Commit Graph

97792 Commits

Author SHA1 Message Date
Andrew Burgess 122cf0f2d9 gdb: Add constructor to struct cu_partial_die_info
Adds a constructor to 'struct cu_partial_die_info' and disables the
default constructor, preventing partially initialised instances from
being created.

Update 'find_partial_die' to return a const struct.

Users of 'find_partial_die' are updated to take account of the above
two changes.

There should be no user visible changes after this commit.

gdb/ChangeLog:

	* dwarf2read.c (struct cu_partial_die_info): Add constructor,
	delete default constructor.
	(find_partial_die): Update to return const struct.
	(partial_die_parent_scope): Move variable declaration into scope
	of its use and change its type to auto.
	(guess_partial_die_structure_name): Likewise.
	(partial_die_info::fixup): Likewise.
2019-05-18 09:46:29 +01:00
John Darrington 3e2cf42fe5 S12Z (doc): Minor improvements to text and formatting.
gas/
	* doc/c-s12z.texi: Miscellaneous adjustments.
2019-05-18 08:35:18 +02:00
GDB Administrator 1c8ce0ebbe Automatic date update in version.in 2019-05-18 00:00:20 +00:00
Tom Tromey 33d0e35aed Don't cast away const in find_and_open_source
find_and_open_source casts away const, but hasn't needed to in a
while.  This removes the cast and a strangely hostile comment.

gdb/ChangeLog
2019-05-17  Tom Tromey  <tromey@adacore.com>

	* source.c (find_and_open_source): Remove cast.
2019-05-17 10:16:40 -06:00
Tom Tromey a45575b035 Constify annotate_source
I noticed that annotate_source takes a "char *", but really should
take a "const char *".  This patch fixes this.

gdb/ChangeLog
2019-05-17  Tom Tromey  <tromey@adacore.com>

	* annotate.c (annotate_source): Make "filename" const.
	* annotate.h (annotate_source): Use const.
2019-05-17 10:16:40 -06:00
Alan Hayward 87781e8475 testsuite: Remove TRANSCRIPT support
TRANSCRIPT is superseeded by the .in, .cmd and .debug files, and
can be removed.

gdb/testsuite/ChangeLog

	* README (Running the Testsuite): Change example.
	(Testsuite Parameters): Remove TRANSCRIPT.
	* lib/gdb.exp: Remove TRANSCRIPT check.
2019-05-17 16:48:36 +01:00
Alan Hayward b420b89e4b testsuite: Add replay logging to GDBSERVER_DEBUG
Add "replay" to the list of GDBSERVER_DEBUG options.  This will
cause a gdbserver.replay file to be written to the test output
directory.

At the same time switch this to a comma separated list in order
to easily handle all possible options.

The replay log is created by GDB, but has been added to
GDBSERVER_DEBUG as it is only required for gdbserver tests. To
enable it, the gdb_debug_init is overridden to allow the additional
checking, before calling the original function.

gdb/testsuite/ChangeLog:

        * README (Testsuite Parameters): Add replay logging to
        GDBSERVER_DEBUG.
        (gdbserver,debug): Refer to GDBSERVER_DEBUG.
        * lib/gdbserver-support.exp (gdbserver_start): Treat gdbserverdebug
        as a comma separated list.
        (gdb_debug_init): Override procedure.
2019-05-17 16:44:17 +01:00
Alan Hayward 408e9b8b9e testsuite: Create .cmd files for gdb and gdbserver
When spawning gdb or gdbserver create a .cmd file in the test output
directory containing the full command line, ensuring the current gdb
instance is appended to the files so that they can be quickly matched
to the corresponding gdb.in file.

gdb/testsuite/ChangeLog:

	* lib/gdb.exp (default_gdb_spawn): Call gdb_write_cmd_file.
	(gdb_write_cmd_file): New procedure.
	* lib/gdbserver-support.exp (gdbserver_start): Call
	gdbserver_write_cmd_file.
	(gdbserver_write_cmd_file): New proedure.
2019-05-17 16:38:02 +01:00
Alan Hayward f9e2e39d23 testsuite: Record all gdb input to gdb.in
When debugging testsuite failures, it can be awkward parsing gdb.log to
obtain all the commands run in order to manually re-run the test.

This patch adds the functionality to save all gdb commands to the file gdb.in
when the testsuite is run. The file is saved in the directory for the test and
if gdb is restarted then .1, .2, .3 etc is added to the filename.

Once a test has been run, the .in file can be used to re-run the test in the
following way:

  gdb -x outputs/gdb.store/gdb.in outputs/gdb.store/store

The code works by intercepting send_gdb.  I've added a TYPE to ensure that any
commands that would destroy the playback are kept from the log (for example the
Y from an answer to a y/n question).

Adds library function standard_output_file_with_gdb_instance to open a file
postfixed with count of the gdb instance.  Ensure this count is reset when a new
.exp script is run.

I've re-run a random selection of .in files to check they do not error. Logs with
commands such as "attach <pid>" will not directly work when re-run.

gdb/testsuite/ChangeLog:

	* lib/gdb.exp (gdb_unload): Mark Y as an answer.
	(delete_breakpoints): Likewise.
	(gdb_run_cmd): Likewise.
	(gdb_start_cmd): Likewise.
	(gdb_starti_cmd): Likewise.
	(gdb_internal_error_resync): Likewise.
	(gdb_test_multiple): Likewise.
	(gdb_reinitialize_dir): Likewise.
	(default_gdb_exit): Likewise.
	(gdb_file_cmd): Mark kill as optional.
	(default_gdb_start): Call gdb_stdin_log_init.
	(send_gdb): Call gdb_stdin_log_write.
	(rerun_to_main): Mark Y as an answer.
	(gdb_stdin_log_init): New function.
	(gdb_stdin_log_write): Likewise.
2019-05-17 16:34:01 +01:00
Alan Hayward 81f47ac29f testsuite: Disable some tests when logging
Fix up all failures encountered when running the testsuite with
GDB_DEBUG="infrun".

Some tests rely on enabling debugging for various components.  With
debugging on, this will be lost to the debug file.

Disable separate tty for mi tests when debugging.  This currently
does not work.

disasm.c should send errors to the stderr instead of the logfile.

Note that enabling debug for other components might still cause
additional errors above what has been fixed here.

gdb/ChangeLog:

	* disasm.c (set_disassembler_options): Send errors to stderr.

gdb/testsuite/ChangeLog:

	* gdb.base/breakpoint-in-ro-region.exp: Disable when debugging.
	* gdb.base/debug-expr.exp: Likewise.
	* gdb.base/foll-fork.exp: Likewise.
	* gdb.base/foll-vfork.exp: Likewise.
	* gdb.base/fork-print-inferior-events.exp: Likewise.
	* gdb.base/gdb-sigterm.exp: Likewise.
	* gdb.base/gdbinit-history.exp: Likewise.
	* gdb.base/osabi.exp: Likewise.
	* gdb.base/sss-bp-on-user-bp-2.exp: Likewise.
	* gdb.base/ui-redirect.exp: Likewise.
	* gdb.gdb/unittest.exp: Likewise.
	* gdb.mi/mi-break.exp: Disable separate-mi-tty when debugging.
	* gdb.mi/mi-watch.exp: Likewise.
	* gdb.mi/new-ui-mi-sync.exp: Likewise.
	* gdb.mi/user-selected-context-sync.exp: Likewise.
	* gdb.python/python.exp: Disable debug test when debugging.
	* gdb.threads/check-libthread-db.exp: Disable when debugging.
	* gdb.threads/signal-while-stepping-over-bp-other-thread.exp:
	Likewise.
	* gdb.threads/stepi-random-signal.exp: Likewise.
