[bootlin/training-materials updates] master: debugging: labs: add a fews tips for gdb usage (e9328d14)

Clément Léger clement.leger at bootlin.com
Tue Nov 22 11:43:26 CET 2022


Repository : https://github.com/bootlin/training-materials
On branch  : master
Link       : https://github.com/bootlin/training-materials/commit/e9328d1417602f869298cf5440dbb34edbbc8ad1

>---------------------------------------------------------------

commit e9328d1417602f869298cf5440dbb34edbbc8ad1
Author: Clément Léger <clement.leger at bootlin.com>
Date:   Tue Nov 22 11:42:22 2022 +0100

    debugging: labs: add a fews tips for gdb usage
    
    Signed-off-by: Clément Léger <clement.leger at bootlin.com>


>---------------------------------------------------------------

e9328d1417602f869298cf5440dbb34edbbc8ad1
 .../debugging-application-crash.tex                           | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/labs/debugging-application-crash/debugging-application-crash.tex b/labs/debugging-application-crash/debugging-application-crash.tex
index a7ec8346..62b8fe85 100644
--- a/labs/debugging-application-crash/debugging-application-crash.tex
+++ b/labs/debugging-application-crash/debugging-application-crash.tex
@@ -60,11 +60,19 @@ Then continue the execution and try to find the error using GDB. There are
 multiple ways to debug such program. We will track down up to the error in order
 to understand
 
+{\em TIP: you can execute command automatically at GDB startup by putting them
+in a \code{~/.gdbinit} file. For instance, history can be enabled with
+\code{set history save on} and pretty printing of structure with
+\code{set print pretty on}.}
+
+{\em TIP: GDB features a TUI which can be spawned using Ctrl + X + A. You can
+switch from the command line to the TUI view using Ctrl X + O.}
+
 {\em TIP: in gdb, not only values can be displayed using \code{p} command but
 functions can also be called directly from gdb ! Try to call
 \code{display_linked_list()}.}
 
-{\note NOTE: you can exit gdbserver from the connected gdb process using the
+{\em NOTE: you can exit gdbserver from the connected gdb process using the
 \code{monitor exit} command.}
 
 \section{Using a coredump with GDB}
@@ -91,7 +99,6 @@ Segmentation fault (core dumped)
 When crashing, a \code{core} file will be generated. Copy this file from the
 NFS directory on you desktop computer using \code{gdb-multiarch}:
 
-
 \begin{bashinput}
 $ gdb-multiarch <program_binary> <coredump_file>
 \end{bashinput}




More information about the training-materials-updates mailing list