Pull over changes from the binutils repository over to GDB.

Conflicts (resolved):
	bfd/elf-bfd.h
Fix a problem in the upstream Makefile.in

2013-02-27  Jeremy Bennett <jeremy.bennett@embecosm.com>

	* Makefile.in (SFILES): Correct location of common files.

Conflicts (resolved):
	gdb/gdbserver/Makefile.in
Updated gdbserver, using new PTRACE_GETREGSETS and PTRACE_SETREGSETS
functionality, and without dependency on the GDB source.

In gdb:

2013-02-27  Jeremy Bennett <jeremy.bennett@embecosm.com>

	* regformats/reg-arc.dat: Updated to match new GDB register
	sequence.

In gdb/gdbserver:

2013-02-27  Jeremy Bennett <jeremy.bennett@embecosm.com>

	* configure.srv (arc*-*-linux*): Remove srv_linux_usrregs and
	replace with srv_linux_regsets.
	* linux-arc-low.c: Commenting updated throughout.
	(regdef.h): Include file added.
	(../arc-constants.h, asm/trace.h): Include files removed
	(elf.h, linux/ptrace.h): Added.
	(ARC_NR_REGS): Removed throughout, replaced where appropriate by
	arc_num_regs.
	(arc_regmap): Removed.
	(struct user_regs_struct) [ARC_LEGACY_PTRACE_ABI]: Added
	conditionally to define struture, pending its adoption in mainline
	Linux.
	(orig_r8): Created to track latest value of orig_r8 register.
	(arc_num_regs): Created.
	(init_registers_arc): Declared as extern.
	(arc_arch_setup): Initialize arc_num_regs from regcache size.
	(arc_get_pc): Name of register is changed.
	(arc_set_pc): Rewritten to use new register structure.
	(arc_fill_gregset, arc_store_gregset): Created.
	(target_regsets): Created.
	(the_low_target): Reordered to omit obsolete functions and
	variables and use named elements.

Conflicts (resolved):
	gdb/gdbserver/configure.srv
Work in progress. Major rewrite of all code.

2013-02-27  Jeremy Bennett <jeremy.bennett@embecosm.com>

	* Makefile.am (HFILES_NO_SRCDIR): Updated with ARC header files.
	* arc-aux-registers.c: Replace ARC specific typedefs throughout by
	their underlying types. Remove obsolete ARC specific headers and
	add arc-elf-tdep.h as header.
	(field_meaning, field_definition, parsing_data): Make name and
	description fields non-constant. Replace ARC specific typedef'd
	types by their underlying types.
	(NO_DESCRIPTION, RESERVED, UNUSED): Make non-constant.
	* arc-aux-registers.h: Remove ARC specific typedefs. Transfer
	structs and enums to arc-tdep.h and arc-elf-tdep.h as appropriate.
	Replace ARC specific typedef'd types by their underlying types.
	* arc-board.c: Replace ARC specific typedef'd types by their
	underlying types.
	* arc-constants.h: Deleted.
	* arc-elf-tdep.c: Replace ARC specific typedef'd types by their
	underlying types. Remove obsolete ARC specific headers and add
	arc-elf-tdep.h as header. Replace arc_jtag functions throughout by
	arc_elf.
	(ARC_NR_REGS, ARC_NR_PSEUDO_REGS): Macros added.
	(EXTRACT): Macro deleted.
	(check_architecture): Deleted.
	(register_reggroup_p): Simplified.
	(REGISTER_NAME_IS): Macro deleted.
	(memory_range_command, arc_jtag_fill_memory_command)
	(arc_jtag_break_memory_command, arc_jtag_watch_memory_command)
	(arc_check_pc_defined): Deleted.
	(arc_elf_init_abi): Replaces arc_jtag_initialize.
	* arc-elf-tdep.h (arc_variant_info): Struct defn deleted.
	(arc_check_pc_defined): Deleted.
	* arc-linux-tdep.c (arc_linux_binutils_reg_to_regnum): Deleted.
	(arc_linux_pseudo_register_read, arc_linux_pseudo_register_write):
	Deleted.
	(arc_linux_init_abi): Use PC rather than STOP_PC.
	* arc-tdep.c (WORD_ALIGNED, WORDS_OCCUPIED, ROUND_UP_TO_WORDS):
	Macros replaced by functions.
	(arc_round_up_to_words): New function.
	(IS_INSTRUCTION): Macro deleted.
	(CHECK_OPERAND_STRING_AND_ACT, PUSH_BLINK, PUSH_BLINK_ACT)
	(IS_PUSH_BLINK_FI, PUSH_FP_ACT, IS_PUSH_FP_FI, UPDATE_FP_ACT)
	(IS_UPDATE_FP_FI, UPDATE_STACK_SPACE, IS_SUB_SP_FI): Macros
	replaced by functions.
	(arc_is_push_blink_fi, arc_is_push_fp_fi, arc_is_update_fp_fi)
	(arc_is_sub_sp_fi, arc_is_core_register): New functions.
	(arc_is_in_prologue): Replace macros by functions.
	* arc-tdep.h: Insert arc-constants.h. Add arc specific enums and
	structs from arc-aux-registers.h.
	* configure.tgt (arc*-*-*): Add arc-board.o.

