diff options
Diffstat (limited to 'source/components/debugger')
-rw-r--r-- | source/components/debugger/dbcmds.c | 27 | ||||
-rw-r--r-- | source/components/debugger/dbfileio.c | 37 | ||||
-rw-r--r-- | source/components/debugger/dbmethod.c | 5 |
3 files changed, 37 insertions, 32 deletions
diff --git a/source/components/debugger/dbcmds.c b/source/components/debugger/dbcmds.c index 8fde330bc9ec..e9774cdebe67 100644 --- a/source/components/debugger/dbcmds.c +++ b/source/components/debugger/dbcmds.c @@ -116,7 +116,7 @@ AcpiDbConvertToNode ( Node = ACPI_TO_POINTER (Address); if (!AcpiOsReadable (Node, sizeof (ACPI_NAMESPACE_NODE))) { - AcpiOsPrintf ("Address %p is invalid in this address space\n", + AcpiOsPrintf ("Address %p is invalid", Node); return (NULL); } @@ -125,7 +125,7 @@ AcpiDbConvertToNode ( if (ACPI_GET_DESCRIPTOR_TYPE (Node) != ACPI_DESC_TYPE_NAMED) { - AcpiOsPrintf ("Address %p is not a valid NS node [%s]\n", + AcpiOsPrintf ("Address %p is not a valid namespace node [%s]\n", Node, AcpiUtGetDescriptorName (Node)); return (NULL); } @@ -139,6 +139,8 @@ AcpiDbConvertToNode ( Node = AcpiDbLocalNsLookup (InString); if (!Node) { + AcpiOsPrintf ("Could not find [%s] in namespace, defaulting to root node\n", + InString); Node = AcpiGbl_RootNode; } } @@ -362,24 +364,19 @@ AcpiDbDisplayTableInfo ( switch (TableDesc->Flags & ACPI_TABLE_ORIGIN_MASK) { - case ACPI_TABLE_ORIGIN_UNKNOWN: + case ACPI_TABLE_ORIGIN_EXTERNAL_VIRTUAL: - AcpiOsPrintf ("Unknown "); + AcpiOsPrintf ("External virtual "); break; - case ACPI_TABLE_ORIGIN_MAPPED: + case ACPI_TABLE_ORIGIN_INTERNAL_PHYSICAL: - AcpiOsPrintf ("Mapped "); + AcpiOsPrintf ("Internal physical "); break; - case ACPI_TABLE_ORIGIN_ALLOCATED: + case ACPI_TABLE_ORIGIN_INTERNAL_VIRTUAL: - AcpiOsPrintf ("Allocated "); - break; - - case ACPI_TABLE_ORIGIN_OVERRIDE: - - AcpiOsPrintf ("Override "); + AcpiOsPrintf ("Internal virtual "); break; default: @@ -390,7 +387,7 @@ AcpiDbDisplayTableInfo ( /* Make sure that the table is mapped */ - Status = AcpiTbVerifyTable (TableDesc); + Status = AcpiTbValidateTable (TableDesc); if (ACPI_FAILURE (Status)) { return; @@ -440,8 +437,6 @@ AcpiDbUnloadAcpiTable ( Node = AcpiDbConvertToNode (ObjectName); if (!Node) { - AcpiOsPrintf ("Could not find [%s] in namespace\n", - ObjectName); return; } diff --git a/source/components/debugger/dbfileio.c b/source/components/debugger/dbfileio.c index 63ecfd87447c..a09c1de8cbd7 100644 --- a/source/components/debugger/dbfileio.c +++ b/source/components/debugger/dbfileio.c @@ -142,6 +142,8 @@ AcpiDbOpenDebugFile ( #ifdef ACPI_APPLICATION +#include "acapps.h" + /******************************************************************************* * * FUNCTION: AcpiDbCheckTextModeCorruption @@ -246,9 +248,11 @@ AcpiDbReadTable ( /* Get the file size */ - fseek (fp, 0, SEEK_END); - FileSize = (UINT32) ftell (fp); - fseek (fp, 0, SEEK_SET); + FileSize = CmGetFileSize (fp); + if (FileSize == ACPI_UINT32_MAX) + { + return (AE_ERROR); + } if (FileSize < 4) { @@ -421,7 +425,7 @@ AeLocalLoadTable ( /* Install the new table into the local data structures */ - Status = AcpiTbInstallTable (&TableInfo); + Status = AcpiTbInitTableDescriptor (&TableInfo); if (ACPI_FAILURE (Status)) { if (Status == AE_ALREADY_EXISTS) @@ -475,23 +479,23 @@ AcpiDbReadTableFromFile ( FILE *File; UINT32 FileSize; UINT32 TableLength; - ACPI_STATUS Status; + ACPI_STATUS Status = AE_ERROR; - /* Open the file */ + /* Open the file, get current size */ File = fopen (Filename, "rb"); if (!File) { perror ("Could not open input file"); - return (AE_ERROR); + return (Status); } - /* Get the file size */ - - fseek (File, 0, SEEK_END); - FileSize = (UINT32) ftell (File); - fseek (File, 0, SEEK_SET); + FileSize = CmGetFileSize (File); + if (FileSize == ACPI_UINT32_MAX) + { + goto Exit; + } /* Get the entire file */ @@ -499,15 +503,14 @@ AcpiDbReadTableFromFile ( Filename, FileSize, FileSize); Status = AcpiDbReadTable (File, Table, &TableLength); - fclose(File); - if (ACPI_FAILURE (Status)) { AcpiOsPrintf ("Could not get table from the file\n"); - return (Status); } - return (AE_OK); +Exit: + fclose(File); + return (Status); } #endif @@ -567,6 +570,8 @@ AcpiDbGetTableFromFile ( return (Status); } + AcpiTbPrintTableHeader (0, Table); + fprintf (stderr, "Acpi table [%4.4s] successfully installed and loaded\n", Table->Signature); diff --git a/source/components/debugger/dbmethod.c b/source/components/debugger/dbmethod.c index 6e44eafeed2e..90d131408c36 100644 --- a/source/components/debugger/dbmethod.c +++ b/source/components/debugger/dbmethod.c @@ -180,6 +180,11 @@ AcpiDbSetMethodData ( if (Type == 'N') { Node = AcpiDbConvertToNode (IndexArg); + if (!Node) + { + return; + } + if (Node->Type != ACPI_TYPE_INTEGER) { AcpiOsPrintf ("Can only set Integer nodes\n"); |