3

How can I configure LLDB to skip libstdc++ code and jump directly into a function stored inside std::function?

There is a similar question with an answer for gdb: How to step into std::function user code from C++ functional with GDB? It works. However LLDB works faster on my machine, so I wonder if it can be configured in a similar way with .lldbinit?

random
  • 3,868
  • 3
  • 22
  • 39
  • I compiled the code from other question. From the `f(1)` line, running `step` directly led to the stored function (`myfunc`), no steps through `std::function` or any other parts of libstdc++. – Dave Lee May 17 '20 at 16:08
  • @DaveLee what lldb version/ which platform do you use? Can you share your config? – random May 18 '20 at 07:36
  • 1
    Support for stepping through std::function to its target was added to lldb quite recently. IIRC, it first showed up in Xcode 11. Try updating your lldb and if that still doesn't work please file a bug. This is new support, so there might be some case that isn't covered yet. When it works it works without user intervention. – Jim Ingham May 18 '20 at 18:19
  • Yes, I tested on macOS with lldb-1100.0.30.12 (from Xcode 11.3.1). – Dave Lee May 18 '20 at 21:20
  • @JimIngham Afaik on MacOs they don't use libstdc++, and have other implementation. Will it work on Linux? – random May 19 '20 at 02:14
  • No, there's only support for the clang std implementation at present. The design allows lldb to support multiple versions of the std library, so that's not a problem. OTOH, it was a little tricky to figure out how to make the current support work in a performant manner, so it will take somebody with a good knowledge of libstdc++ to get this to work for that. – Jim Ingham May 19 '20 at 18:41

0 Answers0