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

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