aslerror.c (7648bc9fee8dec6cb3c4941e0165a930fbe8dcb0) aslerror.c (f9a6772ec354ef7acdcc3de0167e31461ab78a38)
1/******************************************************************************
2 *
3 * Module Name: aslerror - Error handling and statistics
4 *
5 *****************************************************************************/
6
7/******************************************************************************
8 *

--- 321 unchanged lines hidden (view full) ---

330
331/*******************************************************************************
332 *
333 * FUNCTION: AeDecodeErrorMessageId
334 *
335 * PARAMETERS: OutputFile - Output file
336 * Enode - Error node to print
337 * PrematureEOF - True = PrematureEOF has been reached
1/******************************************************************************
2 *
3 * Module Name: aslerror - Error handling and statistics
4 *
5 *****************************************************************************/
6
7/******************************************************************************
8 *

--- 321 unchanged lines hidden (view full) ---

330
331/*******************************************************************************
332 *
333 * FUNCTION: AeDecodeErrorMessageId
334 *
335 * PARAMETERS: OutputFile - Output file
336 * Enode - Error node to print
337 * PrematureEOF - True = PrematureEOF has been reached
338 * Total - Total legth of line
338 * Total - Total length of line
339 *
340 * RETURN: None
341 *
342 * DESCRIPTION: Print the source line of an error.
343 *
344 ******************************************************************************/
345
346static void

--- 93 unchanged lines hidden (view full) ---

440
441/*******************************************************************************
442 *
443 * FUNCTION: AePrintErrorSourceLine
444 *
445 * PARAMETERS: OutputFile - Output file
446 * Enode - Error node to print
447 * PrematureEOF - True = PrematureEOF has been reached
339 *
340 * RETURN: None
341 *
342 * DESCRIPTION: Print the source line of an error.
343 *
344 ******************************************************************************/
345
346static void

--- 93 unchanged lines hidden (view full) ---

440
441/*******************************************************************************
442 *
443 * FUNCTION: AePrintErrorSourceLine
444 *
445 * PARAMETERS: OutputFile - Output file
446 * Enode - Error node to print
447 * PrematureEOF - True = PrematureEOF has been reached
448 * Total - amount of characters printed so far
448 * Total - Number of characters printed so far
449 *
450 *
451 * RETURN: Status
452 *
453 * DESCRIPTION: Print the source line of an error.
454 *
455 ******************************************************************************/
456

--- 65 unchanged lines hidden (view full) ---

522 * and display it. Don't attempt this if we have a
523 * premature EOF condition.
524 */
525 if (*PrematureEOF)
526 {
527 fprintf (OutputFile, "\n");
528 return AE_OK;
529 }
449 *
450 *
451 * RETURN: Status
452 *
453 * DESCRIPTION: Print the source line of an error.
454 *
455 ******************************************************************************/
456

--- 65 unchanged lines hidden (view full) ---

