aboutsummaryrefslogtreecommitdiff
path: root/sys/ddb/db_lex.h
diff options
context:
space:
mode:
authorRobert Watson <rwatson@FreeBSD.org>2007-12-26 09:33:19 +0000
committerRobert Watson <rwatson@FreeBSD.org>2007-12-26 09:33:19 +0000
commitc9b0cc3b9623c30583400b137b82ec92483435ad (patch)
treea166a654090db301023b94b02c647554eb7320ae /sys/ddb/db_lex.h
parente361d7d421054f4f4a30ff48ed4590ee5292db05 (diff)
downloadsrc-c9b0cc3b9623c30583400b137b82ec92483435ad.tar.gz
src-c9b0cc3b9623c30583400b137b82ec92483435ad.zip
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
Notes
Notes: svn path=/head/; revision=174914
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 07955e9dc5cd..8713a27055f1 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_ */