| 1 |
#ifndef PYPY_FAULTHANDLER_H |
| 2 |
#define PYPY_FAULTHANDLER_H |
| 3 |
|
| 4 |
#include "src/precommondefs.h" |
| 5 |
#ifdef _MSC_VER |
| 6 |
#include <crtdefs.h> |
| 7 |
#else |
| 8 |
#include <stdint.h> |
| 9 |
#endif |
| 10 |
|
| 11 |
|
| 12 |
typedef void (*pypy_faulthandler_cb_t)(int fd, void *array_p, |
| 13 |
int length); |
| 14 |
|
| 15 |
RPY_EXTERN char *pypy_faulthandler_setup(pypy_faulthandler_cb_t dump_callback); |
| 16 |
RPY_EXTERN void pypy_faulthandler_teardown(void); |
| 17 |
|
| 18 |
RPY_EXTERN char *pypy_faulthandler_enable(int fd, int all_threads); |
| 19 |
RPY_EXTERN void pypy_faulthandler_disable(void); |
| 20 |
RPY_EXTERN int pypy_faulthandler_is_enabled(void); |
| 21 |
|
| 22 |
RPY_EXTERN void pypy_faulthandler_write(int fd, const char *str); |
| 23 |
RPY_EXTERN void pypy_faulthandler_write_uint(int fd, unsigned long value, |
| 24 |
int min_digits); |
| 25 |
|
| 26 |
RPY_EXTERN void pypy_faulthandler_dump_traceback(int fd, int all_threads, |
| 27 |
void *ucontext); |
| 28 |
|
| 29 |
RPY_EXTERN char *pypy_faulthandler_dump_traceback_later( |
| 30 |
long long microseconds, int repeat, int fd, int exit); |
| 31 |
RPY_EXTERN void pypy_faulthandler_cancel_dump_traceback_later(void); |
| 32 |
|
| 33 |
RPY_EXTERN int pypy_faulthandler_check_signum(long signum); |
| 34 |
RPY_EXTERN char *pypy_faulthandler_register(int, int, int, int); |
| 35 |
RPY_EXTERN int pypy_faulthandler_unregister(int signum); |
| 36 |
|
| 37 |
|
| 38 |
RPY_EXTERN int pypy_faulthandler_read_null(void); |
| 39 |
RPY_EXTERN void pypy_faulthandler_sigsegv(void); |
| 40 |
RPY_EXTERN int pypy_faulthandler_sigfpe(void); |
| 41 |
RPY_EXTERN void pypy_faulthandler_sigabrt(void); |
| 42 |
RPY_EXTERN double pypy_faulthandler_stackoverflow(double); |
| 43 |
|
| 44 |
|
| 45 |
#endif |