diff options
Diffstat (limited to 'src/alloc.c')
| -rw-r--r-- | src/alloc.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/alloc.c b/src/alloc.c index f0da9416ece..961febb6dff 100644 --- a/src/alloc.c +++ b/src/alloc.c | |||
| @@ -6681,13 +6681,21 @@ which_symbols (Lisp_Object obj, EMACS_INT find_max) | |||
| 6681 | } | 6681 | } |
| 6682 | 6682 | ||
| 6683 | #ifdef ENABLE_CHECKING | 6683 | #ifdef ENABLE_CHECKING |
| 6684 | |||
| 6685 | # include <execinfo.h> | ||
| 6686 | |||
| 6684 | bool suppress_checking; | 6687 | bool suppress_checking; |
| 6685 | 6688 | ||
| 6686 | void | 6689 | void |
| 6687 | die (const char *msg, const char *file, int line) | 6690 | die (const char *msg, const char *file, int line) |
| 6688 | { | 6691 | { |
| 6692 | enum { NPOINTERS_MAX = 500 }; | ||
| 6693 | void *buffer[NPOINTERS_MAX]; | ||
| 6694 | int npointers; | ||
| 6689 | fprintf (stderr, "\r\n%s:%d: Emacs fatal error: %s\r\n", | 6695 | fprintf (stderr, "\r\n%s:%d: Emacs fatal error: %s\r\n", |
| 6690 | file, line, msg); | 6696 | file, line, msg); |
| 6697 | npointers = backtrace (buffer, NPOINTERS_MAX); | ||
| 6698 | backtrace_symbols_fd (buffer, npointers, STDERR_FILENO); | ||
| 6691 | abort (); | 6699 | abort (); |
| 6692 | } | 6700 | } |
| 6693 | #endif | 6701 | #endif |