Module Name: src Committed By: uwe Date: Sun Sep 29 02:00:22 UTC 2019
Modified Files: src/sys/ddb: db_input.c db_lex.c Log Message: 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. To generate a diff of this commit: cvs rdiff -u -r1.26 -r1.27 src/sys/ddb/db_input.c cvs rdiff -u -r1.22 -r1.23 src/sys/ddb/db_lex.c 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_input.c diff -u src/sys/ddb/db_input.c:1.26 src/sys/ddb/db_input.c:1.27 --- src/sys/ddb/db_input.c:1.26 Tue Aug 31 07:48:23 2010 +++ src/sys/ddb/db_input.c Sun Sep 29 02:00:22 2019 @@ -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 @@ __KERNEL_RCSID(0, "$NetBSD: db_input.c,v #include <sys/param.h> #include <sys/proc.h> -#include <sys/cpu.h> #include <ddb/ddb.h> @@ -352,11 +351,6 @@ int 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; Index: src/sys/ddb/db_lex.c diff -u src/sys/ddb/db_lex.c:1.22 src/sys/ddb/db_lex.c:1.23 --- src/sys/ddb/db_lex.c:1.22 Thu May 26 15:34:14 2011 +++ src/sys/ddb/db_lex.c Sun Sep 29 02:00:22 2019 @@ -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 @@ db_read_line(void) { 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 */