aboutsummaryrefslogtreecommitdiff
path: root/gas/input-scrub.c
diff options
context:
space:
mode:
authorNick Clifton <nickc@redhat.com>2017-10-11 16:48:16 +0100
committerNick Clifton <nickc@redhat.com>2017-10-11 16:48:16 +0100
commit39865a7f420ab4ca4dec6ed27339618a5d5dc366 (patch)
treeec453548e1ba8bfa3eaafcd0dfe9b5466b6182f4 /gas/input-scrub.c
parentfe22022617a7122491aa83c893a10a8d861cde73 (diff)
downloadgdb-39865a7f420ab4ca4dec6ed27339618a5d5dc366.zip
gdb-39865a7f420ab4ca4dec6ed27339618a5d5dc366.tar.gz
gdb-39865a7f420ab4ca4dec6ed27339618a5d5dc366.tar.bz2
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.
Diffstat (limited to 'gas/input-scrub.c')
-rw-r--r--gas/input-scrub.c32
1 files changed, 20 insertions, 12 deletions
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);
}
+