My use-case is debugging applications for different platforms via qemu-user.
So far the only way I could make it work is to start qemu-aarch64 -g 1234 ... manually through a task via preLaunchTask and have the gdb launched by the debug extension connect to that gdb-server.
The problem is that qemu -g won't print anything and just blocks indefinitely until gdb connects, so the background problem matcher has a hard time. On top of that I don't really need it to watch for any tasks like background compilation. Just kick off the process.
With just "isBackground": true or with a problem matcher that has "activeOnStart": false it will show a message box after a timeout asking to debug anyway, which works but creates an annoying delay of a couple of seconds on every iteration.
In the past I was somehow able to make it work with
"isBackground": true,
"problemMatcher": {
"base": "$gcc",
"background": {
"activeOnStart": true,
"beginsPattern": ".*",
"endsPattern": ".*"
}
},
But now it doesn't work anymore, I tried different variations with non-matching regexes etc. but it either runs into the timeout or it hangs because the debug extension never gets notified (the only way out is to issue a manual gdb -ex 'target remote :1234' -ex q, after that the debug extension is unblocked and tries to connect to the now destroyed server).
The only workaround I found is to switch the task to a shell type and do some non-obvious magic:
"type": "shell",
"command": "nohup /usr/bin/qemu-aarch64 -g 1234 ... & sleep 0.1",
But that will still confusingly stop the program in the beginning due to a Program received signal SIGHUP, Hangup., worked around via setup command handle SIGHUP nostop noprint ignore.
My use-case is debugging applications for different platforms via qemu-user.
So far the only way I could make it work is to start
qemu-aarch64 -g 1234 ...manually through a task viapreLaunchTaskand have the gdb launched by the debug extension connect to that gdb-server.The problem is that
qemu -gwon't print anything and just blocks indefinitely until gdb connects, so the background problem matcher has a hard time. On top of that I don't really need it to watch for any tasks like background compilation. Just kick off the process.With just
"isBackground": trueor with a problem matcher that has"activeOnStart": falseit will show a message box after a timeout asking to debug anyway, which works but creates an annoying delay of a couple of seconds on every iteration.In the past I was somehow able to make it work with
But now it doesn't work anymore, I tried different variations with non-matching regexes etc. but it either runs into the timeout or it hangs because the debug extension never gets notified (the only way out is to issue a manual
gdb -ex 'target remote :1234' -ex q, after that the debug extension is unblocked and tries to connect to the now destroyed server).The only workaround I found is to switch the task to a shell type and do some non-obvious magic:
But that will still confusingly stop the program in the beginning due to a
Program received signal SIGHUP, Hangup., worked around via setup commandhandle SIGHUP nostop noprint ignore.