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.
This commit is contained in:
parent
949406f27b
commit
22d01b8c34
|
@ -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 1.26 2010/08/31 07:48:23 enami Exp $");
|
|||
|
||||
#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;
|
||||
|
|
|
@ -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 */
|
||||
|
|
Loading…
Reference in New Issue