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-test.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'loc2c-test.c') diff --git a/loc2c-test.c b/loc2c-test.c index b8883876..495a95f1 100644 --- a/loc2c-test.c +++ b/loc2c-test.c @@ -136,7 +136,7 @@ handle_variable (Dwarf_Die *lscopes, int lnscopes, int out, struct location *head, *tail = NULL; head = c_translate_location (&pool, &fail, NULL, NULL, - 1, cubias, pc, locexpr, locexpr_len, + 1, cubias, pc, &attr_mem, locexpr, locexpr_len, &tail, fb_attr, cfa_ops); if (dwarf_attr_integrate (vardie, DW_AT_type, &attr_mem) == NULL) @@ -238,7 +238,8 @@ handle_variable (Dwarf_Die *lscopes, int lnscopes, int out, Dwarf_Op offset_loc = { .atom = DW_OP_plus_uconst }; if (dwarf_formudata (&attr_mem, &offset_loc.number) == 0) c_translate_location (&pool, NULL, NULL, NULL, - 1, cubias, pc, &offset_loc, 1, + 1, cubias, pc, &attr_mem, + &offset_loc, 1, &tail, NULL, NULL); else #endif @@ -246,7 +247,8 @@ handle_variable (Dwarf_Die *lscopes, int lnscopes, int out, locexpr = get_location (cubias, pc, &attr_mem, &locexpr_len); c_translate_location (&pool, NULL, NULL, NULL, - 1, cubias, pc, locexpr, locexpr_len, + 1, cubias, pc, &attr_mem, + locexpr, locexpr_len, &tail, NULL, NULL); } } -- cgit