deliverable/binutils-gdb.git
9 years ago[ARM] Support for ARMv8.1 command line option
Matthew Wahab [Wed, 3 Jun 2015 09:03:50 +0000 (10:03 +0100)] 
[ARM] Support for ARMv8.1 command line option

2015-06-03  Matthew Wahab  <matthew.wahab@arm.com>

gas/
* config/tc-arm.c (arm_archs): Add "armv8.1-a".
* doc/c-arm.texi (ARM Options, -march): Add "armv8.1-a".
* NEWS: Mention ARMv8.1 support.

include/opcode/
* arm.h (FPU_ARCH_CRYPTO_NEON_VFP_ARMV8_1): New.
(ARM_ARCH_V8_1A): New.
(ARM_ARCH_V8_1A_FP): New.
(ARM_ARCH_V8_1A_SIMD): New.
(ARM_ARCH_V8_1A_CRYPTOV1): New.
(ARM_FEATURE_CORE): New.

9 years agoAutomatic date update in version.in
GDB Administrator [Wed, 3 Jun 2015 00:00:09 +0000 (00:00 +0000)] 
Automatic date update in version.in

9 years agoFix Sniff_file to get an aligned view.
Cary Coutant [Tue, 2 Jun 2015 21:12:56 +0000 (14:12 -0700)] 
Fix Sniff_file to get an aligned view.

gold/
* nacl.h (Sniff_file): Switch parameters to get_view to get an
aligned view.

9 years agoFix =thread-exited not showing up when detaching (PR 15564)
Simon Marchi [Tue, 2 Jun 2015 19:32:40 +0000 (15:32 -0400)] 
Fix =thread-exited not showing up when detaching (PR 15564)

I sent a patch in 2013 for this (incorrectly named =thread-created):

  https://cygwin.com/ml/gdb-patches/2013-06/msg00129.html

Tom Tromey was ok with the change, but suggested to add a test as well.
Then I forgot about this patch until today. So here it is again, with the
corresponding test.

The problem is that the =thread-exited event does not appear when detaching
from a local process. It does appear with remote though. It's not a really
big deal, but I'd like it to be consistent.

Tested with local and remote Linux on my Ubuntu 14.04.

gdb/ChangeLog:

PR gdb/15564
* inferior.c (detach_inferior): Call exit_inferior_1 with silent = 0.

gdb/testsuite/ChangeLog:

PR gdb/15564
* gdb.mi/mi-detach.exp: New file.

9 years agoPR 17819: Fix --build-id=tree when using --compress-debug-sections.
Cary Coutant [Tue, 2 Jun 2015 16:45:24 +0000 (09:45 -0700)] 
PR 17819: Fix --build-id=tree when using --compress-debug-sections.

When --build-id=tree is selected, gold would schedule a set of
tasks to run to compute md5 hashes in parallel on chunks of the
file. The scheduling was done before the
Write_after_input_sections_task ran, so if we are compressing
debug sections, the output file will change size and be remapped
to a new address, sometimes causing the build id computation to
crash, but even when it doesn't crash, it wouldn't include the
debug information in the hash computation.

This patch delays the scheduling of the md5 tasks until after
Write_after_input_sections_task.

gold/
        PR gold/17819
        * gold.cc (queue_final_tasks): When --build-id=tree, queue a
        separate task to schedule the build id computation.
        * layout.cc (Hash_task::Hash_task): Remove build_id_blocker,
        add Output_file and offset.
        (Hash_task::run): Get and release the input views.
        (Hash_task::is_runnable): Always return NULL (always runnable).
        (Layout::queue_build_id_tasks): Remove.
        (Layout::write_build_id): Add array_of_hashes and size_of_hashes
        parameters; use them instead of class members.
        (Build_id_task_runner::run): New function.
        (Close_task_runner::run): Pass array_of_hashes and size_of_hashes
        to write_build_id.
        * layout.h (Layout::queue_build_id_tasks): Remove.
        (Layout::write_build_id): Add array_of_hashes and size_of_hashes
        parameters.
        (Layout::array_of_hashes_): Remove.
        (Layout::size_of_array_of_hashes_): Remove.
        (Layout::input_view_): Remove.
        (Build_id_task_runner): New class.
        (Close_task_runner::Close_task_runner): Add array_of_hashes and
        size_of_hashes parameters.
        (Close_task_runner::array_of_hashes_): New data member.
        (Close_task_runner::size_of_hashes_): New data member.
        * testsuite/Makefile.am
        (flagstest_compress_debug_sections_and_build_id_tree): New test.
        * testsuite/Makefile.in: Regenerate.

9 years ago[AArch64] Fix typo in testcase
Jiong Wang [Tue, 2 Jun 2015 12:59:17 +0000 (13:59 +0100)] 
[AArch64] Fix typo in testcase

ld/testsuite/
  * ld-aarch64/emit-relocs-313.s: Use gotpage_lo15.

9 years ago[ARM] Support for ARMv8.1 Adv.SIMD extension
Matthew Wahab [Tue, 2 Jun 2015 11:35:21 +0000 (12:35 +0100)] 
[ARM] Support for ARMv8.1 Adv.SIMD extension

9 years ago[ARM] Add support for ARMv8.1 PAN extension
Matthew Wahab [Tue, 2 Jun 2015 11:30:38 +0000 (12:30 +0100)] 
[ARM] Add support for ARMv8.1 PAN extension

9 years ago[ARM] Rework CPU feature selection in the disassembler
Matthew Wahab [Tue, 2 Jun 2015 11:24:24 +0000 (12:24 +0100)] 
[ARM] Rework CPU feature selection in the disassembler

include/opcode/
* arm.h (ARM_FEATURE_ALL): New.

opcodes/
* arm-dis.c (select_arm_features): Rework to avoid used of
redefined macros.

9 years ago[AArch64] Support for ARMv8.1a Adv.SIMD instructions
Matthew Wahab [Tue, 2 Jun 2015 11:20:00 +0000 (12:20 +0100)] 
[AArch64] Support for ARMv8.1a Adv.SIMD instructions

2015-06-02  Matthew Wahab  <matthew.wahab@arm.com>

gas/
  * config/tc-aarch64.c (aarch64_features): Add "rdma".
  * doc/c-aarch64.texi (AArch64 Extensions): Add "rdma".

gas/testsuite/
  * rdma-directive.d: New.
  * rdma.d: New.
  * rdma.s: New.

include/opcode/
  * aarch64.h (AARCH64_FEATURE_RDMA): New.

opcode/
  * aarch64-tbl.h (aarch64_feature_rdma): New.
  (RDMA): New.
  (aarch64_opcode_table): Add "sqrmlah" and "sqrdmlsh" instructions.
  * aarch64-asm-2.c: Regenerate.
  * aarch64-dis-2.c: Regenerate.
  * aarch64-opc-2.c: Regenerate.

9 years ago[AArch64] Support for ARMv8.1a Limited Ordering Regions extension
Matthew Wahab [Tue, 2 Jun 2015 10:29:15 +0000 (11:29 +0100)] 
[AArch64] Support for ARMv8.1a Limited Ordering Regions extension

2015-06-02  Matthew Wahab  <matthew.wahab@arm.com>
include/
  * aarch64.h (AARCH64_FEATURE_LOR): New.

opcodes/
  * aarch64-tbl.h (aarch64_feature_lor): New.
  (LOR): New.
  (aarch64_opdocde_table): Add "ldlar", "ldlarb", "ldlarh", "stllr",
  "stllrb", "stllrh".
  * aarch64-asm-2.c: Regenerate.
  * aarch64-dis-2.c: Regenerate.
  * aarch64-opc-2.c: Regenerate.

gas/
  * config/tc-aarch64.c (aarch64_features): Add "lor".
  * doc/c-aarch64.c (Aarch64 Extensions): Add "lor" to list of
  architecture extensions.

gas/testsuite/
  * lor-directive.d: New.
  * lor.d: New.
  * lor.s: New.

9 years agoInclude linux-nat.h in i386-linux-nat.c
Yao Qi [Tue, 2 Jun 2015 09:28:03 +0000 (10:28 +0100)] 
Include linux-nat.h in i386-linux-nat.c

This commit fixes a build failure on i386-linux.

gdb:

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

* i386-linux-nat.c: Include linux-nat.h.

9 years agoUse a std::vector instead of a std::map to hold Input_merge_map.
Rafael Ávila de Espíndola [Tue, 2 Jun 2015 02:47:20 +0000 (22:47 -0400)] 
Use a std::vector instead of a std::map to hold Input_merge_map.

A std::map is hardly the best data structure for a small map from small
integers.

9 years agoAutomatic date update in version.in
GDB Administrator [Tue, 2 Jun 2015 00:00:08 +0000 (00:00 +0000)] 
Automatic date update in version.in

9 years ago[AArch64][GAS] Add support for PAN architecture extension
Matthew Wahab [Mon, 1 Jun 2015 15:05:58 +0000 (16:05 +0100)] 
[AArch64][GAS] Add support for PAN architecture extension

2015-06-01  Matthew Wahab  <matthew.wahab@arm.com>
gas/
* config/tc-aarch64.c (parse_sys_reg): New parameter.  Check
target support.  Fix whitespace.
(parse_operands): Update for parse_sys_reg changes.
(aarch64_features): Add "pan".
* doc/c-aarch64.texi (Aarch64 Extensions): Add "pan".

gas/testsuite/
* pan-directive.d: New.
* pan.d: New.
* pan.s: New

9 years ago[AArch64][libopcode] Add support for PAN architecture extension
Matthew Wahab [Mon, 1 Jun 2015 15:00:28 +0000 (16:00 +0100)] 
[AArch64][libopcode] Add support for PAN architecture extension

The ARMv8.1 architecture introduced the Privileged Access Never extension. This
adds a processor state field PSTATE.PAN which can be accessed using the MRS/MSR
instructions.

This patch adds support for the PAN architecture feature and processor state
field to libopcode.

include/opcode
2015-06-01  Matthew Wahab  <matthew.wahab@arm.com>

* aarch64.h (AARCH64_FEATURE_PAN): New.
(aarch64_sys_reg_supported_p): Declare.
(aarch64_pstatefield_supported_p): Declare.

opcodes/
2015-06-01  Matthew Wahab  <matthew.wahab@arm.com>
* aarch64-opc.c (F_ARCHEXT): New.
(aarch64_sys_regs): Add "pan".
(aarch64_sys_reg_supported_p): New.
(aarch64_pstatefields): Add "pan".
(aarch64_pstatefield_supported_p): New.

