Re: Catching OS Exceptions in Windows using LDC

2020-07-07 Thread realhet via Digitalmars-d-learn
On Saturday, 4 July 2020 at 14:44:06 UTC, Kagamin wrote: try https://docs.microsoft.com/en-us/windows/win32/api/errhandlingapi/nf-errhandlingapi-setunhandledexceptionfilter Thank You, this was the winner for me. Not just I can catch the OS Exceptions, I can check and alter the CPU state and

Re: Catching OS Exceptions in Windows using LDC

2020-07-04 Thread kinke via Digitalmars-d-learn
On Saturday, 4 July 2020 at 12:59:03 UTC, Adam D. Ruppe wrote: For whatever reason, dmd 64 bit and ldc decided to do their own thing instead of following the Windows standard and thus have no interop with OS exceptions. For LDC, we don't do 'our own thing', but use MSVC++ EH, which allows to

Re: Catching OS Exceptions in Windows using LDC

2020-07-04 Thread Kagamin via Digitalmars-d-learn
try https://docs.microsoft.com/en-us/windows/win32/api/errhandlingapi/nf-errhandlingapi-setunhandledexceptionfilter

Re: Catching OS Exceptions in Windows using LDC

2020-07-04 Thread Adam D. Ruppe via Digitalmars-d-learn
On Saturday, 4 July 2020 at 12:45:50 UTC, realhet wrote: It was not a problem on other systems like: MSVC or Delphi, but on LDC these events are completely ignored. use dmd with -m32 or -m32mscoff and it works correctly automatically. For whatever reason, dmd 64 bit and ldc decided to do

Catching OS Exceptions in Windows using LDC

2020-07-04 Thread realhet via Digitalmars-d-learn
Hi, I'd like to catch the OS Exceptions including: - access violation - int 3 - invalid opcode etc. The default behavior is that when these events happen, the program immediately exits with some negative exit code. It was not a problem on other systems like: MSVC or Delphi, but on LDC