summaryrefslogtreecommitdiffstats
path: root/tapsets.cxx
diff options
context:
space:
mode:
authordsmith <dsmith>2006-11-10 19:59:02 +0000
committerdsmith <dsmith>2006-11-10 19:59:02 +0000
commitcf2a1f857f1af1bde57ab64a50390e92efc481e0 (patch)
tree0e677c874e924c5261d716b1a5c3c61f21218254 /tapsets.cxx
parente26b350f43a7356deb96b8382b0e2acfa89f6b6d (diff)
downloadsystemtap-steved-cf2a1f857f1af1bde57ab64a50390e92efc481e0.tar.gz
systemtap-steved-cf2a1f857f1af1bde57ab64a50390e92efc481e0.tar.xz
systemtap-steved-cf2a1f857f1af1bde57ab64a50390e92efc481e0.zip
2006-11-10 David Smith <dsmith@redhat.com>
* tapsets.cxx (dwarf_var_expanding_copy_visitor::visit_target_symbol): Minor improvement to error handling by throwing exceptions before allocations are done.
Diffstat (limited to 'tapsets.cxx')
-rw-r--r--tapsets.cxx14
1 files changed, 7 insertions, 7 deletions
diff --git a/tapsets.cxx b/tapsets.cxx
index 01b4ef74..d8e068d8 100644
--- a/tapsets.cxx
+++ b/tapsets.cxx
@@ -2890,23 +2890,23 @@ dwarf_var_expanding_copy_visitor::visit_target_symbol (target_symbol *e)
{
assert(e->base_name.size() > 0 && e->base_name[0] == '$');
+ bool lvalue = is_active_lvalue(e);
+ if (lvalue && !q.sess.guru_mode)
+ throw semantic_error("write to target variable not permitted", e->tok);
+
+ if (q.has_return && e->base_name != "$return")
+ throw semantic_error("target variables not available to .return probes");
+
// Synthesize a function.
functiondecl *fdecl = new functiondecl;
fdecl->tok = e->tok;
embeddedcode *ec = new embeddedcode;
ec->tok = e->tok;
- bool lvalue = is_active_lvalue(e);
-
- if (lvalue && !q.sess.guru_mode)
- throw semantic_error("write to target variable not permitted", e->tok);
string fname = (string(lvalue ? "_dwarf_tvar_set" : "_dwarf_tvar_get")
+ "_" + e->base_name.substr(1)
+ "_" + lex_cast<string>(tick++));
- if (q.has_return && e->base_name != "$return")
- throw semantic_error ("target variables not available to .return probes");
-
try
{
if (q.has_return && e->base_name == "$return")