Skip to content

Commit

Permalink
debugging: labs: OOPS: swap decode_stacktrace and gdb disas sections
Browse files Browse the repository at this point in the history
This makes the flow more logical, keeping decode_stacktrace immediately
after addr2line. It also makes the workding make more sense.

Signed-off-by: Luca Ceresoli <[email protected]>
  • Loading branch information
lucaceresoli committed Jan 17, 2025
1 parent 966e0cb commit 3de4acd
Showing 1 changed file with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -54,14 +54,6 @@ \subsection{Locating the exact line where the error happens}
-a <crash_address>
\end{bashinput}
We can even go a step further and use the cross GDB to open vmlinux and
locate the function and corresponding offset in assembly
\begin{bashinput}
$ ${CROSS_COMPILE}gdb /home/$USER/debugging-labs/buildroot/output/build/linux-%\workingkernel%/vmlinux
(gdb) disassemble <function>
\end{bashinput}

This can also be done automatically using \code{decode_stacktrace.sh}. First,
copy/paste the OOPS message into the \code{~/debugging-labs/oops.txt} file.
Then, using the script provided by the kernel, execute the following command:
Expand All @@ -73,6 +65,14 @@ \subsection{Locating the exact line where the error happens}
$ ./scripts/decode_stacktrace.sh vmlinux < ~/debugging-labs/oops.txt
\end{bashinput}
We can even go a step further and use the cross GDB to open vmlinux and
locate the function and corresponding offset in assembly
\begin{bashinput}
$ ${CROSS_COMPILE}gdb /home/$USER/debugging-labs/buildroot/output/build/linux-%\workingkernel%/vmlinux
(gdb) disassemble <function>
\end{bashinput}

\section{KGDB debugging}
In order to debug this OOPS, we'll use KGDB which is an in-kernel debugger.
The provided image already contains the necessary KGDB support and the watchdog
Expand Down

0 comments on commit 3de4acd

Please sign in to comment.