xref: /aosp_15_r20/external/ltp/doc/developers/debugging.rst (revision 49cdfc7efb34551c7342be41a7384b9c40d7cab7)
1.. SPDX-License-Identifier: GPL-2.0-or-later
2
3Debugging
4=========
5
6This section explains some tricks which can be used to debug test binaries.
7
8Debug messages
9--------------
10
11The LTP framework supports ``TDEBUG`` flag test debug messages. These
12messages can be enabled using the ``-D`` parameter or setting ``LTP_ENABLE_DEBUG=1``
13environment variable (see :doc:`../users/setup_tests`).
14
15Tracing and debugging syscalls
16------------------------------
17
18The new test library runs the actual test (i.e. the ``test()`` function) in a
19forked process. To get stack trace of a crashing test in ``gdb`` it's needed to
20`set follow-fork-mode child <https://sourceware.org/gdb/current/onlinedocs/gdb.html/Forks.html>`_.
21
22To trace the test, please use ``strace -f`` to enable tracing also for the
23forked processes.
24