From d6b380891ae8c1947f328ff7d7a0ddc7f5a13e08 Mon Sep 17 00:00:00 2001 From: fche Date: Fri, 15 Jun 2007 20:12:46 +0000 Subject: [PATCH] 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. --- ChangeLog | 7 +++++++ loc2c.c | 16 +++++++--------- 2 files changed, 14 insertions(+), 9 deletions(-) diff --git a/ChangeLog b/ChangeLog index a20252f54..b898bf560 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +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. + 2007-06-14 Frank Ch. Eigler * translate.cxx (emit_module_init): Emit translator/elfutils diff --git a/loc2c.c b/loc2c.c index 79b864fda..bc209047d 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; -- 2.43.5