[Lldb-commits] [lldb] [lldb] Implement basic support for reverse-continue (PR #99736)

David Spickett via lldb-commits lldb-commits at lists.llvm.org
Fri Oct 11 07:23:57 PDT 2024


DavidSpickett wrote:

This is something to do with evaluating `false_condition`.

With a normal session we see these libraries:
```
(lldb) image list
[  0] 371298DF 0x0000aaaaaaaaa000 /home/david.spickett/build-llvm-aarch64/lldb-test-build.noindex/functionalities/reverse-execution/TestReverseContinueBreakpoints.test_reverse_continue_skip_breakpoint/a.out
[  1] C38E00DD-D72E-215A-9DF1-C295FE7D461A-2EF398FF 0x0000fffff7fc2000 /usr/lib/aarch64-linux-gnu/ld-linux-aarch64.so.1
      /usr/lib/debug/.build-id/c3/8e00ddd72e215a9df1c295fe7d461a2ef398ff.debug
[  2] 8A3F013D-F292-A2BC-FE56-490D2244E9A8-A6162A47 0x0000fffff7ffb000 [vdso] (0x0000fffff7ffb000)
[  3] A012B2BB-7711-0E84-B266-CD7425B50E57-427ABB02 0x0000fffff7d90000 /lib/aarch64-linux-gnu/libstdc++.so.6
[  4] 6EAA5DD8-8BB4-2CB9-93DA-1B6C497683D1-71334ED1 0x0000fffff7cf0000 /lib/aarch64-linux-gnu/libm.so.6
      /usr/lib/debug/.build-id/6e/aa5dd88bb42cb993da1b6c497683d171334ed1.debug
[  5] AD8704B8-637D-63A8-F746-C5E0CDEC8708-40569A81 0x0000fffff7cc0000 /lib/aarch64-linux-gnu/libgcc_s.so.1
[  6] AA6E122F-A39A-E02D-412A-FB49D75E3328-1FCD2805 0x0000fffff7b10000 /lib/aarch64-linux-gnu/libc.so.6
      /usr/lib/debug/.build-id/aa/6e122fa39ae02d412afb49d75e33281fcd2805.debug
```
And when we look up `mmap` we find:
```
(lldb) image lookup -n mmap
1 match found in /usr/lib/aarch64-linux-gnu/ld-linux-aarch64.so.1:
        Address: ld-linux-aarch64.so.1[0x000000000001d790] (ld-linux-aarch64.so.1.PT_LOAD[0]..text + 113488)
        Summary: ld-linux-aarch64.so.1`__mmap64 at mmap64.c:50:6
1 match found in /lib/aarch64-linux-gnu/libc.so.6:
        Address: libc.so.6[0x00000000000e1db0] (libc.so.6.PT_LOAD[0]..text + 765296)
        Summary: libc.so.6`__GI___mmap64 at mmap64.c:50:6
```
And use the first one.

With the proxy server we see:
```
(lldb) image list
[  0] 371298DF 0x0000aaaaaaaaa000 /home/david.spickett/build-llvm-aarch64/lldb-test-build.noindex/functionalities/reverse-execution/TestReverseContinueBreakpoints.test_reverse_continue_skip_breakpoint/a.out
[  1] 8A3F013D-F292-A2BC-FE56-490D2244E9A8-A6162A47 0x0000fffff7ffb000 [vdso] (0x0000fffff7ffb000)
[  2] C38E00DD-D72E-215A-9DF1-C295FE7D461A-2EF398FF 0x0000fffff7fc2000 /usr/lib/aarch64-linux-gnu/ld-linux-aarch64.so.1
[  3] A012B2BB-7711-0E84-B266-CD7425B50E57-427ABB02 0x0000fffff7d90000 /lib/aarch64-linux-gnu/libstdc++.so.6
[  4] 6EAA5DD8-8BB4-2CB9-93DA-1B6C497683D1-71334ED1 0x0000fffff7cf0000 /lib/aarch64-linux-gnu/libm.so.6
[  5] AD8704B8-637D-63A8-F746-C5E0CDEC8708-40569A81 0x0000fffff7cc0000 /lib/aarch64-linux-gnu/libgcc_s.so.1
[  6] AA6E122F-A39A-E02D-412A-FB49D75E3328-1FCD2805 0x0000fffff7b10000 /lib/aarch64-linux-gnu/libc.so.6
```
And we find:
```
runCmd: image lookup -n mmap

output: 1 match found in /lib/aarch64-linux-gnu/libc.so.6:
        Address: libc.so.6[0x00000000000e1db0] (libc.so.6.PT_LOAD[0]..text + 765296)
        Summary: libc.so.6`__mmap
```
I haven't got to exactly where it crashes but I see the debug server exit, so I suspect we're not meant to call this `__mmap`. Apparently this is usually an alias to `__mmap64` but I wonder if we're breaking that alias by using it this way, unlike C programs using glibc normally.

Anyway, that aside the problem is likely that we don't find the debug info files when using the proxy. I'm trying to find out why, I suspect some aspect of the real server isn't being passed on correctly.

https://github.com/llvm/llvm-project/pull/99736


More information about the lldb-commits mailing list