Conflicts (resolved):
	gdb/Makefile.in
Work in progress, mostly updating commenting.

2013-02-28  Jeremy Bennett <jeremy.bennett@embecosm.com>

	* arc-tdep.c: Added GFDL license and updated commments
	(arc_local_var_t): Deleted.
	* arc-tdep.h: Added more Doxygen compatible commenting. Removed
	AUX registers addresses.
	(ARC_STOP_GO_REGNUM): Added as pseudo reg.
Work in progress, mostly updating commenting.

2013-02-28  Jeremy Bennett <jeremy.bennett@embecosm.com>

	* arc-tdep.c: Added GFDL license and updated commments
	(arc_local_var_t): Deleted.
	* arc-tdep.h: Added more Doxygen compatible commenting. Removed
	AUX registers addresses.
	(ARC_STOP_GO_REGNUM): Added as pseudo reg.
Work in progress. Update ABI constants and frame info structure.

2013-02-28  Jeremy Bennett <jeremy.bennett@embecosm.com>

	* arc-aux-registers.c (start_ecr). Replace IS_EXTENSION_CORE_REGISTER.
	(arc_initialize_aux_reg_info, arc_core_register_number): Replace
	ARC_FIRST_EXTENSION_CORE_REGISTER by ARC_FIRST_EXT_CORE_REGNUM and
	ARC_LAST_EXTENSION_CORE_REGISTER by ARC_LAST_EXT_CORE_REGNUM.
	* arc-tdep.c (arc_is_in_prologue): Replace ARC_ABI_FRAME_POINTER
	by ARC_FP_REGNUM and ARC_ABI_STACK_POINTER by ARC_SP_REGNUM.
	(arc_print_frame_info, arc_find_this_sp, arc_is_callee_saved):
	Replace ARC_ABI_FIRST_CALLEE_SAVED_REGISTER by
	ARC_FIRST_CALLEE_SAVED_REGNUM and ARC_ABI_LAST_CALLEE_SAVED_REGISTER by
	ARC_LAST_CALLEE_SAVED_REGNUM.
	(push_dummy_call): Replace ARC_ABI_FIRST_ARGUMENT_REGISTER by
	ARC_FIRST_ARG_REGNUM and ARC_ABI_LAST_ARGUMENT_REGISTER by
	ARC_LAST_ARG_REGNUM.
	(arc_extract_return_value, arc_store_return_value): Replace
	ARC_ABI_RETURN_REGNUM by ARC_RET_REGNUM, ARC_ABI_RETURN_LOW_REGNUM
	by ARC_RET_LOW_REGNUM and ARC_ABI_RETURN_REGNUM by
	ARC_RET_HIGH_REGNUM.
	(arc_unwind_cache_t): Replaced by struct arc_unwind_cache.
	(arc_push_blink, arc_is_push_blink_fi, arc_is_push_fp_fi)
	(arc_is_update_fp_fi, arc_is_sub_sp_fi, arc_print_frame_info)
	(arc_create_cache, arc_find_this_sp, arc_is_callee_saved)
	(arc_is_in_prologue, arc_scan_prologue, arc_frame_cache)
	(arc_frame_prev_register, arc_sigtramp,frame_cache)
	(arc_sigtramp_frame_prev_register): Replace arc_unwind_cache_t by
	struct arc_unwind_cache.
	* arc-tdep.h (ARC_ABI_GLOBAL_POINTER, ARC_ABI_FRAME_POINTER)
	(ARC_ABI_STACK_POINTER): Deleted.
	(ARC_FIRST_CALLEE_SAVED_REGNUM): Replaces
	ARC_ABI_FIRST_CALLEE_SAVED_REGISTER.
	(ARC_LAST_CALLEE_SAVED_REGNUM): Replaces
	ARC_ABI_LAST_CALLEE_SAVED_REGISTER.
	(ARC_FIRST_ARG_REGNUM): Replaces ARC_ABI_FIRST_ARGUMENT_REGISTER.
	(ARC_LAST_ARG_REGNUM): Replaces ARC_ABI_LAST_ARGUMENT_REGISTER.
	(ARC_RET_REGNUM): Replaces ARC_ABI_RETURN_REGNUM.
	(ARC_RET_LOW_REGNUM): Replaces ARC_ABI_RETURN_LOW_REGNUM.
	(ARC_RET_HIGH_REGNUM): Replaces ARC_ABI_RETURN_HIGH_REGNUM.
	(ARC_FIRST_EXT_CORE_REGNUM): Replaces
	ARC_FIRST_EXTENSION_CORE_REGISTER.
	(ARC_LAST_EXT_CORE_REGNUM): Replaces
	ARC_LAST_EXTENSION_CORE_REGISTER.
	(ARC_NUM_EXT_CORE_REGS): Replace ARC_NUM_EXTENSION_CORE_REGS
