From 2e7f844220b9419b2f05234b07c56bcdedf7afb2 Mon Sep 17 00:00:00 2001 From: Tim Moore Date: Wed, 16 Dec 2009 18:00:34 +0100 Subject: function to translate from the uretprobe trampoline back to the original return address * runtime/uprobes2/uprobes.c (uprobe_get_pc): new function --- runtime/uprobes2/uprobes.h | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'runtime/uprobes2/uprobes.h') diff --git a/runtime/uprobes2/uprobes.h b/runtime/uprobes2/uprobes.h index ae0692f0..5d2a826e 100644 --- a/runtime/uprobes2/uprobes.h +++ b/runtime/uprobes2/uprobes.h @@ -88,6 +88,14 @@ extern void unregister_uretprobe(struct uretprobe *rp); /* For PRs 9940, 6852... */ extern void unmap_uprobe(struct uprobe *u); extern void unmap_uretprobe(struct uretprobe *rp); +/* + * Given a program counter, translate it back to the original address + * if it is the address of the trampoline. sp is the stack pointer for + * the frame that corresponds to the address. + */ +extern unsigned long uprobe_get_pc(struct uretprobe_instance *ri, + unsigned long pc, + unsigned long sp); #ifdef UPROBES_IMPLEMENTATION -- cgit