binutils-gdb.git
9 years agoLinux x86 low-level debug register code synchronization
Gary Benson [Tue, 24 Mar 2015 14:05:44 +0000 (14:05 +0000)]
Linux x86 low-level debug register code synchronization

This commit makes several small changes to the low-level debug
register code for Linux x86, making the code in the GDB and
gdbserver implementations identical.

gdb/ChangeLog:

* x86-linux-nat.c (x86_linux_dr_set_addr): Update assertion.
(x86_linux_new_thread): Rename argument.

gdb/gdbserver/ChangeLog:

* linux-x86-low.c (x86_linux_dr_get): Add assertion.
Use perror_with_name.  Pass string through gettext.
(x86_linux_dr_set): Likewise.

9 years agoRename gdbserver's low-level Linux x86 debug register accessors
Gary Benson [Tue, 24 Mar 2015 14:05:44 +0000 (14:05 +0000)]
Rename gdbserver's low-level Linux x86 debug register accessors

This commit renames gdbserver's low-level Linux x86 debug register
accessors to the same names used by GDB.

gdb/gdbserver/ChangeLog:

* linux-x86-low.c (x86_dr_low_set_addr): Rename to...
(x86_linux_dr_set_addr): ...this.
(x86_dr_low_get_addr): Rename to...
(x86_linux_dr_get_addr): ...this.
(x86_dr_low_set_control): Rename to...
(x86_linux_dr_set_control): ...this.
(x86_dr_low_get_control): Rename to...
(x86_linux_dr_get_control): ...this.
(x86_dr_low_get_status): Rename to...
(x86_linux_dr_get_status): ...this.
(x86_dr_low): Update with new function names.

9 years agoMake lwp_info.arch_private handling shared
Gary Benson [Tue, 24 Mar 2015 14:05:44 +0000 (14:05 +0000)]
Make lwp_info.arch_private handling shared

This commit moves the code to handle lwp_info.arch_private for
Linux x86 into a new shared file, nat/x86-linux.c.

gdb/ChangeLog:

* nat/x86-linux.h: New file.
* nat/x86-linux.c: Likewise.
* Makefile.in (HFILES_NO_SRCDIR): Add nat/x86-linux.h.
(x86-linux.o): New rule.
* config/i386/linux.mh (NATDEPFILES): Add x86-linux.o.
* config/i386/linux64.mh (NATDEPFILES): Likewise.
* nat/linux-nat.h (struct arch_lwp_info): New forward declaration.
(lwp_set_arch_private_info): New declaration.
(lwp_arch_private_info): Likewise.
* linux-nat.c (lwp_set_arch_private_info): New function.
(lwp_arch_private_info): Likewise.
* x86-linux-nat.c: Include nat/x86-linux.h.
(arch_lwp_info): Removed structure.
(update_debug_registers_callback):
Use lwp_set_debug_registers_changed.
(x86_linux_prepare_to_resume): Use lwp_debug_registers_changed
and lwp_set_debug_registers_changed.
(x86_linux_new_thread): Use lwp_set_debug_registers_changed.

gdb/gdbserver/ChangeLog:

* Makefile.in (x86-linux.o): New rule.
* configure.srv: Add x86-linux.o to relevant targets.
* linux-low.c (lwp_set_arch_private_info): New function.
(lwp_arch_private_info): Likewise.
* linux-x86-low.c: Include nat/x86-linux.h.
(arch_lwp_info): Removed structure.
(update_debug_registers_callback):
Use lwp_set_debug_registers_changed.
(x86_linux_prepare_to_resume): Use lwp_debug_registers_changed
and lwp_set_debug_registers_changed.
(x86_linux_new_thread): Use lwp_set_debug_registers_changed.

9 years agoChange signature of linux_target_ops.new_thread
Gary Benson [Tue, 24 Mar 2015 14:05:44 +0000 (14:05 +0000)]
Change signature of linux_target_ops.new_thread

This commit changes the signature of linux_target_ops.new_thread in
gdbserver to match that used in GDB's equivalent.

gdb/gdbserver/ChangeLog:

* linux-low.h (linux_target_ops) <new_thread>: Changed signature.
* linux-arm-low.c (arm_new_thread): Likewise.
* linux-aarch64-low.c (aarch64_linux_new_thread): Likewise.
* linux-mips-low.c (mips_linux_new_thread): Likewise.
* linux-x86-low.c (x86_linux_new_thread): Likewise.
* linux-low.c (add_lwp): Update the_low_target.new_thread call.

9 years agoIntroduce basic LWP accessors
Gary Benson [Tue, 24 Mar 2015 14:05:44 +0000 (14:05 +0000)]
Introduce basic LWP accessors

This commit introduces three accessors that shared Linux code can
use to access fields of struct lwp_info.  The GDB and gdbserver
Linux x86 code is modified to use them.

gdb/ChangeLog:

* nat/linux-nat.h (ptid_of_lwp): New declaration.
(lwp_is_stopped): Likewise.
(lwp_stop_reason): Likewise.
* linux-nat.c (ptid_of_lwp): New function.
(lwp_is_stopped): Likewise.
(lwp_is_stopped_by_watchpoint): Likewise.
* x86-linux-nat.c (update_debug_registers_callback):
Use lwp_is_stopped.
(x86_linux_prepare_to_resume): Use ptid_of_lwp and
lwp_stop_reason.

gdb/gdbserver/ChangeLog:

* linux-low.c (ptid_of_lwp): New function.
(lwp_is_stopped): Likewise.
(lwp_stop_reason): Likewise.
* linux-x86-low.c (update_debug_registers_callback):
Use lwp_is_stopped.
(x86_linux_prepare_to_resume): Use ptid_of_lwp and
lwp_stop_reason.

9 years agoMake linux_stop_lwp be a shared function
Gary Benson [Tue, 24 Mar 2015 14:05:44 +0000 (14:05 +0000)]
Make linux_stop_lwp be a shared function

Both GDB and gdbserver had linux_stop_lwp functions with identical
declarations.  This commit moves these to nat/linux-nat.h to allow
shared code to use the function.

gdb/ChangeLog:

* linux-nat.h (linux_stop_lwp): Move declaration to...
* nat/linux-nat.h (linux_stop_lwp): New declaration.

gdb/gdbserver/ChangeLog:

* linux-low.h (linux_stop_lwp): Remove declaration.

9 years agoAdd iterate_over_lwps to gdbserver
Gary Benson [Tue, 24 Mar 2015 14:05:43 +0000 (14:05 +0000)]
Add iterate_over_lwps to gdbserver

This commit introduces a new function, iterate_over_lwps, that
shared Linux code can use to call a function for each LWP that
matches certain criteria.  This function already existed in GDB
and was in use by GDB's various low-level Linux x86 debug register
setters.  An equivalent was written for gdbserver and gdbserver's
low-level Linux x86 debug register setters were modified to use
it.

gdb/ChangeLog:

* linux-nat.h: Include nat/linux-nat.h.
(iterate_over_lwps): Move declaration to nat/linux-nat.h.
* nat/linux-nat.h (struct lwp_info): New forward declaration.
(iterate_over_lwps_ftype): New typedef.
(iterate_over_lwps): New declaration.
* linux-nat.h (iterate_over_lwps): Update comment.  Use
iterate_over_lwps_ftype.  Update callback return value check.

gdb/gdbserver/ChangeLog:

* linux-low.h: Include nat/linux-nat.h.
* linux-low.c (iterate_over_lwps_args): New structure.
(iterate_over_lwps_filter): New function.
(iterate_over_lwps): Likewise.
* linux-x86-low.c (update_debug_registers_callback):
Update signature to what iterate_over_lwps expects.
Remove PID check that iterate_over_lwps now performs.
(x86_dr_low_set_addr): Use iterate_over_lwps.
(x86_dr_low_set_control): Likewise.

9 years agoAdd x86_debug_reg_state to gdbserver
Gary Benson [Tue, 24 Mar 2015 14:05:43 +0000 (14:05 +0000)]
Add x86_debug_reg_state to gdbserver

This commit introduces a new function, x86_debug_reg_state, that
shared x86 code can use to access the local mirror of a process's
debug registers.  This function already existed in GDB and was
in use by GDB's x86_linux_prepare_to_resume.  An equivalent was
written for gdbserver and gdbserver's x86_linux_prepare_to_resume
was modified to use it.

gdb/ChangeLog:

* x86-nat.h (x86_debug_reg_state): Move declaration to...
* nat/x86-dregs.h (x86_debug_reg_state): New declaration.

gdb/gdbserver/ChangeLog:

* linux-x86-low.c (x86_debug_reg_state): New function.
(x86_linux_prepare_to_resume): Use the above.

9 years agoIntroduce current_lwp_ptid
Gary Benson [Tue, 24 Mar 2015 14:05:43 +0000 (14:05 +0000)]
Introduce current_lwp_ptid

This commit introduces a new function, current_lwp_ptid, that
shared Linux code can use to obtain the ptid of the current
lightweight process.

gdb/ChangeLog:

* nat/linux-nat.h (current_lwp_ptid): New declaration.
* linux-nat.c (current_lwp_ptid): New function.
* x86-linux-nat.c: Include nat/linux-nat.h.
(x86_linux_dr_get_addr): Use current_lwp_ptid.
(x86_linux_dr_get_control): Likewise.
(x86_linux_dr_get_status): Likewise.
(x86_linux_dr_set_control): Likewise.
(x86_linux_dr_set_addr): Likewise.

gdb/gdbserver/ChangeLog:

* linux-low.c (current_lwp_ptid): New function.
* linux-x86-low.c: Include nat/linux-nat.h.
(x86_dr_low_get_addr): Use current_lwp_ptid.
(x86_dr_low_get_control): Likewise.
(x86_dr_low_get_status): Likewise.

9 years agoFix breakpoint thread condition missing with mi and a pending breakpoint.
Antoine Tremblay [Thu, 19 Feb 2015 20:23:34 +0000 (15:23 -0500)]
Fix breakpoint thread condition missing with mi and a pending breakpoint.

When setting a pending breakpoint with a thread condition while using
the mi interface, the thread condition would be lost by gdb when the breakpoint
was resolved.

