diff options
author | Jung-uk Kim <jkim@FreeBSD.org> | 2019-10-18 18:00:41 +0000 |
---|---|---|
committer | Jung-uk Kim <jkim@FreeBSD.org> | 2019-10-18 18:00:41 +0000 |
commit | 858f47305dae045d81f39451ade697ba99b3266f (patch) | |
tree | 67a913169f2c94028780a7a2a0c84fc9f84e8c60 /source/components/debugger | |
parent | e63852a7532181a14cec2928b31af2209e98414a (diff) |
Notes
Diffstat (limited to 'source/components/debugger')
-rw-r--r-- | source/components/debugger/dbconvert.c | 4 | ||||
-rw-r--r-- | source/components/debugger/dbdisply.c | 2 | ||||
-rw-r--r-- | source/components/debugger/dbfileio.c | 2 | ||||
-rw-r--r-- | source/components/debugger/dbinput.c | 36 | ||||
-rw-r--r-- | source/components/debugger/dbmethod.c | 5 | ||||
-rw-r--r-- | source/components/debugger/dbnames.c | 122 | ||||
-rw-r--r-- | source/components/debugger/dbobject.c | 1 |
7 files changed, 167 insertions, 5 deletions
diff --git a/source/components/debugger/dbconvert.c b/source/components/debugger/dbconvert.c index 631e7e8ff98f..6b58bf5faf62 100644 --- a/source/components/debugger/dbconvert.c +++ b/source/components/debugger/dbconvert.c @@ -274,6 +274,10 @@ AcpiDbConvertToBuffer ( ACPI_STATUS Status; + /* Skip all preceding white space*/ + + AcpiUtRemoveWhitespace (&String); + /* Generate the final buffer length */ for (i = 0, Length = 0; String[i];) diff --git a/source/components/debugger/dbdisply.c b/source/components/debugger/dbdisply.c index 539ff5af117d..72bf1c6be28e 100644 --- a/source/components/debugger/dbdisply.c +++ b/source/components/debugger/dbdisply.c @@ -713,7 +713,6 @@ AcpiDbDisplayResults ( return; } - ObjDesc = WalkState->MethodDesc; Node = WalkState->MethodNode; if (WalkState->Results) @@ -773,7 +772,6 @@ AcpiDbDisplayCallingTree ( return; } - Node = WalkState->MethodNode; AcpiOsPrintf ("Current Control Method Call Tree\n"); while (WalkState) diff --git a/source/components/debugger/dbfileio.c b/source/components/debugger/dbfileio.c index e937c3e4a631..7567fa75447a 100644 --- a/source/components/debugger/dbfileio.c +++ b/source/components/debugger/dbfileio.c @@ -253,7 +253,7 @@ AcpiDbLoadTables ( { Table = TableListHead->Table; - Status = AcpiLoadTable (Table); + Status = AcpiLoadTable (Table, NULL); if (ACPI_FAILURE (Status)) { if (Status == AE_ALREADY_EXISTS) diff --git a/source/components/debugger/dbinput.c b/source/components/debugger/dbinput.c index d091d351b02c..c854cb37a7fe 100644 --- a/source/components/debugger/dbinput.c +++ b/source/components/debugger/dbinput.c @@ -208,6 +208,7 @@ enum AcpiExDebuggerCommands CMD_EVALUATE, CMD_EXECUTE, CMD_EXIT, + CMD_FIELDS, CMD_FIND, CMD_GO, CMD_HANDLERS, @@ -287,6 +288,7 @@ static const ACPI_DB_COMMAND_INFO AcpiGbl_DbCommands[] = {"EVALUATE", 1}, {"EXECUTE", 1}, {"EXIT", 0}, + {"FIELDS", 1}, {"FIND", 1}, {"GO", 0}, {"HANDLERS", 0}, @@ -360,6 +362,7 @@ static const ACPI_DB_COMMAND_HELP AcpiGbl_DbCommandHelp[] = {1, " Find <AcpiName> (? is wildcard)", "Find ACPI name(s) with wildcards\n"}, {1, " Integrity", "Validate namespace integrity\n"}, {1, " Methods", "Display list of loaded control methods\n"}, + {1, " Fields <AddressSpaceId>", "Display list of loaded field units by space ID\n"}, {1, " Namespace [Object] [Depth]", "Display loaded namespace tree/subtree\n"}, {1, " Notify <Object> <Value>", "Send a notification on Object\n"}, {1, " Objects [ObjectType]", "Display summary of all objects or just given type\n"}, @@ -683,6 +686,22 @@ AcpiDbGetNextToken ( } break; + case '{': + + /* This is the start of a field unit, scan until closing brace */ + + String++; + Start = String; + Type = ACPI_TYPE_FIELD_UNIT; + + /* Find end of buffer */ + + while (*String && (*String != '}')) + { + String++; + } + break; + case '[': /* This is the start of a package, scan until closing bracket */ @@ -877,6 +896,7 @@ AcpiDbCommandDispatch ( ACPI_PARSE_OBJECT *Op) { UINT32 Temp; + UINT64 Temp64; UINT32 CommandIndex; UINT32 ParamCount; char *CommandLine; @@ -894,7 +914,6 @@ AcpiDbCommandDispatch ( ParamCount = AcpiDbGetLine (InputBuffer); CommandIndex = AcpiDbMatchCommand (AcpiGbl_DbArgs[0]); - Temp = 0; /* * We don't want to add the !! command to the history buffer. It @@ -993,6 +1012,21 @@ AcpiDbCommandDispatch ( Status = AcpiDbFindNameInNamespace (AcpiGbl_DbArgs[1]); break; + case CMD_FIELDS: + + Status = AcpiUtStrtoul64 (AcpiGbl_DbArgs[1], &Temp64); + + if (ACPI_FAILURE (Status) || Temp64 >= ACPI_NUM_PREDEFINED_REGIONS) + { + AcpiOsPrintf ( + "Invalid adress space ID: must be between 0 and %u inclusive\n", + ACPI_NUM_PREDEFINED_REGIONS - 1); + return (AE_OK); + } + + Status = AcpiDbDisplayFields ((UINT32) Temp64); + break; + case CMD_GO: AcpiGbl_CmSingleStep = FALSE; diff --git a/source/components/debugger/dbmethod.c b/source/components/debugger/dbmethod.c index 6893c5502aba..24c014f9d7cb 100644 --- a/source/components/debugger/dbmethod.c +++ b/source/components/debugger/dbmethod.c @@ -515,6 +515,11 @@ AcpiDbDisassembleMethod ( WalkState->ParseFlags |= ACPI_PARSE_DISASSEMBLE; Status = AcpiPsParseAml (WalkState); + if (ACPI_FAILURE(Status)) + { + return (Status); + } + (void) AcpiDmParseDeferredOps (Op); /* Now we can disassemble the method */ diff --git a/source/components/debugger/dbnames.c b/source/components/debugger/dbnames.c index 2c9af4be741d..ac366ab04ca2 100644 --- a/source/components/debugger/dbnames.c +++ b/source/components/debugger/dbnames.c @@ -154,6 +154,7 @@ #include "acnamesp.h" #include "acdebug.h" #include "acpredef.h" +#include "acinterp.h" #define _COMPONENT ACPI_CA_DEBUGGER @@ -724,6 +725,91 @@ AcpiDbWalkForObjectCounts ( /******************************************************************************* * + * FUNCTION: AcpiDbWalkForFields + * + * PARAMETERS: Callback from WalkNamespace + * + * RETURN: Status + * + * DESCRIPTION: Display short info about objects in the namespace + * + ******************************************************************************/ + +static ACPI_STATUS +AcpiDbWalkForFields ( + ACPI_HANDLE ObjHandle, + UINT32 NestingLevel, + void *Context, + void **ReturnValue) +{ + ACPI_OBJECT *RetValue; + ACPI_REGION_WALK_INFO *Info = (ACPI_REGION_WALK_INFO *) Context; + ACPI_BUFFER Buffer; + ACPI_STATUS Status; + ACPI_NAMESPACE_NODE *Node = AcpiNsValidateHandle (ObjHandle); + + + if (!Node) + { + return (AE_OK); + } + if (Node->Object->Field.RegionObj->Region.SpaceId != Info->AddressSpaceId) + { + return (AE_OK); + } + + Info->Count++; + + /* Get and display the full pathname to this object */ + + Buffer.Length = ACPI_ALLOCATE_LOCAL_BUFFER; + Status = AcpiNsHandleToPathname (ObjHandle, &Buffer, TRUE); + if (ACPI_FAILURE (Status)) + { + AcpiOsPrintf ("Could Not get pathname for object %p\n", ObjHandle); + return (AE_OK); + } + + AcpiOsPrintf ("%s ", (char *) Buffer.Pointer); + ACPI_FREE (Buffer.Pointer); + + Buffer.Length = ACPI_ALLOCATE_LOCAL_BUFFER; + AcpiEvaluateObject (ObjHandle, NULL, NULL, &Buffer); + + /* + * Since this is a field unit, surround the output in braces + */ + AcpiOsPrintf ("{"); + + RetValue = (ACPI_OBJECT *) Buffer.Pointer; + switch (RetValue->Type) + { + case ACPI_TYPE_INTEGER: + + AcpiOsPrintf ("%8.8X%8.8X", ACPI_FORMAT_UINT64 (RetValue->Integer.Value)); + break; + + case ACPI_TYPE_BUFFER: + + AcpiUtDumpBuffer (RetValue->Buffer.Pointer, + RetValue->Buffer.Length, DB_DISPLAY_DATA_ONLY | DB_BYTE_DISPLAY, 0); + break; + + default: + + break; + } + + AcpiOsPrintf ("}\n"); + + ACPI_FREE (Buffer.Pointer); + return (AE_OK); +} + + + +/******************************************************************************* + * * FUNCTION: AcpiDbWalkForSpecificObjects * * PARAMETERS: Callback from WalkNamespace @@ -859,6 +945,42 @@ AcpiDbDisplayObjects ( /******************************************************************************* * + * FUNCTION: AcpiDbDisplayFields + * + * PARAMETERS: ObjTypeArg - Type of object to display + * DisplayCountArg - Max depth to display + * + * RETURN: None + * + * DESCRIPTION: Display objects in the namespace of the requested type + * + ******************************************************************************/ + +ACPI_STATUS +AcpiDbDisplayFields ( + UINT32 AddressSpaceId) +{ + ACPI_REGION_WALK_INFO Info; + + + Info.Count = 0; + Info.OwnerId = ACPI_OWNER_ID_MAX; + Info.DebugLevel = ACPI_UINT32_MAX; + Info.DisplayType = ACPI_DISPLAY_SUMMARY | ACPI_DISPLAY_SHORT; + Info.AddressSpaceId = AddressSpaceId; + + /* Walk the namespace from the root */ + + (void) AcpiWalkNamespace (ACPI_TYPE_LOCAL_REGION_FIELD, ACPI_ROOT_OBJECT, + ACPI_UINT32_MAX, AcpiDbWalkForFields, NULL, + (void *) &Info, NULL); + + return (AE_OK); +} + + +/******************************************************************************* + * * FUNCTION: AcpiDbIntegrityWalk * * PARAMETERS: Callback from WalkNamespace diff --git a/source/components/debugger/dbobject.c b/source/components/debugger/dbobject.c index cebf4420528b..cffa0a533726 100644 --- a/source/components/debugger/dbobject.c +++ b/source/components/debugger/dbobject.c @@ -649,7 +649,6 @@ AcpiDbDecodeArguments ( Node = WalkState->MethodNode; - ObjDesc = WalkState->MethodDesc; /* There are no arguments for the module-level code case */ |