From: Mark Kettenis <kettenis@gnu.org>
To: drow@false.org
Cc: gdb@sources.redhat.com
Subject: Re: [RFC] Is skip_prologue_using_sal actually usable?
Date: Tue, 09 Nov 2004 14:35:00 -0000 [thread overview]
Message-ID: <200411091353.iA9DrKjH090730@elgar.sibelius.xs4all.nl> (raw)
In-Reply-To: <20041109024314.GA1997@nevyn.them.org> (message from Daniel Jacobowitz on Mon, 8 Nov 2004 21:43:14 -0500)
Date: Mon, 8 Nov 2004 21:43:14 -0500
From: Daniel Jacobowitz <drow@false.org>
If you want the first instruction that is not part of the prologue,
then you have no more reason to skip prologues at all. My
understanding is that prologue skipping accomplishes two things:
B? - Get the arguments into their save slots so that we can find
and display them.
A? - Get the frame pointer into a sane state so we can backtrace.
Well, we've taken care of (A) already - the new frame code requires
being able to backtrace from the first instruction of a function,
and we do it. (I think we fall down more often in the epilogue than we
do in the prologue now.)
Assuming the second point is (A) and the first one is (B):
There are still problems here on some badly maintained archs, but in
general this should be OK. We currently make no effort on getting
things right for the epilogue.
What we need is a coherent approach to (B). Future versions of GCC
will make this much easier, by emitting location lists. But for
existing code, and non-dwarf2 targets, I think we could do better than
we do now. Here's a possible approach.
We'd need a gdbarch method describing where incoming arguments were
placed. This could be unified with the function calling code -
cleanest might be to implement a proper "location" data type and then
have the code return a list of locations to either store the parameters
or fetch them depending on context. Then, we'd need a modified sort of
prologue analyzer that told us whether the incoming location for a
particular parameter was likely still valid, or whether the
debug-info-provided location had been initialized. With enough
architecture-independent support code, instead of cramming it all into
the backend, I think this would not be terribly complicated either.
Then, when we arrive at a function - from the very first instruction -
we can display arguments correctly. The user doesn't have to worry
about the copy.
How does that sound? Pipe dream?
Although it sounds plausible I think it's something we should revisit
when GDB actually supports "locations" properly.
In the mean time, we really should strive for some consistency in
where we put function breakpoints. What do you think about my
statement that too early is better than to late?
Mark
next prev parent reply other threads:[~2004-11-09 13:55 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-11-07 14:28 Mark Kettenis
2004-11-09 2:43 ` Randolph Chung
2004-11-09 10:16 ` Daniel Jacobowitz
2004-11-09 14:35 ` Mark Kettenis [this message]
2004-11-09 14:51 ` Daniel Jacobowitz
2004-11-09 14:56 ` Andrew Cagney
2004-11-09 16:07 ` Mark Kettenis
2004-11-09 16:55 ` 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=200411091353.iA9DrKjH090730@elgar.sibelius.xs4all.nl \
--to=kettenis@gnu.org \
--cc=drow@false.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