PR binutils/15356
	* compress.c (decompress_contents): Always call inflateEnd, even
	when another inflation operation fails.

[Note - the actual patch to compress.c was accidentally committed previously].
        * configure.tgt (i386-*-cygwin): Handle x86_64 cygwin.
	* newlib/libc/search/hash.c: Revert patch from 2012-08-08.
Fix the x87 FP register printout when issuing the “info float” command.

Consider the following simple program:

.globl  _start
.text
_start:
      fldt    val
.data
      val: .byte 0x00,0x00,0x45,0x07,0x11,0x19,0x22,0xe9,0xfe,0xbf

With current GDB on x86-64 GNU/Linux hosts, after the moment the fldt
command has been executed the register st(0) looks like this,
according to the “info regs” output (TOP=7):

  R7: Valid   0xffffffbffffffffeffffffe922191107450000 -0.910676542908976927

which is clearly wrong (just count its length).  The problem is due to
the printf statement (see patch) printing a promoted integer value of
a char argument "raw[i]", and, since char is signed on x86-64
GNU/Linux, the erroneous “ffffff” are printed for the first three
bytes which turn out to be "negative".  The fix is to use gdb_byte
instead which is unsigned (and is the type of value_contents(), the
type to be used for raw target bytes anyway).  After the fix the value
will be printed correctly:

  R7: Valid   0xbffee922191107450000 -0.910676542908976927

gdb/
2013-04-19  Vladimir Kargov <kargov@gmail.com>
	    Pedro Alves  <palves@redhat.com>

	* i387-tdep.c (i387_print_float_info): Use gdb_byte for pointer to
	value contents.

gdb/testsuite/
2013-04-19  Vladimir Kargov  <kargov@gmail.com>
	    Pedro Alves  <palves@redhat.com>

	* gdb.arch/i386-float.S: New file.
	* gdb.arch/i386-float.exp: New file.
[AArch64] Honour CFLAGS.

2013-04-19  Yufeng Zhang  <yufeng.zhang@arm.com>

	* aarch64/Makefile.in (rdimon-crt0.o, rdimon-trap.o)
	(rdimon-_exit.o, rdimon-_kill.o, rdimon-syscalls.o)
	(rdimon-libcfunc.o): Add $(CFLAGS) to the compiler command line.
	* aarch64/cpu-init/Makefile.in (${CPU_INIT_OBJS}): Add $(CFLAGS)
	to the compiler command line.
-Wpointer-sign: char -> gdb_byte.

-Wpointer-sign catches all these cases across the codebase that should
be using gdb_byte for raw target bytes.  I think these are all
obvious, hence I've collapsed into a single patch.

