This is the mail archive of the gdb-cvs@sourceware.org mailing list for the GDB 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/gdb-8.0-branch] Fix dwarf2_string_attr for -gsplit-dwarf


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

commit 06848393c68c1b370cf2441756ed7413f4442515
Author: Leszek Swirski <leszeks@google.com>
Date:   Thu Oct 26 19:19:33 2017 -0400

    Fix dwarf2_string_attr for -gsplit-dwarf
    
    The dwarf2_string_attr did not allow DW_FORM_GNU_str_index as a form for
    string types. This manifested as null strings in the namespace_name
    lookup (replaced with "(anonymous namespace)") when debugging
    Fission-compiled code.
    
    (cherry picked from commits 16eb6b2db49e6cf2fdca56efd37689fcc170cd37 and
    b33404388e5bbd8a1fddfde73cd4593ae2b557e8)
    
    gdb/ChangeLog:
    
    	PR symtab/20899
    	* dwarf2read.c (dwarf2_string_attr): Allow DW_FORM_GNU_str_index.

Diff:
---
 gdb/ChangeLog    | 4 ++++
 gdb/dwarf2read.c | 4 +++-
 2 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index b77435c..bfa2359 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,7 @@
+2017-10-25  Leszek Swirski  <leszeks@google.com>
+
+	* dwarf2read.c (dwarf2_string_attr): Allow DW_FORM_GNU_str_index.
+
 2017-10-16  Walfred Tedeschi  <walfred.tedeschi@intel.com>
 
 	* features/Makefile (i386-avx-mpx-avx512-pku.dat): Add backslash 
diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c
index 8503e61..93ec587 100644
--- a/gdb/dwarf2read.c
+++ b/gdb/dwarf2read.c
@@ -17577,7 +17577,9 @@ dwarf2_string_attr (struct die_info *die, unsigned int name, struct dwarf2_cu *c
   if (attr != NULL)
     {
       if (attr->form == DW_FORM_strp || attr->form == DW_FORM_line_strp
-	  || attr->form == DW_FORM_string || attr->form == DW_FORM_GNU_strp_alt)
+	  || attr->form == DW_FORM_string
+	  || attr->form == DW_FORM_GNU_str_index
+	  || attr->form == DW_FORM_GNU_strp_alt)
 	str = DW_STRING (attr);
       else
         complaint (&symfile_complaints,


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