summaryrefslogtreecommitdiff
path: root/sys/arch/alpha
diff options
context:
space:
mode:
authorArtur Grabowski <art@cvs.openbsd.org>2002-05-18 09:49:18 +0000
committerArtur Grabowski <art@cvs.openbsd.org>2002-05-18 09:49:18 +0000
commit906979d106be653cd0c2ceec860f1e3fd621190b (patch)
tree614c96fdad124b5a879089edc51c2094140d7c66 /sys/arch/alpha
parentc12bcfb0228a5dda70c310cb3d35a0e01e627f96 (diff)
Rename the MD db_stack_trace_cmd to db_stack_trace_print. Add an argument
that specifies which printf funciton it should use. Implement db_stack_trace_cmd in MI code. Thanks to miod@ for all the tests.
Diffstat (limited to 'sys/arch/alpha')
-rw-r--r--sys/arch/alpha/alpha/db_trace.c27
1 files changed, 14 insertions, 13 deletions
diff --git a/sys/arch/alpha/alpha/db_trace.c b/sys/arch/alpha/alpha/db_trace.c
index 791cbb96d68..a56939b18c3 100644
--- a/sys/arch/alpha/alpha/db_trace.c
+++ b/sys/arch/alpha/alpha/db_trace.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: db_trace.c,v 1.10 2002/05/16 13:01:41 art Exp $ */
+/* $OpenBSD: db_trace.c,v 1.11 2002/05/18 09:49:16 art Exp $ */
/*
* Copyright (c) 1997 Niklas Hallqvist. All rights reserverd.
@@ -177,11 +177,12 @@ disp(x)
* symbols available.
*/
void
-db_stack_trace_cmd(addr, have_addr, count, modif)
+db_stack_trace_print(addr, have_addr, count, modif, pr)
db_expr_t addr;
int have_addr;
db_expr_t count;
char *modif;
+ int (*pr)(const char *, ...);
{
u_long *frame;
int i, framesize;
@@ -213,7 +214,7 @@ trapframe:
/* Limit the search for procedure start */
offset = 65536;
}
- db_printf("%s(", name);
+ (*pr)("%s(", name);
framesize = 0;
for (i = sizeof (int); i <= offset; i += sizeof (int)) {
@@ -269,11 +270,11 @@ trapframe:
*/
for (i = 0; i < 6; i++) {
if (i > 0)
- db_printf(", ");
+ (*pr)(", ");
if (slot[16 + i])
- db_printf("%lx", *slot[16 + i]);
+ (*pr)("%lx", *slot[16 + i]);
else
- db_printf("?");
+ (*pr)("?");
}
#if 0
@@ -283,18 +284,18 @@ trapframe:
*
* Print the stack frame contents.
*/
- db_printf(") [%p: ", frame);
+ (*pr)(") [%p: ", frame);
if (framesize > 1) {
for (i = 0; i < framesize - 1; i++)
- db_printf("%lx, ", frame[i]);
- db_printf("%lx", frame[i]);
+ (*pr)("%lx, ", frame[i]);
+ (*pr)("%lx", frame[i]);
}
- db_printf("] at ");
+ (*pr)("] at ");
#else
- db_printf(") at ");
+ (*pr)(") at ");
#endif
- db_printsym(pc, DB_STGY_PROC, db_printf);
- db_printf("\n");
+ db_printsym(pc, DB_STGY_PROC, pr);
+ (*pr)("\n");
/*
* If we are looking at a Xent* routine we are in a trap