How Do You Debug a Process in 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
How do you debug a stuck process?
To install and use Debugging Tool for Windows
- Run the program that is freezing or hanging, and that you wish to debug.
- Run the Debugging Tool for Windows. …
- Click on the File menu, and select Attach to a Process. …
- Find the process for the program which you wish to debug. …
- The command window should automatically open.