From 00b01a991cc4300f18c747853e85841d187b1fa4 Mon Sep 17 00:00:00 2001 From: Mark Wielaard Date: Wed, 15 Jul 2009 12:04:57 +0200 Subject: PR10388 Support DW_OP_call_frame_cfa. Depends on elfutils 0.142 cfi support. * loc2c.h (c_translate_location): Take (optional) Dwarf_Op *cfa_ops. * loc2c.c (translate): Recognize DW_OP_call_frame_cfa. (location_from_address): Take cfa_ops, examine fb_ops, if it is DW_OP_call_frame_cfa, pass cfa_ops to translate instead. (location_relative): Take cfa_ops, pass to location_from_address. (c_translate_location): Take cfa_ops, pass to location_from_address. * loc2c-test.c (handle_variable): Take cfa_ops, pass to c_translate_location when needed. (main): Fetch cfa_ops, pass to handle_variable. * dwflpp.h (struct dwflpp): Add new method get_cfa_ops. * dwflpp.cxx: Include elfutils/version.h. (translate_location): Fetch cfa_ops when necessary. (get_cfa_ops): New method. --- loc2c.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'loc2c.h') diff --git a/loc2c.h b/loc2c.h index eb1f39d6..449d4499 100644 --- a/loc2c.h +++ b/loc2c.h @@ -11,7 +11,8 @@ struct location; /* Opaque */ /* Translate a C fragment for the location expression, using *INPUT 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 FB_ATTR location expression. The call_frame might need to be + calculated by the cfa_ops for the given pc_address. On errors, call FAIL, which should not return. Any later errors will use FAIL and FAIL_ARG from the first c_translate_location call. @@ -34,7 +35,8 @@ struct location *c_translate_location (struct obstack *, const Dwarf_Op *locexpr, size_t locexprlen, struct location **input, - Dwarf_Attribute *fb_attr); + Dwarf_Attribute *fb_attr, + const Dwarf_Op *cfa_ops); /* Translate a fragment to dereference the given DW_TAG_pointer_type DIE, where *INPUT is the location of the pointer with that type. */ -- cgit