Usage: objdump <option(s)> <file(s)>
Display information from object <file(s)>.
At least one of the following switches must be given:
-a, --archive-headers Display archive header information
-f, --file-headers Display the contents of the overall file header
-p, --private-headers Display object format specific file header contents
-h, --[section-]headers Display the contents of the section headers
-x, --all-headers Display the contents of all headers
-d, --disassemble Display assembler contents of executable sections
-D, --disassemble-all Display assembler contents of all sections
-S, --source Intermix source code with disassembly
-s, --full-contents Display the full contents of all sections requested
-g, --debugging Display debug information in object file
-e, --debugging-tags Display debug information using ctags style
-G, --stabs Display (in raw form) any STABS info in the file
-W[lLiaprmfFsoR] or
--dwarf[=rawline,=decodedline,=info,=abbrev,=pubnames,=aranges,=macro,=frames,=str,=loc,=Ranges]
Display DWARF info in the file
-t, --syms Display the contents of the symbol table(s)
-T, --dynamic-syms Display the contents of the dynamic symbol table
-r, --reloc Display the relocation entries in the file
-R, --dynamic-reloc Display the dynamic relocation entries in the file
@<file> Read options from <file>
-v, --version Display this program's version number
-i, --info List object formats and architectures supported
-H, --help Display this information
set step-mode on
gdb
file c.out
b 15
r
layout asm
然后进行了以下si动作,得出:
0x0000000000400760 in dlopen@plt ()
(gdb) si
0x0000000000400766 in dlopen@plt ()
(gdb) si
0x000000000040076b in dlopen@plt ()
(gdb) si
0x00000000004006d0 in ?? ()
(gdb) si
0x00000000004006d6 in ?? ()
(gdb)
这些信息怎么看啊????
set step-mode on
打开step-mode模式。在进行单步跟踪时,程序不会因为没有debug信息而不停住。这个参数有很利于查看机器码。
还有一个命令(disassemble)可以查看源程序的当前执行时的机器码,这个命令会把目前内存中的指令dump出来。如下面的示例表示查看函数func的汇编代码:
在反汇编窗口中单步执行下条汇编指令。[/quote]
类似些:
(gdb) si
si
0x0000000000400766 in dlopen@plt ()
(gdb) si
si
0x000000000040076b in dlopen@plt ()
(gdb) si
si
0x00000000004006d0 in ?? ()
(gdb)
这也看不明白啊。
void *imglib = dlopen("./libLGM.so", RTLD_LAZY);//第三方提供的动态链接库
一到调用第三方库的时候就提示以下:
Breakpoint 1 at 0x4008af: file c.c, line 9.
(gdb) r
Starting program: /home/pcd/workspace/myjava/jni/c
Breakpoint 1, main (argc=1, argv=0x7fffffffe1a8) at c.c:13
(gdb) s
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
Cannot find new threads: generic error
(gdb)
void *imglib = dlopen("./libLGM.so", RTLD_LAZY);//第三方提供的动态链接库
一到调用第三方库的时候就提示以下:
Breakpoint 1 at 0x4008af: file c.c, line 9.
(gdb) r
Starting program: /home/pcd/workspace/myjava/jni/c
Breakpoint 1, main (argc=1, argv=0x7fffffffe1a8) at c.c:13
(gdb) s
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
Cannot find new threads: generic error
(gdb)