]> git.ipfire.org Git - thirdparty/binutils-gdb.git/log
thirdparty/binutils-gdb.git
4 years agoAdd no-dist to gnulib configure
Tom Tromey [Fri, 15 Nov 2019 20:48:27 +0000 (13:48 -0700)] 
Add no-dist to gnulib configure

This adds the no-dist option to the gnulib configure script.  gdb
doesn't use "make dist", so there's no need for this.  Adding this
option makes the Makefiles less verbose.

gnulib/ChangeLog
2019-11-15  Tom Tromey  <tromey@adacore.com>

* aclocal.m4, configure, Makefile.in, import/Makefile.in:
Rebuild.
* configure.ac: Remove obsolete comment.  Add no-dist.

Change-Id: I5224e18af9acd5284acb79d5756b0e84b00406e9

4 years agoMinor updates to readline configury
Tom Tromey [Fri, 15 Nov 2019 20:40:53 +0000 (13:40 -0700)] 
Minor updates to readline configury

Christian's recent patches to gnulib made me realize that readline
should be changed to use AC_CONFIG_MACRO_DIRS (ACLOCAL_AMFLAGS is
deprecated) and that it can put the automake options into
configure.ac.  I also added no-define to the automake options.  This
doesn't matter much (we don't generate a config.h here), but gnulib
does it, and it does make configure slightly smaller.

readline/ChangeLog
2019-11-15  Tom Tromey  <tromey@adacore.com>

* configure, Makefile.in: Rebuild.
* configure.ac: Use AC_CONFIG_MACRO_DIRS.  Pass options to
AM_INIT_AUTOMAKE.
* Makefile.am (AUTOMAKE_OPTIONS, ACLOCAL_AMFLAGS): Remove.

Change-Id: If421599cc9dd9c4c3c37b9b439ab2c22c01742ed

4 years agoUse ctime_r and localtime_r for threadsafety
Christian Biesinger [Thu, 31 Oct 2019 21:02:41 +0000 (16:02 -0500)] 
Use ctime_r and localtime_r for threadsafety

To make these calls threadsafe. localtime_r is provided by gnulib if
necessary, and for ctime_r we can just use it because it is in a linux-
specific file.

gdb/ChangeLog:

2019-11-15  Christian Biesinger  <cbiesinger@google.com>

* maint.c (scoped_command_stats::print_time): Use localtime_r
instead of localtime (provided through gnulib if necessary).
* nat/linux-osdata.c (time_from_time_t): Use ctime_r instead
of ctime.

Change-Id: I329bbdc39d5b576f51859ba00f1617e024c30cbd

4 years agoImport the time_r gnulib module
Christian Biesinger [Fri, 8 Nov 2019 17:25:17 +0000 (11:25 -0600)] 
Import the time_r gnulib module

This allows GDB to use localtime_r unconditionally.

See https://lists.gnu.org/archive/html/bug-gnulib/2019-11/msg00022.html
for details on the compile error mentioned below.

gdb/ChangeLog:

2019-11-15  Christian Biesinger  <cbiesinger@google.com>

* gdbsupport/common-defs.h: Include time.h before pathmax.h to
avoid compile errors.

gnulib/ChangeLog:

2019-11-15  Christian Biesinger  <cbiesinger@google.com>

* Makefile.in: Regenerate.
* aclocal.m4: Regenerate.
* config.in: Regenerate.
* configure: Regenerate.
* import/Makefile.am: Update.
* import/Makefile.in: Regenerate.
* import/m4/gnulib-cache.m4: Update.
* import/m4/gnulib-comp.m4: Update.
* import/m4/time_r.m4: New file.
* import/time_r.c: New file.
* update-gnulib.sh: Import time_r.

Change-Id: I53fc861b192940d613ca97f2910b4533c730f667

4 years agoImport the strerror_r-posix module and use it in GDB.
Christian Biesinger [Wed, 6 Nov 2019 18:49:52 +0000 (12:49 -0600)] 
Import the strerror_r-posix module and use it in GDB.

Makes sure to assign the return value of strerror_r to an int,
so that we get a compile error if we accidentally get the
wrong version.

gdb/ChangeLog:

2019-11-15  Christian Biesinger  <cbiesinger@google.com>

* config.in: Regenerate.
* configure: Regenerate.
* gdbsupport/common.m4: No longer check for strerror_r.
* gdbsupport/posix-strerror.c (safe_strerror): Always call the
POSIX version of strerror_r, now that gnulib provides it if
necessary.

gdb/gdbserver/ChangeLog:

2019-11-15  Christian Biesinger  <cbiesinger@google.com>

* config.in: Regenerate.
* configure: Regenerate.

gnulib/ChangeLog:

2019-11-15  Christian Biesinger  <cbiesinger@google.com>

* Makefile.in: Regenerate.
* aclocal.m4: Regenerate.
* config.in: Regenerate.
* configure: Regenerate.
* import/Makefile.am: Update.
* import/Makefile.in: Regenerate.
* import/extra/config.rpath: New file.
* import/glthread/lock.c: New file.
* import/glthread/lock.h: New file.
* import/glthread/threadlib.c: New file.
* import/m4/gnulib-cache.m4: Update.
* import/m4/gnulib-comp.m4: Update.
* import/m4/lib-ld.m4: New file.
* import/m4/lib-link.m4: New file.
* import/m4/lib-prefix.m4: New file.
* import/m4/lock.m4: New file.
* import/m4/strerror_r.m4: New file.
* import/m4/threadlib.m4: New file.
* import/strerror_r.c: New file.
* update-gnulib.sh: Import strerror_r-posix.

Change-Id: I5cfeb12a5203a4cd94a78581541e6085a68685c3

4 years agoGenerate gnulib's toplevel Makefile.in using automake
Christian Biesinger [Fri, 15 Nov 2019 00:17:59 +0000 (16:17 -0800)] 
Generate gnulib's toplevel Makefile.in using automake

This is a lot simpler and as a side-effect this will correctly
regenerate import/Makefile and config.h during rebuilds if
necessary.

gnulib/ChangeLog:

2019-11-15  Christian Biesinger  <cbiesinger@google.com>

* Makefile.am: New file.
* Makefile.in: Replace with generated file.
* aclocal-m4-deps.mk: Remove.
* configure.ac: Use the foreign option for automake and specify
the aclocal search path here.
* update-gnulib.sh: Don't generate aclocal-m4-deps.mk anymore.
Also don't specify the aclocal include path here, now that it
is in configure.ac.

Change-Id: I6a2c4d41cf4f0e21d5c813197bad63ed5c08e408

4 years agoRevert previous delta.
Nick Clifton [Fri, 15 Nov 2019 11:52:50 +0000 (11:52 +0000)] 
Revert previous delta.

PR 2587
* Makefile.am: Revert change from 2019-11-13.
* Makefile.in: Regenerate.

4 years agoUpdate README
Christian Biesinger [Mon, 11 Nov 2019 18:39:31 +0000 (10:39 -0800)] 
Update README

Adds descriptions for some recent-ish configure options to README.

Also updates the minimum Python version per commit
6c28e44a359e9f6cf455ddff0009ca99406f7224.

2019-11-14  Christian Biesinger  <cbiesinger@google.com>

