GetLastError() (with and without debugger)

Pedro Lamarão pedro.lamarao at prodist.com.br
Fri Aug 12 15:58:00 UTC 2022


Em sex., 12 de ago. de 2022 às 12:05, Pedro Lamarão <
pedro.lamarao at prodist.com.br> escreveu:

>
> Em sex., 12 de ago. de 2022 às 12:01, Maurizio Cimadamore <
> maurizio.cimadamore at oracle.com> escreveu:
>
> As I said, I believe this should be visible in JNI too - but perhaps
>> nobody would write code like this using JNI. E.g. with JNI, since it's
>> painful enough to write one native method, developers tend to "lump"
>> multiple functionalities, e.g. error checking, in the same native method
>> implementation. Which, coincidentally, bypasses some issues that might be
>> visible when using debuggers (so it is possible that this is a problem that
>> debuggers never had to worry too much about).
>>
>
> Something like this would happen in JNA and JNR based code.
> I am familiar with these; I'll port the original poster program and push
> to Github.
>

Here: https://github.com/pedrolamarao/jvm-getlasterror

Intellij should be able to understand this with a JDK 19 EA build.

Simply running the program in the IDE gives the expected result for
"panama" and "jna", but not "jnr", in my machine.
Very interesting.

-- 
Pedro Lamarão
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.org/pipermail/panama-dev/attachments/20220812/985dca02/attachment-0001.htm>


More information about the panama-dev mailing list