This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
Re: [patch, rfc, 6.0] Change frame predicates to sniffers
- From: Mark Kettenis <kettenis at chello dot nl>
- To: Michael Elizabeth Chastain <mec at shout dot net>
- Cc: ac131313 at redhat dot com, gdb-patches at sources dot redhat dot com
- Date: 13 Jul 2003 18:55:15 +0200
- Subject: Re: [patch, rfc, 6.0] Change frame predicates to sniffers
- References: <200307121919.h6CJJXxo019043@duracef.shout.net>
Michael Elizabeth Chastain <mec@shout.net> writes:
> My test bed says: no regressions, no improvements.
Yup. Andrews patches don't actually fix things yet. To see any
improvements, the i386 frame unwinder (for stabs) and DWARF2 frame
unwinder need to be converted to make use of the new interfaces.
When I origionally checked in my new i386 frame unwinder I didn't
realise that by improving its prologue analyser I would introduce
regressions. Let me explain what's happening.
For your testcases, the instructions after the function call are
optimized away. This means that the return address of the called
frame points to the first instruction of the next function. The
prologue analysis is done for this function instead of the function
that actually made the call. Previously the prologue analyzer didn't
stop at the "current" PC, but instead it did a full analysis of the
prologue. Since most prologues on the i386 start with the sequence
push %ebp
move %esp,%ebp
this means that it doesn't matter much which prologue we analyzed as
long as the frame pointer (%ebp) was set up correctly. Since the
frame-pointer was set up correctly for the frame that made the call,
things seemed to be correct.
The new prologue analyzer notices that at the first instruction of a
function, the frame-pointer hasn't been setup yet, and the frame
unwinder uses the stack-pointer for unwinding. This fails because we
haven't actually called the function we're analyzing.
We should be able to fix this by using the interfaces Andres is
proposing. Therefore, Andres, please go ahead.
Mark