Conditions under which stepping into shared library should work in gdb?

前端 未结 3 961
甜味超标
甜味超标 2021-01-01 22:49

There are many questions related to specific errors why stepping into a shared library with gdb isn\'t working. None of them provide a systematic answer on how to confirm wh

3条回答
  •  盖世英雄少女心
    2021-01-01 23:32

    Your problem is self-imposed: don't do this: set step-mode on, and step will work as you expect.

    From the GDB manual:

    set step-mode
    set step-mode on
    The set step-mode on command causes the step command to stop at the first
    instruction of a function which contains no debug line information
    rather than stepping over it.
    
    This is useful in cases where you may be interested in inspecting the machine
    instructions of a function which has no symbolic info and do not want
    GDB to automatically skip over this function.
    

    You are interested in the opposite of the above -- you want to step into the print_from_lib function and avoid stopping inside the PLT jump stub and the dynamic loader's symbol resolution function.

提交回复
热议问题