[gdb] Fix rethrow exception slicing in pretty_print_insn
authorTom de Vries <tdevries@suse.de>
Mon, 24 Oct 2022 12:20:49 +0000 (14:20 +0200)
committerTom de Vries <tdevries@suse.de>
Mon, 24 Oct 2022 12:20:49 +0000 (14:20 +0200)
commit0a9c805dfd0dd9a284b30ec0563e4dc1ab5b16c4
tree29c58f19eb4acac8716b5ffd1e4a63e494890dfb
parent67527cffcd5eb548a5de26d6a2b139a52bffa5a6
[gdb] Fix rethrow exception slicing in pretty_print_insn

The preferred way of rethrowing an exception is by using throw without
expression, because it avoids object slicing of the exception [1].

Fix this in gdb_pretty_print_disassembler::pretty_print_insn.

Tested on x86_64-linux.

[1] https://en.cppreference.com/w/cpp/language/throw

Approved-By: Andrew Burgess <aburgess@redhat.com>
gdb/disasm.c