Operating System - OpenVMS
1748185 Members
3957 Online
108759 Solutions
New Discussion юеВ

Re: Unwrapping a call stack in Fortran

 
SOLVED
Go to solution
HDS
Frequent Advisor

Unwrapping a call stack in Fortran

Hello.

When an image abend occurs, the call stack is unraveled, displaying a trace of the module names that brought us to the point of the abend. I am looking for a Fortran[-77] routine that would do the same without the abend.

For example,
%SYSTEM-F-ABORT, abort
%TRACE-F-TRACEBACK, symbolic stack dump follows
image module routine line
JOBTOPMEN FALEXIT FALEXIT 1999 JOBTOPMEN MFSERR MFSERRM 5336 JOBTOPMEN DABUSDAY DABUSDAY 140 JOBTOPMEN ISBUSDAY ISBUSDAY 55 JOBTOPMEN JBFNDJPR JBFNDJPR 3270 JOBTOPMEN JBBLDJPR JBBLDJPR 3437 JOBTOPMEN JBSETJPR JBSETJPR 3749 JOBTOPMEN JOBTOPMEN JOBTOPMEN 3603

I believe that I could use a subroutine that executes an internal WRITE with inconsistant variables...as doing so will generate a traceback dump and continue, but that seems a bit 'sloppy'.

I also understand that there are services that may do what I am looking for...
LIB$GET_INVO_CONTEXT and
LIB$GET_PREV_INVO_CONTEXT
but I have not been able to locate any examples on their use, and I believe that they only return the addresses of the routines...not their names.

Any suggestions? Ideas?

Many thanks,
Howard
4 REPLIES 4
Karl Rohwedder
Honored Contributor
Solution

Re: Unwrapping a call stack in Fortran

Hein van den Heuvel
Honored Contributor

Re: Unwrapping a call stack in Fortran


There was a recent discussion in comp.os.vms about this very topic under the subject "Who called me?"

http://groups.google.com/group/comp.os.vms/search?group=comp.os.vms&q=LIB%24GET_CURR_INVO_CONTEXT+&qt_g=1

Basically you can use the undocumented trace-back routine tbk$show_traceback and give it an action routine where your code will be called for every line in the current traceback.

Sample (C) code attached.
Enjoy!

Hein van den Heuvel
HvdH Performance Consulting



HDS
Frequent Advisor

Re: Unwrapping a call stack in Fortran

Yes...Thank you to Karl and Hein.
I believe that the directed discussion thread contains the desired information.

Much obliged.
Jan van den Ende
Honored Contributor

Re: Unwrapping a call stack in Fortran

Howard,

Welcome to the VMS Forum!

>>>
Yes...Thank you to Karl and Hein.
I believe that the directed discussion thread contains the desired information.

Much obliged.
<<<

For the way to express your thanks, see
http://forums1.itrc.hp.com/service/forums/helptips.do?#33

Proost.

Have one on em.

jpe
Don't rust yours pelled jacker to fine doll missed aches.