hppa-hpux-tdep.c: Fix host dependency.

$ make WERROR_CFLAGS="-Wpointer-sign -Werror" hppa-hpux-tdep.o -k 2>&1 1>/dev/null
../../src/gdb/hppa-hpux-tdep.c: In function ‘hppa_hpux_push_dummy_code’:
../../src/gdb/hppa-hpux-tdep.c:1225:7: error: pointer targets in passing argument 2 of ‘write_memory’ differ in signedness [-Werror=pointer-sign]
In file included from ../../src/gdb/hppa-hpux-tdep.c:22:0:
../../src/gdb/gdbcore.h:85:13: note: expected ‘const gdb_byte *’ but argument is of type ‘char *’
../../src/gdb/hppa-hpux-tdep.c:1251:7: error: pointer targets in passing argument 2 of ‘write_memory’ differ in signedness [-Werror=pointer-sign]
In file included from ../../src/gdb/hppa-hpux-tdep.c:22:0:
../../src/gdb/gdbcore.h:85:13: note: expected ‘const gdb_byte *’ but argument is of type ‘char *’
../../src/gdb/hppa-hpux-tdep.c: In function ‘hppa_hpux_supply_save_state’:
../../src/gdb/hppa-hpux-tdep.c:1354:9: error: pointer targets in passing argument 1 of ‘extract_unsigned_integer’ differ in signedness [-Werror=pointer-sign]
In file included from ../../src/gdb/hppa-hpux-tdep.c:20:0:
../../src/gdb/defs.h:675:22: note: expected ‘const gdb_byte *’ but argument is of type ‘const char *’

Casting to gdb_byte would fix it, however, writing an
unsigned int array like this

      static unsigned int hppa64_tramp[] = {
        0xeac0f000, /* bve,l (r22),%r2 */
        0x0fdf12d1, /* std r31,-8(,sp) */
        0x0fd110c2, /* ldd -8(,sp),rp */
        0xe840d002, /* bve,n (rp) */
        0x08000240  /* nop */
        ...

directly to target memory assumes the host endianness is the same as
the target's.  hppa is big endian, so I believe this patch should be
correct -- it defines the array as a gdb_byte array.  It uses a macro
to make the insn bytes a little more readable.  I thought of using
write_memory_unsigned_integer once for each element of the unsigned
int array, but this way keeps issuing a single target memory write /
roundtrip for the whole trampoline.

gdb/
2013-03-22  Pedro Alves  <palves@redhat.com>

	* hppa-hpux-tdep.c (hppa_hpux_push_dummy_code): Define INSN macro,
	use it to rewrite the trampoline buffers with type gdb_byte[], and
	undefine the macro.  Remove char* cast.
Linux: No need to set ptrace event options in fork/clone children.

Oleg Nesterov told me that the Linux kernel copies the parent's ptrace
options to fork/clone children, so there's no need for GDB to do that
manually.

I was actually a bit surprised, since I thought the ptracer had to
always set the ptrace options itself, and GDB is indeed calling
PTRACE_SETOPTIONS for each new fork child, if it'll stay attached.

Looking at the history of that code, I found that is was actually I
who added that set-ptrace-options-in-children bit, back in
http://sourceware.org/ml/gdb-patches/2009-05/msg00656.html.  But,
honestly, I don't recall why I needed that.  I think I may have just
blindly believed it was necessary.

I then looked back at the history of all the PTRACE_SETOPTIONS code we
have, and found that gdb never did copy the ptrace options before my
patch.  But, when gdbserver learnt to use PTRACE_EVENT_CLONE, at
http://sourceware.org/ml/gdb-patches/2007-10/msg00547.html, it was
made to do 'ptrace (PTRACE_SETOPTIONS, new_pid, 0,
PTRACE_O_TRACECLONE)' for all new clones.  Hmmm.  But, GDB itself
never did that, so it can't really ever have been necessary, I
believe, otherwise GDB should have been doing it too.

(GDBserver doesn't support following forks, and so naturally doesn't
do any PTRACE_SETOPTIONS on fork children.)

So this patch removes the -I believe- unnecessary ptrace syscalls.

Tested on x86_64 Fedora 17, native/gdbserver, and on x86_64 RHEL5
native/gdbserver (Linux 2.6.18, I think a ptrace-on-utrace kernel).
No regressions.

gdb/
2013-03-22  Pedro Alves  <palves@redhat.com>

	* linux-nat.c (linux_child_follow_fork): Don't call
	linux_enable_event_reporting.
	(linux_handle_extended_wait): Don't call
	linux_enable_event_reporting.

gdb/gdbserver/
2013-03-22  Pedro Alves  <palves@redhat.com>

	* linux-low.c (handle_extended_wait): Don't call
	linux_enable_event_reporting.
	PR ld/14902
	* elf32-h8300.c (elf32_h8_relax_delete_bytes): Fix off by one
	errors adjusting relocs and symbols.
Fix attribute section output on sparc.

bfd/

	* elfxx-sparc.c (_bfd_sparc_elf_merge_private_bfd_data): Set type of
	hwcaps attribute.
	PR binutils/15157
	* readelf.c (apply_relocations): Catch relocations with negative
	offsets.
	PR binutils/15201
	* dwarf.c (display_debug_ranges): Add checks for reading beyond
	the end of the section.
