[lldb-dev] [Bug 19311] New: LLDB does not stop at breakpoint on resumed-to instruction (on FreeBSD) -- ThreadPlanStepOverBreakpoint skips subsequent braeakpoint

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Wed Apr 2 11:24:55 PDT 2014


http://llvm.org/bugs/show_bug.cgi?id=19311

            Bug ID: 19311
           Summary: LLDB does not stop at breakpoint on resumed-to
                    instruction (on FreeBSD) --
                    ThreadPlanStepOverBreakpoint skips subsequent
                    braeakpoint
           Product: lldb
           Version: unspecified
          Hardware: PC
                OS: FreeBSD
            Status: NEW
          Severity: normal
          Priority: P
         Component: All Bugs
          Assignee: lldb-dev at cs.uiuc.edu
          Reporter: emaste at freebsd.org
    Classification: Unclassified

Consider this sample code:

(lldb) list 1
   1    int
   2    main(int argc, char *argv[])
   3    {
   4            int i = 0;
   5            i++;
   6            i++;
   7            i++;
   8            i++;
   9            i++;
   10   }

(lldb) disass -b -n main
inc`main at inc.c:3:
0x4005b0:  55                    pushq  %rbp
0x4005b1:  48 89 e5              movq   %rsp, %rbp
0x4005b4:  89 7d ec              movl   %edi, -0x14(%rbp)
0x4005b7:  48 89 75 e0           movq   %rsi, -0x20(%rbp)
0x4005bb:  c7 45 fc 00 00 00 00  movl   $0x0, -0x4(%rbp)
0x4005c2:  83 45 fc 01           addl   $0x1, -0x4(%rbp)
0x4005c6:  83 45 fc 01           addl   $0x1, -0x4(%rbp)
0x4005ca:  83 45 fc 01           addl   $0x1, -0x4(%rbp)
0x4005ce:  83 45 fc 01           addl   $0x1, -0x4(%rbp)
0x4005d2:  83 45 fc 01           addl   $0x1, -0x4(%rbp)
0x4005d6:  c9                    leave  
0x4005d7:  c3                    retq   

Set breakpoints on source lines 5, 6, 7, 8, which are also contiguous assembly
instructions.

(lldb) break list
Current breakpoints:
1: file = '/tank/emaste/src/llvm/build-nodebug/inc.c', line = 5, locations = 1,
resolved = 1, hit count = 2
  1.1: where = inc`main + 18 at inc.c:5, address = 0x00000000004005c2,
resolved, hit count = 2 

2: file = '/tank/emaste/src/llvm/build-nodebug/inc.c', line = 6, locations = 1,
resolved = 1, hit count = 0
  2.1: where = inc`main + 22 at inc.c:6, address = 0x00000000004005c6,
resolved, hit count = 0 

3: file = '/tank/emaste/src/llvm/build-nodebug/inc.c', line = 7, locations = 1,
resolved = 1, hit count = 0
  3.1: where = inc`main + 26 at inc.c:7, address = 0x00000000004005ca,
resolved, hit count = 0 

4: file = '/tank/emaste/src/llvm/build-nodebug/inc.c', line = 8, locations = 1,
resolved = 1, hit count = 0
  4.1: where = inc`main + 30 at inc.c:8, address = 0x00000000004005ce,
resolved, hit count = 0 

(lldb) run
Process 20339 launching
Process 20339 stopped
Process 20339 launched: '/tank/emaste/src/llvm/build-nodebug/inc' (x86_64)
Process 20339 stopped
* thread #1: tid = 103570, 0x00000000004005c2 inc`main(argc=1,
argv=0x00007fffffffd558) + 18 at inc.c:5, stop reason = breakpoint 1.1
    frame #0: 0x00000000004005c2 inc`main(argc=1, argv=0x00007fffffffd558) + 18
