I need to debug a C++ library function invoked by a Python module in VSCode on a remote server.
I'm using VSCode Remote Development extensions, and debugging C++ code using gdb inside vscode on the remote server works fine, as does debugging Python on the remote.
I've tried both attaching to a paused (waiting for input) python process started from the terminal, and attaching to a python process at a breakpoint launched using the python (remote) debugger in vscode.
In both cases, I attach to the process ID using this launch.json config:
{
"name": "GDB Attach proc 0",
"type": "cppdbg",
"request": "attach",
"program": "/home/nfs/mharris/anaconda3/envs/cudf_dev/bin/python",
"processId": "${command:pickProcess}",
"linux": {
"MIMode": "gdb",
"setupCommands": [
{
"text": "-enable-pretty-printing",
"description": "enable pretty printing",
"ignoreFailures": true
},
{
"text": "handle SIGPIPE nostop noprint pass",
"description": "ignore SIGPIPE",
"ignoreFailures": true
}
]
},
},
It prints the following in the gdb terminal window:
==== AUTHENTICATING FOR org.freedesktop.policykit.exec ===
Authentication is needed to run `/usr/bin/gdb' as the super user
Authenticating as: aseadmin,,, (aseadmin)
Password: [1] + Stopped (tty output) /usr/bin/pkexec /usr/bin/gdb --interpreter=mi --tty=${DbgTerm} 0</tmp/Microsoft-MIEngine-In-bydexniu.cf5 1>/tmp/Microsoft-MIEngine-Out-mo618uzc.30l
You have stopped jobs.
I believe aseadmin is an admin user on the server. I don't know why it's trying to run gdb as the superuser. I'm connected to the remote using VSCode remote - SSH using ssh key authentication (my username is not aseadmin, so I'm not sure why it's using that).
I'm running vscode-insider (Version: 1.37.0-insider) with the remote development extensions (0.15.0), on Ubuntu 16.04 LTS.