[gdb] Fix rethrow exception slicing in insert_bp_location
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)
commitb2829fcf9b594ad9933d649cb089efa5b63a2b89
tree2da3989f1c6ebda560d01a178baab4deeb2c9d7b
parent0a9c805dfd0dd9a284b30ec0563e4dc1ab5b16c4
[gdb] Fix rethrow exception slicing in insert_bp_location

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 insert_bp_location.

Tested on x86_64-linux.

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

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