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. */
bar_start bar_len
set bar_end "$bar_start + $bar_len"
+set foo2_res \
+ [function_range foo2 \
+ [list ${srcdir}/${subdir}/$srcfile ${srcdir}/${subdir}/$srcfile2]]
+lassign $foo2_res \
+ foo2_start foo2_len
+set foo2_end "$foo2_start + $foo2_len"
+
# Create the DWARF.
set asm_file [standard_output_file $srcfile3]
Dwarf::assemble $asm_file {
global foo_start foo_end
global bar_start bar_end
+ global foo2_start foo2_end
declare_labels unspecified_type_label
cu {} {
}
}
}
+
+ cu { version 2 } {
+ compile_unit {
+ {language @DW_LANG_Mips_Assembler}
+ {producer "GNU AS 2.40.0"}
+ } {
+ DW_TAG_subprogram {
+ {name foo2}
+ {low_pc $foo2_start addr}
+ {high_pc $foo2_end addr}
+ }
+ }
+ }
}
if [prepare_for_testing "failed to prepare" $testfile \
return -1
}
-foreach f {foo bar} {
+foreach f {foo bar foo2} {
# Print the function type. Return type should be stub type, which is printed
# as void.
gdb_test "ptype $f" "type = void \\(void\\)"