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

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