This is the mail archive of the
gdb@sourceware.org
mailing list for the GDB project.
Re: Problem reading corefiles on ARM
- From: Mark Kettenis <mark dot kettenis at xs4all dot nl>
- To: drow at false dot org, gcc at sources dot redhat dot com
- Cc: sposelenov at emcraft dot com, gdb at sources dot redhat dot com
- Date: Wed, 6 Aug 2008 17:42:48 +0200 (CEST)
- Subject: Re: Problem reading corefiles on ARM
- References: <4899C0FE.4010008@emcraft.com> <20080806152736.GA31492@caradoc.them.org>
> Date: Wed, 6 Aug 2008 11:27:36 -0400
> From: Daniel Jacobowitz <drow@false.org>
>
> On Wed, Aug 06, 2008 at 07:19:26PM +0400, Sergei Poselenov wrote:
> > (gdb) bt
> > #0 0x4004ec0c in raise () from /lib/libc.so.6
> > #1 0x40050234 in abort () from /lib/libc.so.6
> > Backtrace stopped: frame did not save the PC
>
> Your implementation of abort does not save a return address, so GDB
> can't display it. I believe tehis is a known limitation of the ARM
> GCC port.
GCC should really not do this. People are almost guaranteed to want
to be able to see a backtrace from abort(3).
I suppose it optimizes away the instructions to save the return
address, because abort() is marked with __attribute__(noreturn). But
that means there is very little point in actually doing that
optimization since __attribute__(noreturn) implies that the function
will only be called once! I suppose there are some space savings but
are they really significant?