[PATCH] Fix dwarf2_string_attr for -gsplit-dwarf

Leszek Swirski via gdb-patches gdb-patches@sourceware.org
Tue Aug 1 09:20:00 GMT 2017


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.

gdb/doc/ChangeLog:

	* dwarf2read.c: Fix dwarf2_string_attr to allow
	DW_FORM_GNU_str_index
---
 gdb/dwarf2read.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c
index 2c2ecda7fc..f5bed09116 100644
--- a/gdb/dwarf2read.c
+++ b/gdb/dwarf2read.c
@@ -17623,7 +17623,8 @@ 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 || DW_FORM_GNU_str_index
+          || attr->form == DW_FORM_GNU_strp_alt)
 	str = DW_STRING (attr);
       else
         complaint (&symfile_complaints,
-- 
2.14.0.rc0.400.g1c36432dff-goog



More information about the Gdb-patches mailing list