vadimcn / codelldb

A native debugger extension for VSCode based on LLDB
https://marketplace.visualstudio.com/items?itemName=vadimcn.vscode-lldb
MIT License
2.43k stars 237 forks source link

win10 wsl can not debug #929

Closed ab503044120 closed 1 year ago

ab503044120 commented 1 year ago

OS: Windows_NT x64 10.0.19045 VSCode version: 1.78.0 (user setup) CodeLLDB version: v1.9.1 Compiler: clang 7.0.0 Debuggee: linux executable object

image I add configuration in launch.json and click start debug, can't debug the program

> Verbose log

Initial debug configuration: { type: 'lldb', request: 'launch', name: 'Debug', program: '${workspaceFolder}/build/test', args: [], cwd: '${workspaceFolder}', configurationTarget: 6 } Resolved debug configuration: { type: 'lldb', request: 'launch', name: 'Debug', program: '${workspaceFolder}/build/test', args: [], cwd: '${workspaceFolder}', configurationTarget: 6, relativePathBase: '/root/cTest', _adapterSettings: { displayFormat: 'auto', showDisassembly: 'auto', dereferencePointers: true, suppressMissingSourceFiles: true, evaluationTimeout: 5, consoleMode: 'commands', sourceLanguages: null, terminalPromptClear: null, evaluateForHovers: true, commandCompletions: true, reproducer: false } } liblldb: /root/.vscode-server/extensions/vadimcn.vscode-lldb-1.9.1/lldb/lib/liblldb.so environment: {} settings: { evaluateForHovers: true, commandCompletions: true } [DEBUG codelldb] Connecting to 127.0.0.1:3952 [DEBUG codelldb] New debug session [DEBUG codelldb::dap_codec] --> {"command":"initialize","arguments":{"clientID":"vscode","clientName":"Visual Studio Code","adapterID":"lldb","pathFormat":"path","linesStartAt1":true,"columnsStartAt1":true,"supportsVariableType":true,"supportsVariablePaging":true,"supportsRunInTerminalRequest":true,"locale":"en","supportsProgressReporting":true,"supportsInvalidatedEvent":true,"supportsMemoryReferences":true,"supportsArgsCanBeInterpretedByShell":true,"supportsMemoryEvent":true,"supportsStartDebuggingRequest":true},"type":"request","seq":1} [DEBUG codelldb::dap_codec] <-- {"seq":1,"type":"response","request_seq":1,"success":true,"command":"initialize","body":{"exceptionBreakpointFilters":[{"default":true,"filter":"cpp_throw","label":"C++: on throw"},{"default":false,"filter":"cpp_catch","label":"C++: on catch"}],"supportTerminateDebuggee":true,"supportsCancelRequest":true,"supportsCompletionsRequest":true,"supportsConditionalBreakpoints":true,"supportsConfigurationDoneRequest":true,"supportsDataBreakpoints":true,"supportsDelayedStackTraceLoading":true,"supportsDisassembleRequest":true,"supportsEvaluateForHovers":true,"supportsFunctionBreakpoints":true,"supportsGotoTargetsRequest":true,"supportsHitConditionalBreakpoints":true,"supportsInstructionBreakpoints":true,"supportsLogPoints":true,"supportsReadMemoryRequest":true,"supportsRestartFrame":true,"supportsSetVariable":true,"supportsSteppingGranularity":true,"supportsWriteMemoryRequest":true}} [DEBUG codelldb::dap_codec] --> {"command":"launch","arguments":{"type":"lldb","request":"launch","name":"Debug","program":"/root/cTest/build/test","args":[],"cwd":"/root/cTest","__configurationTarget":6,"relativePathBase":"/root/cTest","_adapterSettings":{"displayFormat":"auto","showDisassembly":"auto","dereferencePointers":true,"suppressMissingSourceFiles":true,"evaluationTimeout":5,"consoleMode":"commands","sourceLanguages":null,"terminalPromptClear":null,"evaluateForHovers":true,"commandCompletions":true,"reproducer":false},"__sessionId":"534be58d-b247-4c8b-95c7-2a78a8212602"},"type":"request","seq":2} [DEBUG codelldb::dap_codec] <-- {"seq":2,"type":"event","event":"output","body":{"output":"Console is in 'commands' mode, prefix expressions with '?'.\n"}} INFO(Python) 01:46:21 formatters: Initializing INFO(Python) 01:46:21 formatters.rust: Initializing [DEBUG codelldb::dap_codec] <-- {"seq":3,"type":"event","event":"initialized"} [DEBUG codelldb::debug_session] Debug event: 0x7fffe5fdf678 Event: broadcaster = 0x7fffe5fad570 (lldb.target), type = 0x00000002 (modules-loaded), data = {test} [DEBUG codelldb::dap_codec] <-- {"seq":4,"type":"event","event":"module","body":{"module":{"addressRange":"FFFFFFFFFFFFFFFF","id":"FFFFFFFFFFFFFFFF","name":"test","path":"/root/cTest/build/test","symbolFilePath":"/root/cTest/build/test","symbolStatus":"Symbols loaded."},"reason":"new"}} [DEBUG codelldb::dap_codec] <-- {"seq":5,"type":"request","command":"runInTerminal","arguments":{"args":["/root/.vscode-server/extensions/vadimcn.vscode-lldb-1.9.1/adapter/codelldb","terminal-agent","--connect=3954"],"cwd":"","kind":"integrated","title":"Debug"}} [DEBUG codelldb::dap_codec] --> {"command":"setBreakpoints","arguments":{"source":{"name":"main.cpp","path":"/root/cTest/main.cpp"},"lines":[10],"breakpoints":[{"line":10}],"sourceModified":false},"type":"request","seq":3} [DEBUG codelldb::dap_codec] --> {"command":"setFunctionBreakpoints","arguments":{"breakpoints":[]},"type":"request","seq":4} [DEBUG codelldb::dap_codec] --> {"command":"setDataBreakpoints","arguments":{"breakpoints":[]},"type":"request","seq":5} [DEBUG codelldb::dap_codec] --> {"command":"setInstructionBreakpoints","arguments":{"breakpoints":[]},"type":"request","seq":6} [DEBUG codelldb::dap_codec] --> {"command":"setExceptionBreakpoints","arguments":{"filters":[]},"type":"request","seq":7} [DEBUG codelldb::dap_codec] <-- {"seq":6,"type":"response","request_seq":3,"success":true,"command":"setBreakpoints","body":{"breakpoints":[{"id":1,"line":10,"message":"Resolved locations: 0","verified":true}]}} [DEBUG codelldb::debug_session] Debug event: 0x7f9f280024e8 Event: broadcaster = 0x7fffe5fad570 (lldb.target), type = 0x00000001 (breakpoint-changed), data = {bkpt: 1 type: breakpoint added} [DEBUG codelldb::dap_codec] <-- {"seq":7,"type":"response","request_seq":4,"success":true,"command":"setFunctionBreakpoints","body":{"breakpoints":[]}} [DEBUG codelldb::dap_codec] <-- {"seq":8,"type":"response","request_seq":5,"success":true,"command":"setDataBreakpoints","body":{"breakpoints":[]}} [DEBUG codelldb::dap_codec] <-- {"seq":9,"type":"response","request_seq":6,"success":true,"command":"setInstructionBreakpoints","body":{"breakpoints":[]}} [DEBUG codelldb::dap_codec] <-- {"seq":10,"type":"response","request_seq":7,"success":true,"command":"setExceptionBreakpoints"} [DEBUG codelldb::dap_codec] --> {"type":"response","seq":8,"command":"runInTerminal","request_seq":5,"success":true,"body":{"shellProcessId":3668}} [DEBUG codelldb::dap_codec] --> {"command":"configurationDone","type":"request","seq":9} [DEBUG codelldb::dap_codec] <-- {"seq":11,"type":"event","event":"output","body":{"output":"Launching: /root/cTest/build/test\n"}} [DEBUG codelldb::dap_codec] <-- {"seq":12,"type":"event","event":"output","body":{"output":"Launched process 4186\n"}} [DEBUG codelldb::debug_session] Debug event: 0x7fffe704caa8 Event: broadcaster = 0x7fffe5fad570 (lldb.target), type = 0x00000002 (modules-loaded), data = {ld-2.27.so} [DEBUG codelldb::dap_codec] <-- {"seq":13,"type":"response","request_seq":2,"success":true,"command":"launch"} [DEBUG codelldb::debug_session] Debug event: 0x7fffe70c8528 Event: broadcaster = 0x7fffe5fad570 (lldb.target), type = 0x00000002 (modules-loaded), data = {vdso} [DEBUG codelldb::debug_session] Debug event: 0x7fffe70c84d8 Event: broadcaster = 0x7fffe5fad570 (lldb.target), type = 0x00000001 (breakpoint-changed), data = {bkpt: 1 type: locations resolved} [DEBUG codelldb::dap_codec] <-- {"seq":14,"type":"response","request_seq":9,"success":true,"command":"configurationDone"} [DEBUG codelldb::dap_codec] <-- {"seq":15,"type":"event","event":"module","body":{"module":{"addressRange":"7FFFFF400000","id":"7FFFFF400000","name":"ld-2.27.so","path":"/lib/x86_64-linux-gnu/ld-2.27.so","symbolFilePath":"/usr/lib/debug/lib/x86_64-linux-gnu/ld-2.27.so","symbolStatus":"Symbols loaded."},"reason":"new"}} [DEBUG codelldb::debug_session] Debug event: 0x7fffe70c87e8 Event: broadcaster = 0x7fffe5fad570 (lldb.target), type = 0x00000002 (modules-loaded), data = {test} [DEBUG codelldb::debug_session] Debug event: 0x7fffe70ca5e0 Event: broadcaster = 0x7fffe6c48b28 (lldb.process), type = 0x00000001 (state-changed), data = { process = 0x7fffe6c48af0 (pid = 4186), state = running} [DEBUG codelldb::dap_codec] <-- {"seq":16,"type":"event","event":"module","body":{"module":{"addressRange":"7FFFFFFEF000","id":"7FFFFFFEF000","name":"[vdso]","path":"[vdso]","symbolStatus":"Symbols not found"},"reason":"new"}} [DEBUG codelldb::dap_codec] <-- {"seq":17,"type":"event","event":"breakpoint","body":{"breakpoint":{"id":1,"line":10,"message":"Resolved locations: 1","verified":true},"reason":"changed"}} [DEBUG codelldb::dap_codec] <-- {"seq":18,"type":"event","event":"module","body":{"module":{"addressRange":"400000","id":"400000","name":"test","path":"/root/cTest/build/test","symbolFilePath":"/root/cTest/build/test","symbolStatus":"Symbols loaded."},"reason":"new"}} [DEBUG codelldb::dap_codec] <-- {"seq":19,"type":"event","event":"continued","body":{"allThreadsContinued":true,"threadId":0}} [DEBUG codelldb::dap_codec] --> {"command":"threads","type":"request","seq":10} [DEBUG codelldb::dap_codec] <-- {"seq":20,"type":"response","request_seq":10,"success":true,"command":"threads","body":{"threads":[{"id":4186,"name":"1: tid=4186 \"test\""}]}} [ERROR codelldb::debug_session] [501] channel closed [DEBUG codelldb::debug_session] End of the requests stream [DEBUG codelldb::debug_session] DebugSession::drop() [DEBUG codelldb] End of the debug session [DEBUG codelldb] Exiting Debug adapter exit code=0 (0x0), signal=null.

ab503044120 commented 1 year ago

wsl1 don't support lldb