summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordsmith <dsmith>2007-01-12 16:33:16 +0000
committerdsmith <dsmith>2007-01-12 16:33:16 +0000
commit46392da3e1bfad96fd428122fa1f0ed5182dbb9a (patch)
tree3d17e92b7ce1d4901728b5abdfebaaf9f024c965
parent2efa5308711fec19285ef32cd1947fcda21c4530 (diff)
downloadsystemtap-steved-46392da3e1bfad96fd428122fa1f0ed5182dbb9a.tar.gz
systemtap-steved-46392da3e1bfad96fd428122fa1f0ed5182dbb9a.tar.xz
systemtap-steved-46392da3e1bfad96fd428122fa1f0ed5182dbb9a.zip
2007-01-12 David Smith <dsmith@redhat.com>
* tapsets.cxx (dwarf_var_expanding_copy_visitor::visit_target_symbol): Since array behavior has changed (setting to 0 no longer deletes the array element), we delete the internal counter array element when providing target variable access in return probes.
-rw-r--r--ChangeLog8
-rw-r--r--tapsets.cxx24
2 files changed, 32 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index b804f124..697a99cf 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2007-01-12 David Smith <dsmith@redhat.com>
+
+ * tapsets.cxx
+ (dwarf_var_expanding_copy_visitor::visit_target_symbol): Since
+ array behavior has changed (setting to 0 no longer deletes the
+ array element), we delete the internal counter array element when
+ providing target variable access in return probes.
+
2007-01-11 Roland McGrath <roland@redhat.com>
* systemtap.spec.in (elfutils_version): Bump to 0.125.
diff --git a/tapsets.cxx b/tapsets.cxx
index d08e8633..5869a318 100644
--- a/tapsets.cxx
+++ b/tapsets.cxx
@@ -3012,6 +3012,8 @@ dwarf_var_expanding_copy_visitor::visit_target_symbol (target_symbol *e)
// _dwarf_tvar_{name}_{num}_ctr[_dwarf_tvar_tid]]
// delete _dwarf_tvar_{name}_{num}[_dwarf_tvar_tid,
// _dwarf_tvar_{name}_{num}_ctr[_dwarf_tvar_tid]--]
+ // if (! _dwarf_tvar_{name}_{num}_ctr[_dwarf_tvar_tid])
+ // delete _dwarf_tvar_{name}_{num}_ctr[_dwarf_tvar_tid]
// (2a) Synthesize the tid temporary expression, which will look
// like this:
@@ -3117,6 +3119,28 @@ dwarf_var_expanding_copy_visitor::visit_target_symbol (target_symbol *e)
add_block->statements.push_back (ds);
+ // (2d) Delete the counter value if it is 0. It will look like
+ // this:
+ // if (! _dwarf_tvar_{name}_{num}_ctr[_dwarf_tvar_tid])
+ // delete _dwarf_tvar_{name}_{num}_ctr[_dwarf_tvar_tid]
+
+ ds = new delete_statement;
+ ds->tok = e->tok;
+ ds->value = ai_ctr;
+
+ unary_expression *ue = new unary_expression;
+ ue->tok = e->tok;
+ ue->op = "!";
+ ue->operand = ai_ctr;
+
+ if_statement *ifs = new if_statement;
+ ifs->tok = e->tok;
+ ifs->condition = ue;
+ ifs->thenblock = ds;
+ ifs->elseblock = NULL;
+
+ add_block->statements.push_back (ifs);
+
// (3) We need an entry probe that saves the value for us in the
// global array we created. Create the entry probe, which will
// look like this: