mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-06-29 16:38:05 +08:00
[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
This commit is contained in:
@ -23,6 +23,7 @@
|
|||||||
#include "gdbsupport/gdb_optional.h"
|
#include "gdbsupport/gdb_optional.h"
|
||||||
#include "cli/cli-cmds.h"
|
#include "cli/cli-cmds.h"
|
||||||
#include "cli/cli-style.h"
|
#include "cli/cli-style.h"
|
||||||
|
#include "target.h"
|
||||||
|
|
||||||
/* Set/show debuginfod commands. */
|
/* Set/show debuginfod commands. */
|
||||||
static cmd_list_element *set_debuginfod_prefix_list;
|
static cmd_list_element *set_debuginfod_prefix_list;
|
||||||
@ -204,6 +205,13 @@ debuginfod_source_query (const unsigned char *build_id,
|
|||||||
user_data data ("source file", srcpath);
|
user_data data ("source file", srcpath);
|
||||||
|
|
||||||
debuginfod_set_user_data (c, &data);
|
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,
|
scoped_fd fd (debuginfod_find_source (c,
|
||||||
build_id,
|
build_id,
|
||||||
build_id_len,
|
build_id_len,
|
||||||
@ -242,6 +250,13 @@ debuginfod_debuginfo_query (const unsigned char *build_id,
|
|||||||
user_data data ("separate debug info for", filename);
|
user_data data ("separate debug info for", filename);
|
||||||
|
|
||||||
debuginfod_set_user_data (c, &data);
|
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,
|
scoped_fd fd (debuginfod_find_debuginfo (c, build_id, build_id_len,
|
||||||
&dname));
|
&dname));
|
||||||
debuginfod_set_user_data (c, nullptr);
|
debuginfod_set_user_data (c, nullptr);
|
||||||
|
Reference in New Issue
Block a user