From d6b380891ae8c1947f328ff7d7a0ddc7f5a13e08 Mon Sep 17 00:00:00 2001 From: fche Date: Fri, 15 Jun 2007 20:12:46 +0000 Subject: 2007-06-15 Frank Ch. Eigler PR 3331 cont'd. * loc2c.c (base_encoding): Tolerate absenece of DW_AT_encoding. (c_translate_pointer): Don't even try to find signedness, assume unsigned. --- loc2c.c | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) (limited to 'loc2c.c') diff --git a/loc2c.c b/loc2c.c index 79b864fd..bc209047 100644 --- a/loc2c.c +++ b/loc2c.c @@ -1240,8 +1240,9 @@ base_byte_size (Dwarf_Die *typedie, struct location *origin) static Dwarf_Word base_encoding (Dwarf_Die *typedie, struct location *origin) { - assert (dwarf_tag (typedie) == DW_TAG_base_type || - dwarf_tag (typedie) == DW_TAG_enumeration_type); + if (! (dwarf_tag (typedie) == DW_TAG_base_type || + dwarf_tag (typedie) == DW_TAG_enumeration_type)) + return -1; Dwarf_Attribute attr_mem; Dwarf_Word encoding; @@ -1249,10 +1250,13 @@ base_encoding (Dwarf_Die *typedie, struct location *origin) && dwarf_formudata (&attr_mem, &encoding) == 0) return encoding; + (void) origin; + /* FAIL (origin, N_("cannot get encoding attribute for type %s: %s"), dwarf_diename (typedie) ?: "", dwarf_errmsg (-1)); + */ return -1; } @@ -1546,13 +1550,7 @@ c_translate_pointer (struct obstack *pool, int indent, dwarf_diename (typedie) ?: "", dwarf_errmsg (-1)); - Dwarf_Attribute encoding_attr; - Dwarf_Word encoding; - if (dwarf_attr_integrate (typedie, DW_AT_encoding, &encoding_attr) == NULL - || dwarf_formudata (&encoding_attr, &encoding) != 0) - encoding = base_encoding (typedie, *input); - bool signed_p = (encoding == DW_ATE_signed - || encoding == DW_ATE_signed_char); + bool signed_p = false; /* XXX: Does not matter? */ translate_base_fetch (pool, indent + 1, byte_size, signed_p, input, "addr"); (*input)->type = loc_address; -- cgit