microsoft / microsoft/vscode-cpptools
Debugger crashes when trying to navigate into code in dll
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 6.2k
- Forks
- 1.7k
- Avg merge
- 14h 46m
- Merged PRs (30d)
- 61
Description
Type: Debugger
Describe the bug
- Version Info
Version: 1.47.3 (system setup)
Commit: 91899dcef7b8110878ea59626991a18c8a6a1b3e
Date: 2020-07-23T13:12:49.994Z
Electron: 7.3.2
Chrome: 78.0.3904.130
Node.js: 12.8.1
V8: 7.8.279.23-electron.0
OS: Windows_NT x64 10.0.18363
- C/C++ Extension Version: v0.29.0
- Other extensions you installed (and if the issue persists after disabling them): Only 2 extensions enabled (cpp tools, ms-vscode.cmake-tools)
A clear and concise description of what the bug is.
Cannot navigate into the source of dll built with Debug. Error produced.

To Reproduce
Please include a code sample and launch.json configuration.
Library
//// lib.h
#include <iostream>
class __declspec(dllexport) Test
{
public:
Test();
};
//// lib.cpp
#include "lib.h"
Test::Test()
{
printf("Hello world");
}
Client App
//// src.cpp
#include "lib.h"
int main()
{
Test *a = new Test(); // breakpoint set here; and then F11 is pressed
}
CMakeLists.txt
cmake_minimum_required(VERSION 3.0.0)
project(test_lib VERSION 0.1.0)
include(CTest)
enable_testing()
add_library(test_lib SHARED lib.cpp)
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /DEBUG:FULL")
message("DEBUG FLAGS : ${CMAKE_CXX_FLAGS_DEBUG}") // DEBUG FLAGS : /MDd /Zi /Ob0 /Od /RTC1 /DEBUG:FULL
message("RELEASE FLAGS : ${CMAKE_CXX_FLAGS_RELEASE}") // RELEASE FLAGS : /MD /O2 /Ob2 /DNDEBUG
set(CPACK_PROJECT_NAME ${PROJECT_NAME})
set(CPACK_PROJECT_VERSION ${PROJECT_VERSION})
include(CPack)
add_executable(client_app src.cpp)
target_link_libraries(client_app test_lib)
launch.json
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "(Windows) Launch",
"type": "cppvsdbg",
"request": "launch",
"program": "${command:cmake.launchTargetDirectory}/client_app.exe",
"args": [],
"stopAtEntry": false,
"cwd": "${workspaceFolder}",
"environment": [],
"externalConsole": false,
"logging": {
"engineLogging": true,
"trace" : true,
"traceResponse" : true
}
}
]
}
Additional context
If applicable, please include logging by adding "logging": { "engineLogging": true, "trace": true, "traceResponse": true } in your launch.json
Add any other context about the problem here including log or error messages in your Debug Console or Output windows.
Debug Console
<- (E) {"seq":2,"type":"event","event":"output","body":{"category":"console","output":"-------------------------------------------------------------------\nYou may only use the C/C++ Extension for Visual Studio Code\nwith Visual Studio Code, Visual Studio or Visual Studio for Mac\nsoftware to help you develop and test your applications.\n-------------------------------------------------------------------\n"}}
-------------------------------------------------------------------
You may only use the C/C++ Extension for Visual Studio Code
with Visual Studio Code, Visual Studio or Visual Studio for Mac
software to help you develop and test your applications.
-------------------------------------------------------------------
<- (R) {"seq":4,"type":"response","request_seq":2,"success":true,"command":"launch"}
-> (C) {"type":"response","seq":1,"command":"handshake","request_seq":1,"success":true,"body":{"signature":"441IkfMH+q14GjKxpNYdYsz8HFi+mqUxX+rpOIDrU3WEc0="}}
<- (E) {"seq":7,"type":"event","event":"initialized","body":{}}
-> (C) {"command":"setBreakpoints","arguments":{"source":{"name":"src.cpp","path":"d:\\Projects\\Miscellaneous\\test\\src.cpp"},"lines":[5],"breakpoints":[{"line":5}],"sourceModified":false},"type":"request","seq":3}
<- (R) {"seq":10,"type":"response","request_seq":3,"success":true,"command":"setBreakpoints","message":"","body":{"breakpoints":[{"id":1,"verified":false,"message":"The breakpoint is pending and will be resolved when debugging starts.","line":5}]}}
-> (C) {"command":"setFunctionBreakpoints","arguments":{"breakpoints":[]},"type":"request","seq":4}
<- (R) {"seq":13,"type":"response","request_seq":4,"success":true,"command":"setFunctionBreakpoints","message":"","body":{"breakpoints":[]}}
-> (C) {"command":"setExceptionBreakpoints","arguments":{"filters":[]},"type":"request","seq":5}
<- (R) {"seq":16,"type":"response","request_seq":5,"success":true,"command":"setExceptionBreakpoints"}
-> (C) {"command":"configurationDone","type":"request","seq":6}
<- (E) {"seq":19,"type":"event","event":"output","body":{"category":"telemetry","output":"VS/Diagnostics/Debugger/vsdbg/ProcessCreate","data":{"VS.Diagnostics.Debugger.vsdbg.OSFamily":"Windows","VS.Diagnostics.Debugger.vsdbg.Version":"16.4.20227.2 commit:86e0ca2a3a756c16e152003f9c3bfbabaa22065f","VS.Diagnostics.Debugger.vsdbg.WindowsVersion":"10.0.18363"}}}
<- (E) {"seq":21,"type":"event","event":"process","body":{"name":"D:\\Projects\\Miscellaneous\\test\\build\\Debug\\client_app.exe","systemProcessId":6944,"startMethod":"launch","pointerSize":64}}
<- (E) {"seq":23,"type":"event","event":"output","body":{"category":"telemetry","output":"VS/Diagnostics/Debugger/vsdbg/Launch","data":{"VS.Diagnostics.Debugger.vsdbg.OSFamily":"Windows","VS.Diagnostics.Debugger.vsdbg.Version":"16.4.20227.2 commit:86e0ca2a3a756c16e152003f9c3bfbabaa22065f","VS.Diagnostics.Debugger.vsdbg.VisualizerFileUsed":false,"VS.Diagnostics.Debugger.vsdbg.WindowsVersion":"10.0.18363","VS.Diagnostics.Debugger.vsdbg.Launch.Duration":157,"VS.Diagnostics.Debugger.vsdbg.TargetType":"Live","VS.Diagnostics.Debugger.vsdbg.AdapterId":"cppvsdbg","VS.Diagnostics.Debugger.vsdbg.SourceFileMappings":0}}}
<- (R) {"seq":25,"type":"response","request_seq":6,"success":true,"command":"configurationDone"}
<- (E) {"seq":27,"type":"event","event":"breakpoint","body":{"reason":"changed","breakpoint":{"id":1,"verified":false,"message":"No symbols have been loaded for this document.","line":5}}}
-> (C) {"command":"threads","type":"request","seq":7}
<- (R) {"seq":30,"type":"response","request_seq":7,"success":true,"command":"threads","message":"","body":{"threads":[]}}
Loaded 'D:\Projects\Miscellaneous\test\build\Debug\client_app.exe'. Symbols loaded.
<- (E) {"seq":33,"type":"event","event":"module","body":{"reason":"new","module":{"id":"{24F55A84-B533-4755-927D-7DA45EFD1A24}","name":"client_app.exe","path":"D:\\Projects\\Miscellaneous\\test\\build\\Debug\\client_app.exe","isUserCode":true,"symbolStatus":"Symbols loaded.","symbolFilePath":"D:\\Projects\\Miscellaneous\\test\\build\\Debug\\client_app.pdb"}}}
<- (E) {"seq":35,"type":"event","event":"breakpoint","body":{"reason":"changed","breakpoint":{"id":1,"verified":true,"source":{"name":"src.cpp","path":"D:\\Projects\\Miscellaneous\\test\\src.cpp","sourceReference":0,"sources":[],"checksums":[{"algorithm":"MD5","checksum":"1d569cb07fb44c1bba7d153fd981a9da"}]},"line":5,"endLine":5}}}
<- (E) {"seq":37,"type":"event","event":"thread","body":{"reason":"started","threadId":25888}}
Loaded 'C:\Windows\System32\ntdll.dll'.
<- (E) {"seq":40,"type":"event","event":"module","body":{"reason":"new","module":{"id":"{24F55A84-B533-4755-927D-7DA45EFD1A2E}","name":"ntdll.dll","path":"C:\\Windows\\System32\\ntdll.dll","isUserCode":false,"version":"10.0.18362.815 (WinBuild.160101.0800)","symbolStatus":"Cannot find or open the PDB file."}}}
<- (E) {"seq":42,"type":"event","event":"thread","body":{"reason":"started","threadId":8908}}
Loaded 'C:\Windows\System32\kernel32.dll'.
<- (E) {"seq":45,"type":"event","event":"module","body":{"reason":"new","module":{"id":"{24F55A84-B533-4755-927D-7DA45EFD1A32}","name":"kernel32.dll","path":"C:\\Windows\\System32\\kernel32.dll","isUserCode":false,"version":"10.0.18362.959 (WinBuild.160101.0800)","symbolStatus":"Cannot find or open the PDB file."}}}
Loaded 'C:\Windows\System32\KernelBase.dll'.
<- (E) {"seq":48,"type":"event","event":"module","body":{"reason":"new","module":{"id":"{24F55A84-B533-4755-927D-7DA45EFD1A34}","name":"KernelBase.dll","path":"C:\\Windows\\System32\\KernelBase.dll","isUserCode":false,"version":"10.0.18362.959 (WinBuild.160101.0800)","symbolStatus":"Cannot find or open the PDB file."}}}
<- (E) {"seq":50,"type":"event","event":"thread","body":{"reason":"started","threadId":16136}}
Loaded 'D:\Projects\Miscellaneous\test\build\Debug\test_lib.dll'. Symbols loaded.
<- (E) {"seq":53,"type":"event","event":"module","body":{"reason":"new","module":{"id":"{24F55A84-B533-4755-927D-7DA45EFD1A38}","name":"test_lib.dll","path":"D:\\Projects\\Miscellaneous\\test\\build\\Debug\\test_lib.dll","isUserCode":true,"symbolStatus":"Symbols loaded.","symbolFilePath":"D:\\Projects\\Miscellaneous\\test\\build\\Debug\\test_lib.pdb"}}}
Loaded 'C:\Windows\System32\vcruntime140_1d.dll'.
<- (E) {"seq":56,"type":"event","event":"module","body":{"reason":"new","module":{"id":"{24F55A84-B533-4755-927D-7DA45EFD1A3C}","name":"vcruntime140_1d.dll","path":"C:\\Windows\\System32\\vcruntime140_1d.dll","isUserCode":false,"version":"14.25.28508.3 built by: vcwrkspc","symbolStatus":"Cannot find or open the PDB file."}}}
Loaded 'C:\Windows\System32\vcruntime140d.dll'.
<- (E) {"seq":59,"type":"event","event":"module","body":{"reason":"new","module":{"id":"{24F55A84-B533-4755-927D-7DA45EFD1A3F}","name":"vcruntime140d.dll","path":"C:\\Windows\\System32\\vcruntime140d.dll","isUserCode":false,"version":"14.25.28508.3 built by: vcwrkspc","symbolStatus":"Cannot find or open the PDB file."}}}
Loaded 'C:\Windows\System32\ucrtbased.dll'.
<- (E) {"seq":62,"type":"event","event":"module","body":{"reason":"new","module":{"id":"{24F55A84-B533-4755-927D-7DA45EFD1A42}","name":"ucrtbased.dll","path":"C:\\Windows\\System32\\ucrtbased.dll","isUserCode":false,"version":"10.0.18362.1 (WinBuild.160101.0800)","symbolStatus":"Cannot find or open the PDB file."}}}
<- (E) {"seq":64,"type":"event","event":"thread","body":{"reason":"started","threadId":10324}}
<- (E) {"seq":66,"type":"event","event":"thread","body":{"reason":"exited","threadId":8908}}
<- (E) {"seq":68,"type":"event","event":"stopped","body":{"reason":"breakpoint","threadId":25888,"allThreadsStopped":true,"source":{"name":"src.cpp","path":"D:\\Projects\\Miscellaneous\\test\\src.cpp","sources":[],"checksums":[]},"line":5,"column":0}}
-> (C) {"command":"threads","type":"request","seq":8}
<- (R) {"seq":71,"type":"response","request_seq":8,"success":true,"command":"threads","message":"","body":{"threads":[{"id":25888,"name":"Main Thread"},{"id":16136,"name":"ntdll.dll thread"},{"id":10324,"name":"ntdll.dll thread"}]}}
-> (C) {"command":"stackTrace","arguments":{"threadId":25888,"startFrame":0,"levels":20},"type":"request","seq":9}
<- (R) {"seq":74,"type":"response","request_seq":9,"success":true,"command":"stackTrace","message":"","body":{"stackFrames":[{"id":1000,"name":"client_app.exe!main() Line 5","source":{"name":"src.cpp","path":"D:\\Projects\\Miscellaneous\\test\\src.cpp","sourceReference":0,"sources":[],"checksums":[{"algorithm":"MD5","checksum":"1d569cb07fb44c1bba7d153fd981a9da"}]},"line":5,"column":1,"endLine":5,"endColumn":0,"instructionPointerReference":"0x00007FF6B7221565","moduleId":"{24F55A84-B533-4755-927D-7DA45EFD1A24}"},{"id":1001,"name":"client_app.exe!invoke_main() Line 79","source":{"name":"exe_common.inl","path":"d:\\agent\\_work\\4\\s\\src\\vctools\\crt\\vcstartup\\src\\startup\\exe_common.inl","sourceReference":0,"sources":[],"checksums":[{"algorithm":"MD5","checksum":"71b2ee555da596d26732e057877ac685"}]},"line":79,"column":1,"endLine":79,"endColumn":0,"instructionPointerReference":"0x00007FF6B7221B49","moduleId":"{24F55A84-B533-4755-927D-7DA45EFD1A24}"},{"id":1002,"name":"client_app.exe!__scrt_common_main_seh() Line 288","source":{"name":"exe_common.inl","path":"d:\\agent\\_work\\4\\s\\src\\vctools\\crt\\vcstartup\\src\\startup\\exe_common.inl","sourceReference":0,"sources":[],"checksums":[{"algorithm":"MD5","checksum":"71b2ee555da596d26732e057877ac685"}]},"line":288,"column":1,"endLine":288,"endColumn":0,"instructionPointerReference":"0x00007FF6B72219EE","moduleId":"{24F55A84-B533-4755-927D-7DA45EFD1A24}"},{"id":1003,"name":"client_app.exe!__scrt_common_main() Line 331","source":{"name":"exe_common.inl","path":"d:\\agent\\_work\\4\\s\\src\\vctools\\crt\\vcstartup\\src\\startup\\exe_common.inl","sourceReference":0,"sources":[],"checksums":[{"algorithm":"MD5","checksum":"71b2ee555da596d26732e057877ac685"}]},"line":331,"column":1,"endLine":331,"endColumn":0,"instructionPointerReference":"0x00007FF6B72218AE","moduleId":"{24F55A84-B533-4755-927D-7DA45EFD1A24}"},{"id":1004,"name":"client_app.exe!mainCRTStartup() Line 17","source":{"name":"exe_main.cpp","path":"d:\\agent\\_work\\4\\s\\src\\vctools\\crt\\vcstartup\\src\\startup\\exe_main.cpp","sourceReference":0,"sources":[],"checksums":[{"algorithm":"MD5","checksum":"e78f64243c187e5de8dd6bf8158bf6a4"}]},"line":17,"column":1,"endLine":17,"endColumn":0,"instructionPointerReference":"0x00007FF6B7221BD9","moduleId":"{24F55A84-B533-4755-927D-7DA45EFD1A24}"},{"id":1005,"name":"kernel32.dll!00007ffcb4637bd4()","line":0,"column":0,"instructionPointerReference":"0x00007FFCB4637BD4","moduleId":"{24F55A84-B533-4755-927D-7DA45EFD1A32}"},{"id":1006,"name":"ntdll.dll!00007ffcb478ce51()","line":0,"column":0,"instructionPointerReference":"0x00007FFCB478CE51","moduleId":"{24F55A84-B533-4755-927D-7DA45EFD1A2E}"}],"totalFrames":7}}
-> (C) {"command":"threads","type":"request","seq":10}
<- (R) {"seq":77,"type":"response","request_seq":10,"success":true,"command":"threads","message":"","body":{"threads":[{"id":25888,"name":"Main Thread"},{"id":16136,"name":"ntdll.dll thread"},{"id":10324,"name":"ntdll.dll thread"}]}}
-> (C) {"command":"scopes","arguments":{"frameId":1000},"type":"request","seq":11}
<- (R) {"seq":80,"type":"response","request_seq":11,"success":true,"command":"scopes","message":"","body":{"scopes":[{"name":"Locals","variablesReference":1000,"expensive":false},{"name":"Registers","presentationHint":"registers","variablesReference":1001,"expensive":true}]}}
-> (C) {"command":"variables","arguments":{"variablesReference":1000},"type":"request","seq":12}
<- (R) {"seq":83,"type":"response","request_seq":12,"success":true,"command":"variables","message":"","body":{"variables":[{"name":"a","value":"0xcccccccccccccccc {...}","type":"Test *","presentationHint":{"kind":"data","attributes":[]},"evaluateName":"a","variablesReference":0,"memoryReference":"0xCCCCCCCCCCCCCCCC"}]}}
-> (C) {"command":"stepIn","arguments":{"threadId":25888},"type":"request","seq":13}
<- (E) {"seq":86,"type":"event","event":"continued","body":{"threadId":25888,"allThreadsContinued":true}}
<- (R) {"seq":88,"type":"response","request_seq":13,"success":true,"command":"stepIn"}
<- (E) {"seq":90,"type":"event","event":"stopped","body":{"reason":"step","threadId":25888,"allThreadsStopped":true,"source":{"name":"new_scalar.cpp","path":"d:\\agent\\_work\\4\\s\\src\\vctools\\crt\\vcstartup\\src\\heap\\new_scalar.cpp","sources":[],"checksums":[]},"line":32,"column":0}}
-> (C) {"command":"threads","type":"request","seq":14}
<- (R) {"seq":93,"type":"response","request_seq":14,"success":true,"command":"threads","message":"","body":{"threads":[{"id":25888,"name":"Main Thread"},{"id":16136,"name":"ntdll.dll thread"},{"id":10324,"name":"ntdll.dll thread"}]}}
-> (C) {"command":"stackTrace","arguments":{"threadId":25888,"startFrame":0,"levels":20},"type":"request","seq":15}
<- (R) {"seq":96,"type":"response","request_seq":15,"success":true,"command":"stackTrace","message":"","body":{"stackFrames":[{"id":1000,"name":"client_app.exe!operator new(unsigned __int64 size) Line 32","source":{"name":"new_scalar.cpp","path":"d:\\agent\\_work\\4\\s\\src\\vctools\\crt\\vcstartup\\src\\heap\\new_scalar.cpp","sourceReference":0,"sources":[],"checksums":[{"algorithm":"MD5","checksum":"780d1be3bc8053e2cb8b8bd8769ec032"}]},"line":32,"column":1,"endLine":32,"endColumn":0,"instructionPointerReference":"0x00007FF6B7221640","moduleId":"{24F55A84-B533-4755-927D-7DA45EFD1A24}"},{"id":1001,"name":"client_app.exe!main() Line 5","source":{"name":"src.cpp","path":"D:\\Projects\\Miscellaneous\\test\\src.cpp","sourceReference":0,"sources":[],"checksums":[{"algorithm":"MD5","checksum":"1d569cb07fb44c1bba7d153fd981a9da"}]},"line":5,"column":1,"endLine":5,"endColumn":0,"instructionPointerReference":"0x00007FF6B722156F","moduleId":"{24F55A84-B533-4755-927D-7DA45EFD1A24}"},{"id":1002,"name":"client_app.exe!invoke_main() Line 79","source":{"name":"exe_common.inl","path":"d:\\agent\\_work\\4\\s\\src\\vctools\\crt\\vcstartup\\src\\startup\\exe_common.inl","sourceReference":0,"sources":[],"checksums":[{"algorithm":"MD5","checksum":"71b2ee555da596d26732e057877ac685"}]},"line":79,"column":1,"endLine":79,"endColumn":0,"instructionPointerReference":"0x00007FF6B7221B49","moduleId":"{24F55A84-B533-4755-927D-7DA45EFD1A24}"},{"id":1003,"name":"client_app.exe!__scrt_common_main_seh() Line 288","source":{"name":"exe_common.inl","path":"d:\\agent\\_work\\4\\s\\src\\vctools\\crt\\vcstartup\\src\\startup\\exe_common.inl","sourceReference":0,"sources":[],"checksums":[{"algorithm":"MD5","checksum":"71b2ee555da596d26732e057877ac685"}]},"line":288,"column":1,"endLine":288,"endColumn":0,"instructionPointerReference":"0x00007FF6B72219EE","moduleId":"{24F55A84-B533-4755-927D-7DA45EFD1A24}"},{"id":1004,"name":"client_app.exe!__scrt_common_main() Line 331","source":{"name":"exe_common.inl","path":"d:\\agent\\_work\\4\\s\\src\\vctools\\crt\\vcstartup\\src\\startup\\exe_common.inl","sourceReference":0,"sources":[],"checksums":[{"algorithm":"MD5","checksum":"71b2ee555da596d26732e057877ac685"}]},"line":331,"column":1,"endLine":331,"endColumn":0,"instructionPointerReference":"0x00007FF6B72218AE","moduleId":"{24F55A84-B533-4755-927D-7DA45EFD1A24}"},{"id":1005,"name":"client_app.exe!mainCRTStartup() Line 17","source":{"name":"exe_main.cpp","path":"d:\\agent\\_work\\4\\s\\src\\vctools\\crt\\vcstartup\\src\\startup\\exe_main.cpp","sourceReference":0,"sources":[],"checksums":[{"algorithm":"MD5","checksum":"e78f64243c187e5de8dd6bf8158bf6a4"}]},"line":17,"column":1,"endLine":17,"endColumn":0,"instructionPointerReference":"0x00007FF6B7221BD9","moduleId":"{24F55A84-B533-4755-927D-7DA45EFD1A24}"},{"id":1006,"name":"kernel32.dll!00007ffcb4637bd4()","line":0,"column":0,"instructionPointerReference":"0x00007FFCB4637BD4","moduleId":"{24F55A84-B533-4755-927D-7DA45EFD1A32}"},{"id":1007,"name":"ntdll.dll!00007ffcb478ce51()","line":0,"column":0,"instructionPointerReference":"0x00007FFCB478CE51","moduleId":"{24F55A84-B533-4755-927D-7DA45EFD1A2E}"}],"totalFrames":8}}
-> (C) {"command":"scopes","arguments":{"frameId":1000},"type":"request","seq":16}
<- (R) {"seq":99,"type":"response","request_seq":16,"success":true,"command":"scopes","message":"","body":{"scopes":[{"name":"Locals","variablesReference":1000,"expensive":false},{"name":"Registers","presentationHint":"registers","variablesReference":1001,"expensive":true}]}}
-> (C) {"command":"variables","arguments":{"variablesReference":1000},"type":"request","seq":17}
<- (R) {"seq":102,"type":"response","request_seq":17,"success":true,"command":"variables","message":"","body":{"variables":[{"name":"size","value":"14757395258967641292","type":"const unsigned __int64","presentationHint":{"kind":"data","attributes":["constant"]},"evaluateName":"size","variablesReference":0,"memoryReference":"0xCCCCCCCCCCCCCCCC"}]}}
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
The issue names no source files or tests. Start by reproducing the supplied CMake project with the shown launch.json, then inspect the debugger trace around pressing F11 from src.cpp into test_lib.dll. Done means navigating into the DLL source no longer crashes the debugger.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cmake, cpp, vscode
- Domain
- devtools
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100