Invoking UDB

This chapter describes UDB’s command-line options and arguments.

To pass these arguments to UDB in an integrated development environment, see the section for CLion, Eclipse, Emacs, or GoLand.

Common cases

To start UDB with no program to debug, run the udb program with no arguments.

To start debugging a program, pass it to udb on the command line:

udb PROGRAM

To specify the program together with its command-line arguments, use the --args option:

udb --args PROGRAM ARG1 ARG2 ...

To attach to a running program, use the --pid option:

udb --pid PID

To load an Undo recording, pass it to udb on the command line:

udb RECORDING.UNDO

UDB automatically detects whether the file named on the command line is an Undo recording. Alternatively, use the --load option.

Help options

--help, -h

Print documentation for command-line options and exit.

--version, -v

Print version information and exit.

Program options

--args PROGRAM ARG1 ARG2 ...

Specify the program to debug and its command-line arguments. This must be the last command-line option to udb.

--core CORE, -c CORE

Load the core dump CORE.

--load RECORDING

Load the Undo recording named by RECORDING and start replaying from the beginning.

--load-goto-end RECORDING

Load the Undo recording named by RECORDING and start replaying from the end.

--pid PID, -p PID

Attach the process with id PID.

Mode options

--autorun

After attaching to or launching a program, continue the program automatically. See Autorun mode.

--batch, --batch-silent

Batch mode: udb does not take input from the user, and exits as soon as it has processed all the --command and --eval-command options. Implies --quiet. The --batch-silent option additionally suppresses all standard output from udb.

--defer-recording

Don’t start recording the program until the user enters the urecord command. See Starting UDB with recording disabled.

--quiet, -q, --silent

Don’t print version information at startup. See Quiet startup.

--tty DEVICE

Use DEVICE for standard input and output to the program being debugged.

Symbol options

--symbols SYMBOLS, -s SYMBOLS

Load symbols from SYMBOLS.

Command options

--command FILE, -x FILE

Execute commands from FILE, as if by the source command, after loading the program to debug.

--directory DIRECTORY, -d DIRECTORY

Add DIRECTORY to the list of directories searched by the source command.

--eval-command COMMAND, -ex COMMAND

Execute the UDB command COMMAND, after loading the program to debug.

You can specify multiple --command and --eval-command options. They are executed in the order that they are given on the command line.

--init-command FILE, -ix FILE

Execute commands from FILE, as if by the source command, before loading the program to debug.

--init-eval-command COMMAND, -iex COMMAND

Execute the UDB command COMMAND, before loading the program to debug.

You can specify multiple --init-command and --init-eval-command options. They are executed in the order that they are given on the command line.

-nh

Do not execute commands from the initialization files in your home directory, ~/.udbinit and ~/.gdbinit.

-nx, -n

Do not execute commands from any initialization files.

That is, neither from the system-wide initialization files, nor the initialization files in the current directory, ./.udbinit and ./.gdbinit, nor from the initialization files in your home directory, ~/.udbinit and ~/.gdbinit.

Configuration options

--async-io auto|true|false

The mode for handling asynchronous I/O in the program being debugged. See Debugging programs using asynchronous I/O with UDB.

--checkupdates auto|yes|no|never

Whether udb checks for a newer release at start-up. See Checking for updates.

--event-log-mode circular|straight

Behavior when the event log is full. See Using a straight event log.

--disable-prompt-hints

Disable the showing of hints at the udb prompt. Hints are not printed when run inside an IDE, or when not connected to a terminal (e.g. when being scripted).

--instr-heapsize SIZE[K|M|G]

Size of the translation cache, or 0 to choose a suitable size. See Instrumentation heap size.

--keyfile KEYFILE

Use the license key from KEYFILE. By default, use the file named key in the same directory as udb.

--load-goto-end

After loading an Undo recording using the udb command line, automatically go to the end of execution history. See Going to the end of execution history after loading.

--max-event-log-size SIZE[K|M|G]

Maximum size of the event log, or 0 to choose a suitable size. See Configuring event log size.

--max-snapshots SNAPSHOTS

A hint to udb as to how many snapshots to keep. See Configuring snapshots.

--sessions yes|no|ask

Whether udb restores session state (including bookmarks, breakpoints, and time in recorded history) when loading a recording which has previously been loaded. If the argument is yes (the default), session state is restored; if no, session state is not restored; or if ask, then udb prompts the user when the recording is loaded.

--thread-db FILE|local

The thread debugging library (libthread_db.so) to use. See Selecting the correct thread debugging library.

--tmpdir-root DIRECTORY

The directory used by udb for its temporary files. See Temporary directory root.