@@ -107,8 +107,18 @@ nocgo:
107
107
DATA runtime·mainPC + 0 (SB)/ 8 , $ runtime·main<ABIInternal>(SB)
108
108
GLOBL runtime·mainPC(SB) , RODATA , $ 8
109
109
110
+ // Windows ARM64 needs an immediate 0xf000 argument.
111
+ // See go.dev/issues/ 53837 .
112
+ #define BREAK \
113
+ #ifdef GOOS_windows \
114
+ BRK $ 0xf000 \
115
+ #else \
116
+ BRK \
117
+ #endif \
118
+
119
+
110
120
TEXT runtime·breakpoint(SB) , NOSPLIT|NOFRAME , $ 0 - 0
111
- BRK
121
+ BREAK
112
122
RET
113
123
114
124
TEXT runtime·asminit(SB) , NOSPLIT|NOFRAME , $ 0 - 0
@@ -1325,7 +1335,7 @@ TEXT runtime·debugCallV2<ABIInternal>(SB),NOSPLIT|NOFRAME,$0-0
1325
1335
// Set R20 to 8 and invoke BRK. The debugger should get the
1326
1336
// reason a call can't be injected from SP + 8 and resume execution.
1327
1337
MOVD $ 8 , R20
1328
- BRK
1338
+ BREAK
1329
1339
JMP restore
1330
1340
1331
1341
good:
@@ -1374,7 +1384,7 @@ good:
1374
1384
MOVD $ 20 , R0
1375
1385
MOVD R0 , 16 ( RSP ) // length of debugCallFrameTooLarge string
1376
1386
MOVD $ 8 , R20
1377
- BRK
1387
+ BREAK
1378
1388
JMP restore
1379
1389
1380
1390
restore:
@@ -1383,7 +1393,7 @@ restore:
1383
1393
// Set R20 to 16 and invoke BRK. The debugger should restore
1384
1394
// all registers except for PC and RSP and resume execution.
1385
1395
MOVD $ 16 , R20
1386
- BRK
1396
+ BREAK
1387
1397
// We must not modify flags after this point.
1388
1398
1389
1399
// Restore pointer - containing registers , which may have been
@@ -1414,9 +1424,9 @@ restore:
1414
1424
TEXT NAME(SB) , WRAPPER , $ MAXSIZE - 0 ; \
1415
1425
NO_LOCAL_POINTERS ; \
1416
1426
MOVD $ 0 , R20 ; \
1417
- BRK ; \
1427
+ BREAK ; \
1418
1428
MOVD $ 1 , R20 ; \
1419
- BRK ; \
1429
+ BREAK ; \
1420
1430
RET
1421
1431
DEBUG_CALL_FN(debugCall32<> , 32 )
1422
1432
DEBUG_CALL_FN(debugCall64<> , 64 )
@@ -1439,7 +1449,7 @@ TEXT runtime·debugCallPanicked(SB),NOSPLIT,$16-16
1439
1449
MOVD val_data + 8 (FP) , R0
1440
1450
MOVD R0 , 16 ( RSP )
1441
1451
MOVD $ 2 , R20
1442
- BRK
1452
+ BREAK
1443
1453
RET
1444
1454
1445
1455
// Note: these functions use a special calling convention to save generated code space.
0 commit comments