当我在gdb中使用disassemble命令时,我得到了当前函数中每条指令的反汇编,如下所示:
40057c: mov edi,0x400747
400581: mov eax,0x0
400586: call 0x400440 <printf@plt>
40058b: mov esi,0x10
400590: mov edi,0x40075d
400595: mov eax,0x0
40059a: call 0x400440 <printf@plt>
40059f: movabs rax,0x400921fb54442d18
4005a9: mov QWORD PTR [rbp-0x8],rax
4005ad: call 0x400544 <InlineDebugTest()>
4005b2: movsd xmm0,QWORD PTR [rbp-0x8]
当我在QtCreator 3.0中查看反汇编时(通过选择Debug-&gt;按指令操作或右键单击寄存器窗口中的EIP并选择Open Disassembler at),我发现'call'指令都被省略了,如下图所示:
40057c: mov edi,0x400747
400581: mov eax,0x0
12 printf("kFooBar == %u\n", kFooBar);
40058b: mov esi,0x10
400590: mov edi,0x40075d
400595: mov eax,0x0
14 double pi = 3.14159265358979323;
40059f: movabs rax,0x400921fb54442d18
4005a9: mov QWORD PTR [rbp-0x8],rax
16 InlineDebugTest();
4005b2: movsd xmm0,QWORD PTR [rbp-0x8]
我还发现在长函数中QtCreator经常无法显示函数的开头 - 省略了数百个字节的反汇编。这是一个已知的问题吗?是否故意忽略“呼叫”指令?