I was following instructions from here. Installed cpptools. Created tasks.json
with following contents:
{
\"version\": \"0.1.0\",
\"comm
I have faced this issue before. In my case, the compiler generated a release application as default. It has no symbols for debugging.
So, please make sure that you are generated a debug app for debugging.
good luck!
If you want command.PickProcess to work..
It should be a ':' not a '.' - therefore:
{
"name": ".NET Core Attach",
"type": "coreclr",
"request": "attach",
"processId": "${command:pickProcess}"
}
Should sort you out :)
I believe you are trying to use the VS Code debugger (cppvsdbg) instead of gdb (cppdbg.) This modified launch.json
works for me with TDM-GCC and gdb as the debugger:
{
"version": "0.2.0",
"configurations": [
{
"name": "C++ Launch",
"type": "cppdbg",
"request": "launch",
"args": [],
"stopAtEntry": false,
"cwd": "${workspaceRoot}",
"environment": [],
"externalConsole": true,
"linux": {
"program": "${workspaceRoot}/a.out",
"MIMode": "gdb",
"setupCommands": [
{
"description": "Enable pretty-printing for gdb",
"text": "-enable-pretty-printing",
"ignoreFailures": true
}
]
},
"osx": {
"MIMode": "lldb"
},
"windows": {
"miDebuggerPath": "C:\\TDM-GCC-64\\bin\\gdb.exe",
"program": "${workspaceRoot}\\a.exe",
"MIMode": "gdb",
"setupCommands": [
{
"description": "Enable pretty-printing for gdb",
"text": "-enable-pretty-printing",
"ignoreFailures": true
}
]
}
},
{
"name": "C++ Attach",
"miDebuggerPath": "C:\\TDM-GCC-64\\bin\\gdb.exe",
"type": "cppdbg",
"request": "attach",
"program": "${workspaceRoot}/a.exe",
"processId": "${command:pickProcess}",
"linux": {
"MIMode": "gdb",
"program": "${workspaceRoot}/a.out",
"setupCommands": [
{
"description": "Enable pretty-printing for gdb",
"text": "-enable-pretty-printing",
"ignoreFailures": true
}
]
},
"osx": {
"MIMode": "lldb"
},
"windows": {
"MIMode": "gdb",
"miDebuggerPath": "C:\\TDM-GCC-64\\bin\\gdb.exe",
"setupCommands": [
{
"description": "Enable pretty-printing for gdb",
"text": "-enable-pretty-printing",
"ignoreFailures": true
}
]
}
}
]
}