Skip to content

Commit

Permalink
iASL: Update error messages for ALREADY_EXISTS errors
Browse files Browse the repository at this point in the history
Print the full pathname of the new node and the node that already
exists.
  • Loading branch information
acpibob committed Jan 8, 2020
1 parent 5d76494 commit 49d829d
Showing 1 changed file with 30 additions and 6 deletions.
36 changes: 30 additions & 6 deletions source/compiler/aslload.c
Expand Up @@ -273,6 +273,7 @@ LdLoadFieldElements (
ACPI_PARSE_OBJECT *SourceRegion;
ACPI_NAMESPACE_NODE *Node;
ACPI_STATUS Status;
char *ExternalPath;


SourceRegion = UtGetArg (Op, 0);
Expand Down Expand Up @@ -356,9 +357,16 @@ LdLoadFieldElements (
* The name already exists in this scope
* But continue processing the elements
*/
ExternalPath = AcpiNsGetNormalizedPathname (Node, TRUE);

AslDualParseOpError (ASL_ERROR, ASL_MSG_NAME_EXISTS, Child,
Child->Asl.Value.String, ASL_MSG_FOUND_HERE, Node->Op,
Node->Op->Asl.ExternalName);
ExternalPath, ASL_MSG_FOUND_HERE, Node->Op,
ExternalPath);

if (ExternalPath)
{
ACPI_FREE (ExternalPath);
}
}
}
else
Expand Down Expand Up @@ -402,6 +410,7 @@ LdLoadResourceElements (
ACPI_PARSE_OBJECT *InitializerOp = NULL;
ACPI_NAMESPACE_NODE *Node;
ACPI_STATUS Status;
char *ExternalPath;


/*
Expand All @@ -418,10 +427,17 @@ LdLoadResourceElements (
{
/* Actual node causing the error was saved in ParentMethod */

ExternalPath = AcpiNsGetNormalizedPathname (Node, TRUE);

AslDualParseOpError (ASL_ERROR, ASL_MSG_NAME_EXISTS,
(ACPI_PARSE_OBJECT *) Op->Asl.ParentMethod,
Op->Asl.Namepath, ASL_MSG_FOUND_HERE, Node->Op,
Node->Op->Asl.ExternalName);
ExternalPath, ASL_MSG_FOUND_HERE, Node->Op,
ExternalPath);

if (ExternalPath)
{
ACPI_FREE (ExternalPath);
}
return (AE_OK);
}
return (Status);
Expand Down Expand Up @@ -498,6 +514,7 @@ LdNamespace1Begin (
BOOLEAN ForceNewScope = FALSE;
const ACPI_OPCODE_INFO *OpInfo;
ACPI_PARSE_OBJECT *ParentOp;
char *ExternalPath;


ACPI_FUNCTION_NAME (LdNamespace1Begin);
Expand Down Expand Up @@ -938,9 +955,16 @@ LdNamespace1Begin (
{
/* Valid error, object already exists */

ExternalPath = AcpiNsGetNormalizedPathname (Node, TRUE);

AslDualParseOpError (ASL_ERROR, ASL_MSG_NAME_EXISTS, Op,
Op->Asl.ExternalName, ASL_MSG_FOUND_HERE, Node->Op,
Node->Op->Asl.ExternalName);
ExternalPath, ASL_MSG_FOUND_HERE, Node->Op,
ExternalPath);

if (ExternalPath)
{
ACPI_FREE (ExternalPath);
}
return_ACPI_STATUS (AE_OK);
}
}
Expand Down

0 comments on commit 49d829d

Please sign in to comment.