summaryrefslogtreecommitdiffstats
path: root/source/compiler/aslerror.c
diff options
context:
space:
mode:
Diffstat (limited to 'source/compiler/aslerror.c')
-rw-r--r--source/compiler/aslerror.c159
1 files changed, 71 insertions, 88 deletions
diff --git a/source/compiler/aslerror.c b/source/compiler/aslerror.c
index 1fcb97e..14ca99d 100644
--- a/source/compiler/aslerror.c
+++ b/source/compiler/aslerror.c
@@ -41,7 +41,6 @@
* POSSIBILITY OF SUCH DAMAGES.
*/
-#define ASL_EXCEPTIONS
#include "aslcompiler.h"
#define _COMPONENT ACPI_COMPILER
@@ -204,7 +203,7 @@ AePrintException (
int Actual;
size_t RActual;
UINT32 MsgLength;
- char *MainMessage;
+ const char *MainMessage;
char *ExtraMessage;
UINT32 SourceColumn;
UINT32 ErrorColumn;
@@ -399,109 +398,93 @@ AePrintException (
}
}
- /* NULL message ID, just print the raw message */
+ /* If a NULL message ID, just print the raw message */
if (Enode->MessageId == 0)
{
fprintf (OutputFile, "%s\n", Enode->Message);
+ return;
}
- else
- {
- /* Decode the message ID */
- if (Gbl_VerboseErrors)
- {
- fprintf (OutputFile, "%s %4.4d -",
- AslErrorLevel[Enode->Level],
- Enode->MessageId + ((Enode->Level+1) * 1000));
- }
- else /* IDE case */
- {
- fprintf (OutputFile, "%s %4.4d:",
- AslErrorLevelIde[Enode->Level],
- Enode->MessageId + ((Enode->Level+1) * 1000));
- }
+ /* Decode the message ID */
- MainMessage = AslMessages[Enode->MessageId];
- ExtraMessage = Enode->Message;
+ fprintf (OutputFile, "%s %4.4d -",
+ AeDecodeExceptionLevel (Enode->Level),
+ AeBuildFullExceptionCode (Enode->Level, Enode->MessageId));
- if (Enode->LineNumber)
- {
- /* Main message: try to use string from AslMessages first */
+ MainMessage = AeDecodeMessageId (Enode->MessageId);
+ ExtraMessage = Enode->Message;
- if (!MainMessage)
- {
- MainMessage = "";
- }
+ /* If a NULL line number, just print the decoded message */
- MsgLength = strlen (MainMessage);
- if (MsgLength == 0)
- {
- /* Use the secondary/extra message as main message */
+ if (!Enode->LineNumber)
+ {
+ fprintf (OutputFile, " %s %s\n\n", MainMessage, ExtraMessage);
+ return;
+ }
- MainMessage = Enode->Message;
- if (!MainMessage)
- {
- MainMessage = "";
- }
+ MsgLength = strlen (MainMessage);
+ if (MsgLength == 0)
+ {
+ /* Use the secondary/extra message as main message */
- MsgLength = strlen (MainMessage);
- ExtraMessage = NULL;
- }
+ MainMessage = Enode->Message;
+ if (!MainMessage)
+ {
+ MainMessage = "";
+ }
- if (Gbl_VerboseErrors && !PrematureEOF)
- {
- if (Total >= 256)
- {
- fprintf (OutputFile, " %s",
- MainMessage);
- }
- else
- {
- SourceColumn = Enode->Column + Enode->FilenameLength + 6 + 2;
- ErrorColumn = ASL_ERROR_LEVEL_LENGTH + 5 + 2 + 1;
+ MsgLength = strlen (MainMessage);
+ ExtraMessage = NULL;
+ }
- if ((MsgLength + ErrorColumn) < (SourceColumn - 1))
- {
- fprintf (OutputFile, "%*s%s",
- (int) ((SourceColumn - 1) - ErrorColumn),
- MainMessage, " ^ ");
- }
- else
- {
- fprintf (OutputFile, "%*s %s",
- (int) ((SourceColumn - ErrorColumn) + 1), "^",
- MainMessage);
- }
- }
+ if (Gbl_VerboseErrors && !PrematureEOF)
+ {
+ if (Total >= 256)
+ {
+ fprintf (OutputFile, " %s",
+ MainMessage);
+ }
+ else
+ {
+ SourceColumn = Enode->Column + Enode->FilenameLength + 6 + 2;
+ ErrorColumn = ASL_ERROR_LEVEL_LENGTH + 5 + 2 + 1;
+
+ if ((MsgLength + ErrorColumn) < (SourceColumn - 1))
+ {
+ fprintf (OutputFile, "%*s%s",
+ (int) ((SourceColumn - 1) - ErrorColumn),
+ MainMessage, " ^ ");
}
else
{
- fprintf (OutputFile, " %s", MainMessage);
+ fprintf (OutputFile, "%*s %s",
+ (int) ((SourceColumn - ErrorColumn) + 1), "^",
+ MainMessage);
}
+ }
+ }
+ else
+ {
+ fprintf (OutputFile, " %s", MainMessage);
+ }
- /* Print the extra info message if present */
+ /* Print the extra info message if present */
- if (ExtraMessage)
- {
- fprintf (OutputFile, " (%s)", ExtraMessage);
- }
+ if (ExtraMessage)
+ {
+ fprintf (OutputFile, " (%s)", ExtraMessage);
+ }
- if (PrematureEOF)
- {
- fprintf (OutputFile, " and premature End-Of-File");
- }
+ if (PrematureEOF)
+ {
+ fprintf (OutputFile, " and premature End-Of-File");
+ }
- fprintf (OutputFile, "\n");
- if (Gbl_VerboseErrors)
- {
- fprintf (OutputFile, "\n");
- }
- }
- else
- {
- fprintf (OutputFile, " %s %s\n\n", MainMessage, ExtraMessage);
- }
+ fprintf (OutputFile, "\n");
+ if (Gbl_VerboseErrors)
+ {
+ fprintf (OutputFile, "\n");
}
}
@@ -556,7 +539,7 @@ AePrintErrorLog (
void
AslCommonError2 (
UINT8 Level,
- UINT8 MessageId,
+ UINT16 MessageId,
UINT32 LineNumber,
UINT32 Column,
char *SourceLine,
@@ -642,7 +625,7 @@ AslCommonError2 (
void
AslCommonError (
UINT8 Level,
- UINT8 MessageId,
+ UINT16 MessageId,
UINT32 CurrentLineNumber,
UINT32 LogicalLineNumber,
UINT32 LogicalByteOffset,
@@ -776,7 +759,7 @@ AslDisableException (
BOOLEAN
AslIsExceptionDisabled (
UINT8 Level,
- UINT8 MessageId)
+ UINT16 MessageId)
{
UINT32 EncodedMessageId;
UINT32 i;
@@ -801,7 +784,7 @@ AslIsExceptionDisabled (
* Ignore this warning/remark if it has been disabled by
* the user (-vw option)
*/
- EncodedMessageId = MessageId + ((Level + 1) * 1000);
+ EncodedMessageId = AeBuildFullExceptionCode (Level, MessageId);
for (i = 0; i < Gbl_DisabledMessagesIndex; i++)
{
/* Simple implementation via fixed array */
@@ -840,7 +823,7 @@ AslIsExceptionDisabled (
void
AslError (
UINT8 Level,
- UINT8 MessageId,
+ UINT16 MessageId,
ACPI_PARSE_OBJECT *Op,
char *ExtraMessage)
{
OpenPOWER on IntegriCloud