9 years ago[AArch64] BFD support BFD_RELOC_AARCH64_LD32_GOTPAGE_LO14
Jiong Wang [Mon, 1 Jun 2015 14:45:25 +0000 (15:45 +0100)] 
[AArch64] BFD support BFD_RELOC_AARCH64_LD32_GOTPAGE_LO14

This patch add BFD_RELOC_AARCH64_LD32_GOTPAGE_LO14 relocation
supoprt in bfd linker.

2015-06-01  Jiong Wang  <jiong.wang@arm.com>

bfd/
  * elfnn-aarch64.c (aarch64_reloc_got_type): Support
  BFD_RELOC_AARCH64_LD32_GOTPAGE_LO14.
  (elfNN_aarch64_final_link_relocate): Ditto.
  (elfNN_aarch64_gc_swap_hook): Ditto.
  (elfNN_aarch64_check_relocs): Ditto.
  * elfxx-aarch64.c (_bfd_aarch64_elf_put_addend): Ditto.

ld/testsuite/
  * ld-aarch64/emit-relocs-28.s: New test file.
  * ld-aarch64/emit-relocs-28.d: Ditto.
  * ld-aarch64/aarch64-elf.exp: Run new test.

9 years ago[AArch64] GAS support BFD_RELOC_AARCH64_LD32_GOTPAGE_LO14
Jiong Wang [Mon, 1 Jun 2015 14:41:54 +0000 (15:41 +0100)] 
[AArch64] GAS support BFD_RELOC_AARCH64_LD32_GOTPAGE_LO14

This patch add BFD_RELOC_AARCH64_LD32_GOTPAGE_LO14 support in Gas.

The relocation modifier
===
  :gotpage_lo14:symbol

2015-06-01 Jiong.Wang <jiong.wang@arm.com>

bfd/
  * reloc.c (BFD_RELOC_AARCH64_LD32_GOTPAGE_LO14): New entry.
  * bfd-in2.h: Regenerate.
  * libbfd.h: Regenerate.
  * elfnn-aarch64.c (elfNN_aarch64_howto_table): New entry for
  BFD_RELOC_AARCH64_LD32_GOTPAGE_LO14.

gas/
  * config/tc-aarch64.c (reloc_table): New relocation modifiers.
  (md_apply_fix): Support BFD_RELOC_AARCH64_LD32_GOTPAGE_LO14.
  (aarch64_force_relocation): Ditto.

gas/testsuite/
  * gas/aarch64/ilp32-basic.s: New testcase.
  * gas/aarch64/ilp32-basic.d: Ditto.

9 years agoPR symtab/18392
Jan Kratochvil [Mon, 1 Jun 2015 12:02:34 +0000 (14:02 +0200)] 
PR symtab/18392

Initially there is some chain (let's say the longest one
but that doe snot matter).  Consequently its elements from the middle are
being removed and there remains only some few unambiguous top and bottom ones.

The original idea why the comparison should be sharp ("<") was that if there
are multiple chains like (0xaddr show jmp instruction address):
        main(0x100) -> a(0x200) -> d(0x400)
        main(0x100) -> a(0x200) -> c(0x300) -> d(0x400)
then - such situation cannot exist - if two jmp instructions in "a" have the
same address they must also jump to the same address (*).

(*) jump to a computed address would be never considered for the DWARF
    tail-call records.

So there could be:
        main(0x100) -> a(0x200) -> d(0x400)
        main(0x100) -> a(0x270) -> c(0x300) -> d(0x400)
But then "a" frame itself is ambiguous and it must not be displayed.

I did not realize that there can be self-tail-call:
        main(0x100) -> a(0x200) -> d(0x400)
        main(0x100) -> a(0x280) -> a(0x200) -> d(0x400)
which intersects to:
        main(0x100) -> <???>? -> a(0x200) -> d(0x400)
And so if the first chain was chosen the
        main(0x100) -> a(0x200) -> d(0x400)
then the final intersection has callers+callees==length.

> for example, if CALLERS is 3 and
> CALLEES is 2, what does the chain look like?

main(0x100) -> x(0x150) -> y(0x200) -> <???>? -> a(0x200) -> d(0x400)

And if LENGTH is 7 then:
        call_site[0] = main(0x100)
        call_site[1] = x(0x150)
        call_site[2] = y(0x200)
        call_site[3] = garbage
        call_site[4] = garbage
        call_site[5] = a(0x200)
        call_site[6] = d(0x400)

gdb/ChangeLog
2015-06-01  Andreas Schwab  <schwab@linux-m68k.org>
    Jan Kratochvil  <jan.kratochvil@redhat.com>

PR symtab/18392
* dwarf2-frame-tailcall.c (pretended_chain_levels): Correct
assertion.
* dwarf2loc.c (chain_candidate): Likewise.

gdb/testsuite/ChangeLog
2015-06-01  Jan Kratochvil  <jan.kratochvil@redhat.com>

PR symtab/18392
* gdb.arch/amd64-tailcall-self.S: New file.
* gdb.arch/amd64-tailcall-self.c: New file.
* gdb.arch/amd64-tailcall-self.exp: New file.

9 years agoFetch and store VFP registers by PTRACE_{G,S}ETREGSET
Yao Qi [Mon, 1 Jun 2015 11:13:02 +0000 (12:13 +0100)] 
Fetch and store VFP registers by PTRACE_{G,S}ETREGSET

This patch is to use PTRACE_{G,S}ETREGSET to fetch and store VFP
registers if kernel supports.

gdb:

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

* arm-linux-nat.c (fetch_vfp_regs): Use PTRACE_GETREGSET.
(store_vfp_regs): Use PTRACE_SETREGSET.

9 years agoFetch and store FP registers by PTRACE_{G,S}ETREGSET
Yao Qi [Mon, 1 Jun 2015 11:13:02 +0000 (12:13 +0100)] 
Fetch and store FP registers by PTRACE_{G,S}ETREGSET

If kernel supports PTRACE_GETREGSET, GDB uses PTRACE_{G,S}ETREGSET
to fetch and store FP registers.

gdb:

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

* arm-linux-nat.c (fetch_fpregister): Use PTRACE_GETREGSET.
(fetch_fpregs): Likewise.
* arm-linux-nat.c (store_fpregister): Use PTRACE_SETREGSET.
(store_fpregs): Likewise.

9 years agoFetch and store GP registers by PTRACE_{G,S}ETREGSET
Yao Qi [Mon, 1 Jun 2015 11:13:02 +0000 (12:13 +0100)] 
Fetch and store GP registers by PTRACE_{G,S}ETREGSET

If kernel supports PTRACE_GETREGSET, GDB uses PTRACE_{G,S}ETREGSET
to fetch and store GP registers.

gdb:

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

* arm-linux-nat.c (fetch_register): Use PTRACE_GETREGSET.
(fetch_regs): Likewise.
(store_regs): Use PTRACE_SETREGSET.
(store_register): Likewise.

9 years agoCheck whether kernel supports PTRACE_GETREGSET
Yao Qi [Mon, 1 Jun 2015 11:13:02 +0000 (12:13 +0100)] 
Check whether kernel supports PTRACE_GETREGSET

gdb:

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

* arm-linux-nat.c (arm_linux_read_description): Check whether
kernel supports PTRACE_GETREGSET.

9 years agoMove have_ptrace_getregset to linux-nat.c
Yao Qi [Mon, 1 Jun 2015 11:13:02 +0000 (12:13 +0100)] 
Move have_ptrace_getregset to linux-nat.c

I'll let arm-linux-nat.c to use PTRACE_GETREGSET if kernel supports,
so this patch is to move have_ptrace_getregset from x86-linux-nat.c
to linux-nat.c.

gdb:

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

* x86-linux-nat.c (have_ptrace_getregset): Move it to ...
* linux-nat.c: ... here.
* x86-linux-nat.h (have_ptrace_getregset): Move the declaration
to ...
* linux-nat.h: ... here.

9 years agoMove PTRACE_GETREGSET and PTRACE_SETREGSET to nat/linux-ptrace.h
Yao Qi [Mon, 1 Jun 2015 11:13:02 +0000 (12:13 +0100)] 
Move PTRACE_GETREGSET and PTRACE_SETREGSET to nat/linux-ptrace.h

Macros PTRACE_GETREGSET and PTRACE_SETREGSET are defined locally in
some places in GDB and GDBserver.  This patch is to move them to
nat/linux-ptrace.h to avoid duplication.

gdb:

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

* amd64-linux-nat.c: Include "nat/linux-ptrace.h".
* i386-linux-nat.c: Likewise.
* nat/linux-ptrace.h (PTRACE_GETREGSET, PTRACE_SETREGSET): Define.
* s390-linux-nat.c: Include "nat/linux-ptrace.h".
(PTRACE_GETREGSET, PTRACE_SETREGSET): Remove.
* x86-linux-nat.c: Include "nat/linux-ptrace.h".
* x86-linux-nat.h (PTRACE_GETREGSET, PTRACE_SETREGSET): Remove.

gdb/gdbserver:

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

* linux-s390-low.c (PTRACE_GETREGSET, PTRACE_SETREGSET): Remove.
* linux-x86-low.c: Likewise.

9 years agox86/Intel: fix i386_optab[] for vcvt{,u}si2s{d,s}
Jan Beulich [Mon, 1 Jun 2015 09:40:28 +0000 (11:40 +0200)] 
x86/Intel: fix i386_optab[] for vcvt{,u}si2s{d,s}

opcodes/
2015-06-01  Jan Beulich  <jbeulich@suse.com>

* i386-tbl.h: Regenerate.

9 years ago[AArch64] BFD_RELOC_AARCH64_TLSLE_ADD_LO12 should enable overflow check
Jiong Wang [Mon, 1 Jun 2015 09:31:38 +0000 (10:31 +0100)] 
[AArch64] BFD_RELOC_AARCH64_TLSLE_ADD_LO12 should enable overflow check

BFD_RELOC_AARCH64_TLSLE_ADD_LO12 is used to generate simplest
one-instruction addressing for TLS LE model when tls size is smaller
4K. Linker need to make sure there is no TLS offset overflow.

2015-06-01  Jiong Wang  <jiong.wang@arm.com>

bfd/
  * elfnn-aarch64.c (elfNN_aarch64_howto_table): Set overflow type to
  complain_overflow_unsigned for BFD_RELOC_AARCH64_TLSLE_ADD_LO12.
  * elfxx-aarch64.c (_bfd_aarch64_elf_resolve_relocation): Don't use
  PGOFF for BFD_RELOC_AARCH64_TLSLE_ADD_LO12, that will mask off all
  potential high overflowed bits.

