home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 10 Tools
/
10-Tools.zip
/
mod201j.zip
/
modula2.exe
/
os2src
/
dumper.def
< prev
next >
Wrap
Text File
|
1996-01-25
|
4KB
|
118 lines
DEFINITION MODULE DUMPER;
(*************************************************************************
DUMPER.DEF Interface for postmortem debugger SeeDump's DUMPER.DLL
This file requires the postmortem debugger "SeeDump".
"SeeDump" is distributed by
a priori computer solutions GmbH, Munich, Germany
E-Mail: 100137.2315@compuserve.com
Fax: +49-69-236426
DUMPER.DLL sets up a new OS/2 exception handler
which will then generate a special dump file
for the postmortem debugger.
The program importing this definition should intialize the
DUMPER.DLL as follows:
MODULE ...
(*$XL+*)
(*$CDECL+*)
...
IMPORT DUMPER;
....
VAR
ExceptReg : DUMPER.SEEDUMPREGREC;
...
BEGIN (* of program module *)
ExceptReg.prev_structure := NIL;
ExceptReg.ExceptionHandler := NIL;
ExceptReg.flag := DUMPER_DEFAULT;
ExceptReg.DoTheDumpEnv := NIL;
ExceptReg.EndThreadHandler := 0;
_SETXCPTHANDLER( DUMPER_VERSION, ExceptReg );
...
END. (* of program module *)
Copyright (c) 1996 by Juergen Neuhoff
*************************************************************************)
(*$XL+ extended M2-language *)
(*$CDECL+ C-style procedures *)
FROM OS2DEF IMPORT PVOID, ULONG, PCHAR;
(********************************************************************
_SETXCPTHANDLER will register an exception handler to write a dump
whenever the thread, which has issued this call, traps.
parameter "flag" can take the value EXIT_THREAD to indicate that only the
thread where the exception occurred should be terminated.
If this bit is not set, the process will be terminated.
A new file can be written each time by specifying
DUMPER_NEWFILE. In this case up to 10 dump files will be
written to the dump directory.
The directory for the dumps can be set using the environment
variable SEEDUMPDUMPDIR. If not set, the current directory is
used.
If a trap occurs, some information is displayed using
printf. This is set using the DUMPER_VERBOSE parameter.
The DUMPER_EXITLIST displays some information as the process
terminates.
parameter "DoTheDumpEnv" points to a string which can be used to specify
an environment variable. When a trap occurs, this variable is
checked. If it is not set, the exception is passed to OS/2. If
it is set, the dump file is written. For example, use
DoTheDumpEnv = "WRITE_DUMP" to write a dump file only if the
environment variable "WRITE_DUMP" is set. The empty string ""
is interpreted to always take a dump.
parameter "EndThreadHandler" can be used with the DUMPER_EXITTHREAD
parameter. This should contain the address of the function
to call to terminate the thread. Default is DosExit( EXIT_THREAD ).
parameter "regrec" must point to the struct SEEDUMPREGREC
which must be addressable when an exception occurs.
The best place to declare it, is at the very beginning of main
or the entry routine of a thread.
********************************************************************)
CONST
DUMPER_VERSION = 00010001H;
DUMPER_EXITTHREAD = 00000001H;
DUMPER_EXITLIST = 00000002H;
DUMPER_VERBOSE = 00000004H;
DUMPER_NEWFILE = 00000008H;
DUMPER_DEFAULT = ( DUMPER_EXITTHREAD OR
DUMPER_EXITLIST OR
DUMPER_VERBOSE OR
DUMPER_NEWFILE
);
(*$V+*)
TYPE
SEEDUMPREGREC = RECORD
prev_structure : PVOID; (* volatile *)
ExceptionHandler : PVOID; (* volatile *)
flag : ULONG;
DoTheDumpEnv : PCHAR;
EndThreadHandler : ULONG;
END;
PSEEDUMPREGREC = POINTER TO SEEDUMPREGREC;
(*$V-*)
PROCEDURE _SETXCPTHANDLER
(
version : ULONG;
VAR regrec : SEEDUMPREGREC
);
END DUMPER.