summaryrefslogtreecommitdiff
path: root/source/components/debugger
diff options
context:
space:
mode:
Diffstat (limited to 'source/components/debugger')
-rw-r--r--source/components/debugger/dbexec.c12
-rw-r--r--source/components/debugger/dbinput.c18
-rw-r--r--source/components/debugger/dbobject.c75
-rw-r--r--source/components/debugger/dbxface.c46
4 files changed, 91 insertions, 60 deletions
diff --git a/source/components/debugger/dbexec.c b/source/components/debugger/dbexec.c
index ebd02b7c89276..af01ca277f41a 100644
--- a/source/components/debugger/dbexec.c
+++ b/source/components/debugger/dbexec.c
@@ -419,8 +419,20 @@ AcpiDbExecute (
#ifdef ACPI_DEBUG_OUTPUT
UINT32 PreviousAllocations;
UINT32 Allocations;
+#endif
+
+ /*
+ * Allow one execution to be performed by debugger or single step
+ * execution will be dead locked by the interpreter mutexes.
+ */
+ if (AcpiGbl_MethodExecuting)
+ {
+ AcpiOsPrintf ("Only one debugger execution is allowed.\n");
+ return;
+ }
+#ifdef ACPI_DEBUG_OUTPUT
/* Memory allocation tracking */
PreviousAllocations = AcpiDbGetOutstandingAllocations ();
diff --git a/source/components/debugger/dbinput.c b/source/components/debugger/dbinput.c
index 981d7062e29d1..1b9a9175e294a 100644
--- a/source/components/debugger/dbinput.c
+++ b/source/components/debugger/dbinput.c
@@ -123,6 +123,7 @@ enum AcpiExDebuggerCommands
CMD_OSI,
CMD_OWNER,
CMD_PATHS,
+ CMD_PREDEFINED,
CMD_PREFIX,
CMD_QUIT,
CMD_REFERENCES,
@@ -152,7 +153,6 @@ enum AcpiExDebuggerCommands
CMD_TERMINATE,
CMD_THREADS,
- CMD_PREDEFINED,
CMD_TEST,
#endif
};
@@ -201,6 +201,7 @@ static const ACPI_DB_COMMAND_INFO AcpiGbl_DbCommands[] =
{"OSI", 0},
{"OWNER", 1},
{"PATHS", 0},
+ {"PREDEFINED", 0},
{"PREFIX", 0},
{"QUIT", 0},
{"REFERENCES", 1},
@@ -230,7 +231,6 @@ static const ACPI_DB_COMMAND_INFO AcpiGbl_DbCommands[] =
{"TERMINATE", 0},
{"THREADS", 3},
- {"PREDEFINED", 0},
{"TEST", 1},
#endif
{NULL, 0}
@@ -1229,7 +1229,8 @@ AcpiDbExecuteThread (
AcpiGbl_MethodExecuting = FALSE;
AcpiGbl_StepToNextCall = FALSE;
- MStatus = AcpiUtAcquireMutex (ACPI_MTX_DEBUG_CMD_READY);
+ MStatus = AcpiOsAcquireMutex (AcpiGbl_DbCommandReady,
+ ACPI_WAIT_FOREVER);
if (ACPI_FAILURE (MStatus))
{
return;
@@ -1237,11 +1238,7 @@ AcpiDbExecuteThread (
Status = AcpiDbCommandDispatch (AcpiGbl_DbLineBuf, NULL, NULL);
- MStatus = AcpiUtReleaseMutex (ACPI_MTX_DEBUG_CMD_COMPLETE);
- if (ACPI_FAILURE (MStatus))
- {
- return;
- }
+ AcpiOsReleaseMutex (AcpiGbl_DbCommandComplete);
}
}
@@ -1332,13 +1329,14 @@ AcpiDbUserCommands (
* Signal the debug thread that we have a command to execute,
* and wait for the command to complete.
*/
- Status = AcpiUtReleaseMutex (ACPI_MTX_DEBUG_CMD_READY);
+ AcpiOsReleaseMutex (AcpiGbl_DbCommandReady);
if (ACPI_FAILURE (Status))
{
return (Status);
}
- Status = AcpiUtAcquireMutex (ACPI_MTX_DEBUG_CMD_COMPLETE);
+ Status = AcpiOsAcquireMutex (AcpiGbl_DbCommandComplete,
+ ACPI_WAIT_FOREVER);
if (ACPI_FAILURE (Status))
{
return (Status);
diff --git a/source/components/debugger/dbobject.c b/source/components/debugger/dbobject.c
index eef1b9e4f2f3a..019e8115fc0db 100644
--- a/source/components/debugger/dbobject.c
+++ b/source/components/debugger/dbobject.c
@@ -445,6 +445,7 @@ AcpiDbDecodeLocals (
UINT32 i;
ACPI_OPERAND_OBJECT *ObjDesc;
ACPI_NAMESPACE_NODE *Node;
+ BOOLEAN DisplayLocals = FALSE;
ObjDesc = WalkState->MethodDesc;
@@ -463,14 +464,39 @@ AcpiDbDecodeLocals (
return;
}
- AcpiOsPrintf ("Local Variables for method [%4.4s]:\n",
- AcpiUtGetNodeName (Node));
+ /* Are any locals actually set? */
for (i = 0; i < ACPI_METHOD_NUM_LOCALS; i++)
{
ObjDesc = WalkState->LocalVariables[i].Object;
- AcpiOsPrintf (" Local%X: ", i);
- AcpiDbDisplayInternalObject (ObjDesc, WalkState);
+ if (ObjDesc)
+ {
+ DisplayLocals = TRUE;
+ break;
+ }
+ }
+
+ /* If any are set, only display the ones that are set */
+
+ if (DisplayLocals)
+ {
+ AcpiOsPrintf ("\nInitialized Local Variables for method [%4.4s]:\n",
+ AcpiUtGetNodeName (Node));
+
+ for (i = 0; i < ACPI_METHOD_NUM_LOCALS; i++)
+ {
+ ObjDesc = WalkState->LocalVariables[i].Object;
+ if (ObjDesc)
+ {
+ AcpiOsPrintf (" Local%X: ", i);
+ AcpiDbDisplayInternalObject (ObjDesc, WalkState);
+ }
+ }
+ }
+ else
+ {
+ AcpiOsPrintf ("No Local Variables are initialized for method [%4.4s]\n",
+ AcpiUtGetNodeName (Node));
}
}
@@ -494,10 +520,11 @@ AcpiDbDecodeArguments (
UINT32 i;
ACPI_OPERAND_OBJECT *ObjDesc;
ACPI_NAMESPACE_NODE *Node;
+ BOOLEAN DisplayArgs = FALSE;
+ Node = WalkState->MethodNode;
ObjDesc = WalkState->MethodDesc;
- Node = WalkState->MethodNode;
if (!Node)
{
@@ -512,16 +539,40 @@ AcpiDbDecodeArguments (
return;
}
- AcpiOsPrintf (
- "Arguments for Method [%4.4s]: "
- "(%X arguments defined, max concurrency = %X)\n",
- AcpiUtGetNodeName (Node), ObjDesc->Method.ParamCount,
- ObjDesc->Method.SyncLevel);
+ /* Are any arguments actually set? */
for (i = 0; i < ACPI_METHOD_NUM_ARGS; i++)
{
ObjDesc = WalkState->Arguments[i].Object;
- AcpiOsPrintf (" Arg%u: ", i);
- AcpiDbDisplayInternalObject (ObjDesc, WalkState);
+ if (ObjDesc)
+ {
+ DisplayArgs = TRUE;
+ break;
+ }
+ }
+
+ /* If any are set, only display the ones that are set */
+
+ if (DisplayArgs)
+ {
+ AcpiOsPrintf (
+ "Initialized Arguments for Method [%4.4s]: "
+ "(%X arguments defined for method invocation)\n",
+ AcpiUtGetNodeName (Node), ObjDesc->Method.ParamCount);
+
+ for (i = 0; i < ACPI_METHOD_NUM_ARGS; i++)
+ {
+ ObjDesc = WalkState->Arguments[i].Object;
+ if (ObjDesc)
+ {
+ AcpiOsPrintf (" Arg%u: ", i);
+ AcpiDbDisplayInternalObject (ObjDesc, WalkState);
+ }
+ }
+ }
+ else
+ {
+ AcpiOsPrintf ("No Arguments are initialized for method [%4.4s]\n",
+ AcpiUtGetNodeName (Node));
}
}
diff --git a/source/components/debugger/dbxface.c b/source/components/debugger/dbxface.c
index a6a5a62dd9cf5..9e7c31d6c0c8a 100644
--- a/source/components/debugger/dbxface.c
+++ b/source/components/debugger/dbxface.c
@@ -101,12 +101,10 @@ AcpiDbStartCommand (
{
/* Handshake with the front-end that gets user command lines */
- Status = AcpiUtReleaseMutex (ACPI_MTX_DEBUG_CMD_COMPLETE);
- if (ACPI_FAILURE (Status))
- {
- return (Status);
- }
- Status = AcpiUtAcquireMutex (ACPI_MTX_DEBUG_CMD_READY);
+ AcpiOsReleaseMutex (AcpiGbl_DbCommandComplete);
+
+ Status = AcpiOsAcquireMutex (AcpiGbl_DbCommandReady,
+ ACPI_WAIT_FOREVER);
if (ACPI_FAILURE (Status))
{
return (Status);
@@ -450,14 +448,16 @@ AcpiInitializeDebugger (
{
/* These were created with one unit, grab it */
- Status = AcpiUtAcquireMutex (ACPI_MTX_DEBUG_CMD_COMPLETE);
+ Status = AcpiOsAcquireMutex (AcpiGbl_DbCommandComplete,
+ ACPI_WAIT_FOREVER);
if (ACPI_FAILURE (Status))
{
AcpiOsPrintf ("Could not get debugger mutex\n");
return_ACPI_STATUS (Status);
}
- Status = AcpiUtAcquireMutex (ACPI_MTX_DEBUG_CMD_READY);
+ Status = AcpiOsAcquireMutex (AcpiGbl_DbCommandReady,
+ ACPI_WAIT_FOREVER);
if (ACPI_FAILURE (Status))
{
AcpiOsPrintf ("Could not get debugger mutex\n");
@@ -511,33 +511,3 @@ AcpiTerminateDebugger (
}
ACPI_EXPORT_SYMBOL (AcpiTerminateDebugger)
-
-
-#ifdef ACPI_OBSOLETE_FUNCTIONS
-/*******************************************************************************
- *
- * FUNCTION: AcpiDbMethodEnd
- *
- * PARAMETERS: WalkState - Current walk
- *
- * RETURN: Status
- *
- * DESCRIPTION: Called at method termination
- *
- ******************************************************************************/
-
-void
-AcpiDbMethodEnd (
- ACPI_WALK_STATE *WalkState)
-{
-
- if (!AcpiGbl_CmSingleStep)
- {
- return;
- }
-
- AcpiOsPrintf ("<Method Terminating>\n");
-
- AcpiDbStartCommand (WalkState, NULL);
-}
-#endif