Skip to content

[lldb-dap] Failed to get dataBreakpointInfo #147104

@DrSergei

Description

@DrSergei

VSCode doesn’t send repeated Scopes requests for a frame, so the frame from the last Scopes request is selected even after changing frames in the UI. This causes problems with DataBreakpointInfo requests because lldb-dap cannot find variables in this frame. I think the solution is to add frameId to scope's variables reference, allowing scopes from different frames to be distinguished.

1751656819.835361481 (stdio) --> {"command":"initialize","arguments":{"clientID":"vscode","clientName":"Visual Studio Code","adapterID":"lldb-dap","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,"supportsANSIStyling":true},"type":"request","seq":1}
1751656819.841649294 (stdio) <-- {"body":{"$__lldb_version":"lldb version 21.0.0git ([email protected]:DrSergei/llvm-project.git revision 2fe0feb84875189478d8dd998cc992fa76562709)\n  clang revision 2fe0feb84875189478d8dd998cc992fa76562709\n  llvm revision 2fe0feb84875189478d8dd998cc992fa76562709","completionTriggerCharacters":["."," ","\t"],"exceptionBreakpointFilters":[{"description":"C++ Catch","filter":"cpp_catch","label":"C++ Catch","supportsCondition":true},{"description":"C++ Throw","filter":"cpp_throw","label":"C++ Throw","supportsCondition":true},{"description":"Objective-C Catch","filter":"objc_catch","label":"Objective-C Catch","supportsCondition":true},{"description":"Objective-C Throw","filter":"objc_throw","label":"Objective-C Throw","supportsCondition":true}],"supportTerminateDebuggee":true,"supportsBreakpointLocationsRequest":true,"supportsCancelRequest":true,"supportsCompletionsRequest":true,"supportsConditionalBreakpoints":true,"supportsConfigurationDoneRequest":true,"supportsDataBreakpoints":true,"supportsDelayedStackTraceLoading":true,"supportsDisassembleRequest":true,"supportsEvaluateForHovers":true,"supportsExceptionFilterOptions":true,"supportsExceptionInfoRequest":true,"supportsFunctionBreakpoints":true,"supportsHitConditionalBreakpoints":true,"supportsInstructionBreakpoints":true,"supportsLogPoints":true,"supportsModulesRequest":true,"supportsReadMemoryRequest":true,"supportsSetVariable":true,"supportsSteppingGranularity":true,"supportsValueFormattingOptions":true},"command":"initialize","request_seq":1,"seq":0,"success":true,"type":"response"}
1751656819.865692139 (stdio) --> {"command":"launch","arguments":{"type":"lldb-dap","request":"launch","name":"Launch (lldb-dap)","program":"/home/sergei/test/main.exe","args":[],"cwd":"/home/sergei/test","__configurationTarget":6,"__sessionId":"1d322a1d-6257-4ab3-bfd8-eb4e94686993"},"type":"request","seq":2}
1751656819.956820011 (stdio) <-- {"command":"launch","request_seq":2,"seq":0,"success":true,"type":"response"}
1751656819.956956387 (stdio) <-- {"body":{"module":{"addressRange":"0x7ffff7fc5000","debugInfoSize":"526.0KB","id":"1C8DB5F8-3BBA-514F-8FD5-F1FB6D7BE975-BE1BB855","name":"ld-linux-x86-64.so.2","path":"/usr/lib/x86_64-linux-gnu/ld-linux-x86-64.so.2","symbolFilePath":"/usr/lib/debug/.build-id/1c/8db5f83bba514f8fd5f1fb6d7be975be1bb855.debug","symbolStatus":"Symbols loaded."},"reason":"new"},"event":"module","seq":0,"type":"event"}
1751656819.956998587 (stdio) <-- {"event":"initialized","seq":0,"type":"event"}
1751656819.957040787 (stdio) <-- {"body":{"module":{"addressRange":"0x7ffff7fc3000","id":"276A2448-B2D5-2819-E052-4FB46CFC1168-4A23D111","name":"[vdso]","path":"[vdso]","symbolStatus":"Symbols not found."},"reason":"new"},"event":"module","seq":0,"type":"event"}
1751656819.957118034 (stdio) <-- {"body":{"module":{"addressRange":"0x555555554000","debugInfoSize":"725B","id":"EF51F15C-BFD8-FC78-7717-9F6D4A0D777B-EBB08E8A","name":"main.exe","path":"/home/sergei/test/main.exe","symbolFilePath":"/home/sergei/test/main.exe","symbolStatus":"Symbols loaded."},"reason":"new"},"event":"module","seq":0,"type":"event"}
1751656819.980591536 (stdio) --> {"command":"setBreakpoints","arguments":{"source":{"name":"main.cpp","path":"/home/sergei/test/main.cpp"},"lines":[3],"breakpoints":[{"line":3}],"sourceModified":false},"type":"request","seq":3}
1751656819.980821848 (stdio) --> {"command":"setFunctionBreakpoints","arguments":{"breakpoints":[]},"type":"request","seq":4}
1751656819.980875015 (stdio) --> {"command":"setInstructionBreakpoints","arguments":{"breakpoints":[]},"type":"request","seq":5}
1751656819.980926752 (stdio) --> {"command":"setExceptionBreakpoints","arguments":{"filters":[],"filterOptions":[]},"type":"request","seq":6}
1751656819.980949879 (stdio) --> {"command":"setDataBreakpoints","arguments":{"breakpoints":[]},"type":"request","seq":7}
1751656819.989525795 (stdio) <-- {"body":{"breakpoints":[{"column":12,"id":1,"instructionReference":"0x555555555138","line":3,"source":{"name":"main.cpp","path":"/home/sergei/test/main.cpp"},"verified":true}]},"command":"setBreakpoints","request_seq":3,"seq":0,"success":true,"type":"response"}
1751656819.989787340 (stdio) <-- {"body":{"breakpoints":[]},"command":"setFunctionBreakpoints","request_seq":4,"seq":0,"success":true,"type":"response"}
1751656819.989926100 (stdio) <-- {"body":{"breakpoints":[]},"command":"setInstructionBreakpoints","request_seq":5,"seq":0,"success":true,"type":"response"}
1751656819.990063429 (stdio) <-- {"body":{},"command":"setExceptionBreakpoints","request_seq":6,"seq":0,"success":true,"type":"response"}
1751656819.990155935 (stdio) <-- {"body":{"breakpoint":{"column":12,"id":1,"instructionReference":"0x555555555138","line":3,"verified":true},"reason":"changed"},"event":"breakpoint","seq":0,"type":"event"}
1751656819.990191460 (stdio) <-- {"body":{"breakpoints":[]},"command":"setDataBreakpoints","request_seq":7,"seq":0,"success":true,"type":"response"}
1751656820.045519352 (stdio) --> {"command":"breakpointLocations","arguments":{"source":{"name":"main.cpp","path":"/home/sergei/test/main.cpp"},"line":3},"type":"request","seq":8}
1751656820.045915842 (stdio) <-- {"body":{"breakpoints":[{"column":12,"line":3}]},"command":"breakpointLocations","request_seq":8,"seq":0,"success":true,"type":"response"}
1751656820.076243401 (stdio) --> {"command":"breakpointLocations","arguments":{"source":{"name":"main.cpp","path":"/home/sergei/test/main.cpp"},"line":3},"type":"request","seq":9}
1751656820.076744080 (stdio) <-- {"body":{"breakpoints":[{"column":12,"line":3}]},"command":"breakpointLocations","request_seq":9,"seq":0,"success":true,"type":"response"}
1751656820.095665932 (stdio) --> {"command":"configurationDone","type":"request","seq":10}
1751656820.096032619 (stdio) <-- {"body":{"capabilities":{"supportsRestartRequest":true,"supportsStepInTargetsRequest":true}},"event":"capabilities","seq":0,"type":"event"}
1751656820.096253872 (stdio) <-- {"body":{"isLocalProcess":true,"name":"/home/sergei/test/main.exe","startMethod":"launch","systemProcessId":32442},"event":"process","seq":0,"type":"event"}
1751656820.096753836 (stdio) <-- {"command":"configurationDone","request_seq":10,"seq":0,"success":true,"type":"response"}
1751656820.119818926 (stdio) --> {"command":"breakpointLocations","arguments":{"source":{"name":"main.cpp","path":"/home/sergei/test/main.cpp"},"line":3},"type":"request","seq":11}
1751656820.120085001 (stdio) --> {"command":"threads","type":"request","seq":12}
1751656820.121870041 (stdio) <-- {"body":{"breakpoints":[{"column":12,"line":3}]},"command":"breakpointLocations","request_seq":11,"seq":0,"success":true,"type":"response"}
1751656820.122054338 (stdio) <-- {"body":{"threads":[{"id":32442,"name":"main.exe"}]},"command":"threads","request_seq":12,"seq":0,"success":true,"type":"response"}
1751656820.363988876 (stdio) <-- {"body":{"module":{"addressRange":"0x7ffff7d9b000","debugInfoSize":"3.5MB","id":"42C84C92-E6F9-8126-B3E2-230EBFDEAD22-C235B667","name":"libc.so.6","path":"/lib/x86_64-linux-gnu/libc.so.6","symbolFilePath":"/usr/lib/debug/.build-id/42/c84c92e6f98126b3e2230ebfdead22c235b667.debug","symbolStatus":"Symbols loaded."},"reason":"new"},"event":"module","seq":0,"type":"event"}
1751656820.368147850 (stdio) <-- {"body":{"allThreadsStopped":true,"description":"breakpoint 1.1","hitBreakpointIds":[1],"preserveFocusHint":false,"reason":"breakpoint","threadCausedFocus":true,"threadId":32442},"event":"stopped","seq":0,"type":"event"}
1751656820.373748064 (stdio) --> {"command":"threads","type":"request","seq":13}
1751656820.374249220 (stdio) <-- {"body":{"threads":[{"id":32442,"name":"main.exe"}]},"command":"threads","request_seq":13,"seq":0,"success":true,"type":"response"}
1751656820.383546829 (stdio) --> {"command":"stackTrace","arguments":{"threadId":32442,"startFrame":0,"levels":1},"type":"request","seq":14}
1751656820.384087086 (stdio) <-- {"body":{"stackFrames":[{"column":12,"id":524288,"instructionPointerReference":"0x555555555138","line":3,"name":"f1()","source":{"name":"main.cpp","path":"/home/sergei/test/main.cpp"}}],"totalFrames":21},"command":"stackTrace","request_seq":14,"seq":0,"success":true,"type":"response"}
1751656820.425847530 (stdio) --> {"command":"breakpointLocations","arguments":{"source":{"name":"main.cpp","path":"/home/sergei/test/main.cpp"},"line":3},"type":"request","seq":15}
1751656820.426809549 (stdio) <-- {"body":{"breakpoints":[{"column":12,"line":3}]},"command":"breakpointLocations","request_seq":15,"seq":0,"success":true,"type":"response"}
1751656820.799609423 (stdio) --> {"command":"scopes","arguments":{"frameId":524288},"type":"request","seq":16}
1751656820.800187826 (stdio) <-- {"body":{"scopes":[{"expensive":false,"name":"Locals","namedVariables":1,"presentationHint":"locals","variablesReference":1},{"expensive":false,"name":"Globals","namedVariables":0,"variablesReference":2},{"expensive":false,"name":"Registers","namedVariables":3,"presentationHint":"registers","variablesReference":3}]},"command":"scopes","request_seq":16,"seq":0,"success":true,"type":"response"}
1751656820.812552214 (stdio) --> {"command":"variables","arguments":{"variablesReference":1},"type":"request","seq":17}
1751656820.812761784 (stdio) --> {"command":"stackTrace","arguments":{"threadId":32442,"startFrame":1,"levels":19},"type":"request","seq":18}
1751656820.858426094 (stdio) <-- {"body":{"variables":[{"$__lldb_extensions":{"declaration":{"column":9,"line":2,"path":"/home/sergei/test/main.cpp"},"value":"1"},"declarationLocationReference":8,"evaluateName":"a","id":4,"memoryReference":"0x7FFFFFFFDA6C","name":"a","type":"int","value":"1","variablesReference":0}]},"command":"variables","request_seq":17,"seq":0,"success":true,"type":"response"}
1751656820.867719889 (stdio) <-- {"body":{"stackFrames":[{"column":7,"id":524289,"instructionPointerReference":"0x555555555155","line":8,"name":"f2()","source":{"name":"main.cpp","path":"/home/sergei/test/main.cpp"}},{"column":7,"id":524290,"instructionPointerReference":"0x555555555172","line":14,"name":"f3()","source":{"name":"main.cpp","path":"/home/sergei/test/main.cpp"}},{"column":7,"id":524291,"instructionPointerReference":"0x555555555184","line":19,"name":"main","source":{"name":"main.cpp","path":"/home/sergei/test/main.cpp"}},{"column":16,"id":524292,"instructionPointerReference":"0x7FFFF7DC51CA","line":58,"name":"__libc_start_call_main","source":{"name":"libc_start_call_main.h","path":"sysdeps/nptl/libc_start_call_main.h"}},{"column":3,"id":524293,"instructionPointerReference":"0x7FFFF7DC528B","line":360,"name":"__libc_start_main_impl","source":{"name":"libc-start.c","path":"csu/libc-start.c"}},{"column":1,"id":524294,"instructionPointerReference":"0x555555555065","line":13,"name":"_start","source":{"name":"_start","path":"/home/sergei/test/main.exe`_start","presentationHint":"deemphasize","sourceReference":1}}],"totalFrames":7},"command":"stackTrace","request_seq":18,"seq":0,"success":true,"type":"response"}
1751656822.432814121 (stdio) --> {"command":"dataBreakpointInfo","arguments":{"name":"a","variablesReference":1},"type":"request","seq":19}
1751656822.433374405 (stdio) <-- {"body":{"accessTypes":["read","write","readWrite"],"dataId":"7FFFFFFFDA6C/4","description":"4 bytes at 7FFFFFFFDA6C a"},"command":"dataBreakpointInfo","request_seq":19,"seq":0,"success":true,"type":"response"}
1751656826.074514151 (stdio) --> {"command":"scopes","arguments":{"frameId":524289},"type":"request","seq":20}
1751656826.075013876 (stdio) <-- {"body":{"scopes":[{"expensive":false,"name":"Locals","namedVariables":1,"presentationHint":"locals","variablesReference":1},{"expensive":false,"name":"Globals","namedVariables":0,"variablesReference":2},{"expensive":false,"name":"Registers","namedVariables":3,"presentationHint":"registers","variablesReference":3}]},"command":"scopes","request_seq":20,"seq":0,"success":true,"type":"response"}
1751656826.078428268 (stdio) --> {"command":"variables","arguments":{"variablesReference":1},"type":"request","seq":21}
1751656826.078998327 (stdio) <-- {"body":{"variables":[{"$__lldb_extensions":{"declaration":{"column":9,"line":7,"path":"/home/sergei/test/main.cpp"},"value":"2"},"declarationLocationReference":10,"evaluateName":"b","id":5,"memoryReference":"0x7FFFFFFFDA8C","name":"b","type":"int","value":"2","variablesReference":0}]},"command":"variables","request_seq":21,"seq":0,"success":true,"type":"response"}
1751656828.276206255 (stdio) --> {"command":"dataBreakpointInfo","arguments":{"name":"b","variablesReference":1},"type":"request","seq":22}
1751656828.276531219 (stdio) <-- {"body":{"accessTypes":["read","write","readWrite"],"dataId":"7FFFFFFFDA8C/4","description":"4 bytes at 7FFFFFFFDA8C b"},"command":"dataBreakpointInfo","request_seq":22,"seq":0,"success":true,"type":"response"}
1751656830.185382843 (stdio) --> {"command":"scopes","arguments":{"frameId":524290},"type":"request","seq":23}
1751656830.186013460 (stdio) <-- {"body":{"scopes":[{"expensive":false,"name":"Locals","namedVariables":1,"presentationHint":"locals","variablesReference":1},{"expensive":false,"name":"Globals","namedVariables":0,"variablesReference":2},{"expensive":false,"name":"Registers","namedVariables":3,"presentationHint":"registers","variablesReference":3}]},"command":"scopes","request_seq":23,"seq":0,"success":true,"type":"response"}
1751656830.190769672 (stdio) --> {"command":"variables","arguments":{"variablesReference":1},"type":"request","seq":24}
1751656830.191405535 (stdio) <-- {"body":{"variables":[{"$__lldb_extensions":{"declaration":{"column":9,"line":13,"path":"/home/sergei/test/main.cpp"},"value":"3"},"declarationLocationReference":12,"evaluateName":"c","id":6,"memoryReference":"0x7FFFFFFFDAAC","name":"c","type":"int","value":"3","variablesReference":0}]},"command":"variables","request_seq":24,"seq":0,"success":true,"type":"response"}
1751656831.617709160 (stdio) --> {"command":"dataBreakpointInfo","arguments":{"name":"c","variablesReference":1},"type":"request","seq":25}
1751656831.618343592 (stdio) <-- {"body":{"accessTypes":["read","write","readWrite"],"dataId":"7FFFFFFFDAAC/4","description":"4 bytes at 7FFFFFFFDAAC c"},"command":"dataBreakpointInfo","request_seq":25,"seq":0,"success":true,"type":"response"}
1751656833.738955975 (stdio) --> {"command":"scopes","arguments":{"frameId":524291},"type":"request","seq":26}
1751656833.739639997 (stdio) <-- {"body":{"scopes":[{"expensive":false,"name":"Locals","namedVariables":0,"presentationHint":"locals","variablesReference":1},{"expensive":false,"name":"Globals","namedVariables":0,"variablesReference":2},{"expensive":false,"name":"Registers","namedVariables":3,"presentationHint":"registers","variablesReference":3}]},"command":"scopes","request_seq":26,"seq":0,"success":true,"type":"response"}
1751656833.745048523 (stdio) --> {"command":"variables","arguments":{"variablesReference":1},"type":"request","seq":27}
1751656833.745321989 (stdio) <-- {"body":{"variables":[]},"command":"variables","request_seq":27,"seq":0,"success":true,"type":"response"}
1751656840.133133650 (stdio) --> {"command":"dataBreakpointInfo","arguments":{"name":"a","variablesReference":1},"type":"request","seq":28}
1751656840.133486271 (stdio) <-- {"body":{"dataId":null,"description":"variable not found: a"},"command":"dataBreakpointInfo","request_seq":28,"seq":0,"success":true,"type":"response"}

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions