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

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