Commit 06140066 by Richard Biener Committed by Richard Biener

re PR lto/89514 (-g -fdebug-types-section -flto gives 'Dwarf Error: bad length' in gdb)

2019-02-27  Richard Biener  <rguenther@suse.de>

	PR debug/89514
	* dwarf2out.c (size_of_die): Key on AT_ref (a)->comdat_type_p
	rather than on use_debug_types, doing what output_die does.
	(value_format): Likewise.

From-SVN: r269250
parent a4395a84
2019-02-27 Richard Biener <rguenther@suse.de>
PR debug/89514
* dwarf2out.c (size_of_die): Key on AT_ref (a)->comdat_type_p
rather than on use_debug_types, doing what output_die does.
(value_format): Likewise.
2019-02-27 Martin Jambor <mjambor@suse.cz>
Martin Sebor <msebor@redhat.com>
......
......@@ -9433,7 +9433,7 @@ size_of_die (dw_die_ref die)
we use DW_FORM_ref_addr. In DWARF2, DW_FORM_ref_addr
is sized by target address length, whereas in DWARF3
it's always sized as an offset. */
if (use_debug_types)
if (AT_ref (a)->comdat_type_p)
size += DWARF_TYPE_SIGNATURE_SIZE;
else if (dwarf_version == 2)
size += DWARF2_ADDR_SIZE;
......@@ -9877,7 +9877,12 @@ value_format (dw_attr_node *a)
return DW_FORM_flag;
case dw_val_class_die_ref:
if (AT_ref_external (a))
return use_debug_types ? DW_FORM_ref_sig8 : DW_FORM_ref_addr;
{
if (AT_ref (a)->comdat_type_p)
return DW_FORM_ref_sig8;
else
return DW_FORM_ref_addr;
}
else
return DW_FORM_ref;
case dw_val_class_fde_ref:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment