Commit Graph

84131 Commits

Author SHA1 Message Date
Doug Evans a38fe4fedd inferior.h (struct inferior_suspend_state): Delete, unused.
gdb/ChangeLog:

	* inferior.h (struct inferior_suspend_state): Delete, unused.
	All references deleted.
2015-06-23 11:36:49 -07:00
Peter Bergner 8e6500c55e Fix rfebb gdb test cases.
The following patch fixed the assembly / disassembly of the rfebb instruction:

    https://sourceware.org/ml/binutils/2015-06/msg00190.html

This patch updates the gdb testsuite to match the new disassembly behavior.

gdb/testsuite/
	* gdb.arch/powerpc-power.exp <rfebb>: Fixup test results.
	* gdb.arch/powerpc-power.s <rfebb>: Likewise.
2015-06-23 13:33:05 -05:00
Mike Frysinger 4953dc2094 sim: trace: do not enable internal debug by default
Since --trace-debug is for people hacking on the sim sources rather than
people just using the sim, default it to off.  This matches the behavior
of other debug knobs we have.
2015-06-23 14:05:38 -04:00
Mike Frysinger b50a153264 sim: assume recentish compiler/systems
Assume the build system supports stdint.h/stdarg.h as those have been
around long enough and we don't care about pre-stdc compilers anymore.
2015-06-23 14:04:49 -04:00
Mike Frysinger 7564fe458c gdb: microblaze: delete useless stubs
These don't accomplish anything the common core doesn't already, so
punt them as they purely waste code.
2015-06-23 09:41:31 -04:00
Yao Qi 0bdb2f7849 Convert have_ptrace_getregset to a tri-state boolean
have_ptrace_getregset is a tri-state variable (-1, 0, 1), and we have
some conditions like "if (have_ptrace_getregset)", which is not correct.
I'll explain why it is not correct in the following example.  This fix
to this problem to replace the test (have_ptrace_getregset) to test
(have_ptrace_getregset == 1) or (have_ptrace_getregset == -1) etc.
However Doug thinks it hinders readability
https://sourceware.org/ml/gdb-patches/2015-05/msg00692.html so I decide
to add a new enum tribool and change have_ptrace_getregset to it, in
order to make these tests more readable.

have_ptrace_getregset is initialised to -1, and is adjusted to 0 or 1 in
$ARCH_linux_read_description according to the capability of the kernel.
However, it is possible that have_ptrace_getregset is used before it is
set to 0 or 1, which means it is still -1.  This is shown below.

(gdb) run
Starting program: gdb/testsuite/gdb.base/break

