GDB

Description

GDB, the GNU Project debugger, allows you to see what is going on `inside’ another program while it executes — or what another program was doing at the moment it crashed.

Usage

Syntax

    gdb [options] [executable-file [core-file or process-id]]
gdb [options] –args executable-file [inferior-arguments …]

Options

Selection of debuggee and its files:

  --args                Arguments after executable-file are passed to inferior
  --core=COREFILE       Analyze the core dump COREFILE.
  --exec=EXECFILE       Use EXECFILE as the executable.
  --pid=PID             Attach to running process PID.
  --directory=DIR       Search for source files in DIR.
  --se=FILE             Use FILE as symbol file and executable file.
  --symbols=SYMFILE     Read symbols from SYMFILE.
  --readnow             Fully read symbol files on first access.
  --write               Set writing into executable and core files.

Initial commands and command files:

  --command=FILE, -x           Execute GDB commands from FILE.
  --init-command=FILE,-ix      Like -x but execute commands before loading inferior.
  --eval-command=COMMAND, -ex  Execute a single GDB command.May be used multiple times and in conjunction with --command.
  --init-eval-command=COMMAND,-iex  Like -ex but before loading inferior.
  --nh                         Do not read ~/.gdbinit.
  --nx                         Do not read any .gdbinit files in any directory.

Output and user interface control:

  --fullname           Output information used by emacs-GDB interface.
  --interpreter=INTERP Select a specific interpreter / user interface
  --tty=TTY            Use TTY for input/output by the program being debugged.
  -w                   Use the GUI interface.
  --nw                 Do not use the GUI interface.
  --tui                Use a terminal user interface.
  --dbx                DBX compatibility mode.
  --xdb                XDB compatibility mode.
  --quiet              Do not print version number on startup.

Operating modes:

  --batch               Exit after processing options.
  --batch-silent        Like --batch, but suppress all gdb stdout output.
  --return-child-result GDB exit code will be the child's exit code.
  --configuration       Print details about GDB configuration and then exit.
  --help                Print this message and then exit.
  --version             Print version information and then exit.

Remote debugging options:

  -b BAUDRATE        Set serial port baud rate used for remote debugging.
  -l TIMEOUT         Set timeout in seconds for remote debugging.

Other options:

  --cd=DIR           Change current directory to DIR.

Example

[email protected]cyborg:~$ gdb -readnow '/home/cyborg/Downloads/flashback-0.18.1-ps2elf/FLASHBCK.ELF' 
GNU gdb (Ubuntu 7.7.1-0ubuntu5~14.04.2) 7.7.1
Copyright (C) 2014 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from /home/cyborg/Downloads/flashback-0.18.1-ps2elf/FLASHBCK.ELF...expanding to full symbols...done.
(gdb) apropos catch
catch -- Set catchpoints to catch events
catch assert -- Catch failed Ada assertions
catch catch -- Catch an exception
catch exception -- Catch Ada exceptions
catch exec -- Catch calls to exec
catch fork -- Catch calls to fork
catch load -- Catch loads of shared libraries
catch rethrow -- Catch an exception
catch signal -- Catch signals by their names and/or numbers
catch syscall -- Catch system calls by their names and/or numbers
catch throw -- Catch an exception
catch unload -- Catch unloads of shared libraries
catch vfork -- Catch calls to vfork
function _streq -- $_streq - check string equality
save breakpoints -- Save current breakpoint definitions as a script
tcatch -- Set temporary catchpoints to catch events
tcatch assert -- Catch failed Ada assertions
tcatch catch -- Catch an exception
tcatch exception -- Catch Ada exceptions
tcatch exec -- Catch calls to exec
tcatch fork -- Catch calls to fork
tcatch load -- Catch loads of shared libraries
tcatch rethrow -- Catch an exception
---Type <return> to continue, or q <return> to quit---

0 Comments

Leave a reply

CONTACT US

We're are building as a community and a team. Be a part of it.

Sending

©2017 Ztrela Knowledge Solutions Pvt. Ltd

Log in with your credentials

Forgot your details?