Repository : ssh://git@open-mesh.org/doc
On branches: backup-redmine/2019-11-07,master
commit 439e701dc9c49bb445f5194e6aff20a05039fd54 Author: Sven Eckelmann sven@narfation.org Date: Sun Oct 27 12:45:20 2019 +0000
doc: open-mesh/Kernel_debugging_with_kgdb
439e701dc9c49bb445f5194e6aff20a05039fd54 open-mesh/Kernel_debugging_with_kgdb.textile | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/open-mesh/Kernel_debugging_with_kgdb.textile b/open-mesh/Kernel_debugging_with_kgdb.textile index 4ab25bd..7e273cd 100644 --- a/open-mesh/Kernel_debugging_with_kgdb.textile +++ b/open-mesh/Kernel_debugging_with_kgdb.textile @@ -251,17 +251,17 @@ h3. Configure KGDB serial
The kgdb needs a serial device to work. This has to be set in the module parameter. We assume now that the serial console on our device is ttyS0 with baudrate 115200:
-<pre> +<pre><code class="shell"> echo ttyS0,115200 > /sys/module/kgdboc/parameters/kgdboc -</pre> +</code></pre>
h3. Switch to kgdb
The gdb frontend cannot directly talk to the kernel over serial and create breakpoints. The sysrq mechanism has to be used to switch to kgdb before gdb can be used. Under OpenWrt, this is the easily done using
-<pre> +<pre><code class="shell"> echo g > /proc/sysrq-trigger -</pre> +</code></pre>
h3. Connecting gdb
@@ -273,10 +273,10 @@ I would use following folder in my x86-64 build environment:
When kgdb is activated using sysrq, we can configure gdb to connect via a serial adapter to the device. But we should first load the vmlinux with our target specific gdb. We must change to the LINUX_DIR first and can then start our GDB before we will connect to the remote device.
-<pre> +<pre><code class="shell"> cd "${LINUX_DIR}" "${GDB}" -iex "set auto-load safe-path scripts/gdb/" ./vmlinux -</pre> +</code></pre>
In this example, we are using an USB TTL converter. It has to be configured in gdb