[PATCH 0/2] [gdb] Fix rethrow exception slicing

Tom de Vries tdevries@suse.de
Mon Oct 24 08:49:11 GMT 2022


While investigating PR29712, I used my ignore-errors patch (
https://sourceware.org/pipermail/gdb-patches/2021-May/178990.html ) and
found that the thrown error was not caught by ignore-errors due to object
slicing of the exception by a rethrow.

In other words, a gdb_exception_error is thrown, caught and rethrown, but the
rethrow throws a gdb_exception instead, which will not be caught by an
encapsulating catch gdb_exception_error.

Fix this and one more occurrence of rethrow exception slicing that I found
using grepping.

Tom de Vries (2):
  [gdb] Fix rethrow exception slicing in pretty_print_insn
  [gdb] Fix rethrow exception slicing in insert_bp_location

 gdb/breakpoint.c | 28 +++++++++++++++++++++-------
 gdb/disasm.c     |  4 ++--
 2 files changed, 23 insertions(+), 9 deletions(-)


base-commit: b347f578952a29ff9b02090b0dafec563520c80b
-- 
2.35.3



More information about the Gdb-patches mailing list