Bug 2319 – "Win32 Exception" not very useful

Status
RESOLVED
Resolution
FIXED
Severity
enhancement
Priority
P3
Component
phobos
Product
D
Version
D2
Platform
x86
OS
Windows
Creation time
2008-08-29T03:18:00Z
Last change time
2015-06-09T05:15:02Z
Keywords
EH
Assigned to
bugzilla
Creator
nnbkxozgitfef

Comments

Comment #0 by nnbkxozgitfef — 2008-08-29T03:18:53Z
Currently _d_translate_se_to_d_exception() translates almost any Win32 SE (except for divide by zero, access violation and stack overflow) into a simple D Exception with the message set to "Win32 Exception" and no hint what the original exception was or where in the application the exception was raised. This is not at least helpful if you want to locate a bug. At least D should differentiate between the exceptions here: http://msdn.microsoft.com/en-us/library/aa363082(VS.85).aspx ...or better get a copy of the original EXCEPTION_RECORD structure, or perhaps the most significant members like ExceptionCode and ExceptionAddress.
Comment #1 by clugdbug — 2009-04-01T02:58:09Z
DMD 1.042 and 2.027 now generate the full list of exceptions. You won't see "Win32 Exception" any more. There's more that could be done with the EXCEPTION_RECORD structure, ideally a full back-trace -- but that's a different issue.
Comment #2 by torhu — 2009-04-01T15:03:04Z
Still get "Error: Win32 Exception" with this code: --- void main() { asm { int 3; } } --- No big deal for me, I just tried out of curiousity. Thought I'd mention it, though.
Comment #3 by clugdbug — 2009-04-02T02:19:43Z
(In reply to comment #2) > Still get "Error: Win32 Exception" with this code: > > --- > void main() > { > asm { int 3; } > } > --- > > No big deal for me, I just tried out of curiousity. Thought I'd mention it, > though. Yes, OK, it still generates Win32 exception for the following ones: case STATUS_INTEGER_OVERFLOW: // not supported on any x86 processor case STATUS_IN_PAGE_ERROR: case STATUS_INVALID_DISPOSITION: case STATUS_NONCONTINUABLE_EXCEPTION: case STATUS_BREAKPOINT: case STATUS_SINGLE_STEP: // In DMC, but not in Microsoft docs case STATUS_GUARD_PAGE_VIOLATION: case STATUS_INVALID_HANDLE: Perhaps the breakpoint one is important enough to treat specially. I'd forgotten that you can generate it without having a debugger attached. I'll add it in. The others can only be generated by compiler/runtime errors, I believe.