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

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