ld/testsuite/
  * ld-aarch64/tprel_add_lo12_overflow.s: New testcase.
  * ld-aarch64/tprel_add_lo12_overflow.d: Nex expectation file.
  * ld-aarch64/aarch64-elf.exp: Run new testcase.

9 years ago[AArch64] BFD Support BFD_RELOC_AARCH64_LD64_GOTPAGE_LO15
Jiong Wang [Mon, 1 Jun 2015 09:26:00 +0000 (10:26 +0100)] 
[AArch64] BFD Support BFD_RELOC_AARCH64_LD64_GOTPAGE_LO15

2015-06-01  Jiong Wang  <jiong.wang@arm.com>
bfd/
* elfnn-aarch64.c (aarch64_reloc_got_type): Support
BFD_RELOC_AARCH64_LD64_GOTPAGE_LO15.
(elfNN_aarch64_final_link_relocate): Ditto.
(elfNN_aarch64_gc_swap_hook): Ditto.
(elfNN_aarch64_check_relocs): Ditto.
* elfxx-aarch64.c (_bfd_aarch64_elf_put_addend): Ditto.

ld/testsuite/
* ld-aarch64/emit-relocs-313.s: New test file.
* ld-aarch64/emit-relocs-313.d: Ditto.
* ld-aarch64/aarch64-elf.exp: Run new test.

9 years ago[AArch64] GAS Support BFD_RELOC_AARCH64_LD64_GOTPAGE_LO15
Jiong Wang [Mon, 1 Jun 2015 09:22:15 +0000 (10:22 +0100)] 
[AArch64] GAS Support BFD_RELOC_AARCH64_LD64_GOTPAGE_LO15

2015-06-01 Jiong.Wang <jiong.wang@arm.com>

bfd/
  * reloc.c (BFD_RELOC_AARCH64_LD64_GOTPAGE_LO15): New entry.
  * bfd-in2.h: Regenerate.
  * libbfd.h: Regenerate.
  * elfnn-aarch64.c (elfNN_aarch64_howto_table): New entry for
  BFD_RELOC_AARCH64_LD64_GOTPAGE_LO15.

gas/
  * config/tc-aarch64.c (reloc_table): New relocation modifiers.
  (md_apply_fix): Support BFD_RELOC_AARCH64_LD64_GOTPAGE_LO15.
  (aarch64_force_relocation): Ditto.

gas/testsuite/
  * gas/aarch64/reloc-insn.s: New testcase.
  * gas/aarch64/reloc-insn.d: Ditto.

9 years agox86/Intel: disassemble vcvt{,u}si2s{d,s} with correct operand order
Jan Beulich [Mon, 1 Jun 2015 07:51:28 +0000 (09:51 +0200)] 
x86/Intel: disassemble vcvt{,u}si2s{d,s} with correct operand order

As pointed out before, the documentation mandates the rounding mode to
follow the GPR, so disassembler should produce output accordingly.

gas/testsuite/
2015-06-01  Jan Beulich  <jbeulich@suse.com>

* gas/i386/avx512f.s: Adjust operand order for Intel syntax
vcvt{,u}si2ss.
* gas/i386/x86-64-avx512f.s: Adjust operand order for Intel
syntax vcvt{,u}si2s{d,s}.

opcodes/
2015-06-01  Jan Beulich  <jbeulich@suse.com>

* i386-dis.c (print_insn): Swap rounding mode specifier and
general purpose register in Intel mode.

9 years agox86/Intel: accept mandated operand order for vcvt{,u}si2s{d,s}
Jan Beulich [Mon, 1 Jun 2015 07:50:00 +0000 (09:50 +0200)] 
x86/Intel: accept mandated operand order for vcvt{,u}si2s{d,s}

As pointed out before, the documentation mandates the rounding mode to
follow the GPR, so gas should accept such input. As the brojen code got
released already we sadly will need to continue to also accept the
badly ordered operands.

gas/testsuite/
2015-06-01  Jan Beulich  <jbeulich@suse.com>

* gas/i386/avx512f-intel.d: Adjust expectations on operand order.
* gas/i386/evex-lig256-intel.d: Likewise.
* gas/i386/evex-lig512-intel.d: Likewise.
* gas/i386/x86-64-avx512f-intel.d: Likewise.
* gas/i386/x86-64-evex-lig256-intel.d: Likewise.
* gas/i386/x86-64-evex-lig512-intel.d: Likewise.

opcodes/
2015-06-01  Jan Beulich  <jbeulich@suse.com>

* i386-opc.tbl: New IntelSyntax entries for vcvt{,u}si2s{d,s}.
* i386-tbl.h: Regenerate.

9 years agoAutomatic date update in version.in
GDB Administrator [Mon, 1 Jun 2015 00:00:08 +0000 (00:00 +0000)] 
Automatic date update in version.in

9 years agoAutomatic date update in version.in
GDB Administrator [Sun, 31 May 2015 00:00:07 +0000 (00:00 +0000)] 
Automatic date update in version.in

9 years agoUnbreak DJGPP build of GDB.
Eli Zaretskii [Sat, 30 May 2015 10:05:53 +0000 (13:05 +0300)] 
Unbreak DJGPP build of GDB.

gdb/
* go32-nat.c (go32_xfer_memory): Fix the return value to be
compatible to what read_child and write_child return.  This
unbreaks that DJGPP build of GDB which was broken since v7.7.

9 years agoAutomatic date update in version.in
GDB Administrator [Sat, 30 May 2015 00:00:12 +0000 (00:00 +0000)] 
Automatic date update in version.in

9 years agoAdd myself to the Write After Approval list.
Martin Galvan [Fri, 29 May 2015 23:44:22 +0000 (20:44 -0300)] 
Add myself to the Write After Approval list.

9 years agoPR gdb/18464: Do not crash on unrecognized GNU .note.ABI-tag values
Roland McGrath [Fri, 29 May 2015 16:24:36 +0000 (09:24 -0700)] 
PR gdb/18464: Do not crash on unrecognized GNU .note.ABI-tag values

Diagnosis of unexpected input (in this case, in an executable file)
should not crash as if it were a bug in GDB.

gdb/
PR gdb/18464
* osabi.c (generic_elf_osabi_sniff_abi_tag_sections): Use warning
rather than internal_error for an unrecognized value.

9 years agoRecognize GNU_ABI_TAG_SYLLABLE and GNU_ABI_TAG_NACL.
Roland McGrath [Fri, 29 May 2015 16:13:53 +0000 (09:13 -0700)] 
Recognize GNU_ABI_TAG_SYLLABLE and GNU_ABI_TAG_NACL.

binutils/
* readelf.c (print_gnu_note: NT_GNU_ABI_TAG): Recognize
GNU_ABI_TAG_SYLLABLE and GNU_ABI_TAG_NACL.

include/elf/
* common.h (GNU_ABI_TAG_SYLLABLE): New macro.
(GNU_ABI_TAG_NACL): New macro.

9 years agoFix building PE test executables in environments where $CFLAGS is needed.
Stephen Kitt [Fri, 29 May 2015 10:51:41 +0000 (11:51 +0100)] 
Fix building PE test executables in environments where $CFLAGS is needed.

* ld-pe/pe-run2.exp (test_direct2_link_dll): Add $CFLAGS to the
compiler command line.

9 years agoxtensa: fix access to the last pseudo register
Max Filippov [Sun, 17 May 2015 22:39:40 +0000 (01:39 +0300)] 
xtensa: fix access to the last pseudo register

Currently access to the last pseudo register is aliased to a1. This is
done by little snippets in the beginning of xtensa_pseudo_register_read
and xtensa_pseudo_register_write that used to do such aliasing for FP
register since bdb4c075a29dd086f0868b394b488b1c94666be6, but then
FP_ALIAS was expanded into gdbarch_num_regs (current_gdbarch) +
gdbarch_num_pseudo_regs (current_gdbarch) (one register past the last
pseudo register) in 304fe2552d6e0821e8fdb7575f8e7ba6607a076d, which
then was changed to the last pseudo register in
94a0e877111421d300d26b858bd3a0a27078d1e8.

Drop these snippets.

2015-05-29  Max Filippov  <jcmvbkbc@gmail.com>
gdb/
* xtensa-tdep.c (xtensa_pseudo_register_read)
(xtensa_pseudo_register_write): Don't alias last pseudo register
to a1.

9 years agoFixes a couple of bugs reported in dlltool.
Stephen Kitt [Fri, 29 May 2015 10:03:03 +0000 (11:03 +0100)] 
Fixes a couple of bugs reported in dlltool.

* dlltool.c (make_one_lib_file): Clear .idata$6 before use.
(main): Fail if the output file specified by the -z option cannot
be opened.

9 years agoAutomatic date update in version.in
GDB Administrator [Fri, 29 May 2015 00:00:08 +0000 (00:00 +0000)] 
Automatic date update in version.in

9 years agoCompact EH Support
Catherine Moore [Thu, 28 May 2015 21:50:36 +0000 (14:50 -0700)] 
Compact EH Support

The specification for the Compact EH format is available at:
https://github.com/MentorEmbedded/cxx-abi/blob/master/MIPSCompactEH.pdf

2015-05-28  Catherine Moore  <clm@codesourcery.com>
    Bernd Schmidt <bernds@codesourcery.com>
    Paul Brook <paul@codesourcery.com>

