Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/acpi/acpica/Osd usability fixes for the debugger:



details:   https://anonhg.NetBSD.org/src/rev/0e6c7bb59d45
branches:  trunk
changeset: 532346:0e6c7bb59d45
user:      drochner <drochner%NetBSD.org@localhost>
date:      Wed Jun 05 17:58:33 2002 +0000

description:
usability fixes for the debugger:
-cut yhe trailing '\r' from input lines so that commands are recognized
-use db_vprintf() for output in interactive mode to get the "|more" effect
-do the same setjmp() game as ddb, so we can return to the prompt

diffstat:

 sys/dev/acpi/acpica/Osd/OsdMisc.c   |  24 +++++++++++++++++++++---
 sys/dev/acpi/acpica/Osd/OsdStream.c |  21 +++++++++++++++++----
 2 files changed, 38 insertions(+), 7 deletions(-)

diffs (129 lines):

diff -r 54dc62fa0247 -r 0e6c7bb59d45 sys/dev/acpi/acpica/Osd/OsdMisc.c
--- a/sys/dev/acpi/acpica/Osd/OsdMisc.c Wed Jun 05 17:53:52 2002 +0000
+++ b/sys/dev/acpi/acpica/Osd/OsdMisc.c Wed Jun 05 17:58:33 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: OsdMisc.c,v 1.2 2001/11/13 13:01:58 lukem Exp $        */
+/*     $NetBSD: OsdMisc.c,v 1.3 2002/06/05 17:58:33 drochner Exp $     */
 
 /*
  * Copyright 2001 Wasabi Systems, Inc.
@@ -42,7 +42,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: OsdMisc.c,v 1.2 2001/11/13 13:01:58 lukem Exp $");
+__KERNEL_RCSID(0, "$NetBSD: OsdMisc.c,v 1.3 2002/06/05 17:58:33 drochner Exp $");
 
 #include "opt_ddb.h"
 
@@ -52,12 +52,15 @@
 #include <machine/db_machdep.h>
 
 #include <ddb/db_extern.h>
+#include <ddb/db_output.h>
 
 #include <dev/acpi/acpica.h>
 #include <dev/acpi/acpi_osd.h>
 
 #include <dev/acpi/acpica/Subsystem/acdebug.h>
 
+int acpi_indebugger;
+
 /*
  * AcpiOsSignal:
  *
@@ -108,8 +111,9 @@
 
        db_readline(Buffer, 80);
        for (cp = Buffer; *cp != 0; cp++)
-               if (*cp == '\n')
+               if (*cp == '\n' || *cp == '\r')
                        *cp = 0;
+       db_output_line = 0;
        return (AE_OK);
 #else
        printf("ACPI: WARNING: DDB not configured into kernel.\n");
@@ -128,6 +132,10 @@
 #ifdef ENABLE_DEBUGGER
        static int beenhere;
        ACPI_PARSE_OBJECT obj;
+#ifdef DDB
+       label_t acpi_jmpbuf;
+       label_t *savejmp;
+#endif
 
        if (beenhere == 0) {
                printf("Initializing ACPICA debugger...\n");
@@ -136,7 +144,17 @@
        }
 
        printf("Entering ACPICA debugger...\n");
+#ifdef DDB
+       savejmp = db_recover;
+       setjmp(&acpi_jmpbuf);
+       db_recover = &acpi_jmpbuf;
+#endif
+       acpi_indebugger = 1;
        AcpiDbUserCommands('A', &obj);
+       acpi_indebugger = 0;
+#ifdef DDB
+       db_recover = savejmp;
+#endif
 #else
        printf("ACPI: WARNING: ACPCICA debugger not present.\n");
 #endif
diff -r 54dc62fa0247 -r 0e6c7bb59d45 sys/dev/acpi/acpica/Osd/OsdStream.c
--- a/sys/dev/acpi/acpica/Osd/OsdStream.c       Wed Jun 05 17:53:52 2002 +0000
+++ b/sys/dev/acpi/acpica/Osd/OsdStream.c       Wed Jun 05 17:58:33 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: OsdStream.c,v 1.2 2001/11/13 13:01:58 lukem Exp $      */
+/*     $NetBSD: OsdStream.c,v 1.3 2002/06/05 17:58:33 drochner Exp $   */
 
 /*
  * Copyright 2001 Wasabi Systems, Inc.
@@ -42,13 +42,21 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: OsdStream.c,v 1.2 2001/11/13 13:01:58 lukem Exp $");
+__KERNEL_RCSID(0, "$NetBSD: OsdStream.c,v 1.3 2002/06/05 17:58:33 drochner Exp $");
+
+#include "opt_ddb.h"
 
 #include <sys/types.h>
 #include <sys/systm.h>
 
 #include <dev/acpi/acpica.h>
 
+#ifdef DDB
+#include <ddb/db_output.h>
+#endif
+
+extern int acpi_indebugger;
+
 /*
  * AcpiOsPrintf:
  *
@@ -61,7 +69,7 @@
        va_list ap;
 
        va_start(ap, Format);
-       vprintf(Format, ap);
+       AcpiOsVprintf(Format, ap);
        va_end(ap);
 
        return (0);     /* XXX XXX XXX */
@@ -71,7 +79,12 @@
 AcpiOsVprintf(const char *Format, va_list Args)
 {
 
-       vprintf(Format, Args);
+#ifdef DDB
+       if (acpi_indebugger)
+               db_vprintf(Format, Args);
+       else
+#endif
+               vprintf(Format, Args);
 
        return (0);     /* XXX XXX XXX */
 }



Home | Main Index | Thread Index | Old Index