From: Tonny Tzeng Date: Sun, 18 Apr 2010 02:15:27 +0800 Subject: [U-Boot] [PATCH v2 2/4] [ARM] Add KGDB support for ARM platforms In-Reply-To: <1271527979.17655.85.camel@localhost.localdomain> References: <1271524811.17655.32.camel@localhost.localdomain> <1271527807.17655.82.camel@localhost.localdomain> <1271527979.17655.85.camel@localhost.localdomain> Message-ID: <1271528127.17655.86.camel@localhost.localdomain> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Signed-off-by: Tonny Tzeng --- 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 #include +#ifdef CONFIG_CMD_KGDB +#include +#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