aboutsummaryrefslogtreecommitdiff
path: root/gdb/python/py-auto-load.c
diff options
context:
space:
mode:
authorGuinevere Larsen <guinevere@redhat.com>2024-06-20 14:52:35 -0300
committerGuinevere Larsen <guinevere@redhat.com>2024-11-22 17:38:31 -0300
commit3cfa137ca5327c759fd192ad1f0fdc981bf05b82 (patch)
tree29b70d68556e9361d812e663666436514cca17ce /gdb/python/py-auto-load.c
parent4e943705e3e8a5a9448d087502bcb390a694ad02 (diff)
downloadbinutils-3cfa137ca5327c759fd192ad1f0fdc981bf05b82.zip
binutils-3cfa137ca5327c759fd192ad1f0fdc981bf05b82.tar.gz
binutils-3cfa137ca5327c759fd192ad1f0fdc981bf05b82.tar.bz2
gdb: Introduce RAII signal handler setter
This patch is motivated by the wait function for the record-full target, that would install a custom signal handler for SIGINT, but could throw an exception and never reset the SIGINT handler. This is clearly a bad idea, so this patch introduces the class scoped_signal_handler in a new .h file. The file is added to gdbsupport, even though only gdb code is using it, because it feels like an addition that would be useful for more than just directly gdb. The implementation of the RAII class is based on the implementation on gdb/utils.c. That is, it uses preprocessor ifdefs to probe for sigaction support, and uses it if possible, defaulting to a raw call to signal only if sigaction isn't supported. sigaction is preferred based on the "portability" section of the manual page for the signal function. There are 3 places where this class can just be dropped in, gdb/record-full.c, gdb/utils.c and gdb/extension.c. This third place already had a specialized RAII signal handler setter, but it is substituted for the new general purpose one. Approved-By: Tom Tromey <tom@tromey.com>
Diffstat (limited to 'gdb/python/py-auto-load.c')
0 files changed, 0 insertions, 0 deletions