| 1 | diff --git a/src/main.c b/src/main.c
|
| 2 | index 33fe51e0..004d0e2c 100644
|
| 3 | |
| 4 | |
| 5 | @@ -2158,7 +2158,9 @@ dump_debug_buffer_to_file (void)
|
| 6 |
|
| 7 | #include <termios.h>
|
| 8 | #include <unistd.h>
|
| 9 | +#ifdef HAVE_EXECINFO_H
|
| 10 | #include <execinfo.h>
|
| 11 | +#endif
|
| 12 |
|
| 13 | #define BACKTRACE_SIZE 1024
|
| 14 | #define MAPS_SIZE 8192
|
| 15 | @@ -2205,6 +2207,7 @@ write_maps (int output_fd)
|
| 16 | close (fd);
|
| 17 | }
|
| 18 |
|
| 19 | +#ifdef HAVE_EXECINFO_H
|
| 20 | static void
|
| 21 | write_backtrace (int output_fd)
|
| 22 | {
|
| 23 | @@ -2221,6 +2224,7 @@ write_backtrace (int output_fd)
|
| 24 | number_of_addresses - BACKTRACE_FRAMES_TO_SKIP,
|
| 25 | output_fd);
|
| 26 | }
|
| 27 | +#endif
|
| 28 |
|
| 29 | static void
|
| 30 | on_crash (int signum)
|
| 31 | @@ -2250,7 +2254,9 @@ on_crash (int signum)
|
| 32 | tcsetattr (fd, TCSAFLUSH, &term_attributes);
|
| 33 |
|
| 34 | write_maps (fd);
|
| 35 | +#ifdef HAVE_EXECINFO_H
|
| 36 | write_backtrace (fd);
|
| 37 | +#endif
|
| 38 | }
|
| 39 |
|
| 40 | if (debug_buffer != NULL) {
|