From: Joel Brobecker <brobecker@adacore.com>
To: gdb-patches@sources.redhat.com
Cc: randolph@tausq.org
Subject: [hppa] FYI: confusion in unwind descriptor field meaning
Date: Wed, 09 Nov 2005 23:55:00 -0000 [thread overview]
Message-ID: <20051109203108.GX1635@adacore.com> (raw)
Hello,
This is really for anybody's FYI, and maybe Randolph if he'd like to
dig in some of the issues with me.
This is something I'm still working on, so I haven't verified my theory
just yet. But I think there is a confusion in the meaning of Save_SP
in the unwind descriptor. The document I have says:
18. Save_SP (bit 27): One if the entry value of SP is saved by this
regions entry sequence in the current frame marker (current_SP - 4);
zero otherwise.
It doesn't say that the frame has a frame base register. For this, we
have another field:
25. Large_frame_r3 (bit 34): One if gr3 is changed during the entry
sequence to contain the address of the base of the (new) frame.
So I think the following test is wrong:
/* Handle code with and without frame pointers. */
if (u->Save_SP)
cache->saved_regs[reg].addr = offset;
else
cache->saved_regs[reg].addr = (u->Total_frame_size << 3) + offset;
I think it should read something like:
if (u->Large_frame)
or something like this. Or perhaps we should check the base register
and if it is r3, then only use the offset. Not sure yet.
The problem I'm really working on is not affected by the above, it's
more about finding out that the function, although the Alloca flag is
not set, has a variable-size frame. I need to use the Large_frame flag
to determine that we have a frame base, and therfore use r3 as the frame
base if the previous_SP has been saved there.
Generally speaking, there have been fixing a large number of issues our
customers have helped us find out. For instance, we have found code
pieces where the unwind record shows a discontinuous region: No entry
point. So the address start of the region does not point at the function
start and hence no prologue, with the consequences you can imagine when
we scan that region looking for prologue instructions...
Unfortunately, I'm unable to contribute either the examples provided
by the customer (they often come in the form of a gigantic executable
along with a core file, no source), nor the fix, because the compiler
we use made some tweaks to the unwind data so that the HP unwinder is
able to unwind through GCC code as well as HP code (I understand GCC
made some small deviations from the ABI, or used to make maybe).
--
Joel
next reply other threads:[~2005-11-09 20:31 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-11-09 23:55 Joel Brobecker [this message]
2005-11-10 1:27 ` Randolph Chung
2005-11-10 1:31 ` Joel Brobecker
2005-11-10 1:32 ` Randolph Chung
2005-11-10 19:18 ` Randolph Chung
2005-11-11 11:22 ` Joel Brobecker
2005-11-12 3:32 ` Randolph Chung
2005-11-12 4:22 ` Jim Blandy
2005-11-12 4:39 ` Jim Blandy
2005-11-12 4:59 ` Randolph Chung
2005-11-12 5:07 ` Jim Blandy
2005-11-12 13:21 ` Randolph Chung
2005-11-12 17:08 ` Jim Blandy
2005-11-13 15:38 ` Randolph Chung
2005-11-13 18:27 ` Daniel Jacobowitz
2005-11-19 19:15 ` Randolph Chung
2005-11-13 18:23 ` Joel Brobecker
2005-11-13 18:28 ` Daniel Jacobowitz
2005-11-13 18:36 ` Joel Brobecker
2005-11-13 18:45 ` 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=20051109203108.GX1635@adacore.com \
--to=brobecker@adacore.com \
--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