From bc4cd50dde5753948c6456ffccaec60d112ecad2 Mon Sep 17 00:00:00 2001 From: Michael Friedrich Date: Wed, 12 Sep 2018 12:32:00 +0200 Subject: [PATCH] Enhance development docs with GDB backtrace and thread list --- doc/21-development.md | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/doc/21-development.md b/doc/21-development.md index 94619a412..4565fd94b 100644 --- a/doc/21-development.md +++ b/doc/21-development.md @@ -175,7 +175,20 @@ make sure to attach as much detail as possible. If Icinga 2 is still running, generate a full backtrace from the running process and store it into a new file (e.g. for debugging dead locks): - # gdb -p $(pidof icinga2) -batch -ex "thread apply all bt full" -ex "detach" -ex "q" > gdb_bt.log +Icinga 2 runs with 2 processes, therefore generate two backtrace logs +and add them to the GitHub issue. + +``` +for pid in $(pidof icinga2); do gdb -p $pid -batch -ex "thread apply all bt full" -ex "detach" -ex "q" > gdb_bt_${pid}_`date +%s`.log; done +``` + +### GDB Thread List from Running Process + +Instead of a full backtrace, you sometimes just need a list of running threads. + +``` +for pid in $(pidof icinga2); do gdb -p $pid -batch -ex "info threads" -ex "detach" -ex "q" > gdb_threads_${pid}_`date +%s`.log; done +``` ### GDB Backtrace Stepping