This is the mail archive of the gdb-patches@sources.redhat.com 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: [patch, rfc, 6.0] Change frame predicates to sniffers


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


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