# Getting Started with UDB¶

UDB is a reverse debugger created by Undo, which can be used to execute a program, play it forwards and backwards, and analyse its internal state. This is useful for determining the cause of bugs since it is possible to observe all of the program state up to the point of the bug.

## Launching a program in UDB¶

The following command will launch a program in UDB:

udb <path-to-exe>
...UDB starts...
(udb) run <your-arguments>


You can also use the --args parameter to specify the arguments on the command line rather than the debugger prompt:

udb --args <path-to-exe> <your-arguments>
...UDB starts...
(udb) run


## Attaching to an existing process¶

Sometimes it’s not possible or convenient to launch a program in UDB; you can attach to an existing process using:

udb --pid=<pid> <path-to-exe>
...UDB starts...
(udb) continue


It’s important to specify the path to the executable so UDB can find the debug symbols corresponding to the process.

UDB supports the same set of navigation commands as GDB - continue, next, finish etc. UDB also supports reverse equivalents of these commands to allow you to navigate forwards and backwards through your program’s execution:

Forwards Reverse
continue reverse-continue / rc
step reverse-step
next reverse-next / rn
finish reverse-finish / rf
until reverse-until

Use the ugo start or ugo end commands to jump to the beginning or end of your program’s execution history.