[PATCH v2 2/4] DWARF 5 support: Handle DW_FORM_strx
authorAli Tamur <tamur@google.com>
Tue, 27 Aug 2019 01:40:18 +0000 (18:40 -0700)
committerAli Tamur <tamur@google.com>
Tue, 1 Oct 2019 01:00:41 +0000 (18:00 -0700)
* Handle DW_FORM_strx forms everywhere.

Tested with CC=/usr/bin/gcc (version 8.3.0) against master branch (also with
-gsplit-dwarf and -gdwarf-4 flags) and there was no increase in the set of
tests that fails.

This is part of an effort to support DWARF 5 in gdb.

gdb/ChangeLog:

        * dwarf2read.c (skip_one_die): Handle DW_FORM_strx forms.
        (dwarf2_string_attr): Likewise.

gdb/ChangeLog
gdb/dwarf2read.c

index a096cae2dab50867e0b053c740c1dca3e6a56833..1be7f4b2f6ec77ca32cddf8ec8bfaf928dd6fb03 100644 (file)
@@ -1,3 +1,8 @@
+2019-09-30  Ali Tamur <tamur@google.com>
+
+       * dwarf2read.c (skip_one_die): Handle DW_FORM_strx forms.
+       (dwarf2_string_attr): Likewise.
+
 2019-09-30  Ali Tamur <tamur@google.com>
 
        * dwarf2read.c (process_full_comp_unit): Remove whitespace at the EOL.
index 0f4f36682c776b56003d1ab88f88e89656e777d9..53e7393a7c92b2fc0136777cbae18395a7ae35ca 100644 (file)
@@ -9336,6 +9336,7 @@ skip_one_die (const struct die_reader_specs *reader, const gdb_byte *info_ptr,
        case DW_FORM_data1:
        case DW_FORM_ref1:
        case DW_FORM_flag:
+       case DW_FORM_strx1:
          info_ptr += 1;
          break;
        case DW_FORM_flag_present:
@@ -9343,10 +9344,15 @@ skip_one_die (const struct die_reader_specs *reader, const gdb_byte *info_ptr,
          break;
        case DW_FORM_data2:
        case DW_FORM_ref2:
+       case DW_FORM_strx2:
          info_ptr += 2;
          break;
+       case DW_FORM_strx3:
+         info_ptr += 3;
+         break;
        case DW_FORM_data4:
        case DW_FORM_ref4:
+       case DW_FORM_strx4:
          info_ptr += 4;
          break;
        case DW_FORM_data8:
@@ -20168,6 +20174,10 @@ dwarf2_string_attr (struct die_info *die, unsigned int name, struct dwarf2_cu *c
       if (attr->form == DW_FORM_strp || attr->form == DW_FORM_line_strp
          || attr->form == DW_FORM_string
          || attr->form == DW_FORM_strx
+         || attr->form == DW_FORM_strx1
+         || attr->form == DW_FORM_strx2
+         || attr->form == DW_FORM_strx3
+         || attr->form == DW_FORM_strx4
          || attr->form == DW_FORM_GNU_str_index
          || attr->form == DW_FORM_GNU_strp_alt)
        str = DW_STRING (attr);