Don't rely on inferior_ptid in record_full_wait
[deliverable/binutils-gdb.git] / gas / input-scrub.c
index f5f2af214a2424194ea4e581f20d0ea4da5896e1..df110d1b55283a7afd9d1bd1418abb908c693252 100644 (file)
@@ -1,5 +1,5 @@
 /* input_scrub.c - Break up input buffers into whole numbers of lines.
-   Copyright (C) 1987-2016 Free Software Foundation, Inc.
+   Copyright (C) 1987-2020 Free Software Foundation, Inc.
 
    This file is part of GAS, the GNU Assembler.
 
@@ -487,6 +487,23 @@ new_logical_line (const char *fname, int line_number)
 }
 
 \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 *
@@ -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);
 }
+
This page took 0.024 seconds and 4 git commands to generate.