1. Oct 10, 2020
    • GDB Administrator's avatar
      Automatic date update in version.in · 448ba686
      GDB Administrator authored
      448ba686
    • Joel Brobecker's avatar
      ada-lang.c::advance_wild_match improve doc and parameter+temporaries types · 59c8a30b
      Joel Brobecker authored
      This commit fixes the type of one of the parameters as well as a couple
      of temporaries.
      
      While at it, the function's description is slightly rewritten to make it
      a little clearer what the function does.
      
      gdb/ChangeLog:
      
              * ada-lang.c (advance_wild_match): Rewrite the function's
              description.  Change the type of target0, t0 and t1 to char.
      59c8a30b
    • Tom Tromey's avatar
      Fix bit offset regression · 7c184d33
      Tom Tromey authored
      The type-safe attribute patch introduced a regression that can occur
      when the DW_AT_bit_offset value is negative.  This can happen with
      some Ada programs.
      
      This patch fixes the problem.  It also fixes a minor oddity in the
      existing scalar storage test -- this test was intended to assign a
      smaller number of bits to the field.
      
      2020-10-09  Tom Tromey  <tromey@adacore.com>
      
      	* dwarf2/read.c (dwarf2_add_field): Handle signed offsets.
      
      gdb/testsuite/ChangeLog
      2020-10-09  Tom Tromey  <tromey@adacore.com>
      
      	* gdb.ada/scalar_storage/storage.adb (Another_Range): New type.
      	(Rec): Add field.  Fix range.
      	* gdb.ada/scalar_storage.exp: Update.
      7c184d33
  2. Oct 09, 2020
    • Tom Tromey's avatar
      Return std::string from ada_encode · 5c4258f4
      Tom Tromey authored
      This changes ada_encode to return a std::string.  This simplifies it
      somewhat, removes a use of GROW_VECT, and is also simpler for callers
      to use.
      
      gdb/ChangeLog
      2020-10-09  Tom Tromey  <tromey@adacore.com>
      
      	* ada-lang.h (ada_encode): Return std::string.
      	* ada-lang.c (ada_encode_1): Return std::string.
      	(ada_encode): Likewise.
      	(type_from_tag, ada_lookup_name_info::ada_lookup_name_info):
      	Update.
      	* ada-exp.y (block_lookup, write_var_or_type): Update.
      5c4258f4
    • Alan Modra's avatar
      [GOLD] Power10 segv due to wild r2 · fa40fbe4
      Alan Modra authored
      Calling non-pcrel functions from pcrel code requires a stub to set up
      r2.  Gold created the stub, but an "optimisation" made the stub jump
      to the function local entry, ie. r2 was not initialised.
      
      This patch fixes that long branch stub problem, and another that might
      occur for plt call stubs to local functions.
      
      bfd/
      	* elf64-ppc.c (write_plt_relocs_for_local_syms): Don't do local
      	entry offset optimisation.
      gold/
      	* powerpc.cc (Powerpc_relobj::do_relocate_sections): Don't do
      	local entry offset optimisation for lplt_section.
      	(Target_powerpc::Branch_info::make_stub): Don't add local
      	entry offset to long branch dest passed to
      	add_long_branch_entry.  Do pass st_other bits.
      	(Stub_table::Branch_stub_ent): Add "other_" field.
      	(Stub_table::add_long_branch_entry): Add "other" param, and
      	save.
      	(Stub_table::branch_stub_size): Adjust long branch offset.
      	(Stub_table::do_write): Likewise.
      	(Target_powerpc::Relocate::relocate): Likewise.
      fa40fbe4
    • Alan Modra's avatar
      [GOLD] internal error in relocate, at powerpc.cc:10473 · 4290b0ab
      Alan Modra authored
      GOT relocations can refer directly to a function in a fixed position
      executable, unlike ADDR64 which needs a global entry stub, or branch
      relocs, which need PLT stubs.
      
      	* powerpc.cc (is_got_reloc): New function.
      	(Target_powerpc::Relocate::relocate): Use it here, exclude GOT
      	relocs when looking for stubs.
      4290b0ab
    • H.J. Lu's avatar
      x86: Support GNU_PROPERTY_X86_ISA_1_V[234] marker · 32930e4e
      H.J. Lu authored
      GCC 11 supports -march=x86-64-v[234] to enable x86 micro-architecture ISA
      levels:
      
      https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97250
      
      Update GNU_PROPERTY_X86_ISA_1_XXX macros:
      
      https://gitlab.com/x86-psABIs/x86-64-ABI/-/merge_requests/13
      
      in x86 ELF binaries to indicate that micro-architecture ISA levels
      required to execute the binary:
      
       #define GNU_PROPERTY_X86_ISA_1_NEEDED (GNU_PROPERTY_X86_UINT32_OR_LO + 2)
       #define GNU_PROPERTY_X86_ISA_1_USED (GNU_PROPERTY_X86_UINT32_OR_AND_LO + 2)
       #define GNU_PROPERTY_X86_ISA_1_V2 (1U << 0)
       #define GNU_PROPERTY_X86_ISA_1_V3 (1U << 1)
       #define GNU_PROPERTY_X86_ISA_1_V4 (1U << 2)
      
      The previous GNU_PROPERTY_X86_ISA_1_XXX  macros are deprecated and renamed
      to GNU_PROPERTY_X86_COMPAT_2_ISA_1_XXX.
      
      In addition to EM_X86_64, GNU_PROPERTY_X86_ISA_1_V[234] marker can be used
      by ld.so to detect the x86-64-v4 shared library placed in an x86-64-v2
      directory by mistake on an x86-64-v2 machine to avoid crashes on x86-64-v4
      instructions.
      
      Add -z x86-64-v[234] linker command line option to mark x86-64-v[234]
      ISA level as needed.
      
      Also add
      
       #define GNU_PROPERTY_X86_FEATURE_2_MASK (1U << 11)
      
      for mask registers.
      
      bfd/
      
      	PR gas/26703
      	* elf-linker-x86.h (elf_linker_x86_params): Add isa_level.
      	* elfxx-x86.c (_bfd_x86_elf_merge_gnu_properties): Merge
      	GNU_PROPERTY_X86_ISA_1_V[234].
      	(_bfd_x86_elf_link_setup_gnu_properties): Generate
      	GNU_PROPERTY_X86_ISA_1_V[234] for -z x86-64-v[234].
      
      binutils/
      
      	PR gas/26703
      	* readelf.c (decode_x86_compat_2_isa): New function.
      	(decode_x86_isa): Updated for new X86_ISA_1_XXX bits.
      	(decode_x86_feature_1): Handle GNU_PROPERTY_X86_FEATURE_2_MASK.
      	(print_gnu_property_note): Handle X86_COMPAT_2_ISA_1_USED,
      	and X86_COMPAT_2_ISA_1_NEEDED.
      	* testsuite/binutils-all/i386/pr21231b.s: Updated to the current
      	GNU_PROPERTY_X86_ISA_1_USED and GNU_PROPERTY_X86_ISA_1_NEEDED
      	values.
      	* testsuite/binutils-all/x86-64/pr21231b.s: Likewise.
      	* testsuite/binutils-all/x86-64/pr23494a.s: Likewise.
      	* testsuite/binutils-all/x86-64/pr23494b.s: Likewise.
      	* testsuite/binutils-all/x86-64/pr23494c.s: Likewise.
      	* testsuite/binutils-all/i386/empty.d: Updated.
      	* testsuite/binutils-all/i386/ibt.d: Likewise.
      	* testsuite/binutils-all/i386/pr21231a.d: Likewise.
      	* testsuite/binutils-all/i386/pr21231b.d: Likewise.
      	* testsuite/binutils-all/i386/shstk.d: Likewise.
      	* testsuite/binutils-all/x86-64/empty-x32.d: Likewise.
      	* testsuite/binutils-all/x86-64/empty.d: Likewise.
      	* testsuite/binutils-all/x86-64/ibt-x32.d: Likewise.
      	* testsuite/binutils-all/x86-64/ibt.d: Likewise.
      	* testsuite/binutils-all/x86-64/pr21231a.d: Likewise.
      	* testsuite/binutils-all/x86-64/pr21231b.d: Likewise.
      	* testsuite/binutils-all/x86-64/pr23494a-x32.d: Likewise.
      	* testsuite/binutils-all/x86-64/pr23494a.d: Likewise.
      	* testsuite/binutils-all/x86-64/pr23494c-x32.d: Likewise.
      	* testsuite/binutils-all/x86-64/pr23494c.d: Likewise.
      	* testsuite/binutils-all/x86-64/pr23494d-x32.d: Likewise.
      	* testsuite/binutils-all/x86-64/pr23494d.d: Likewise.
      	* testsuite/binutils-all/x86-64/pr23494e-x32.d: Likewise.
      	* testsuite/binutils-all/x86-64/pr23494e.d: Likewise.
      	* testsuite/binutils-all/x86-64/shstk-x32.d: Likewise.
      	* testsuite/binutils-all/x86-64/shstk.d: Likewise.
      
      gas/
      
      	PR gas/26703
      	* config/tc-i386.c (xstate): Add xstate_mask.
      	(md_assemble): Check i.types[j], instead of i.tm.operand_types[j],
      	for xstate.  Set xstate_mask, instead of xstate_zmm, for RegMask.
      	(output_insn): Update for GNU_PROPERTY_X86_ISA_1_V[234].  Update
      	xstate for mask register and VSIB.
      	* testsuite/gas/i386/i386.exp: Run more GNU_PROPERTY tests.
      	* testsuite/gas/i386/property-1.s: Updated to the current
      	GNU_PROPERTY_X86_ISA_1_USED value.
      	* testsuite/gas/i386/property-2.s: Only keep cmove.
      	* testsuite/gas/i386/property-3.s: Changed to addsubpd.
      	* testsuite/gas/i386/property-1.d: Updated.
      	* testsuite/gas/i386/property-2.d: Likewise.
      	* testsuite/gas/i386/property-3.d: Likewise.
      	* testsuite/gas/i386/property-4.d: Likewise.
      	* testsuite/gas/i386/property-5.d: Likewise.
      	* testsuite/gas/i386/property-6.d: Likewise.
      	* testsuite/gas/i386/x86-64-property-1.d: Likewise.
      	* testsuite/gas/i386/x86-64-property-2.d: Likewise.
      	* testsuite/gas/i386/x86-64-property-3.d: Likewise.
      	* testsuite/gas/i386/x86-64-property-4.d: Likewise.
      	* testsuite/gas/i386/x86-64-property-5.d: Likewise.
      	* testsuite/gas/i386/x86-64-property-6.d: Likewise.
      	* testsuite/gas/i386/x86-64-property-7.d: Likewise.
      	* testsuite/gas/i386/x86-64-property-8.d: Likewise.
      	* testsuite/gas/i386/x86-64-property-9.d: Likewise.
      	* testsuite/gas/i386/property-11.d: New file.
      	* testsuite/gas/i386/property-11.s: Likewise.
      	* testsuite/gas/i386/property-12.d: Likewise.
      	* testsuite/gas/i386/property-12.s: Likewise.
      	* testsuite/gas/i386/property-13.d: Likewise.
      	* testsuite/gas/i386/property-13.s: Likewise.
      	* testsuite/gas/i386/x86-64-property-11.d: Likewise.
      	* testsuite/gas/i386/x86-64-property-12.d: Likewise.
      	* testsuite/gas/i386/x86-64-property-13.d: Likewise.
      	* testsuite/gas/i386/x86-64-property-14.d: Likewise.
      	* testsuite/gas/i386/x86-64-property-14.s: Likewise.
      
      include/
      
      	PR gas/26703
      	* elf/common.h (GNU_PROPERTY_X86_ISA_1_USED): Renamed to ...
      	(GNU_PROPERTY_X86_COMPAT_2_ISA_1_USED): This.
      	(GNU_PROPERTY_X86_ISA_1_NEEDED): Renamed to ...
      	(GNU_PROPERTY_X86_COMPAT_2_ISA_1_NEEDED): This.
      	(GNU_PROPERTY_X86_ISA_1_XXX): Renamed to ...
      	(GNU_PROPERTY_X86_COMPAT_2_ISA_1_XXX): This.
      	(GNU_PROPERTY_X86_ISA_1_NEEDED): New.
      	(GNU_PROPERTY_X86_ISA_1_USED): Likewise.
      	(GNU_PROPERTY_X86_ISA_1_V2): Likewise.
      	(GNU_PROPERTY_X86_ISA_1_V3): Likewise.
      	(GNU_PROPERTY_X86_ISA_1_V4): Likewise.
      	(GNU_PROPERTY_X86_FEATURE_2_MASK): Likewise.
      
      ld/
      
      	PR gas/26703
      	* NEWS: Mention -z x86-64-v[234].
      	* ld.texi: Document -z x86-64-v[234].
      	* emulparams/elf32_x86_64.sh: Use x86-64-level.sh.
      	* emulparams/elf_i386.sh: Likewise.
      	* emulparams/elf_x86_64.sh: Likewise.
      	* emulparams/x86-64-level.sh: New file.
      	* testsuite/ld-elf/x86-feature-1a.rd: Update.
      	* testsuite/ld-elf/x86-feature-1b.rd: Likewise.
      	* testsuite/ld-elf/x86-feature-1c.rd: Likewise.
      	* testsuite/ld-elf/x86-feature-1d.rd: Likewise.
      	* testsuite/ld-elf/x86-feature-1e.rd: Likewise.
      	* testsuite/ld-i386/pr23372c.d: Likewise.
      	* testsuite/ld-i386/pr23486c.d: Likewise.
      	* testsuite/ld-i386/pr23486d.d: Likewise.
      	* testsuite/ld-i386/pr24322a.d: Likewise.
      	* testsuite/ld-i386/pr24322b.d: Likewise.
      	* testsuite/ld-i386/property-1a.r: Likewise.
      	* testsuite/ld-i386/property-2a.r: Likewise.
      	* testsuite/ld-i386/property-3.r: Likewise.
      	* testsuite/ld-i386/property-3a.r: Likewise.
      	* testsuite/ld-i386/property-4.r: Likewise.
      	* testsuite/ld-i386/property-4a.r: Likewise.
      	* testsuite/ld-i386/property-5.r: Likewise.
      	* testsuite/ld-i386/property-5a.r: Likewise.
      	* testsuite/ld-i386/property-7a.r: Likewise.
      	* testsuite/ld-i386/property-x86-3.d: Likewise.
      	* testsuite/ld-i386/property-x86-4a.d: Likewise.
      	* testsuite/ld-i386/property-x86-5.d: Likewise.
      	* testsuite/ld-i386/property-x86-cet1.d: Likewise.
      	* testsuite/ld-i386/property-x86-cet2a.d: Likewise.
      	* testsuite/ld-i386/property-x86-cet5a.d: Likewise.
      	* testsuite/ld-i386/property-x86-cet5b.d: Likewise.
      	* testsuite/ld-i386/property-x86-ibt1a.d: Likewise.
      	* testsuite/ld-i386/property-x86-ibt1b.d: Likewise.
      	* testsuite/ld-i386/property-x86-ibt2.d: Likewise.
      	* testsuite/ld-i386/property-x86-ibt3a.d: Likewise.
      	* testsuite/ld-i386/property-x86-ibt3b.d: Likewise.
      	* testsuite/ld-i386/property-x86-ibt4.d: Likewise.
      	* testsuite/ld-i386/property-x86-ibt5.d: Likewise.
      	* testsuite/ld-i386/property-x86-shstk1a.d: Likewise.
      	* testsuite/ld-i386/property-x86-shstk1b.d: Likewise.
      	* testsuite/ld-i386/property-x86-shstk2.d: Likewise.
      	* testsuite/ld-i386/property-x86-shstk3a.d: Likewise.
      	* testsuite/ld-i386/property-x86-shstk3b.d: Likewise.
      	* testsuite/ld-i386/property-x86-shstk4.d: Likewise.
      	* testsuite/ld-i386/property-x86-shstk5.d: Likewise.
      	* testsuite/ld-x86-64/pr23372c-x32.d: Likewise.
      	* testsuite/ld-x86-64/pr23372c.d: Likewise.
      	* testsuite/ld-x86-64/pr23486c.d: Likewise.
      	* testsuite/ld-x86-64/pr23486d-x32.d: Likewise.
      	* testsuite/ld-x86-64/pr23486d.d: Likewise.
      	* testsuite/ld-x86-64/pr24322a-x32.d: Likewise.
      	* testsuite/ld-x86-64/pr24322a.d: Likewise.
      	* testsuite/ld-x86-64/pr24322b-x32.d: Likewise.
      	* testsuite/ld-x86-64/pr24322b.d: Likewise.
      	* testsuite/ld-x86-64/pr24458a-x32.d: Likewise.
      	* testsuite/ld-x86-64/pr24458a.d: Likewise.
      	* testsuite/ld-x86-64/pr24458b-x32.d: Likewise.
      	* testsuite/ld-x86-64/pr24458b.d: Likewise.
      	* testsuite/ld-x86-64/pr24458c-x32.d: Likewise.
      	* testsuite/ld-x86-64/pr24458c.d: Likewise.
      	* testsuite/ld-x86-64/property-1a.r: Likewise.
      	* testsuite/ld-x86-64/property-2a.r: Likewise.
      	* testsuite/ld-x86-64/property-3.r: Likewise.
      	* testsuite/ld-x86-64/property-3a.r: Likewise.
      	* testsuite/ld-x86-64/property-4.r: Likewise.
      	* testsuite/ld-x86-64/property-4a.r: Likewise.
      	* testsuite/ld-x86-64/property-5.r: Likewise.
      	* testsuite/ld-x86-64/property-5a.r: Likewise.
      	* testsuite/ld-x86-64/property-7a.r: Likewise.
      	* testsuite/ld-x86-64/property-x86-3-x32.d: Likewise.
      	* testsuite/ld-x86-64/property-x86-3.d: Likewise.
      	* testsuite/ld-x86-64/property-x86-4a-x32.d: Likewise.
      	* testsuite/ld-x86-64/property-x86-4a.d: Likewise.
      	* testsuite/ld-x86-64/property-x86-5-x32.d: Likewise.
      	* testsuite/ld-x86-64/property-x86-5.d: Likewise.
      	* testsuite/ld-x86-64/property-x86-cet1-x32.d: Likewise.
      	* testsuite/ld-x86-64/property-x86-cet1.d: Likewise.
      	* testsuite/ld-x86-64/property-x86-cet2a-x32.d: Likewise.
      	* testsuite/ld-x86-64/property-x86-cet2a.d: Likewise.
      	* testsuite/ld-x86-64/property-x86-cet5a-x32.d: Likewise.
      	* testsuite/ld-x86-64/property-x86-cet5a.d: Likewise.
      	* testsuite/ld-x86-64/property-x86-cet5b-x32.d: Likewise.
      	* testsuite/ld-x86-64/property-x86-cet5b.d: Likewise.
      	* testsuite/ld-x86-64/property-x86-ibt1a-x32.d: Likewise.
      	* testsuite/ld-x86-64/property-x86-ibt1a.d: Likewise.
      	* testsuite/ld-x86-64/property-x86-ibt1b-x32.d: Likewise.
      	* testsuite/ld-x86-64/property-x86-ibt1b.d: Likewise.
      	* testsuite/ld-x86-64/property-x86-ibt2-x32.d: Likewise.
      	* testsuite/ld-x86-64/property-x86-ibt2.d: Likewise.
      	* testsuite/ld-x86-64/property-x86-ibt3a-x32.d: Likewise.
      	* testsuite/ld-x86-64/property-x86-ibt3a.d: Likewise.
      	* testsuite/ld-x86-64/property-x86-ibt3b-x32.d: Likewise.
      	* testsuite/ld-x86-64/property-x86-ibt3b.d: Likewise.
      	* testsuite/ld-x86-64/property-x86-ibt4-x32.d: Likewise.
      	* testsuite/ld-x86-64/property-x86-ibt4.d: Likewise.
      	* testsuite/ld-x86-64/property-x86-ibt5-x32.d: Likewise.
      	* testsuite/ld-x86-64/property-x86-ibt5.d: Likewise.
      	* testsuite/ld-x86-64/property-x86-shstk1a-x32.d: Likewise.
      	* testsuite/ld-x86-64/property-x86-shstk1a.d: Likewise.
      	* testsuite/ld-x86-64/property-x86-shstk1b-x32.d: Likewise.
      	* testsuite/ld-x86-64/property-x86-shstk1b.d: Likewise.
      	* testsuite/ld-x86-64/property-x86-shstk2-x32.d: Likewise.
      	* testsuite/ld-x86-64/property-x86-shstk2.d: Likewise.
      	* testsuite/ld-x86-64/property-x86-shstk3a-x32.d: Likewise.
      	* testsuite/ld-x86-64/property-x86-shstk3a.d: Likewise.
      	* testsuite/ld-x86-64/property-x86-shstk3b-x32.d: Likewise.
      	* testsuite/ld-x86-64/property-x86-shstk3b.d: Likewise.
      	* testsuite/ld-x86-64/property-x86-shstk4-x32.d: Likewise.
      	* testsuite/ld-x86-64/property-x86-shstk4.d: Likewise.
      	* testsuite/ld-x86-64/property-x86-shstk5-x32.d: Likewise.
      	* testsuite/ld-x86-64/property-x86-shstk5.d: Likewise.
      	* testsuite/ld-i386/i386.exp: Run property-x86-6,
      	property-x86-isa1, property-x86-isa2 and property-x86-isa3.
      	* testsuite/ld-i386/property-x86-1.S: Updated to the current
      	GNU_PROPERTY_X86_ISA_1_USED and GNU_PROPERTY_X86_ISA_1_NEEDED
      	values.
      	* testsuite/ld-i386/property-x86-2.S: Likewise.
      	* testsuite/ld-i386/property-x86-3.s: Likewise.
      	* testsuite/ld-x86-64/pr23372d.s: Likewise.
      	* testsuite/ld-x86-64/pr23372e.s: Likewise.
      	* testsuite/ld-x86-64/pr23372f.s: Likewise.
      	* testsuite/ld-x86-64/pr23486c.s: Likewise.
      	* testsuite/ld-x86-64/pr23486d.s: Likewise.
      	* testsuite/ld-x86-64/property-x86-1.S: Likewise.
      	* testsuite/ld-x86-64/property-x86-2.S: Likewise.
      	* testsuite/ld-x86-64/property-x86-3.s: Likewise.
      	* testsuite/ld-x86-64/property-x86-5a.s: Likewise.
      	* testsuite/ld-x86-64/property-x86-5b.s: Likewise.
      	* testsuite/ld-i386/property-x86-6.d: New file.
      	* testsuite/ld-i386/property-x86-isa1.d: Likewise.
      	* testsuite/ld-i386/property-x86-isa2.d: Likewise.
      	* testsuite/ld-i386/property-x86-isa3.d: Likewise.
      	* testsuite/ld-x86-64/property-x86-6-x32.d: Likewise.
      	* testsuite/ld-x86-64/property-x86-6.d: Likewise.
      	* testsuite/ld-x86-64/property-x86-6.s: Likewise.
      	* testsuite/ld-x86-64/property-x86-isa1-x32.d: Likewise.
      	* testsuite/ld-x86-64/property-x86-isa1.d: Likewise.
      	* testsuite/ld-x86-64/property-x86-isa1.s: Likewise.
      	* testsuite/ld-x86-64/property-x86-isa2-x32.d: Likewise.
      	* testsuite/ld-x86-64/property-x86-isa2.d: Likewise.
      	* testsuite/ld-x86-64/property-x86-isa3-x32.d: Likewise.
      	* testsuite/ld-x86-64/property-x86-isa3.d: Likewise.
      	* testsuite/ld-x86-64/simple.s: Likewise.
      	* ld/testsuite/ld-x86-64/x86-64.exp: Run property-x86-6,
      	property-x86-6-x32, property-x86-isa1, property-x86-isa1-x32,
      	property-x86-isa2, property-x86-isa2-x32, property-x86-isa3-x32
      	and property-x86-isa3.
      32930e4e
    • Hannes Domani's avatar
      Handle void results as unformatted prints · 3d87245c
      Hannes Domani authored
      When printing void results without any format letter, they are output
      as expected:
      (gdb) p $abcd
      $1 = void
      (gdb) p (void)10
      $2 = void
      
      But if any format letter (besides s) is used, it always outputs zero:
      (gdb) p/x $abcd
      $3 = 0x0
      (gdb) p/x (void)10
      $4 = 0x0
      
      So this adds void results to the types handled like unformatted prints.
      
      gdb/ChangeLog:
      
      2020-10-09  Hannes Domani  <ssbssa@yahoo.de>
      
      	PR exp/26714
      	* printcmd.c (print_formatted): Handle void results as
      	unformatted prints.
      
      gdb/testsuite/ChangeLog:
      
      2020-10-09  Hannes Domani  <ssbssa@yahoo.de>
      
      	PR exp/26714
      	* gdb.base/printcmds.exp: Add tests for void results.
      3d87245c
    • Andrew Burgess's avatar
      gdb: Delay releasing target_desc_up in more cases · bbb826f5
      Andrew Burgess authored
      After commit:
      
        commit 51a948fd
        Date:   Mon Jul 20 14:18:04 2020 +0100
      
            gdb: Have allocate_target_description return a unique_ptr
      
      There were a few places where we could (should?) have delayed
      releasing the target_desc_up until a little later.  This commit
      catches these cases.
      
      In the case of ARC, the target_desc_up is now exposed right out to
      gdbserver, which means making a small change there too.
      
      There should be no user visible changes after this commit.
      
      gdb/ChangeLog:
      
      	* arch/aarch32.c (aarch32_create_target_description): Release the
      	target_desc_up as late as possible.
      	* arch/aarch64.c (aarch64_create_target_description): Likewise.
      	* arch/amd64.c (amd64_create_target_description): Likewise.
      	* arch/arc.c (arc_create_target_description): Return a
      	target_desc_up, don't release it.
      	* arch/arc.h (arc_create_target_description): Update declaration.
      	(arc_lookup_target_description): Move target_desc_up into the
      	cache, and return a borrowed pointer.
      	* arch/arm.c (arm_create_target_description): Release the
      	target_desc_up as late as possible.
      	* arch/i386.c (i386_create_target_description): Likewise.
      	* arch/riscv.h (riscv_create_target_description): Update
      	declaration to match definition.
      	* arch/tic6x.c (tic6x_create_target_description): Release the
      	target_desc_up as late as possible.
      
      gdbserver/ChangeLog:
      
      	* linux-arc-low.cc (arc_linux_read_description): Release the
      	unique_ptr returned from arc_create_target_description.
      bbb826f5
    • Andrew Burgess's avatar
      gnulib: Ensure all libraries are used when building gdb/gdbserver · 361cb219
      Andrew Burgess authored
      An issue was reported here related to building GDB on MinGW:
      
        https://sourceware.org/pipermail/gdb/2020-September/048927.html
      
      It was suggested here:
      
        https://sourceware.org/pipermail/gdb/2020-September/048931.html
      
      that the solution might be to make use of $(LIB_GETRANDOM), a variable
      defined in the gnulib makefile, when linking GDB.
      
      In fact I think the issue is bigger than just LIB_GETRANDOM.  When
      using the script binutils-gdb/gnulib/update-gnulib.sh to reimport
      gnulib there is a lot of output from gnulib's gnulib-tool.  Part of
      that output is this:
      
        You may need to use the following makefile variables when linking.
        Use them in <program>_LDADD when linking a program, or
        in <library>_a_LDFLAGS or <library>_la_LDFLAGS when linking a library.
          $(FREXPL_LIBM)
          $(FREXP_LIBM)
          $(INET_NTOP_LIB)
          $(LIBTHREAD)
          $(LIB_GETLOGIN)
          $(LIB_GETRANDOM)
          $(LIB_HARD_LOCALE)
          $(LIB_MBRTOWC)
          $(LIB_SETLOCALE_NULL)
          $(LTLIBINTL) when linking with libtool, $(LIBINTL) otherwise
      
      What I think this is telling us is that we should be including the
      value of all these variables on the link line for gdb and gdbserver.
      
      The problem though is that these variables are define in gnulib's
      makefile, but are not (necessarily) defined in GDB's makefile.
      
      One solution would be to recreate the checks that gnulib performs in
      order to recreate these variables in both gdb's and gdbserver's
      makefile.  Though this shouldn't be too hard, most (if not all) of
      these checks are in the form macros defined in m4 files in the gnulib
      tree, so we could just reference these as needed.  However, in this
      commit I propose a different solution.
      
      Currently, in the top level makefile, we give gdb and gdbserver a
      dependency on gnulib.  Once gnulib has finished building gdb and
      gdbserver can start, these projects then have a hard coded (relative)
      path to the compiled gnulib library in their makefiles.
      
      In this commit I extend the gnulib configure script to install a new
      makefile fragment in the gnulib build directory.  This new file will
      have the usual variable substitutions applied to it, and so can
      include the complete list (see above) of all the extra libraries that
      are needed when linking against gnulib.
      
      In fact the new makefile fragment defines three variables, these are:
      
      LIBGNU: The path to the archive containing gnulib.  Can be used as a
             dependency as when this file changes gdb/gdbserver should be
             relinked.
      
      LIBGNU_EXTRA_LIBS: A list of linker -l.... flags that should be
             included in the link line of gdb/gdbserver.  These are
             libraries that $(LIBGNU) depends on.  This list is taken from
             the output of gnulib-tool, which is run by our
             gnulib/update-gnulib.sh script.
      
      INCGNU: A list of -I.... include paths that should be passed to the
             compiler, these are where the gnulib headers can be found.
      
      Now both gdb and gdbserver can include the makefile fragment and make
      use of these variables.
      
      The makefile fragment relies on the variable GNULIB_BUILDDIR being
      defined.  This is checked for in the fragment, and was already defined
      in the makefiles of gdb and gdbserver.
      
      gdb/ChangeLog:
      
      	* Makefile.in: Include Makefile.gnulib.inc.  Don't define LIBGNU
      	or INCGNU.  Make use of LIBGNU_EXTRA_LIBS when linking.
      
      gdbserver/ChangeLog:
      
      	* Makefile.in: Include Makefile.gnulib.inc.  Don't define LIBGNU
      	or INCGNU.  Make use of LIBGNU_EXTRA_LIBS when linking.
      
      gnulib/ChangeLog:
      
      	* Makefile.gnulib.inc.in: New file.
      	* Makefile.in: Regenerate.
      	* configure: Regenerate.
      	* configure.ac: Install the new file.
      361cb219
    • Jan Vrany's avatar
      Notify observers that directories have changed when using "directory" CLI command · f5c4b229
      Jan Vrany authored
      gdb/ChangeLog
      
      	* source.c (directory_command): Notify observers that "directories"
      	parameter has changed.
      
      gdb/testsuite/ChangeLog
      
      	* gdb.mi/mi-cmd-param-changed.exp: Check that notification is
      	is emmited for both 'set directories' and 'directory' commands.
      f5c4b229
    • Tom Tromey's avatar
      Style more output of "disassemble" command · b2701685
      Tom Tromey authored
      I noticed a couple of spots where the "disassemble" could style its
      output, but currently does not.  This patch adds styling to the
      function name at the start of the disassembly, and any addresses
      printed there.
      
      gdb/ChangeLog
      2020-10-08  Tom Tromey  <tom@tromey.com>
      
      	* cli/cli-cmds.c (print_disassembly): Style function name and
      	addresses.  Add _() wrappers.
      
      gdb/testsuite/ChangeLog
      2020-10-08  Tom Tromey  <tom@tromey.com>
      
      	* gdb.base/style.exp: Check that "main"'s name is styled.
      b2701685
    • GDB Administrator's avatar
      Automatic date update in version.in · b3d3944e
      GDB Administrator authored
      b3d3944e
  3. Oct 08, 2020
    • H.J. Lu's avatar
      gold: Update testsuite/split_[i386|x32|x86_64].sh · f5114272
      H.J. Lu authored
      Update testsuite/split_i386.sh, testsuite/split_x32.sh and
      testsuite/split_x86_64.sh for
      
      commit f9ff65d4
      Author: Alan Modra <amodra@gmail.com>
      Date:   Thu Oct 8 10:27:43 2020 +1030
      
          [GOLD] Increase --split-stack-adjust-size
      
      	* testsuite/split_i386.sh: Updated for --split-stack-adjust-size
      	default change.
      	* testsuite/split_x32.sh: Likewise.
      	* testsuite/split_x86_64.sh: Likewise.
      f5114272
    • Shahab Vahedi's avatar
      Update GDB NEWS with ARC support in GDBserver · ada508b6
      Shahab Vahedi authored
      gdb/ChangeLog:
      
      	* NEWS: Mention ARC support in GDBserver.
      ada508b6
    • Andrew Burgess's avatar
      gdb: Have allocate_target_description return a unique_ptr · 51a948fd
      Andrew Burgess authored
      Update allocate_target_description to return a target_desc_up, a
      specialisation of unique_ptr.
      
      This commit does not attempt to make use of the unique_ptr in the
      best possible way, in almost all cases we immediately release the
      pointer from within the unique_ptr and then continue as before.
      
      There are a few places where it was easy to handle the unique_ptr, and
      in these cases I've done that.
      
      Everything under gdb/features/* is auto-regenerated.
      
      There should be no user visible changes after this commit.
      
      gdb/ChangeLog:
      
      	* arch/aarch32.c (aarch32_create_target_description): Release
      	unique_ptr returned from allocate_target_description.
      	* arch/aarch64.c (aarch64_create_target_description): Likewise.
      	* arch/amd64.c (amd64_create_target_description): Likewise.
      	* arch/arc.c (arc_create_target_description): Likewise.
      	* arch/arm.c (arm_create_target_description): Likewise.
      	* arch/i386.c (i386_create_target_description): Likewise.
      	* arch/riscv.c (riscv_create_target_description): Update return
      	type.  Handle allocate_target_description returning a unique_ptr.
      	(riscv_lookup_target_description): Update to handle unique_ptr.
      	* arch/tic6x.c (tic6x_create_target_description): Release
      	unique_ptr returned from allocate_target_description.
      	* features/microblaze-with-stack-protect.c: Regenerate.
      	* features/microblaze.c: Regenerate.
      	* features/mips-dsp-linux.c: Regenerate.
      	* features/mips-linux.c: Regenerate.
      	* features/mips64-dsp-linux.c: Regenerate.
      	* features/mips64-linux.c: Regenerate.
      	* features/nds32.c: Regenerate.
      	* features/nios2.c: Regenerate.
      	* features/or1k.c: Regenerate.
      	* features/rs6000/powerpc-32.c: Regenerate.
      	* features/rs6000/powerpc-32l.c: Regenerate.
      	* features/rs6000/powerpc-403.c: Regenerate.
      	* features/rs6000/powerpc-403gc.c: Regenerate.
      	* features/rs6000/powerpc-405.c: Regenerate.
      	* features/rs6000/powerpc-505.c: Regenerate.
      	* features/rs6000/powerpc-601.c: Regenerate.
      	* features/rs6000/powerpc-602.c: Regenerate.
      	* features/rs6000/powerpc-603.c: Regenerate.
      	* features/rs6000/powerpc-604.c: Regenerate.
      	* features/rs6000/powerpc-64.c: Regenerate.
      	* features/rs6000/powerpc-64l.c: Regenerate.
      	* features/rs6000/powerpc-7400.c: Regenerate.
      	* features/rs6000/powerpc-750.c: Regenerate.
      	* features/rs6000/powerpc-860.c: Regenerate.
      	* features/rs6000/powerpc-altivec32.c: Regenerate.
      	* features/rs6000/powerpc-altivec32l.c: Regenerate.
      	* features/rs6000/powerpc-altivec64.c: Regenerate.
      	* features/rs6000/powerpc-altivec64l.c: Regenerate.
      	* features/rs6000/powerpc-e500.c: Regenerate.
      	* features/rs6000/powerpc-e500l.c: Regenerate.
      	* features/rs6000/powerpc-isa205-32l.c: Regenerate.
      	* features/rs6000/powerpc-isa205-64l.c: Regenerate.
      	* features/rs6000/powerpc-isa205-altivec32l.c: Regenerate.
      	* features/rs6000/powerpc-isa205-altivec64l.c: Regenerate.
      	* features/rs6000/powerpc-isa205-ppr-dscr-vsx32l.c: Regenerate.
      	* features/rs6000/powerpc-isa205-ppr-dscr-vsx64l.c: Regenerate.
      	* features/rs6000/powerpc-isa205-vsx32l.c: Regenerate.
      	* features/rs6000/powerpc-isa205-vsx64l.c: Regenerate.
      	* features/rs6000/powerpc-isa207-htm-vsx32l.c: Regenerate.
      	* features/rs6000/powerpc-isa207-htm-vsx64l.c: Regenerate.
      	* features/rs6000/powerpc-isa207-vsx32l.c: Regenerate.
      	* features/rs6000/powerpc-isa207-vsx64l.c: Regenerate.
      	* features/rs6000/powerpc-vsx32.c: Regenerate.
      	* features/rs6000/powerpc-vsx32l.c: Regenerate.
      	* features/rs6000/powerpc-vsx64.c: Regenerate.
      	* features/rs6000/powerpc-vsx64l.c: Regenerate.
      	* features/rs6000/rs6000.c: Regenerate.
      	* features/rx.c: Regenerate.
      	* features/s390-gs-linux64.c: Regenerate.
      	* features/s390-linux32.c: Regenerate.
      	* features/s390-linux32v1.c: Regenerate.
      	* features/s390-linux32v2.c: Regenerate.
      	* features/s390-linux64.c: Regenerate.
      	* features/s390-linux64v1.c: Regenerate.
      	* features/s390-linux64v2.c: Regenerate.
      	* features/s390-te-linux64.c: Regenerate.
      	* features/s390-tevx-linux64.c: Regenerate.
      	* features/s390-vx-linux64.c: Regenerate.
      	* features/s390x-gs-linux64.c: Regenerate.
      	* features/s390x-linux64.c: Regenerate.
      	* features/s390x-linux64v1.c: Regenerate.
      	* features/s390x-linux64v2.c: Regenerate.
      	* features/s390x-te-linux64.c: Regenerate.
      	* features/s390x-tevx-linux64.c: Regenerate.
      	* features/s390x-vx-linux64.c: Regenerate.
      	* mips-tdep.c (_initialize_mips_tdep): Release unique_ptr returned
      	from allocate_target_description.
      	* target-descriptions.c (allocate_target_description): Update
      	return type.
      	(print_c_tdesc::visit_pre): Release unique_ptr returned from
      	allocate_target_description.
      
      gdbserver/ChangeLog:
      
      	* linux-low.cc (linux_process_target::handle_extended_wait):
      	Release the unique_ptr returned from allocate_target_description.
      	* linux-riscv-low.cc (riscv_target::low_arch_setup): Likewise.
      	* linux-x86-low.cc (tdesc_amd64_linux_no_xml): Change type.
      	(tdesc_i386_linux_no_xml): Change type.
      	(x86_linux_read_description): Borrow pointer from unique_ptr
      	object.
      	(x86_target::get_ipa_tdesc_idx): Likewise.
      	(initialize_low_arch): Likewise.
      	* tdesc.cc (allocate_target_description): Update return type.
      
      gdbsupport/ChangeLog:
      
      	* tdesc.h (allocate_target_description): Update return type.
      51a948fd
    • Alan Modra's avatar
      [GOLD] Increase --split-stack-adjust-size · f9ff65d4
      Alan Modra authored
      For functions with small (< 256 bytes) stack frames, the current x86
      do_calls_non_split ignores --split-stack-adjust-size and, in
      combination with __morestack_non_split, supplies a non-split-stack
      function with at least 0x100000 (1M) available stack.  On powerpc64, a
      default of 0x4000 is not large enough to reliably work with the golang
      testsuite.  This increase the default size to the defacto x86 value.
      
      	* options.h (split_stack_adjust_size): Default to 0x100000.
      f9ff65d4
    • GDB Administrator's avatar
      Automatic date update in version.in · 467eed62
      GDB Administrator authored
      467eed62
    • H.J. Lu's avatar
      x86: Update GNU property tests · 3d08aa66
      H.J. Lu authored
      Update property tests for glibc compiled by Fedora binary annotation
      plugin for GCC, which may insert additonal GNU properties:
      
      	x86 ISA needed: SSE, SSE2
      
      	* testsuite/ld-i386/property-3.r: Updated for Fedora binary
      	annotation plugin for GCC.
      	* testsuite/ld-i386/property-4.r: Likewise.
      	* testsuite/ld-i386/property-5.r: Likewise.
      	* testsuite/ld-x86-64/property-3.r: Likewise.
      	* testsuite/ld-x86-64/property-4.r: Likewise.
      	* testsuite/ld-x86-64/property-5.r: Likewise.
      3d08aa66
    • Tom Tromey's avatar
      Add simple_search_memory unit tests · 485c47e5
      Tom Tromey authored
      This adds some unit tests for simple_search_memory.  I tried here to
      reproduce some bugs (PR gdb/11158 and PR gdb/17756), but was unable
      to.
      
      gdb/ChangeLog
      2020-10-07  Tom Tromey  <tromey@adacore.com>
      
      	* unittests/search-memory-selftests.c: New file.
      	* Makefile.in (SELFTESTS_SRCS): Add
      	unittests/search-memory-selftests.c.
      485c47e5
    • Tom Tromey's avatar
      Document inclusive range in help for "find" · 3a135a91
      Tom Tromey authored
      PR gdb/16930 points out that the "find" command uses an inclusive
      range; but this is not documented in the "help".  This patch updates
      the help text.
      
      gdb/ChangeLog
      2020-10-07  Tom Tromey  <tromey@adacore.com>
      
      	PR gdb/16930:
      	* findcmd.c (_initialize_mem_search): Mention that the range is
      	inclusive.
      3a135a91
    • Tom Tromey's avatar
      Remove some dead code from handle_search_memory · 60b74662
      Tom Tromey authored
      handle_search_memory had some code after a call to error.  This code
      is dead, and this patch removes it.
      
      gdbserver/ChangeLog
      2020-10-07  Tom Tromey  <tromey@adacore.com>
      
      	* server.cc (handle_search_memory): Remove dead code.
      60b74662
    • Tom Tromey's avatar
      Use simple_search_memory in gdbserver · 55b10d89
      Tom Tromey authored
      This replaces gdbserver's memory-searching function with
      simple_search_memory.
      
      gdbserver/ChangeLog
      2020-10-07  Tom Tromey  <tromey@adacore.com>
      
      	* server.cc (handle_search_memory_1): Remove.
      	(handle_search_memory): Use simple_search_memory.
      55b10d89
    • Tom Tromey's avatar
      Move simple_search_memory to gdbsupport/search.cc · 4a72de73
      Tom Tromey authored
      This moves the simple_search_memory function to a new file,
      gdbsupport/search.cc.  The API is slightly changed to make it more
      general.  This generality is useful for wiring it to gdbserver, and
      also for unit testing.
      
      gdb/ChangeLog
      2020-10-07  Tom Tromey  <tromey@adacore.com>
      
      	* target.h (simple_search_memory): Don't declare.
      	* target.c (simple_search_memory): Move to gdbsupport.
      	(default_search_memory): Update.
      	* remote.c (remote_target::search_memory): Update.
      
      gdbsupport/ChangeLog
      2020-10-07  Tom Tromey  <tromey@adacore.com>
      
      	* Makefile.in: Rebuild.
      	* Makefile.am (libgdbsupport_a_SOURCES): Add search.cc.
      	* search.h: New file.
      	* search.cc: New file.
      4a72de73
    • Tom Tromey's avatar
      Rename some tests in find.exp · e86efb33
      Tom Tromey authored
      This renames some tests in find.exp, to avoid duplicate test names.
      
      gdb/testsuite/ChangeLog
      2020-10-07  Tom Tromey  <tromey@adacore.com>
      
      	* gdb.base/find.exp: Rename some tests.
      e86efb33
    • Simon Marchi's avatar
      gdb: put user-supplied CFLAGS at the end · a038ffd8
      Simon Marchi authored
      GDB currently doesn't build cleanly with clang (a -Wdeprecated-copy-dtor
      error).  I configured my clang-based GDB build with
      CXXFLAGS="-Wno-error=deprecated-copy-dtor", so I can use it despite that
      problem.  However, I found that it had no effect.  This is because my
      -Wno-error=Wdeprecated-copy-dtor switch is followed by -Werror in the
      command line, which switches back all warnings to be errors.
      
      If we want the user-supplied C(XX)FLAGS to be able to override flags
      added by our configure script, the user-supplied C(XX)FLAGS should
      appear after the configure-supplied flags.
      
      This patch moves the user-supplied CXXFLAGS at the very end of the
      compilation command line, which fixes the problem described above.  This
      means moving it out of INTERNAL_CFLAGS and inlining it in the users of
      INTERNAL_CFLAGS.
      
      I observed the problem when building GDB, but the same problem could
      happen with GDBserver, so the change is done there too.
      
      In GDBserver, INTERNAL_CFLAGS is passed when linking
      
      gdb/ChangeLog:
      
      	* Makefile.in (COMPILE): Add CXXFLAGS.
      	(INTERNAL_CFLAGS_BASE): Remove CXXFLAGS.
      	(check-headers): Add CXXFLAGS.
      
      gdbserver/ChangeLog:
      
      	* Makefile.in (COMPILE): Add CXXFLAGS.
      	(INTERNAL_CFLAGS_BASE): Remove CXXFLAGS.
      	(gdbserver$(EXEEXT)): Add CXXFLAGS.
      	(gdbreplay$(EXEEXT)): Add CXXFLAGS.
      	($(IPA_LIB)): Add CXXFLAGS.
      	(IPAGENT_COMPILE): Add CXXFLAGS.
      
      Change-Id: I00e054506695e0e9536095c6d14827e48abd8f69
      a038ffd8
    • Kamil Rytarowski's avatar
      Add Makefile.in entry for "Add NetBSD/aarch64 gdbserver support" · 8b558efe
      Kamil Rytarowski authored
      The support is on par with NetBSD/amd64, thus GPR works,
      single step and software breakpoint are operational, and the
      SVR4 r_debug integration is functional.
      
      gdbserver/ChangeLog:
      
               * netbsd-aarch64-low.cc: Add.
               * Makefile.in (SFILES): Register "netbsd-aarch64-low.c".
               * configure.srv: Add aarch64*-*-netbsd*.
      8b558efe
    • Shahab Vahedi's avatar
      gdb: Correct the ChageLog entry · bbe90b5d
      Shahab Vahedi authored
      Becausae of a copy/paste, I've put myself as the author of the
      following patch which was not true:
      
      6d2d7c56 gdbserver: Add GNU/Linux support for ARC
      
      This change will place the correct date and author in the ChangeLog.
      bbe90b5d
    • Anton Kolesov's avatar
      arc: Add support for Linux coredump files · cc463201
      Anton Kolesov authored
      With the implemenations in this patch, ARC gdb can handle
      coredump related matters.  The binutils counter part of
      this patch has already been pushed [1].
      
      v2 [2]:
      - arc_linux_collect_gregset: Use "reg <= ARC_LAST_REGNUM" instead of
        "reg < ARC_LAST_REGNUM" for the condition check of the for-loop.
      - arc-linux-tdep.c: Use "ARC_LAST_REGNUM < ARRAY_SIZE (...)" instead of
        "ARC_LAST_REGNUM <= ARRAY_SIZE (...)" for the "asserts".
      - Use "buf + arc_linux_core_reg_offsets[ARC_ERET_REGNUM]" instead of
        "buf + REG_OFF (6)".
      - Fix a few typos/indentation.
      
      v3 [3]:
      - Use gdb_assert_not_reached(text) instead of gdb_assert (!text).
      - Remove unnecessary braces in the for loop.
      
      [1] arc: Add support for ARC HS extra registers in core files
      https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=2745674244d6aecddcf636475034bdb9c0a6b4a0
      
      [2] First remarks
      https://sourceware.org/pipermail/gdb-patches/2020-September/171912.html
      
      [3] Second remarks
      https://sourceware.org/pipermail/gdb-patches/2020-October/172302.html
      
      gdb/ChangeLog:
      
      	* arc-linux-tdep.h: New file.
      	* arc-linux-tdep.c (arc_linux_core_reg_offsets,
      	arc_linux_supply_gregset, arc_linux_supply_v2_regset,
      	arc_linux_collect_gregset, arc_linux_collect_v2_regset,
      	arc_linux_gregset, arc_linux_v2_regset,
      	arc_linux_iterate_over_regset_sections,
      	arc_linux_core_read_description): Implement.
      	(arc_linux_init_osabi): Set iterate_over_regset_sections.
      	* arc-tdep.h (ARC_OFFSET_NO_REGISTER): Declare.
              (arc_gdbarch_features_create): Add.
      	* arc-tdep.c (arc_gdbarch_features_create): Not static anymore.
      cc463201
  4. Oct 07, 2020
    • Anton Kolesov's avatar
      gdbserver: Add GNU/Linux support for ARC · 6d2d7c56
      Anton Kolesov authored
      This gdbserver implementation supports ARC ABI v3 and v4 (older ARC ABI
      versions are not supported by other modern GNU tools or Linux itself).
      Gdbserver supports inspection of ARC HS registers R30, R58 and R59 - feature
      that has been added to Linux 4.12.  Whether gdbserver build will actually
      support this feature depends on the version of Linux headers used to build
      the server.
      
      v2 [1]:
      - Use "this->read_memory ()" instead of "the_target->read_memory ()".
      - Remove the unnecessary "arch-arc.o:" target from the "Makefile.in".
      - Got rid of "ntohs()" function and added lots of comments about
        endianness.
      - Clarify why "pc" value is read from and saved to different fields
        in user regs struct.
      - In function "is_reg_name_available_p()", use a range-based iterator
        to loop over the registers.
      - Removed mentioning of issue number that was not related to sourceware.
      - A few typo's fixed.
      
      [1] Remarks
      https://sourceware.org/pipermail/gdb-patches/2020-September/171911.html
      https://sourceware.org/pipermail/gdb-patches/2020-September/171919.html
      
      gdbserver/ChangeLog:
      
      	* configure.srv: Support ARC architecture.
      	* Makefile.in: Add linux-arc-low.cc and arch/arc.o.
      	* linux-arc-low.cc: New file.
      6d2d7c56
    • Shahab Vahedi's avatar
      arc: Rename "arc_gdbarch_features" struct · e4bd363f
      Shahab Vahedi authored
      "arc_gdbarch_features" is a data structure containing information
      about the ARC architecture: ISA version, register size, etc.
      This name is misleading, because although it carries the phrase
      "gdbarch", it has nothing to do with the type/interface in GDB.
      Traditionaly, "gdbarch" structures are only used for that purpose.
      To rectify this, this patch changes the name to "arc_arch_features".
      
      gdb/ChangeLog:
      
      	* arch/arc.h: Rename "arc_gdbarch_features" to
      	"arc_arch_features".
      	* arc-tdep.h: Likewise.
      	* arc-tdep.c: Likewise.
      e4bd363f
    • Kamil Rytarowski's avatar
      Stop passing netbsd_process_target to local functions · 48491055
      Kamil Rytarowski authored
      Switch from target->read_memory to netbsd_nat::read_memory and
      cleanup the code.
      
      No functional change.
      
      gdbserver/ChangeLog:
      
              * netbsd-low.cc (get_dynamic, get_r_debug, read_one_ptr)
              (netbsd_qxfer_libraries_svr4): Remove "target" argument and update.
              (netbsd_process_target::qxfer_libraries_svr4): Update.
      48491055
    • Tankut Baris Aktemur's avatar
      gdb/infcmd: remove redundant clear_proceed_status call · b68bef99
      Tankut Baris Aktemur authored
      In `attach_command`, there is a call to `init_wait_for_inferior`
      followed by a call to `clear_proceed_status`.  However,
      `init_wait_for_inferior` already calls `clear_proceed_status`.  Remove
      the redundant call.
      
      Regression-tested on X86_64 Linux.
      
      gdb/ChangeLog:
      2020-10-07  Tankut Baris Aktemur  <tankut.baris.aktemur@intel.com>
      
      	* infcmd.c (attach_command): Remove the redundant call to
      	`clear_proceed_status`.
      b68bef99
    • Kamil Rytarowski's avatar
      Correct logical error in NetBSD's read_memory and write_memory · 4641551a
      Kamil Rytarowski authored
      In case of repeated ptrace PT_IO call and returning the value of
      transferred bytes equal to 0, do not return without setting
      xfered_len.
      
      gdb/ChangeLog:
      
              * nat/netbsd-nat.c (write_memory, read_memory): Update.
      4641551a
    • Kamil Rytarowski's avatar
      Fix whitespace formatting · 2be01f63
      Kamil Rytarowski authored
      gdbserver/ChangeLog:
      
              * netbsd-low.cc: Fix whitespace formatting.
              * netbsd-amd64-low.cc: Likewise.
      2be01f63
    • Kamil Rytarowski's avatar
      Add common write_memory and read_memory NetBSD routines · 91e5e8db
      Kamil Rytarowski authored
      Instead of sharing the native-only code with all BSDs with slightly
      different semantics of the kernels, share the NetBSD-only behavior beteen
      the NetBSD native and gdbserver setup.
      
      NetBSD does not differentiate the address space I and D in the
      operations (contrary to OpenBSD). NetBSD handles EACCES that integrates
      with NetBSD specific PaX MPROTECT error handling.
      
      Add a verbose message in the native client that an operation could be
      cancelled due to PaX MPROTECT setup.
      
      gdb/ChangeLog:
      
             * nat/netbsd-nat.c (write_memory, read_memory): Add.
             * nat/netbsd-nat.h (write_memory, read_memory): Likewise.
             * nbsd-nat.c (nbsd_nat_target::xfer_partial): Update.
      
      gdbserver/ChangeLog:
      
             * netbsd-low.cc (netbsd_process_target::read_memory)
             (netbsd_process_target::write_memory): Update.
      91e5e8db
    • Kamil Rytarowski's avatar
      Add ChangeLog for "Add NetBSD/aarch64 gdbserver support" · 9529c852
      Kamil Rytarowski authored
      The support is on par with NetBSD/amd64, thus GPR works,
      single step and software breakpoint are operational, and the
      SVR4 r_debug integration is functional.
      
      gdbserver/ChangeLog:
      
               * netbsd-aarch64-low.cc: Add.
               * Makefile.in (SFILES): Register "netbsd-aarch64-low.c".
               * configure.srv: Add aarch64*-*-netbsd*.
      9529c852
    • Kamil Rytarowski's avatar
      Add NetBSD/aarch64 gdbserver support · 8e1d0929
      Kamil Rytarowski authored
      The support is on par with NetBSD/amd64, thus GPR works,
      single step and software breakpoint are operational, and the
      SVR4 r_debug integration is functional.
      
      gdbserver/ChangeLog:
      
               * netbsd-aarch64-low.cc: Add.
               * Makefile.in (SFILES): Register "netbsd-aarch64-low.c".
               * configure.srv: Add aarch64*-*-netbsd*.
      8e1d0929
    • Simon Marchi's avatar
      gdb: make signal_catch_counts a static array · 64c03bdb
      Simon Marchi authored
      I noticed that signal_catch_counts is a dynamically-allocated array of
      constant size, allocated at startup an never freed.  This might as well
      be a statically-allocated array.
      
      gdb/ChangeLog:
      
      	* break-catch-sig.c (signal_catch_counts): Make a static arrray.
      	(_initialize_break_catch_sig): Don't allocate array.
      
      Change-Id: I220321df5ad6c1d2664ec9d483eea2dc1c979afe
      64c03bdb
    • Michael Forney's avatar
      gdb: Fix installation of gcore.1 on some platforms · 4b136f6f
      Michael Forney authored
      gcore is installed on NetBSD, FreeBSD, Solaris (HAVE_NATIVE_GCORE_HOST=1)
      and Linux (HAVE_NATIVE_GCORE_TARGET=1). However, even though gcore.1
      is installed conditional on those variables, HAVE_NATIVE_GCORE_HOST
      was missing from gdb/doc/Makefile.in, so manual installation was
      skipped on NetBSD, FreeBSD, and Solaris.
      
      gdb/doc/ChangeLog:
      2020-10-06  Michael Forney  <mforney@mforney.org>
      
              * Makefile.in (HAVE_NATIVE_GCORE_HOST): Add for gcore.1
              install condition.
      
      Change-Id: I17c3ce2ecdfb806ece17f05ba78356b25ffa865e
      4b136f6f