Closed feihugis closed 3 years ago
I was able to attach to a process by using the config below:
{
"name": "(gdb) Attach",
"type": "cppdbg",
"request": "attach",
"program": "/opt/conda/bin/python",
"processId": "${command:pickProcess}",
"MIMode": "gdb",
"miDebuggerPath": "/usr/local/cuda/bin/cuda-gdb",
"setupCommands": [
{
"description": "Enable pretty-printing for gdb",
"text": "-enable-pretty-printing",
"ignoreFailures": true
}
]
},
why does it need to be run as superuser? "Superuser access is required to attach to a process. Attaching as superuser can potentially harm your computer. Do you want to continue? [y/N]"
The thing is that my process has this marked: import prctl PR_SET_PTRACER_ANY = 0xffffffff prctl.set_ptracer(PR_SET_PTRACER_ANY)
This basically makes it debuggable by any other debugger
I tried to attach to a process using below configure, but the debug task was just hanging there.