Under linux, can I use GDB to debug a process that is currently running?
The command to use is gdb attach pid where pid is the process id of the process you want to attach to.
gdb attach pid