linux – 我可以使用GDB来调试正在运行的进程吗?

在linux下,我可以使用GDB调试当前运行的进程吗?
是。使用attach命令。查看this link了解更多信息。在GDB控制台上键入帮助连接提供以下内容:

06000

Attach to a process or file outside of GDB.
This command attaches to another target, of the same type as your last
target” command (“info files” will show your target stack).
The command may take as argument a process id, a process name
(with an optional process-id as a suffix), or a device file.
For a process id, you must have permission to send the process a signal,
and it must have the same effective uid as the debugger.
When using “attach” to an existing process, the debugger finds the
program running in the process, looking first in the current working
directory, or (if not found there) using the source file search path
(see the “directory” command). You can also use the “file” command
to specify the program, and to load its symbol table.

http://stackoverflow.com/questions/2308653/can-i-use-gdb-to-debug-a-running-process

本站文章除注明转载外,均为本站原创或编译
转载请明显位置注明出处:linux – 我可以使用GDB来调试正在运行的进程吗?