[gdb/symtab] Handle DW_FORM_strx in form_requires_reprocessing
authorTom de Vries <tdevries@suse.de>
Thu, 11 Feb 2021 20:03:03 +0000 (21:03 +0100)
committerTom de Vries <tdevries@suse.de>
Thu, 11 Feb 2021 20:03:03 +0000 (21:03 +0100)
When running test-case gdb.dwarf2/fission-mix.exp using gcc-11, I run into:
...
(gdb) file fission-mix^M
Reading symbols from fission-mix...^M
src/gdb/dwarf2/attribute.h:258: internal-error: \
  void attribute::set_unsigned_reprocess(ULONGEST): \
  Assertion `form_requires_reprocessing ()' failed.^M
...

This happens when calling set_unsigned_reprocess on an attribute with form
DW_FORM_strx.  The assert triggers because DW_FORM_strx is not listed in
form_requires_reprocessing.

Fix this by adding DW_FORM_strx in form_requires_reprocessing.

Tested on x86_64-linux.

gdb/ChangeLog:

2021-02-11  Tom de Vries  <tdevries@suse.de>

PR symtab/27353
* dwarf2/attribute.c (attribute::form_requires_reprocessing):
Return true for DW_FORM_strx.

gdb/ChangeLog
gdb/dwarf2/attribute.c

index 4d0033de625e17ce009522f399afc0a7fc6a06e6..ff44b8b66787a0bd5f71f380072b578a8134bd66 100644 (file)
@@ -1,3 +1,9 @@
+2021-02-11  Tom de Vries  <tdevries@suse.de>
+
+       PR symtab/27353
+       * dwarf2/attribute.c (attribute::form_requires_reprocessing):
+       Return true for DW_FORM_strx.
+
 2021-02-11  Tom Tromey  <tromey@adacore.com>
 
        PR gdb/27383:
index b4f188a096e1c991e161eeb44e127c7d3ed154e5..3205b0f7d29af5401fe62395e1330ba8ce1ef0a2 100644 (file)
@@ -192,7 +192,8 @@ attribute::form_is_unsigned () const
 bool
 attribute::form_requires_reprocessing () const
 {
-  return (form == DW_FORM_strx1
+  return (form == DW_FORM_strx
+         || form == DW_FORM_strx1
          || form == DW_FORM_strx2
          || form == DW_FORM_strx3
          || form == DW_FORM_strx4
This page took 0.027676 seconds and 4 git commands to generate.