RFR: 8307955: Prefer to PTRACE_GETREGSET instead of PTRACE_GETREGS in method 'ps_proc.c::process_get_lwp_regs'

Guoxiong Li gli at openjdk.org
Tue May 16 10:39:43 UTC 2023


On Tue, 16 May 2023 05:39:05 GMT, Chris Plummer <cjplummer at openjdk.org> wrote:

>> Hi all,
>> 
>> This patch revises the code of `ps_proc.c::process_get_lwp_regs`
>> to use `PTRACE_GETREGSET` first instead of `PTRACE_GETREGS`.
>> The `PTRACE_GETREGS` is not present on all architectures as the man page states [1].
>> And if we use `PTRACE_GETREGS` first, several tests will fail at the special envs,
>> such as my local riscv64-linux env. Please see [the issue](https://bugs.openjdk.org/browse/JDK-8307955) for more information.
>> 
>> And I remove the unnecessary comments and macro,
>> because the `sparc` arch related code had been removed.
>> 
>> Thanks for the review.
>> 
>> Best Regards,
>> -- Guoxiong
>> 
>> [1] https://man7.org/linux/man-pages/man2/ptrace.2.html
>
> Changes look good. I tested with our internal test system on all supported platforms and did not see any issues.

@plummercj Thanks for your test and review.

Waiting for another review.

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

PR Comment: https://git.openjdk.org/jdk/pull/13939#issuecomment-1549415870


More information about the serviceability-dev mailing list