No description
Find a file
Tankut Baris Aktemur adbc0c5542 gdb: limit updating the address spaces to the current target
For the `update_address_spaces` function, there is this comment:

   It is assumed that there are no bound inferiors yet, otherwise,
   they'd be left with stale referenced to released aspaces.

The function indeed iterates over all inferiors and resets their
address spaces.  The function has only one caller:
remote_target::start_remote_1.  This means, if we already have an
inferior and then start a remote target in a second inferior, we may
alter the address space of the first inferior.  It seems the current
code is a left-over from pre-multi-target days.  To prevent bad things
from happening, update the address spaces for a given target only.

A scenario where unwanted behavior occurs is as follows: Start a
multi-threaded program in non-stop mode.  Hit a breakpoint with a
thread.  Create a second inferior on a remote target.  Switch back to
inferior 1.  Continuing repeatedly hits the breakpoint.  See below.

  $ gdb /tmp/multi-thread
  Reading symbols from /tmp/multi-thread...
  (gdb) set non-stop on
  (gdb) break 30
  Breakpoint 1 at 0x151e: file multi-thread.cpp, line 30.
  (gdb) run
  Starting program: /tmp/multi-thread
  [Thread debugging using libthread_db enabled]
  Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
  [New Thread 0x7ffff7a4f640 (LWP 3413070)]
  [New Thread 0x7ffff724e640 (LWP 3413071)]
  [New Thread 0x7ffff6a4d640 (LWP 3413072)]
  [New Thread 0x7ffff624c640 (LWP 3413073)]

  Thread 1 "multi-thread" hit Breakpoint 1, main (argc=1, argv=0x7fffffffdec8) at multi-thread.cpp:30
  30        int x = 42;
  (gdb) add-inferior -no-connection
  [New inferior 2]
  Added inferior 2
  (gdb) inferior 2
  [Switching to inferior 2 [<null>] (<noexec>)]
  (gdb) target extended-remote | gdbserver --multi -
  Remote debugging using | gdbserver --multi -
  Remote debugging using stdio
  (gdb) inferior 1
  [Switching to inferior 1 [process 3413067] (/tmp/multi-thread)]
  [Switching to thread 1.1 (Thread 0x7ffff7a50740 (LWP 3413067))]
  #0  main (argc=1, argv=0x7fffffffdec8) at multi-thread.cpp:30
  30        int x = 42;
  (gdb) continue
  Continuing.

  Thread 1.1 "multi-thread" hit Breakpoint 1, main (argc=1, argv=0x7fffffffdec8) at multi-thread.cpp:30
  30        int x = 42;
  (gdb) continue
  Continuing.

  Thread 1.1 "multi-thread" hit Breakpoint 1, main (argc=1, argv=0x7fffffffdec8) at multi-thread.cpp:30
  30        int x = 42;
  (gdb) continue
  Continuing.

  Thread 1.1 "multi-thread" hit Breakpoint 1, main (argc=1, argv=0x7fffffffdec8) at multi-thread.cpp:30
  30        int x = 42;
  (gdb)
  ...

It was not possible to simplify the bug reproducer.  For some reason,
simplifications make observable problems go away.  Adding the case
above as a testcase.

Regression-tested in Linux x86-64 with the default, native-gdbserver,
and native-extended-gdbserver board files.

