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: Do not unwind frames past NULL PC


On Fri, Feb 22, 2008 at 05:12:18PM +0000, Maciej W. Rozycki wrote:
> Hello,
> 
>  Some architectures, like MIPS, specify in the ABI that the value of the 
> return address in a frame (or in other words the value of the PC the frame 
> would have been called from) being zero denotes the outermost frame.  At 
> the moment GDB does not seem to have a way to terminate frame unwinding in 
> an architecture-specific way (or to that matter any that would not imply 
> an error condition) in get_prev_frame_1(), which is where such a check 
> would be needed.
> 
>  However even for these architectures which may not necessarily specify in 
> the relevant ABI that a NULL PC is the terminating value it seems rather 
> unlikely for a function to have been called in a way which would make its 
> return address to be zero and yet it having a genuine caller with an 
> associated frame.  Therefore I propose the following check to be 
> introduced to get_prev_frame_1().  It removes the confusing bogus frame at 
> the bottom of a backtrace like below:

Similar changes have been proposed several times, but were controversial.

  http://sourceware.org/ml/gdb-patches/2006-05/msg00196.html
  http://sourceware.org/ml/gdb-patches/2006-07/msg00296.html

and more recently:

  http://sourceware.org/ml/gdb-patches/2007-12/msg00004.html

-- 
Daniel Jacobowitz
CodeSourcery


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