Repository : ssh://git@open-mesh.org/doc
On branches: backup-redmine/2019-11-07,master
commit 71309661d1a7d27f13dad7929ebf8dc8185856d7 Author: Sven Eckelmann sven@narfation.org Date: Mon Oct 14 13:46:49 2019 +0000
doc: open-mesh/Kernel_debugging_with_kgdb
71309661d1a7d27f13dad7929ebf8dc8185856d7 open-mesh/Kernel_debugging_with_kgdb.textile | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-)
diff --git a/open-mesh/Kernel_debugging_with_kgdb.textile b/open-mesh/Kernel_debugging_with_kgdb.textile index 9f742ba..b1353f9 100644 --- a/open-mesh/Kernel_debugging_with_kgdb.textile +++ b/open-mesh/Kernel_debugging_with_kgdb.textile @@ -10,10 +10,10 @@ h3. Disabling watchdog
Most CPUs have some kind of watchdog integrated. They can often be disabled and are often inactive when the watchdog driver is not loaded. For example, ath79/ar71xx can be build without the internal watchdog support by changing in <code>target/linux/{ar71xx,ath79}/config-*</code>:
-<pre> +<pre><code class="diff"> -CONFIG_ATH79_WDT=y +# CONFIG_ATH79_WDT is not set -</pre> +</code></pre>
Unfortunately, there are also external watchdog chips which cannot be disabled. They have to be manually triggered regularly during the debugging process to prevent a sudden reboot. The details depend on the actual hardware but it often ends up in writing to a specific (GPIO control/set/clear) register.
@@ -34,7 +34,7 @@ CONFIG_GDB_SCRIPTS=y
For x86-64, the change (mostly created using <code>make kernel_menuconfig</code>) would be:
-<pre> +<pre><code class="diff"> diff --git a/target/linux/x86/config-4.14 b/target/linux/x86/config-4.14 index 014e7b275b..c6c6f871a9 100644 --- a/target/linux/x86/config-4.14 @@ -105,11 +105,11 @@ index 84a3d88a7f..c8a017f970 100644 +GRUB_CONSOLE_CMDLINE = nokaslr
USE_ATKBD = generic 64 -</pre> +</code></pre>
For ar71xx (GL.inet AR750 in my case), it would look like:
-<pre> +<pre><code class="diff"> diff --git a/target/linux/ar71xx/config-4.14 b/target/linux/ar71xx/config-4.14 index 4bc84792b6..8bd7c8b299 100644 --- a/target/linux/ar71xx/config-4.14 @@ -207,13 +207,13 @@ index 804532b55c..c485389f56 100644 CMDLINE = $$(if $$(BOARDNAME),board=$$(BOARDNAME)) $$(if $$(MTDPARTS),mtdparts=$$(MTDPARTS)) $$(if $$(CONSOLE),console=$$(CONSOLE)) KERNEL := kernel-bin | patch-cmdline | lzma | uImage lzma COMPILE := -</pre> +</code></pre>
h3. Enabling python support for gdb
OpenWrt will build a gdb when <code>CONFIG_GDB=y</code> is set in .config. But this version is missing python support. But it can be enabled with following patch:
-<pre> +<pre><code class="diff"> diff --git a/toolchain/gdb/Makefile b/toolchain/gdb/Makefile index 3b884f9e79..9b0149faca 100644 --- a/toolchain/gdb/Makefile @@ -239,7 +239,7 @@ index 3b884f9e79..9b0149faca 100644 rm -rf \ $(HOST_BUILD_DIR) \ $(TOOLCHAIN_DIR)/bin/$(TARGET_CROSS)gdb \ -</pre> +</code></pre>
h2. Start debugging session
@@ -299,7 +299,7 @@ The rest of the usage now works similar to debugging using gdbserver. Just set s
Some other ideas are documented in [[Emulation_Debug#Using-GDB]]. This document also contains important hints about [[Emulation_Debug#Building-the-batman-adv-module|increasing the chance of getting debugable modules]] which didn't had all information optimized away. The relevant flags could be set directly in the routing feed like this:
-<pre> +<pre><code class="diff"> diff --git a/batman-adv/Makefile b/batman-adv/Makefile index a7c6a79..c18f978 100644 --- a/batman-adv/Makefile @@ -313,7 +313,7 @@ index a7c6a79..c18f978 100644 NOSTDINC_FLAGS="$(NOSTDINC_FLAGS)" \ modules endef -</pre> +</code></pre>
h2. Working with external Watchdog over GPIO