This is the mail archive of the binutils-cvs@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[binutils-gdb] Disable the inclusion of logical input files in the assembler listing output unless high level sourc


https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=39865a7f420ab4ca4dec6ed27339618a5d5dc366

commit 39865a7f420ab4ca4dec6ed27339618a5d5dc366
Author: Nick Clifton <nickc@redhat.com>
Date:   Wed Oct 11 16:48:16 2017 +0100

    Disable the inclusion of logical input files in the assembler listing output unless high level source listing has been enabled.
    
    	PR 21977
    	* listing.c (listing_newline): Use the name of the current
    	physical input file, rather than the current logical input file,
    	unless including high level source in the listing.
    	* input-scrub.c (as_where_physical): New function.  Returns the
    	name of the current physical input file.
    	* as.h: Add prototype for as_where_physical.

Diff:
---
 gas/ChangeLog     | 10 ++++++++++
 gas/as.h          |  1 +
 gas/input-scrub.c | 32 ++++++++++++++++++++------------
 gas/listing.c     |  8 +++++++-
 4 files changed, 38 insertions(+), 13 deletions(-)

diff --git a/gas/ChangeLog b/gas/ChangeLog
index 95932c2..67b789d 100644
--- a/gas/ChangeLog
+++ b/gas/ChangeLog
@@ -1,3 +1,13 @@
+2017-10-11  Nick Clifton  <nickc@redhat.com>
+
+	PR 21977
+	* listing.c (listing_newline): Use the name of the current
+	physical input file, rather than the current logical input file,
+	unless including high level source in the listing.
+	* input-scrub.c (as_where_physical): New function.  Returns the
+	name of the current physical input file.
+	* as.h: Add prototype for as_where_physical.
+
 2017-10-09  Andreas Krebbel  <krebbel@linux.vnet.ibm.com>
 
 	* testsuite/gas/s390/zarch-arch12.d (prno, tpei, irbm): New
diff --git a/gas/as.h b/gas/as.h
index fee7c75..5e9dcea 100644
--- a/gas/as.h
+++ b/gas/as.h
@@ -486,6 +486,7 @@ void   cond_exit_macro (int);
 int    seen_at_least_1_file (void);
 void   app_pop (char *);
 const char * as_where (unsigned int *);
+const char * as_where_physical (unsigned int *);
 void   bump_line_counters (void);
 void   do_scrub_begin (int);
 void   input_scrub_begin (void);
diff --git a/gas/input-scrub.c b/gas/input-scrub.c
index 5e57c2c..6222154 100644
--- a/gas/input-scrub.c
+++ b/gas/input-scrub.c
@@ -487,6 +487,23 @@ new_logical_line (const char *fname, int line_number)
 }
 
 
+/* Return the current physical input file name and line number, if known  */
+
+const char *
+as_where_physical (unsigned int *linep)
+{
+  if (physical_input_file != NULL)
+    {
+      if (linep != NULL)
+	*linep = physical_input_line;
+      return physical_input_file;
+    }
+
+  if (linep != NULL)
+    *linep = 0;
+  return NULL;
+}
+
 /* Return the current file name and line number.  */
 
 const char *
@@ -499,16 +516,7 @@ as_where (unsigned int *linep)
 	*linep = logical_input_line;
       return logical_input_file;
     }
-  else if (physical_input_file != NULL)
-    {
-      if (linep != NULL)
-	*linep = physical_input_line;
-      return physical_input_file;
-    }
-  else
-    {
-      if (linep != NULL)
-	*linep = 0;
-      return NULL;
-    }
+
+  return as_where_physical (linep);
 }
+
diff --git a/gas/listing.c b/gas/listing.c
index 18c6e3b..31eae98 100644
--- a/gas/listing.c
+++ b/gas/listing.c
@@ -324,7 +324,13 @@ listing_newline (char *ps)
     }
 #endif
 
-  file = as_where (&line);
+  /* PR 21977 - use the physical file name not the logical one unless high
+     level source files are being included in the listing.  */
+  if (listing & LISTING_HLL)
+    file = as_where (&line);
+  else
+    file = as_where_physical (&line);
+
   if (ps == NULL)
     {
       if (line == last_line


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]