Interface change: db_printsym() takes a third argument, pr, a function
pointer indicating how to print the symbol. This allows db_printsym() to called in places where db_printf() is not an appropriate output function. While straightforward, apologies in advance if I've introduced any minor syntax errors; I was unable to test compilation this on all the affected platforms.
This commit is contained in:
parent
091b74891d
commit
f3528d725d
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: db_disasm.c,v 1.7 2000/03/20 02:54:45 thorpej Exp $ */
|
||||
/* $NetBSD: db_disasm.c,v 1.8 2000/05/25 19:57:30 jhawk Exp $ */
|
||||
|
||||
/*
|
||||
* Mach Operating System
|
||||
@ -48,7 +48,7 @@
|
||||
|
||||
#include <sys/cdefs.h> /* RCS ID & Copyright macro defns */
|
||||
|
||||
__KERNEL_RCSID(0, "$NetBSD: db_disasm.c,v 1.7 2000/03/20 02:54:45 thorpej Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: db_disasm.c,v 1.8 2000/05/25 19:57:30 jhawk Exp $");
|
||||
|
||||
#include <sys/param.h>
|
||||
#include <sys/systm.h>
|
||||
@ -1080,7 +1080,7 @@ loadstore_address:
|
||||
register_name(i.branch_format.ra));
|
||||
branch_displacement:
|
||||
db_printsym(iadr + sizeof(alpha_instruction) +
|
||||
(signed_immediate << 2), DB_STGY_PROC);
|
||||
(signed_immediate << 2), DB_STGY_PROC, db_printf);
|
||||
break;
|
||||
default:
|
||||
/*
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: db_trace.c,v 1.4 1999/07/12 07:37:14 ross Exp $ */
|
||||
/* $NetBSD: db_trace.c,v 1.5 2000/05/25 19:57:30 jhawk Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1999 The NetBSD Foundation, Inc.
|
||||
@ -42,7 +42,7 @@
|
||||
|
||||
#include <sys/cdefs.h> /* RCS ID & Copyright macro defns */
|
||||
|
||||
__KERNEL_RCSID(0, "$NetBSD: db_trace.c,v 1.4 1999/07/12 07:37:14 ross Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: db_trace.c,v 1.5 2000/05/25 19:57:30 jhawk Exp $");
|
||||
|
||||
#include <sys/param.h>
|
||||
#include <sys/systm.h>
|
||||
@ -208,7 +208,7 @@ db_stack_trace_cmd(addr, have_addr, count, modif)
|
||||
* debugger (for serious debugging).
|
||||
*/
|
||||
db_printf("%s() at ", symname);
|
||||
db_printsym(callpc, DB_STGY_PROC);
|
||||
db_printsym(callpc, DB_STGY_PROC, db_printf);
|
||||
db_printf("\n");
|
||||
|
||||
/*
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: db_disasm.c,v 1.1 2000/05/09 21:55:55 bjh21 Exp $ */
|
||||
/* $NetBSD: db_disasm.c,v 1.2 2000/05/25 19:57:32 jhawk Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1996 Mark Brinicombe.
|
||||
@ -62,7 +62,7 @@ static void
|
||||
db_disasm_printaddr(u_int address)
|
||||
{
|
||||
|
||||
db_printsym((db_addr_t)address, DB_STGY_ANY);
|
||||
db_printsym((db_addr_t)address, DB_STGY_ANY, db_printf);
|
||||
}
|
||||
|
||||
vm_offset_t
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: db_machdep.c,v 1.1 2000/05/09 21:55:55 bjh21 Exp $ */
|
||||
/* $NetBSD: db_machdep.c,v 1.2 2000/05/25 19:57:32 jhawk Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1996 Mark Brinicombe
|
||||
@ -173,7 +173,8 @@ db_show_intrchain_cmd(addr, have_addr, count, modif)
|
||||
name = "?";
|
||||
|
||||
db_printf("%s(", name);
|
||||
db_printsym((u_int)ptr->ih_func, DB_STGY_PROC);
|
||||
db_printsym((u_int)ptr->ih_func, DB_STGY_PROC,
|
||||
db_printf);
|
||||
db_printf(") %08x\n", (u_int)ptr->ih_arg);
|
||||
ptr = ptr->ih_next;
|
||||
}
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: db_trace.c,v 1.2 2000/05/13 14:43:11 bjh21 Exp $ */
|
||||
/* $NetBSD: db_trace.c,v 1.3 2000/05/25 19:57:32 jhawk Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1996 Scott K. Stevens
|
||||
@ -140,9 +140,9 @@ db_stack_trace_cmd(addr, have_addr, count, modif)
|
||||
|
||||
db_printf("%s", name);
|
||||
db_printf("(scp=0x%x(", frame[FR_SCP]);
|
||||
db_printsym(scp, DB_STGY_PROC);
|
||||
db_printsym(scp, DB_STGY_PROC, db_printf);
|
||||
db_printf("), rlv=0x%x(", frame[FR_RLV]);
|
||||
db_printsym(frame[FR_RLV] & R15_PC, DB_STGY_PROC);
|
||||
db_printsym(frame[FR_RLV] & R15_PC, DB_STGY_PROC, db_printf);
|
||||
db_printf("),\n\trsp=0x%x", frame[FR_RSP]);
|
||||
db_printf(", rfp=0x%x", frame[FR_RFP]);
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: db_disasm.c,v 1.12 1998/04/01 23:04:16 mark Exp $ */
|
||||
/* $NetBSD: db_disasm.c,v 1.13 2000/05/25 19:57:32 jhawk Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1996 Mark Brinicombe.
|
||||
@ -55,7 +55,7 @@ static void
|
||||
db_disasm_printaddr(address)
|
||||
u_int address;
|
||||
{
|
||||
db_printsym((db_addr_t)address, DB_STGY_ANY);
|
||||
db_printsym((db_addr_t)address, DB_STGY_ANY, db_printf);
|
||||
}
|
||||
|
||||
vm_offset_t
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: db_machdep.c,v 1.14 1999/10/05 12:34:32 tron Exp $ */
|
||||
/* $NetBSD: db_machdep.c,v 1.15 2000/05/25 19:57:32 jhawk Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1996 Mark Brinicombe
|
||||
@ -178,7 +178,8 @@ db_show_intrchain_cmd(addr, have_addr, count, modif)
|
||||
name = "?";
|
||||
|
||||
db_printf("%s(", name);
|
||||
db_printsym((u_int)ptr->ih_func, DB_STGY_PROC);
|
||||
db_printsym((u_int)ptr->ih_func, DB_STGY_PROC,
|
||||
db_printf);
|
||||
db_printf(") %08x\n", (u_int)ptr->ih_arg);
|
||||
ptr = ptr->ih_next;
|
||||
}
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: db_trace.c,v 1.11 1999/04/12 20:38:18 pk Exp $ */
|
||||
/* $NetBSD: db_trace.c,v 1.12 2000/05/25 19:57:32 jhawk Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1996 Scott K. Stevens
|
||||
@ -115,7 +115,7 @@ db_stack_trace_cmd(addr, have_addr, count, modif)
|
||||
name = "?";
|
||||
|
||||
db_printf("%s(", name);
|
||||
db_printsym(pc, DB_STGY_PROC);
|
||||
db_printsym(pc, DB_STGY_PROC, db_printf);
|
||||
db_printf(")");
|
||||
db_printf("\n");
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: db_disasm.c,v 1.17 2000/03/28 19:15:40 thorpej Exp $ */
|
||||
/* $NetBSD: db_disasm.c,v 1.18 2000/05/25 19:57:33 jhawk Exp $ */
|
||||
|
||||
/*
|
||||
* Mach Operating System
|
||||
@ -970,7 +970,7 @@ db_print_address(seg, size, addrp)
|
||||
if (seg)
|
||||
db_printf("%s:", seg);
|
||||
|
||||
db_printsym((db_addr_t)addrp->disp, DB_STGY_ANY);
|
||||
db_printsym((db_addr_t)addrp->disp, DB_STGY_ANY, db_printf);
|
||||
if (addrp->base != 0 || addrp->index != 0) {
|
||||
db_printf("(");
|
||||
if (addrp->base)
|
||||
@ -1323,15 +1323,18 @@ db_disasm(loc, altfmt)
|
||||
if (seg)
|
||||
db_printf("%s:%#r",seg, displ);
|
||||
else
|
||||
db_printsym((db_addr_t)displ, DB_STGY_ANY);
|
||||
db_printsym((db_addr_t)displ, DB_STGY_ANY,
|
||||
db_printf);
|
||||
break;
|
||||
case Db:
|
||||
get_value_inc(displ, loc, 1, TRUE);
|
||||
db_printsym((db_addr_t)(displ + loc), DB_STGY_XTRN);
|
||||
db_printsym((db_addr_t)(displ + loc), DB_STGY_XTRN,
|
||||
db_printf);
|
||||
break;
|
||||
case Dl:
|
||||
get_value_inc(displ, loc, 4, TRUE);
|
||||
db_printsym((db_addr_t)(displ + loc), DB_STGY_XTRN);
|
||||
db_printsym((db_addr_t)(displ + loc), DB_STGY_XTRN,
|
||||
db_printf);
|
||||
break;
|
||||
case o1:
|
||||
db_printf("$1");
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: db_trace.c,v 1.25 1999/06/07 07:00:07 thorpej Exp $ */
|
||||
/* $NetBSD: db_trace.c,v 1.26 2000/05/25 19:57:33 jhawk Exp $ */
|
||||
|
||||
/*
|
||||
* Mach Operating System
|
||||
@ -330,7 +330,7 @@ db_stack_trace_cmd(addr, have_addr, count, modif)
|
||||
db_printf(",");
|
||||
}
|
||||
db_printf(") at ");
|
||||
db_printsym(callpc, DB_STGY_PROC);
|
||||
db_printsym(callpc, DB_STGY_PROC, db_printf);
|
||||
db_printf("\n");
|
||||
|
||||
if (lastframe == 0 && offset == 0 && !have_addr) {
|
||||
@ -370,7 +370,7 @@ db_stack_trace_cmd(addr, have_addr, count, modif)
|
||||
}
|
||||
|
||||
if (count && is_trap != NONE) {
|
||||
db_printsym(callpc, DB_STGY_XTRN);
|
||||
db_printsym(callpc, DB_STGY_XTRN, db_printf);
|
||||
db_printf(":\n");
|
||||
}
|
||||
}
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: db_disasm.c,v 1.4 1997/03/20 12:00:37 matthias Exp $ */
|
||||
/* $NetBSD: db_disasm.c,v 1.5 2000/05/25 19:57:33 jhawk Exp $ */
|
||||
|
||||
/*
|
||||
* Mach Operating System
|
||||
@ -997,20 +997,24 @@ void db_formatOperand(operand, loc)
|
||||
break;
|
||||
|
||||
case AMODE_MREL:
|
||||
db_printsym((db_addr_t) operand->o_disp1, DB_STGY_ANY);
|
||||
db_printsym((db_addr_t) operand->o_disp1, DB_STGY_ANY,
|
||||
db_printf);
|
||||
db_printf("(");
|
||||
db_printsym((db_addr_t) operand->o_disp0, DB_STGY_ANY);
|
||||
db_printsym((db_addr_t) operand->o_disp0, DB_STGY_ANY,
|
||||
db_printf);
|
||||
db_printf("(%s))",regTable[operand->o_reg0].name);
|
||||
break;
|
||||
|
||||
case AMODE_QUICK:
|
||||
case AMODE_IMM:
|
||||
db_printsym((db_addr_t) operand->o_disp0, DB_STGY_ANY);
|
||||
db_printsym((db_addr_t) operand->o_disp0, DB_STGY_ANY,
|
||||
db_printf);
|
||||
break;
|
||||
|
||||
case AMODE_ABS:
|
||||
db_printf("@");
|
||||
db_printsym((db_addr_t) operand->o_disp0, DB_STGY_ANY);
|
||||
db_printsym((db_addr_t) operand->o_disp0, DB_STGY_ANY,
|
||||
db_printf);
|
||||
break;
|
||||
|
||||
case AMODE_EXT:
|
||||
@ -1025,7 +1029,8 @@ void db_formatOperand(operand, loc)
|
||||
|
||||
case AMODE_RREL:
|
||||
case AMODE_MSPC:
|
||||
db_printsym((db_addr_t) operand->o_disp0, DB_STGY_XTRN);
|
||||
db_printsym((db_addr_t) operand->o_disp0, DB_STGY_XTRN,
|
||||
db_printf);
|
||||
db_printf("(%s)",regTable[operand->o_reg0].name);
|
||||
break;
|
||||
|
||||
@ -1156,7 +1161,7 @@ void db_formatAsm(insn, loc, altfmt)
|
||||
}
|
||||
db_printsym((db_addr_t)
|
||||
insn->i_opr[i].o_disp0 + value,
|
||||
DB_STGY_XTRN);
|
||||
DB_STGY_XTRN, db_printf);
|
||||
j++;
|
||||
}
|
||||
}
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: db_trace.c,v 1.6 1998/09/02 19:17:14 matthias Exp $ */
|
||||
/* $NetBSD: db_trace.c,v 1.7 2000/05/25 19:57:34 jhawk Exp $ */
|
||||
|
||||
/*
|
||||
* Mach Operating System
|
||||
@ -332,7 +332,7 @@ db_stack_trace_cmd(addr, have_addr, count, modif)
|
||||
db_printf(",");
|
||||
}
|
||||
db_printf(") at ");
|
||||
db_printsym(callpc, DB_STGY_PROC);
|
||||
db_printsym(callpc, DB_STGY_PROC, printf);
|
||||
db_printf("\n");
|
||||
|
||||
if (lastframe == 0 && offset == 0 && !have_addr) {
|
||||
@ -372,7 +372,7 @@ db_stack_trace_cmd(addr, have_addr, count, modif)
|
||||
}
|
||||
|
||||
if (count && is_trap != NONE) {
|
||||
db_printsym(callpc, DB_STGY_XTRN);
|
||||
db_printsym(callpc, DB_STGY_XTRN, db_printf);
|
||||
db_printf(":\n");
|
||||
}
|
||||
}
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: db_disasm.c,v 1.1 1999/09/13 10:31:27 itojun Exp $ */
|
||||
/* $NetBSD: db_disasm.c,v 1.2 2000/05/25 19:57:34 jhawk Exp $ */
|
||||
|
||||
/*
|
||||
* Mach Operating System
|
||||
@ -939,7 +939,7 @@ db_print_address(seg, size, addrp)
|
||||
if (seg)
|
||||
db_printf("%s:", seg);
|
||||
|
||||
db_printsym((db_addr_t)addrp->disp, DB_STGY_ANY);
|
||||
db_printsym((db_addr_t)addrp->disp, DB_STGY_ANY, db_printf);
|
||||
if (addrp->base != 0 || addrp->index != 0) {
|
||||
db_printf("(");
|
||||
if (addrp->base)
|
||||
@ -1281,15 +1281,18 @@ db_disasm(loc, altfmt)
|
||||
if (seg)
|
||||
db_printf("%s:%#r",seg, displ);
|
||||
else
|
||||
db_printsym((db_addr_t)displ, DB_STGY_ANY);
|
||||
db_printsym((db_addr_t)displ, DB_STGY_ANY,
|
||||
db_printf);
|
||||
break;
|
||||
case Db:
|
||||
get_value_inc(displ, loc, 1, TRUE);
|
||||
db_printsym((db_addr_t)(displ + loc), DB_STGY_XTRN);
|
||||
db_printsym((db_addr_t)(displ + loc), DB_STGY_XTRN,
|
||||
db_printf);
|
||||
break;
|
||||
case Dl:
|
||||
get_value_inc(displ, loc, 4, TRUE);
|
||||
db_printsym((db_addr_t)(displ + loc), DB_STGY_XTRN);
|
||||
db_printsym((db_addr_t)(displ + loc), DB_STGY_XTRN,
|
||||
db_printf);
|
||||
break;
|
||||
case o1:
|
||||
db_printf("$1");
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: db_trace.c,v 1.1 1999/09/13 10:31:28 itojun Exp $ */
|
||||
/* $NetBSD: db_trace.c,v 1.2 2000/05/25 19:57:34 jhawk Exp $ */
|
||||
|
||||
/*
|
||||
* Mach Operating System
|
||||
@ -316,7 +316,7 @@ db_stack_trace_cmd(addr, have_addr, count, modif)
|
||||
db_printf(",");
|
||||
}
|
||||
db_printf(") at ");
|
||||
db_printsym(callpc, DB_STGY_PROC);
|
||||
db_printsym(callpc, DB_STGY_PROC, db_printf);
|
||||
db_printf("\n");
|
||||
|
||||
if (lastframe == 0 && offset == 0 && !have_addr) {
|
||||
@ -356,7 +356,7 @@ db_stack_trace_cmd(addr, have_addr, count, modif)
|
||||
}
|
||||
|
||||
if (count && is_trap != NONE) {
|
||||
db_printsym(callpc, DB_STGY_XTRN);
|
||||
db_printsym(callpc, DB_STGY_XTRN, db_printf);
|
||||
db_printf(":\n");
|
||||
}
|
||||
}
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: db_disasm.c,v 1.11 1998/09/22 05:40:14 chs Exp $ */
|
||||
/* $NetBSD: db_disasm.c,v 1.12 2000/05/25 19:57:35 jhawk Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1994 David S. Miller, davem@nadzieja.rutgers.edu
|
||||
@ -910,17 +910,17 @@ db_disasm(loc, altfmt)
|
||||
case 'm':
|
||||
db_printsym(
|
||||
(db_addr_t)(loc + DISP22_SE(insn)),
|
||||
DB_STGY_ANY);
|
||||
DB_STGY_ANY, db_printf);
|
||||
break;
|
||||
case 'u':
|
||||
db_printsym(
|
||||
(db_addr_t)(loc + DISP19_SE(insn)),
|
||||
DB_STGY_ANY);
|
||||
DB_STGY_ANY, db_printf);
|
||||
break;
|
||||
case 'n':
|
||||
db_printsym(
|
||||
(db_addr_t)(loc + DISP30_SE(insn)),
|
||||
DB_STGY_PROC);
|
||||
DB_STGY_PROC, db_printf);
|
||||
break;
|
||||
case 's':
|
||||
db_printf("%%asi");
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: db_trace.c,v 1.14 2000/04/10 01:22:09 chs Exp $ */
|
||||
/* $NetBSD: db_trace.c,v 1.15 2000/05/25 19:57:35 jhawk Exp $ */
|
||||
|
||||
/*
|
||||
* Mach Operating System
|
||||
@ -125,7 +125,7 @@ db_stack_trace_cmd(addr, have_addr, count, modif)
|
||||
for (i=0; i < 5; i++)
|
||||
db_printf("0x%x, ", frame->fr_arg[i]);
|
||||
db_printf("0x%x) at ", frame->fr_arg[i]);
|
||||
db_printsym(pc, DB_STGY_PROC);
|
||||
db_printsym(pc, DB_STGY_PROC, db_printf);
|
||||
db_printf("\n");
|
||||
}
|
||||
}
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: db_disasm.c,v 1.5 1999/02/28 00:23:58 eeh Exp $ */
|
||||
/* $NetBSD: db_disasm.c,v 1.6 2000/05/25 19:57:35 jhawk Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1994 David S. Miller, davem@nadzieja.rutgers.edu
|
||||
@ -940,24 +940,24 @@ db_disasm(loc, altfmt)
|
||||
break;
|
||||
case 'l':
|
||||
db_printsym(
|
||||
(db_addr_t)(loc + (int)(4 * ((insn & 0x1fff) |
|
||||
(db_addr_t)(loc + (int)(4 * ((insn & 0x1fff) |
|
||||
((insn >> 20) & 0x3)))),
|
||||
DB_STGY_ANY);
|
||||
DB_STGY_ANY, db_printf);
|
||||
break;
|
||||
case 'm':
|
||||
db_printsym(
|
||||
(db_addr_t)(loc + (int)(4 * (insn & 0x3fffff))),
|
||||
DB_STGY_ANY);
|
||||
(db_addr_t)(loc + (int)(4 * (insn & 0x3fffff))),
|
||||
DB_STGY_ANY, db_printf);
|
||||
break;
|
||||
case 'u':
|
||||
db_printsym(
|
||||
(db_addr_t)(loc + (int)(4 * (insn & 0x7ffff))),
|
||||
DB_STGY_ANY);
|
||||
(db_addr_t)(loc + (int)(4 * (insn & 0x7ffff))),
|
||||
DB_STGY_ANY, db_printf);
|
||||
break;
|
||||
case 'n':
|
||||
db_printsym(
|
||||
(db_addr_t)(loc + (int)(4 * (insn & 0x3fffffff))),
|
||||
DB_STGY_PROC);
|
||||
(db_addr_t)(loc + (int)(4 * (insn & 0x3fffffff))),
|
||||
DB_STGY_PROC, db_printf);
|
||||
break;
|
||||
case 's':
|
||||
db_printf("%%asi");
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: db_interface.c,v 1.31 2000/05/19 18:54:27 thorpej Exp $ */
|
||||
/* $NetBSD: db_interface.c,v 1.32 2000/05/25 19:57:35 jhawk Exp $ */
|
||||
|
||||
/*
|
||||
* Mach Operating System
|
||||
@ -691,7 +691,7 @@ db_print_trace_entry(te, i)
|
||||
(int)te->tt, (u_long)te->tstate,
|
||||
(u_long)te->tfault, (u_long)te->tsp,
|
||||
(u_long)te->tpc);
|
||||
db_printsym((u_long)te->tpc, DB_STGY_PROC);
|
||||
db_printsym((u_long)te->tpc, DB_STGY_PROC, db_printf);
|
||||
db_printf(": ");
|
||||
if ((te->tpc && !(te->tpc&0x3)) &&
|
||||
curproc &&
|
||||
@ -832,7 +832,7 @@ db_dump_buf(addr, have_addr, count, modif)
|
||||
buf->b_dev, buf->b_data);
|
||||
db_printf("saveaddr:%p lblkno:%x blkno:%x iodone:%x",
|
||||
buf->b_saveaddr, buf->b_lblkno, buf->b_blkno, buf->b_iodone);
|
||||
db_printsym((long)buf->b_iodone, DB_STGY_PROC);
|
||||
db_printsym((long)buf->b_iodone, DB_STGY_PROC, db_printf);
|
||||
db_printf("\nvp:%p dirtyoff:%x dirtyend:%x\n", buf->b_vp, buf->b_dirtyoff, buf->b_dirtyend);
|
||||
}
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: db_trace.c,v 1.12 2000/04/06 13:32:49 mrg Exp $ */
|
||||
/* $NetBSD: db_trace.c,v 1.13 2000/05/25 19:57:35 jhawk Exp $ */
|
||||
|
||||
/*
|
||||
* Mach Operating System
|
||||
@ -126,7 +126,7 @@ db_stack_trace_cmd(addr, have_addr, count, modif)
|
||||
db_printf("%x, ", f32->fr_arg[i]);
|
||||
db_printf("%x) at ", f32->fr_arg[i]);
|
||||
}
|
||||
db_printsym(pc, DB_STGY_PROC);
|
||||
db_printsym(pc, DB_STGY_PROC, db_printf);
|
||||
db_printf("\n");
|
||||
}
|
||||
}
|
||||
@ -176,7 +176,7 @@ u_int64_t frame;
|
||||
f->fr_arg[4], f->fr_arg[5], f->fr_fp, f->fr_pc);
|
||||
#if 0
|
||||
/* Sometimes this don't work. Dunno why. */
|
||||
db_printsym(f->fr_pc, DB_STGY_PROC);
|
||||
db_printsym(f->fr_pc, DB_STGY_PROC, db_printf);
|
||||
#endif
|
||||
db_printf("\n");
|
||||
} else {
|
||||
@ -205,7 +205,7 @@ u_int64_t frame;
|
||||
db_printf("%8x %8x %8x %8x %8x %8x %8x=sp %8x=pc:",
|
||||
f->fr_arg[0], f->fr_arg[1], f->fr_arg[2], f->fr_arg[3],
|
||||
f->fr_arg[4], f->fr_arg[5], f->fr_fp, f->fr_pc);
|
||||
db_printsym(f->fr_pc, DB_STGY_PROC);
|
||||
db_printsym(f->fr_pc, DB_STGY_PROC, db_printf);
|
||||
db_printf("\n");
|
||||
} else {
|
||||
struct frame32 fr;
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: db_break.c,v 1.12 2000/03/30 11:31:26 augustss Exp $ */
|
||||
/* $NetBSD: db_break.c,v 1.13 2000/05/25 19:57:36 jhawk Exp $ */
|
||||
|
||||
/*
|
||||
* Mach Operating System
|
||||
@ -217,7 +217,7 @@ db_list_breakpoints()
|
||||
db_printf("%s%p %5d ",
|
||||
db_map_current(bkpt->map) ? "*" : " ",
|
||||
bkpt->map, bkpt->init_count);
|
||||
db_printsym(bkpt->address, DB_STGY_PROC);
|
||||
db_printsym(bkpt->address, DB_STGY_PROC, db_printf);
|
||||
db_printf("\n");
|
||||
}
|
||||
}
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: db_examine.c,v 1.17 2000/03/30 11:31:26 augustss Exp $ */
|
||||
/* $NetBSD: db_examine.c,v 1.18 2000/05/25 19:57:36 jhawk Exp $ */
|
||||
|
||||
/*
|
||||
* Mach Operating System
|
||||
@ -88,7 +88,7 @@ db_examine(addr, fmt, count)
|
||||
while ((c = *fp++) != 0) {
|
||||
if (db_print_position() == 0) {
|
||||
/* Always print the address. */
|
||||
db_printsym(addr, DB_STGY_ANY);
|
||||
db_printsym(addr, DB_STGY_ANY, db_printf);
|
||||
db_printf(":\t");
|
||||
db_prev = addr;
|
||||
}
|
||||
@ -198,7 +198,7 @@ db_print_cmd(addr, have_addr, count, modif)
|
||||
|
||||
switch (db_print_format) {
|
||||
case 'a':
|
||||
db_printsym((db_addr_t)addr, DB_STGY_ANY);
|
||||
db_printsym((db_addr_t)addr, DB_STGY_ANY, db_printf);
|
||||
break;
|
||||
case 'r':
|
||||
db_printf("%11lr", addr);
|
||||
@ -233,7 +233,7 @@ void
|
||||
db_print_loc_and_inst(loc)
|
||||
db_addr_t loc;
|
||||
{
|
||||
db_printsym(loc, DB_STGY_PROC);
|
||||
db_printsym(loc, DB_STGY_PROC, db_printf);
|
||||
db_printf(":\t");
|
||||
(void) db_disasm(loc, FALSE);
|
||||
}
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: db_sym.c,v 1.20 2000/05/22 14:49:10 jhawk Exp $ */
|
||||
/* $NetBSD: db_sym.c,v 1.21 2000/05/25 19:57:36 jhawk Exp $ */
|
||||
|
||||
/*
|
||||
* Mach Operating System
|
||||
@ -499,9 +499,10 @@ unsigned int db_maxoff = 0x10000000;
|
||||
|
||||
|
||||
void
|
||||
db_printsym(off, strategy)
|
||||
db_printsym(off, strategy, pr)
|
||||
db_expr_t off;
|
||||
db_strategy_t strategy;
|
||||
void (*pr) __P((const char *, ...));
|
||||
{
|
||||
db_expr_t d;
|
||||
char *filename;
|
||||
@ -514,17 +515,17 @@ db_printsym(off, strategy)
|
||||
cursym = db_search_symbol(off, strategy, &d);
|
||||
db_symbol_values(cursym, &name, &value);
|
||||
if (name && (d < db_maxoff) && value) {
|
||||
db_printf("%s", name);
|
||||
(*pr)("%s", name);
|
||||
if (d)
|
||||
db_printf("+%#lr", d);
|
||||
(*pr)("+%#lr", d);
|
||||
if (strategy == DB_STGY_PROC) {
|
||||
if (db_line_at_pc(cursym, &filename, &linenum, off))
|
||||
db_printf(" [%s:%d]", filename, linenum);
|
||||
(*pr)(" [%s:%d]", filename, linenum);
|
||||
}
|
||||
return;
|
||||
}
|
||||
}
|
||||
db_printf("%#ln", off);
|
||||
(*pr)("%#ln", off);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: db_sym.h,v 1.12 2000/05/22 14:49:10 jhawk Exp $ */
|
||||
/* $NetBSD: db_sym.h,v 1.13 2000/05/25 19:57:36 jhawk Exp $ */
|
||||
|
||||
/*
|
||||
* Mach Operating System
|
||||
@ -137,7 +137,7 @@ void db_symbol_values __P((db_sym_t, char **, db_expr_t *));
|
||||
db_symbol_values(db_search_symbol(val,DB_STGY_XTRN,offp),namep,0)
|
||||
/* ditto, but no locals */
|
||||
|
||||
void db_printsym __P((db_expr_t, db_strategy_t));
|
||||
void db_printsym __P((db_expr_t, db_strategy_t, void(*)(const char *, ...)));
|
||||
/* print closest symbol to a value */
|
||||
|
||||
boolean_t db_line_at_pc __P((db_sym_t, char **, int *, db_expr_t));
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: db_write_cmd.c,v 1.12 2000/03/30 11:31:27 augustss Exp $ */
|
||||
/* $NetBSD: db_write_cmd.c,v 1.13 2000/05/25 19:57:36 jhawk Exp $ */
|
||||
|
||||
/*
|
||||
* Mach Operating System
|
||||
@ -79,7 +79,7 @@ db_write_cmd(address, have_addr, count, modif)
|
||||
|
||||
while (db_expression(&new_value)) {
|
||||
old_value = db_get_value(addr, size, FALSE);
|
||||
db_printsym(addr, DB_STGY_ANY);
|
||||
db_printsym(addr, DB_STGY_ANY, db_printf);
|
||||
db_printf("\t\t%#*ln = %#*ln\n", (int)(sizeof (old_value) * 2) + 2,
|
||||
old_value, (int)(sizeof (new_value) * 2) + 2, new_value);
|
||||
db_put_value(addr, size, new_value);
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: db_xxx.c,v 1.8 2000/03/26 20:24:12 kleink Exp $ */
|
||||
/* $NetBSD: db_xxx.c,v 1.9 2000/05/25 19:57:36 jhawk Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1982, 1986, 1989, 1991, 1993
|
||||
@ -178,7 +178,7 @@ db_show_all_procs(addr, haddr, count, modif)
|
||||
if(p->p_wchan && p->p_wmesg) {
|
||||
db_printf(" %-12s", p->p_wmesg);
|
||||
db_printsym((db_expr_t)p->p_wchan,
|
||||
DB_STGY_XTRN);
|
||||
DB_STGY_XTRN, db_printf);
|
||||
}
|
||||
db_printf("\n");
|
||||
break;
|
||||
|
Loading…
Reference in New Issue
Block a user