From: Glenn Wolf [r39604@pulsar.sps.mot.com] Sent: Friday, June 11, 1999 11:51 AM To: Info-VAX@Mvb.Saic.Com Subject: Re: Signal handling and tracebacks system@SendSpamHere.ORG (Brian Schenkenberger, VAXman-) writes: > > If you could share the code in the condition handler, that might help > How's your fortran? Here's a snippet, without all the fortran declaration rigamarole. There's a little more (very little) to the actual production routine, but the problem I see is when this path is executed. integer*4 function Cue_Error_SignalHandler (sigArgs, mechArgs) if ((sigargs(2) .and. STS$M_FAC_SP) .or. .not. (sigargs(2) .and. STS$K_SEVERE)) then ! Signal is either non-fatal, or facility specific. Generate a traceback ! so we can find out where the error occurred. Do this by signalling with ! the severity set to warning. The traceback handler will catch this, ! generate the trace, and return. Call Lib$Signal(%val(sigargs(2) .and. (.not. 7))) ! Now, get the message for the real error & severity, and put it ! in the CUE message buffers where the caller can find it Call Lib$Sys_GetMsg(sigargs(2), ! Get message indicator & KeyLength, & ErrorKey, & FacilityMask+SeverityMask+MessageMask) Call Lib$Sys_GetMsg(sigargs(2), ! Get message text & TextLength, & ErrorText, & TextMask) Call Cue_Error_Set(ErrorKey(:KeyLength), ErrorText(:TextLength)) ! Simulate LIB$SIG_TO_RET, except that the stack is unwound to the ! establisher of the condition handler, not its caller if (mechargs(1).eq.4) then ! We're on a VAX depth = mechargs(3) mechargs (4) = sigargs(2) else ! We're on an Alpha depth = mechargs(5) mechargs (13) = sigargs(2) ! status to be returned mechargs (14) = 0 ! On ALPHA the next item is the top half of R0. ! On VAX the next item is R1, which is harmless. endif ! check status of: unwinding stack, to establisher, no alt. PC call Gut_Check (Sys$Unwind (depth, %val(0))) Cue_Error_SignalHandler = 1 ! We handled the condition else ! we don't know how to handle any other signal. ! resignal everything else. Cue_Error_SignalHandler = 0 endif > > > You can pick up a sample of both SNAPSHOT and TRACER (the callable > symbolic traceback) from ftp://ftp.tmesis.com. There are several > examples demonstrating how to call the traceback there as well: > TRACER_CALLING_DEMO.{FOR,C,MAR} > > UNZIP the SNAPSHOT and/or TRACER files and then, VMSINSTAL them. > > -- I've pulled them down, and will look into them. Thanks for your help. -- =+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+ Glenn D. Wolf Motorola SPS business: Glenn_Wolf@email.sps.mot.com SPS IT CIM Solutions personal: Glenn_D_Wolf@msn.com 426 North 44th St. voice: (602) 914-8188 Mail Drop: GW-250 fax: (602) 914-8130 Phoenix AZ 85008 =+=+=+ I don't speak for Motorola, Motorola doesn't speak for me! =+=+=+