Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/ddb db_get_line - raw access to the DDB command line.



details:   https://anonhg.NetBSD.org/src/rev/b04c0797f430
branches:  trunk
changeset: 936553:b04c0797f430
user:      uwe <uwe%NetBSD.org@localhost>
date:      Wed Jul 29 23:29:42 2020 +0000

description:
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.

diffstat:

 sys/ddb/db_lex.c |  14 ++++++++++++--
 sys/ddb/db_lex.h |   3 ++-
 2 files changed, 14 insertions(+), 3 deletions(-)

diffs (52 lines):

diff -r 18fb26b53d20 -r b04c0797f430 sys/ddb/db_lex.c
--- a/sys/ddb/db_lex.c  Wed Jul 29 21:35:35 2020 +0000
+++ b/sys/ddb/db_lex.c  Wed Jul 29 23:29:42 2020 +0000
@@ -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_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)
 {
diff -r 18fb26b53d20 -r b04c0797f430 sys/ddb/db_lex.h
--- a/sys/ddb/db_lex.h  Wed Jul 29 21:35:35 2020 +0000
+++ b/sys/ddb/db_lex.h  Wed Jul 29 23:29:42 2020 +0000
@@ -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 @@
 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);
 



Home | Main Index | Thread Index | Old Index