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