deliverable/binutils-gdb.git
8 years agoDisable paging when run by Emacs 25.1 and later.
Eli Zaretskii [Thu, 29 Oct 2015 17:25:28 +0000 (19:25 +0200)] 
Disable paging when run by Emacs 25.1 and later.

gdb/ChangeLog:

* utils.c (init_page_info): Disable paging if INSIDE_EMACS is set
in the environment.

8 years agognu-v2-abi.c: Add casts
Pedro Alves [Thu, 29 Oct 2015 17:23:34 +0000 (17:23 +0000)] 
gnu-v2-abi.c: Add casts

I looked at changing these is_destructor_name/is_constructor_name
interfaces in order to detangle the boolean result from the ctor/dtor
kind return, but then realized that this design goes all the way down
to the libiberty demangler interfaces.  E.g, include/demangle.h:

 ~~~
 /* Return non-zero iff NAME is the mangled form of a constructor name
    in the G++ V3 ABI demangling style.  Specifically, return an `enum
    gnu_v3_ctor_kinds' value indicating what kind of constructor
    it is.  */
 extern enum gnu_v3_ctor_kinds
 is_gnu_v3_mangled_ctor (const char *name);

 enum gnu_v3_dtor_kinds {
   gnu_v3_deleting_dtor = 1,
   gnu_v3_complete_object_dtor,
   gnu_v3_base_object_dtor,
   /* These are not part of the V3 ABI.  Unified destructors are generated
      as a speed-for-space optimization when the -fdeclone-ctor-dtor option
      is used, and are always internal symbols.  */
   gnu_v3_unified_dtor,
   gnu_v3_object_dtor_group
 };
 ~~~

libiberty/cp-demangle.c:

 ~~~
 enum gnu_v3_ctor_kinds
 is_gnu_v3_mangled_ctor (const char *name)
 {
   enum gnu_v3_ctor_kinds ctor_kind;
   enum gnu_v3_dtor_kinds dtor_kind;

   if (! is_ctor_or_dtor (name, &ctor_kind, &dtor_kind))
     return (enum gnu_v3_ctor_kinds) 0;
   return ctor_kind;
 }
 ~~~

etc.

gdb/ChangeLog:
2015-10-29  Pedro Alves  <palves@redhat.com>

* gnu-v2-abi.c (gnuv2_is_destructor_name)
(gnuv2_is_constructor_name): Add casts.

8 years agoMake GOT entry size target-dependent
H.J. Lu [Thu, 29 Oct 2015 15:47:12 +0000 (08:47 -0700)] 
Make GOT entry size target-dependent

The GOT entry size is target-dependent.  This patch adds a got_entry_size
function to Sized_target class so that a target can provide a value
different from default.

PR gold/19184
* incremental.cc (Got_plt_view_info): Add got_entry_size.
(Local_got_offset_visitor::visit): Replace got_entry_size_
with info_.got_entry_size.
(Local_got_offset_visitor::got_entry_size_): Removed.
(Global_got_offset_visitor::visit): Replace got_entry_size_
with info_.got_entry_size.
(Global_got_offset_visitor::got_entry_size_): Removed.
(Output_section_incremental_inputs::write_got_plt): Initialize
view_info.got_entry_size.
* target.h (Sized_target::got_entry_size): New virtual function.
* x86_64.cc (Target_x86_64::got_entry_size): New function.

8 years agoAlso check GOTPCRELX
H.J. Lu [Thu, 29 Oct 2015 16:18:57 +0000 (09:18 -0700)] 
Also check GOTPCRELX

* ld-x86-64/plt-main3.rd: Also check GOTPCRELX.

8 years ago2015-10-29 Catherine Moore <clm@codesourcery.com>
Catherine Moore [Thu, 29 Oct 2015 13:58:16 +0000 (06:58 -0700)] 
2015-10-29  Catherine Moore  <clm@codesourcery.com>

     bfd/
     * elfxx-mips.c (mips_elf_check_mips16_stubs): Set a stub's output
     section to bfd_abs_section_ptr if the stub is discarded.

     ld/testsuite/
     * ld-mips-elf/mips16-fp-stub-1.s: New.
     * ld-mips-elf/mips16-fp-stub-2.s: New.
     * ld-mips-elf/mips16-fp-stub.d: New.
     * ld-mips-elf/mips-elf.exp: Run new tests.
     * ld-mips-elf/mips16-intermix.d: Update expected output.

https://sourceware.org/ml/binutils/2015-10/msg00137.html

8 years agoAdd support for AArch64 CloudABI binaries.
Ed Schouten [Thu, 29 Oct 2015 13:49:03 +0000 (13:49 +0000)] 
Add support for AArch64 CloudABI binaries.

ld * Makefile.am (ALL_64_EMULATION_SOURCES): Add support for
CloudABI on aarch64. For this target we have to make sure we use
ELFOSABI_CLOUDABI instead of ELFOSABI_NONE.
* configure.tgt (targ_emul): Likewise.
* emulparams/aarch64cloudabi.sh: New file.
* emulparams/aarch64cloudabib.sh: New file.
* Makefile.in: Regenerate.

bfd * config.bfd (targ_defvec): Add support for CloudABI on aarch64.
For this target we have to make sure we use ELFOSABI_CLOUDABI
instead of ELFOSABI_NONE.
* configure.ac (tb): Likewise.
* elfnn-aarch64.c: Likewise.
* targets.c (_bfd_target_vector): Likewise.
* configure: Regenerate.

gas * config/tc-aarch64.c (elf64_aarch64_target_format): Select the
cloudabi format if the TARGET_OS is cloudabi.

8 years agobfd/libhppa.h: Make C++ compatible
Pedro Alves [Thu, 29 Oct 2015 12:55:03 +0000 (12:55 +0000)] 
bfd/libhppa.h: Make C++ compatible

Fixes this when GDB is built in C++ mode:

 In file included from /home/pedro/gdb/mygit/src/gdb/../bfd/som.h:27:0,
  from /home/pedro/gdb/mygit/src/gdb/somread.c:31:
 /home/pedro/gdb/mygit/src/gdb/../bfd/libhppa.h: In function ‘int bfd_hppa_insn2fmt(bfd*, int)’:
 /home/pedro/gdb/mygit/src/gdb/../bfd/libhppa.h:380:42: error: invalid conversion from ‘int’ to ‘hppa_opcode_type’ [-fpermissive]
  #define get_opcode(insn) (((insn) >> 26) & 0x3f)
   ^
 /home/pedro/gdb/mygit/src/gdb/../bfd/libhppa.h:465:30: note: in expansion of macro ‘get_opcode’
    enum hppa_opcode_type op = get_opcode (insn);
       ^

bfd/ChangeLog:
2015-10-29  Pedro Alves  <palves@redhat.com>

* libhppa.h (bfd_hppa_insn2fmt): Add cast.

8 years agogdbserver/mem-break.c: Add cast
Pedro Alves [Thu, 29 Oct 2015 12:55:02 +0000 (12:55 +0000)] 
gdbserver/mem-break.c: Add cast

... for C++.

Fixes:

 gdb/gdbserver/mem-break.c:204:28: error: invalid conversion from 'int' to 'bkpt_type' [-fpermissive]

gdb/gdbserver/ChangeLog:
2015-10-29  Pedro Alves  <palves@redhat.com>

* mem-break.c (Z_packet_to_bkpt_type): Add cast.

8 years agogdbserver/tracepoint: Add casts out of tpoint->handle
Pedro Alves [Thu, 29 Oct 2015 12:55:02 +0000 (12:55 +0000)] 
gdbserver/tracepoint: Add casts out of tpoint->handle

... as needed for C++.

tpoint->handle is a generic 'void *' handle.

gdb/gdbserver/ChangeLog:
2015-10-29  Pedro Alves  <palves@redhat.com>

* tracepoint.c (clear_installed_tracepoints): Add casts.

8 years agogdbserver: enum gdb_signal casts
Pedro Alves [Thu, 29 Oct 2015 12:55:02 +0000 (12:55 +0000)] 
gdbserver: enum gdb_signal casts

This is code parsing RSP signal numbers, checking whether the numbers
are indeed valid/known GDB signals, and then converting to host signal
numbers.  I considered adding temporary enum gdb_signal variables
instead, but didn't really like the result.

gdb/gdbserver/ChangeLog:
2015-10-29  Pedro Alves  <palves@redhat.com>

* server.c (handle_v_cont, process_serial_event): Add enum
gdb_signal casts to signal parsing code.

8 years agogdbserver: btrace enums
Pedro Alves [Thu, 29 Oct 2015 12:55:02 +0000 (12:55 +0000)] 
gdbserver: btrace enums

