$OpenBSD: patch-src_sdl_sf_sig_c,v 1.1 2021/01/03 16:12:02 bcallah Exp $

Remove execinfo and backtrace

Index: src/sdl/sf_sig.c
--- src/sdl/sf_sig.c.orig
+++ src/sdl/sf_sig.c
@@ -22,7 +22,6 @@
 #include <stdio.h>
 #include <signal.h>
 #include <stdlib.h>
-#include <execinfo.h>
 
 #include <SDL.h>
 
@@ -66,10 +65,6 @@ void sf_installhandlers()
 
 #else
 
-#ifndef NO_EXECINFO_H
-#include <execinfo.h>
-#endif
-
 /* get REG_EIP from ucontext.h */
 #ifndef NO_UCONTEXT_H
 #ifndef __USE_GNU
@@ -109,9 +104,7 @@ static char *getsigname(int s)
 static void bt_sighandler(int sig, siginfo_t * info, void *secret)
 {
 
-	void *trace[16];
 	char *nam;
-	int i, trace_size = 0;
 
 	if (sig == SIGINT) {
 		fprintf(stderr, "Emergency Exit (Signal SIGITNT received)\n");
@@ -130,18 +123,10 @@ static void bt_sighandler(int sig, siginfo_t * info, v
 
 	printf("\n");
 
-	trace_size = backtrace(trace, 16);
 	/* overwrite sigaction with caller's address */
 	/* trace[1] = (void *) uc->uc_mcontext.gregs[_PROG_COUNTER]; */
 
 	/* skip first stack frame (points here) */
-	printf("Backtrace:\n");
-
-	for (i = 1; i < trace_size; i++) {
-		printf("  ");
-		fflush(stdout);
-		backtrace_symbols_fd(trace + i, 1, fileno(stdout));
-	}
 
 	os_quit(EXIT_SUCCESS);
 }
