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

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