void
-typeresolution_info::visit_embeddedcode (embeddedcode*)
+typeresolution_info::visit_embeddedcode (embeddedcode* s)
{
+ // PR11573. If we have survived thus far with a piece of embedded
+ // code that requires uprobes, we need to track this.
+ //
+ // This is an odd place for this check, as opposed
+ // to a separate 'optimization' pass, or c_unparser::visit_embeddedcode
+ // over yonder in pass 3. However, we want to do it during pass 2 so
+ // that cached sessions also get the uprobes treatment.
+ if (!session.need_uprobes && s->code.find("/* pragma:uprobes */") != string::npos)
+ {
+ if (session.verbose > 2)
+ clog << "Activating uprobes support because /* pragma:uprobes */ seen." << endl;
+ session.need_uprobes = true;
+ }
}
* Equivalent to print_ustack(ubacktrace()),
* except that deeper stack nesting may be supported. Return nothing.
*/
-function print_ubacktrace () %{ /* unprivileged */
+function print_ubacktrace () %{ /* unprivileged */ /* pragma:uprobes */
assert_is_myproc();
if (CONTEXT->regs) {
_stp_stack_print(CONTEXT->regs, 1, CONTEXT->pi, MAXTRACE,
* shorter (just name and offset), and the function address is
* printed if it can't be mapped to a name.
*/
-function print_ubacktrace_brief () %{ /* unprivileged */
+function print_ubacktrace_brief () %{ /* unprivileged */ /* pragma:uprobes */
assert_is_myproc();
if (CONTEXT->regs) {
_stp_stack_print(CONTEXT->regs, SYM_VERBOSE_BRIEF, CONTEXT->pi,
* string length. Returns empty string when current probe point cannot
* determine user backtrace.
*/
-function ubacktrace:string () %{ /* pure */ /* unprivileged */
+function ubacktrace:string () %{ /* pure */ /* unprivileged */ /* pragma:uprobes */
assert_is_myproc();
if (CONTEXT->regs)
_stp_stack_snprint (THIS->__retvalue, MAXSTRINGLEN,