This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [RFC] Move the frame zero PC check earlier


Eli Zaretskii <eliz@gnu.org> writes:
>> 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?

(UNFAIR UNHAPPINESS ABOUT NON-ZERO SOLUTIONS FOR EVERYBODY!!!)

Well, no: the stacks we'd like to display are healthy and well-formed,
according to the conventions of the system; there's nothing
non-standard about them at all.  So they ought to display as normal
stacks --- on those systems.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]