Fix MinGW compilation

On Sun, 14 Dec 2014 07:00:28 +0100, Yao Qi wrote:
The build on mingw host is broken because mingw has no mkdtemp.

../../../git/gdb/compile/compile.c: In function 'get_compile_file_tempdir':
../../../git/gdb/compile/compile.c:194:3: error: implicit declaration of function 'mkdtemp' [-Werror=implicit-function-declaration]
   tempdir_name = mkdtemp (tname);
   ^
../../../git/gdb/compile/compile.c:194:16: error: assignment makes pointer from integer without a cast [-Werror]
   tempdir_name = mkdtemp (tname);
                ^
cc1: all warnings being treated as errors

In the end I have managed to test it by Wine myself:

$ wine build_win32/gdb/gdb.exe -q build_win32/gdb/gdb.exe -ex start -ex 'compile code 1' -ex 'set confirm no' -ex quit
[...]
Temporary breakpoint 1, main (argc=1, argv=0x241418) at ../../gdb/gdb.c:29
29        args.argc = argc;
Could not load libcc1.so: Module not found.

Even if it managed to load libcc1.so (it needs host-dependent name libcc1.dll)
then it would soon end up at least on:

default_infcall_mmap:
  error (_("This target does not support inferior memory allocation by mmap."));

As currently there is only:

linux-tdep.c:
  set_gdbarch_infcall_mmap (gdbarch, linux_infcall_mmap);

While one could debug Linux targets from MS-Windows host I find it somehow
overcomplicated now when we are trying to get it running at least on native
Linux x86*.

The 'compile' project needs a larger port effort to run on MS-Windows.

gdb/ChangeLog
2014-12-17  Jan Kratochvil  <jan.kratochvil@redhat.com>

	Fix MinGW compilation.
	* compile/compile.c (get_compile_file_tempdir): Call error if
	!HAVE_MKDTEMP.
	* config.in: Regenerate.
	* configure: Regenerate.
	* configure.ac (AC_CHECK_FUNCS): Add mkdtemp.

gdb/testsuite/ChangeLog
2014-12-17  Jan Kratochvil  <jan.kratochvil@redhat.com>

	Fix MinGW compilation.
	* gdb.compile/compile-ops.exp: Update untested message if
	!skip_compile_feature_tests.
	* gdb.compile/compile-setjmp.exp: Likewise.
	* gdb.compile/compile-tls.exp: Likewise.
	* gdb.compile/compile.exp: Likewise.
	* lib/gdb.exp (skip_compile_feature_tests): Check also "Command not
	supported on this host".
Automatic date update in version.in
Display DW_LANG_C11 as (C11).

	* dwarf.c (read_and_display_attr_value): Change display name of
	DW_LANG_C11 from (ANSI C11) to (C11).
Fix file name in earlier entry.
language_lookup_primitive_type: Renamed from language_lookup_primitive_type_by_name.

gdb/ChangeLog:

	* language.c (language_lookup_primitive_type): Renamed from
	language_lookup_primitive_type_by_name.  All callers updated.
infcmd.c (jump_command): Minor simplification.

gdb/ChangeLog:

	* infcmd.c (jump_command): Minor simplification.
Remove h8300_print_float_info

In infcmd.c:print_float_info, if the architecture doesn't have gdbarch
method print_float_info implemented and doesn't float reggroup, GDB
will prints "No floating-point info available for this processor."
The h8300 port doesn't have float registers, and don't need to
implement print_float_info.  This patch is to remove it.

gdb:

2014-12-18  Yao Qi  <yao@codesourcery.com>

	* h8300-tdep.c (h8300_print_float_info): Remove.
	(h8300_gdbarch_init): Remove the call to
	set_gdbarch_print_float_info.
Refactor gdbarch method print_float_info

This patch is to change print_float_info gdbarch method for the
following two reasons,

 1. we want to add a default implementation of print_float_info to
    dump the float pointer registers.  It can be reused by backend to
    print something more than float point registers.
 2. we want to simplify the caller of print_float_info,
    infcmd.c:print_float_info.

gdb:

2014-12-18  Yao Qi  <yao@codesourcery.com>

 	* gdbarch.sh (print_float_info): Change its type from 'M' to 'm'.
	* gdbarch.c: Re-generated.
	* gdbarch.h: Likewise.
	* infcmd.c (default_print_float_info): New function.
	(print_float_info): Removed.  Move code to
	default_print_float_info.
	(float_info): Adjust to call gdbarch_print_float_info.
	* inferior.h (default_print_float_info): Declare it.
MIPS: Provide FPU info and decode FCSR in `info float'

This patch is the V2.  V1 can be found in
https://sourceware.org/ml/gdb-patches/2012-05/msg00938.html
V2 is to address Joel's comment
<https://sourceware.org/ml/gdb-patches/2012-06/msg00289.html> about
keeping dumping floating point registers.  Additionally, command
'info float' prints bits on nan2008 and abs2008.

------------------------------------------------------------------

 The change below provides a MIPS-specific handler for the:

(gdb) info float

command.  It provides information about the FPU type available (if any),
the FPU register width, and decodes the CP1 Floating Point Control and
Status Register (FCSR):

(gdb) print /x $fsr
$1 = 0xff83ffff
(gdb) info float
fpu type: double-precision
reg size: 32 bits
cond    : 0 1 2 3 4 5 6 7
cause   : inexact uflow oflow div0 inval unimp
mask    : inexact uflow oflow div0 inval
flags   : inexact uflow oflow div0 inval
rounding: -inf
flush   : zero

 One point to note about CP1.FCSR are the non-standard Flush-to-Nearest
and Flush-Override bits.  They are not a part of the MIPS architecture and
take two positions reserved for an implementation-dependent use in the
architecture.  They are present in all the FPU implementations made by
MIPS Technologies since the spin-off from SGI.

 I haven't been able to track down a single other MIPS FPU implementation
that would make any use of these bits and they are required to be
hardwired to zero by the architecture specification if unimplemented.
Therefore I think it makes sense to report them in the current way.

 GDB has no guaranteed access to the CP0 Processor Identification (PRId)
register to validate this feature properly and the ID information stored
in the CP1 Floating Point Implementation Register (FIR) is from my
experience not reliable enough (there's no Company ID available there for
once unlike in CP0.PRId and Processor ID is not guaranteed to be unique).

 As a side note we should probably dump CP1.FIR information as well, as
there's useful stuff indicating some FPU features there.  That's material
for another change however.

gdb/

2014-12-18  Nigel Stephens  <nigel@mips.com>
            Maciej W. Rozycki  <macro@codesourcery.com>

	* mips-tdep.c (print_fpu_flags): New function.
	(mips_print_float_info): Likewise.
	(mips_gdbarch_init): Install mips_print_float_info as gdbarch
	print_float_info routine.

gdb/testsuite/

2014-12-18  Nigel Stephens  <nigel@mips.com>
            Maciej W. Rozycki  <macro@codesourcery.com>

	* gdb.base/float.exp: Handle the new output from "info float" on
	MIPS targets.
A few comment cleanups

I stumbled upon a few comments that I think are outdated.

Comment for elfread.c (elf_symfile_init): As far as history goes in git,
I don't see anything related to that.

Comment for elfread.c (elf_symfile_read): References a parameter that was
removed in 1999.

Comment for struct sym_fns/sym_offsets: References a parameter that was
changed in 1999.

gdb/ChangeLog:

	* elfread.c (elf_symfile_init): Remove stale comment.
	(elf_symfile_read): Same.
	* symfile.h (struct sym_fns): Same.