From: Daniel Jacobowitz <drow@false.org>
To: gdb@sources.redhat.com
Cc: cagney@gnu.org
Subject: [mips] When to use a proc_desc
Date: Thu, 25 Mar 2004 06:26:00 -0000 [thread overview]
Message-ID: <20040325040322.GA12885@nevyn.them.org> (raw)
find_proc_desc has this bit of dead code in it - next_frame is never NULL:
/* IF this is the topmost frame AND
* (this proc does not have debugging information OR
* the PC is in the procedure prologue)
* THEN create a "heuristic" proc_desc (by analyzing
* the actual code) to replace the "official" proc_desc.
*/
if (next_frame == NULL)
{
This used to work (and was necessary). Nowadays, the equivalent check would
be:
frame_relative_level (next_frame) < 0
and if you really wanted to capture the intent of the original check, you'd
also need:
get_frame_type (next_frame) != NORMAL_FRAME
Obviously, as we just discussed with my other patch, the point is to avoid
this grubbing up the chain. But proc_desc's have no way to verify that
things have already been saved, so we just lose out right now. This
corresponds to several failures in the testsuite on MIPS GNU/Linux (along
with a couple of related problems, which have less objectionable solutions).
Basically, if the current frame has not been running long enough to save all
its registers, the proc_desc can lead us easily down an unwinding rathole;
it's inherently unreliable because it has no prologue end marker. How can
we handle this?
Eventually I want to turn on DWARF-2 unwinding support in GDB, at which
point we may not want to support GAS's .pdr at all (even if we have to
continue supporting it for some other MIPS target). But in the meantime I'd
like to fix the regressions in it.
BTW, even in_prologue is not a good enough check, with optimized code. I
have several testcases where registers are not saved until "after" the
prologue. But the checks in mips32_decode_reg_save are [generally] good
enough for this. So that's a recent improvement over the previous code.
--
Daniel Jacobowitz
MontaVista Software Debian GNU/Linux Developer
next reply other threads:[~2004-03-25 4:03 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-03-25 6:26 Daniel Jacobowitz [this message]
2004-03-25 16:22 ` Andrew Cagney
2004-04-06 21:56 ` Andrew Cagney
2004-04-06 21:58 ` Daniel Jacobowitz
2004-04-06 23:34 ` Mark Kettenis
2004-04-07 4:48 ` 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=20040325040322.GA12885@nevyn.them.org \
--to=drow@false.org \
--cc=cagney@gnu.org \
--cc=gdb@sources.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