From 86598ebfa13479b4ba3b6b7a9de25c3e497ff57e Mon Sep 17 00:00:00 2001 From: Mark Wielaard Date: Wed, 16 Sep 2009 12:22:04 +0200 Subject: Clean up dwflpp::translate_location workaround for DW_AT_data_member_location. Do the same workaround as loc2c-test.c does. Just treat a constant member location offset as a DW_OP_plus_uconst and call c_translate_location for it. Also Remove c_translate_add_offset. * dwflpp.cxx (dwflpp::translate_location): Check elfutils version and only do workaround for elfutils < 0.142. * loc2c.h (c_translate_add_offset): Removed. * loc2c.c (c_translate_add_offset): Likewise. --- loc2c.c | 34 ---------------------------------- 1 file changed, 34 deletions(-) (limited to 'loc2c.c') diff --git a/loc2c.c b/loc2c.c index d4cb4666..5cf59691 100644 --- a/loc2c.c +++ b/loc2c.c @@ -1711,40 +1711,6 @@ c_translate_pointer_store (struct obstack *pool, int indent, // XXX: what about multiple-location lvalues? } - -/* Translate a fragment to add an offset to the currently calculated - address of the input location. Used for struct fields. Only works - when location is already an actual base address. -*/ - -void -c_translate_add_offset (struct obstack *pool, int indent, const char *comment, - Dwarf_Sword off, struct location **input) -{ - indent++; - if (comment == NULL || comment[0] == '\0') - comment = "field offset"; - switch ((*input)->type) - { - case loc_address: - obstack_printf (pool, "%*saddr += " SFORMAT "; // %s\n", - indent * 2 + 2, "", off, comment); - *input = (*input)->next = new_synthetic_loc (pool, *input, false); - break; - - case loc_register: - FAIL (*input, N_("cannot add offset of object in register")); - break; - case loc_noncontiguous: - FAIL (*input, N_("cannot add offset of noncontiguous object")); - break; - - default: - abort (); - break; - } -} - /* Determine the element stride of an array type. */ static Dwarf_Word array_stride (Dwarf_Die *typedie, struct location *origin) -- cgit