Fix dwarf2_string_attr for -gsplit-dwarf
Commit Message
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/ChangeLog:
* dwarf2read.c (dwarf2_string_attr): Allow DW_FORM_GNU_strp_alt.
(cherry picked from commits 16eb6b2db49e6cf2fdca56efd37689fcc170cd37 and
b33404388e5bbd8a1fddfde73cd4593ae2b557e8)
---
gdb/ChangeLog | 4 ++++
gdb/dwarf2read.c | 4 +++-
2 files changed, 7 insertions(+), 1 deletion(-)
Comments
"Leszek Swirski via gdb-patches" <gdb-patches@sourceware.org> writes:
> gdb/ChangeLog:
>
> * dwarf2read.c (dwarf2_string_attr): Allow DW_FORM_GNU_strp_alt.
s/DW_FORM_GNU_strp_alt/DW_FORM_GNU_str_index
Otherwise, patch is good to me.
On 2017-10-25 05:24, Leszek Swirski via gdb-patches wrote:
> 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/ChangeLog:
>
> * dwarf2read.c (dwarf2_string_attr): Allow DW_FORM_GNU_strp_alt.
>
> (cherry picked from commits 16eb6b2db49e6cf2fdca56efd37689fcc170cd37
> and
> b33404388e5bbd8a1fddfde73cd4593ae2b557e8)
> ---
> gdb/ChangeLog | 4 ++++
> gdb/dwarf2read.c | 4 +++-
> 2 files changed, 7 insertions(+), 1 deletion(-)
Hi Leszek,
It's not mentioned, but from the context of the ChangeLog change, I
understand this is for the 8.0 branch? 8.0.1 was already released, and
I don't know if there are plans for a 8.0.2. But in any case,
cherry-picking this fix doesn't hurt for anybody building from the
gdb-8.0-branch.
Thanks,
Simon
> It's not mentioned, but from the context of the ChangeLog change, I
> understand this is for the 8.0 branch? 8.0.1 was already released, and I
> don't know if there are plans for a 8.0.2. But in any case, cherry-picking
> this fix doesn't hurt for anybody building from the gdb-8.0-branch.
Yes, sorry, I should have made that clearer.
On 2017-10-25 11:27, Leszek Swirski via gdb-patches wrote:
>> It's not mentioned, but from the context of the ChangeLog change, I
>> understand this is for the 8.0 branch? 8.0.1 was already released,
>> and I
>> don't know if there are plans for a 8.0.2. But in any case,
>> cherry-picking
>> this fix doesn't hurt for anybody building from the gdb-8.0-branch.
>
> Yes, sorry, I should have made that clearer.
I pushed the patch and added a reference to the original PR in the
ChangeLog.
Thanks!
Simon
> I pushed the patch and added a reference to the original PR in the
> ChangeLog.
Thanks Simon.
@@ -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
@@ -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,