This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
Re: [RFC] Unexpected automatic language switch - get_frame_language()
- From: Joel Brobecker <brobecker at gnat dot com>
- To: Michael Snyder <msnyder at redhat dot com>
- Cc: gdb-patches at sources dot redhat dot com
- Date: Fri, 5 Dec 2003 16:18:15 -0800
- Subject: Re: [RFC] Unexpected automatic language switch - get_frame_language()
- References: <20031205224807.GE716@gnat.com> <3FD11B60.2040008@redhat.com>
> Sounds kinda like a debugging-optimized-code problem. Your function
> is tail-return optimized -- doesn't really return. That's outside
> the expected API.
Kind of, yes, but the code in question was compiled at -O0! It's a
noreturn function because the compiler could statically determine that
the exception would be unhandled.
> I think you have to do "special" things for non-returning functions.
> I've seen the same sort of thing for eg. _exit.
Do you remember how these similar problems were approached and solved?
> >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.
Hmm, I thought this was "portable" since I sort of remember that we are
already using this sort of technique in similar situations. I can't
remember exactly which changes, but decrementing the PC was something we
already did in other places. Maybe your objecting to the part that says
"do the decrement only for the non bottom one"?
--
Joel