Mirror of the gdb mailing list
 help / color / mirror / Atom feed
From: Roland McGrath <roland@redhat.com>
To: Jan Kratochvil <jan.kratochvil@redhat.com>
Cc: gcc@gcc.gnu.org, libc-alpha@sources.redhat.com,
		gdb@sourceware.org, Jakub Jelinek <jakub@redhat.com>,
		Richard Henderson <rth@redhat.com>
Subject: Re: Unwinding CFI gcc practice of assumed `same value' regs
Date: Mon, 11 Dec 2006 22:40:00 -0000	[thread overview]
Message-ID: <20061211224022.AD76E1800E7@magilla.sf.frob.com> (raw)
In-Reply-To: Jan Kratochvil's message of  Monday, 11 December 2006 20:03:00 +0100 <20061211190300.GA4372@host0.dyn.jankratochvil.net>

GCC's unwinder doesn't distinguish undefined from same_value, because it
doesn't matter for EH unwinding purposes.  Both mean "nothing to be done
for this register".  The distinction only matters to informative unwinding
purposes like debugging.  I'm not sure why libgcc's unwinder really ought
to care.  It's not that I'm against it knowing the difference; that
certainly seems a cleaner way for it to be internally.  But as to the idea
that it needs to distinguish them for correctness, and thus other things
need to rely on having a libgcc_s version that does, and so forth, I don't
see the motivation.  

In the ideal world, things would use cfi_undefined on the pc regno to
indicate the base frame, as the dwarf3 spec says to.  I certainly think it
would be cleanest for everything to do that.  But again, in practice on
i386 and x86_64, I'm not sure I see the need.  Correct unwind info should
always restore the caller's bp register value.  When that unwinds to the
outermost frame, that will be a zero value as the runtime code of base
frames sets it.  

My reading is that the "ABI authoring body" for GNU systems or the
"compilation system authoring body" for GNU compilers already specifies
that the default rule is same_value for callee-saves registers (as chosen
by each particular ABI), even if this has not been formally documented
anywhere heretofore.  (This is how I've written ABI support in another
unwinder implementation I've worked on.)  As you've said, this is the only
reading by which current CFI is correct and complete for getting the values
of callee-saves registers.  I presume that GCC's omission of rules for
those registers is in fact simply because EH unwinding doesn't care and
people on the generation side just didn't think about it beyond that.
Regardless of the true reasons for the history, the description above
applies to the manifest practice that constitutes what we want the formal
specification to mean.


Thanks,
Roland


  reply	other threads:[~2006-12-11 22:40 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-12-11 19:03 Jan Kratochvil
2006-12-11 22:40 ` Roland McGrath [this message]
2006-12-12 15:54   ` Jakub Jelinek
2006-12-12 13:55 ` Andrew Haley
2006-12-12 14:55   ` Mark Kettenis
2006-12-12 15:04     ` Andrew Haley
2006-12-12 15:21       ` Ulrich Drepper
2006-12-12 15:26         ` Andrew Haley
2006-12-12 15:39           ` Ulrich Drepper
2006-12-13 18:11             ` Michael Matz
2006-12-12 15:50           ` Jan Kratochvil
2006-12-12 16:19           ` Jakub Jelinek
2006-12-12 16:55       ` Ian Lance Taylor
2006-12-12 17:06         ` Andrew Haley
2006-12-12 17:34           ` Mark Kettenis
2006-12-13 18:02           ` Michael Matz
2006-12-13 18:10 ` Michael Matz

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=20061211224022.AD76E1800E7@magilla.sf.frob.com \
    --to=roland@redhat.com \
    --cc=gcc@gcc.gnu.org \
    --cc=gdb@sourceware.org \
    --cc=jakub@redhat.com \
    --cc=jan.kratochvil@redhat.com \
    --cc=libc-alpha@sources.redhat.com \
    --cc=rth@redhat.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