From: Justin Seyster Date: Wed, 9 Mar 2011 22:57:17 +0000 (-0500) Subject: Adds stub for tc_declare_call_symbol(). X-Git-Tag: release-v1.1~9^2~11^2~2 X-Git-Url: https://git.fsl.cs.stonybrook.edu/?a=commitdiff_plain;h=4e3e5be1f90e5471e90ae563eeaa4a115f26a84b;p=interaspect.git Adds stub for tc_declare_call_symbol(). --- diff --git a/src/tracecut.c b/src/tracecut.c index d44d817..73ee159 100644 --- a/src/tracecut.c +++ b/src/tracecut.c @@ -417,6 +417,49 @@ tc_bind_to_return_value (struct tc_tracecut *tc, const char *param_name, return add_call_symbol_binding (tc, param_name, symbol_name, -1); } +/** + * Create a function call symbol along with its bindings in one + * statement. The declaration is a string containing the function + * name and all the bindings in a special format. To bind the first + * and second call parameters, use the format: + * + * "func_name(param1, param2)" + * + * Use ? to skip a call parameter. To bind only the + * second call parameter, for example: + * + * "func_name(?, param)" + * + * To bind the return value: + * + * "(param)func_name()" + * + * \param tc The tracecut to add the symbol to. + * \param name The name used to reference this symbol. + * \param declaration A string declaring the name of the function that + * should trigger this symbol's event, as well as which param bindings + * to add. + * \param location Specifies whether the the symbol event should + * trigger before or after the specified function is called. + * \return #TC_SUCCESS or + * - #TC_BAD_CONTEXT, when called after compilation has already + * started; + * - #TC_INVAL, when the declaration is invalid because of syntax + errors; + * - #TC_DUPLICATE, if there already exists a symbol with the + * specified name; + * - #TC_NOENT, if one of the parameters in the declaration does not + exist; + * - #TC_NOMEM, if memory runs out. + */ +enum tc_error +tc_declare_call_symbol (struct tc_tracecut *tc, const char *name, + const char *declaration, + enum aop_insert_location location) +{ + return return_error (tc, TC_SUCCESS); +} + /** * Add a rule to a tracecut, specified as a regular expression. A * tracecut regular expression can include any of the tracecut's diff --git a/src/tracecut.h b/src/tracecut.h index 64f017d..c04e33f 100644 --- a/src/tracecut.h +++ b/src/tracecut.h @@ -99,6 +99,10 @@ extern enum tc_error tc_bind_to_return_value (struct tc_tracecut *tc, const char *param_name, const char *symbol_name); +enum tc_error tc_declare_call_symbol (struct tc_tracecut *tc, const char *name, + const char *declaration, + enum aop_insert_location location); + extern enum tc_error tc_add_rule (struct tc_tracecut *tc, const char *specification);