xref: /freebsd/sys/contrib/dev/acpica/components/debugger/dbmethod.c (revision 313a0c13efa638cf248e35eed49f36ec0a1a7f26)
1a159c266SJung-uk Kim /*******************************************************************************
2a159c266SJung-uk Kim  *
3a159c266SJung-uk Kim  * Module Name: dbmethod - Debug commands for control methods
4a159c266SJung-uk Kim  *
5a159c266SJung-uk Kim  ******************************************************************************/
6a159c266SJung-uk Kim 
7a159c266SJung-uk Kim /*
8*313a0c13SJung-uk Kim  * Copyright (C) 2000 - 2014, Intel Corp.
9a159c266SJung-uk Kim  * All rights reserved.
10a159c266SJung-uk Kim  *
11a159c266SJung-uk Kim  * Redistribution and use in source and binary forms, with or without
12a159c266SJung-uk Kim  * modification, are permitted provided that the following conditions
13a159c266SJung-uk Kim  * are met:
14a159c266SJung-uk Kim  * 1. Redistributions of source code must retain the above copyright
15a159c266SJung-uk Kim  *    notice, this list of conditions, and the following disclaimer,
16a159c266SJung-uk Kim  *    without modification.
17a159c266SJung-uk Kim  * 2. Redistributions in binary form must reproduce at minimum a disclaimer
18a159c266SJung-uk Kim  *    substantially similar to the "NO WARRANTY" disclaimer below
19a159c266SJung-uk Kim  *    ("Disclaimer") and any redistribution must be conditioned upon
20a159c266SJung-uk Kim  *    including a substantially similar Disclaimer requirement for further
21a159c266SJung-uk Kim  *    binary redistribution.
22a159c266SJung-uk Kim  * 3. Neither the names of the above-listed copyright holders nor the names
23a159c266SJung-uk Kim  *    of any contributors may be used to endorse or promote products derived
24a159c266SJung-uk Kim  *    from this software without specific prior written permission.
25a159c266SJung-uk Kim  *
26a159c266SJung-uk Kim  * Alternatively, this software may be distributed under the terms of the
27a159c266SJung-uk Kim  * GNU General Public License ("GPL") version 2 as published by the Free
28a159c266SJung-uk Kim  * Software Foundation.
29a159c266SJung-uk Kim  *
30a159c266SJung-uk Kim  * NO WARRANTY
31a159c266SJung-uk Kim  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
32a159c266SJung-uk Kim  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
33a159c266SJung-uk Kim  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR
34a159c266SJung-uk Kim  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
35a159c266SJung-uk Kim  * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
36a159c266SJung-uk Kim  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
37a159c266SJung-uk Kim  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
38a159c266SJung-uk Kim  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
39a159c266SJung-uk Kim  * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
40a159c266SJung-uk Kim  * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
41a159c266SJung-uk Kim  * POSSIBILITY OF SUCH DAMAGES.
42a159c266SJung-uk Kim  */
43a159c266SJung-uk Kim 
44a159c266SJung-uk Kim #include <contrib/dev/acpica/include/acpi.h>
45a159c266SJung-uk Kim #include <contrib/dev/acpica/include/accommon.h>
46a159c266SJung-uk Kim #include <contrib/dev/acpica/include/acdispat.h>
47a159c266SJung-uk Kim #include <contrib/dev/acpica/include/acnamesp.h>
48a159c266SJung-uk Kim #include <contrib/dev/acpica/include/acdebug.h>
49a159c266SJung-uk Kim #include <contrib/dev/acpica/include/acdisasm.h>
50a159c266SJung-uk Kim #include <contrib/dev/acpica/include/acparser.h>
51895f26a9SJung-uk Kim #include <contrib/dev/acpica/include/acpredef.h>
52a159c266SJung-uk Kim 
53a159c266SJung-uk Kim 
54a159c266SJung-uk Kim #ifdef ACPI_DEBUGGER
55a159c266SJung-uk Kim 
56a159c266SJung-uk Kim #define _COMPONENT          ACPI_CA_DEBUGGER
57a159c266SJung-uk Kim         ACPI_MODULE_NAME    ("dbmethod")
58a159c266SJung-uk Kim 
59a159c266SJung-uk Kim 
60a159c266SJung-uk Kim /*******************************************************************************
61a159c266SJung-uk Kim  *
62a159c266SJung-uk Kim  * FUNCTION:    AcpiDbSetMethodBreakpoint
63a159c266SJung-uk Kim  *
64a159c266SJung-uk Kim  * PARAMETERS:  Location            - AML offset of breakpoint
65a159c266SJung-uk Kim  *              WalkState           - Current walk info
66a159c266SJung-uk Kim  *              Op                  - Current Op (from parse walk)
67a159c266SJung-uk Kim  *
68a159c266SJung-uk Kim  * RETURN:      None
69a159c266SJung-uk Kim  *
70a159c266SJung-uk Kim  * DESCRIPTION: Set a breakpoint in a control method at the specified
71a159c266SJung-uk Kim  *              AML offset
72a159c266SJung-uk Kim  *
73a159c266SJung-uk Kim  ******************************************************************************/
74a159c266SJung-uk Kim 
75a159c266SJung-uk Kim void
76a159c266SJung-uk Kim AcpiDbSetMethodBreakpoint (
77a159c266SJung-uk Kim     char                    *Location,
78a159c266SJung-uk Kim     ACPI_WALK_STATE         *WalkState,
79a159c266SJung-uk Kim     ACPI_PARSE_OBJECT       *Op)
80a159c266SJung-uk Kim {
81a159c266SJung-uk Kim     UINT32                  Address;
82a159c266SJung-uk Kim 
83a159c266SJung-uk Kim 
84a159c266SJung-uk Kim     if (!Op)
85a159c266SJung-uk Kim     {
86a159c266SJung-uk Kim         AcpiOsPrintf ("There is no method currently executing\n");
87a159c266SJung-uk Kim         return;
88a159c266SJung-uk Kim     }
89a159c266SJung-uk Kim 
90a159c266SJung-uk Kim     /* Get and verify the breakpoint address */
91a159c266SJung-uk Kim 
92a159c266SJung-uk Kim     Address = ACPI_STRTOUL (Location, NULL, 16);
93a159c266SJung-uk Kim     if (Address <= Op->Common.AmlOffset)
94a159c266SJung-uk Kim     {
95a159c266SJung-uk Kim         AcpiOsPrintf ("Breakpoint %X is beyond current address %X\n",
96a159c266SJung-uk Kim             Address, Op->Common.AmlOffset);
97a159c266SJung-uk Kim     }
98a159c266SJung-uk Kim 
99a159c266SJung-uk Kim     /* Save breakpoint in current walk */
100a159c266SJung-uk Kim 
101a159c266SJung-uk Kim     WalkState->UserBreakpoint = Address;
102a159c266SJung-uk Kim     AcpiOsPrintf ("Breakpoint set at AML offset %X\n", Address);
103a159c266SJung-uk Kim }
104a159c266SJung-uk Kim 
105a159c266SJung-uk Kim 
106a159c266SJung-uk Kim /*******************************************************************************
107a159c266SJung-uk Kim  *
108a159c266SJung-uk Kim  * FUNCTION:    AcpiDbSetMethodCallBreakpoint
109a159c266SJung-uk Kim  *
110a159c266SJung-uk Kim  * PARAMETERS:  Op                  - Current Op (from parse walk)
111a159c266SJung-uk Kim  *
112a159c266SJung-uk Kim  * RETURN:      None
113a159c266SJung-uk Kim  *
114a159c266SJung-uk Kim  * DESCRIPTION: Set a breakpoint in a control method at the specified
115a159c266SJung-uk Kim  *              AML offset
116a159c266SJung-uk Kim  *
117a159c266SJung-uk Kim  ******************************************************************************/
118a159c266SJung-uk Kim 
119a159c266SJung-uk Kim void
120a159c266SJung-uk Kim AcpiDbSetMethodCallBreakpoint (
121a159c266SJung-uk Kim     ACPI_PARSE_OBJECT       *Op)
122a159c266SJung-uk Kim {
123a159c266SJung-uk Kim 
124a159c266SJung-uk Kim 
125a159c266SJung-uk Kim     if (!Op)
126a159c266SJung-uk Kim     {
127a159c266SJung-uk Kim         AcpiOsPrintf ("There is no method currently executing\n");
128a159c266SJung-uk Kim         return;
129a159c266SJung-uk Kim     }
130a159c266SJung-uk Kim 
131a159c266SJung-uk Kim     AcpiGbl_StepToNextCall = TRUE;
132a159c266SJung-uk Kim }
133a159c266SJung-uk Kim 
134a159c266SJung-uk Kim 
135a159c266SJung-uk Kim /*******************************************************************************
136a159c266SJung-uk Kim  *
137a159c266SJung-uk Kim  * FUNCTION:    AcpiDbSetMethodData
138a159c266SJung-uk Kim  *
139a159c266SJung-uk Kim  * PARAMETERS:  TypeArg         - L for local, A for argument
140a159c266SJung-uk Kim  *              IndexArg        - which one
141a159c266SJung-uk Kim  *              ValueArg        - Value to set.
142a159c266SJung-uk Kim  *
143a159c266SJung-uk Kim  * RETURN:      None
144a159c266SJung-uk Kim  *
145a159c266SJung-uk Kim  * DESCRIPTION: Set a local or argument for the running control method.
146a159c266SJung-uk Kim  *              NOTE: only object supported is Number.
147a159c266SJung-uk Kim  *
148a159c266SJung-uk Kim  ******************************************************************************/
149a159c266SJung-uk Kim 
150a159c266SJung-uk Kim void
151a159c266SJung-uk Kim AcpiDbSetMethodData (
152a159c266SJung-uk Kim     char                    *TypeArg,
153a159c266SJung-uk Kim     char                    *IndexArg,
154a159c266SJung-uk Kim     char                    *ValueArg)
155a159c266SJung-uk Kim {
156a159c266SJung-uk Kim     char                    Type;
157a159c266SJung-uk Kim     UINT32                  Index;
158a159c266SJung-uk Kim     UINT32                  Value;
159a159c266SJung-uk Kim     ACPI_WALK_STATE         *WalkState;
160a159c266SJung-uk Kim     ACPI_OPERAND_OBJECT     *ObjDesc;
161a159c266SJung-uk Kim     ACPI_STATUS             Status;
162a159c266SJung-uk Kim     ACPI_NAMESPACE_NODE     *Node;
163a159c266SJung-uk Kim 
164a159c266SJung-uk Kim 
165a159c266SJung-uk Kim     /* Validate TypeArg */
166a159c266SJung-uk Kim 
167a159c266SJung-uk Kim     AcpiUtStrupr (TypeArg);
168a159c266SJung-uk Kim     Type = TypeArg[0];
169a159c266SJung-uk Kim     if ((Type != 'L') &&
170a159c266SJung-uk Kim         (Type != 'A') &&
171a159c266SJung-uk Kim         (Type != 'N'))
172a159c266SJung-uk Kim     {
173a159c266SJung-uk Kim         AcpiOsPrintf ("Invalid SET operand: %s\n", TypeArg);
174a159c266SJung-uk Kim         return;
175a159c266SJung-uk Kim     }
176a159c266SJung-uk Kim 
177a159c266SJung-uk Kim     Value = ACPI_STRTOUL (ValueArg, NULL, 16);
178a159c266SJung-uk Kim 
179a159c266SJung-uk Kim     if (Type == 'N')
180a159c266SJung-uk Kim     {
181a159c266SJung-uk Kim         Node = AcpiDbConvertToNode (IndexArg);
182*313a0c13SJung-uk Kim         if (!Node)
183*313a0c13SJung-uk Kim         {
184*313a0c13SJung-uk Kim             return;
185*313a0c13SJung-uk Kim         }
186*313a0c13SJung-uk Kim 
187a159c266SJung-uk Kim         if (Node->Type != ACPI_TYPE_INTEGER)
188a159c266SJung-uk Kim         {
189a159c266SJung-uk Kim             AcpiOsPrintf ("Can only set Integer nodes\n");
190a159c266SJung-uk Kim             return;
191a159c266SJung-uk Kim         }
192a159c266SJung-uk Kim         ObjDesc = Node->Object;
193a159c266SJung-uk Kim         ObjDesc->Integer.Value = Value;
194a159c266SJung-uk Kim         return;
195a159c266SJung-uk Kim     }
196a159c266SJung-uk Kim 
197a159c266SJung-uk Kim     /* Get the index and value */
198a159c266SJung-uk Kim 
199a159c266SJung-uk Kim     Index = ACPI_STRTOUL (IndexArg, NULL, 16);
200a159c266SJung-uk Kim 
201a159c266SJung-uk Kim     WalkState = AcpiDsGetCurrentWalkState (AcpiGbl_CurrentWalkList);
202a159c266SJung-uk Kim     if (!WalkState)
203a159c266SJung-uk Kim     {
204a159c266SJung-uk Kim         AcpiOsPrintf ("There is no method currently executing\n");
205a159c266SJung-uk Kim         return;
206a159c266SJung-uk Kim     }
207a159c266SJung-uk Kim 
208a159c266SJung-uk Kim     /* Create and initialize the new object */
209a159c266SJung-uk Kim 
210a159c266SJung-uk Kim     ObjDesc = AcpiUtCreateIntegerObject ((UINT64) Value);
211a159c266SJung-uk Kim     if (!ObjDesc)
212a159c266SJung-uk Kim     {
213a159c266SJung-uk Kim         AcpiOsPrintf ("Could not create an internal object\n");
214a159c266SJung-uk Kim         return;
215a159c266SJung-uk Kim     }
216a159c266SJung-uk Kim 
217a159c266SJung-uk Kim     /* Store the new object into the target */
218a159c266SJung-uk Kim 
219a159c266SJung-uk Kim     switch (Type)
220a159c266SJung-uk Kim     {
221a159c266SJung-uk Kim     case 'A':
222a159c266SJung-uk Kim 
223a159c266SJung-uk Kim         /* Set a method argument */
224a159c266SJung-uk Kim 
225a159c266SJung-uk Kim         if (Index > ACPI_METHOD_MAX_ARG)
226a159c266SJung-uk Kim         {
227a159c266SJung-uk Kim             AcpiOsPrintf ("Arg%u - Invalid argument name\n", Index);
228a159c266SJung-uk Kim             goto Cleanup;
229a159c266SJung-uk Kim         }
230a159c266SJung-uk Kim 
231a159c266SJung-uk Kim         Status = AcpiDsStoreObjectToLocal (ACPI_REFCLASS_ARG, Index, ObjDesc,
232a159c266SJung-uk Kim                     WalkState);
233a159c266SJung-uk Kim         if (ACPI_FAILURE (Status))
234a159c266SJung-uk Kim         {
235a159c266SJung-uk Kim             goto Cleanup;
236a159c266SJung-uk Kim         }
237a159c266SJung-uk Kim 
238a159c266SJung-uk Kim         ObjDesc = WalkState->Arguments[Index].Object;
239a159c266SJung-uk Kim 
240a159c266SJung-uk Kim         AcpiOsPrintf ("Arg%u: ", Index);
241a159c266SJung-uk Kim         AcpiDmDisplayInternalObject (ObjDesc, WalkState);
242a159c266SJung-uk Kim         break;
243a159c266SJung-uk Kim 
244a159c266SJung-uk Kim     case 'L':
245a159c266SJung-uk Kim 
246a159c266SJung-uk Kim         /* Set a method local */
247a159c266SJung-uk Kim 
248a159c266SJung-uk Kim         if (Index > ACPI_METHOD_MAX_LOCAL)
249a159c266SJung-uk Kim         {
250a159c266SJung-uk Kim             AcpiOsPrintf ("Local%u - Invalid local variable name\n", Index);
251a159c266SJung-uk Kim             goto Cleanup;
252a159c266SJung-uk Kim         }
253a159c266SJung-uk Kim 
254a159c266SJung-uk Kim         Status = AcpiDsStoreObjectToLocal (ACPI_REFCLASS_LOCAL, Index, ObjDesc,
255a159c266SJung-uk Kim                     WalkState);
256a159c266SJung-uk Kim         if (ACPI_FAILURE (Status))
257a159c266SJung-uk Kim         {
258a159c266SJung-uk Kim             goto Cleanup;
259a159c266SJung-uk Kim         }
260a159c266SJung-uk Kim 
261a159c266SJung-uk Kim         ObjDesc = WalkState->LocalVariables[Index].Object;
262a159c266SJung-uk Kim 
263a159c266SJung-uk Kim         AcpiOsPrintf ("Local%u: ", Index);
264a159c266SJung-uk Kim         AcpiDmDisplayInternalObject (ObjDesc, WalkState);
265a159c266SJung-uk Kim         break;
266a159c266SJung-uk Kim 
267a159c266SJung-uk Kim     default:
268a9d8d09cSJung-uk Kim 
269a159c266SJung-uk Kim         break;
270a159c266SJung-uk Kim     }
271a159c266SJung-uk Kim 
272a159c266SJung-uk Kim Cleanup:
273a159c266SJung-uk Kim     AcpiUtRemoveReference (ObjDesc);
274a159c266SJung-uk Kim }
275a159c266SJung-uk Kim 
276a159c266SJung-uk Kim 
277a159c266SJung-uk Kim /*******************************************************************************
278a159c266SJung-uk Kim  *
279a159c266SJung-uk Kim  * FUNCTION:    AcpiDbDisassembleAml
280a159c266SJung-uk Kim  *
281a159c266SJung-uk Kim  * PARAMETERS:  Statements          - Number of statements to disassemble
282a159c266SJung-uk Kim  *              Op                  - Current Op (from parse walk)
283a159c266SJung-uk Kim  *
284a159c266SJung-uk Kim  * RETURN:      None
285a159c266SJung-uk Kim  *
286a159c266SJung-uk Kim  * DESCRIPTION: Display disassembled AML (ASL) starting from Op for the number
287a159c266SJung-uk Kim  *              of statements specified.
288a159c266SJung-uk Kim  *
289a159c266SJung-uk Kim  ******************************************************************************/
290a159c266SJung-uk Kim 
291a159c266SJung-uk Kim void
292a159c266SJung-uk Kim AcpiDbDisassembleAml (
293a159c266SJung-uk Kim     char                    *Statements,
294a159c266SJung-uk Kim     ACPI_PARSE_OBJECT       *Op)
295a159c266SJung-uk Kim {
296a159c266SJung-uk Kim     UINT32                  NumStatements = 8;
297a159c266SJung-uk Kim 
298a159c266SJung-uk Kim 
299a159c266SJung-uk Kim     if (!Op)
300a159c266SJung-uk Kim     {
301a159c266SJung-uk Kim         AcpiOsPrintf ("There is no method currently executing\n");
302a159c266SJung-uk Kim         return;
303a159c266SJung-uk Kim     }
304a159c266SJung-uk Kim 
305a159c266SJung-uk Kim     if (Statements)
306a159c266SJung-uk Kim     {
307a159c266SJung-uk Kim         NumStatements = ACPI_STRTOUL (Statements, NULL, 0);
308a159c266SJung-uk Kim     }
309a159c266SJung-uk Kim 
310a159c266SJung-uk Kim #ifdef ACPI_DISASSEMBLER
311a159c266SJung-uk Kim     AcpiDmDisassemble (NULL, Op, NumStatements);
312a159c266SJung-uk Kim #endif
313a159c266SJung-uk Kim }
314a159c266SJung-uk Kim 
315a159c266SJung-uk Kim 
316a159c266SJung-uk Kim /*******************************************************************************
317a159c266SJung-uk Kim  *
318a159c266SJung-uk Kim  * FUNCTION:    AcpiDbDisassembleMethod
319a159c266SJung-uk Kim  *
320a159c266SJung-uk Kim  * PARAMETERS:  Name            - Name of control method
321a159c266SJung-uk Kim  *
322a159c266SJung-uk Kim  * RETURN:      None
323a159c266SJung-uk Kim  *
324a159c266SJung-uk Kim  * DESCRIPTION: Display disassembled AML (ASL) starting from Op for the number
325a159c266SJung-uk Kim  *              of statements specified.
326a159c266SJung-uk Kim  *
327a159c266SJung-uk Kim  ******************************************************************************/
328a159c266SJung-uk Kim 
329a159c266SJung-uk Kim ACPI_STATUS
330a159c266SJung-uk Kim AcpiDbDisassembleMethod (
331a159c266SJung-uk Kim     char                    *Name)
332a159c266SJung-uk Kim {
333a159c266SJung-uk Kim     ACPI_STATUS             Status;
334a159c266SJung-uk Kim     ACPI_PARSE_OBJECT       *Op;
335a159c266SJung-uk Kim     ACPI_WALK_STATE         *WalkState;
336a159c266SJung-uk Kim     ACPI_OPERAND_OBJECT     *ObjDesc;
337a159c266SJung-uk Kim     ACPI_NAMESPACE_NODE     *Method;
338a159c266SJung-uk Kim 
339a159c266SJung-uk Kim 
340a159c266SJung-uk Kim     Method = AcpiDbConvertToNode (Name);
341a159c266SJung-uk Kim     if (!Method)
342a159c266SJung-uk Kim     {
343a159c266SJung-uk Kim         return (AE_BAD_PARAMETER);
344a159c266SJung-uk Kim     }
345a159c266SJung-uk Kim 
346ed17e06eSJung-uk Kim     if (Method->Type != ACPI_TYPE_METHOD)
347ed17e06eSJung-uk Kim     {
348ed17e06eSJung-uk Kim         ACPI_ERROR ((AE_INFO, "%s (%s): Object must be a control method",
349ed17e06eSJung-uk Kim             Name, AcpiUtGetTypeName (Method->Type)));
350ed17e06eSJung-uk Kim         return (AE_BAD_PARAMETER);
351ed17e06eSJung-uk Kim     }
352ed17e06eSJung-uk Kim 
353a159c266SJung-uk Kim     ObjDesc = Method->Object;
354a159c266SJung-uk Kim 
355a159c266SJung-uk Kim     Op = AcpiPsCreateScopeOp ();
356a159c266SJung-uk Kim     if (!Op)
357a159c266SJung-uk Kim     {
358a159c266SJung-uk Kim         return (AE_NO_MEMORY);
359a159c266SJung-uk Kim     }
360a159c266SJung-uk Kim 
361a159c266SJung-uk Kim     /* Create and initialize a new walk state */
362a159c266SJung-uk Kim 
363a159c266SJung-uk Kim     WalkState = AcpiDsCreateWalkState (0, Op, NULL, NULL);
364a159c266SJung-uk Kim     if (!WalkState)
365a159c266SJung-uk Kim     {
366a159c266SJung-uk Kim         return (AE_NO_MEMORY);
367a159c266SJung-uk Kim     }
368a159c266SJung-uk Kim 
369a159c266SJung-uk Kim     Status = AcpiDsInitAmlWalk (WalkState, Op, NULL,
370a159c266SJung-uk Kim         ObjDesc->Method.AmlStart,
371a159c266SJung-uk Kim         ObjDesc->Method.AmlLength, NULL, ACPI_IMODE_LOAD_PASS1);
372a159c266SJung-uk Kim     if (ACPI_FAILURE (Status))
373a159c266SJung-uk Kim     {
374a159c266SJung-uk Kim         return (Status);
375a159c266SJung-uk Kim     }
376a159c266SJung-uk Kim 
377ed17e06eSJung-uk Kim     Status = AcpiUtAllocateOwnerId (&ObjDesc->Method.OwnerId);
378ed17e06eSJung-uk Kim     WalkState->OwnerId = ObjDesc->Method.OwnerId;
379ed17e06eSJung-uk Kim 
380ed17e06eSJung-uk Kim     /* Push start scope on scope stack and make it current */
381ed17e06eSJung-uk Kim 
382ed17e06eSJung-uk Kim     Status = AcpiDsScopeStackPush (Method,
383ed17e06eSJung-uk Kim         Method->Type, WalkState);
384ed17e06eSJung-uk Kim     if (ACPI_FAILURE (Status))
385ed17e06eSJung-uk Kim     {
386ed17e06eSJung-uk Kim         return (Status);
387ed17e06eSJung-uk Kim     }
388ed17e06eSJung-uk Kim 
389ed17e06eSJung-uk Kim     /* Parse the entire method AML including deferred operators */
390a159c266SJung-uk Kim 
391a159c266SJung-uk Kim     WalkState->ParseFlags &= ~ACPI_PARSE_DELETE_TREE;
392a159c266SJung-uk Kim     WalkState->ParseFlags |= ACPI_PARSE_DISASSEMBLE;
393a159c266SJung-uk Kim 
394ed17e06eSJung-uk Kim     Status = AcpiPsParseAml (WalkState);
395efcc2a30SJung-uk Kim     (void) AcpiDmParseDeferredOps (Op);
396ed17e06eSJung-uk Kim 
397ed17e06eSJung-uk Kim     /* Now we can disassemble the method */
398ed17e06eSJung-uk Kim 
399ed17e06eSJung-uk Kim     AcpiGbl_DbOpt_verbose = FALSE;
400a159c266SJung-uk Kim #ifdef ACPI_DISASSEMBLER
401a159c266SJung-uk Kim     AcpiDmDisassemble (NULL, Op, 0);
402a159c266SJung-uk Kim #endif
403ed17e06eSJung-uk Kim     AcpiGbl_DbOpt_verbose = TRUE;
404ed17e06eSJung-uk Kim 
405a159c266SJung-uk Kim     AcpiPsDeleteParseTree (Op);
406ed17e06eSJung-uk Kim 
407ed17e06eSJung-uk Kim     /* Method cleanup */
408ed17e06eSJung-uk Kim 
409ed17e06eSJung-uk Kim     AcpiNsDeleteNamespaceSubtree (Method);
410ed17e06eSJung-uk Kim     AcpiNsDeleteNamespaceByOwner (ObjDesc->Method.OwnerId);
411ed17e06eSJung-uk Kim     AcpiUtReleaseOwnerId (&ObjDesc->Method.OwnerId);
412a159c266SJung-uk Kim     return (AE_OK);
413a159c266SJung-uk Kim }
414a159c266SJung-uk Kim 
415a159c266SJung-uk Kim #endif /* ACPI_DEBUGGER */
416