# CLion¶

CLion is a C/C++ IDE from JetBrains, available from the JetBrains website.

Undo supplies a plugin which integrates UndoDB into CLion, allowing you to interactively debug the application you’re currently developing from within the CLion IDE. Alternatively, you can load and analyse recordings of programs that use Undo’s Live Recorder technology, helping you to debug exact copies of your program’s execution.

## Known issues¶

There are a number of known issues with the plugin that you should be aware of prior to use. These are listed below.

1. UndoDB requires you to agree to a set of license terms before using it. It is not currently possible to agree to these terms through the CLion plugin. As a workaround until this issue is resolved, you must start UndoDB from the Linux command line (by running ‘udb’) and follow the instructions to accept the license.
2. (For Live Recorder users) Loading Undo Recordings is only possible once a normal debugging session has started. To load a recording, start a debugging session in the usual manner, then follow the instructions on loading a recording in the documentation below.

## Enabling UndoDB within CLion¶

1. Configure CLion to use UndoDB.

Choose File -> Settings… -> Build, Execution, Deployment -> Toolchains

Select Use specified GDB:

Enter the location of udb in the text box (the button to the right can be used to navigate the file tree). When CLion recognises the pathname, a message will appear, eg “GDB version: GNU gdb (GDB) 8.1”.

2. Install the plugin.

Choose File -> Settings… -> Plugins

Click Install plugin from disk… and navigate to your UndoDB installation. Select undo-clion.jar as the name of the plugin.

You should now see UndoDB reversible debugger extensions in the list of plugins. Restart CLion to enable the plugin.

## Using UndoDB within CLion¶

Starting a debug session works exactly as normal with CLion. However the debugger toolbars have some new buttons.

On the left toolbar, the Resume button is followed by a Reverse Resume button, which executes backwards from the current point until a breakpoint or watchpoint is hit, or execution is interrupted.

On the top toolbar, there are new Reverse Step Into, Reverse Step Out and Reverse Step Over buttons.

Also on the top toolbar is the Load Recording button.

If you are familiar with other UndoDB commands, they can be entered at the GDB console.