gdb/
	* remote.c (remote_unpush_target): New function.
	(remote_open_1): Remove two pop_target calls, update one comment, add
	comment to target_preopen call.  Replace pop_target call by
	remote_unpush_target call.
	(interrupt_query, readchar, getpkt_or_notif_sane_1): Replace
	pop_target calls by remote_unpush_target calls.
Subject: Fix range validation of integer commands with "unlimited".

The range validation added by

  http://sourceware.org/ml/gdb-patches/2013-03/msg00767.html

Changes things to allow setting the command to INT_MAX or UINT_MAX
directly, with signed and unsigned commands respectively.  However,
that went a little bit too far, as in the cases of var_integer and
var_uinteger, those values are actually implementation detail.  It's
better to not expose them in the interface, and have users assume
those values mean "unlimited" too, so to be safer to expand the range
of the commands in the future if we want to.  Yes, it's pedantic, and
it's not likely users actually will do this, but MI frontends and
Python scripts might.

gdb/
2013-03-22  Pedro Alves  <palves@redhat.com>
	    Yao Qi  <yao@codesourcery.com>
	    Mark Kettenis  <kettenis@gnu.org>

	* cli/cli-setshow.c (do_set_command) <var_uinteger>:
	Don't let the user set the value to UINT_MAX directly.
	<var_integer>: Don't let the user set the value to INT_MAX
	directly.
Whoops, wrong patch.  Reverting.
Subject: Fix range validation of integer commands with "unlimited".

The range validation added by

  http://sourceware.org/ml/gdb-patches/2013-03/msg00767.html

Changes things to allow setting the command to INT_MAX or UINT_MAX
directly, with signed and unsigned commands respectively.  However,
that went a little bit too far, as in the cases of var_integer and
var_uinteger, those values are actually implementation detail.  It's
better to not expose them in the interface, and have users assume
those values mean "unlimited" too, so to be safer to expand the range
of the commands in the future if we want to.  Yes, it's pedantic, and
it's not likely users actually will do this, but MI frontends and
Python scripts might.

gdb/
2013-03-22  Pedro Alves  <palves@redhat.com>
	    Yao Qi  <yao@codesourcery.com>
	    Mark Kettenis  <kettenis@gnu.org>

	* cli/cli-setshow.c (do_set_command) <var_uinteger>:
	Don't let the user set the value to UINT_MAX directly.
	<var_integer>: Don't let the user set the value to INT_MAX
	directly.
gdb/
	* exceptions.h (enum errors): New entry TARGET_CLOSE_ERROR.
	* remote.c (trace_error): Remove the special handling of '2'.
	(readchar) <SERIAL_EOF>
	(readchar) <SERIAL_ERROR>
	(getpkt_or_notif_sane_1): Use TARGET_CLOSE_ERROR for them.
	(remote_get_trace_status): Call throw_exception if EX is
	TARGET_CLOSE_ERROR.
	* utils.c (perror_with_name): Rename to ...
	(throw_perror_with_name): ... here.  New parameter errcode, describe it
	in the function comment.
	(perror_with_name): New function wrapper.
	* utils.h (enum errors): New stub declaration.
	(throw_perror_with_name): New declaration.

gdb/testsuite/
	* gdb.server/server-kill.c: New file.
	* gdb.server/server-kill.exp: New file.
daily update
src-release: fix version look up for bfd based projects
	PR ld/15270
	* elflink.c (elf_link_add_object_symbols): Don't set def_regular
	or ref_regular for BFD_PLUGIN owned syms, or have them affect
	def_dynamic/ref_dynamic.
	(_bfd_elf_fix_symbol_flags): Don't set def_regular for BFD_PLUGIN
	owned syms.
*** empty log message ***
	* elf-bfd.h (_bfd_elf_merge_symbol): Delete declaration.
	* elflink.c (_bfd_elf_merge_symbol): Make static.
	* elf32-sh-symbian.c (sh_symbian_relocate_section): Don't call
	_bfd_elf_merge_symbol, call _bfd_generic_link_add_one_symbol.
Fix relocation of directories in the MinGW build.

 windows-nat.c (windows_get_absolute_argv0): New function.
 windows-nat.h: Add its prototype.
 main.c (get_init_files): Use filename_ncmp instead of strncmp.
 Use IS_DIR_SEPARATOR instead of looking for a character inside
 SLASH_STRING.  Include filenames.h.
 (captured_main) [__MINGW32__]: Make argv[0] absolute, so that
 relocate_gdb_directory works when passed gdb_program_name.
 Include windows-nat.h.
2013-03-23  Joel Sherrill  <joel.sherrill@oarcorp.com>

	* acinclude.m4: Add SIM_DV_SOCKSER_O which is empty  on hosts
	which do not support dv-sockser.o.  Add always as option to
	first argument to SIM_AC_OPTION_HARDWARE. Fail if hardware
	is always required to be enabled by simulator.
2013-03-23  Joel Sherrill  <joel.sherrill@oarcorp.com>

	* configure.ac: Fail if dv-sockser.o not available.
	Error when --disable-sim-hardware is specified.
	* configure: Regenerated.
2013-03-23  Joel Sherrill  <joel.sherrill@oarcorp.com>

	* configure.ac: Use $SIM_DV_SOCKSER_O.
	* configure: Regenerated.