[U-Boot] [PATCH v2 2/4] [ARM] Add KGDB support for ARM platforms

Tonny Tzeng tonny.tzeng at gmail.com
Sat Apr 17 20:15:27 CEST 2010


Signed-off-by: Tonny Tzeng <tonny.tzeng at gmail.com>
---
 arch/arm/lib/interrupts.c |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)

diff --git a/arch/arm/lib/interrupts.c b/arch/arm/lib/interrupts.c
index 1f2b815..6ee4309 100644
--- a/arch/arm/lib/interrupts.c
+++ b/arch/arm/lib/interrupts.c
@@ -37,6 +37,9 @@
 
 #include <common.h>
 #include <asm/proc-armv/ptrace.h>
+#ifdef CONFIG_CMD_KGDB
+#include <kgdb.h>
+#endif
 
 #ifdef CONFIG_USE_IRQ
 DECLARE_GLOBAL_DATA_PTR;
@@ -137,6 +140,12 @@ void show_regs (struct pt_regs *regs)
 
 void do_undefined_instruction (struct pt_regs *pt_regs)
 {
+#ifdef CONFIG_CMD_KGDB
+	if (*(unsigned long *)(instruction_pointer(pt_regs) - 4) == KGDB_COMPILED_BREAK) {
+		(*debugger_exception_handler)(pt_regs);
+		return;
+	}
+#endif
 	printf ("undefined instruction\n");
 	show_regs (pt_regs);
 	bad_mode ();
-- 
1.6.0.6




More information about the U-Boot mailing list