Show current assembly instruction in GDB

前端 未结 8 1615
一生所求
一生所求 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:56

    If you want the next few instructions to display automatically while stepping through the program you can use the display command as follows -

    display /3i $pc

    The above will display 3 instructions whenever a breakpoint is hit or when you single step the program.

    More details at the blog entry here.

    0 讨论(0)
  • 2020-11-30 16:57

    From within gdb press Ctrl x 2 and the screen will split into 3 parts.

    First part will show you the normal code in high level language.

    Second will show you the assembly equivalent and corresponding instruction Pointer.

    Third will present you the normal gdb prompt to enter commands.

    See the screen shot

    0 讨论(0)
提交回复
热议问题