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

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