From d8092bae40316bfc7d7ca38270d905bad8317bbd Mon Sep 17 00:00:00 2001 From: uwe Date: Mon, 23 Oct 2006 21:13:00 +0000 Subject: [PATCH] Kill get_ascii and its alternative format, it's not very useful. We'd better use it for something else later. I'm also thinking of g/c'ing the temp buffer and emit disassembly with db_printf direcly, and get_ascii gets in the way. --- sys/arch/sh3/sh3/db_disasm.c | 24 ++++-------------------- 1 file changed, 4 insertions(+), 20 deletions(-) diff --git a/sys/arch/sh3/sh3/db_disasm.c b/sys/arch/sh3/sh3/db_disasm.c index aecc3ca253d4..bc65e76d05f4 100644 --- a/sys/arch/sh3/sh3/db_disasm.c +++ b/sys/arch/sh3/sh3/db_disasm.c @@ -1,4 +1,4 @@ -/* $NetBSD: db_disasm.c,v 1.18 2006/10/23 19:28:07 uwe Exp $ */ +/* $NetBSD: db_disasm.c,v 1.19 2006/10/23 21:13:00 uwe Exp $ */ /* * Copyright (c) 1998-2000 Internet Initiative Japan Inc. @@ -29,7 +29,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: db_disasm.c,v 1.18 2006/10/23 19:28:07 uwe Exp $"); +__KERNEL_RCSID(0, "$NetBSD: db_disasm.c,v 1.19 2006/10/23 21:13:00 uwe Exp $"); #include #include @@ -43,7 +43,6 @@ __KERNEL_RCSID(0, "$NetBSD: db_disasm.c,v 1.18 2006/10/23 19:28:07 uwe Exp $"); static uint16_t get_insn(const void *); static void get_opcode(const uint16_t *, char *); -static void get_ascii(const unsigned char *, char *); static void f_02(const uint16_t *, char *); static void f_03(const uint16_t *, char *); @@ -137,15 +136,11 @@ static rasm_t f[16][16] = { db_addr_t db_disasm(db_addr_t loc, boolean_t altfmt) { - char line[40], ascii[4]; const void *pc = (void *)loc; + char line[40]; get_opcode(pc, line); - if (altfmt) { - get_ascii(pc, ascii); - db_printf("%-32s ! %s\n", line, ascii); - } else - db_printf("%s\n", line); + db_printf("%s\n", line); return (loc + 2); } @@ -179,17 +174,6 @@ get_insn(const void *pc) return insn; } - -static void -get_ascii(const unsigned char *cp, char *str) -{ - - *str++ = (0x20 <= *cp && *cp < 0x7f) ? *cp : '.'; - cp++; - *str++ = (0x20 <= *cp && *cp < 0x7f) ? *cp : '.'; - *str = '\0'; -} - static void get_opcode(const uint16_t *pc, char *buf) {