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

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