• R/O
  • HTTP
  • SSH
  • HTTPS

List of commits

Tags
No Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

GNU Binutils with patches for OS216


users/palves/cxx-gdb_exceptions
RSS
Rev. Tiempo Autor
30aa2fe users/palves/cxx-gdb_exceptions 2016-09-24 01:58:41 Pedro Alves

gdb: Avoid exception copying in exception printing routines

b366739 2016-09-24 01:57:50 Pedro Alves

Get rid of gdb_exception::message copying/xstrdup'ing

Gets rid of all gdb_exception (and thus gdb_exception::message)
copying introduded by the previous patch, by:

- using rethrow_exception whenever we want to rethrow from within a
catch block. rethrow_exception does "throw;", which throws the
original exception object.

- making throw_exception take an rval reference, in order to allow
moving the original exception's message string into the thrown
exception object.

I thought of making throw_exception take a non-const lval reference,
which should work too, but it feels like forcing callers to use
gdb::move is less surprising. Otherwise, there'd be no visible clue
at the caller site that would make it obvious that throw_exception
destroys its argument.

Actually, now that I think more about this, since we're always going
to end up copying the exception, it may be better to instead rely on
copy elision, and keep things simpler by always passing by value
around. The rethrow_exception bits should still be useful though.

9a81b44 2016-09-24 01:42:14 Pedro Alves

Make gdb_exception manage lifetime of its message string

Currently, the lifetime of the message string associated with
gdb_exception objects is managed by a stack on the side:

/* A stack of exception messages.
This is needed to handle nested calls to throw_it: we don't want to
xfree space for a message before it's used.
This can happen if we throw an exception during a cleanup:
An outer TRY_CATCH may have an exception message it wants to print,
but while doing cleanups further calls to throw_it are made.

This is indexed by the size of the current_catcher list.
It is a dynamically allocated array so that we don't care how deeply
GDB nests its TRY_CATCHs. */
static char **exception_messages;

/* The number of currently allocated entries in exception_messages. */
static int exception_messages_size;

This patch gets rid of that side stack by making the exception objects
responsible for managing the lifetime of their message strings.