This patch fixes this behavior by setting the thread condition properly in the
mi case.

Also, this patch modifies the mi-pending test case to test for this issue and
removes some unneeded code in the testcase and dependency on stdio.

gdb/Changelog:
PR breakpoints/16466
* breakpoint.c (create_breakpoint): Set thread on breakpoint struct.

gdb/testsuite/ChangeLog:
PR breakpoints/16466
* gdb.mi/Makefile.in: Add mi-pendshr2.sl to cleanup.
* gdb.mi/mi-pending.c (thread_func): New function.
(int main): Add threading support required.
* gdb.mi/mi-pending.exp: Add tests for this issue.
* gdb.mi/mi-pendshr.c (pendfunc1): Remove stdio dependency.
(pendfunc2): Remove stdio dependency.
* gdb.mi/mi-pendshr2.c: New file.

9 years ago[AArch64] Refactor generation of 835769 workaround stubs.
Marcus Shawcroft [Fri, 20 Mar 2015 19:08:00 +0000 (19:08 +0000)]
[AArch64] Refactor generation of 835769 workaround stubs.

This patch recognizes that we only need to perform one scan for the
835769 errata and that this scan can take place before we insert
branch stubs.  The erratum scan code is relocated and adjusted to
create stub entries directly rather than populating an intermediate
representation.  Since stub entries are created immediately we can
drop the adhoc stub size adjustment code and allow the generic stub
sizing code to deal with 835769 stub entries.

This patch restructures the code but does not change the workaround
used to deal with erratum 83679, the exact placement of workaround
stubs in the final image may change slightly after this patch due to
stubs being created in a different order.

9 years ago[AArch64] Use _bfd_aarch64_add_stub_entry_in_group.
Marcus Shawcroft [Tue, 24 Mar 2015 11:24:50 +0000 (11:24 +0000)]
[AArch64] Use _bfd_aarch64_add_stub_entry_in_group.

Adjust the 835769 workaround code to use
_bfd_aarch64_add_stub_entry_in_group rather than inspect the
underlying section_group structure directly.

9 years agoMake powerpc bfd ld reloc overflow vs undefined symbols match gold
Alan Modra [Tue, 24 Mar 2015 07:07:57 +0000 (17:37 +1030)]
Make powerpc bfd ld reloc overflow vs undefined symbols match gold

* elf64-ppc.c (ppc64_elf_relocate_section): Report overflow to
stubs, even those for undefined weak symbols.  Otherwise, don't
report relocation overflow on branches to undefined strong
symbols.  Fix memory leak.
* elf32-ppc.c (ppc_elf_relocate_section): Don't report relocation
overflow on branches to undefined strong symbols.

9 years agosim: m68hc11/mips/mn10300/v850: add basic sim_pc_get
Mike Frysinger [Tue, 24 Mar 2015 06:41:51 +0000 (02:41 -0400)]
sim: m68hc11/mips/mn10300/v850: add basic sim_pc_get

The previous profile change broke these sims that use sim-profile but
not sim-cpu (due to missing model support).  Add simple funcs until we
can convert these over properly.

9 years agoPR18147, relocation overflow when --unresolved-symbols=ignore-all
Alan Modra [Tue, 24 Mar 2015 05:16:50 +0000 (15:46 +1030)]
PR18147, relocation overflow when --unresolved-symbols=ignore-all

If ignoring unresolved symbols, ignore reloc overflows too.  If not
ignoring unresolved symbols we will report an error about the symbol
being undefined, making any report about reloc overflow superfluous.

PR18147
* powerpc.cc (Target_powerpc::Relocate::relocate): Don't report
relocation errors for branches to strong undefined symbols.

9 years agoExtend arm_feature_set struct to provide more bits
Terry Guo [Tue, 24 Mar 2015 06:08:08 +0000 (14:08 +0800)]
Extend arm_feature_set struct to provide more bits

gas/ChangeLog:
2015-03-24  Terry Guo  <terry.guo@arm.com>

* config/tc-arm.c (no_cpu_selected): Use new macro to compare
features.
(parse_psr): Likewise.
(do_t_mrs): Likewise.
(do_t_msr): Likewise.
(static const arm_feature_set arm_ext_*): Defined with new
macros.
(static const arm_feature_set arm_cext_*): Likewise.
(static const arm_feature_set fpu_fpa_ext_*): Likewise.
(static const arm_feature_set fpu_vfp_ext_*): Likewise.
(deprecated_coproc_regs): Likewise.
(UL_BARRIER): Likewise.
(barrier_opt_names): Likewise.
(arm_cpus): Likewise.
(arm_extensions): Likewise.

include/opcode/ChangeLog:
2015-03-24  Terry Guo  <terry.guo@arm.com>

* arm.h (arm_feature_set): Extended to provide more available
* bits.
(ARM_ANY): Updated to follow above new definition.
(ARM_CPU_HAS_FEATURE): Likewise.
(ARM_CPU_IS_ANY): Likewise.
(ARM_MERGE_FEATURE_SETS): Likewise.
(ARM_CLEAR_FEATURE): Likewise.
(ARM_FEATURE): Likewise.
(ARM_FEATURE_COPY): New macro.
(ARM_FEATURE_EQUAL): Likewise.
(ARM_FEATURE_ZERO): Likewise.
(ARM_FEATURE_CORE_EQUAL): Likewise.
(ARM_FEATURE_LOW): Likewise.
(ARM_FEATURE_CORE_LOW): Likewise.
(ARM_FEATURE_CORE_COPROC): Likewise.

opcodes/ChangeLog:
2015-03-24  Terry Guo  <terry.guo@arm.com>

* arm-dis.c (opcode32): Updated to use new arm feature struct.
(opcode16): Likewise.
(coprocessor_opcodes): Replace bit with feature struct.
(neon_opcodes): Likewise.
(arm_opcodes): Likewise.
(thumb_opcodes): Likewise.
(thumb32_opcodes): Likewise.
(print_insn_coprocessor): Likewise.
(print_insn_arm): Likewise.
(select_arm_features): Follow new feature struct.

9 years agosim: profile: disconnect from watchpoint core
Mike Frysinger [Mon, 23 Mar 2015 04:24:05 +0000 (00:24 -0400)]
sim: profile: disconnect from watchpoint core

The profile code was using STATE_WATCHPOINTS to get access to the PC, but
we already have a standard method for getting the pc, so switch to that.

This assumes that sizeof_pc is the same size as sim_cia, but we already
assume this in places by way of sim_pc_{get,set}, and this is how it's
documented in the sim-base.h API.

9 years agosim: moxie: clean up build time warnings
Mike Frysinger [Tue, 24 Mar 2015 05:11:20 +0000 (01:11 -0400)]
sim: moxie: clean up build time warnings

9 years agosim: moxie: convert to nrun.o
Mike Frysinger [Mon, 23 Mar 2015 03:59:45 +0000 (23:59 -0400)]
sim: moxie: convert to nrun.o

This port already used a lot of common/ files, so cutting it over to
nrun.o and using a few more common objects is pretty straight forward.

9 years agosim: erc32/h8300/m68hc11: trim unused functions
Mike Frysinger [Mon, 23 Mar 2015 03:16:01 +0000 (23:16 -0400)]
sim: erc32/h8300/m68hc11: trim unused functions

These funcs are only used with the old run.o, and these sims use nrun.o,
so drop these stub funcs.

9 years agosim: moxie: switch to common sim-command.o
Mike Frysinger [Mon, 23 Mar 2015 02:59:47 +0000 (22:59 -0400)]
sim: moxie: switch to common sim-command.o

9 years agosim: clean up SIM_HAVE_BIENDIAN
Mike Frysinger [Mon, 23 Mar 2015 02:55:42 +0000 (22:55 -0400)]
sim: clean up SIM_HAVE_BIENDIAN

This define only applies when using the old run.o main.  Document it as
such, and delete it from mips/sh64 since both use nrun.o now.

9 years agosim: m32r: drop duplicate dv_sockser_install call
Mike Frysinger [Mon, 23 Mar 2015 02:45:47 +0000 (22:45 -0400)]
sim: m32r: drop duplicate dv_sockser_install call

Since sim_module_install takes care of this for us, there's no need
to initialize the module twice.

9 years agosim: Revert "Fix frv/iq2000/m32r/sh64 sim, default hardware to off."
Mike Frysinger [Sat, 14 Mar 2015 20:09:12 +0000 (16:09 -0400)]
sim: Revert "Fix frv/iq2000/m32r/sh64 sim, default hardware to off."

This partially reverts commits:
105dd264de9a2fa7eee45eff897aa1d6171c1c4b
3df3af7c3f9095f9dc951fe680ce76f6e497914b
c4892a6b37647a0b33a2113b59762f678aabe4b2
9e3042ec073e05a0a5aa56398fd2662c5dcd5002

Now that dv-sockser is handled entirely by the common build logic, the
failure these targets were hitting isn't really possible anymore.  Lets
reset their hardware status back to defaulting to on.  Some of these
were set to "always" previously, but we don't support that anymore.

9 years agosim: fix sim-hardware configure option
Mike Frysinger [Tue, 24 Mar 2015 02:19:41 +0000 (22:19 -0400)]
sim: fix sim-hardware configure option

The current default handling for the --enable-sim-hardware option ends up
forcing the value to whatever is set as the first argument when calling
the macro (by virtue of how autoconf works).  Relocate the setup code to
the 4th parameter of the AC_ARG_ENABLE macro to fix it.

This was caused by the simplification work in 1517bd274290e06af498ef7e49.

Reported-by: Hans-Peter Nilsson <hans-peter.nilsson@axis.com>
9 years agosim: drop support for requiring hw support
Mike Frysinger [Tue, 24 Mar 2015 02:45:13 +0000 (22:45 -0400)]
sim: drop support for requiring hw support

Since no sim is using the "always" option to SIM_AC_OPTION_HARDWARE, and
we don't want to require hw support to always be enabled, drop the option.
This leads to a slight simplification in the macro too as we can collapse
the sim_hw_p variable.

9 years agosim: cris: delete unused CONFIG_DEVICES
Mike Frysinger [Tue, 24 Mar 2015 03:09:39 +0000 (23:09 -0400)]
sim: cris: delete unused CONFIG_DEVICES