bfd/
* bfd-in2.h: Regenerated.
* elf-bfd.h (DWARF2_EH_HDR, COMPACT_EH_HDR): Define.
(COMPACT_EH_CANT_UNWIND_OPCODE): Define.
(dwarf_eh_frame_hdr_info): Move dwarf-specific fields from
eh_frame_hdr_info.
(compact_eh_frame_hdr_info): Declare.
(eh_frame_hdr_info):  Redeclare with union for dwarf-specific
fields and compact-eh fields.
(elf_backend_data): Add cant_unwind_opcode and compact_eh_encoding.
(bfd_elf_section_data): Add eh_frame_entry_field.
(elf_section_eh_frame_entry): Define.
(bfd_elf_parse_eh_frame_entries): Declare.
(_bfd_elf_parse_eh_frame_entry): Declare.
(_bfd_elf_end_eh_frame_parsing): Declare.
(_bfd_elf_write_section_eh_frame_entry): Declare.
(_bfd_elf_eh_frame_entry_present): Declare.
(_bfd_elf_section_for_symbol): Declare.
* elf-eh-frame.c (bfd_elf_discard_eh_frame_entry): New function.
(bfd_elf_record_eh_frame_entry): New function.
(_bfd_elf_parse_eh_frame_entry): New function.
(_bfd_elf_parse_eh_frame): Update hdr_info field references.
(cmp_eh_frame_hdr): New function.
(add_eh_frame_hdr_terminator): New function.
(_bfd_elf_end_eh_frame_parsing): New function.
(find_merged_cie): Update hdr_info field references.
(_bfd_elf_discard_section_eh_frame): Likewise.
(_bfd_elf_discard_section_eh_frame_hdr): Add Compact EH support.
(_bfd_elf_eh_frame_entry_present): New function.
(_bfd_elf_maybe_strip_eh_frame_hdr): Add Compact EH support.
(_bfd_elf_write_section_eh_frame_entry): New function.
(_bfd_elf_write_section_eh_frame): Update hdr_info field references.
(_bfd_elf_fixup_eh_frame_hdr): New function.
(write_compact_eh_frame_hdr): New function.
(write_dwarf_eh_frame_hdr): New function.
(_bfd_elf_write_section_eh_frame_hdr): Add Compact EH support.
* elflink.c (_bfd_elf_section_for_symbol): New function.
(elf_section_ignore_discarded_relocs): Add Compact EH support.
(elf_link_input_bfd): Likewise.
(bfd_elf_final_link): Likewise.
(_bfd_elf_gc_mark): Likewise.
(bfd_elf_parse_eh_frame_entries): New function.
(bfd_elf_gc_sections): Add Compact EH support.
(bfd_elf_discard_info): Likewise.
* elfxx-mips.c: Include dwarf2.h.
(_bfd_mips_elf_compact_eh_encoding): New function.
(_bfd_mips_elf_cant_unwind_opcode): New function.
* elfxx-mips.h (_bfd_mips_elf_compact_eh_encoding): Declare.
(_bfd_mips_elf_cant_unwind_opcode): Declare.
(elf_backend_compact_eh_encoding): Define.
(elf_backend_cant_unwind_opcode): Define.
* elfxx-target.h (elf_backend_compact_eh_encoding): Provide default.
(elf_backend_cant_unwind_opcode): Provide default.
(elf_backend_data elfNN_bed): Add elf_backend_compact_eh_encoding and
elf_backend_cant_unwind_opcode.
* section.c (SEC_INFO_TYPE_EH_FRAME_ENTRY): Add definition.

gas/
* config/tc-alpha.c (all_cfi_sections): Declare.
(s_alpha_ent): Initialize all_cfi_sections.
(alpha_elf_md_end): Invoke cfi_set_sections.
* config/tc-mips.c (md_apply_fix):  Handle BFD_RELOC_NONE.
(s_ehword): Use BFD_RELOC_32_PCREL.
(mips_fix_adjustable): Handle BFD_RELOC_32_PCREL.
(mips_cfi_reloc_for_encoding): New function.
* tc-mips.h (DWARF2_FDE_RELOC_SIZE): Redefine.
(DWARF2_FDE_RELOC_ENCODING): Define.
(tc_cfi_reloc_for_encoding): Define.
(mips_cfi_reloc_for_encoding): Define.
(tc_compact_eh_opcode_stop): Define.
(tc_compact_eh_opcode_pad): Define.
* doc/as.texinfo: Document Compact EH extensions.
* doc/internals.texi: Likewise.
* dw2gencfi.c (EH_FRAME_LINKONCE): Redefine.
(tc_cfi_reloc_for_encoding): Provide default.
(compact_eh): Declare.
(emit_expr_encoded): New function.
(get_debugseg_name): Add Compact EH support.
(alloc_debugseg_item): Likewise.
(cfi_set_sections): New function.
(dot_cfi_fde_data): New function.
(dot_cfi_personality_id): New function.
(dot_cfi_inline_lsda): New function.
(cfi_pseudo_table): Add cfi_fde_data, cfi_personality_id,
and cfi_inline_lsda.
(dot_cfi_personality): Add Compact EH support.
(dot_cfi_lsda): Likewise.
(dot_cfi_sections): Likewise.
(dot_cfi_startproc): Likewise.
(get_cfi_seg): Likewise.
(output_compact_unwind_data): New function.
(output_cfi_insn): Add Compact EH support.
(output_cie): Likewise.
(output_fde): Likewise.
(cfi_finish): Likewise.
(cfi_emit_eh_header): New function.
(output_eh_header): New function.
* dw2gencfi.h (cfi_set_sections): Declare.
(SUPPORT_COMPACT_EH): Define.
(MULTIPLE_FRAME_SECTIONS): Define.
New enumeration to describe the Compact EH header format.
(fde_entry): Add new fields personality_id, eh_header_type, eh_data_size,
eh_data, eh_loc and sections.
(CFI_EMIT_eh_frame, CFI_EMIT_debug_frame, CFI_EMIT_target,
CFI_EMIT_eh_frame_compact): Define.

2015-05-22  Catherine Moore  <clm@codesourcery.com>
    Bernd Schmidt <bernds@codesourcery.com>

gas/testsuite/
* gas/mips/mips.exp: Run new tests.

* gas/mips/compact-eh-1.s: New file.
* gas/mips/compact-eh-2.s: New file.
* gas/mips/compact-eh-3.s: New file.
* gas/mips/compact-eh-4.s: New file.
* gas/mips/compact-eh-5.s: New file.
* gas/mips/compact-eh-6.s: New file.
* gas/mips/compact-eh-7.s: New file.
* gas/mips/compact-eh-eb-1.d: New file.
* gas/mips/compact-eh-eb-2.d: New file.
* gas/mips/compact-eh-eb-3.d: New file.
* gas/mips/compact-eh-eb-4.d: New file.
* gas/mips/compact-eh-eb-5.d: New file.
* gas/mips/compact-eh-eb-6.d: New file.
* gas/mips/compact-eh-eb-7.d: New file.
* gas/mips/compact-eh-el-1.d: New file.
* gas/mips/compact-eh-el-2.d: New file.
* gas/mips/compact-eh-el-3.d: New file.
* gas/mips/compact-eh-el-4.d: New file.
* gas/mips/compact-eh-el-5.d: New file.
* gas/mips/compact-eh-el-6.d: New file.
* gas/mips/compact-eh-el-7.d: New file.
* gas/mips/compact-eh-err1.l: New file.
* gas/mips/compact-eh-err1.s: New file.
* gas/mips/compact-eh-err2.l: New file.
* gas/mips/compact-eh-err2.s: New file.

2015-05-22  Catherine Moore  <clm@codesourcery.com>

include/
* bfdlink.h: Rename eh_frame_hdr to eh_frame_hdr_type.

2015-05-22  Catherine Moore  <clm@codesourcery.com>
    Paul Brook <paul@codesourcery.com>

ld/
* emultempl/elf32.em (gld${EMULATION_NAME}_after_open):
Add Compact EH support.
* scripttempl/elf.sc: Handle .eh_frame_entry and .gnu_extab
sections.

2015-05-22  Catherine Moore  <clm@codesourcery.com>

ld/testsuite/
* ld-mips-elf/compact-eh.ld: New linker script.
* ld-mips-elf/compact-eh1.d: New.
* ld-mips-elf/compact-eh1.s: New.
* ld-mips-elf/compact-eh1a.s: New.
* ld-mips-elf/compact-eh1b.s: New.
* ld-mips-elf/compact-eh2.d: New.
* ld-mips-elf/compact-eh2.s: New.
* ld-mips-elf/compact-eh3.d: New.
* ld-mips-elf/compact-eh3.s: New.
* ld-mips-elf/compact-eh3a.s: New.
* ld-mips-elf/compact-eh4.d: New.
* ld-mips-elf/compact-eh5.d: New.
* ld-mips-elf/compact-eh6.d: New.
* ld-mips-elf/mips-elf.exp: Run new tests.

9 years agoDisable exec-dependent follow vfork tests for remote
Don Breazeal [Thu, 28 May 2015 20:36:05 +0000 (13:36 -0700)] 
Disable exec-dependent follow vfork tests for remote

The native-extended-gdbserver target now supports fork events and
follow fork, but it does not yet support exec events.  Some of the
tests in gdb.base/foll-vfork.exp depend on exec events.  This patch
disables those tests for remote targets.  We can re-enable these
once the exec event support goes in.

gdb/testsuite/

* gdb.base/foll-vfork.exp (main): Disable exec-dependent
tests for remote targets by checking is_target_gdbserver.

9 years agoInitialize last_resume_kind for remote fork child
Don Breazeal [Thu, 28 May 2015 20:12:01 +0000 (13:12 -0700)] 
Initialize last_resume_kind for remote fork child

This patch fixes some intermittent test failures in
gdb.base/foll-vfork.exp where a vfork child would be (incorrectly)
resumed when handling the vfork event.  In this case the result
was a subsequent event reported to the client side as a SIGTRAP
delivered to the as-yet-unknown child thread.

The new thread was resumed (incorrectly) in linux-low.c when
resume_stopped_resumed_lwps was called from
linux_wait_for_event_filtered after the vfork event had been
handled in handle_extended_wait.

Gdbserver/linux-low.c's add_thread function creates threads with
last_resume_kind == resume_continue by default.  This field is
used by resume_stopped_resumed_lwps to decide whether to perform
the resume:

