Show current assembly instruction in GDB

前端 未结 8 1654
一生所求
一生所求 2020-11-30 15:52

I\'m doing some assembly-level debugging in GDB. Is there a way to get GDB to show me the current assembly instruction in the same way that it shows the current source line?

8条回答
  •  野性不改
    2020-11-30 16:39

    You can do

    display/i $pc
    

    and every time GDB stops, it will display the disassembly of the next instruction.

    GDB-7.0 also supports set disassemble-next-line on, which will disassemble the entire next line, and give you more of the disassembly context.

提交回复
热议问题