[bootlin/training-materials updates] master: debugging: labs: gdb: use gdbserver --multi (22826e76)
Clément Léger
clement.leger at bootlin.com
Tue Nov 22 11:13:58 CET 2022
Repository : https://github.com/bootlin/training-materials
On branch : master
Link : https://github.com/bootlin/training-materials/commit/22826e767f300b062d0df600d100237076b7a22d
>---------------------------------------------------------------
commit 22826e767f300b062d0df600d100237076b7a22d
Author: Clément Léger <clement.leger at bootlin.com>
Date: Tue Nov 22 11:13:58 2022 +0100
debugging: labs: gdb: use gdbserver --multi
Signed-off-by: Clément Léger <clement.leger at bootlin.com>
>---------------------------------------------------------------
22826e767f300b062d0df600d100237076b7a22d
.../debugging-application-crash.tex | 10 +++++++---
1 file changed, 7 insertions(+), 3 deletions(-)
diff --git a/labs/debugging-application-crash/debugging-application-crash.tex b/labs/debugging-application-crash/debugging-application-crash.tex
index 294c2620..a7ec8346 100644
--- a/labs/debugging-application-crash/debugging-application-crash.tex
+++ b/labs/debugging-application-crash/debugging-application-crash.tex
@@ -40,10 +40,10 @@ $ ./linked_list
From what you can see, it actually crashes ! So we will use GDB to debug that
program. We will do that remotely since our target does not embed a full gdb,
only a gdbserver, a lightweight gdb server that allows connecting with a remote
-full feature GDB. Start our program using gdbserver:
+full feature GDB. Start our program using gdbserver in multi mode:
\begin{bashinput}
-$ gdbserver localhost:2000 ./linked_list
+$ gdbserver --multi :2000 ./linked_list
\end{bashinput}
On the host side install gdb-multiarch if not already done and attach to this
@@ -52,7 +52,8 @@ process using gdb-multiarch:
\begin{bashinput}
$ sudo apt install gdb-multiarch
$ gdb-multiarch ./linked_list
-(gdb) target remote <target_ip>:2000
+(gdb) target extended-remote 192.168.0.100:2000
+(gdb) set sysroot /home/<user>/debugging-labs/buildroot/output/target/
\end{bashinput}
Then continue the execution and try to find the error using GDB. There are
@@ -63,6 +64,9 @@ to understand
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
+\code{monitor exit} command.}
+
\section{Using a coredump with GDB}
Sometimes, the problems only arise in production and you can only gather data
More information about the training-materials-updates
mailing list