5

Stepping through function objects with the debugger can be very confusing if I need to go through a std::function call.

Is it somehow possible to skip these frames?

ildjarn
  • 62,044
  • 9
  • 127
  • 211
StackedCrooked
  • 34,653
  • 44
  • 154
  • 278
  • You mean like a "step over" command? – John Dibling Jun 08 '12 at 21:04
  • @JohnDibling Yes, some sort of implicit "step over". – StackedCrooked Jun 08 '12 at 22:19
  • You could set a breakpoint in the function that would be called, and then use continue. – jxh Jun 09 '12 at 01:49
  • Possible duplicate of [How can I jump into a function held inside std::function in GDB while skipping all the internal implementation?](https://stackoverflow.com/questions/52442745/how-can-i-jump-into-a-function-held-inside-stdfunction-in-gdb-while-skipping-a) – Justin Aug 02 '19 at 18:50
  • I voted the duplicate in this direction, because of the guidance at https://meta.stackoverflow.com/a/252017/1896169 . The duplicate direction could go the other way. – Justin Aug 02 '19 at 18:51

1 Answers1

3

gdb 7.4 added the skip family of commands for this.

(gdb) apropos skip
info skip -- Display the status of skips
set step-mode -- Set mode of the step operation
show step-mode -- Show mode of the step operation
skip -- Ignore a function while stepping
skip delete -- Delete skip entries
skip disable -- Disable skip entries
skip enable -- Enable skip entries
skip file -- Ignore a file while stepping
skip function -- Ignore a function while stepping
matt
  • 5,364
  • 1
  • 25
  • 25