1 /*-------------------------------------------------------------------------
6 * Portions Copyright (c) 1996-2000, PostgreSQL, Inc
7 * Portions Copyright (c) 1994, Regents of the University of California
11 * $Header: /cvsroot/pgsql/src/backend/utils/error/assert.c,v 1.17 2000/01/26 05:57:20 momjian Exp $
14 * This should eventually work with elog(), dlog(), etc.
16 *-------------------------------------------------------------------------
22 #include "utils/exc.h"
23 #include "utils/trace.h"
26 ExceptionalCondition(char *conditionName,
27 Exception *exceptionP,
32 extern char *ExcFileName; /* XXX */
33 extern Index ExcLineNumber; /* XXX */
35 ExcFileName = fileName;
36 ExcLineNumber = lineNumber;
38 if (!PointerIsValid(conditionName)
39 || !PointerIsValid(fileName)
40 || !PointerIsValid(exceptionP))
42 EPRINTF("TRAP: ExceptionalCondition: bad arguments\n");
51 EPRINTF("TRAP: %s(\"%s:%s\", File: \"%s\", Line: %d)\n",
52 exceptionP->message, conditionName,
53 (detail == NULL ? "" : detail),
54 fileName, lineNumber);
57 #ifdef ABORT_ON_ASSERT
60 #ifdef SLEEP_ON_ASSERT
65 * XXX Depending on the Exception and tracing conditions, you will XXX
66 * want to stop here immediately and maybe dump core. XXX This may be
67 * especially true for Assert(), etc.
70 /* TraceDump(); dump the trace stack */
72 /* XXX FIXME: detail is lost */
73 ExcRaise(exceptionP, (ExcDetail) 0, (ExcData) NULL, conditionName);