2019-05-17 15:35:08 +01:00
Alan Hayward 29b523140e testsuite: Add option to capture GDB debug
Add both board option and environment variable which enables gdb
debug via a comma separated list and sends it to the file gdb.debug,
located in the output directory for the current test.  Document this.

Add support for the environment variable in the Makefile.

The testsuite can be run with gdb debug enabled in the following way:

	make check GDB_DEBUG="infrun,target,remote"

A Test with multiple invocations of GDB will all append debug to the
same log file.

gdb/testsuite/ChangeLog:

	* Makefile.in: Pass through GDB_DEBUG.
	* README (Testsuite Parameters): Add GDB_DEBUG.
        (gdb,debug): Add board setting.
 	* lib/gdb.exp (default_gdb_start): Start debugging.
 	(gdb_debug_enabled): New procedure.
 	(gdb_debug_init): Likewise.
2019-05-17 14:35:55 +01:00
Alan Hayward ca1285d175 Add debug redirect option
Currently, when logging is enabled, output will be sent to both a
logfile and standard terminal output.  The redirect option sends output
only to the logfile.  This includes all debug output.

Add the option to redirect debug output seperately to normal
output, using the cli command:

  set logging debugredirect on

By setting this and enabling logging, all output and debug will
be sent to the logfile.  The user will still see all output but
no debug output.

This causes a change in behaviour for anyone currently using
logging redirect, as now only output will be redirected.  Users
will have to issue the additional command above to also redirect
debug.

Expand ui-redirect.exp cover the changes.

gdb/ChangeLog:

	* cli/cli-interp.c (struct saved_output_files): Add saved entry.
	(cli_interp_base::set_logging): Check debug_redirect.
	* cli/cli-interp.h (set_logging): Add debug_redirect parameter.
	* cli/cli-logging.c (debug_redirect): Add static variable.
	(pop_output_files): Add default param.
	(handle_redirections): Print debug setting.
	(show_logging_command): Likewise.
	(_initialize_cli_logging): Add debugredirect command.
	* interps.c (current_interp_set_logging): Add debug_redirect
	parameter.
	* interps.h (set_logging): Add debug_redirect parameter.
	(current_interp_set_logging): Likewise.
	* mi/mi-common.h: Likewise.
	* mi/mi-interp.c (mi_interp::set_logging): Likewise.

gdb/testsuite/ChangeLog:

	* gdb.base/ui-redirect.exp: Add debug redirect tests.
2019-05-17 14:21:47 +01:00
John Darrington 334fe02b5f GAS (documentation): Remove trademark acknowledgements.
GNU policy is not to include trademark acknowlegements in
documentation [1]

[1] https://www.gnu.org/prep/standards/html_node/Trademarks.html

Committing as obvious.

gas/

* doc/c-arm.texi (ARM Options): Remove "(r)" and "(tm)"
* doc/c-bfin.texi (Blackfin Syntax): Remove "(r)"
2019-05-17 15:18:08 +02:00
Alan Hayward f3a09c800f Change file close behavior for tee_file
Instead of using two bools to decide if the files should close when tee_file
is closed, make file one stay open and file two close.  This simplifies the
use cases for it.

Inline the make_logging_output into the calling functions (the logic here
looks ugly in order to simplify a later change).

Expand ui-redirect.exp to cover the changes, similar to mi-logging.exp.

gdb/ChangeLog:

	* cli/cli-interp.c (cli_interp_base::set_logging): Create tee_file
	directly.
	* cli/cli-interp.h (make_logging_output): Remove declaration.
	* cli/cli-logging.c (make_logging_output): Remove function.
	* mi/mi-interp.c (mi_interp::set_logging): Create tee_file
	directly.
	* ui-file.c (tee_file::tee_file): Remove bools.
	(tee_file::~tee_file): Remove deletes.
	* ui-file.h (tee_file): Remove bools.

gdb/testsuite/ChangeLog:

	* gdb.base/ui-redirect.exp: Test redirection.
2019-05-17 14:07:04 +01:00
Alan Modra af4fa23fba PR24567, assertion failure in ldlang.c:6868 when compiling with -flto
As the existing comment said: "a common ought to be overridden by a
def in a -flto object".  This patch makes the code actually do that,
rather than allowing a normal object file common to override a -flto
defined symbol.

	PR 24567
	* plugin.c (plugin_notice): Do not let a common symbol override
	a non-common definition in IR.
2019-05-17 21:06:07 +09:30
Jan Vrany 2664858829 MI: Add new command -complete
There is a CLI command 'complete' intended to use with emacs. Such a command
would also be useful for MI frontends, when separate CLI and MI channels cannot
be used. For example, on Windows (because of lack of PTYs) or when GDB is used
through SSH session.

This commit adds a new '-complete' MI command.

gdb/Changelog:
2019-01-28  Jan Vrany  <jan.vrany@fit.cvut.cz>

	* mi/mi-cmds.h (mi_cmd_complete): New function.
	* mi/mi-main.c (mi_cmd_complete): Likewise.
	* mi/mi-cmds.c: Define new MI command -complete.
	* NEWS: Mention new -complete command.

gdb/doc/ChangeLog:
2019-01-28  Jan Vrany  <jan.vrany@fit.cvut.cz>

	* gdb.texinfo (Miscellaneous GDB/MI Commands): Document new
	MI command -complete.

gdb/testsuite/ChangeLog:
2019-01-28  Jan Vrany  <jan.vrany@fit.cvut.cz>

	* gdb.mi/mi-complete.exp: New file.
	* gdb.mi/mi-complete.cc: Likewise.
2019-05-17 10:58:23 +01:00
Jan Vrany 6e035501e1 MI: extract command completion logic from complete_command()
Extract completion logic from CLI complete_command() into a new
helper function complete().

gdb/Changelog:

	* completer.h (complete): New function.
	* completer.c (complete): Likewise.
	* cli/cli-cmds.c: (complete_command): Update to use new complete()
	function defined in completer.h.
2019-05-17 10:58:23 +01:00
Jan Vrany 7d0e2ecede Add myself to gdb/MAINTAINERS
gdb/Changelog:

       * MAINTAINERS (Write After Approval): Add myself.
2019-05-17 10:48:12 +01:00
Tom de Vries fb816e8b1c [gdb] Fix heap-use-after-free in typename_concat
When running gdb using AddressSanitizer, and loading a cc1plus binary built
with profiledbootstrap and -flto, we run into a heap-use-after-free error:
...
$ LD_PRELOAD=/usr/lib64/libasan.so.3 ./gdb -batch cc1plus
==26855==ERROR: AddressSanitizer: heap-use-after-free on address \
  0x62100ad8a8b0 at pc 0x7f13803cc9e3 bp 0x7ffe55b0d090 sp 0x7ffe55b0c840
