summaryrefslogtreecommitdiffstats
path: root/sys/ddb/db_lex.h
diff options
context:
space:
mode:
authorrwatson <rwatson@FreeBSD.org>2007-12-26 09:33:19 +0000
committerrwatson <rwatson@FreeBSD.org>2007-12-26 09:33:19 +0000
commit6ff1515c5f8d3787a46b92ded45aacb75cec051e (patch)
treea166a654090db301023b94b02c647554eb7320ae /sys/ddb/db_lex.h
parent19ae9a5e773935b7d124c45606ca64d72213a810 (diff)
downloadFreeBSD-src-6ff1515c5f8d3787a46b92ded45aacb75cec051e.zip
FreeBSD-src-6ff1515c5f8d3787a46b92ded45aacb75cec051e.tar.gz
Add a simple scripting facility to DDB(4), allowing the user to
define a set of named scripts. Each script consists of a list of DDB commands separated by ";"s that will be executed verbatim. No higher level language constructs, such as branching, are provided for: scripts are executed by sequentially injecting commands into the DDB input buffer. Four new commands are present in DDB: "run" to run a specific script, "script" to define or print a script, "scripts" to list currently defined scripts, and "unscript" to delete a script, modeled on shell alias commands. Scripts may also be manipulated using sysctls in the debug.ddb.scripting MIB space, although users will prefer to use the soon-to-be-added ddb(8) tool for usability reasons. Scripts with certain names are automatically executed on various DDB events, such as entering the debugger via a panic, a witness error, watchdog, breakpoint, sysctl, serial break, etc, allowing customized handling. MFC after: 3 months
Diffstat (limited to 'sys/ddb/db_lex.h')
-rw-r--r--sys/ddb/db_lex.h11
1 files changed, 7 insertions, 4 deletions
diff --git a/sys/ddb/db_lex.h b/sys/ddb/db_lex.h
index 07955e9..8713a27 100644
--- a/sys/ddb/db_lex.h
+++ b/sys/ddb/db_lex.h
@@ -36,10 +36,12 @@
/*
* Lexical analyzer.
*/
-void db_flush_lex(void);
-int db_read_line(void);
-int db_read_token(void);
-void db_unread_token(int t);
+void db_flush_lex(void);
+char *db_get_line(void);
+void db_inject_line(const char *command);
+int db_read_line(void);
+int db_read_token(void);
+void db_unread_token(int t);
extern db_expr_t db_tok_number;
#define TOK_STRING_SIZE 120
@@ -66,5 +68,6 @@ extern char db_tok_string[TOK_STRING_SIZE];
#define tSHIFT_L 18
#define tSHIFT_R 19
#define tDOTDOT 20
+#define tSEMI 21
#endif /* !_DDB_DB_LEX_H_ */
OpenPOWER on IntegriCloud