RFR: JDK-8305782: Provide MacroAssembler::breakpoint on aarch64 [v2]
Andrew Haley
aph at openjdk.org
Sun Apr 30 10:07:24 UTC 2023
On Tue, 11 Apr 2023 06:55:30 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.
>
> Thomas Stuefe has updated the pull request incrementally with one additional commit since the last revision:
>
> reuse Assembler::brk
The best way is like this:
address poo;
void stuff() {
... instructions ...
poo = pc();
... instructions ...
}
then, in gdb:
(gdb) b <somewhere after startup>
breakpoint 2 at 0xabcedf
(gdb) comm 2
Type commands for breakpoint(s) 2, one per line.
End with a line saying just "end".
>b *poo
>c
>end
(gdb)
Now, every time you run the program, a breakpoint will be set at `*poo`. And you can continue after the breakpoint.
-------------
PR Comment: https://git.openjdk.org/jdk/pull/13401#issuecomment-1528984092
More information about the hotspot-compiler-dev
mailing list