summaryrefslogtreecommitdiff
path: root/source/components/debugger
diff options
context:
space:
mode:
Diffstat (limited to 'source/components/debugger')
-rw-r--r--source/components/debugger/dbcmds.c30
-rw-r--r--source/components/debugger/dbconvert.c2
-rw-r--r--source/components/debugger/dbdisply.c77
-rw-r--r--source/components/debugger/dbexec.c11
-rw-r--r--source/components/debugger/dbfileio.c136
-rw-r--r--source/components/debugger/dbinput.c45
-rw-r--r--source/components/debugger/dbmethod.c2
-rw-r--r--source/components/debugger/dbnames.c9
-rw-r--r--source/components/debugger/dbobject.c6
-rw-r--r--source/components/debugger/dbstats.c3
-rw-r--r--source/components/debugger/dbtest.c5
-rw-r--r--source/components/debugger/dbutils.c1
-rw-r--r--source/components/debugger/dbxface.c91
13 files changed, 198 insertions, 220 deletions
diff --git a/source/components/debugger/dbcmds.c b/source/components/debugger/dbcmds.c
index c9d06f977f83..1a3b8c848bc8 100644
--- a/source/components/debugger/dbcmds.c
+++ b/source/components/debugger/dbcmds.c
@@ -117,8 +117,7 @@ AcpiDbConvertToNode (
Node = ACPI_TO_POINTER (Address);
if (!AcpiOsReadable (Node, sizeof (ACPI_NAMESPACE_NODE)))
{
- AcpiOsPrintf ("Address %p is invalid",
- Node);
+ AcpiOsPrintf ("Address %p is invalid", Node);
return (NULL);
}
@@ -127,7 +126,7 @@ AcpiDbConvertToNode (
if (ACPI_GET_DESCRIPTOR_TYPE (Node) != ACPI_DESC_TYPE_NAMED)
{
AcpiOsPrintf ("Address %p is not a valid namespace node [%s]\n",
- Node, AcpiUtGetDescriptorName (Node));
+ Node, AcpiUtGetDescriptorName (Node));
return (NULL);
}
}
@@ -914,7 +913,7 @@ AcpiDbDeviceResources (
Node = ACPI_CAST_PTR (ACPI_NAMESPACE_NODE, ObjHandle);
- ParentPath = AcpiNsGetExternalPathname (Node);
+ ParentPath = AcpiNsGetNormalizedPathname (Node, TRUE);
if (!ParentPath)
{
return (AE_NO_MEMORY);
@@ -1005,7 +1004,7 @@ GetCrs:
/* Get the _CRS resource list (test ALLOCATE buffer) */
ReturnBuffer.Pointer = NULL;
- ReturnBuffer.Length = ACPI_ALLOCATE_LOCAL_BUFFER;
+ ReturnBuffer.Length = ACPI_ALLOCATE_LOCAL_BUFFER;
Status = AcpiGetCurrentResources (Node, &ReturnBuffer);
if (ACPI_FAILURE (Status))
@@ -1074,7 +1073,7 @@ GetPrs:
}
ReturnBuffer.Pointer = AcpiGbl_DbBuffer;
- ReturnBuffer.Length = ACPI_DEBUG_BUFFER_SIZE;
+ ReturnBuffer.Length = ACPI_DEBUG_BUFFER_SIZE;
Status = AcpiGetPossibleResources (Node, &ReturnBuffer);
if (ACPI_FAILURE (Status))
@@ -1097,7 +1096,7 @@ GetAei:
AcpiOsPrintf ("Evaluating _AEI\n");
ReturnBuffer.Pointer = AcpiGbl_DbBuffer;
- ReturnBuffer.Length = ACPI_DEBUG_BUFFER_SIZE;
+ ReturnBuffer.Length = ACPI_DEBUG_BUFFER_SIZE;
Status = AcpiEvaluateObject (AeiNode, NULL, NULL, &ReturnBuffer);
if (ACPI_FAILURE (Status))
@@ -1108,7 +1107,7 @@ GetAei:
}
ReturnBuffer.Pointer = AcpiGbl_DbBuffer;
- ReturnBuffer.Length = ACPI_DEBUG_BUFFER_SIZE;
+ ReturnBuffer.Length = ACPI_DEBUG_BUFFER_SIZE;
Status = AcpiGetEventResources (Node, &ReturnBuffer);
if (ACPI_FAILURE (Status))
@@ -1224,8 +1223,8 @@ AcpiDbGenerateGpe (
}
}
- GpeEventInfo = AcpiEvGetGpeEventInfo (ACPI_TO_POINTER (BlockNumber),
- GpeNumber);
+ GpeEventInfo = AcpiEvGetGpeEventInfo (
+ ACPI_TO_POINTER (BlockNumber), GpeNumber);
if (!GpeEventInfo)
{
AcpiOsPrintf ("Invalid GPE\n");
@@ -1284,15 +1283,8 @@ AcpiDbTrace (
UINT32 Flags = 0;
- if (EnableArg)
- {
- AcpiUtStrupr (EnableArg);
- }
-
- if (OnceArg)
- {
- AcpiUtStrupr (OnceArg);
- }
+ AcpiUtStrupr (EnableArg);
+ AcpiUtStrupr (OnceArg);
if (MethodArg)
{
diff --git a/source/components/debugger/dbconvert.c b/source/components/debugger/dbconvert.c
index 058838a42e84..218909e1bbac 100644
--- a/source/components/debugger/dbconvert.c
+++ b/source/components/debugger/dbconvert.c
@@ -198,7 +198,7 @@ AcpiDbConvertToBuffer (
}
j++;
- i+=2;
+ i += 2;
while (String[i] &&
((String[i] == ',') || (String[i] == ' ')))
{
diff --git a/source/components/debugger/dbdisply.c b/source/components/debugger/dbdisply.c
index 267ab58fd859..09d1232a74ea 100644
--- a/source/components/debugger/dbdisply.c
+++ b/source/components/debugger/dbdisply.c
@@ -413,14 +413,13 @@ AcpiDbDisplayMethodInfo (
}
ObjDesc = WalkState->MethodDesc;
- Node = WalkState->MethodNode;
+ Node = WalkState->MethodNode;
AcpiOsPrintf ("Currently executing control method is [%4.4s]\n",
- AcpiUtGetNodeName (Node));
+ AcpiUtGetNodeName (Node));
AcpiOsPrintf ("%X Arguments, SyncLevel = %X\n",
- (UINT32) ObjDesc->Method.ParamCount,
- (UINT32) ObjDesc->Method.SyncLevel);
-
+ (UINT32) ObjDesc->Method.ParamCount,
+ (UINT32) ObjDesc->Method.SyncLevel);
RootOp = StartOp;
while (RootOp->Common.Parent)
@@ -581,7 +580,7 @@ AcpiDbDisplayResults (
}
ObjDesc = WalkState->MethodDesc;
- Node = WalkState->MethodNode;
+ Node = WalkState->MethodNode;
if (WalkState->Results)
{
@@ -657,7 +656,7 @@ AcpiDbDisplayCallingTree (
*
* FUNCTION: AcpiDbDisplayObjectType
*
- * PARAMETERS: Name - User entered NS node handle or name
+ * PARAMETERS: ObjectArg - User entered NS node handle
*
* RETURN: None
*
@@ -667,21 +666,17 @@ AcpiDbDisplayCallingTree (
void
AcpiDbDisplayObjectType (
- char *Name)
+ char *ObjectArg)
{
- ACPI_NAMESPACE_NODE *Node;
+ ACPI_HANDLE Handle;
ACPI_DEVICE_INFO *Info;
ACPI_STATUS Status;
UINT32 i;
- Node = AcpiDbConvertToNode (Name);
- if (!Node)
- {
- return;
- }
+ Handle = ACPI_TO_POINTER (strtoul (ObjectArg, NULL, 16));
- Status = AcpiGetObjectInfo (ACPI_CAST_PTR (ACPI_HANDLE, Node), &Info);
+ Status = AcpiGetObjectInfo (Handle, &Info);
if (ACPI_FAILURE (Status))
{
AcpiOsPrintf ("Could not get object info, %s\n",
@@ -689,25 +684,18 @@ AcpiDbDisplayObjectType (
return;
}
- if (Info->Valid & ACPI_VALID_ADR)
- {
- AcpiOsPrintf ("ADR: %8.8X%8.8X, STA: %8.8X, Flags: %X\n",
- ACPI_FORMAT_UINT64 (Info->Address),
- Info->CurrentStatus, Info->Flags);
- }
- if (Info->Valid & ACPI_VALID_SXDS)
- {
- AcpiOsPrintf ("S1D-%2.2X S2D-%2.2X S3D-%2.2X S4D-%2.2X\n",
- Info->HighestDstates[0], Info->HighestDstates[1],
- Info->HighestDstates[2], Info->HighestDstates[3]);
- }
- if (Info->Valid & ACPI_VALID_SXWS)
- {
- AcpiOsPrintf ("S0W-%2.2X S1W-%2.2X S2W-%2.2X S3W-%2.2X S4W-%2.2X\n",
- Info->LowestDstates[0], Info->LowestDstates[1],
- Info->LowestDstates[2], Info->LowestDstates[3],
- Info->LowestDstates[4]);
- }
+ AcpiOsPrintf ("ADR: %8.8X%8.8X, STA: %8.8X, Flags: %X\n",
+ ACPI_FORMAT_UINT64 (Info->Address),
+ Info->CurrentStatus, Info->Flags);
+
+ AcpiOsPrintf ("S1D-%2.2X S2D-%2.2X S3D-%2.2X S4D-%2.2X\n",
+ Info->HighestDstates[0], Info->HighestDstates[1],
+ Info->HighestDstates[2], Info->HighestDstates[3]);
+
+ AcpiOsPrintf ("S0W-%2.2X S1W-%2.2X S2W-%2.2X S3W-%2.2X S4W-%2.2X\n",
+ Info->LowestDstates[0], Info->LowestDstates[1],
+ Info->LowestDstates[2], Info->LowestDstates[3],
+ Info->LowestDstates[4]);
if (Info->Valid & ACPI_VALID_HID)
{
@@ -719,11 +707,6 @@ AcpiDbDisplayObjectType (
AcpiOsPrintf ("UID: %s\n", Info->UniqueId.String);
}
- if (Info->Valid & ACPI_VALID_SUB)
- {
- AcpiOsPrintf ("SUB: %s\n", Info->SubsystemId.String);
- }
-
if (Info->Valid & ACPI_VALID_CID)
{
for (i = 0; i < Info->CompatibleIdList.Count; i++)
@@ -760,6 +743,13 @@ AcpiDbDisplayResultObject (
ACPI_WALK_STATE *WalkState)
{
+#ifndef ACPI_APPLICATION
+ if (AcpiGbl_DbThreadId != AcpiOsGetThreadId())
+ {
+ return;
+ }
+#endif
+
/* Only display if single stepping */
if (!AcpiGbl_CmSingleStep)
@@ -792,6 +782,13 @@ AcpiDbDisplayArgumentObject (
ACPI_WALK_STATE *WalkState)
{
+#ifndef ACPI_APPLICATION
+ if (AcpiGbl_DbThreadId != AcpiOsGetThreadId())
+ {
+ return;
+ }
+#endif
+
if (!AcpiGbl_CmSingleStep)
{
return;
@@ -1171,7 +1168,7 @@ AcpiDbDisplayNonRootHandlers (
return (AE_OK);
}
- Pathname = AcpiNsGetExternalPathname (Node);
+ Pathname = AcpiNsGetNormalizedPathname (Node, TRUE);
if (!Pathname)
{
return (AE_OK);
diff --git a/source/components/debugger/dbexec.c b/source/components/debugger/dbexec.c
index af01ca277f41..b2836eb55db8 100644
--- a/source/components/debugger/dbexec.c
+++ b/source/components/debugger/dbexec.c
@@ -528,8 +528,8 @@ AcpiDbExecute (
/* Dump a _PLD buffer if present */
if (ACPI_COMPARE_NAME ((ACPI_CAST_PTR (ACPI_NAMESPACE_NODE,
- AcpiGbl_DbMethodInfo.Method)->Name.Ascii),
- METHOD_NAME__PLD))
+ AcpiGbl_DbMethodInfo.Method)->Name.Ascii),
+ METHOD_NAME__PLD))
{
AcpiDbDumpPldBuffer (ReturnObj.Pointer);
}
@@ -627,7 +627,8 @@ AcpiDbMethodThread (
if (ReturnObj.Length)
{
AcpiOsPrintf ("Evaluation of %s returned object %p Buflen %X\n",
- Info->Pathname, ReturnObj.Pointer, (UINT32) ReturnObj.Length);
+ Info->Pathname, ReturnObj.Pointer,
+ (UINT32) ReturnObj.Length);
AcpiDbDumpExternalObject (ReturnObj.Pointer, 1);
}
#endif
@@ -694,7 +695,7 @@ AcpiDbCreateExecutionThreads (
/* Get the arguments */
NumThreads = strtoul (NumThreadsArg, NULL, 0);
- NumLoops = strtoul (NumLoopsArg, NULL, 0);
+ NumLoops = strtoul (NumLoopsArg, NULL, 0);
if (!NumThreads || !NumLoops)
{
@@ -810,7 +811,7 @@ AcpiDbCreateExecutionThreads (
for (i = 0; i < (NumThreads); i++)
{
- Status = AcpiOsExecute (OSL_DEBUGGER_THREAD, AcpiDbMethodThread,
+ Status = AcpiOsExecute (OSL_DEBUGGER_EXEC_THREAD, AcpiDbMethodThread,
&AcpiGbl_DbMethodInfo);
if (ACPI_FAILURE (Status))
{
diff --git a/source/components/debugger/dbfileio.c b/source/components/debugger/dbfileio.c
index aaeda4527f86..9ce3f2ff6a52 100644
--- a/source/components/debugger/dbfileio.c
+++ b/source/components/debugger/dbfileio.c
@@ -46,7 +46,10 @@
#include "accommon.h"
#include "acdebug.h"
#include "actables.h"
-
+#include <stdio.h>
+#ifdef ACPI_APPLICATION
+#include "acapps.h"
+#endif
#define _COMPONENT ACPI_CA_DEBUGGER
ACPI_MODULE_NAME ("dbfileio")
@@ -121,134 +124,35 @@ AcpiDbOpenDebugFile (
#endif
-#ifdef ACPI_APPLICATION
-#include "acapps.h"
-
/*******************************************************************************
*
- * FUNCTION: AeLocalLoadTable
+ * FUNCTION: AcpiDbLoadTables
*
- * PARAMETERS: Table - pointer to a buffer containing the entire
- * table to be loaded
+ * PARAMETERS: ListHead - List of ACPI tables to load
*
* RETURN: Status
*
- * DESCRIPTION: This function is called to load a table from the caller's
- * buffer. The buffer must contain an entire ACPI Table including
- * a valid header. The header fields will be verified, and if it
- * is determined that the table is invalid, the call will fail.
- *
- ******************************************************************************/
-
-static ACPI_STATUS
-AeLocalLoadTable (
- ACPI_TABLE_HEADER *Table)
-{
- ACPI_STATUS Status = AE_OK;
-
-
- ACPI_FUNCTION_TRACE (AeLocalLoadTable);
-
-#if 0
-/* ACPI_TABLE_DESC TableInfo; */
-
- if (!Table)
- {
- return_ACPI_STATUS (AE_BAD_PARAMETER);
- }
-
- TableInfo.Pointer = Table;
- Status = AcpiTbRecognizeTable (&TableInfo, ACPI_TABLE_ALL);
- if (ACPI_FAILURE (Status))
- {
- return_ACPI_STATUS (Status);
- }
-
- /* Install the new table into the local data structures */
-
- Status = AcpiTbInitTableDescriptor (&TableInfo);
- if (ACPI_FAILURE (Status))
- {
- if (Status == AE_ALREADY_EXISTS)
- {
- /* Table already exists, no error */
-
- Status = AE_OK;
- }
-
- /* Free table allocated by AcpiTbGetTable */
-
- AcpiTbDeleteSingleTable (&TableInfo);
- return_ACPI_STATUS (Status);
- }
-
-#if (!defined (ACPI_NO_METHOD_EXECUTION) && !defined (ACPI_CONSTANT_EVAL_ONLY))
-
- Status = AcpiNsLoadTable (TableInfo.InstalledDesc, AcpiGbl_RootNode);
- if (ACPI_FAILURE (Status))
- {
- /* Uninstall table and free the buffer */
-
- AcpiTbDeleteTablesByType (ACPI_TABLE_ID_DSDT);
- return_ACPI_STATUS (Status);
- }
-#endif
-#endif
-
- return_ACPI_STATUS (Status);
-}
-#endif
-
-
-/*******************************************************************************
- *
- * FUNCTION: AcpiDbGetTableFromFile
- *
- * PARAMETERS: Filename - File where table is located
- * ReturnTable - Where a pointer to the table is returned
- *
- * RETURN: Status
- *
- * DESCRIPTION: Load an ACPI table from a file
+ * DESCRIPTION: Load ACPI tables from a previously constructed table list.
*
******************************************************************************/
ACPI_STATUS
-AcpiDbGetTableFromFile (
- char *Filename,
- ACPI_TABLE_HEADER **ReturnTable,
- BOOLEAN MustBeAmlFile)
+AcpiDbLoadTables (
+ ACPI_NEW_TABLE_DESC *ListHead)
{
-#ifdef ACPI_APPLICATION
ACPI_STATUS Status;
+ ACPI_NEW_TABLE_DESC *TableListHead;
ACPI_TABLE_HEADER *Table;
- BOOLEAN IsAmlTable = TRUE;
- Status = AcpiUtReadTableFromFile (Filename, &Table);
- if (ACPI_FAILURE (Status))
- {
- return (Status);
- }
-
- if (MustBeAmlFile)
- {
- IsAmlTable = AcpiUtIsAmlTable (Table);
- if (!IsAmlTable)
- {
- ACPI_EXCEPTION ((AE_INFO, AE_OK,
- "Input for -e is not an AML table: "
- "\"%4.4s\" (must be DSDT/SSDT)",
- Table->Signature));
- return (AE_TYPE);
- }
- }
+ /* Load all ACPI tables in the list */
- if (IsAmlTable)
+ TableListHead = ListHead;
+ while (TableListHead)
{
- /* Attempt to recognize and install the table */
+ Table = TableListHead->Table;
- Status = AeLocalLoadTable (Table);
+ Status = AcpiLoadTable (Table);
if (ACPI_FAILURE (Status))
{
if (Status == AE_ALREADY_EXISTS)
@@ -265,20 +169,12 @@ AcpiDbGetTableFromFile (
return (Status);
}
- AcpiTbPrintTableHeader (0, Table);
-
fprintf (stderr,
"Acpi table [%4.4s] successfully installed and loaded\n",
Table->Signature);
- }
- AcpiGbl_AcpiHardwarePresent = FALSE;
- if (ReturnTable)
- {
- *ReturnTable = Table;
+ TableListHead = TableListHead->Next;
}
-
-#endif /* ACPI_APPLICATION */
return (AE_OK);
}
diff --git a/source/components/debugger/dbinput.c b/source/components/debugger/dbinput.c
index 1b9a9175e294..68043cbed6f8 100644
--- a/source/components/debugger/dbinput.c
+++ b/source/components/debugger/dbinput.c
@@ -45,6 +45,9 @@
#include "accommon.h"
#include "acdebug.h"
+#ifdef ACPI_APPLICATION
+#include "acapps.h"
+#endif
#define _COMPONENT ACPI_CA_DEBUGGER
ACPI_MODULE_NAME ("dbinput")
@@ -679,10 +682,7 @@ AcpiDbGetLine (
/* Uppercase the actual command */
- if (AcpiGbl_DbArgs[0])
- {
- AcpiUtStrupr (AcpiGbl_DbArgs[0]);
- }
+ AcpiUtStrupr (AcpiGbl_DbArgs[0]);
Count = i;
if (Count)
@@ -762,7 +762,7 @@ AcpiDbCommandDispatch (
/* If AcpiTerminate has been called, terminate this thread */
- if (AcpiGbl_DbTerminateThreads)
+ if (AcpiGbl_DbTerminateLoop)
{
return (AE_CTRL_TERMINATE);
}
@@ -942,8 +942,8 @@ AcpiDbCommandDispatch (
else if (ParamCount == 2)
{
Temp = AcpiGbl_DbConsoleDebugLevel;
- AcpiGbl_DbConsoleDebugLevel = strtoul (AcpiGbl_DbArgs[1],
- NULL, 16);
+ AcpiGbl_DbConsoleDebugLevel =
+ strtoul (AcpiGbl_DbArgs[1], NULL, 16);
AcpiOsPrintf (
"Debug Level for console output was %8.8lX, now %8.8lX\n",
Temp, AcpiGbl_DbConsoleDebugLevel);
@@ -1119,8 +1119,16 @@ AcpiDbCommandDispatch (
break;
case CMD_LOAD:
+ {
+ ACPI_NEW_TABLE_DESC *ListHead = NULL;
- Status = AcpiDbGetTableFromFile (AcpiGbl_DbArgs[1], NULL, FALSE);
+ Status = AcpiAcGetAllTablesFromFile (AcpiGbl_DbArgs[1],
+ ACPI_GET_ALL_TABLES, &ListHead);
+ if (ACPI_SUCCESS (Status))
+ {
+ AcpiDbLoadTables (ListHead);
+ }
+ }
break;
case CMD_OPEN:
@@ -1140,6 +1148,7 @@ AcpiDbCommandDispatch (
* re-creating the semaphores!
*/
+ AcpiGbl_DbTerminateLoop = TRUE;
/* AcpiInitialize (NULL); */
break;
@@ -1184,7 +1193,7 @@ AcpiDbCommandDispatch (
#ifdef ACPI_APPLICATION
AcpiDbCloseDebugFile ();
#endif
- AcpiGbl_DbTerminateThreads = TRUE;
+ AcpiGbl_DbTerminateLoop = TRUE;
return (AE_CTRL_TERMINATE);
case CMD_NOT_FOUND:
@@ -1224,7 +1233,7 @@ AcpiDbExecuteThread (
ACPI_STATUS MStatus;
- while (Status != AE_CTRL_TERMINATE)
+ while (Status != AE_CTRL_TERMINATE && !AcpiGbl_DbTerminateLoop)
{
AcpiGbl_MethodExecuting = FALSE;
AcpiGbl_StepToNextCall = FALSE;
@@ -1240,6 +1249,7 @@ AcpiDbExecuteThread (
AcpiOsReleaseMutex (AcpiGbl_DbCommandComplete);
}
+ AcpiGbl_DbThreadsTerminated = TRUE;
}
@@ -1294,7 +1304,7 @@ AcpiDbUserCommands (
/* TBD: [Restructure] Need a separate command line buffer for step mode */
- while (!AcpiGbl_DbTerminateThreads)
+ while (!AcpiGbl_DbTerminateLoop)
{
/* Force output to console until a command is entered */
@@ -1330,10 +1340,6 @@ AcpiDbUserCommands (
* and wait for the command to complete.
*/
AcpiOsReleaseMutex (AcpiGbl_DbCommandReady);
- if (ACPI_FAILURE (Status))
- {
- return (Status);
- }
Status = AcpiOsAcquireMutex (AcpiGbl_DbCommandComplete,
ACPI_WAIT_FOREVER);
@@ -1350,14 +1356,5 @@ AcpiDbUserCommands (
}
}
- /* Shut down the debugger */
-
- AcpiTerminateDebugger ();
-
- /*
- * Only this thread (the original thread) should actually terminate the
- * subsystem, because all the semaphores are deleted during termination
- */
- Status = AcpiTerminate ();
return (Status);
}
diff --git a/source/components/debugger/dbmethod.c b/source/components/debugger/dbmethod.c
index ee13baef979c..6351b2a0d132 100644
--- a/source/components/debugger/dbmethod.c
+++ b/source/components/debugger/dbmethod.c
@@ -89,7 +89,7 @@ AcpiDbSetMethodBreakpoint (
Address = strtoul (Location, NULL, 16);
AmlOffset = (UINT32) ACPI_PTR_DIFF (Op->Common.Aml,
- WalkState->ParserState.AmlStart);
+ WalkState->ParserState.AmlStart);
if (Address <= AmlOffset)
{
AcpiOsPrintf ("Breakpoint %X is beyond current address %X\n",
diff --git a/source/components/debugger/dbnames.c b/source/components/debugger/dbnames.c
index 6b41dc6ea2a7..f9b192574c25 100644
--- a/source/components/debugger/dbnames.c
+++ b/source/components/debugger/dbnames.c
@@ -198,7 +198,7 @@ AcpiDbSetScope (
/* Build the final pathname */
if (AcpiUtSafeStrcat (AcpiGbl_DbScopeBuf, sizeof (AcpiGbl_DbScopeBuf),
- Name))
+ Name))
{
Status = AE_BUFFER_OVERFLOW;
goto ErrorExit;
@@ -499,7 +499,7 @@ AcpiDbWalkForPredefinedNames (
return (AE_OK);
}
- Pathname = AcpiNsGetExternalPathname (Node);
+ Pathname = AcpiNsGetNormalizedPathname (Node, TRUE);
if (!Pathname)
{
return (AE_OK);
@@ -560,7 +560,8 @@ AcpiDbCheckPredefinedNames (
/* Search all nodes in namespace */
(void) AcpiWalkNamespace (ACPI_TYPE_ANY, ACPI_ROOT_OBJECT,
- ACPI_UINT32_MAX, AcpiDbWalkForPredefinedNames, NULL, (void *) &Count, NULL);
+ ACPI_UINT32_MAX, AcpiDbWalkForPredefinedNames,
+ NULL, (void *) &Count, NULL);
AcpiOsPrintf ("Found %u predefined names in the namespace\n", Count);
}
@@ -962,7 +963,7 @@ AcpiDbBusWalk (
/* Exit if there is no _PRT under this device */
Status = AcpiGetHandle (Node, METHOD_NAME__PRT,
- ACPI_CAST_PTR (ACPI_HANDLE, &TempNode));
+ ACPI_CAST_PTR (ACPI_HANDLE, &TempNode));
if (ACPI_FAILURE (Status))
{
return (AE_OK);
diff --git a/source/components/debugger/dbobject.c b/source/components/debugger/dbobject.c
index 019e8115fc0d..da9ff396101b 100644
--- a/source/components/debugger/dbobject.c
+++ b/source/components/debugger/dbobject.c
@@ -495,7 +495,8 @@ AcpiDbDecodeLocals (
}
else
{
- AcpiOsPrintf ("No Local Variables are initialized for method [%4.4s]\n",
+ AcpiOsPrintf (
+ "No Local Variables are initialized for method [%4.4s]\n",
AcpiUtGetNodeName (Node));
}
}
@@ -572,7 +573,8 @@ AcpiDbDecodeArguments (
}
else
{
- AcpiOsPrintf ("No Arguments are initialized for method [%4.4s]\n",
+ AcpiOsPrintf (
+ "No Arguments are initialized for method [%4.4s]\n",
AcpiUtGetNodeName (Node));
}
}
diff --git a/source/components/debugger/dbstats.c b/source/components/debugger/dbstats.c
index e1ff8bb00c3c..cc781762956c 100644
--- a/source/components/debugger/dbstats.c
+++ b/source/components/debugger/dbstats.c
@@ -339,7 +339,7 @@ AcpiDbClassifyOneObject (
Op = AcpiPsGetDepthNext (Root, Op);
SizeOfParseTree = (NumGrammarElements - NumMethodElements) *
- (UINT32) sizeof (ACPI_PARSE_OBJECT);
+ (UINT32) sizeof (ACPI_PARSE_OBJECT);
SizeOfMethodTrees = NumMethodElements * (UINT32) sizeof (ACPI_PARSE_OBJECT);
SizeOfNodeEntries = NumNodes * (UINT32) sizeof (ACPI_NAMESPACE_NODE);
SizeOfAcpiObjects = NumNodes * (UINT32) sizeof (ACPI_OPERAND_OBJECT);
@@ -439,6 +439,7 @@ AcpiDbDisplayStatistics (
AcpiOsPrintf ("%16.16s % 10ld% 10ld\n", AcpiUtGetTypeName (i),
AcpiGbl_NodeTypeCount [i], AcpiGbl_ObjTypeCount [i]);
}
+
AcpiOsPrintf ("%16.16s % 10ld% 10ld\n", "Misc/Unknown",
AcpiGbl_NodeTypeCountMisc, AcpiGbl_ObjTypeCountMisc);
diff --git a/source/components/debugger/dbtest.c b/source/components/debugger/dbtest.c
index 840d371d11c0..83a2c9ec6312 100644
--- a/source/components/debugger/dbtest.c
+++ b/source/components/debugger/dbtest.c
@@ -980,7 +980,8 @@ AcpiDbEvaluateAllPredefinedNames (
ACPI_UINT32_MAX, AcpiDbEvaluateOnePredefinedName, NULL,
(void *) &Info, NULL);
- AcpiOsPrintf ("Evaluated %u predefined names in the namespace\n", Info.Count);
+ AcpiOsPrintf (
+ "Evaluated %u predefined names in the namespace\n", Info.Count);
}
@@ -1033,7 +1034,7 @@ AcpiDbEvaluateOnePredefinedName (
return (AE_OK);
}
- Pathname = AcpiNsGetExternalPathname (Node);
+ Pathname = AcpiNsGetNormalizedPathname (Node, TRUE);
if (!Pathname)
{
return (AE_OK);
diff --git a/source/components/debugger/dbutils.c b/source/components/debugger/dbutils.c
index 90fd949cf445..4d4ee60ab4f7 100644
--- a/source/components/debugger/dbutils.c
+++ b/source/components/debugger/dbutils.c
@@ -199,6 +199,7 @@ AcpiDbDumpExternalObject (
{
AcpiOsPrintf ("\n");
}
+
AcpiUtDebugDumpBuffer (
ACPI_CAST_PTR (UINT8, ObjDesc->Buffer.Pointer),
ObjDesc->Buffer.Length, DB_BYTE_DISPLAY, _COMPONENT);
diff --git a/source/components/debugger/dbxface.c b/source/components/debugger/dbxface.c
index 9e7c31d6c0c8..cc636dece49a 100644
--- a/source/components/debugger/dbxface.c
+++ b/source/components/debugger/dbxface.c
@@ -152,6 +152,40 @@ AcpiDbStartCommand (
/*******************************************************************************
*
+ * FUNCTION: AcpiDbSignalBreakPoint
+ *
+ * PARAMETERS: WalkState - Current walk
+ *
+ * RETURN: Status
+ *
+ * DESCRIPTION: Called for AML_BREAK_POINT_OP
+ *
+ ******************************************************************************/
+
+void
+AcpiDbSignalBreakPoint (
+ ACPI_WALK_STATE *WalkState)
+{
+
+#ifndef ACPI_APPLICATION
+ if (AcpiGbl_DbThreadId != AcpiOsGetThreadId ())
+ {
+ return;
+ }
+#endif
+
+ /*
+ * Set the single-step flag. This will cause the debugger (if present)
+ * to break to the console within the AML debugger at the start of the
+ * next AML instruction.
+ */
+ AcpiGbl_CmSingleStep = TRUE;
+ AcpiOsPrintf ("**break** Executed AML BreakPoint opcode\n");
+}
+
+
+/*******************************************************************************
+ *
* FUNCTION: AcpiDbSingleStep
*
* PARAMETERS: WalkState - Current walk
@@ -181,6 +215,13 @@ AcpiDbSingleStep (
ACPI_FUNCTION_ENTRY ();
+#ifndef ACPI_APPLICATION
+ if (AcpiGbl_DbThreadId != AcpiOsGetThreadId ())
+ {
+ return (AE_OK);
+ }
+#endif
+
/* Check the abort flag */
if (AcpiGbl_AbortMethod)
@@ -439,6 +480,10 @@ AcpiInitializeDebugger (
AcpiGbl_DbScopeBuf [1] = 0;
AcpiGbl_DbScopeNode = AcpiGbl_RootNode;
+ /* Initialize user commands loop */
+
+ AcpiGbl_DbTerminateLoop = FALSE;
+
/*
* If configured for multi-thread support, the debug executor runs in
* a separate thread so that the front end can be in another address
@@ -466,15 +511,21 @@ AcpiInitializeDebugger (
/* Create the debug execution thread to execute commands */
- Status = AcpiOsExecute (OSL_DEBUGGER_THREAD,
+ AcpiGbl_DbThreadsTerminated = FALSE;
+ Status = AcpiOsExecute (OSL_DEBUGGER_MAIN_THREAD,
AcpiDbExecuteThread, NULL);
if (ACPI_FAILURE (Status))
{
ACPI_EXCEPTION ((AE_INFO, Status,
"Could not start debugger thread"));
+ AcpiGbl_DbThreadsTerminated = TRUE;
return_ACPI_STATUS (Status);
}
}
+ else
+ {
+ AcpiGbl_DbThreadId = AcpiOsGetThreadId ();
+ }
return_ACPI_STATUS (AE_OK);
}
@@ -499,6 +550,22 @@ AcpiTerminateDebugger (
void)
{
+ /* Terminate the AML Debugger */
+
+ AcpiGbl_DbTerminateLoop = TRUE;
+
+ if (AcpiGbl_DebuggerConfiguration & DEBUGGER_MULTI_THREADED)
+ {
+ AcpiOsReleaseMutex (AcpiGbl_DbCommandReady);
+
+ /* Wait the AML Debugger threads */
+
+ while (!AcpiGbl_DbThreadsTerminated)
+ {
+ AcpiOsSleep (100);
+ }
+ }
+
if (AcpiGbl_DbBuffer)
{
AcpiOsFree (AcpiGbl_DbBuffer);
@@ -511,3 +578,25 @@ AcpiTerminateDebugger (
}
ACPI_EXPORT_SYMBOL (AcpiTerminateDebugger)
+
+
+/*******************************************************************************
+ *
+ * FUNCTION: AcpiSetDebuggerThreadId
+ *
+ * PARAMETERS: ThreadId - Debugger thread ID
+ *
+ * RETURN: None
+ *
+ * DESCRIPTION: Set debugger thread ID
+ *
+ ******************************************************************************/
+
+void
+AcpiSetDebuggerThreadId (
+ ACPI_THREAD_ID ThreadId)
+{
+ AcpiGbl_DbThreadId = ThreadId;
+}
+
+ACPI_EXPORT_SYMBOL (AcpiSetDebuggerThreadId)