diff options
Diffstat (limited to 'source/compiler/asllisting.c')
| -rw-r--r-- | source/compiler/asllisting.c | 41 | 
1 files changed, 33 insertions, 8 deletions
| diff --git a/source/compiler/asllisting.c b/source/compiler/asllisting.c index 5bf50e2d53716..4e7bb48d63376 100644 --- a/source/compiler/asllisting.c +++ b/source/compiler/asllisting.c @@ -5,7 +5,7 @@   *****************************************************************************/  /* - * Copyright (C) 2000 - 2012, Intel Corp. + * Copyright (C) 2000 - 2013, Intel Corp.   * All rights reserved.   *   * Redistribution and use in source and binary forms, with or without @@ -117,6 +117,8 @@ LsTreeWriteWalk (      UINT32                  Level,      void                    *Context); +#define ASL_LISTING_LINE_PREFIX         ":  " +  /*******************************************************************************   * @@ -665,7 +667,8 @@ LsWriteListingHexBytes (              {              case ASL_FILE_LISTING_OUTPUT: -                FlPrintFile (FileId, "%8.8X....", Gbl_CurrentAmlOffset); +                FlPrintFile (FileId, "%8.8X%s", Gbl_CurrentAmlOffset, +                    ASL_LISTING_LINE_PREFIX);                  break;              case ASL_FILE_ASM_SOURCE_OUTPUT: @@ -725,6 +728,24 @@ LsWriteOneSourceLine (      Gbl_SourceLine++;      Gbl_ListingNode->LineNumber++; +    /* Ignore lines that are completely blank (but count the line above) */ + +    if (FlReadFile (ASL_FILE_SOURCE_OUTPUT, &FileByte, 1) != AE_OK) +    { +        return (0); +    } +    if (FileByte == '\n') +    { +        return (1); +    } + +    /* +     * This is a non-empty line, we will print the entire line with +     * the line number and possibly other prefixes and transforms. +     */ + +    /* Line prefixes for special files, C and ASM output */ +      if (FileId == ASL_FILE_C_SOURCE_OUTPUT)      {          FlPrintFile (FileId, "     *"); @@ -740,19 +761,21 @@ LsWriteOneSourceLine (           * This file contains "include" statements, print the current           * filename and line number within the current file           */ -        FlPrintFile (FileId, "%12s %5d....", -                    Gbl_ListingNode->Filename, Gbl_ListingNode->LineNumber); +        FlPrintFile (FileId, "%12s %5d%s", +            Gbl_ListingNode->Filename, Gbl_ListingNode->LineNumber, +            ASL_LISTING_LINE_PREFIX);      }      else      {          /* No include files, just print the line number */ -        FlPrintFile (FileId, "%8d....", Gbl_SourceLine); +        FlPrintFile (FileId, "%8u%s", Gbl_SourceLine, +            ASL_LISTING_LINE_PREFIX);      } -    /* Read one line (up to a newline or EOF) */ +    /* Read the rest of this line (up to a newline or EOF) */ -    while (FlReadFile (ASL_FILE_SOURCE_OUTPUT, &FileByte, 1) == AE_OK) +    do      {          if (FileId == ASL_FILE_C_SOURCE_OUTPUT)          { @@ -766,13 +789,15 @@ LsWriteOneSourceLine (          if (FileByte == '\n')          {              /* +             * This line has been completed.               * Check if an error occurred on this source line during the compile.               * If so, we print the error message after the source line.               */              LsCheckException (Gbl_SourceLine, FileId);              return (1);          } -    } + +    } while (FlReadFile (ASL_FILE_SOURCE_OUTPUT, &FileByte, 1) == AE_OK);      /* EOF on the input file was reached */ | 
