Subject: API Change request: Try 2
To: None <tech-kern@netbsd.org>
From: Cherry G. Mathew <cherry@sdf.lonestar.org>
List: tech-kern
Date: 04/01/2006 07:06:41
Hi,
Could this (trivial) patch be reviewed ?
Comments about less intrusive (to other ports) ways to do this would help.
This is from kern/32359
Thanks,
--
~Cherry
Index: arch/alpha/include/db_machdep.h
===================================================================
RCS file: /cvsroot/src/sys/arch/alpha/include/db_machdep.h,v
retrieving revision 1.14
diff -u -r1.14 db_machdep.h
--- arch/alpha/include/db_machdep.h 29 Apr 2003 17:06:04 -0000 1.14
+++ arch/alpha/include/db_machdep.h 1 Apr 2006 12:55:15 -0000
@@ -50,7 +50,7 @@
#define BKPT_ADDR(addr) (addr) /* breakpoint address */
#define BKPT_INST 0x00000080 /* breakpoint instruction */
#define BKPT_SIZE (4) /* size of breakpoint inst */
-#define BKPT_SET(inst) (BKPT_INST)
+#define BKPT_SET(inst, addr) (BKPT_INST)
#define FIXUP_PC_AFTER_BREAK(regs) \
((regs)->tf_regs[FRAME_PC] -= BKPT_SIZE)
Index: arch/amd64/include/db_machdep.h
===================================================================
RCS file: /cvsroot/src/sys/arch/amd64/include/db_machdep.h,v
retrieving revision 1.3
diff -u -r1.3 db_machdep.h
--- arch/amd64/include/db_machdep.h 23 Jun 2003 11:01:04 -0000 1.3
+++ arch/amd64/include/db_machdep.h 1 Apr 2006 12:55:15 -0000
@@ -60,7 +60,7 @@
#define BKPT_ADDR(addr) (addr) /* breakpoint address */
#define BKPT_INST 0xcc /* breakpoint instruction */
#define BKPT_SIZE (1) /* size of breakpoint inst */
-#define BKPT_SET(inst) (BKPT_INST)
+#define BKPT_SET(inst, addr) (BKPT_INST)
#define FIXUP_PC_AFTER_BREAK(regs) ((regs)->tf_rip -= BKPT_SIZE)
Index: arch/arm/include/db_machdep.h
===================================================================
RCS file: /cvsroot/src/sys/arch/arm/include/db_machdep.h,v
retrieving revision 1.9
diff -u -r1.9 db_machdep.h
--- arch/arm/include/db_machdep.h 11 Dec 2005 12:16:46 -0000 1.9
+++ arch/arm/include/db_machdep.h 1 Apr 2006 12:55:17 -0000
@@ -60,7 +60,7 @@
#define BKPT_ADDR(addr) (addr) /* breakpoint address */
#define BKPT_INST (KERNEL_BREAKPOINT) /* breakpoint instruction */
#define BKPT_SIZE (INSN_SIZE) /* size of breakpoint inst */
-#define BKPT_SET(inst) (BKPT_INST)
+#define BKPT_SET(inst, addr) (BKPT_INST)
/*#define FIXUP_PC_AFTER_BREAK(regs) ((regs)->tf_pc -= BKPT_SIZE)*/
Index: arch/hppa/include/db_machdep.h
===================================================================
RCS file: /cvsroot/src/sys/arch/hppa/include/db_machdep.h,v
retrieving revision 1.4
diff -u -r1.4 db_machdep.h
--- arch/hppa/include/db_machdep.h 16 Feb 2006 20:17:13 -0000 1.4
+++ arch/hppa/include/db_machdep.h 1 Apr 2006 12:55:26 -0000
@@ -63,7 +63,7 @@
#define BKPT_ADDR(addr) (addr) /* breakpoint address */
#define BKPT_INST 0x00010000 /* break 0,8 */
#define BKPT_SIZE sizeof(int)
-#define BKPT_SET(inst) BKPT_INST
+#define BKPT_SET(inst, addr) BKPT_INST
#define IS_BREAKPOINT_TRAP(type, code) (type != T_RECOVERY)
#define IS_WATCHPOINT_TRAP(type, code) 0
Index: arch/i386/include/db_machdep.h
===================================================================
RCS file: /cvsroot/src/sys/arch/i386/include/db_machdep.h,v
retrieving revision 1.24
diff -u -r1.24 db_machdep.h
--- arch/i386/include/db_machdep.h 27 Oct 2003 13:44:20 -0000 1.24
+++ arch/i386/include/db_machdep.h 1 Apr 2006 12:55:26 -0000
@@ -58,7 +58,7 @@
#define BKPT_ADDR(addr) (addr) /* breakpoint address */
#define BKPT_INST 0xcc /* breakpoint instruction */
#define BKPT_SIZE (1) /* size of breakpoint inst */
-#define BKPT_SET(inst) (BKPT_INST)
+#define BKPT_SET(inst, addr) (BKPT_INST)
#define FIXUP_PC_AFTER_BREAK(regs) ((regs)->tf_eip -= BKPT_SIZE)
Index: arch/m68k/include/db_machdep.h
===================================================================
RCS file: /cvsroot/src/sys/arch/m68k/include/db_machdep.h,v
retrieving revision 1.26
diff -u -r1.26 db_machdep.h
--- arch/m68k/include/db_machdep.h 11 Dec 2005 12:17:53 -0000 1.26
+++ arch/m68k/include/db_machdep.h 1 Apr 2006 12:55:27 -0000
@@ -56,7 +56,7 @@
#define BKPT_ADDR(addr) (addr) /* breakpoint address */
#define BKPT_INST 0x4e4f /* breakpoint instruction */
#define BKPT_SIZE (2) /* size of breakpoint inst */
-#define BKPT_SET(inst) (BKPT_INST)
+#define BKPT_SET(inst, addr) (BKPT_INST)
#define FIXUP_PC_AFTER_BREAK(regs) ((regs)->tf_pc -= BKPT_SIZE)
Index: arch/mips/include/db_machdep.h
===================================================================
RCS file: /cvsroot/src/sys/arch/mips/include/db_machdep.h,v
retrieving revision 1.17
diff -u -r1.17 db_machdep.h
--- arch/mips/include/db_machdep.h 11 Dec 2005 12:18:09 -0000 1.17
+++ arch/mips/include/db_machdep.h 1 Apr 2006 12:55:28 -0000
@@ -66,7 +66,7 @@
#define BKPT_ADDR(addr) (addr) /* breakpoint address */
#define BKPT_INST 0x0001000D
#define BKPT_SIZE (4) /* size of breakpoint inst */
-#define BKPT_SET(inst) (BKPT_INST)
+#define BKPT_SET(inst, addr) (BKPT_INST)
#define IS_BREAKPOINT_TRAP(type, code) ((type) == T_BREAK)
#define IS_WATCHPOINT_TRAP(type, code) (0) /* XXX mips3 watchpoint */
Index: arch/pc532/include/db_machdep.h
===================================================================
RCS file: /cvsroot/src/sys/arch/pc532/include/db_machdep.h,v
retrieving revision 1.18
diff -u -r1.18 db_machdep.h
--- arch/pc532/include/db_machdep.h 11 Dec 2005 12:18:31 -0000 1.18
+++ arch/pc532/include/db_machdep.h 1 Apr 2006 12:55:32 -0000
@@ -66,7 +66,7 @@
#define BKPT_ADDR(addr) (addr) /* breakpoint address */
#define BKPT_INST 0xf2 /* breakpoint instruction */
#define BKPT_SIZE (1) /* size of breakpoint inst */
-#define BKPT_SET(inst) (BKPT_INST)
+#define BKPT_SET(inst, addr) (BKPT_INST)
#define db_clear_single_step(regs) ((regs)->tf_regs.r_psr &= ~PSL_T)
#define db_set_single_step(regs) ((regs)->tf_regs.r_psr |= PSL_T)
Index: arch/pdp10/include/db_machdep.h
===================================================================
RCS file: /cvsroot/src/sys/arch/pdp10/include/db_machdep.h,v
retrieving revision 1.3
diff -u -r1.3 db_machdep.h
--- arch/pdp10/include/db_machdep.h 11 Dec 2005 12:18:34 -0000 1.3
+++ arch/pdp10/include/db_machdep.h 1 Apr 2006 12:55:32 -0000
@@ -50,7 +50,7 @@
#define BKPT_INST 0041000000000 /* MUUO */
#define BKPT_SIZE 4 /* bytes */
-#define BKPT_SET(inst) (BKPT_INST)
+#define BKPT_SET(inst, addr) (BKPT_INST)
#define BKPT_ADDR(addr) (addr) /* breakpoint address */
#define IS_BREAKPOINT_TRAP(type, code) (1) /* XXX */
Index: arch/powerpc/include/db_machdep.h
===================================================================
RCS file: /cvsroot/src/sys/arch/powerpc/include/db_machdep.h,v
retrieving revision 1.17
diff -u -r1.17 db_machdep.h
--- arch/powerpc/include/db_machdep.h 29 Apr 2003 17:06:06 -0000 1.17
+++ arch/powerpc/include/db_machdep.h 1 Apr 2006 12:55:33 -0000
@@ -69,7 +69,7 @@
#define BKPT_ASM "trap" /* should match BKPT_INST */
#define BKPT_INST 0x7fe00008 /* breakpoint instruction */
#define BKPT_SIZE (4) /* size of breakpoint inst */
-#define BKPT_SET(inst) (BKPT_INST)
+#define BKPT_SET(inst, addr) (BKPT_INST)
#ifndef PPC_IBM4XX
#define SR_SINGLESTEP 0x400
Index: arch/sh3/include/db_machdep.h
===================================================================
RCS file: /cvsroot/src/sys/arch/sh3/include/db_machdep.h,v
retrieving revision 1.10
diff -u -r1.10 db_machdep.h
--- arch/sh3/include/db_machdep.h 18 Dec 2005 22:41:50 -0000 1.10
+++ arch/sh3/include/db_machdep.h 1 Apr 2006 12:55:34 -0000
@@ -49,7 +49,7 @@
#define BKPT_ADDR(addr) (addr) /* breakpoint address */
#define BKPT_INST 0xc3c3 /* breakpoint instruction */
#define BKPT_SIZE 2 /* size of breakpoint inst */
-#define BKPT_SET(inst) BKPT_INST
+#define BKPT_SET(inst, addr) BKPT_INST
#define FIXUP_PC_AFTER_BREAK(regs) ((regs)->tf_spc -= BKPT_SIZE)
Index: arch/sh5/include/db_machdep.h
===================================================================
RCS file: /cvsroot/src/sys/arch/sh5/include/db_machdep.h,v
retrieving revision 1.12
diff -u -r1.12 db_machdep.h
--- arch/sh5/include/db_machdep.h 11 Dec 2005 12:19:00 -0000 1.12
+++ arch/sh5/include/db_machdep.h 1 Apr 2006 12:55:34 -0000
@@ -52,7 +52,7 @@
#define BKPT_ADDR(addr) ((addr) & ~3) /* ditch the instruction type bits */
#define BKPT_INST 0x6ff5fff0 /* breakpoint instruction (BRK) */
#define BKPT_SIZE 4 /* size of breakpoint inst */
-#define BKPT_SET(inst) BKPT_INST
+#define BKPT_SET(inst, addr) BKPT_INST
#define IS_BREAKPOINT_TRAP(type, code) ((type) == T_BREAK)
#define IS_WATCHPOINT_TRAP(type, code) (0) /* XXX (msaitoh) */
Index: arch/sparc/include/db_machdep.h
===================================================================
RCS file: /cvsroot/src/sys/arch/sparc/include/db_machdep.h,v
retrieving revision 1.21
diff -u -r1.21 db_machdep.h
--- arch/sparc/include/db_machdep.h 4 Mar 2006 03:39:02 -0000 1.21
+++ arch/sparc/include/db_machdep.h 1 Apr 2006 12:55:35 -0000
@@ -68,7 +68,7 @@
#define BKPT_ADDR(addr) (addr) /* breakpoint address */
#define BKPT_INST 0x91d02001 /* breakpoint instruction */
#define BKPT_SIZE (4) /* size of breakpoint inst */
-#define BKPT_SET(inst) (BKPT_INST)
+#define BKPT_SET(inst, addr) (BKPT_INST)
#define IS_BREAKPOINT_TRAP(type, code) \
((type) == T_BREAKPOINT || (type) == T_KGDB_EXEC)
Index: arch/sparc64/include/db_machdep.h
===================================================================
RCS file: /cvsroot/src/sys/arch/sparc64/include/db_machdep.h,v
retrieving revision 1.18
diff -u -r1.18 db_machdep.h
--- arch/sparc64/include/db_machdep.h 20 Feb 2006 19:00:27 -0000 1.18
+++ arch/sparc64/include/db_machdep.h 1 Apr 2006 12:55:35 -0000
@@ -79,7 +79,7 @@
#define BKPT_ADDR(addr) (addr) /* breakpoint address */
#define BKPT_INST 0x91d02001 /* breakpoint instruction */
#define BKPT_SIZE (4) /* size of breakpoint inst */
-#define BKPT_SET(inst) (BKPT_INST)
+#define BKPT_SET(inst, addr) (BKPT_INST)
#define IS_BREAKPOINT_TRAP(type, code) \
((type) == T_BREAKPOINT || (type) == T_KGDB_EXEC)
Index: arch/vax/include/db_machdep.h
===================================================================
RCS file: /cvsroot/src/sys/arch/vax/include/db_machdep.h,v
retrieving revision 1.13
diff -u -r1.13 db_machdep.h
--- arch/vax/include/db_machdep.h 12 Mar 2006 17:14:41 -0000 1.13
+++ arch/vax/include/db_machdep.h 1 Apr 2006 12:55:35 -0000
@@ -51,7 +51,7 @@
#define BKPT_ADDR(addr) (addr) /* breakpoint address */
#define BKPT_INST 0x03 /* breakpoint instruction */
#define BKPT_SIZE (1) /* size of breakpoint inst */
-#define BKPT_SET(inst) (BKPT_INST)
+#define BKPT_SET(inst, addr) (BKPT_INST)
#define FIXUP_PC_AFTER_BREAK(regs) ((regs)->pc -= BKPT_SIZE)
Index: ddb/db_break.c
===================================================================
RCS file: /cvsroot/src/sys/ddb/db_break.c,v
retrieving revision 1.20
diff -u -r1.20 db_break.c
--- ddb/db_break.c 11 Dec 2005 12:20:53 -0000 1.20
+++ ddb/db_break.c 1 Apr 2006 12:55:37 -0000
@@ -172,7 +172,7 @@
bkpt->bkpt_inst = db_get_value(bkpt->address,
BKPT_SIZE, FALSE);
db_put_value(bkpt->address,
- BKPT_SIZE, BKPT_SET(bkpt->bkpt_inst));
+ BKPT_SIZE, BKPT_SET(bkpt->bkpt_inst, bkpt->address));
}
db_breakpoints_inserted = TRUE;
}