Blame SOURCES/gdb-6.6-buildid-locate-rpm-librpm-workaround.patch

ed07ac
From FEDORA_PATCHES Mon Sep 17 00:00:00 2001
ed07ac
From: Fedora GDB patches <invalid@email.com>
ed07ac
Date: Fri, 27 Oct 2017 21:07:50 +0200
ed07ac
Subject: gdb-6.6-buildid-locate-rpm-librpm-workaround.patch
ed07ac
ed07ac
;; Workaround librpm BZ 643031 due to its unexpected exit() calls (BZ 642879).
ed07ac
;;=push+jan
ed07ac
ed07ac
diff --git a/gdb/build-id.c b/gdb/build-id.c
ed07ac
--- a/gdb/build-id.c
ed07ac
+++ b/gdb/build-id.c
ed07ac
@@ -708,6 +708,19 @@ build_id_to_filename (const struct bfd_build_id *build_id, char **link_return)
ed07ac
 #include <dlfcn.h>
ed07ac
 #endif
ed07ac
 
ed07ac
+/* Workarodun https://bugzilla.redhat.com/show_bug.cgi?id=643031
ed07ac
+   librpm must not exit() an application on SIGINT
ed07ac
+
ed07ac
+   Enable or disable a signal handler.  SIGNUM: signal to enable (or disable
ed07ac
+   if negative).  HANDLER: sa_sigaction handler (or NULL to use
ed07ac
+   rpmsqHandler()).  Returns: no. of refs, -1 on error.  */
ed07ac
+extern int rpmsqEnable (int signum, /* rpmsqAction_t handler */ void *handler);
ed07ac
+int
ed07ac
+rpmsqEnable (int signum, /* rpmsqAction_t handler */ void *handler)
ed07ac
+{
ed07ac
+  return 0;
ed07ac
+}
ed07ac
+
ed07ac
 /* This MISSING_RPM_HASH tracker is used to collect all the missing rpm files
ed07ac
    and avoid their duplicities during a single inferior run.  */
ed07ac
 
ed07ac
diff --git a/gdb/proc-service.list b/gdb/proc-service.list
ed07ac
--- a/gdb/proc-service.list
ed07ac
+++ b/gdb/proc-service.list
ed07ac
@@ -37,4 +37,7 @@
ed07ac
   ps_pstop;
ed07ac
   ps_ptread;
ed07ac
   ps_ptwrite;
ed07ac
+
ed07ac
+  /* gdb-6.6-buildid-locate-rpm.patch */
ed07ac
+  rpmsqEnable;
ed07ac
 };