1234567891011121314151617181920212223242526272829303132333435363738 |
- $OpenBSD: patch-tmate-debug_c,v 1.2 2017/02/17 12:37:33 jasper Exp $
- Actually disable all debug handling when not requested.
- Fixes undefined references to backtrace{,_symbols}().
- --- tmate-debug.c.orig Tue Mar 29 05:30:07 2016
- +++ tmate-debug.c Fri Feb 17 13:36:30 2017
- @@ -1,4 +1,6 @@
- +#if DEBUG
- #include <execinfo.h>
- +#endif
- #include <stdio.h>
- #include <stdlib.h>
- #include <regex.h>
- @@ -55,6 +57,7 @@ static int print_resolved_stack_frame(const char *fram
-
- void tmate_print_stack_trace(void)
- {
- +#if DEBUG
- void *array[20];
- size_t size;
- char **strings;
- @@ -66,13 +69,12 @@ void tmate_print_stack_trace(void)
- tmate_info ("============ %zd stack frames ============", size);
-
- for (i = 1; i < size; i++) {
- -#if DEBUG
- if (print_resolved_stack_frame(strings[i]) < 0)
- -#endif
- tmate_info("%s", strings[i]);
- }
-
- free (strings);
- +#endif
- }
-
-
|