This is the mail archive of the gdb-prs@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]

[Bug gdb/12644] GDB steps over function


http://sourceware.org/bugzilla/show_bug.cgi?id=12644

--- Comment #2 from Tom Tromey <tromey at redhat dot com> 2011-04-07 16:13:19 UTC ---
I suspect this is a GCC bug.

I ran this with 'set debug infrun 1'.  In the output I see:

infrun: stop_pc = 0x8048474
infrun: stepped into subroutine
infrun: inserting step-resume breakpoint at 0x8048482

This happens when the 'step' enters 'f'.  Then GDB sees that 0x8048474
is the start of 'f', so it sets a step-resume breakpoint at the point
where the prologue ends.

Here is 'f':

(gdb) disas 0x8048482
Dump of assembler code for function f(bool):
   0x08048474 <+0>:    push   %ebp
   0x08048475 <+1>:    mov    %esp,%ebp
   0x08048477 <+3>:    sub    $0x28,%esp
   0x0804847a <+6>:    mov    0x8(%ebp),%eax
   0x0804847d <+9>:    mov    %al,-0xc(%ebp)
   0x08048480 <+12>:    jmp    0x8048483 <f(bool)+15>
   0x08048482 <+14>:    nop
   0x08048483 <+15>:    cmpb   $0x0,-0xc(%ebp)
   0x08048487 <+19>:    jne    0x8048482 <f(bool)+14>
   0x08048489 <+21>:    movl   $0x8048584,(%esp)
   0x08048490 <+28>:    call   0x804839c <puts@plt>
   0x08048495 <+33>:    leave  
   0x08048496 <+34>:    ret    

That is, GCC says that the prologue ends at <f+14>.
But we never actually reach that PC.

Maybe it is a GDB bug somewhere else.
In any case I don't think the next-over-throw patch is to blame.

-- 
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.


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