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.h | 7 ------- 1 file changed, 7 deletions(-) (limited to 'loc2c.h') diff --git a/loc2c.h b/loc2c.h index 449d4499..8bc59d29 100644 --- a/loc2c.h +++ b/loc2c.h @@ -87,13 +87,6 @@ c_translate_pointer_store (struct obstack *pool, int indent, Dwarf_Die *typedie, struct location **input, const char *rvalue); -/* 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); - /* Translate a C fragment for a direct argument VALUE. On errors, call FAIL, which should not return. Any later errors will use FAIL and FAIL_ARG from this translate call. On success, return the fragment created. */ -- cgit From 24c7957b4dbddc8545d0e0c734377746a5ae6e60 Mon Sep 17 00:00:00 2001 From: Mark Wielaard Date: Thu, 17 Sep 2009 15:06:57 +0200 Subject: PR10417 Pass around attributes for supporting DW_OP_{implicit,stack}_value. Preparation for retrieving the Dwarf_Block that holds the value of an DW_OP_implicit_value. We need the Dwarf_Attribute that is associated with the location expression operants. Depends on new elfutils 0.143 functionality. Recognizes, but does not yet handle the new operants DW_OP_{implicit,stack}_value. * loc2c.h (c_translate_location): Take an Dwarf_Attribute. * loc2c.c (c_translate_location): Likewise and pass it on. (location_relative): Likewise. (location_from_address): Likewise. (translate): Likewise and capture Dwarf_Block. * loc2c-test.c (handle_variable): Pass in Dwarf_Attribute. * dwflpp.cxx (translate_location): Likewise. (literal_stmt_for_return): Pass in NULL to indicate no attribute. --- loc2c.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'loc2c.h') diff --git a/loc2c.h b/loc2c.h index 8bc59d29..becf2d85 100644 --- a/loc2c.h +++ b/loc2c.h @@ -12,7 +12,9 @@ struct location; /* Opaque */ as the starting location, begin from scratch if *INPUT is null. If DW_OP_fbreg is used, it may have a subfragment computing from the FB_ATTR location expression. The call_frame might need to be - calculated by the cfa_ops for the given pc_address. + calculated by the cfa_ops for the given pc_address. If known the + locattr provides the attribute from which the locexpr array was + retrieved. On errors, call FAIL, which should not return. Any later errors will use FAIL and FAIL_ARG from the first c_translate_location call. @@ -32,6 +34,7 @@ struct location *c_translate_location (struct obstack *, int indent, Dwarf_Addr bias, Dwarf_Addr pc_address, + Dwarf_Attribute *attr, const Dwarf_Op *locexpr, size_t locexprlen, struct location **input, -- cgit