diff options
| author | Srinivas Pokala <Pokala.Srinivas@ibm.com> | 2022-12-14 06:31:50 +0100 |
|---|---|---|
| committer | Keith Randall <khr@golang.org> | 2023-01-20 05:00:12 +0000 |
| commit | 3e77efc7204407c5c8882bec42fdcaa88ef40a9b (patch) | |
| tree | 81273a001366a3c604d93788cb46df2a64693154 /src/cmd/internal | |
| parent | 5c67ebbb31a296ca1593d0229b1d51d5ac73aa6d (diff) | |
| download | go-3e77efc7204407c5c8882bec42fdcaa88ef40a9b.tar.xz | |
cmd/internal/obj/s390x, runtime: fix breakpoint in s390x
Currently runtime.Breakpoint generates SIGSEGV in s390x.
The solution to this is add new asm instruction BRRK of
type FORMAT_E for the breakpoint exception.
Fixes #52103
Change-Id: I8358a56e428849a5d28d5ade141e1d7310bee084
Reviewed-on: https://go-review.googlesource.com/c/go/+/457456
Reviewed-by: Keith Randall <khr@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Cherry Mui <cherryyz@google.com>
Run-TryBot: Keith Randall <khr@golang.org>
Reviewed-by: Keith Randall <khr@google.com>
Diffstat (limited to 'src/cmd/internal')
| -rw-r--r-- | src/cmd/internal/obj/s390x/a.out.go | 3 | ||||
| -rw-r--r-- | src/cmd/internal/obj/s390x/anames.go | 1 | ||||
| -rw-r--r-- | src/cmd/internal/obj/s390x/asmz.go | 7 |
3 files changed, 11 insertions, 0 deletions
diff --git a/src/cmd/internal/obj/s390x/a.out.go b/src/cmd/internal/obj/s390x/a.out.go index c1bda1fced..cdfb6ddff3 100644 --- a/src/cmd/internal/obj/s390x/a.out.go +++ b/src/cmd/internal/obj/s390x/a.out.go @@ -994,6 +994,9 @@ const ( AWORD ADWORD + // Breakpoint + ABRRK + // end marker ALAST diff --git a/src/cmd/internal/obj/s390x/anames.go b/src/cmd/internal/obj/s390x/anames.go index 8b2a76b2c9..3af15a504c 100644 --- a/src/cmd/internal/obj/s390x/anames.go +++ b/src/cmd/internal/obj/s390x/anames.go @@ -716,5 +716,6 @@ var Anames = []string{ "BYTE", "WORD", "DWORD", + "BRRK", "LAST", } diff --git a/src/cmd/internal/obj/s390x/asmz.go b/src/cmd/internal/obj/s390x/asmz.go index d8a36c4e9c..d9f76061ef 100644 --- a/src/cmd/internal/obj/s390x/asmz.go +++ b/src/cmd/internal/obj/s390x/asmz.go @@ -333,6 +333,9 @@ var optab = []Optab{ // undefined (deliberate illegal instruction) {i: 78, as: obj.AUNDEF}, + // Break point instruction(0x0001 opcode) + {i: 73, as: ABRRK}, + // 2 byte no-operation {i: 66, as: ANOPH}, @@ -2470,6 +2473,7 @@ const ( op_XSCH uint32 = 0xB276 // FORMAT_S CANCEL SUBCHANNEL op_XY uint32 = 0xE357 // FORMAT_RXY1 EXCLUSIVE OR (32) op_ZAP uint32 = 0xF800 // FORMAT_SS2 ZERO AND ADD + op_BRRK uint32 = 0x0001 // FORMAT_E BREAKPOINT // added in z13 op_CXPT uint32 = 0xEDAF // RSL-b CONVERT FROM PACKED (to extended DFP) @@ -3605,6 +3609,9 @@ func (c *ctxtz) asmout(p *obj.Prog, asm *[]byte) { zSIL(opcode, uint32(r), uint32(d), uint32(v), asm) } + case 73: //Illegal opcode with SIGTRAP Exception + zE(op_BRRK, asm) + case 74: // mov reg addr (including relocation) i2 := c.regoff(&p.To) switch p.As { |
