From: Jim Blandy <jimb@red-bean.com>
To: gdb@sourceware.org
Subject: Re: Prologue analysis interface
Date: Wed, 23 Nov 2005 03:14:00 -0000 [thread overview]
Message-ID: <8f2776cb0511221909i2fe80536oed9a1617700515ae@mail.gmail.com> (raw)
In-Reply-To: <20051123020455.GA2247@nevyn.them.org>
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.
> 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.
> 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?
> So, for now, how about that? Just provide something along the lines of
> the tramp-frame interface that does the busywork. We can adjust later
> what is busywork and what isn't.
Having voiced my misgivings above, I'll give it a shot.
next prev parent reply other threads:[~2005-11-23 3:09 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 [this message]
2005-11-23 6:18 ` Daniel Jacobowitz
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=8f2776cb0511221909i2fe80536oed9a1617700515ae@mail.gmail.com \
--to=jimb@red-bean.com \
--cc=gdb@sourceware.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