Skip to content

Commit

Permalink
runtime: fix Breakpoint in ppc64x
Browse files Browse the repository at this point in the history
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 golang#52101
  • Loading branch information
alexsaezm committed Apr 1, 2022
1 parent 62d4c32 commit 364a743
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/runtime/asm_ppc64x.s
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ DATA runtime·mainPC+0(SB)/8,$runtime·main<ABIInternal>(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
Expand Down

0 comments on commit 364a743

Please sign in to comment.