summaryrefslogtreecommitdiff
path: root/source/compiler/asllisting.c
diff options
context:
space:
mode:
authorJung-uk Kim <jkim@FreeBSD.org>2013-01-17 21:32:03 +0000
committerJung-uk Kim <jkim@FreeBSD.org>2013-01-17 21:32:03 +0000
commitee39d6d85cfcfa8e856c410c0ad4cd96e8fded55 (patch)
tree4bd397d55198bfd01fc6744430f25faf08f18b0c /source/compiler/asllisting.c
parentb28e481ae9b051dab150e9b5a89730cdc1103a9c (diff)
Notes
Diffstat (limited to 'source/compiler/asllisting.c')
-rw-r--r--source/compiler/asllisting.c41
1 files changed, 33 insertions, 8 deletions
diff --git a/source/compiler/asllisting.c b/source/compiler/asllisting.c
index 5bf50e2d5371..4e7bb48d6337 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 */