From: Frederic RISS <frederic.riss@st.com>
To: Daniel Jacobowitz <drow@false.org>
Cc: gdb@sourceware.org
Subject: Re: Robustify frame_unwind_address_in_block heuristic?
Date: Wed, 01 Oct 2008 15:26:00 -0000 [thread overview]
Message-ID: <1222874744.6785.530.camel@crx3051.cro.st.com> (raw)
In-Reply-To: <20081001144756.GA19452@caradoc.them.org>
Le mercredi 01 octobre 2008 à 10:47 -0400, Daniel Jacobowitz a écrit :
> On Wed, Oct 01, 2008 at 04:41:42PM +0200, Frederic RISS wrote:
> > I have to admit that the above is a convoluted case which shouldn't show
> > up in a 'standard' debug session. It's also not the first time I wish
> > that frame unwinders were more flexible/modular, but it's the first time
> > that I wasn't able to work around the issue without patching GDB's core
> > functionality. Would it be acceptable to add a check to the above
> > function that checks whether pc-1 points into the same function as pc?
>
> No. That's exactly the issue this code was written to handle :-)
Really? I always thought the main motivation was showing the call site
in the backtrace rather than the return site (when they are different).
But yes, I hadn't thought about the handling of noreturn functions which
are rather more common than my stubs :-)
> > Or maybe someone sees another way to prevent that issue?
>
> I don't see how to generically handle this case unless you can
> distinguish it from this example:
>
> my_function:
> do_stuff
> call noreturn_function
> unrelated_function:
> do_unrelated_stuff
>
> But there's rarely anything to handle the special kind of call in your
> 'returned-to' function, so from what's on the stack, I don't know how
> we can tell.
Of course we can't :-(, at least not in a generic way. I know the
exceptions to the rule in my application, but unfortunately there's no
way to feed this information into the frame unwinding machinery.
Well, I guess I need to stick with my ugly patch to frame.c.
Thanks for the fast answer!
Fred.
next prev parent reply other threads:[~2008-10-01 15:26 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-10-01 14:42 Frederic RISS
2008-10-01 14:48 ` Daniel Jacobowitz
2008-10-01 15:26 ` Frederic RISS [this message]
2008-10-01 15:29 ` Joel Brobecker
2008-10-01 15:58 ` Frederic RISS
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=1222874744.6785.530.camel@crx3051.cro.st.com \
--to=frederic.riss@st.com \
--cc=drow@false.org \
--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