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

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