4 ms·
Have not used gdb for a while but I think a good gdb tip is that you can evaluate functions with the print p command: > p myfunction()
by havkom 5y ago
Have not used gdb for a while but I think a good gdb tip is that you can evaluate functions with the print p command:
> p myfunction()
- mark_undoio 5y agoGetting more advanced, you can generally do this anywhere GDB will accept a value. Which means you can do things like: > break my_file.c:123 if my_function() == 0x5 i.e. please stop at `my_file.c` line 123 but when `my_function()` is returning the value 0x5. GDB will handle calling the function and checking its value every time you get there.