+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
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);
}
\f
+/* 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 *
*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);
}
+
}
#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