From: Daniel Jacobowitz <drow@false.org>
To: Jim Blandy <jimb@red-bean.com>
Cc: gdb@sourceware.org
Subject: Re: Prologue analysis interface
Date: Wed, 23 Nov 2005 06:18:00 -0000 [thread overview]
Message-ID: <20051123051741.GA5341@nevyn.them.org> (raw)
In-Reply-To: <8f2776cb0511221909i2fe80536oed9a1617700515ae@mail.gmail.com>
On Tue, Nov 22, 2005 at 07:09:44PM -0800, Jim Blandy wrote:
> On 11/22/05, Daniel Jacobowitz <drow@false.org> wrote:
> > One thing that jumped out at me in the m32c analyzer. You record
> > pushes of registers as frame related, and you record spills of argument
> > registers using "mov" as frame related.
>
> You mean "not frame related" right? Yes, it does undermine the
> general principle. I don't really see why stores of original values
> to the stack would be any worse.
Eh, no, I mean frame related:
if (m32c_is_arg_spill (&st, dest, src_value))
after_last_frame_related_insn = st.next_addr;
> > The question in my mind is whether the target-independently-describable
> > tweaks we need for this are good for all targets. And as unlikely as
> > it may seem, I think it's true. For instance, S/390 has a bit to use
> > only the stack slot with the highest address if it sees multiple saves.
> > We could easily enough handle that in the target-dependent part in the
> > model I described above, but we don't have to (with an appropriate
> > check for the direction of the stack). It's probably good just about
> > everywhere.
>
> I see how the m32c and the S/390 could both be accomodated by a single
> piece of code. But I think there's something to watch out for here.
> We don't want the generic prologue analyzer driver to become a
> somewhat complex piece of code with a lot of little behaviors
> carefully chosen to make things work nicely on particular targets ---
> exactly what you're suggesting. Think about (if I'm remembering
> correctly) monitor_fetch_register. It's a generic function, meant to
> be shared amongst all sorts of monitors, that does a decent job
> groveling through the output of a ROM monitor's "show me the
> registers" commands and finding the actual values. When it works,
> it's great, but when it isn't working right for your monitor, you just
> have to custom-code your own register parser. You can't change the
> generic function's behavior in the slightest, because you don't know
> what behaviors all the other monitors (which you can't test) are
> depending on. Which puts you in the ridiculous situation of not being
> able to change monitor_fetch_register even if *nobody* wants the
> current behavior --- because you can't discover that that's the case.
> It's an ossified function. It will never change. That's not the end
> of the world --- you just copy it, install it as a custom function in
> the monitor_ops structure, and go on your way. But you lose the
> benefits you'd like to get from common code.
Point taken. But please take another look at what I've suggested - in
the end, I ended up leaving almost all of the likely-fiddly-bits to the
target.
My message was a bit confusing to read, since that's not where I
_wanted_ to end up.
> > Both the S/390 and m32c use heuristics to terminate the frame chain.
> > I agree that these are necessary, but I've also come to see a bit of
> > the counterargument that they're in the wrong place. I think what we
> > need may be an additional method for frames to say "this same unwinder
> > thinks the stack is finished here". Pathological examples: calling
> > thread_start() or an optimized noreturn function from gdb.
>
> Why is it better to have a separate method than to have 'this_id'
> leave the id unchanged?
My thinking was: because !frame_id_p (get_frame_id (next_frame)) means
"there can be no frames after me" and "frame_should_unwind_past
(next_frame)" means "it looks like I've come to the end of the stack,
here, I don't know how to go on". Maybe someone else does, e.g. to
find a dummy frame. But really the value of this seems minimal. I
just keep coming back to the nagging feeling that the way we find the
last frame is just not right.
--
Daniel Jacobowitz
CodeSourcery, LLC
next prev parent reply other threads:[~2005-11-23 5:17 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-11-22 19:30 Jim Blandy
2005-11-22 19:44 ` Daniel Jacobowitz
2005-11-23 0:20 ` Jim Blandy
2005-11-23 2:14 ` Daniel Jacobowitz
2005-11-23 2:52 ` Joel Brobecker
2005-11-23 3:52 ` Jim Blandy
2005-11-23 16:56 ` Ulrich Weigand
2005-11-23 18:37 ` Joel Brobecker
2005-11-24 6:21 ` Jim Blandy
2005-11-24 10:21 ` Jim Blandy
2005-11-24 17:18 ` Ulrich Weigand
2005-11-25 3:06 ` Jim Blandy
2005-11-23 3:14 ` Jim Blandy
2005-11-23 6:18 ` Daniel Jacobowitz [this message]
2005-11-23 14:54 ` Ulrich Weigand
2006-01-27 17:11 ` Daniel Jacobowitz
2006-01-27 18:25 ` Jim Blandy
2006-01-28 13:40 ` Jim Blandy
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=20051123051741.GA5341@nevyn.them.org \
--to=drow@false.org \
--cc=gdb@sourceware.org \
--cc=jimb@red-bean.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