[lldb-dev] [Bug 23944] New: Single step atomic sequences

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Thu Jun 25 05:45:58 PDT 2015


https://llvm.org/bugs/show_bug.cgi?id=23944

            Bug ID: 23944
           Summary: Single step atomic sequences
           Product: lldb
           Version: unspecified
          Hardware: All
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: All Bugs
          Assignee: lldb-dev at cs.uiuc.edu
          Reporter: tberghammer at google.com
    Classification: Unclassified

On several architectures there are atomic instruction sequences where placing a
breakpoint in the middle of them changes the behavior of the code. The expected
behavior from the debugger is to treat these sequences as a "single instruction
block" and step through it and place breakpoints only outside of it.

Example on ARM (code came from libc.so`pthread_mutex_lock):

libc.so[0x17738] <+190>: ldrex  lr, [r4]
libc.so[0x1773c] <+194>: mov.w  r2, #0x0
libc.so[0x17740] <+198>: teq.w  lr, r5
libc.so[0x17744] <+202>: it     eq
libc.so[0x17746] <+204>: strexeq r2, r12, [r4]
libc.so[0x1774a] <+208>: cmp    r2, #0x0
libc.so[0x1774c] <+210>: bne    0x17738                   ; <+190>

There is an internal link (implemented inside of the processor) between the
ldrex and the strex instruction. If the evaluation of the code brakes between
these 2 instructions then this link broke resulting in a change in the behavior
of the code (in this case strex will always fail).

P.S.: The issue (in theory) handled by GDB properly on ARM
(https://sourceware.org/ml/gdb-patches/2011-12/msg00235.html)

-- 
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/20150625/90292580/attachment.html>


More information about the lldb-dev mailing list