tags:

views:

37

answers:

1

I know I can use jump to set the program counter to a specific line and so I can skip one ore more lines (or execute some lines again). Can I easily just skip the next line without having to enter line numbers?

This would be very convenient to "comment out" something at run time.

+3  A: 
jump +1

jumps to the next line line i.e. skipping the current line. You may also want to combine it with tbreak +1 to set a temporary breakpoint at the jump target.

See http://sourceware.org/gdb/current/onlinedocs/gdb/Specify-Location.html for more ways of expressing locations with gdb.

laalto
Pretty obvious, but thanks! Works great in Xcode using breakpoints with Debugger Command.
Ortwin Gentz