summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkenistoj <kenistoj>2007-12-27 21:30:51 +0000
committerkenistoj <kenistoj>2007-12-27 21:30:51 +0000
commit212fcc465abe7e7806a9b0a21385bd645cd13177 (patch)
tree1c62ee58044de73c4703dfb61053869404458952
parent3ece0f626dbb9bef8acf34f7fb3842a3cf3a2397 (diff)
downloadsystemtap-steved-212fcc465abe7e7806a9b0a21385bd645cd13177.tar.gz
systemtap-steved-212fcc465abe7e7806a9b0a21385bd645cd13177.tar.xz
systemtap-steved-212fcc465abe7e7806a9b0a21385bd645cd13177.zip
* runtime/uprobes/uprobes_x86_64.c: Fix handling of indirect
jmps and calls that use rip-relative addressing. Allow probing of opcode 0x63.
-rw-r--r--ChangeLog6
-rw-r--r--runtime/uprobes/uprobes_x86_64.c15
2 files changed, 16 insertions, 5 deletions
diff --git a/ChangeLog b/ChangeLog
index b4f41825..e2a6cc8d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2007-12-27 Jim Keniston <jkenisto@us.ibm.com>
+
+ * runtime/uprobes/uprobes_x86_64.c: Fix handling of indirect
+ jmps and calls that use rip-relative addressing. Allow probing
+ of opcode 0x63.
+
2007-12-13 Masami Hiramatsu <mhiramat@redhat.com>
* stap.1.in: Document about relay buffer sharing.
diff --git a/runtime/uprobes/uprobes_x86_64.c b/runtime/uprobes/uprobes_x86_64.c
index 23dcdadb..78969248 100644
--- a/runtime/uprobes/uprobes_x86_64.c
+++ b/runtime/uprobes/uprobes_x86_64.c
@@ -43,7 +43,7 @@ static const unsigned long good_insns_64[256 / 64] = {
W(0x30, 1,1,1,1,1,1,0,0,1,1,1,1,1,1,0,0), /* 30 */
W(0x40, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)| /* 40 */
W(0x50, 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1)| /* 50 */
- W(0x60, 0,0,0,0,0,0,0,0,1,1,1,1,0,0,0,0)| /* 60 */
+ W(0x60, 0,0,0,1,0,0,0,0,1,1,1,1,0,0,0,0)| /* 60 */
W(0x70, 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1), /* 70 */
W(0x80, 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1)| /* 80 */
W(0x90, 1,1,1,1,1,1,1,1,1,1,1,0,1,1,1,1)| /* 90 */
@@ -603,8 +603,13 @@ void uprobe_post_ssout(struct uprobe_task *utask, struct uprobe_probept *ppt,
regs->rax = utask->arch_info.saved_scratch_register;
else
regs->rcx = utask->arch_info.saved_scratch_register;
- regs->rip += (4 + correction);
- return;
+ /*
+ * The original instruction includes a displacement, and so
+ * is 4 bytes longer than what we've just single-stepped.
+ * Fall through to handle stuff like "jmpq *...(%rip)" and
+ * "callq *...(%rip)".
+ */
+ correction += 4;
}
/*
@@ -613,8 +618,8 @@ void uprobe_post_ssout(struct uprobe_task *utask, struct uprobe_probept *ppt,
* ppt->arch_info.flags.
*
* We don't bother skipping prefixes here because none of the
- * non-rip-relative instructions that require special treatment
- * involve prefixes.
+ * instructions that require special treatment (other than
+ * rip-relative instructions, handled above) involve prefixes.
*/
switch (*insn) {