public inbox for gdb@sourceware.org
 help / color / mirror / Atom feed
From: Roland McGrath <roland@redhat.com>
To: Mark Kettenis <kettenis@jive.nl>
Cc: cagney@gnu.org, gdb@sources.redhat.com
Subject: Re: Identifying bottom-of-stack
Date: Thu, 05 Aug 2004 20:18:00 -0000	[thread overview]
Message-ID: <200408052018.i75KIXAZ023214@magilla.sf.frob.com> (raw)
In-Reply-To: Mark Kettenis's message of  Thursday, 5 August 2004 11:41:23 +0200 <200408050941.i759fNJE010167@juw15.nfra.nl>

> The problem is that a zero frame pointer is an insufficient condition
> to determine the bottom of the stack.  With code generated with
> -fno-frame-pointer, the register that was traditionally used for the
> frame pointer can be used for other purposes, and may very well
> contain zero.

Of course, but if there is no CFI then there is nothing better to do than
assume the frame pointer is a frame pointer and try to use it, no?

> There is.  On amd64 -fno-frame-pointer is the default.

I know that.

> So this effort of not generating CFI and clearing the framepointer is
> pointless.

Clearing the frame pointer is not pointless since the ABI document suggests
doing exactly that.  Avoiding generating CFI is not pointless since it is
better than generating CFI that is incorrect.

Anyway, I didn't ask if these things were pointless, I asked if they were
sufficient.  If gdb doesn't consider a zero frame pointer register in a
frame with no CFI sufficient indication of being the outermost frame, then
that answers the question.  You don't need to justify the choice of gdb's
semantics on this to me, just clarify them to me.

[Andrew says:]
> >    > - GLIBC marking those outermost frames with CFI indicating that both the 
> >    > CFA and the RA are "unknown"?
> 
> s/unknown/undefined/

Perhaps this addresses Mark's request for precision in terminology, but it
doesn't clarify anything for me.  Does this "undefined" mean the
"undefined" used in the DWARF spec?  Does DW_CFA_def_cfa with some register +
DW_CFA_undefined on that register in fact yield this?  Is that the only way
to produce it?  Is it the optimal way?

These are the questions I meant to imply when I asked,
"What would such CFI look like exactly?" 

If you want me to do it, step one is always to specify it completely.


Thanks,
Roland

  parent reply	other threads:[~2004-08-05 20:18 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-08-04 16:01 Andrew Cagney
2004-08-04 17:17 ` Daniel Jacobowitz
2004-08-04 18:12   ` Andrew Cagney
2004-08-04 18:03     ` Daniel Jacobowitz
2004-08-04 18:31       ` Andrew Cagney
2004-08-04 19:02 ` Roland McGrath
2004-08-05  9:42   ` Mark Kettenis
2004-08-05 13:03     ` Andrew Cagney
2004-08-05 20:18     ` Roland McGrath [this message]
2004-08-11 17:51       ` Andrew Cagney

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=200408052018.i75KIXAZ023214@magilla.sf.frob.com \
    --to=roland@redhat.com \
    --cc=cagney@gnu.org \
    --cc=gdb@sources.redhat.com \
    --cc=kettenis@jive.nl \
    /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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).