Fixes:

 ../../../src/gdb/gdbserver/linux-low.c: In function ‘int linux_low_read_btrace(btrace_target_info*, buffer*, int)’:
 ../../../src/gdb/gdbserver/linux-low.c:6827:48: error: invalid conversion from ‘int’ to ‘btrace_read_type’ [-fpermissive]
    err = linux_read_btrace (&btrace, tinfo, type);
 ^
 In file included from ../../../src/gdb/gdbserver/linux-low.c:98:0:
 ../../../src/gdb/gdbserver/../nat/linux-btrace.h:116:26: error:   initializing argument 3 of ‘btrace_error linux_read_btrace(btrace_data*, btrace_target_info*, btrace_read_type)’ [-fpermissive]
  extern enum btrace_error linux_read_btrace (struct btrace_data *btrace,
   ^

The cyclic dependency the comment talks about is no longer relevant:
  https://sourceware.org/ml/gdb-patches/2015-10/msg00643.html

gdb/gdbserver/ChangeLog:
2015-10-29  Pedro Alves  <palves@redhat.com>

* linux-low.c (linux_low_read_btrace): Change type of 'type'
parameter.
* server.c (handle_qxfer_btrace): Change type of 'type'
local.
* target.h (struct target_ops) <read_btrace>: Change type of
'type' parameter.  Update comment.

8 years agogdbserver/Linux: Introduce NULL_REGSET
Pedro Alves [Thu, 29 Oct 2015 12:55:02 +0000 (12:55 +0000)] 
gdbserver/Linux: Introduce NULL_REGSET

Fixes errors like:

 src/gdb/gdbserver/linux-x86-low.c:477:1: error: invalid conversion from 'int' to 'regset_type' [-fpermissive]

gdb/gdbserver/ChangeLog:
2015-10-29  Pedro Alves  <palves@redhat.com>

* linux-low.h (NULL_REGSET): Define.
* linux-aarch64-low.c (aarch64_regsets): Use NULL_REGSET.
* linux-arm-low.c (arm_regsets): Likewise.
* linux-crisv32-low.c (cris_regsets): Likewise.
* linux-m68k-low.c (m68k_regsets): Likewise.
* linux-mips-low.c (mips_regsets): Likewise.
* linux-nios2-low.c (nios2_regsets): Likewise.
* linux-ppc-low.c (ppc_regsets): Likewise.
* linux-s390-low.c (s390_regsets): Likewise.
* linux-sh-low.c (sh_regsets): Likewise.
* linux-sparc-low.c (sparc_regsets): Likewise.
* linux-tic6x-low.c (tic6x_regsets): Likewise.
* linux-tile-low.c (tile_regsets): Likewise.
* linux-x86-low.c (x86_regsets): Likewise.
* linux-xtensa-low.c (xtensa_regsets): Likewise.

8 years agoAdd cast to exception_none
Pedro Alves [Thu, 29 Oct 2015 12:55:01 +0000 (12:55 +0000)] 
Add cast to exception_none

Fixes, in C++ mode:

 ../../src/gdb/common/common-exceptions.c:23:69: error: invalid conversion from ‘int’ to ‘return_reason’ [-fpermissive]
  const struct gdb_exception exception_none = { 0, GDB_NO_ERROR, NULL };
      ^

(I considered adding an enum value for '0', but the code and comments
around return_reason and its uses explain how 0 is special/internal,
so I'm leaving it be.)

gdb/ChangeLog:
2015-10-29  Pedro Alves  <palves@redhat.com>

* common/common-exceptions.c (exception_none): Add cast.

8 years agocompile: Rename struct type_map_instance::gcc_type field
Pedro Alves [Thu, 29 Oct 2015 12:55:01 +0000 (12:55 +0000)] 
compile: Rename struct type_map_instance::gcc_type field

Fixes:

  src/gdb/compile/compile-c-types.c:36:12: error: declaration of ‘gcc_type type_map_instance::gcc_type’ [-fpermissive]
     gcc_type gcc_type;
      ^
  In file included from src/gdb/../include/gcc-c-interface.h:23:0,
   from src/gdb/compile/compile-internal.h:21,
   from src/gdb/compile/compile-c-types.c:23:
  src/gdb/../include/gcc-interface.h:32:28: error: changes meaning of ‘gcc_type’ from ‘typedef long long unsigned int gcc_type’ [-fpermissive]
   typedef unsigned long long gcc_type;
      ^
  src/gdb/compile/compile-c-types.c: In function ‘gcc_type convert_qualified(compile_c_instance*, type*)’:
  src/gdb/compile/compile-c-types.c:310:19: error: invalid conversion from ‘int’ to ‘gcc_qualifiers’ [-fpermissive]
quals);
     ^

gdb/ChangeLog:
2015-10-29  Pedro Alves  <palves@redhat.com>

* compile/compile-c-types.c (struct type_map_instance)
<gcc_type>: Rename to gcc_type_handle.
(insert_type, convert_type): Adjust.

8 years agoDon't assume break/continue inside a TRY block works
Pedro Alves [Thu, 29 Oct 2015 12:55:01 +0000 (12:55 +0000)] 
Don't assume break/continue inside a TRY block works

In C++, this:

try
  {
    break;
  }
catch (..)
  {}

is invalid.  However, because our TRY/CATCH macros support it in C,
the C++ version of those macros support it too.  To catch such
assumptions, this adds a (disabled) hack that maps TRY/CATCH to raw
C++ try/catch.  Then it goes through all instances that building on
x86_64 GNU/Linux trips on, fixing them.

This isn't strictly necessary yet, but I think it's nicer to try to
keep the tree in a state where it's easier to eliminate the TRY/CATCH
macros.

gdb/ChangeLog:
2015-10-29  Pedro Alves  <palves@redhat.com>

* dwarf2-frame-tailcall.c (dwarf2_tailcall_sniffer_first): Don't
assume that "break" breaks out of a TRY/CATCH.
* python/py-framefilter.c (py_print_single_arg): Don't assume
"continue" breaks out of a TRY/CATCH.
* python/py-value.c (valpy_binop_throw): New function, factored
out from ...
(valpy_binop): ... this.
(valpy_richcompare_throw): New function, factored
out from ...
(valpy_richcompare): ... this.
* solib.c (solib_read_symbols): Don't assume "break" breaks out
of a TRY/CATCH.
* common/common-exceptions.h [USE_RAW_CXX_TRY]
<TRY/CATCH/END_CATCH>: Define as 1-1 wrappers around try/catch.

8 years agoFix reporting of command line options that need an argument, but which occur as the...
Nick Clifton [Thu, 29 Oct 2015 10:45:10 +0000 (10:45 +0000)] 
Fix reporting of command line options that need an argument, but which occur as the last option on the command line.

PR ld/19146
* lexsup.c (parse_args): Correct error message for an option that
is missing its argument if that option is the last one on the
command line.

8 years agoRe: Orphan output section with multiple input sections
Alan Modra [Thu, 29 Oct 2015 05:46:22 +0000 (16:16 +1030)] 
Re: Orphan output section with multiple input sections

The last patch missed handling the case where the ideal place to put
an orphan was after a non-existent output section statement, as can
happen when not using the builtin linker scripts.  This patch uses the
updated flags for that case too, and extends the support to mmo and pe.

PR ld/19162
* emultempl/elf32.em (gld${EMULATION_NAME}_place_orphan): Pass
updated flags to lang_output_section_find_by_flags.
* emultempl/mmo.em (mmo_place_orphan): Merge flags for any
other input sections that might match a new output section to
decide placement.
* emultempl/pe.em (gld_${EMULATION_NAME}_place_orphan): Likewise.
* emultempl/pep.em (gld_${EMULATION_NAME}_place_orphan): Likewise.
* ldlang.c (lang_output_section_find_by_flags): Add sec_flags param.
* ldlang.h (lang_output_section_find_by_flags): Update prototype.

8 years agofix typo in ld's texinfo
Matthias Klose [Thu, 29 Oct 2015 05:33:33 +0000 (16:03 +1030)] 
fix typo in ld's texinfo

* ld.texinfo (Options <-rpath>): Fix typo.

8 years agoFix CPS availability.
Thomas Preud'homme [Thu, 15 Oct 2015 02:37:55 +0000 (10:37 +0800)] 
Fix CPS availability.

2015-10-29  Thomas Preud'homme  <thomas.preudhomme@arm.com>

gas/
    * config/tc-arm.c (insns): Guard cps by arm_ext_v6_notm instead of
    arm_ext_v6_dsp.

8 years agoAutomatic date update in version.in
GDB Administrator [Thu, 29 Oct 2015 00:00:08 +0000 (00:00 +0000)] 
Automatic date update in version.in

8 years agoAdd __attribute__((__aligned__(1))) to unaligned symbols from scripts (for s390).
Marcin Kościelnicki [Mon, 5 Oct 2015 14:57:16 +0000 (16:57 +0200)] 
Add __attribute__((__aligned__(1))) to unaligned symbols from scripts (for s390).

gold/
* testsuite/binary_test.cc: Add __attribute__((aligned(1))).
* testsuite/script_test_12a.c: Likewise.
* testsuite/script_test_1a.cc: Likewise.
* testsuite/script_test_2.cc: Likewise.

8 years agoMake debug_msg.sh more open-minded about line numbers (needed for s390).
Marcin Kościelnicki [Mon, 5 Oct 2015 14:57:15 +0000 (16:57 +0200)] 
Make debug_msg.sh more open-minded about line numbers (needed for s390).

gold/
* testsuite/debug_msg.sh: Accept more fuzz in line numbers.

8 years agoFix empty string alignment in .rodata.str*
Marcin Kościelnicki [Mon, 5 Oct 2015 14:57:14 +0000 (16:57 +0200)] 
Fix empty string alignment in .rodata.str*

gold/
PR gold/18959
* stringpool.cc (Stringpool_template::new_key_offset): Align all
strings, even zero-length.
(Stringpool_template::set_string_offsets):

8 years agoAdd s390 backend.
Marcin Kościelnicki [Mon, 5 Oct 2015 14:57:13 +0000 (16:57 +0200)] 
Add s390 backend.

elfcpp/
* s390.h: New file.

gold/
* s390.cc: New file.
* Makefile.am (TARGETSOURCES): Add s390.cc.
(ALL_TARGETOBJS): Add s390.o.
* Makefile.in: Regenerate.
* configure.ac: Add s390 support.
* configure: Regenerate.
* configure.tgt: Add s390-*-* and s390x-*-*.
* testsuite/icf_safe_test.sh (arch_specific_safe_fold): Add s390
support.

8 years agoAdd 64-bit archive support.
Marcin Kościelnicki [Mon, 5 Oct 2015 14:57:12 +0000 (16:57 +0200)] 
Add 64-bit archive support.

gold/
* archive.cc (Archive::sym64name): New const.
(Archive::setup): Add support for SYM64 armap.
(Archive::read_armap): Likewise.
(Archive::interpret_header): Likewise.
(Archive::const_iterator::read_next_header): Likewise.
* archive.h (Archive::sym64name): New const.
(Archive::read_armap): Add mapsize template parameter.

8 years agoSupport 64-bit entry size in SHT_HASH (for s390).
Marcin Kościelnicki [Mon, 5 Oct 2015 14:57:11 +0000 (16:57 +0200)] 
Support 64-bit entry size in SHT_HASH (for s390).

gold/
* dynobj.cc (Dynobj::create_elf_hash_table): Create hash table with
target-specific entry size.
(Dynobj::sized_create_elf_hash_table): Add size template parameter.
* dynobj.h (Dynobj::sized_create_elf_hash_table): Likewise.
* layout.cc (Layout::create_dynamic_symtab): Set entsize to
hash_entry_size.
* target.h (Target::hash_entry_size): New method.
(Target::Target_info::hash_entry_size): New data member.

* aarch64.cc (Target_aarch64::aarch64_info): Add hash_entry_size.
* arm.cc (Target_arm::arm_info): Likewise.
(Target_arm_nacl::arm_nacl_info): Likewise.
* i386.cc (Target_i386::i386_info): Likewise.
(Target_i386_nacl::i386_nacl_info): Likewise.
(Target_iamcu::iamcu_info): Likewise.
* mips.cc (Target_mips::mips_info): Likewise.
(Target_mips_nacl::mips_nacl_info): Likewise.
* powerpc.cc (Target_powerpc::powerpc_info): Likewise.
* sparc.cc (Target_sparc::sparc_info): Likewise.
* tilegx.cc (Target_tilegx::tilegx_info): Likewise.
* x86_64.cc (Target_x86_64::x86_64_info): Likewise.
(Target_x86_64_nacl::x86_64_nacl_info): Likewise.
* testsuite/testfile.cc (Target_test::test_target_info): Likewise.

8 years agoMove encoded as 'or' in binutils.
Simon Dardis [Wed, 28 Oct 2015 16:52:17 +0000 (09:52 -0700)] 
Move encoded as 'or' in binutils.

A patch (http://sourceware.org/ml/binutils/2015-07/msg00376.html)
submitted to binutils will be encoding move as an 'or' instruction over
[d]addu in assembly and various code stubs. This patch for gdb addresses
that change for the mips specific parts of gdb.

gdb/ChangeLog:

* mips-linux-tdep.c (mips_linux_in_dynsym_stub): Recognise 'or'
as move along with [d]addu.

8 years agoCheck R_386_GOT32/R_386_GOT32X without base register
H.J. Lu [Wed, 28 Oct 2015 16:15:17 +0000 (09:15 -0700)] 
Check R_386_GOT32/R_386_GOT32X without base register

The R_386_GOT32 and R_386_GOT32X relocations may be used without base
register:

movl bar@GOT, %eax

Its calculation is G + A, instead of G + A - GOT, and it can only used
to generate non-PIC executable.  Include the .got.plt section address
for R_386_GOT32 and R_386_GOT32X relocations without base register.
Don't allow R_386_GOT32 and R_386_GOT32X relocations without base
register when making a PIC output.

PR gold/19177
* i386.cc (Target_i386::Relocate::relocate): Check R_386_GOT32
and R_386_GOT32X relocations without base register.

8 years agoFix a typo in comment in elf32-i386.c
H.J. Lu [Wed, 28 Oct 2015 16:03:59 +0000 (09:03 -0700)] 
Fix a typo in comment in elf32-i386.c

* elf32-i386.c (elf_i386_relocate_section): Fix a typo in
comment.

8 years agoAdd tests for 16-bit versions of ARM teq, tst, cmp and cmn instructions.
Nick Clifton [Wed, 28 Oct 2015 15:30:05 +0000 (15:30 +0000)] 
Add tests for 16-bit versions of ARM teq, tst, cmp and cmn instructions.

        * gas/arm/pinsn.s: New.
        * gas/arm/pinsn.d: Likewise.

8 years agoPass noaliases_p to aarch64_decode_insn
Yao Qi [Mon, 5 Oct 2015 10:15:58 +0000 (11:15 +0100)] 
Pass noaliases_p to aarch64_decode_insn

Nowadays aarch64_decode_insn is a public interface used by both
opcodes and gdb.  However, its behaviour relies on a global variable
no_aliases, which isn't a good practise.  On the other hand, In default,
no_aliases is zero, but in GDB, we do want no alias when decoding
instructions for prologue analysis (patches to be posted), so that we
can handle both instructions "add" and "mov" (an alias of "add") as
"add".  The code in GDB can be simplified.

This patch adds a new argument in aarch64_decode_insn, and pass no_aliases
to it.  In GDB side, always pass 1 to it.

include/opcode:

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

* aarch64.h (aarch64_decode_insn): Update declaration.

opcodes:

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

* aarch64-dis.c (aarch64_decode_insn): Add one argument
noaliases_p.  Update comments.  Pass noaliases_p rather than
no_aliases to aarch64_opcode_decode.
(print_insn_aarch64_word): Pass no_aliases to
aarch64_decode_insn.

gdb:

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

* aarch64-tdep.c (aarch64_software_single_step): Pass 1 to
aarch64_decode_insn.

8 years agoFix recent STM324LXX patch to compile on 32-bit hosts.
Nick Clifton [Wed, 28 Oct 2015 13:52:11 +0000 (13:52 +0000)] 
Fix recent STM324LXX patch to compile on 32-bit hosts.

* elf32-arm.c (create_instruction_branch_absolute): Replace
pointer parameters with a simple integer parameter.
(stm32l4xx_create_replacing_stub_ldmia): Update calls to
create_instruction_branch_absolute.
(stm32l4xx_create_replacing_stub_ldmdb): Likewise.
(stm32l4xx_create_replacing_stub_vldm): Likewise.
(elf32_arm_write_section): Use pointer type for veneer addresses.

8 years agoFix errors in the gas testsuite for the ARC target.
Cupertino Miranda [Wed, 28 Oct 2015 13:48:00 +0000 (13:48 +0000)] 
Fix errors in the gas testsuite for the ARC target.

bfd * reloc.c (BFD_RELOC_ARC_32_PCREL): New entry.
(ARC_TLS_DTPOFF): Arrange it in order.
* elf32-arc.c (arc_elf_howto_ini): Update formula.
(get_middle_endian_relocation): New function.
(PDATA): Define.
* bfd-in2.h: Regenerate.
* libbfd.h: Likewise.

elf * arc-reloc.def (ARC_32_PCREL): New definition.

gas * config/tc-arc.c (tokenize_arguments): Avoid creating unused
symbols when parsing relocation types.
(md_apply_fix): Handle TLS relocations. Fix BFD_RELOC_ARC_32_PCREL
relocation.
(arc_check_reloc): Emit BFD_RELOC_ARC_32_PCREL relocation.

8 years agoAdd a test for PR ld/19162
H.J. Lu [Wed, 28 Oct 2015 10:20:55 +0000 (03:20 -0700)] 
Add a test for PR ld/19162

PR ld/19162
* ld-x86-64/x86-64.exp: Run pr19162.
* ld-x86-64/pr19162.d: New file.
* ld-x86-64/pr19162a.s: Likewise.
* ld-x86-64/pr19162b.s: Likewise.

8 years agoOrphan output section with multiple input sections
Alan Modra [Wed, 28 Oct 2015 06:48:13 +0000 (17:18 +1030)] 
Orphan output section with multiple input sections

If given input sections with differing flags, we'd like to place the
section according to the final output section flags.

bfd/
PR ld/19162
* elflink.c (_bfd_elf_gc_mark_reloc): Move code iterating over
linker input bfds..
* section.c (bfd_get_next_section_by_name): ..to here.  Add ibfd param.
(bfd_get_linker_section): Adjust bfd_get_next_section_by_name call.
* tekhex.c (first_phase): Likewise.
* elflink.c (bfd_elf_gc_sections): Likewise.
* bfd-in2.h: Regenerate.
ld/
PR ld/19162
* emultempl/elf32.em (gld${EMULATION_NAME}_place_orphan): Check flags
before calling _bfd_elf_match_sections_by_type.  Merge flags for
any other input sections that might match a new output section to
decide placement.

8 years agoAutomatic date update in version.in
GDB Administrator [Wed, 28 Oct 2015 00:00:18 +0000 (00:00 +0000)] 
Automatic date update in version.in

8 years agoPatch for PR gold/19042 - unsupported reloc 311/312.
Han Shen [Tue, 27 Oct 2015 22:17:54 +0000 (15:17 -0700)] 
Patch for PR gold/19042 - unsupported reloc 311/312.

gold/

* aarch64.cc (Target_aarch64::Scan::local): Add support for
reloc 311/312.

8 years agoMake host_address_to_string/gdb_print_host_address cast parameter to 'void *'
Pedro Alves [Tue, 27 Oct 2015 17:25:09 +0000 (17:25 +0000)] 
Make host_address_to_string/gdb_print_host_address cast parameter to 'void *'

Fixes a set of errors like:

 ../../src/gdb/symfile-debug.c: In function ‘int debug_qf_map_symtabs_matching_filename(objfile*, const char*, const char*, int (*)(symtab*, void*), void*)’:
 ../../src/gdb/symfile-debug.c:137:39: error: invalid conversion from ‘int (*)(symtab*, void*)’ to ‘const void*’ [-fpermissive]
host_address_to_string (callback),
^

Note this has to work with data and function pointers.  In C++11 we
may perhaps do something a bit safer, but we're not there yet, and I
don't think it really matters.  For now just always do a simple
C-style cast in host_address_to_string itself.  No point in adding a
void * cast to each and every caller.

gdb/ChangeLog:
2015-10-27  Pedro Alves  <palves@redhat.com>

* common/print-utils.c (host_address_to_string): Rename to ...
(host_address_to_string_1): ... this.
* common/print-utils.h (host_address_to_string): Reimplement as
wrapper around host_address_to_string_1.
* utils.c (gdb_print_host_address): Rename to ...
(gdb_print_host_address_1): ... this.
* utils.h (gdb_print_host_address): Reimplement as wrapper macro
around host_address_to_string_1.

8 years agotarget_read_memory&co: no longer return target_xfer_status
Pedro Alves [Tue, 27 Oct 2015 17:25:09 +0000 (17:25 +0000)] 
target_read_memory&co: no longer return target_xfer_status

Years ago, these functions used to return errno/EIO.  Later, through a
series of changes that intended to remove native/remote differences,
they ended up returning a target_xfer_status in disguise.

Unlike target_xfer_partial&co, the point of target_read_memory&co is
to either fully succeed or fail.  On error, they always return
TARGET_XFER_E_IO.  So there's no real point in casting the return of
target_read_memory to a target_xfer_status to pass it to memory_error.
Instead, it results in clearer code to simply decouple
target_read_memory&co's return from target_xfer_status.

This fixes build errors like this in C++ mode:

 ../../src/gdb/corefile.c: In function ‘void read_stack(CORE_ADDR, gdb_byte*, ssize_t)’:
 ../../src/gdb/corefile.c:276:34: error: invalid conversion from ‘int’ to ‘target_xfer_status’ [-fpermissive]
      memory_error (status, memaddr);
   ^
 ../../src/gdb/corefile.c:216:1: error:   initializing argument 1 of ‘void memory_error(target_xfer_status, CORE_ADDR)’ [-fpermissive]

gdb/ChangeLog:
2015-10-27  Pedro Alves  <palves@redhat.com>

* alpha-tdep.c (alpha_read_insn): Always pass TARGET_XFER_E_IO to
memory_error.  Rename local 'status' to 'res'.
* c-lang.c (c_get_string): Always pass TARGET_XFER_E_IO to
memory_error.
* corefile.c (read_stack, read_code, write_memory): Always pass
TARGET_XFER_E_IO to memory_error.
* disasm.c (dis_asm_memory_error): Always pass TARGET_XFER_E_IO to
memory_error.  Rename parameter 'status' to 'err'.
(dump_insns): Rename local 'status' to 'err'.
* mips-tdep.c (mips_fetch_instruction): Rename parameter 'statusp'
to 'errp'.  Rename local 'status' to 'err'.  Always pass
TARGET_XFER_E_IO to memory_error.
(mips_breakpoint_from_pc): Rename local 'status' to 'err'.
* target.c (target_read_memory, target_read_raw_memory)
(target_read_stack, target_read_code, target_write_memory)
(target_write_raw_memory): Return -1 on error instead of
TARGET_XFER_E_IO.
* valprint.c (val_print_string): Rename local 'errcode' to 'err'.
Always pass TARGET_XFER_E_IO to memory_error.  Update comment.

8 years agoguile: Change return value of gdbscm_with_guile for const char *
Simon Marchi [Tue, 27 Oct 2015 17:11:45 +0000 (13:11 -0400)] 
guile: Change return value of gdbscm_with_guile for const char *

The documentation of gdbscm_with_guile says that it returns a statically
allocated string (IOW, a const char *).  We can reflect that in its
return value type, and get rid of C++ build errors.

Initially fixes:

/home/simark/src/binutils-gdb/gdb/guile/scm-disasm.c: In function ‘void* gdbscm_disasm_read_memory_worker(void*)’:
/home/simark/src/binutils-gdb/gdb/guile/scm-disasm.c:93:12: error: invalid conversion from ‘const void*’ to ‘void*’ [-fpermissive]
     return "seek error";

gdb/ChangeLog:

* guile/guile-internal.h (gdbscm_with_guile): Change return
types to const char *.
* guile/scm-safe-call.c (gdbscm_with_guile): Likewise.
(struct c_data) <func>: Likewise.
(struct c_data) <result>: Change type to const char *.
(scscm_eval_scheme_string): Change return type to
const char *.
(scscm_source_scheme_script): Likewise.
(gdbscm_safe_eval_string): Change type of result variable to
const char * and remove cast.
(gdbscm_safe_source_script): Likewise.
* guile/scm-disasm.c (gdbscm_disasm_read_memory_worker):
Change return type to const char *.
(gdbscm_disasm_read_memory): Change type of status to
const char *.

8 years agosource.c:openp: save/restore errno
Pedro Alves [Tue, 27 Oct 2015 16:03:24 +0000 (16:03 +0000)] 
source.c:openp: save/restore errno

openp's return is documented as:

~~~
   If a file is found, return the descriptor.
   Otherwise, return -1, with errno set for the last name we tried to open.  */
~~~

By inspection, I noticed that there are function calls after the ones
that first set errno, and those may clobber errno.  It's safer to save
errno when see an open fail, and restore it on exit.

Tested on x86_64 Fedora 20.

gdb/ChangeLog:
2015-10-27  Pedro Alves  <palves@redhat.com>

* source.c (openp): New local 'last_errno'.  Use it to
save/restore errno.

8 years agoFix RL78 disassembly of DE+offset addressing to always show the offset, even when...
Vinay Kumar [Tue, 27 Oct 2015 15:24:40 +0000 (15:24 +0000)] 
Fix RL78 disassembly of DE+offset addressing to always show the offset, even when zero.

PR binutils/19159
opcodes * rl78-decode.opc (MOV): Added offset to DE register in index
addressing mode.
* rl78-decode.c: Regenerate.

test * gas/rl78/pr19159.s: New test source file.
* gas/rl78/pr19159.d: New test case.
* gas/rl78/rl78.exp: Run the new test.

8 years agopsymtab.c: Add casts
Pedro Alves [Tue, 27 Oct 2015 14:57:18 +0000 (14:57 +0000)] 
psymtab.c: Add casts

... as needed for C++.

gdb/ChangeLog:
2015-10-27  Pedro Alves  <palves@redhat.com>

* psymtab.c (dump_psymtab_addrmap_1): Add casts.

8 years agoctf.c: Fix int/enum implicit cast
Simon Marchi [Tue, 27 Oct 2015 14:53:24 +0000 (10:53 -0400)] 
ctf.c: Fix int/enum implicit cast

This patch was taken directly from Pedro's branch.

Right now, SET_INT32_FIELD is used to set enum fields.  This works in C,
but not C++.  Therefore, define the new SET_ENUM_FIELD, which casts the
value to the right enum type.

gdb/ChangeLog:

* ctf.c (SET_ENUM_FIELD): New macro.
(ctf_read_status): Use it.
(ctf_read_tp): Use it.

8 years agoDisplay system registers by their names when disassembling RL78 instructions.
Vinay Kumar [Tue, 27 Oct 2015 14:49:02 +0000 (14:49 +0000)] 
Display system registers by their names when disassembling RL78 instructions.

PR binutils/19158
opcodes * rl78-decode.opc: Add 's' print operator to instructions that
access system registers.
* rl78-decode.c: Regenerate.
* rl78-dis.c (print_insn_rl78_common): Decode all system
registers.

tests * gas/rl78/pr19158.s: New test source file.
* gas/rl78/pr19158.d: New test case.
* gas/rl78/rl78.exp: Run the new test.

8 years agoFix RL78 disassembly so that SP+OFFSET addressing always shows the offset, even when...
Vinay Kumar [Tue, 27 Oct 2015 14:00:40 +0000 (14:00 +0000)] 
Fix RL78 disassembly so that SP+OFFSET addressing always shows the offset, even when zero.

PR binutils/19157
opcodes * rl78-decode.opc: Add 'a' print operator to mov instructions
using stack pointer plus index addressing.
* rl78-decode.c: Regenerate.

tests * gas/rl78: New directory.
* gas/rl78/rl78.exp: New test driver.
* gas/rl78/pr19157.s: New test source file.
* gas/rl78/pr19157.d: New test case.

8 years agoAdd scm_t_dynwind_flags casts
Simon Marchi [Tue, 27 Oct 2015 13:34:30 +0000 (09:34 -0400)] 
Add scm_t_dynwind_flags casts

There is a handful of calls to

  scm_dynwind_begin (0);

where the parameter is an enum, scm_t_dynwind_flags.  In C++, we have no
choice but to add an explicit cast, since there is no enum value that
represents 0 (no flags set).

gdb/ChangeLog:

* guile/scm-breakpoint.c (gdbscm_set_breakpoint_stop_x): Add
scm_t_dynwind_flags casts.
* guile/scm-cmd.c (gdbscm_parse_command_name): Likewise.
* guile/scm-ports.c (gdbscm_open_memory): Likewise.
* guile/scm-value.c (gdbscm_value_to_string): Likewise.

8 years agoIntroduce ax_raw_byte and use it
Simon Marchi [Tue, 27 Oct 2015 13:33:29 +0000 (09:33 -0400)] 
Introduce ax_raw_byte and use it

This patch was taken directly from Pedro's branch.

ax_simple is used to append an agent expression operator to an agent
expression string.  Therefore, it takes an enum agent_op as input.
There is an instance where it's called to append a raw byte, unrelated
to the enum.  It makes the build fail in C++ mode.

This patch introduces ax_raw_byte for that purpose and uses it.

gdb/ChangeLog:

* ax.h (ax_raw_byte): New declaration.
* ax-general.c (ax_raw_byte): New function.
(ax_simple): Use ax_raw_byte.
* ax-gdb.c (gen_printf): Likewise.

8 years agoada-lang.h: Add cast in GROW_VECT
Simon Marchi [Tue, 27 Oct 2015 13:27:40 +0000 (09:27 -0400)] 
ada-lang.h: Add cast in GROW_VECT

The assignment requires a cast in C++.  We only use this macro for
vectors of chars, so adding (char *) diretly will do for now.

gdb/ChangeLog:

* ada-lang.h (GROW_VECT): Add cast.

8 years agoAdd --fix-stm32l4xx-629360 to the ARM linker to enable a link-time workaround for...
Laurent Alfonsi [Tue, 27 Oct 2015 13:20:33 +0000 (13:20 +0000)] 
Add --fix-stm32l4xx-629360 to the ARM linker to enable a link-time workaround for a bug in the bus matrix / memory controller for some of the STM32 Cortex-M4 based products (STM32L4xx).

bfd  * bfd-in2.h: Regenerate.
     * bfd-in.h (bfd_arm_stm32l4xx_fix): New enum. Specify how
     STM32L4XX instruction scanning should be done.
     (bfd_elf32_arm_set_stm32l4xx_fix)
     (bfd_elf32_arm_stm32l4xx_erratum_scan)
     (bfd_elf32_arm_stm32l4xx_fix_veneer_locations): Add prototypes.
     (bfd_elf32_arm_set_target_relocs): Add stm32l4xx fix type argument
     to prototype.
     * elf32-arm.c (STM32L4XX_ERRATUM_VENEER_SECTION_NAME)
     (STM32L4XX_ERRATUM_VENEER_ENTRY_NAME): Define macros.
     (elf32_stm32l4xx_erratum_type): New enum.
     (elf32_stm32l4xx_erratum_list): New struct. List of veneers or
     jumps to veneers.
     (_arm_elf_section_data): Add stm32l4xx_erratumcount,
     stm32l4xx_erratumlist.
     (elf32_arm_link_hash_table): Add stm32l4xx_erratum_glue_size,
     stm32l4xx_fix and num_stm32l4xx_fixes fields.
     (ctz): New function.
     (popcount): New function.
     (elf32_arm_link_hash_table_create): Initialize stm32l4xx_fix.
     (put_thumb2_insn): New function.
     (STM32L4XX_ERRATUM_LDM_VENEER_SIZE): Define. Size of a veneer for
     LDM instructions.
     (STM32L4XX_ERRATUM_VLDM_VENEER_SIZE): Define. Size of a veneer for
     VLDM instructions.
     (bfd_elf32_arm_allocate_interworking_sections): Initialise erratum
     glue section.
     (record_stm32l4xx_erratum_veneer) : New function. Create a single
     veneer, and its associated symbols.
     (bfd_elf32_arm_add_glue_sections_to_bfd): Add STM32L4XX erratum glue.
     (bfd_elf32_arm_set_stm32l4xx_fix): New function. Set the type of
     erratum workaround required.
     (bfd_elf32_arm_stm32l4xx_fix_veneer_locations): New function. Find
     out where veneers and branches to veneers have been placed in
     virtual memory after layout.
     (is_thumb2_ldmia): New function.
     (is_thumb2_ldmdb): Likewise.
     (is_thumb2_vldm ): Likewise.
     (stm32l4xx_need_create_replacing_stub): New function. Decide if a
     veneer must be emitted.
     (bfd_elf32_arm_stm32l4xx_erratum_scan): Scan the sections of an
     input BFD for potential erratum-triggering insns. Record results.
     (bfd_elf32_arm_set_target_relocs): Set stm32l4xx_fix field in
     global hash table.
     (elf32_arm_size_dynamic_sections): Collect glue information.
     (create_instruction_branch_absolute): New function.
     (create_instruction_ldmia): Likewise.
     (create_instruction_ldmdb): Likewise.
     (create_instruction_mov): Likewise.
     (create_instruction_sub): Likewise.
     (create_instruction_vldmia): Likewise.
     (create_instruction_vldmdb): Likewise.
     (create_instruction_udf_w): Likewise.
     (create_instruction_udf): Likewise.
     (push_thumb2_insn32): Likewise.
     (push_thumb2_insn16): Likewise.
     (stm32l4xx_fill_stub_udf): Likewise.
     (stm32l4xx_create_replacing_stub_ldmia): New function. Expands the
     replacing stub for ldmia instructions.
     (stm32l4xx_create_replacing_stub_ldmdb): Likewise for ldmdb.
     (stm32l4xx_create_replacing_stub_vldm): Likewise for vldm.
     (stm32l4xx_create_replacing_stub): New function. Dispatches the
     stub emission to the appropriate functions.
     (elf32_arm_write_section): Output veneers, and branches to veneers.

ld   * ld.texinfo: Description of the STM32L4xx erratum workaround.
     * emultempl/armelf.em (stm32l4xx_fix): New.
     (arm_elf_before_allocation): Choose the type of fix, scan for
     erratum.
     (gld${EMULATION_NAME}_finish): Fix veneer locations.
     (arm_elf_create_output_section_statements): Propagate
     stm32l4xx_fix value.
     (PARSE_AND_LIST_PROLOGUE): Define OPTION_STM32L4XX_FIX.
     (PARSE_AND_LIST_LONGOPTS): Add entry for handling
     --fix-stm32l4xx-629360.
     (PARSE_AND_LIST_OPTION): Add entry for helping on
     --fix-stm32l4xx-629360.
     (PARSE_AND_LIST_ARGS_CASES): Treat OPTION_STM32L4XX_FIX.

tests * ld-arm/arm-elf.exp (armelftests_common): Add STM32L4XX
       tests.
     * ld-arm/stm32l4xx-cannot-fix-far-ldm.d: New.
     * ld-arm/stm32l4xx-cannot-fix-far-ldm.s: Likewise.
     * ld-arm/stm32l4xx-cannot-fix-it-block.d: Likewise.
     * ld-arm/stm32l4xx-cannot-fix-it-block.s: Likewise.
     * ld-arm/stm32l4xx-fix-all.d: Likewise.
     * ld-arm/stm32l4xx-fix-all.s: Likewise.
     * ld-arm/stm32l4xx-fix-it-block.d: Likewise.
     * ld-arm/stm32l4xx-fix-it-block.s: Likewise.
     * ld-arm/stm32l4xx-fix-ldm.d: Likewise.
     * ld-arm/stm32l4xx-fix-ldm.s: Likewise.
     * ld-arm/stm32l4xx-fix-vldm.d: Likewise.
     * ld-arm/stm32l4xx-fix-vldm.s: Likewise.

8 years agoAdd support to readelf for reading NetBSD ELF core notes.
Stephen Fisher [Tue, 27 Oct 2015 11:32:38 +0000 (11:32 +0000)] 
Add support to readelf for reading NetBSD ELF core notes.

binutils * binutils.c (process_netbsd_elf_note): New function.
(process_note): Call the new function for NetBSD core notes.

include * common.h (NT_NETBSD_MARCH): Define.

8 years agoAdd support for 32-bit and 64-bit PowerPC AIX core files.
Sangamesh Mallayya [Tue, 27 Oct 2015 10:30:29 +0000 (10:30 +0000)] 
Add support for 32-bit and 64-bit PowerPC AIX core files.

* configure.ac (powerpc64-*-aix[5-9].*): Match powerpc64 running
aix for core file support.
* configure: Regenerate.
* rs6000-core.c: Check for __ld_info64 if compiling 64-bit gdb.
Added BFD64 check if we are using old core file format for 32-bit gdb.
Set sizeof CORE_COMMONSZ appropriately in case of either new or
old core file format.
(read_hdr): Added BFD64 check for 64-bit support.
(rs6000coff_core_p): Likewise.
(rs6000coff_core_file_matches_executable_p): Likewise.
(rs6000coff_core_file_failing_command): Likewise.
(rs6000coff_core_file_failing_signal): Likewise.
Add support for debugging core files generated by binaries in
Large Memory model.
(rs6000coff_core_p): If Large Memory Model is used, then the .data
segment should start from BDATAORG which has been defined in the
system header files.

8 years agoPrevent overflowing the selected_cpu_name buffer in the ARM assembler.
Jim Wilson [Tue, 27 Oct 2015 09:33:08 +0000 (09:33 +0000)] 
Prevent overflowing the selected_cpu_name buffer in the ARM assembler.

* config/tc-arm.c (selected_cpu_name): Increase length of array to
accomodate "Samsung Exynos M1".
(arm_parse_cpu): Add assertion and length check to prevent
overfilling selected_cpu_name.

8 years agoxfail pr19161 test on hppa-linux
Alan Modra [Tue, 27 Oct 2015 07:33:24 +0000 (18:03 +1030)] 
xfail pr19161 test on hppa-linux

HPPA linux needs libgcc.a for millicode routine $$dyncall.

* ld-gc/pr19161.d: xfail hppa-*-*.

8 years agoFix access_to_packed_array.exp typos/errors
Jan Kratochvil [Tue, 27 Oct 2015 05:08:45 +0000 (06:08 +0100)] 
Fix access_to_packed_array.exp typos/errors

Running ./gdb.ada/access_to_packed_array.exp ...
ERROR: tcl error sourcing ./gdb.ada/access_to_packed_array.exp.
ERROR: extra characters after close-quote
    while executing
"gdb_test "print pack.a" "\\(0 => 1, 2, 3, 4, 5, 6, 7, 8, 9, 10\\)")"
    (file "./gdb.ada/access_to_packed_array.exp" line 29)
    invoked from within
"source ./gdb.ada/access_to_packed_array.exp"
    ("uplevel" body line 1)
    invoked from within
"uplevel #0 source ./gdb.ada/access_to_packed_array.exp"
    invoked from within
"catch "uplevel #0 source $test_file_name""

Unrelated to the typos I have changed the print expectations s/"x"/" = x"/
as for example expectation "3" should not match " = 43".

2015-10-27  Jan Kratochvil  <jan.kratochvil@redhat.com>

* gdb.ada/access_to_packed_array.exp: Fix typos erroring the testfile.

8 years agosymtab.h (struct general_symbol_info> <ada_mangled>: Update comment.
Doug Evans [Tue, 27 Oct 2015 03:24:16 +0000 (20:24 -0700)] 
symtab.h (struct general_symbol_info> <ada_mangled>: Update comment.

gdb/ChangeLog:

* symtab.h (struct general_symbol_info> <ada_mangled>: Update comment.

8 years agoEvaluate __start_* and __stop_* symbol PROVIDE expressions early
Alan Modra [Tue, 27 Oct 2015 01:31:55 +0000 (12:01 +1030)] 
Evaluate __start_* and __stop_* symbol PROVIDE expressions early

Makes these symbols defined before bfd_elf_size_dynamic_sections, to
avoid horrible hacks elsewhere.  The exp_fold_tree undefweak change
is necessary to define undefweak symbols early too.  The comment was
wrong.  PROVIDE in fact defines undefweak symbols, via
bfd_elf_record_link_assignment.

PR ld/19175
* ldlang.c (lang_insert_orphan): Evaluate __start_* and __stop_*
symbol PROVIDE expressions.
* ldexp.c (exp_fold_tree_1 <etree_provide>): Define undefweak
references.

8 years agotarget.c: Add a cast and change a type
Simon Marchi [Tue, 27 Oct 2015 02:07:27 +0000 (22:07 -0400)] 
target.c: Add a cast and change a type

Fixes some errors in C++ build.

gdb/ChangeLog:

* target.c (memory_xfer_partial): Change type of buf to gdb_byte
pointer.
(simple_search_memory): Cast return of memmem.

8 years agostap-probe.c: Add casts
Simon Marchi [Tue, 27 Oct 2015 02:04:10 +0000 (22:04 -0400)] 
stap-probe.c: Add casts

gdb/ChangeLog:

* stap-probe.c (handle_stap_probe): Add (const char *) casts.

8 years agoctf_xfer_partial: Return TARGET_XFER_E_IO instead of -1 on error
Simon Marchi [Tue, 27 Oct 2015 02:00:41 +0000 (22:00 -0400)] 
ctf_xfer_partial: Return TARGET_XFER_E_IO instead of -1 on error

Use the enum value instead of the corresponding int value.

gdb/ChangeLog:

* ctf.c (ctf_xfer_partial): Return TARGET_XFER_E_IO instead of
-1 on error.

8 years agoAutomatic date update in version.in
GDB Administrator [Tue, 27 Oct 2015 00:00:10 +0000 (00:00 +0000)] 
Automatic date update in version.in

8 years agoCheck symbol defined by assignment in linker script
H.J. Lu [Mon, 26 Oct 2015 23:32:34 +0000 (16:32 -0700)] 
Check symbol defined by assignment in linker script

Symbol symbol defined by an assignment in a linker script has type
bfd_link_hash_new.  elf_i386_convert_load and elf_x86_64_convert_load
should check bfd_link_hash_new to see if a symbol is defined by a linker
script.

bfd/

PR ld/19175
* elf32-i386.c (elf_i386_convert_load): Check bfd_link_hash_new
instead of calling bfd_link_get_defined_symbol.
* elf64-x86-64.c (elf_x86_64_convert_load): Likewise.  Skip
relocation overflow for bfd_link_hash_new.
* linker.c (bfd_link_get_defined_symbol): Removed.
* bfd-in2.h: Regenerated.

ld/testsuite/

PR ld/19175
* ld-i386/i386.exp: Run pr19175.
* ld-x86-64/x86-64.exp: Likewise.
* ld-i386/pr19175.d: New file.
* ld-i386/pr19175.s: Likewise.
* ld-i386/pr19175.t: Likewise.
* ld-x86-64/pr19175.d: Likewise.
* ld-x86-64/pr19175.s: Likewise.
* ld-x86-64/pr19175.t: Likewise.

8 years agoPR symtab/17391 gdb internal error: assertion fails in regcache.c:178
Doug Evans [Mon, 26 Oct 2015 23:05:21 +0000 (16:05 -0700)] 
PR symtab/17391 gdb internal error: assertion fails in regcache.c:178

gdb/ChangeLog:

* dwarf2-frame.c (dwarf2_restore_rule): Call dwarf_reg_to_regnum
instead of gdbarch_dwarf2_reg_to_regnum.
(dwarf2_frame_cache): Ditto.
(read_addr_from_reg): Call dwarf_reg_to_regnum_or_error instead of
gdbarch_dwarf2_reg_to_regnum.
(get_reg_value): Ditto.
(dwarf2_fetch_cfa_info): Ditto.
(dwarf2_frame_prev_register): Ditto.
* dwarf2loc.c: #include "complaints.h".
(dwarf_expr_read_addr_from_reg): Call dwarf_reg_to_regnum_or_error
instead of gdbarch_dwarf2_reg_to_regnum.
(dwarf_expr_get_reg_value): Ditto.
(read_pieced_value): Ditto.
(write_pieced_value): Ditto.
(dwarf2_evaluate_loc_desc_full): Ditto.
(dwarf_reg_to_regnum): New function.
(throw_bad_regnum_error): New function.
(dwarf_reg_to_regnum_or_error): Renamed from
dwarf2_reg_to_regnum_or_errorChange to take a ULONGEST regnum.
All callers updated.  Call throw_bad_regnum_error.
(locexpr_regname): Improve text of bad register number.
* dwarf2loc.h (dwarf_reg_to_regnum): Declare.
(dwarf_reg_to_regnum_or_error): Update prototype.
* dwarf2expr.c: #include "dwarf2loc.h".
(dwarf_block_to_sp_offset): Call dwarf_reg_to_regnum instead of
gdbarch_dwarf2_reg_to_regnum.
* gdbarch.sh (dwarf2_reg_to_regnum): Add comment.
* gdbarch.h: Regenerate.
* amd64-tdep.c (amd64_dwarf_reg_to_regnum): Remove warning for bad
register.
* avr-tdep.c (avr_dwarf_reg_to_regnum): Ditto.
* cris-tdep.c (cris_dwarf2_reg_to_regnum): Ditto.
* bfin-tdep.c (bfin_reg_to_regnum): Fix error checking.
* hppa-linux-tdep.c (hppa_dwarf_reg_to_regnum): Improve error checking.
Remove warning for bad register.
* hppa-tdep.c (hppa64_dwarf_reg_to_regnum): Ditto.
* i386-tdep.c (i386_svr4_dwarf_reg_to_regnum): Renamed from
i386_svr4_reg_to_regnum.  Return -1 for bad registers.
(i386_svr4_reg_to_regnum): New function.
(i386_gdbarch_init): Update call to set_gdbarch_dwarf2_reg_to_regnum.
* microblaze-tdep.c (microblaze_dwarf2_reg_to_regnum): Don't assert
on bad registers, return -1.
* msp430-tdep.c (msp430_dwarf2_reg_to_regnum): Improve error checking.
Remove warning for bad register.
* nios2-tdep.c: Add static assert for NIOS2_NUM_REGS.
(nios2_dwarf_reg_to_regnum): Fix off-by-one error.
Remove warning for bad register.  Return -1 for bad register.
* rl78-tdep.c (rl78_dwarf_reg_to_regnum): Don't flag an internal error
for bad register, return -1.
* rx-tdep.c (rx_dwarf_reg_to_regnum): Ditto.
* m68k-tdep.c (m68k_dwarf_reg_to_regnum): Fix error result.
* mep-tdep.c (mep_debug_reg_to_regnum): Ditto.
* mips-tdep.c (mips_stab_reg_to_regnum): Ditto.
(mips_dwarf_dwarf2_ecoff_reg_to_regnum): Ditto.
* mn10300-tdep.c (mn10300_dwarf2_reg_to_regnum): Remove warning
for bad regs.
* xtensa-tdep.c (xtensa_reg_to_regnum): Remove internal error for
bad regs.  Fix error result.
* stabsread.c (stab_reg_to_regnum): Watch for negative regno.
(reg_value_complaint): Update complaint text.
* mdebugread.c (reg_value_complaint): New function.
(mdebug_reg_to_regnum): Rewrite to watch for bad reg numbers.

gdb/testsuite/ChangeLog:

* lib/dwarf.exp (_location): Add support for DW_OP_regx.
* gdb.dwarf2/bad-regnum.c: New file.
* gdb.dwarf2/bad-regnum.exp: New file.

8 years agoPR python/18938: source -s foo.py with foo.py a symlink to foo.notpy fails
Doug Evans [Mon, 26 Oct 2015 21:33:19 +0000 (14:33 -0700)] 
PR python/18938: source -s foo.py with foo.py a symlink to foo.notpy fails

gdb/ChangeLog:

PR python/18938
* cli/cli-cmds (source_script_fron_sctream): New arg file_to_open.
All callers updated.

gdb/testsuite/ChangeLog:

* gdb.python/python.exp: Add test for symlink from .py file to .notpy
file.

8 years agoPrint address map in output of "mt print psymbols"
Doug Evans [Mon, 26 Oct 2015 21:12:51 +0000 (14:12 -0700)] 
Print address map in output of "mt print psymbols"

gdb/ChangeLog:

* psymtab.c (struct dump_psymtab_addrmap_data): Define.
(dump_psymtab_addrmap_1, dump_psymtab_addrmap): New functions.
(maintenance_print_psymbols): Print address map.

8 years agoMove __SIGRTMIN.
Doug Evans [Mon, 26 Oct 2015 20:30:57 +0000 (13:30 -0700)] 
Move __SIGRTMIN.

gdb/ChangeLog:

* nat/linux-nat.h (__SIGRTMIN): Move here from gdbserver/linux-low.c.

gdb/gdbserver/ChangeLog:

* linux-low.c (__SIGRTMIN): Move to nat/linux-nat.h.

8 years agomusl: Move W_STOPCODE to common/gdb_wait.h.
Doug Evans [Mon, 26 Oct 2015 20:24:01 +0000 (13:24 -0700)] 
musl: Move W_STOPCODE to common/gdb_wait.h.

gdb/ChangeLog:

* common/gdb_wait.h (W_STOPCODE): Define, moved here from
gdbserver/linux-low.c.
(WSETSTOP): Simplify.

gdb/gdbserver/ChangeLog:

* linux-low.c (W_STOPCODE): Moved to common/gdb_wait.h.

8 years agoAdd some casts for building on musl.
Doug Evans [Mon, 26 Oct 2015 20:20:12 +0000 (13:20 -0700)] 
Add some casts for building on musl.

gdb/ChangeLog:

* linux-thread-db.c (find_new_threads_callback): Cast ti.ti_tid to
unsigned long for debug_printf.
(thread_db_pid_to_str): Ditto.

gdb/gdbserver/ChangeLog:

* thread-db.c (find_one_thread): Cast ti.ti_tid to unsigned long
for debug_printf.
(attach_thread, find_new_threads_callback): Ditto.

8 years agoguile: Simplify ioscm_make_gdb_stdio_port
Simon Marchi [Mon, 26 Oct 2015 19:05:50 +0000 (15:05 -0400)] 
guile: Simplify ioscm_make_gdb_stdio_port

As pointed out by Pedro, it's clearer to do it this way.  We can trust
that scm_mode_bits won't try to modify our string, even though it takes
a non-const char *.

gdb/ChangeLog:

* guile/scm-ports.c (ioscm_make_gdb_stdio_port): Do not pass a
local char array to scm_mode_bits, use a cast instead.

8 years agotui: Simplify tui_alloc_content
Simon Marchi [Mon, 26 Oct 2015 16:58:32 +0000 (12:58 -0400)] 
tui: Simplify tui_alloc_content

I stumbled upon this while doing some cxx-conversion work.  Since the
x-family alloc functions throw on failure, it is useless to test their
result for failure.  The else branch of != NULL is basically dead code.

I changed the type of element_block_ptr to struct tui_win_element, which
seems obvious (this is actually what raised the flag, casting the result
of xmalloc to struct tui_win_element* wouldn't work).

gdb/ChangeLog:

* tui/tui-data.c (tui_alloc_content): Don't check xmalloc
result.  Change type of element_block_ptr.  Change allocation to
use XNEWVEC.

8 years agoProperly convert address load of __start_XXX/__stop_XXX
H.J. Lu [Mon, 26 Oct 2015 13:10:23 +0000 (06:10 -0700)] 
Properly convert address load of __start_XXX/__stop_XXX

Since __start_XXX and __stop_XXX symbols aren't defined when address
load is being converted, we need to check if there is an XXX output
section to get their section and value.  This patch adds a new function,
bfd_link_get_defined_symbol, to search for the XXX output section to
check if __start_XXX and __stop_XXX symbols are defined.

bfd/

PR ld/19171
* elf32-i386.c (elf_i386_convert_load): Call
bfd_link_get_defined_symbol to check if a symbol is defined.
* elf64-x86-64.c (elf_x86_64_convert_load): Call
bfd_link_get_defined_symbol to get defined symbol section and
value.
* linker.c (bfd_link_get_defined_symbol): New function.
* bfd-in2.h: Regenerated.

ld/testsuite/

PR ld/19171
* ld-i386/lea1.s: Add tests for address load of __start_XXX
and __stop_XXX.
* ld-i386/mov1.s: Likewise.
* ld-x86-64/lea1.s: Likewise.
* ld-x86-64/mov1.s: Likewise.
* ld-i386/lea1a.d: Updated.
* ld-i386/lea1b.d: Likewise.
* ld-i386/lea1c.d: Likewise.
* ld-i386/mov1a.d: Likewise.
* ld-i386/mov1b.d: Likewise.
* ld-x86-64/lea1a.d: Likewise.
* ld-x86-64/lea1b.d: Likewise.
* ld-x86-64/lea1c.d: Likewise.
* ld-x86-64/lea1d.d: Likewise.
* ld-x86-64/lea1e.d: Likewise.
* ld-x86-64/lea1f.d: Likewise.
* ld-x86-64/mov1a.d: Likewise.
* ld-x86-64/mov1b.d: Likewise.
* ld-x86-64/mov1c.d: Likewise.
* ld-x86-64/mov1d.d: Likewise.

8 years agoDo not pass NULL for the string in catch_errors
Luis Machado [Mon, 26 Oct 2015 13:17:29 +0000 (11:17 -0200)] 
Do not pass NULL for the string in catch_errors

I caught a segmentation fault while running gdb.reverse/sigall-reverse.exp,
in a mingw32 GDB, in this code path. It boils down to the code trying to
strlen () a NULL pointer. I tracked things down and it looks like
record_full_message_wrapper_safe is the only offender.

gdb/ChangeLog:

2015-10-26  Luis Machado  <lgustavo@codesourcery.com>

* record-full.c (record_full_message_wrapper_safe): Pass empty string to
catch_errors call instead of NULL.

8 years agoFix constness problem in ioscm_make_gdb_stdio_port
Simon Marchi [Mon, 26 Oct 2015 12:41:38 +0000 (08:41 -0400)] 
Fix constness problem in ioscm_make_gdb_stdio_port

ioscm_make_gdb_stdio_port passes const char pointers (literal strings) to
scm_mode_bits, which takes a non-const char pointer.  Ideally, we would
change scm_mode_bits to take a const char pointer, but it's not part of
an API we control.

Instead, it's easy enough to build the string to pass to scm_mode_bits in
a (non-const) char array and pass that.

gdb/ChangeLog:

* guile/scm-ports.c (ioscm_make_gdb_stdio_port): Pass non-const
char pointer to scm_mode_bits.

8 years agosymtab.c: Add cast
Simon Marchi [Mon, 26 Oct 2015 12:41:38 +0000 (08:41 -0400)] 
symtab.c: Add cast

gdb/ChangeLog:

* symtab.c (default_make_symbol_completion_list_break_on_1): Add
cast.

8 years agogdbscm_memory_port_write: use local variable to avoid adding casts
Simon Marchi [Mon, 26 Oct 2015 12:41:37 +0000 (08:41 -0400)] 
gdbscm_memory_port_write: use local variable to avoid adding casts

By having a local variable of type (const gdb_byte *), we can avoid adding
two casts.

gdb/ChangeLog:

* guile/scm-ports.c (gdbscm_memory_port_write): Declare new
"data" local variable and use it.

8 years agoscm-symbol.c: Add (domain_enum) casts
Simon Marchi [Mon, 26 Oct 2015 12:41:36 +0000 (08:41 -0400)] 
scm-symbol.c: Add (domain_enum) casts

We currently pass integers as domain_enums to lookup_symbol.  The
most obvious fix is to add casts there.

I first thought of changing the type of the domain variables to
domain_enum.  However, because we pass a pointer to them to
gdbscm_parse_function_args, which expects them to be integers (because
of the format string), I don't think it would be correct.  If the enum
does not have the same size as an int, gdbscm_parse_function_args could
write past the memory of domain, overwriting something else on the
stack.

gdb/ChangeLog:

* guile/scm-symbol.c (gdbscm_lookup_global_symbol): Add
domain_enum cast.
(gdbscm_lookup_symbol): Likewise.

8 years agoAutomatic date update in version.in
GDB Administrator [Mon, 26 Oct 2015 00:00:08 +0000 (00:00 +0000)] 
Automatic date update in version.in

8 years agoFix compile.exp error message expectation
Jan Kratochvil [Sun, 25 Oct 2015 11:16:10 +0000 (12:16 +0100)] 
Fix compile.exp error message expectation

commit cdaec3f3e7ea9118204f0e579bd3257234fbae63
Author: Luis Machado <lgustavo@codesourcery.com>
Date:   Thu Aug 27 02:00:16 2015 -0300
    Mention language in compile error message

regressed:

-PASS: gdb.compile/compile.exp: compile code globalvar
+FAIL: gdb.compile/compile.exp: compile code globalvar

Update the expected message.

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

* gdb.compile/compile.exp (compile code globalvar): Update expectation
for a change by "Mention language in compile error message".

8 years agoRe-apply change for handling non-local references in nested functions.
Iain Buclaw [Sun, 25 Oct 2015 08:17:24 +0000 (09:17 +0100)] 
Re-apply change for handling non-local references in nested functions.

gdb/ChangeLog:

* d-exp.y: Remove an obsolete comment and propagate the block
information to the produced expression.

8 years agotui-data.c: Remove unnecessary casts
Simon Marchi [Sun, 25 Oct 2015 02:40:37 +0000 (22:40 -0400)] 
tui-data.c: Remove unnecessary casts

The (void *) casts make the build fail in C++ mode and are unnecessary.

gdb/ChangeLog:

* tui/tui-data.c (tui_add_to_source_windows): Remove void *
cast.
(tui_add_content_elements): Likewise.

8 years agocli-setshow.c: Constify variable
Simon Marchi [Sun, 25 Oct 2015 02:28:56 +0000 (22:28 -0400)] 
cli-setshow.c: Constify variable

Fixes:

/home/simark/src/binutils-gdb/gdb/cli/cli-setshow.c:390:13: error: invalid conversion from ‘const char*’ to ‘char*’ [-fpermissive]
  p = strchr (arg, ' ');
             ^
gdb/ChangeLog:

* cli/cli-setshow.c (do_set_command): Constify p.

8 years agoAutomatic date update in version.in
GDB Administrator [Sun, 25 Oct 2015 00:00:08 +0000 (00:00 +0000)] 
Automatic date update in version.in

8 years agoReplace (void *) cast with (gdb_byte *)
Simon Marchi [Sat, 24 Oct 2015 22:36:26 +0000 (18:36 -0400)] 
Replace (void *) cast with (gdb_byte *)

Fixes:

/home/simark/src/binutils-gdb/gdb/nat/linux-ptrace.c:207:6: error: invalid conversion from ‘void*’ to ‘gdb_byte* {aka unsigned char*}’ [-fpermissive]
   pc = (void *) (uintptr_t) l;
         ^

gdb/ChangeLog:

* nat/linux-ptrace.c (linux_ptrace_test_ret_to_nx): Replace
(void *) cast with (gdb_byte *).

8 years agoproc-service.c: Add (gdb_byte *) cast
Simon Marchi [Sat, 24 Oct 2015 22:36:25 +0000 (18:36 -0400)] 
proc-service.c: Add (gdb_byte *) cast

A cast here is necessary, just as it's necessary in ps_pdwrite just
below.  The type of buf can't be changed, since it's fixed in the ps_pd*
API.

gdb/ChangeLog:

* proc-service.c (ps_pdread): Add cast.

8 years agosparc64-tdep.c: Don't assign using memcpy return
Simon Marchi [Sat, 24 Oct 2015 22:36:24 +0000 (18:36 -0400)] 
sparc64-tdep.c: Don't assign using memcpy return

This:

  valbuf = memcpy (buf, valbuf, len);

causes a build failure in C++, because memcpy returns the value of
"buf" as a void *.  Instead of adding a cast, we can just do the
assignment separately.

gdb/ChangeLog:

* sparc64-tdep.c (sparc64_store_arguments): Split assignment of
valbuf.

8 years agoia64-tdep.c: Remove (void *) casts
Simon Marchi [Sat, 24 Oct 2015 22:36:23 +0000 (18:36 -0400)] 
ia64-tdep.c: Remove (void *) casts

Remove these (void *) casts, which cause a build failure in C++ mode.

gdb/ChangeLog:

* ia64-tdep.c (ia64_pseudo_register_write): Remove cast.
(ia64_push_dummy_call): Remove cast and change type of "to" to
array of gdb_byte.

8 years agoAutomatic date update in version.in
GDB Administrator [Sat, 24 Oct 2015 00:00:08 +0000 (00:00 +0000)] 
Automatic date update in version.in

8 years agoAdd mmap casts in linux-btrace.c
Simon Marchi [Fri, 23 Oct 2015 23:48:48 +0000 (19:48 -0400)] 
Add mmap casts in linux-btrace.c

gdb/ChangeLog:

* linux-btrace.c (linux_enable_pt): Add cast to mmap return.

8 years agoAdd cast to observer.sh
Simon Marchi [Fri, 23 Oct 2015 20:58:13 +0000 (16:58 -0400)] 
Add cast to observer.sh

gdb/ChangeLog:

* observer.h (observer_${event}_notification_stub): Add cast.

8 years agoRemove set_breakpoint_data definition in GDBServer.
Antoine Tremblay [Fri, 23 Oct 2015 17:20:39 +0000 (13:20 -0400)] 
Remove set_breakpoint_data definition in GDBServer.

This patch removes the now unused set_breakpoint_data function from mem_break.h

gdb/gdbserver/ChangeLog:

* mem-break.h (set_breakpoint_data): Remove.

8 years agoFix nto,spu and win32 builds of GDBServer.
Antoine Tremblay [Fri, 23 Oct 2015 17:20:39 +0000 (13:20 -0400)] 
Fix nto,spu and win32 builds of GDBServer.

This patch fixes the build that was broken by :
https://sourceware.org/ml/gdb-patches/2015-10/msg00369.html

It implements the sw_breakpoint_from_kind operation on these targets and removes
the calls to set_breakpoint_data.

Compiliation tested on win32.

Not tested : nto, spu.

gdb/gdbserver/ChangeLog:

* nto-low.c (nto_sw_breakpoint_from_kind): New function.
(struct target_ops) <sw_breakpoint_from_kind>: Initialize.
(initialize_low): Remove set_breakpoint_data call.
* spu-low.c (spu_sw_breakpoint_from_kind): New function.
(struct target_ops) <sw_breakpoint_from_kind>: Iniitalize.
(initialize_low): Remove set_breakpoint_data call.
* win32-low.c (win32_sw_breakpoint_from_kind): New function.
(struct target_ops) <sw_breakpoint_from_kind>: Initialize.
(initialize_low): Remove set_breakpoint_data call.

8 years agoRefactor default_breakpoint_kind_from_pc to be used by all targets in GDBServer.
Antoine Tremblay [Fri, 23 Oct 2015 17:20:39 +0000 (13:20 -0400)] 
Refactor default_breakpoint_kind_from_pc to be used by all targets in GDBServer.

This patch moves default_breakpoint_kind_from_pc to target.c and creates a macro
so that all targets can easily use it.

This allows the breakpoint_kind_from_pc operation to be left unimplemented in
targets that do not need it.

This is preparation to fix the win32/nto/spu build that was broken by this
patch: https://sourceware.org/ml/gdb-patches/2015-10/msg00369.html

No regression on Ubuntu 14.04 x86-64 with gdbserver-{native-extended}

gdb/gdbserver/ChangeLog:

* linux-low.c (default_breakpoint_kind_from_pc): Move to target.c.
* mem-break.c (set_breakpoint_at): Use target_breakpoint_kind_from_pc.
* target.c (default_breakpoint_kind_from_pc): Moved from linux-low.c
* target.h (target_breakpoint_kind_from_pc): New macro.

8 years agoHandle __start_* and __stop_* symbols in --gc-sections
Alan Modra [Fri, 23 Oct 2015 11:53:05 +0000 (22:23 +1030)] 
Handle __start_* and __stop_* symbols in --gc-sections

PR ld/11133
PR ld/19161
PR ld/19167
* elflink.c (_bfd_elf_gc_mark_hook): Delete code handling __start_*
and __stop_* symbol refs.
(_bfd_elf_gc_mark_rsec): Add start_stop parameter.  Handle __start_*
and __stop_* symbol refs here..
(_bfd_elf_gc_mark_reloc): ..and here.
* elf-bfd.h (_bfd_elf_gc_mark_hook): Update prototype.
* elf-eh-frame.c (_bfd_elf_parse_eh_frame): Update
_bfd_elf_gc_mark_rsec call.

8 years agoAdd a test for PR ld/19167
H.J. Lu [Fri, 23 Oct 2015 11:23:51 +0000 (04:23 -0700)] 
Add a test for PR ld/19167

PR ld/19167
* ld-gc/gc.exp: Run pr19167 test.
* ld-gc/pr19167.d: New file.
* ld-gc/pr19167a.s: Likewise.
* ld-gc/pr19167b.s: Likewise.

8 years agoInitialize field insn_count correctly
Yao Qi [Wed, 21 Oct 2015 14:50:55 +0000 (15:50 +0100)] 
Initialize field insn_count correctly

This patch initialize dsd.insn_count, otherwise, it triggers the assert
below on testings we did recently.

gdb:

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

* aarch64-tdep.c (aarch64_displaced_step_copy_insn): Set
dsd.insn_count to zero.

8 years agoAutomatic date update in version.in
GDB Administrator [Fri, 23 Oct 2015 00:00:08 +0000 (00:00 +0000)] 
Automatic date update in version.in

8 years agoRe: Always keep sections marked with SEC_KEEP
Alan Modra [Thu, 22 Oct 2015 23:44:51 +0000 (10:14 +1030)] 
Re: Always keep sections marked with SEC_KEEP

Revert bba037e0, it breaks the gc-sections model.  Instead fix the
underlying problem which is that _bfd_elf_gc_mark_hook is too late to
be setting SEC_KEEP.

PR ld/11133
PR ld/19161
* elflink.c (elf_gc_sweep): Revert last patch.
(_bfd_elf_gc_mark_hook): Don't set SEC_KEEP here.

8 years agoAlways keep sections marked with SEC_KEEP
H.J. Lu [Thu, 22 Oct 2015 19:17:43 +0000 (12:17 -0700)] 
Always keep sections marked with SEC_KEEP

SEC_KEEP check in elf_gc_sweep was missing in commit:

commit bde6f3eb6dff94cea1d471e15c6154d55d49820f
Author: H.J. Lu <hjl.tools@gmail.com>
Date:   Fri Jan 8 01:43:23 2010 +0000

    Set SEC_KEEP on section XXX for undefined __start_XXX/__stop_XXX

    bfd/

    2010-01-07  H.J. Lu  <hongjiu.lu@intel.com>

      PR ld/11133
      * elflink.c (_bfd_elf_gc_mark_hook): Check section XXX for
      undefined __start_XXX/__stop_XXX in all input files and set
      SEC_KEEP.

This patch adds SEC_KEEP check to elf_gc_sweep.

bfd/

PR ld/19161
* elflink.c (elf_gc_sweep): Always keep sections marked with
SEC_KEEP.

ld/testsuite/

PR ld/19161
* ld-gc/gc.exp: Run pr19161 test.
* ld-gc/pr19161-1.c: New file.
* ld-gc/pr19161-2.c: Likewise.
* ld-gc/pr19161.d: Likewise.

8 years agogarbage collect gdb/infrun.c:stop_after_trap
Pedro Alves [Sun, 18 Oct 2015 11:32:47 +0000 (12:32 +0100)] 
garbage collect gdb/infrun.c:stop_after_trap

No longer used anywhere.

gdb/ChangeLog:
2015-10-22  Pedro Alves  <palves@redhat.com>

* infrun.c (stop_after_trap): Delete.
(clear_proceed_status, handle_signal_stop, struct
infcall_control_state, save_infcall_control_state)
(restore_infcall_control_state): Remove references to
stop_after_trap.

8 years agoFix inconsistent breakpoint kinds between breakpoints and tracepoints in GDBServer.
Antoine Tremblay [Thu, 22 Oct 2015 16:21:51 +0000 (12:21 -0400)] 
Fix inconsistent breakpoint kinds between breakpoints and tracepoints in GDBServer.

This patch fixes a regression introduced by :
https://sourceware.org/ml/gdb-patches/2015-10/msg00369.html

Tests : gdb.trace/trace-break.exp and gdb.trace/trace-mt.exp would fail on x86
with gdbserver-{native,extended}.

Before this patch, the breakpoint kind set by GDB with a Z packet and the one
set in the case of a tracepoint would be inconsistent on targets that did not
implement breakpoint_kind_from_pc. On x86 for example a breakpoint set by GDB
would have a kind of 1 but a breakpoint set by a tracepoint would have a kind of
0.

This created a missmatch when trying to insert a tracepoint and a breakpoint at
the same location. One of the two breakpoints would be removed with debug
message : "Inconsistent breakpoint kind".

This patch fixes the issue by changing the default 0 breakpoint kind to be
the size of the breakpoint according to sw_breakpoint_from_kind.

The default breakpoint kind must be the breakpoint length to keep consistency
between breakpoints set via GDB and the ones set internally by GDBServer.

No regression on Ubuntu 14.04 x86-64 with gdbserver-{native-extended}

gdb/gdbserver/ChangeLog:

* linux-low.c (default_breakpoint_kind_from_pc): New function.
(linux_breakpoint_kind_from_pc): Use default_breakpoint_kind_from_pc for
the default breakpoint kind.

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