This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
Re: [patch/rfa] Fix some corner cases in hppa stack unwinding
- From: "John David Anglin" <dave at hiauly1 dot hia dot nrc dot ca>
- To: gdb-patches at gcc dot gnu dot org
- Cc: randolph at tausq dot org
- Date: Tue, 8 Jun 2004 11:46:43 -0400 (EDT)
- Subject: Re: [patch/rfa] Fix some corner cases in hppa stack unwinding
> p.s. it's probably possible to come up with a tricky test case where the
> unwinder will still break:
>
> frame 0: sets/saves frame pointer, start unwinding after fp is set but
> before it is saved
> frame 1 .. n-1: does not set/save frame pointer
> frame n: requires frame pointer to unwind properly (e.g. calls alloca())
> frame n+1 ...
>
> in this case frame n will not unwind properly because we cannot retrieve
> the correct fp from the stack (the one that has not yet been saved).
Under HP-UX when a frame pointer is needed, GCC 3.3 and later saves
the previous stack pointer (frame pointer) in the frame marker at
sp - (TARGET_64BIT ? -8 : -4). This value is copied in dynamic stack
allocations. Thus, you should be able to obtain the frame pointer
for frame 'n' from the frame marker. You just need the address of
frame n-1 to access the frame marker of frame n.
This could also be done under linux if it is useful.
Dave
--
J. David Anglin dave.anglin@nrc-cnrc.gc.ca
National Research Council of Canada (613) 990-0752 (FAX: 952-6602)