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 breakpoints/15360] can't step into function


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

--- Comment #1 from dje at google dot com 2013-04-11 23:56:44 UTC ---
gdb is putting the step-resume bkpt at the wrong place.

(gdb) disas function
Dump of assembler code for function function():
   0x00000000004004b4 <+0>:     push   %rbp
   0x00000000004004b5 <+1>:     mov    %rsp,%rbp
   0x00000000004004b8 <+4>:     push   %r12
   0x00000000004004ba <+6>:     push   %rbx
   0x00000000004004bb <+7>:     sub    $0x10,%rsp
   0x00000000004004bf <+11>:    jmp    0x4004c2 <function()+14>
   0x00000000004004c1 <+13>:    nop
   0x00000000004004c2 <+14>:    movl   $0x0,-0x18(%rbp)
   0x00000000004004c9 <+21>:    mov    -0x18(%rbp),%eax
   0x00000000004004cc <+24>:    add    $0x4,%eax
   0x00000000004004cf <+27>:    mov    %eax,-0x14(%rbp)
   0x00000000004004d2 <+30>:    mov    $0x1,%r12d
   0x00000000004004d8 <+36>:    mov    $0x1,%ebx
   0x00000000004004dd <+41>:    lea    -0x20(%rbp),%rax
   0x00000000004004e1 <+45>:    mov    %rax,%rdi
   0x00000000004004e4 <+48>:    callq  0x400514 <foo::~foo()>
   0x00000000004004e9 <+53>:    test   %ebx,%ebx
   0x00000000004004eb <+55>:    je     0x4004c1 <function()+13>
   0x00000000004004ed <+57>:    mov    %r12d,%eax
   0x00000000004004f0 <+60>:    add    $0x10,%rsp
   0x00000000004004f4 <+64>:    pop    %rbx
   0x00000000004004f5 <+65>:    pop    %r12
   0x00000000004004f7 <+67>:    pop    %rbp
   0x00000000004004f8 <+68>:    retq
End of assembler dump.
...
Temporary breakpoint 2, main (argc=1, argv=0x7fffffffe848) at foo.c:23
23        function();
(gdb) s
infrun: clear_proceed_status_thread (process 20005)
infrun: proceed (addr=0xffffffffffffffff, signal=144, step=1)
infrun: resume (step=1, signal=0), trap_expected=0, current thread [process
20005] at 0x400508
infrun: wait_for_inferior ()
infrun: target_wait (-1, status) =
infrun:   20005 [process 20005],
infrun:   status->kind = stopped, signal = SIGTRAP
infrun: infwait_normal_state
infrun: TARGET_WAITKIND_STOPPED
infrun: stop_pc = 0x4004b4
infrun: stepped into subroutine
infrun: inserting step-resume breakpoint at 0x4004c1
infrun: resume (step=0, signal=0), trap_expected=0, current thread [process
20005] at 0x4004b4
infrun: prepare_to_wait
infrun: target_wait (-1, status) =
infrun:   20005 [process 20005],
infrun:   status->kind = exited, status = 0
infrun: infwait_normal_state
infrun: TARGET_WAITKIND_EXITED
[Inferior 1 (process 20005) exited normally]
infrun: stop_stepping

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