Commit 5bb2ed2c by Mark Mitchell Committed by Mark Mitchell

re PR debug/14328 (gcc3.2.2 generates incorrect debugging enum values)

	PR debug/14328
	* dwarf2out.c (gen_enumeration_type_die): Output all enumeration
	constants as signed values.

From-SVN: r78690
parent 719f407a
2004-02-29 Mark Mitchell <mark@codesourcery.com>
PR debug/14328
* dwarf2out.c (gen_enumeration_type_die): Output all enumeration
constants as signed values.
PR middle-end/13448
* c-tree.h (readonly_warning): Rename to ...
(readonly_error): ... this.
......
......@@ -10691,20 +10691,20 @@ gen_enumeration_type_die (tree type, dw_die_ref context_die)
link != NULL; link = TREE_CHAIN (link))
{
dw_die_ref enum_die = new_die (DW_TAG_enumerator, type_die, link);
tree value = TREE_VALUE (link);
add_name_attribute (enum_die,
IDENTIFIER_POINTER (TREE_PURPOSE (link)));
if (host_integerp (TREE_VALUE (link),
TREE_UNSIGNED (TREE_TYPE (TREE_VALUE (link)))))
{
if (tree_int_cst_sgn (TREE_VALUE (link)) < 0)
add_AT_int (enum_die, DW_AT_const_value,
tree_low_cst (TREE_VALUE (link), 0));
else
add_AT_unsigned (enum_die, DW_AT_const_value,
tree_low_cst (TREE_VALUE (link), 1));
}
if (host_integerp (value, TREE_UNSIGNED (TREE_TYPE (value))))
/* DWARF2 does not provide a way of indicating whether or
not enumeration constants are signed or unsigned. GDB
always assumes the values are signed, so we output all
values as if they were signed. That means that
enumeration constants with very large unsigned values
will appear to have negative values in the debugger. */
add_AT_int (enum_die, DW_AT_const_value,
tree_low_cst (value, tree_int_cst_sgn (value) > 0));
}
}
else
......
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