Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ➜ wbench gcc func.c -o func -g -mpreferred-stack-boundary=12
- ➜ wbench gdb -q func
- Reading symbols from func...done.
- (gdb) set disassembly-flavor intel
- (gdb) disas main
- Dump of assembler code for function main:
- 0x0000000000400514 <+0>: push rbp
- 0x0000000000400515 <+1>: mov rbp,rsp
- 0x0000000000400518 <+4>: sub rsp,0x1000
- 0x000000000040051f <+11>: mov DWORD PTR [rbp-0x8],0x41
- 0x0000000000400526 <+18>: mov DWORD PTR [rbp-0x4],0x2
- 0x000000000040052d <+25>: mov eax,DWORD PTR [rbp-0x4]
- 0x0000000000400530 <+28>: mov edi,eax
- 0x0000000000400532 <+30>: call 0x4004ed <function>
- 0x0000000000400537 <+35>: mov DWORD PTR [rbp-0x4],eax
- 0x000000000040053a <+38>: mov eax,DWORD PTR [rbp-0x4]
- 0x000000000040053d <+41>: leave
- 0x000000000040053e <+42>: ret
- End of assembler dump.
- (gdb) disas function
- Dump of assembler code for function function:
- 0x00000000004004ed <+0>: push rbp
- 0x00000000004004ee <+1>: mov rbp,rsp
- 0x00000000004004f1 <+4>: sub rsp,0xf8c
- 0x00000000004004f8 <+11>: mov DWORD PTR [rbp-0x1004],edi
- 0x00000000004004fe <+17>: mov DWORD PTR [rbp-0x4],0x42
- 0x0000000000400505 <+24>: add DWORD PTR [rbp-0x1004],0x1
- 0x000000000040050c <+31>: mov eax,DWORD PTR [rbp-0x1004]
- 0x0000000000400512 <+37>: leave
- 0x0000000000400513 <+38>: ret
- End of assembler dump.
- (gdb)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement