git: 60013d9c5024 - main - dtrace: Fix the i386 FBT build

From: Mark Johnston <markj_at_FreeBSD.org>
Date: Tue, 01 Nov 2022 04:18:59 UTC
The branch main has been updated by markj:

URL: https://cgit.FreeBSD.org/src/commit/?id=60013d9c5024c86f4c7027ed2b18856517e8a05c

commit 60013d9c5024c86f4c7027ed2b18856517e8a05c
Author:     Mark Johnston <markj@FreeBSD.org>
AuthorDate: 2022-11-01 04:14:30 +0000
Commit:     Mark Johnston <markj@FreeBSD.org>
CommitDate: 2022-11-01 04:17:48 +0000

    dtrace: Fix the i386 FBT build
    
    Reported by:    Jenkins
    Fixes:  0e69c959150c ("dtrace: Fix up %rip for invop probes on x86")
---
 sys/cddl/dev/fbt/x86/fbt_isa.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/sys/cddl/dev/fbt/x86/fbt_isa.c b/sys/cddl/dev/fbt/x86/fbt_isa.c
index b05ae4cb2c44..481e65bd761b 100644
--- a/sys/cddl/dev/fbt/x86/fbt_isa.c
+++ b/sys/cddl/dev/fbt/x86/fbt_isa.c
@@ -89,7 +89,11 @@ fbt_invop(uintptr_t addr, struct trapframe *frame, uintptr_t scratch __unused)
 		 * Report the address of the breakpoint for the benefit
 		 * of consumers fetching register values with regs[].
 		 */
+#ifdef __i386__
+		frame->tf_eip--;
+#else
 		frame->tf_rip--;
+#endif
 		for (; fbt != NULL; fbt = fbt->fbtp_tracenext) {
 			ASSERT(fbt->fbtp_rval == fbtrval);
 			if (fbt->fbtp_roffset == 0) {
@@ -150,7 +154,11 @@ fbt_invop(uintptr_t addr, struct trapframe *frame, uintptr_t scratch __unused)
 			}
 		}
 		/* Advance to the instruction following the breakpoint. */
+#ifdef __i386__
+		frame->tf_eip++;
+#else
 		frame->tf_rip++;
+#endif
 		return (fbtrval);
 	}