diff options
author | roland <roland> | 2005-11-22 00:29:54 +0000 |
---|---|---|
committer | roland <roland> | 2005-11-22 00:29:54 +0000 |
commit | d1531387ba69eb6b31197a5be26a63ce20bb9d40 (patch) | |
tree | ce9d6d4d872a2650e7d6ebf8cb8fef0f3093bf08 /loc2c.c | |
parent | 422d1ceb1e08c1174154cf19bb03f788e1e10fb8 (diff) | |
download | systemtap-steved-d1531387ba69eb6b31197a5be26a63ce20bb9d40.tar.gz systemtap-steved-d1531387ba69eb6b31197a5be26a63ce20bb9d40.tar.xz systemtap-steved-d1531387ba69eb6b31197a5be26a63ce20bb9d40.zip |
2005-11-21 Roland McGrath <roland@redhat.com>
* 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.
Diffstat (limited to 'loc2c.c')
-rw-r--r-- | loc2c.c | 32 |
1 files changed, 5 insertions, 27 deletions
@@ -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: |