Switching to assembly in gdb

后端 未结 5 774
予麋鹿
予麋鹿 2020-12-08 06:35

Is there is any way to switch to assembly when debugging a C or C++ program in gdb ? (Given that all source files and their corresponding assembly files are available)

5条回答
  •  北海茫月
    2020-12-08 07:17

    There is a way to disassemble a function or a certain section of code, is that what you are after?

    The command to do so would be disassemble or a memory location.

    Is this what you are referring to?

    (gdb) help disassemble
    Disassemble a specified section of memory.
    Default is the function surrounding the pc of the selected frame.
    With a single argument, the function surrounding that address is dumped.
    Two arguments are taken as a range of memory to dump.
    

提交回复
热议问题