New ACPI_DEBUG_PRINT macro deployed. Much smaller implementation.

date	2001.08.14.23.19.00;	author rmoore1;	state Exp;
This commit is contained in:
aystarik 2005-06-29 16:24:36 +00:00
parent b6d72ca847
commit ec0ae23794
3 changed files with 72 additions and 41 deletions

View File

@ -1,7 +1,7 @@
/*******************************************************************************
*
* Module Name: dbinput - user front-end to the AML debugger
* $Revision: 1.62 $
* $Revision: 1.64 $
*
******************************************************************************/
@ -144,7 +144,7 @@ BOOLEAN OutputToFile = FALSE;
UINT32 AcpiGbl_DbDebugLevel = 0x0FFFFFFF;
UINT32 AcpiGbl_DbConsoleDebugLevel = NORMAL_DEFAULT | TRACE_TABLES;
UINT32 AcpiGbl_DbConsoleDebugLevel = NORMAL_DEFAULT | ACPI_LV_TABLES;
UINT8 AcpiGbl_DbOutputFlags = DB_CONSOLE_OUTPUT;
@ -264,7 +264,7 @@ COMMAND_INFO Commands[] =
{"TERMINATE", 0},
{"THREADS", 3},
{"TREE", 0},
{"UNLOAD", 0},
{"UNLOAD", 1},
{NULL, 0}
};
@ -325,7 +325,7 @@ AcpiDbDisplayHelp (
AcpiOsPrintf ("Stats [Allocations|Memory|Misc\n");
AcpiOsPrintf (" |Objects|Tables] Display namespace and memory statistics\n");
AcpiOsPrintf ("Tables Display info about loaded ACPI tables\n");
AcpiOsPrintf ("Unload Unload an ACPI table\n");
AcpiOsPrintf ("Unload <TableSig> [Instance] Unload an ACPI table\n");
AcpiOsPrintf ("! <CommandNumber> Execute command from history buffer\n");
AcpiOsPrintf ("!! Execute last command again\n");
return;

View File

@ -1,7 +1,7 @@
/*******************************************************************************
*
* Module Name: dbutils - AML debugger utilities
* $Revision: 1.30 $
* $Revision: 1.41 $
*
******************************************************************************/
@ -9,8 +9,8 @@
*
* 1. Copyright Notice
*
* Some or all of this work - Copyright (c) 1999, Intel Corp. All rights
* reserved.
* Some or all of this work - Copyright (c) 1999, 2000, 2001, Intel Corp.
* All rights reserved.
*
* 2. License
*
@ -128,11 +128,10 @@
#ifdef ENABLE_DEBUGGER
#define _COMPONENT DEBUGGER
#define _COMPONENT ACPI_DEBUGGER
MODULE_NAME ("dbutils")
/*******************************************************************************
*
* FUNCTION: AcpiDbSetOutputDestination
@ -184,10 +183,10 @@ AcpiDbDumpBuffer (
UINT32 Address)
{
AcpiOsPrintf ("\nLocation 0x%X:\n", Address);
AcpiOsPrintf ("\nLocation %X:\n", Address);
AcpiDbgLevel |= TRACE_TABLES;
AcpiCmDumpBuffer ((UINT8 *) Address, 64, DB_BYTE_DISPLAY, ACPI_UINT32_MAX);
AcpiDbgLevel |= ACPI_LV_TABLES;
AcpiUtDumpBuffer ((UINT8 *) Address, 64, DB_BYTE_DISPLAY, ACPI_UINT32_MAX);
}
@ -227,12 +226,14 @@ AcpiDbDumpObject (
{
case ACPI_TYPE_ANY:
AcpiOsPrintf ("[Object Reference] Value: %p\n", ObjDesc->Reference.Handle);
AcpiOsPrintf ("[Object Reference] = %p\n", ObjDesc->Reference.Handle);
break;
case ACPI_TYPE_NUMBER:
AcpiOsPrintf ("[Number] Value: %ld (0x%lX)\n", ObjDesc->Number.Value, ObjDesc->Number.Value);
case ACPI_TYPE_INTEGER:
AcpiOsPrintf ("[Integer] = %X%8.8X\n", HIDWORD (ObjDesc->Integer.Value),
LODWORD (ObjDesc->Integer.Value));
break;
@ -249,8 +250,8 @@ AcpiDbDumpObject (
case ACPI_TYPE_BUFFER:
AcpiOsPrintf ("[Buffer] Value: ");
AcpiCmDumpBuffer ((UINT8 *) ObjDesc->Buffer.Pointer, ObjDesc->Buffer.Length, DB_DWORD_DISPLAY, _COMPONENT);
AcpiOsPrintf ("[Buffer] = ");
AcpiUtDumpBuffer ((UINT8 *) ObjDesc->Buffer.Pointer, ObjDesc->Buffer.Length, DB_DWORD_DISPLAY, _COMPONENT);
break;
@ -265,9 +266,27 @@ AcpiDbDumpObject (
break;
case INTERNAL_TYPE_REFERENCE:
AcpiOsPrintf ("[Object Reference] = %p\n", ObjDesc->Reference.Handle);
break;
case ACPI_TYPE_PROCESSOR:
AcpiOsPrintf ("[Processor]\n");
break;
case ACPI_TYPE_POWER:
AcpiOsPrintf ("[Power Resource]\n");
break;
default:
AcpiOsPrintf ("[Unknown Type] 0x%X \n", ObjDesc->Type);
AcpiOsPrintf ("[Unknown Type] %X \n", ObjDesc->Type);
break;
}
}
@ -335,7 +354,7 @@ AcpiDbPrepNamestring (
*
* RETURN: Status
*
* DESCRIPTION: Second pass parse of the ACPI tables. We need to wait until
* DESCRIPTION: Second pass parse of the ACPI tables. We need to wait until
* second pass to parse the control methods
*
******************************************************************************/
@ -439,11 +458,11 @@ AcpiDbLocalNsLookup (
if (ACPI_FAILURE (Status))
{
AcpiOsPrintf ("Could not locate name: %s %s\n", Name, AcpiCmFormatException (Status));
AcpiOsPrintf ("Could not locate name: %s %s\n", Name, AcpiFormatException (Status));
}
AcpiCmFree (InternalPath);
ACPI_MEM_FREE (InternalPath);
return (Node);
}

View File

@ -1,7 +1,7 @@
/*******************************************************************************
*
* Module Name: dbxface - AML Debugger external interfaces
* $Revision: 1.30 $
* $Revision: 1.38 $
*
******************************************************************************/
@ -9,8 +9,8 @@
*
* 1. Copyright Notice
*
* Some or all of this work - Copyright (c) 1999, Intel Corp. All rights
* reserved.
* Some or all of this work - Copyright (c) 1999, 2000, 2001, Intel Corp.
* All rights reserved.
*
* 2. License
*
@ -127,7 +127,7 @@
#ifdef ENABLE_DEBUGGER
#define _COMPONENT DEBUGGER
#define _COMPONENT ACPI_DEBUGGER
MODULE_NAME ("dbxface")
@ -154,6 +154,7 @@ AcpiDbSingleStep (
ACPI_PARSE_OBJECT *Next;
ACPI_STATUS Status = AE_OK;
UINT32 OriginalDebugLevel;
ACPI_PARSE_OBJECT *DisplayOp;
/* Is there a breakpoint set? */
@ -166,7 +167,7 @@ AcpiDbSingleStep (
{
/* Hit the breakpoint, resume single step, reset breakpoint */
AcpiOsPrintf ("***Break*** at AML offset 0x%X\n", Op->AmlOffset);
AcpiOsPrintf ("***Break*** at AML offset %X\n", Op->AmlOffset);
AcpiGbl_CmSingleStep = TRUE;
AcpiGbl_StepToNextCall = FALSE;
WalkState->MethodBreakpoint = 0;
@ -179,7 +180,7 @@ AcpiDbSingleStep (
* namely, opcodes that have arguments
*/
if (Op->Opcode == AML_NAMEDFIELD_OP)
if (Op->Opcode == AML_INT_NAMEDFIELD_OP)
{
return (AE_OK);
}
@ -198,7 +199,7 @@ AcpiDbSingleStep (
case OPTYPE_NAMED_OBJECT:
switch (Op->Opcode)
{
case AML_NAMEPATH_OP:
case AML_INT_NAMEPATH_OP:
return (AE_OK);
break;
}
@ -211,10 +212,10 @@ AcpiDbSingleStep (
if ((OutputToFile) ||
(AcpiGbl_CmSingleStep) ||
(AcpiDbgLevel & TRACE_PARSE))
(AcpiDbgLevel & ACPI_LV_PARSE))
{
if ((OutputToFile) ||
(AcpiDbgLevel & TRACE_PARSE))
(AcpiDbgLevel & ACPI_LV_PARSE))
{
AcpiOsPrintf ("\n[AmlDebug] Next AML Opcode to execute:\n");
}
@ -226,13 +227,24 @@ AcpiDbSingleStep (
*/
OriginalDebugLevel = AcpiDbgLevel;
AcpiDbgLevel &= ~(TRACE_PARSE | TRACE_FUNCTIONS);
AcpiDbgLevel &= ~(ACPI_LV_PARSE | ACPI_LV_FUNCTIONS);
Next = Op->Next;
Op->Next = NULL;
DisplayOp = Op;
if (Op->Parent)
{
if ((Op->Parent->Opcode == AML_IF_OP) ||
(Op->Parent->Opcode == AML_WHILE_OP))
{
DisplayOp = Op->Parent;
}
}
/* Now we can display it */
AcpiDbDisplayOp (Op, ACPI_UINT32_MAX);
AcpiDbDisplayOp (WalkState, DisplayOp, ACPI_UINT32_MAX);
if ((Op->Opcode == AML_IF_OP) ||
(Op->Opcode == AML_WHILE_OP))
@ -276,7 +288,7 @@ AcpiDbSingleStep (
if (AcpiGbl_StepToNextCall)
{
if (Op->Opcode != AML_METHODCALL_OP)
if (Op->Opcode != AML_INT_METHODCALL_OP)
{
/* Not a method call, just keep executing */
@ -294,7 +306,7 @@ AcpiDbSingleStep (
* by default.
*/
if (Op->Opcode == AML_METHODCALL_OP)
if (Op->Opcode == AML_INT_METHODCALL_OP)
{
AcpiGbl_CmSingleStep = FALSE; /* No more single step while executing called method */
@ -302,13 +314,13 @@ AcpiDbSingleStep (
/* TBD: [Future] don't kill the user breakpoint! */
WalkState->MethodBreakpoint = Op->AmlOffset + 1; /* Must be non-zero! */
WalkState->MethodBreakpoint = /* Op->AmlOffset + */ 1; /* Must be non-zero! */
}
/* TBD: [Investigate] what are the namespace locking issues here */
/* AcpiCmReleaseMutex (ACPI_MTX_NAMESPACE); */
/* AcpiUtReleaseMutex (ACPI_MTX_NAMESPACE); */
/* Go into the command loop and await next user command */
@ -320,8 +332,8 @@ AcpiDbSingleStep (
{
/* Handshake with the front-end that gets user command lines */
AcpiCmReleaseMutex (ACPI_MTX_DEBUG_CMD_COMPLETE);
AcpiCmAcquireMutex (ACPI_MTX_DEBUG_CMD_READY);
AcpiUtReleaseMutex (ACPI_MTX_DEBUG_CMD_COMPLETE);
AcpiUtAcquireMutex (ACPI_MTX_DEBUG_CMD_READY);
}
else
@ -351,7 +363,7 @@ AcpiDbSingleStep (
Status = AcpiDbCommandDispatch (LineBuf, WalkState, Op);
}
/* AcpiCmAcquireMutex (ACPI_MTX_NAMESPACE); */
/* AcpiUtAcquireMutex (ACPI_MTX_NAMESPACE); */
/* User commands complete, continue execution of the interrupted method */
@ -397,8 +409,8 @@ AcpiDbInitialize (void)
{
/* These were created with one unit, grab it */
AcpiCmAcquireMutex (ACPI_MTX_DEBUG_CMD_COMPLETE);
AcpiCmAcquireMutex (ACPI_MTX_DEBUG_CMD_READY);
AcpiUtAcquireMutex (ACPI_MTX_DEBUG_CMD_COMPLETE);
AcpiUtAcquireMutex (ACPI_MTX_DEBUG_CMD_READY);
/* Create the debug execution thread to execute commands */