forked from python/cpython
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpycore_traceback.h
More file actions
62 lines (47 loc) · 1.81 KB
/
pycore_traceback.h
File metadata and controls
62 lines (47 loc) · 1.81 KB
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
51
52
53
54
55
56
57
58
59
60
61
62
#ifndef Py_INTERNAL_TRACEBACK_H
#define Py_INTERNAL_TRACEBACK_H
#ifdef __cplusplus
extern "C" {
#endif
#ifndef Py_BUILD_CORE
# error "this header requires Py_BUILD_CORE define"
#endif
// Export for '_ctypes' shared extension
PyAPI_FUNC(int) _Py_DisplaySourceLine(PyObject *, PyObject *, int, int, int *, PyObject **);
// Export for 'pyexact' shared extension
PyAPI_FUNC(void) _PyTraceback_Add(const char *, const char *, int);
/* Write a Unicode object into the file descriptor fd. Encode the string to
ASCII using the backslashreplace error handler.
Do nothing if text is not a Unicode object.
This function is signal safe. */
extern void _Py_DumpASCII(int fd, PyObject *text);
/* Format an integer as decimal into the file descriptor fd.
This function is signal safe. */
extern void _Py_DumpDecimal(
int fd,
size_t value);
/* Format an integer as hexadecimal with width digits into fd file descriptor.
The function is signal safe. */
extern void _Py_DumpHexadecimal(
int fd,
uintptr_t value,
Py_ssize_t width);
extern PyObject* _PyTraceBack_FromFrame(
PyObject *tb_next,
PyFrameObject *frame);
#define EXCEPTION_TB_HEADER "Traceback (most recent call last):\n"
#define EXCEPTION_GROUP_TB_HEADER "Exception Group Traceback (most recent call last):\n"
/* Write the traceback tb to file f. Prefix each line with
indent spaces followed by the margin (if it is not NULL). */
extern int _PyTraceBack_Print(
PyObject *tb, const char *header, PyObject *f);
extern int _Py_WriteIndentedMargin(int, const char*, PyObject *);
extern int _Py_WriteIndent(int, PyObject *);
// Export for the faulthandler module
PyAPI_FUNC(void) _Py_InitDumpStack(void);
PyAPI_FUNC(void) _Py_DumpStack(int fd);
extern void _Py_DumpTraceback_Init(void);
#ifdef __cplusplus
}
#endif
#endif /* !Py_INTERNAL_TRACEBACK_H */