How can I jump to a frame in a stack trace according to the function name in gdb?

后端 未结 2 495
闹比i
闹比i 2021-02-07 01:28

I\'m debugging a stack overflow due to infinite recursion. The program fails when the stack is 700 calls deep.

I want to jump to the frame in which the function was in

2条回答
  •  -上瘾入骨i
    2021-02-07 02:05

    You have to use bt with minus. It is similar to bt, but print first the outermost n frames.
    For example:
    bt -100

    And it is likely you will see the frame that you need to inspect on the first or second screen.
    Once insecting the stack trace using bt -100 helped me to fix a pboblem with a lot of recursive calls easily.

    And then issue command
    f

提交回复
热议问题