Looks like unused copy & paste from other sim ports.  Drop it.

9 years agosim: mn10300: fix duplicated hardware option
Mike Frysinger [Mon, 23 Mar 2015 02:41:36 +0000 (22:41 -0400)]
sim: mn10300: fix duplicated hardware option

This code was calling SIM_AC_OPTION_HARDWARE twice -- we only want and
need to do it once.

9 years agosim: iq2000/mn10300: drop dv-sockser.o references
Mike Frysinger [Tue, 24 Mar 2015 02:57:36 +0000 (22:57 -0400)]
sim: iq2000/mn10300: drop dv-sockser.o references

The common code handles this for us now automatically.

9 years agosim: frv: delete UART device support
Mike Frysinger [Tue, 24 Mar 2015 01:51:35 +0000 (21:51 -0400)]
sim: frv: delete UART device support

This looks like copy & paste logic from the m32r port (and history
suggests this as well).  Since building with hw & device support
enabled leads to failures:
sim/frv/devices.c: In function 'device_io_read_buffer':
sim/frv/devices.c:39:15: error: 'UART_INCHAR_ADDR' undeclared (first use in this function)

Delete it entirely.  We leave device support in place as it is used
to flush the scache.

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

9 years agoFix indentation in ser_windows_setparity and hardwire_setparity.
Joel Brobecker [Mon, 23 Mar 2015 22:42:23 +0000 (15:42 -0700)]
Fix indentation in ser_windows_setparity and hardwire_setparity.

gdb/ChangeLog:

        * ser-mingw.c (ser_windows_setparity): Fix indentation.
        * ser-unix.c (hardwire_setparity): Likewise.

9 years agoGDB: Add set/show serial parity command.
Yury Grechishchev [Mon, 23 Mar 2015 21:15:42 +0000 (00:15 +0300)]
GDB: Add set/show serial parity command.

The "set serial parity" command allows the user to control which
parity to use when communicating over a serial connection, rather
than having the parity hardcoded to none.

gdb/ChangeLog:

        * NEWS: Mention set/show serial parity command.
        * monitor.c (monitor_open): Call serial_setparity.
        * remote.c (remote_open_1): Likewise.
        * ser-base.c (ser_base_serparity): New function.
        * ser-base.h (ser_base_setparity): Add  declaration.
        * ser-go32.c (dos_ops): Set "setparity" field.
        * ser-mingw.c (ser_windows_raw): Do not set state.fParity and
        state.Parity.
        (ser_windows_setparity): New function.
        (hardwire_ops): Add ser_windows_setparity.
        (tty_ops): Add NULL for setparity field.
        (pipe_ops): Add ser_base_setparity.
        (tcp_ops): Likewise.
        * ser-pipe.c (pipe_ops): Likewise.
        * ser-tcp.c (tcp_ops): Likewise.
        * ser-unix.c (hardwire_setparity): Add declaration.
        (hardwire_raw): Don't reset PARENB flag.
        (hardwire_setparity): New function.
        (hardwire_ops): Add hardwire_setparity.
        * serial.c (serial_setparity): New function.
        (serial_parity): New global.
        (parity_none, parity_odd, parity_even, parity_enums, parity):
        New static globals.
        (set_parity): New function.
        (_initialize_serial): Add set/show serial parity commands.
        * serial.h (GDBPARITY_NONE): Define.
        (GDBPARITY_ODD): Define.
        (GDBPARITY_EVEN): Define.
        (serial_setparity) Add declaration.
        (struct serial_ops): Add setparity field.
        * target.h (serial_parity): Add declaration.

gdb/doc/ChangeLog:

        * gdb.texinfo (Remote configuration): Document "set/show
        serial parity" command.

9 years agoUpdate comment of linespec_lexer_lex_keyword.
Keith Seitz [Mon, 23 Mar 2015 20:32:01 +0000 (13:32 -0700)]
Update comment of linespec_lexer_lex_keyword.

gdb/ChangeLog

       * linespec.c (linespec_lexer_lex_keyword): Update comment.

9 years agoAdd missing changelog entries of last commit
Keith Seitz [Mon, 23 Mar 2015 20:29:19 +0000 (13:29 -0700)]
Add missing changelog entries of last commit

9 years agoExpand keyword lexing intelligence in the linespec parser.
Keith Seitz [Mon, 23 Mar 2015 19:59:18 +0000 (12:59 -0700)]
Expand keyword lexing intelligence in the linespec parser.

    This patch changes the heuristic the linespec lexer uses to
    detect a keyword in the input stream.

    Currently, the heuristic is: a word is a keyword if it
    1) points to a string that is a keyword
    2) is followed by a non-identifier character

    This is strictly more correct than using whitespace. For example,
    it allows constructs such as "break foo if(i == 1)". However,
    find_condition_and_thread in breakpoint.c does not support this expanded
    usage. It requires whitespace to follow the keyword.

    The proposed new heuristic is: a word is a keyword if it
    1) points to a string that is a keyword
    2) is followed by whitespace
    3) is not followed by another keyword string followed by whitespace

    This additional complexity allows constructs such as
    "break thread thread 3" and "break thread 3".  In the former case,
    the actual location is a symbol named "thread" to be set on thread #3.
    In the later case, the location is NULL, i.e., the default location,
    to be set on thread #3.

    In order to pass all the new tests added here, I've also had to add a
    new feature to parse_breakpoint_sals, which expands recognition of the
    default location to keywords other than "if", which is the only keyword
    currently permitted with the default (NULL) location, but there is no
    reason to exclude other keywords.

    Consequently, it will be possible to use "break thread 1" or
    "break task 1".

    In addition to all of this, it is now possible to remove the keyword_ok
    state from the linespec parser.

    gdb/ChangeLog

     * breakpoint.c (parse_breakpoint_sals): Use
     linespec_lexer_lex_keyword to ascertain if the user specified
     a NULL location.
     * linespec.c [IF_KEYWORD_INDEX]: Define.
     (linespec_lexer_lex_keyword): Export.
     (struct ls_parser) <keyword_ok>: Remove.
     A keyword is only a keyword if not followed by another keyword.
     (linespec_lexer_lex_one): Remove keyword_ok handling.
     Add comment explaining why the parsing stream is not advanced
     when a keyword is seen.
     (parse_linespec): Remove parser->keyword_ok.
     * linespec.h (linespec_lexer_lex_keyword): Add declaration.

    gdb/testsuite/ChangeLog

     * gdb.linespec/keywords.c: New file.
     * gdb.linespec/keywords.exp: New file.

9 years agoPR gdb/18021 - defend against "static virtual" methods
Keith Seitz [Fri, 27 Feb 2015 17:55:07 +0000 (09:55 -0800)]
PR gdb/18021 - defend against "static virtual" methods

This bug appears to be caused by bad debuginfo. The method
causing the sefault in the reporter's test case is marked both static
and virtual.

This patch simply safegaurds against this case in dwarf2_add_member_fn,
where the code assumes that there is a `this' pointer when a virtual method
is seen (more specifically, when DW_AT_vtable_elem is seen).

It previously dereferenced the first formal parameter
(`this' pointer), which in this case doesn't exist. GDB consequently
segfaulted dereferencing a NULL pointer.

gdb/ChangeLog
PR gdb/18021
* dwarf2read.c (dwarf2_add_member_fn): Issue a complaint
if we find a static method with DW_AT_vtable_elem_location.

gdb/testsuite/ChangeLog
PR gdb/18021
* gdb.dwarf2/staticvirtual.exp: New test.

9 years ago[OBV] Fix build -- missing ';'
Keith Seitz [Mon, 23 Mar 2015 18:41:11 +0000 (11:41 -0700)]
[OBV] Fix build -- missing ';'

bfd/ChangeLog

* elfnn-aarch64.c (_bfd_aarch64_create_or_find_stub_sec): Add
missing ';'.

9 years agoAdding Changelog for previous commit.
Marcus Shawcroft [Fri, 20 Mar 2015 18:54:59 +0000 (18:54 +0000)]
Adding Changelog for previous commit.

9 years agoFactor out _bfd_aarch64_erratum_835769_stub_name
Marcus Shawcroft [Fri, 20 Mar 2015 18:54:59 +0000 (18:54 +0000)]
Factor out _bfd_aarch64_erratum_835769_stub_name

9 years ago[AArch64] Factor out _bfd_aarch64_resize_stubs()
Marcus Shawcroft [Fri, 20 Mar 2015 20:20:35 +0000 (20:20 +0000)]
[AArch64] Factor out _bfd_aarch64_resize_stubs()

9 years ago[AArch64] Factor stub creation code into _bfd_aarch64_create_stub_section.
Marcus Shawcroft [Tue, 10 Mar 2015 13:16:28 +0000 (13:16 +0000)]
[AArch64] Factor stub creation code into _bfd_aarch64_create_stub_section.

9 years ago[AArch64] Factor out common behaviour between elf_aarch64_create_or_find_stub_sec...
Marcus Shawcroft [Sat, 28 Feb 2015 00:10:21 +0000 (00:10 +0000)]
[AArch64] Factor out common behaviour between elf_aarch64_create_or_find_stub_sec and elfNN_aarch64_add_stub

9 years ago[AArch64] Flip sense of erratum_835769_scan.
Marcus Shawcroft [Fri, 20 Mar 2015 18:49:29 +0000 (18:49 +0000)]
[AArch64] Flip sense of erratum_835769_scan.

9 years ago[AArch64] Drop unused argument to elf_aarch64_create_or_find_stub_sec
Marcus Shawcroft [Sat, 28 Feb 2015 00:06:26 +0000 (00:06 +0000)]
[AArch64] Drop unused argument to elf_aarch64_create_or_find_stub_sec

9 years ago[AArch64] Remove unused variable.
Marcus Shawcroft [Sun, 22 Mar 2015 07:59:48 +0000 (07:59 +0000)]
[AArch64] Remove unused variable.

9 years agoFixup previous changelog entry.
Marcus Shawcroft [Mon, 23 Mar 2015 15:10:56 +0000 (15:10 +0000)]
Fixup previous changelog entry.

