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


Mark Kettenis writes:
> 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.

Gotcha.

> 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.

Aha!

This is consistent with the stack dump I attached to pr gdb/1250.
gdb picks out a word for the program counter that would be correct
if the caller looked like this:

  func2:
    call abort
    push %ebp
    mov %ebp, %esp

This is a good candidate for a standalone test, gdb.base/gdb1250.exp,
with a KFAIL in it.  I'll write such a test tomorrow.

Michael C


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