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

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