Module Name: src
Committed By: uwe
Date: Wed Jul 29 23:29:42 UTC 2020
Modified Files:
src/sys/ddb: db_lex.c db_lex.h
Log Message:
db_get_line - raw access to the DDB command line.
Provide a way for DDB commands to access the remainder of the command
line as-is.
To generate a diff of this commit:
cvs rdiff -u -r1.25 -r1.26 src/sys/ddb/db_lex.c
cvs rdiff -u -r1.15 -r1.16 src/sys/ddb/db_lex.h
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/sys/ddb/db_lex.c
diff -u src/sys/ddb/db_lex.c:1.25 src/sys/ddb/db_lex.c:1.26
--- src/sys/ddb/db_lex.c:1.25 Fri Nov 22 23:01:49 2019
+++ src/sys/ddb/db_lex.c Wed Jul 29 23:29:42 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: db_lex.c,v 1.25 2019/11/22 23:01:49 ad Exp $ */
+/* $NetBSD: db_lex.c,v 1.26 2020/07/29 23:29:42 uwe Exp $ */
/*
* Mach Operating System
@@ -34,7 +34,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: db_lex.c,v 1.25 2019/11/22 23:01:49 ad Exp $");
+__KERNEL_RCSID(0, "$NetBSD: db_lex.c,v 1.26 2020/07/29 23:29:42 uwe Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -89,6 +89,16 @@ db_set_line(const char *sp, const char *
db_endlp = ep;
}
+void
+db_get_line(const char **psp, const char **pep)
+{
+
+ if (psp != NULL)
+ *psp = db_lp;
+ if (pep != NULL)
+ *pep = db_endlp;
+}
+
static void
db_flush_line(void)
{
Index: src/sys/ddb/db_lex.h
diff -u src/sys/ddb/db_lex.h:1.15 src/sys/ddb/db_lex.h:1.16
--- src/sys/ddb/db_lex.h:1.15 Sun Nov 27 13:05:28 2005
+++ src/sys/ddb/db_lex.h Wed Jul 29 23:29:42 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: db_lex.h,v 1.15 2005/11/27 13:05:28 yamt Exp $ */
+/* $NetBSD: db_lex.h,v 1.16 2020/07/29 23:29:42 uwe Exp $ */
/*
* Mach Operating System
@@ -36,6 +36,7 @@ void db_flush_lex(void);
char *db_num_to_str(db_expr_t);
int db_read_line(void);
void db_set_line(const char *, const char *);
+void db_get_line(const char **, const char **);
int db_read_token(void);
void db_unread_token(int);