这里的不同是因为gcc 在生成dwarf2调试信息的时候 最后给了一个错误的寄存器号码 我记得去年讨论过这个问题 而且已经在gcc中修正了
但是我现在用了下我的gcc好像amd64是没问题的 但是i386是错的 所以希望英雄们帮我测下 多谢
*/
struct ty { int a; int b;};
struct ty
cool ()
{
struct ty c;
return c;
}
int
main()
{
struct ty d;
d = cool ();
return 0;
}
(gdb) start
Temporary breakpoint 1 at 0x8048374: file 7.c, line 15.
Starting program: /home/eric/temp/a.out
[Thread debugging using libthread_db enabled]
Temporary breakpoint 1, main () at 7.c:15
15 d = cool ();
(gdb) s
cool () at 7.c:8
8 return c;
(gdb) s
9 }
(gdb) set disassemble-next-line on
(gdb) si
0x0804836a 9 }
0x0804836a <cool+22>: c9 leave
0x0804836b <cool+23>: c2 04 00 ret $0x4
(gdb) bt
#0 0x0804836a in cool () at 7.c:9
#1 0x0804837f in main () at 7.c:15
(gdb) si
0x0804836b 9 }
0x0804836b <cool+23>: c2 04 00 ret $0x4
(gdb) bt
#0 0x0804836b in cool () at 7.c:9
#1 0x0804837f in main () at 7.c:15
> --
> 您收到此邮件是因为您订阅了 Google 网上论坛的"HelloGcc Workshop"论坛。
> 要向此网上论坛发帖,请发送电子邮件至 hell...@googlegroups.com。
> 要取消订阅此网上论坛,请发送电子邮件至 hellogcc+u...@googlegroups.com。
> 若有更多问题,请通过 http://groups.google.com/group/hellogcc?hl=zh-CN 访问此网上论坛。
>
>
2010/6/7 Eric Fisher <joefo...@gmail.com>: