Linux /proc and Process Debugging/Batch backtrace with gdb

Collect all-thread backtraces from a live process.

Section: Debuggers and Core Dumps

Batch backtrace with gdb

bash
bash
gdb -batch -ex "thread apply all bt" -p 1234
Explanation

Collect all-thread backtraces from a live process.

Learn the surrounding workflow

Compare similar commands or jump into common fixes when this command is part of a bigger troubleshooting path.

Related commands

Same sheet · prioritizing Debuggers and Core Dumps
Attach gdb to PID
Attach a debugger to a running process.
OpenIn sheetbashsame section
Open latest core in gdb
Load the newest core dump for a PID into gdb.
OpenIn sheetbashsame section
List captured core dumps
List core dumps managed by systemd-coredump.
OpenIn sheetbashsame section
Enable core dumps in shell
Allow the shell to generate core dumps.
OpenIn sheetbashsame section
Read process command line
Print the null-separated command line from /proc.
Trace a command with strace
Trace syscalls made by a new command.