forked from Imagelibrary/binutils-gdb
[gdb] Eliminate catch(...) in get_test_insn
In get_test_insn in gdb/disasm-selftests.c, we find this code:
...
try
{
kind = gdbarch_breakpoint_kind_from_pc (gdbarch, &pc);
insn = gdbarch_sw_breakpoint_from_kind (gdbarch, kind, &bplen);
}
catch (...)
{
continue;
}
...
The catch is there to catch memory errors, but it swallows all exceptions, including
gdb_exception_quit and gdb_exception_forced_quit.
Fix this by limiting the catch to gdb_exception_error.
Tested on x86_64-linux, by rebuilding and running gdb.gdb/unittest.exp.
Approved-By: Tom Tromey <tom@tromey.com>
This commit is contained in:
@@ -165,7 +165,7 @@ get_test_insn (struct gdbarch *gdbarch, size_t *len)
|
||||
kind = gdbarch_breakpoint_kind_from_pc (gdbarch, &pc);
|
||||
insn = gdbarch_sw_breakpoint_from_kind (gdbarch, kind, &bplen);
|
||||
}
|
||||
catch (...)
|
||||
catch (const gdb_exception_error &)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user