Source-Changes-HG archive

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

[src/trunk]: src/sys/ddb Print db> prompt in db_read_line(), not db_readline().



details:   https://anonhg.NetBSD.org/src/rev/71edec490bde
branches:  trunk
changeset: 965723:71edec490bde
user:      uwe <uwe%NetBSD.org@localhost>
date:      Sun Sep 29 02:00:22 2019 +0000

description:
Print db> prompt in db_read_line(), not db_readline().

The former is what DDB repl calls.  The latter performs the actual
input so let other code use it without the unwanted db> prompt.  It's
already used by ACPI (and AcpiOsWaitCommandReady supplies its own
prompt).  I also use it for my uncommitted Forth scripting for DDB.

diffstat:

 sys/ddb/db_input.c |  10 ++--------
 sys/ddb/db_lex.c   |  10 ++++++++--
 2 files changed, 10 insertions(+), 10 deletions(-)

diffs (72 lines):

diff -r 9bb61eaf98fd -r 71edec490bde sys/ddb/db_input.c
--- a/sys/ddb/db_input.c        Sun Sep 29 00:57:11 2019 +0000
+++ b/sys/ddb/db_input.c        Sun Sep 29 02:00:22 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: db_input.c,v 1.26 2010/08/31 07:48:23 enami Exp $      */
+/*     $NetBSD: db_input.c,v 1.27 2019/09/29 02:00:22 uwe Exp $        */
 
 /*
  * Mach Operating System
@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: db_input.c,v 1.26 2010/08/31 07:48:23 enami Exp $");
+__KERNEL_RCSID(0, "$NetBSD: db_input.c,v 1.27 2019/09/29 02:00:22 uwe Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_ddbparam.h"
@@ -38,7 +38,6 @@
 
 #include <sys/param.h>
 #include <sys/proc.h>
-#include <sys/cpu.h>
 
 #include <ddb/ddb.h>
 
@@ -352,11 +351,6 @@
 db_readline(char *lstart, int lsize)
 {
 
-# ifdef MULTIPROCESSOR
-       db_printf("db{%ld}> ", (long)cpu_number());
-# else
-       db_printf("db> ");
-# endif
        db_force_whitespace();  /* synch output position */
 
        db_lbuf_start = lstart;
diff -r 9bb61eaf98fd -r 71edec490bde sys/ddb/db_lex.c
--- a/sys/ddb/db_lex.c  Sun Sep 29 00:57:11 2019 +0000
+++ b/sys/ddb/db_lex.c  Sun Sep 29 02:00:22 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: db_lex.c,v 1.22 2011/05/26 15:34:14 joerg Exp $        */
+/*     $NetBSD: db_lex.c,v 1.23 2019/09/29 02:00:22 uwe Exp $  */
 
 /*
  * Mach Operating System
@@ -34,10 +34,11 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: db_lex.c,v 1.22 2011/05/26 15:34:14 joerg Exp $");
+__KERNEL_RCSID(0, "$NetBSD: db_lex.c,v 1.23 2019/09/29 02:00:22 uwe Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
+#include <sys/cpu.h>
 
 #include <ddb/ddb.h>
 
@@ -61,6 +62,11 @@
 {
        int     i;
 
+#ifdef MULTIPROCESSOR
+       db_printf("db{%ld}> ", (long)cpu_number());
+#else
+       db_printf("db> ");
+#endif
        i = db_readline(db_line, sizeof(db_line));
        if (i == 0)
                return (0);     /* EOI */



Home | Main Index | Thread Index | Old Index