From 03c75a4a21ef3dba8abbc7e596d2a102427a3d96 Mon Sep 17 00:00:00 2001 From: Josh Stone Date: Wed, 15 Jul 2009 18:21:56 -0700 Subject: PR5930: Address-op for $target and @cast members This allows the '&' operator to get the address of @cast and $target variable expressions. * staptree.h (target_symbol): add addressof field * staptree.cxx (target_symbol::print): print '&' for addressof (cast_op::print): ditto * parse.cxx (parser::parse_value): allow '&' prefix on $target/@cast * dwflpp.cxx (dwflpp::translate_final_fetch_or_store): allow taking the computed address without actually doing a final fetch. * tapset* (*::visit_target_symbol): throw errors for $vars w/o addresses * testsuite/systemtap.base/cast.stp: add &@cast test * testsuite/semok/target_addr.stp: test '&' on different member types * testsuite/semko/target_addr?.stp: test failure on bitfields/registers --- tapset-mark.cxx | 3 +++ 1 file changed, 3 insertions(+) (limited to 'tapset-mark.cxx') diff --git a/tapset-mark.cxx b/tapset-mark.cxx index 7544d7bb..4d8679d2 100644 --- a/tapset-mark.cxx +++ b/tapset-mark.cxx @@ -175,6 +175,9 @@ mark_var_expanding_visitor::visit_target_symbol (target_symbol* e) { assert(e->base_name.size() > 0 && e->base_name[0] == '$'); + if (e->addressof) + throw semantic_error("cannot take address of marker variable", e->tok); + if (e->base_name.substr(0,4) == "$arg") visit_target_symbol_arg (e); else if (e->base_name == "$format" || e->base_name == "$name") -- cgit