Repository : ssh://git@open-mesh.org/doc
On branches: backup-redmine/2019-11-07,master
>---------------------------------------------------------------
commit 97b3f5369b8e904a2dbd362ca79195cbad5efcfb
Author: Sven Eckelmann <sven(a)narfation.org>
Date: Mon Oct 14 10:31:23 2019 +0000
doc: open-mesh/Kernel_debugging_with_kgdb
>---------------------------------------------------------------
97b3f5369b8e904a2dbd362ca79195cbad5efcfb
open-mesh/Kernel_debugging_with_kgdb.textile | 102 +++++++++++++++++++++++++++
1 file changed, 102 insertions(+)
diff --git a/open-mesh/Kernel_debugging_with_kgdb.textile b/open-mesh/Kernel_debugging_with_kgdb.textile
index c689d9a..3ecbb45 100644
--- a/open-mesh/Kernel_debugging_with_kgdb.textile
+++ b/open-mesh/Kernel_debugging_with_kgdb.textile
@@ -107,6 +107,108 @@ index 84a3d88a7f..c8a017f970 100644
USE_ATKBD = generic 64
</pre>
+For ar71xx (GL.inet AR750 in my case), it would look like:
+
+<pre>
+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
++++ b/target/linux/ar71xx/config-4.14
+@@ -290,7 +290,7 @@ CONFIG_ATH79=y
+ # CONFIG_ATH79_NVRAM is not set
+ # CONFIG_ATH79_PCI_ATH9K_FIXUP is not set
+ # CONFIG_ATH79_ROUTERBOOT is not set
+-CONFIG_ATH79_WDT=y
++# CONFIG_ATH79_WDT is not set
+ CONFIG_CEVT_R4K=y
+ CONFIG_CLKDEV_LOOKUP=y
+ CONFIG_CLONE_BACKWARDS=y
+@@ -299,6 +299,8 @@ CONFIG_CMDLINE_BOOL=y
+ # CONFIG_CMDLINE_OVERRIDE is not set
+ CONFIG_COMMON_CLK=y
+ # CONFIG_COMMON_CLK_BOSTON is not set
++CONFIG_CONSOLE_POLL=y
++CONFIG_CONSOLE_TRANSLATIONS=y
+ CONFIG_CPU_BIG_ENDIAN=y
+ CONFIG_CPU_GENERIC_DUMP_TLB=y
+ CONFIG_CPU_HAS_PREFETCH=y
+@@ -316,10 +318,15 @@ CONFIG_CPU_SUPPORTS_MSA=y
+ CONFIG_CRYPTO_RNG2=y
+ CONFIG_CRYPTO_WORKQUEUE=y
+ CONFIG_CSRC_R4K=y
++CONFIG_DEBUG_INFO=y
++CONFIG_DEBUG_INFO_DWARF4=y
++# CONFIG_DEBUG_INFO_REDUCED is not set
+ CONFIG_DMA_NONCOHERENT=y
++CONFIG_DUMMY_CONSOLE=y
+ CONFIG_EARLY_PRINTK=y
+ CONFIG_ETHERNET_PACKET_MANGLE=y
+ CONFIG_FIXED_PHY=y
++CONFIG_GDB_SCRIPTS=y
+ CONFIG_GENERIC_ATOMIC64=y
+ CONFIG_GENERIC_CLOCKEVENTS=y
+ CONFIG_GENERIC_CMOS_UPDATE=y
+@@ -385,6 +392,7 @@ CONFIG_HAVE_PERF_EVENTS=y
+ CONFIG_HAVE_REGS_AND_STACK_ACCESS_API=y
+ CONFIG_HAVE_SYSCALL_TRACEPOINTS=y
+ CONFIG_HAVE_VIRT_CPU_ACCOUNTING_GEN=y
++CONFIG_HW_CONSOLE=y
+ CONFIG_HZ_PERIODIC=y
+ CONFIG_I2C=y
+ CONFIG_I2C_ALGOBIT=y
+@@ -395,13 +403,20 @@ CONFIG_INITRAMFS_COMPRESSION=""
+ CONFIG_INITRAMFS_ROOT_GID=0
+ CONFIG_INITRAMFS_ROOT_UID=0
+ CONFIG_INITRAMFS_SOURCE="../../root"
++CONFIG_INPUT=y
+ CONFIG_INTEL_XWAY_PHY=y
+ CONFIG_IP17XX_PHY=y
+ CONFIG_IRQ_DOMAIN=y
+ CONFIG_IRQ_FORCED_THREADING=y
+ CONFIG_IRQ_MIPS_CPU=y
+ CONFIG_IRQ_WORK=y
++CONFIG_KGDB=y
++# CONFIG_KGDB_KDB is not set
++# CONFIG_KGDB_LOW_LEVEL_TRAP is not set
++CONFIG_KGDB_SERIAL_CONSOLE=y
++# CONFIG_KGDB_TESTS is not set
+ CONFIG_LEDS_GPIO=y
++CONFIG_MAGIC_SYSRQ=y
+ CONFIG_MARVELL_PHY=y
+ CONFIG_MDIO_BITBANG=y
+ CONFIG_MDIO_BUS=y
+@@ -472,6 +487,7 @@ CONFIG_RTL8367_PHY=y
+ # CONFIG_SERIAL_8250_FSL is not set
+ CONFIG_SERIAL_8250_NR_UARTS=1
+ CONFIG_SERIAL_8250_RUNTIME_UARTS=1
++# CONFIG_SERIAL_KGDB_NMI is not set
+ # CONFIG_SOC_AR71XX is not set
+ # CONFIG_SOC_AR724X is not set
+ # CONFIG_SOC_AR913X is not set
+@@ -503,3 +519,8 @@ CONFIG_SYS_SUPPORTS_ZBOOT_UART_PROM=y
+ CONFIG_TICK_CPU_ACCOUNTING=y
+ CONFIG_TINY_SRCU=y
+ CONFIG_USB_SUPPORT=y
++# CONFIG_VGACON_SOFT_SCROLLBACK is not set
++CONFIG_VGA_CONSOLE=y
++CONFIG_VT=y
++CONFIG_VT_CONSOLE=y
++# CONFIG_VT_HW_CONSOLE_BINDING is not set
+diff --git a/target/linux/ar71xx/image/Makefile b/target/linux/ar71xx/image/Makefile
+index 804532b55c..c485389f56 100644
+--- a/target/linux/ar71xx/image/Makefile
++++ b/target/linux/ar71xx/image/Makefile
+@@ -58,7 +58,7 @@ define Device/Default
+ PROFILES = Default Minimal $$(DEVICE_PROFILE)
+ MTDPARTS :=
+ BLOCKSIZE := 64k
+- CONSOLE := ttyS0,115200
++ CONSOLE := ttyS0,115200 nokaslr
+ CMDLINE = $$(if $$(BOARDNAME),board=$$(BOARDNAME)) $$(if $$(MTDPARTS),mtdparts=$$(MTDPARTS)) $$(if $$(CONSOLE),console=$$(CONSOLE))
+ KERNEL := kernel-bin | patch-cmdline | lzma | uImage lzma
+ COMPILE :=
+</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: