1 /*-------------------------------------------------------------------------
6 * Copyright (c) 1994, Regents of the University of California
10 * $Header: /cvsroot/pgsql/src/backend/utils/error/assert.c,v 1.9 1998/06/18 16:35:38 momjian Exp $
13 * This should eventually work with elog(), dlog(), etc.
15 *-------------------------------------------------------------------------
20 #include "postgres.h" /* where the declaration goes */
21 #include "utils/module.h"
23 #include "utils/exc.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 fprintf(stderr, "ExceptionalCondition: bad arguments\n");
52 "%s(\"%s:%s\", File: \"%s\", Line: %d)\n",
53 exceptionP->message, conditionName, 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);