READ of size 47 at 0x62100ad8a8b0 thread T0
    #0 0x7f13803cc9e2  (/usr/lib64/libasan.so.3+0x3e9e2)
    #1 0x5e7a0d in typename_concat gdb/dwarf2read.c:22661
    #2 0x5c6437 in partial_die_full_name gdb/dwarf2read.c:8876
    #3 0x5c6555 in add_partial_symbol gdb/dwarf2read.c:8893
    #4 0x5c6ecf in add_partial_subprogram gdb/dwarf2read.c:9156
    #5 0x5c5e90 in scan_partial_symbols gdb/dwarf2read.c:8668
    #6 0x5c6c0a in add_partial_namespace gdb/dwarf2read.c:9081
    #7 0x5c5f99 in scan_partial_symbols gdb/dwarf2read.c:8702
    #8 0x5c48b6 in process_psymtab_comp_unit_reader gdb/dwarf2read.c:8056
    #9 0x5c3c1f in init_cutu_and_read_dies gdb/dwarf2read.c:7689
    #10 0x5c4c03 in process_psymtab_comp_unit gdb/dwarf2read.c:8140
    #11 0x5c58a2 in dwarf2_build_psymtabs_hard gdb/dwarf2read.c:8500
    #12 0x5c0d03 in dwarf2_build_psymtabs(objfile*) gdb/dwarf2read.c:6337
    #13 0x612359 in read_psyms gdb/elfread.c:1311
    #14 0x798a64 in require_partial_symbols(objfile*, int) gdb/psymtab.c:115
    #15 0x867d7b in read_symbols gdb/symfile.c:821
    #16 0x8683d9 in syms_from_objfile_1 gdb/symfile.c:1000
    #17 0x8684a1 in syms_from_objfile gdb/symfile.c:1017
    #18 0x868873 in symbol_file_add_with_addrs gdb/symfile.c:1124
    #19 0x868b0a in symbol_file_add_from_bfd(bfd*, char const*, \
                    enum_flags<symfile_add_flag>, std::vector<other_sections, \
		    std::allocator<other_sections> >*, \
		    enum_flags<objfile_flag>, objfile*) gdb/symfile.c:1204
    #20 0x868b64 in symbol_file_add(char const*, \
                    enum_flags<symfile_add_flag>, \
		    std::vector<other_sections, \
		    std::allocator<other_sections> >*, \
		    enum_flags<objfile_flag>) gdb/symfile.c:1217
    #21 0x868c39 in symbol_file_add_main_1 gdb/symfile.c:1240
    #22 0x868bd0 in symbol_file_add_main(char const*, \
                    enum_flags<symfile_add_flag>) gdb/symfile.c:1231
    #23 0x71f1b2 in symbol_file_add_main_adapter gdb/main.c:395
    #24 0x71f10e in catch_command_errors gdb/main.c:372
    #25 0x71ff5f in captured_main_1 gdb/main.c:1043
    #26 0x72045d in captured_main gdb/main.c:1163
    #27 0x7204c8 in gdb_main(captured_main_args*) gdb/main.c:1188
    #28 0x40fd7d in main gdb/gdb.c:32
    #29 0x7f137e300f49 in __libc_start_main (/lib64/libc.so.6+0x20f49)
    #30 0x40fc89 in _start (/data/gdb_versions/devel/build/gdb/gdb+0x40fc89)

0x62100ad8a8b0 is located 944 bytes inside of 4064-byte region \
  [0x62100ad8a500,0x62100ad8b4e0)
freed by thread T0 here:
    #0 0x7f13804523a0 in __interceptor_free (/usr/lib64/libasan.so.3+0xc43a0)
    #1 0x435e44 in xfree<void> gdb/common/common-utils.h:60
    #2 0xa82c25 in call_freefun libiberty/obstack.c:103
    #3 0xa83098 in _obstack_free libiberty/obstack.c:280
    #4 0x4367da in auto_obstack::~auto_obstack() gdb/gdb_obstack.h:101
    #5 0x5ed72c in dwarf2_cu::~dwarf2_cu() gdb/dwarf2read.c:25341
    #6 0x5fb5bb in std::default_delete<dwarf2_cu>::operator()(dwarf2_cu*) const \
                   /usr/include/c++/7/bits/unique_ptr.h:78
    #7 0x5f7334 in std::unique_ptr<dwarf2_cu, \
                   std::default_delete<dwarf2_cu> >::~unique_ptr() \
		   /usr/include/c++/7/bits/unique_ptr.h:268
    #8 0x5c3ce5 in init_cutu_and_read_dies gdb/dwarf2read.c:7624
    #9 0x5c4c03 in process_psymtab_comp_unit gdb/dwarf2read.c:8140
    #10 0x5c58a2 in dwarf2_build_psymtabs_hard gdb/dwarf2read.c:8500
    #11 0x5c0d03 in dwarf2_build_psymtabs(objfile*) gdb/dwarf2read.c:6337
    #12 0x612359 in read_psyms gdb/elfread.c:1311
    #13 0x798a64 in require_partial_symbols(objfile*, int) gdb/psymtab.c:115
    #14 0x867d7b in read_symbols gdb/symfile.c:821
    #15 0x8683d9 in syms_from_objfile_1 gdb/symfile.c:1000
    #16 0x8684a1 in syms_from_objfile gdb/symfile.c:1017
    #17 0x868873 in symbol_file_add_with_addrs gdb/symfile.c:1124
    #18 0x868b0a in symbol_file_add_from_bfd(bfd*, char const*, \
                    enum_flags<symfile_add_flag>, std::vector<other_sections,  \
		    std::allocator<other_sections> >*, \
		    enum_flags<objfile_flag>, objfile*) gdb/symfile.c:1204
    #19 0x868b64 in symbol_file_add(char const*, \
                    enum_flags<symfile_add_flag>, std::vector<other_sections, \
		    std::allocator<other_sections> >*, \
		    enum_flags<objfile_flag>) gdb/symfile.c:1217
    #20 0x868c39 in symbol_file_add_main_1 gdb/symfile.c:1240
    #21 0x868bd0 in symbol_file_add_main(char const*, \
                    enum_flags<symfile_add_flag>) gdb/symfile.c:1231
    #22 0x71f1b2 in symbol_file_add_main_adapter gdb/main.c:395
    #23 0x71f10e in catch_command_errors gdb/main.c:372
    #24 0x71ff5f in captured_main_1 gdb/main.c:1043
    #25 0x72045d in captured_main gdb/main.c:1163
    #26 0x7204c8 in gdb_main(captured_main_args*) gdb/main.c:1188
    #27 0x40fd7d in main gdb/gdb.c:32
    #28 0x7f137e300f49 in __libc_start_main (/lib64/libc.so.6+0x20f49)

previously allocated by thread T0 here:
    #0 0x7f13804526b8 in __interceptor_malloc (/usr/lib64/libasan.so.3+0xc46b8)
    #1 0x5114b5 in xmalloc gdb/common/common-utils.c:44
    #2 0xa82bd5 in call_chunkfun libiberty/obstack.c:94
    #3 0xa82eda in _obstack_newchunk libiberty/obstack.c:206
    #4 0x477310 in allocate_on_obstack::operator new(unsigned long, obstack*) \
                   gdb/gdb_obstack.h:117
    #5 0x5dea8c in load_partial_dies gdb/dwarf2read.c:18571
    #6 0x5c487f in process_psymtab_comp_unit_reader gdb/dwarf2read.c:8054
    #7 0x5c3c1f in init_cutu_and_read_dies gdb/dwarf2read.c:7689
    #8 0x5c4c03 in process_psymtab_comp_unit gdb/dwarf2read.c:8140
    #9 0x5c58a2 in dwarf2_build_psymtabs_hard gdb/dwarf2read.c:8500
    #10 0x5c0d03 in dwarf2_build_psymtabs(objfile*) gdb/dwarf2read.c:6337
    #11 0x612359 in read_psyms gdb/elfread.c:1311
    #12 0x798a64 in require_partial_symbols(objfile*, int) gdb/psymtab.c:115
    #13 0x867d7b in read_symbols gdb/symfile.c:821
    #14 0x8683d9 in syms_from_objfile_1 gdb/symfile.c:1000
    #15 0x8684a1 in syms_from_objfile gdb/symfile.c:1017
    #16 0x868873 in symbol_file_add_with_addrs gdb/symfile.c:1124
    #17 0x868b0a in symbol_file_add_from_bfd(bfd*, char const*, \
                    enum_flags<symfile_add_flag>, \
		    std::vector<other_sections, \
		    std::allocator<other_sections> >*, \
		    enum_flags<objfile_flag>, objfile*) gdb/symfile.c:1204
    #18 0x868b64 in symbol_file_add(char const*, enum_flags<symfile_add_flag>, \
                    std::vector<other_sections, \
		    std::allocator<other_sections> >*, \
		    enum_flags<objfile_flag>) gdb/symfile.c:1217
    #19 0x868c39 in symbol_file_add_main_1 gdb/symfile.c:1240
    #20 0x868bd0 in symbol_file_add_main(char const*, \
                    enum_flags<symfile_add_flag>) gdb/symfile.c:1231
    #21 0x71f1b2 in symbol_file_add_main_adapter gdb/main.c:395
    #22 0x71f10e in catch_command_errors gdb/main.c:372
    #23 0x71ff5f in captured_main_1 gdb/main.c:1043
    #24 0x72045d in captured_main gdb/main.c:1163
    #25 0x7204c8 in gdb_main(captured_main_args*) gdb/main.c:1188
    #26 0x40fd7d in main gdb/gdb.c:32
    #27 0x7f137e300f49 in __libc_start_main (/lib64/libc.so.6+0x20f49)
