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

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