gdb/
2013-04-19  Pedro Alves  <palves@redhat.com>

	* aarch64-tdep.c (aarch64_default_breakpoint): Change type to
	gdb_byte[].
	(aarch64_breakpoint_from_pc): Change return type to gdb_byte *.
	* ada-lang.c (ada_value_assign): Use gdb_byte.
	* alphanbsd-tdep.c (sigtramp_retcode): Change type to gdb_byte[].
	(alphanbsd_sigtramp_offset): Use gdb_byte.
	* arm-linux-tdep.c (arm_linux_arm_le_breakpoint)
	(arm_linux_arm_be_breakpoint, eabi_linux_arm_le_breakpoint)
	(eabi_linux_arm_be_breakpoint, arm_linux_thumb_be_breakpoint)
	(arm_linux_thumb_le_breakpoint, arm_linux_thumb2_be_breakpoint)
	(arm_linux_thumb2_le_breakpoint): Change type to gdb_byte[].
	* arm-tdep.c (arm_stub_unwind_sniffer)
	(arm_displaced_init_closure): Use gdb_byte.
	(arm_default_arm_le_breakpoint, arm_default_arm_be_breakpoint)
	(arm_default_thumb_le_breakpoint)
	(arm_default_thumb_be_breakpoint): Change type to gdb_byte[].
	* arm-tdep.h (struct gdbarch_tdep) <arm_breakpoint,
	thumb_breakpoint, thumb2_breakpoint>: Change type to gdb_byte *.
	* arm-wince-tdep.c (arm_wince_le_breakpoint)
	(arm_wince_thumb_le_breakpoint): Change type to gdb_byte[].
	* armnbsd-tdep.c (arm_nbsd_arm_le_breakpoint)
	(arm_nbsd_arm_be_breakpoint, arm_nbsd_thumb_le_breakpoint)
	(arm_nbsd_thumb_be_breakpoint): Change type to gdb_byte[].
	* armobsd-tdep.c (arm_obsd_thumb_le_breakpoint)
	(arm_obsd_thumb_be_breakpoint): Change type to gdb_byte[].
	* cris-tdep.c (push_stack_item, cris_push_dummy_call)
	(cris_store_return_value, cris_extract_return_value): Use
	gdb_byte.
	(constraint): Change type of parameter to char * from signed
	char*.  Use gdb_byte.
	* dwarf2loc.c (read_pieced_value, write_pieced_value): Change type
	of local buffer to gdb_byte *.
	* dwarf2read.c (read_index_from_section): Use gdb_byte.
	(create_dwp_hash_table): Change type of locals to gdb_byte *.
	(add_address_entry): Change type of local buffer to gdb_byte[].
	* frv-tdep.c (frv_adjust_breakpoint_address, find_func_descr)
	(frv_push_dummy_call): Use gdb_byte.
	* hppa-hpux-tdep.c (hppa_hpux_push_dummy_code)
	(hppa_hpux_supply_ss_fpblock, hppa_hpux_supply_ss_wide)
	(hppa_hpux_supply_save_state): Use gdb_byte.
	* hppa-tdep.c (hppa32_push_dummy_call)
	(hppa64_convert_code_addr_to_fptr): Use gdb_byte.
	* ia64-tdep.c (extract_bit_field, replace_bit_field)
	(slotN_contents, replace_slotN_contents): Change type of parameter
	to gdb_byte *.
	(fetch_instruction, ia64_pseudo_register_write)
	(ia64_register_to_value, ia64_value_to_register)
	(ia64_extract_return_value, ia64_store_return_value)
	(ia64_push_dummy_call): Use gdb_byte.
	* m32c-tdep.c (m32c_return_value): Remove cast.
	* m68hc11-tdep.c (m68hc11_pseudo_register_write)
	(m68hc11_push_dummy_call, m68hc11_store_return_value): Use
	gdb_byte.
	* mipsnbsd-tdep.c (mipsnbsd_get_longjmp_target): Use gdb_byte.
	* mn10300-tdep.c (mn10300_store_return_value)
	(mn10300_breakpoint_from_pc, mn10300_push_dummy_call): Use
	gdb_byte.
	* moxie-tdep.c (moxie_process_readu): Use gdb_byte.
	(moxie_process_record): Remove casts.
	* ppc-ravenscar-thread.c (supply_register_at_address)
	(ppc_ravenscar_generic_store_registers): Use gdb_byte.
	* ravenscar-thread.c (get_running_thread_id): Use gdb_byte.
	* remote-m32r-sdi.c (m32r_fetch_register): Use gdb_byte.
	* remote-mips.c (mips_xfer_memory): Use gdb_byte.
	* remote.c (compare_sections_command): Use gdb_byte.
	* score-tdep.c (score7_free_memblock): Change type of parameter to
	gdb_byte *.
	* sh-tdep.c (sh_justify_value_in_reg): Change return type to
	gdb_byte *.  Use gdb_byte.
	(sh_push_dummy_call_fpu): Use gdb_byte.
	(sh_extract_return_value_nofpu, sh_extract_return_value_fpu)
	(sh_store_return_value_nofpu, sh_store_return_value_fpu)
	(sh_register_convert_to_virtual, sh_register_convert_to_raw):
	Change parameter type to 'gdb_byte *'.  Use gdb_byte.
	(sh_pseudo_register_read, sh_pseudo_register_write): Use gdb_byte.
	* sh64-tdep.c (sh64_push_dummy_call): Use gdb_byte.
	(sh64_store_return_value, sh64_register_convert_to_virtual):
	Change parameter type to 'gdb_byte *'.  Use gdb_byte.
	(sh64_pseudo_register_write): Use gdb_byte.
	* solib-darwin.c (darwin_current_sos): Add casts to 'gdb_byte *'.
	* solib-irix.c (fetch_lm_info): Likewise.  Use gdb_byte for byte
	buffer.
	(irix_current_sos): Use gdb_byte.
	* solib-som.c (som_current_sos): Use gdb_byte.
	* sparc-ravenscar-thread.c (supply_register_at_address)
	(sparc_ravenscar_generic_store_registers): Use gdb_byte.
	* spu-multiarch.c (spu_xfer_partial): Add cast to 'char *'.
	* spu-tdep.c (spu_get_overlay_table): Use gdb_byte.
	* tic6x-tdep.c (tic6x_breakpoint_from_pc): Change return type to
	'gdb_byte *'.
	* tic6x-tdep.h (struct gdbarch_tdep) <breakpoint>: Change type to
	'gdb_byte *'.
	* tracepoint.c (tfile_fetch_registers): Use gdb_byte.
	* xstormy16-tdep.c (xstormy16_extract_return_value)
	(xstormy16_store_return_value): Change parameter type to
	'gdb_byte *'.  Adjust.
	(xstormy16_push_dummy_call): Use gdb_byte.
	* xtensa-tdep.c (xtensa_scan_prologue, call0_ret)
	(call0_analyze_prologue, execute_code): Use gdb_byte.
