assembly - Debugging disassembled libraries with gdb -
In Linux and Mac OS X, I can use stepi to debug an application without the ddigging information.
On Mac OS X GDB, those tasks are displayed which are said inside the library, although sometimes every step instruction has to move several assembler instructions.
On Linux, when I have lost a dynamic library GDB, for example (puts) with (), there are three assembler instructions, once GDB reaches a 0x080482bf, then this message Fails with "a function is not a program counter for selected frames".
0x080482ba @ PLT () (GDB) puts the assembler code dump for the disassembled function @plt: 0x080482b4 < Puts @ plt + 0>: jmp * 0x8049580 0x080482ba & lt; Puts @platt + 6> Push $ 0x10 0x080482bf & lt; Puts @platt + 11>: jmp 0x8048284 & lt; _init + 48 & gt; End of Seamler dump (GDB) puts into stepi 0x080482bf @ plt () (gdb) stepi 0x08048284 ?? () (GDB) separation A function does not count to programmed frames for selected frames.
Do you know how to debug this library call with GDB.
If no debug has been debug to debug GDB, then memory addresses to debug GDB Will not be able to determine the category. To work around this, you can cross the line in the decimble
command, for example:
(gdb) p $ pc $ 4 = (zero ( *) ()) 0x70c72d & lt; _IO_puts + 29> (GDB) 0x70c72d 0x70c740 Displays 0x70c72d to 0x70c740: 0x0070c72d and lift; _IO_puts + 29>: mov% eax, (% esp) 0x0070c730 & lt; _IO_puts + 32 & gt;: 0x721f10 Call & lt; Strlen & gt; 0x0070c735 & lt; _IO_puts + 37 & gt; Mov 0x84c (% ebx),% edx 0x0070c73b & lt; _IO_puts + 43>: cmpw $ 0x0, (% adx) 0x0070c73f & lt; _IO_puts + 47>: mov% edx, -0x10 (% ebp) End of seamless dump
There may be a way to establish debug symbols. On my Ubuntu system, I have installed the libc6-dbg
package, which allows me to go into the function in the standard library.
Comments
Post a Comment