From 97b002e13e925cfbaada7c5c2b2425eaf5090694 Mon Sep 17 00:00:00 2001 From: Benny Halevy Date: Thu, 5 May 2022 16:07:29 +0300 Subject: [PATCH] docs: debugging.md: add a sample gdbinit file This gdbinit contains recommended settings commonly useful for debugging scylla core dumps. Signed-off-by: Benny Halevy --- docs/guides/debugging.md | 3 +++ gdbinit | 19 +++++++++++++++++++ 2 files changed, 22 insertions(+) create mode 100644 gdbinit diff --git a/docs/guides/debugging.md b/docs/guides/debugging.md index 04296eb496..be4920462c 100644 --- a/docs/guides/debugging.md +++ b/docs/guides/debugging.md @@ -149,6 +149,9 @@ places. You can always load it by hand if GDB refuses or fails to load it: (gdb) source /path/to/your/.gdbinit +Scylla provides the following [gdbinit](../../gdbinit) file helpful for debugging scylla +at the root of the source tree. + #### TUI GDB has a terminal based GUI called diff --git a/gdbinit b/gdbinit new file mode 100644 index 0000000000..18e22891b9 --- /dev/null +++ b/gdbinit @@ -0,0 +1,19 @@ +# Recommended .gdbinit for debugging scylla +# See docs/guides/debugging.md for more information +handle SIG34 pass noprint +handle SIGUSR1 pass noprint +set print pretty +set python print-stack full +set auto-load safe-path /opt/scylladb/libreloc +add-auto-load-safe-path /lib64 +add-auto-load-safe-path /usr/lib64 +set debug libthread-db 1 + +# Register pretty-printer helpers for printing common +# std-c++ stl containers. +python +import glob +sys.path.insert(0, glob.glob('/usr/share/gcc-*/python')[0]) +from libstdcxx.v6.printers import register_libstdcxx_printers +register_libstdcxx_printers (None) +end