If I compile a source like this, (with Clang, Mac OS X)
int main()
{
int a = 4;
int* b = &a;
int c = *b;
return 6;
}
compiled object file will be disassembled like this. (with otool
, Mac OS X)
main.o:
(__TEXT,__text) section
_main:
0000000000000000 pushq %rbp
0000000000000001 movq %rsp,%rbp
0000000000000004 movl $0x00000006,%eax
0000000000000009 leaq 0xf8(%rbp),%rcx
000000000000000d movl $_main,0xfc(%rbp)
0000000000000014 movl $0x00000004,0xf8(%rbp)
000000000000001b movq %rcx,0xf0(%rbp)
000000000000001f movq 0xf0(%rbp),%rcx
0000000000000023 movl (%rcx),%edx
0000000000000025 movl %edx,0xec(%rbp)
0000000000000028 popq %rbp
0000000000000029 ret
Is it possible to see local variable symbol name in disassembly? Just like debugger does. If possible, how can I do that?