How Do I Debug Linux?
Contents How Do I Debug a Linux Process? Attaching an Already Running Gdb to an Already Running Process Use the Shell Gdb Command to Run the Ps Command and...
Contents
How do I debug a Linux process?
Attaching an Already Running GDB to an Already Running Process
- Use the shell GDB command to run the ps command and find the program’s process id (pid): (gdb) shell ps -C program -o pid h pid. Replace program with a file name or path to the program.
- Use the attach command to attach GDB to the program: (gdb) attach pid.
Must Read
Is Linux easy to debug?
The interactive graphical user interface is very robust and can display graphical data such as graphs and charts. Thanks to a massive amount of helpful resources, developers can adapt to this Linux debugger pretty easily.