Xcode 4. So I can do p something to print a variable. What else I can do?
To exit GDB, use the quit command (abbreviated q ), or type an end-of-file character (usually C-d ). If you do not supply expression , GDB will terminate normally; otherwise it will terminate using the result of expression as the error code.
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.
If specified, the info functions command will list the functions matching the regex. If omitted, the command wil list all functions in all loaded modules (main program and shared libraries).
Because you obviously don't want anything complete but only some pointers, you can
list
: list the lines around current positionlist -
: list lines before thatcont
: continuebreak 'Class::method()'
: set a breakpointrun
: run the program from the startstart
: run and stop in main()kill
: kill the running programfin
: continue until the function returnsup
/down
: go up/down one stack framebt
: get the backtracet a a bt
(thread apply all bt): get a backtrace for all threadsstep
: run until different code line (descending into functions)next
: run until different code line (skipping over functions)commands
: set automatic actions on breakpointsen
/dis
/del
: enable/disable/delete breakpointscatch throw
: enable breaking when an exception is thrownreturn <value>
: force the function to return now and return <value>
set pagination off
: disable --- More --- promptset history save on
set history filename /home/<user>/.gdb_history
(both of those at best in /home/<user>/.gdbinit
)help
: get help about any gdb commandSo far my random collection.
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