1. 19 Feb, 2021 1 commit
  2. 15 Feb, 2021 2 commits
  3. 28 Jun, 2020 4 commits
  4. 27 Jun, 2020 4 commits
    • Simon Marchi's avatar
      gdbsupport: add format attribute to print_xml_feature::add_line · 6db3031e
      Simon Marchi authored
      Fixes this clang error:
            CXX      tdesc.o
          /home/smarchi/src/binutils-gdb/gdbsupport/tdesc.cc:444:25: error: format string is not a string literal [-Werror,-Wformat-nonliteral]
            string_vappendf (tmp, fmt, ap);
      There is already a but about GCC not emitting this warning:
      	* tdesc.h (class print_xml_feature) <add_line>: Add
      Change-Id: I7014075e83717f6d7e19d044a3675ff9981ebe17
    • Pedro Alves's avatar
      Make {get,set}_inferior_io_terminal inferior methods · 05779d57
      Pedro Alves authored
      This converts the get_inferior_io_terminal and
      set_inferior_io_terminal free functions to inferior methods.
      Since the related commands are called "tty", "{set,show}
      inferior-tty", and MI's "-inferior-tty-{set,show}", to make the
      connection between the commands and the code more obvious, the methods
      are named set_tty/tty instead of set_io_terminal/io_terminal.
      	* fork-child.c (prefork_hook): Adjust.
      	* infcmd.c (set_inferior_io_terminal, get_inferior_io_terminal):
      	(set_inferior_tty_command, show_inferior_tty_command): Adjust.
      	* inferior.c (inferior::set_tty, inferior::tty): New methods.
      	* inferior.h (set_inferior_io_terminal, get_inferior_io_terminal):
      	Remove declarations.
      	(struct inferior) <set_tty, tty>: New methods.
      	(struct inferior) <terminal>: Rename to ...
      	(struct inferior) <m_terminal>: ... this and make private.
      	* main.c (captured_main_1): Adjust.
      	* mi/mi-cmd-env.c (mi_cmd_inferior_tty_set): Adjust.
      	(mi_cmd_inferior_tty_show): Adjust.
      	* nto-procfs.c (nto_procfs_target::create_inferior): Adjust.
      	* windows-nat.c (windows_nat_target::create_inferior): Adjust.
    • Alan Modra's avatar
      asan: readelf: use after free in process_archive · cfc16775
      Alan Modra authored
      This tidies up in cases where fuzzed thin archives hit the error return
      path in setup_nested_archive.
      	* elfcomm.c (setup_nested_archive): Set nested_arch->file to NULL
      	after freeing.
      	(release_archive): Set fields of arch to NULL after freeing.
    • GDB Administrator's avatar
      Automatic date update in version.in · aa57a9d3
      GDB Administrator authored
  5. 26 Jun, 2020 25 commits
    • Philippe Waroquiers's avatar
      Make test names unique in python.exp and guile.exp · c0b3b3bd
      Philippe Waroquiers authored
      Version 2, handles the comments of Simon and Pedro.
      Note that gdb_test_multiline and gdb_py_test_multiple are using
      the "input line" as the test name, and so when there is a duplicated
      input line (such as a line containing "end"), we have duplicated test
      names => as gdb_test_multiline and gdb_py_test_multiple are identical,
      as indicated in FIXME, move this to gdb.exp, and make the test name unique
      by adding the inputnr to the pass message for each input.
      2020-06-26  Philippe Waroquiers  <philippe.waroquiers@skynet.be>
      	* lib/gdb.exp (gdb_test_multiline): New, moved from gdb-guile.exp,
      	have a input seq nr in each pass message.
              * lib/gdb-guile.exp (gdb_test_multiline): Move to gdb.exp.
      	* lib/gdb-python.exp (gdb_py_test_multiple): Remove.
      	* gdb.python/python.exp: Make test names unique,
      	use gdb_test_multiline instead of gdb_py_test_multiple,
      	use $gdb_test_name.
      	* gdb.guile/guile.exp: Make test names unique, use $gdb_test_name
    • H.J. Lu's avatar
      x86: Process ImmExt without operands · b6cd5d10
      H.J. Lu authored
      To support Intel AMX instructions with 8-bit immediate opcode extension,
      but without operands:
      tilerelease, 0, 0x49, 0xc0, 1, CpuAMX_TILE|Cpu64, Vex|VexOpcode=1|No_bSuf|No_wSuf|No_lSuf|No_sSuf|No_qSuf|No_ldSuf|ImmExt, { 0 }
      process ImmExt without operands.
      	* config/tc-i386.c (md_assemble): Process ImmExt without
    • H.J. Lu's avatar
      i386-opc.tbl: Add a blank line · e978ad62
      H.J. Lu authored
      	* i386-opc.tbl: Add a blank line.
    • H.J. Lu's avatar
      x86: Correct VexSIB128 to VecSIB128 · 79b32e73
      H.J. Lu authored
    • H.J. Lu's avatar
      x86: Rename VecSIB to SIB for Intel AMX · 63112cd6
      H.J. Lu authored
      Rename VecSIB to SIB to support Intel Advanced Matrix Extensions which
      introduces instructions with a mandatory SIB byte which isn't a vector
      SIB (VSIB).
      	* config/tc-i386.c (check_VecOperands): Replace vecsib with sib.
      	Replace VecSIB128, VecSIB256 and VecSIB512 with VECSIB128,
      	VECSIB256 and VECSIB512, respectively.
      	(build_modrm_byte): Replace vecsib with sib.
      	* i386-gen.c (opcode_modifiers): Replace VecSIB with SIB.
      	(VecSIB128): Renamed to ...
      	(VECSIB128): This.
      	(VecSIB256): Renamed to ...
      	(VECSIB256): This.
      	(VecSIB512): Renamed to ...
      	(VECSIB512): This.
      	(VecSIB): Renamed to ...
      	(SIB): This.
      	(i386_opcode_modifier): Replace vecsib with sib.
      	* i386-opc.tbl (VexSIB128): New.
      	(VecSIB256): Likewise.
      	(VecSIB512): Likewise.
      	Replace VecSIB=1, VecSIB=2 and VecSIB=3 with VexSIB128, VecSIB256
      	and VecSIB512, respectively.
    • Nick Alcock's avatar
      libctf: support platforms with separate libintl · 8e6635bd
      Nick Alcock authored
      We were not using the right configure machinery to spot libintl on
      platforms where it was required, leading to the spurious failure of
      various configure tests (e.g. for things like ELF support in BFD).
      	* aclocal.m4: Add config/gettext-sister.m4: Shuffle into
      	alphabetical order.
      	* configure.ac: Add ZW_GNU_GETTEXT_SISTER_DIR.
      	* config.h.in: Regenerated.
      	* Makefile.in: Likewise.
      	* configure: Likewise.
    • Nick Alcock's avatar
      libctf: add some missing #includes. · c1401ecc
      Nick Alcock authored
      Causes warnings on (at least) recent FreeBSD.
      	* ctf-create.c: Include <unistd.h>.
      	* ctf-open-bfd.c: Likewise.
    • Nick Alcock's avatar
      libctf, elfcpp, gold: do not assume that <byteswap.h> contains bswap_* · e755667f
      Nick Alcock authored
      At least one C library (uclibc-ng) defines some of these only when
      the compiler is GCC.  We might as well test for all three cases and
      handle any of them being missing.
      Very similar code exists in libctf and split between elfcpp and gold:
      fix both.
      (Also sync up elfcpp with a change made to libctf swap.h a few months
      ago: since there is no out-of-line definition of the bswap replacements,
      they should be declared static inline, not just inline, to prevent the
      linker generating out-of-line references to them.)
      	PR libctf/25120
      	* configure.ac: Check for bswap_16, bswap_32, and bswap_64 decls.
      	* swap.h (bswap_16): Do not assume that presence of <byteswap.h>
      	means this is declared.
      	(bswap_32): Likewise.
      	(bswap_64): Likewise.
      	(bswap_identity_64): Remove, unused.
      	* configure: Regenerated.
      	* config.h.in: Likewise.
      	* configure.ac: Check for bswap_16, bswap_32, and bswap_64 decls.
      	* configure: Regenerated.
      	* config.h.in: Likewise.
      	* elfcpp_swap.h (bswap_16): Do not assume that presence of
      	<byteswap.h> means this is declared.  Make static inline, matching
      	recent change to libctf, since there is no non-inline definition
      	of these functions.
      	(bswap_32): Likewise.
      	(bswap_64): Likewise.
    • Nick Alcock's avatar
      libctf: work with compilers not supporting GNU C attributes · 86670658
      Nick Alcock authored
      The obvious fallback __attribute__ stanza was missing.
      Thanks to Harald van Dijk.
      	PR 25120
      	* ctf-impl.h (_libctf_printflike_): Add non-GNU-C fallback.
      	(_libctf_unlikely_): Likewise.
      	(_libctf_unused): Likewise.
      	(_libctf_malloc_): Likewise.
    • Nick Alcock's avatar
      libctf: avoid nonportable __thread in CTF archive handling · 2e428e74
      Nick Alcock authored
      This keeps archive searching threadsafe using the new bsearch_r that was
      just added to libiberty.
      	* ctf-archive.c (search_nametbl): No longer global: declare...
      	(ctf_arc_open_by_name_internal): ... here. Use bsearch_r.
      	(search_modent_by_name): Take and use ARG for the nametbl.
    • Nick Alcock's avatar
      libctf, binutils: support CTF archives like objdump · 2f6ecaed
      Nick Alcock authored
      objdump and readelf have one major CTF-related behavioural difference:
      objdump can read .ctf sections that contain CTF archives and extract and
      dump their members, while readelf cannot.  Since the linker often emits
      CTF archives, this means that readelf intermittently and (from the
      user's perspective) randomly fails to read CTF in files that ld emits,
      with a confusing error message wrongly claiming that the CTF content is
      corrupt.  This is purely because the archive-opening code in libctf was
      needlessly tangled up with the BFD code, so readelf couldn't use it.
      Here, we disentangle it, moving ctf_new_archive_internal from
      ctf-open-bfd.c into ctf-archive.c and merging it with the helper
      function in ctf-archive.c it was already using.  We add a new public API
      function ctf_arc_bufopen, that looks very like ctf_bufopen but returns
      an archive given suitable section data rather than a ctf_file_t: the
      archive is a ctf_archive_t, so it can be called on raw CTF dictionaries
      (with no archive present) and will return a single-member synthetic
      There is a tiny lifetime tweak here: before now, the archive code could
      assume that the symbol section in the ctf_archive_internal wrapper
      structure was always owned by BFD if it was present and should always be
      freed: now, the caller can pass one in via ctf_arc_bufopen, wihch has
      the usual lifetime rules for such sections (caller frees): so we add an
      extra field to track whether this is an internal call from ctf-open-bfd,
      in which case we still free the symbol section.
      	* ctf-api.h (ctf_arc_bufopen): New.
      	* ctf-impl.h (ctf_new_archive_internal): Declare.
      	(ctf_arc_bufopen): Remove.
      	(ctf_archive_internal) <ctfi_free_symsect>: New.
      	* ctf-archive.c (ctf_arc_close): Use it.
      	(ctf_arc_bufopen): Fuse into...
      	(ctf_new_archive_internal): ... this, moved across from...
      	* ctf-open-bfd.c: ... here.
      	(ctf_bfdopen_ctfsect): Use ctf_arc_bufopen.
      	* libctf.ver: Add it.
      	* readelf.c (dump_section_as_ctf): Support .ctf archives using
      	ctf_arc_bufopen.  Automatically load the .ctf member of such
      	archives as the parent of all other members, unless specifically
      	overridden via --ctf-parent.  Split out dumping code into...
      	(dump_ctf_archive_member): ... here, as in objdump, and call
      	it once per archive member.
      	(dump_ctf_indent_lines): Code style fix.
    • Nick Alcock's avatar
      libctf: create: forwards are always in the namespace of their referent · 8ffcdf18
      Nick Alcock authored
      The C namespace a forward is located in is always the same as the
      namespace of the corresponding complete type: 'struct foo' is in the
      struct namespace and does not collide with, say, 'union foo'.
      libctf allowed for this in many places, but inconsistently: in
      particular, forward *addition* never allowed for this, and was interning
      forwards in the default namespace, which is always wrong, since you can
      only forward structs, unions and enums, all of which are in their own
      namespaces in C.
      Forward removal needs corresponding adjustment to remove the names form
      the right namespace, as does ctf_rollback.
      	* ctf-create.c (ctf_add_forward): Intern in the right namespace.
      	(ctf_dtd_delete): Remove correspondingly.
      	(ctf_rollback): Likewise.
    • Nick Alcock's avatar
      libctf: create: ctf_add_type should hand back already-added non-SoUs · d04a47ac
      Nick Alcock authored
      When we add a type from a dictionary and then try to add it again, we
      should hand it back unchanged unless it is a structure, union or enum
      with a different number of members.  That's what the comment says we do.
      Instead, we hand it back unchanged *only* if it is a structure, union or
      enum with the same number of members: non-structs, unions and enums are
      unconditionally added.  This causes extreme type bloating and (in
      conjunction with the bug fixed by the next commit) can easily lead to
      the same type being mistakenly added to a dictionary more than once
      (which, for forwards, was not banned and led to dictionary corruption).
      	* ctf-create.c (ctf_add_type_internal): Hand back existing types
    • Nick Alcock's avatar
      libctf: create: don't add forwards if the type added already exists · 6bbf9da8
      Nick Alcock authored
      This is what ctf_add_forward is documented to do, but it's not what it
      actually does: the code is quite happy to add forwards that duplicate
      existing structs, etc.
      This is obviously wrong and breaks both the nondeduplicating linker
      and the upcoming deduplicator, as well as allowing ordinary callers of
      ctf_add_type to corrupt the dictionary by just adding the same root-
      visible forward more than once.
      	* ctf-create.c (ctf_add_forward): Don't add forwards to
      	types that already exist.
    • Nick Alcock's avatar
      libctf: create: non-root-visible types should not appear in name tables · fe4c2d55
      Nick Alcock authored
      We were accidentally interning newly-added and newly-opened
      non-root-visible types into name tables, and removing names from name
      tables when such types were removed.  This is very wrong: the whole
      point of non-root-visible types is they do not go in name tables and
      cannot be looked up by name.  This bug made non-root-visible types
      basically identical to root-visible types, right back to the earliest
      days of libctf in the Solaris era.
      	* ctf-open.c (init_types): Only intern root-visible types.
      	* ctf-create.c (ctf_dtd_insert): Likewise.
      	(ctf_dtd_delete): Only remove root-visible types.
      	(ctf_rollback): Likewise.
      	(ctf_add_generic): Adjust.
      	(ctf_add_struct_sized): Adjust comment.
      	(ctf_add_union_sized): Likewise.
      	(ctf_add_enum): Likewise.
      	* ctf-impl.h (ctf_dtd_insert): Adjust prototype.
    • Nick Alcock's avatar
      binutils, ld: work with --disable-libctf · 094e34f2
      Nick Alcock authored
      This unfortunately means conditionalizing out all the libctf code, but
      the result is not too unbearably ugly, if a bit repetitive.  I have
      stubbed out code in the !ENABLE_LIBCTF path to avoid extra redundant
      ifdefs where it seems that might be helpful.  (The stubs are not too
      disruptive, but I've tried to keep them on one line where possible to
      avoid filling up the screen with stubs that nobody would care about.
      If this is too much of a coding style violation I can change it.)
      Changes since v2: use GCC_ENABLE rather than repeating all the
                        AC_ARG_ENABLE stuff over and over again.
      	* configure.ac [--enable-libctf]: New, default yes.
      	Set ENABLE_LIBCTF accordingly.
      	* Makefile.am [!ENABLE_LIBCTF]: Empty LIBCTF.
      	* configure: Regenerate.
      	* config.in: Regenerate.
      	* Makefile.in: Regenerate.
      	* aclocal.m4: Regenerate.
      	* ldlang.c (ctf_output): Conditionalize on ENABLE_LIBCTF.
      	(ldlang_open_ctf): Likewise.
      	(lang_merge_ctf): Likewise.
      	(ldlang_ctf_apply_strsym): Likewise.
      	(lang_write_ctf): Likewise.
      	(ldlang_write_ctf_late): Likewise.
      	(ldlang_open_ctf) [!ENABLE_LIBCTF]: Warn about the presence of CTF
      	(lang_merge_ctf) [!ENABLE_LIBCTF]: New stub.
      	(ldlang_ctf_apply_strsym) [!ENABLE_LIBCTF]: Likewise.
      	(lang_write_ctf) [!ENABLE_LIBCTF]: Likewise.
      	(ldlang_write_ctf_late) [!ENABLE_LIBCTF]: Likewise.
      	* ldelfgen.c (ldelf_emit_ctf_early): Conditionalize on
      	(struct ctf_strsym_iter_cb_arg): Likewise.
      	(ldelf_ctf_strtab_iter_cb): Likewise.
      	(ldelf_ctf_symbols_iter_cb): Likewise.
      	(ldelf_examine_strtab_for_ctf): Likewise.
      	(ldelf_emit_ctf_early) [!ENABLE_LIBCTF]: New stub.
      	(ldelf_examine_strtab_for_ctf) [!ENABLE_LIBCTF]: New stub.
      	* configure.ac [--enable-libctf]: New, default yes.
      	Set ENABLE_LIBCTF accordingly.
      	* Makefile.am [!ENABLE_LIBCTF]: Empty LIBCTF and LIBCTF_NOBFD.
      	* configure: Regenerate.
      	* config.in: Regenerate.
      	* Makefile.in: Regenerate.
      	* aclocal.m4: Regenerate.
      	* objdump.c (usage): Conditionalize portions on ENABLE_LIBCTF.
      	(option_values): Likewise.
      	(long_options): Likewise.
      	(main): Likewise.
      	(dump_ctf_indent_lines): Conditionalize out when !ENABLE_LIBCTF.
      	(make_ctfsect): Likewise.
      	(dump_ctf_archive_member): Likewise.
      	(dump_ctf) [ENABLE_LIBCTF]: Likewise.
      	(dump_ctf) [!ENABLE_LIBCTF]: New empty stub.
      	* readelf.c (options): Conditionalize portions on ENABLE_LIBCTF.
      	(usage): Likewise.
      	(process_section_contents): Likewise.
      	(shdr_to_ctf_sect): Conditionalize out when !ENABLE_LIBCTF.
      	(dump_ctf_indent_lines): Likewise.
      	(dump_section_as_ctf) [ENABLE_LIBCTF]: Likewise.
    • Nick Alcock's avatar
      Fix --enable-libctf and --disable-static · 1776e3e5
      Nick Alcock authored
      This fixes test runs and compilation when --disable-libctf,
      --disable-static, or --enable-shared are passed.
      Changes since v2: Use GCC_ENABLE and fix indentation.  Fix prototype
      using 'void'.  Use 'unsupported' and gdb_caching_proc.
      Changes since v3: Adapt to upstream changes providing skip_ctf_tests.
      Changes since v4: Adapt to upstream changes in the seven months (!)
      since I last looked at this.
      	* configure.ac: Add --enable-libctf: handle --disable-static
      	* acinclude.m4: sinclude ../config/enable.m4.
      	* Makefile.in (aclocal_m4_deps): Adjust accordingly.
      	(LIBCTF): Substitute in.
      	(CTF_DEPS): New, likewise.
      	(CLIBS): libctf needs symbols from libbfd: move earlier.
      	(CDEPS): Use CTF_DEPS, not LIBCTF, now LIBCTF can include rpath
      	* ctfread.c: Surround in ENABLE_LIBCTF.
      	(elfctf_build_psymtabs) [!ENABLE_LIBCTF]: New stub.
      	* configure: Regenerate.
      	* config.in: Likewise.
      	* configure.ac: Add --enable-libctf.
      	* aclocal.m4: sinclude ../config/enable.m4.
      	* Makefile.in (site.exp): Add enable_libctf to site.exp.
      	* lib/gdb.exp (skip_ctf_tests): Use it.
      	* gdb.base/ctf-constvars.exp: Error message tweak.
      	* gdb.base/ctf-ptype.exp: Likewise.
      	* configure: Regenerate.
    • Jan Beulich's avatar
      x86: make I disassembler macro available for new use · d1c36125
      Jan Beulich authored
      The {Q|Q} construct on lgdt/lidt and the slightly different {Q|IQ}
      struck me as odd when encountering. Realizing they both have the same
      effect, let's free up the I macro by using the former form of construct
      where needed (there aren't that many uses overall).
      With there now being several multi-character macros also re-do "alt"
      handling slightly: Terminate it when finding the closing brace, rather
      than after the next single character. Also set the flag only when
      actually in Intel syntax mode.
    • Jan Beulich's avatar
      ld/x86: actually invoke k1om tests · 198e1db7
      Jan Beulich authored
      Unlike claimed by the ChangeLog entries added by 7a9068fe ("Add
      initial Intel K1OM support") these tests did never get enabled.
    • Jan Beulich's avatar
      x86: fix processing of -M disassembler option · 2a1bb84c
      Jan Beulich authored
      Multiple -M options can be specified in any order. Therefore stright
      assignment to fields affected needs to be avoided, such that earlier
      options' effects won't be discarded. This was in particular a problem
      for -Msuffix followed by certain of the other sub-options.
      While updating documentation, take the liberty and also drop the
      redundant mentioning of being able to comma-separate multiple options.
    • Gary Benson's avatar
      Fix -Wstring-compare testcase build failure · f53b3eeb
      Gary Benson authored
      Clang fails to compile the file gdb/testsuite/gdb.cp/try_catch.cc
      with the following error:
        warning: result of comparison against a string literal is
        unspecified (use strncmp instead) [-Wstring-compare]
      This commit fixes the error, replacing the pointer comparison with
      a call to strcmp.  This commit also adds a final check: the test
      program is run to the final return statement, and the value of
      "test" is checked to ensure it is still "true" at that point.
      	* gdb.cp/try_catch.cc: Include string.h.
      	(main): Replace comparison against string literal with
      	strcmp, avoiding build failure with -Wstring-compare.
      	Add "marker test-complete".
      	* gdb.cp/try_catch.exp: Run the test to the above marker,
      	then verify that the value of "test" is still true.
    • Eli Zaretskii's avatar
      Improve documentation of which shell is used by GDB's shell commands · edf92af0
      Eli Zaretskii authored
      2020-06-26  Eli Zaretskii  <eliz@gnu.org>
      	* gdb.texinfo (Shell Commands): More accurate description of use
      	of $SHELL.  Reported by Sandra Loosemore <sandra@codesourcery.com>.
    • Pat Bernardi's avatar
      m68k: tag floating-point ABI used · 85f7484a
      Pat Bernardi authored
      This patch adds GNU attribute support to m68k and utilises it to tag the
      floating-point calling convention used (hard-float or soft-float). It enables
      the linker to ensure linked objects use a consistent floating-point ABI and
      allows tools like GDB to infer the ABI used from the ELF file. It is based on
      similar work done for PowerPC.
      	* elf32-m68k.c (m68k_elf_merge_obj_attributes): New function.
      	(elf32_m68k_merge_private_bfd_data): Merge GNU attributes.
      	* readelf.c (display_m68k_gnu_attribute): New function.
      	(process_arch_specific): Call display_m68k_gnu_attribute for EM_68K.
      	* config/tc-m68k.c (m68k_elf_gnu_attribute): New function.
      	(md_pseudo_table): Handle "gnu_attribute".
      	* doc/as.texi: Document GNU attribute for M68K.
      	* elf/m68k.h: Add enum for GNU object attribute with floating point
      	tag name and values.
      	* testsuite/ld-m68k/attr-gnu-4-0.s: New file.
      	* testsuite/ld-m68k/attr-gnu-4-1.s: Likewise.
      	* testsuite/ld-m68k/attr-gnu-4-2.s: Likewise.
      	* testsuite/ld-m68k/attr-gnu-4-00.d: Likewise.
      	* testsuite/ld-m68k/attr-gnu-4-01.d: Likewise.
      	* testsuite/ld-m68k/attr-gnu-4-02.d: Likewise.
      	* testsuite/ld-m68k/attr-gnu-4-10.d: Likewise.
      	* testsuite/ld-m68k/attr-gnu-4-11.d: Likewise.
      	* testsuite/ld-m68k/attr-gnu-4-12.d: Likewise.
      	* testsuite/ld-m68k/attr-gnu-4-20.d: Likewise.
      	* testsuite/ld-m68k/attr-gnu-4-21.d: Likewise.
      	* testsuite/ld-m68k/attr-gnu-4-22.d: Likewise.
      	* testsuite/ld-m68k/m68k.exp: Run the new tests.
    • Alan Modra's avatar
      RISCV changes broke 32-bit --enable-targets=all · ba9b3ef5
      Alan Modra authored
      By the look of it, git commit 39ff0b81 broke 32-bit host
      --enable-targets=all binutils builds.
      /usr/local/bin/ld: ../opcodes/.libs/libopcodes.a(riscv-dis.o): in function `parse_riscv_dis_option':
      /home/alan/src/binutils-gdb/opcodes/riscv-dis.c:102: undefined reference to `riscv_get_priv_spec_class'
      collect2: error: ld returned 1 exit status
      Makefile:925: recipe for target 'objdump' failed
      The problem is that elfxx-riscv.c is not built for a 32-bit host
      without --enable-64-bit-bfd or unless RISCV is given specifically as a
      target.  No such trimming of 64-bit only targets is done in opcodes.
      One solution is to move these support functions to cpu-riscv.c, which
      runs into "error: implicit declaration of function ‘xmalloc’".  Now,
      xmalloc is not supposed to be used in libbfd or libopcodes - it's rude
      to crash out of an application that calls libbfd or libopcodes
      functions without giving it a chance to deal with out-of-memory
      itself.  So I removed the xmalloc and instead used a fixed size
      buffer.  If you are worried about adding 36 bytes for the buffer to
      the riscv_get_priv_spec_class_from_numbers stack frame size, then you
      have no idea of the likely xmalloc + malloc stack frame size!  Trying
      to reduce memory usage is commendable, but in this instance
      riscv_estimate_digit and malloc for a temp buffer uses a lot more
      memory than a fixed max-size buffer.
      	* elfxx-riscv.c (struct priv_spec_t, priv_specs),
      	(riscv_get_priv_spec_class, riscv_get_priv_spec_class_from_numbers),
      	(riscv_get_priv_spec_name): Move to..
      	* cpu-riscv.c: ..here.
      	(riscv_get_priv_spec_class_from_numbers): Don't xmalloc temp buffer.
      	Use %u to print unsigned numbers.
    • GDB Administrator's avatar
      Automatic date update in version.in · 30610e15
      GDB Administrator authored
  6. 25 Jun, 2020 4 commits
    • Simon Marchi's avatar
      gdb: use make_unique_xstrdup in set_inferior_io_terminal · 58373b80
      Simon Marchi authored
      	* infcmd.c (set_inferior_io_terminal): Use make_unique_xstrdup.
      Change-Id: I38b6e753f58947531fe4a293d574bc27ec128f47
    • Simon Marchi's avatar
      gdb: make inferior::terminal a unique ptr · 277474ee
      Simon Marchi authored
      This changes the inferior::terminal field to be a unique pointer, so its
      deallocation is automatically managed.
      	* inferior.h (struct inferior) <terminal>: Change type to
      	* inferior.c (inferior::~inferior): Don't free inf->terminal.
      	* infcmd.c (set_inferior_io_terminal): Don't free terminal
      	field, adjust to unique pointer.
      	(get_inferior_io_terminal): Adjust to unique pointer.
      Change-Id: Iedb6459b4f9eeae812b0cb9d514b5707d5107cdb
    • David Faust's avatar
      cpu: fix offset16 type, update c-calls in bpf.cpu · d73be611
      David Faust authored
      Correct the type of the offset16 field to HI, and simplify memory
      accesses which use it. Also update c-calls in semantics for a
      few instructions.
      2020-06-25 David Faust  <david.faust@oracle.com>
      	* bpf.cpu (f-offset16): Change type from INT to HI.
      	(dxli): Simplify memory access.
      	(dxsi): Likewise.
      	(define-endian-insn): Update c-call in semantics.
      	(dlabs) Likewise.
      	(dlind) Likewise.
    • Andrew Burgess's avatar
      gdb/riscv: Loop over all registers for 'info all-registers' · 6d74da72
      Andrew Burgess authored
      Currently the 'info all-registers' command only loops over those
      registers that are known to GDB.  Any registers that are unknown, that
      is, are mentioned in the target description, but are not something GDB
      otherwise knows, will not be displayed.
      This feels wrong, so this commit fixes this mistake.  The output of
      'info all-registers' now matches 'info registers all'.
      	* riscv-tdep.c (riscv_print_registers_info): Loop over all
      	registers, not just the known core set of registers.
      	* gdb.arch/riscv-tdesc-regs.exp: New test cases.