summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLv Zheng <lv.zheng@intel.com>2015-07-07 16:18:37 +0800
committerLv Zheng <lv.zheng@intel.com>2015-07-07 16:18:37 +0800
commit2164923d60429eea7cd5a4a8629b607af7325afa (patch)
treef6bdeba9c53fea8f64119e3728ffc856292aa197
parent310e0ae1c4730f4dadc80125125099ab76851499 (diff)
downloadacpica-2164923d60429eea7cd5a4a8629b607af7325afa.tar.gz
Debugger: Move debugger specific APIs to debugger component.
Some disassembler APIs should rather be debugger APIs. This patch moves them to the debugger folder to be ready for debugger porting. Signed-off-by: Lv Zheng <lv.zheng@intel.com>
-rw-r--r--generate/unix/acpiexec/Makefile2
-rw-r--r--source/components/debugger/dbdisply.c11
-rw-r--r--source/components/debugger/dbmethod.c11
-rw-r--r--source/components/debugger/dbobject.c (renamed from source/components/disassembler/dmobject.c)63
-rw-r--r--source/components/debugger/dbutils.c3
-rw-r--r--source/components/debugger/dbxface.c4
-rw-r--r--source/components/disassembler/dmopcode.c3
-rw-r--r--source/components/dispatcher/dsmethod.c10
-rw-r--r--source/include/acdebug.h26
-rw-r--r--source/include/acdisasm.h26
10 files changed, 86 insertions, 73 deletions
diff --git a/generate/unix/acpiexec/Makefile b/generate/unix/acpiexec/Makefile
index 13388811e..6fa25e827 100644
--- a/generate/unix/acpiexec/Makefile
+++ b/generate/unix/acpiexec/Makefile
@@ -58,6 +58,7 @@ OBJECTS = \
$(OBJDIR)/dbinput.o\
$(OBJDIR)/dbmethod.o\
$(OBJDIR)/dbnames.o\
+ $(OBJDIR)/dbobject.o\
$(OBJDIR)/dbstats.o\
$(OBJDIR)/dbtest.o\
$(OBJDIR)/dbutils.o\
@@ -66,7 +67,6 @@ OBJECTS = \
$(OBJDIR)/dmcstyle.o\
$(OBJDIR)/dmdeferred.o\
$(OBJDIR)/dmnames.o\
- $(OBJDIR)/dmobject.o\
$(OBJDIR)/dmopcode.o\
$(OBJDIR)/dmresrc.o\
$(OBJDIR)/dmresrcl.o\
diff --git a/source/components/debugger/dbdisply.c b/source/components/debugger/dbdisply.c
index e8ea451eb..1dd679b41 100644
--- a/source/components/debugger/dbdisply.c
+++ b/source/components/debugger/dbdisply.c
@@ -121,7 +121,6 @@
#include "acparser.h"
#include "acinterp.h"
#include "acdebug.h"
-#include "acdisasm.h"
#ifdef ACPI_DEBUGGER
@@ -585,7 +584,7 @@ AcpiDbDisplayLocals (
return;
}
- AcpiDmDisplayLocals (WalkState);
+ AcpiDbDecodeLocals (WalkState);
}
@@ -615,7 +614,7 @@ AcpiDbDisplayArguments (
return;
}
- AcpiDmDisplayArguments (WalkState);
+ AcpiDbDecodeArguments (WalkState);
}
@@ -671,7 +670,7 @@ AcpiDbDisplayResults (
{
ObjDesc = Frame->Results.ObjDesc[Index];
AcpiOsPrintf ("Result%u: ", i);
- AcpiDmDisplayInternalObject (ObjDesc, WalkState);
+ AcpiDbDisplayInternalObject (ObjDesc, WalkState);
if (Index == 0)
{
Frame = Frame->Results.Next;
@@ -835,7 +834,7 @@ AcpiDbDisplayResultObject (
}
AcpiOsPrintf ("ResultObj: ");
- AcpiDmDisplayInternalObject (ObjDesc, WalkState);
+ AcpiDbDisplayInternalObject (ObjDesc, WalkState);
AcpiOsPrintf ("\n");
}
@@ -865,7 +864,7 @@ AcpiDbDisplayArgumentObject (
}
AcpiOsPrintf ("ArgObj: ");
- AcpiDmDisplayInternalObject (ObjDesc, WalkState);
+ AcpiDbDisplayInternalObject (ObjDesc, WalkState);
}
diff --git a/source/components/debugger/dbmethod.c b/source/components/debugger/dbmethod.c
index 5e20ada01..3ea263992 100644
--- a/source/components/debugger/dbmethod.c
+++ b/source/components/debugger/dbmethod.c
@@ -118,7 +118,9 @@
#include "acdispat.h"
#include "acnamesp.h"
#include "acdebug.h"
+#ifdef ACPI_DISASSEMBLER
#include "acdisasm.h"
+#endif
#include "acparser.h"
#include "acpredef.h"
@@ -313,7 +315,7 @@ AcpiDbSetMethodData (
ObjDesc = WalkState->Arguments[Index].Object;
AcpiOsPrintf ("Arg%u: ", Index);
- AcpiDmDisplayInternalObject (ObjDesc, WalkState);
+ AcpiDbDisplayInternalObject (ObjDesc, WalkState);
break;
case 'L':
@@ -336,7 +338,7 @@ AcpiDbSetMethodData (
ObjDesc = WalkState->LocalVariables[Index].Object;
AcpiOsPrintf ("Local%u: ", Index);
- AcpiDmDisplayInternalObject (ObjDesc, WalkState);
+ AcpiDbDisplayInternalObject (ObjDesc, WalkState);
break;
default:
@@ -382,7 +384,9 @@ AcpiDbDisassembleAml (
NumStatements = strtoul (Statements, NULL, 0);
}
+#ifdef ACPI_DISASSEMBLER
AcpiDmDisassemble (NULL, Op, NumStatements);
+#endif
}
@@ -465,6 +469,8 @@ AcpiDbDisassembleMethod (
WalkState->ParseFlags |= ACPI_PARSE_DISASSEMBLE;
Status = AcpiPsParseAml (WalkState);
+
+#ifdef ACPI_DISASSEMBER
(void) AcpiDmParseDeferredOps (Op);
/* Now we can disassemble the method */
@@ -472,6 +478,7 @@ AcpiDbDisassembleMethod (
AcpiGbl_DbOpt_Verbose = FALSE;
AcpiDmDisassemble (NULL, Op, 0);
AcpiGbl_DbOpt_Verbose = TRUE;
+#endif
AcpiPsDeleteParseTree (Op);
diff --git a/source/components/disassembler/dmobject.c b/source/components/debugger/dbobject.c
index 1414d4b57..5d2e0fbc4 100644
--- a/source/components/disassembler/dmobject.c
+++ b/source/components/debugger/dbobject.c
@@ -1,6 +1,6 @@
/*******************************************************************************
*
- * Module Name: dmobject - ACPI object decode and display
+ * Module Name: dbobject - ACPI object decode and display
*
******************************************************************************/
@@ -116,24 +116,27 @@
#include "acpi.h"
#include "accommon.h"
#include "acnamesp.h"
+#include "acdebug.h"
+#ifdef ACPI_DISASSEMBLER
#include "acdisasm.h"
+#endif
-#ifdef ACPI_DISASSEMBLER
+#ifdef ACPI_DEBUGGER
#define _COMPONENT ACPI_CA_DEBUGGER
- ACPI_MODULE_NAME ("dmnames")
+ ACPI_MODULE_NAME ("dbobject")
/* Local prototypes */
static void
-AcpiDmDecodeNode (
+AcpiDbDecodeNode (
ACPI_NAMESPACE_NODE *Node);
/*******************************************************************************
*
- * FUNCTION: AcpiDmDumpMethodInfo
+ * FUNCTION: AcpiDbDumpMethodInfo
*
* PARAMETERS: Status - Method execution status
* WalkState - Current state of the parse tree walk
@@ -147,7 +150,7 @@ AcpiDmDecodeNode (
******************************************************************************/
void
-AcpiDmDumpMethodInfo (
+AcpiDbDumpMethodInfo (
ACPI_STATUS Status,
ACPI_WALK_STATE *WalkState)
{
@@ -183,16 +186,16 @@ AcpiDmDumpMethodInfo (
/* Display the method locals and arguments */
AcpiOsPrintf ("\n");
- AcpiDmDisplayLocals (WalkState);
+ AcpiDbDecodeLocals (WalkState);
AcpiOsPrintf ("\n");
- AcpiDmDisplayArguments (WalkState);
+ AcpiDbDecodeArguments (WalkState);
AcpiOsPrintf ("\n");
}
/*******************************************************************************
*
- * FUNCTION: AcpiDmDecodeInternalObject
+ * FUNCTION: AcpiDbDecodeInternalObject
*
* PARAMETERS: ObjDesc - Object to be displayed
*
@@ -203,7 +206,7 @@ AcpiDmDumpMethodInfo (
******************************************************************************/
void
-AcpiDmDecodeInternalObject (
+AcpiDbDecodeInternalObject (
ACPI_OPERAND_OBJECT *ObjDesc)
{
UINT32 i;
@@ -265,7 +268,7 @@ AcpiDmDecodeInternalObject (
/*******************************************************************************
*
- * FUNCTION: AcpiDmDecodeNode
+ * FUNCTION: AcpiDbDecodeNode
*
* PARAMETERS: Node - Object to be displayed
*
@@ -276,7 +279,7 @@ AcpiDmDecodeInternalObject (
******************************************************************************/
static void
-AcpiDmDecodeNode (
+AcpiDbDecodeNode (
ACPI_NAMESPACE_NODE *Node)
{
@@ -308,7 +311,7 @@ AcpiDmDecodeNode (
default:
- AcpiDmDecodeInternalObject (AcpiNsGetAttachedObject (Node));
+ AcpiDbDecodeInternalObject (AcpiNsGetAttachedObject (Node));
break;
}
}
@@ -316,7 +319,7 @@ AcpiDmDecodeNode (
/*******************************************************************************
*
- * FUNCTION: AcpiDmDisplayInternalObject
+ * FUNCTION: AcpiDbDisplayInternalObject
*
* PARAMETERS: ObjDesc - Object to be displayed
* WalkState - Current walk state
@@ -328,7 +331,7 @@ AcpiDmDecodeNode (
******************************************************************************/
void
-AcpiDmDisplayInternalObject (
+AcpiDbDisplayInternalObject (
ACPI_OPERAND_OBJECT *ObjDesc,
ACPI_WALK_STATE *WalkState)
{
@@ -354,7 +357,7 @@ AcpiDmDisplayInternalObject (
case ACPI_DESC_TYPE_NAMED:
- AcpiDmDecodeNode ((ACPI_NAMESPACE_NODE *) ObjDesc);
+ AcpiDbDecodeNode ((ACPI_NAMESPACE_NODE *) ObjDesc);
break;
case ACPI_DESC_TYPE_OPERAND:
@@ -386,7 +389,7 @@ AcpiDmDisplayInternalObject (
ObjDesc = WalkState->LocalVariables
[ObjDesc->Reference.Value].Object;
AcpiOsPrintf ("%p", ObjDesc);
- AcpiDmDecodeInternalObject (ObjDesc);
+ AcpiDbDecodeInternalObject (ObjDesc);
}
break;
@@ -398,7 +401,7 @@ AcpiDmDisplayInternalObject (
ObjDesc = WalkState->Arguments
[ObjDesc->Reference.Value].Object;
AcpiOsPrintf ("%p", ObjDesc);
- AcpiDmDecodeInternalObject (ObjDesc);
+ AcpiDbDecodeInternalObject (ObjDesc);
}
break;
@@ -409,7 +412,7 @@ AcpiDmDisplayInternalObject (
case ACPI_TYPE_BUFFER_FIELD:
AcpiOsPrintf ("%p", ObjDesc->Reference.Object);
- AcpiDmDecodeInternalObject (ObjDesc->Reference.Object);
+ AcpiDbDecodeInternalObject (ObjDesc->Reference.Object);
break;
case ACPI_TYPE_PACKAGE:
@@ -421,7 +424,7 @@ AcpiDmDisplayInternalObject (
}
else
{
- AcpiDmDecodeInternalObject (
+ AcpiDbDecodeInternalObject (
*(ObjDesc->Reference.Where));
}
break;
@@ -446,11 +449,11 @@ AcpiDmDisplayInternalObject (
switch (ACPI_GET_DESCRIPTOR_TYPE (ObjDesc->Reference.Object))
{
case ACPI_DESC_TYPE_NAMED:
- AcpiDmDecodeNode (ObjDesc->Reference.Object);
+ AcpiDbDecodeNode (ObjDesc->Reference.Object);
break;
case ACPI_DESC_TYPE_OPERAND:
- AcpiDmDecodeInternalObject (ObjDesc->Reference.Object);
+ AcpiDbDecodeInternalObject (ObjDesc->Reference.Object);
break;
default:
@@ -460,7 +463,7 @@ AcpiDmDisplayInternalObject (
case ACPI_REFCLASS_NAME:
- AcpiDmDecodeNode (ObjDesc->Reference.Node);
+ AcpiDbDecodeNode (ObjDesc->Reference.Node);
break;
case ACPI_REFCLASS_DEBUG:
@@ -479,7 +482,7 @@ AcpiDmDisplayInternalObject (
default:
AcpiOsPrintf ("<Obj> ");
- AcpiDmDecodeInternalObject (ObjDesc);
+ AcpiDbDecodeInternalObject (ObjDesc);
break;
}
break;
@@ -497,7 +500,7 @@ AcpiDmDisplayInternalObject (
/*******************************************************************************
*
- * FUNCTION: AcpiDmDisplayLocals
+ * FUNCTION: AcpiDbDecodeLocals
*
* PARAMETERS: WalkState - State for current method
*
@@ -508,7 +511,7 @@ AcpiDmDisplayInternalObject (
******************************************************************************/
void
-AcpiDmDisplayLocals (
+AcpiDbDecodeLocals (
ACPI_WALK_STATE *WalkState)
{
UINT32 i;
@@ -538,14 +541,14 @@ AcpiDmDisplayLocals (
{
ObjDesc = WalkState->LocalVariables[i].Object;
AcpiOsPrintf (" Local%X: ", i);
- AcpiDmDisplayInternalObject (ObjDesc, WalkState);
+ AcpiDbDisplayInternalObject (ObjDesc, WalkState);
}
}
/*******************************************************************************
*
- * FUNCTION: AcpiDmDisplayArguments
+ * FUNCTION: AcpiDbDecodeArguments
*
* PARAMETERS: WalkState - State for current method
*
@@ -556,7 +559,7 @@ AcpiDmDisplayLocals (
******************************************************************************/
void
-AcpiDmDisplayArguments (
+AcpiDbDecodeArguments (
ACPI_WALK_STATE *WalkState)
{
UINT32 i;
@@ -587,7 +590,7 @@ AcpiDmDisplayArguments (
{
ObjDesc = WalkState->Arguments[i].Object;
AcpiOsPrintf (" Arg%u: ", i);
- AcpiDmDisplayInternalObject (ObjDesc, WalkState);
+ AcpiDbDisplayInternalObject (ObjDesc, WalkState);
}
}
diff --git a/source/components/debugger/dbutils.c b/source/components/debugger/dbutils.c
index 5c85a1574..22a5c4548 100644
--- a/source/components/debugger/dbutils.c
+++ b/source/components/debugger/dbutils.c
@@ -117,7 +117,6 @@
#include "accommon.h"
#include "acnamesp.h"
#include "acdebug.h"
-#include "acdisasm.h"
#ifdef ACPI_DEBUGGER
@@ -295,7 +294,7 @@ AcpiDbDumpExternalObject (
case ACPI_TYPE_LOCAL_REFERENCE:
AcpiOsPrintf ("[Object Reference] = ");
- AcpiDmDisplayInternalObject (ObjDesc->Reference.Handle, NULL);
+ AcpiDbDisplayInternalObject (ObjDesc->Reference.Handle, NULL);
break;
case ACPI_TYPE_PROCESSOR:
diff --git a/source/components/debugger/dbxface.c b/source/components/debugger/dbxface.c
index 348f1aa65..2292152a4 100644
--- a/source/components/debugger/dbxface.c
+++ b/source/components/debugger/dbxface.c
@@ -117,7 +117,9 @@
#include "accommon.h"
#include "amlcode.h"
#include "acdebug.h"
+#ifdef ACPI_DISASSEMBLER
#include "acdisasm.h"
+#endif
#ifdef ACPI_DEBUGGER
@@ -384,7 +386,9 @@ AcpiDbSingleStep (
/* Now we can display it */
+#ifdef ACPI_DISASSEMBLER
AcpiDmDisassemble (WalkState, DisplayOp, ACPI_UINT32_MAX);
+#endif
if ((Op->Common.AmlOpcode == AML_IF_OP) ||
(Op->Common.AmlOpcode == AML_WHILE_OP))
diff --git a/source/components/disassembler/dmopcode.c b/source/components/disassembler/dmopcode.c
index 1838cc3c4..2941a4065 100644
--- a/source/components/disassembler/dmopcode.c
+++ b/source/components/disassembler/dmopcode.c
@@ -120,6 +120,7 @@
#include "acdisasm.h"
#include "acinterp.h"
#include "acnamesp.h"
+#include "acdebug.h"
#ifdef ACPI_DISASSEMBLER
@@ -1039,7 +1040,7 @@ AcpiDmDisassembleOneOp (
(WalkState->Results) &&
(WalkState->ResultCount))
{
- AcpiDmDecodeInternalObject (
+ AcpiDbDecodeInternalObject (
WalkState->Results->Results.ObjDesc [
(WalkState->ResultCount - 1) %
ACPI_RESULTS_FRAME_OBJ_NUM]);
diff --git a/source/components/dispatcher/dsmethod.c b/source/components/dispatcher/dsmethod.c
index 6d896cc3b..10c354821 100644
--- a/source/components/dispatcher/dsmethod.c
+++ b/source/components/dispatcher/dsmethod.c
@@ -118,9 +118,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
@@ -285,7 +285,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
*
@@ -338,10 +338,10 @@ AcpiDsMethodError (
{
AcpiDsDumpMethodStack (Status, WalkState, WalkState->Op);
- /* Display method locals/args if disassembler is present */
+ /* Display method locals/args if debugger is present */
-#ifdef ACPI_DISASSEMBLER
- AcpiDmDumpMethodInfo (Status, WalkState);
+#ifdef ACPI_DEBUGGER
+ AcpiDbDumpMethodInfo (Status, WalkState);
#endif
}
diff --git a/source/include/acdebug.h b/source/include/acdebug.h
index 5a53101e4..909c8319c 100644
--- a/source/include/acdebug.h
+++ b/source/include/acdebug.h
@@ -503,6 +503,32 @@ AcpiDbGetNextToken (
/*
+ * dbobject
+ */
+void
+AcpiDbDecodeInternalObject (
+ ACPI_OPERAND_OBJECT *ObjDesc);
+
+void
+AcpiDbDisplayInternalObject (
+ ACPI_OPERAND_OBJECT *ObjDesc,
+ ACPI_WALK_STATE *WalkState);
+
+void
+AcpiDbDecodeArguments (
+ ACPI_WALK_STATE *WalkState);
+
+void
+AcpiDbDecodeLocals (
+ ACPI_WALK_STATE *WalkState);
+
+void
+AcpiDbDumpMethodInfo (
+ ACPI_STATUS Status,
+ ACPI_WALK_STATE *WalkState);
+
+
+/*
* dbstats - Generation and display of ACPI table statistics
*/
void
diff --git a/source/include/acdisasm.h b/source/include/acdisasm.h
index a5676bd39..2cad1b91f 100644
--- a/source/include/acdisasm.h
+++ b/source/include/acdisasm.h
@@ -715,10 +715,6 @@ AcpiDmDisassembleOneOp (
ACPI_OP_WALK_INFO *Info,
ACPI_PARSE_OBJECT *Op);
-void
-AcpiDmDecodeInternalObject (
- ACPI_OPERAND_OBJECT *ObjDesc);
-
UINT32
AcpiDmListType (
ACPI_PARSE_OBJECT *Op);
@@ -778,28 +774,6 @@ AcpiDmNamestring (
/*
- * dmobject
- */
-void
-AcpiDmDisplayInternalObject (
- ACPI_OPERAND_OBJECT *ObjDesc,
- ACPI_WALK_STATE *WalkState);
-
-void
-AcpiDmDisplayArguments (
- ACPI_WALK_STATE *WalkState);
-
-void
-AcpiDmDisplayLocals (
- ACPI_WALK_STATE *WalkState);
-
-void
-AcpiDmDumpMethodInfo (
- ACPI_STATUS Status,
- ACPI_WALK_STATE *WalkState);
-
-
-/*
* dmbuffer
*/
void