GDB The GNU DeBugger - PowerPoint PPT Presentation

1 / 2
About This Presentation
Title:

GDB The GNU DeBugger

Description:

core file Crashed program's core dump. You must compile with -g for debug information! ... set name expr Set a variable to expr jump where Resume ... – PowerPoint PPT presentation

Number of Views:307
Avg rating:3.0/5.0
Slides: 3
Provided by: ashutos
Category:
Tags: debugger | gdb | gnu | compile

less

Transcript and Presenter's Notes

Title: GDB The GNU DeBugger


1
GDB - The GNU DeBugger
  • To run gdb (a text-based debugger)
  • gdb ltprogram filegt ltcore filegt
  • ltprogram filegt Executable program file
  • ltcore filegt Crashed programs core dump
  • You must compile with -g for debug information!
  • Within gdb
  • Running gdb
  • run ltargsgt Run program with arguments ltargsgt
  • quit Quit the gdb debugger
  • help lttopicgt Access gdbs internal help
  • Examining program state
  • info localsargs Prints out info on local
    variablesargs
  • backtraceltngt Prints the top ltngt frames on the
    stack
  • print ltexprgt Print out ltexprgt

2
GDB continued
  • Controlling program flow
  • step Step one line, entering called functions
  • next Step one line, skipping called functions
  • finish Finish the current function and print the
    return value
  • Controlling program flow with breakpoints
  • continue Continue execution (after a stop)
  • breakltwheregt Set a breakpoint
  • delete ltnumsgt Deletes breakpoints by number
  • rwatch ltexprgt Sets a watchpoint, which will
    break when ltexprgt is written to or read
  • Modifying program state
  • set ltnamegt ltexprgt Set a variable to ltexprgt
  • jump ltwheregt Resume program execution at ltwheregt
Write a Comment
User Comments (0)
About PowerShow.com