To avoid introducing string copying whenever an exception object is
copied (currently we just copy the pointer), this patch makes use of
C++11 rval references, along with a simple emulation for C++03.
Instead of writting std::move, you write gdb::move, and instead of
writting "gdb_exception&&", you write gdb_exception_rval_ref. The
latter is actually a struct in C++03 mode. The C++03 mode is a bit
more permissive (I didn't want to complicate the code), but we know
that if the code compiles in C++11 mode (or later), then we're not
doing anything we shouldn't. The next patch will make more use of
rvalue references throughout the codebase to eliminate unnecessary
gdb_exception::message xstrdup'ing introduced by this patch.

8442b33 2016-09-24 01:41:33 Pedro Alves

The script used to convert CATCH blocks

5cd8448 2016-09-24 01:41:27 Pedro Alves

CATCH(e, RETURN_MASK_ERROR) -> CATCH(const gdb_error &e) etc. throughout

Do:

- CATCH (e, RETURN_MASK_ERROR)
+ CATCH (const gdb_error &e)

And:

- CATCH (ex, RETURN_MASK_ALL)
+ CATCH (const gdb_exception &ex)

Throughout.

Done with a simple sed.

3ec6609 2016-09-24 01:34:28 Pedro Alves

CATCH(e, RETURN_MASK_ERROR) -> CATCH(const gdb_error &e): core bits

This changes GDB's TRY/CATCH macros in a way that allowing changing
the CATCH sites to look a lot more like normal C++ catch blocks.
I.e., do:

- CATCH (e, RETURN_MASK_ERROR)
+ CATCH (const gdb_error &e)

And:

- CATCH (ex, RETURN_MASK_ALL)
+ CATCH (const gdb_exception &ex)

Note this simplifies the TRY_SJLJ/CATCH_SJLJ implementation, by no
longer supporting filter masks. The places where we need this will
always want to catch all exceptions, so nothing is missed.

Since the exception types used to filter errors vs QUITs are exposed
to current code, and, we no longer need to play macro tricks, we
rename them to something more sensible:

-struct gdb_exception_RETURN_MASK_ERROR : public gdb_exception_RETURN_MASK_ALL
+struct gdb_error : public gdb_exception

-struct gdb_exception_RETURN_MASK_QUIT : public gdb_exception_RETURN_MASK_ALL
+struct gdb_quit : public gdb_exception

and "struct gdb_exception_RETURN_MASK_ALL" is gone.

The logic is now:

- Code that wants to catch Ctrl-C as well as gdb errors can can
simply catch gdb_exception, the root exception type.

- Code that wants to only intercept errors while ignoring Ctrl-C
catches gdb_error instead.

Adding more exception types that inherit gdb_error so that catching
code wouldn't have to rethrow if it catches a gdb_error of the "wrong"
error type would be possible, though not done here.

The next patch adjusts the whole codebase to use the new CATCH form.

97e64e5 2016-09-24 01:27:26 Yao Qi

Replace sprintf with xsnprintf in nat/linux-osdata.c

I see the following build warning when I build GDB with GCC trunk.

../../binutils-gdb/gdb/nat/linux-osdata.c: In function ‘LONGEST linux_xfer_osdata_fds(gdb_byte*, ULONGEST, ULONGEST)’:
../../binutils-gdb/gdb/nat/linux-osdata.c:767:1: error: ‘%s’ directive writing between 0 and 255 bytes into a region of size 11 [-Werror=format-length=]
linux_xfer_osdata_fds (gdb_byte *readbuf,
^~~~~~~~~~~~~~~~~~~~~
../../binutils-gdb/gdb/nat/linux-osdata.c:800:51: note: format output between 7 and 262 bytes into a destination of size 17
sprintf (procentry, "/proc/%s", dp->d_name);
^
../../binutils-gdb/gdb/nat/linux-osdata.c: In function ‘LONGEST linux_xfer_osdata_threads(gdb_byte*, ULONGEST, ULONGEST)’:
../../binutils-gdb/gdb/nat/linux-osdata.c:555:1: error: ‘%s’ directive writing between 0 and 255 bytes into a region of size 11 [-Werror=format-length=]
linux_xfer_osdata_threads (gdb_byte *readbuf,
^~~~~~~~~~~~~~~~~~~~~~~~~
../../binutils-gdb/gdb/nat/linux-osdata.c:588:51: note: format output between 7 and 262 bytes into a destination of size 17
sprintf (procentry, "/proc/%s", dp->d_name);
^
cc1plus: all warnings being treated as errors

The warning is a false positive, but we can workaround it by replacing
sprintf with xsnprintf. On the other hand, it is always preferred to
use xsnprintf.

gdb:

2016-09-23 Yao Qi <yao.qi@linaro.org>

* nat/linux-osdata.c (linux_xfer_osdata_threads): Replace
sprintf with xsnprintf.
(linux_xfer_osdata_fds): Likewise.

503b1c3 2016-09-24 00:42:24 Pedro Alves

gdb: Replace operator new / operator new[]

If xmalloc fails allocating memory, usually because something tried a
huge allocation, like xmalloc(-1) or some such, GDB asks the user what
to do:

.../src/gdb/utils.c:1079: internal-error: virtual memory exhausted.
A problem internal to GDB has been detected,
further debugging may prove unreliable.
Quit this debugging session? (y or n)

If the user says "n", that throws a QUIT exception, which is caught by
one of the multiple CATCH(RETURN_MASK_ALL) blocks somewhere up the
stack.

The default implementations of operator new / operator new[] call
malloc directly, and on memory allocation failure throw
std::bad_alloc. Currently, if that happens, since nothing catches it,
the exception escapes out of main, and GDB aborts from unhandled
exception.

This patch replaces the default operator new variants with versions
that, just like xmalloc:

#1 - Raise an internal-error on memory allocation failure.

#2 - Throw a QUIT gdb_exception, so that the exact same CATCH blocks
continue handling memory allocation problems.

A minor complication of #2 is that operator new can _only_ throw
std::bad_alloc, or something that extends it:

void* operator new (std::size_t size) throw (std::bad_alloc);

That means that if we let a gdb QUIT exception escape from within
operator new, the C++ runtime aborts due to unexpected exception
thrown.

So to bridge the gap, this patch adds a new gdb_quit_bad_alloc
exception type that inherits both std::bad_alloc and gdb_exception,
and throws _that_.

If we decide that we should be catching memory allocation errors in
fewer places than all the places we currently catch them (everywhere
we use RETURN_MASK_ALL currently), then we could change operator new
to throw plain std::bad_alloc then. But I'm considering such a change
as separate matter from this one -- it'd make sense to do the same to
xmalloc at the same time, for instance.

Meanwhile, this allows using new/new[] instead of xmalloc/XNEW/etc.
without losing the "virtual memory exhausted" internal-error
safeguard.

Tested on x86_64 Fedora 23.

gdb/ChangeLog:
2016-09-23 Pedro Alves <palves@redhat.com>

* Makefile.in (SFILES): Add common/new-op.c.
(COMMON_OBS): Add common/new-op.o.
(new-op.o): New rule.
* common/common-exceptions.h: Include <new>.
(struct gdb_quit_bad_alloc): New type.
* common/new-op.c: New file.

gdb/gdbserver/ChangeLog:
2016-09-23 Pedro Alves <palves@redhat.com>

* Makefile.in (SFILES): Add common/new-op.c.
(OBS): Add common/new-op.o.
(new-op.o): New rule.

5025eb7 2016-09-24 00:32:04 Akihiko Odaki

Delete relocations associatesd with deleted exidx entries.

PR ld/20595
ld * testsuite/ld-arm/unwind-4.d: Add -q option to linker command
line and -r option to objdump command line. Match emitted relocs
to make sure that superflous relocs are not generated.

bfd * elf-bfd.h (struct elf_backend_data): Add
elf_backend_count_output_relocs callback to count relocations in
the final output.
* elf-arm.c (elf32_arm_add_relocation): Deleted.
(elf32_arm_write_section): Move additional relocation to emit_relocs.
(elf32_arm_count_output_relocs): New function.
(emit_relocs): New function.
(elf32_arm_emit_relocs): New function.
(elf32_arm_vxworks_emit_relocs): New function.
(elf_backend_emit_relocs): Updated to use the new functions.
(elf_backend_count_output_relocs): New define.
* bfd/elflink.c (bfd_elf_final_link): Do not add additional_reloc_count
to the relocation count.
(_bfd_elf_link_size_reloc_section): Use callback to count the
relocations which will be in output.
(_bfd_elf_default_count_output_relocs): New function.
* bfd/elfxx-target.h (elf_backend_count_output_relocs): New define.

7c4236c 2016-09-23 18:26:05 Andreas Krebbel

S/390: Move start of 64 bit binaries from 2GB to 256MB.

ld/ChangeLog:

2016-09-23 Andreas Krebbel <krebbel@linux.vnet.ibm.com>

* emulparams/elf64_s390.sh: Change TEXT_START_ADDR to 256MB.
* testsuite/ld-s390/tlsbin_64.dd: Adjust testcase accordingly.
* testsuite/ld-s390/tlsbin_64.rd: Likewise.

27b5c3d 2016-09-23 09:00:20 GDB Administrator

Automatic date update in version.in

f73842f 2016-09-23 00:04:03 Yao Qi

Close gdbserver in mi_gdb_exit

In commit 6423214f (testsuite: Don't use expect_background to reap
gdbserver), we override gdb_exit in lib/gdbserver-support.exp, so
that we can close gdbserver first. However, we don't close gdbserver
in mi_gdb_exit. This makes a problem in my aarch64 mulit-arch testing,
in which I run some mi tests, mi-watch.exp for example, in different
variations (aarch64 and arm),

Schedule of variations:
junor0-2
junor0-2-arm/-marm
junor0-2-arm/-mthumb

When the test is done in the first variation (aarch64), test case is
recompiled for arm, but GDBserver with aarch64 program is still
running. When the second variation is started, GDB loads arm program,
but GDBserver still loads aarch64 program because the old GDBserver
process is using it. We'll get,

47-target-select remote junor0-2:2350^M
&"warning: Selected architecture arm is not compatible with reported target architecture aarch64\n"^M
&"warning: Architecture rejected target-supplied description\n"

This patch fixes this problem by closing GDBserver in mi_gdb_exit.

gdb/testsuite:

2016-09-22 Yao Qi <yao.qi@linaro.org>

* lib/gdbserver-support.exp: Rename mi_gdb_exit.
(gdb_exit): Rename it to ...
(gdbserver_gdb_exit): ... Close GDBserver.
(gdb_exit): New proc, call gdbserver_gdb_exit.
(mi_gdb_exit): Likewise.

de67845 2016-09-22 23:36:37 Edjunior Barbosa Machado

Fix build breakage from commit 6ec2b2

I was notified by buildbot that my patch (commit 6ec2b2) has broken the build
on x86_64:

../../binutils-gdb/gdb/rs6000-tdep.c: In function int ppc_process_record_op31(gdbarch*, regcache*, CORE_ADDR, uint32_t):
../../binutils-gdb/gdb/rs6000-tdep.c:4705:50: error: cannot convert CORE_ADDR* {aka long unsigned int*} to ULONGEST* {aka long long unsigned int*} for argument 3 to register_status regcache_raw_read_unsigned(regcache*, int, ULONGEST*)
tdep->ppc_gp0_regnum + PPC_RA (insn), &ea);
^
../../binutils-gdb/gdb/rs6000-tdep.c:4718:50: error: cannot convert CORE_ADDR* {aka long unsigned int*} to ULONGEST* {aka long long unsigned int*} for argument 3 to register_status regcache_raw_read_unsigned(regcache*, int, ULONGEST*)
tdep->ppc_gp0_regnum + PPC_RA (insn), &ea);
^
The patch below should fix it.

gdb/ChangeLog:
2016-09-22 Edjunior Barbosa Machado <emachado@linux.vnet.ibm.com>

* rs6000-tdep.c (ppc_process_record_op31): Fix
regcache_raw_read_unsigned call using the correct parameter type.

90681da 2016-09-22 22:36:54 Yao Qi

Use gdbserver-base in remote-gdbserver-on-localhost.exp

This patch is to make remote-gdbserver-on-localhost.exp use gdbserver-base
and remove duplicated code.

gdb/testsuite:

2016-09-22 Yao Qi <yao.qi@linaro.org>

* boards/gdbserver-base.exp (gdb_server_prog): Set the absolute
path.
* boards/remote-gdbserver-on-localhost.exp: Use gdbserver-base.
Remove duplication.

0ec22c2 2016-09-22 22:29:49 Nick Clifton

Report failed attempts to locate DT_NEEDED files when --verbose is in effect.

* emultempl/elf32.em (_try_needed): In verbose mode, report failed
attempts to find a needed library.

fa42dd2 2016-09-22 20:26:44 Anton Kolesov

arc: Fix ARI warning for printf(%p)

Replace printf ("%p") with printf ("%s", host_address_to_string ()). Printing
host addrss might make sense here because pointers can be null and this would
affect how function behaves.

This particular warning is printed only when option -Wari is passed to
contrib/ari/gdb_ari.sh

gdb/ChangeLog:

* arc-tdep.c: Fix ARI warning for printf(%p).

870dd15 2016-09-22 19:30:24 Thomas Preud'homme

Remove legacy basepri_mask MRS/MSR special reg

2016-09-22 Thomas Preud'homme <thomas.preudhomme@arm.com>

gas/
* config/tc-arm.c (v7m_psrs): Remove BASEPRI_MASK MRS/MSR special
register and redundant basepri_max.

9c211fd 2016-09-22 18:04:19 Yao Qi

Check the right proc name

In lib/gdbserver-support.exp, we rename gdb_exit to
gdbserver_orig_gdb_exit, but we check the existence gdbserver_gdb_exit.
We should check gdbserver_orig_gdb_exit instead. Looks it is a typo
or an oversight.

gdb/testsuite:

2016-09-22 Yao Qi <yao.qi@linaro.org>

* lib/gdbserver-support.exp: Check the existence of
gdbserver_orig_gdb_exit rather than gdbserver_gdb_exit.

1e0baa1 2016-09-22 09:00:18 GDB Administrator

Automatic date update in version.in

31da3f2 2016-09-22 03:09:15 Anton Kolesov

Add myself as a write-after-approval GDB maintainer

gdb/ChangeLog:

* MAINTAINERS (Write After Approval): Add Anton Kolesov.

ad0a504 2016-09-22 03:07:06 Anton Kolesov

arc: New Synopsys ARC port

ARC is a family of licensable processors developed by Synopsys.

This is an initial patch that doesn't yet support some of the features, that
are already available in Synopsys' fork of GDB, namely:

* longjmp support
* signal frame handling
* prologue analysis
* Linux targets support
* native Linux support

ARC cores are configurable and extensible, which means from debugger
perspective that some registers and debug capabilities are optional, therefore
it is up to the GDB stub to determine exact list of register available on
target and supply it to GDB via XML target descriptions. List of registers
that is known to GDB and is required is intentionally kept small to simplify
requirements to GDB stub and implementation of a GDB client.

gdb/ChangeLog:

* Makefile.in (ALL_TARGET_OBS): Add arc-tdep.o.
(HFILES_NO_SRCDIR): Add arc-tdep.h.
(ALLDEPFILES): Add arc-tdep.c.
* NEWS: Mention new ARC port.
* configure.tgt: Add ARC.
* arc-tdep.c: New file.
* arc-tdep.h: New file.
* features/Makefile (XMLTOC): Add arc-v2.xml and arc-arcompact.xml.
* features/arc-v2.xml: New file.
* features/arc-v2.c: New file (generated).
* features/arc-arcompact.xml: New file.
* features/arc-arcompact.c: New file (generated).

gdb/doc/ChangeLog:

* gdb.texinfo (Embedded Processors): Document ARC.
(Synopsys ARC): New section.
(Standard Target Features): Document ARC features.
(ARC Features): New section.

gdb/testsuite/ChangeLog:

* gdb.xml/tdesc-regs.exp: set core-regs for arc*-*-elf32.

8aabe2e 2016-09-22 02:47:43 Edjunior Barbosa Machado

ppc: Fix return of instruction handlers in ppc_process_record_op63

some instruction handlers in ppc_process_record_op63() seem to be missing
return or incorrectly using break. This patch aims to fix that.

gdb/ChangeLog:
2016-09-21 Edjunior Barbosa Machado <emachado@linux.vnet.ibm.com>

* rs6000-tdep.c (ppc_process_record_op63): Fix return of instruction
handlers.

36cf180 2016-09-22 02:39:37 Tom Tromey

PR gdb/20604 - fix "quit" when an invalid expression is used

This fixes PR gdb/20604. The bug here is that passing an invalid
expression to "quit" -- e.g., "quit()" -- causes gdb to enter a
non-functioning state.

The immediate problem is that quit_force resets the terminal before
evaluating the expression. However, it seemed to me that it doesn't
really make sense to pass the quit_force argument to kill_or_detach
(which passes it to to_detach), first because conflating the exit
status for "quit" and the signal to pass when detaching doesn't make
sense, and second because to_detach implementations generally only
accept a constant here, while "quit" accepts an expression. So, I
removed that.

As an aside, I think the "detach SIGNO" functionality is not
documented.

Built and regtested on x86-64 Fedora 24.

2016-09-21 Tom Tromey <tom@tromey.com>

PR gdb/20604:
* top.h (quit_force): Update.
* top.c (quit_force): Changed type of first argument. Don't
evaluate expression. Pass NULL to kill_or_detach.
* cli/cli-cmds.c (quit_command): Evaluate "args".

2016-09-21 Tom Tromey <tom@tromey.com>

PR gdb/20604:
* gdb.base/quit.exp: New file.

74172ec 2016-09-22 02:12:21 Simon Marchi

Update and add .gitignore's

This patch adds a bunch of generated files to gdb's gitignore files.
There are still a bunch of "stamp" files that are not ignored, but I
think the rule for them should be put in the top-level gitignore.

Users and developers are encouraged to build out-of-tree, but some
people prefer the simplicity to build in-tree, so it should be useful
for them.

gdb/ChangeLog:

* .gitignore: Ignore more files.
* data-directory/.gitignore: Likewise.

gdb/doc/ChangeLog:

* .gitignore: New file.

gdb/gdbserver/ChangeLog:

* .gitinore: Ignore more files.

gdb/testsuite/ChangeLog:

* .gitignore: New file.

6ec2b21 2016-09-22 01:30:39 Edjunior Barbosa Machado

ppc: Add Power ISA 3.0/POWER9 instructions record support

gdb/ChangeLog:
2016-09-21 Edjunior Barbosa Machado <emachado@linux.vnet.ibm.com>

* rs6000-tdep.c (PPC_DQ): New macro.
(ppc_process_record_op4): Add Power ISA 3.0 instructions.
(ppc_process_record_op19): Likewise.
(ppc_process_record_op31): Likewise.
(ppc_process_record_op59): Likewise.
(ppc_process_record_op60): Likewise.
(ppc_process_record_op63): Likewise.
(ppc_process_record): Likewise.
(ppc_process_record_op61): New function.

ad43e10 2016-09-22 01:11:52 Richard Sandiford

[AArch64] Print spaces after commas in addresses

I got an off-list request to make the AArch64 disassembler print
spaces after commas in addresses. This patch does that.

The same code is used to print operands in "did you mean" errors,
so to keep things consistent, the patch also prints spaces between
operands in those messages.

opcodes/
* aarch64-opc.c (print_immediate_offset_address): Print spaces
after commas in addresses.
(aarch64_print_operand): Likewise.

gas/
* config/tc-aarch64.c (print_operands): Print spaces between
operands.
* testsuite/gas/aarch64/ilp32-basic.d: Expect spaces after ","
in addresses.
* testsuite/gas/aarch64/ldst-reg-imm-post-ind.d: Likewise.
* testsuite/gas/aarch64/ldst-reg-imm-pre-ind.d: Likewise.
* testsuite/gas/aarch64/ldst-reg-pair.d: Likewise.
* testsuite/gas/aarch64/ldst-reg-reg-offset.d: Likewise.
* testsuite/gas/aarch64/ldst-reg-uns-imm.d: Likewise.
* testsuite/gas/aarch64/ldst-reg-unscaled-imm.d: Likewise.
* testsuite/gas/aarch64/reloc-insn.d: Likewise.
* testsuite/gas/aarch64/sve.d: Likewise.
* testsuite/gas/aarch64/symbol.d: Likewise.
* testsuite/gas/aarch64/system.d: Likewise.
* testsuite/gas/aarch64/tls-desc.d: Likewise.
* testsuite/gas/aarch64/sve-invalid.l: Expect spaces after ","
in suggested alternatives.
* testsuite/gas/aarch64/verbose-error.l: Likewise.

ld/
* testsuite/ld-aarch64/emit-relocs-28.d: Expect spaces after ","
in addresses.
* testsuite/ld-aarch64/emit-relocs-301-be.d: Likewise.
* testsuite/ld-aarch64/emit-relocs-301.d: Likewise.
* testsuite/ld-aarch64/emit-relocs-302-be.d: Likewise.
* testsuite/ld-aarch64/emit-relocs-302.d: Likewise.
* testsuite/ld-aarch64/emit-relocs-310-be.d: Likewise.
* testsuite/ld-aarch64/emit-relocs-310.d: Likewise.
* testsuite/ld-aarch64/emit-relocs-313.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/emit-relocs-531.d: Likewise.
* testsuite/ld-aarch64/emit-relocs-532.d: Likewise.
* testsuite/ld-aarch64/emit-relocs-533.d: Likewise.
* testsuite/ld-aarch64/emit-relocs-534.d: Likewise.
* testsuite/ld-aarch64/emit-relocs-535.d: Likewise.
* testsuite/ld-aarch64/emit-relocs-536.d: Likewise.
* testsuite/ld-aarch64/emit-relocs-537.d: Likewise.
* testsuite/ld-aarch64/emit-relocs-538.d: Likewise.
* testsuite/ld-aarch64/erratum835769.d: Likewise.
* testsuite/ld-aarch64/erratum843419.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/ifunc-21.d: Likewise.
* testsuite/ld-aarch64/ifunc-7c.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-all.d: Likewise.
* testsuite/ld-aarch64/tls-relax-gd-ie.d: Likewise.
* testsuite/ld-aarch64/tls-relax-gdesc-ie-2.d: Likewise.
* testsuite/ld-aarch64/tls-relax-gdesc-ie.d: Likewise.
* testsuite/ld-aarch64/tls-relax-large-desc-ie-be.d: Likewise.
* testsuite/ld-aarch64/tls-relax-large-desc-ie.d: Likewise.
* testsuite/ld-aarch64/tls-tiny-desc.d: Likewise.
* testsuite/ld-aarch64/tls-tiny-gd.d: Likewise.

ab3b8fc 2016-09-22 01:11:04 Richard Sandiford

[AArch64] Use "must" rather than "should" in error messages

One of the review comments from the SVE series was that it would
be better to use "must" rather than "should" in error messages.
I think this patch fixes all cases in the AArch64 code.
It also uses "must be" instead of "expected to be".

opcodes/
* aarch64-opc.c (operand_general_constraint_met_p): Use "must be"
rather than "should be" or "expected to be" in error messages.

gas/
* config/tc-aarch64.c (output_operand_error_record): Use "must be"
rather than "should be" or "expected to be" in error messages.
(parse_operands): Likewise.
* testsuite/gas/aarch64/diagnostic.l: Likewise.
* testsuite/gas/aarch64/legacy_reg_names.l: Likewise.
* testsuite/gas/aarch64/sve-invalid.l: Likewise.
* testsuite/gas/aarch64/sve-reg-diagnostic.l: Likewise.

bb7eff5 2016-09-22 01:09:59 Richard Sandiford

[AArch64] Add SVE condition codes

SVE defines new names for existing NZCV conditions, to reflect the
result of instructions like PTEST. This patch adds support for these
names.

The patch also adds comments to the disassembly output to show the
alternative names of a condition code. For example:

cinv x0, x1, cc

becomes:

cinv x0, x1, cc // cc = lo, ul, last

and:

b.cc f0 <...>

becomes:

b.cc f0 <...> // b.lo, b.ul, b.last

Doing this for the SVE names follows the practice recommended by the
SVE specification and is definitely useful when reading SVE code.
If the feeling is that it's too distracting elsewhere, we could add
an option to turn it off.

include/
* opcode/aarch64.h (aarch64_cond): Bump array size to 4.

opcodes/
* aarch64-dis.c (remove_dot_suffix): New function, split out from...
(print_mnemonic_name): ...here.
(print_comment): New function.
(print_aarch64_insn): Call it.
* aarch64-opc.c (aarch64_conds): Add SVE names.
(aarch64_print_operand): Print alternative condition names in
a comment.

gas/
* config/tc-aarch64.c (opcode_lookup): Search for the end of
a condition name, rather than assuming that it will have exactly
2 characters.
(parse_operands): Likewise.
* testsuite/gas/aarch64/alias.d: Add new condition-code comments
to the expected output.
* testsuite/gas/aarch64/beq_1.d: Likewise.
* testsuite/gas/aarch64/float-fp16.d: Likewise.
* testsuite/gas/aarch64/int-insns.d: Likewise.
* testsuite/gas/aarch64/no-aliases.d: Likewise.
* testsuite/gas/aarch64/programmer-friendly.d: Likewise.
* testsuite/gas/aarch64/reloc-insn.d: Likewise.
* testsuite/gas/aarch64/b_c_1.d, testsuite/gas/aarch64/b_c_1.s:
New test.

ld/
* testsuite/ld-aarch64/emit-relocs-280.d: Match branch comments.
* testsuite/ld-aarch64/weak-undefined.d: Likewise.

f2a5c4f 2016-09-22 01:08:58 Richard Sandiford

Fix misplaced ChangeLog

bc33f5f 2016-09-22 00:59:07 Richard Sandiford

[AArch64][SVE 32/32] Add SVE tests

This patch adds new tests for SVE. It also extends diagnostic.[sl] with
checks for some inappropriate uses of MUL and MUL VL in base AArch64
instructions.

gas/testsuite/
* gas/aarch64/diagnostic.s, gas/aarch64/diagnostic.l: Add tests for
invalid uses of MUL VL and MUL in base AArch64 instructions.
* gas/aarch64/sve-add.s, gas/aarch64/sve-add.d, gas/aarch64/sve-dup.s,
gas/aarch64/sve-dup.d, gas/aarch64/sve-invalid.s,
gas/aarch64/sve-invalid.d, gas/aarch64/sve-invalid.l,
gas/aarch64/sve-reg-diagnostic.s, gas/aarch64/sve-reg-diagnostic.d,
gas/aarch64/sve-reg-diagnostic.l, gas/aarch64/sve.s,
gas/aarch64/sve.d: New tests.