Reputation: 1824
We are developing a Win64 DLL using the GCC toolchain (MinGW-w64) in version 9.2.0. As IDE we use VisualStudio Code (version 1.47.3) with the C/C++ IntelliSense, debugging, and code browsing plugin from Microsoft (version 0.30.0).
Unfortunately, we cannot set any breakpoints inside our DLL.
The situation is the same if we attach the DLL within our TestApplication statical or dynamical by using LoadLibrary.
Starting the GDB as a console process allows us to set a breakpoint in the DLL and stop at that line, but we miss the convenience of the IDE. I assume there is an issue in the configuration of the VSCode project or within the C/C++ plugin.
We use the following launch.json file:
"version": "0.2.0",
"configurations": [
{
"name": "gcc.exe build and debug active file",
"type": "cppdbg",
"request": "launch",
"program": "${workspaceFolder}/Win64/TestApplication.exe",
"args": [],
"stopAtEntry": true,
"cwd": "${workspaceFolder}",
"environment": [],
"externalConsole": true,
"MIMode": "gdb",
"miDebuggerPath": "${workspaceFolder}/minGW-w64/bin/gdb.exe",
"setupCommands": [
{
"description": "Enable pretty-printing for gdb",
"text": "-enable-pretty-printing",
"ignoreFailures": false
}
],
"preLaunchTask": "build-all",
"avoidWindowsConsoleRedirection": true,
"logging": {
"trace": false,
"traceResponse": false,
"engineLogging": true
}
}
]
}
Update: 17-Aug-2020: The reason is the missing symbols from the DLL, which cannot be loaded. Even if I try to load the symbol file for the DLL while the debugger is starting, it always removes these symbols when loading the host application. The only workaround that I have found is to manually reload the symbol file within a first breakpoint that I can only enter by its address.
Is anybody able to debug a Win64 DLL with the same toolchain?
Upvotes: 1
Views: 1641