I am trying to debug a custom logic analyzer shared library (.so) via VSCode and GDB with the Logic 2 .appimage.
I have built my shared library with symbols using CMakeLists.txt : set(CMAKE_BUILD_TYPE Debug)
I can successfully attach to the running module outside of VSCode using gdb attach
and setting the PID to the correct process using this post:
ps ax | grep Logic | grep type=renderer
This gives me the correct PID. After I load my custom analyzer on a captured signal, I run lsof -p <pid above> | grep <name of lib>
to confirm its loaded.
I can’t seem to get my vscode launch.json configuration correct to utilize gdb and attach and step through and break on breakpoints.
So far, I have a launch.json config that looks like this:
{
"configurations": [
{
"name": "(gdb) Launch Logic and gdb attach to child proc",
"type": "cppdbg",
"request": "attach",
"program": "<PATH_TO_LOGIC.appimage>",
"MIMode": "gdb",
"setupCommands": [
{
"description": "Enable pretty-printing for gdb",
"text": "-enable-pretty-printing",
"ignoreFailures": true,
},
{
"description":"In this mode GDB will be attached to both processes after a call to fork() or vfork().",
"text": "-gdb-set detach-on-fork off",
"ignoreFailures": true
},
{ "description": "The new process is debugged after a fork. The parent process runs unimpeded.",
"text": "-gdb-set follow-fork-mode child",
"ignoreFailures": true
}
]
}
],
"version": "2.0.0"
I tried adding the logic appimage path to “program”, not sure if that’s correct.
I just cant get the breakpoints to work in vscode
Any ideas?