diff options
Diffstat (limited to 'source/components/debugger/dbmethod.c')
| -rw-r--r-- | source/components/debugger/dbmethod.c | 39 | 
1 files changed, 36 insertions, 3 deletions
| diff --git a/source/components/debugger/dbmethod.c b/source/components/debugger/dbmethod.c index 5335611278f78..c3266c51e2599 100644 --- a/source/components/debugger/dbmethod.c +++ b/source/components/debugger/dbmethod.c @@ -345,6 +345,13 @@ AcpiDbDisassembleMethod (          return (AE_BAD_PARAMETER);      } +    if (Method->Type != ACPI_TYPE_METHOD) +    { +        ACPI_ERROR ((AE_INFO, "%s (%s): Object must be a control method", +            Name, AcpiUtGetTypeName (Method->Type))); +        return (AE_BAD_PARAMETER); +    } +      ObjDesc = Method->Object;      Op = AcpiPsCreateScopeOp (); @@ -362,21 +369,47 @@ AcpiDbDisassembleMethod (      }      Status = AcpiDsInitAmlWalk (WalkState, Op, NULL, -                    ObjDesc->Method.AmlStart, -                    ObjDesc->Method.AmlLength, NULL, ACPI_IMODE_LOAD_PASS1); +        ObjDesc->Method.AmlStart, +        ObjDesc->Method.AmlLength, NULL, ACPI_IMODE_LOAD_PASS1); +    if (ACPI_FAILURE (Status)) +    { +        return (Status); +    } + +    Status = AcpiUtAllocateOwnerId (&ObjDesc->Method.OwnerId); +    WalkState->OwnerId = ObjDesc->Method.OwnerId; + +    /* Push start scope on scope stack and make it current */ + +    Status = AcpiDsScopeStackPush (Method, +        Method->Type, WalkState);      if (ACPI_FAILURE (Status))      {          return (Status);      } -    /* Parse the AML */ +    /* Parse the entire method AML including deferred operators */      WalkState->ParseFlags &= ~ACPI_PARSE_DELETE_TREE;      WalkState->ParseFlags |= ACPI_PARSE_DISASSEMBLE; +      Status = AcpiPsParseAml (WalkState); +    AcpiDmParseDeferredOps (Op); +    /* Now we can disassemble the method */ + +    AcpiGbl_DbOpt_verbose = TRUE; +    AcpiGbl_DbOpt_verbose = FALSE;      AcpiDmDisassemble (NULL, Op, 0); +    AcpiGbl_DbOpt_verbose = TRUE; +      AcpiPsDeleteParseTree (Op); + +    /* Method cleanup */ + +    AcpiNsDeleteNamespaceSubtree (Method); +    AcpiNsDeleteNamespaceByOwner (ObjDesc->Method.OwnerId); +    AcpiUtReleaseOwnerId (&ObjDesc->Method.OwnerId);      return (AE_OK);  } | 