9 years agoRemove dead code.
Marcus Shawcroft [Sun, 22 Mar 2015 07:57:18 +0000 (07:57 +0000)]
Remove dead code.

9 years ago[AArch64] Tidy up in aarch64_mem_op_p().
Marcus Shawcroft [Thu, 12 Mar 2015 12:11:07 +0000 (12:11 +0000)]
[AArch64] Tidy up in aarch64_mem_op_p().

9 years ago[AArch64] Adjust layout of elfNN_aarch64_write_section.
Marcus Shawcroft [Fri, 13 Mar 2015 14:50:26 +0000 (14:50 +0000)]
[AArch64] Adjust layout of elfNN_aarch64_write_section.

9 years ago[AArch64] Adjust layout emultempl/aarch64elf.em.
Marcus Shawcroft [Sun, 22 Mar 2015 07:47:38 +0000 (07:47 +0000)]
[AArch64] Adjust layout emultempl/aarch64elf.em.

9 years agoRemove is_merge_section_for.
Rafael Ávila de Espíndola [Mon, 23 Mar 2015 13:16:49 +0000 (09:16 -0400)]
Remove is_merge_section_for.

Now that Input_merge_map has an Output_section_data, we can use it in
implementing find_merge_section and replace the only use of is_merge_section_for
with it.

9 years agoFix thinko with previous delta to RL78 sim, by adding code to define the G10 and...
Nick Clifton [Mon, 23 Mar 2015 11:40:14 +0000 (11:40 +0000)]
Fix thinko with previous delta to RL78 sim, by adding code to define the G10 and G13 mode options.

* cpu.c (rl78_g10_mode): Declare.
(g13_multiply): Declare.
* cpu.h (rl78_g10_mode): Export.
(g13_multiply): Export.

9 years agosim: dv-sockser: move build to common dir
Mike Frysinger [Mon, 23 Mar 2015 02:36:12 +0000 (22:36 -0400)]
sim: dv-sockser: move build to common dir

If dv-sockser is available, lets add it to the common SIM_HW_OBJS
variable so it is always included automatically.  Now ports do not
have to shoe horn it in directly themselves.  It does mean it will
be compiled for targets that don't explicitly use it, but that's
really what we want anyways.

9 years agosim: dv-sockser: add stub funcs when not available
Mike Frysinger [Mon, 23 Mar 2015 02:23:04 +0000 (22:23 -0400)]
sim: dv-sockser: add stub funcs when not available

This lets ports assume that the dv-sockser API is always available if
they want to.  This way we don't have to do an abort at configure time
and it makes the resulting code a bit simpler.

9 years agosim: bfin/msp430: drop run-sim.h include
Mike Frysinger [Mon, 23 Mar 2015 04:08:25 +0000 (00:08 -0400)]
sim: bfin/msp430: drop run-sim.h include

This header is used only with run.o, and both of these use nrun.o.

9 years agosim: sh64: delete dv-sockser references
Mike Frysinger [Mon, 23 Mar 2015 02:25:04 +0000 (22:25 -0400)]
sim: sh64: delete dv-sockser references

This sim doesn't actually use dv-sockser code anywhere, so drop references
to it in its build files.

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

9 years agoFix support for i386 TLS GD-to-IE optimization.
Cary Coutant [Sun, 22 Mar 2015 18:59:21 +0000 (11:59 -0700)]
Fix support for i386 TLS GD-to-IE optimization.

There are two cases to support, one with an SIB-form (6-byte) LEA,
the other with a 5-byte LEA and a NOP after the call __tls_get_addr.
Gold did not yet support the second case. This patch adds that
support.

gold/
PR gold/18106
* i386.cc (Target_i386::Relocate::tls_gd_to_ie): Fix support for
non-SIB form of lea, with nop after the call.

9 years agoFix internal error with -z relro when .tbss is last relro section.
Cary Coutant [Sun, 22 Mar 2015 05:30:44 +0000 (22:30 -0700)]
Fix internal error with -z relro when .tbss is last relro section.

When calculating the padding necessary to align the end of the relro
segment to a page boundary, gold erroneously ignores the .tdata section
when checking to see if there are any relro sections (so if .tdata
is the only relro section, we fail to align the segment properly),
and erroneously pads the cumulative size of the segment based on
the alignment of .tbss. If there are no relro sections following .tbss,
it then fails to note the padding needed at the end of .tdata.

This patch fixes both problems. is_first_section_relro() will return
true when it sees a .tdata section, and we do not align the cumulative
size until after checking for the .tbss section.

gold/
PR gold/14217
* output.cc (Output_segment::is_first_section_relro): Don't ignore
.tdata section.
(Output_segment::set_section_addresses): Don't align size of relro
segment for .tbss.

9 years agoFix bug when optimizing string pools of aligned strings.
Cary Coutant [Sun, 22 Mar 2015 04:09:46 +0000 (21:09 -0700)]
Fix bug when optimizing string pools of aligned strings.

Tail optimization of string pools (enabled when linker is run with -O2
or greater) should not be done when the section alignment is greater
than the size of the characters in the strings; otherwise, unaligned
strings may result.

gold/
PR gold/18010
* stringpool.cc (Stringpool_template): Don't optimize if section
alignment is greater than sizeof(char).

9 years agoPR gold/18048: Fix INCLUDE directive support for gold
Cary Coutant [Sun, 22 Mar 2015 02:03:00 +0000 (19:03 -0700)]
PR gold/18048: Fix INCLUDE directive support for gold

This patch fixes INCLUDE directives in script files, so that when
an INCLUDE appears inside a sections block, section commands block,
or memory def block, the contents are parsed in the appropriate
context.

gold/
PR gold/18048
* script-c.h (script_include_directive): Add first_token parameter.
* script.cc (script_include_directive): Add first_token parameter, and
pass it to read_script_file.
* yyscript.y (PARSING_SECTIONS_BLOCK, PARSING_SECTION_CMDS)
(PARSING_MEMORY_DEF): New tokens.
(top): Add new productions for INCLUDE files.
(file_cmd): Replace file_or_sections_cmd with copy of its productions.
Pass PARSING_LINKER_SCRIPT to script_include_directive.
(section_block_cmd): Likewise; pass PARSING_SECTIONS_BLOCK.
(section_cmd): Pass PARSING_SECTION_CMDS.
(file_or_sections_cmd): Remove.
(memory_def): Pass PARSING_MEMORY_DEF.
* testsuite/Makefile.am (memory_test_2): New test.
* testsuite/Makefile.in: Regenerate.
* testsuite/memory_test_inc.t: New script file.
* testsuite/memory_test_inc_1.t.src: New script file.
* testsuite/memory_test_inc_2.t.src: New script file.
* testsuite/memory_test_inc_3.t.src: New script file.

9 years agoSupport compressed debug sections in dynamic object files.
Cary Coutant [Sun, 22 Mar 2015 01:50:11 +0000 (18:50 -0700)]
Support compressed debug sections in dynamic object files.

This patch adds support for reading compressed debug info in
shared objects. It actually simplifies things, by moving the
support for compressed sections all the way up to the top-level
Object class, eliminating the need for several virtual methods.

gold/
* dwp.cc (Sized_relobj_dwo::do_section_contents): Delete.
(Sized_relobj_dwo::setup): Build compressed section map.
(Sized_relobj_dwo::do_decompressed_section_contents): Delete.
* dynobj.cc (Sized_dynobj::base_read_symbols): Build compressed
section map.
* object.cc (Sized_relobj_file::Sized_relobj_file): Remove
compressed_sections_ field.
(build_compressed_section_map): Take Object instead of
Sized_relobj_file parameter; add decompress_if_needed parameter.
(Sized_relobj_file::do_find_special_sections): Store compressed
section map in parent Object.
(Sized_relobj_file::do_decompressed_section_contents): Move
implementation to Object::decompressed_section_contents.
(Sized_relobj_file::do_discard_decompressed_sections): Move
implementation to Object::discard_decompressed_sections.
* object.h (build_compressed_section_map): Declare.
(Object::Object): Add compressed_sections_ field.
(Object::section_is_compressed): Move implementation here.
(Object::decompressed_section_contents): De-virtualize.
(Object::discard_decompressed_sections): De-virtualize.
(Object::do_section_is_compressed): Delete.
(Object::do_decompressed_section_contents): Delete.
(Object::set_compressed_sections): New method.
(Object::compressed_sections): New method.
(Object::compressed_sections_): New data member.
(Compressed_section_info, Compressed_section_map): Move to top of file.
(Sized_relobj_file::do_section_is_compressed): Delete.
(Sized_relobj_file::do_decompressed_section_contents): Delete.
(Sized_relobj_file::do_discard_decompressed_sections): Delete.
(Sized_relobj_file::compressed_sections_): Move to Object class.

9 years agoFix internal error in do_relocate_sections when using plugins.
Cary Coutant [Sun, 22 Mar 2015 00:47:49 +0000 (17:47 -0700)]
Fix internal error in do_relocate_sections when using plugins.

In a previous patch for PR 14675, to fix a problem with
the .eh_frame section when static linking, I added a step to
finalize the .eh_frame section at the end of the first link
pass. This patch caused PR 18152, where a plugin-claimed
object caused a non-claimed object's layout to be deferred
until replacement files were read. The call to
finalize_eh_frame_section() is happening before the layout of
the deferred objects, leading to the internal error in
do_relocate_sections.

This patch moves the finalization of the .eh_frame section to
after deferred objects have been processed.

gold/
PR gold/14675
PR gold/18152
* gold.cc (queue_middle_tasks): Finalize .eh_frame after laying out
deferred objects.

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

9 years agoFix undefined behavior in TUI's TAB expansion
Eli Zaretskii [Sat, 21 Mar 2015 08:48:34 +0000 (10:48 +0200)]
Fix undefined behavior in TUI's TAB expansion

gdb/ChangeLog:

* tui/tui-io.c (tui_expand_tabs): Reinitialize the column counter
before the second loop, to avoid undefined behavior.  Reported by
Anton Blanchard <anton@samba.org>.

9 years agoAutomatic date update in version.in
GDB Administrator [Sat, 21 Mar 2015 00:00:07 +0000 (00:00 +0000)]
Automatic date update in version.in

