Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix macOS arm64 Unix breakpoint #108560

Merged
merged 3 commits into from
Oct 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 4 additions & 11 deletions src/coreclr/jit/compiler.h
Original file line number Diff line number Diff line change
Expand Up @@ -12449,17 +12449,10 @@ const instruction INS_SQRT = INS_vsqrt;

#ifdef TARGET_ARM64

const instruction INS_MULADD = INS_madd;
inline const instruction INS_BREAKPOINT_osHelper()
{
// GDB needs the encoding of brk #0
// Windbg needs the encoding of brk #F000
return TargetOS::IsUnix ? INS_brk_unix : INS_brk_windows;
}
#define INS_BREAKPOINT INS_BREAKPOINT_osHelper()

const instruction INS_ABS = INS_fabs;
const instruction INS_SQRT = INS_fsqrt;
const instruction INS_MULADD = INS_madd;
const instruction INS_BREAKPOINT = INS_brk;
const instruction INS_ABS = INS_fabs;
const instruction INS_SQRT = INS_fsqrt;

#endif // TARGET_ARM64

Expand Down
7 changes: 2 additions & 5 deletions src/coreclr/jit/instrsarm64.h
Original file line number Diff line number Diff line change
Expand Up @@ -1593,11 +1593,8 @@ INST1(nop, "nop", 0, IF_SN_0A, 0xD503201F)
INST1(yield, "yield", 0, IF_SN_0A, 0xD503203F)
// yield SN_0A 1101010100000011 0010000000111111 D503 203F

INST1(brk_windows, "brk_windows", 0, IF_SI_0A, 0xD43E0000)
// brk (windows) SI_0A 1101010000111110 0000000000000000 D43E 0000 0xF000

INST1(brk_unix, "brk_unix", 0, IF_SI_0A, 0xD4200000)
// brk imm16 SI_0A 11010100001iiiii iiiiiiiiiii00000 D420 0000 imm16
INST1(brk, "brk", 0, IF_SI_0A, 0xD43E0000)
// brk 0xf000 SI_0A 1101010000111110 0000000000000000 D43E 0000 0xF000

INST1(dsb, "dsb", 0, IF_SI_0B, 0xD503309F)
// dsb barrierKind SI_0B 1101010100000011 0011bbbb10011111 D503 309F imm4 - barrier kind
Expand Down
2 changes: 1 addition & 1 deletion src/coreclr/pal/inc/unixasmmacrosarm64.inc
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ C_FUNC(\Name\()_End):
.endm

.macro EMIT_BREAKPOINT
brk #0
brk #0xf000
.endm

//-----------------------------------------------------------------------------
Expand Down
Loading