From 1b8ca75eaaff2985709ad61cc33c77a673c75a8c Mon Sep 17 00:00:00 2001 From: =?utf8?q?Alejandro=20S=C3=A1ez?= Date: Mon, 23 May 2022 12:07:47 +0000 Subject: [PATCH] runtime: fix breakpoint in ppc64x Currently runtime.Breakpoint generates a SIGSEGV in ppc64. The solution is an unconditional trap similar to what clang and gcc do. It is documented in the section C.6 of the ABI Book 3. Fixes #52101 Change-Id: I071d2f2679b695ef268445b04c9222bd74e1f9af GitHub-Last-Rev: fff4e5e8ffe23bf0cef135b22abd2cc0a3838613 GitHub-Pull-Request: golang/go#52102 Reviewed-on: https://go-review.googlesource.com/c/go/+/397554 Reviewed-by: Dmitri Shuralyov TryBot-Result: Gopher Robot Reviewed-by: Paul Murphy Run-TryBot: Paul Murphy Reviewed-by: Cherry Mui --- src/runtime/asm_ppc64x.s | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/runtime/asm_ppc64x.s b/src/runtime/asm_ppc64x.s index ec17dc9ce3..c6bcf82ec0 100644 --- a/src/runtime/asm_ppc64x.s +++ b/src/runtime/asm_ppc64x.s @@ -106,7 +106,7 @@ DATA runtime·mainPC+0(SB)/8,$runtime·main(SB) GLOBL runtime·mainPC(SB),RODATA,$8 TEXT runtime·breakpoint(SB),NOSPLIT|NOFRAME,$0-0 - MOVD R0, 0(R0) // TODO: TD + TW $31, R0, R0 RET TEXT runtime·asminit(SB),NOSPLIT|NOFRAME,$0-0 -- 2.48.1