[bootlin/training-materials updates] master: slides: gdb: add more content for debugging course (b8675cee)

Clément Léger clement.leger at bootlin.com
Thu Feb 2 13:23:06 CET 2023


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

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

commit b8675ceeef17f544e8350cc4f6ae5d81a878e0ff
Author: Clément Léger <clement.leger at bootlin.com>
Date:   Thu Feb 2 13:23:06 2023 +0100

    slides: gdb: add more content for debugging course
    
    Signed-off-by: Clément Léger <clement.leger at bootlin.com>


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

b8675ceeef17f544e8350cc4f6ae5d81a878e0ff
 common/gdb.tex | 56 +++++++++++++++++++++++++++++++++++++++++++++++++++++++-
 1 file changed, 55 insertions(+), 1 deletion(-)

diff --git a/common/gdb.tex b/common/gdb.tex
index 2d4b16c0..ed3d4349 100644
--- a/common/gdb.tex
+++ b/common/gdb.tex
@@ -80,7 +80,61 @@
   \end{itemize}
 \end{frame}
 
-\ifthenelse{\equal{\training}{debugging}}{}
+\ifthenelse{\equal{\training}{debugging}}
+{
+\begin{frame}
+  \frametitle{GDB advanced commands (1/3)}
+  \small
+  \begin{itemize}
+    \item \code{info threads} (\code{i threads})\\
+      Display the list of threads that are available
+    \item \code{info breakpoints} (\code{i b})\\
+      Display the list of breakpoints/watchpoints
+    \item \code{delete <n>} (\code{d <n>})\\
+      Delete breakpoint <n>
+    \item \code{threads <n>} (\code{t <n>})\\
+      Select thread number <n>
+    \item \code{frame <n>} (\code{f <n>})\\
+      Select a specific frame from the backtrace, the number being the one
+      displayed when using \code{backtrace} at the beginning of each line
+  \end{itemize}
+\end{frame}
+
+\begin{frame}
+  \frametitle{GDB advanced commands (2/3)}
+  \small
+  \begin{itemize}
+    \item \code{watch <variable>} or \code{watch \*<address>}\\
+      Add a watchpoint on a specific variable/address.
+    \item \code{print variable = value} (\code{p variable = value})\\
+      Modify the content of the specified variable with a new value
+    \item \code{break if condition == value}\\
+      Break only if the specified condition is true
+    \item \code{watch if condition == value}\\
+      Trigger the watchpoint only if the specified condition is true
+    \item \code{x/<n><u> <address>}\\
+      Display memory at the provided address. \code{n} is the amount of memory to
+      display, \code{u} is the type of data to be displayed (\code{b/h/w/g}).
+      Instructions can be displayed using the \code{i} type.
+  \end{itemize}
+\end{frame}
+
+\begin{frame}
+  \frametitle{GDB advanced commands (3/3)}
+  \small
+  \begin{itemize}
+    \item \code{list <expr>}\\
+      Display the source code associated to the current program counter location.
+    \item \code{disassemble <location,start_offset,end_offset>} (\code{disas})\\
+      Display the assembly code that is currently executed.
+    \item \code{p $newvar = value}\\
+      Declare a new gdb variable that can be used locally or in command sequence
+    \item \code{define <command_name>}\\
+      Define a new command sequence. GDB will prompt for the sequence of
+      commands.
+  \end{itemize}
+\end{frame}
+}
 {
 \subsection{Remote debugging}
 }




More information about the training-materials-updates mailing list