From: Daniel Jacobowitz <drow@false.org>
To: Mark Kettenis <mark.kettenis@xs4all.nl>
Cc: gdb-patches@sourceware.org
Subject: Re: [patch RFC] Re: Notes on a frame_unwind_address_in_block problem
Date: Mon, 01 Jan 2007 20:35:00 -0000 [thread overview]
Message-ID: <20070101203533.GA20094@nevyn.them.org> (raw)
In-Reply-To: <200701012026.l01KQj6h022478@brahms.sibelius.xs4all.nl>
On Mon, Jan 01, 2007 at 09:26:45PM +0100, Mark Kettenis wrote:
> But if you're calling get_frame_func() you've already got a frame, so
> you should know everything about it. The place to fix things is
> probably get_frame_address_in_block(). For one thing it's probably
> not a good idea to return an address that's lower than the code
> address in the frame ID. Or perhaps it is enough to look at the
> frame's type and simply call frame_pc_unwind for SIGTRAMP_FRAMEs.
Hmm, get_frame_func may have been an ill-chosen example. A better one
is frame_func_unwind. get_frame_func just wraps frame_func_unwind, and
get_frame_address_in_block just wraps frame_unwind_address_in_block. I
think that's a generally good thing - it encourages consistency in
their results. The unwind variants are used all over GDB, not just
during unwinding; this matters e.g. around main, where get_prev_frame
might return NULL.
And that's why my solution ended up complicated. When you're in
frame_func_unwind you have to call frame_unwind_address_in_block,
and at that point you might not know the type or even the unwinder
of the previous frame.
So I made frame_unwind_address_in_block do pretty much what you
suggested above, and forbid calling it before we know the type of the
previous frame.
> > Hmm... I don't think it's possible, but it depends what qualifier you
> > meant to put on "all targets". The only way I can see to do it would
> > be with hand-written assembly and CFI and stack manipulation. I might
> > be able to write a test which worked on all x86-64 systems and
> > pretended to have create a signal frame, if that's what you wanted.
>
> Hmm, sorry yes, a test that would work on all i386 or x86-64 target
> was what I actually meant.
I can probably do that. I'll try this evening.
--
Daniel Jacobowitz
CodeSourcery
next prev parent reply other threads:[~2007-01-01 20:35 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20060706222157.GA1377@nevyn.them.org>
[not found] ` <200607132020.k6DKKCSB023812@elgar.sibelius.xs4all.nl>
[not found] ` <20060718183910.GB17864@nevyn.them.org>
2007-01-01 19:19 ` Daniel Jacobowitz
2007-01-01 19:54 ` Mark Kettenis
2007-01-01 20:02 ` Daniel Jacobowitz
2007-01-01 20:27 ` Mark Kettenis
2007-01-01 20:35 ` Daniel Jacobowitz [this message]
2007-01-02 0:51 ` Daniel Jacobowitz
2007-01-02 19:16 ` Mark Kettenis
2007-01-02 19:18 ` Daniel Jacobowitz
2007-01-02 19:20 ` Daniel Jacobowitz
2007-01-02 21:32 ` Mark Kettenis
2007-01-03 11:37 ` Mark Kettenis
2007-01-03 14:43 ` Daniel Jacobowitz
2007-01-03 16:13 ` Daniel Jacobowitz
2007-01-03 20:28 ` Mark Kettenis
2007-01-03 20:30 ` Daniel Jacobowitz
2007-01-03 21:58 ` Mark Kettenis
2007-01-03 22:02 ` Daniel Jacobowitz
2007-01-03 22:23 ` Mark Kettenis
2007-01-03 22:29 ` Daniel Jacobowitz
2007-02-20 12:39 ` Daniel Jacobowitz
2007-02-20 15:31 ` Daniel Jacobowitz
2007-02-20 16:20 ` Daniel Jacobowitz
2007-02-22 21:28 ` Mark Kettenis
2007-02-22 21:32 ` Daniel Jacobowitz
2007-02-27 20:18 ` 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=20070101203533.GA20094@nevyn.them.org \
--to=drow@false.org \
--cc=gdb-patches@sourceware.org \
--cc=mark.kettenis@xs4all.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