(gdb) b m.c
:26 Breakpoint
1 at 0x4004d4
: file m.c, line
26.
(gdb) b func
Breakpoint
2 at 0x4004ac
: file m.c, line
17.
(gdb) b func2
Breakpoint
3 at 0x40047e
: file m.c, line
8.
(gdb)
然后我们在第一个断点处停下,反汇编当前的main函数,查看参数传递方式,如下所示:
(gdb) disassemble
/m main
Dump of assembler code
for function main
: 25 {
0x00000000004004cc
<+0>: push
%rbp
0x00000000004004cd
<+1>: mov
%rsp,
%rbp
0x00000000004004d0
<+4>: sub $0x10,
%rsp