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

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