Debian Codegraph @

doc/html/_sources/imap/reference/faqs/o-gdb.rst.txt

raw
1 .. _faqs-o-gdb:
2
3 How to run gdb on Cyrus components
4 ----------------------------------
5
6 .. sidebar:: What is a service daemon?
7
8 A service daemon is any program based around master/service.c. This includes
9 imapd, lmtpd (and some others), but does *not* include the command line
10 tools.
11
12 An easy way to debug something in a service daemon is to write a
13 :ref:`Cassandane test <developer-testing>` that tries to reproduce the
14 bug. Cassandane has a ``[gdb]`` section in cassandane.ini which allows for
15 starting service daemons in a debugger.
16
17 The cassandane.ini.example in the cassandane repository contains examples and
18 instructions.
19
20 For programs that aren't service daemons, there are two options:
21
22 If they are installed, run them with gdb. You might need to use ``sudo``
23 depending on permissions. If they haven't been installed (and you're in the
24 source/build tree), you need to run gdb from ``libtool`` in order for everything
25 to work.
26
27 For example, if you wanted to debug cyr_virusscan:
28
29 .. code-block:: bash
30
31 $ ./libtool --mode=execute gdb imap/cyr_virusscan
32
33 Command line arguments for a tool you're debugging, must be given to gdb before
34 you run. Use something like `set args [ ... ]
35 <https://sourceware.org/gdb/current/onlinedocs/gdb/Arguments.html#Arguments>`_.
36
37 `More information on gdb <http://sourceware.org/gdb/current/onlinedocs/gdb/>`_.