summaryrefslogtreecommitdiff
path: root/source/components/dispatcher/dsmethod.c
diff options
context:
space:
mode:
Diffstat (limited to 'source/components/dispatcher/dsmethod.c')
-rw-r--r--source/components/dispatcher/dsmethod.c34
1 files changed, 22 insertions, 12 deletions
diff --git a/source/components/dispatcher/dsmethod.c b/source/components/dispatcher/dsmethod.c
index f1c3be8b1953f..95e0cb3f2a00c 100644
--- a/source/components/dispatcher/dsmethod.c
+++ b/source/components/dispatcher/dsmethod.c
@@ -46,9 +46,9 @@
#include "acdispat.h"
#include "acinterp.h"
#include "acnamesp.h"
-#include "acdisasm.h"
#include "acparser.h"
#include "amlcode.h"
+#include "acdebug.h"
#define _COMPONENT ACPI_DISPATCHER
@@ -109,7 +109,7 @@ AcpiDsAutoSerializeMethod (
/* Create/Init a root op for the method parse tree */
- Op = AcpiPsAllocOp (AML_METHOD_OP);
+ Op = AcpiPsAllocOp (AML_METHOD_OP, ObjDesc->Method.AmlStart);
if (!Op)
{
return_ACPI_STATUS (AE_NO_MEMORY);
@@ -213,7 +213,7 @@ AcpiDsDetectNamedOpcodes (
* RETURN: Status
*
* DESCRIPTION: Called on method error. Invoke the global exception handler if
- * present, dump the method data if the disassembler is configured
+ * present, dump the method data if the debugger is configured
*
* Note: Allows the exception handler to change the status code
*
@@ -224,6 +224,9 @@ AcpiDsMethodError (
ACPI_STATUS Status,
ACPI_WALK_STATE *WalkState)
{
+ UINT32 AmlOffset;
+
+
ACPI_FUNCTION_ENTRY ();
@@ -247,23 +250,28 @@ AcpiDsMethodError (
* Handler can map the exception code to anything it wants, including
* AE_OK, in which case the executing method will not be aborted.
*/
+ AmlOffset = (UINT32) ACPI_PTR_DIFF (WalkState->Aml,
+ WalkState->ParserState.AmlStart);
+
Status = AcpiGbl_ExceptionHandler (Status,
WalkState->MethodNode ?
WalkState->MethodNode->Name.Integer : 0,
- WalkState->Opcode, WalkState->AmlOffset, NULL);
+ WalkState->Opcode, AmlOffset, NULL);
AcpiExEnterInterpreter ();
}
AcpiDsClearImplicitReturn (WalkState);
-#ifdef ACPI_DISASSEMBLER
if (ACPI_FAILURE (Status))
{
- /* Display method locals/args if disassembler is present */
+ AcpiDsDumpMethodStack (Status, WalkState, WalkState->Op);
- AcpiDmDumpMethodInfo (Status, WalkState, WalkState->Op);
- }
+ /* Display method locals/args if debugger is present */
+
+#ifdef ACPI_DEBUGGER
+ AcpiDbDumpMethodInfo (Status, WalkState);
#endif
+ }
return (Status);
}
@@ -349,6 +357,8 @@ AcpiDsBeginMethodExecution (
return_ACPI_STATUS (AE_NULL_ENTRY);
}
+ AcpiExStartTraceMethod (MethodNode, ObjDesc, WalkState);
+
/* Prevent wraparound of thread count */
if (ObjDesc->Method.ThreadCount == ACPI_UINT8_MAX)
@@ -610,10 +620,7 @@ Cleanup:
/* On error, we must terminate the method properly */
AcpiDsTerminateControlMethod (ObjDesc, NextWalkState);
- if (NextWalkState)
- {
- AcpiDsDeleteWalkState (NextWalkState);
- }
+ AcpiDsDeleteWalkState (NextWalkState);
return_ACPI_STATUS (Status);
}
@@ -870,5 +877,8 @@ AcpiDsTerminateControlMethod (
}
}
+ AcpiExStopTraceMethod ((ACPI_NAMESPACE_NODE *) MethodDesc->Method.Node,
+ MethodDesc, WalkState);
+
return_VOID;
}