summaryrefslogtreecommitdiffstats
path: root/tapsets.cxx
diff options
context:
space:
mode:
authorDave Brolley <brolley@redhat.com>2009-03-20 11:49:56 -0400
committerDave Brolley <brolley@redhat.com>2009-03-20 11:49:56 -0400
commitc11e62bef0f85147c96aeb7d0a7f9fd69da51db6 (patch)
treefc320ed03c59849fb922acff51b7b93f89fe6047 /tapsets.cxx
parent1ca3466b0426566a6c6ba03251d8cca3d111f170 (diff)
parent0cf9ea606eb7677a1241595f7568dd4a6c243ef2 (diff)
downloadsystemtap-steved-c11e62bef0f85147c96aeb7d0a7f9fd69da51db6.tar.gz
systemtap-steved-c11e62bef0f85147c96aeb7d0a7f9fd69da51db6.tar.xz
systemtap-steved-c11e62bef0f85147c96aeb7d0a7f9fd69da51db6.zip
Merge branch 'master' of git://sources.redhat.com/git/systemtap
Diffstat (limited to 'tapsets.cxx')
-rw-r--r--tapsets.cxx33
1 files changed, 26 insertions, 7 deletions
diff --git a/tapsets.cxx b/tapsets.cxx
index 894a7447..a8653d8a 100644
--- a/tapsets.cxx
+++ b/tapsets.cxx
@@ -3521,9 +3521,17 @@ dwarf_query::blacklisted_p(const string& funcname,
if (! (goodfn && goodfile))
{
- if (sess.verbose>1)
- clog << " skipping - blacklisted";
- return true;
+ if (sess.guru_mode)
+ {
+ if (sess.verbose>1)
+ clog << " guru mode enabled - ignoring blacklist";
+ }
+ else
+ {
+ if (sess.verbose>1)
+ clog << " skipping - blacklisted";
+ return true;
+ }
}
// This probe point is not blacklisted.
@@ -5059,7 +5067,8 @@ void dwarf_cast_expanding_visitor::visit_cast_op (cast_op* e)
// cast_op to the next pass. We hope that this value ends
// up not being referenced after all, so it can be optimized out
// quietly.
- semantic_error* er = new semantic_error ("type definition not found", e->tok);
+ string msg = "type definition '" + e->type + "' not found";
+ semantic_error* er = new semantic_error (msg, e->tok);
// NB: we can have multiple errors, since a @cast
// may be expanded in several different contexts:
// function ("*") { @cast(...) }
@@ -9233,7 +9242,7 @@ mark_builder::build(systemtap_session & sess,
struct tracepoint_arg
{
- string name, c_type;
+ string name, c_type, typecast;
bool usable, used, isptr;
Dwarf_Die type_die;
tracepoint_arg(): usable(false), used(false), isptr(false) {}
@@ -9336,6 +9345,9 @@ tracepoint_var_expanding_visitor::visit_target_symbol_arg (target_symbol* e)
if (lvalue && (!dw.sess.guru_mode || e->components.empty()))
throw semantic_error("write to tracepoint variable '" + e->base_name
+ "' not permitted", e->tok);
+ // XXX: if a struct/union arg is passed by value, then writing to its fields
+ // is also meaningless until you dereference past a pointer member. It's
+ // harder to detect and prevent that though...
if (e->components.empty())
{
@@ -9676,6 +9688,14 @@ resolve_tracepoint_arg_type(tracepoint_arg& arg)
if (dwarf_attr_integrate(&arg.type_die, DW_AT_type, &type_attr)
&& dwarf_formref_die(&type_attr, &arg.type_die))
arg.isptr = true;
+ arg.typecast = "(intptr_t)";
+ return true;
+ case DW_TAG_structure_type:
+ case DW_TAG_union_type:
+ // for structs/unions which are passed by value, we turn it into
+ // a pointer that can be dereferenced.
+ arg.isptr = true;
+ arg.typecast = "(intptr_t)&";
return true;
default:
// should we consider other types too?
@@ -9778,8 +9798,7 @@ tracepoint_derived_probe_group::emit_module_decls (systemtap_session& s)
{
s.op->newline() << "c->locals[0]." << p->name << ".__tracepoint_arg_"
<< p->args[j].name << " = (int64_t)";
- if (p->args[j].isptr)
- s.op->line() << "(intptr_t)";
+ s.op->line() << p->args[j].typecast;
s.op->line() << "__tracepoint_arg_" << p->args[j].name << ";";
}
s.op->newline() << p->name << " (c);";