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

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