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: [PATCH] Fix problem with scope.exp test, skipping past init0 call


On Monday 13 February 2006 10:39, Daniel Jacobowitz wrote:
> What platform and compiler version is this?  It doesn't fail for me.

Fedora Core 4, using the latest development gcc while running the]
gdb testsuite.

> Well, that's supposed to skip a call to __main(), which GCC generates
> on very few platforms... stopping at the opening brace is definitely
> a bug in its own right, in the debug info or in the prologue skipper.

The problem is that gcc now generates prologues that the prologue skipper
isn't prepared to handle.

The latest gcc generates prologues like:

main:
        leal    4(%esp), %ecx
        andl    $-16, %esp
        pushl   -4(%ecx)
        pushl   %ebp
        movl    %esp, %ebp
        pushl   %ecx
        call    foo

While older gcc's generate a prologue that
gdb understands, like:

main:
        pushl   %ebp
        movl    %esp, %ebp
        subl    $8, %esp
        andl    $-16, %esp
        movl    $0, %eax
        addl    $15, %eax
        addl    $15, %eax
        shrl    $4, %eax
        sall    $4, %eax
        subl    %eax, %esp
        call    foo

So when compiling with the latest gcc, gdb will set a function
breakpoint at the same address as main.

I was just reviewing the mailing lists to see if anyone else has
reported this, or is working on it, before doing any work on
i386_analyze_frame_setup().

-Fred


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