codelldb icon indicating copy to clipboard operation
codelldb copied to clipboard

Can't hit breakpoints when using lldb but gdb can

Open liusj5257 opened this issue 2 years ago • 2 comments

OS: win11 21h2 VSCode version: 1.70.2 CodeLLDB version: 1.7.4 Compiler: clang 14.0.6 x86_64-w64-windows-gnu Debuggee: .exe

While using lldb , the breakpoints are not getting hit . And I add "stopOnEntry": true to the launch file ,it stopped on entry, but the breakpoints are not getting hit . At last ,I try gdb and all the breakpoints can get hit.

Verbose log
Initial debug configuration: {
  type: 'lldb',
  request: 'launch',
  name: 'lldb',
  program: '${workspaceFolder}/BIN/${fileBasenameNoExtension}',
  args: [],
  cwd: '${fileDirname}',
  stopOnEntry: true,
  __configurationTarget: 6
}
Resolved debug configuration: {
  type: 'lldb',
  request: 'launch',
  name: 'lldb',
  program: '${workspaceFolder}/BIN/${fileBasenameNoExtension}',
  args: [],
  cwd: '${fileDirname}',
  stopOnEntry: true,
  __configurationTarget: 6,
  expressions: 'simple',
  relativePathBase: 'e:\\CANOE\\GCC',
  _adapterSettings: {
    displayFormat: 'auto',
    showDisassembly: 'never',
    dereferencePointers: true,
    suppressMissingSourceFiles: true,
    evaluationTimeout: 5,
    consoleMode: 'commands',
    sourceLanguages: null,
    terminalPromptClear: null,
    evaluateForHovers: true,
    commandCompletions: true,
    reproducer: false
  }
}
liblldb: c:\Users\LIU-S\.vscode\extensions\vadimcn.vscode-lldb-1.7.4\lldb\bin\liblldb.dll
environment: {}
params: { evaluateForHovers: true, commandCompletions: true }
[2022-08-29T01:02:45.650Z DEBUG codelldb] New debug session
[2022-08-29T01:02:45.828Z 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":"zh-cn","supportsProgressReporting":true,"supportsInvalidatedEvent":true,"supportsMemoryReferences":true,"supportsArgsCanBeInterpretedByShell":true},"type":"request","seq":1}
[2022-08-29T01:02:45.828Z DEBUG codelldb::dap_codec]  {"command":"launch","arguments":{"type":"lldb","request":"launch","name":"lldb","program":"E:\\CANOE\\GCC/BIN/CLOSE","args":[],"cwd":"e:\\CANOE\\GCC\\Source\\REMOTE","stopOnEntry":true,"__configurationTarget":6,"expressions":"simple","relativePathBase":"e:\\CANOE\\GCC","_adapterSettings":{"displayFormat":"auto","showDisassembly":"never","dereferencePointers":true,"suppressMissingSourceFiles":true,"evaluationTimeout":5,"consoleMode":"commands","sourceLanguages":null,"terminalPromptClear":null,"evaluateForHovers":true,"commandCompletions":true,"reproducer":false},"__sessionId":"b0d7da5c-a1a3-4e0f-b327-f44b6d8acefe"},"type":"request","seq":2}
[2022-08-29T01:02:45.844Z DEBUG codelldb::dap_codec]  {"command":"setBreakpoints","arguments":{"source":{"name":"CLOSE.C","path":"e:\\CANOE\\GCC\\Source\\REMOTE\\CLOSE.C"},"lines":[10,11,12,13,14],"breakpoints":[{"line":10},{"line":11},{"line":12},{"line":13},{"line":14}],"sourceModified":false},"type":"request","seq":3}
[2022-08-29T01:02:45.906Z DEBUG codelldb::debug_session] Debug event: 00000239395BC730 Event: broadcaster = 00000239390E40C8 (lldb.target), type = 0x00000001 (breakpoint-changed), data = {}
[2022-08-29T01:02:45.906Z DEBUG codelldb::dap_codec]  {"type":"response","seq":4,"command":"runInTerminal","request_seq":5,"success":true,"body":{"shellProcessId":25252}}
[2022-08-29T01:02:45.949Z DEBUG codelldb::dap_codec] --> {"command":"setFunctionBreakpoints","arguments":{"breakpoints":[]},"type":"request","seq":5}
[2022-08-29T01:02:45.949Z DEBUG codelldb::dap_codec]  {"command":"setDataBreakpoints","arguments":{"breakpoints":[]},"type":"request","seq":6}
[2022-08-29T01:02:45.997Z DEBUG codelldb::dap_codec]  {"command":"setExceptionBreakpoints","arguments":{"filters":["cpp_throw"]},"type":"request","seq":7}
[2022-08-29T01:02:46.051Z DEBUG codelldb::dap_codec]  {"command":"configurationDone","type":"request","seq":8}
[2022-08-29T01:02:46.054Z DEBUG codelldb::dap_codec]  {"command":"threads","type":"request","seq":9}
[2022-08-29T01:02:46.117Z DEBUG codelldb::dap_codec]  {"command":"threads","type":"request","seq":10}
[2022-08-29T01:02:46.123Z DEBUG codelldb::dap_codec]  {"command":"threads","type":"request","seq":11}
[2022-08-29T01:02:46.143Z DEBUG codelldb::dap_codec]  {"command":"stackTrace","arguments":{"threadId":14436,"startFrame":0,"levels":1},"type":"request","seq":12}
[2022-08-29T01:02:46.149Z DEBUG codelldb::dap_codec]  {"command":"cancel","arguments":{"requestId":12},"type":"request","seq":13}
[2022-08-29T01:02:46.165Z INFO  codelldb::debug_session] Cancellation CancelArguments { progress_id: None, request_id: Some(12) }
[2022-08-29T01:02:46.165Z DEBUG codelldb::dap_codec] --> {"command":"stackTrace","arguments":{"threadId":14436,"startFrame":0,"levels":1},"type":"request","seq":14}
[2022-08-29T01:02:46.165Z DEBUG codelldb::dap_codec]  {"command":"scopes","arguments":{"frameId":1002},"type":"request","seq":15}
[2022-08-29T01:02:46.619Z DEBUG codelldb::dap_codec]  {"command":"variables","arguments":{"variablesReference":1003},"type":"request","seq":16}
[2022-08-29T01:02:46.623Z DEBUG codelldb::dap_codec]  {"command":"stackTrace","arguments":{"threadId":14436,"startFrame":1,"levels":19},"type":"request","seq":17}
[2022-08-29T01:02:46.638Z DEBUG codelldb::dap_codec]  {"command":"continue","arguments":{"threadId":14436},"type":"request","seq":18}
[2022-08-29T01:03:39.266Z DEBUG codelldb::dap_codec]  {"command":"disconnect","arguments":{"restart":false,"terminateDebuggee":false},"type":"request","seq":19}
[2022-08-29T01:03:39.315Z DEBUG codelldb::dap_codec] 

liusj5257 avatar Aug 29 '22 01:08 liusj5257

I have the same problem, and I was able to work around it by adding this to the launch.json configuration:

"sourceMap": {"/": "c:\\"}

It looks like this bug is already fixed in LLVM 15: https://github.com/llvm/llvm-project/commit/b548f5847235118878c15caa8df1b89e75fc965b

jscissr avatar Sep 01 '22 19:09 jscissr

I have the same problem, and I was able to work around it by adding this to the launch.json configuration:

"sourceMap": {"/": "c:\\"}

It looks like this bug is already fixed in LLVM 15: llvm/llvm-project@b548f58

Thanks , but it looks like not work for me.

liusj5257 avatar Sep 07 '22 01:09 liusj5257