Uploaded image for project: 'Swift'
  1. Swift
  2. SR-13066

LLDB does not descend into system libraries when debugging

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Medium
    • Resolution: Won't Do
    • Component/s: LLDB for Swift
    • Labels:
      None
    • Environment:

      Fedora 32 with master build:
      Swift version 5.3-dev (LLVM 94a8a8d0ffb5977, Swift ec8d5f4ecbe53e6)
      Target: x86_64-unknown-linux-gnu

      Description

      I am working on a command line app on Linux (Fedora 32). I am trying to use the sd-bus API from systemd, however am having some issues using the API.

      While trying to debug, I have found that LLDB will not step into the sd-bus functions I am calling, even though I have the relevant -debug-info and -debug-source packages installed.

      I have also installed the LZMA dev packages and manually enabled LLDB's support for LZMA-compressed debug info in the swift build script.

      I do note the following warning from LLDB when starting execution:

      warning: (x86_64) /lib64/libsystemd.so.0 unsupported DW_FORM values: 0x1f20 0x1f21
      

      I am able to use step-inst to descend into the functions, however no usable symbol info is available.

      Example LLDB output:

      Process 509983 stopped
      * thread #1, name = 'Tsunami', stop reason = instruction step into
          frame #0: 0x00007ffff6fb2f22 libsystemd.so.0`sd_bus_call + 18
      libsystemd.so.0`sd_bus_call:
      ->  0x7ffff6fb2f22 <+18>: pushq  %rbp
          0x7ffff6fb2f23 <+19>: movq   %rdi, %rbp
          0x7ffff6fb2f26 <+22>: movq   %rsi, %rdi
          0x7ffff6fb2f29 <+25>: pushq  %rbx
      Target 0: (Tsunami) stopped.
      (lldb)
      

      GDB output showing expected symbols:

      0x00005555556a8ce7	173	        r = sd_bus_call(bus, m, 0, &error, reply)
      (gdb) s
      sd_bus_call (bus=0x55555586cb50, _m=0x55555586dbb0, usec=0, error=0x7fffffffd3f0,
          reply=0x7fffffffd408) at ../src/libsystemd/sd-bus/sd-bus.c:2147
      2147	                sd_bus_message **reply) {
      (gdb)
      2149	        _cleanup_(sd_bus_message_unrefp) sd_bus_message *m = sd_bus_message_ref(_m);
      (gdb)
      sd_bus_message_ref (m=0x55555586dbb0) at ../src/libsystemd/sd-bus/bus-message.c:911
      911	_public_ sd_bus_message* sd_bus_message_ref(sd_bus_message *m) {
      (gdb)
      912	        if (!m)
      (gdb)
      

      I note a number of patches for LLDB in 2019 to add LZMA and .gnu-debug-data support, but I would assume these have been integrated into LLDB 10.0 which Swift 5.3 seems to be using.

        Attachments

          Activity

            People

            Assignee:
            Unassigned
            Reporter:
            ryanw Ryan
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: