File: create_fatal_error_zshow_dmp.c

package info (click to toggle)
fis-gtm 6.2-000-1
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 30,784 kB
  • ctags: 42,554
  • sloc: ansic: 358,483; asm: 4,847; csh: 4,574; sh: 2,261; awk: 200; makefile: 86; sed: 13
file content (50 lines) | stat: -rw-r--r-- 1,826 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
/****************************************************************
 *								*
 *	Copyright 2010 Fidelity Information Services, Inc	*
 *								*
 *	This source code contains the intellectual property	*
 *	of its copyright holder(s), and is made available	*
 *	under a license.  If you do not know the terms of	*
 *	the license, please stop and do not read further.	*
 *								*
 ****************************************************************/

#include "mdef.h"

#ifdef VMS
#include <ssdef.h>
#endif
#ifdef UNIX
#include <signal.h>
#endif

#include "error.h"
#include "jobexam_process.h"
#include "gtmdbglvl.h"
#include "create_fatal_error_zshow_dmp.h"

LITDEF mval gtmfatal_error_filename = DEFINE_MVAL_LITERAL(MV_STR, 0, 0, SIZEOF(GTMFATAL_ERROR_DUMP_FILENAME) - 1,
							  GTMFATAL_ERROR_DUMP_FILENAME, 0, 0);

GBLREF	int4		exi_condition;
GBLREF	uint4		gtmDebugLevel;
GBLREF	volatile int4	gtmMallocDepth;

/* On VMS, SIGNAL is sig->chf$l_sig_name (a parameter to mdb_condition_handler) so needs to be passed in */
void create_fatal_error_zshow_dmp(int4 signal, boolean_t repeat_error)
{
	mval	dummy_mval;
	int4	save_SIGNAL;	/* On UNIX this is exi_condition */

	UNIX_ONLY(PRN_ERROR);
	if (UNIX_ONLY(0 == gtmMallocDepth && ((SIGBUS != exi_condition && SIGSEGV != exi_condition) ||
					      (GDL_ZSHOWDumpOnSignal & gtmDebugLevel)))
	    VMS_ONLY((SS$_ACCVIO != signal) || (GDL_ZSHOWDumpOnSignal & gtmDebugLevel)))
	{	/* If dumpable condition, create traceback file of M stack info and such */
		/* On Unix, we need to push out our error now before we potentially overlay it in jobexam_process() */
		/* Create dump file */
		UNIX_ONLY(save_SIGNAL = SIGNAL); 		/* Signal might be modified by jobexam_process() */
		jobexam_process((mval *)&gtmfatal_error_filename, &dummy_mval);
		UNIX_ONLY(SIGNAL = save_SIGNAL);
	}
}