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