1 GDB - The GNU Project Debugger
2 ==============================
4 `The GNU Project Debugger (GDB) <https://www.sourceware.org/gdb>`_ is
5 a powerful tool that allows you to analyze the execution flow
7 GDB can help to find bugs, uncover crash errors or track the
8 source code during execution of a development cluster.
9 It can also be used to debug Teuthology test runs.
14 Basic usage with examples can be found `here. <https://geeksforgeeks.org/gdb-command-in-linux-with-examples>`_
15 GDB can be attached to a running process. For instance, after deploying a
16 development cluster, the process number (PID) of a ``ceph-osd`` daemon can be found in::
21 Attaching gdb to the process::
23 $ gdb ./bin/ceph-osd -p <pid>
26 It is recommended to compile without any optimizations (``-O0`` gcc flag)
27 in order to avoid elimination of intermediate values.
29 Stopping for breakpoints while debugging may cause timeouts, so the following
30 configuration options are suggested::
33 osd_op_thread_timeout = 1500
34 osd_op_thread_suicide_timeout = 1500
36 Debugging Teuthology Tests
37 ^^^^^^^^^^^^^^^^^^^^^^^^^^
39 ``src/script/ceph-debug-docker.sh`` can be used to analyze Teuthology failures::
41 $ ./ceph-debug-docker.sh <branch-name>
43 Refer to the script header for more information.