Debian Codegraph @

rpython/translator/c/src/exception.h

raw symbols SCIP
1
2 /************************************************************/
3 /*** C header subsection: exceptions ***/
4
5 #ifdef HAVE_RTYPER // shrug, hopefully dies with PYPY_NOT_MAIN_FILE
6
7 /* just a renaming, unless DO_LOG_EXC is set */
8 #define RPyExceptionOccurred RPyExceptionOccurred1
9 #define RPY_DEBUG_RETURN() /* nothing */
10
11
12 #ifdef DO_LOG_EXC
13 #undef RPyExceptionOccurred
14 #undef RPY_DEBUG_RETURN
15 #define RPyExceptionOccurred() RPyDebugException(" noticing a")
16 #define RPY_DEBUG_RETURN() RPyDebugException("leaving with")
17 #define RPyDebugException(msg) ( \
18 RPyExceptionOccurred1() \
19 ? (RPyDebugReturnShowException(msg, __FILE__, __LINE__, __FUNCTION__), 1) \
20 : 0 \
21 )
22 #endif
23 /* !DO_LOG_EXC: define the function anyway, so that we can shut
24 off the prints of a debug_exc by remaking only testing_1.o */
25 RPY_EXTERN
26 void RPyDebugReturnShowException(const char *msg, const char *filename,
27 long lineno, const char *functionname);
28
29 /* Hint: functions and macros not defined here, like RPyRaiseException,
30 come from exctransformer via the table in extfunc.py. */
31
32 #define RPyFetchException(etypevar, evaluevar, type_of_evaluevar) do { \
33 etypevar = RPyFetchExceptionType(); \
34 evaluevar = (type_of_evaluevar)RPyFetchExceptionValue(); \
35 RPyClearException(); \
36 } while (0)
37
38 /* prototypes */
39
40 RPY_EXTERN
41 void _RPyRaiseSimpleException(RPYTHON_EXCEPTION rexc);
42
43 #endif