summaryrefslogtreecommitdiffstats
path: root/testsuite/semko
diff options
context:
space:
mode:
authordsmith <dsmith>2006-06-05 21:49:14 +0000
committerdsmith <dsmith>2006-06-05 21:49:14 +0000
commite19fda4e952815ed64646a8183c479824bf58444 (patch)
treecc106c4c6a5a8bf11a133b62533ff7aad9044be0 /testsuite/semko
parentc641b2813f6fd069dc10cdc66736f09e4531c551 (diff)
downloadsystemtap-steved-e19fda4e952815ed64646a8183c479824bf58444.tar.gz
systemtap-steved-e19fda4e952815ed64646a8183c479824bf58444.tar.xz
systemtap-steved-e19fda4e952815ed64646a8183c479824bf58444.zip
2006-06-05 David Smith <dsmith@redhat.com>
* tapsets.cxx (dwflpp::express_as_string): New function. Extracted from dwflpp::literal_stmt_for_local() so that dwflpp::literal_stmt_for_return() could also call it. (dwflpp::literal_stmt_for_local): Portion extracted to create dwflpp::express_as_string(). (dwflpp::literal_stmt_for_return): New function. Adds support for new symbolic access ("$return") to return value in .return probes. Fixes PR 1132. (target_variable_flavour_calculating_visitor::visit_target_symbol): Calls dwflpp::literal_stmt_for_return() when in a return probe and the variable name is "$return". (dwarf_var_expanding_copy_visitor::visit_target_symbol): Ditto. * stapfuncs.5.in: Noted that the retval() function is deprecated. * stapprobes.5.in: Corrected the name of the return value variable. * tapset/return.stp: Marked the retval() function as deprecated. * testsuite/semko/return01.stp: Added new test. * testsuite/semko/return02.stp: Ditto.
Diffstat (limited to 'testsuite/semko')
-rwxr-xr-xtestsuite/semko/return01.stp7
-rwxr-xr-xtestsuite/semko/return02.stp7
2 files changed, 14 insertions, 0 deletions
diff --git a/testsuite/semko/return01.stp b/testsuite/semko/return01.stp
new file mode 100755
index 00000000..9e3c5f44
--- /dev/null
+++ b/testsuite/semko/return01.stp
@@ -0,0 +1,7 @@
+#! stap -p2
+
+probe kernel.function("get_page_state").return
+{
+ # this should fail, since get_page_state() is a void function
+ printf("return is %d\n", $return)
+}
diff --git a/testsuite/semko/return02.stp b/testsuite/semko/return02.stp
new file mode 100755
index 00000000..db4cd8c7
--- /dev/null
+++ b/testsuite/semko/return02.stp
@@ -0,0 +1,7 @@
+#! stap -p2
+
+probe kernel.function("sys_read")
+{
+ # this should fail - using $return not in a '.return' probe
+ printf("in sys_read - return = %d\n", $return)
+}