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

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