Work in progress. More tidying up of the gdbarch.

2013-03-04  Jeremy Bennett <jeremy.bennett@embecosm.com>

	* arc-elf-tdep.c (arc_elf_cannot_fetch_register)
	(arc_elf_cannot_store_register): Created.
	(arc_elf_init_abi): Add calls to set gdbarch_cannot_fetch_register
	and gdbarch_cannot_store_register.
	* arc-linux-tdep.c (arc_linux_cannot_fetch_register)
	(arc_linux_cannot_store_register): Created.
	(arc_linux_init_abi): Add calls to set
	gdbarch_cannot_fetch_register and gdbarch_cannot_store_register.
	* arc-tdep.c (arc_cannot_fetch_register)
	(arc_cannot_store_register, arc_dummy_disassembler)
	(arc_set_disassembler): Deleted.
	(arc_skip_trampoline_code): New function.
	(arc_gdbarch_init): Remove calls to set
	gdbarch_cannot_fetch_register and
	gdbarch_cannot_store_register. No need for observer to set
	disassembler, since we now only support ARCompact.
	Set gdbarch_skip_trampoline_code. Set non-steppable watchpoints.

Conflicts (resolved):
	gdb/ChangeLog.ARC
	gdb/arc-elf-tdep.c
	gdb/arc-linux-tdep.c
	gdb/arc-tdep.c
2013-03-04  Jeremy Bennett <jeremy.bennett@embecosm.com>

	* regformats/reg-arc.dat: Updated to match GDB register sequence.
Make the register handling match GDB client, and prepare for ARC ABI v3.

2013-03-04  Jeremy Bennett <jeremy.bennett@embecosm.com>

	* linux-arc-low.c (orig_r8) Deleted.
	(arc_cannot_store_register, arc_cannot_fetch_register): Updated to
	correctly reflect user space r/w status of registers.
	(arc_set_pc): Simplified - issues are dealt with in
	arc_fill_gregset and arc_store_gregset.
	(arc_fill_gregset, arc_store_gregset): No need for orig_r8 any
	more (it goes in ARV v3 ABI anyway).
Tidy up functions.

2013-03-04  Jeremy Bennett <jeremy.bennett@embecosm.com>

	* arc-elf-tdep.c (arc_elf_cannot_fetch_register)
	(arc_elf_cannot_store_register): Remove osabi.
	* arc-linux-tdep.c (arc_linux_cannot_fetch_register)
	(arc_linux_cannot_store_register): Remove osabi.
Correct trivial programming errors.

2013-03-04  Jeremy Bennett <jeremy.bennett@embecosm.com>

	* linux-arc-low.c (arc_fill_regset): Use regbuf->scratch.ret
	rather than regbuf->reg.
	(arc_store_regset): Typo - use supply_register_by_name rather than
	collect_register_by_name for stop_pc.
Rewrite to support ARC v2 ABI without regsets, which are not present in
Linux 3.2.

