Module Name: src
Committed By: matt
Date: Thu Feb 16 10:45:17 UTC 2012
Modified Files:
src/sys/arch/mips/include [matt-nb5-mips64]: db_machdep.h
src/sys/arch/mips/mips [matt-nb5-mips64]: db_disasm.c db_interface.c
db_trace.c
Log Message:
Change db_expr_t to an register_t so we can see the full register contents
on N32 kernels.
To generate a diff of this commit:
cvs rdiff -u -r1.22.62.4 -r1.22.62.5 src/sys/arch/mips/include/db_machdep.h
cvs rdiff -u -r1.19.62.3 -r1.19.62.4 src/sys/arch/mips/mips/db_disasm.c
cvs rdiff -u -r1.64.16.23 -r1.64.16.24 src/sys/arch/mips/mips/db_interface.c
cvs rdiff -u -r1.35.38.5 -r1.35.38.6 src/sys/arch/mips/mips/db_trace.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/sys/arch/mips/include/db_machdep.h
diff -u src/sys/arch/mips/include/db_machdep.h:1.22.62.4 src/sys/arch/mips/include/db_machdep.h:1.22.62.5
--- src/sys/arch/mips/include/db_machdep.h:1.22.62.4 Fri Apr 29 08:26:21 2011
+++ src/sys/arch/mips/include/db_machdep.h Thu Feb 16 10:45:16 2012
@@ -1,4 +1,4 @@
-/* $NetBSD: db_machdep.h,v 1.22.62.4 2011/04/29 08:26:21 matt Exp $ */
+/* db_machdep.h,v 1.22.62.4 2011/04/29 08:26:21 matt Exp */
/*
* Copyright (c) 1997 Jonathan Stone (hereinafter referred to as the author)
@@ -42,7 +42,7 @@
typedef vaddr_t db_addr_t; /* address - unsigned */
-typedef long db_expr_t; /* expression - signed */
+typedef register_t db_expr_t; /* expression - signed */
typedef struct reg db_regs_t;
Index: src/sys/arch/mips/mips/db_disasm.c
diff -u src/sys/arch/mips/mips/db_disasm.c:1.19.62.3 src/sys/arch/mips/mips/db_disasm.c:1.19.62.4
--- src/sys/arch/mips/mips/db_disasm.c:1.19.62.3 Fri Apr 29 08:26:24 2011
+++ src/sys/arch/mips/mips/db_disasm.c Thu Feb 16 10:45:17 2012
@@ -1,4 +1,4 @@
-/* $NetBSD: db_disasm.c,v 1.19.62.3 2011/04/29 08:26:24 matt Exp $ */
+/* db_disasm.c,v 1.19.62.3 2011/04/29 08:26:24 matt Exp */
/*-
* Copyright (c) 1991, 1993
@@ -35,7 +35,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: db_disasm.c,v 1.19.62.3 2011/04/29 08:26:24 matt Exp $");
+__KERNEL_RCSID(0, "db_disasm.c,v 1.19.62.3 2011/04/29 08:26:24 matt Exp");
#include <sys/types.h>
#include <sys/systm.h>
@@ -157,7 +157,7 @@ static void print_addr(db_addr_t);
db_addr_t
db_disasm(db_addr_t loc, bool altfmt)
{
- u_int32_t instr;
+ uint32_t instr;
/*
* Take some care with addresses to not UTLB here as it
@@ -172,7 +172,7 @@ db_disasm(db_addr_t loc, bool altfmt)
}
}
else {
- instr = *(u_int32_t *)loc;
+ instr = *(uint32_t *)(intptr_t)loc;
}
return (db_disasm_insn(instr, loc, altfmt));
@@ -596,7 +596,7 @@ print_addr(db_addr_t loc)
if (diff == 0)
db_printf("%s", symname);
else
- db_printf("<%s+%lx>", symname, diff);
+ db_printf("<%s+%#"PRIxREGISTER">", symname, diff);
db_printf("\t[addr:%#"PRIxVADDR"]", loc);
} else {
db_printf("%#"PRIxVADDR, loc);
Index: src/sys/arch/mips/mips/db_interface.c
diff -u src/sys/arch/mips/mips/db_interface.c:1.64.16.23 src/sys/arch/mips/mips/db_interface.c:1.64.16.24
--- src/sys/arch/mips/mips/db_interface.c:1.64.16.23 Thu May 26 19:21:56 2011
+++ src/sys/arch/mips/mips/db_interface.c Thu Feb 16 10:45:17 2012
@@ -266,7 +266,7 @@ db_kvtophys_cmd(db_expr_t addr, bool hav
* Cast the physical address -- some platforms, while
* being ILP32, may be using 64-bit paddr_t's.
*/
- db_printf("0x%lx -> 0x%" PRIx64 "\n", addr,
+ db_printf("%#"PRIxPTR" -> 0x%" PRIx64 "\n", (intptr_t) addr,
(uint64_t) kvtophys(addr));
} else
printf("not a kernel virtual address\n");
@@ -672,7 +672,7 @@ db_mfcr_cmd(db_expr_t addr, bool have_ad
".set pop \n\t" \
: "=r"(value) : "r"(addr));
- db_printf("control reg 0x%lx = 0x%" PRIx64 "\n", addr, value);
+ db_printf("control reg %#"PRIx64" = %#" PRIx64 "\n", addr, value);
}
void
@@ -702,7 +702,7 @@ db_mtcr_cmd(db_expr_t addr, bool have_ad
".set pop \n\t" \
:: "r"(value), "r"(addr));
- db_printf("control reg 0x%lx = 0x%lx\n", addr, value);
+ db_printf("control reg %#"PRIx64" = %#"PRIx64"\n", addr, value);
}
#endif /* (MIPS64_RMIXL + MIPS64R2_RMIXL) > 0 */
Index: src/sys/arch/mips/mips/db_trace.c
diff -u src/sys/arch/mips/mips/db_trace.c:1.35.38.5 src/sys/arch/mips/mips/db_trace.c:1.35.38.6
--- src/sys/arch/mips/mips/db_trace.c:1.35.38.5 Fri Apr 29 08:26:25 2011
+++ src/sys/arch/mips/mips/db_trace.c Thu Feb 16 10:45:17 2012
@@ -1,4 +1,4 @@
-/* $NetBSD: db_trace.c,v 1.35.38.5 2011/04/29 08:26:25 matt Exp $ */
+/* db_trace.c,v 1.35.38.5 2011/04/29 08:26:25 matt Exp */
/*
* Mach Operating System
@@ -27,7 +27,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: db_trace.c,v 1.35.38.5 2011/04/29 08:26:25 matt Exp $");
+__KERNEL_RCSID(0, "db_trace.c,v 1.35.38.5 2011/04/29 08:26:25 matt Exp");
#include "opt_ddb.h"
@@ -169,7 +169,7 @@ db_stack_trace_print(db_expr_t addr, boo
}
if (lwpaddr) {
- l = (struct lwp *)addr;
+ l = (struct lwp *)(intptr_t)addr;
(*pr)("pid %d.%d ", l->l_proc->p_pid, l->l_lid);
} else {
/* "trace/t" */