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

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