How to use the pycharm attach debug mode with gdb?

As the title said I want attach to a running process and debug it. When I use attach to process in pycharm . I get this in my console. (check the image) I don't know what command I can use here. not much tutorial about it. I haven checked this video : 

Command like call (void)PyRun_SimpleString not work in pycharm. So how to use it?


Here is the output of the console when start debugging, I don't know how to interact with it: 

import sys; print('Python %s on %s' % (sys.version, sys.platform))
Attaching to a process with PID=104,692
/usr/bin/python3.11 /home/lizhe/.local/share/JetBrains/Toolbox/apps/pycharm-community/plugins/python-ce/helpers/pydev/pydevd_attach_to_process/ --port 40539 --pid 104692
PYDEVD_GDB_SCAN_SHARED_LIBRARIES not set (scanning all libraries for needed symbols).
Running: gdb --nw --nh --nx --pid 104692 --batch --eval-command='set scheduler-locking off' --eval-command='set architecture auto' --eval-command='call (void*)dlopen("/home/lizhe/.local/share/JetBrains/Toolbox/apps/pycharm-community/plugins/python-ce/helpers/pydev/pydevd_attach_to_process/", 2)' --eval-command='sharedlibrary attach_linux_amd64' --eval-command='call (int)DoAttach(0, "import sys;sys.path.append(\"/home/lizhe/.local/share/JetBrains/Toolbox/apps/pycharm-community/plugins/python-ce/helpers/pydev\");sys.path.append(\"/home/lizhe/.local/share/JetBrains/Toolbox/apps/pycharm-community/plugins/python-ce/helpers/pydev/pydevd_attach_to_process\");import attach_script;attach_script.attach(port=40539, host=\"\", protocol=\"\", debug_mode=\"\");", 0)'
[New LWP 104693]
[New LWP 104694]
This GDB supports auto-downloading debuginfo from the following URLs:
Enable debuginfod for this session? (y or [n]) [answered N; input not from terminal]
Debuginfod has been disabled.
To make this setting permanent, add 'set debuginfod enabled off' to .gdbinit.





Please sign in to leave a comment.