Show current assembly instruction in GDB

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

    Setting the following option:

    set  disassemble-next-line on
    show disassemble-next-line
    

    Will give you results that look like this:

    (gdb) stepi
    0x000002ce in ResetISR () at startup_gcc.c:245
    245 {
       0x000002cc : 80 b5   push    {r7, lr}
    => 0x000002ce : 82 b0   sub sp, #8
       0x000002d0 : 00 af   add r7, sp, #0
    (gdb) stepi
    0x000002d0  245 {
       0x000002cc : 80 b5   push    {r7, lr}
       0x000002ce : 82 b0   sub sp, #8
    => 0x000002d0 : 00 af   add r7, sp, #0
    

提交回复
热议问题