.title CRASH - crash & try to trap the trace .ident 'V1.0' ; .library /mar:always/ ;++ ; ; Facility: CRASH - TRACETRAP example program ; ; Author: David G. North, CCP ; ; Date: 90.12.04 ; ; Usage: ; $ MACRO CRASH/DEBUG ; $ LINK CRASH,TRACETRAP/DEBUG ; $ RUN/NODEBUG TRACETRAP ; Hello ; Trace trap, code=%X1000000C, to file /TRACEBACK.LOG/ ; $ TYPE TRACEBACK.LOG ; Access violation, reason mask=00, virtual address=0000002D, ; PC=00000402, PSL=03C00000 ; Symbolic stack dump follows ; module name routine name line rel PC abs PC ; ; CRASH FRED3 72 00000002 00000402 ; CRASH FRED2 74 00000006 0000040E ; CRASH FRED1 77 00000006 00000415 ; CRASH MAIN 84 0000002C 00000442 ;-- ; psect definitions .psect $$data,rd,wrt,noshr,noexe,nopic .psect $$code,exe,nowrt,shr,pic ; sample MAIN that causes a traceback .psect $$data fnam: .ascid /TRACEBACK.LOG/ .psect $$code .entry fred3, ^m<> clrl @45 ;trash the program .entry fred2, ^m<> calls #0,fred3 ret .entry fred1, ^m<> calls #0,fred2 ret .entry main, ^m<> pushaw tracer pushaq fnam calls #2,g^INIT_TRACE_TRAP ;start the trap routine calls #0,fred1 movzwl #SS$_NORMAL,r0 ret .entry tracer, ^m<> PRINTF ,4(AP),8(AP) ret .end main