[gcc(refs/vendors/redhat/heads/gcc-8-branch)] backport: re PR debug/92664 (Wrong .debug_line section information when compiling stdin input with -

Jakub Jelinek jakub@gcc.gnu.org
Thu Sep 17 16:39:36 GMT 2020


https://gcc.gnu.org/g:99fc0bc7b4628fe415e61e4be2bcebbb1b503967

commit 99fc0bc7b4628fe415e61e4be2bcebbb1b503967
Author: Jakub Jelinek <jakub@redhat.com>
Date:   Fri Feb 14 12:49:07 2020 +0100

    backport: re PR debug/92664 (Wrong .debug_line section information when compiling stdin input with -g3)
    
            Backported from mainline
            2019-11-27  Jakub Jelinek  <jakub@redhat.com>
    
            PR debug/92664
            * dwarf2out.c (lookup_filename): Use "<stdin>" instead of "".

Diff:
---
 gcc/ChangeLog   | 7 +++++++
 gcc/dwarf2out.c | 3 +++
 2 files changed, 10 insertions(+)

diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 85caceabfb6..a956570933d 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,6 +1,13 @@
 2020-02-14  Jakub Jelinek  <jakub@redhat.com>
 
 	Backported from mainline
+	2019-11-27  Jakub Jelinek  <jakub@redhat.com>
+
+	PR debug/92664
+	* dwarf2out.c (lookup_filename): Use "<stdin>" instead of "".
+
+2020-02-14  Jakub Jelinek  <jakub@redhat.com>
+
 	2019-11-23  Jakub Jelinek  <jakub@redhat.com>
 
 	PR target/92615
diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c
index 0d67d303eb7..ab01f7dbcae 100644
--- a/gcc/dwarf2out.c
+++ b/gcc/dwarf2out.c
@@ -26999,6 +26999,9 @@ lookup_filename (const char *file_name)
   if (!file_name)
     return NULL;
 
+  if (!file_name[0])
+    file_name = "<stdin>";
+
   dwarf_file_data **slot
     = file_table->find_slot_with_hash (file_name, htab_hash_string (file_name),
 				       INSERT);


More information about the Gcc-cvs mailing list