Backport upstream patch "[PR gdb/27026] CTRL-C is ignored

when debug info is downloaded" (RHBZ 2024875, Aaron Merey).
This commit is contained in:
Alexandra Hájková 2022-01-05 22:45:54 +01:00
parent 489f452205
commit 3d4c9c3eff
5 changed files with 70 additions and 0 deletions

View File

@ -351,3 +351,7 @@ Patch084: gdb-rhbz2024875-fix-unittest-failure.patch
#scalar values by value
Patch085: gdb-rhbz202487-rework-set-debuginfod.patch
#Backport upstream commit from Aaron Merey
#b9db26b4c44 [PR gdb/27026] CTRL-C is ignored when debug info is downloaded
Patch086: gdb-rhbz2024875-pr27026.patch

View File

@ -83,3 +83,4 @@
%patch083 -p1
%patch084 -p1
%patch085 -p1
%patch086 -p1

View File

@ -83,3 +83,4 @@ gdb-rhbz2024875-expand-documentation-for-debuginfod.patch
gdb-rhbz2024875-set_show-for-managing-debuginfod.patch
gdb-rhbz2024875-fix-unittest-failure.patch
gdb-rhbz202487-rework-set-debuginfod.patch
gdb-rhbz2024875-pr27026.patch

View File

@ -0,0 +1,60 @@
From FEDORA_PATCHES Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Alexandra=20H=C3=A1jkov=C3=A1?= <ahajkova@redhat.com>
Date: Wed, 5 Jan 2022 22:42:27 +0100
Subject: gdb-rhbz2024875-pr27026.patch
;;Backport upstream commit from Aaron Merey
;;b9db26b4c44 [PR gdb/27026] CTRL-C is ignored when debug info is downloaded
[PR gdb/27026] CTRL-C is ignored when debug info is downloaded
During debuginfod downloads, ctrl-c should result in the download
being cancelled and skipped. However in some cases, ctrl-c fails to
get delivered to gdb during downloading. This can result in downloads
being unskippable.
Fix this by ensuring that target_terminal::ours is in effect for the
duration of each download.
Co-authored-by: Tom de Vries <tdevries@suse.de>
https://sourceware.org/bugzilla/show_bug.cgi?id=27026#c3
diff --git a/gdb/debuginfod-support.c b/gdb/debuginfod-support.c
--- a/gdb/debuginfod-support.c
+++ b/gdb/debuginfod-support.c
@@ -23,6 +23,7 @@
#include "gdbsupport/gdb_optional.h"
#include "cli/cli-cmds.h"
#include "cli/cli-style.h"
+#include "target.h"
/* Set/show debuginfod commands. */
static cmd_list_element *set_debuginfod_prefix_list;
@@ -208,6 +209,13 @@ debuginfod_source_query (const unsigned char *build_id,
user_data data ("source file", srcpath);
debuginfod_set_user_data (c, &data);
+ gdb::optional<target_terminal::scoped_restore_terminal_state> term_state;
+ if (target_supports_terminal_ours ())
+ {
+ term_state.emplace ();
+ target_terminal::ours ();
+ }
+
scoped_fd fd (debuginfod_find_source (c,
build_id,
build_id_len,
@@ -246,6 +254,13 @@ debuginfod_debuginfo_query (const unsigned char *build_id,
user_data data ("separate debug info for", filename);
debuginfod_set_user_data (c, &data);
+ gdb::optional<target_terminal::scoped_restore_terminal_state> term_state;
+ if (target_supports_terminal_ours ())
+ {
+ term_state.emplace ();
+ target_terminal::ours ();
+ }
+
scoped_fd fd (debuginfod_find_debuginfo (c, build_id, build_id_len,
&dname));
debuginfod_set_user_data (c, nullptr);

View File

@ -1143,6 +1143,10 @@ fi
%endif
%changelog
* Wed Jan 5 2022 Alexandra Hájková - 11.1-6
-Backport upstream patch "[PR gdb/27026] CTRL-C is ignored
when debug info is downloaded" (RHBZ 2024875, Aaron Merey).
* Wed Jan 5 2022 Alexandra Hájková - 11.1-6
- Backport upstream patch "rework "set debuginfod" commands"
(RHBZ 2024875, Simon Marchi).