1. May 10, 2021
    • Dimitar Dimitrov's avatar
      Enable linker garbage collection for the PRU target. · 5b45e89f
      Dimitar Dimitrov authored
      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.
      5b45e89f
    • Dimitar Dimitrov's avatar
      PRU: Add alignment for resource table, and allow sizes of memory regions to be... · 261980de
      Dimitar Dimitrov authored
      PRU: Add alignment for resource table, and allow sizes of memory regions to be set from the command line.
      
      ld	* scripttempl/pru.sc (.resource_table): Add ALIGN directive.
      	Use symbols for memory sizes.
      261980de
    • Sergey Belyashov's avatar
      Add support for 8-bit and 24-bit shifts in the z80 assembler. · e4b1ab20
      Sergey Belyashov authored
      	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.
      e4b1ab20
    • Thomas Wolff's avatar
      Restore old behaviour of windres so that options containing spaces are not... · 749c7002
      Thomas Wolff authored
      Restore old behaviour of windres so that options containing spaces are not 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.
      749c7002
    • Andrew Burgess's avatar
      gdb/doc: reword a sentence · 802021d4
      Andrew Burgess authored
      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.
      802021d4
    • Alan Modra's avatar
      Avoid possible pointer wrap · 2d4b4986
      Alan Modra authored
      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.
      2d4b4986
    • GDB Administrator's avatar
      Automatic date update in version.in · 400f0c9b
      GDB Administrator authored
      400f0c9b
  2. May 09, 2021
    • Andrew Burgess's avatar
      gdb/doc: document 'set debug py-unwind' · 9dffa1aa
      Andrew Burgess authored
      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'.
      9dffa1aa
    • Andrew Burgess's avatar
      gdb/py: add some debugging to py-breakpoint.c · 75140e3b
      Andrew Burgess authored
      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'.
      75140e3b
    • Andrew Burgess's avatar
      gdb/py: convert debug logging in py-unwind to use new scheme · 1ef40c13
      Andrew Burgess authored
      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.
      1ef40c13
    • Andrew Burgess's avatar
      gdb: replace fprint_frame_id · 927c4e35
      Andrew Burgess authored
      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.
      927c4e35
    • Alan Modra's avatar
      Use htab_eq_string in libctf · 4821e618
      Alan Modra authored
      	* 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.
      4821e618
    • Alan Modra's avatar
      Use htab_eq_string in binutils · b05a0fc7
      Alan Modra authored
      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.
      b05a0fc7
    • Simon Marchi's avatar
      gdbsupport: re-generate configure & friends · b6703327
      Simon Marchi authored
      I get these changes when re-generating the autoconf stuff in gdbsupport,
      fallouts from 4655f850 ("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
      b6703327
    • Simon Marchi's avatar
      gdb, gdbserver: make status_to_str return std::string · 8d06918f
      Simon Marchi authored
      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
      8d06918f
    • Simon Marchi's avatar
      gdb: add missing space in infrun_debug_printf · 550e9289
      Simon Marchi authored
      gdb/ChangeLog:
      
      	* infrun.h (infrun_debug_printf): Add missing space.
      
      Change-Id: I476096a098451ff2019ab38caa41ebfef0e04a1c
      550e9289
    • GDB Administrator's avatar
      Automatic date update in version.in · 9ef1d5f4
      GDB Administrator authored
      9ef1d5f4
    • Mike Frysinger's avatar
      sim: h8300: clean up various warnings · bb608f81
      Mike Frysinger authored
      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.
      bb608f81
    • Mike Frysinger's avatar
      sim: touch modules target · b50a658a
      Mike Frysinger authored
      If there are no updates to the file, touch the result so we don't
      keep trying to regenerate it.
      b50a658a
    • Mike Frysinger's avatar
      sim: cgen: tweak trace format · 532497fe
      Mike Frysinger authored
      Fixes build warnings when the address size isn't an integer.
      532497fe
    • Mike Frysinger's avatar
      sim: cgen: namespace mode_names a bit · 12279229
      Mike Frysinger authored
      These are exported in the library linkage, so add a cgen_ prefix.
      12279229
    • Mike Frysinger's avatar
      sim: cgen: tweak cgen_rtx_error to fix warnings · 6ae9091a
      Mike Frysinger authored
      The function was missing a prototype, and passing a constant string
      as the format string instead of going through a %s format.
      6ae9091a
    • Mike Frysinger's avatar
      sim: cgen: tweak initializers to avoid warnings · aac7ce3c
      Mike Frysinger authored
      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.
      aac7ce3c
    • Mike Frysinger's avatar
      binutils: update release docs process · 354c317e
      Mike Frysinger authored
      Now that we generate multiple html & pdf forms, update the release
      process to show how they get updated.
      354c317e
    • Mike Frysinger's avatar
      support generating multi-html pages in parallel · cf758b39
      Mike Frysinger authored
      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.
      cf758b39
  3. May 08, 2021
    • Mike Frysinger's avatar
      generate single html manual page by default · 2faf902d
      Mike Frysinger authored
      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.
      2faf902d
    • Mike Frysinger's avatar
      sim: add html & pdf stubs · 0d0878d7
      Mike Frysinger authored
      We stub out the info targets already since we don't provide any.
      0d0878d7
    • Tom Tromey's avatar
      sim: use htab_eq_string · 65a9835b
      Tom Tromey authored
      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.
      65a9835b
    • Pedro Alves's avatar
      Don't run personality syscall at configure time; don't check it at all · 4655f850
      Pedro Alves authored
      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.
      4655f850
    • Pedro Alves's avatar
      Don't include sys/personality.h in linux-low.cc anymore · e2ea3a38
      Pedro Alves authored
      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.
      e2ea3a38
    • Mike Frysinger's avatar
      sim: m68hc11: fix up cycle buffer printing · 8a16cc4b
      Mike Frysinger authored
      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.
      8a16cc4b
    • GDB Administrator's avatar
      Automatic date update in version.in · f6593c3d
      GDB Administrator authored
      f6593c3d
    • Andrew Burgess's avatar
      gdb/guile: perform tilde expansion when sourcing guile scripts · 1845e254
      Andrew Burgess authored
      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.
      1845e254
    • Andrew Burgess's avatar
      gdb/testsuite: use gdb_test_no_output instead of send_gdb · a3237c7c
      Andrew Burgess authored
      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.
      a3237c7c
    • Simon Marchi's avatar
      gdb: make target_desc_info::filename an std::string · 91e3c425
      Simon Marchi authored
      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
      91e3c425
    • Simon Marchi's avatar
      gdb: (de-)allocate target_desc_info with new/delete · 0b2f7ade
      Simon Marchi authored
      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
      0b2f7ade
    • Simon Marchi's avatar
      gdb: change target_desc_info::fetched to bool · 820c4490
      Simon Marchi authored
      gdb/ChangeLog:
      
      	* target-descriptions.c (struct target_desc_info) <fetched>:
      	bool.
      	(target_find_description): Adjust.
      	(target_clear_description): Adjust.
      
      Change-Id: Ib69e097b38cf270e674f1249105d535a312954e1
      820c4490
    • Simon Marchi's avatar
      gdb: remove target description macros · c2962e6a
      Simon Marchi authored
      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
      c2962e6a
    • Dimitar Dimitrov's avatar
      sim: Add bfd include path for common testsuite tools · 0d315c88
      Dimitar Dimitrov authored
      
      
      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: default avatarDimitar Dimitrov <dimitar@dinux.eu>
      0d315c88
    • Nick Clifton's avatar
      Add a generic .bss directive for ELF based targets. · 476654be
      Nick Clifton authored
      	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.
      476654be