Follow the build instructions for gdb instead of C

Possible duplicate:
Going to build in gdb

I am debugging some code in gdb. When I run the ni command (for the next command ), it displays the C code. Displaying the completed assembly instructions will make more sense to me.

 (gdb) ni 0x0804845a 28 tmp = *lpp; (gdb) ni 0x0804845c 28 tmp = *lpp; (gdb) ni 0x0804846a 29 **lpp = (unsigned long) &buf; (gdb) ni 0x0804846c 29 **lpp = (unsigned long) &buf; 

Is there a way to make gdb display the assembly code instead without calling disassm every time?

EDIT: I know about the layout asm command, which displays the code in a readline window. I would like to see disassembly on the gdb command line, not in the gdb window.

+6
source share
2 answers

When you go through ni , displaying a few useful build commands is often very useful.

 (gdb) display/4i $pc 

will show the next 4 commands every time GDB stops.

+11
source

Have you tried using the TUI ASM layout?

It is quite convenient.

 (gdb) layout asm 
+6
source

Source: https://habr.com/ru/post/918236/


All Articles