This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [RFA] backtrace in mixed language applications
- From: Daniel Jacobowitz <drow at false dot org>
- To: Joel Brobecker <brobecker at adacore dot com>
- Cc: Jerome Guitton <guitton at adacore dot com>, gdb-patches at sources dot redhat dot com
- Date: Wed, 15 Aug 2007 15:29:02 -0400
- Subject: Re: [RFA] backtrace in mixed language applications
- References: <20070810100313.GA29799@adacore.com> <20070815191834.GK11498@adacore.com>
On Wed, Aug 15, 2007 at 12:18:34PM -0700, Joel Brobecker wrote:
> I think this opens the chance for the debugger to change the selected
> frame if something goes wrong (or the user presses controlC), which is an
> unexpected side-effect.
Correct. If you have to switch the global selected frame, please use
a cleanup. It's better to pass the selected frame explicitly where
possible, but it may not be practical depending what is checking the
language.
> Also, I'm thinking this is the wrong place for doing this frame switch.
> How about doing it inside print_frame? I think this would make sure
> we cover all the cases where we print a frame, such as after an "up",
> "down", or a "frame" command. And I think the frame selection needs
> to be protected against error raising.
>
> What do others think?
Yes, I agree. If we really need to change the selected frame to print
a frame correctly, then let's do it lower down (or document/assert
the requirement).
--
Daniel Jacobowitz
CodeSourcery