From: "John David Anglin" <dave@hiauly1.hia.nrc.ca>
To: randolph@tausq.org
Cc: gdb-patches@sources.redhat.com, cagney@gnu.org
Subject: Re: [patch/rfa/hppa] Use frame pointer for unwinding
Date: Mon, 17 May 2004 17:54:00 -0000 [thread overview]
Message-ID: <200405171754.i4HHs5Tc006398@hiauly1.hia.nrc.ca> (raw)
In-Reply-To: <20040517172821.GX566@tausq.org>
> ok, feature request? ;-) as noted below this is not really required for
> gdb to work correctly; i'm just wondering if the same Save_SP scheme
> works for both hp compiler and gcc. In some other email you had
> indicated that the hp compiler doesn't set the Save_SP flag (or did
> i misunderstand you?)....
It's my understanding that none of the HP compilers set the Save_SP
flag. This is why the flag was selected. Originally, it indicated
that a frame pointer was needed for the frame. Now, we also save
the entry value of SP in the current frame marker (current_SP - 4)
when a frame pointer is needed and TARGET_HPUX_UNWIND_LIBRARY is
true.
> > Note that the the previous SP (frame pointer) is saved in the frame
> > marker of frame 1. This value is accessible from frame 2 (i.e.,
> > effectively the frame pointer is always saved under hpux when Save_SP
> > is true -- it's just done by the caller). However, I think gdb
> > should avoid using the saved SP value in the frame marker as not
> > all versions of GCC support this. It's also not supported under
> > linux.
>
> right now gdb uses the value of the frame pointer that is stored at the
> start of the frame; that is, for "normal frames", it looks for a
> specific code sequence:
>
> stw,ma rN, xxx(sp)
>
> in the code, and if it sees this, it notes that a frame pointer has
> been stored at offset 0 of the stack. During unwinding, it finds out
> if the current frame should have saved the fp (by looking at the Save_SP
> flag) and if so it retrieves it from the stack.
A stw,ma r3, xxx(sp) instruction in the entry sequence is unique to
GCC (32-bit runtime). If you find this, Save_SP should also be set
as it is part of the sequence to save %r3 and copy the stack pointer
to %r3 in a frame which needs a frame pointer..
Dave
--
J. David Anglin dave.anglin@nrc-cnrc.gc.ca
National Research Council of Canada (613) 990-0752 (FAX: 952-6602)
next prev parent reply other threads:[~2004-05-17 17:54 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-05-17 17:14 John David Anglin
2004-05-17 17:28 ` Randolph Chung
2004-05-17 17:54 ` John David Anglin [this message]
-- strict thread matches above, loose matches on Subject: below --
2004-05-17 16:13 John David Anglin
2004-05-16 2:07 Randolph Chung
2004-05-16 10:36 ` Mark Kettenis
2004-05-16 15:36 ` Randolph Chung
2004-05-16 16:22 ` Mark Kettenis
2004-05-16 16:42 ` Randolph Chung
2004-05-16 16:32 ` Andrew Cagney
2004-05-16 17:03 ` Randolph Chung
2004-05-17 0:13 ` Randolph Chung
2004-05-17 2:34 ` Randolph Chung
2004-05-17 15:23 ` Andrew Cagney
2004-05-17 16:01 ` Randolph Chung
2004-05-17 17:27 ` Andrew Cagney
2004-05-17 15:13 ` 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=200405171754.i4HHs5Tc006398@hiauly1.hia.nrc.ca \
--to=dave@hiauly1.hia.nrc.ca \
--cc=cagney@gnu.org \
--cc=gdb-patches@sources.redhat.com \
--cc=randolph@tausq.org \
/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