aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2021-05-11Automatic date update in version.inGDB Administrator1-1/+1
2021-05-10[PR gdb/27614] gdb-add-index fails on symlinks.Lancelot SIX4-0/+86
PR 27614 shows that gdb-add-index fails to generate the index when its argument is a symlink. The following one liner illustrates the reported problem: $ echo 'int main(){}'|gcc -g -x c -;ln -s a.out symlink;gdb-add-index symlink gdb-add-index: No index was created for symlink gdb-add-index: [Was there no debuginfo? Was there already an index?] $ ls -l -rwxr-xr-x 1 25712 Mar 19 23:05 a.out* -rw------- 1 8277 Mar 19 23:05 a.out.gdb-index lrwxrwxrwx 1 5 Mar 19 23:05 symlink -> a.out* GDB generates the .gdb-index file with a name that matches the name of the actual program (a.out.gdb-index here), not the symlink that references it. The remaining of the script is looking for a file named after the provided argument (would be 'symlink.gdb-index' in our example). gdb/ChangeLog: PR gdb/27614 * contrib/gdb-add-index.sh: Fix when called with a symlink as an argument. gdb/testsuite/ChangeLog: PR gdb/27614 * gdb.dwarf2/gdb-add-index-symlink.exp: New test.
2021-05-10Remove strayed fprintf in commit 23182ac0d83H.J. Lu2-1/+6
PR binutils/27839 * simple.c (bfd_simple_get_relocated_section_contents): Remove strayed fprintf.
2021-05-10gdb/testsuite: don't use source tree as temporary HOME directoryAndrew Burgess2-1/+17
In this commit: commit 1845e254645efbc02248345ccdb557d265dd8ae1 Date: Wed May 5 16:50:17 2021 +0100 gdb/guile: perform tilde expansion when sourcing guile scripts A test was added that tries to source a guile script from the users HOME directory. In order to achieve this the test (temporarily) modifies $HOME to point into the binutils-gdb source tree. The problem with this is that sourcing a guile script can cause the guile script to be byte compiled and written into a .cache/ directory, which is stored .... in the $HOME directory. The result was that the test added in the above commit would cause a .cache/ directory to be added into the binutils-gdb source tree. In this commit the test is updated to create a new directory in the build tree, the file we want to source is copied over, and $HOME is set to point at the location in the build tree. Now when the test is run the .cache/ directory is created in the build tree, leaving the source tree untouched. gdb/testsuite/ChangeLog: * gdb.guile/guile.exp: Don't use the source directory as a temporary HOME directory.
2021-05-10gdb/testsuite: use proc parameters in gdb.arch/amd64-osabi.expSimon Marchi2-3/+8
This test has a little oversight: the test procedure doesn't actually use its parameters, the commands and expected patterns are hard-coded, so we always test with i386:x86-64, instead of with the three arches. Fix that. gdb/testsuite/ChangeLog: * gdb.arch/amd64-osabi.exp (test_osabi_none): Use the parameters. Change-Id: Iee2c32963d09e502ae791d5df2b6c04a1f49a57a
2021-05-10gdb, gdbserver: make status_to_str display the signal nameSimon Marchi2-4/+10
I was looking at some "set debug lin-lwp" logs, and saw that a thread received the "Child exited" signal. It took me a moment to realize that this was SIGCHLD. I then thought that it would be nice for status_to_str to show the signal name (SIGCHLD) in addition to the description "Child exited", since people are much more used to referring to signals using their names. Fortunately, libiberty contains a handy function to get the signal name from the signal number, strsigno, use that. The output of "set debug lin-lwp" now looks like: [linux-nat] linux_nat_wait_1: waitpid 1209631 received SIGTRAP - Trace/breakpoint trap (stopped) gdb/ChangeLog: * nat/linux-waitpid.c (status_to_str): Show signal name. Change-Id: I8ad9b1e744dd64461fd87b08d5c29f9ef97c4691
2021-05-10Fix an indirection via uninitialised memory when parsing a corrupt input file.Nick Clifton2-0/+46
PR 27839 * simple.c (simple_dummy_add_to_set): New function. (simple_dummy_constructor): New function. (simple_dummy_multiple_common): New function. (bfd_simple_get_relocated_section_contents): Zero out the callbacks structure, and then set the add_to_set, constructor and multiple_common fields.
2021-05-10Enable linker garbage collection for the PRU target.Dimitar Dimitrov10-7/+22
bfd * elf32-pru.c (elf_backend_can_gc_sections): Define as 1. ld * testsuite/ld-elf/group8a.d: Remove pru from XFAIL list. * testsuite/ld-elf/group8b.d: Ditto. * testsuite/ld-elf/group9a.d: Ditto. * testsuite/ld-elf/group9b.d: Ditto. * testsuite/ld-elf/pr12851.d: Ditto. * testsuite/ld-elf/pr22677.d: Ditto. * testsuite/lib/ld-lib.exp (check_gc_sections_available): Remove pru from list.
2021-05-10PRU: Add alignment for resource table, and allow sizes of memory regions to ↵Dimitar Dimitrov2-2/+14
be set from the command line. ld * scripttempl/pru.sc (.resource_table): Add ALIGN directive. Use symbols for memory sizes.
2021-05-10Add support for 8-bit and 24-bit shifts in the z80 assembler.Sergey Belyashov4-2/+35
PR 27415 * config/tc-z80.c (emit_data_val): Add support for 8-bit and 24-bit shifts. * testsuite/gas/z80/z80_reloc.a: Update tests. * testsuite/gas/z80/z80_reloc.d: Update expected disassembly.
2021-05-10Restore old behaviour of windres so that options containing spaces are not ↵Thomas Wolff3-29/+14
enclosed in double quotes. PR 4356 PR 26865 PR 27594 * windres.c (quot): Revert previous delta. Do not use double quotes when spaces are detected in options. * doc/binutils.texi (windres): Remove suggestion that the --preprocessor option can take arguments.
2021-05-10gdb/doc: reword a sentenceAndrew Burgess3-2/+7
Change this: The available watchpoint types represented by constants are defined in the gdb module: to this: The available watchpoint types are represented by constants defined in the gdb module: The new version matches a similar line a few lines up the document which reads: The available types are represented by constants defined in the gdb module: gdb/doc/ChangeLog: * guile.texinfo (Breakpoints In Guile): Reword sentence. * python.texinfo (Breakpoints In Python): Reword sentence.
2021-05-10Avoid possible pointer wrapAlan Modra2-3/+9
PTR supplied to these macros can be read from user input, END is an end of buffer pointer. It's safer to do arithmetic on END than on PTR. * dwarf.c (SAFE_BYTE_GET): Check bounds by subtracting amount from END rather than adding amount to PTR. (SAFE_SIGNED_BYTE_GET, SAFE_BYTE_GET64): Likewise.
2021-05-10Automatic date update in version.inGDB Administrator1-1/+1
2021-05-09gdb/doc: document 'set debug py-unwind'Andrew Burgess2-0/+12
When the 'set debug py-unwind' flag was added, it was never documented in the manual. This commit adds some text for this command to the manual. gdb/doc/ChangeLog: * python.texinfo (Python Commands): Document 'set debug py-unwind' and 'show debug py-unwind'.
2021-05-09gdb/py: add some debugging to py-breakpoint.cAndrew Burgess4-3/+83
Adds some new debugging to python/py-breakpoint.c. gdb/ChangeLog: * python/py-breakpoint.c (pybp_debug): New static global. (show_pybp_debug): New function. (pybp_debug_printf): Define. (PYBP_SCOPED_DEBUG_ENTER_EXIT): Define. (gdbpy_breakpoint_created): Add some debugging. (gdbpy_breakpoint_deleted): Likewise. (gdbpy_breakpoint_modified): Likewise. (_initialize_py_breakpoint): New function. gdb/doc/ChangeLog: * python.texinfo (Python Commands): Document 'set debug py-breakpoint' and 'show debug py-breakpoint'.
2021-05-09gdb/py: convert debug logging in py-unwind to use new schemeAndrew Burgess2-16/+51
Converts the debug print out in python/py-unwind.c to use the new debug printing scheme. I have also modified what is printed in a few places, for example, rather than printing frame pointers, I now print the frame level, this matches what we do in the general 'set debug frame' tracing, and is usually more helpful (I think). I also added a couple of ENTER/EXIT scope printers. gdb/ChangeLog: * python/py-unwind.c (pyuw_debug): Convert to bool. (show_pyuw_debug): New function. (pyuw_debug_printf): Define. (PYUW_SCOPED_DEBUG_ENTER_EXIT): Define. (pyuw_this_id): Convert to new debug print macros. (pyuw_prev_register): Likewise. (pyuw_sniffer): Likewise. (pyuw_dealloc_cache): Likewise. (_initialize_py_unwind): Update now pyuw_debug is a bool, and add show function when registering.
2021-05-09gdb: replace fprint_frame_idAndrew Burgess7-75/+68
Replace fprint_frame_id with a member function frame_id::to_string that returns a std::string. Convert all of the previous users of fprint_frame_id to use the new member function. This means that instead of writing things like this: fprintf_unfiltered (file, " id="); fprint_frame_id (file, s->id.id); We can write this: fprintf_unfiltered (file, " id=%s", s->id.id.to_string ().c_str ()); There should be no user visible changes after this commit. gdb/ChangeLog: * dummy-frame.c (fprint_dummy_frames): Convert use of fprint_frame_id to use frame_id::to_string. * frame.c (fprint_field): Delete. (fprint_frame_id): Moved to... (frame_id::to_string): ...this, rewritten to return a string. (fprint_frame): Convert use of fprint_frame_id to use frame_id::to_string. (compute_frame_id): Likewise. (frame_id_p): Likewise. (frame_id_eq): Likewise. (frame_id_inner): Likewise. * frame.h (struct frame_id) <to_string>: New member function. (fprint_frame_id): Delete declaration. * guile/scm-frame.c (frscm_print_frame_smob): Convert use of fprint_frame_id to use frame_id::to_string. * python/py-frame.c (frame_object_to_frame_info): Likewise. * python/py-unwind.c (unwind_infopy_str): Likewise. (pyuw_this_id): Likewise.
2021-05-09Use htab_eq_string in libctfAlan Modra4-18/+16
* ctf-impl.h (ctf_dynset_eq_string): Don't declare. * ctf-hash.c (ctf_dynset_eq_string): Delete function. * ctf-dedup.c (make_set_element): Use htab_eq_string. (ctf_dedup_atoms_init, ADD_CITER, ctf_dedup_init): Likewise. (ctf_dedup_conflictify_unshared): Likewise. (ctf_dedup_walk_output_mapping): Likewise.
2021-05-09Use htab_eq_string in binutilsAlan Modra2-9/+7
A quick check says this is the only place in all of bfd, opcodes, binutils, gas, ld, gprof that duplicates the new libiberty htab_eq_string. * objcopy.c (eq_string): Delete. (create_symbol_htab): Use htab_eq_string.
2021-05-08gdbsupport: re-generate configure & friendsSimon Marchi4-83/+8
I get these changes when re-generating the autoconf stuff in gdbsupport, fallouts from 4655f8509fd4 ("Don't run personality syscall at configure time; don't check it at all"). gdbsupport/ChangeLog: * Makefile.in: Re-generate. * config.in: Re-generate. * configure: Re-generate. Change-Id: Ie1876ee58d6f4f1cf25fa14900eecf4c85a744c1
2021-05-08gdb, gdbserver: make status_to_str return std::stringSimon Marchi6-25/+41
Instead of using a static buffer. This is safer, and we don't really mind about any extra dynamic allocation here, since it's only used for debug purposes. gdb/ChangeLog: * nat/linux-waitpid.c (status_to_str): Return std::string. * nat/linux-waitpid.h (status_to_str): Likewise. * linux-nat.c (linux_nat_post_attach_wait): Adjust. (linux_nat_target::attach): Adjust. (linux_handle_extended_wait): Adjust. (wait_lwp): Adjust. (stop_wait_callback): Adjust. (linux_nat_filter_event): Adjust. (linux_nat_wait_1): Adjust. * nat/linux-waitpid.c (status_to_str): Adjust. * nat/linux-waitpid.h (status_to_str): Adjust. gdbserver/ChangeLog: * linux-low.cc (linux_process_target::wait_for_event_filtered): Adjust to status_to_str returning std::string. Change-Id: Ia8aead70270438a5690f243e6faafff6c38ff757
2021-05-08gdb: add missing space in infrun_debug_printfSimon Marchi2-1/+5
gdb/ChangeLog: * infrun.h (infrun_debug_printf): Add missing space. Change-Id: I476096a098451ff2019ab38caa41ebfef0e04a1c
2021-05-09Automatic date update in version.inGDB Administrator1-1/+1
2021-05-08sim: h8300: clean up various warningsMike Frysinger4-8/+21
A random grab bag of minor fixes to enable -Werror for this port. Disable h8_set_macS for now as it's unused. Initialize trace & intMask before using them. Mark local set_h8300h function static.
2021-05-08sim: touch modules targetMike Frysinger2-0/+5
If there are no updates to the file, touch the result so we don't keep trying to regenerate it.
2021-05-08sim: cgen: tweak trace formatMike Frysinger2-1/+5
Fixes build warnings when the address size isn't an integer.
2021-05-08sim: cgen: namespace mode_names a bitMike Frysinger3-3/+11
These are exported in the library linkage, so add a cgen_ prefix.
2021-05-08sim: cgen: tweak cgen_rtx_error to fix warningsMike Frysinger3-1/+8
The function was missing a prototype, and passing a constant string as the format string instead of going through a %s format.
2021-05-08sim: cgen: tweak initializers to avoid warningsMike Frysinger2-6/+10
Use {} instead of {0} to avoid warnings: common/cgen-utils.c:59:1: warning: missing braces around initializer [-Wmissing-braces] 59 | { | ^ 60 | { 61 | VIRTUAL_INSN_X_INVALID, "--invalid--", NULL, 0, { V, { 0 } } | {{}} Generated code should be the same.
2021-05-08binutils: update release docs processMike Frysinger2-16/+26
Now that we generate multiple html & pdf forms, update the release process to show how they get updated.
2021-05-08support generating multi-html pages in parallelMike Frysinger15-27/+106
Use the pattern from other projects where we generate the html pages in a dir named the same as the project. So now we have: gas/doc/gas.html - single html page gas/doc/gas/ - multiple html pages This works for projects that have a doc/ subdir already, but gprof & ld require a little tweaking since they generate their docs in their respective toplevels.
2021-05-08generate single html manual page by defaultMike Frysinger15-8/+43
This better matches other GNU projects like autoconf/automake where the html manual is the single page form. We'll support the multi-page form in a follow up change.
2021-05-08sim: add html & pdf stubsMike Frysinger2-0/+13
We stub out the info targets already since we don't provide any.
2021-05-08sim: use htab_eq_stringTom Tromey2-9/+6
This changes the sim to use htab_eq_string from libiberty. sim/common/ChangeLog 2021-05-08 Tom Tromey <tom@tromey.com> * sim-options.c (compare_strings): Remove. (dup_arg_p): Use htab_eq_string.
2021-05-08Don't run personality syscall at configure time; don't check it at allPedro Alves11-204/+22
Currently, in order to tell whether support for disabling address space randomization on Linux is available, GDB checks if the personality syscall works, at configure time. I.e., it does a run test, instead of a compile/link test: AC_RUN_IFELSE([PERSONALITY_TEST], [have_personality=true], [have_personality=false], This is a bit bogus, because the machine the build is done on may not (and is when you consider distro gdbs) be the machine that eventually runs gdb. It would be better if this were a compile/link test instead, and then at runtime, GDB coped with the personality syscall failing. Actually, GDB already copes. One environment where this is problematic is building GDB in a Docker container -- by default, Docker runs the container with seccomp, with a profile that disables the personality syscall. You can tell Docker to use a less restricted seccomp profile, but I think we should just fix it in GDB. "man 2 personality" says: This system call first appeared in Linux 1.1.20 (and thus first in a stable kernel release with Linux 1.2.0); library support was added in glibc 2.3. ... ADDR_NO_RANDOMIZE (since Linux 2.6.12) With this flag set, disable address-space-layout randomization. glibc 2.3 was released in 2002. Linux 2.6.12 was released in 2005. The original patch that added the configure checks was submitted in 2008. The first version of the patch that was submitted to the list called personality from common code: https://sourceware.org/pipermail/gdb-patches/2008-June/058204.html and then was moved to Linux-specific code: https://sourceware.org/pipermail/gdb-patches/2008-June/058209.html Since HAVE_PERSONALITY is only checked in Linux code, and ADDR_NO_RANDOMIZE exists for over 15 years, I propose just completely removing the configure checks. If for some odd reason, some remotely modern system still needs a configure check, then we can revert this commit but drop the AC_RUN_IFELSE in favor of always doing the AC_LINK_IFELSE cross-compile fallback. gdb/ChangeLog: * linux-nat.c (linux_nat_target::supports_disable_randomization): Remove references to HAVE_PERSONALITY. * nat/linux-personality.c: Remove references to HAVE_PERSONALITY. (maybe_disable_address_space_randomization) (~maybe_disable_address_space_randomizatio): Remove references to HAVE_PERSONALITY. * config.in, configure: Regenerate. gdbserver/ChangeLog: * linux-low.cc: (linux_process_target::supports_disable_randomization): Remove reference to HAVE_PERSONALITY. * config.in, configure: Regenerate. gdbsupport/ChangeLog: * common.m4 (personality test): Remove.
2021-05-08Don't include sys/personality.h in linux-low.cc anymorePedro Alves2-7/+5
Lancelot pointed out that since the refactor at: https://sourceware.org/pipermail/gdb-patches/2015-January/120503.html the sys/personality.h include is not needed in linux-low.cc anymore, as it does not call personality directly itself anymore. gdbserver/ChangeLog: * linux-low.cc: Don't include sys/personality.h or define ADDR_NO_RANDOMIZE.
2021-05-07sim: m68hc11: fix up cycle buffer printingMike Frysinger2-5/+8
Make sure the local static buffer is large enough, and simplify the sprintf for merging the fields all into one. This fixes compiler warnings from buf possibly being overflowed.
2021-05-08Automatic date update in version.inGDB Administrator1-1/+1
2021-05-07gdb/guile: perform tilde expansion when sourcing guile scriptsAndrew Burgess4-2/+28
Before this patch: (gdb) source ~/script.scm ERROR: In procedure apply-smob/1: ERROR: In procedure primitive-load-path: Unable to find file "~/script.scm" in load path Error while executing Scheme code. (gdb) This is because the path is not tilde expanded. In contrast, when sourcing a .py or .gdb script the path is tilde expanded. This commit fixes this oversight, and allows the above source command to work as expected. The tilde expansion is done in the generic GDB code before we call the sourcer function for any particular extension language. gdb/ChangeLog: * cli/cli-cmds.c: Add 'gdbsupport/gdb_tilde_expand.h' include. (source_script_with_search): Perform tilde expansion. gdb/testsuite/ChangeLog: * gdb.guile/guile.exp: Add an extra test.
2021-05-07gdb/testsuite: use gdb_test_no_output instead of send_gdbAndrew Burgess2-2/+7
I noticed gdb.base/ptype-offsets.exp failing occasionally, this was due to lines like this in the test script: send_gdb "set print type hex on\n" As this does not match the '(gdb)' prompt that is produced, the prompt would sometimes be matched against the next test, causing the next test to think its output was missing and fail. Fix this by switching to: gdb_test_no_output "set print type hex on" gdb/testsuite/ChangeLog: * gdb.base/ptype-offsets.exp: Replace use of send_gdb with gdb_test_no_output.
2021-05-07gdb: make target_desc_info::filename an std::stringSimon Marchi2-20/+26
To make the management of memory automatic. As to why I chose to make this an std::string and not an std::unique_xmalloc_ptr<char>: some parts of the code consider both a NULL value and an empty string value to mean "no filename". target_desc_info_from_user_p, however, doesn't check for a non-NULL but empty string value. So it seems like having two ways of denoting "no filename" can lead to these kinds of inconsistencies. Using std::string, "no filename" is only represented by an empty value. As a bonus, using an std::string lets us copy target_desc_info objects using the default assignment operator. gdb/ChangeLog: * target-descriptions.c (struct target_desc_info) <filename>: Make std::string. (copy_inferior_target_desc_info): Adjust. (target_desc_info_free): Adjust. (target_find_description): Adjust. (set_tdesc_filename_cmd): Adjust. (show_tdesc_filename_cmd): Adjust. (unset_tdesc_filename_cmd): Adjust. (maint_print_c_tdesc_cmd): Adjust. Change-Id: I4e3a6ad8ccda2b88c202471d4f54249753cad127
2021-05-07gdb: (de-)allocate target_desc_info with new/deleteSimon Marchi2-5/+13
In preparation for using non-POD types in the struct. gdb/ChangeLog: * target-descriptions.c (struct target_desc_info): Initialize fields. (get_tdesc_info): Use new. (target_desc_info_free): Use delete. Change-Id: I10fdaeeae7cdbd7930ae7adeeb13f7f363c67c7a
2021-05-07gdb: change target_desc_info::fetched to boolSimon Marchi2-3/+10
gdb/ChangeLog: * target-descriptions.c (struct target_desc_info) <fetched>: bool. (target_find_description): Adjust. (target_clear_description): Adjust. Change-Id: Ib69e097b38cf270e674f1249105d535a312954e1
2021-05-07gdb: remove target description macrosSimon Marchi2-38/+53
In my opinion, the target_desc_fetched, current_target_desc and target_description_filename macros in target-descriptions.c are not very useful. I don't think it's useful to hide that they operate on the current inferior, as everything currently works under the assumption that the various tdesc commands operate on the current inferior, and I don't see that changing in the foreseeable future. This change also avoids having multiple unnecessary calls to current_inferior and get_tdesc_info per function. gdb/ChangeLog: * target-descriptions.c (struct target_desc_info) <tdesc>: Adjust doc. (target_desc_fetched): Remove. (current_target_desc): Remove. (target_description_filename): Remove. (target_find_description): Adjust. (target_clear_description): Adjust. (target_current_description): Adjust. (set_tdesc_filename_cmd): Adjust. (show_tdesc_filename_cmd): Adjust. (unset_tdesc_filename_cmd): Adjust. (maint_print_c_tdesc_cmd): Adjust. (maint_print_xml_tdesc_cmd): Adjust. Change-Id: Ibfb581490e949c16d59924e2cac633ede5c26c5b
2021-05-07sim: Add bfd include path for common testsuite toolsDimitar Dimitrov4-2/+12
On a host without installed libbfd, this patch fixes the following "make check-sim" errors for both pru cross target, and native x86_64: In file included from ../../../binutils/sim/common/sim-basics.h:131, from testsuite/common/bits32m0.c:13:../../../binutils/sim/../include/gdb/callback.h:55:10: fatal error: bfd.h: No such file or directory 55 | #include "bfd.h" | ^~~~~~~ Signed-off-by: Dimitar Dimitrov <dimitar@dinux.eu>
2021-05-07Add a generic .bss directive for ELF based targets.Nick Clifton4-14/+65
PR 3136 * config/obj-elf.c (elf_pseudo_table): Add entry for .bss. (obj_elf_bss): New function. Change to the .bss section. Support an optional subsection number. (obj_elf_change_section): Call obj_elf_section_change_hook. (obj_elf_section): Likewise. (obj_elf_data): Likewise. (obj_elf_text): Likewise. (obj_elf_struct): Likewise. (obj_elf_subsection): Likewise. (obj_elf_previous): Likewise. * config/obj-elf.h (obj_elf_bss): Prototype. * doc/as.texi (Bss): New node.
2021-05-07gdb: some int to bool conversionAndrew Burgess4-7/+18
Change int parameter to bool in remote_notice_new_inferior (remote.c) and notice_new_inferior (infcmd.c), and update the callers. There should be no user visible changes after this commit. gdb/ChangeLog: * infcmd.c (notice_new_inferior): Change parameter type. * inferior.h (notice_new_inferior): Change parameter type. * remote.c (remote_notice_new_inferior): Change parameter type to bool. Also update type of local variable to bool. (remote_target::update_thread_list): Change type of local variable to bool. (remote_target::process_stop_reply): Pass bool instead of int to remote_notice_new_inferior.
2021-05-07gdb: remove reference to current inferior in target_stack::unpushSimon Marchi2-1/+6
target_stack::unpush needs to get the target beneath the target being unpushed to update the m_top field (which keeps the stratum of the top-most target). It currently does so using target_ops::beneath, which uses the target stack of the current inferior. The target stack of the current inferior is the same as the `this` in the unpush method. Avoid this detour and remove this reference to the current inferior by calling target_ops::find_beneath and passing `this` to find the target beneath `t` in the target stack that is `this`. gdb/ChangeLog: * target.c (target_stack::unpush): Call target_ops::find_beneath to get the target beneath `t`. Change-Id: If9d9661567c5c16f655d270bd2ec9f1b3aa6dadc
2021-05-07gdb: make target_close check that the target isn't pushed in all inferiorsSimon Marchi2-1/+7
The target_close function currently checks that the target to be closed isn't pushed in the current inferior: gdb_assert (!current_inferior ()->target_is_pushed (targ)); Normally, a target is closed when its refcount has dropped to 0, due to not being used in any inferior anymore. I think it would make sense to change that assert to not only check in the current inferior, but to check in all inferiors. It would be quite bad (and a bug) to close a target while it's still pushed in one of the non-current inferiors. gdb/ChangeLog: * target.c (target_close): Check in all inferiors that the target is not pushed. Change-Id: I6e37fc3f3476a0593da1e476604642b2de90f1d5