Hello,
I would like to ask how to debug plugins within VSCode with gdb in a good way. I’m able to attach to a running instance of Rack and debug a plugin that was built with the SDK. Sadly, most interesting variables are hidden as <optimized out>
.
So, I would like to build Rack from source (done) and build my plugins right in the plugins folder, as the Build guide points out.
Now I can run make debug
and gdb is running my newly build instance of Rack. But any changes I’ve done to my plugin are not being build right now. Confusingly, the loaded patch is the same for my previously installed Rack or my own build.
So I guess I got something wrong on how this all is meant to work.
Secondly, I would like to use VSCode for debugging with gdb. How to set that all up? This is what I have done so far, but I’m very confused how this should be done, can you help me?
launch.jason:
{
"version": "0.2.0",
"configurations": [
{
"name": "(gdb) Launch",
"type": "cppdbg",
"request": "launch",
"program": "C:/Users/loren/Documents/dev/Rack/Rack.exe",
"args": [],
"stopAtEntry": false,
"cwd": "${workspaceFolder}",
"externalConsole": true,
"MIMode": "gdb",
"miDebuggerPath": "C:/msys64/mingw64/bin/gdb.exe",
"setupCommands": [
{
"description": "Enable pretty-printing for gdb",
"text": "-enable-pretty-printing",
"ignoreFailures": true
}
],
"preLaunchTask": "Build and debug"
}
]
}
task.jason:
{
"version": "2.0.0",
"tasks": [
{
"label": "Build and debug",
"type": "shell",
"command": "make debug",
"options": {
"cwd": "${workspaceFolder}",
"env": {
"PATH": "C:\\msys64\\usr\\bin\\;C:\\msys64\\mingw64\\bin"
}
},
"problemMatcher": {
"owner": "cpp",
"fileLocation": [
"absolute"
],
"pattern": {
"regexp": "^(.*):(\\d+):(\\d+):\\s+(warning|error):\\s+(.*)$",
"file": 1,
"line": 2,
"column": 3,
"severity": 4,
"message": 5
}
}
}
]
}
Can anyone point me in the direction to figure this all out? Thanks a lot!