mirror of
https://sourceware.org/git/binutils-gdb.git
synced 2026-08-27 00:26:02 -04:00
No description
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> |
||
|---|---|---|
| bfd | ||
| binutils | ||
| config | ||
| contrib | ||
| cpu | ||
| elfcpp | ||
| etc | ||
| gas | ||
| gdb | ||
| gdbserver | ||
| gdbsupport | ||
| gnulib | ||
| gold | ||
| gprof | ||
| gprofng | ||
| include | ||
| ld | ||
| libbacktrace | ||
| libctf | ||
| libdecnumber | ||
| libiberty | ||
| libsframe | ||
| opcodes | ||
| readline | ||
| sim | ||
| texinfo | ||
| zlib | ||
| .clang-format | ||
| .cvsignore | ||
| .editorconfig | ||
| .gitattributes | ||
| .gitignore | ||
| .pre-commit-config.yaml | ||
| ar-lib | ||
| ChangeLog | ||
| compile | ||
| config-ml.in | ||
| config.guess | ||
| config.rpath | ||
| config.sub | ||
| configure | ||
| configure.ac | ||
| COPYING | ||
| COPYING.LIB | ||
| COPYING.LIBGLOSS | ||
| COPYING.NEWLIB | ||
| COPYING3 | ||
| COPYING3.LIB | ||
| depcomp | ||
| djunpack.bat | ||
| install-sh | ||
| libtool.m4 | ||
| ltgcc.m4 | ||
| ltmain.sh | ||
| ltoptions.m4 | ||
| ltsugar.m4 | ||
| ltversion.m4 | ||
| lt~obsolete.m4 | ||
| MAINTAINERS | ||
| Makefile.def | ||
| Makefile.in | ||
| Makefile.tpl | ||
| makefile.vms | ||
| missing | ||
| mkdep | ||
| mkinstalldirs | ||
| move-if-change | ||
| multilib.am | ||
| README | ||
| README-maintainer-mode | ||
| SECURITY.txt | ||
| 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, 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.