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

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