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

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