Remove some GDBSERVER checks from linux-ptrace

This patch removes some GDBSERVER checks from common/linux-ptrace.c.
Currently the code uses a compile-time check to decide whether some
flags should be used.  This changes the code to instead let users of
the module specify an additional set of flags; and then changes gdb's
linux-nat.c to call this function.  At some later date, when the back
ends are fully merged, we will be able to remove this function again.

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

	* common/linux-ptrace.c (additional_flags): New global.
	(linux_test_for_tracesysgood, linux_test_for_tracefork): Use
	additional_flags; don't check GDBSERVER.
	(linux_ptrace_set_additional_flags): New function.
	* common/linux-ptrace.h (linux_ptrace_set_additional_flags):
	Declare.
	* linux-nat.c (_initialize_linux_nat): Call
	linux_ptrace_set_additional_flags.
Make gdbserver CORE_ADDR unsigned

gdbserver defines CORE_ADDR to be signed.  This seems erroneous to
me; and furthermore likely to cause problems in common/, as it is
different from gdb's definition.

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

	* defs.h (CORE_ADDR): Now unsigned.
Introduce common-types.h

This introduces common-types.h.  This file defines various standard
types used by gdb and gdbserver.

Currently these types are conditionally defined based on GDBSERVER.
The long term goal is to remove all such tests; however, this is
difficult as currently gdb uses definitions from BFD.  In the meantime
this is still a step in the right direction.

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

	* common/common-types.h: New file.
	* common/linux-ptrace.c: Include common-types.h.
	* defs.h: Include common-types.h.
	(gdb_byte, CORE_ADDR, CORE_ADDR_MAX, LONGEST, ULONGEST): Remove.

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

	* server.h: Include common-types.h.  Move gdb_assert.h include
	earlier.  Add static assertion.
	(gdb_byte, CORE_ADDR, LONGEST, ULONGEST): Remove.
remove simple GDBSERVER uses from common

This removes various simple GDBSERVER uses from common.  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 for the time being we still need to
check GDBSERVER to decide which gnulib config header to import; but
this is not very significant in the long run.
Introduce and use debug_printf and debug_vprintf

This introduces debug_printf and debug_vprintf, a function that
clients of "common" are expected to implement.  gdbserver's
existing debug_printf is repurposed as debug_vprintf, and a new
wrapper is written.

common/agent.c is changed to use debug_vprintf rather than
defining the macro DEBUG_AGENT depending on GDBSERVER.

nat/i386-dregs.c is changed to use the externally-implemented
debug_printf, rather than defining it itself.
remove GDBSERVER use from common/linux-ptrace.c

This mostly removes the use of defs.h and server.h from
common/linux-ptrace.c.  A use must remain for the gnulib header for
the time being.
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.
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.
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.
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.
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.
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.
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.