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

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