aboutsummaryrefslogtreecommitdiff
path: root/gdb/dwarf2
diff options
context:
space:
mode:
authorTom de Vries <tdevries@suse.de>2024-05-02 09:34:46 +0200
committerTom de Vries <tdevries@suse.de>2024-05-02 09:34:46 +0200
commit5ce0e02478cc79a260c7e29822450284a32b9b12 (patch)
tree5051c2b270968675b28e62d7535d791f99d63032 /gdb/dwarf2
parent75d933919d8e99c85054bdbf3a0bee0235f2bd3b (diff)
downloadgdb-5ce0e02478cc79a260c7e29822450284a32b9b12.zip
gdb-5ce0e02478cc79a260c7e29822450284a32b9b12.tar.gz
gdb-5ce0e02478cc79a260c7e29822450284a32b9b12.tar.bz2
[gdb/symtab] Work around PR gas/29517, dwarf2 case
In commit 1d45d90934b ("[gdb/symtab] Work around PR gas/29517") we added a workaround for PR gas/29517. The problem is present in gas version 2.39, and fixed in 2.40, so the workaround is only active for gas version == 2.39. However, the problem in gas is only fixed for dwarf version >= 3, which supports DW_TAG_unspecified_type. Fix this by also activating the workaround for dwarf version == 2. Tested on x86_64-linux. Approved-by: Kevin Buettner <kevinb@redhat.com> PR symtab/31689 https://sourceware.org/bugzilla/show_bug.cgi?id=31689
Diffstat (limited to 'gdb/dwarf2')
-rw-r--r--gdb/dwarf2/read.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/gdb/dwarf2/read.c b/gdb/dwarf2/read.c
index 7eacafc..00e8608 100644
--- a/gdb/dwarf2/read.c
+++ b/gdb/dwarf2/read.c
@@ -14549,10 +14549,13 @@ read_subroutine_type (struct die_info *die, struct dwarf2_cu *cu)
type = die_type (die, cu);
+ /* PR gas/29517 occurs in 2.39, and is fixed in 2.40, but it's only fixed
+ for dwarf version >= 3 which supports DW_TAG_unspecified_type. */
if (type->code () == TYPE_CODE_VOID
&& !type->is_stub ()
&& die->child == nullptr
- && producer_is_gas_2_39 (cu))
+ && (cu->per_cu->version () == 2
+ || producer_is_gas_2_39 (cu)))
{
/* Work around PR gas/29517, pretend we have an DW_TAG_unspecified_type
return type. */