[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>
This commit is contained in:
Tom de Vries
2024-09-24 13:41:42 +02:00
parent 7ba8082f03
commit b3926d6ad1

View File

@@ -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;