9 years ago[gdb/DWARF] Introduce linked list for dynamic attributes
Keven Boell [Fri, 20 Mar 2015 21:45:20 +0000 (17:45 -0400)]
[gdb/DWARF] Introduce linked list for dynamic attributes

This patch introduces a linked list for dynamic attributes of a type.
This is a pre-work for the Fortran dynamic array support. The Fortran
dynamic array support will add more dynamic attributes to a type.
As only a few types will have such dynamic attributes set, a linked
list is more efficient in terms of memory consumption than adding
multiple attributes to main_type.

gdb/ChangeLog:

        * gdbtypes.c (resolve_dynamic_type_internal): Adapt
        data_location usage to linked list.
        (resolve_dynamic_type_internal): Adapt data_location to
        linked list.
        (get_dyn_prop, add_dyn_prop, copy_dynamic_prop_list): New function.
        (copy_type_recursive, copy_type): Add copy of linked list.
        * gdbtypes.h (enum dynamic_prop_node_kind): New enum.
        (struct dynamic_prop_list): New struct.
        * dwarf2read.c (set_die_type): Set data_location data.

9 years agoconstify i386-sol2-tdep.c and machoread.c
Pedro Alves [Mon, 9 Mar 2015 11:58:23 +0000 (11:58 +0000)]
constify i386-sol2-tdep.c and machoread.c

/home/pedro/gdb/mygit/src/gdb/i386-sol2-tdep.c: In function ‘const char* i386_sol2_static_transform_name(const char*)’:
/home/pedro/gdb/mygit/src/gdb/i386-sol2-tdep.c:93:29: error: invalid conversion from ‘const char*’ to ‘char*’ [-fpermissive]
       p = strrchr (name, '.');
                             ^
gdb:

2015-03-20  Pedro Alves  <palves@redhat.com>

* i386-sol2-tdep.c (i386_sol2_static_transform_name): Move "p" to
inner block and make it const.
* machoread.c (get_archive_prefix_len): Make "lparen" const.

9 years agoconstify set_breakpoint_condition
Pedro Alves [Mon, 9 Mar 2015 11:58:21 +0000 (11:58 +0000)]
constify set_breakpoint_condition

gdb:

2015-03-20  Pedro Alves  <palves@redhat.com>

* breakpoint.c (set_breakpoint_condition): Make argument "exp" const.
* breakpoint.h (set_breakpoint_condition): Update declaration.

9 years agoconstify tui/tui-io.c
Pedro Alves [Mon, 9 Mar 2015 11:58:20 +0000 (11:58 +0000)]
constify tui/tui-io.c

gdb:

2015-03-20  Pedro Alves  <palves@redhat.com>

* tui/tui-io.c (tui_expand_tabs): Make "s1" const.

9 years agoconstify xcoffread.c
Pedro Alves [Mon, 9 Mar 2015 11:58:20 +0000 (11:58 +0000)]
constify xcoffread.c

/home/pedro/gdb/mygit/src/gdb/xcoffread.c: In function ‘void scan_xcoff_symtab(objfile*)’:
/home/pedro/gdb/mygit/src/gdb/xcoffread.c:2644:33: error: invalid conversion from ‘const char*’ to ‘char*’ [-fpermissive]
      p = strchr (namestring, ':');
                                 ^
gdb:

2015-03-20  Pedro Alves  <palves@redhat.com>

* xcoffread.c (scan_xcoff_symtab): Make "p" and "q" const.

9 years agoconstify remote-m32r-sdi.c
Pedro Alves [Mon, 9 Mar 2015 11:58:19 +0000 (11:58 +0000)]
constify remote-m32r-sdi.c

gdb:

2015-03-20  Pedro Alves  <palves@redhat.com>

* remote-m32r-sdi.c (m32r_open): Make "port_str" const.

9 years agoconstify nto-tdep.c
Pedro Alves [Mon, 9 Mar 2015 11:58:14 +0000 (11:58 +0000)]
constify nto-tdep.c

/home/pedro/gdb/mygit/src/gdb/nto-tdep.c: In function ‘int nto_find_and_open_solib(char*, unsigned int, char**)’:
/home/pedro/gdb/mygit/src/gdb/nto-tdep.c:111:14: error: invalid conversion from ‘const char*’ to ‘char*’ [-fpermissive]
       endian = gdbarch_byte_order (target_gdbarch ())
              ^
/home/pedro/gdb/mygit/src/gdb/nto-tdep.c: In function ‘void nto_init_solib_absolute_prefix()’:
/home/pedro/gdb/mygit/src/gdb/nto-tdep.c:170:14: error: invalid conversion from ‘const char*’ to ‘char*’ [-fpermissive]
       endian = gdbarch_byte_order (target_gdbarch ())
              ^

gdb

2015-03-20  Pedro Alves  <palves@redhat.com>

* nto-tdep.c (nto_find_and_open_solib): Make "endian" const.
(nto_init_solib_absolute_prefix): Likewise.

9 years agoconstify gdbserver/tracepoint.c
Pedro Alves [Mon, 9 Mar 2015 11:58:09 +0000 (11:58 +0000)]
constify gdbserver/tracepoint.c

gdb/gdbserver/tracepoint.c:3647:7: error: invalid conversion from 'const char*' to 'char*' [-fpermissive]
gdb/gdbserver/tracepoint.c:3652:7: error: invalid conversion from 'const char*' to 'char*' [-fpermissive]
gdb/gdbserver/tracepoint.c:3657:7: error: invalid conversion from 'const char*' to 'char*' [-fpermissive]

gdb/gdbserver

2015-03-20  Pedro Alves  <palves@redhat.com>

* tracepoint.c (cmd_qtstatus): Make "str" const.

9 years agoconstify gdbserver/server.c
Pedro Alves [Mon, 9 Mar 2015 11:58:08 +0000 (11:58 +0000)]
constify gdbserver/server.c

gdb/gdbserver/

2015-03-20  Pedro Alves  <palves@redhat.com>

* server.c (handle_general_set): Make "req_str" const.

9 years agoconstify sparc-sol2-tdep.c and spu-tdep.c
Pedro Alves [Mon, 9 Mar 2015 11:58:17 +0000 (11:58 +0000)]
constify sparc-sol2-tdep.c and spu-tdep.c

/home/pedro/gdb/mygit/src/gdb/sparc-sol2-tdep.c: In function ‘const char* sparc_sol2_static_transform_name(const char*)’:
/home/pedro/gdb/mygit/src/gdb/sparc-sol2-tdep.c:247:35: error: invalid conversion from ‘const char*’ to ‘char*’ [-fpermissive]
       char *p = strrchr (name, '.');
                                   ^
gdb:

2015-03-20  Pedro Alves  <palves@redhat.com>

* sparc-sol2-tdep.c (sparc_sol2_static_transform_name): Make "p" const.
* spu-tdep.c (spu_gdbarch_init): Make "name" const.

9 years agoRemove gdb.hp
Jan Kratochvil [Fri, 20 Mar 2015 16:15:15 +0000 (17:15 +0100)]
Remove gdb.hp

gdb/ChangeLog
2015-03-20  Jan Kratochvil  <jan.kratochvil@redhat.com>

* config/djgpp/README: Remove gdb.hp.

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

* Makefile.in (ALL_SUBDIRS): Remove gdb.hp.
* README: Remove HP-UX and gdb.hp.
(configuration):
* configure: Regenerate.
* configure.ac (AC_OUTPUT): Remove gdb.hp/Makefile,
gdb.hp/gdb.objdbg/Makefile, gdb.hp/gdb.base-hp/Makefile,
gdb.hp/gdb.aCC/Makefile, gdb.hp/gdb.compat/Makefile,
gdb.hp/gdb.defects/Makefile.
* gdb.hp/Makefile.in: File deleted.
* gdb.hp/gdb.aCC/Makefile.in: File deleted.
* gdb.hp/gdb.aCC/optimize.c: File deleted.
* gdb.hp/gdb.aCC/optimize.exp: File deleted.
* gdb.hp/gdb.aCC/run.c: File deleted.
* gdb.hp/gdb.aCC/watch-cmd.exp: File deleted.
* gdb.hp/gdb.base-hp/Makefile.in: File deleted.
* gdb.hp/gdb.base-hp/callfwmall.c: File deleted.
* gdb.hp/gdb.base-hp/callfwmall.exp: File deleted.
* gdb.hp/gdb.base-hp/dollar.c: File deleted.
* gdb.hp/gdb.base-hp/dollar.exp: File deleted.
* gdb.hp/gdb.base-hp/genso-thresh.c: File deleted.
* gdb.hp/gdb.base-hp/hwwatchbus.c: File deleted.
* gdb.hp/gdb.base-hp/hwwatchbus.exp: File deleted.
* gdb.hp/gdb.base-hp/pxdb.c: File deleted.
* gdb.hp/gdb.base-hp/pxdb.exp: File deleted.
* gdb.hp/gdb.base-hp/reg-pa64.exp: File deleted.
* gdb.hp/gdb.base-hp/reg-pa64.s: File deleted.
* gdb.hp/gdb.base-hp/reg.exp: File deleted.
* gdb.hp/gdb.base-hp/reg.s: File deleted.
* gdb.hp/gdb.base-hp/sized-enum.c: File deleted.
* gdb.hp/gdb.base-hp/sized-enum.exp: File deleted.
* gdb.hp/gdb.base-hp/so-thresh.exp: File deleted.
* gdb.hp/gdb.base-hp/so-thresh.mk: File deleted.
* gdb.hp/gdb.base-hp/so-thresh.sh: File deleted.
* gdb.hp/gdb.compat/Makefile.in: File deleted.
* gdb.hp/gdb.compat/average.c: File deleted.
* gdb.hp/gdb.compat/sum.c: File deleted.
* gdb.hp/gdb.compat/xdb.c: File deleted.
* gdb.hp/gdb.compat/xdb0.c: File deleted.
* gdb.hp/gdb.compat/xdb0.h: File deleted.
* gdb.hp/gdb.compat/xdb1.c: File deleted.
* gdb.hp/gdb.compat/xdb1.exp: File deleted.
* gdb.hp/gdb.compat/xdb2.exp: File deleted.
* gdb.hp/gdb.compat/xdb3.exp: File deleted.
* gdb.hp/gdb.defects/Makefile.in: File deleted.
* gdb.hp/gdb.defects/bs14602.c: File deleted.
* gdb.hp/gdb.defects/bs14602.exp: File deleted.
* gdb.hp/gdb.defects/solib-d.c: File deleted.
* gdb.hp/gdb.defects/solib-d.exp: File deleted.
* gdb.hp/gdb.defects/solib-d1.c: File deleted.
* gdb.hp/gdb.defects/solib-d2.c: File deleted.
* gdb.hp/gdb.objdbg/Makefile.in: File deleted.
* gdb.hp/gdb.objdbg/objdbg01.exp: File deleted.
* gdb.hp/gdb.objdbg/objdbg01/x1.cc: File deleted.
* gdb.hp/gdb.objdbg/objdbg01/x2.cc: File deleted.
* gdb.hp/gdb.objdbg/objdbg01/x3.cc: File deleted.
* gdb.hp/gdb.objdbg/objdbg01/x3.h: File deleted.
* gdb.hp/gdb.objdbg/objdbg02.exp: File deleted.
* gdb.hp/gdb.objdbg/objdbg02/x1.cc: File deleted.
* gdb.hp/gdb.objdbg/objdbg02/x2.cc: File deleted.
* gdb.hp/gdb.objdbg/objdbg02/x3.cc: File deleted.
* gdb.hp/gdb.objdbg/objdbg03.exp: File deleted.
* gdb.hp/gdb.objdbg/objdbg03/x1.cc: File deleted.
* gdb.hp/gdb.objdbg/objdbg03/x2.cc: File deleted.
* gdb.hp/gdb.objdbg/objdbg03/x3.cc: File deleted.
* gdb.hp/gdb.objdbg/objdbg04.exp: File deleted.
* gdb.hp/gdb.objdbg/objdbg04/x.h: File deleted.
* gdb.hp/gdb.objdbg/objdbg04/x1.cc: File deleted.
* gdb.hp/gdb.objdbg/objdbg04/x2.cc: File deleted.
* gdb.hp/gdb.objdbg/tools/symaddr: File deleted.
* gdb.hp/gdb.objdbg/tools/symaddr.pa64: File deleted.
* gdb.hp/gdb.objdbg/tools/test-objdbg.cc: File deleted.
* gdb.hp/tools/odump: File deleted.

