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

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