Skip to contentSkip to conversation

kgdb for ia64

WIP Luck, Tony 1 participant 1 message Dec 5, 2008

lore
Share & tools
lore

Luck, Tony

author
#0 lore raw

I've been poking at kgdb for ia64 ... here's what I have so far. Known problems:

1) Backtrace doesn't step back more than one function ... probably I'm giving some bad register information (or not enough register information).

2) gdb will set breakpoints, but won't clear them again:
(gdb) br sys_fsync
Breakpoint 1 at 0xa00000010019d8f0
(gdb) clear sys_fsync
No breakpoint at sys_fsync.

Probably lots more ... I haven't done much testing beyond finding that I can continue from the initial breakpoint, single-step, examine memory.

---

 arch/ia64/Kconfig             |    1 
 arch/ia64/include/asm/break.h |    1 
 arch/ia64/include/asm/kgdb.h  |   85 ++++++++
 arch/ia64/kernel/Makefile     |    1 
 arch/ia64/kernel/entry.S      |    9 
 arch/ia64/kernel/kgdb.c       |  437 ++++++++++++++++++++++++++++++++++++++++++
 6 files changed, 534 insertions(+)
arch/ia64/Kconfig +1 -0
index 6bd91ed..ebf1696 100644
@@ -23,6 +23,7 @@ config IA64
 	select HAVE_KRETPROBES
 	select HAVE_DMA_ATTRS
 	select HAVE_KVM
+	select HAVE_ARCH_KGDB
 	select HAVE_ARCH_TRACEHOOK
 	default y
 	help
arch/ia64/include/asm/break.h +1 -0
index e90c40e..bd93aa1 100644
@@ -14,6 +14,7 @@
 #define __IA64_BREAK_KDB		0x80100
 #define __IA64_BREAK_KPROBE		0x81000 /* .. 0x81fff */
 #define __IA64_BREAK_JPROBE		0x82000
+#define __IA64_BREAK_KGDB		0x83000 /* .. 0x83fff */
 
 /*
  * OS-specific break numbers:
arch/ia64/include/asm/kgdb.h new file +85 -0

85 lines not on this page · raw message

arch/ia64/kernel/Makefile +1 -0
index c381ea9..8b926c7 100644
@@ -33,6 +33,7 @@ obj-$(CONFIG_CRASH_DUMP)	+= crash_dump.o
 obj-$(CONFIG_IA64_UNCACHED_ALLOCATOR)	+= uncached.o
 obj-$(CONFIG_AUDIT)		+= audit.o
 obj-$(CONFIG_PCI_MSI)		+= msi_ia64.o
+obj-$(CONFIG_KGDB)		+= kgdb.o
 mca_recovery-y			+= mca_drv.o mca_drv_asm.o
 obj-$(CONFIG_IA64_MC_ERR_INJECT)+= err_inject.o
 
arch/ia64/kernel/entry.S +9 -0
index d435f4a..74a14fb 100644
@@ -50,6 +50,15 @@
 
 #include "minstate.h"
 
+#ifdef CONFIG_KGDB
+#include <asm/break.h>
+
+GLOBAL_ENTRY(arch_kgdb_breakpoint)
+	break __IA64_BREAK_KGDB
+	br.ret.sptk.many rp
+END(arch_kgdb_breakpoint)
+#endif
+
 #ifdef __IA64_ASM_PARAVIRTUALIZED_NATIVE
 	/*
 	 * execve() is special because in case of success, we need to
arch/ia64/kernel/kgdb.c new file +434 -0

434 lines not on this page · raw message