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: %ebp-based backtrace patch


Hi,

On Mon, 6 Jul 2009, Frank Ch. Eigler wrote:

> Daniel Jacobowitz <drow@false.org> writes:
> 
> > A number of Linux distributions are carrying the attached patch from
> > Michael Matz.  [...]
> >   https://bugzilla.novell.com/show_bug.cgi?id=390722#c25
> >[...]
> > 	* i386-tdep.c (i386_frame_cache): Assume anonymous functions use
> > 	a frame pointer.
> >[...]
> 
> Could gdb partially disassemble such functions to check
> whether %ebp is likely being used as this heuristic expects?

Nope.  We don't know the function borders.  But there's another heuristic 
that could potentially be useful: check if %ebp points not too far away 
from %esp (and has a higher value).  That way we would at least reject 
functions that use %ebp to hold some low integer values.

Then we of course have the problem again of having to rely on %esp-4 
containing the return address.  That assumption doesn't really hold very 
often.  In fact it holds _only_ for frameless functions, of which there 
aren't that many on x86.  So we're screwed either way.


Ciao,
Michael.


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