Starting the Debugger from a Command Line

When you invoke the debugger from a command line you can bring a program or core file under debugger control, or you can attach to a running process.

The following is the command line syntax to invoke the debugger using the idb command:

idb [dbx_options ] [ executable_file [ core_file ] ]

 

Note that the set of recognized options depends on the mode. For example, -V option is valid in DBX mode, but not in GDB mode.

dbx_options:

[ -c file ]

[ -cd directory ]

[ -command file ]

[ -dbx ]

[ -echo ]

[ -emacs ]

[ -fullname ]

[ -gdb [ gdb_options ] ]

[ -gui ]

[ -help ]

[ - i file ]

[ -I dir ]

[ -interactive ]

[ -maxruntime minutes ]

[ -nosharedobjs ]

[ -parallel launcher launcher_args ]

[ -pid process_id ]

[ -prompt string ]

[ -quiet ]

[ -tty terminal_device ]

[ -V ]

[ -version ]

gdb_options:

: -cd dir

| -command file

| -d[irectory] dir

| -f[ullname]

| -gdb [ gdb_options ]

| -help

| -interpreter name

| -nowindows

| -nw

| -p[id] pid

| -q[uiet]

| -silent

| -tty device

| -version

| -ui name

 

DBX mode refers to the debugger's command input mode that is "dbx like" in its command syntax. It is not fully dbx compatible.

Note:

Options can be prefixed by a dash (-) or double dash (--) . Option names may be abbreviated as long as the abbreviations are unambiguous. An option and its argument are separated with one or more spaces or equal sign (=).

For example, to invoke the debugger on an executable file named a.out:

% idb a.out

 

To invoke the Debugger on a core file:

 

% idb a.out core

 

To invoke the debugger and attach to a running process when you do not know what file it is executing:

% idb -pid 8492