Approved-By: Simon Marchi <simon.marchi@efficios.com>
2026-02-25 18:59:57 +01:00
bfd Automatic date update in version.in 2026-02-25 00:00:08 +00:00
binutils readelf: endless loop on attrv2 2026-02-24 22:06:45 +10:30
config tidy m4 plugin config support 2025-11-03 10:59:50 +10:30
contrib [contrib] Accept _("") and operator() in check_GNU_style_lib.py 2025-11-20 10:46:54 +01:00
cpu Fix even more -Wdiscarded-qualifers issues 2026-02-25 06:48:22 -08:00
elfcpp Update year range in copyright notice of binutils files 2026-01-01 23:22:14 +10:30
etc Update year range in copyright notice of binutils files 2026-01-01 23:22:14 +10:30
gas gas/testsuite: add runtest_file_p filtering to run_list_test and run_elf_list_test 2026-02-24 23:22:01 -08:00
gdb gdb: limit updating the address spaces to the current target 2026-02-25 18:59:57 +01:00
gdbserver gdb/gdbserver: move argument setting complexity into gdbsupport/ 2026-02-13 16:37:38 +00:00
gdbsupport gdbsupport: add gdb::unordered_string_map 2026-02-13 14:04:07 -05:00
gnulib gnulib: re-generate Makefile.in 2026-01-06 15:14:50 -05:00
gold [gold] Note gold and dwp deprecation in NEWS 2026-02-05 12:11:34 +01:00
gprof gprof: fix testsuite with older glibc 2026-02-13 10:19:39 +01:00
gprofng update gprofng doc/version.texi 2026-01-30 08:15:26 +10:30
include include/sim: remove arm simulator header 2026-02-13 18:57:08 +00:00
ld Don't run pr24576 tests on windows host 2026-02-23 21:51:03 +10:30
libbacktrace tidy m4 plugin config support 2025-11-03 10:59:50 +10:30
libctf ctf_dump_objts output string 2026-02-04 07:00:12 +10:30
libdecnumber regen config 2023-08-12 10:27:57 +09:30
libiberty libiberty: sync with gcc 2026-02-05 17:24:38 +00:00
libsframe Free sframe encoder context 2026-02-11 15:31:33 +10:30
opcodes Fix even more -Wdiscarded-qualifers issues 2026-02-25 06:48:22 -08:00
readline readline/tcap.h: Update definitions for C23 2025-05-02 12:00:05 -06:00
sim sim: re-generate Makefile.in 2026-01-06 15:15:02 -05:00
texinfo
zlib tidy m4 plugin config support 2025-11-03 10:59:50 +10:30
.clang-format Add .clang-format 2026-02-11 07:53:01 -07:00
.cvsignore
.editorconfig toplevel: unify the GCC and GDB/binutils .editorconfig files 2025-10-01 16:20:29 +01:00
.gitattributes binutils-gdb/git: Handle *.ac and *.m4 files in .gitattributes 2025-12-18 10:00:54 +01:00
.gitignore Add .clang-format 2026-02-11 07:53:01 -07:00
.pre-commit-config.yaml [pre-commit] Require pre-commit v4.5.1 2026-02-03 17:45:38 +01:00
ar-lib
ChangeLog Import the following commits from the master config sources: a2287c3041a3f2a204eb942e09c015eab00dc7dd 973e3e6af23b73a4f1b8d95680454cae22593bf8 3a71dc102953608d4592ec401b519837c28a672a f91a544533876c70f43b9fd51064b2bcf3fa7382 484648c73f3843b256dd011bd415e81594300a0a 7f4149527babe92cb5da1032734f5cb90cefdac5 9f6e0fe8ce04628bbd4a455118ff3f8309a1aef9 2026-01-08 11:20:38 +00:00
compile
config-ml.in MSP430: Add -fno-exceptions multilib 2023-08-12 10:24:26 +09:30
config.guess Import the following commits from the master config sources: a2287c3041a3f2a204eb942e09c015eab00dc7dd 973e3e6af23b73a4f1b8d95680454cae22593bf8 3a71dc102953608d4592ec401b519837c28a672a f91a544533876c70f43b9fd51064b2bcf3fa7382 484648c73f3843b256dd011bd415e81594300a0a 7f4149527babe92cb5da1032734f5cb90cefdac5 9f6e0fe8ce04628bbd4a455118ff3f8309a1aef9 2026-01-08 11:20:38 +00:00
config.rpath
config.sub Import the following commits from the master config sources: a2287c3041a3f2a204eb942e09c015eab00dc7dd 973e3e6af23b73a4f1b8d95680454cae22593bf8 3a71dc102953608d4592ec401b519837c28a672a f91a544533876c70f43b9fd51064b2bcf3fa7382 484648c73f3843b256dd011bd415e81594300a0a 7f4149527babe92cb5da1032734f5cb90cefdac5 9f6e0fe8ce04628bbd4a455118ff3f8309a1aef9 2026-01-08 11:20:38 +00:00
configure AMDGCN: Disable subdirectory configuration for unsupported GAS and LD 2026-02-18 17:32:32 +00:00
configure.ac AMDGCN: Disable subdirectory configuration for unsupported GAS and LD 2026-02-18 17:32:32 +00:00
COPYING
COPYING.LIB
COPYING.LIBGLOSS
COPYING.NEWLIB
COPYING3
COPYING3.LIB
depcomp
djunpack.bat
install-sh
libtool.m4 Binutils/GCC: Add clang LTO support to AR, NM and RANLIB 2025-09-25 12:30:13 +08:00
ltgcc.m4
ltmain.sh ltmain.sh: allow more flags at link-time 2024-09-25 19:06:10 +01:00
ltoptions.m4
ltsugar.m4
ltversion.m4
lt~obsolete.m4
MAINTAINERS Fix compiling bfd/vms-lib.c for a 32-bit host. 2024-03-18 10:26:16 +00:00
Makefile.def Sync top-level with GCC 2025-11-03 09:53:04 +00:00
Makefile.in Sync toplevel files from gcc 2025-10-02 07:42:18 +08:00
Makefile.tpl Sync toplevel files from gcc 2025-10-02 07:42:18 +08:00
makefile.vms
missing
mkdep
mkinstalldirs
move-if-change
multilib.am
README README: don't talk about libg++ 2025-09-07 04:06:01 +01:00
README-maintainer-mode
SECURITY.txt Add a SECURITY.txt file describing the GNU Binutils' project's stance on security related bugs. 2023-04-20 16:52:11 +01:00
setup.com
src-release.sh Rename 'binutils' to 'binutils_with_gold'. Rename 'bin_no_gold' to 'binutils'. Add 'gold' 2025-02-04 11:50:02 +00:00
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, and so on. 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.