Most tricky/useful commands for gdb debugger

Vijay picture Vijay · Sep 24, 2009 · Viewed 38.2k times · Source

Can you post your most tricky and useful commands while you run a debugger like gdb or dbx.

Answer

artagnon picture artagnon · Sep 24, 2009
  1. backtrace full: Complete backtrace with local variables
  2. up, down, frame: Move through frames
  3. watch: Suspend the process when a certain condition is met
  4. set print pretty on: Prints out prettily formatted C source code
  5. set logging on: Log debugging session to show to others for support
  6. set print array on: Pretty array printing
  7. finish: Continue till end of function
  8. enable and disable: Enable/disable breakpoints
  9. tbreak: Break once, and then remove the breakpoint
  10. where: Line number currently being executed
  11. info locals: View all local variables
  12. info args: View all function arguments
  13. list: view source
  14. rbreak: break on function matching regular expression