17.2. Command-Line Syntax

 < Day Day Up > 

GDB is invoked as follows:

     gdb [options] [executable [corefile-or-PID]]     gdb [options] --args executable [program args ...]

The gdbtui command is equivalent to gdb --tui; it invokes GDB with the Text User Interface. The TUI is described in the later section "The GDB Text User Interface."

GDB has both traditional short options and GNU-style long options. Long options may start with either one or two hyphens. The command-line options are as follows.


--args

Pass on arguments after executable to the program being debugged.


--async, --noasync

Enable/disable the asynchronous version of the command-line interface.


-b baudrate, --baud baudrate

Set the serial port baud rate used for remote debugging.


--batch

Process options and then exit.


--cd dir

Change current directory to dir.


-c file, --core file

Analyze the core dump file.


-d dir, --directory dir

Search for source files in dir.


-e file, --exec file

Use file as the executable.


-f, --fullname

Output information used by the Emacs-GDB interface.


--help

Print a usage and option summary and then exit.


--interpreter interp

Select a specific interpreter/user interface. The command-line interface is the default, although there are other interfaces for use by frontend programs.


-n, --nx

Do not read the .gdbinit file.


-nw, --nowindows

Force the use of the command-line interface, even if a windows interface is available.


-p pidnum, -c pidnum, --pid pidnum

Attach to running process pidnum.


-q, --quiet, --silent

Do not print the version number on startup.


-r, --readnow

Fully read symbol files on first access.


-s file, --symbols file

Read symbols from file.


--se file

Use file for both the symbol file and the executable file.


--statistics

Print statistics about CPU time and memory usage after each command finishes.


-t device, --tty device

Use device for input/output by the program being debugged.


--tui

Use the Terminal User Interface (TUI).


-x file, --command file

Execute GDB commands from file.


--version

Print version information and then exit.


-w, --windows

Force the use of a window interface if there is one.


--write

Allow writing into the executable and core files.

     < Day Day Up > 


    Unix in a Nutshell
    Unix in a Nutshell, Fourth Edition
    ISBN: 0596100299
    EAN: 2147483647
    Year: 2005
    Pages: 201

    flylib.com © 2008-2017.
    If you may any questions please contact us: flylib@qtcs.net