RFR: JDK-8305782: Provide MacroAssembler::breakpoint on aarch64

Feilong Jiang fjiang at openjdk.org
Mon Apr 10 06:43:43 UTC 2023


On Sun, 9 Apr 2023 07:45:46 GMT, Thomas Stuefe <stuefe at openjdk.org> wrote:

> The ability to emit debug traps was useful for me on arm, and I miss it on aarch64.
> 
> Tested manually on Linux aarch64 in gdb with various values for hint covering the whole 16-bit range set. Hint gets encoded in the instruction (gdb decodes instruction as "BRK xxx" with xxx being the hint). According to documentation the hint ends up in ESR.ELx.ISS after the trap hit, but gdb refused to display the ESR register, so I could not verify that.

src/hotspot/cpu/aarch64/macroAssembler_aarch64.cpp line 2525:

> 2523: void MacroAssembler::breakpoint(uint16_t hint_imm16) {
> 2524:   // BRK with hint
> 2525:   const uint32_t c = 0xD4200000 | (((uint32_t)hint_imm16) << 5);

aarch64 already provides `brk` at assembler [1],  for readability, maybe we can just simply use `brk(hint_imm16)` here.

1. https://github.com/openjdk/jdk/blob/969a6b9fd7f7afc60250309f3ada205c1473cf8e/src/hotspot/cpu/aarch64/assembler_aarch64.hpp#L1036

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/13401#discussion_r1161478302


More information about the hotspot-compiler-dev mailing list