This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [RFC] Move the frame zero PC check earlier
> Date: Thu, 18 May 2006 22:04:09 +0200 (CEST)
> From: Mark Kettenis <mark.kettenis@xs4all.nl>
> CC: pgilliam@us.ibm.com, andrew.stubbs@st.com, brobecker@adacore.com, drow@false.org, mark.kettenis@xs4all.nl, gdb-patches@sourceware.org
>
> > The only reason presented in this thread for displaying those frames
> > at all is that it can be an indication of a bug in GDB.
>
> No. There are two reasons why we should print those frames, and I
> consider both of them not to be an indication of a bug in GDB.
>
> 1. Because of a bug in the program you're debugging, it has
> overwritten the return address on the stack. Currently this causes
> the extra frame to be printed signalling the user that something is
> wrong. Daniel's patch changes this, but only if the return address
> is overwritten with zero.
>
> 2. It may be fundamentally impossible to unwind code produced by an
> optimizing compiler without additional debug info. We can't
> consider the fact that GDB gets the return address wrong if the
> debug info is missing a bug in GDB. Again the extra frame signals
> the user that something is wrong.
I think it was already suggested in this lengthy thread to display
some kind of message to alert the user. For example:
(Backtrace terminated due to zero return address.)
Would this make everybody fairly happy to zero in on a solution?