Breakpoint 2, amd64_linux_fetch_inferior_registers (ops=0xceaa80, regcache=0xe72000, regnum=16) at git/gdb/amd64-linux-nat.c:128
128	{
top?p have_ptrace_getregset
$1 = TRIBOOL_UNKNOWN
top?c
Continuing.

Breakpoint 2, amd64_linux_fetch_inferior_registers (ops=0xceaa80, regcache=0xe72000, regnum=16) at git/gdb/amd64-linux-nat.c:128
128	{
top?c
Continuing.

Breakpoint 1, x86_linux_read_description (ops=0xceaa80) at git/gdb/x86-linux-nat.c:117
117	{

PTRACE_GETREGSET command is used even GDB doesn't know whether
PTRACE_GETREGSET is supported or not.  It is wrong, but works on x86.
However it doesn't work on arm-linux if the kernel doesn't support
PTRACE_GETREGSET at all.  We'll get:

(gdb) run
Starting program: gdb/testsuite/gdb.base/break
warning: Unable to fetch general register.
PC register is not available

gdb:

2015-06-23  Yao Qi  <yao.qi@linaro.org>

	* amd64-linux-nat.c (amd64_linux_fetch_inferior_registers):
	Check whether have_ptrace_getregset is TRIBOOL_TRUE explicitly.
	(amd64_linux_store_inferior_registers): Likewise.
	* arm-linux-nat.c (fetch_fpregister): Likewise.
	(fetch_fpregs, store_fpregister): Likewise.
	(store_fpregister, store_fpregs): Likewise.
	(fetch_register, fetch_regs): Likewise.
	(store_register, store_regs): Likewise.
	(fetch_vfp_regs, store_vfp_regs): Likewise.
	(arm_linux_read_description): Check have_ptrace_getregset is
	TRIBOOL_UNKNOWN.  Set have_ptrace_getregset to TRIBOOL_TRUE
	or TRIBOOL_FALSE.
	* i386-linux-nat.c (fetch_xstateregs): Check
	have_ptrace_getregset is not TRIBOOL_TRUE.
	(store_xstateregs): Likewise.
	* linux-nat.c (have_ptrace_getregset): Change its type to
	enum tribool.
	* linux-nat.h (tribool): New enum.
	* x86-linux-nat.c (x86_linux_read_description): Use enum tribool.
	Check whether have_ptrace_getregset is TRIBOOL_TRUE.
2015-06-23 14:03:11 +01:00
Jiong Wang c217058957 [AArch64] Generate DT_TEXTREL for relocation against read-only section
2015-06-23  Jiong Wang  <jiong.wang@arm.com>

  bfd/
    * elfnn-aarch64.c (aarch64_readonly_dynrelocs): New function.
    (elfNN_aarch64_size_dynamic_sections): Traverse hash table to check
    relocations against read-only sections.

  ld/testsuite/
    * ld-aarch64/dt_textrel.s: New testcase.
    * ld-aarch64/dt_textrel.d: New expectation file.
    * ld-aarch64/aarch64-elf.exp: Run new testcase.
2015-06-23 12:12:06 +01:00
GDB Administrator e5ee3fe285 Automatic date update in version.in 2015-06-23 00:00:08 +00:00
Peter Bergner 7b9341139a PPC sync instruction accepts invalid and incompatible operands
ISA 2.07 added a new category called Elemental Memory Barriers that modifies
the sync instruction to accept an additional operand ESYNC.  Edmar added
support for this insruction varient here:

    https://sourceware.org/ml/binutils/2012-02/msg00221.html

Looking at this closer, I see that the insert_ls() function is misnamed
(since it's attached to the ESYNC operand, not the LS operand) but more
importantly, it is silently modifying the LS operand value behind the
users back when the LS operand is either invalid or is incompatible with
the new ESYNC operand.  The ISA 2.07 doc has an Assembler Note that clearly
states that assemblers that support the ESYNC operand should report all
invalid uses of LS and ESYNC.  This patch changes the assembler to
error out on invalid and incompatible operand usage.

opcodes/
	* ppc-opc.c (insert_ls): Test for invalid LS operands.
	(insert_esync): New function.
	(LS, WC): Use insert_ls.
	(ESYNC): Use insert_esync.

gas/testsuite/
	* gas/ppc/e6500.s <sync>: Fix invalid test.
	* gas/ppc/e6500.d: Likewise.
2015-06-22 14:55:24 -05:00
Nick Clifton bdc4de1b24 Stop "objdump -d" from disassembling past a symbolic address.
include	* dis-asm.h (struct disassemble_info): Add stop_vma field.

binuti  * objdump.c (disassemble_bytes): Set the stop_vma field in the
	disassemble_info structure when disassembling code sections with
	-d.
	* doc/binutils.texi (objdump): Document the discrepancy between -d
	and -D.

opcodes	* dis-buf.c (buffer_read_memory): Fail is stop_vma is set and the
	requested region lies beyond it.
	* bfin-dis.c (print_insn_bfin): Ignore sysop instructions when
	looking for 32-bit insns.
	* mcore-dis.c (print_insn_mcore): Disable stop_vma when reading
	data.
	* sh-dis.c (print_insn_sh): Likewise.
	* tic6x-dis.c (print_insn_tic6x): Disable stop_vma when reading
	blocks of instructions.
	* vax-dis.c (print_insn_vax): Check that the requested address
	does not clash with the stop_vma.

tests	* gas/arm/backslash-at.s: Add extra .byte directives so that the
	foo symbol does not appear to point half way through an
	instruction.
	* gas/arm/backslash-at.d: Update expected disassembly.
	* gas/i386/ilp32/x86-64-opcode-inval-intel.d: Likewise.
	* gas/i386/ilp32/x86-64-opcode-inval.d: Likewise.
	* gas/i386/x86-64-opcode-inval-intel.d: Likewise.
	* gas/i386/x86-64-opcode-inval.d: Likewise.
2015-06-22 16:53:27 +01:00
Yao Qi 07fcd30112 Add comments on using board file remote-gdbserver-on-localhost.exp
This commit is to add comments on using this board file and the
requirements on localhost.

gdb/testsuite:

2015-06-22  Yao Qi  <yao.qi@linaro.org>

	* boards/remote-gdbserver-on-localhost.exp: Add comments.
2015-06-22 14:01:20 +01:00
Yao Qi 52042a003f Don't skip hw breakpoint/watchpoint tests for aarch64 target
This patch is to let skip_hw_breakpoint_tests and skip_hw_watchpoint_tests
return 0 for aarch64 target, since aarch64 has HW watchpoint and
breakpoint registers.

With this patch applied, about 1560 watchpoint/breakpoint related tests
become enabled on aarch64-linux native testing.

gdb/testsuite:

2015-06-22  Yao Qi  <yao.qi@linaro.org>

	* lib/gdb.exp (skip_hw_breakpoint_tests): Return 0 for target
	aarch64*-*-*.
	(skip_hw_watchpoint_tests): Likewise.
2015-06-22 13:43:30 +01:00
GDB Administrator cb5d172ca4 Automatic date update in version.in 2015-06-22 00:00:07 +00:00
Mike Frysinger ccd4b2953b sim: common: add basic model assert
If the configured in default doesn't match a known value, throw an
assertion failure rather than segfaulting deeper down.
2015-06-21 13:56:24 -04:00
Mike Frysinger f55b33d51b sim: common: use standard intXX_t types for signedXX
Let's assume that the system supports the POSIX int8/16/32/64_t types
as this collapses the logic significantly.
2015-06-21 13:38:12 -04:00
Mike Frysinger 618b526e31 sim: common: standardize multiple include defines
We use SIM_xxx_H in most headers, so convert _SIM_xxx_H_ over to it.
2015-06-21 13:33:27 -04:00
Alan Modra 02db4b0a9f Don't use $< in Makefiles
$< is a GNU make feature.

	* Makefile.am: Expand $<.
	* Makefile.in: Regenerate.
2015-06-21 13:07:57 +09:30
GDB Administrator bcdeacb69a Automatic date update in version.in 2015-06-21 00:00:08 +00:00
GDB Administrator c325601c3f Automatic date update in version.in 2015-06-20 00:00:08 +00:00
Peter Bergner 11a0cf2ec0 Allow for optional operands with non-zero default values.
ISA 2.07 (ie, POWER8) added the rfebb instruction which takes one operand
with the value of either a 0 or 1.  It also defines an extended mnemonic
with no operands (ie, "rfebb") that is supposed to be equivalent to "rfebb 1".
I implemented rfebb's lone operand with PPC_OPERAND_OPTIONAL, but the
problem is, optional operands that are ommitted always default to the
value 0, which is wrong in this case.  I have added support for allowing
non-zero default values by adding an additional flag PPC_OPERAND_OPTIONAL_VALUE
that specifies that the default operand value to be used is stored in the
SHIFT field of the operand field immediately following this one.

This fixes the rfebb issue.  I also fixed the mftb and mfcr instructions
so they use the same mechanism.  This allows us to flag invalid uses of
mfcr where we explicitly pass in a zero FXM value, like the use in a2.[sd].

include/opcode/

	* ppc.h (PPC_OPERAND_OPTIONAL_VALUE): New.
	(ppc_optional_operand_value): New inline function.

opcodes/
	* ppc-dis.h (skip_optional_operands): Use ppc_optional_operand_value.
	* ppc-opc.c (FXM4): Add non-zero optional value.
	(TBR): Likewise.
	(SXL): Likewise.
	(insert_fxm): Handle new default operand value.
	(extract_fxm): Likewise.
	(insert_tbr): Likewise.
	(extract_tbr): Likewise.

gas/
	* config/tc-ppc.c (md_assemble): Use ppc_optional_operand_value.
	Allow for optional operands without insert functions.

gas/testsuite/
	* gas/ppc/power8.d: Fixup rfebb test results.
	* gas/ppc/a2.s: Fix invalid mfcr test.
	* gas/ppc/a2.d: Likewise.
2015-06-19 17:17:07 -05:00
Doug Evans 18a94d75a0 Remove special support in gdb for Sun's version of stabs.
Discussion:
https://sourceware.org/ml/gdb-patches/2015-05/msg00169.html

gdb/ChangeLog:

	* NEWS: Mention Sun's version of stabs is no longer supported.
	* elfread.c (free_elfinfo): Delete.  All uses updated.
	(elfstab_offset_sections): Delete.  All uses updated.
	* gdb-stabs.h (stab_section_info): Delete.  All uses updated.
	* psympriv.h (partial_symtab) <section_offsets>: Delete.
	All uses updated.
	* psymtab.c (start_psymtab_common): Delete arg section_offsets.
	All callers updated.

gdb/doc/ChangeLog:

	* stabs.texinfo (ELF Linker Relocation): Mention Sun stabs is no
	longer supported.
2015-06-19 11:34:43 -07:00
GDB Administrator ef8b8d4ad5 Automatic date update in version.in 2015-06-19 00:00:08 +00:00
Simon Marchi 124e13d9e7 remote: consider addressable unit size when reading/writing memory
Adapt code in remote.c to take into account addressable unit size when
reading/writing memory.

A few variables are renamed and suffixed with _bytes or _units. This
way, it's more obvious if there is any place where we add or compare
values of different kinds (which would be a mistake).

gdb/ChangeLog:

	* common/rsp-low.c (needs_escaping): New.
	(remote_escape_output): Add unit_size parameter. Refactor to
	support multi-byte addressable units.  Rename parameters.
	* common/rsp-low.h (remote_escape_output): Add unit_size
	parameter and rename others. Update doc.
	* remote.c (align_for_efficient_write): New.
	(remote_write_bytes_aux): Add unit_size parameter and use it.
	Rename some variables.  Update doc.
	(remote_xfer_partial): Get unit size and use it.
	(remote_read_bytes_1): Add unit_size parameter and use it.
	Rename some variables. Update doc.
	(remote_write_bytes): Same.
	(remote_xfer_live_readonly_partial): Same.
	(remote_read_bytes): Same.
	(remote_flash_write): Update call to remote_write_bytes_aux.
	(remote_write_qxfer): Update call to remote_escape_output.
	(remote_search_memory): Same.
	(remote_hostio_pwrite): Same.

gdb/gdbserver/ChangeLog:

	* server.c (write_qxfer_response): Update call to
	remote_escape_output.
2015-06-18 13:12:39 -04:00
Patrick Palka 74bd41ce65 Test the interaction between GDBHISTSIZE and .gdbinit
The value inside the GDBHISTSIZE environment variable, only if valid,
should override setting the history size through one's .gdbinit file.

gdb/testsuite/ChangeLog:

	* gdb.base/gdbinit-history.exp: Test the interaction between
	setting GDBHISTSIZE and setting the history size via .gdbinit.
2015-06-18 11:51:19 -04:00
Nick Clifton c12d2c9d48 Add support for using the ADR alias in Thumb mode against nearby symbols.
PR gas/18541
gas	* config/tc-arm.c (md_apply_fix): Add support for ADR in thumb
	mode against a nearby symbol.

tests	* gas/arm/thumb.s: Add test of ADR against a nearby symbol.
	* gas/arm/thumb.d: Update expected output.
	* gas/arm/thumb-eabi.d: Likewise.
2015-06-18 10:23:16 +01:00
Nick Clifton 75c1199967 Fix the computation of the addends for an ARM_TLS_LE32 reloc.
PR gas/18481
bfd	* elf32-arm.c (R_ARM_TLS_LE32): Set the special function to NULL.

gas	* config/tc-arm.c (tc_gen_reloc): Include BFD_RELOC_ARM_TLS_LE32
	in the same case as BFD_RELOC_ARM_TLS_IS32.

tests	* gas/arm/tls.s: Add tests of the tpoff pseudo with a local
	symbol.
	* gas/arm/tls.d: Update expected output.
2015-06-18 10:18:42 +01:00
Mike Frysinger 57b42d6489 sim: syscall: simplify unknown syscall trace
Since we always include the raw syscall number when tracing, also
including it in the name when it's unknown is redundant.  Simplify
the code by using a constant string.
2015-06-18 04:07:42 -04:00
Mike Frysinger 7aec3bb968 sim: callback: fix sentinel testing when walking maps
The new helpers for walking the maps tested the wrong value for exiting
the for loop.  This caused crashes when looking up entries that were not
in the map.
2015-06-18 04:02:26 -04:00
GDB Administrator faffbc648d Automatic date update in version.in 2015-06-18 00:00:08 +00:00
Luis Machado 6ae8866180 Fix problems with finishing a dummy function call on simulators.
Some simulators don't handle permanent breakpoints properly and will
sometimes terminate when hitting such a breakpoint instruction or have
unwanted effects.

When a permanent breakpoint is inserted, GDB will not attempt to insert
other breakpoint locations on top of it, leading to the problem described
above.

By not marking permanent breakpoint locations as inserted, we allow the
insertion of breakpoint locations on top of the permanent ones, preventing
the simulators from running into that situation.

gdb/ChangeLog:

2015-06-17  Luis Machado  <lgustavo@codesourcery.com>

	* breakpoint.c (add_location_to_breakpoint): Don't mark permanent
	locations as inserted.
	Update and expand comment about permanent locations.
	(bp_loc_is_permanent): Don't return 0 for bp_call_dummy.
	Move comment to add_location_to_breakpoint.
	(update_global_location_list): Don't error out if a permanent
	breakpoint is not marked inserted.
	Don't error out if a non-permanent breakpoint location is inserted on
	top of a permanent breakpoint.
2015-06-17 16:50:57 -03:00
Luis Machado da4616f69f Remove unused function make_breakpoint_permanent.
make_breakpoint_permanent is no longer used anywhere and can be
safely removed.

gdb/ChangeLog:

2015-06-17  Luis Machado  <lgustavo@codesourcery.com>

	* breakpoint.c (make_breakpoint_permanent): Remove unused
	function.
	* breakpoint.h (make_breakpoint_permanent): Remove declaration.
2015-06-17 16:09:24 -03:00
Patrick Palka 0eacb2983d Make NEWS entry and manual regarding GDBHISTSIZE more consistent
... by mentioning in the manual that setting GDBHISTSIZE to the empty
string disables truncation, like the NEWS entry does.

gdb/doc/ChangeLog:

	* gdb.texinfo (Command History): Mention that setting
	GDBHISTSIZE to the empty string disables history truncation.
2015-06-17 14:52:09 -04:00
Patrick Palka bc460514b9 Tweak the handling of $GDBHISTSIZE edge cases [PR gdb/16999]
When GDB reads a nonsensical value for the GDBHISTSIZE environment
variable, i.e. one that is non-numeric or negative, GDB then sets its
history size to 0.  This behavior is annoying and also inconsistent
with the behavior of bash.

This patch makes the behavior of invalid GDBHISTSIZE consistent with how
bash handles HISTSIZE.  When we encounter a null or out-of-range
GDBHISTSIZE (outside of [0, INT_MAX]) we now set the history size to
unlimited instead of 0.  When we encounter a non-numeric GDBHISTSIZE we
do nothing.

gdb/ChangeLog:

	PR gdb/16999
	* NEWS: Mention new GDBHISTSIZE behavior.
	* top.c (init_history): For null or out-of-range GDBHISTSIZE,
	set history size to unlimited.  Ignore non-numeric GDBHISTSIZE.

gdb/doc/ChangeLog:

	PR gdb/16999
	* gdb.texinfo (Command History): Mention new GDBHISTSIZE
	behavior.

gdb/testsuite/ChangeLog:

	PR gdb/16999
	* gdb.base/gdbhistsize-history.exp: New test.
2015-06-17 14:12:19 -04:00
Patrick Palka b58c513b79 Read $GDBHISTSIZE instead of $HISTSIZE
The HISTSIZE environment variable is generally expected to be read by
shells, not by applications.  Some distros for example globally export
HISTSIZE in /etc/profile -- with the intention that it only affects
shells -- and by doing so it renders useless GDB's own mechanism for
setting the history size via .gdbinit.  Also, annoyances may arise when
HISTSIZE is not interpreted the same way by the shell and by GDB, e.g.
PR gdb/16999.  That can always be fixed on a shell-by-shell basis but it
may be impossible to be consistent with the behavior of all shells at
once.  Finally it just makes sense to not confound shell environment
variables with application environment variables.

gdb/ChangeLog:

	* NEWS: Mention that GDBHISTSIZE is read instead of HISTSIZE.
	* top.c (init_history): Read from GDBHISTSIZE instead of
	HISTSIZE.
	(init_main): Refer to GDBHISTSIZE instead of HISTSIZE.

gdb/doc/ChangeLog:

	* gdb.texinfo (Command History): Replace occurrences of HISTSIZE
	with GDBHISTSIZE.

gdb/testsuite/ChangeLog:

	* gdb.base/gdbinit-history.exp: Replace occurrences of HISTSIZE
	with GDBHISTSIZE.
	* gdb.base/readline.exp: Likewise.
2015-06-17 14:03:50 -04:00
Mike Frysinger 7d5c6c43ca sim: syscall: add common sim_syscall helpers
Many ports have the same sim syscall logic, so add some helpers to handle
all the common details.  The arches still have to deal with the unpacking
and packing of the syscall arguments, but the rest of the sim<->callback
glue is now shared.
2015-06-17 13:19:51 -04:00
Mike Frysinger 61a0c964e6 sim: syscall: unify memory helpers
Almost every port implements these two callbacks in the same way, so
unify them in the common layer.
2015-06-17 13:19:51 -04:00
Mike Frysinger 6362a3f875 sim: callback: add human readable strings for debugging to maps
When tracing, we often want to display the human readable name for the
various syscall/errno values.  Rather than make each target duplicate
the lookup, extend the existing maps to include the string directly,
and add helper functions to look up the constants.

While most targets are autogenerated (from libgloss), the bfin/cris
targets have custom maps for the Linux ABI which need to be updated
by hand.
2015-06-17 13:19:51 -04:00
Yao Qi 920467912a Fix tcl error
This patch fixes the following tcl error

Running ../../../binutils-gdb/gdb/testsuite/gdb.base/break-interp.exp ...
ERROR: (DejaGnu) proc "else" does not exist.
The error code is NONE
The info on the error is:
invalid command name "else"
    while executing
"::tcl_unknown else"
    ("uplevel" body line 1)
    invoked from within
"uplevel 1 ::tcl_unknown $args"

gdb/testsuite:

2015-06-17  Yao Qi  <yao.qi@linaro.org>

	* lib/gdb.exp (get_build_id): Move braces and "else" to the same
	line.
2015-06-17 17:16:00 +01:00
Jiong Wang 696ddf4b52 [AArch64] Select correct linker emulation for ILP32 according to endianes
2015-06-17  Jiong Wang  <jiong.wang@arm.com>

ld/testsuite/
  * ld-aarch64/aarch64-elf.exp (aarch64_choose_ilp32_emul): New function.
  * ld-aarch64/emit-relocs-28.d: Use aarch64_choose_ilp32_emul to choose
  emulation mode.
2015-06-17 16:36:04 +01:00
Nick Clifton 5fc177c895 Fix compile warnings building previous delta in a 32-bit environment.
* config/tc-arm.c (is_double_a_single): Make conditional upon the
	availablity of a 64-bit type.  Use this type for the argument and
	mantissa.
	(double_to_single): Likewise.
	* config/tc-arm.c (move_or_literal_pool): Use a 64-bit type for
	the constant value, if available.  Generate a 64-bit value from a
	bignum if supported.  Only perform the second optimization for
	PR 18500 if the 64-bit type is available.
2015-06-17 16:10:36 +01:00
Patrick Palka 2093d2d314 Don't truncate the history file when history size is unlimited
We still do not handle "set history size unlimited" correctly.  In
particular, after writing to the history file, we truncate the history
even if it is unlimited.

This patch makes sure that we do not call history_truncate_file() if the
history is not stifled (i.e. if it's unlimited).  This bug causes the
history file to be truncated to zero on exit when one has "set history
size unlimited" in their gdbinit file.  Although this code exists in GDB
7.8, the bug is masked by a pre-existing bug that's been only fixed in
GDB 7.9 (PR gdb/17820).

gdb/ChangeLog:

	* top.c (gdb_safe_append_history): Do not call
	history_truncate_file if the history is not stifled.

gdb/testsuite/ChangeLog:

	* gdb.base/gdbinit-history.exp: Add test case to check that
	an unlimited history file does not get truncated on exit.
2015-06-17 09:41:58 -04:00
Alessandro Marzocchi 1256987795 Add support for converting LDR Rx,=<imm> to MOV or MVN in Thumb2 mode.
PR gas/18499
gas	* config/tc-arm.c (move_or_literal_pool): Add support for LDR Rx,=
	to MOV.w or MVN.w for Thumb2.

tests	* gas/arm/thumb2_ldr_immediate_armv6.s: New test case.
	* gas/arm/thumb2_ldr_immediate_armv6.d: Expected disassembly.
	* gas/arm/thumb2_ldr_immediate_armv6t2.s: New test case.
	* gas/arm/thumb2_ldr_immediate_armv6t2.d: Expected disassembly.
2015-06-17 13:50:52 +01:00
Alessandro Marzocchi ba592044bc Add support for converting VLDR <reg>,=<constant> to a VMOV instruction when appropriate.
PR gas/18500
gas	* config/tc-arm.c (is_double_a_single): New function.
	(double_to_single): New function.
	(move_or_literal_pool): Add support for	converting VLDR to VMOV.

tests	* gas/arm/vfpv2-ldr_immediate.s: New test case.
	* gas/arm/vfpv2-ldr_immediate.d: Expected disassembly.
	* gas/arm/vfpv3-ldr_immediate.s: New test case.
	* gas/arm/vfpv3-ldr_immediate.d: Expected disassembly.
	* gas/arm/vfpv3xd-ldr_immediate.s: New test case.
	* gas/arm/vfpv3xd-ldr_immediate.d: Expected disassembly.
2015-06-17 12:56:17 +01:00
Andreas Arnez fc24848555 S390: Add syscall info for syscalls from 344 up to 354
Represent new Linux syscalls for s390 and s390x in GDB's syscall info.
Add the syscalls from 344 (finit_module) up to 354 (execveat).

gdb/ChangeLog:

	* syscalls/s390-linux.xml: Add syscalls 344 through 354.
	* syscalls/s390x-linux.xml: Likewise.
2015-06-17 11:17:08 +02:00
Andreas Arnez e6c693af14 Add vector ABI tests to gnu_vector.exp
So far the gnu_vector test was limited to "static" aspects of GDB's
vector support, like evaluating vector-valued expressions.  This patch
enriches the test and adds checks for GDB's vector ABI support as well.
The new checks particularly verify inferior function calls with vector
arguments and GDB's handling of vector return values.

The test now attempts to compile for the target's "native" architecture,
such that a hardware vector ABI is used if available.

Since GDB has no vector ABI support for x86 and x86_64 targets, most of
the new checks are KFAILed there.

gdb/testsuite/ChangeLog:

	* gdb.base/gnu_vector.c: Include stdarg.h and stdio.h.
	(VECTOR): New macro.  Use it...
	(int4, uint4, char4, float4, int2, longlong2, float2, double2):
	...for these typedefs.
	(int8, char1, int1, double1): New typedefs.
	(struct just_int2, struct two_int2): New structures.
	(add_some_intvecs, add_many_charvecs, add_various_floatvecs)
	(add_structvecs, add_singlevecs): New functions.
	(main): Call add_some_intvecs twice.
	* gdb.base/gnu_vector.exp: Drop GCC version check; just attempt
	the compile and exit upon failure.  Try compiling for the "native"
	architecture.  Test inferior function calls with vector arguments
	and vector return value handling with "finish" and "return".
2015-06-17 11:17:07 +02:00
GDB Administrator 490b7f752c Automatic date update in version.in 2015-06-17 00:00:07 +00:00
Nicolas Pitre 451133cefa gas: section name substitution sequence
This patch adds the ability to automatically construct a section name
based on the prior section.

When gas is invoked with --sectname-subst, the occurrence of %S in a
section name will be substituted by the name of the current section. For
example:

	.macro exception_code
	.pushsection %S.exception
	[exception code here]
	.popsection
	.endm

	.text
	[code]
	exception_code
	[...]

	.section .init
	[init code]
	exception_code
	[...]

The first and second exception_code invocations create the
.text.exception and the .init.exception sections respectively.  This is
useful e.g. to discriminate between anciliary sections that are tied to
.init code and can be discarded at run time when initialization is over
vs anciliary sections tied to .text sections that need to stay resident.

	* as.c (show_usage): Document --sectname-subst.
	(parse_args): Add --sectname-subst.
	* as.h (flag_sectname_subst): New.
	* config/obj-elf.c (obj_elf_section_name): Add %S substitution.
	* doc/as.texinfo: Document it.
2015-06-17 08:52:00 +09:30
Michael Eager 4da680addb GDB Namespaces - Define MSG_CMSG_CLOEXEC if not defined.
2015-06-16  Michael Eager  <eager@eagercon.com>

	* nat/linux-namespaces.c (MSG_CMSG_CLOEXEC): Define if not defined.
2015-06-16 07:18:03 -07:00
Patrick Palka 0a75489fab Call target_terminal_ours_for_output() before refreshing TUI's frame info
In some cases tui_show_frame_info() may get called while the inferior's
terminal settings are still in effect.  But when we call this function
we absolutely need to have our terminal settings in effect because the
function is responsible for redrawing TUI's windows following a change
in the selected frame or a change in the PC.  If our terminal settings
are not in effect, the screen does not get redrawn properly, causing
temporary display artifacts (which can be fixed via ^L).

This scenario happens most prominently when stepping through a program
in TUI while a watchpoint is in effect.

Here is an example backtrace for when tui_show_frame_info() gets called
while target_terminal_is_inferior() == 1:

  #1  0x00000000004988ee in tui_selected_frame_level_changed_hook (level=0)
  #2  0x0000000000617b99 in select_frame (fi=0x18c9820)
  #3  0x0000000000617c3f in get_selected_frame (message=message@entry=0x0)
  #4  0x00000000004ce534 in update_watchpoint (b=b@entry=0x2d9a760,
      reparse=reparse@entry=0)
  #5  0x00000000004d625e in insert_breakpoints ()
  #6  0x0000000000531cfe in keep_going (ecs=ecs@entry=0x7ffea7884ac0)
  #7  0x00000000005326d7 in process_event_stop_test (ecs=ecs@entry=0x7ffea7884ac0)
  #8  0x000000000053596e in handle_inferior_event_1 (ecs=0x7ffea7884ac0)

The fix is simple: call target_terminal_ours_for_output() before calling
tui_show_frame_info() in TUI's frame-changed hook, making sure to
restore the original terminal settings afterwards.

gdb/ChangeLog:

	* tui/tui-hooks.c (tui_selected_frame_level_changed_hook): Call
	target_terminal_ours_for_output() before calling
	tui_show_frame_info(), and restore the original terminal
	settings afterwards.
2015-06-16 09:31:05 -04:00
Matthew Wahab bdfa8b951b [AArch64] Support id_mmfr4 system register
2015-06-16  Matthew Wahab  <matthew.wahab@arm.com>
opcodes/
  * aarch64-opc.c (aarch64_sys_regs): Add "id_mmfr4_el1".

gas/testsuite
  * sysreg.d: Add id_mmfr4_el1, update expected output.
  * sysreg.s: Add id_mmfr4_el1.
2015-06-16 14:17:34 +01:00