-Wpointer-sign: gdb_byte -> char.

This is sort of the opposite of the previous patch.  Places that
manipulate strings or interfaces that return strings are changed to
use char* instead of gdb_byte*.

gdb/
2013-04-19  Pedro Alves  <palves@redhat.com>

	* avr-tdep.c (avr_io_reg_read_command): New local 'bufstr'.  Use
	it to get a string view of the byte buffer.
	* i386-cygwin-tdep.c (core_process_module_section): Change local 'buf'
	type to gdb_byte *.  Adjust.
	* linux-tdep.c (linux_info_proc, linux_find_memory_regions_full):
	Change local to char *.
	* solib-darwin.c (find_program_interpreter): Change return type to
	char *.  Adjust.
	(darwin_solib_get_all_image_info_addr_at_init): Adjust.
	* solib-dsbt.c (enable_break2): Change local 'buf' to char *.
	* solib-frv.c (enable_break2): Change local 'buf' to char *.
	* solib-spu.c (spu_current_sos): Add gdb_byte * cast.
	* solib-svr4.c (find_program_interpreter): Change return type to
	char *.  Adjust.
	(enable_break): Change local 'interp_name' to char *.
	* spu-multiarch.c (spu_xfer_partial): Add cast to 'char *'.
	* spu-tdep.c (spu_pseudo_register_read_spu): Add cast to 'char *'.
	(spu_pseudo_register_write_spu): Use char for string buffer.
	Adjust.
	(info_spu_event_command, info_spu_signal_command): Add casts to
	'char *'.
cris-tdep.c: Use unsigned variable for unsigned command.

