From d1531387ba69eb6b31197a5be26a63ce20bb9d40 Mon Sep 17 00:00:00 2001 From: roland Date: Tue, 22 Nov 2005 00:29:54 +0000 Subject: 2005-11-21 Roland McGrath * loc2c.c (c_translate_location): Take Dwarf_Op vector as argument directly, not Dwarf_Attribute.p * loc2c.h: Update decl. * loc2c-test.c (get_location): New function. (handle_variable): Use it. * tapsets.cxx (dwflpp::translate_location): New method. (dwflpp::translate_components, dwflpp::literal_stmt_for_local): Use it. --- loc2c.c | 32 +++++--------------------------- 1 file changed, 5 insertions(+), 27 deletions(-) (limited to 'loc2c.c') diff --git a/loc2c.c b/loc2c.c index d6504474..a6b62fdc 100644 --- a/loc2c.c +++ b/loc2c.c @@ -965,34 +965,12 @@ c_translate_location (struct obstack *pool, void *fail_arg, void (*emit_address) (void *fail_arg, struct obstack *, Dwarf_Addr), - int indent, Dwarf_Addr dwbias, - Dwarf_Attribute *loc_attr, Dwarf_Addr address, + int indent, Dwarf_Addr dwbias, Dwarf_Addr pc_address, + const Dwarf_Op *expr, size_t len, struct location **input, Dwarf_Attribute *fb_attr) { - ++indent; - - Dwarf_Op *expr; - size_t len; - switch (dwarf_getlocation_addr (loc_attr, address - dwbias, &expr, &len, 1)) - { - case 1: /* Should always happen. */ - if (len == 0) - goto inaccessible; - break; - - default: /* Shouldn't happen. */ - case -1: - (*fail) (fail_arg, N_("dwarf_addrloclists (form %#x): %s"), - dwarf_whatform (fb_attr), dwarf_errmsg (-1)); - return NULL; + indent += 2; - case 0: /* Shouldn't happen. */ - inaccessible: - (*fail) (fail_arg, N_("not accessible at this address")); - return NULL; - } - - ++indent; switch (*input == NULL ? loc_address : (*input)->type) { case loc_address: @@ -1000,14 +978,14 @@ c_translate_location (struct obstack *pool, This expression will compute starting with that on the stack. */ return location_from_address (pool, fail, fail_arg, emit_address ?: &default_emit_address, - indent, dwbias, expr, len, address, + indent, dwbias, expr, len, pc_address, input, fb_attr); case loc_noncontiguous: case loc_register: /* The starting point is not an address computation, but a register. We can only handle limited computations from here. */ - return location_relative (pool, indent, dwbias, expr, len, address, + return location_relative (pool, indent, dwbias, expr, len, pc_address, input, fb_attr); default: -- cgit