summaryrefslogtreecommitdiff
path: root/sys/arch
diff options
context:
space:
mode:
authorMiod Vallat <miod@cvs.openbsd.org>2007-03-27 15:57:21 +0000
committerMiod Vallat <miod@cvs.openbsd.org>2007-03-27 15:57:21 +0000
commit5ed409ffdcb56ab483477fe94dcdacb589b62186 (patch)
tree059f691173ab3296ff46db66ebb7a0fdb17d4dcb /sys/arch
parent0702faa5375b9117aeadc01e9c3b3ba96dd13189 (diff)
Try and print symbol-relative addresses for branches, and display
delay slots instructions correctly.
Diffstat (limited to 'sys/arch')
-rw-r--r--sys/arch/mips64/mips64/db_disasm.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/sys/arch/mips64/mips64/db_disasm.c b/sys/arch/mips64/mips64/db_disasm.c
index 7ec3da65ccb..6a2d58b8e50 100644
--- a/sys/arch/mips64/mips64/db_disasm.c
+++ b/sys/arch/mips64/mips64/db_disasm.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: db_disasm.c,v 1.5 2006/01/15 14:36:09 miod Exp $ */
+/* $OpenBSD: db_disasm.c,v 1.6 2007/03/27 15:57:20 miod Exp $ */
/*-
* Copyright (c) 1991, 1993
* The Regents of the University of California. All rights reserved.
@@ -35,7 +35,7 @@
* SUCH DAMAGE.
*
* from: @(#)kadb.c 8.1 (Berkeley) 6/10/93
- * $Id: db_disasm.c,v 1.5 2006/01/15 14:36:09 miod Exp $
+ * $Id: db_disasm.c,v 1.6 2007/03/27 15:57:20 miod Exp $
*/
#include <sys/param.h>
@@ -45,6 +45,7 @@
#include <machine/db_machdep.h>
#include <ddb/db_interface.h>
#include <ddb/db_output.h>
+#include <ddb/db_sym.h>
static char *op_name[64] = {
/* 0 */ "spec", "bcond","j", "jal", "beq", "bne", "blez", "bgtz",
@@ -131,7 +132,8 @@ db_disasm(loc, altfmt)
{
if (md_printins(kdbpeek((void *)loc), loc)) {
loc += 4;
- printf("\t\t");
+ db_printsym(loc, DB_STGY_ANY, db_printf);
+ db_printf(":\t ");
md_printins(kdbpeek((void *)loc), loc);
}
loc += 4;
@@ -258,7 +260,8 @@ md_printins(int ins, int mdbdot)
reg_name[i.IType.rt]);
pr_displ:
delay = 1;
- db_printf("0x%08x", mdbdot + 4 + ((short)i.IType.imm << 2));
+ db_printsym(mdbdot + 4 + ((short)i.IType.imm << 2),
+ DB_STGY_PROC, db_printf);
break;
case OP_COP0: