[lldb-dev] [Bug 51451] New: LLDB AArch64 SVE register context fails to restore after JITTed expression eval

via lldb-dev lldb-dev at lists.llvm.org
Thu Aug 12 03:22:54 PDT 2021


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

            Bug ID: 51451
           Summary: LLDB AArch64 SVE register context fails to restore
                    after JITTed expression eval
           Product: lldb
           Version: 12.0
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: All Bugs
          Assignee: lldb-dev at lists.llvm.org
          Reporter: omair.javaid at linaro.org
                CC: jdevlieghere at apple.com, llvm-bugs at lists.llvm.org

Used add_int_arrays_acle example from here:
https://www.linaro.org/blog/how-to-use-lldb-to-debug-sve-enabled-applications/

Used instructions to run on qemu with ubuntu focal where I installed clang-12
and lldb-12 using "apt install".

If I put a breakpoint in the middle of add_int_arrays_acle function, I can read
the SVE registers with "re re". But if I try to read a C variable, the SVE
registers get modified. Here is an example:

Process 298 stopped
* thread #1, name = 'test', stop reason = breakpoint 1.1
    frame #0: 0x000000000040058c
test`add_int_arrays_acle(out=0x000000000041102c, a=0x000000000041302c,
b=0x000000000041502c) at arrays.c:17:3
   14  
   15     pred = svwhilelt_b32(i, (uint64_t)ARRAYSIZE);
   16  
-> 17     while (svptest_first(svptrue_b32(), pred)) {
          ^
   18       sva = svld1(pred, &a[i]);
   19       svb = svld1(pred, &b[i]);
   20       svres = svadd_m(pred, sva, svb);
(lldb) re re p0
      p0 = {0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11}
(lldb) p i
(uint64_t) $1 = 0
(lldb) re re p0
      p0 = {0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00}
(lldb)

I have used the p* registers above as the effect is not visible in the z*
registers unless they have data in the high bits. Here is the example:

(lldb) re write z0 "0x2f 0x2f 0x2f 0x2f 0x2f 0x2f 0x2f 0x2f 0x2f 0x2f 0x2f 0x2f
0x2f 0x2f 0x2f 0x2f 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00
0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00
0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00
0x00 0x00 0x01 0x01"

(lldb) re re z0
      z0 = {0x2f 0x2f 0x2f 0x2f 0x2f 0x2f 0x2f 0x2f 0x2f 0x2f 0x2f 0x2f 0x2f
0x2f 0x2f 0x2f 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00
0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00
0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00
0x00 0x01 0x01}
(lldb) p i
(uint64_t) $2 = 0
(lldb) re re z0
      z0 = {0x2f 0x2f 0x2f 0x2f 0x2f 0x2f 0x2f 0x2f 0x2f 0x2f 0x2f 0x2f 0x2f
0x2f 0x2f 0x2f 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00
0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00
0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00
0x00 0x00 0x00}
(lldb)

-- 
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/20210812/b96eb797/attachment.html>


More information about the lldb-dev mailing list