This is the mail archive of the
gdb-prs@sources.redhat.com
mailing list for the GDB project.
Re: backtrace/1435: backtrace fails to mention main function in Linux/gcc/C
- From: bjacob at ca dot metsci dot com
- To: kettenis at gnu dot org
- Cc: gdb-prs at sources dot redhat dot com,
- Date: 6 Nov 2003 00:08:00 -0000
- Subject: Re: backtrace/1435: backtrace fails to mention main function in Linux/gcc/C
- Reply-to: bjacob at ca dot metsci dot com
The following reply was made to PR backtrace/1435; it has been noted by GNATS.
From: bjacob@ca.metsci.com
To: gdb-gnats@sources.redhat.com, kettenis@gnu.org,
gdb-prs@sources.redhat.com
Cc:
Subject: Re: backtrace/1435: backtrace fails to mention main function in Linux/gcc/C
Date: Wed, 5 Nov 2003 16:01:30 -0800
http://sources.redhat.com/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gdb&pr=1435
> I can't immediately tell what's wrong. Can you provide me with the
> output of "info frame" for those frames and the ouput of "disas f" and
> "disas __assert_fail"?
(gdb) where
#0 0x42029331 in kill () from /lib/i686/libc.so.6
#1 0x4202911a in raise () from /lib/i686/libc.so.6
#2 0x4202a8c2 in abort () from /lib/i686/libc.so.6
#3 0x42022ecb in __assert_fail () from /lib/i686/libc.so.6
#4 0x0804839a in f () at t.c:4
(gdb) info frame
Stack level 0, frame at 0xbffff3c0:
eip = 0x42029331 in kill; saved eip 0x4202911a
called by frame at 0xbffff3e0
Arglist at 0xbffff3b8, args:
Locals at 0xbffff3b8, Previous frame's sp is 0xbffff3c0
Saved registers:
eip at 0xbffff3bc
(gdb) up
#1 0x4202911a in raise () from /lib/i686/libc.so.6
(gdb) info frame
Stack level 1, frame at 0xbffff3e0:
eip = 0x4202911a in raise; saved eip 0x4202a8c2
called by frame at 0xbffff510, caller of frame at 0xbffff3c0
Arglist at 0xbffff3d8, args:
Locals at 0xbffff3d8, Previous frame's sp is 0xbffff3e0
Saved registers:
ebx at 0xbffff3d4, ebp at 0xbffff3d8, eip at 0xbffff3dc
(gdb) up
#2 0x4202a8c2 in abort () from /lib/i686/libc.so.6
(gdb) info frame
Stack level 2, frame at 0xbffff510:
eip = 0x4202a8c2 in abort; saved eip 0x42022ecb
called by frame at 0xbffff530, caller of frame at 0xbffff3e0
Arglist at 0xbffff508, args:
Locals at 0xbffff508, Previous frame's sp is 0xbffff510
Saved registers:
ebx at 0xbffff504, ebp at 0xbffff508, eip at 0xbffff50c
(gdb) up
#3 0x42022ecb in __assert_fail () from /lib/i686/libc.so.6
(gdb) info frame
Stack level 3, frame at 0xbffff530:
eip = 0x42022ecb in __assert_fail; saved eip 0x804839a
called by frame at 0xbffff550, caller of frame at 0xbffff510
Arglist at 0xbffff528, args:
Locals at 0xbffff528, Previous frame's sp is 0xbffff530
Saved registers:
ebx at 0xbffff520, ebp at 0xbffff528, esi at 0xbffff524, eip at 0xbffff52c
(gdb) up
#4 0x0804839a in f () at t.c:4
4 assert(0);
(gdb) info frame
Stack level 4, frame at 0xbffff550:
eip = 0x804839a in f (t.c:4); saved eip 0x80483c8
caller of frame at 0xbffff530
source language c.
Arglist at 0xbffff548, args:
Locals at 0xbffff548, Previous frame's sp is 0xbffff550
Saved registers:
ebx at 0xbffff520, ebp at 0xbffff548, esi at 0xbffff524, eip at 0xbffff54c
(gdb) up
Initial frame selected; you cannot go up.
(gdb) disas f
Dump of assembler code for function f:
0x08048370 <f+0>: push %ebp
0x08048371 <f+1>: mov %esp,%ebp
0x08048373 <f+3>: sub $0x18,%esp
0x08048376 <f+6>: movl $0x8048428,0xc(%esp,1)
0x0804837e <f+14>: movl $0x4,0x8(%esp,1)
0x08048386 <f+22>: movl $0x804842a,0x4(%esp,1)
0x0804838e <f+30>: movl $0x804842e,(%esp,1)
0x08048395 <f+37>: call 0x8048280
End of assembler dump.
(gdb) disas __assert_fail
Dump of assembler code for function __assert_fail:
0x42022de4 <__assert_fail+0>: push %ebp
0x42022de5 <__assert_fail+1>: mov %esp,%ebp
0x42022de7 <__assert_fail+3>: push %esi
0x42022de8 <__assert_fail+4>: push %ebx
0x42022de9 <__assert_fail+5>: sub $0x1c,%esp
0x42022dec <__assert_fail+8>: call 0x42022de0 <free_mem+64>
0x42022df1 <__assert_fail+13>: add $0x10d51b,%ebx
0x42022df7 <__assert_fail+19>: mov 0x8(%ebp),%ecx
0x42022dfa <__assert_fail+22>: lea 0xffff6fd3(%ebx),%esi
0x42022e00 <__assert_fail+28>: mov 0x14(%ebp),%edx
0x42022e03 <__assert_fail+31>: push %ecx
0x42022e04 <__assert_fail+32>: lea 0xffff8b5d(%ebx),%ecx
0x42022e0a <__assert_fail+38>: test %edx,%edx
0x42022e0c <__assert_fail+40>: cmove %esi,%edx
0x42022e0f <__assert_fail+43>: mov %ecx,%eax
0x42022e11 <__assert_fail+45>: cmove %esi,%eax
0x42022e14 <__assert_fail+48>: push %eax
0x42022e15 <__assert_fail+49>: mov 0xc(%ebp),%eax
0x42022e18 <__assert_fail+52>: push %edx
0x42022e19 <__assert_fail+53>: mov 0x10(%ebp),%edx
0x42022e1c <__assert_fail+56>: push %edx
0x42022e1d <__assert_fail+57>: push %eax
0x42022e1e <__assert_fail+58>: mov 0x778(%ebx),%eax
0x42022e24 <__assert_fail+64>: mov (%eax),%eax
0x42022e26 <__assert_fail+66>: cmpb $0x0,(%eax)
0x42022e29 <__assert_fail+69>: cmove %esi,%ecx
0x42022e2c <__assert_fail+72>: push %ecx
0x42022e2d <__assert_fail+73>: push %eax
0x42022e2e <__assert_fail+74>: lea 0xffff9314(%ebx),%eax
0x42022e34 <__assert_fail+80>: sub $0xc,%esp
0x42022e37 <__assert_fail+83>: push $0x5
0x42022e39 <__assert_fail+85>: push %eax
0x42022e3a <__assert_fail+86>: lea 0xffff2570(%ebx),%eax
0x42022e40 <__assert_fail+92>: push %eax
0x42022e41 <__assert_fail+93>: call 0x42023974 <dcgettext>
0x42022e46 <__assert_fail+98>: add $0x18,%esp
0x42022e49 <__assert_fail+101>: push %eax
0x42022e4a <__assert_fail+102>: lea 0xfffffff4(%ebp),%eax
0x42022e4d <__assert_fail+105>: push %eax
0x42022e4e <__assert_fail+106>: call 0x420160bc
0x42022e53 <__assert_fail+111>: add $0x30,%esp
0x42022e56 <__assert_fail+114>: test %eax,%eax
0x42022e58 <__assert_fail+116>: js 0x42022eb0 <__assert_fail+204>
0x42022e5a <__assert_fail+118>: mov 0x7c4(%ebx),%eax
0x42022e60 <__assert_fail+124>: mov (%eax),%edx
0x42022e62 <__assert_fail+126>: mov 0x5c(%edx),%ecx
0x42022e65 <__assert_fail+129>: test %ecx,%ecx
0x42022e67 <__assert_fail+131>: jle 0x42022ea0 <__assert_fail+188>
0x42022e69 <__assert_fail+133>: mov 0xfffffff4(%ebp),%eax
0x42022e6c <__assert_fail+136>: sub $0x4,%esp
0x42022e6f <__assert_fail+139>: push %eax
0x42022e70 <__assert_fail+140>: lea 0xffffafbc(%ebx),%eax
0x42022e76 <__assert_fail+146>: push %eax
0x42022e77 <__assert_fail+147>: push %edx
0x42022e78 <__assert_fail+148>: call 0x4206f0c4 <fwprintf>
0x42022e7d <__assert_fail+153>: add $0x10,%esp
0x42022e80 <__assert_fail+156>: mov 0x7c4(%ebx),%eax
0x42022e86 <__assert_fail+162>: sub $0xc,%esp
0x42022e89 <__assert_fail+165>: mov (%eax),%ecx
0x42022e8b <__assert_fail+167>: push %ecx
0x42022e8c <__assert_fail+168>: call 0x4206b874 <fflush>
0x42022e91 <__assert_fail+173>: mov 0xfffffff4(%ebp),%eax
0x42022e94 <__assert_fail+176>: pop %edx
0x42022e95 <__assert_fail+177>: push %eax
0x42022e96 <__assert_fail+178>: call 0x4201739c
0x42022e9b <__assert_fail+183>: jmp 0x42022ec3 <__assert_fail+223>
0x42022e9d <__assert_fail+185>: lea 0x0(%esi),%esi
0x42022ea0 <__assert_fail+188>: mov 0xfffffff4(%ebp),%esi
0x42022ea3 <__assert_fail+191>: sub $0x8,%esp
0x42022ea6 <__assert_fail+194>: push %edx
0x42022ea7 <__assert_fail+195>: push %esi
0x42022ea8 <__assert_fail+196>: call 0x420171fc
0x42022ead <__assert_fail+201>: jmp 0x42022e7d <__assert_fail+153>
0x42022eaf <__assert_fail+203>: nop
0x42022eb0 <__assert_fail+204>: sub $0x4,%esp
0x42022eb3 <__assert_fail+207>: lea 0xffff7194(%ebx),%eax
0x42022eb9 <__assert_fail+213>: push $0x12
0x42022ebb <__assert_fail+215>: push %eax
0x42022ebc <__assert_fail+216>: push $0x2
0x42022ebe <__assert_fail+218>: call 0x4201718c
0x42022ec3 <__assert_fail+223>: add $0x10,%esp
0x42022ec6 <__assert_fail+226>: call 0x420162ec
0x42022ecb <__assert_fail+231>: nop
0x42022ecc <__assert_fail+232>: lea 0x0(%esi,1),%esi
0x42022ed0 <__assert_fail+236>: mov (%esp,1),%ebx
0x42022ed3 <__assert_fail+239>: ret
End of assembler dump.
(gdb)