aboutsummaryrefslogtreecommitdiff
path: root/sys/ddb/ddb.h
diff options
context:
space:
mode:
authorJohn Baldwin <jhb@FreeBSD.org>2003-07-31 17:27:52 +0000
committerJohn Baldwin <jhb@FreeBSD.org>2003-07-31 17:27:52 +0000
commit1e16f6098bf69794d9be2a7722a1ee1ac090508d (patch)
tree2e3958472b2e92004d1cf78c61cbb91760f2f2b8 /sys/ddb/ddb.h
parent69e4c730376c7789a1f05e654f2eaaf3c4937be9 (diff)
downloadsrc-1e16f6098bf69794d9be2a7722a1ee1ac090508d.tar.gz
src-1e16f6098bf69794d9be2a7722a1ee1ac090508d.zip
Add a one-shot callout facility to db_printf() that executes the registered
callout when a specified number of lines have been output. This can be used to implement pagers for ddb commands that output a lot of text. A simple paging function is included that automatically rearms itself when fired. Reviewed by: bde, julian
Notes
Notes: svn path=/head/; revision=118268
Diffstat (limited to 'sys/ddb/ddb.h')
-rw-r--r--sys/ddb/ddb.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/sys/ddb/ddb.h b/sys/ddb/ddb.h
index 7259e97b6637..1ef452cfd440 100644
--- a/sys/ddb/ddb.h
+++ b/sys/ddb/ddb.h
@@ -39,9 +39,13 @@
#include <machine/db_machdep.h> /* type definitions */
+#define DB_LINES_PER_PAGE 20
+
typedef void db_cmdfcn_t(db_expr_t addr, boolean_t have_addr, db_expr_t count,
char *modif);
+typedef void db_page_calloutfcn_t(void *arg);
+
#define DB_COMMAND(cmd_name, func_name) \
DB_SET(cmd_name, func_name, db_cmd_set, 0, NULL)
#define DB_SHOW_COMMAND(cmd_name, func_name) \
@@ -100,6 +104,8 @@ void db_read_bytes(vm_offset_t addr, size_t size, char *data);
int db_readline(char *lstart, int lsize);
void db_restart_at_pc(boolean_t watchpt);
void db_set_watchpoints(void);
+void db_setup_paging(db_page_calloutfcn_t *callout, void *arg,
+ int maxlines);
void db_skip_to_eol(void);
boolean_t db_stop_at_pc(boolean_t *is_breakpoint);
#define db_strcpy strcpy
@@ -139,6 +145,8 @@ db_cmdfcn_t ipc_port_print;
db_cmdfcn_t vm_page_print;
#endif
+db_page_calloutfcn_t db_simple_pager;
+
/* Scare the user with backtrace of curthread to console. */
void db_print_backtrace(void);