"set cris-version" is an unsigned command:

    /* CRIS-specific user-commands.  */
    add_setshow_uinteger_cmd ("cris-version", class_support,
  			    &usr_cmd_cris_version,
  			    _("Set the current CRIS version."),
  			    _("Show the current CRIS version."),
  			    _("\
  Set to 10 for CRISv10 or 32 for CRISv32 if autodetection fails.\n\
  Defaults to 10. "),

Tested by building on x86_64 Fedora 17.

2013-04-19  Pedro Alves  <palves@redhat.com>

	* cris-tdep.c (usr_cmd_cris_version): Make unsigned.
	(struct gdbarch_tdep) <cris_version>: Make unsigned.
	(cris_spec_reg_applicable, cris_gdbarch_init): Adjust locals.
alpha-tdep.c/mips-tdep.c: "set heuristic-fence-post" is signed/zinteger.

These commands are currently var_zinteger, hence their control
variable is signed.

gdb/
2013-04-19  Pedro Alves  <palves@redhat.com>

	* alpha-tdep.c (heuristic_fence_post): Change type to int.
	(alpha_heuristic_proc_start): Adjust to check -1 instead of
	UINT_MAX.
	* mips-tdep.c (heuristic_fence_post): Change type to int.
	(heuristic_proc_start): Adjust to check -1 instead of UINT_MAX.
mep-tdep.c: Wrong signness for instruction buffer.

There seems to be no reason for this to be signed.

gdb/
2013-04-19  Pedro Alves  <palves@redhat.com>

	* mep-tdep.c (mep_get_insn): Change 'insn' parameter type to
	unsigned long *.
mips-tdep.c: Wrong signness for local holding PC register.

Addresses on MIPS are signed, and we're indeed using
regcache_cooked_read_signed to read the PC, but, we're passing it the
address of an unsigned variable, which triggers a -Wpointer-sign
warning.  I've chosen to change the variable's type.  I believe this
will end up being the same (though I can't test it).

gdb/
2013-04-19  Pedro Alves  <palves@redhat.com>

	* mips-tdep.c (mips_read_pc): Change local 'pc' type to LONGEST.
ppc-linux-tdep.c: Wrong signness for buffer holding instructions.

There seems to be no reason for this buffer to be signed.  We pass it
around to functions expecting it to be unsigned (which triggers
-Wpointer-sign warnings).

gdb/
2013-04-19  Pedro Alves  <palves@redhat.com>

	* ppc-linux-tdep.c (ppc_skip_trampoline_code): Change local
	'insnbuf' buffer type to unsigned int[].
-Wpointer-sign: s390-tdep.c.

-Wpointer-sign reveals a bunch of:

../../src/gdb/s390-tdep.c:1342:7: error: pointer targets in passing argument 4 of ‘is_rx’ differ in signedness [-Werror=pointer-sign]
../../src/gdb/s390-tdep.c:1038:1: note: expected ‘unsigned int *’ but argument is of type ‘int *’
../../src/gdb/s390-tdep.c:1343:9: error: pointer targets in passing argument 5 of ‘is_rxy’ differ in signedness [-Werror=pointer-sign]
../../src/gdb/s390-tdep.c:1055:1: note: expected ‘unsigned int *’ but argument is of type ‘int *’
../../src/gdb/s390-tdep.c:1344:9: error: pointer targets in passing argument 5 of ‘is_rxy’ differ in signedness [-Werror=pointer-sign]
../../src/gdb/s390-tdep.c:1055:1: note: expected ‘unsigned int *’ but argument is of type ‘int *’
...
../../src/gdb/s390-tdep.c:1363:7: error: pointer targets in passing argument 5 of ‘is_rs’ differ in signedness [-Werror=pointer-sign]
../../src/gdb/s390-tdep.c:966:1: note: expected ‘unsigned int *’ but argument is of type ‘int *’
../../src/gdb/s390-tdep.c:1364:9: error: pointer targets in passing argument 6 of ‘is_rsy’ differ in signedness [-Werror=pointer-sign]
../../src/gdb/s390-tdep.c:983:1: note: expected ‘unsigned int *’ but argument is of type ‘int *’
../../src/gdb/s390-tdep.c:1365:9: error: pointer targets in passing argument 6 of ‘is_rsy’ differ in signedness [-Werror=pointer-sign]
../../src/gdb/s390-tdep.c:983:1: note: expected ‘unsigned int *’ but argument is of type ‘int *’
...

I don't know much about s390, but from reading the code I believe the
right fix is to treat d2 as signed.

gdb/
2013-04-19  Pedro Alves  <palves@redhat.com>

	* s390-tdep.c (is_rs, is_rsy, is_rx, is_rxy): Change type of 'd2'
	parameter to int *.
-Wpointer-sign: aarch64-tdep.c.

../../src/gdb/aarch64-tdep.c: In function ‘aarch64_analyze_prologue’:
../../src/gdb/aarch64-tdep.c:713:7: error: pointer targets in passing argument 3 of ‘decode_cb’ differ in signedness [-Werror=pointer-sign]
../../src/gdb/aarch64-tdep.c:386:1: note: expected ‘int *’ but argument is of type ‘unsigned int *’
../../src/gdb/aarch64-tdep.c:747:7: error: pointer targets in passing argument 3 of ‘decode_stur’ differ in signedness [-Werror=pointer-sign]
../../src/gdb/aarch64-tdep.c:597:1: note: expected ‘int *’ but argument is of type ‘unsigned int *’


'is64' is just used as a boolean; signed/unsigned doesn't really matter.

2013-04-19  Pedro Alves  <palves@redhat.com>

	* aarch64-tdep.c (aarch64_analyze_prologue): Change type of local
	'is64' to signed 'int'.
-Wpointer-sign: xtensa-tdep.c.

../../src/gdb/xtensa-tdep.c:2914:4: error: pointer targets in passing argument 7 of ‘xtensa_operand_get_field’ differ in signedness [-Werror=pointer-sign]
In file included from ../../src/gdb/xtensa-tdep.c:53:0:
../../src/gdb/../include/xtensa-isa.h:487:1: note: expected ‘unsigned int *’ but argument is of type ‘int *’
../../src/gdb/xtensa-tdep.c:2916:4: error: pointer targets in passing argument 4 of ‘xtensa_operand_decode’ differ in signedness [-Werror=pointer-sign]
In file included from ../../src/gdb/xtensa-tdep.c:53:0:
../../src/gdb/../include/xtensa-isa.h:507:1: note: expected ‘unsigned int *’ but argument is of type ‘int *’
../../src/gdb/xtensa-tdep.c:2918:4: error: pointer targets in passing argument 7 of ‘xtensa_operand_get_field’ differ in signedness [-Werror=pointer-sign]
In file included from ../../src/gdb/xtensa-tdep.c:53:0:
../../src/gdb/../include/xtensa-isa.h:487:1: note: expected ‘unsigned int *’ but argument is of type ‘int *’
../../src/gdb/xtensa-tdep.c:2920:4: error: pointer targets in passing argument 4 of ‘xtensa_operand_decode’ differ in signedness [-Werror=pointer-sign]
In file included from ../../src/gdb/xtensa-tdep.c:53:0:
../../src/gdb/../include/xtensa-isa.h:507:1: note: expected ‘unsigned int *’ but argument is of type ‘int *’
../../src/gdb/xtensa-tdep.c:2922:4: error: pointer targets in passing argument 7 of ‘xtensa_operand_get_field’ differ in signedness [-Werror=pointer-sign]
In file included from ../../src/gdb/xtensa-tdep.c:53:0:
../../src/gdb/../include/xtensa-isa.h:487:1: note: expected ‘unsigned int *’ but argument is of type ‘int *’
../../src/gdb/xtensa-tdep.c:2924:4: error: pointer targets in passing argument 4 of ‘xtensa_operand_decode’ differ in signedness [-Werror=pointer-sign]
In file included from ../../src/gdb/xtensa-tdep.c:53:0:
../../src/gdb/../include/xtensa-isa.h:507:1: note: expected ‘unsigned int *’ but argument is of type ‘int *’

Those bfd functions that decode instructions output uint32_t values.
Hence this fix:

2013-04-19  Pedro Alves  <palves@redhat.com>

	* xtensa-tdep.c (execute_l32e, execute_s32e): Change type of
	parameters 'at', 'as' and 'offset' to uint32_t.
-Wpointer-sign: alpha-tdep.c.

../../src/gdb/alpha-tdep.c: In function ‘alpha_extract_return_value’:
../../src/gdb/alpha-tdep.c:520:4: error: pointer targets in passing argument 3 of ‘regcache_cooked_read_signed’ differ in signedness [-Werror=pointer-sign]
In file included from ../../src/gdb/alpha-tdep.c:36:0:

We use regcache_cooked_read_unsigned everywhere else too.

2013-04-19  Pedro Alves  <palves@redhat.com>

	* alpha-tdep.c (alpha_extract_return_value): Use
	regcache_cooked_read_unsigned to read 'v0'.
Cast result of obstack_base to gdb_byte * in a couple spots.

obstack_base returns char *.  Need to cast to gdb_byte * in a couple spots.

gdb/
2013-04-19  Pedro Alves  <palves@redhat.com>

	* c-lang.c (evaluate_subexp_c): Cast result of obstack_base to
	gdb_byte *.
	* linux-tdep.c (linux_make_mappings_corefile_notes): Likewise.
serial_write: change prototype to take a void-pointer buffer.

While remote.c works with "char *" buffers most of the time, other
remote targets have binary-ish-er protocols, and choose to use
"unsigned char" throughout, like e.g., remote-mips.c or
remote-m32r-sdi.c.  That results in -Wpointer-sign warnings in those
targets, unless we add casts in calls to serial_write.  Since
serial_write is only concerned about sending raw host bytes out, and
serial_ops->write_prim already works with "void *"/"size_t", a similar
interface to the "write" or "send" system calls, I find it natural to
change serial_write's prototype accordingly, avoiding the need for
casts.

Tested on x86_64 Fedora 17, and also by building x86_64-mingw32
and DJGPP/go32 -hosted gdbs.

gdb/
2013-04-19  Pedro Alves  <palves@redhat.com>

	* ser-base.c (ser_base_write): Change prototype -- take 'void *'
	buffer and size_t size.  Adjust.
	* ser-base.h (ser_base_write): Adjust.
	* ser-go32.c (cnts): Change type to size_t.
	(dos_write): Change prototype -- take 'void *'
	buffer and size_t size.  Adjust.
	(dos_info): Print elements of 'cnts' as unsigned long.
	* serial.c (serial_write): Likewise.
	* serial.h (serial_write): Adjust.
	(struct serial_ops) <write>: Change prototype -- take 'void *'
	buffer and size_t size.  Adjust.
gdb_byte for binary buffer, char for string: remote.c, tracepoint.c.

While the RSP is largely ASCII based (hence the packet buffer type is
char *), at places we pass around 8-bit binary packets in that buffer.
Functions like hex2bin or remote_escape_output conceptually are
handling binary buffers, so I left them as working with gdb_byte, and
added casts where necessary.  Whether these are host bytes or target
bytes is blurry at present, so this is largely a matter of taste.
Switching some of these functions to take "char *" or "void *" would
be equally good.

gdb/
2013-04-19  Pedro Alves  <palves@redhat.com>

	* remote.c (remote_write_bytes_aux, compare_sections_command)
	(remote_read_qxfer)
	(remote_search_memory, remote_hostio_pwrite, remote_hostio_pread)
	(remote_hostio_readlink, remote_bfd_iovec_pread)
	(remote_set_trace_notes): Use gdb_byte when RSP buffer is used as
	binary buffer, and char when buffer is used as string.
	* tracepoint.c (encode_source_string, tfile_write_uploaded_tp)
	(trace_save, tfile_open, traceframe_walk_blocks)
	(tfile_fetch_registers): Likewise.
gdb_byte for binary buffer, char for string: common/agent.c.

Similarly to the remote code, agent commands are mostly ascii.  Cast to
gdb_byte when treating the command buffer as raw memory bytes.

2013-04-19  Pedro Alves  <palves@redhat.com>

	* common/agent.c (agent_run_command): Add cast to gdb_byte *.