Debian Codegraph @

rpython/translator/c/src/exception.c

raw symbols SCIP
1 #include "singleheader.h"
2 #include "src/exception.h"
3
4 #if defined(PYPY_CPYTHON_EXTENSION)
5 PyObject *RPythonError;
6 #endif
7
8 /******************************************************************/
9 #ifdef HAVE_RTYPER /* RPython version of exceptions */
10 /******************************************************************/
11
12 void RPyDebugReturnShowException(const char *msg, const char *filename,
13 long lineno, const char *functionname)
14 {
15 #ifdef DO_LOG_EXC
16 fprintf(stderr, "%s %.*s: %s:%ld %s\n", msg,
17 (int)(RPyFetchExceptionType()->ov_name->rs_chars.length),
18 RPyFetchExceptionType()->ov_name->rs_chars.items,
19 filename, lineno, functionname);
20 #endif
21 }
22
23 /* Hint: functions and macros not defined here, like RPyRaiseException,
24 come from exctransformer via the table in extfunc.py. */
25
26 #define RPyFetchException(etypevar, evaluevar, type_of_evaluevar) do { \
27 etypevar = RPyFetchExceptionType(); \
28 evaluevar = (type_of_evaluevar)RPyFetchExceptionValue(); \
29 RPyClearException(); \
30 } while (0)
31
32 /* implementations */
33
34 void _RPyRaiseSimpleException(RPYTHON_EXCEPTION rexc)
35 {
36 RPyRaiseException(RPYTHON_TYPE_OF_EXC_INST(rexc), rexc);
37 }
38
39
40 /******************************************************************/
41 #endif /* HAVE_RTYPER */
42 /******************************************************************/