diff options
author | Tom de Vries <tdevries@suse.de> | 2024-09-24 13:41:42 +0200 |
---|---|---|
committer | Tom de Vries <tdevries@suse.de> | 2024-09-24 13:41:42 +0200 |
commit | b3926d6ad14413ca64e7828c98823c52d7e74307 (patch) | |
tree | 896168f8260d998e694e42a77b3cdf575c3e0bf9 | |
parent | 7ba8082f030c44b15616336f7dee7ee1df74ba21 (diff) | |
download | fsf-binutils-gdb-b3926d6ad14413ca64e7828c98823c52d7e74307.zip fsf-binutils-gdb-b3926d6ad14413ca64e7828c98823c52d7e74307.tar.gz fsf-binutils-gdb-b3926d6ad14413ca64e7828c98823c52d7e74307.tar.bz2 |
[gdb] Handle ^C in gnu_source_highlight_test
In gnu_source_highlight_test we have:
...
try
{
res = try_source_highlight (styled_prog, language_c, fullname);
}
catch (...)
{
saw_exception = true;
}
...
This also swallows gdb_exception_quit and gdb_exception_forced_quit. I don't
know whether these can actually happen here, but if not it's better to
accommodate for the possibility anyway.
Fix this by handling gdb_exception explicitly, and rethrowing
gdb_exception_quit and gdb_exception_forced_quit.
Tested on aarch64-linux.
Approved-By: Tom Tromey <tom@tromey.com>
-rw-r--r-- | gdb/source-cache.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/gdb/source-cache.c b/gdb/source-cache.c index 2815b6e..f08c872 100644 --- a/gdb/source-cache.c +++ b/gdb/source-cache.c @@ -282,6 +282,12 @@ static void gnu_source_highlight_test () { res = try_source_highlight (styled_prog, language_c, fullname); } + catch (const gdb_exception &e) + { + if (e.reason != RETURN_ERROR) + throw; + saw_exception = true; + } catch (...) { saw_exception = true; |