2013-03-05  Jeremy Bennett <jeremy.bennett@embecosm.com>

	* configure.srv (arc*-*-linux*): Add srv_usrregs for legacy.
	* linux-arc-low.c: Reorder functions for clarity and tidy up
	commenting generally.
	(struct user_regs_scratch): based on ptrace.h structs.
	(arc_arch_setup): Initalize register map for ARC v2 ABI.
	(arc_num_regs): Deleted and relaced by the_low_target.num_regs
	throughout.
	(arc_fetch_register, arc_breakpoint_at): New functions.
	(target_regsets): Correct field names.
	(the_low_target): Add entry for breakpoint_at and optionally
	fetch_register.
Use byte, not word offsets for ptrace.

2013-03-05  Jeremy Bennett <jeremy.bennett@embecosm.com>

	* linux-arc-low.c (arch_arc_setup): Convert offsets to byte
	offsets.
	(arc_fetch_register): Convert offset to byte offset.
Fix sigtramp frame handlers to use THIS frame and be endian friendly.

2013-03-05  Jeremy Bennett <jeremy.bennett@embecosm.com>

	* arc-linux-tdep.c (SIGTRAMP_INSNS_LENGTH): Deleted.
	(arc_sigtramp_insns): Moved into arc_linux_is_sigtramp.
	(arc_linux_is_sigtramp): Define arc_sigtramp_insns locally,
	replace SIGTRAMP_INSNS_LENGTH with sizeof. Make endian friendly.
	(arc_linux_sigcontext_addr): Use THIS frame.
Better debug messages.

2013-03-06  Jeremy Bennett <jeremy.bennett@embecosm.com>

	* arc-tdep.h (ARC_ENTRY_DEBUG): Don't print the filename.
Fix problem with linux_write_memory corrupting stack.

2013-03-06  Jeremy Bennett  <jeremy.bennett@embecosm.com>

	PR gdb/15236
	* linux-low.c (linux_write_memory): Return early success if len is
	zero.

Conflicts (resolved):
	gdb/gdbserver/ChangeLog.ARC
Tidy up and shrink the target dependency structure. Correct a bug in register
printing.

2013-03-06  Jeremy Bennett <jeremy.bennett@embecosm.com>

	* arc-aux-registers.c (arc_processor_version, arc_reg_access): New
	enums taken from arc-tdep.h.
	(arc_core_reg_def, arc_aux_reg_def, arc_reg_info)
	(arc_variant_info): New structs taken from arc-tdep.h.
	(arc_processor_variant_info): New static instance, renamed and
	moved out of _initialize_aux_regs.
	(INFO_OF): Use arc_processor_variant_info.
	(arc_create_variant_info): New function taken from arc_elf_tdep.c.
	(_initialize_arc_aux_regs): Remove declaration of variant, call
	arc_create_variant_info.
	* arc-elf-tdep.c (arc_elf_init_abi): Don't set
	pc_regnum_in_sigcontext, lowest_pc, breakpoint_instr,
	breakpoint_size. Don't call create_variant_info, since now done in
	arc-aux-registers.c.
	* arc-linux-tdep.c (arc_linux_init_abi): Don't set lowest_pc,
	arc_processor_variant_info, breakpoint_instr, breakpoint_size.
	* arc-tdep.c (arc_sigtramp_frame_prev_register): Don't try to use
	"ret" register for PC.
	(arc_breakpoint_from_pc): Determine directly, don't use tdep.
	(arc_register_name): Don't name registers not in the architecture.
	(arc_register_type): PC should be func_ptr type.
	(arc_print_registers_info): Correct logic for all registers.
	* arc-tdep.h (gdbarch_tdep): Remove pc_regnum_in_sigcontext,
	lowest_pc, arc_processor_variant_info, breakpoint_instr,
	breakpoint_size.

Conflicts (resolved):
	gdb/arc-tdep.h
Correct decrement after break.

2013-03-07  Jeremy Bennett <jeremy.bennett@embecosm.com>

	* arc-tdep.c (arc_gdbarch_init): set decr_pc_after_break to 2.
2013-03-13  Jeremy Bennett <jeremy.bennett@embecosm.com>

	* arc-tdep.c (arc_frame_unwind, arg_sigtramp_frame_unwind): set
	.stop_reason field.