on Linux and Mac OS X I can use stepi and nexti to debug an application without debugging information.
Mac OS X gdb displays the functions that are called inside the library, although sometimes there are several assembler instructions in each stepi instruction.
On Linux, when I enter the dynamic library, gdb is lost. For example, with puts () there are three assembler commands inside puts (), when gdb reaches the jump at 0x080482bf, it fails with the message "No function contains program counter for the selected frame".
0x080482ba in puts@plt () (gdb) disassemble Dump of assembler code for function puts@plt: 0x080482b4 <puts@plt+0>: jmp *0x8049580 0x080482ba <puts@plt+6>: push $0x10 0x080482bf <puts@plt+11>: jmp 0x8048284 <_init+48> End of assembler dump. (gdb) stepi 0x080482bf in puts@plt () (gdb) stepi 0x08048284 in ?? () (gdb) disassemble No function contains program counter for selected frame.
You know how to debug these library calls with gdb.
assembly x86 disassembly gdb
Freeman Oct 18 '09 at 16:24 2009-10-18 16:24
source share