~ubuntu-branches/ubuntu/wily/fwts/wily

« back to all changes in this revision

Viewing changes to src/acpica/source/compiler/aslerror.c

  • Committer: Package Import Robot
  • Author(s): Ivan Hu, Colin Ian King, Keng-Yu Lin
  • Date: 2014-06-18 10:20:44 UTC
  • mfrom: (34.2.17)
  • Revision ID: package-import@ubuntu.com-20140618102044-njbyt477zf2kqh59
Tags: 14.06.00-0ubuntu0
[Colin Ian King]
* lib: fwts_framework: change fwts-live progress feedback (LP: #1321664)
* cpu: cpufreq: add more granularity to progress feedback
* acpi: fan: add more granularity to progress feedback
* acpi: acpidump: remove duplicate consts
* live-image: save various system and firmware data at end of test
  (LP: #1322543)
* cpu: cpufreq: add more precision to GHz CPU frequency information
* cpu: cpufreq: print MHz as float, remove erroneous rounding
* cpu: cpufreq: show Turbo Boost with top _PSS value
* cpu: cpufreq: sort frequencies using almost equal comparison (LP: #1322531)
* acpica: update to version 20140424 (LP: #1312351)
* Add support for ACPI 1.0 GUID
* live-image: Add UEFI tests to the run all batch tests menu item
  (LP: #1322545)
* fwts-test: arg-show-progress-dialog-0001: fix armhf failures
* fwts-test: arg-show-progress-dialog-0001: fix armhf failures, for test-0002

[Keng-Yu Lin]
* debian: add watch file
* fwts-test: arg-show-progress-dialog: sync with fwts

Show diffs side-by-side

added added

removed removed

Lines of Context:
113
113
 *
114
114
 *****************************************************************************/
115
115
 
116
 
#define ASL_EXCEPTIONS
117
116
#include "aslcompiler.h"
118
117
 
119
118
#define _COMPONENT          ACPI_COMPILER
276
275
    int                     Actual;
277
276
    size_t                  RActual;
278
277
    UINT32                  MsgLength;
279
 
    char                    *MainMessage;
 
278
    const char              *MainMessage;
280
279
    char                    *ExtraMessage;
281
280
    UINT32                  SourceColumn;
282
281
    UINT32                  ErrorColumn;
471
470
        }
472
471
    }
473
472
 
474
 
    /* NULL message ID, just print the raw message */
 
473
    /* If a NULL message ID, just print the raw message */
475
474
 
476
475
    if (Enode->MessageId == 0)
477
476
    {
478
477
        fprintf (OutputFile, "%s\n", Enode->Message);
479
 
    }
480
 
    else
481
 
    {
482
 
        /* Decode the message ID */
483
 
 
484
 
        if (Gbl_VerboseErrors)
485
 
        {
486
 
            fprintf (OutputFile, "%s %4.4d -",
487
 
                        AslErrorLevel[Enode->Level],
488
 
                        Enode->MessageId + ((Enode->Level+1) * 1000));
489
 
        }
490
 
        else /* IDE case */
491
 
        {
492
 
            fprintf (OutputFile, "%s %4.4d:",
493
 
                        AslErrorLevelIde[Enode->Level],
494
 
                        Enode->MessageId + ((Enode->Level+1) * 1000));
495
 
        }
496
 
 
497
 
        MainMessage = AslMessages[Enode->MessageId];
498
 
        ExtraMessage = Enode->Message;
499
 
 
500
 
        if (Enode->LineNumber)
501
 
        {
502
 
            /* Main message: try to use string from AslMessages first */
503
 
 
504
 
            if (!MainMessage)
505
 
            {
506
 
                MainMessage = "";
507
 
            }
508
 
 
509
 
            MsgLength = strlen (MainMessage);
510
 
            if (MsgLength == 0)
511
 
            {
512
 
                /* Use the secondary/extra message as main message */
513
 
 
514
 
                MainMessage = Enode->Message;
515
 
                if (!MainMessage)
516
 
                {
517
 
                    MainMessage = "";
518
 
                }
519
 
 
520
 
                MsgLength = strlen (MainMessage);
521
 
                ExtraMessage = NULL;
522
 
            }
523
 
 
524
 
            if (Gbl_VerboseErrors && !PrematureEOF)
525
 
            {
526
 
                if (Total >= 256)
527
 
                {
528
 
                    fprintf (OutputFile, "    %s",
529
 
                        MainMessage);
530
 
                }
531
 
                else
532
 
                {
533
 
                    SourceColumn = Enode->Column + Enode->FilenameLength + 6 + 2;
534
 
                    ErrorColumn = ASL_ERROR_LEVEL_LENGTH + 5 + 2 + 1;
535
 
 
536
 
                    if ((MsgLength + ErrorColumn) < (SourceColumn - 1))
537
 
                    {
538
 
                        fprintf (OutputFile, "%*s%s",
539
 
                            (int) ((SourceColumn - 1) - ErrorColumn),
540
 
                            MainMessage, " ^ ");
541
 
                    }
542
 
                    else
543
 
                    {
544
 
                        fprintf (OutputFile, "%*s %s",
545
 
                            (int) ((SourceColumn - ErrorColumn) + 1), "^",
546
 
                            MainMessage);
547
 
                    }
548
 
                }
 
478
        return;
 
479
    }
 
480
 
 
481
    /* Decode the message ID */
 
482
 
 
483
    fprintf (OutputFile, "%s %4.4d -",
 
484
        AeDecodeExceptionLevel (Enode->Level),
 
485
        AeBuildFullExceptionCode (Enode->Level, Enode->MessageId));
 
486
 
 
487
    MainMessage = AeDecodeMessageId (Enode->MessageId);
 
488
    ExtraMessage = Enode->Message;
 
489
 
 
490
    /* If a NULL line number, just print the decoded message */
 
491
 
 
492
    if (!Enode->LineNumber)
 
493
    {
 
494
        fprintf (OutputFile, " %s %s\n\n", MainMessage, ExtraMessage);
 
495
        return;
 
496
    }
 
497
 
 
498
    MsgLength = strlen (MainMessage);
 
499
    if (MsgLength == 0)
 
500
    {
 
501
        /* Use the secondary/extra message as main message */
 
502
 
 
503
        MainMessage = Enode->Message;
 
504
        if (!MainMessage)
 
505
        {
 
506
            MainMessage = "";
 
507
        }
 
508
 
 
509
        MsgLength = strlen (MainMessage);
 
510
        ExtraMessage = NULL;
 
511
    }
 
512
 
 
513
    if (Gbl_VerboseErrors && !PrematureEOF)
 
514
    {
 
515
        if (Total >= 256)
 
516
        {
 
517
            fprintf (OutputFile, "    %s",
 
518
                MainMessage);
 
519
        }
 
520
        else
 
521
        {
 
522
            SourceColumn = Enode->Column + Enode->FilenameLength + 6 + 2;
 
523
            ErrorColumn = ASL_ERROR_LEVEL_LENGTH + 5 + 2 + 1;
 
524
 
 
525
            if ((MsgLength + ErrorColumn) < (SourceColumn - 1))
 
526
            {
 
527
                fprintf (OutputFile, "%*s%s",
 
528
                    (int) ((SourceColumn - 1) - ErrorColumn),
 
529
                    MainMessage, " ^ ");
549
530
            }
550
531
            else
551
532
            {
552
 
                fprintf (OutputFile, " %s", MainMessage);
553
 
            }
554
 
 
555
 
            /* Print the extra info message if present */
556
 
 
557
 
            if (ExtraMessage)
558
 
            {
559
 
                fprintf (OutputFile, " (%s)", ExtraMessage);
560
 
            }
561
 
 
562
 
            if (PrematureEOF)
563
 
            {
564
 
                fprintf (OutputFile, " and premature End-Of-File");
565
 
            }
566
 
 
567
 
            fprintf (OutputFile, "\n");
568
 
            if (Gbl_VerboseErrors)
569
 
            {
570
 
                fprintf (OutputFile, "\n");
571
 
            }
572
 
        }
573
 
        else
574
 
        {
575
 
            fprintf (OutputFile, " %s %s\n\n", MainMessage, ExtraMessage);
576
 
        }
 
533
                fprintf (OutputFile, "%*s %s",
 
534
                    (int) ((SourceColumn - ErrorColumn) + 1), "^",
 
535
                    MainMessage);
 
536
            }
 
537
        }
 
538
    }
 
539
    else
 
540
    {
 
541
        fprintf (OutputFile, " %s", MainMessage);
 
542
    }
 
543
 
 
544
    /* Print the extra info message if present */
 
545
 
 
546
    if (ExtraMessage)
 
547
    {
 
548
        fprintf (OutputFile, " (%s)", ExtraMessage);
 
549
    }
 
550
 
 
551
    if (PrematureEOF)
 
552
    {
 
553
        fprintf (OutputFile, " and premature End-Of-File");
 
554
    }
 
555
 
 
556
    fprintf (OutputFile, "\n");
 
557
    if (Gbl_VerboseErrors)
 
558
    {
 
559
        fprintf (OutputFile, "\n");
577
560
    }
578
561
}
579
562
 
628
611
void
629
612
AslCommonError2 (
630
613
    UINT8                   Level,
631
 
    UINT8                   MessageId,
 
614
    UINT16                  MessageId,
632
615
    UINT32                  LineNumber,
633
616
    UINT32                  Column,
634
617
    char                    *SourceLine,
714
697
void
715
698
AslCommonError (
716
699
    UINT8                   Level,
717
 
    UINT8                   MessageId,
 
700
    UINT16                  MessageId,
718
701
    UINT32                  CurrentLineNumber,
719
702
    UINT32                  LogicalLineNumber,
720
703
    UINT32                  LogicalByteOffset,
848
831
BOOLEAN
849
832
AslIsExceptionDisabled (
850
833
    UINT8                   Level,
851
 
    UINT8                   MessageId)
 
834
    UINT16                  MessageId)
852
835
{
853
836
    UINT32                  EncodedMessageId;
854
837
    UINT32                  i;
873
856
         * Ignore this warning/remark if it has been disabled by
874
857
         * the user (-vw option)
875
858
         */
876
 
        EncodedMessageId = MessageId + ((Level + 1) * 1000);
 
859
        EncodedMessageId = AeBuildFullExceptionCode (Level, MessageId);
877
860
        for (i = 0; i < Gbl_DisabledMessagesIndex; i++)
878
861
        {
879
862
            /* Simple implementation via fixed array */
912
895
void
913
896
AslError (
914
897
    UINT8                   Level,
915
 
    UINT8                   MessageId,
 
898
    UINT16                  MessageId,
916
899
    ACPI_PARSE_OBJECT       *Op,
917
900
    char                    *ExtraMessage)
918
901
{