When I am debugging a program in Xcode, I can pause execution in there debugger console. Is there any way to do this using gdb from the command line?
I'd like to do this so I can modify breakpoints after the program has started.
To stop your program while it is running, type "(ctrl) + c" (hold down the ctrl key and press c). gdb will stop your program at whatever line it has just executed. From here you can examine variables and move through your program.
To skip a breakpoint a certain number of times, we use the ignore command. The ignore command takes two arguments: the breakpoint number to skip, and the number of times to skip it. (gdb) ignore 2 5 Will ignore next 5 crossings of breakpoint 2.
In the Query Editor window, right-click the breakpoint, and then click Delete Breakpoint. In the Breakpoints window, right-click the breakpoint, and then click Delete on the shortcut menu. In the Breakpoints window, select the breakpoint, and then press DELETE.
You can just press Ctrl+C and will be able to do what you ask, although it might not always work (see comments below).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With