* README (`configure' options): Update.

Change-Id: I8ce8ca6935afbd130295e143802c585cf1e735f9

4 years agoAutomatic date update in version.in
GDB Administrator [Fri, 15 Nov 2019 00:00:24 +0000 (00:00 +0000)] 
Automatic date update in version.in

4 years agoAllow re-assigning to convenience variables
Tom Tromey [Tue, 5 Nov 2019 17:12:27 +0000 (10:12 -0700)] 
Allow re-assigning to convenience variables

A customer reported somewhat odd gdb behavior, where re-assigning an
array or string to a convenience variable would yield "Too many array
elements".  A test case is:

    (gdb) p $x = "x"
    (gdb) p $x = "xyz"

This patch fixes the problem by making a special case in the evaluator
for assignment to convenience variables, which seems like the correct
behavior.

Note that a previous patch implemented this for Ada, see commit
f411722cb ("Allow re-assigning to convenience variables").

gdb/ChangeLog
2019-11-14  Tom Tromey  <tromey@adacore.com>

* eval.c (evaluate_subexp_standard) <BINOP_ASSIGN>: Do not pass an
expected type for the RHS if the LHS is a convenience variable.

gdb/testsuite/ChangeLog
2019-11-14  Tom Tromey  <tromey@adacore.com>

* gdb.base/gdbvars.exp (test_convenience_variables): Add
regression tests.

Change-Id: I5e66a2d243931a5c43c7af4bc9f6717464c2477e

4 years ago[gdb/doc] Fix typos
Tom de Vries [Thu, 14 Nov 2019 13:43:11 +0000 (14:43 +0100)] 
[gdb/doc] Fix typos

Fix typos in gdb docs.

gdb/doc/ChangeLog:

2019-11-14  Tom de Vries  <tdevries@suse.de>

* gdb.texinfo: Fix typos.
* python.texi: Same.
* stabs.texinfo: Same.

Change-Id: I044d6788eeea48e4a9b73ee752e5aaf333e56a46

4 years agoAnother attempt at fixing building gprof with gmake.
Nick Clifton [Thu, 14 Nov 2019 12:11:43 +0000 (12:11 +0000)] 
Another attempt at fixing building gprof with gmake.

PR 2587
* Makefile.am (SUFFIXES): Add .c.
* Makefile.in: Regenerate.

4 years agogdb: fix build error in unittests/vec-utils-selftests.c
Simon Marchi [Thu, 14 Nov 2019 11:50:20 +0000 (06:50 -0500)] 
gdb: fix build error in unittests/vec-utils-selftests.c

When building with gcc 9.2.0, I get the following build error:

    In file included from /home/simark/src/binutils-gdb/gdb/unittests/vec-utils-selftests.c:23:
    /home/simark/src/binutils-gdb/gdb/gdbsupport/gdb_vecs.h: In instantiation of ‘T unordered_remove(std::__debug::vector<T>&, typename std::__debug::vector<T>::iterator) [with T = selftests::vector_utils_tests::unordered_remove_tests()::obj; typename std::__debug::vector<T>::iterator = __gnu_debug::_Safe_iterator<__gnu_cxx::__normal_iterator<selftests::vector_utils_tests::unordered_remove_tests()::obj*, std::__cxx1998::vector<selftests::vector_utils_tests::unordered_remove_tests()::obj, std::allocator<selftests::vector_utils_tests::unordered_remove_tests()::obj> > >, std::__debug::vector<selftests::vector_utils_tests::unordered_remove_tests()::obj>, std::random_access_iterator_tag>]’:
    /home/simark/src/binutils-gdb/gdb/unittests/vec-utils-selftests.c:53:26:   required from here
    /home/simark/src/binutils-gdb/gdb/gdbsupport/gdb_vecs.h:53:5: error: implicitly-declared ‘selftests::vector_utils_tests::unordered_remove_tests()::obj::obj(const selftests::vector_utils_tests::unordered_remove_tests()::obj&)’ is deprecated [-Werror=deprecated-copy]
       53 |   T removed = std::move (*it);
          |     ^~~~~~~
    /home/simark/src/binutils-gdb/gdb/unittests/vec-utils-selftests.c:41:10: note: because ‘selftests::vector_utils_tests::unordered_remove_tests()::obj’ has user-provided ‘selftests::vector_utils_tests::unordered_remove_tests()::obj& selftests::vector_utils_tests::unordered_remove_tests()::obj::operator=(const selftests::vector_utils_tests::unordered_remove_tests()::obj&)’
       41 |     obj &operator= (const obj &other)
          |          ^~~~~~~~
    In file included from /home/simark/src/binutils-gdb/gdb/unittests/vec-utils-selftests.c:23:
    /home/simark/src/binutils-gdb/gdb/gdbsupport/gdb_vecs.h:58:10: error: implicitly-declared ‘selftests::vector_utils_tests::unordered_remove_tests()::obj::obj(const selftests::vector_utils_tests::unordered_remove_tests()::obj&)’ is deprecated [-Werror=deprecated-copy]
       58 |   return removed;
          |          ^~~~~~~
    /home/simark/src/binutils-gdb/gdb/unittests/vec-utils-selftests.c:41:10: note: because ‘selftests::vector_utils_tests::unordered_remove_tests()::obj’ has user-provided ‘selftests::vector_utils_tests::unordered_remove_tests()::obj& selftests::vector_utils_tests::unordered_remove_tests()::obj::operator=(const selftests::vector_utils_tests::unordered_remove_tests()::obj&)’
       41 |     obj &operator= (const obj &other)
          |          ^~~~~~~~

I think gcc is just trying to be nice and recommends the good practice
of providing a copy constructor if an assignment operator is provided.

Silence the warning by providing that copy constructor.

gdb/ChangeLog:

* unittests/vec-utils-selftests.c (unordered_remove_tests::obj):
Provide explicit default and copy constructor.

Change-Id: I323361b1c120bf8525613b74e7e5983910e002df

4 years agox86: drop redundant SYSCALL/SYSRET templates
Jan Beulich [Thu, 14 Nov 2019 07:48:22 +0000 (08:48 +0100)] 
x86: drop redundant SYSCALL/SYSRET templates

The Cpu64 forms are no different in their attributes except for the CPU
flags; there's no need to key these off of anything other than
CpuSYSCALL even for the 64-bit forms. Dropping these improves the
diagnostic on SYSRETQ used in 32-bit code from "unsupported instruction
`sysret'" to "invalid instruction suffix for `sysret'".

4 years agox86: fold individual Jump* attributes into a single Jump one
Jan Beulich [Thu, 14 Nov 2019 07:47:44 +0000 (08:47 +0100)] 
x86: fold individual Jump* attributes into a single Jump one

..., taking just 3 bits instead of 5. No two of them are used together.

4 years agox86: make JumpAbsolute an insn attribute
Jan Beulich [Thu, 14 Nov 2019 07:47:03 +0000 (08:47 +0100)] 
x86: make JumpAbsolute an insn attribute

... instead of an operand one: There's only ever one operand here
anyway.

4 years agox86: make AnySize an insn attribute
Jan Beulich [Thu, 14 Nov 2019 07:46:19 +0000 (08:46 +0100)] 
x86: make AnySize an insn attribute

... instead of an operand one. Which operand it applies to can be
determined from other operand properties, but as it turns out the only
place it is actually used at doesn't even need further qualification.

4 years agox86/Intel: correct CMPSD test cases' regexp closing paren placement
Jan Beulich [Thu, 14 Nov 2019 07:45:26 +0000 (08:45 +0100)] 
x86/Intel: correct CMPSD test cases' regexp closing paren placement

The CMPS test case derivation from their MOVS counterparts I did in
d241b91073 ("x86/Intel: correct MOVSD and CMPSD handling") ended up
with misplaced closing parentheses in som regexps. Correct this.

4 years agox86/Intel: extend MOVSD/CMPSD testsuite coverage
Jan Beulich [Thu, 14 Nov 2019 07:44:57 +0000 (08:44 +0100)] 
x86/Intel: extend MOVSD/CMPSD testsuite coverage

This is still in the context of PR/gas 25167.

4 years agoFix python gdbpy_breakpoint_object leak.
Philippe Waroquiers [Tue, 12 Nov 2019 19:33:29 +0000 (20:33 +0100)] 
Fix python gdbpy_breakpoint_object leak.

valgrind reports a leak when a breakpoint is created then deleted:

==1313== 40 bytes in 1 blocks are definitely lost in loss record 1,115 of 8,596
==1313==    at 0x4835753: malloc (vg_replace_malloc.c:307)
==1313==    by 0x6E05BC: _PyObject_New (object.c:255)
==1313==    by 0x470E4B: gdbpy_breakpoint_created(breakpoint*) (py-breakpoint.c:1023)
==1313==    by 0x2946D9: operator() (std_function.h:687)
==1313==    by 0x2946D9: notify (observable.h:106)
==1313==    by 0x2946D9: install_breakpoint(int, std::unique_ptr<breakpoint, std::default_delete<breakpoint> >&&, int) (breakpoint.c:8136)
==1313==    by 0x295BCA: create_breakpoint_sal (breakpoint.c:8878)
==1313==    by 0x295BCA: create_breakpoints_sal (breakpoint.c:8919)
==1313==    by 0x295BCA: create_breakpoints_sal_default (breakpoint.c:13671)
...

The leak is due to a superfluous Py_INCREF when the python object
is allocated inside gdbpy_breakpoint_created, when the python object
is allocated locally: this object has already a refcount of 1, and
the only reference is the reference from the C breakpoint object.
The Py_INCREF is however needed when the python object was created from
python: the python object was stored in bppy_pending_object, and
gdbpy_breakpoint_created creates a new reference to this object.

Solve the leak by calling 'Py_INCREF (newbp);' only in the bppy_pending_object
case.

Regression tested on debian/amd64 natively and under valgrind on centos/amd64.
Before the patch, 795 tests have a definite leak.
After the patch, 197 have a definite leak.

Thanks to Tom, that helped on irc with the python refcount logic.

gdb/ChangeLog
2019-11-14  Philippe Waroquiers  <philippe.waroquiers@skynet.be>

* python/py-finishbreakpoint.c (gdbpy_breakpoint_created):
only call Py_INCREF (newbp) in the bppy_pending_object case.

4 years agoAutomatic date update in version.in
GDB Administrator [Thu, 14 Nov 2019 00:00:21 +0000 (00:00 +0000)] 
Automatic date update in version.in

4 years agoRemove symbol-related static asserts
Tom Tromey [Mon, 11 Nov 2019 14:43:13 +0000 (07:43 -0700)] 
Remove symbol-related static asserts

commit 3573abe1d added static asserts to ensure that symbol sizes
don't vary.  However, this failed to build on Windows, on at least one
ARM platform (see PR build/25182) and internally at AdaCore for PPC.

So, I think it is probably best to just remove these assertions,
effectively reverting 3573abe1d.

gdb/ChangeLog
2019-11-13  Tom Tromey  <tromey@adacore.com>

PR build/25182:
* psympriv.h (partial_symbol): Remove static assert.
* symtab.h (general_symbol_info, symbol): Remove static assert.

Change-Id: I51940fb2240c474838b48494b5072081701789bb

4 years agoFix the rule for building C files in the gprof makefile.
Nick Clifton [Wed, 13 Nov 2019 11:21:39 +0000 (11:21 +0000)] 
Fix the rule for building C files in the gprof makefile.

PR 2587
* Makefile.am: Fix rule to build .c files from .m files.

4 years agognulib: Fix path to import/Makefile{,.in}
Christian Biesinger [Wed, 13 Nov 2019 02:11:37 +0000 (20:11 -0600)] 
gnulib: Fix path to import/Makefile{,.in}

I don't know why this path is what it is but it is clearly wrong.

gnulib/ChangeLog:

2019-11-12  Christian Biesinger  <cbiesinger@google.com>

* Makefile.in: Fix path to say import/ instead of gnulib/.

Change-Id: Ib7f6a319ee764d20072e38911766ca7032d6ca8e

4 years agoRISC-V: Support the INSN_CLASS.*F.* classes for .insn directive.
Jim Wilson [Wed, 13 Nov 2019 00:13:00 +0000 (16:13 -0800)] 
RISC-V: Support the INSN_CLASS.*F.* classes for .insn directive.

We have to enable the f extension through -march or ELF attribute if we use the
FPR in .insn directive.  The behavior is same as the riscv_opcodes.

2019-11-12  Nelson Chu  <nelson.chu@sifive.com>
opcodes/
* riscv-opc.c (riscv_insn_types): Replace the INSN_CLASS_I with
INSN_CLASS_F and the INSN_CLASS_C with INSN_CLASS_F_AND_C if we
use the floating point register (FPR).

gas/
* testsuite/gas/riscv/insn.d: Add the f extension to -march option.

Change-Id: I4f59d04c82673ef84c56ecd2659ad8ce164dd626

4 years agoAutomatic date update in version.in
GDB Administrator [Wed, 13 Nov 2019 00:00:20 +0000 (00:00 +0000)] 
Automatic date update in version.in

4 years agoRISC-V: Fix ld relax failure with calls and align directives.
Jim Wilson [Tue, 12 Nov 2019 23:50:48 +0000 (15:50 -0800)] 
RISC-V: Fix ld relax failure with calls and align directives.

Make _bfd_riscv_relax_call handle section alignment padding same as
the _bfd_riscv_relax_lui and _bfd_riscv_relax_pc functions already
do.  Use the max section alignment if section boundaries are crossed,
otherwise the alignment of the containing section.

bfd/
PR 25181
* elfnn-riscv.c (_bfd_riscv_relax_call): Always add max_alignment to
foff.  If sym_sec->output_section and sec->output_section are the same
and not *ABS* then set max_alignment to that section's alignment.

ld/
PR 25181
* testsuite/ld-riscv-elf/call-relax-0.s: New file.
* testsuite/ld-riscv-elf/call-relax-1.s: New file.
* testsuite/ld-riscv-elf/call-relax-2.s: New file.
* testsuite/ld-riscv-elf/call-relax-3.s: New file.
* testsuite/ld-riscv-elf/call-relax.d: New test.
* testsuite/ld-riscv-elf/ld-riscv-elf.exp: Run call-relax test.

Change-Id: Iaf65cee52345abf1955f36e8e72c4f6cc0db8d9a

4 years agogdb: Support printf 'z' size modifier
Andrew Burgess [Tue, 5 Nov 2019 14:24:17 +0000 (14:24 +0000)] 
gdb: Support printf 'z' size modifier

The gdb format mechanism doesn't currently support the 'z' size
modifier, there are a few places in GDB where this is used.  Instead
of removing these uses lets just add support to GDB for using 'z'.

I found this issue when trying to use some of the debug output.
Before this commit:

  (gdb) set debug dwarf-line 9
  (gdb) file test
  Reading symbols from test...
  Unrecognized format specifier 'z' in printf
  (No debugging symbols found in test)
  (gdb)

After this commit:

  (gdb) set debug dwarf-line 9
  (gdb) file test
  Reading symbols from test...
  Adding dir 1: /usr/include
  Adding file 1: test.c
  Adding file 2: stdc-predef.h
  Processing actual line 3: file 1, address 0x4004a0, is_stmt 1, discrim 0
  Processing actual line 4: file 1, address 0x4004a0, is_stmt 1, discrim 0
  .... lots of debug output ...
  Processing actual line 10: file 1, address 0x4003b7, is_stmt 0, discrim 0
  (gdb)

I've added a self test to cover the integer format size modifiers,
including the 'z' modifier.

gdb/ChangeLog:

* gdbsupport/format.c (format_pieces::format_pieces): Support
printf 'z' size modifier.
* gdbsupport/format.h (enum argclass): Add size_t_arg.
* printcmd.c (ui_printf):  Handle size_t_arg.
* ui-out.c (ui_out::vmessage): Likewise.
* unittests/format_pieces-selftests.c (test_format_int_sizes): New
function.
(run_tests): Call test_format_int_sizes.

gdb/gdbserver/ChangeLog:

* ax.c (ax_printf): Handle size_t_arg.

Change-Id: Ib6c44d88aa5bce265d757e4c0698881803dd186f

4 years agoMake struct symbol inherit from general_symbol_info
Christian Biesinger [Mon, 4 Nov 2019 19:12:09 +0000 (13:12 -0600)] 
Make struct symbol inherit from general_symbol_info

Since this is now no longer a POD, also give it a constructor that
initializes all fields. (I have considered overloading operator new
to zero-initialize the memory instead; let me know if you prefer that)

gdb/ChangeLog:

2019-11-12  Christian Biesinger  <cbiesinger@google.com>

* ada-exp.y (write_ambiguous_var): Update.
* buildsym.c (add_symbol_to_list): Update.
* dwarf2read.c (read_variable): Update.
(new_symbol): Update.
* jit.c (finalize_symtab): Update.
* language.c (language_alloc_type_symbol): Update.
* symtab.c (fixup_symbol_section): Update.
(initialize_objfile_symbol_1): Move code to...
(initialize_objfile_symbol): ...here. Remove now-unnecessary memset.
(allocate_symbol): Update.
(allocate_template_symbol): Update.
(get_symbol_address): Update.
* symtab.h (struct symbol): Inherit from general_symbol_info instead
of having as a field, and add a constructor.
(SYMBOL_VALUE): Update.
(SYMBOL_VALUE_ADDRESS): Update.
(SET_SYMBOL_VALUE_ADDRESS): Update.
(SYMBOL_VALUE_BYTES): Update.
(SYMBOL_VALUE_COMMON_BLOCK): Update.
(SYMBOL_BLOCK_VALUE): Update.
(SYMBOL_VALUE_CHAIN): Update.
(SYMBOL_LANGUAGE): Update.
(SYMBOL_SECTION): Update.
(SYMBOL_OBJ_SECTION): Update.
(SYMBOL_SET_LANGUAGE): Update.
(SYMBOL_SET_LINKAGE_NAME): Update.
(SYMBOL_SET_NAMES): Update.
(SYMBOL_NATURAL_NAME): Update.
(SYMBOL_LINKAGE_NAME): Update.
(SYMBOL_DEMANGLED_NAME): Update.
(SYMBOL_SEARCH_NAME): Update.
(SYMBOL_MATCHES_SEARCH_NAME): Update.
(struct symbol): Update.
(struct template_symbol): Update.
(struct rust_vtable_symbol): Update.
* xcoffread.c (SYMBOL_DUP): Update.

Change-Id: I05b1628455bcce3efaa101e65ef051708d17eb07

4 years agoConsolidate setting of current_layout
Tom Tromey [Wed, 9 Oct 2019 02:06:09 +0000 (20:06 -0600)] 
Consolidate setting of current_layout

Currently several functions in tui-layout.c set current_layout after
their work is done.  This moves this assignment to show_layout,
instead.

gdb/ChangeLog
2019-11-12  Tom Tromey  <tom@tromey.com>

* tui/tui-layout.c (show_layout): Set current_layout.
(show_source_disasm_command, show_data)
(show_source_or_disasm_and_command): Don't set current_layout.

Change-Id: Id8b23797d68e607f0fcd6d29b8801869d40d1869

4 years agoMove _initialize_tui_layout to end of file
Tom Tromey [Tue, 8 Oct 2019 21:44:18 +0000 (15:44 -0600)] 
Move _initialize_tui_layout to end of file

This moves _initialize_tui_layout to the end of the file, conforming
to the typical gdb style.

gdb/ChangeLog
2019-11-12  Tom Tromey  <tom@tromey.com>

* tui/tui-layout.c (_initialize_tui_layout): Move to end.

Change-Id: I667f741b44b2bc470878a36f093a96d89fa31893

4 years agoMake TUI resizing tests more robust
Tom Tromey [Fri, 16 Aug 2019 21:16:12 +0000 (15:16 -0600)] 
Make TUI resizing tests more robust

As Sergio pointed out, the TUI resizing tests are flaky.  Debugging
this showed three main problems.

1. expect's "stty" command processes its arguments one-by-one.  So,
rather than requesting a single resize, it sends two separate resize
requests (one for rows and one for columns).  This means gdb sees two
SIGWINCH signals and resizes the terminal twice.

I consider this a bug in expect, but I couldn't readily see how to
report a bug; and anyway the fix wouldn't propagate very quickly.

This patch works around this problem by explicitly doing two separate
resizes (so it will be robust if expect ever does change); and then by
waiting for each resize to complete before continuing.

2. gdb uses curses to drive the console rendering.  Currently the test
suite looks for terminal text insertion sequences to decide when a
command has completed.  However, it turns out that, sometimes, curses
can output things in non-obvious ways.  I didn't debug into curses but
I guess this can happen due to output optimizations.  No matter the
reason, sometimes the current approach of only tracking text
insertions is not enough to detect that gdb has finished rendering.

This patch fixes this problem by arranging to detect the termination
output after any curses command, not just insertion.

3. Detecting when a resize has completed is tricky.  In fact, I could
not find a way to reliably do this.

This patch fixes this problem by adding a special maint
"tui-resize-message" setting to gdb.  When this is enabled, gdb will
print a message after each SIGWINCH has been fully processed.  The
test suite enables this mode and then waits for the message in order
to know when control can be returned to the calling test.

This patch also adds a timeout, to avoid the situation where the
terminal code fails to notice a change for some reason.  This lets the
test at least try to continue.

gdb/ChangeLog
2019-11-12  Tom Tromey  <tom@tromey.com>

* tui/tui-win.c (resize_message): New global.
(show_tui_resize_message): New function.
(tui_async_resize_screen): Print message if requested.
(_initialize_tui_win): Add tui-resize-message setting.
* NEWS: Add entry for new commands.

gdb/doc/ChangeLog
2019-11-12  Tom Tromey  <tom@tromey.com>

* gdb.texinfo (Maintenance Commands): Document new command.

gdb/testsuite/ChangeLog
2019-11-12  Tom Tromey  <tom@tromey.com>

* lib/tuiterm.exp (_accept): Add wait_for parameter.  Check output
after any command.  Expect prompt after WAIT_FOR is seen.
(enter_tui): Enable resize messages.
(command): Expect command in output.
(get_line): Avoid error when cursor appears to be off-screen.
(dump_screen): Include screen size in title.
(_do_resize): New proc, from "resize".
(resize): Rewrite.  Do resize in two steps.
* gdb.tui/empty.exp (layouts): Fix entries.
(check_boxes): Remove xfail.
(check_text): Dump screen on failure.

Change-Id: I420e0259cb99b21adcd28f671b99161eefa7a51d

4 years ago[gas][arm] Enable VLDM, VSTM, VPUSH, VPOP for MVE
Mihail Ionescu [Tue, 12 Nov 2019 13:57:20 +0000 (13:57 +0000)] 
[gas][arm] Enable VLDM, VSTM, VPUSH, VPOP for MVE

This patch enables a few instructions for Armv8.1-M MVE. Currently VLDM,
VSTM, VSTR, VLDR, VPUSH and VPOP are enabled only when the Armv8-M
Floating-point Extension is enabled.  According to the ARMv8.1-M ARM,
section A.1.4.2[1], they can be enabled by having "Armv8-M Floating-point
Extension and/or Armv8.1-M MVE".

[1]https://developer.arm.com/docs/ddi0553/bh/armv81-m-architecture-reference-manual

2019-11-12  Mihail Ionescu  <mihail.ionescu@arm.com>

* config/tc-arm.c (do_vfp_nsyn_push): Move in order to enable it for
both fpu_vfp_ext_v1xd and mve_ext and add call to the aliased vstm
instruction for mve_ext.
(do_vfp_nsyn_pop): Move in order to enable it for both
fpu_vfp_ext_v1xd and mve_ext and add call to the aliased vldm
instruction for mve_ext.
(do_neon_ldm_stm): Add fpu_vfp_ext_v1 and mve_ext checks.
(insns): Enable vldm, vldmia, vldmdb, vstm, vstmia, vstmdb, vpop,
vpush, and fldd, fstd, flds, fsts for arm_ext_v6t2 instead
of fpu_vfp_ext_v1xd.
* testsuite/gas/arm/v8_1m-mve.s: New.
* testsuite/gas/arm/v8_1m-mve.d: New.

4 years ago[binutils][arm] Update the decoding of MVE VMOV, VMVN
Mihail Ionescu [Tue, 12 Nov 2019 13:55:37 +0000 (13:55 +0000)] 
[binutils][arm] Update the decoding of MVE VMOV, VMVN

This patch updates the decoding of the VMOV and VMVN instructions which depend on cmode.
Previously VMOV and VMVN with cmode 1101 were not allowed.
The cmode changes also required updating of the MVE conflict checking.
Now instructions with opcodes 0xef800d50 and 0xef800e70 correctly get decoded as VMOV
and VMVN, respectively.

2019-11-12  Mihail Ionescu  <mihail.ionescu@arm.com>

* opcodes/arm-dis.c (mve_opcodes): Enable VMOV imm to vec with
cmode 1101.
(is_mve_encoding_conflict): Update cmode conflict checks for
MVE_VMVN_IMM.

2019-11-12  Mihail Ionescu  <mihail.ionescu@arm.com>

* gas/config/tc-arm.c (do_neon_mvn): Allow mve_ext cmode=0xd.
* testsuite/gas/arm/mve-vmov-vmvn-vorr-vbic.s: New test.
* testsuite/gas/arm/mve-vmov-vmvn-vorr-vbic.d: Likewise.

4 years ago[gas][arm] Make .fpu reset the FPU/Coprocessor feature bits
Mihail Ionescu [Tue, 12 Nov 2019 13:53:06 +0000 (13:53 +0000)] 
[gas][arm] Make .fpu reset the FPU/Coprocessor feature bits

This patch is fixes the '.fpu' behaviour.
Currently, using '.fpu' resets the previously selected '.fpu' options (by overwriting them),
but does not reset previous FPU options selected by other means (ie. when using
'.arch_extension fp' in conjunction with '.fpu <x>', the FPU is not reset).

Example:
.arch armv8-a         @ SET BASE
.arch_extension fp    @ ADD FP-ARMV8
.fpu vfpv2            @ ADD (already existing bits, does not reset)
vfms.f32 s0, s1, s2   @ OK

.arch armv8-a         @ RESET
.fpu fp-armv8         @ ADD FP-ARMV8
vfms.f32 s0, s1, s2   @ OK
.fpu vfpv2            @ RESET to VFPV2
vfms.f32 s0, s1, s2   @ ERROR

After the patch this becomes:
.arch armv8-a         @ SET BASE
.arch_extension fp    @ ADD FP-ARMV8
.fpu vfpv2            @ RESET TO VFPV2
vfms.f32 s0, s1, s2   @ ERROR

.arch armv8-a         @ RESET
.fpu fp-armv8         @ ADD FP-ARMV8
vfms.f32 s0, s1, s2   @ OK
.fpu vfpv2            @ RESET to VFPV2
vfms.f32 s0, s1, s2   @ ERROR

gas/ChangeLog:

2019-11-11  Mihail Ionescu  <mihail.ionescu@arm.com>

        * config/tc-arm.c (s_arm_fpu): Clear selected_cpu fpu bits.
        (fpu_any): Remove OBJ_ELF guards.
        * gas/testsuite/gas/arm/fpu-rst.s: New.
        * gas/testsuite/gas/arm/fpu-rst.d: New.
        * gas/testsuite/gas/arm/fpu-rst.l: New.

4 years agox86: fold EsSeg into IsString
Jan Beulich [Tue, 12 Nov 2019 08:09:31 +0000 (09:09 +0100)] 
x86: fold EsSeg into IsString

EsSeg (a per-operand bit) is used with IsString (a per-insn attribute)
only. Extend the attribute to 2 bits, thus allowing to encode
- not a string insn,
- string insn with neither operand requiring use of %es:,
- string insn with 1st operand requiring use of %es:,
- string insn with 2nd operand requiring use of %es:,
which covers all possible cases, allowing to drop EsSeg.

The (transient) need to comment out the OTUnused #define did uncover an
oversight in the earlier OTMax -> OTNum conversion, which is being taken
care of here.

4 years agox86: eliminate ImmExt abuse
Jan Beulich [Tue, 12 Nov 2019 08:08:32 +0000 (09:08 +0100)] 
x86: eliminate ImmExt abuse

Drop the remaining instances left in place by commit c3949f432f ("x86:
limit ImmExt abuse), now that we have a way to specify specific GPRs.

Take the opportunity and also introduce proper 16-bit forms of
applicable SVME insns as well as 1-operand forms of CLZERO.

4 years agox86: introduce operand type "instance"
Jan Beulich [Tue, 12 Nov 2019 08:07:34 +0000 (09:07 +0100)] 
x86: introduce operand type "instance"

Special register "class" instances can't be combined with one another
(neither in templates nor in register entries), and hence it is not a
good use of resources (memory as well as execution time) to represent
them as individual bits of a bit field.

Furthermore the generalization becoming possible will allow
improvements to the handling of insns accepting only individual
registers as their operands.

4 years agoAutomatic date update in version.in
GDB Administrator [Tue, 12 Nov 2019 00:00:28 +0000 (00:00 +0000)] 
Automatic date update in version.in

4 years agoDocument and extend readline-bindable functions
Tom Tromey [Sat, 9 Nov 2019 18:54:39 +0000 (11:54 -0700)] 
Document and extend readline-bindable functions

This adds readline-bindable function names to a few gdb functions that
already had key bindings.  This lets users change the bindings.

This also removes the gdb-command function.  Due to how this function
is implemented, it doesn't make sense to allow binding it.

Finally, this updates the documentation to reflect these changes.

gdb/ChangeLog
2019-11-11  Tom Tromey  <tom@tromey.com>

* tui/tui.c (tui_initialize_readline): Add new bindable readline
functions.

gdb/doc/ChangeLog
2019-11-11  Tom Tromey  <tom@tromey.com>

* gdb.texinfo (TUI Keys): Document readline function names.

Change-Id: I2233779b7aefe372f19bd03c8f325733c3385e72

4 years agoDocument operate-and-get-next
Tom Tromey [Sat, 9 Nov 2019 18:38:05 +0000 (11:38 -0700)] 
Document operate-and-get-next

This adds some documentation for the operate-and-get-next readline
function that gdb supplies.  The text is largely taken from the Bash
manual.

gdb/doc/ChangeLog
2019-11-11  Tom Tromey  <tom@tromey.com>

* gdb.texinfo (Editing): Document operate-and-get-next.

Change-Id: I9adb16d9ce84bfbda5fe8a2828f668ea878c080c

4 years agoUse getpwuid_r instead of getpwuid
Christian Biesinger [Sat, 2 Nov 2019 18:16:09 +0000 (13:16 -0500)] 
Use getpwuid_r instead of getpwuid

gdb/ChangeLog:

2019-11-11  Christian Biesinger  <cbiesinger@google.com>

* nat/linux-osdata.c (user_from_uid): Use getpwuid_r.

Change-Id: I587359267f8963ef1da6ba0223a1525807a721de

4 years agoFix typo in vFile:pwrite documentation
Tom Tromey [Mon, 11 Nov 2019 19:45:35 +0000 (12:45 -0700)] 
Fix typo in vFile:pwrite documentation

A user on irc noticed that the remote protocol documentation mentioned
"vFile:write" -- but this is a typo, there is only "vFile:pwrite".
This patch fixes the bug.  Tested by rebuilding, committing as
obvious.

gdb/doc/ChangeLog
2019-11-11  Tom Tromey  <tromey@adacore.com>

* gdb.texinfo (Host I/O Packets): Fix typo in "vFile:pwrite".

Change-Id: I2f668a691eed7883ba6bc092471739f44c82301b

4 years agoArm64: SVE2's smaxp/sminp require operands 1 and 3 to be the same register
Jan Beulich [Mon, 11 Nov 2019 12:28:35 +0000 (13:28 +0100)] 
Arm64: SVE2's smaxp/sminp require operands 1 and 3 to be the same register

This is just like for their umaxp/uminp and fmaxp/fminp counterparts.

4 years agoArm64: fix build with old glibc
Jan Beulich [Mon, 11 Nov 2019 12:27:47 +0000 (13:27 +0100)] 
Arm64: fix build with old glibc

Some old glibc versions have string.h surface "index", which some
compilers then warn about if shadowed by a local variable. Re-use an
existing variable instead.

4 years agoPR24996, Gold fix for ternary operator within linker scripts
Miguel Saldivar [Sun, 10 Nov 2019 08:04:25 +0000 (00:04 -0800)] 
PR24996, Gold fix for ternary operator within linker scripts

PR 24996
* expression.cc (Trinary_expression::arg2_value): Use correct integer
expression when calling "eval_maybe_dot" method.
(Trinary_expression::arg3_value): Likewise.

4 years agoAutomatic date update in version.in
GDB Administrator [Mon, 11 Nov 2019 00:00:24 +0000 (00:00 +0000)] 
Automatic date update in version.in

4 years agogdb/python: Introduce gdb.lookup_static_symbols
Andrew Burgess [Tue, 15 Oct 2019 15:18:26 +0000 (16:18 +0100)] 
gdb/python: Introduce gdb.lookup_static_symbols

If gdb.lookup_static_symbol is going to return a single symbol then it
makes sense (I think) for it to return a context sensitive choice of
symbol, that is the global static symbol that would be visible to the
program at that point.

However, if the user of the python API wants to instead get a
consistent set of global static symbols, no matter where they stop,
then they have to instead consider all global static symbols with a
given name - there could be many.  That is what this new API function
offers, it returns a list (possibly empty) of all global static
symbols matching a given name (and optionally a given symbol domain).

gdb/ChangeLog:

* python/py-symbol.c (gdbpy_lookup_static_symbols): New
function.
* python/python-internal.h (gdbpy_lookup_static_symbols):
Declare new function.
* python/python.c (python_GdbMethods): Add
gdb.lookup_static_symbols method.
* NEWS: Mention gdb.lookup_static_symbols.

gdb/testsuite/ChangeLog:

* gdb.python/py-symbol.exp: Add test for
gdb.lookup_static_symbols.

gdb/doc/ChangeLog:

* python.texi (Symbols In Python): Add documentation for
gdb.lookup_static_symbols.

Change-Id: I1153b0ae5bcbc43b3dcf139043c7a48bf791e1a3

4 years agogdb/python: smarter symbol lookup for gdb.lookup_static_symbol
Andrew Burgess [Mon, 23 Sep 2019 15:59:08 +0000 (16:59 +0100)] 
gdb/python: smarter symbol lookup for gdb.lookup_static_symbol

When using gdb.lookup_static_symbol I think that GDB should find
static symbols (global symbol with static linkage) from the current
object file ahead of static symbols from other object files.

This means that if we have two source files f1.c and f2.c, and both
files contains 'static int foo;', then when we are stopped in f1.c a
call to 'gdb.lookup_static_symbol ("foo")' will find f1.c::foo, and if
we are stopped in f2.c we would find 'f2.c::foo'.

Given that gdb.lookup_static_symbol always returns a single symbol,
but there can be multiple static symbols with the same name GDB is
always making a choice about which symbols to return.  I think that it
makes sense for the choice GDB makes in this case to match what a user
would get on the command line if they asked to 'print foo'.

gdb/testsuite/ChangeLog:

* gdb.python/py-symbol.c: Declare and call function from new
py-symbol-2.c file.
* gdb.python/py-symbol.exp: Compile both source files, and add new
tests for gdb.lookup_static_symbol.
* gdb.python/py-symbol-2.c: New file.

gdb/doc/ChangeLog:

* python.texi (Symbols In Python): Extend documentation for
gdb.lookup_static_symbol.

gdb/ChangeLog:

* python/py-symbol.c (gdbpy_lookup_static_symbol): Lookup in
static block of current object file first.  Also fix typo in
header comment.

Change-Id: Ie55dbeb8806f35577b46015deecde27a0ca2ab64

4 years agogdb: Add a class to track last display symtab and line information
Andrew Burgess [Fri, 8 Nov 2019 16:18:43 +0000 (16:18 +0000)] 
gdb: Add a class to track last display symtab and line information

In stack.c we currently have a set of static global variables to track
the last displayed symtab and line.  This commit moves all of these
into a class and adds an instance of the class to track the same
information.

The API into stack.c is unchanged after this cleanup.

There should be no user visible changes after this commit.

gdb/ChangeLog:

* stack.c (set_last_displayed_sal): Delete.
(last_displayed_sal_valid): Delete.
(last_displayed_pspace): Delete.
(last_displayed_addr): Delete.
(last_displayed_symtab): Delete.
(last_displayed_line): Delete.
(class last_displayed_symtab_info_type): New.
(last_displayed_symtab_info): New static global variable.
(print_frame_info): Call methods on last_displayed_symtab_info.
(clear_last_displayed_sal): Update header comment, and make use of
last_displayed_symtab_info.
(last_displayed_sal_is_valid): Likewise.
(get_last_displayed_pspace): Likewise.
(get_last_displayed_addr): Likewise.
(get_last_displayed_symtab): Likewise.
(get_last_displayed_line): Likewise.
(get_last_displayed_sal): Likewise.
* stack.h (clear_last_displayed_sal): Update header comment.
(last_displayed_sal_is_valid): Likewise.
(get_last_displayed_pspace): Likewise.
(get_last_displayed_addr): Likewise.
(get_last_displayed_symtab): Likewise.
(get_last_displayed_line): Likewise.
(get_last_displayed_sal): Likewise.

Change-Id: Ia3dbfe267feec03108c5c8ed8bd94fc0a030c3ed

4 years agogdb: Convert frame_show_address to return a bool
Andrew Burgess [Fri, 8 Nov 2019 15:15:29 +0000 (15:15 +0000)] 
gdb: Convert frame_show_address to return a bool

Just a clean up, should be no user visible changes after this commit.

gdb/ChangeLog:

* stack.c (frame_show_address): Convert return type to bool.
* stack.h (frame_show_address): Likewise, and update header
comment.

Change-Id: Iaaa9ebd4ff6534db19c5329f1c604932c747bd7f

4 years agogdb_vecs.h: Avoid self move assign
Andrew Burgess [Fri, 8 Nov 2019 23:39:14 +0000 (23:39 +0000)] 
gdb_vecs.h: Avoid self move assign

While working on another patch I ran into an issue with
unordered_remove (in gdb_vecs.h), where removing the last item of the
vector can cause a self move assign.

When compiling the C++ standard library in debug mode (with
-D_GLIBCXX_DEBUG=1) this causes an error to trigger.

I've fixed the issue in this patch and provided a unit test.

The provided unit test includes an assignment operator which checks
for self move assign, this removes the need to compile with
-D_GLIBCXX_DEBUG=1 in order to spot the bug.  If you're keen to see
the error reported from the C++ standard library then remove operator=
from the unit test and recompile GDB with -D_GLIBCXX_DEBUG=1.

gdb/ChangeLog:

* Makefile.in (SUBDIR_UNITTESTS_SRCS): Add new file to the list.
* unittests/vec-utils-selftests.c: New file.
* gdbsupport/gdb_vecs.h (unordered_remove): Avoid self move assign.

Change-Id: I80247b20cd5212038117db7412865f5e6a9257cd

4 years agoRemove can_highlight from TUI windows
Tom Tromey [Sun, 10 Nov 2019 17:33:07 +0000 (10:33 -0700)] 
Remove can_highlight from TUI windows

Each TUI window has a "can_highlight" member.  However, this has the
same meaning as "can_box" -- a window can be highlighted if and only
if it can be boxed.  So, this patch removes can_highlight in favor of
simply using can_box.

gdb/ChangeLog
2019-11-10  Tom Tromey  <tom@tromey.com>

* tui/tui-wingeneral.c (tui_unhighlight_win): Use can_box.
(tui_highlight_win): Likewise.
(tui_win_info::check_and_display_highlight_if_needed): Likewise.
* tui/tui-data.h (struct tui_win_info) <can_highlight>: Remove.
* tui/tui-command.h (struct tui_cmd_window) <tui_cmd_window>:
Don't set can_highlight.

Change-Id: I35916859070efcdfcc6e692c71cc6070956dcfce

4 years agoRemove unused constructor declaration from cli_style_option
Tom Tromey [Sun, 10 Nov 2019 16:48:42 +0000 (09:48 -0700)] 
Remove unused constructor declaration from cli_style_option

I noticed that cli_style_option declares a constructor that is never
defined.  This removes it.

gdb/ChangeLog
2019-11-10  Tom Tromey  <tom@tromey.com>

* cli/cli-style.h (class cli_style_option) <cli_style_option>:
Remove unused declaration.

Change-Id: Ic59ec7eab4d7183d9392b58709354b2d4449b7be

4 years agoAutomatic date update in version.in
GDB Administrator [Sun, 10 Nov 2019 00:01:10 +0000 (00:01 +0000)] 
Automatic date update in version.in

4 years agoAutomatic date update in version.in
GDB Administrator [Sat, 9 Nov 2019 00:00:20 +0000 (00:00 +0000)] 
Automatic date update in version.in

4 years agoi386: Only check suffix in instruction mnemonic
H.J. Lu [Fri, 8 Nov 2019 17:31:06 +0000 (09:31 -0800)] 
i386: Only check suffix in instruction mnemonic

We should check suffix in instruction mnemonic when matching instruction.
In Intel syntax, normally we check for memory operand size.  But the same
mnemonic with 2 different encodings can have the same memory operand
size and i.suffix is set to LONG_DOUBLE_MNEM_SUFFIX from memory operand
size in Intel syntax to distinguish them.  When there is no suffix in
mnemonic, we check LONG_DOUBLE_MNEM_SUFFIX in i.suffix for mnemonic
suffix.

gas/

PR gas/25167
* config/tc-i386.c (match_template): Don't check instruction
suffix set from operand.
* testsuite/gas/i386/code16.d: New file.
* testsuite/gas/i386/code16.s: Likewise.
* testsuite/gas/i386/i386.exp: Run code16.
* testsuite/gas/i386/x86-64-branch-4.l: Updated.

opcodes/

PR gas/25167
* i386-opc.tbl: Remove IgnoreSize from cmpsd and movsd.
* i386-tbl.h: Regenerated.

4 years agoConstify command_line_input
Tom Tromey [Tue, 22 Oct 2019 19:32:39 +0000 (13:32 -0600)] 
Constify command_line_input

This changes command_line_input to return a "const char *", which is
appropriate because the memory is owned by command_line_input.  Then
it fixes up the users.

I looked at making command_line_input transfer ownership to its caller
instead, but this is complicated due to the way read_next_line is
called, so I decided against it.

Tested by rebuilding.

gdb/ChangeLog
2019-11-08  Tom Tromey  <tromey@adacore.com>

* top.c (read_command_file): Update.
(command_line_input): Make return type const.
* python/py-gdb-readline.c: Update.
* linespec.c (decode_line_2): Update.
* defs.h (command_line_input): Make return type const.
* cli/cli-script.c (read_next_line): Make return type const.
* ada-lang.c (get_selections): Update.

Change-Id: I27e6c9477fd1005ab5b16e0d337e4c015b6e6248

4 years agoRevert "GENERATE_SHLIB_SCRIPT vs. EMBEDDED."
Alan Modra [Fri, 8 Nov 2019 10:27:07 +0000 (20:57 +1030)] 
Revert "GENERATE_SHLIB_SCRIPT vs. EMBEDDED."

This reverts commit f2aaebdb97977ee7a5c83c02af871e758e7d594b.
My reasons for making that change were just plain wrong.

4 years agox86: convert RegMask and RegBND from bitfield to enumerator
Jan Beulich [Fri, 8 Nov 2019 08:06:24 +0000 (09:06 +0100)] 
x86: convert RegMask and RegBND from bitfield to enumerator

This is to further shrink the operand type representation.

4 years agox86: convert RegSIMD and RegMMX from bitfield to enumerator
Jan Beulich [Fri, 8 Nov 2019 08:05:36 +0000 (09:05 +0100)] 
x86: convert RegSIMD and RegMMX from bitfield to enumerator

This is to further shrink the operand type representation.

4 years agox86: convert Control/Debug/Test from bitfield to enumerator
Jan Beulich [Fri, 8 Nov 2019 08:04:53 +0000 (09:04 +0100)] 
x86: convert Control/Debug/Test from bitfield to enumerator

This is to further shrink the operand type representation.

4 years agox86: convert SReg from bitfield to enumerator
Jan Beulich [Fri, 8 Nov 2019 08:04:09 +0000 (09:04 +0100)] 
x86: convert SReg from bitfield to enumerator

This is to further shrink the operand type representation.

4 years agox86: introduce operand type "class"
Jan Beulich [Fri, 8 Nov 2019 08:03:23 +0000 (09:03 +0100)] 
x86: introduce operand type "class"

Many operand types, in particular the various kinds of registers, can't
be combined with one another (neither in templates nor in register
entries), and hence it is not a good use of resources (memory as well as
execution time) to represent them as individual bits of a bit field.

4 years agoPR25172, Wrong description of --stop-address=ADDR switch
Alan Modra [Fri, 8 Nov 2019 03:32:05 +0000 (14:02 +1030)] 
PR25172, Wrong description of --stop-address=ADDR switch

PR 25172
* objdump.c (usage): Correct --stop-address description.

4 years agoAutomatic date update in version.in
GDB Administrator [Fri, 8 Nov 2019 00:00:14 +0000 (00:00 +0000)] 
Automatic date update in version.in

4 years ago[gas][aarch64] Add the v8.6 Data Gathering Hint mnemonic [10/X]
Matthew Malcomson [Thu, 7 Nov 2019 17:22:45 +0000 (17:22 +0000)] 
[gas][aarch64] Add the v8.6 Data Gathering Hint mnemonic [10/X]

Hi,

This patch is part of a series that adds support for Armv8.6-A
to binutils.

In this last patch, the new Data Gathering Hint mnemonic is introduced.

Committed on behalf of Mihail Ionescu.

gas/ChangeLog:

2019-11-07  Mihail Ionescu  <mihail.ionescu@arm.com>

* testsuite/gas/aarch64/dgh.s: New test.
* testsuite/gas/aarch64/dgh.d: New test.

opcodes/ChangeLog:

2019-11-07  Mihail Ionescu  <mihail.ionescu@arm.com>

* opcodes/aarch64-tbl.h (V8_6_INSN): New macro for v8.6 instructions.
(aarch64_opcode_table): Add data gathering hint mnemonic.
* opcodes/aarch64-dis-2.c: Account for new instruction.

Is it ok for trunk?

Regards,
Mihail

4 years ago[Patch][binutils][arm] Armv8.6-A Matrix Multiply extension [9/10]
Matthew Malcomson [Thu, 7 Nov 2019 17:20:08 +0000 (17:20 +0000)] 
[Patch][binutils][arm]  Armv8.6-A Matrix Multiply extension [9/10]

Hi,

This patch is part of a series that adds support for Armv8.6-A
(Matrix Multiply and BFloat16 extensions) to binutils.

This patch introduces the Matrix Multiply (Int8, F32, F64) extensions
to the arm backend.

The following Matrix Multiply instructions are added: vummla, vsmmla,
vusmmla, vusdot, vsudot[1].

[1]https://developer.arm.com/docs/ddi0597/latest/simd-and-floating-point-instructions-alphabetic-order

Committed on behalf of Mihail Ionescu.

gas/ChangeLog:

2019-11-07  Mihail Ionescu  <mihail.ionescu@arm.com>

* config/tc-arm.c (arm_ext_i8mm): New feature set.
(do_vusdot): New.
(do_vsudot): New.
(do_vsmmla): New.
(do_vummla): New.
(insns): Add vsmmla, vummla, vusmmla, vusdot, vsudot mnemonics.
(armv86a_ext_table): Add i8mm extension.
(arm_extensions): Move bf16 extension to context sensitive table.
(armv82a_ext_table, armv84a_ext_table, armv85a_ext_table):
Move bf16 extension to context sensitive table.
(armv86a_ext_table): Add i8mm extension.
* doc/c-arm.texi: Document i8mm extension.
* testsuite/gas/arm/i8mm.s: New test.
* testsuite/gas/arm/i8mm.d: New test.
* testsuite/gas/arm/bfloat17-cmdline-bad-3.d: Update test.

include/ChangeLog:

2019-11-07  Mihail Ionescu  <mihail.ionescu@arm.com>

* opcode/arm.h (ARM_EXT2_I8MM): New feature macro.

opcodes/ChangeLog:

2019-11-07  Mihail Ionescu  <mihail.ionescu@arm.com>

* arm-dis.c (neon_opcodes): Add i8mm SIMD instructions.

Regression tested on arm-none-eabi.
Is this ok for trunk?

Regards,
Mihail

4 years ago[binutils][aarch64] Matrix Multiply extension enablement [8/X]
Matthew Malcomson [Thu, 7 Nov 2019 17:10:01 +0000 (17:10 +0000)] 
[binutils][aarch64] Matrix Multiply extension enablement [8/X]

Hi,

This patch is part of a series that adds support for Armv8.6-A
(Matrix Multiply and BFloat16 extensions) to binutils.

This patch introduces the Matrix Multiply (Int8, F32, F64) extensions
to the aarch64 backend.

The following instructions are added: {s/u}mmla, usmmla, {us/su}dot,
fmmla, ld1rob, ld1roh, d1row, ld1rod, uzip{1/2}, trn{1/2}.

Committed on behalf of Mihail Ionescu.

gas/ChangeLog:

2019-11-07  Mihail Ionescu  <mihail.ionescu@arm.com>

* config/tc-aarch64.c: Add new arch fetures to suppport the mm extension.
(parse_operands): Add new operand.
* testsuite/gas/aarch64/i8mm.s: New test.
* testsuite/gas/aarch64/i8mm.d: New test.
* testsuite/gas/aarch64/f32mm.s: New test.
* testsuite/gas/aarch64/f32mm.d: New test.
* testsuite/gas/aarch64/f64mm.s: New test.
* testsuite/gas/aarch64/f64mm.d: New test.
* testsuite/gas/aarch64/sve-movprfx-mm.s: New test.
* testsuite/gas/aarch64/sve-movprfx-mm.d: New test.

include/ChangeLog:

2019-11-07  Mihail Ionescu  <mihail.ionescu@arm.com>

* opcode/aarch64.h (AARCH64_FEATURE_I8MM): New.
(AARCH64_FEATURE_F32MM): New.
(AARCH64_FEATURE_F64MM): New.
(AARCH64_OPND_SVE_ADDR_RI_S4x32): New.
(enum aarch64_insn_class): Add new instruction class "aarch64_misc" for
instructions that do not require special handling.

opcodes/ChangeLog:

2019-11-07  Mihail Ionescu  <mihail.ionescu@arm.com>

* aarch64-tbl.h (aarch64_feature_i8mm_sve, aarch64_feature_f32mm_sve,
aarch64_feature_f64mm_sve, aarch64_feature_i8mm, aarch64_feature_f32mm,
aarch64_feature_f64mm): New feature sets.
(INT8MATMUL_INSN, F64MATMUL_SVE_INSN, F64MATMUL_INSN,
F32MATMUL_SVE_INSN, F32MATMUL_INSN): New macros to define matrix multiply
instructions.
(I8MM_SVE, F32MM_SVE, F64MM_SVE, I8MM, F32MM, F64MM): New feature set
macros.
(QL_MMLA64, OP_SVE_SBB): New qualifiers.
(OP_SVE_QQQ): New qualifier.
(INT8MATMUL_SVE_INSNC, F64MATMUL_SVE_INSNC,
F32MATMUL_SVE_INSNC): New feature set for bfloat16 instructions to support
the movprfx constraint.
(aarch64_opcode_table): Support for SVE_ADDR_RI_S4x32.
(aarch64_opcode_table): Define new instructions smmla,
ummla, usmmla, usdot, sudot, fmmla, ld1rob, ld1roh, ld1row, ld1rod
uzip{1/2}, trn{1/2}.
* aarch64-opc.c (operand_general_constraint_met_p): Handle
AARCH64_OPND_SVE_ADDR_RI_S4x32.
(aarch64_print_operand): Handle AARCH64_OPND_SVE_ADDR_RI_S4x32.
* aarch64-dis-2.c (aarch64_opcode_lookup_1, aarch64_find_next_opcode):
Account for new instructions.
* opcodes/aarch64-asm-2.c (aarch64_insert_operand): Support the new
S4x32 operand.
* aarch64-opc-2.c (aarch64_operands): Support the new S4x32 operand.

Regression tested on arm-none-eabi.

Is it ok for trunk?

Regards,
Mihail

4 years ago[Patch][binutils][aarch64] .bfloat16 directive for AArch64 [7/10]
Matthew Malcomson [Thu, 7 Nov 2019 17:07:32 +0000 (17:07 +0000)] 
[Patch][binutils][aarch64] .bfloat16 directive for AArch64 [7/10]

Hi,

This patch is part of a series that adds support for Armv8.6-A
(Matrix Multiply and BFloat16 extensions) to binutils.

This patch implements the '.bfloat' directive for the AArch64 backend.

The syntax for the directive is:
  .bfloat16 <0-n numbers>
e.g.
  .bfloat16 12.0
  .bfloat16 0.123, 1.0, NaN, 5

This is implemented by utilizing the ieee_atof_detail function in order
to encode the slightly
different bfloat16 format.

Added testcases to verify the correct encoding for various bfloat16
values (NaN, Infinity (+ & -), normals, subnormals etc...).

Cross compiled and tested on aarch64-none-elf and aarch64-none-linux-gnu
with no issues.

Committed on behalf of Mihail Ionescu.

gas/ChangeLog:

2019-10-29  Mihail Ionescu  <mihail.ionescu@arm.com>
2019-10-29  Barnaby Wilks  <barnaby.wilks@arm.com>

* config/tc-aarch64.c (md_atof): Add encoding for the bfloat16 format.
* testsuite/gas/aarch64/bfloat16-directive-le.d: New test.
* testsuite/gas/aarch64/bfloat16-directive-be.d: New test.
* testsuite/gas/aarch64/bfloat16-directive.s: New test.

Is it ok for trunk?

Regards,
Mihail

4 years ago[Patch][binutils][arm] .bfloat16 directive for Arm [6/X]
Matthew Malcomson [Thu, 7 Nov 2019 17:03:54 +0000 (17:03 +0000)] 
[Patch][binutils][arm] .bfloat16 directive for Arm [6/X]

Hi,

This patch is part of a series that adds support for Armv8.6-A
(Matrix Multiply and BFloat16 extensions) to binutils.

This patch implements the '.bfloat16' directive for the Arm backend.

The syntax for the directive is:
  .bfloat16 <0-n numbers>
e.g.
  .bfloat16 12.0
  .bfloat16 0.123, 1.0, NaN, 5

This is implemented by utilizing the ieee_atof_detail function (included
in the previous patch) in order to encode the slightly different
bfloat16 format.

Added testcases to verify the correct encoding for various bfloat16
values (NaN, Infinity (+ & -), normals, subnormals etc...).

Cross compiled and tested on arm-none-eabi and arm-none-linux-gnueabihf
with no issues.

Committed on behalf of Mihail Ionescu.

gas/ChangeLog:

2019-10-21  Mihail Ionescu  <mihail.ionescu@arm.com>
2019-10-21  Barnaby Wilks  <barnaby.wilks@arm.com>

* config/tc-arm.c (md_atof): Add encoding for bfloat16
* testsuite/gas/arm/bfloat16-directive-le.d: New test.
* testsuite/gas/arm/bfloat16-directive-be.d: New test.
* testsuite/gas/arm/bfloat16-directive.s: New test.

Is it ok for trunk?

Regards,
Mihail

4 years ago[Patch][binutils] Generic support for parsing numbers in bfloat16 format [5/X]
Matthew Malcomson [Thu, 7 Nov 2019 17:01:04 +0000 (17:01 +0000)] 
[Patch][binutils] Generic support for parsing numbers in bfloat16 format [5/X]

Hi,

This patch is part of a series that adds support for Armv8.6-A
(Matrix Multiply and BFloat16 extensions).

This patch contains some general refactoring of the atof_ieee
function, exposing a function that allows a higher level of control
over the format of IEEE-like floating point numbers.
This has been done in order to be able to add a directive for assembling
floating point literals in the bfloat16 format in the following patches.

Committed on behalf of Mihail Ionescu.

Tested on arm-none-eabi, arm-none-linux-gnueabihf, aarch64-none-elf
and aarch64-none-linux-gnuwith no issues.

gas/ChangeLog:

2019-10-21  Mihail Ionescu  <mihail.ionescu@arm.com>
2019-10-21  Barnaby Wilks  <barnaby.wilks@arm.com>

* as.h (atof_ieee_detail): Add prototype for atof_ieee_detail function.
(atof_ieee): Move some code into the atof_ieee_detail function.
(atof_ieee_detail): Add function that provides a higher level of control over generating
IEEE-like numbers.

Is it ok for trunk?

Regards,
Mihail

4 years ago[binutils][arm] BFloat16 enablement [4/X]
Matthew Malcomson [Thu, 7 Nov 2019 16:56:12 +0000 (16:56 +0000)] 
[binutils][arm] BFloat16 enablement [4/X]

Hi,

This patch is part of a series that adds support for Armv8.6-A
(Matrix Multiply and BFloat16 extensions) to binutils.

This patch introduces BFloat16 instructions to the arm backend.
The following BFloat16 instructions are added: vdot, vfma{l/t},
vmmla, vfmal{t/b}, vcvt, vcvt{t/b}.

gas/ChangeLog:

2019-11-07  Mihail Ionescu  <mihail.ionescu@arm.com>
2019-11-07  Matthew Malcomson  <matthew.malcomson@arm.com>

* config/tc-arm.c (arm_archs): Add armv8.6-a option.
(cpu_arch_ver): Add TAG_CPU_ARCH_V8 tag for Armv8.6-a.
* doc/c-arm.texi (-march): New armv8.6-a arch.
* config/tc-arm.c (arm_ext_bf16): New feature set.
(enum neon_el_type): Add NT_bfloat value.
(B_MNEM_vfmat, B_MNEM_vfmab): New bfloat16 encoder
helpers.
(BAD_BF16): New message.
(parse_neon_type): Add bf16 type specifier.
(enum neon_type_mask): Add N_BF16 type.
(type_chk_of_el_type): Account for NT_bfloat.
(el_type_of_type_chk): Account for N_BF16.
(neon_three_args): Split out from neon_three_same.
(neon_three_same): Part split out into neon_three_args.
(CVT_FLAVOUR_VAR): Add bf16_f32 cvt flavour.
(do_neon_cvt_1): Account for vcvt.bf16.f32.
(do_bfloat_vmla): New.
(do_mve_vfma): New function to deal with the mnemonic clash between the BF16
vfmat and the MVE vfma in a VPT block with a 't'rue condition.
(do_neon_cvttb_1): Account for vcvt{t,b}.bf16.f32.
(do_vdot): New
(do_vmmla): New
(insns): Add vdot and vmmla mnemonics.
(arm_extensions): Add "bf16" extension.
* doc/c-arm.texi: Document "bf16" extension.
* testsuite/gas/arm/attr-march-armv8_6-a.d: New test.
* testsuite/gas/arm/bfloat16-bad.d: New test.
* testsuite/gas/arm/bfloat16-bad.l: New test.
* testsuite/gas/arm/bfloat16-bad.s: New test.
* testsuite/gas/arm/bfloat16-cmdline-bad-2.d: New test.
* testsuite/gas/arm/bfloat16-cmdline-bad-3.d: New test.
* testsuite/gas/arm/bfloat16-cmdline-bad.d: New test.
* testsuite/gas/arm/bfloat16-neon.s: New test.
* testsuite/gas/arm/bfloat16-non-neon.s: New test.
* testsuite/gas/arm/bfloat16-thumb-bad.d: New test.
* testsuite/gas/arm/bfloat16-thumb-bad.l: New test.
* testsuite/gas/arm/bfloat16-thumb.d: New test.
* testsuite/gas/arm/bfloat16-vfp.d: New test.
* testsuite/gas/arm/bfloat16.d: New test.
* testsuite/gas/arm/bfloat16.s: New test.

include/ChangeLog:

2019-11-07  Mihail Ionescu  <mihail.ionescu@arm.com>
2019-11-07  Matthew Malcomson  <matthew.malcomson@arm.com>

* opcode/arm.h (ARM_EXT2_V8_6A, ARM_AEXT2_V8_6A,
ARM_ARCH_V8_6A): New.
* opcode/arm.h (ARM_EXT2_BF16): New feature macro.
(ARM_AEXT2_V8_6A): Include above macro in definition.

opcodes/ChangeLog:

2019-11-07  Mihail Ionescu  <mihail.ionescu@arm.com>
2019-11-07  Matthew Malcomson  <matthew.malcomson@arm.com>

* arm-dis.c (select_arm_features): Update bfd_march_arm_8 with
Armv8.6-A.
(coprocessor_opcodes): Add bfloat16 vcvt{t,b}.
(neon_opcodes): Add bfloat SIMD instructions.
(print_insn_coprocessor): Add new control character %b to print
condition code without checking cp_num.
(print_insn_neon): Account for BFloat16 instructions that have no
special top-byte handling.

Regression tested on arm-none-eabi.

Is it ok for trunk?

Regards,
Mihail

4 years ago[Patch][binutils][arm] Create a new generic coprocessor array [3/10]
Matthew Malcomson [Thu, 7 Nov 2019 16:53:40 +0000 (16:53 +0000)] 
[Patch][binutils][arm] Create a new generic coprocessor array [3/10]

Hi,

This patch is part of a series that adds support for Armv8.6-A
(Matrix Multiply and BFloat16 extensions) to binutils.

Some generic instructions match a large range of encoding space (e.g.
stc, mcr, mrc).
Currently these instructions are in the coprocessor_opcodes array, which
means they are checked before many other instructions when disassembling
arm and thumb32 codes.

This patch moves the generic instructions into a separate array to be
checked later on.
This is done in order to avoid instruction conflict between the generic
instructions and newer ones -- this has already been seen with MVE, and
is also a problem with BFloat16.

One way to avoid the conflict could be to swap the search order between
coprocessor_opcodes and neon_opcodes.
We avoid this since it's a larger change that may introduce extra bugs
(that aren't caught by the testsuite).

We have decided against searching the generic array after searching the
arm specific and thumb32 specific arrays with a similar reasoning about
keeping the change small.

Regression tested with arm-none-linux-gnueabihf.

Committed on behalf of Mihail Ionescu.

opcodes/ChangeLog:

2019-10-29  Mihail Ionescu  <mihail.ionescu@arm.com>
2019-10-29  Matthew Malcomson  <matthew.malcomson@arm.com>

* arm-dis.c (print_insn_coprocessor,
print_insn_generic_coprocessor): Create wrapper functions around
the implementation of the print_insn_coprocessor control codes.
(print_insn_coprocessor_1): Original print_insn_coprocessor
function that now takes which array to look at as an argument.
(print_insn_arm): Use both print_insn_coprocessor and
print_insn_generic_coprocessor.
(print_insn_thumb32): As above.

Is it ok for trunk?

Regards,
Mihail

4 years ago[binutils][aarch64] Bfloat16 enablement [2/X]
Matthew Malcomson [Thu, 7 Nov 2019 16:38:59 +0000 (16:38 +0000)] 
[binutils][aarch64] Bfloat16 enablement [2/X]

Hi,

This patch is part of a series that adds support for Armv8.6-A
(Matrix Multiply and BFloat16 extensions) to binutils.

This patch introduces the following BFloat16 instructions to the
aarch64 backend: bfdot, bfmmla, bfcvt, bfcvtnt, bfmlal[t/b],
bfcvtn2.

Committed on behalf of Mihail Ionescu.

gas/ChangeLog:

2019-11-07  Mihail Ionescu  <mihail.ionescu@arm.com>
2019-11-07  Matthew Malcomson  <matthew.malcomson@arm.com>

* config/tc-aarch64.c (vectype_to_qualifier): Special case the
S_2H operand qualifier.
* doc/c-aarch64.texi: Document bf16 and bf16mmla4 extensions.
* testsuite/gas/aarch64/bfloat16.d: New test.
* testsuite/gas/aarch64/bfloat16.s: New test.
* testsuite/gas/aarch64/illegal-bfloat16.d: New test.
* testsuite/gas/aarch64/illegal-bfloat16.l: New test.
* testsuite/gas/aarch64/illegal-bfloat16.s: New test.
* testsuite/gas/aarch64/sve-bfloat-movprfx.s: New test.
* testsuite/gas/aarch64/sve-bfloat-movprfx.d: New test.

include/ChangeLog:

2019-11-07  Mihail Ionescu  <mihail.ionescu@arm.com>
2019-11-07  Matthew Malcomson  <matthew.malcomson@arm.com>

* opcode/aarch64.h (AARCH64_FEATURE_BFLOAT16): New feature macros.
(AARCH64_ARCH_V8_6): Include BFloat16 feature macros.
(enum aarch64_opnd_qualifier): Introduce new operand qualifier
AARCH64_OPND_QLF_S_2H.
(enum aarch64_insn_class): Introduce new class "bfloat16".
(BFLOAT16_SVE_INSNC): New feature set for bfloat16
instructions to support the movprfx constraint.

opcodes/ChangeLog:

2019-11-07  Mihail Ionescu  <mihail.ionescu@arm.com>
2019-11-07  Matthew Malcomson  <matthew.malcomson@arm.com>

* aarch64-asm.c (aarch64_ins_reglane): Use AARCH64_OPND_QLF_S_2H
in reglane special case.
* aarch64-dis-2.c (aarch64_opcode_lookup_1,
aarch64_find_next_opcode): Account for new instructions.
* aarch64-dis.c (aarch64_ext_reglane): Use AARCH64_OPND_QLF_S_2H
in reglane special case.
* aarch64-opc.c (struct operand_qualifier_data): Add data for
new AARCH64_OPND_QLF_S_2H qualifier.
* aarch64-tbl.h (QL_BFDOT QL_BFDOT64, QL_BFDOT64I, QL_BFMMLA2,
QL_BFCVT64, QL_BFCVTN64, QL_BFCVTN2_64): New qualifiers.
(aarch64_feature_bfloat16, aarch64_feature_bfloat16_sve,
aarch64_feature_bfloat16_bfmmla4): New feature sets.
(BFLOAT_SVE, BFLOAT): New feature set macros.
(BFLOAT_SVE_INSN, BFLOAT_BFMMLA4_INSN, BFLOAT_INSN): New macros
to define BFloat16 instructions.
(aarch64_opcode_table): Define new instructions bfdot,
bfmmla, bfcvt, bfcvtnt, bfdot, bfdot, bfcvtn, bfmlal[b/t]
bfcvtn2, bfcvt.

Regression tested on aarch64-elf.

Is it ok for trunk?

Regards,
Mihail

4 years ago[gas][aarch64] Armv8.6-a option [1/X]
Matthew Malcomson [Thu, 7 Nov 2019 16:18:51 +0000 (16:18 +0000)] 
[gas][aarch64] Armv8.6-a option [1/X]

Hi,

This patch is part of a series that adds support for Armv8.6-A
to binutils.
This first patch adds the Armv8.6-A flag to binutils.
No instructions are behind it at the moment.

Commited on behalf of Mihail Ionescu.

gas/ChangeLog:

2019-11-07  Mihail Ionescu  <mihail.ionescu@arm.com>
2019-11-07  Matthew Malcomson  <matthew.malcomson@arm.com>

* config/tc-aarch64.c (armv8.6-a): New arch.
* doc/c-aarch64.texi (armv8.6-a): Document new arch.

include/ChangeLog:

2019-11-07  Mihail Ionescu  <mihail.ionescu@arm.com>
2019-11-07  Matthew Malcomson  <matthew.malcomson@arm.com>

* opcode/aarch64.h (AARCH64_FEATURE_V8_6): New.
(AARCH64_ARCH_V8_6): New.

opcodes/ChangeLog:

2019-11-07  Mihail Ionescu  <mihail.ionescu@arm.com>
2019-11-07  Matthew Malcomson  <matthew.malcomson@arm.com>

* aarch64-tbl.h (ARMV8_6): New macro.

Is it ok for trunk?

Regards,
Mihail

4 years agoAllow the --output option of the "ar" prorgam to extract files to locations outside...
Nick Clifton [Thu, 7 Nov 2019 11:56:54 +0000 (11:56 +0000)] 
Allow the --output option of the "ar" prorgam to extract files to locations outside of the current directory.

* ar.c (open_output_file): Check for filename validity before
prefixing with output directory.
Display the constructed output filename if in verbose mode.
(extract_file): Let open_output_file display the filename.

4 years agoFix bug merging notes with objcopy when no merging results in zeroes being written...
Nick Clifton [Thu, 7 Nov 2019 11:36:06 +0000 (11:36 +0000)] 
Fix bug merging notes with objcopy when no merging results in zeroes being written back into the note section.

* objcopy.c (copy_object): Skip note sections that do not have
an output section.  Always copy note sections, even if no
changes are made.

4 years ago[gdb/contrib] Add words.sh script
Tom de Vries [Thu, 7 Nov 2019 09:49:56 +0000 (10:49 +0100)] 
[gdb/contrib] Add words.sh script

Add a script that takes a list of files as arguments and output a list of
words from the C comments with their frequencies.

For:
...
$ ./gdb/contrib/words.sh $(find gdb -type f -name "*.c" -o -name "*.h")
...
it generates a list of ~15000 words prefixed with frequency.

This could be used to generate a dictionary that is kept as part of the
sources, against which new code can be checked, generating a warning or
error.  The hope is that misspellings would trigger this frequently, and rare
words rarely, otherwise the burden of updating the dictionary would be too
much.

And for:
...
$ ./gdb/contrib/words.sh -f 1 $(find gdb -type f -name "*.c" -o -name "*.h")
...
it generates a list of ~5000 words with frequency 1.

This can be used to scan for misspellings manually.

Change-Id: I7b119c9a4519cdbf62a3243d1df2927c80813e8b

4 years agoRemove CR16C support
Alan Modra [Thu, 7 Nov 2019 03:02:16 +0000 (13:32 +1030)] 
Remove CR16C support

I think it is past time to remove CR16C support.  CR16C was added in
2004, and only for ld.  gas and binutils support is lacking, and there
have been no commits to bfd/elf32-cr16c.c other than warning fixes or
global maintainers making changes to all targets.  I see no maintainer
listed for CR16C, and no commits from anyone at NSC supporting the
target.  Furthermore, at the time the CR16 support was added in 2007,
config.sub was changed upstream to no longer recognise cr16c as a
valid cpu.  That means the CR16C ld support is only available as a
secondary target by configuring with, for example,
--enable-targets=all or --enable-targets=cr16c-unknown-elf.  No
testing of the CR16C target is possible.

include/
* elf/cr16c.h: Delete.
bfd/
* cpu-cr16c.c: Delete.
* elf32-cr16c.c: Delete.
* Makefile.am,
* archures.c,
* config.bfd,
* configure.ac,
* reloc.c,
* targets.c: Remove cr16c support.
* Makefile.in,
* bfd-in2.h,
* configure,
* libbfd.h,
* po/SRC-POTFILES.in: Regenerate.
ld/
* emulparams/elf32cr16c.sh: Delete.
* scripttempl/elf32cr16c.sc: Delete.
* Makefile.am,
* configure.tgt: Remove cr16c support.
* NEWS: Mention removal of cr16c.
* Makefile.in,
* po/BLD-POTFILES.in: Regenerate.

4 years agoOrder targets in ld/configure.tgt
Alan Modra [Wed, 6 Nov 2019 07:20:27 +0000 (17:50 +1030)] 
Order targets in ld/configure.tgt

The target list was supposed to be more or less alphabetically sorted,
but this wasn't anywhere near the case.  The comment about keeping
architecture variants together seems odd to me, and is no doubt the
reason why ix86 and x86_64 were grouped together, so I removed that
comment.  The patch doesn't change order of entries for a given cpu.

* configure.tgt: Order targets by cpu.

4 years agox86: support further AMD Zen2 instructions
Jan Beulich [Thu, 7 Nov 2019 08:29:14 +0000 (09:29 +0100)] 
x86: support further AMD Zen2 instructions

Both RDPRU and MCOMMIT have been publicly documented meanwhile:
https://www.amd.com/system/files/TechDocs/24594.pdf.

4 years agox86: adjust register names printed for MONITOR/MWAIT
Jan Beulich [Thu, 7 Nov 2019 08:28:20 +0000 (09:28 +0100)] 
x86: adjust register names printed for MONITOR/MWAIT

As the comments (here: almost, in the opcode table: fully) correctly
state - all register operands except MONITOR's address one are fixed
at 32 bit size. Don't print 64-bit registers there.

Also adjust x86-64-suffix.d's name such that it wouldn't be identical to
x86-64-rep-suffix.d's, but instead resemble that of its sibling
x86-64-suffix-intel.d.

4 years agox86/Intel: drop IgnoreSize from operand-less MOVSD/CMPSD again
Jan Beulich [Thu, 7 Nov 2019 08:27:16 +0000 (09:27 +0100)] 
x86/Intel: drop IgnoreSize from operand-less MOVSD/CMPSD again

These were mistakenly added by d241b91073 ("x86/Intel: correct MOVSD and
CMPSD handling"). This addresses part of PR/gas 25167.

4 years agoaarch64 and arm testsuite fixes for targets lacking shared libs
Alan Modra [Thu, 7 Nov 2019 00:30:26 +0000 (11:00 +1030)] 
aarch64 and arm testsuite fixes for targets lacking shared libs

* testsuite/ld-aarch64/aarch64-elf.exp: Run tests requiring pie
or shared library support only when check_shared_lib_support.
* testsuite/ld-aarch64/bti-pac-plt-1.d: Likewise.
* testsuite/ld-aarch64/bti-pac-plt-2.d: Likewise.
* testsuite/ld-aarch64/bti-plt-1.d: Likewise.
* testsuite/ld-aarch64/bti-plt-2.d: Likewise.
* testsuite/ld-aarch64/bti-plt-3.d: Likewise.
* testsuite/ld-aarch64/bti-plt-4.d: Likewise.
* testsuite/ld-aarch64/bti-plt-6.d: Likewise.
* testsuite/ld-aarch64/bti-plt-7.d: Likewise.
* testsuite/ld-aarch64/bti-warn.d: Likewise.
* testsuite/ld-aarch64/dt_textrel.d: Likewise.
* testsuite/ld-aarch64/emit-relocs-258-dyn-bad.d: Likewise.
* testsuite/ld-aarch64/emit-relocs-259-dyn-bad.d: Likewise.
* testsuite/ld-aarch64/emit-relocs-264-bad.d: Likewise.
* testsuite/ld-aarch64/emit-relocs-266-bad.d: Likewise.
* testsuite/ld-aarch64/emit-relocs-268-bad.d: Likewise.
* testsuite/ld-aarch64/emit-relocs-269-bad.d: Likewise.
* testsuite/ld-aarch64/emit-relocs-515-be.d: Likewise.
* testsuite/ld-aarch64/emit-relocs-515.d: Likewise.
* testsuite/ld-aarch64/emit-relocs-516-be.d: Likewise.
* testsuite/ld-aarch64/emit-relocs-516.d: Likewise.
* testsuite/ld-aarch64/farcall-b-plt.d: Likewise.
* testsuite/ld-aarch64/farcall-bl-plt.d: Likewise.
* testsuite/ld-aarch64/gc-plt-relocs.d: Likewise.
* testsuite/ld-aarch64/gc-relocs-257-dyn.d: Likewise.
* testsuite/ld-aarch64/ifunc-1-local.d: Likewise.
* testsuite/ld-aarch64/ifunc-1.d: Likewise.
* testsuite/ld-aarch64/ifunc-12.d: Likewise.
* testsuite/ld-aarch64/ifunc-13.d: Likewise.
* testsuite/ld-aarch64/ifunc-14a.d: Likewise.
* testsuite/ld-aarch64/ifunc-14b.d: Likewise.
* testsuite/ld-aarch64/ifunc-14c.d: Likewise.
* testsuite/ld-aarch64/ifunc-14d.d: Likewise.
* testsuite/ld-aarch64/ifunc-14e.d: Likewise.
* testsuite/ld-aarch64/ifunc-14f.d: Likewise.
* testsuite/ld-aarch64/ifunc-15.d: Likewise.
* testsuite/ld-aarch64/ifunc-16.d: Likewise.
* testsuite/ld-aarch64/ifunc-18a.d: Likewise.
* testsuite/ld-aarch64/ifunc-18b.d: Likewise.
* testsuite/ld-aarch64/ifunc-19a.d: Likewise.
* testsuite/ld-aarch64/ifunc-19b.d: Likewise.
* testsuite/ld-aarch64/ifunc-2-local.d: Likewise.
* testsuite/ld-aarch64/ifunc-2.d: Likewise.
* testsuite/ld-aarch64/ifunc-20.d: Likewise.
* testsuite/ld-aarch64/ifunc-21.d: Likewise.
* testsuite/ld-aarch64/ifunc-3a.d: Likewise.
* testsuite/ld-aarch64/ifunc-3b.d: Likewise.
* testsuite/ld-aarch64/ifunc-5b-local.d: Likewise.
* testsuite/ld-aarch64/ifunc-5b.d: Likewise.
* testsuite/ld-aarch64/ifunc-6b.d: Likewise.
* testsuite/ld-aarch64/ifunc-7b.d: Likewise.
* testsuite/ld-aarch64/ifunc-7c.d: Likewise.
* testsuite/ld-aarch64/pac-plt-1.d: Likewise.
* testsuite/ld-aarch64/pac-plt-2.d: Likewise.
* testsuite/ld-aarch64/pcrel_pic_defined.d: Likewise.
* testsuite/ld-aarch64/pcrel_pic_undefined.d: Likewise.
* testsuite/ld-aarch64/pie-bind-locally.d: Likewise.
* testsuite/ld-aarch64/plt_mapping_symbol.d: Likewise.
* testsuite/ld-aarch64/pr20402.d: Likewise.
* testsuite/ld-aarch64/pr22764.d: Likewise.
* testsuite/ld-aarch64/property-bti-pac1.d: Likewise.
* testsuite/ld-aarch64/protected-data.d: Likewise.
* testsuite/ld-aarch64/rela-abs-relative-be.d: Likewise.
* testsuite/ld-aarch64/rela-abs-relative-opt.d: Likewise.
* testsuite/ld-aarch64/rela-abs-relative.d: Likewise.
* testsuite/ld-aarch64/relasz.d: Likewise.
* testsuite/ld-aarch64/relocs-1027-symbolic-func.d: Likewise.
* testsuite/ld-aarch64/tls-desc-ie-ilp32.d: Likewise.
* testsuite/ld-aarch64/tls-desc-ie.d: Likewise.
* testsuite/ld-aarch64/tls-large-desc-be.d: Likewise.
* testsuite/ld-aarch64/tls-large-desc.d: Likewise.
* testsuite/ld-aarch64/tls-large-ie-be.d: Likewise.
* testsuite/ld-aarch64/tls-large-ie.d: Likewise.
* testsuite/ld-aarch64/tls-relax-gdesc-le-now.d: Likewise.
* testsuite/ld-aarch64/tls-small-ld.d: Likewise.
* testsuite/ld-aarch64/tls-tiny-desc.d: Likewise.
* testsuite/ld-aarch64/tls-tiny-gd.d: Likewise.
* testsuite/ld-aarch64/tls-tiny-ie.d: Likewise.
* testsuite/ld-aarch64/tls-tiny-ld.d: Likewise.
* testsuite/ld-aarch64/tlsle-symbol-offset.d: Likewise.
* testsuite/ld-aarch64/tlsle.d: Likewise.
* testsuite/ld-aarch64/variant_pcs-now.d: Likewise.
* testsuite/ld-aarch64/variant_pcs-shared.d: Likewise.
* testsuite/ld-arm/arm-elf.exp: Likewise.  Remove --hash-style=sysv
from static tests.  Consolidate armelftests_common_* vars into one.
* testsuite/ld-arm/gc-hidden-1.d: Require check_shared_lib_support.
* testsuite/ld-arm/movw-shared-1.d: Likewise.
* testsuite/ld-arm/movw-shared-2.d: Likewise.
* testsuite/ld-arm/movw-shared-3.d: Likewise.
* testsuite/ld-arm/movw-shared-4.d: Likewise.
* testsuite/ld-arm/pie-bind-locally.d: Likewise.
* testsuite/ld-arm/protected-data.d: Likewise.
* testsuite/ld-arm/rel32-reject-pie.d: Likewise.
* testsuite/ld-arm/rel32-reject.d: Likewise.
* testsuite/ld-arm/thumb2-bl-undefweak.d: Likewise.
* testsuite/ld-arm/thumb2-bl-undefweak1.d: Likewise.

4 years agoAutomatic date update in version.in
GDB Administrator [Thu, 7 Nov 2019 00:00:32 +0000 (00:00 +0000)] 
Automatic date update in version.in

4 years agoUse strtok_r instead of strtok
Christian Biesinger [Sat, 2 Nov 2019 17:09:31 +0000 (12:09 -0500)] 
Use strtok_r instead of strtok

Improves threadsafety. This will be important when the patch series at
https://gnutoolchain-gerrit.osci.io/r/c/binutils-gdb/+/176
lands.

gdb/ChangeLog:

2019-11-06  Christian Biesinger  <cbiesinger@google.com>

* linux-tdep.c (linux_info_proc): Use strtok_r instead of strtok.
* mi/mi-main.c (output_cores): Likewise.
* nat/linux-osdata.c (linux_xfer_osdata_cpus): Likewise.
(linux_xfer_osdata_modules): Likewise.
* remote.c (register_remote_support_xml): Likewise.
* sparc64-tdep.c (adi_is_addr_mapped): Likewise.
* xml-syscall.c (syscall_create_syscall_desc): Likewise.

gdb/gdbserver/ChangeLog:

2019-11-06  Christian Biesinger  <cbiesinger@google.com>

* linux-x86-low.c (x86_linux_process_qsupported): Use strtok_r
instead of strtok.
* server.c (handle_query): Likewise.
(captured_main): Likewise.

Change-Id: Ief6138965a24398e5fc064598cd8f2abd3b5047c

4 years agoRegenerate gnulib files
Christian Biesinger [Wed, 6 Nov 2019 18:24:04 +0000 (12:24 -0600)] 
Regenerate gnulib files

It looks like autoheader and automake weren't run for commit
73cc72729a184f00bf6fc4d74684a8516ba6b683.

Note, it looks like the installed gettext version affects the
generated output here, I used 0.19.8.1 to get no diff.

gnulib/ChangeLog:

2019-11-06  Christian Biesinger  <cbiesinger@google.com>

* config.in: Regenerate.
* import/Makefile.in: Regenerate.

Change-Id: Iadd43023713a77921b0f850184a19afb1517be02

4 years agoRemove some includes of readline.h
Tom Tromey [Sun, 27 Oct 2019 21:50:54 +0000 (15:50 -0600)] 
Remove some includes of readline.h

I went through most of the spots that include readline.h and, when
appropriate, either removed the include or changed it to include
tilde.h.

Note that remote-sim.c and bsd-kvm.c could probably include tilde.h
instead, but I did not change these.  I think I can't build the
latter, and I didn't want to set up a sim build for the former.

Tested by rebuilding.

gdb/ChangeLog
2019-11-06  Tom Tromey  <tom@tromey.com>

* tui/tui-interp.c: Don't include readline.h.
* tui/tui-hooks.c: Don't include readline.h.
* symmisc.c: Include tilde.h, not readline.h.
* symfile.c: Include tilde.h, not readline.h.
* source.c: Include tilde.h, not readline.h.
* solib.c: Include tilde.h, not readline.h.
* psymtab.c: Include tilde.h, not readline.h.
* exec.c: Include tilde.h, not readline.h.
* corelow.c: Include tilde.h, not readline.h.
* cli/cli-dump.c: Include tilde.h, not readline.h.
* cli/cli-cmds.c: Don't include readline.h.

Change-Id: I60487a190c43128b800ef77517d1ab42957571d7

4 years agoFix an off-by-one error in the IN_RANGE macro used by readelf. Add another use of...
Christian Eggers [Wed, 6 Nov 2019 12:29:23 +0000 (12:29 +0000)] 
Fix an off-by-one error in the IN_RANGE macro used by readelf.  Add another use of the macro.

* readelf.c (IN_RANGE): Rename parameter OFF to NELEM. Add
comment.  Catch potential integer overflow and fix off by one
error whilst checking reloc location against section size.
(apply_relocations): Use IN_RANGE macro.

4 years agold: Fix printed sizes in map file
Christian Eggers [Mon, 4 Nov 2019 07:34:54 +0000 (08:34 +0100)] 
ld: Fix printed sizes in map file

For targets with octets_per_byte > 1, testsuite/ld-scripts/rgn-over*
produce wrong sizes in the generated map files:

.text           0x0000000000001000        0x6
                                          ^^^ # correct
 *(.txt)
 .txt           0x0000000000001000        0xc tmpdir/rgn-over.o
                                          ^^^ # should also be 0x6

* ldlang.c (print_input_section): Shift printed size by opb_shift.

4 years agoFix regression from TUI disassembly style patch
Tom Tromey [Wed, 6 Nov 2019 01:12:49 +0000 (18:12 -0700)] 
Fix regression from TUI disassembly style patch

My previous patch to add styling to the TUI disassembly failed to
correctly fix a bug that Simon had pointed out in review.  This patch
fixes the bug.

gdb/ChangeLog
2019-11-05  Tom Tromey  <tom@tromey.com>

* tui/tui-disasm.c (struct tui_asm_line) <addr_size>: New member.
(tui_disassemble): Set addr_size.
(tui_disasm_window::set_contents): Use addr_size.

Change-Id: Ic0152f3b82a2f79be28ae46d590096661f271580

4 years agoAutomatic date update in version.in
GDB Administrator [Wed, 6 Nov 2019 00:00:41 +0000 (00:00 +0000)] 
Automatic date update in version.in

4 years agoRemove la_get_string member
Tom Tromey [Thu, 3 Oct 2019 22:59:17 +0000 (16:59 -0600)] 
Remove la_get_string member

The la_get_string member of struct language_defn was intended to
provide a way to fetch string data from a "string" object in a
language-dependent way.  However, it turned out that this was never
needed, and was only ever implemented for C.  This patch removes the
language hook entirely.

gdb/ChangeLog
2019-11-05  Tom Tromey  <tom@tromey.com>

* rust-lang.c (rust_language_defn): Update.
* python/py-value.c (valpy_string): Call c_get_string.
* p-lang.c (pascal_language_defn): Update.
* opencl-lang.c (opencl_language_defn): Update.
* objc-lang.c (objc_language_defn): Update.
* m2-lang.c (m2_language_defn): Update.
* language.c (unknown_language_defn, auto_language_defn): Update.
(default_get_string): Remove.
* guile/scm-value.c (gdbscm_value_to_string): Use c_get_string.
* go-lang.c (go_language_defn): Update.
* f-lang.c (f_language_defn): Update.
* d-lang.c (d_language_defn): Update.
* c-lang.c (c_language_defn, cplus_language_defn)
(asm_language_defn, minimal_language_defn): Update.
* ada-lang.c (ada_language_defn): Update.
* language.h (struct language_defn) <la_get_string>: Remove.
(LA_GET_STRING): Remove.
(default_get_string): Don't declare.

Change-Id: Ia97763dfe34dc8ecb46587f7a651f8af9be8fdbd

4 years agoStyle disassembly in the TUI
Tom Tromey [Mon, 21 Oct 2019 17:21:14 +0000 (11:21 -0600)] 
Style disassembly in the TUI

This patch changes the TUI disassembly window to style its contents.
The styling should be identical to what is seen in the CLI.  This
involved a bit of rearrangement, so that the source and disassembly
windows could share both the copy_source_line utility function, and
the ability to react to changes in "set style enabled".

This version introduces a new function to strip the styling from the
address string when computing the length.  As a byproduct, it also
removes the unused "insn_size" computation from
tui_disasm_window::set_contents.

gdb/ChangeLog
2019-11-05  Tom Tromey  <tom@tromey.com>

* tui/tui-source.h (struct tui_source_window): Inline
constructor.  Remove destructor.
<style_changed, m_observable>: Move to superclass.
* tui/tui-winsource.h (tui_copy_source_line): Declare.
(struct tui_source_window_base): Move private members to end.
<style_changed, m_observable>: Move from tui_source_window.
* tui/tui-winsource.c (tui_copy_source_line): Move from
tui-source.c.  Rename from copy_source_line.  Add special handling
for negative line number.
(tui_source_window_base::style_changed): Move from
tui_source_window.
(tui_source_window_base): Register observer.
(~tui_source_window_base): New.
* tui/tui-source.c (copy_source_line): Move to tui-winsource.c;
rename.
(tui_source_window::set_contents): Use tui_copy_source_line.
(tui_source_window::tui_source_window): Move to tui-source.h.
(tui_source_window::~tui_source_window): Remove.
(tui_source_window::style_changed): Move to superclass.
* tui/tui-disasm.c (tui_disassemble): Create string file with
styling, when possible.  Add "addr_size" parameter.
(tui_disasm_window::set_contents): Use tui_copy_source_line.
Don't compute maximum size.
(len_without_escapes): New function

Change-Id: I8722635eeecbbb1633d943a65b856404c2d467b0

4 years agoChange tui_source_element::line to have type std::string
Tom Tromey [Mon, 21 Oct 2019 16:58:08 +0000 (10:58 -0600)] 
Change tui_source_element::line to have type std::string

This changes tui_source_element::line to be of type std::string.  This
reduces the number of copies made.

gdb/ChangeLog
2019-11-05  Tom Tromey  <tom@tromey.com>

* tui/tui-winsource.h (struct tui_source_element) <line>: Now a
std::string.
* tui/tui-winsource.c (tui_show_source_line): Update.
* tui/tui-source.c (tui_source_window::set_contents): Update.
* tui/tui-disasm.c (tui_disasm_window::set_contents): Update.

Change-Id: Id600f3e1d386a2911f187366e05e2ec599068dd2

4 years agoFix ARI warning in symtab.h
Christian Biesinger [Tue, 5 Nov 2019 20:52:59 +0000 (14:52 -0600)] 
Fix ARI warning in symtab.h

gdb/ChangeLog:

2019-11-05  Christian Biesinger  <cbiesinger@google.com>

* symtab.h (gdb_static_assert): Put && operator at the beginning
of the line instead of the end.

Change-Id: I6d05c2f5e46c3f317ba97458509b2da9fd03464b

4 years agoFix memory allocation and release problems in the bfd documentation processor.
Tim R?hsen [Tue, 5 Nov 2019 16:03:07 +0000 (16:03 +0000)] 
Fix memory allocation and release problems in the bfd documentation processor.

* doc/chew.c (add_to_definition): Use correct type when
calculating size of array reallocation.
(nextword): Always initialise the word return parameter.
(compile): Check return value of nextword().

4 years agox86: fold OP_Mwaitx() into OP_Mwait()
Jan Beulich [Tue, 5 Nov 2019 08:19:50 +0000 (09:19 +0100)] 
x86: fold OP_Mwaitx() into OP_Mwait()

There's no need to have separate functions, the difference can easily be
expressed using the function arguments.

4 years agox86: split MONITORX/MWAITX entries
Jan Beulich [Tue, 5 Nov 2019 08:19:10 +0000 (09:19 +0100)] 
x86: split MONITORX/MWAITX entries

Both encodings do not ignore the 66/F3/F2 prefixes, so don't have the
disassembler ignore them either.