9 years agoLimit multi-byte nop instructions to 10 bytes
H.J. Lu [Fri, 20 Mar 2015 11:39:04 +0000 (04:39 -0700)]
Limit multi-byte nop instructions to 10 bytes

There is no performance advantage to use multi-byte nop instructions
greater than 10 bytes.  This patch limits multi-byte nop instructions
to 10 bytes.  Since there is only one way to encode multi-byte nop
instructions now, it also removed redundant nop tests.

gas/

* config/tc-i386.c (i386_align_code): Limit multi-byte nop
instructions to 10 bytes.

gas/testsuite/

* gas/i386/i386.exp: Don't run nops-1-bdver1, nops-1-bdver2,
nops-1-bdver3, nops-1-bdver4, nops-1-znver1, nops-1-btver1
nops-1-btver2, x86-64-nops-1-nocona, x86-64-nops-1-bdver1,
x86-64-nops-1-bdver2, x86-64-nops-1-bdver3, x86-64-nops-1-bdver4,
x86-64-nops-1-znver1, x86-64-nops-1-btver1 nor
x86-64-nops-1-btver2.
* gas/i386/nops-1-core2.d: Updated.
* gas/i386/nops-1-k8.d: Likewise.
* gas/i386/nops-4a-i686.d: Likewise.
* gas/i386/nops-5-i686.d: Likewise.
* gas/i386/nops-5.d: Likewise.
* gas/i386/nops-6.d: Likewise.
* gas/i386/x86-64-nops-1-core2.d: Likewise.
* gas/i386/x86-64-nops-1-g64.d: Likewise.
* gas/i386/x86-64-nops-1-k8.d: Likewise.
* gas/i386/x86-64-nops-1.d: Likewise.
* gas/i386/x86-64-nops-2.d: Likewise.
* gas/i386/x86-64-nops-3.d: Likewise.
* gas/i386/x86-64-nops-4-core2.d: Likewise.
* gas/i386/x86-64-nops-4-k8.d: Likewise.
* gas/i386/x86-64-nops-4.d: Likewise.
* gas/i386/x86-64-nops-5-k8.d: Likewise.
* gas/i386/x86-64-nops-5.d: Likewise.
* gas/i386/ilp32/x86-64-nops-1-core2.d: Likewise.
* gas/i386/ilp32/x86-64-nops-1-k8.d: Likewise.
* gas/i386/ilp32/x86-64-nops-1.d: Likewise.
* gas/i386/ilp32/x86-64-nops-2.d: Likewise.
* gas/i386/ilp32/x86-64-nops-3.d: Likewise.
* gas/i386/ilp32/x86-64-nops-4-core2.d: Likewise.
* gas/i386/ilp32/x86-64-nops-4-k8.d: Likewise.
* gas/i386/ilp32/x86-64-nops-4.d: Likewise.
* gas/i386/ilp32/x86-64-nops-5-k8.d: Likewise.
* gas/i386/ilp32/x86-64-nops-5.d: Likewise.
* gas/i386/nops-1-bdver1.d: Removed.
* gas/i386/nops-1-bdver2.d: Likewise.
* gas/i386/nops-1-bdver3.d: Likewise.
* gas/i386/nops-1-bdver4.d: Likewise.
* gas/i386/nops-1-btver1.d: Likewise.
* gas/i386/nops-1-btver2.d: Likewise.
* gas/i386/nops-1-znver1.d: Likewise.
* gas/i386/x86-64-nops-1-bdver1.d: Likewise.
* gas/i386/x86-64-nops-1-bdver2.d: Likewise.
* gas/i386/x86-64-nops-1-bdver3.d: Likewise.
* gas/i386/x86-64-nops-1-bdver4.d: Likewise.
* gas/i386/x86-64-nops-1-btver1.d: Likewise.
* gas/i386/x86-64-nops-1-btver2.d: Likewise.
* gas/i386/x86-64-nops-1-nocona.d: Likewise.
* gas/i386/x86-64-nops-1-znver1.d: Likewise.
* gas/i386/ilp32/x86-64-nops-1-nocona.d: Likewise.

9 years agoFixes implementation of hardware multiply/divide peripheral in RL78 G13 cores.
Nick Clifton [Fri, 20 Mar 2015 10:29:46 +0000 (10:29 +0000)]
Fixes implementation of hardware multiply/divide peripheral in RL78 G13 cores.

* load.c (rl78_load): If the G10, G13 or G14 flag bits are set in
the ELF header use them to select the proper emulation mode.
* mem.c (mem_put_byte): Use mem_put_hi to store a value into the
MDB register.
(mem_get_byte): Use mem_get_hi to extract a value from the MDB
register.

9 years agoDon't call set_gdbarch_cannot_step_breakpoint in aarch64_gdbarch_init
Yao Qi [Fri, 20 Mar 2015 10:15:21 +0000 (10:15 +0000)]
Don't call set_gdbarch_cannot_step_breakpoint in aarch64_gdbarch_init

Hi,
I am looking at the following fails in aarch64-linux,

stepi^M
47        NOP; /* after permanent bp */^M
(gdb) FAIL: gdb.base/bp-permanent.exp: always_inserted=off, sw_watchpoint=0: stepi signal with handler: single-step to handler

the test expects GDB single step into signal handler, but GDB doesn't.
The code in infrun.c:resume

      /* Most targets can step a breakpoint instruction, thus
 executing it normally.  But if this one cannot, just
 continue and we will hit it anyway.  */
      if (gdbarch_cannot_step_breakpoint (gdbarch))
step = 0;

change the intended action from "step" to "continue".  The gdbarch method
cannot_step_breakpoint isn't documented well, and I don't get much clue
after explore the history.  However, from the comments above,
aarch64-linux can step a breakpoint instruction, so don't need to call
set_gdbarch_cannot_step_breakpoint.

gdb:

2015-03-20  Yao Qi  <yao.qi@linaro.org>

* aarch64-tdep.c (aarch64_gdbarch_init): Don't call
set_gdbarch_cannot_step_breakpoint.

9 years agoAutomatic date update in version.in
GDB Administrator [Fri, 20 Mar 2015 00:00:07 +0000 (00:00 +0000)]
Automatic date update in version.in

9 years agoFix race exposed by gdb.threads/killed.exp
Pedro Alves [Thu, 19 Mar 2015 15:12:33 +0000 (15:12 +0000)]
Fix race exposed by gdb.threads/killed.exp

On GNU/Linux, this test sometimes FAILs like this:

 (gdb) run
 Starting program: /home/pedro/gdb/mygit/build/gdb/testsuite/gdb.threads/killed
 [Thread debugging using libthread_db enabled]
 Using host libthread_db library "/lib64/libthread_db.so.1".
 ptrace: No such process.
 (gdb)
 Program terminated with signal SIGKILL, Killed.
 The program no longer exists.
 FAIL: gdb.threads/killed.exp: run program to completion (timeout)

