Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Michael Snyder <msnyder@redhat.com>
To: Joel Brobecker <brobecker@gnat.com>
Cc: gdb-patches@sources.redhat.com
Subject: Re: [RFC] Unexpected automatic language switch - get_frame_language()
Date: Fri, 05 Dec 2003 23:57:00 -0000	[thread overview]
Message-ID: <3FD11B60.2040008@redhat.com> (raw)
In-Reply-To: <20031205224807.GE716@gnat.com>

Joel Brobecker wrote:
> 
> So we determine the language by looking up the symtab associated to
> the given frame pc. Unfortunately, we were not very lucky in our case
> because the call instruction was the last instruction of the function.
> And because get_frame_pc actually gives a return address (except for
> the bottom frame), the pc return is actually pointing to a different
> function. And this is where we're not lucky for the second time, because
> the next function is in a different unit written in a different
> language!


Sounds kinda like a debugging-optimized-code problem.  Your function
is tail-return optimized -- doesn't really return.  That's outside
the expected API.

I think you have to do "special" things for non-returning functions.
I've seen the same sort of thing for eg. _exit.

[...]
> 
> So I think the correct way of doing this is to use a decremented PC
> for any frame but the bottom one. 

I think that's fixing the wrong problem.  And it's not really portable.

[...]
 > PS: I couldn't reduce the testcase more, the test is too sensitive
 > to code generation and placement...

That's generally a good sign of an optimization problem.




  reply	other threads:[~2003-12-05 23:57 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-12-05 22:48 Joel Brobecker
2003-12-05 23:57 ` Michael Snyder [this message]
2003-12-06  0:18   ` Joel Brobecker
2003-12-06  0:28     ` Andrew Cagney
2003-12-10  1:50       ` Joel Brobecker
2003-12-10 16:14         ` Andrew Cagney
2003-12-10 17:42           ` Joel Brobecker
2003-12-06  0:42     ` Michael Snyder
2003-12-10 17:47 ` Daniel Jacobowitz
2003-12-10 18:10   ` Joel Brobecker
2003-12-10 18:20     ` Daniel Jacobowitz
2003-12-10 19:16       ` Joel Brobecker
2003-12-10 19:18         ` Daniel Jacobowitz
2003-12-10 18:33     ` Ada's throw/catch; Was: " Andrew Cagney
2003-12-10 19:04       ` Joel Brobecker

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=3FD11B60.2040008@redhat.com \
    --to=msnyder@redhat.com \
    --cc=brobecker@gnat.com \
    --cc=gdb-patches@sources.redhat.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