To set up UndoDB within Emacs, follow the steps below:
- Make sure undodb-gdb is in your path.
- M-x gdb, press enter.
- You will see a prompt that looks something like this: Run gdb (like this): gdb -i=mi.
- Modify the prompt so that it points to undodb: Run gdb (like this): undodb-gdb -i=mi.
- You can now use UndoDB as you usually would.
There is a possibility that when you try this, you will see an error message stating that non-stop mode is not supported. UndoDB doesn’t currently support non-stop mode, so the solution is to use all-stop mode. This can be done by following these steps:
- M-x customize, press enter.
- Navigate through the groups. Programming -> Tools -> Gdb -> Gdb Non Stop.
- Expand the gdb Non Stop Setting item. This should be turned on by default. Press toggle, to turn it off.
- Press C-x C-s to save these settings.
- Restart emacs.
To set up UndoDB within DDD, follow the steps below:
- Start the ddd executable with the --debugger parameter. For example: ddd --debugger “./undodb-gdb”.
- There is no support for reversible buttons in DDD, but you can still type all the normal undodb commands into the ‘GDB console’ section of the ddd window.
To set up UndoDB within Eclipse, follow the steps below:
- Open up Eclipse.
- Go to the run menu and select debug configurations.
- From the debugger tab, change the gdb debugger from gdb to undodb-gdb to enable reversible debugging.
- Tick the enable reverse debugging at startup box.
- Apply those changes.
To enable reversible debugging in the GUI:
- Right click on the tool bar and select customise perspective from the window menu.
- Choose the command groups availability tab and select reverse debugging.