Subject: issues with KGDB and ARM
To: None <>
From: Karl Janmar <>
List: port-arm
Date: 03/29/2005 01:13:05
Hi there ARM hackers!

I have put some work in my GP32 port (which I talked about erlier in 
this list). I had some issues when I was using KGDB with netbsd/arm.
I use the 2.0 Release as my source base.

  I needed to do some modification to generate a valid KGDB undefined 
instruction when single stepping, if I don't do this the kernel will 
generate an unhandled undefined exception.

This happen when sys/ddb/db_run.c: db_set_single_step() calling machdep 
stuff in db_machdep.c inserting a BKPT_INST.

RCS file: /cvsroot/src/sys/arch/arm/include/db_machdep.h,v
retrieving revision 1.8
diff -u -r1.8 db_machdep.h
--- db_machdep.h        9 Jul 2003 20:14:15 -0000       1.8
+++ db_machdep.h        28 Mar 2005 22:53:01 -0000
@@ -58,7 +58,12 @@

  #define        BKPT_ADDR(addr) (addr)                  /* breakpoint 
address */
+#if defined(DDB)
  #define        BKPT_INST       (KERNEL_BREAKPOINT)     /* breakpoint 
instruction */
+/* breakpoint instruction if we use KGDB, this is used in 
db_set_temp_breakpoint() */
+#define        BKPT_INST       (GDB5_BREAKPOINT)
  #define        BKPT_SIZE       (INSN_SIZE)             /* size of 
breakpoint inst */
  #define        BKPT_SET(inst)  (BKPT_INST)

This might not be the best place to put the logic, seperation ddb/kgdb.

Too tired to write something else then nonsens now. bbl
- Karl