On Tue, 22 Apr 2025 19:16:39 GMT, Kevin Walls <kev...@openjdk.org> wrote:

>> ah, interesting. The native caller doesn't print the error message, it 
>> throws a Java exception with the message in the exception string, and the 
>> Java code then deals with the exception.
>> 
>> This is different on MacOS, where the error message is printed, and then an 
>> exception with a generic message is thrown. I haven't checked what the 
>> Windows implementation does here.
>> 
>> The Linux implementation with dynamic exception messages was introduced in 
>> 57d8a71115b8fc9a2eb2be876a396c474c207cf3.
>> 
>> I'll modify the Linux Pgrab to report all errors through the exception 
>> message, and remove print_error from Pgrab.
>> 
>> Should I additionally modify the MacOS's 
>> Java_sun_jvm_hotspot_debugger_bsd_BsdDebuggerLocal_attach0__I to report all 
>> errors through the exception message and remove print_error, or is it OK if 
>> the implementations behave differently?
>
>> I'll modify the Linux Pgrab to report all errors through the exception 
>> message, and remove print_error from Pgrab.
> 
> That would be great.  There is some existing fragmentation/platform 
> differences here, so I don't think you need to make all the implementations 
> the same for this change.

I ended up not removing print_error; I found that ptrace_attach was reporting 
the failures using both print_error and the exception message, so it looked 
reasonable to use both mechanisms in other places too.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/24722#discussion_r2054914278

Reply via email to