summaryrefslogtreecommitdiffstats
path: root/tapsets.cxx
diff options
context:
space:
mode:
authorJosh Stone <jistone@redhat.com>2009-11-06 16:01:10 -0800
committerJosh Stone <jistone@redhat.com>2009-11-06 16:01:10 -0800
commitd87623a1515eada2bd7809b370bf8e7a3294c985 (patch)
tree86d8d8d6a38bfc19644ae1eebd585f9f7aa4c59a /tapsets.cxx
parent079915a57182ed3e5981190ccf8216c674aa4406 (diff)
downloadsystemtap-steved-d87623a1515eada2bd7809b370bf8e7a3294c985.tar.gz
systemtap-steved-d87623a1515eada2bd7809b370bf8e7a3294c985.tar.xz
systemtap-steved-d87623a1515eada2bd7809b370bf8e7a3294c985.zip
Constrain $var-checking for -L of .return probes
Normally, using a $var in a return probe create a matching entry probe to save the value. We don't want all this machinery though when we're just checking the accessibility of a $var for -L mode. * tapsets.cxx (dwarf_derived_probe::saveargs): Save/restore has_return while the $var accesses are attempted.
Diffstat (limited to 'tapsets.cxx')
-rw-r--r--tapsets.cxx20
1 files changed, 10 insertions, 10 deletions
diff --git a/tapsets.cxx b/tapsets.cxx
index 21704f69..59598cf3 100644
--- a/tapsets.cxx
+++ b/tapsets.cxx
@@ -2901,6 +2901,12 @@ dwarf_derived_probe::saveargs(dwarf_query& q, Dwarf_Die* scope_die, dwarf_var_ex
dwarf_type_name(&type_die, type_name))
args.insert("$return:"+type_name);
+ /* Pretend that we aren't in a .return for a moment, just so we can check
+ * whether variables are accessible. We don't want to all the entry-saving
+ * code generated during listing mode. */
+ bool saved_has_return = has_return;
+ q.has_return = has_return = false;
+
Dwarf_Die arg;
vector<Dwarf_Die> scopes = q.dw.getscopes_die(scope_die);
if (dwarf_child (&scopes[0], &arg) == 0)
@@ -2927,16 +2933,7 @@ dwarf_derived_probe::saveargs(dwarf_query& q, Dwarf_Die* scope_die, dwarf_var_ex
/* trick from visit_target_symbol_context */
target_symbol *tsym = new target_symbol;
- token *t = new token;
- /* We hypothesize accessing the argument
- * The source_loc will be base_loc since no real one */
- t->content = "$";
- t->content += arg_name;
- t->type = tok_identifier;
- t->location.file = q.base_loc->tok->location.file;
- t->location.column = q.base_loc->tok->location.column;
- t->location.line = q.base_loc->tok->location.line;
- tsym->tok = t;
+ tsym->tok = q.base_loc->tok;
tsym->base_name = "$";
tsym->base_name += arg_name;
@@ -2947,6 +2944,9 @@ dwarf_derived_probe::saveargs(dwarf_query& q, Dwarf_Die* scope_die, dwarf_var_ex
args.insert("$"+string(arg_name)+":"+type_name);
}
while (dwarf_siblingof (&arg, &arg) == 0);
+
+ /* restore the .return status of the probe */
+ q.has_return = has_return = saved_has_return;
}