summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMark Wielaard <mjw@redhat.com>2009-08-24 17:09:29 +0200
committerMark Wielaard <mjw@redhat.com>2009-08-24 17:13:17 +0200
commit345bbb3d0f827566083cb124c6f3641639ad98d4 (patch)
tree71883cf1024a731c8a960b2e38970ff446c3a493
parent1392896dcda33324d43392f8e99fed240cf5fb9b (diff)
downloadsystemtap-steved-345bbb3d0f827566083cb124c6f3641639ad98d4.tar.gz
systemtap-steved-345bbb3d0f827566083cb124c6f3641639ad98d4.tar.xz
systemtap-steved-345bbb3d0f827566083cb124c6f3641639ad98d4.zip
Fix failing uprobes.exp -p5 failures by removing trailing spaces in $$ vars.
* tapsets.cxx (dwarf_var_expanding_visitor::visit_target_symbol_context): Don't add extra space at end of list, only add space between symbols. * testsuite/systemtap.base/uprobes.exp: Use more specific expect regex. * testsuite/systemtap.base/vars.exp: Don't just chop off last char of printf output string.
-rw-r--r--tapsets.cxx14
-rw-r--r--testsuite/systemtap.base/uprobes.exp4
-rw-r--r--testsuite/systemtap.base/vars.exp2
3 files changed, 12 insertions, 8 deletions
diff --git a/tapsets.cxx b/tapsets.cxx
index 76c93a98..878d43b4 100644
--- a/tapsets.cxx
+++ b/tapsets.cxx
@@ -2115,13 +2115,14 @@ dwarf_var_expanding_visitor::visit_target_symbol_context (target_symbol* e)
else
{
pf->raw_components += "return";
- pf->raw_components += "=%#x ";
+ pf->raw_components += "=%#x";
pf->args.push_back(texp);
}
}
else
{
// non-.return probe: support $$parms, $$vars, $$locals
+ bool first = true;
Dwarf_Die result;
if (dwarf_child (&scopes[0], &result) == 0)
do
@@ -2144,6 +2145,10 @@ dwarf_var_expanding_visitor::visit_target_symbol_context (target_symbol* e)
const char *diename = dwarf_diename (&result);
if (! diename) continue;
+ if (! first)
+ pf->raw_components += " ";
+ pf->raw_components += diename;
+
tsym->tok = e->tok;
tsym->base_name = "$";
tsym->base_name += diename;
@@ -2163,15 +2168,14 @@ dwarf_var_expanding_visitor::visit_target_symbol_context (target_symbol* e)
}
}
- pf->raw_components += diename;
- pf->raw_components += "=? ";
+ pf->raw_components += "=?";
}
else
{
- pf->raw_components += diename;
- pf->raw_components += "=%#x ";
+ pf->raw_components += "=%#x";
pf->args.push_back(texp);
}
+ first = false;
}
while (dwarf_siblingof (&result, &result) == 0);
}
diff --git a/testsuite/systemtap.base/uprobes.exp b/testsuite/systemtap.base/uprobes.exp
index bdd620b3..3b98c8b1 100644
--- a/testsuite/systemtap.base/uprobes.exp
+++ b/testsuite/systemtap.base/uprobes.exp
@@ -36,8 +36,8 @@ if {! [installtest_p]} {
spawn stap $srcdir/$subdir/uprobes.stp -w -c "./jennie 1 2 3 4"
set ok 0
expect {
- -re {^process[^\r\n]*jennie[^\r\n]*main[^\r\n]*argc=0x[1-5][^\r\n]*\r\n} { incr ok; exp_continue }
- -re {^process[^\r\n]*jennie[^\r\n]*main[^\r\n]*return=0x0[^\r\n]*\r\n} { incr ok; exp_continue }
+ -re {^process[^\r\n]+jennie[^\r\n]+main[^\r\n]+arg[cv]=0x[0-9a-f]+\ +arg[cv]=0x[0-9a-f]+\r\n} { incr ok; exp_continue }
+ -re {^process[^\r\n]+jennie[^\r\n]+main[^\r\n]+return=0x0\r\n} { incr ok; exp_continue }
-timeout 30
timeout { }
eof { }
diff --git a/testsuite/systemtap.base/vars.exp b/testsuite/systemtap.base/vars.exp
index 195abee0..75afe9ef 100644
--- a/testsuite/systemtap.base/vars.exp
+++ b/testsuite/systemtap.base/vars.exp
@@ -3,7 +3,7 @@
set test "vars"
# grab C statement that $$vars yields
-set cmd [concat stap -p3 -e {"probe kernel.statement(\"bio_copy_user@fs/bio.c+1\") \{print (\$\$vars)\}"} | grep {"printf.*="} | sed -e {"s/^.*MAXSTRINGLEN, \"//"} -e {s/.\".*$//}]
+set cmd [concat stap -p3 -e {"probe kernel.statement(\"bio_copy_user@fs/bio.c+1\") \{print (\$\$vars)\}"} | grep {"printf.*="} | sed -e {"s/^.*MAXSTRINGLEN, \"//"} -e {s/\".*$//}]
catch {eval exec $cmd} vars
# grab C statement that $$parms yields