at inc.c:5
   2    main(int argc, char *argv[])
   3    {
   4            int i = 0;
-> 5            i++;
   6            i++;
   7            i++;
   8            i++;

At this point "continue" should stop at the breakpoint on line 6, but instead
ThreadPlanStepOverBreakpoint disables, steps over, and re-enables each
breakpoint in turn.

(lldb) c
Process 20339 resuming
Process 20339 exited with status = 255 (0x000000ff) 



output from "log enable lldb step" for the first two breakpoints (the correctly
stepped-over one at line 5, and the skipped one at line 6):
(lldb) c
Process::PrivateResume() m_stop_id = 4, public state: stopped private state:
stopped
Thread::PushPlan(0x0x808f4a000): "Single stepping past breakpoint site 32 at
0x4005c2", tid = 0x18d57.
WillResume Thread #1 (0x0x808f4a000): tid = 0x18d57, pc = 0x004005c2, sp =
0x7fffffffd500, fp = 0x7fffffffd500, plan = 'Step over breakpoint trap', state
= stepping, stop others = 1
Process thinks the process has resumed.
Current Plan for thread 1(0x808f4a000) (0x18d57, stepping): Step over
breakpoint trap being asked whether we should report run.
Process 20344 resuming

ThreadList::ShouldStop: 1 threads
Thread::ShouldStop(0x808f4a000) for tid = 0x18d57 0x18d57, pc =
0x00000000004005c6
^^^^^^^^ Thread::ShouldStop Begin ^^^^^^^^
Plan stack initial state:
  Plan Stack for thread #1: tid = 0x18d57, stack_size = 2
    Element 1: Single stepping past breakpoint site 32 at 0x4005c2
    Element 0: Base thread plan.

Plan Step over breakpoint trap explains stop, auto-continue 1.
Plan Step over breakpoint trap should stop: 0.
Completed step over breakpoint plan.
Popping plan: "Step over breakpoint trap", tid = 0x18d57.
Plan stack final state:
  Plan Stack for thread #1: tid = 0x18d57, stack_size = 1
    Element 0: Base thread plan.
  Completed Plan Stack: 1 elements.
    Element 0: Single stepping past breakpoint site 32 at 0x4005c2

vvvvvvvv Thread::ShouldStop End (returning 0) vvvvvvvv
ThreadList::ShouldStop overall should_stop = 0
ThreadList::ShouldReportStop 1 threads
Thread::ShouldReportStop() tid = 0x18d57: returning vote  for complete stack's
back plan
ThreadPlan::ShouldReportStop() returning vote: no
ThreadList::ShouldReportStop returning no
Process::PrivateResume() m_stop_id = 5, public state: running private state:
stopped
Thread::PushPlan(0x0x808f4a000): "Single stepping past breakpoint site 33 at
0x4005c6", tid = 0x18d57.
WillResume Thread #1 (0x0x808f4a000): tid = 0x18d57, pc = 0x004005c6, sp =
0x7fffffffd500, fp = 0x7fffffffd500, plan = 'Step over breakpoint trap', state
= stepping, stop others = 1
Process thinks the process has resumed.

ThreadList::ShouldStop: 1 threads
Thread::ShouldStop(0x808f4a000) for tid = 0x18d57 0x18d57, pc =
0x00000000004005ca
^^^^^^^^ Thread::ShouldStop Begin ^^^^^^^^
Plan stack initial state:
  Plan Stack for thread #1: tid = 0x18d57, stack_size = 2
    Element 1: Single stepping past breakpoint site 33 at 0x4005c6
    Element 0: Base thread plan.

Plan Step over breakpoint trap explains stop, auto-continue 1.
Plan Step over breakpoint trap should stop: 0.
Completed step over breakpoint plan.
Popping plan: "Step over breakpoint trap", tid = 0x18d57.
Plan stack final state:
  Plan Stack for thread #1: tid = 0x18d57, stack_size = 1
    Element 0: Base thread plan.
  Completed Plan Stack: 1 elements.
    Element 0: Single stepping past breakpoint site 33 at 0x4005c6

vvvvvvvv Thread::ShouldStop End (returning 0) vvvvvvvv
ThreadList::ShouldStop overall should_stop = 0
ThreadList::ShouldReportStop 1 threads
Thread::ShouldReportStop() tid = 0x18d57: returning vote  for complete stack's
back plan
ThreadPlan::ShouldReportStop() returning vote: no
ThreadList::ShouldReportStop returning no
Process::PrivateResume() m_stop_id = 6, public state: running private state:
stopped
Thread::PushPlan(0x0x808f4a000): "Single stepping past breakpoint site 34 at
0x4005ca", tid = 0x18d57.
WillResume Thread #1 (0x0x808f4a000): tid = 0x18d57, pc = 0x004005ca, sp =
0x7fffffffd500, fp = 0x7fffffffd500, plan = 'Step over breakpoint trap', state
= stepping, stop others = 1
Process thinks the process has resumed.

ThreadList::ShouldStop: 1 threads
Thread::ShouldStop(0x808f4a000) for tid = 0x18d57 0x18d57, pc =
0x00000000004005ce
^^^^^^^^ Thread::ShouldStop Begin ^^^^^^^^
Plan stack initial state:
  Plan Stack for thread #1: tid = 0x18d57, stack_size = 2
    Element 1: Single stepping past breakpoint site 34 at 0x4005ca
    Element 0: Base thread plan.

Plan Step over breakpoint trap explains stop, auto-continue 1.
Plan Step over breakpoint trap should stop: 0.
Completed step over breakpoint plan.
Popping plan: "Step over breakpoint trap", tid = 0x18d57.
Plan stack final state:
  Plan Stack for thread #1: tid = 0x18d57, stack_size = 1
    Element 0: Base thread plan.
  Completed Plan Stack: 1 elements.
    Element 0: Single stepping past breakpoint site 34 at 0x4005ca

vvvvvvvv Thread::ShouldStop End (returning 0) vvvvvvvv

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/lldb-dev/attachments/20140402/cc5eb084/attachment.html>


More information about the lldb-dev mailing list