From: Andrew Cagney <ac131313@redhat.com>
To: Mark Kettenis <kettenis@chello.nl>
Cc: gdb-patches@sources.redhat.com
Subject: Re: [PATCH/i386newframe/RFC] DWARF CFI frame unwinder
Date: Mon, 05 May 2003 14:24:00 -0000 [thread overview]
Message-ID: <3EB6742C.6070409@redhat.com> (raw)
In-Reply-To: <200305051348.h45DmHC1009293@elgar.kettenis.dyndns.org>
> Date: Sun, 04 May 2003 23:35:27 -0400
> From: Andrew Cagney <ac131313@redhat.com>
>
> Mark, fyi,
>
> > + case REG_SAVED_REG:
> > + *optimizedp = 0;
> > + *lvalp = lval_register;
> > + *addrp = 0;
> > + *realnump = DWARF2_REG_TO_REGNUM (cache->reg[regnum].loc.reg);
> > + if (valuep)
> > + {
> > + /* Read the value from the register. */
> > + frame_unwind_register (next_frame, *realnump, valuep);
> > + }
> > + break;
> > +
>
> Set *addrp to the register offset hack (Otherwize something mysterious
> fails. What? I don't remember).
>
> Yes, findvar.c:value_of_register() and findvar.c:value_from_register()
> use this. Worse, our whole value subsystem seems to rely on this.
> Ughh, that's really gross. We should do something about that!
[tell me about it :-)]
> Anyway. Thinking about it a bit more, I suspect the whole handling of
> REG_SAVED_REG is wrong. Instead, we should just change the register
> number according to the DWARF CFI rule and let the unwinder for
> NEXT_FRAME handle the request:
>
> case REG_SAVED_REG:
> regnum = DWARF2_REG_TO_REGNUM (cache->reg[regnum].loc.reg);
> /* FALLTHROUGH */
Please, anything but a fallthrough :-)
> case REG_UNMODIFIED:
> frame_register_unwind (next_frame, regnum,
> optimizedp, lvalp, addrp, realnump, valuep);
> break;
>
> Eventually this means that sentinel_frame_prev_register will provide
> the register offset hack.
>
> Do you agree with my analysis?
Yes. Stores could otherwize go to the wrong register (a really horrible
bug to track down).
I should note that the part of ``info registers'' where it prints out
where a register was saved needs a re-think. Now that things are
recursive it has the potential for reporting a register that was saved N
levels further in on the stack (it does this already with the d10v and
PC vs LR).
BTW, suggest adding a few name prefixes to register number variables -
it is really hard to know which space (DWARF 2 or GDB) the register's
value falls in.
Andrew
next prev parent reply other threads:[~2003-05-05 14:24 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-05-04 22:07 Mark Kettenis
2003-05-05 3:35 ` Andrew Cagney
2003-05-05 3:42 ` Daniel Jacobowitz
2003-05-05 14:08 ` Andrew Cagney
2003-05-05 14:27 ` Daniel Jacobowitz
2003-05-05 14:52 ` Andrew Cagney
2003-05-05 14:59 ` Daniel Jacobowitz
2003-05-05 14:11 ` Mark Kettenis
2003-05-05 13:48 ` Mark Kettenis
2003-05-05 14:24 ` Andrew Cagney [this message]
2003-05-05 13:52 ` Mark Kettenis
2003-05-05 14:31 ` Andrew Cagney
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=3EB6742C.6070409@redhat.com \
--to=ac131313@redhat.com \
--cc=gdb-patches@sources.redhat.com \
--cc=kettenis@chello.nl \
/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