9,7 → 9,7 |
* |
* 1. Copyright Notice |
* |
* Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. |
* Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp. |
* All rights reserved. |
* |
* 2. License |
241,6 → 241,8 |
UINT32 ErrorColumn; |
FILE *OutputFile; |
FILE *SourceFile; |
long FileSize; |
BOOLEAN PrematureEOF = FALSE; |
|
|
if (Gbl_NoErrors) |
280,8 → 282,28 |
/* Get the file handles */ |
|
OutputFile = Gbl_Files[FileId].Handle; |
|
/* Use the merged header/source file if present, otherwise use input file */ |
|
SourceFile = Gbl_Files[ASL_FILE_SOURCE_OUTPUT].Handle; |
if (!SourceFile) |
{ |
SourceFile = Gbl_Files[ASL_FILE_INPUT].Handle; |
} |
|
if (SourceFile) |
{ |
/* Determine if the error occurred at source file EOF */ |
|
fseek (SourceFile, 0, SEEK_END); |
FileSize = ftell (SourceFile); |
|
if ((long) Enode->LogicalByteOffset >= FileSize) |
{ |
PrematureEOF = TRUE; |
} |
} |
|
if (Header) |
{ |
fprintf (OutputFile, "%s", Header); |
300,9 → 322,16 |
fprintf (OutputFile, "%6u: ", Enode->LineNumber); |
|
/* |
* Seek to the offset in the combined source file, read the source |
* line, and write it to the output. |
* If not at EOF, get the corresponding source code line and |
* display it. Don't attempt this if we have a premature EOF |
* condition. |
*/ |
if (!PrematureEOF) |
{ |
/* |
* Seek to the offset in the combined source file, read |
* the source line, and write it to the output. |
*/ |
Actual = fseek (SourceFile, (long) Enode->LogicalByteOffset, |
(int) SEEK_SET); |
if (Actual) |
327,6 → 356,8 |
RActual = fread (&SourceByte, 1, 1, SourceFile); |
} |
} |
} |
|
fprintf (OutputFile, "\n"); |
} |
} |
369,7 → 400,7 |
ExtraMessage = NULL; |
} |
|
if (Gbl_VerboseErrors) |
if (Gbl_VerboseErrors && !PrematureEOF) |
{ |
SourceColumn = Enode->Column + Enode->FilenameLength + 6 + 2; |
ErrorColumn = ASL_ERROR_LEVEL_LENGTH + 5 + 2 + 1; |
399,6 → 430,11 |
fprintf (OutputFile, " (%s)", ExtraMessage); |
} |
|
if (PrematureEOF) |
{ |
fprintf (OutputFile, " and premature End-Of-File"); |
} |
|
fprintf (OutputFile, "\n"); |
if (Gbl_VerboseErrors) |
{ |
656,13 → 692,13 |
|
int |
AslCompilererror ( |
char *CompilerMessage) |
const char *CompilerMessage) |
{ |
|
AslCommonError (ASL_ERROR, ASL_MSG_SYNTAX, Gbl_CurrentLineNumber, |
Gbl_LogicalLineNumber, Gbl_CurrentLineOffset, |
Gbl_CurrentColumn, Gbl_Files[ASL_FILE_INPUT].Filename, |
CompilerMessage); |
ACPI_CAST_PTR (char, CompilerMessage)); |
|
return 0; |
} |