Note the suspicious "No such process" line (that's errno==ESRCH).
Adding debug output we see:

  linux_nat_wait: [process -1], [TARGET_WNOHANG]
  LLW: enter
  LNW: waitpid(-1, ...) returned 18465, ERRNO-OK
  LLW: waitpid 18465 received Stopped (signal) (stopped)
  LNW: waitpid(-1, ...) returned 18461, ERRNO-OK
  LLW: waitpid 18461 received Trace/breakpoint trap (stopped)
  LLW: Handling extended status 0x03057f
  LHEW: Got clone event from LWP 18461, new child is LWP 18465
  LNW: waitpid(-1, ...) returned 0, ERRNO-OK
  RSRL: resuming stopped-resumed LWP LWP 18465 at 0x3b36af4b51: step=0
  RSRL: resuming stopped-resumed LWP LWP 18461 at 0x3b36af4b51: step=0
  sigchld
  ptrace: No such process.
  (gdb) linux_nat_wait: [process -1], [TARGET_WNOHANG]
  LLW: enter
  LNW: waitpid(-1, ...) returned 18465, ERRNO-OK
  LLW: waitpid 18465 received Killed (terminated)
  LLW: LWP 18465 exited.
  LNW: waitpid(-1, ...) returned 18461, No child processes
  LLW: waitpid 18461 received Killed (terminated)
  Process 18461 exited
  LNW: waitpid(-1, ...) returned -1, No child processes
  LLW: exit
  sigchld
  infrun: target_wait (-1, status) =
  infrun:   18461 [process 18461],
  infrun:   status->kind = signalled, signal = GDB_SIGNAL_KILL
  infrun: TARGET_WAITKIND_SIGNALLED

  Program terminated with signal SIGKILL, Killed.
  The program no longer exists.
  infrun: stop_waiting
  FAIL: gdb.threads/killed.exp: run program to completion (timeout)

The issue is that here:

  RSRL: resuming stopped-resumed LWP LWP 18465 at 0x3b36af4b51: step=0
  RSRL: resuming stopped-resumed LWP LWP 18461 at 0x3b36af4b51: step=0

The first line shows we had just resumed LWP 18465, which does:

 void *
 child_func (void *dummy)
 {
   kill (pid, SIGKILL);
   exit (1);
 }

So if the kernel manages to schedule that thread fast enough, the
process may be killed before GDB has a chance to resume LWP 18461.

GDBserver has code at the tail end of linux_resume_one_lwp to cope
with this:

~~~
    ptrace (step ? PTRACE_SINGLESTEP : PTRACE_CONT, lwpid_of (thread),
    (PTRACE_TYPE_ARG3) 0,
    /* Coerce to a uintptr_t first to avoid potential gcc warning
       of coercing an 8 byte integer to a 4 byte pointer.  */
    (PTRACE_TYPE_ARG4) (uintptr_t) signal);

    current_thread = saved_thread;
    if (errno)
      {
/* ESRCH from ptrace either means that the thread was already
   running (an error) or that it is gone (a race condition).  If
   it's gone, we will get a notification the next time we wait,
   so we can ignore the error.  We could differentiate these
   two, but it's tricky without waiting; the thread still exists
   as a zombie, so sending it signal 0 would succeed.  So just
   ignore ESRCH.  */
if (errno == ESRCH)
  return;

perror_with_name ("ptrace");
      }
~~~

However, that's not a complete fix, because between starting to handle
the resume request and getting that PTRACE_CONTINUE, we run other
ptrace calls that can also fail with ESRCH, and that end up throwing
an error (with perror_with_name).

In the case above, I indeed sometimes see resume_stopped_resumed_lwps
fail in the registers read:

resume_stopped_resumed_lwps (struct lwp_info *lp, void *data)
{
...
      CORE_ADDR pc = regcache_read_pc (regcache);

Or e.g., in 32-bit mode, i386_linux_resume has several calls that can
throw too.

Whether to ignore ptrace errors or not depends on context that is only
available somewhere up the call chain.  So the fix is to let ptrace
errors throw as they do today, and wrap the resume request in a
TRY/CATCH that swallows it iff the lwp that we were trying to resume
is no longer ptrace-stopped.

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

* linux-low.c (linux_resume_one_lwp): Rename to ...
(linux_resume_one_lwp_throw): ... this.  Don't handle ESRCH here,
instead call perror_with_name.
(check_ptrace_stopped_lwp_gone): New function.
(linux_resume_one_lwp): Reimplement as wrapper around
linux_resume_one_lwp_throw that swallows errors if the LWP is
gone.

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

* linux-nat.c (linux_resume_one_lwp): Rename to ...
(linux_resume_one_lwp_throw): ... this.  Don't handle ESRCH here,
instead call perror_with_name.
(check_ptrace_stopped_lwp_gone): New function.
(linux_resume_one_lwp): Reimplement as wrapper around
linux_resume_one_lwp_throw that swallows errors if the LWP is
gone.
(resume_stopped_resumed_lwps): Try register reads in TRY/CATCH and
swallows errors if the LWP is gone.  Use
linux_resume_one_lwp_throw instead of linux_resume_one_lwp.

9 years agoRemove spurious gdb/ChangeLog entry
Pedro Alves [Thu, 19 Mar 2015 17:00:55 +0000 (17:00 +0000)]
Remove spurious gdb/ChangeLog entry

My last change added the same entry to both gdbserver's and gdb's
ChangeLogs by mistake...  Should have gone to gdbserver's only.

9 years agogdbserver/Linux: unbreak non-stop
Pedro Alves [Thu, 19 Mar 2015 16:51:09 +0000 (16:51 +0000)]
gdbserver/Linux: unbreak non-stop

The previous change added an assertion that is catching yet another
bug in count_events_callback/select_event_lwp_callback:

  (gdb)
  PASS: gdb.mi/mi-nonstop.exp: interrupted
  mi_expect_interrupt: expecting: \*stopped,(reason="signal-received",signal-name="0",signal-meaning="Signal 0"|reason="signal-received",signal-name="SIGINT",signal-meaning="Interrupt")[^
  ]*

  /home/pedro/gdb/mygit/src/gdb/gdbserver/linux-low.c:2329: A problem internal to GDBserver has been detected.
  select_event_lwp: Assertion `num_events > 0' failed.
  =thread-group-exited,id="i1"

Certainly select_event_lwp_callback should always at least find one
event, as it's only called because an event triggered (though we may
have more than one: the point of the function is randomly picking
one).

An LWP that GDB previously asked to continue/step (thus is resumed)
and gets a vCont;t request ends up with last_resume_kind ==
resume_stop.  These functions in gdbserver used to filter out events
that weren't going to be reported to GDB; I think the last_resume_kind
kind check used to make sense at that point, but it no longer does.

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

* linux-low.c (count_events_callback, select_event_lwp_callback):
No longer check whether the thread has resume_stop as last resume
kind.

9 years agoAdd support for G13 and G14 flag bits in RL78 ELF binaries.
Nick Clifton [Thu, 19 Mar 2015 15:37:43 +0000 (15:37 +0000)]
Add support for G13 and G14 flag bits in RL78 ELF binaries.

inc * rl78.h (E_FLAG_RL78_G10): Redefine.
(E_FLAG_RL78_CPU_MASK, E_FLAG_RL78_ANY_CPU, E_FLAG_RL78_G13
E_FLAG_RL78_G14): New flags.

bin * readelf.c (get_machine_flags): Decode RL78's G13 and G14 flags.

gas * config/tc-rl78.c (enum options): Add G13 and G14.
(md_longopts): Add -mg13 and -mg14.
(md_parse_option): Handle -mg13 and -mg14.
(md_show_usage): List -mg13 and -mg14.
* doc/c-rl78.texi: Add description of -mg13 and -mg14 options.

bfd * elf32-rl78.c (rl78_cpu_name): New function.  Prints the name of
the RL78 core based upon the flags.
(rl78_elf_merge_private_bfd_data): Handle merging of G13 and G14
flags.
(rl78_elf_print_private_bfd_data): Use rl78_cpu_name.
(elf32_rl78_machine): Always return bfd_mach_rl78.

9 years agogdbserver/Linux: unbreak thread event randomization
Pedro Alves [Sun, 15 Mar 2015 19:35:26 +0000 (19:35 +0000)]
gdbserver/Linux: unbreak thread event randomization

Wanting to make sure the new continue-pending-status.exp test tests
both cases of threads 2 and 3 reporting an event, I added counters to
the test, to make it FAIL if events for both threads aren't seen.
Assuming a well behaved backend, and given a reasonable number of
iterations, it should PASS.

However, running that against GNU/Linux gdbserver, I found that
surprisingly, that FAILed.  GDBserver always reported the breakpoint
hit for the same thread.

Turns out that I broke gdbserver's thread event randomization
recently, with git commit 582511be ([gdbserver] linux-low.c: better
starvation avoidance, handle non-stop mode too).  In that commit I
missed that the thread structure also has a status_pending_p field...
The end result was that count_events_callback always returns 0, and
then if no thread is stepping, select_event_lwp always returns the
event thread.  IOW, no randomization is happening at all.  Quite
curious how all the other changes in that patch were sufficient to fix
non-stop-fair-events.exp anyway even with that broken.

Tested on x86_64 Fedora 20, native and gdbserver.

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

* linux-low.c (count_events_callback, select_event_lwp_callback):
Use the lwp's status_pending_p field, not the thread's.

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

* gdb.threads/continue-pending-status.exp (saw_thread_2)
(saw_thread_3): New globals.
(top level): Increment them when an event for the corresponding
thread is seen.
(no thread starvation): New test.

9 years agonative/Linux: internal error if resume is short-circuited
Pedro Alves [Thu, 19 Mar 2015 12:20:25 +0000 (12:20 +0000)]
native/Linux: internal error if resume is short-circuited

If the linux_nat_resume's short-circuits the resume because the
current thread has a pending status, and, a thread with a higher
number was previously stopped for a breakpoint, GDB internal errors,
like:

 /home/pedro/gdb/mygit/src/gdb/linux-nat.c:2590: internal-error: status_callback: Assertion `lp->status != 0' failed.

Fix this by make status_callback bail out earlier.  GDBserver is
already doing the same.

New test added that exercises this.

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

* linux-nat.c (status_callback): Return early if the LWP has no
status pending.

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

* gdb.threads/continue-pending-status.c: New file.
* gdb.threads/continue-pending-status.exp: New file.

9 years agoselect_event_lwp_callback: update comments
Pedro Alves [Thu, 19 Mar 2015 12:24:06 +0000 (12:24 +0000)]
select_event_lwp_callback: update comments

This function (in both GDB and GDBserver) used to consider only
SIGTRAP/breakpoint events, but that's no longer the case nowadays.

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

* linux-low.c (select_event_lwp_callback): Update comments to
no longer mention SIGTRAP.

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

* linux-nat.c (select_event_lwp_callback): Update comment to no
longer mention SIGTRAP.

9 years agoFix building and testing dwarf debug section compression feature when zlib is not...
Nick Clifton [Thu, 19 Mar 2015 12:14:56 +0000 (12:14 +0000)]
Fix building and testing dwarf debug section compression feature when zlib is not available.

PR gas/18087
gas/test * gas/i386/dw2-compress-1.d: Allow the test to pass regardless of
whether the .debug_info section was compressed on not.

bfd * compress.c (bfd_compress_section_contents): Do not define this
function if it is not used.

9 years agoAutomatic date update in version.in
GDB Administrator [Thu, 19 Mar 2015 00:00:07 +0000 (00:00 +0000)]
Automatic date update in version.in

9 years agoTighten gdb.base/disp-step-syscall.exp
Pedro Alves [Wed, 18 Mar 2015 19:28:08 +0000 (19:28 +0000)]
Tighten gdb.base/disp-step-syscall.exp

This fixes several problems with this test.

E.g,. with --target_board=native-extended-gdbserver on x86_64 Fedora
20, I get:

 Running /home/pedro/gdb/mygit/src/gdb/testsuite/gdb.base/disp-step-syscall.exp ...
 FAIL: gdb.base/disp-step-syscall.exp: vfork: get hexadecimal valueof "$pc" (timeout)
 FAIL: gdb.base/disp-step-syscall.exp: vfork: single step over vfork final pc
 FAIL: gdb.base/disp-step-syscall.exp: vfork: delete break vfork insn
 FAIL: gdb.base/disp-step-syscall.exp: vfork: continue to marker (vfork) (the program is no longer running)

And with --target=native-gdbserver, I get:

 Running /home/pedro/gdb/mygit/src/gdb/testsuite/gdb.base/disp-step-syscall.exp ...
 KPASS: gdb.base/disp-step-syscall.exp: vfork: single step over vfork (PRMS server/13796)
 FAIL: gdb.base/disp-step-syscall.exp: vfork: get hexadecimal valueof "$pc" (timeout)
 FAIL: gdb.base/disp-step-syscall.exp: vfork: single step over vfork final pc
 FAIL: gdb.base/disp-step-syscall.exp: vfork: delete break vfork insn
 FAIL: gdb.base/disp-step-syscall.exp: vfork: continue to marker (vfork) (the program is no longer running)

First, the lack of fork support on remote targets is supposed to be
kfailed, so the KPASS is obviously bogus.  The extended-remote board
should have KFAILed too.

The problem is that the test is using "is_remote" instead of
gdb_is_target_remote.

And then, I get:

 (gdb) PASS: gdb.base/disp-step-syscall.exp: vfork: set displaced-stepping on
 stepi

 Program terminated with signal SIGSEGV, Segmentation fault.
 The program no longer exists.
 (gdb) PASS: gdb.base/disp-step-syscall.exp: vfork: single step over vfork

Obviously, that should be a FAIL.  The problem is that the test only
expects SIGILL, not SIGSEGV.  It also doesn't bail correctly if an
internal error or some other pattern caught by gdb_test_multiple
matches.  The test doesn't really need to match specific exits/crashes
patterns, if the PASS regex is improved, like in ...

... this and the other "stepi" tests are a bit too lax, passing on
".*".  This tightens those up to expect "x/i" and the "=>" current PC
indicator, like in:

 1: x/i $pc
 => 0x3b36abc9e2 <vfork+34>:     syscall

On x86_64 Fedora 20, I now get a quick KFAIL instead of timeouts with
both the native-extended-gdbserver and native-gdbserver boards:

 PASS: gdb.base/disp-step-syscall.exp: vfork: delete break vfork
 PASS: gdb.base/disp-step-syscall.exp: vfork: continue to syscall insn vfork
 PASS: gdb.base/disp-step-syscall.exp: vfork: set displaced-stepping on
 KFAIL: gdb.base/disp-step-syscall.exp: vfork: single step over vfork (PRMS: server/13796)

and a full pass with native testing.

gdb/testsuite/
2015-03-18  Pedro Alves  <palves@redhat.com>

* gdb.base/disp-step-syscall.exp (disp_step_cross_syscall):
Use gdb_is_target_remote instead of is_remote.  Use
gdb_test_multiple instead of gdb_expect.  Exit early if
gdb_test_multiple hits its internal matches.  Tighten stepi tests
expected output.  Fail on exit with any signal, instead of just
SIGILL.

9 years agoMake bfd_compress_section_contents static
H.J. Lu [Wed, 18 Mar 2015 18:20:06 +0000 (11:20 -0700)]
Make bfd_compress_section_contents static

* compress.c (bfd_compress_section_contents): Make it static.
* bfd/bfd-in2.h: Regenerated.

9 years agoAdd a testcase for PR gas/18087
H.J. Lu [Wed, 18 Mar 2015 16:20:38 +0000 (09:20 -0700)]
Add a testcase for PR gas/18087

PR gas/18087
* gas/i386/dw2-compress-1.d: Revert the last change.
* gas/i386/dw2-compress-3.d: New.
* gas/i386/dw2-compress-3.s: Likewise.
* gas/i386/i386.exp: Run dw2-compress-3 for ELF targets.

9 years agoFixes a problem generating relocs for import libraries created by Microsoft tools...
Nick Clifton [Wed, 18 Mar 2015 16:19:59 +0000 (16:19 +0000)]
Fixes a problem generating relocs for import libraries created by Microsoft tools for the x85_64 architecture.

PR ld/16598
* peicode.h (pe_ILF_build_a_bfd): Add support for creating relocs
suitable for the AMD64.

9 years agoFix debug section compression so that it is only performed if it would make the secti...
Jon Turney [Wed, 18 Mar 2015 15:47:13 +0000 (15:47 +0000)]
Fix debug section compression so that it is only performed if it would make the section smaller.

PR binutils/18087
gas * doc/as.texinfo: Note that when gas compresses debug sections the
compression is only performed if it makes the section smaller.
* write.c (compress_debug): Do not compress a debug section if
doing so would make it larger.

tests * gas/i386/dw2-compress-1.d: Do not expect the .debug_abbrev or
.debug_info sections to be compressed.

binu * doc/binutils.texi: Note that when objcopy compresses debug
sections the compression is only performed if it makes the section
smaller.

bfd * coffgen.c (make_a_section_from_file): Only prepend a z to a
debug section's name if the section was actually compressed.
* elf.c (_bfd_elf_make_section_from_shdr): Likewise.
* compress.c (bfd_init_section_compress_status): Do not compress
the section if doing so would make it bigger.  In such cases leave
the section alone and return COMPRESS_SECTION_NONE.

9 years agoFix amd64 windows unwinding issues within MS dlls.
Tristan Gingold [Thu, 5 Mar 2015 13:36:32 +0000 (14:36 +0100)]
Fix amd64 windows unwinding issues within MS dlls.

Unwind info in system dlls uses almost all possible codes, contrary to unwind
info generated by gcc.  A few issues have been discovered: incorrect handling
of SAVE_NONVOL opcodes and incorrect in prologue range checks.  Furthermore I
added comments not to forget what has been investigated.

gdb/ChangeLog:
* amd64-windows-tdep.c (amd64_windows_find_unwind_info): Move
redirection code to ...
(amd64_windows_frame_decode_insns): ... Here.  Fix in prologue
checks.  Fix SAVE_NONVOL operations.  Add debug code and comments.

9 years agoReimplement "vFile:fstat" without qSupported
Gary Benson [Wed, 18 Mar 2015 11:19:02 +0000 (11:19 +0000)]
Reimplement "vFile:fstat" without qSupported

This commit makes support for the "vFile:fstat" packet be detected
by probing rather than using qSupported, for consistency with the
other vFile: packets.

gdb/ChangeLog:

(remote_protocol_features): Remove the "vFile:fstat" feature.
(remote_hostio_fstat): Probe for "vFile:fstat" support.

gdb/doc/ChangeLog:

* gdb.texinfo (General Query Packets): Remove documentation
for now-removed vFile:fstat qSupported features.

gdb/gdbserver/ChangeLog:

* server.c (handle_query): Do not report vFile:fstat as supported.

9 years agoSupport catch syscall on aarch64 linux
Yao Qi [Wed, 18 Mar 2015 10:47:45 +0000 (10:47 +0000)]
Support catch syscall on aarch64 linux

Hi,
This patch is to support catch syscall on aarch64 linux.  We
implement gdbarch method get_syscall_number for aarch64-linux,
and add aarch64-linux.xml file, which looks straightforward, however
the changes to test case doesn't.

First of all, we enable catch-syscall.exp on aarch64-linux target,
but skip the multi_arch testing on current stage.  I plan to touch
multi arch debugging on aarch64-linux later.

Then, when I run catch-syscall.exp on aarch64-linux, gcc errors that
SYS_pipe isn't defined.  We find that aarch64 kernel only has pipe2
syscall and libc already convert pipe to pipe2.  As a result, I change
catch-syscall.c to use SYS_pipe if it is defined, otherwise use
SYS_pipe2 instead.  The vector all_syscalls in catch-syscall.exp can't
be pre-determined, so I add a new proc setup_all_syscalls to fill it,
according to the availability of SYS_pipe.

Regression tested on {x86_64, aarch64}-linux x {native, gdbserver}.

gdb:

2015-03-18  Yao Qi  <yao.qi@linaro.org>

PR tdep/18107
* aarch64-linux-tdep.c: Include xml-syscall.h
(aarch64_linux_get_syscall_number): New function.
(aarch64_linux_init_abi): Call
set_gdbarch_get_syscall_number.
* syscalls/aarch64-linux.xml: New file.

gdb/testsuite:

2015-03-18  Yao Qi  <yao.qi@linaro.org>

PR tdep/18107
* gdb.base/catch-syscall.c [!SYS_pipe] (pipe2_syscall): New
variable.
* gdb.base/catch-syscall.exp: Don't skip it on
aarch64*-*-linux* target.  Remove elements in all_syscalls.
(test_catch_syscall_multi_arch): Skip it on aarch64*-linux*
target.
(setup_all_syscalls): New proc.

9 years agoUse %F instead of %X for einfo
Chen Gang [Wed, 18 Mar 2015 01:12:19 +0000 (11:42 +1030)]
Use %F instead of %X for einfo

When src or dst is NULL, the next fread or fwrite will cause a
segmentation fault, so we need to treat it as fatal.

* ldmain.c (main): Use %F instead of %X for einfo.