[fpc-devel] -dTEST_WIN32_SEH

Sven Barth pascaldragon at googlemail.com
Sun Apr 13 21:31:41 CEST 2014


On 13.04.2014 19:27, Martin Frb wrote:
> On 13/04/2014 16:54, Sergei Gorelkin wrote:
>> Since the new exception handling is compilant with "official way to do
>> it", I'd expect the debugger to be notified about exception by Windows
>> directly. But I have no idea about how gdb is compatible with that.
>> Maybe it must be configured in certain way.
>>
>> Anyway, the exception information including its original address is
>> still available when control is passed to __FPC_except_handler. This
>> handler is called twice, first time it initiates unwinding and the
>> second time restores the stack and jumps to code of "except" block.
>
> Ok, thanks for the info.
>
> Will see what I can find.

On Windows a debugger will use the debugging API which (most 
importantly) involves WaitForDebugEvent() (see 
http://msdn.microsoft.com/en-us/library/windows/desktop/ms681423%28v=vs.85%29.aspx 
) of which the returned DEBUG_EVENT structure (see 
http://msdn.microsoft.com/en-us/library/windows/desktop/ms679308%28v=vs.85%29.aspx 
) contains among others information of the exception. The debugger is 
informed of such an exception twice: once before the exception handler 
is called and once afterwards if no handler decided to handle the 
exception (called first change and second/last change exception 
handling). GDB should handle this already as it is able to present 
SIGSEGVs etc. which rely on the information provided by Windows...

Regards,
Sven




More information about the fpc-devel mailing list