From 19e9205a23a412d9e48707fc012db23116ccf282 Mon Sep 17 00:00:00 2001 From: John Baldwin Date: Wed, 12 Jul 2006 21:22:44 +0000 Subject: Simplify the pager support in DDB. Allowing different db commands to install custom pager functions didn't actually happen in practice (they all just used the simple pager and passed in a local quit pointer). So, just hardcode the simple pager as the only pager and make it set a global db_pager_quit flag that db commands can check when the user hits 'q' (or a suitable variant) at the pager prompt. Also, now that it's easy to do so, enable paging by default for all ddb commands. Any command that wishes to honor the quit flag can do so by checking db_pager_quit. Note that the pager can also be effectively disabled by setting $lines to 0. Other fixes: - 'show idt' on i386 and pc98 now actually checks the quit flag and terminates early. - 'show intr' now actually checks the quit flag and terminates early. --- sys/ddb/db_command.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'sys/ddb/db_command.c') diff --git a/sys/ddb/db_command.c b/sys/ddb/db_command.c index c15edaa97148..c92d52fa2aff 100644 --- a/sys/ddb/db_command.c +++ b/sys/ddb/db_command.c @@ -392,8 +392,9 @@ db_command(last_cmdp, cmd_table) /* * Execute the command. */ + db_enable_pager(); (*cmd->fcn)(addr, have_addr, count, modif); - db_setup_paging(NULL, NULL, -1); + db_disable_pager(); if (cmd->flag & CS_SET_DOT) { /* @@ -675,16 +676,13 @@ 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); LIST_FOREACH(p, &allproc, 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) + if (db_pager_quit) return; } } -- cgit v1.3