Go to file
Andrew Burgess ba6a0ef349 gdb: use make_scoped_restore to restore gdbpy_current_objfile
The current mechanism by which the Python gdb.current_objfile is
maintained does not allow for nested auto-load events.  It is assumed
that once an auto-load script has finished loading then the current
objfile should be set back to NULL.  In a nested situation, we should
be restoring the previous value.

We already have an RAII class to handle save/restore type behaviour,
so lets just switch to use that.

The test is a little contrived, but is simple enough, and triggers the
bug.  The real use case might involve the auto-load script calling
functions (either in the just-loaded object file, or in the main
executable), which in turn trigger further auto-loads to occur.

gdb/ChangeLog:

	* python/python.c (gdbpy_source_objfile_script): Use
	make_scoped_restore to restore gdbpy_current_objfile.
	(gdbpy_execute_objfile_script): Likewise.

gdb/testsuite/ChangeLog:

	* gdb.python/py-auto-load-chaining-f1.c: New file.
	* gdb.python/py-auto-load-chaining-f1.o-gdb.py: New file.
	* gdb.python/py-auto-load-chaining-f2.c: New file.
	* gdb.python/py-auto-load-chaining-f2.o-gdb.py: New file.
	* gdb.python/py-auto-load-chaining.c: New file.
	* gdb.python/py-auto-load-chaining.exp: New file.
2021-03-15 09:21:37 +00:00
bfd Automatic date update in version.in 2021-03-15 00:00:06 +00:00
binutils aix: correct HOWTO table and add missing relocations 2021-03-12 22:08:20 +10:30
config
contrib
cpu
elfcpp
etc
gas aarch64: Add few missing system registers 2021-03-12 14:20:46 +00:00
gdb gdb: use make_scoped_restore to restore gdbpy_current_objfile 2021-03-15 09:21:37 +00:00
gdbserver gdbserver: linux-low: make linux_process_target::filter_event return void 2021-02-23 10:56:56 -05:00
gdbsupport
gnulib
gold
gprof
include Add values for NetBSD .note.netbsd.ident notes (PaX). 2021-03-12 14:37:51 +00:00
intl
ld riscv --enable-targets=all on 32-bit host 2021-03-12 23:01:01 +10:30
libctf bfd, ld, libctf: skip zero-refcount strings in CTF string reporting 2021-03-02 15:10:10 +00:00
libdecnumber
libiberty
opcodes aarch64: Add few missing system registers 2021-03-12 14:20:46 +00:00
readline Fix Readline 8.1 build on mingw 2021-03-02 13:42:37 -07:00
sim sim: rename BUILD_LDFLAGS to LDFLAGS_FOR_BUILD 2021-03-13 11:21:13 -05:00
texinfo
zlib
.cvsignore
.gitattributes
.gitignore
ar-lib
ChangeLog sim: drop dep on configure-gdb 2021-03-12 19:50:26 -05:00
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 sim: drop dep on configure-gdb 2021-03-12 19:50:26 -05:00
Makefile.in sim: drop dep on configure-gdb 2021-03-12 19:50:26 -05:00
Makefile.tpl Add missing changes to Makefile.tpl 2021-02-28 04:39:38 -08:00
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.