From e19fda4e952815ed64646a8183c479824bf58444 Mon Sep 17 00:00:00 2001 From: dsmith Date: Mon, 5 Jun 2006 21:49:14 +0000 Subject: 2006-06-05 David Smith * 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. --- testsuite/semko/return01.stp | 7 +++++++ testsuite/semko/return02.stp | 7 +++++++ 2 files changed, 14 insertions(+) create mode 100755 testsuite/semko/return01.stp create mode 100755 testsuite/semko/return02.stp (limited to 'testsuite/semko') 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) +} -- cgit