symtab.h (struct symbol_search) <symtab>: Delete, unnecessary.

gdb/ChangeLog:

	* symtab.h (struct symbol_search) <symtab>: Delete.  All uses updated.
	* symtab.c (compare_search_syms): Use SYMBOL_SYMTAB accessor.
	(print_symbol_info): Delete arg symtab.  All callers updated.
	(symtab_symbol_info): Use SYMBOL_SYMTAB accessor.
cp_find_type_baseclass_by_name: Renamed from find_type_baseclass_by_name.

gdb/ChangeLog:

	* cp-namespace.c (cp_find_type_baseclass_by_name): Renamed from
	find_type_baseclass_by_name.  All callers updated.
cp_lookup_symbol_via_imports: Renamed from cp_lookup_symbol_imports.

gdb/ChangeLog:

	* cp-namespace.c (cp_lookup_symbol_via_imports): Renamed from
	cp_lookup_symbol_imports.  All callers updated.
boards/stabs.exp: New file.

gdb/ChangeLog:

	* boards/stabs.exp: New file.
Make buildsym set-up/tear-down more consistent, and document it.

gdb/ChangeLog:

	* buildsym.c: Add comments describing how the buildsym machinery
	is used by the various file formats.
	(really_free_pendings): Enhance function comment.
	See pending_macros to NULL.  Simplify resetting pending_addrmap.
	Call free_buildsym_compunit.
	(free_buildsym_compunit): Set current_subfile to NULL.
	(prepare_for_building): New function.
	(start_symtab): Call it.  Remove call to set_last_source_file.
	(restart_symtab): New arg "cust".  All callers updated.
	Simplify, call prepare_for_building.  Re-initialize buildsym_compunit.
	(reset_symtab_globals): Enhance function comment.
	Set local_symbols, file_symbols, global_symbols to NULL.
	Set pending_macros to NULL.  Simplify resetting pending_addrmap.
	Call free_buildysym_compunit.
	(end_symtab_without_blockvector): Delete.  All callers updated.
	(end_symtab_with_blockvector): Remove redundant call to
	free_buildsym_compunit.
	(augment_type_symtab): Remove arg "cust".  All callers updated.
	(buildsym_init): Remove resetting of free_pendings, file_symbols,
	global_symbols, pending_blocks, pending_macros.  Instead make
	handling consistent with pending_addrmap: Assert value was reset
	at end of previous symtab building.  Initialize context_stack here.
New parameter "debug symbol-lookup".

gdb/ChangeLog:

	New parameter "debug symbol-lookup".
	* NEWS: Mention it.
	* cp-namespace.c (cp_lookup_symbol_imports_or_template): Add debug
	output.
	(cp_lookup_symbol_namespace, cp_lookup_symbol_nonlocal): Ditto.
	(cp_lookup_nested_symbol): Ditto.
	* language.c (language_lookup_primitive_type_by_name): Add debug
	output.
	* minsyms.c (lookup_minimal_symbol): Add debug output.
	* objfiles.c (objfile_debug_name): Moved here, and renamed ...
	* symfile-debug.c (debug_objfile_name): ... from here.  All callers
	updated.
	* objfiles.h (objfile_debug_name): Declare.
	* symtab.h (symbol_lookup_debug): Declare.
	* symtab.c (symbol_lookup_debug): New global.
	(lookup_language_this): Add debug output.
	(lookup_symbol_aux, lookup_symbol_in_block): Ditto.
	(lookup_symbol_in_objfile_symtabs, lookup_symbol_via_quick_fns): Ditto.
	(lookup_symbol_in_static_block, lookup_symbol_in_objfile): Ditto.
	(_initialize_symtab): Add new parameter "debug symbol-lookup".

gdb/doc/ChangeLog:

	* gdb.texinfo (Debugging Output): Document "debug symbol-lookup".
value_maybe_namespace_elt: Remove redundant call to lookup_static_symbol.

Anytime you can remove a symbol lookup that loops over all objfiles
is A Good Thing.

The call to lookup_static_symbol in valops.c:value_maybe_namespace_elt
is redundant with this call in cp_lookup_nested_symbol:

	/* Now search all static file-level symbols.  We have to do this
	   for things like typedefs in the class.  We do not try to
	   guess any imported namespace as even the fully specified
	   namespace search is already not C++ compliant and more
	   assumptions could make it too magic.  */

	size = strlen (parent_name) + 2 + strlen (nested_name) + 1;
	concatenated_name = alloca (size);
	xsnprintf (concatenated_name, size, "%s::%s",
		 parent_name, nested_name);
	sym = lookup_static_symbol (concatenated_name, VAR_DOMAIN);
	if (sym != NULL)
	  return sym;

Earlier in value_maybe_namespace_elt we do this:

  sym = cp_lookup_symbol_namespace (namespace_name, name,
				    get_selected_block (0), VAR_DOMAIN);

That sequence goes like:

value_maybe_namespace_elt
-> cp_lookup_symbol_namespace
-> cp_lookup_symbol_in_namespace
-> lookup_symbol_file
-> cp_lookup_nested_symbol
-> lookup_static_symbol

The call was added in commit 41f62f3939b1c69e68ef5652feb44fef90eb85c9.
https://sourceware.org/ml/gdb-patches/2010-06/msg00663.html
With a part 2 here:
https://sourceware.org/ml/gdb-patches/2010-06/msg00664.html

At the time the call to lookup_static_symbol (spelled
lookup_static_symbol_aux at the time) was needed.

However, this patch, 8dea366bbed7986295681c101dcfbd35aeb6dfc4,
https://sourceware.org/ml/gdb-patches/2012-11/msg00387.html
augmented lookup_symbol_file to call cp_lookup_nested_symbol
and introduced the redundancy.

It's kinda buried, so it's totally not unexpected that this happened.

gdb/ChangeLog:

	* valops.c (value_maybe_namespace_elt): Remove redundant call to
	lookup_static_symbol.
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