Closed rjra100 closed 10 months ago
I was a bit surprised to find that it involves the creation of temporary breakpoints in order to resolve symbols - the more obvious approach to me would seem to be to directly ask the lldb frame object for its symbol
Unfortunately VSCode does not expose stack frame ids to extensions, only their source locations.
I've raised a PR with a fix that works for me.
OS: Windows 10 21H2 + WSL + Docker running a RHEL7.9 container (sorry!) VSCode version: 1.79.2 + Dev Containers 0.295.0 CodeLLDB version: 1.9.2 (custom-built on RHEL7.9 because it's got an ancient glibc and the store version doesn't run, but no code changes) Compiler: gcc 10.2.1 (also tried with clang 15.0.7; identical behaviour) Debuggee: Any C++ binary
The new Excluded Callers feature sounds great, but I'm afraid it doesn't appear to be working in a dev container environment. Attempting to exclude any stack frame results in a popup "Could not locate symbol for this stack frame".
I reproduced with an example as simple as
g++ -g test.cpp
, debug and attempt to exclude main().Verbose logging doesn't appear to produce much of interest. However, lldb logging (
log enable lldb break
) produces this:From the looks of it, because I'm running in a containerised environment the file path is coming out with a vscode-remote:/\<blah> prefix on it, and as a result lldb's filtering it out and not resolving the breakpoint to any locations. I'm not entirely clear where the remote container prefix is coming from, though. A breakpoint is correctly created if I simply run
break set -f /workspaces/test.cpp -l 4 -u 15
in the debug console (or in command line lldb), but I get similar behaviour if I include the vscode-remote prefix there.Incidentally, I guess there was probably a reason, but from a quick look at the implementation of the exclude callers function I was a bit surprised to find that it involves the creation of temporary breakpoints in order to resolve symbols - the more obvious approach to me would seem to be to directly ask the lldb frame object for its symbol (via the Python interface, if you've got an
SBFrame
object you can doframe.GetSymbol()
and go from there without needing to mess about with breakpoints at all). The ExcludeSymbolRequest seems to pass the file location rather than the frame, though, so perhaps that isn't an option.Let me know if there's any way I can help debug this - I've got the containerised environment all set up and I'm also also set up to run custom builds of the extension if that'll help, so if you'd like me to add any logging or try out any experimental fixes, I'm very happy to do so.