I implemented an exception handler and registered it with SIGNALQQ. Within this exception handler I want to call TRACEBACKQQ function with EPTR option. Unfortunately GETEXCEPTIONPTRSQQ() function returns NULL. Does anyone of you have an idea why? Thank you for your time in advance.
integer(4) function h_fpe (signum,ecode) !DIR$ ATTRIBUTES C :: h_fpe !params integer(2) :: signum integer(2) :: ecode !variables integer(4) :: RTN_STS integer(KIND=INT_PTR_KIND()) :: EPTRS include 'FOR_IOSDEF.FOR' !body !write(*,'(/,A)') 'in signal handler for sig$fpe' !write(*,*) 'signum = ', signum !write(*,*) 'ecode = ', ecode !read(*,*) EPTRS = GETEXCEPTIONPTRSQQ() call TRACEBACKQQ(USER_EXIT_CODE=-1,STATUS=RTN_STS,EPTR=EPTRS) if (RTN_STS .EQ. FOR$IOS_SUCCESS) then write(*,*) 'TRACEBACK WAS SUCCESSFUL' read(*,*) end if h_fpe = 1 end
I would try adding USE IFCORE to your program so that GetExceptionPtrsQQ is properly defined.
It's possible that the return value is being interpreted as a REAL, being converted to INTEGER before being stored in EPTRS, and weird things are happening.
I hope this helps --
I am still NOT able to figure out why GETEXCEPTIONPTRSQQ function returns NULL when it is called within exception handler. Why I am not able to use this nice feature...