Remove simple GDBSERVER uses from common, nat and target

This removes various simple GDBSERVER uses from common, nat and
target.  The simple uses are just cases where the code includes defs.h
or server.h depending on GDBSERVER.  Instead, now the files include
the headers that they require.  Unfortunately we still need to check
GDBSERVER for some files to decide which gnulib config header to
import, but this is a step in the right direction.

gdb/
2014-06-18  Tom Tromey  <tromey@redhat.com>
	    Gary Benson  <gbenson@redhat.com>

	* common/buffer.c: Don't include server.h or defs.h; update
	includes.
	* common/common-utils.c: Don't include server.h or defs.h; update
	includes.
	* common/filestuff.c: Don't include server.h or defs.h; update
	includes.
	* common/filestuff.h: Include stdio.h.
	* common/format.c: Don't include server.h or defs.h; update
	includes.
	* common/gdb_vecs.c: Don't include server.h or defs.h; update
	includes.
	* common/print-utils.c: Don't include server.h or defs.h; update
	includes.
	* common/rsp-low.c: Don't include server.h or defs.h; update
	includes.
	* common/signals.c: Don't include server.h or defs.h; update
	includes.
	* common/vec.c: Don't include server.h or defs.h; update includes.
	* common/xml-utils.c: Don't include server.h or defs.h; update
	includes.
	* nat/linux-osdata.c: Don't include server.h or defs.h; update
	includes.
	* nat/linux-procfs.c: Don't include server.h or defs.h; update
	includes.
	* nat/linux-ptrace.c: Don't include server.h or defs.h; update
	includes.
	* nat/mips-linux-watch.h: Don't include server.h or defs.h; update
	includes.
	* target/waitstatus.c: Don't include server.h or defs.h; update
	includes.
Remove GDBSERVER use from nat/i386-dregs.c

This removes the use of GDBSERVER from nat/i386-dregs.c.  Neither
defs.h or server.h are included: the specific files required are
listed instead.  Also, a declaration previously made only outside
of gdbserver is made unconditional.

gdb/
2014-06-18  Gary Benson  <gbenson@redhat.com>

	* gdb/nat/i386-dregs.c: Don't include server.h or defs.h; update
	includes.
	(debug_hw_points): Declare regardless of GDBSERVER.
Make btrace-common.h not use GDBSERVER

This changes btrace-common.h not to include defs.h or server.h.
Instead it moves the defs.h include to btrace.c.

gdb/
2014-01-09  Tom Tromey  <tromey@redhat.com>

	* btrace.c: Include defs.h.
	* common/btrace-common.h: Don't include server.h or defs.h.
Mostly remove GDBSERVER from linux-waitpid.c

This commit mostly removes the use of GDBSERVER from
nat/linux-waitpid.c.  A use remains for some debugging
code that I will remove when the Linux thread_db code
is refactored.

gdb/
2014-07-09  Gary Benson  <gbenson@redhat.com>

	* configure.ac [AC_CHECK_HEADERS] <errno.h>: New check.
	* configure: Regenerate.
	* config.in: Likewise.
	* nat/linux-waitpid.c: Don't include server.h or defs.h.
	(linux_debug) [debug_threads]: New declaration.
Add target/target.h

This adds target/target.h.  This file declares some functions that the
"common" code can use and that the clients must implement.  It also
changes code in common to use these functions.

gdb/
2014-01-09  Tom Tromey  <tromey@redhat.com>

	* target.h: Include target/target.h.
	(target_read_memory, target_write_memory): Don't declare.
	* target.c (target_read_uint32): New function.
	* common/agent.c: Don't include server.h or defs.h; update
	includes.
	(agent_get_helper_thread_id): Use target_read_uint32.
	(agent_run_command): Always use target_write_memory,
	target_read_memory.
	(agent_capability_check): Use target_read_uint32.
	* target/target.h: New file.

gdb/gdbserver/
2014-01-09  Tom Tromey  <tromey@redhat.com>

	* target.c (target_read_memory, target_read_uint32)
	(target_write_memory): New functions.
More target unification

This unifies a few more top-level target functions -- target_resume,
target_wait, and target_stop -- and the declaration of the variable
"non_stop".  This follows the usual pattern, where clients of "common"
are expected to define the objects appropriately, thus simplifying
common/agent.c a bit more.

gdb/
2014-06-18  Tom Tromey  <tromey@redhat.com>

	* target/target.h (target_resume, target_wait, target_stop)
	(non_stop): Moved from target.h.
	* target.h (target_resume, target_wait, target_stop, non_stop):
	Move to target/target.h.
	* common/agent.c (agent_run_command): Always use target_resume,
	target_stop, and target_wait.

gdb/gdbserver/
2014-06-18  Tom Tromey  <tromey@redhat.com>

	* target.c (target_wait, target_stop, target_resume): New
	functions.
Add target/symbol.h, update users

This adds a new "target/symbol.h" file, that declares a symbol-lookup
function used by code in common.  It follows the usual pattern, where
clients of "common" have their own definitions of this function.  This
simplifies agent.c a bit.

gdb/
2014-06-18  Tom Tromey  <tromey@redhat.com>

	* target/symbol.h: New file.
	* target.h: Include target/symbol.h.
	* target.c (target_look_up_symbol): New function.
	* common/agent.c: Include target/symbol.h.
	(agent_look_up_symbols): Use target_look_up_symbol.

gdb/gdbserver/
2014-06-18  Tom Tromey  <tromey@redhat.com>

	* target.c: Include target/symbol.h.
	(target_look_up_symbol): New function.
Finally remove GDBSERVER (mostly) from agent.c

This reduces the use of the GDBSERVER define in agent.c to deciding
which gnulib header to include.

gdb/
2014-06-18  Tom Tromey  <tromey@redhat.com>
	    Gary Benson  <gbenson@redhat.com>

	* common/agent.c: Don't include defs.h or server.h.
Introduce common_get_thread_regcache

This introduces common_get_thread_regcache so that we can simplify
common/linux-btrace.c.  A better long term solution would be unify the
regcache code, but this suffices for my current purposes.

gdb/
2014-06-18  Tom Tromey  <tromey@redhat.com>

	* regcache.h (common_get_thread_regcache): Declare.
	* regcache.c (common_get_thread_regcache): New function.
	* common/linux-btrace.h (common_get_thread_regcache): Declare.
	* common/linux-btrace.c (perf_event_read_bts): Use
	common_get_thread_regcache.

gdb/gdbserver/
2014-06-18  Tom Tromey  <tromey@redhat.com>

	* regcache.c (common_get_thread_regcache): New function.
Finally remove GDBSERVER (mostly) from linux-btrace.c

This applies the usual GDBSERVER treatment to linux-btrace.c.
Now it is used only to find the gnulib header.

gdb/
2014-06-18  Tom Tromey  <tromey@redhat.com>

	* common/linux-btrace.c: Don't include defs.h or server.h.
	* common/linux-btrace.h (struct target_ops): Declare.