GetLastError() (with and without debugger)

Pedro Lamarão pedro.lamarao at prodist.com.br
Fri Aug 12 14:55:30 UTC 2022


Em sex., 12 de ago. de 2022 às 11:50, Maurizio Cimadamore <
maurizio.cimadamore at oracle.com> escreveu:

>
> On 12/08/2022 15:43, Pedro Lamarão wrote:
>
>
> This is incorrect. WriteFile() indicates an error, but GetLastError()
>> returns 0 (= NO_ERROR). Could it be that the debugger calls another Windows
>> API function between those two functions, resetting the last error?
>>
>> In my project that's a major issue. Since the software behaves
>> incorrectly with the debugger, the software can no longer be debugged. This
>> doesn't just affect it when debugging this particular piece of code but
>> anytime this code is run in a debugging session.
>>
>
>
> This would be a blocker for all applications of Windows API functions via
> panama.
> Windows Sockets has a similar mechanism called WSAGetLastError.
>
> And JNI - I doubt there's anything Panama specific here (unless proven
> otherwise).
>

Of course, this would disturb any interaction with Windows API, however it
was activated.
For some reason, such a debugger has been working with software for some
time, and I presume it works with software that calls the system via JNI.
Is there perhaps some kind of special "locking" when calling into JNI which
the debugger might have learned to respect?

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


More information about the panama-dev mailing list