summaryrefslogtreecommitdiffstats
path: root/sys/ddb
diff options
context:
space:
mode:
authorcognet <cognet@FreeBSD.org>2005-10-02 22:57:31 +0000
committercognet <cognet@FreeBSD.org>2005-10-02 22:57:31 +0000
commitfad768f07c2c65298560b437932e66cd7089de25 (patch)
tree9e19d74efc71996612d06e274b7778cb87aae0d3 /sys/ddb
parente6d490315ac686c39ae56c71658d8455ba229207 (diff)
downloadFreeBSD-src-fad768f07c2c65298560b437932e66cd7089de25.zip
FreeBSD-src-fad768f07c2c65298560b437932e66cd7089de25.tar.gz
- Call db_setup_paging() for traceall.
- Make it so one can't call db_setup_paging() if it has already been called before. traceall needs this, or else the db_setup_paging() call from db_trace_thread() will reset the printed line number, and override its argument. This is not perfect for traceall, because even if one presses 'q' while in the middle of printing a backtrace it will finish printing the backtrace before exiting, as db_trace_thread() won't be notified it should stop, but it is hard to do better without reworking the pager interface a lot more.
Diffstat (limited to 'sys/ddb')
-rw-r--r--sys/ddb/db_command.c5
-rw-r--r--sys/ddb/db_output.c13
2 files changed, 13 insertions, 5 deletions
diff --git a/sys/ddb/db_command.c b/sys/ddb/db_command.c
index 91c8fcc..8b49c04 100644
--- a/sys/ddb/db_command.c
+++ b/sys/ddb/db_command.c
@@ -684,12 +684,17 @@ db_stack_trace_all(db_expr_t dummy, boolean_t dummy2, db_expr_t dummy3,
{
struct proc *p;
struct thread *td;
+ int quit;
+ quit = 0;
+ db_setup_paging(db_simple_pager, &quit, db_lines_per_page);
for (p = LIST_FIRST(&allproc); p != NULL; p = LIST_NEXT(p, p_list)) {
FOREACH_THREAD_IN_PROC(p, td) {
db_printf("\nTracing command %s pid %d tid %ld td %p\n",
p->p_comm, p->p_pid, (long)td->td_tid, td);
db_trace_thread(td, -1);
+ if (quit)
+ return;
}
}
}
diff --git a/sys/ddb/db_output.c b/sys/ddb/db_output.c
index 3a0fbc5..fccae29 100644
--- a/sys/ddb/db_output.c
+++ b/sys/ddb/db_output.c
@@ -186,11 +186,14 @@ db_putchar(c, arg)
void
db_setup_paging(db_page_calloutfcn_t *callout, void *arg, int maxlines)
{
-
- db_page_callout = callout;
- db_page_callout_arg = arg;
- db_maxlines = maxlines;
- db_newlines = 0;
+
+ if (db_page_callout == NULL || callout == NULL || arg ==
+ db_page_callout_arg) {
+ db_page_callout = callout;
+ db_page_callout_arg = arg;
+ db_maxlines = maxlines;
+ db_newlines = 0;
+ }
}
/*
OpenPOWER on IntegriCloud