...

This error happens as follows.

The function find_partial_die has a cu argument, but returns a pdi which may
or may not be from that cu:
...
/* Find a partial DIE at OFFSET, which may or may not be in CU,
   except in the case of .debug_types DIEs which do not reference
   outside their CU (they do however referencing other types via
   DW_FORM_ref_sig8).  */

static struct partial_die_info *
find_partial_die (sect_offset sect_off, int offset_in_dwz, struct dwarf2_cu *cu)
...

So the pdi returned by find_partial_die here in partial_die_parent_scope may
be from another cu:
...
partial_die_parent_scope (struct partial_die_info *pdi,
                          struct dwarf2_cu *cu)
{
  const char *grandparent_scope;
  struct partial_die_info *parent, *real_pdi;

  /* We need to look at our parent DIE; if we have a DW_AT_specification,
     then this means the parent of the specification DIE.  */

  real_pdi = pdi;
  while (real_pdi->has_specification)
    real_pdi = find_partial_die (real_pdi->spec_offset,
                                 real_pdi->spec_is_dwz, cu);

  parent = real_pdi->die_parent;
...
in which case both real_pdi and parent will be not from cu, but from another
one, say cu2.

Subsequently, cu's comp_unit_obstack is used to set parent->scope:
...
        parent->scope = typename_concat (&cu->comp_unit_obstack,
                                         grandparent_scope,
                                         parent->name, 0, cu);
...

So, we use cu->comp_unit_obstack to assign a value to the scope field of
a pdi belonging to cu2, and when cu is deleted, the scope field points to a
freed value.

Fix this by making find_partial_die return the cu corresponding to the
returned pdi, and handling this at the call sites.

Tested on x86_64-linux.

gdb/ChangeLog:

2019-05-17  Tom de Vries  <tdevries@suse.de>

	PR gdb/24094
	* dwarf2read.c (struct cu_partial_die_info): New struct.
	(find_partial_die): Return cu_partial_die_info.
	(partial_die_parent_scope, guess_partial_die_structure_name)
	(partial_die_info::fixup): Handle new return type of find_partial_die.
2019-05-17 09:35:19 +02:00
GDB Administrator 6275948b47 Automatic date update in version.in 2019-05-17 00:00:14 +00:00
Sergio Durigan Junior 677052f2a5 Make stap-probe.c:stap_parse_register_operand's "regname" an std::string
This patch simplifies the code of
stap-probe.c:stap_parse_register_operand by making "regname" an
std::string.  No functionality change.

I'm this code's maintainer, so I'm pushing this as it's a fairly
trivial patch.

gdb/ChangeLog:
2019-05-16  Sergio Durigan Junior  <sergiodj@redhat.com>

	* stap-probe.c (stap_parse_register_operand): Make "regname" an
	"std::string", simplifying the algorithm.
2019-05-16 16:26:30 -04:00
Sergio Durigan Junior f3da911665 Fix complaint string formatting on stap-probe.c
I think the string formatting for complaints was messed up by Tom's
patch to simplify the complaint mechanism.  This small and trivial
patch fixes them.

Pushed as obvious.

gdb/ChangeLog:
2019-05-16  Sergio Durigan Junior  <sergiodj@redhat.com>

	* stap-probe.c (handle_stap_probe): Fix complaint formatting.
	(stap_static_probe_ops::get_probes): Likewise.
2019-05-16 16:26:29 -04:00
Sergio Durigan Junior f1bb75ab2a Slightly improve logic of some operations on stap-probe.c
This patch contains three very small improvement on the logic of some
operations we do on stap-probe.c.  They don't change what the code
does.

Pushed as obvious.

gdb/ChangeLog:
2019-05-16  Sergio Durigan Junior  <sergiodj@redhat.com>

	* stap-probe.c (stap_parse_register_operand): Make "if (*p->arg ==
	'-')" and "else if".
	(stap_parse_single_operand): Join checks for
	"gdbarch_stap_parse_special_token_p" and
	"gdbarch_stap_parse_special_token" in the same "if" statement.
	Invert check when verifying for operation on register
	displacement.
2019-05-16 16:26:29 -04:00
Sergio Durigan Junior 3ca58cdea1 Update some comments on stap-probe.c
Some functions's comments were not entirely correct on stap-probe.c,
so this patch updates them.

Pushed as obvious.

gdb/ChangeLog:
2019-05-16  Sergio Durigan Junior  <sergiodj@redhat.com>

	* stap-probe.c (stap_get_opcode): Update comment.
	(stap_get_expected_argument_type): Likewise.
	(handle_stap_probe): Likewise.
2019-05-16 16:26:29 -04:00
Sergio Durigan Junior af2d9beee9 Bool-ify stap-probe.c and stap-related code on i386-tdep.c
This simple patch converts a bunch of "int"s to "bool" on stap-probe.c
and on the stap-related code present on i386-tdep.c.

