diff options
author | jhb <jhb@FreeBSD.org> | 2003-07-31 17:27:52 +0000 |
---|---|---|
committer | jhb <jhb@FreeBSD.org> | 2003-07-31 17:27:52 +0000 |
commit | 7a022c490241980d564815f3a9eb35f1899334d6 (patch) | |
tree | 2e3958472b2e92004d1cf78c61cbb91760f2f2b8 /sys/ddb/ddb.h | |
parent | e77fe07b3a80c9ac29de7086418b3c8db6b99374 (diff) | |
download | FreeBSD-src-7a022c490241980d564815f3a9eb35f1899334d6.zip FreeBSD-src-7a022c490241980d564815f3a9eb35f1899334d6.tar.gz |
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
Diffstat (limited to 'sys/ddb/ddb.h')
-rw-r--r-- | sys/ddb/ddb.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/sys/ddb/ddb.h b/sys/ddb/ddb.h index 7259e97..1ef452c 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); |