522 * and display it. Don't attempt this if we have a
523 * premature EOF condition.
524 */
525 if (*PrematureEOF)
526 {
527 fprintf (OutputFile, "\n");
528 return AE_OK;
529 }
530
530 /*
531 * Seek to the offset in the combined source file,
532 * read the source line, and write it to the output.
533 */
534 Actual = fseek (SourceFile,
535 (long) Enode->LogicalByteOffset, (int) SEEK_SET);
536 if (Actual)
537 {

--- 7 unchanged lines hidden (view full) ---

545 RActual = fread (&SourceByte, 1, 1, SourceFile);
546 if (RActual != 1)
547 {
548 fprintf (OutputFile,
549 "[*** iASL: Read error on source code temp file %s ***]",
550 AslGbl_Files[ASL_FILE_SOURCE_OUTPUT].Filename);
551 return AE_IO_ERROR;
552 }
531 /*
532 * Seek to the offset in the combined source file,
533 * read the source line, and write it to the output.
534 */
535 Actual = fseek (SourceFile,
536 (long) Enode->LogicalByteOffset, (int) SEEK_SET);
537 if (Actual)
538 {

--- 7 unchanged lines hidden (view full) ---

546 RActual = fread (&SourceByte, 1, 1, SourceFile);
547 if (RActual != 1)
548 {
549 fprintf (OutputFile,
550 "[*** iASL: Read error on source code temp file %s ***]",
551 AslGbl_Files[ASL_FILE_SOURCE_OUTPUT].Filename);
552 return AE_IO_ERROR;
553 }
553 /* Read/write the source line, up to the maximum line length */
554
554
555 /* Read/write the source line, up to the maximum line length */
556
555 while (RActual && SourceByte && (SourceByte != '\n'))
556 {
557 if (*Total < 256)
558 {
559 /* After the max line length, we will just read the line, no write */
560
561 if (fwrite (&SourceByte, 1, 1, OutputFile) != 1)
562 {

--- 164 unchanged lines hidden (view full) ---

727 *
728 * FUNCTION: AePrintSubError
729 *
730 * PARAMETERS: OutputFile - Output file
731 * Enode - Error node to print
732 *
733 * RETURN: None
734 *
557 while (RActual && SourceByte && (SourceByte != '\n'))
558 {
559 if (*Total < 256)
560 {
561 /* After the max line length, we will just read the line, no write */
562
563 if (fwrite (&SourceByte, 1, 1, OutputFile) != 1)
564 {

--- 164 unchanged lines hidden (view full) ---

729 *
730 * FUNCTION: AePrintSubError
731 *
732 * PARAMETERS: OutputFile - Output file
733 * Enode - Error node to print
734 *
735 * RETURN: None
736 *
735 * DESCRIPTION: Print the contents of an error nodes. This function is tailored
737 * DESCRIPTION: Print the contents of an error node. This function is tailored
736 * to print error nodes that are SubErrors within ASL_ERROR_MSG
737 *
738 ******************************************************************************/
739
740static void
741AePrintSubError (
742 FILE *OutputFile,
743 ASL_ERROR_MSG *Enode)

--- 46 unchanged lines hidden (view full) ---

790 *
791 * PARAMETERS: InputEnode - Input Error node to initialize
792 * Level - Seriousness (Warning/error, etc.)
793 * MessageId - Index into global message buffer
794 * CurrentLineNumber - Actual file line number
795 * LogicalLineNumber - Cumulative line number
796 * LogicalByteOffset - Byte offset in source file
797 * Column - Column in current line
738 * to print error nodes that are SubErrors within ASL_ERROR_MSG
739 *
740 ******************************************************************************/
741
742static void
743AePrintSubError (
744 FILE *OutputFile,
745 ASL_ERROR_MSG *Enode)

--- 46 unchanged lines hidden (view full) ---

792 *
793 * PARAMETERS: InputEnode - Input Error node to initialize
794 * Level - Seriousness (Warning/error, etc.)
795 * MessageId - Index into global message buffer
796 * CurrentLineNumber - Actual file line number
797 * LogicalLineNumber - Cumulative line number
798 * LogicalByteOffset - Byte offset in source file
799 * Column - Column in current line
798 * Filename - source filename
799 * ExtraMessage - additional error message
800 * Filename - Source filename
801 * ExtraMessage - Additional error message
800 * SourceLine - Line of error source code
801 * SubError - SubError of this InputEnode
802 *
803 * RETURN: None
804 *
805 * DESCRIPTION: Initialize an Error node
806 *
807 ******************************************************************************/

--- 50 unchanged lines hidden (view full) ---

858 {
859 Enode->Filename = Filename;
860 Enode->FilenameLength = strlen (Filename);
861 if (Enode->FilenameLength < 6)
862 {
863 Enode->FilenameLength = 6;
864 }
865
802 * SourceLine - Line of error source code
803 * SubError - SubError of this InputEnode
804 *
805 * RETURN: None
806 *
807 * DESCRIPTION: Initialize an Error node
808 *
809 ******************************************************************************/

--- 50 unchanged lines hidden (view full) ---

860 {
861 Enode->Filename = Filename;
862 Enode->FilenameLength = strlen (Filename);
863 if (Enode->FilenameLength < 6)
864 {
865 Enode->FilenameLength = 6;
866 }
867
866 FileNode = FlGetCurrentFileNode ();
868 /*
869 * Attempt to get the file node of the filename listed in the parse
870 * node. If the name doesn't exist in the global file node, it is
871 * because the file is included by #include or ASL include. In this
872 * case, get the current file node. The source output of the current
873 * file will contain the contents of the file listed in the parse node.
874 */
875 FileNode = FlGetFileNode (ASL_FILE_INPUT, Filename);
867 if (!FileNode)
868 {
876 if (!FileNode)
877 {
869 return;
878 FileNode = FlGetCurrentFileNode ();
870 }
871
872 Enode->SourceFilename =
873 FileNode->Files[ASL_FILE_SOURCE_OUTPUT].Filename;
874 }
875}
876
877
878/*******************************************************************************
879 *
880 * FUNCTION: AslCommonError2
881 *
882 * PARAMETERS: Level - Seriousness (Warning/error, etc.)
883 * MessageId - Index into global message buffer
884 * LineNumber - Actual file line number
885 * Column - Column in current line
886 * SourceLine - Actual source code line
879 }
880
881 Enode->SourceFilename =
882 FileNode->Files[ASL_FILE_SOURCE_OUTPUT].Filename;
883 }
884}
885
886
887/*******************************************************************************
888 *
889 * FUNCTION: AslCommonError2
890 *
891 * PARAMETERS: Level - Seriousness (Warning/error, etc.)
892 * MessageId - Index into global message buffer
893 * LineNumber - Actual file line number
894 * Column - Column in current line
895 * SourceLine - Actual source code line
887 * Filename - source filename
888 * ExtraMessage - additional error message
896 * Filename - Source filename
897 * ExtraMessage - Additional error message
889 *
890 * RETURN: None
891 *
892 * DESCRIPTION: Create a new error node and add it to the error log
893 *
894 ******************************************************************************/
895
896void

--- 16 unchanged lines hidden (view full) ---

913 * FUNCTION: AslCommonError
914 *
915 * PARAMETERS: Level - Seriousness (Warning/error, etc.)
916 * MessageId - Index into global message buffer
917 * CurrentLineNumber - Actual file line number
918 * LogicalLineNumber - Cumulative line number
919 * LogicalByteOffset - Byte offset in source file
920 * Column - Column in current line
898 *
899 * RETURN: None
900 *
901 * DESCRIPTION: Create a new error node and add it to the error log
902 *
903 ******************************************************************************/
904
905void

--- 16 unchanged lines hidden (view full) ---

922 * FUNCTION: AslCommonError
923 *
924 * PARAMETERS: Level - Seriousness (Warning/error, etc.)
925 * MessageId - Index into global message buffer
926 * CurrentLineNumber - Actual file line number
927 * LogicalLineNumber - Cumulative line number
928 * LogicalByteOffset - Byte offset in source file
929 * Column - Column in current line
921 * Filename - source filename
922 * ExtraMessage - additional error message
930 * Filename - Source filename
931 * ExtraMessage - Additional error message
923 *
924 * RETURN: None
925 *
926 * DESCRIPTION: Create a new error node and add it to the error log
927 *
928 ******************************************************************************/
929
930void

--- 25 unchanged lines hidden (view full) ---

956 * FUNCTION: AslLogNewError
957 *
958 * PARAMETERS: Level - Seriousness (Warning/error, etc.)
959 * MessageId - Index into global message buffer
960 * CurrentLineNumber - Actual file line number
961 * LogicalLineNumber - Cumulative line number
962 * LogicalByteOffset - Byte offset in source file
963 * Column - Column in current line
932 *
933 * RETURN: None
934 *
935 * DESCRIPTION: Create a new error node and add it to the error log
936 *
937 ******************************************************************************/
938
939void

--- 25 unchanged lines hidden (view full) ---

965 * FUNCTION: AslLogNewError
966 *
967 * PARAMETERS: Level - Seriousness (Warning/error, etc.)
968 * MessageId - Index into global message buffer
969 * CurrentLineNumber - Actual file line number
970 * LogicalLineNumber - Cumulative line number
971 * LogicalByteOffset - Byte offset in source file
972 * Column - Column in current line
964 * Filename - source filename
965 * Message - additional error message
973 * Filename - Source filename
974 * Message - Additional error message
966 * SourceLine - Actual line of source code
967 * SubError - Sub-error associated with this error
968 *
969 * RETURN: None
970 *
971 * DESCRIPTION: Create a new error node and add it to the error log
972 *
973 ******************************************************************************/

--- 46 unchanged lines hidden (view full) ---

1020
1021/*******************************************************************************
1022 *
1023 * FUNCTION: GetModifiedLevel
1024 *
1025 * PARAMETERS: Level - Seriousness (Warning/error, etc.)
1026 * MessageId - Index into global message buffer
1027 *
975 * SourceLine - Actual line of source code
976 * SubError - Sub-error associated with this error
977 *
978 * RETURN: None
979 *
980 * DESCRIPTION: Create a new error node and add it to the error log
981 *
982 ******************************************************************************/

--- 46 unchanged lines hidden (view full) ---

1029
1030/*******************************************************************************
1031 *
1032 * FUNCTION: GetModifiedLevel
1033 *
1034 * PARAMETERS: Level - Seriousness (Warning/error, etc.)
1035 * MessageId - Index into global message buffer
1036 *
1028 * RETURN: UINT8 - modified level
1037 * RETURN: UINT8 - Modified level
1029 *
1030 * DESCRIPTION: Get the modified level of exception codes that are reported as
1031 * errors from the -ww option.
1032 *
1033 ******************************************************************************/
1034
1035static UINT8
1036GetModifiedLevel (

--- 327 unchanged lines hidden (view full) ---

1364 * FUNCTION: AslDualParseOpError
1365 *
1366 * PARAMETERS: Level - Seriousness (Warning/error, etc.)
1367 * MainMsgId - Index into global message buffer
1368 * MainOp - Parse node where error happened
1369 * MainMsg - Message pertaining to the MainOp
1370 * SubMsgId - Index into global message buffer
1371 * SubOp - Additional parse node for better message
1038 *
1039 * DESCRIPTION: Get the modified level of exception codes that are reported as
1040 * errors from the -ww option.
1041 *
1042 ******************************************************************************/
1043
1044static UINT8
1045GetModifiedLevel (

--- 327 unchanged lines hidden (view full) ---

1373 * FUNCTION: AslDualParseOpError
1374 *
1375 * PARAMETERS: Level - Seriousness (Warning/error, etc.)
1376 * MainMsgId - Index into global message buffer
1377 * MainOp - Parse node where error happened
1378 * MainMsg - Message pertaining to the MainOp
1379 * SubMsgId - Index into global message buffer
1380 * SubOp - Additional parse node for better message
1372 * SubMsg - Message pertainint to SubOp
1381 * SubMsg - Message pertaining to SubOp
1373 *
1374 *
1375 * RETURN: None
1376 *
1377 * DESCRIPTION: Main error reporting routine for the ASL compiler for error
1378 * messages that point to multiple parse objects.
1379 *
1380 ******************************************************************************/

--- 35 unchanged lines hidden (view full) ---

1416
1417/*******************************************************************************
1418 *
1419 * FUNCTION: AslError
1420 *
1421 * PARAMETERS: Level - Seriousness (Warning/error, etc.)
1422 * MessageId - Index into global message buffer
1423 * Op - Parse node where error happened
1382 *
1383 *
1384 * RETURN: None
1385 *
1386 * DESCRIPTION: Main error reporting routine for the ASL compiler for error
1387 * messages that point to multiple parse objects.
1388 *
1389 ******************************************************************************/

--- 35 unchanged lines hidden (view full) ---

1425
1426/*******************************************************************************
1427 *
1428 * FUNCTION: AslError
1429 *
1430 * PARAMETERS: Level - Seriousness (Warning/error, etc.)
1431 * MessageId - Index into global message buffer
1432 * Op - Parse node where error happened
1424 * ExtraMessage - additional error message
1433 * ExtraMessage - Additional error message
1425 *
1426 * RETURN: None
1427 *
1428 * DESCRIPTION: Main error reporting routine for the ASL compiler (all code
1429 * except the parser.)
1430 *
1431 ******************************************************************************/
1432

--- 21 unchanged lines hidden (view full) ---

1454
1455
1456/*******************************************************************************
1457 *
1458 * FUNCTION: AslCoreSubsystemError
1459 *
1460 * PARAMETERS: Op - Parse node where error happened
1461 * Status - The ACPICA Exception
1434 *
1435 * RETURN: None
1436 *
1437 * DESCRIPTION: Main error reporting routine for the ASL compiler (all code
1438 * except the parser.)
1439 *
1440 ******************************************************************************/
1441

--- 21 unchanged lines hidden (view full) ---

1463
1464
1465/*******************************************************************************
1466 *
1467 * FUNCTION: AslCoreSubsystemError
1468 *
1469 * PARAMETERS: Op - Parse node where error happened
1470 * Status - The ACPICA Exception
1462 * ExtraMessage - additional error message
1471 * ExtraMessage - Additional error message
1463 * Abort - TRUE -> Abort compilation
1464 *
1465 * RETURN: None
1466 *
1467 * DESCRIPTION: Error reporting routine for exceptions returned by the ACPICA
1468 * core subsystem.
1469 *
1470 ******************************************************************************/

--- 61 unchanged lines hidden ---
1472 * Abort - TRUE -> Abort compilation
1473 *
1474 * RETURN: None
1475 *
1476 * DESCRIPTION: Error reporting routine for exceptions returned by the ACPICA
1477 * core subsystem.
1478 *
1479 ******************************************************************************/

--- 61 unchanged lines hidden ---