Go to file
Kevin Buettner 96e3f4e3c3 Forced quit cases handled by resetting sync_quit_force_run
During my audit of the use of gdb_exception with regard to QUIT
processing, I found a try/catch in the scoped_switch_fork_info
destructor.

Static analysis found this call path from the destructor to
maybe_quit():

  scoped_switch_fork_info::~scoped_switch_fork_info()
    -> remove_breakpoints()
    -> remove_breakpoint(bp_location*)
    -> remove_breakpoint_1(bp_location*, remove_bp_reason)
    -> memory_validate_breakpoint(gdbarch*, bp_target_info*)
    -> target_read_memory(unsigned long, unsigned char*, long)
    -> target_read(target_ops*, target_object, char const*, unsigned char*, unsigned long, long)
    -> maybe_quit()

Since it's not safe to do a 'throw' from a destructor, we simply
call set_quit_flag and, for gdb_exception_forced_quit, also
set sync_quit_force_run.  This will cause the appropriate
exception to be rethrown at the next QUIT check.

Another case is the try / catch in tui_getc() in tui-io.c.  The
existing catch swallows the exception.  I've added a catch for
'gdb_exception_forced_quit', which also swallows the exception,
but also sets sync_quit_force_run and calls set_quit_flag in
order to restart forced quit processing at the next QUIT check.
This is required because it isn't safe to throw into/through
readline.

Thanks to Pedro Alves for suggesting this idea.

Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=26761
Tested-by: Tom de Vries <tdevries@suse.de>
Approved-By: Pedro Alves <pedro@palves.net>
2023-02-27 16:20:39 -07:00
bfd Fix missing "Core was generated by" when loading a x32 corefile. 2023-02-27 13:01:06 +00:00
binutils testsuite: prune DOS drive letter in test outputs 2023-02-24 14:35:10 +01:00
config
contrib
cpu bpf: fix error conversion from long unsigned int to unsigned int [-Werror=overflow] 2023-02-03 11:18:50 -06:00
elfcpp
etc
gas gas/testsuite: adjust another test for case insensitive file systems 2023-02-27 15:17:49 +01:00
gdb Forced quit cases handled by resetting sync_quit_force_run 2023-02-27 16:20:39 -07:00
gdbserver gdbserver/linux-low.cc: Fix a typo in ternary operator 2023-02-24 12:09:05 -07:00
gdbsupport Introduce gdb_exception_forced_quit 2023-02-27 16:20:38 -07:00
gnulib
gold Updated Serbian translations for gold, gprof and opcodes sub-directories 2023-02-27 12:50:31 +00:00
gprof Updated Serbian translations for gold, gprof and opcodes sub-directories 2023-02-27 12:50:31 +00:00
gprofng gprofng: fix Dwarf reader for DW_TAG_subprogram 2023-02-17 14:00:54 -08:00
include Delete PROGRESS macros 2023-02-16 21:00:50 +10:30
intl
ld testsuite: prune DOS drive letter in test outputs 2023-02-24 14:35:10 +01:00
libbacktrace
libctf
libdecnumber
libiberty
libsframe libsframe/doc: use "stack trace" instead of "unwind" for SFrame 2023-02-02 00:47:22 -08:00
opcodes Updated Serbian translations for gold, gprof and opcodes sub-directories 2023-02-27 12:50:31 +00:00
readline
sim
texinfo
zlib
.cvsignore
.editorconfig
.gitattributes
.gitignore
ar-lib
ChangeLog
compile
config-ml.in
config.guess
config.rpath
config.sub
configure
configure.ac
COPYING
COPYING3
COPYING3.LIB
COPYING.LIB
COPYING.LIBGLOSS
COPYING.NEWLIB
depcomp
djunpack.bat
install-sh
libtool.m4
lt~obsolete.m4
ltgcc.m4
ltmain.sh
ltoptions.m4
ltsugar.m4
ltversion.m4
MAINTAINERS
Makefile.def
Makefile.in
Makefile.tpl
makefile.vms
missing
mkdep
mkinstalldirs
move-if-change
multilib.am
README
README-maintainer-mode
setup.com
src-release.sh
symlink-tree
test-driver
ylwrap

		   README for GNU development tools

This directory contains various GNU compilers, assemblers, linkers, 
debuggers, etc., plus their support routines, definitions, and documentation.

If you are receiving this as part of a GDB release, see the file gdb/README.
If with a binutils release, see binutils/README;  if with a libg++ release,
see libg++/README, etc.  That'll give you info about this
package -- supported targets, how to use it, how to report bugs, etc.

It is now possible to automatically configure and build a variety of
tools with one command.  To build all of the tools contained herein,
run the ``configure'' script here, e.g.:

	./configure 
	make

To install them (by default in /usr/local/bin, /usr/local/lib, etc),
then do:
	make install

(If the configure script can't determine your type of computer, give it
the name as an argument, for instance ``./configure sun4''.  You can
use the script ``config.sub'' to test whether a name is recognized; if
it is, config.sub translates it to a triplet specifying CPU, vendor,
and OS.)

If you have more than one compiler on your system, it is often best to
explicitly set CC in the environment before running configure, and to
also set CC when running make.  For example (assuming sh/bash/ksh):

	CC=gcc ./configure
	make

A similar example using csh:

	setenv CC gcc
	./configure
	make

Much of the code and documentation enclosed is copyright by
the Free Software Foundation, Inc.  See the file COPYING or
COPYING.LIB in the various directories, for a description of the
GNU General Public License terms under which you can copy the files.

REPORTING BUGS: Again, see gdb/README, binutils/README, etc., for info
on where and how to report problems.