static void
resume_stopped_resumed_lwps (struct inferior_list_entry *entry) {
  struct thread_info *thread = (struct thread_info *) entry;
  struct lwp_info *lp = get_thread_lwp (thread);

  if (lp->stopped
      && !lp->status_pending_p
      && thread->last_resume_kind != resume_stop
      && thread->last_status.kind == TARGET_WAITKIND_IGNORE)
    {

So the fix is to make sure to set thread->last_resume_kind to
resume_stop.  Here we do that for new fork children in
gdbserver/linux-low.c:handle_extended_wait.

In addition, it seemed prudent to initialize lwp_info.status_pending_p
for the new fork child.  I also rearranged the initialization code
so that all of the lwp_info initialization was together, rather than
intermixed with thread_info and process_info initialization.

Tested native, native-gdbserver, native-extended-gdbserver on
x86_64 GNU/Linux.

gdb/gdbserver/

* linux-low.c (handle_extended_wait): Initialize
thread_info.last_resume_kind for new fork children.

9 years agoMake remote follow fork 'Detaching' message match native
Don Breazeal [Thu, 28 May 2015 21:26:03 +0000 (14:26 -0700)] 
Make remote follow fork 'Detaching' message match native

This patch fixes a couple of failures in gdb.base/foll-vfork.exp for
extended-remote targets.  The failures were the result of the
verbose/debug "Detaching..." messages in infrun.c:follow_fork_inferior
not matching what was expected in the extended-remote case.

The path modifies the ptids used in the messages to ensure that they
print "process nnn" instead of (possibly) "Thread nnn.nnn".  The
detach is a process-wide operation, so we need to use a process-
style ptid regardless of what type of ptid target_pid_to_str returns.

Tested on x86_64 GNU/Linux, native, remote, extended-remote.

gdb/

* infrun.c (follow_fork_inferior): Ensure the use of
process-style ptids (pid,0,0) in verbose/debug "Detaching"
messages.

9 years ago* dwarf2read.c (record_line_ftype): Remove, duplicate.
Doug Evans [Thu, 28 May 2015 16:42:02 +0000 (09:42 -0700)] 
* dwarf2read.c (record_line_ftype): Remove, duplicate.

gdb/Changelog:

* dwarf2read.c (record_line_ftype): Remove, duplicate.

9 years agoRemove global variable arm_linux_has_wmmx_registers in arm-linux-nat.c
Yao Qi [Thu, 28 May 2015 09:19:30 +0000 (10:19 +0100)] 
Remove global variable arm_linux_has_wmmx_registers in arm-linux-nat.c

This patch is to remove the global variable arm_linux_has_wmmx_registers
in arm-linux-nat.c, and add a new field have_wmmx_registers in
'struct gdbarch_tdep'.

gdb:

2015-05-28  Yao Qi  <yao.qi@linaro.org>

* arm-linux-nat.c (arm_linux_has_wmmx_registers): Remove.
(arm_linux_fetch_inferior_registers): Use
tdep->have_wmmx_registers instead of arm_linux_has_wmmx_registers.
(arm_linux_store_inferior_registers): Likewise.
(arm_linux_read_description): Don't set
arm_linux_has_wmmx_registers.
* arm-tdep.c (arm_gdbarch_init): Set
tdep->have_wmmx_registers according target descriptions.
* arm-tdep.h (struct gdbarch_tdep) <have_wmmx_registers>: New
field.

9 years agoRemove global variable arm_linux_vfp_register_count in arm-linux-nat.c
Yao Qi [Thu, 28 May 2015 09:19:30 +0000 (10:19 +0100)] 
Remove global variable arm_linux_vfp_register_count in arm-linux-nat.c

This patch is to remove the global variable arm_linux_vfp_register_count
from arm-linux-nat.c.  This global variable is set when native gdb
looks for the right target description according HWCAP.  However,
'struct gdbarch_tdep' has already had a field have_vfp_registers, which
is a boolean about whether target has vfp registers or not.  This
patch converts this boolean field to a numeric counter to replace
global variable arm_linux_vfp_register_count.

gdb:

2015-05-28  Yao Qi  <yao.qi@linaro.org>

* arm-linux-nat.c (arm_linux_vfp_register_count): Remove.
(fetch_vfp_regs): Use vfp_register_count from gdbarch_tdep
instead of arm_linux_vfp_register_count.
(store_vfp_regs): Likewise.
(arm_linux_fetch_inferior_registers): Likewise.
(arm_linux_store_inferior_registers): Likewise.
(arm_linux_read_description): Don't set
arm_linux_vfp_register_count.
* arm-linux-tdep.c (arm_linux_iterate_over_regset_sections):
Adjust.
* arm-tdep.c (arm_gdbarch_init): Add assert on
vfp_register_count.
* arm-tdep.h (struct gdbarch_tdep) <have_vfp_registers>: Rename
field to vfp_register_count.  All users updated.

9 years agoDo arm_abi detection for ELFOSABI_GNU binaries
Kyle Huey [Thu, 28 May 2015 08:12:12 +0000 (09:12 +0100)] 
Do arm_abi detection for ELFOSABI_GNU binaries

On ARM systems, gdb must determine which style of breakpoint to use
(see the comments at the beginning of gdb/arm-linux-tdep.c).  In
arm_gdbarch_init we only attempt to extract the eabi version from the
ELF binary if it is a ELFOSABI_NONE binary.  If the binary is
ELFOSABI_GNU instead, we end up defaulting to the old style OABI
syscall breakpoint instruction.  On a Linux kernel built without
CONFIG_OABI_COMPAT, this triggers a SIGILL in ld when attempting to
execute any ELFOSABI_GNU program.
(e.g. https://github.com/raspberrypi/linux/issues/766)

gdb/

2015-05-28  Kyle Huey  <me@kylehuey.com>  (tiny patch)

* gdb/arm-tdep.c (arm_gdbarch_init): Perform arm_abi detection on
ELFOSABI_GNU binaries.

9 years agoAutomatic date update in version.in
GDB Administrator [Thu, 28 May 2015 00:00:08 +0000 (00:00 +0000)] 
Automatic date update in version.in

9 years agoAdd struct to record dwarf line number state machine.
Doug Evans [Wed, 27 May 2015 21:44:29 +0000 (14:44 -0700)] 
Add struct to record dwarf line number state machine.

gdb/ChangeLog:

* dwarf2read.c (lnp_state_machine): New typedef.
(lnp_reader_state): New typedef.
(dwarf_record_line_1): Renamed from dwarf_record_line.
All callers updated.
(dwarf_record_line): New function.
(init_lnp_state_machine): New function.
(check_line_address): Replace p_record_line parameter with state.
All callers updated.
(dwarf_decode_lines_1): Call dwarf_record_line, init_lnp_state_machine.
Update to record state in lnp_state_machine.

9 years agoConvert PLT reloc only if pointer equality isn't needed
H.J. Lu [Wed, 27 May 2015 21:32:24 +0000 (14:32 -0700)] 
Convert PLT reloc only if pointer equality isn't needed

When pointer equality needed, we can't replace PLT relocations with
GOT relocations for -z now.  This patch checks if pointer equality is
needed before converting PLT relocations to GOT relocations.

bfd/

PR binutils/18458
* elf32-i386.c (elf_i386_check_relocs): Create .plt.got section
for now binding only if pointer equality isn't needed.
(elf_i386_allocate_dynrelocs): Use .plt.got section for now
binding only if pointer equality isn't needed.
* elf64-x86-64.c (elf_x86_64_check_relocs): Create .plt.got
section for now binding only if pointer equality isn't needed.
(elf_x86_64_allocate_dynrelocs): Use .plt.got section for now
binding only if pointer equality isn't needed.

ld/testsuite/

PR binutils/18458
* ld-elf/shared.exp (build_tests): Build libpr18458a.so and
libpr18458b.so.
(run_tests): Run pr18458 test.
* ld-elf/pr18458a.c: New file.
* ld-elf/pr18458b.c: Likewise.
* ld-elf/pr18458c.c: Likewise.

9 years agodwarf2read.c code cleanup, split out check_line_address
Doug Evans [Wed, 27 May 2015 20:22:02 +0000 (13:22 -0700)] 
dwarf2read.c code cleanup, split out check_line_address

gdb/ChangeLog:

* dwarf2read.c (record_line_ftype): New typedef.
(check_line_address): New function.
(dwarf_decode_lines_1): Call it.

9 years agoAdd set/show debug dwarf-line.
Doug Evans [Wed, 27 May 2015 19:55:19 +0000 (12:55 -0700)] 
Add set/show debug dwarf-line.

gdb/ChangeLog:

* NEWS: Mention "set debug dwarf-line".
* dwarf2read.c (dwarf_line_debug): New static global.
(add_include_dir): Add debug dwarf-line support.
(add_file_name, dwarf_record_line, dwarf_finish_line): Ditto.
(_initialize_dwarf2_read): New parameter "debug dwarf-line".

gdb/doc/ChangeLog:

* gdb.texinfo (Debugging Output): Mention set/show debug dwarf-line.

9 years agoDon't ignore domain in nested lookups.
Doug Evans [Wed, 27 May 2015 19:17:37 +0000 (12:17 -0700)] 
Don't ignore domain in nested lookups.

gdb/ChangeLog:

* cp-namespace.c (cp_lookup_nested_symbol): New arg "domain".
All callers updated.
(cp_lookup_nested_symbol_1, find_symbol_in_baseclass): Ditto.
* cp-support.h (cp_lookup_nested_symbol): Update.

9 years agoPR symtab/18258
Doug Evans [Wed, 27 May 2015 18:50:38 +0000 (11:50 -0700)] 
PR symtab/18258

gdb/ChangeLog:

* block.c (block_find_symbol): New function.
(block_find_non_opaque_type): Ditto.
(block_find_non_opaque_type_preferred): Ditto.
* block.h (block_symbol_matcher_ftype): New typedef.
(block_find_symbol): Declare.
(block_find_non_opaque_type): Ditto.
(block_find_non_opaque_type_preferred): Ditto.
* dwarf2read.c (dw2_lookup_symbol): Call block_find_symbol.
* psymtab.c (psym_lookup_symbol): Ditto.
* symtab.c (basic_lookup_transparent_type_1): New function.
(basic_lookup_transparent_type): Call it.

gdb/testsuite/ChangeLog:

* gdb.dwarf2/opaque-type-lookup-2.c: New file.
* gdb.dwarf2/opaque-type-lookup.c: New file.
* gdb.dwarf2/opaque-type-lookup.exp: New file.

9 years ago[aarch64] Handle unknown instruction encoding
Yao Qi [Wed, 27 May 2015 10:08:40 +0000 (11:08 +0100)] 
[aarch64] Handle unknown instruction encoding

We see the following build error:

 gdb/aarch64-tdep.c: In function 'aarch64_process_record':
 gdb/aarch64-tdep.c:2823:17: error: 'record_buf[0]' may be used uninitialized in this function [-Werror=maybe-uninitialized]
                 memcpy(&REGS[0], &RECORD_BUF[0], sizeof(uint32_t)*LENGTH); \
                 ^
 gdb/aarch64-tdep.c:3529:12: note: 'record_buf[0]' was declared here
   uint32_t record_buf[2];

since record_buf[0] isn't initialized in some paths in which
instruction encodings doesn't exist in current ARMv8 reference manual.
This patch is to let the function return AARCH64_RECORD_UNKNOWN for
these paths.

gdb:

2015-05-27  Yao Qi  <yao.qi@linaro.org>

* aarch64-tdep.c (aarch64_record_data_proc_simd_fp): Return
AARCH64_RECORD_UNKNOWN for unknown instruction encoding.

9 years agoFix ARI warnings in aarch64-tdep.c
Yao Qi [Wed, 27 May 2015 10:29:24 +0000 (11:29 +0100)] 
Fix ARI warnings in aarch64-tdep.c

This patch fixes some ARI warnings:

 $ bash ./gdb/contrib/ari/gdb_ari.sh -Wall -Werror -Wari gdb/aarch64-tdep.c
 gdb/aarch64-tdep.c:3009: code: Do not use &&, or || at the end of a line
 gdb/aarch64-tdep.c:3010: code: Do not use &&, or || at the end of a line
 gdb/aarch64-tdep.c:3413: code: Do not use &&, or || at the end of a line
 gdb/aarch64-tdep.c:3460: code: Do not use &&, or || at the end of a line

This patch moves && from the end of line to the start of the line.

gdb:

2015-05-27  Yao Qi  <yao.qi@linaro.org>

* aarch64-tdep.c (aarch64_record_branch_except_sys): Split lines
before operator &&.
(aarch64_record_load_store): Likewise.

9 years agoPR c++/18141, c++/18417.
Doug Evans [Wed, 27 May 2015 00:20:49 +0000 (17:20 -0700)] 
PR c++/18141, c++/18417.

gdb/ChangeLog:

* cp-support.c (cp_lookup_rtti_type): Handle the case of NAME being
a typedef.

gdb/testsuite/ChangeLog:

* gdb.cp/iostream.cc: New file.
* gdb.cp/iostream.exp: New file.

9 years agoAutomatic date update in version.in
GDB Administrator [Wed, 27 May 2015 00:00:09 +0000 (00:00 +0000)] 
Automatic date update in version.in

9 years agoRename dwarf2 to dwarf in "set debug" and maintenance commands.
Doug Evans [Tue, 26 May 2015 23:50:57 +0000 (16:50 -0700)] 
Rename dwarf2 to dwarf in "set debug" and maintenance commands.

gdb/ChangeLog:

* NEWS: Add entries for command renamings.
* dwarf2read.c (dwarf_read_debug): Renamed from dwarf2_read_debug.
All uses updated.
(dwarf_die_debug): Renamed from dwarf2_die_debug.  All uses updated.
(dwarf_max_cache_age): Renamed from dwarf2_max_cache_age.
All uses updated.
(show_dwarf_max_cache_age): Renamed from show_dwarf2_max_cache_age.
All callers updated.  Fix spelling of DWARF in help text.
(set_dwarf_cmdlist): Renamed from set_dwarf2_cmdlist.
All uses updated.
(show_dwarf_cmdlist): Renamed from show_dwarf2_cmdlist.
All uses updated.
(set_dwarf_cmd): Renamed from set_dwarf2_cmd.  All callers updated.
(show_dwarf_cmd): Renamed from show_dwarf2_cmd.  All callers updated.
(dwarf_always_disassemble): Renamed from dwarf_always_disassemble.
All uses updated.
(show_dwarf_always_disassemble): Renamed from
show_dwarf2_always_disassemble.  All callers updated.
(_initialize_dwarf2_read): Rename "set/show dwarf2" prefix to
"set/show dwarf".  Rename "set/show dwarf2 max-cache-age" to
"set/show dwarf max-cache-age".  Rename
"set/show dwarf2 always-disassemble" to
"set/show dwarf always-disassemble".  Rename
"set/show debug dwarf2-read" to "set/show debug dwarf-read".  Rename
"set/show debug dwarf2-die" to "set/show debug dwarf-die".

gdb/doc/ChangeLog:

* gdb.texinfo (Debugging Output): Update for DWARF "set debug"
command renamings.
(Maintenance Commands): Update for DWARF "set debug" command renamings.

gdb/testsuite/ChangeLog:

* gdb.dwarf2/dw2-op-call.exp: Update.
* gdb.dwarf2/dw4-sig-types.exp: Update.
* gdb.dwarf2/implptr.exp: Update.
* gdb.mi/mi-cmd-param-changed.exp: Update.

9 years agoPR python/18438
Doug Evans [Tue, 26 May 2015 23:13:04 +0000 (16:13 -0700)] 
PR python/18438

gdb/ChangeLog:

* python/py-lazy-string.c (stpy_convert_to_value): Use
gdbpy_gdb_memory_error not PyExc_MemoryError.
(gdbpy_create_lazy_string_object): Ditto.

gdb/testsuite/ChangeLog:

* gdb.python/py-lazy-string.c: New file.
* gdb.python/py-lazy-string.exp: New file.
* gdb.python/py-prettyprint.c (lazystring) <len>: New member.
(main): Update.  Add estring3.
* gdb.python/py-prettyprint.exp: Add tests for strings at address 0.
* gdb.python/py-prettyprint.py (pp_ls): Handle length.

9 years agogdb: tui: Minor fix to compare against NULL.
Andrew Burgess [Tue, 26 May 2015 21:31:23 +0000 (22:31 +0100)] 
gdb: tui: Minor fix to compare against NULL.

Minor coding standard fix to compare against NULL.

gdb/ChangeLog:

* tui/tui-regs.c (tui_reg_next_command): Compare against NULL.

9 years agogdb: Add 'tui reg prev' command.
Andrew Burgess [Thu, 21 May 2015 19:51:53 +0000 (21:51 +0200)] 
gdb: Add 'tui reg prev' command.

There is already a 'tui reg next' command, this adds a symmetric 'tui
reg prev' command.

gdb/ChangeLog:

* tui/tui-regs.c (tui_reg_prev_command): New function.
(_initialize_tui_regs): Add 'prev' command for 'tui reg'.
* reggroups.c (reggroup_prev): New function.
* reggroups.h (reggroup_prev): Add declaration.  Update comment.

gdb/doc/ChangeLog:

* gdb.texinfo (TUI Commands): Add 'tui reg prev' details.

9 years agoAll FreeBSD targets are ELF except i?86-*-freebsd\[12\].*.
Ed Maste [Mon, 25 May 2015 16:12:12 +0000 (12:12 -0400)] 
All FreeBSD targets are ELF except i?86-*-freebsd\[12\].*.

FreeBSD has used ELF for all targets for more than 15 years. Add
*-*-freebsd* except i?86-*-freebsd\[12\].* to is_elf_format. Update
is_aout_format to include a trailing dot, so that it does not match
freebsd-10.0 and later.

9 years agoNew gdb.reverse test case for aarch64 instructions
Yao Qi [Tue, 19 May 2015 10:34:36 +0000 (11:34 +0100)] 
New gdb.reverse test case for aarch64 instructions

This patch adds a test case to test the process record for some of
aarch64 instructions.

In each function, GDB turns on process record, and single step until
program goes to the end of the function.  Then, single step backward.
In each of forward single step and backward single step, the contents
of registers are saved, and test compares them.  If there is any
differences, a FAIL is emitted.

The test is flexible, and we can test other instructions easily in the
future.

gdb/testsuite:

2015-05-26  Omair Javaid  <omair.javaid@linaro.org>
    Yao Qi  <yao.qi@linaro.org>

* gdb.reverse/aarch64.c: New.
* gdb.reverse/aarch64.exp: New.

9 years agoEnables gdb.reverse testsuite for aarch64*-linux targets
Omair Javaid [Mon, 11 May 2015 11:10:56 +0000 (12:10 +0100)] 
Enables gdb.reverse testsuite for aarch64*-linux targets

This patch enable gdb.reverse tests for aarch64*-linux targets.

With this patch, there are 7 FAILs in gdb.reverse/ tests.

 FAIL: gdb.reverse/finish-reverse-bkpt.exp: reverse-finish from void_func trips breakpoint at entry
 FAIL: gdb.reverse/finish-reverse-bkpt.exp: no spurious proceed after breakpoint stop
 FAIL: gdb.reverse/next-reverse-bkpt-over-sr.exp: reverse-next over call trips user breakpoint at function entry
 FAIL: gdb.reverse/step-precsave.exp: reverse step into fn call
 FAIL: gdb.reverse/step-precsave.exp: reverse step out of called fn
 FAIL: gdb.reverse/step-reverse.exp: reverse step into fn call
 FAIL: gdb.reverse/step-reverse.exp: reverse step out of called fn

gdb/testsuite:

2015-05-26  Omair Javaid  <omair.javaid@linaro.org>

* lib/gdb.exp (supports_process_record): Return true for aarch64*-linux*.
(supports_reverse): Likewise.

9 years agoImplements aarch64 process record and reverse debugging support
Omair Javaid [Mon, 11 May 2015 11:10:46 +0000 (12:10 +0100)] 
Implements aarch64 process record and reverse debugging support

This patch adds the support of aarch64-linux process record and reverse
debugging.  The implementation is similar to ARM's counterpart.

2015-05-26  Omair Javaid  <omair.javaid@linaro.org>
    Yao Qi  <yao.qi@linaro.org>

* aarch64-linux-tdep.c: Include linux-record.h and
record-full.h.
(struct linux_record_tdep aarch64_linux_record_tdep): Declare.
(aarch64_syscall): New enum.
(aarch64_canonicalize_syscall): New function.
(aarch64_all_but_pc_registers_record): New function.
(aarch64_linux_syscall_record): New function.
(aarch64_linux_init_abi): Install AArch64 process record
handler.  Update to handle syscall recording.
* aarch64-tdep.c: Include record.h and record-full.h.
(submask, bit, bits, REG_ALLOC, MEM_ALLOC): New macros.
(struct aarch64_mem_r): Define.
(aarch64_record_result): New enum.
(struct insn_decode_record): Define.
(insn_decode_record): New typedef.
(aarch64_record_data_proc_reg): New function.
(aarch64_record_data_proc_imm): New function.
(aarch64_record_branch_except_sys): New function.
(aarch64_record_load_store): New function.
(aarch64_record_data_proc_simd_fp): New function.
(aarch64_record_asimd_load_store): New function.
(aarch64_record_decode_insn_handler): New function.
(deallocate_reg_mem): New function.
(aarch64_process_record): New function.
* aarch64-tdep.h (struct gdbarch_tdep) <aarch64_syscall_record>:
New field.
(aarch64_process_record): New extern declaration.
* configure.tgt: Add linux-record.o to gdb_target_obs.
* linux-record.h (struct linux_record_tdep) <arg7>: New field.

9 years agoNEWS entry about aarch64-linux record/replay support
Omair Javaid [Mon, 11 May 2015 11:10:43 +0000 (12:10 +0100)] 
NEWS entry about aarch64-linux record/replay support

This patch adds the NEWS entry for aarch64-linux record replay
support.

It has been reviewed and approved.

gdb:

2015-05-26  Omair Javaid  <omair.javaid@linaro.org>

* NEWS: Add a note on process record-replay support on aarch64*-linux*
targets.

9 years agoRename in_function_epilogue_p to stack_frame_destroyed_p
Martin Galvan [Tue, 26 May 2015 10:59:17 +0000 (11:59 +0100)] 
Rename in_function_epilogue_p to stack_frame_destroyed_p

We concluded that gdbarch_in_function_epilogue_p is misnamed, since it
returns true if the given PC is one instruction after the one that
destroyed the stack (which isn't necessarily inside an epilogue),
therefore it should be renamed to stack_frame_destroyed_p.

I also took the liberty of renaming the arch-specific implementations to
*_stack_frame_destroyed_p as well for consistency.

gdb:

2015-05-26  Martin Galvan  <martin.galvan@tallertechnologies.com>

* amd64-tdep.c: Replace in_function_epilogue_p with
stack_frame_destroyed_p throughout.
* arch-utils.c: Ditto.
* arch-utils.h: Ditto.
* arm-tdep.c: Ditto.
* breakpoint.c: Ditto.
* gdbarch.sh: Ditto.
* hppa-tdep.c: Ditto.
* i386-tdep.c: Ditto.
* mips-tdep.c: Ditto.
* nios2-tdep.c: Ditto.
* rs6000-tdep.c: Ditto.
* s390-linux-tdep.c: Ditto.
* score-tdep.c: Ditto.
* sh-tdep.c: Ditto.
* sparc-tdep.c: Ditto.
* sparc-tdep.h: Ditto.
* sparc64-tdep.c: Ditto.
* spu-tdep.c: Ditto.
* tic6x-tdep.c: Ditto.
* tilegx-tdep.c: Ditto.
* xstormy16-tdep.c: Ditto.
* gdbarch.c, gdbarch.h: Re-generated.

9 years agoxtensa: fix gas segfault with --text-section-literals
Max Filippov [Sun, 17 May 2015 03:46:15 +0000 (06:46 +0300)] 
xtensa: fix gas segfault with --text-section-literals

When --text-section-literals is used and code in the .init or .fini
emits literal in the absence of .literal_position, xtensa_move_literals
segfaults.

Check that search_frag is non-NULL in the xtensa_move_literals and
report error otherwise.

2015-05-26  Max Filippov  <jcmvbkbc@gmail.com>
gas/
* config/tc-xtensa.c (xtensa_move_literals): Check that
search_frag is non-NULL. Report error if literal frag is not
found.

9 years agoAutomatic date update in version.in
GDB Administrator [Tue, 26 May 2015 00:00:08 +0000 (00:00 +0000)] 
Automatic date update in version.in

9 years agoAutomatic date update in version.in
GDB Administrator [Mon, 25 May 2015 00:00:08 +0000 (00:00 +0000)] 
Automatic date update in version.in

9 years agoAutomatic date update in version.in
GDB Administrator [Sun, 24 May 2015 00:00:08 +0000 (00:00 +0000)] 
Automatic date update in version.in

9 years agoAutomatic date update in version.in
GDB Administrator [Sat, 23 May 2015 00:00:08 +0000 (00:00 +0000)] 
Automatic date update in version.in

9 years agoFixes: "gas/read.c:5087:12: error: left shift of negative"
Nick Clifton [Fri, 22 May 2015 13:27:36 +0000 (14:27 +0100)] 
Fixes: "gas/read.c:5087:12: error: left shift of negative"
PR gas/18446
* read.c (output_big_sleb128): Use U suffix to prevent compile
time warning.

9 years agogdb: New 'tui enable' and 'tui disable' commands.
Andrew Burgess [Fri, 22 May 2015 08:07:42 +0000 (10:07 +0200)] 
gdb: New 'tui enable' and 'tui disable' commands.

Add new commands to specifically enable and disable tui mode.  This is
in addition to the readline bindings, but might be easier for a user to
discover if they accidentally end up in tui mode.

gdb/ChangeLog:

* NEWS: Mention 'tui enable' and 'tui disable'.
* tui/tui.c (tui_enable_command): New function.
(tui_disable_command): New function.
(_initialize_tui): New function.

gdb/doc/ChangeLog:

* gdb.texinfo (TUI): Include 'tui enable' in the introduction.
(TUI Commands): Add 'tui enable' and 'tui disable' details.

9 years agoMake sure test names are unique in gdb.base/gdbinit-history.exp
Patrick Palka [Thu, 21 May 2015 22:53:03 +0000 (18:53 -0400)] 
Make sure test names are unique in gdb.base/gdbinit-history.exp

Use with_test_prefix to avoid duplicating test names when calling
the procedure test_gdbinit_history_setting multiple times.

gdb/testsuite/ChangeLog:

* gdb.base/gdbinit-history.exp (test_gdbinit_history_setting):
Use with_test_prefix.

9 years agoAutomatic date update in version.in
GDB Administrator [Fri, 22 May 2015 00:00:08 +0000 (00:00 +0000)] 
Automatic date update in version.in

9 years agogdb: Use NULL not 0 in a tui function.
Andrew Burgess [Thu, 21 May 2015 19:21:40 +0000 (21:21 +0200)] 
gdb: Use NULL not 0 in a tui function.

gdb/ChangeLog:

* tui/tui-regs.c (tui_reg_next_command): Use NULL not 0.

9 years agogdb: Add cleanup to avoid memory leak on error.
Andrew Burgess [Wed, 20 May 2015 22:51:23 +0000 (00:51 +0200)] 
gdb: Add cleanup to avoid memory leak on error.

Use cleanup to avoid leaking memory if an error occurs during tui
start up.

gdb/ChangeLog:

* tui/tui-layout.c (tui_set_layout_for_display_command): Ensure
buf_ptr is freed.

9 years agogdb: Don't call tui_enable too early.
Andrew Burgess [Wed, 20 May 2015 22:45:26 +0000 (00:45 +0200)] 
gdb: Don't call tui_enable too early.

Calling tui_enable too early in tui_layout_command can leave the tui in
an enabled state if the user has entered an invalid layout name.
Instead postpone the call to tui_enable until later in
tui_set_layout_for_display_command just before the layout is changed.

gdb/ChangeLog:

* tui/tui-layout.c (tui_layout_command): Move call to tui_enable
into ...
(tui_set_layout_for_display_command): ...here, before calling
tui_set_layout.  Only set the layout if gdb has not already
entered the TUI_FAILURE state.

9 years agogdb: Add completer for layout command.
Andrew Burgess [Thu, 26 Mar 2015 14:13:57 +0000 (14:13 +0000)] 
gdb: Add completer for layout command.

Add layout name completion for the layout command.

gdb/ChangeLog:

* tui/tui-layout.c (layout_completer): New function.
(_initialize_tui_layout): Set completer on layout command.

gdb/testsuite/ChangeLog:

* gdb.base/completion.exp: Add test for completion of layout
names.

9 years agogdb: Remove register class specific layout names.
Andrew Burgess [Wed, 20 May 2015 21:35:07 +0000 (23:35 +0200)] 
gdb: Remove register class specific layout names.

The layout command supports the layout names $FREGS, $GREGS, $SREGS,
and $REGS. The intention of these layout names was to display the tui
register window with a specific set of registers.

First, these layout names no longer work, and haven't for a while, using
any of them will just result in switching to the general register view.

Second there is already the command 'tui reg GROUP' command to set the
displayed register set to GROUP, so making the layout command also
control the register set feels like unnecessary overloading of the
layout command.

This commit removes all code relating to supporting the register set
specific names from the layout command.  Afterwards the user can select
an available layout using the layout command, and control the choice of
register set using the 'tui reg GROUP' command.

gdb/ChangeLog:

* tui/tui-layout.c (tui_set_layout): Remove
tui_register_display_type parameter.  Remove all checking of this
parameter, and reindent function.  Update header comment.
(tui_set_layout_for_display_command): Rename to...
(tui_set_layout_by_name): ...this, and don't check for different
register class types, don't pass a tui_register_display_type to
tui_set_layout.  Update header comment.
(layout_names): Remove register set specific names.
* tui/tui-layout.h (tui_set_layout): Remove
tui_register_display_type parameter.
* tui/tui.c (tui_rl_change_windows): Don't pass a
tui_register_display_type to tui_set_layout.
(tui_rl_delete_other_windows): Likewise.
(tui_enable): Likewise.
* tui/tui-data.h (TUI_FLOAT_REGS_NAME): Remove.
(TUI_FLOAT_REGS_NAME_LOWER): Remove.
(TUI_GENERAL_REGS_NAME): Remove.
(TUI_GENERAL_REGS_NAME_LOWER): Remove.
(TUI_SPECIAL_REGS_NAME): Remove.
(TUI_SPECIAL_REGS_NAME_LOWER): Remove.
(TUI_GENERAL_SPECIAL_REGS_NAME): Remove.
(TUI_GENERAL_SPECIAL_REGS_NAME_LOWER): Remove.
(enum tui_register_display_type): Remove.
(struct tui_layout_def): Remove regs_display_type and
float_regs_display_type fields.
(struct tui_data_info): Remove regs_display_type field.
(tui_layout_command): Use new name for
tui_set_layout_for_display_command.
* tui/tui-data.c (layout_def): Don't initialise removed fields.
(tui_clear_win_detail): Don't initialise removed fields of
win_info.
* tui/tui-regs.c (tui_show_registers): Use new name for
tui_set_layout_for_display_command.
* tui/tui.h (tui_set_layout_for_display_command): Rename
declaration to...
(tui_set_layout_by_name): ...this.
* printcmd.c (display_command): Remove tui related layout call,
and reindent.

9 years agoAutomatic date update in version.in
GDB Administrator [Thu, 21 May 2015 00:00:08 +0000 (00:00 +0000)] 
Automatic date update in version.in

9 years agogdb/testsuite: New skip_tui_tests predicate.
Andrew Burgess [Fri, 27 Mar 2015 22:52:31 +0000 (22:52 +0000)] 
gdb/testsuite: New skip_tui_tests predicate.

Add a new predicate procedure to the gdb.exp library 'skip_tui_tests',
which returns true if the tui is not compiled into gdb.

Make use of this predicate in the gdb.base/tui-layout.exp test as an
example.

gdb/testsuite/ChangeLog:

* lib/gdb.exp (skip_tui_tests): New proc.
* gdb.base/tui-layout.exp: Check skip_tui_tests.

9 years agoSkip extra relocations in .rel.plt/.rela.plt
H.J. Lu [Wed, 20 May 2015 14:55:45 +0000 (07:55 -0700)] 
Skip extra relocations in .rel.plt/.rela.plt

Extra relocations may be added to the .rel.plt/.rela.plt section, which
are unrelated to PLT.  We should skip them when retrieving PLT entry
symbol values.

PR binutils/18437
* elf32-i386.c (elf_i386_get_plt_sym_val): Skip extra relocations
in .rel.plt/.rela.plt.
* elf64-x86-64.c (elf_x86_64_get_plt_sym_val): Likewise.

9 years ago[AArch64/BFD] Sort relocation case labels alphabetically
Jiong Wang [Wed, 20 May 2015 09:58:43 +0000 (10:58 +0100)] 
[AArch64/BFD] Sort relocation case labels alphabetically

2015-05-19  Jiong Wang  <jiong.wang@arm.com>

    bfd/
* elfnn-aarch64.c (aarch64_tls_transition_without_check): Sort
relocation case labels alphabetically.
(elfNN_aarch64_final_link_relocate): Ditto.
(elfNN_aarch64_tls_relax): Ditto.
(elfNN_aarch64_relocate_section): Ditto.
(elfNN_aarch64_gc_sweep_hook): Ditto.
(elfNN_aarch64_check_relocs): Ditto.
* elfxx-aarch64.c (_bfd_aarch64_elf_put_addend): Ditto.
(_bfd_aarch64_elf_resolve_relocation): Ditto.

9 years ago[AArch64] Sort relocation case labels alphabetically
Jiong Wang [Wed, 20 May 2015 09:44:24 +0000 (10:44 +0100)] 
[AArch64] Sort relocation case labels alphabetically

2015-05-19  Jiong. Wang  <jiong.wang@arm.com>

gas/
  * config/tc-aarch64.c (process_movw_reloc_info): Sort relocation case labels
  alphabetically.
  (md_apply_fix): Ditto.
  (aarch64_force_relocation): Ditto.

9 years agoMemory leak reading frame register during inferior event handling
Joel Brobecker [Fri, 13 Feb 2015 10:57:29 +0000 (11:57 +0100)] 
Memory leak reading frame register during inferior event handling

When using a conditional breakpoint where the condition evaluated
to false a large number of times before the program stopped,
a user reported that GDB's memory consumption was growing very
quickly until it ran out of memory.

The problem was tracked down to temporary struct values being created
each time the program stops and handles an inferior event.  Because
the breakpoint condition usually evaluates to false, there can be
a fairly large number of such events to be handled before we eventually
return the prompt to the user (which is when we would normally purge
such values).

This patch fixes the issue by making sure that handle_inferior_event
releases all new values created during its execution.

gdb/ChangeLog:

        * infrun.c (handle_inferior_event_1): Renames handle_inferior_event.
        (handle_inferior_event): New function.

9 years agogdb/ada-lang.c: Rename local variable typename into type_name...
Joel Brobecker [Wed, 20 May 2015 07:14:30 +0000 (09:14 +0200)] 
gdb/ada-lang.c: Rename local variable typename into type_name...

... to avoid a build failure when building with C++ compiler
(when configured with --enable-build-with-cxx). We cannot use
"typename" as it is a C++ reserved keyword.

gdb/ChangeLog:

        * ada-lang.c (to_fixed_array_type): Rename local variable
        typename into type_name.

9 years agoAutomatic date update in version.in
GDB Administrator [Wed, 20 May 2015 00:00:08 +0000 (00:00 +0000)] 
Automatic date update in version.in

9 years agocompile: Fix ASAN crash for gdb.compile/compile.exp
Jan Kratochvil [Tue, 19 May 2015 14:12:30 +0000 (16:12 +0200)] 
compile: Fix ASAN crash for gdb.compile/compile.exp

(gdb) PASS: gdb.compile/compile.exp: set unwindonsignal on
compile code *(volatile int *) 0 = 0;
Program received signal SIGSEGV, Segmentation fault.
0x00007ffff7fba426 in _gdb_expr (__regs=0x7ffff7fb8000) at gdb command line:1
1 gdb command line: No such file or directory.
=================================================================
==10462==ERROR: AddressSanitizer: heap-use-after-free on address 0x621000cf7a3d at pc 0x0000004e46b9 bp 0x7ffdeb0f7a40 sp 0x7ffdeb0f71b8
READ of size 10 at 0x621000cf7a3d thread T0
    #0 0x4e46b8 in printf_common(void*, char const*, __va_list_tag*) [clone .isra.6] (/home/jkratoch/redhat/gdb-clean-asan/gdb/gdb+0x4e46
b8)
    #1 0x4f645e in vasprintf (/home/jkratoch/redhat/gdb-clean-asan/gdb/gdb+0x4f645e)
    #2 0xe5cf00 in xstrvprintf common/common-utils.c:120
    #3 0xe74192 in throw_it common/common-exceptions.c:332
    #4 0xe742f6 in throw_verror common/common-exceptions.c:361
    #5 0xddc89e in verror /home/jkratoch/redhat/gdb-clean-asan/gdb/utils.c:541
    #6 0xe734bd in error common/errors.c:43
    #7 0xafa1d6 in call_function_by_hand_dummy /home/jkratoch/redhat/gdb-clean-asan/gdb/infcall.c:1031
    #8 0xe81858 in compile_object_run compile/compile-object-run.c:119
    #9 0xe7733c in eval_compile_command compile/compile.c:577
    #10 0xe7541e in compile_code_command compile/compile.c:153

It is obvious why that happens, dummy_frame_pop() will call compile objfile
cleanup which will free that objfile and NAME then becomes a stale pointer.

> Is there any reason we release OBJFILE in the dummy frame dtor?  Why
> don't we register a cleanup to release in OBJFILE in compile_object_run?
> together with releasing compile_module?  'struct compile_module' has a
> field objfile, which should be released together with
> 'struct compile_module' instead of dummy_frame.

(gdb) break puts
Breakpoint 2 at 0x3830c6fd30: file ioputs.c, line 34.
(gdb) compile code puts("hello")
Breakpoint 2, _IO_puts (str=0x7ffff7ff8000 "hello") at ioputs.c:34
34      {
The program being debugged stopped while in a function called from GDB.
Evaluation of the expression containing the function
(_gdb_expr) will be abandoned.
When the function is done executing, GDB will silently stop.
(gdb) bt
(gdb) _

Now compile_object_run() called from line
(gdb) compile code puts("hello")
has finished for a long time.  But we still need to have that injected code
OBJFILE valid when GDB is executing it.  Therefore OBJFILE is freed only from
destructor of the frame #1.

At the patched line of call_function_by_hand_dummy() the dummy frame
destructor has not yet been run but it will be run before the fetched NAME
will get used.

gdb/ChangeLog
2015-05-19  Jan Kratochvil  <jan.kratochvil@redhat.com>

Fix ASAN crash for gdb.compile/compile.exp.
* infcall.c (call_function_by_hand_dummy): Use xstrdup for NAME.

9 years agocompile: gdb_stdout -> gdb_stdlog
Jan Kratochvil [Tue, 19 May 2015 12:27:06 +0000 (14:27 +0200)] 
compile: gdb_stdout -> gdb_stdlog

Please send debug output to gdb_stdlog.

OK but gdb/compile/ is using now only gdb_stdout; the error above is due to
a copy-paste.  So I will send a follow-up patch to change all the other
gdb/compile/ gdb_stdout strings to gdb_stdlog.

gdb/ChangeLog
2015-05-19  Jan Kratochvil  <jan.kratochvil@redhat.com>

* compile/compile-c-symbols.c (convert_symbol_sym, gcc_convert_symbol)
(gcc_symbol_address): Change gdb_stdout to gdb_stdlog.
* compile/compile-object-load.c (setup_sections, compile_object_load):
Likewise.
* compile/compile.c (compile_to_object): Likewise.

9 years agoFix gdb.base/gdbinit-history.exp when HISTSIZE is set in the environment
Pedro Alves [Tue, 19 May 2015 09:47:27 +0000 (10:47 +0100)] 
Fix gdb.base/gdbinit-history.exp when HISTSIZE is set in the environment

Some buildslaves are showing that this test is failing.  E.g.,:

 https://sourceware.org/ml/gdb-testers/2015-q2/msg04164.html

The issue is that HISTSIZE is set to 1000 in the environment that runs
the tests (that's the default in Fedora, set in /etc/profile).

We can trivially reproduce it with:

 $ HISTSIZE=1000 make check RUNTESTFLAGS="gdbinit-history.exp"
 (...)
 Running /home/pedro/gdb/mygit/src/gdb/testsuite/gdb.base/gdbinit-history.exp ...
 FAIL: gdb.base/gdbinit-history.exp: show history size
 FAIL: gdb.base/gdbinit-history.exp: show history size
 FAIL: gdb.base/gdbinit-history.exp: show commands

gdb.log shows:
 ...
 (gdb) set height 0
 (gdb) set width 0
 (gdb) show history size
 The size of the command history is 1000.
 (gdb) FAIL: gdb.base/gdbinit-history.exp: show history size

gdb/testsuite/ChangeLog:
2015-05-19  Pedro Alves  <palves@redhat.com>

* gdb.base/gdbinit-history.exp (test_gdbinit_history_setting):
Save the whole env array instead of just HOME.  Unset HISTSIZE in
the environment while testing.  Restore whole environment
afterwards.

9 years agoAutomatic date update in version.in
GDB Administrator [Tue, 19 May 2015 00:00:08 +0000 (00:00 +0000)] 
Automatic date update in version.in

9 years agoFix seg-fault in readelf when decoding corrupt IA64 unwind information.
Nick Clifton [Mon, 18 May 2015 14:58:46 +0000 (15:58 +0100)] 
Fix seg-fault in readelf when decoding corrupt IA64 unwind information.

PR binutils/18420
* ia64-unwind.c (unw_decode): Add end parameter.  Pass parameter
on to decode functions.
(unw_devode_p2_p5): Pass end paraemter to UNW_DEC_SPILL_MASK.
(UNW_DEC_SPILL_MASK): Add end parameter.  Check that unw_rlen does
not take us beyond the end of the buffer.
* ia64-unwind.h (unw_decode): Update prototype.
* readelf.c (dump_ia64_unwind): Pass end pointer to unw_decode.

9 years agoFix dw-2 test for 16-bit targets.
Nick Clifton [Mon, 18 May 2015 13:36:15 +0000 (14:36 +0100)] 
Fix dw-2 test for 16-bit targets.

* binutils-all/dw2-3.S: Replace .int with .4byte.

9 years agoRemove Disp32 from AMD64 direct call/jmp
H.J. Lu [Mon, 18 May 2015 11:17:12 +0000 (04:17 -0700)] 
Remove Disp32 from AMD64 direct call/jmp

* i386-opc.tbl: Remove Disp32 from AMD64 direct call/jmp.
* i386-init.h: Regenerated.

This page took 0.049884 seconds and 4 git commands to generate.