Mirror of the gdb mailing list
 help / color / mirror / Atom feed
From: Paul Koning <Paul_Koning@dell.com>
To: mark.kettenis@xs4all.nl
Cc: drow@false.org,     gcc@sources.redhat.com,
	    sposelenov@emcraft.com,     gdb@sources.redhat.com
Subject: Re: Problem reading corefiles on ARM
Date: Wed, 06 Aug 2008 16:02:00 -0000	[thread overview]
Message-ID: <18585.51522.726379.18666@gargle.gargle.HOWL> (raw)
In-Reply-To: <200808061542.m76FgmUv017348@brahms.sibelius.xs4all.nl>

>>>>> "Mark" == Mark Kettenis <mark.kettenis@xs4all.nl> writes:

 >> 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.

 Mark> GCC should really not do this.  People are almost guaranteed to
 Mark> want to be able to see a backtrace from abort(3).

Absolutely.

 Mark> I suppose it optimizes away the instructions to save the return
 Mark> address, because abort() is marked with
 Mark> __attribute__(noreturn).  But that means there is very little
 Mark> point in actually doing that optimization since
 Mark> __attribute__(noreturn) implies that the function will only be
 Mark> called once!  I suppose there are some space savings but are
 Mark> they really significant?

I think the space savings in "noreturn" come from not having to save
caller-saved registers in the calling function.  That savings can add
up if the noreturn function is called from many places.

Clearly the return address needs to be saved in the case of functions
like "abort".  Come to think of it, probably all the usual registers
should be saved, so you can examine variables in the function that
called abort and not get nonsense.

It sounds to me like the "noreturn" attribute should be removed from
"abort".

     paul


  parent reply	other threads:[~2008-08-06 16:02 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-08-06 15:20 Sergei Poselenov
2008-08-06 15:28 ` Daniel Jacobowitz
2008-08-06 15:45   ` Mark Kettenis
2008-08-06 15:51     ` Daniel Jacobowitz
2008-08-06 16:02     ` Paul Koning [this message]
2008-08-06 17:10       ` Joe Buck
2008-08-06 17:39         ` Paul Koning
2008-08-06 17:52           ` Joe Buck
2008-08-06 18:11             ` Paul Koning
2008-08-06 21:39               ` Andreas Schwab
2008-08-06 21:58                 ` Joe Buck
2008-08-07 13:30                   ` Paul Koning
2008-08-07 16:56                     ` Joe Buck
2008-08-07 17:29                       ` Paul Koning
2008-08-07  9:30   ` Sergei Poselenov
2008-08-07 13:44     ` Daniel Jacobowitz

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=18585.51522.726379.18666@gargle.gargle.HOWL \
    --to=paul_koning@dell.com \
    --cc=drow@false.org \
    --cc=gcc@sources.redhat.com \
    --cc=gdb@sources.redhat.com \
    --cc=mark.kettenis@xs4all.nl \
    --cc=sposelenov@emcraft.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox