summaryrefslogtreecommitdiffstats
path: root/sys/sparc64
diff options
context:
space:
mode:
authorjhb <jhb@FreeBSD.org>2006-07-12 21:22:44 +0000
committerjhb <jhb@FreeBSD.org>2006-07-12 21:22:44 +0000
commita72b0bcd7fd4baed9952beefc6398b3d79c789d9 (patch)
treef2aff187736391b024e6cf6f28e95e5708a2d927 /sys/sparc64
parent883bd6a55eef6005b2e79ccc0c939a365bebb656 (diff)
downloadFreeBSD-src-a72b0bcd7fd4baed9952beefc6398b3d79c789d9.zip
FreeBSD-src-a72b0bcd7fd4baed9952beefc6398b3d79c789d9.tar.gz
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.
Diffstat (limited to 'sys/sparc64')
-rw-r--r--sys/sparc64/sparc64/db_trace.c15
1 files changed, 6 insertions, 9 deletions
diff --git a/sys/sparc64/sparc64/db_trace.c b/sys/sparc64/sparc64/db_trace.c
index bb5f60c..73d3b31 100644
--- a/sys/sparc64/sparc64/db_trace.c
+++ b/sys/sparc64/sparc64/db_trace.c
@@ -103,7 +103,7 @@ db_frame(struct db_variable *vp, db_expr_t *valuep, int op)
* User stack trace (debugging aid).
*/
static void
-db_utrace(struct thread *td, struct trapframe *tf, int count, int *quitp)
+db_utrace(struct thread *td, struct trapframe *tf, int count)
{
struct pcb *pcb;
db_addr_t sp, rsp, o7, pc;
@@ -115,7 +115,7 @@ db_utrace(struct thread *td, struct trapframe *tf, int count, int *quitp)
FALSE);
pc = db_get_value((db_addr_t)&tf->tf_tpc, sizeof(tf->tf_tpc), FALSE);
db_printf("user trace: trap %%o7=%#lx\n", o7);
- while (count-- && sp != 0 && !*quitp) {
+ while (count-- && sp != 0 && !db_pager_quit) {
db_printf("pc %#lx, sp %#lx\n", pc, sp);
/* First, check whether the frame is in the pcb. */
found = 0;
@@ -141,7 +141,7 @@ db_utrace(struct thread *td, struct trapframe *tf, int count, int *quitp)
}
static int
-db_print_trap(struct thread *td, struct trapframe *tf, int count, int *quitp)
+db_print_trap(struct thread *td, struct trapframe *tf, int count)
{
struct proc *p;
const char *symname;
@@ -219,7 +219,7 @@ db_print_trap(struct thread *td, struct trapframe *tf, int count, int *quitp)
db_printf("userland() at ");
db_printsym(tpc, DB_STGY_PROC);
db_printf("\n");
- db_utrace(td, tf, count, quitp);
+ db_utrace(td, tf, count);
}
return (user);
}
@@ -236,7 +236,6 @@ db_backtrace(struct thread *td, struct frame *fp, int count)
db_addr_t pc;
int trap;
int user;
- int quit;
if (count == -1)
count = 1024;
@@ -244,9 +243,7 @@ db_backtrace(struct thread *td, struct frame *fp, int count)
trap = 0;
user = 0;
npc = 0;
- quit = 0;
- db_setup_paging(db_simple_pager, &quit, db_lines_per_page);
- while (count-- && !user && !quit) {
+ while (count-- && !user && !db_pager_quit) {
pc = (db_addr_t)db_get_value((db_addr_t)&fp->fr_pc,
sizeof(fp->fr_pc), FALSE);
if (trap) {
@@ -272,7 +269,7 @@ db_backtrace(struct thread *td, struct frame *fp, int count)
tf = (struct trapframe *)(fp + 1);
npc = db_get_value((db_addr_t)&tf->tf_tpc,
sizeof(tf->tf_tpc), FALSE);
- user = db_print_trap(td, tf, count, &quit);
+ user = db_print_trap(td, tf, count);
trap = 1;
} else {
db_printf("%s() at ", name);
OpenPOWER on IntegriCloud