Tue Jan 17 12:32:52 2012 UTC ()
Fix the symbol lookup on branches, etc.


(skrll)
diff -r1.14 -r1.15 src/sys/arch/hppa/hppa/db_disasm.c

cvs diff -r1.14 -r1.15 src/sys/arch/hppa/hppa/db_disasm.c (expand / switch to unified diff)

--- src/sys/arch/hppa/hppa/db_disasm.c 2012/01/17 12:08:43 1.14
+++ src/sys/arch/hppa/hppa/db_disasm.c 2012/01/17 12:32:52 1.15
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: db_disasm.c,v 1.14 2012/01/17 12:08:43 skrll Exp $ */ 1/* $NetBSD: db_disasm.c,v 1.15 2012/01/17 12:32:52 skrll Exp $ */
2 2
3/* $OpenBSD: db_disasm.c,v 1.9 2000/04/18 20:02:45 mickey Exp $ */ 3/* $OpenBSD: db_disasm.c,v 1.9 2000/04/18 20:02:45 mickey Exp $ */
4 4
5/* 5/*
6 * Copyright (c) 1999,2005 Michael Shalayeff 6 * Copyright (c) 1999,2005 Michael Shalayeff
7 * All rights reserved. 7 * All rights reserved.
8 * 8 *
9 * Permission to use, copy, modify, and distribute this software for any 9 * Permission to use, copy, modify, and distribute this software for any
10 * purpose with or without fee is hereby granted, provided that the above 10 * purpose with or without fee is hereby granted, provided that the above
11 * copyright notice and this permission notice appear in all copies. 11 * copyright notice and this permission notice appear in all copies.
12 * 12 *
13 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 13 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
14 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 14 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
@@ -28,27 +28,27 @@ @@ -28,27 +28,27 @@
28 * the above copyright notice and this notice appears in all 28 * the above copyright notice and this notice appears in all
29 * copies, and that the name of Hewlett-Packard Company not be 29 * copies, and that the name of Hewlett-Packard Company not be
30 * used in advertising or publicity pertaining to distribution 30 * used in advertising or publicity pertaining to distribution
31 * of the software without specific, written prior permission. 31 * of the software without specific, written prior permission.
32 * Hewlett-Packard Company makes no representations about the 32 * Hewlett-Packard Company makes no representations about the
33 * suitability of this software for any purpose. 33 * suitability of this software for any purpose.
34 */ 34 */
35 35
36/* 36/*
37 * unasm.c -- HP_PA Instruction Printer 37 * unasm.c -- HP_PA Instruction Printer
38 */ 38 */
39 39
40#include <sys/cdefs.h> 40#include <sys/cdefs.h>
41__KERNEL_RCSID(0, "$NetBSD: db_disasm.c,v 1.14 2012/01/17 12:08:43 skrll Exp $"); 41__KERNEL_RCSID(0, "$NetBSD: db_disasm.c,v 1.15 2012/01/17 12:32:52 skrll Exp $");
42 42
43#include <sys/param.h> 43#include <sys/param.h>
44#include <sys/systm.h> 44#include <sys/systm.h>
45 45
46#include <machine/db_machdep.h> 46#include <machine/db_machdep.h>
47#include <ddb/db_access.h> 47#include <ddb/db_access.h>
48#include <ddb/db_sym.h> 48#include <ddb/db_sym.h>
49#include <ddb/db_output.h> 49#include <ddb/db_output.h>
50#include <ddb/db_interface.h> 50#include <ddb/db_interface.h>
51 51
52 52
53/* IMPORTANT NOTE: 53/* IMPORTANT NOTE:
54 * All modules using this header may assume that the datatype "int" is a 54 * All modules using this header may assume that the datatype "int" is a
@@ -2223,27 +2223,27 @@ fmpyaddDasm(const struct inst *i, OFS of @@ -2223,27 +2223,27 @@ fmpyaddDasm(const struct inst *i, OFS of
2223 db_printf("add%s\t%%f%s, %%f%s, %%f%s, %%f%s, %%f%s", 2223 db_printf("add%s\t%%f%s, %%f%s, %%f%s, %%f%s, %%f%s",
2224 ((SinglePrec(w)) ? "sgl" : "dbl"), ms1, ms2, mt, as, ad); 2224 ((SinglePrec(w)) ? "sgl" : "dbl"), ms1, ms2, mt, as, ad);
2225 2225
2226 return (1); 2226 return (1);
2227} 2227}
2228 2228
2229vaddr_t 2229vaddr_t
2230db_disasm(vaddr_t loc, bool flag) 2230db_disasm(vaddr_t loc, bool flag)
2231{ 2231{
2232 const struct inst *i; 2232 const struct inst *i;
2233 const struct majoropcode *m; 2233 const struct majoropcode *m;
2234 u_int ext; 2234 u_int ext;
2235 union insn instruct; 2235 union insn instruct;
2236 OFS ofs = 0; 2236 OFS ofs = loc;
2237 2237
2238 iExInit(); 2238 iExInit();
2239 2239
2240 if (USERMODE(loc)) { 2240 if (USERMODE(loc)) {
2241 if (copyin((void *)(loc &~ HPPA_PC_PRIV_MASK), 2241 if (copyin((void *)(loc &~ HPPA_PC_PRIV_MASK),
2242 &instruct, sizeof(instruct))) 2242 &instruct, sizeof(instruct)))
2243 instruct.w = 0; 2243 instruct.w = 0;
2244 } else 2244 } else
2245 instruct.w = *(int *)loc; 2245 instruct.w = *(int *)loc;
2246 2246
2247 m = &majopcs[Opcode(instruct)]; 2247 m = &majopcs[Opcode(instruct)];
2248 ext = OpExt(instruct.w, m); 2248 ext = OpExt(instruct.w, m);
2249 if (ext <= m->maxsubop) { 2249 if (ext <= m->maxsubop) {