Pushed as obvious (+ I'm the maintainer of this code).

gdb/ChangeLog:
2019-05-16  Sergio Durigan Junior  <sergiodj@redhat.com>

	* i386-tdep.c (i386_stap_parse_special_token_triplet): Change
	return type to 'bool'.  Adjust comment.  Use 'bool' when
	appropriate.
	(i386_stap_parse_special_token_three_arg_disp): Likewise.
	* stap-probe.c (stap_parse_argument_1): Likewise.
	(stap_is_operator): Likewise.
	(stap_is_generic_prefix): Likewise.
	(stap_is_register_prefix): Likewise.
	(stap_is_register_indirection_prefix): Likewise.
	(stap_is_integer_prefix): Likewise.
	(stap_generic_check_suffix): Likewise.
	(stap_check_integer_suffix): Likewise.
	(stap_check_register_suffix): Likewise.
	(stap_check_register_indirection_suffix): Likewise.
	(stap_parse_register_operand): Likewise.
	(stap_parse_single_operand): Likewise.
	(stap_parse_argument_1): Likewise.
	(stap_probe::get_argument_count): Likewise.
	(stap_is_operator): Likewise.
2019-05-16 16:26:29 -04:00
Tom Tromey 61c9c4212d Fix darwin-nat.c build
John Marshall pointed out that darwin-nat.c fails to build:

    CXX    darwin-nat.o
    ../../../binutils-gdb/gdb/darwin-nat.c:1709:8: error: must use 'class' tag to refer to type 'thread_info' in this scope
    for (thread_info *it : all_threads ())
    /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/include/mach/thread_act.h:240:15: note:
    class 'thread_info' is hidden by a non-type declaration of 'thread_info' here
    kern_return_t thread_info

    Mach has a thread_info() function declared in that header, which darwin-nat.c #includes.

This patch fixes the problem by reintroducing the struct keyword.

gdb/ChangeLog
2019-05-16  Tom Tromey  <tromey@adacore.com>

	* darwin-nat.c (thread_info_from_private_thread_info): Add struct
	keyword to foreach.
2019-05-16 10:46:59 -06:00
Andre Vieira 64c350f2b7 [PATCH, GAS, Arm] Refactor check_simd_pred_availability
gas/ChangeLog:
2019-05-16  Andre Vieira  <andre.simoesdiasvieira@arm.com>

	* config/tc-arm.c (check_simd_pred_availability): Refactor.
	(do_neon_dyadic_i_su): Refactor use of check_simd_pred_availability.
	(do_neon_dyadic_i64_su): Likewise.
	(do_neon_shl): Likewise.
	(do_neon_qshl): Likewise.
	(do_neon_rshl): Likewise.
	(do_neon_logic): Likewise.
	(do_neon_dyadic_if_su): Likewise.
	(do_neon_addsub_if_i): Likewise.
	(do_neon_mac_maybe_scalar): Likewise.
	(do_neon_fmac): Likewise.
	(do_neon_mul): Likewise.
	(do_neon_qdmulh): Likewise.
	(do_neon_qrdmlah): Likewise.
	(do_neon_abs_neg): Likewise.
	(do_neon_sli): Likewise.
	(do_neon_sri): Likewise.
	(do_neon_qshlu_imm): Likewise.
	(do_neon_cvt_1): Likewise.
	(do_neon_cvttb_1): Likewise.
	(do_neon_mvn): Likewise.
	(do_neon_rev): Likewise.
	(do_neon_dup): Likewise.
	(do_neon_mov): Likewise.
	(do_neon_rshift_round_imm): Likewise.
	(do_neon_sat_abs_neg): Likewise.
	(do_neon_cls): Likewise.
	(do_neon_clz): Likewise.
	(do_vmaxnm): Likewise.
	(do_vrint_1): Likewise.
	(do_vcmla): Likewise.
	(do_vcadd): Likewise.
2019-05-16 16:37:35 +01:00
Andre Vieira 514bbb0fd9 [PATCH, binutils, Arm] Add Armv8.1-M Mainline and MVE enablement to NEWS
gas/ChangeLog:
2019-05-16  Andre Vieira  <andre.simoesdiasvieira@arm.com>

	* NEWS: Mention Armv8.1-M Mainline and MVE.

binutils/ChangeLog:
2019-05-16  Andre Vieira  <andre.simoesdiasvieira@arm.com>

	* NEWS: Mention Armv8.1-M Mainline and MVE.
2019-05-16 16:37:35 +01:00
Andre Vieira 4d6ac85451 [PATCH 57/57][Arm][GAS] MVE Tests
gas/ChangeLog:
2019-05-16  Andre Vieira  <andre.simoesdiasvieira@arm.com>

	* testsuite/gas/arm/mve-tailpredloop.d: New test.
	* testsuite/gas/arm/mve-tailpredloop.s: New test.
	* testsuite/gas/arm/mve-vabav.d: New test.
	* testsuite/gas/arm/mve-vabav.s: New test.
	* testsuite/gas/arm/mve-vabd.d: New test.
	* testsuite/gas/arm/mve-vabd.s: New test.
	* testsuite/gas/arm/mve-vabsneg.d: New test.
	* testsuite/gas/arm/mve-vabsneg.s: New test.
	* testsuite/gas/arm/mve-vadc.d: New test.
	* testsuite/gas/arm/mve-vadc.s: New test.
	* testsuite/gas/arm/mve-vaddlv.d: New test.
	* testsuite/gas/arm/mve-vaddlv.s: New test.
	* testsuite/gas/arm/mve-vaddsub.d: New test.
	* testsuite/gas/arm/mve-vaddsub.s: New test.
	* testsuite/gas/arm/mve-vaddv.d: New test.
	* testsuite/gas/arm/mve-vaddv.s: New test.
	* testsuite/gas/arm/mve-vand.d: New test.
	* testsuite/gas/arm/mve-vand.s: New test.
	* testsuite/gas/arm/mve-vbic.d: New test.
	* testsuite/gas/arm/mve-vbic.s: New test.
	* testsuite/gas/arm/mve-vbrsr.d: New test.
	* testsuite/gas/arm/mve-vbrsr.s: New test.
	* testsuite/gas/arm/mve-vcadd.d: New test.
	* testsuite/gas/arm/mve-vcadd.s: New test.
	* testsuite/gas/arm/mve-vcls.d: New test.
	* testsuite/gas/arm/mve-vcls.s: New test.
	* testsuite/gas/arm/mve-vclz.d: New test.
	* testsuite/gas/arm/mve-vclz.s: New test.
	* testsuite/gas/arm/mve-vcmla.d: New test.
	* testsuite/gas/arm/mve-vcmla.s: New test.
	* testsuite/gas/arm/mve-vcmp.d: New test.
	* testsuite/gas/arm/mve-vcmp.s: New test.
	* testsuite/gas/arm/mve-vcmul.d: New test.
	* testsuite/gas/arm/mve-vcmul.s: New test.
	* testsuite/gas/arm/mve-vcvt-1.d: New test.
	* testsuite/gas/arm/mve-vcvt-1.s: New test.
	* testsuite/gas/arm/mve-vcvt-2.d: New test.
	* testsuite/gas/arm/mve-vcvt-2.s: New test.
	* testsuite/gas/arm/mve-vcvt-3.d: New test.
	* testsuite/gas/arm/mve-vcvt-3.s: New test.
	* testsuite/gas/arm/mve-vcvt-4.d: New test.
	* testsuite/gas/arm/mve-vcvt-4.s: New test.
	* testsuite/gas/arm/mve-vddup.d: New test.
	* testsuite/gas/arm/mve-vddup.s: New test.
	* testsuite/gas/arm/mve-vdup.d: New test.
	* testsuite/gas/arm/mve-vdup.s: New test.
	* testsuite/gas/arm/mve-veor.d: New test.
	* testsuite/gas/arm/mve-veor.s: New test.
	* testsuite/gas/arm/mve-vfma-vfms.d: New test.
	* testsuite/gas/arm/mve-vfma-vfms.s: New test.
	* testsuite/gas/arm/mve-vfmas.d: New test.
	* testsuite/gas/arm/mve-vfmas.s: New test.
	* testsuite/gas/arm/mve-vhadd-vhsub-vrhadd.d: New test.
	* testsuite/gas/arm/mve-vhadd-vhsub-vrhadd.s: New test.
	* testsuite/gas/arm/mve-vhcadd.d: New test.
	* testsuite/gas/arm/mve-vhcadd.s: New test.
	* testsuite/gas/arm/mve-vmax-vmin.d: New test.
	* testsuite/gas/arm/mve-vmax-vmin.s: New test.
	* testsuite/gas/arm/mve-vmaxa-vmina.d: New test.
	* testsuite/gas/arm/mve-vmaxa-vmina.s: New test.
	* testsuite/gas/arm/mve-vmaxnm-vminnm.d: New test.
	* testsuite/gas/arm/mve-vmaxnm-vminnm.s: New test.
	* testsuite/gas/arm/mve-vmaxnma-vminnma.s: New test.
	* testsuite/gas/arm/mve-vmaxnmv-vminnmv.d: New test.
	* testsuite/gas/arm/mve-vmaxnmv-vminnmv.s: New test.
	* testsuite/gas/arm/mve-vmaxv-vminv.d: New test.
	* testsuite/gas/arm/mve-vmaxv-vminv.s: New test.
	* testsuite/gas/arm/mve-vmla.d: New test.
	* testsuite/gas/arm/mve-vmla.s: New test.
	* testsuite/gas/arm/mve-vmladav.d: New test.
	* testsuite/gas/arm/mve-vmladav.s: New test.
	* testsuite/gas/arm/mve-vmlaldav.d: New test.
	* testsuite/gas/arm/mve-vmlaldav.s: New test.
	* testsuite/gas/arm/mve-vmlalv.d: New test.
	* testsuite/gas/arm/mve-vmlalv.s: New test.
	* testsuite/gas/arm/mve-vmlas.d: New test.
	* testsuite/gas/arm/mve-vmlas.s: New test.
	* testsuite/gas/arm/mve-vmlav.d: New test.
	* testsuite/gas/arm/mve-vmlav.s: New test.
	* testsuite/gas/arm/mve-vmlsdav.d: New test.
	* testsuite/gas/arm/mve-vmlsdav.s: New test.
	* testsuite/gas/arm/mve-vmlsldav.d: New test.
	* testsuite/gas/arm/mve-vmlsldav.s: New test.
	* testsuite/gas/arm/mve-vmov-1.d: New test.
	* testsuite/gas/arm/mve-vmov-1.s: New test.
	* testsuite/gas/arm/mve-vmov-2.d: New test.
	* testsuite/gas/arm/mve-vmov-2.s: New test.
	* testsuite/gas/arm/mve-vmul.d: New test.
	* testsuite/gas/arm/mve-vmul.s: New test.
	* testsuite/gas/arm/mve-vmulh.d: New test.
	* testsuite/gas/arm/mve-vmulh.s: New test.
	* testsuite/gas/arm/mve-vmullbt.d: New test.
	* testsuite/gas/arm/mve-vmullbt.s: New test.
	* testsuite/gas/arm/mve-vmvn.d: New test.
	* testsuite/gas/arm/mve-vmvn.s: New test.
	* testsuite/gas/arm/mve-vorn.d: New test.
	* testsuite/gas/arm/mve-vorn.s: New test.
	* testsuite/gas/arm/mve-vorr.d: New test.
	* testsuite/gas/arm/mve-vorr.s: New test.
	* testsuite/gas/arm/mve-vpnot.d: New test.
	* testsuite/gas/arm/mve-vpnot.s: New test.
	* testsuite/gas/arm/mve-vpsel.d: New test.
	* testsuite/gas/arm/mve-vpsel.s: New test.
	* testsuite/gas/arm/mve-vpt.d: New test.
	* testsuite/gas/arm/mve-vpt.s: New test.
	* testsuite/gas/arm/mve-vqabsneg.s: New test.
	* testsuite/gas/arm/mve-vqaddsub.d: New test.
	* testsuite/gas/arm/mve-vqaddsub.s: New test.
	* testsuite/gas/arm/mve-vqdmladh.d: New test.
	* testsuite/gas/arm/mve-vqdmladh.s: New test.
	* testsuite/gas/arm/mve-vqdmlah.d: New test.
	* testsuite/gas/arm/mve-vqdmlah.s: New test.
	* testsuite/gas/arm/mve-vqdmlash.d: New test.
	* testsuite/gas/arm/mve-vqdmlash.s: New test.
	* testsuite/gas/arm/mve-vqdmlsdh.d: New test.
	* testsuite/gas/arm/mve-vqdmlsdh.s: New test.
	* testsuite/gas/arm/mve-vqdmulh.d: New test.
	* testsuite/gas/arm/mve-vqdmulh.s: New test.
	* testsuite/gas/arm/mve-vqdmull.d: New test.
	* testsuite/gas/arm/mve-vqdmull.s: New test.
	* testsuite/gas/arm/mve-vqmovn.d: New test.
	* testsuite/gas/arm/mve-vqmovn.s: New test.
	* testsuite/gas/arm/mve-vqrshl.d: New test.
	* testsuite/gas/arm/mve-vqrshl.s: New test.
	* testsuite/gas/arm/mve-vqrshrn.d: New test.
	* testsuite/gas/arm/mve-vqrshrn.s: New test.
	* testsuite/gas/arm/mve-vqshl.d: New test.
	* testsuite/gas/arm/mve-vqshl.s: New test.
	* testsuite/gas/arm/mve-vrev.d: New test.
	* testsuite/gas/arm/mve-vrev.s: New test.
	* testsuite/gas/arm/mve-vrint.d: New test.
	* testsuite/gas/arm/mve-vrint.s: New test.
	* testsuite/gas/arm/mve-vrmlaldavh.d: New test.
	* testsuite/gas/arm/mve-vrmlaldavh.s: New test.
	* testsuite/gas/arm/mve-vrshl.d: New test.
	* testsuite/gas/arm/mve-vrshl.s: New test.
	* testsuite/gas/arm/mve-vsbc.d: New test.
	* testsuite/gas/arm/mve-vsbc.s: New test.
	* testsuite/gas/arm/mve-vshl.d: New test.
	* testsuite/gas/arm/mve-vshl.s: New test.
	* testsuite/gas/arm/mve-vshlc.d: New test.
	* testsuite/gas/arm/mve-vshlc.s: New test.
	* testsuite/gas/arm/mve-vshll.d: New test.
	* testsuite/gas/arm/mve-vshll.s: New test.
	* testsuite/gas/arm/mve-vshr.d: New test.
	* testsuite/gas/arm/mve-vshr.s: New test.
	* testsuite/gas/arm/mve-vshrn.d: New test.
	* testsuite/gas/arm/mve-vshrn.s: New test.
	* testsuite/gas/arm/mve-vsli.d: New test.
	* testsuite/gas/arm/mve-vsli.s: New test.
	* testsuite/gas/arm/mve-vsri.d: New test.
	* testsuite/gas/arm/mve-vsri.s: New test.
	* testsuite/gas/arm/mve-vstld.d: New test.
	* testsuite/gas/arm/mve-vstld.s: New test.
	* testsuite/gas/arm/mve-vstrldr-1.d: New test.
	* testsuite/gas/arm/mve-vstrldr-1.s: New test.
	* testsuite/gas/arm/mve-vstrldr-2.d: New test.
	* testsuite/gas/arm/mve-vstrldr-2.s: New test.
	* testsuite/gas/arm/mve-vstrldr-3.d: New test.
	* testsuite/gas/arm/mve-vstrldr-3.s: New test.
2019-05-16 16:37:35 +01:00
Andre Vieira 14b456f2a0 [PATCH 56/57][Arm][OBJDUMP] Add support for MVE instructions: vpnot, vpsel, vqabs, vqadd, vqsub, vqneg and vrev
opcodes/ChangeLog:
2019-05-16  Andre Vieira  <andre.simoesdiasvieira@arm.com>
	    Michael Collison <michael.collison@arm.com>

	* arm-dis.c (thumb32_opcodes): Add new instructions.
	(enum mve_instructions): Likewise.
	(enum mve_undefined): Add new reasons.
	(is_mve_encoding_conflict): Handle new instructions.
	(is_mve_undefined): Likewise.
	(is_mve_unpredictable): Likewise.
	(print_mve_undefined): Likewise.
	(print_mve_size): Likewise.
2019-05-16 16:37:35 +01:00
Andre Vieira f49bb598d9 [PATCH 55/57][Arm][OBJDUMP] Add support for MVE instructions: vmul, vmulh, vrmulh and vneg
opcodes/ChangeLog:
2019-05-16  Andre Vieira  <andre.simoesdiasvieira@arm.com>
	    Michael Collison <michael.collison@arm.com>

	* arm-dis.c (thumb32_opcodes): Add new instructions.
	(enum mve_instructions): Likewise.
	(is_mve_encoding_conflict): Handle new instructions.
	(is_mve_undefined): Likewise.
	(is_mve_unpredictable): Likewise.
	(print_mve_size): Likewise.
2019-05-16 16:37:35 +01:00
Andre Vieira 56858bea62 [PATCH 54/57][Arm][OBJDUMP] Add support for MVE instructions: vmax(a), vmax(a)v, vmaxnm(a), vmaxnm(a)v, vmin(a), vmin(a)v, vminnm(a), vminnm(a)v and vmla
opcodes/ChangeLog:
2019-05-16  Andre Vieira  <andre.simoesdiasvieira@arm.com>
	    Michael Collison <michael.collison@arm.com>

	* arm-dis.c (thumb32_opcodes): Add new instructions.
	(enum mve_instructions): Likewise.
	(is_mve_encoding_conflict): Likewise.
	(is_mve_unpredictable): Likewise.
	(print_mve_size): Likewise.
2019-05-16 16:37:35 +01:00
Andre Vieira e523f10159 [PATCH 53/57][Arm][OBJDUMP] Add support for MVE instructions: vand, vbrsr, vcls, vclz and vctp
opcodes/ChangeLog:
2019-05-16  Andre Vieira  <andre.simoesdiasvieira@arm.com>
	    Michael Collison <michael.collison@arm.com>

	* arm-dis.c (thumb32_opcodes): Add new instructions.
	(enum mve_instructions): Likewise.
	(is_mve_encoding_conflict): Handle new instructions.
	(is_mve_undefined): Likewise.
	(is_mve_unpredictable): Likewise.
	(print_mve_size): Likewise.
2019-05-16 16:37:35 +01:00
Andre Vieira 66dcaa5d55 [PATCH 52/57][Arm][OBJDUMP] Add support for MVE instructions: vadc, vabav, vabd, vabs, vadd, vsbc and vsub
opcodes/ChangeLog:
2019-05-16  Andre Vieira  <andre.simoesdiasvieira@arm.com>
	    Michael Collison <michael.collison@arm.com>

	* arm-dis.c (thumb32_opcodes): Add new instructions.
	(enum mve_instructions): Likewise.
	(is_mve_encoding_conflict): Handle new instructions.
	(is_mve_undefined): Likewise.
	(is_mve_unpredictable): Likewise.
	(print_mve_size): Likewise.
	(print_insn_mve): Likewise.
2019-05-16 16:37:35 +01:00
Andre Vieira d052b9b7cb [PATCH 51/57][Arm][OBJDUMP] Add support for MVE instructions: lctp, letp, wlstp and dlstp
opcodes/ChangeLog:
2019-05-16  Andre Vieira  <andre.simoesdiasvieira@arm.com>
	    Michael Collison <michael.collison@arm.com>

	* arm-dis.c (thumb32_opcodes): Add new instructions.
	(print_insn_thumb32): Handle new instructions.
2019-05-16 16:37:35 +01:00
Andre Vieira ed63aa178c [PATCH 50/57][Arm][OBJDUMP] Add support for MVE shift instructions
opcodes/ChangeLog:
2019-05-16  Andre Vieira  <andre.simoesdiasvieira@arm.com>
	    Michael Collison <michael.collison@arm.com>

	* arm-dis.c (enum mve_instructions): Add new instructions.
	(enum mve_undefined): Add new reasons.
	(is_mve_encoding_conflict): Handle new instructions.
	(is_mve_undefined): Likewise.
	(is_mve_unpredictable): Likewise.
	(print_mve_undefined): Likewise.
	(print_mve_size): Likewise.
	(print_mve_shift_n): Likewise.
	(print_insn_mve): Likewise.
2019-05-16 16:37:35 +01:00
Andre Vieira 897b9bbcff [PATCH 49/57][Arm][OBJDUMP] Add support for MVE complex number instructions
opcodes/ChangeLog:
2019-05-16  Andre Vieira  <andre.simoesdiasvieira@arm.com>
	    Michael Collison <michael.collison@arm.com>

	* arm-dis.c (enum mve_instructions): Add new instructions.
	(is_mve_encoding_conflict): Handle new instructions.
	(is_mve_unpredictable): Likewise.
	(print_mve_rotate): Likewise.
	(print_mve_size): Likewise.
	(print_insn_mve): Likewise.
2019-05-16 16:37:35 +01:00
Andre Vieira 1c8f2df85f [PATCH 48/57][Arm][OBJDUMP] Add support for MVE instructions: vddup, vdwdup, vidup and viwdup
opcodes/ChangeLog:
2019-05-16  Andre Vieira  <andre.simoesdiasvieira@arm.com>
	    Michael Collison <michael.collison@arm.com>

	* arm-dis.c (enum mve_instructions): Add new instructions.
	(is_mve_encoding_conflict): Handle new instructions.
	(is_mve_unpredictable): Likewise.
	(print_mve_size): Likewise.
	(print_insn_mve): Likewise.
2019-05-16 16:37:35 +01:00
Andre Vieira d3b6314397 [PATCH 47/57][Arm][OBJDUMP] Add support for MVE instructions: vaddv, vmlaldav, vmladav, vmlas, vrmlsldavh, vmlsldav, vmlsdav, vrmlaldavh, vqdmlah, vqrdmlash, vqrdmlash, vqdmlsdh, vqrdmlsdh, vqdmulh and vqrdmulh
opcodes/ChangeLog:
2019-05-16  Andre Vieira  <andre.simoesdiasvieira@arm.com>
	    Michael Collison <michael.collison@arm.com>

	* arm-dis.c (enum mve_instructions): Add new instructions.
	(enum mve_undefined): Add new reasons.
	(is_mve_encoding_conflict): Handle new instructions.
	(is_mve_undefined): Likewise.
	(is_mve_unpredictable): Likewise.
	(print_mve_undefined): Likewise.
	(print_mve_size): Likewise.
	(print_insn_mve): Likewise.
2019-05-16 16:37:35 +01:00
Andre Vieira 14925797f8 [PATCH 46/57][Arm][OBJDUMP] Add support for MVE instructions: vmovl, vmull, vqdmull, vqmovn, vqmovun and vmovn
opcodes/ChangeLog:
2019-05-16  Andre Vieira  <andre.simoesdiasvieira@arm.com>
	    Michael Collison <michael.collison@arm.com>

	* arm-dis.c (enum mve_instructions): Add new instructions.
	(is_mve_encoding_conflict): Handle new instructions.
	(is_mve_undefined): Likewise.
	(is_mve_unpredictable): Likewise.
	(print_mve_size): Likewise.
	(print_insn_mve): Likewise.
2019-05-16 16:37:35 +01:00
Andre Vieira c507f10b07 [PATCH 45/57][Arm][OBJDUMP] Add support for MVE instructions: vmov, vmvn, vorr, vorn, vmovx and vbic
opcodes/ChangeLog:
2019-05-16  Andre Vieira  <andre.simoesdiasvieira@arm.com>
	    Michael Collison <michael.collison@arm.com>

	* arm-dis.c (enum mve_instructions): Add new instructions.
	(enum mve_unpredictable): Add new reasons.
	(enum mve_undefined): Likewise.
	(is_mve_okay_in_it): Handle new isntructions.
	(is_mve_encoding_conflict): Likewise.
	(is_mve_undefined): Likewise.
	(is_mve_unpredictable): Likewise.
	(print_mve_vmov_index): Likewise.
	(print_simd_imm8): Likewise.
	(print_mve_undefined): Likewise.
	(print_mve_unpredictable): Likewise.
	(print_mve_size): Likewise.
	(print_insn_mve): Likewise.
2019-05-16 16:37:35 +01:00
Andre Vieira bf0b396de7 [PATCH 44/57][Arm][OBJDUMP] Add support for MVE instructions: vcvt and vrint
opcodes/ChangeLog:
2019-05-16  Andre Vieira  <andre.simoesdiasvieira@arm.com>
	    Michael Collison <michael.collison@arm.com>

	* arm-dis.c (enum mve_instructions): Add new instructions.
	(enum mve_unpredictable): Add new reasons.
	(enum mve_undefined): Likewise.
	(is_mve_encoding_conflict): Handle new instructions.
	(is_mve_undefined): Likewise.
	(is_mve_unpredictable): Likewise.
	(print_mve_undefined): Likewise.
	(print_mve_unpredictable): Likewise.
	(print_mve_rounding_mode): Likewise.
	(print_mve_vcvt_size): Likewise.
	(print_mve_size): Likewise.
	(print_insn_mve): Likewise.
2019-05-16 16:37:35 +01:00
Andre Vieira ef1576a1b5 [PATCH 43/57][Arm][OBJDUMP] Add support for MVE instructions: scatter stores and gather loads
opcodes/ChangeLog:
2019-05-16  Andre Vieira  <andre.simoesdiasvieira@arm.com>
	    Michael Collison <michael.collison@arm.com>

	* arm-dis.c (enum mve_instructions): Add new instructions.
	(enum mve_unpredictable): Add new reasons.
	(enum mve_undefined): Likewise.
	(is_mve_undefined): Handle new instructions.
	(is_mve_unpredictable): Likewise.
	(print_mve_undefined): Likewise.
	(print_mve_unpredictable): Likewise.
	(print_mve_size): Likewise.
	(print_insn_mve): Likewise.
2019-05-16 16:37:31 +01:00
Andre Vieira aef6d00658 [PATCH 42/57][Arm][OBJDUMP] Add support for MVE instructions: vldr[bhw] and vstr[bhw]
opcodes/ChangeLog:
2019-05-16  Andre Vieira  <andre.simoesdiasvieira@arm.com>
	    Michael Collison <michael.collison@arm.com>

	* arm-dis.c (enum mve_instructions): Add new instructions.
	(enum mve_undefined): Add new reasons.
	(insns): Add new instructions.
	(is_mve_encoding_conflict):
	(print_mve_vld_str_addr): New print function.
	(is_mve_undefined): Handle new instructions.
	(is_mve_unpredictable): Likewise.
	(print_mve_undefined): Likewise.
	(print_mve_size): Likewise.
	(print_insn_coprocessor_1): Handle MVE VLDR, VSTR instructions.
	(print_insn_mve):  Handle new operands.
2019-05-16 16:37:24 +01:00
Andre Vieira 04d54ace12 [PATCH 41/57][Arm][OBJDUMP] Add support for MVE instructions: vld[24] and vst[24]
opcodes/ChangeLog:
2019-05-16  Andre Vieira  <andre.simoesdiasvieira@arm.com>
	    Michael Collison <michael.collison@arm.com>

	* arm-dis.c (enum mve_instructions): Add new instructions.
	(enum mve_unpredictable): Add new reasons.
	(is_mve_encoding_conflict): Handle new instructions.
	(is_mve_unpredictable): Likewise.
	(mve_opcodes): Add new instructions.
	(print_mve_unpredictable): Handle new reasons.
	(print_mve_register_blocks): New print function.
	(print_mve_size): Handle new instructions.
	(print_insn_mve): Likewise.
2019-05-16 16:37:17 +01:00
Andre Vieira 9743db035e [PATCH 40/57][Arm][OBJDUMP] Add support for MVE instructions: vdup, veor, vfma, vfms, vhadd, vhsub and vrhadd
opcodes/ChangeLog:
2019-05-16  Andre Vieira  <andre.simoesdiasvieira@arm.com>
	    Michael Collison <michael.collison@arm.com>

	* arm-dis.c (enum mve_instructions): Add new instructions.
	(enum mve_unpredictable): Add new reasons.
	(enum mve_undefined): Likewise.
	(is_mve_encoding_conflict): Handle new instructions.
	(is_mve_undefined): Likewise.
	(is_mve_unpredictable): Likewise.
	(coprocessor_opcodes): Move NEON VDUP from here...
	(neon_opcodes): ... to here.
	(mve_opcodes): Add new instructions.
	(print_mve_undefined):  Handle new reasons.
	(print_mve_unpredictable): Likewise.
	(print_mve_size): Handle new instructions.
	(print_insn_neon): Handle vdup.
	(print_insn_mve): Handle new operands.
2019-05-16 16:37:13 +01:00
Andre Vieira 143275ea7e [PATCH 39/57][Arm][OBJDUMP] Add support for MVE instructions: vpt, vpst and vcmp
opcodes/ChangeLog:
2019-05-16  Andre Vieira  <andre.simoesdiasvieira@arm.com>
	    Michael Collison <michael.collison@arm.com>

	* arm-dis.c (enum mve_instructions): Add new instructions.
	(enum mve_unpredictable): Add new values.
	(mve_opcodes): Add new instructions.
	(vec_condnames): New array with vector conditions.
	(mve_predicatenames): New array with predicate suffixes.
	(mve_vec_sizename): New array with vector sizes.
	(enum vpt_pred_state): New enum with vector predication states.
	(struct vpt_block): New struct type for vpt blocks.
	(vpt_block_state): Global struct to keep track of state.
	(mve_extract_pred_mask): New helper function.
	(num_instructions_vpt_block): Likewise.
	(mark_outside_vpt_block): Likewise.
	(mark_inside_vpt_block): Likewise.
	(invert_next_predicate_state): Likewise.
	(update_next_predicate_state): Likewise.
	(update_vpt_block_state): Likewise.
	(is_vpt_instruction): Likewise.
	(is_mve_encoding_conflict): Add entries for new instructions.
	(is_mve_unpredictable): Likewise.
	(print_mve_unpredictable): Handle new cases.
	(print_instruction_predicate): Likewise.
	(print_mve_size): New function.
	(print_vec_condition): New function.
	(print_insn_mve): Handle vpt blocks and new print operands.
2019-05-16 16:37:09 +01:00
Andre Vieira f08d8ce3cd [PATCH 38/57][Arm][OBJDUMP] Disable the use of MVE reserved coproc numbers in coprocessor instructions
opcodes/ChangeLog:
2019-05-16  Andre Vieira  <andre.simoesdiasvieira@arm.com>

	* arm-dis.c (print_insn_coprocessor_1): Disable the use of coprocessors
	8, 14 and 15 for Armv8.1-M Mainline.
2019-05-16 16:37:01 +01:00
Andre Vieira 73cd51e51b [PATCH 37/57][Arm][OBJDUMP] Add framework for MVE instructions
opcodes/ChangeLog:
2019-05-16  Andre Vieira  <andre.simoesdiasvieira@arm.com>
	    Michael Collison <michael.collison@arm.com>

	* arm-dis.c (enum mve_instructions): New enum.
	(enum mve_unpredictable): Likewise.
	(enum mve_undefined): Likewise.
	(struct mopcode32): New struct.
	(is_mve_okay_in_it): New function.
	(is_mve_architecture): Likewise.
	(arm_decode_field): Likewise.
	(arm_decode_field_multiple): Likewise.
	(is_mve_encoding_conflict): Likewise.
	(is_mve_undefined): Likewise.
	(is_mve_unpredictable): Likewise.
	(print_mve_undefined): Likewise.
	(print_mve_unpredictable): Likewise.
	(print_insn_coprocessor_1): Use arm_decode_field_multiple.
	(print_insn_mve): New function.
	(print_insn_thumb32): Handle MVE architecture.
	(select_arm_features): Force thumb for Armv8.1-m Mainline.
2019-05-16 16:36:58 +01:00
Andre Vieira 1f6234a335 [PATCH 36/57][Arm][GAS] Add support for MVE instructions: wlstp, dlstp, letp and lctp
gas/ChangeLog:
2019-05-16  Andre Vieira  <andre.simoesdiasvieira@arm.com>

	* config/tc-arm.c (T16_32_TAB): Add new instructions.
	(do_t_loloop): Changed to handle tail predication variants.
	(md_apply_fix): Likewise.
	(insns): Add entries for MVE mnemonics.
	* testsuite/gas/arm/mve-tailpredloop-bad.d: New test.
	* testsuite/gas/arm/mve-tailpredloop-bad.l: New test.
	* testsuite/gas/arm/mve-tailpredloop-bad.s: New test.
	* testsuite/gas/arm/mve-tailpredloop.d: New test.
2019-05-16 16:36:53 +01:00