-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Support LLDB-DAP as a debugger (OSX/Linux/Windows) #13569
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
…nto dev/garretts/implement-lldb-dap
…microsoft/vscode-cpptools into dev/garretts/implement-lldb-dap
"rust" | ||
], | ||
"_aiKeyComment": "Ignore 'Property aiKey is not allowed'. See https://github.com/microsoft/vscode/issues/76493", | ||
"aiKey": "0c6ae279ed8443289764825290e4f9e2-1a736e7c-1324-4338-be46-fc2a58ae4d14-7255", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
does lldb-dap
send telemetry events? If it doesn't, you may want to remove this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
AFAIK, this key is used by VSCode itself to send telemetry for the debugger extension (ie, monacoworkbench/debugsessionstart
) events - which is the very code that I've written.
Yes, this is absolutely necessary
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
monacoworkbench/debugsessionstart
is from VS Code's telemetry table, they send that at https://github.com/microsoft/vscode/blob/2ba158ca779b715bd4d29d1cb6ac022b27672b26/src/vs/workbench/contrib/debug/browser/debugService.ts#L677 and does not rely on aiKey
This aiKey
should be for telemetry sent from the debugger via OutputEvent
with category: "telemetry"
I don't see anywhere in lldb-dap
that utilized OutputType::Telemetry
.
https://github.com/search?q=repo%3Allvm%2Fllvm-project+OutputType%3A%3ATelemetry&type=code
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The aikey
for the Debugger Contribution is read in VSCode itself here in getCustomTelemetryEndpoint()
:
It would appear that getCustomTelemetryEndpoint()
is called, and it writes at least one event here:
I could be wrong, but I don't see any way that the lldb-dap binary would even be able to get the configuration for the debugger contribution from package.json since we never pass that to it.
This is following the same pattern that the debugger contribution points for the other debug types (cppdbg
and cppvsdbg
) - cppdbg uses the MIEngine adapter, and I find no indication that MIEngine uses aikey
at all (https://github.com/search?q=repo%3Amicrosoft%2FMIEngine%20aikey&type=code)
After reading the comments here:
microsoft/vscode#2931
microsoft/vscode#76493 (comment)
I was under the impression that's why we even have the aikey
in the debugger contribution point, otherwise we just send telemetry events ourselves with the key as normal.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would appear that getCustomTelemetryEndpoint() is called, and it writes at least one event here:
A couple lines above show that the aiKey
is used specifically for the OutputEvent
that lldb-dap
does not send. lldb-dap
does not need aiKey
, but aiKey
is used when Telemetry is sent (via OutputEvent) from the debugger.
This link shows that lldb-dap
does not send any OutputType::Telemetry
at all https://github.com/search?q=repo%3Allvm%2Fllvm-project+OutputType%3A%3ATelemetry&type=code
My comment here is saying, this aiKey
is going to be unused so you can remove from the configuration unless there's plan to introduce telemetry OutputEvents from lldb-dap
.
This adds the ability to debug processes via LLDB using the LLDB-DAP adapter that is bundled with LLVM's LLDB debugger.
This includes:
cpplldb
debug typenote
function to the logger that sets a transient message in the status bar.links.ts
as central place to store links (there are others embedded in the code that should be moved, and then they should all be aka.ms links for security)program
withattach
so that the processes can be filtered to what they expect.cppdbg
andcppvsdbg
so that they use the constants that exist already.ConfigurationProvider
code so that it's not string-smashing to write JSON.lldb-dap
,lldb-dap-##
,lldb-vscode
, andlldb-vscode-##
to support different named binaries (especially on linux)Important Notes
the
cppvsdbg
debugger on Windows can debug LLVM compiled binaries very well, and there is really no reason you want to use the LLDB-DAP on windows - it's just not as good as the other platforms. It's sluggish and has problems with step over and other things.LLDB-DAP on windows has a dependency of Python310 - which means if your Python3 installed by the store or whereever is not 3.10 but say 3.13 - it won't work. To fix that, you can run this from an elevated command line:
curl https://www.python.org/ftp/python/3.10.11/python-3.10.11-embed-amd64.zip --output - | tar x -C c:\program files\llvm\bin
-- this will download the right binary and unpack it into the correct folder -- but this is really a hack.