]> sourceware.org Git - systemtap.git/commitdiff
translator: propagate types to .return saved vars
authorJosh Stone <jistone@redhat.com>
Tue, 22 Jul 2014 17:22:12 +0000 (10:22 -0700)
committerJosh Stone <jistone@redhat.com>
Tue, 22 Jul 2014 17:22:12 +0000 (10:22 -0700)
tapsets.cxx
testsuite/semko/autocast11.stp [new file with mode: 0755]
testsuite/semok/autocast11.stp [new file with mode: 0755]

index 510f5399e7189b93c6e1c12f4369110157a8156c..7c51ef1503d7c3169ee620f9f5c87a99301da827 100644 (file)
@@ -3578,6 +3578,10 @@ dwarf_var_expanding_visitor::visit_target_symbol_saved_return (target_symbol* e)
   else
     exp = gen_mapped_saved_return(repl, e->sym_name());
 
+  // Propagate the DWARF type to the expression in the return probe.
+  if (repl->type_details && !exp->type_details)
+    exp->type_details = repl->type_details;
+
   // Provide the variable to our parent so it can be used as a
   // substitute for the target symbol.
   provide (exp);
diff --git a/testsuite/semko/autocast11.stp b/testsuite/semko/autocast11.stp
new file mode 100755 (executable)
index 0000000..acea0fa
--- /dev/null
@@ -0,0 +1,17 @@
+#! stap -p2
+
+probe kernel.function("schedule_tail").return ?
+{
+    // Test the type propagated from a value saved at entry, with an error
+    // (semok/autocast11.stp makes sure this normally works)
+    mm = $prev->mm
+    println(mm->no_such_member)
+}
+
+probe process("stap").function("main").return ?
+{
+    // NB: if the access above fails as it should, we won't even get here, but
+    // this is still useful to give --runtime=dyninst something to test.
+    a = $argv
+    println(a->no_such_member)
+}
diff --git a/testsuite/semok/autocast11.stp b/testsuite/semok/autocast11.stp
new file mode 100755 (executable)
index 0000000..f4faf0e
--- /dev/null
@@ -0,0 +1,14 @@
+#! stap -p2
+
+probe kernel.function("schedule_tail").return ?
+{
+    // Test the type propagated from a value saved at entry
+    mm = $prev->mm
+    println(mm->mmap)
+}
+
+probe process("stap").function("main").return ?
+{
+    a = $argv
+    println((a)[0])
+}
This page took 0.056237 seconds and 5 git commands to generate.