Linux GDB command of (b)

gdb command:

  1. Prerequisite: The executable file must contain debugging information gcc -g
  2. gdb file name - start gdb debugger
  3. View Code command
      current file:
        List line number (function name)
      the specified file:
        List the file name: line number (function name)
  4. Set breakpoints
      current file:
        b line number (function name)
      the specified file:
        b File name: line number (function name)
      set conditional breakpoints:
        b line number if value == 23
      View breakpoint information:
        info b
      remove breakpoints
        d breakpoint number
  5. Start Debugging
      perform only one line of code: start
         continue to stop at the breakpoint: continue - c
      stops directly at the breakpoint: run - r
  6. Stepping
      into the body of the function: step - s
        out of the function body: finish (if the loop at the breakpoint, a breakpoint needs to be deleted)
      does not enter the body of the function: next - n
  7. Tracking variable
      automatic printing variable information: display variable name

  Cancellation variable track: undisplay Number
     Gets Number: info display
  manually print variable values: print - p

  Acquisition variable corresponding type: ptype

    1. Out of the loop: u
    2. Quit gdb: quit

Guess you like

Origin www.cnblogs.com/wanghao-boke/p/11297508.html