10 int handler(struct _EXCEPTION_RECORD
*ExceptionRecord
,
11 void *EstablisherFrame
,
12 struct _CONTEXT
*ContextRecord
,
13 struct _DISPATCHER_CONTEXT
*DispatcherContext
)
15 fprintf(stderr
, "Crash, count %d\nExc Code %x Addr %x Nparams %d\n",
17 ExceptionRecord
->ExceptionCode
,
18 ExceptionRecord
->ExceptionAddress
,
19 ExceptionRecord
->NumberParameters
);
21 return EXCEPTION_EXECUTE_HANDLER
;
24 #define FN DATAPATH "/exc-log.txt"
26 int main(int argc
, char *argv
[])
27 __attribute__((__exception_handler__(handler
)));
29 int main(int argc
, char *argv
[])
35 fprintf(stderr
, "File " FN
" not open\n");
40 fprintf(stderr
, "Start\n");
42 fprintf(stderr
, "Main: survived\n");