Commit Graph

152 Commits

Author SHA1 Message Date
Joel Brobecker 648d586d84 configure gdb/gnulib with --disable-largefile if largefile support disabled.
This patch mostly aims at fixing a GDB build failure on 32bit Solaris
systems (Sparc and x86), due to a recent gnulib update adding the
readlink module. But it might also fix related issues when configuring
with --disable-largefile.

A side-effect of the gnulib readlink module addition is that it caused
largefile support to be added as well, and in particular
gnulib/import/m4/largefile.m4 introduced the following new #define in
gnulib's config.in:

| +/* Number of bits in a file offset, on hosts where this is settable. */
| +#undef _FILE_OFFSET_BITS

When defined to 64, it triggers an issue with procfs.h while trying
to build sparc-sol2-nat.c:

| #if !defined(_LP64) && _FILE_OFFSET_BITS == 64
| #error  "Cannot use procfs in the large file compilation environment"
| #endif

As it turns out, this is a fairly familiar problem, and one of
the reasons behind ACX_LARGEFILE having been created. In that macro,
we have some code which disables largefile support on solaris hosts:

|   sparc-*-solaris*|i[3-7]86-*-solaris*)
| changequote([,])dnl
|     # On native 32bit sparc and ia32 solaris, large-file and procfs support
|     # are mutually exclusive; and without procfs support, the bfd/ elf module
|     # cannot provide certain routines such as elfcore_write_prpsinfo
|     # or elfcore_write_prstatus.  So unless the user explicitly requested
|     # large-file support through the --enable-largefile switch, disable
|     # large-file support in favor of procfs support.
|     test "${target}" = "${host}" -a "x$plugins" = xno \
|       && : ${enable_largefile="no"}
|     ;;

But gnulib ignores this fact, and so tries to determine how to
enable large-file support irrespective of whether we want it or not.
This patch fixes the issue by passing --disable-largefile to gnulib's
configure when large-file support in GDB is disabled. This is done
by first enhancing ACX_CONFIGURE_DIR to allow us to pass extra
arguments to be passed to the configure command, and then by modifying
GDB's configure to pass --disable-largefile if large-file support
is disabled.

gdb/ChangeLog:

	* acx_configure_dir.m4 (ACX_CONFIGURE_DIR): Add support for
        new "EXTRA-ARGS" parameter.
	* configure.ac: If large-file support is disabled in GDB,
        pass --disable-largefile to ACX_CONFIGURE_DIR call for "gnulib".
	* configure: Regenerate.

gdb/gdbserver/ChangeLog:

	* configure.ac: If large-file support is disabled in GDBserver,
        pass --disable-largefile to ACX_CONFIGURE_DIR call for "gnulib".
        * configure: Regenerate.

Tested by rebuilding on sparc-solaris and x86_64-linux (with gdbserver).
This fixes the build failure on sparc-solaris. I also verified in
gnulib's config.log file that we pass --disable-largefile in the solaris
case, while we do not in the GNU/Linux case.
2014-12-13 09:45:57 -05:00
Yao Qi bdca27a2f5 Use readlink unconditionally
Since readlink module is imported, we can use it unconditionally.
This patch is to remove configure checks and HAVE_READLINK checks in
code.  It was mentioned in the patch below

  [RFA/commit] gdbserver: return ENOSYS if readlink not supported.
  https://sourceware.org/ml/gdb-patches/2012-02/msg00148.html

to use readlink in gdbserver, but we chose something simple at that
moment.

gdb:

2014-11-28  Yao Qi  <yao@codesourcery.com>

	* configure.ac (AC_CHECK_FUNCS): Remove readlink.
	* config.in, configure: Re-generate.
	* inf-child.c (inf_child_fileio_readlink): Don't check
	HAVE_READLINK is defined.

gdb/gdbserver:

2014-11-28  Yao Qi  <yao@codesourcery.com>

	* configure.ac(AC_CHECK_FUNCS): Remove readlink.
	* config.in, configure: Re-generate.
	* hostio.c (handle_unlink): Remove code checking HAVE_READLINK
	is defined.
2014-11-28 18:37:52 +08:00
Yao Qi 9c232dda88 Include alloca.h unconditionally
Since gnulib alloca module was imported, we can include alloca.h in
both gdb and gdbserver unconditionally, so this patch adds inclusion
of alloca.h in common-defs.h.  This patch also removes AC_FUNC_ALLOCA
in configure.ac because we don't need to check alloca any more.

This patch below is removed in fact.

  [RFA/commit] include alloca.h if available.
  https://www.sourceware.org/ml/gdb-patches/2010-08/msg00566.html

Since alloca.h is from gnulib now, we don't have to check malloc.h in
configure and include malloc.h in code.  This patch also remove them
too.

gdb:

2014-11-21  Yao Qi  <yao@codesourcery.com>

	* common/common-defs.h: Include alloca.h
	* configure.ac: Don't invoke AC_FUNC_ALLOCA.
	* configure: Re-generated.
	* defs.h: Remove code handling alloca.
	* utils.c (gdb_realpath): Don't check HAVE_ALLOCA is defined
	or not.

gdb/gdbserver:

2014-11-21  Yao Qi  <yao@codesourcery.com>

	* configure.ac: Don't invoke AC_FUNC_ALLOCA.
	(AC_CHECK_HEADERS): Remove malloc.h.
	* configure: Re-generated.
	* config.in: Re-generated.
	* server.h: Don't include alloca.h and malloc.h.
	* gdbreplay.c: Don't check HAVE_ALLOCA_H is defined.
	Don't include malloc.h.
2014-11-21 22:05:41 +08:00
Gary Benson e9bcb65852 Introduce common/gdb_setjmp.h
This commit creates a new file, common/gdb_setjmp.h, to hold some
portability macros for setjmp/longjmp et al. that are used by the
exceptions subsystem and by the demangler crash catcher.

gdb/ChangeLog:

	* common/gdb_setjmp.h: New file.
	* Makefile.in (HFILES_NO_SRCDIR): Add common/gdb_setjmp.h.
	* configure.ac: Move sigsetjmp check...
	* common/common.m4: ...here.
	* configure: Regenerate.
	* cp-support.c (SIGJMP_BUF): Delete.
	(SIGSETJMP): Likewise.
	(SIGLONGJMP): Likewise.
	* exceptions.h (gdb_setjmp.h): Include.
	(setjmp.h): Do not include.
	(EXCEPTIONS_SIGJMP_BUF): Delete.
	(EXCEPTIONS_SIGSETJMP): Likewise.
	(EXCEPTIONS_SIGLONGJMP): Likewise.
	Replace all uses of EXCEPTIONS_SIG* macros with SIG* macros
	from gdb_setjmp.h.
	* exceptions.c: Likewise.

gdb/gdbserver/ChangeLog:

	* config.in: Regenerate.
	* configure: Likewise.
2014-08-29 10:53:36 +01:00
Gary Benson bb974a2493 Move errno.h to common-defs.h
This commit moves the inclusion of errno.h to common-defs.h and
removes all other inclusions.  Note that prior to this commit
server.h included errno.h protected by "#ifdef HAVE_ERRNO_H".
This protection was added with the Windows CE port, which is
currently broken.  Since no other platform needs this, I have
removed the protection and the configury to support it.

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

	* common/common-defs.h: Include errno.h.
	* defs.h: Do not include errno.h.
	* ada-typeprint.c: Likewise.
	* c-typeprint.c: Likewise.
	* core-regset.c: Likewise.
	* corefile.c: Likewise.
	* corelow.c: Likewise.
	* event-loop.c: Likewise.
	* f-typeprint.c: Likewise.
	* gnu-nat.c: Likewise.
	* go32-nat.c: Likewise.
	* i386gnu-nat.c: Likewise.
	* m2-typeprint.c: Likewise.
	* nat/linux-btrace.c: Likewise.
	* p-typeprint.c: Likewise.
	* procfs.c: Likewise.
	* remote-sim.c: Likewise.
	* rs6000-nat.c: Likewise.
	* target.c: Likewise.
	* typeprint.c: Likewise.
	* ui-file.c: Likewise.
	* valops.c: Likewise.
	* valprint.c: Likewise.

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

	* configure.ac (AC_CHECK_HEADERS): Remove errno.h.
	* configure: Regenerate.
	* config.in: Likewise.
	* server.h: Do not include errno.h.
	* event-loop.c: Likewise.
	* hostio-errno.c: Likewise.
	* linux-low.c: Likewise.
	* remote-utils.c: Likewise.
	* spu-low.c: Likewise.
	* utils.c: Likewise.
	* gdbreplay.c: Unconditionally include errno.h.
2014-08-07 09:06:48 +01:00
Gary Benson 698b3e0833 Fix mingw32 build on x86-64 RHEL 6.5
This commit fixes the mingw32 build on x86-64 RHEL 6.5.

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

	* configure.ac (AC_REPLACE_FUNCS) <vasprintf, vsnprintf>: Removed.
	* configure: Regenerated.
	* config.in: Likewise.
2014-06-20 15:41:28 +01:00
Marcus Shawcroft e1d2394b50 Fix gdbserver cross build.
The recent libiberty patch caused issues when cross building
gdbserver.  The Makefile ends invoking the build machine's "ar"
instead of the --host version:

  ar  ./libiberty.a \
	    ./regex.o (...)

  ar: illegal option -- .
  Usage: ar [emulation options] [-]{dmpqrstx}[abcfilNoPsSuvV] [member-name] [count] archive-file file...
	 ar -M [<mri-script]

The libiberty configure script does probe for and finds an appropriate
AR.  However, gdbserver's configure does not probe for AR and
overrides the AR used in the libiberty build by explicitly passing AR
to the sub-builds.

gdb/gdbserver/
2014-06-20  Marcus Shawcroft  <marcus.shawcroft@arm.com>

	* configure.ac: Invoke. AC_CHECK_TOOL(AR, ar).
	* Makefile.in (AR, AR_FLAGS): Define.
	* configure: Regenerate.
2014-06-20 11:48:15 +01:00
Tom Tromey 0b04e52316 link gdbserver against libiberty
This builds a libiberty just for gdbserver and arranges for gdbserver
to use it.  I've tripped across the lack of libiberty in gdbserver at
least once, and I have seen other threads where it would have been
useful.

2014-06-12  Tom Tromey  <tromey@redhat.com>

	* debug.c (debug_printf): Remove HAVE_GETTIMEOFDAY checks.
	* server.c (monitor_show_help): Remove HAVE_GETTIMEOFDAY check.
	(parse_debug_format_options): Likewise.
	(gdbserver_usage): Likewise.
	* Makefile.in (LIBIBERTY_BUILDDIR, LIBIBERTY): New variables.
	(SUBDIRS, REQUIRED_SUBDIRS): Add libiberty.
	(gdbserver$(EXEEXT), gdbreplay$(EXEEXT)): Depend on and link
	against libiberty.
	($(LIBGNU)): Depend on libiberty.
	(all-lib): Recurse into all subdirs.
	(install-only): Invoke "install" target in subdirs.
	(vasprintf.o, vsnprintf.o, safe-ctype.o, lbasename.o): Remove
	targets.
	* configure: Rebuild.
	* configure.ac: Add ACX_CONFIGURE_DIR for libiberty.  Don't check
	for vasprintf, vsnprintf, or gettimeofday.
	* configure.srv: Don't add safe-ctype.o or lbasename.o to
	srv_tgtobj.
2014-06-12 14:35:47 -06:00
Joel Brobecker 270c993744 Make it easy to make --disable-werror the default for both binutils and gdb
The goal of this patch is to provide an easy way to make
--disable-werror the default when building binutils, or the parts
of binutils that need to get built when building GDB. In development
mode, we want to continue making -Werror the default with GCC.
But, when making releases, I think we want to make it as easy as
possible for regular users to successfully build from sources.

GDB already has this kind of feature to turn -Werror as well as
the use of the libmcheck library. As GDB Release Manager, I take
advantage of it to turn those off after having cut the branch.
I'd like to be able to do the same for the binutils bits. And
perhaps Tristan will want to do the same for his releases too
(not sure, binutils builders might be a little savvier than GDB
builders).

This patch introduces a new file, called development.sh, which
just sets a variable called $development. In our development branches
(Eg. "master"), it's set to true. But setting it to false would allow
us to change the default behavior of various development-related
features to be turned off; in this case, it turns off the use of
-Werror by default (use --enable-werror to turn it back on).

bfd/ChangeLog:

        * development.sh: New file.
        * warning.m4 (AM_BINUTILS_WARNINGS): Source bfd/development.sh.
        Make -Werror the default with GCC only if DEVELOPMENT is true.
        * Makefile.am (CONFIG_STATUS_DEPENDENCIES): Add
        $(srcdir)/development.sh.
        * Makefile.in, configure: Regenerate.

binutils/ChangeLog:

        * Makefile.am (CONFIG_STATUS_DEPENDENCIES): Add dependency on
        bfd's development.sh.
        * Makefile.in, configure: Regenerate.

gas/ChangeLog:

        * Makefile.am (CONFIG_STATUS_DEPENDENCIES): Add dependency on
        bfd's development.sh.
        * Makefile.in, configure: Regenerate.

gold/ChangeLog:

        * Makefile.am (CONFIG_STATUS_DEPENDENCIES): New.
        * Makefile.in, configure: Regenerate.

gprof/ChangeLog:

        * Makefile.am (CONFIG_STATUS_DEPENDENCIES): Add dependency on
        bfd's development.sh.
        * Makefile.in, configure: Regenerate.

ld/ChangeLog:

        * Makefile.am (CONFIG_STATUS_DEPENDENCIES): Add dependency on
        bfd's development.sh.
        * Makefile.in, configure: Regenerate.

opcodes/ChangeLog:

        * Makefile.am (CONFIG_STATUS_DEPENDENCIES): Add dependency on
        bfd's development.sh.
        * Makefile.in, configure: Regenerate.

gdb/ChangeLog:

        * development.sh: Delete.
        * Makefile.in (config.status): Adjust dependency on development.sh.
        * configure.ac: Adjust development.sh source call.
        * configure: Regenerate.

gdb/gdbserver/ChangeLog:

        * configure.ac: Adjust development.sh source call.
        * Makefile.in (config.status): Adjust dependency on development.sh.
        * configure: Regenerate.

Tested on x86_64-linux by building two ways: One with DEVELOPMENT
set to true, and one with DEVELOPMENT set to false. In the first
case, I could see the use of -Werror, while it disappeared in
the second case.
2014-06-05 05:47:29 -07:00
Joel Brobecker 786dc51990 Do not build gdbserver with -Werror by default if development=false
On GDB release branches, we change $development in gdb/development.sh
to false, in order to build the GDB release without -Werror by default,
thus avoiding harmless compiler warnings from breaking the build of
someone who's only interested in building GDB rather than working
on it.

This patch implements the same strategy for gdbserver, using the exact
same method.

gdb/gdbserver/ChangeLog:

        * configure.ac: Only use -Werror by default when DEVELOPMENT
        is true.
        * configure: Regenerate.

Tested on x86_64-linux, by rebuilding GDBserver first with development
set to true, and then doing it again with development set to false.
Werror was used in the first case, but not in the second.
2014-05-20 06:25:10 -07:00
Doug Evans 87ce2a04c5 New gdbserver option --debug-format=timestamp.
* NEWS: Mention it.

	gdbserver/
	* configure.ac (AC_CHECK_FUNCS): Add test for gettimeofday.
	* configure: Regenerate.
	* config.in: Regenerate.
	* Makefile.in (SFILES): Add debug.c.
	(OBS): Add debug.o.
	* debug.c: New file.
	* debug.h: New file.
	* linux-aarch64-low.c (*): Update all debugging printfs to use
	debug_printf instead of fprintf.
	* linux-arm-low.c (*): Ditto.
	* linux-cris-low.c (*): Ditto.
	* linux-crisv32-low.c (*): Ditto.
	* linux-m32r-low.c (*): Ditto.
	* linux-sparc-low.c (*): Ditto.
	* linux-x86.c (*): Ditto.
	* linux-low.c (*): Ditto.
	(linux_wait_1): Add calls to debug_enter, debug_exit.
	(linux_wait): Remove redundant debugging printf.
	(stop_all_lwps): Add calls to debug_enter, debug_exit.
	(linux_resume, unstop_all_lwps): Ditto.
	* mem-break.c (*): Update all debugging printfs to use
	debug_printf instead of fprintf.
	* remote-utils.c (*): Ditto.
	* thread-db.c (*): Ditto.
	* server.c #include <ctype.h>, "gdb_vecs.h".
	(debug_threads): Moved to debug.c.
	(*): Update all debugging printfs to use debug_printf instead of
	fprintf.
	(start_inferior): Replace call to fflush with call to debug_flush.
	(monitor_show_help): Mention set debug-format.
	(parse_debug_format_options): New function.
	(handle_monitor_command): Handle "monitor set debug-format".
	(gdbserver_usage): Mention --debug-format.
	(main): Parse --debug-format.
	* server.h (debug_threads): Declaration moved to debug.h.
	#include "debug.h".
	* tracepoint.c (trace_debug_1) [!IN_PROCESS_AGENT]: Add version of
	trace_debug_1 that uses debug_printf.
	(tracepoint_look_up_symbols): Update all debugging printfs to use
	debug_printf instead of fprintf.

	doc/
	* gdb.texinfo (Server): Mention --debug-format=all|none|timestamp.
	(gdbserver man): Ditto.

	testsuite/
	* gdb.server/server-mon.exp: Add tests for "set debug-format".
2014-01-22 14:17:39 -08:00
Tom Tromey 0080a2f671 stdlib.h is universal too
stdlib.h is universal as well, so there is no need to check for it.

2013-11-18  Tom Tromey  <tromey@redhat.com>

	* configure: Rebuild.
	* configure.ac: Don't check for stdlib.h
	* defs.h: Include stdlib.h unconditionally.

2013-11-18  Tom Tromey  <tromey@redhat.com>

	* configure: Rebuild.
	* configure.ac: Don't check for stdlib.h.
	* gdbreplay.c: Unconditionally include stdlib.h.
2013-11-18 13:29:02 -07:00
Tom Tromey 2978b11100 remove gdb_dirent.h
This removes gdb_dirent.h and updates the code to use dirent.h
instead.  It also removes the now-useless configure checks.

2013-11-18  Tom Tromey  <tromey@redhat.com>

	* common/common.m4 (GDB_AC_COMMON): Don't use AC_HEADER_DIRENT.
	* common/gdb_dirent.h: Remove.
	* common/filestuff.c: Use dirent.h.
	* common/linux-osdata.c: Use dirent.h.
	(NAMELEN): Define.
	* config.in: Rebuild.
	* configure: Rebuild.
	* configure.ac: Don't use AC_HEADER_DIRENT.
	* linux-fork.c: Use dirent.h
	* linux-nat.c: Use dirent.h.
	* nto-procfs.c: Use dirent.h.
	* procfs.c: Use dirent.h.

2013-11-18  Tom Tromey  <tromey@redhat.com>

	* config.in: Rebuild.
	* configure: Rebuild.
	* configure.ac: Don't use AC_HEADER_DIRENT.
2013-11-18 13:29:01 -07:00
Tom Tromey a3d08894e5 don't check for string.h or strings.h
Now that we are using the gnulib string.h module, we don't need to
check for string.h or strings.h.  This removes the last few checks
from the source and from the configure scripts.

2013-11-18  Tom Tromey  <tromey@redhat.com>

	* configure: Rebuild.
	* common/common.m4 (GDB_AC_COMMON): Don't check for string.h or
	strings.h.

2013-11-18  Tom Tromey  <tromey@redhat.com>

	* server.h: Don't check HAVE_STRING_H.
	* gdbreplay.c: Don't check HAVE_STRING_H.
	* configure: Rebuild.
2013-11-18 13:29:01 -07:00
Tom Tromey 1bd2f0baf1 remove unused gdbserver configury
This updates gdbserver's configure.ac to remove checks that aren't
directly needed by gdbserver.

2013-11-08  Tom Tromey  <tromey@redhat.com>

	* configure, config.in: Rebuild.
	* configure.ac: Remove unused configury.
2013-11-08 12:30:25 -07:00
Tom Tromey 3266f10be2 introduce common.m4
It has bothered me for a while that files in common/ use macros
defined via autoconf checks, but rely on each configure.ac doing the
proper checks independently.

This patch introduces common/common.m4 which consolidates the checks
assumed by code in common.

The rule I propose is that if something is needed or used by common,
it should be checked for by common.m4.  However, if the check is also
needed by gdb or gdbserver, then it should be duplicated there.

Built and regtested on x86-64 Fedora 18 (though this is hardly the
most strenuous case) and using the Fedora 18 mingw cross compilers.  I
also examined the config.in diffs to ensure that symbols did not go
missing.

2013-11-08  Tom Tromey  <tromey@redhat.com>

	* acinclude.m4: Include common.m4.
	* common/common.m4: New file.
	* configure, config.in: Rebuild.
	* configure.ac: Use GDB_AC_COMMON.

2013-11-08  Tom Tromey  <tromey@redhat.com>

	* acinclude.m4: Include common.m4, codeset.m4.
	* configure, config.in: Rebuild.
	* configure.ac: Use GDB_AC_COMMON.
2013-11-08 12:29:26 -07:00
Mike Frysinger 5b4e221c82 gdb: btrace: fix build errors on older glibc builds
It is possible to have a build of glibc where SYS_perf_event_open is not
defined (because when the glibc was compiled, the syscall did not exist),
but have newer kernel headers installed so that linux/perf_event.h is
available.  In this setup, you get a build failure:

./common/linux-btrace.c: In function 'kernel_supports_btrace':
./common/linux-btrace.c:316:23: error: 'SYS_perf_event_open' undeclared (first use in this function)

Update the ifdef check to also see if the syscall is available.

URL: https://bugs.gentoo.org/473522
Reported-by: William Throwe <wtt6@cornell.edu>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2013-09-29 03:57:34 +00:00
Yao Qi bd88542004 gdb/
2013-07-04  Yao Qi  <yao@codesourcery.com>

	Revert:
	2013-06-27  Yao Qi  <yao@codesourcery.com>

	* common/create-version.sh: Update comments.  Handle the case
	that TARGET_ALIAS is empty.

gdb/gdbserver/

2013-07-04  Yao Qi  <yao@codesourcery.com>

	* Makefile.in (host_alias): Use @host_noncanonical@.
	(target_alias): Use @target_noncanonical@.
	* configure.ac: Use ACX_NONCANONICAL_TARGET and
	ACX_NONCANONICAL_HOST.
	* configure: Regenerated.

	Revert:
	2013-06-28  Mircea Gherzan  <mircea.gherzan@intel.com>

	* configure.ac (version_host, version_target): Set and AC_SUBST them.
	* configure: Rebuild.
	* Makefile.in (version_host, version_target): Get from configure.
	(version.c): Use $(version_host) and $(version_target).
2013-07-04 01:22:38 +00:00
Pedro Alves 17ef446eed On mainline/development, also link GDBserver with -lmcheck.
This factors --enable-libmcheck related bits from GDB's configure.ac
and makes GDBserver use them too.  Specifically, the 'development'
global is moved to a separate script to it can be sourced by both GDB
and GDBserver, and the --enable-libmcheck/--disable-libmcheck bits
proper are moved to a new m4 file.

I started out by defining 'development' in the m4 file, but in the end
decided against it, as a separate script has the advantage that
changing it in release branches does not require regenerating
configure, unlike today.

I had also started out by making the new GDB_AC_LIBMCHECK itself
handle the yes/no default fallback depending on release/developement,
but since I had split out 'development' to a separate script, and, GDB
needs the python checks anyway (hence we'd need to do the python
checks in gdb's configure.ac, and pass in a 'default lmcheck yes/no'
parameter to GDB_AC_LIBMCHECK anyway), I ended up keeping
GDB_AC_LIBMCHECK isolated from the 'development' global.  IOW, it's
the caller's business to handle it.

Tested on x86_64 Fedora 17.  Built GDB and GDBserver with and without
--enable-libmcheck, and observed --enable-libmcheck overrides the
disablement of -lmcheck caused by python supporting threads, and that
GDBserver links with -lmcheck when expected.  Also observed that
changing the 'development' global, and issuing "make" triggers a
relink, and '-lmcheck' is included or not from the link accordingly.

gdb/
2013-07-03  Pedro Alves  <palves@redhat.com>

	* Makefile.in (config.status): Depend on development.sh.
	(aclocal_m4_deps): Add libmcheck.m4.
	* acinclude.m4: Include libmcheck.m4.
	* configure.ac: Source development.sh instead of setting
	'development' here.  --enable-libmcheck/--disable-libmcheck code
	factored out to GDB_AC_LIBMCHECK.  Run it.
	* development.sh: New file.
	* libmcheck.m4: New file.
	* configure: Regenerate.

gdb/gdbserver/
2013-07-03  Pedro Alves  <palves@redhat.com>

	* Makefile.in (config.status): Depend on development.sh.
	* acinclude.m4: Include libmcheck.m4.
	* configure: Regenerate.
2013-07-03 13:25:46 +00:00
Pedro Alves bc7dea8de9 Rely on gnulib's unistd.h replacement.
With gnulib's unistd module, we can assume unistd.h is always present, and that
STDIN_FILENO, STDOUT_FILENO, STDERR_FILENO are always defined.

Don't remove unistd.h from GDB's configure.ac, as later tests in the
file use HAVE_UNISTD_H checks.

gdb/
2013-07-01  Pedro Alves  <palves@redhat.com>

	* defs.h: Don't check HAVE_UNISTD_H before including <unistd.h>.
	(STDIN_FILENO, STDOUT_FILENO, STDERR_FILENO): Delete.
	* tracepoint.c: Don't check HAVE_UNISTD_H before including
	<unistd.h>.

gdb/gdbserver/
2013-07-01  Pedro Alves  <palves@redhat.com>

	* event-loop.c: Don't check HAVE_UNISTD_H before including
	<unistd.h>.
	* gdbreplay.c: Likewise.
	* remote-utils.c: Likewise.
	* server.c: Likewise.
	* configure.ac: Don't check for unistd.h.
	* configure: Regenerate.
2013-07-01 11:19:27 +00:00
Mircea Gherzan 257b6bec77 gdbserver: fix the standalone build
When directly invoking gdb/gdbserver/configure && make, the build will
fail because the $(host_alias) is empty and thus create-version.sh does
not get enough parameters.

The output of gdbserver --version without this patch (built like above):

  [...]
  This gdbserver was configured as ""

After applying this patch:

  [...]
  This gdbserver was configured as "x86_64-unknown-linux-gnu"

2013-06-28  Mircea Gherzan  <mircea.gherzan@intel.com>

gdbserver:

	* configure.ac (version_host, version_target): Set and AC_SUBST
	them.
	* configure: Rebuild.
	* Makefile.in (version_host, version_target): Get from
	configure.
	(version.c): Use $(version_host) and $(version_target).

Change-Id: Id48240532ad3d624ec78867a6db5ebd4c09583ff
Signed-off-by: Mircea Gherzan <mircea.gherzan@intel.com>
2013-06-28 12:29:15 +00:00
Tom Tromey 614c279dda PR gdb/7912:
* Makefile.in (SFILES): Add filestuff.c
	(COMMON_OBS): Add filestuff.o.
	(filestuff.o): New target.
	* auto-load.c (auto_load_objfile_script_1): Use
	gdb_fopen_cloexec.
	* auxv.c (procfs_xfer_auxv): Use gdb_open_cloexec.
	* cli/cli-cmds.c (shell_escape): Call close_most_fds.
	* cli/cli-dump.c (fopen_with_cleanup): Use gdb_fopen_cloexec.
	* common/agent.c (gdb_connect_sync_socket): Use
	gdb_socket_cloexec.
	* common/filestuff.c: New file.
	* common/filestuff.h: New file.
	* common/linux-osdata.c (linux_common_core_of_thread)
	(command_from_pid, commandline_from_pid, print_source_lines)
	(linux_xfer_osdata_shm, linux_xfer_osdata_sem)
	(linux_xfer_osdata_msg, linux_xfer_osdata_modules): Use
	gdb_fopen_cloexec.
	* common/linux-procfs.c (linux_proc_get_int)
	(linux_proc_pid_has_state): Use gdb_fopen_cloexec.
	* config.in, configure: Rebuild.
	* configure.ac: Don't check for sys/socket.h.  Check for
	fdwalk, pipe2.
	* corelow.c (core_open): Use gdb_open_cloexec.
	* dwarf2read.c (write_psymtabs_to_index): Use gdb_fopen_cloexec.
	* fork-child.c (fork_inferior): Call close_most_fds.
	* gdb_bfd.c (gdb_bfd_open): Use gdb_open_cloexec.
	* inf-child.c (inf_child_fileio_readlink): Use gdb_open_cloexec.
	* linux-nat.c (linux_nat_thread_name, linux_proc_pending_signals):
	Use gdb_fopen_cloexec.
	(linux_proc_xfer_partial, linux_proc_xfer_spu): Use
	gdb_open_cloexec.
	(linux_async_pipe): Use gdb_pipe_cloexec.
	* remote-fileio.c (remote_fileio_func_open): Use
	gdb_open_cloexec.
	* remote.c (remote_file_put, remote_file_get): Use
	gdb_fopen_cloexec.
	* ser-pipe.c (pipe_open): Use gdb_socketpair_cloexec,
	close_most_fds.
	* ser-tcp.c (net_open): Use gdb_socket_cloexec.
	* ser-unix.c (hardwire_open): Use gdb_open_cloexec.
	* solib.c (solib_find): Use gdb_open_cloexec.
	* source.c (openp, find_and_open_source): Use gdb_open_cloexec.
	* tracepoint.c (tfile_start): Use gdb_fopen_cloexec.
	(tfile_open): Use gdb_open_cloexec.
	* tui/tui-io.c (tui_initialize_io): Use gdb_pipe_cloexec.
	* ui-file.c (gdb_fopen): Use gdb_fopen_cloexec.
	* xml-support.c (xml_fetch_content_from_file): Use
	gdb_fopen_cloexec.
	* main.c (captured_main): Call notice_open_fds.
gdbserver
	* Makefile.in (SFILES): Add filestuff.c.
	(OBS): Add filestuff.o.
	(filestuff.o): New target.
	* config.in, configure: Rebuild.
	* configure.ac: Check for fdwalk, pipe2.
2013-04-22 16:46:15 +00:00
Pedro Alves 7d4e5717e0 Use AC_DEFINE for USE_THREAD_DB
Use AC_DEFINE for USE_THREAD_DB instead of manually passing it down
through -D flags.

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

	* configure.ac (USE_THREAD_DB): Delete variable.
	(if test "$srv_linux_thread_db" = "yes"): AC_DEFINE USE_THREAD_DB.
	Don't AC_SUBST USE_THREAD_DB.
	* Makefile.in (INTERNAL_CFLAGS): Remove @USE_THREAD_DB@.
	* config.in, configure: Regenerate.
2013-04-17 09:58:15 +00:00
Markus Metzger 9accd112a6 Add the gdb remote target operations for branch tracing.
We define the following packets:

  Qbtrace:bts         enable branch tracing for the current thread
                      returns "OK" or "Enn"

  Qbtrace:off         disable branch tracing for the current thread
                      returns "OK" or "Enn"

  qXfer:btrace:read   read the full branch trace data for the current thread

gdb/
	* target.h (enum target_object): Add TARGET_OBJECT_BTRACE.
	* remote.c: Include btrace.h.
	(struct btrace_target_info): New struct.
	(remote_supports_btrace): New function.
	(send_Qbtrace): New function.
	(remote_enable_btrace): New function.
	(remote_disable_btrace): New function.
	(remote_teardown_btrace): New function.
	(remote_read_btrace): New function.
	(init_remote_ops): Add btrace ops.
	(enum <unnamed>): Add btrace packets.
	(struct protocol_feature remote_protocol_features[]): Add btrace packets.
	(_initialize_remote): Add packet configuration for branch tracing.

gdbserver/
	* target.h (struct target_ops): Add btrace ops.
	(target_supports_btrace): New macro.
	(target_enable_btrace): New macro.
	(target_disable_btrace): New macro.
	(target_read_btrace): New macro.
	* gdbthread.h (struct thread_info): Add btrace field.
	* server.c: Include btrace-common.h.
	(handle_btrace_general_set): New function.
	(handle_btrace_enable): New function.
	(handle_btrace_disable): New function.
	(handle_general_set): Call handle_btrace_general_set.
	(handle_qxfer_btrace): New function.
	(struct qxfer qxfer_packets[]): Add btrace entry.
	* inferiors.c (remove_thread): Disable btrace.
	* linux-low: Include linux-btrace.h.
	(linux_low_enable_btrace): New function.
	(linux_low_read_btrace): New function.
	(linux_target_ops): Add btrace ops.
	* configure.srv (i[34567]86-*-linux*): Add linux-btrace.o.
	Add srv_linux_btrace=yes.
	(x86_64-*-linux*): Add linux-btrace.o.
	Add srv_linux_btrace=yes.
	* configure.ac: Define HAVE_LINUX_BTRACE.
	* config.in: Regenerated.
	* configure: Regenerated.
2013-03-11 08:35:11 +00:00
Tom Tromey 589bc9275a * configure.ac: Invoke AC_SYS_LARGEFILE.
* configure, config.in: Rebuild.
2013-02-28 16:51:19 +00:00
Tom Tromey 61c125b91f * Makefile.in (DEPMODE, DEPDIR, depcomp, COMPILE.pre)
(COMPILE.post, COMPILE, POSTCOMPILE, IPAGENT_COMPILE): New
	macros.
	(.c.o): Rewrite.
	(ax-ipa.o, tracepoint-ipa.o, utils-ipa.o, format-ipa.o)
	(common-utils-ipa.o, remote-utils-ipa.o, regcache-ipa.o)
	(i386-linux-ipa.o, linux-i386-ipa.o, linux-amd64-ipa.o)
	(amd64-linux-ipa.o, ax.o): Rewrite.
	(event-loop.o, hostio.o, hostio-errno.o, inferiors.o, mem-break.o)
	(proc-service.o, regcache.o, remote-utils.o, server.o, target.o)
	(thread-db.o, tracepoint.o, utils.o, gdbreplay.o, dll.o): Remove.
	(signals.o, linux-procfs.o, linux-ptrace.o, common-utils.o, vec.o)
	(gdb_vecs.o, xml-utils.o, linux-osdata.o, ptid.o, buffer.o)
	(format.o, agent.o, vasprintf.o, vsnprintf.o): Rewrite.
	(i386-low.o, i387-fp.o, linux-low.o, linux-arm-low.o)
	(linux-bfin-low.o, linux-cris-low.o, linux-crisv32-low.o)
	(linux-ia64-low.o, linux-m32r-low.o, linux-mips-low.o)
	(linux-ppc-low.o, linux-s390-low.o, linux-sh-low.o)
	(linux-tic6x-low.o, linux-x86-low.o, linux-xtensa-low.o)
	(linux-tile-low.o, lynx-low.o, lynx-ppc-low.o, nto-low.o)
	(nto-x86-low.o, linux-low.o, win32-low.o, win32-arm-low.o)
	(win32-i386-low.o, spu-low.o, reg-arm.o, arm-with-iwmmxt.o)
	(arm-with-vfpv2.o, arm-with-vfpv3.o, arm-with-neon.o, reg-bfin.o)
	(reg-cris.o, reg-crisv32.o, i386.o, i386-linux.o, i386-avx.o)
	(i386-avx-linux.o, i386-mmx.o, i386-mmx-linux.o, reg-ia64.o)
	(reg-m32r.o, reg-m68k.o, reg-cf.o, mips-linux.o, mips-dsp-linux.o)
	(mips64-linux.o, mips64-dsp-linux.o, powerpc-32.o, powerpc-32l.o)
	(powerpc-altivec32l.o, powerpc-cell32l.o, powerpc-vsx32l.o)
	(powerpc-isa205-32l.o, powerpc-isa205-altivec32l.o)
	(powerpc-isa205-vsx32l.o, powerpc-e500l.o, powerpc-64l.o)
	(powerpc-altivec64l.o, powerpc-cell64l.o, powerpc-vsx64l.o)
	(powerpc-isa205-64l.o, powerpc-isa205-altivec64l.o)
	(powerpc-isa205-vsx64l.o, s390-linux32.o, s390-linux32v1.o)
	(s390-linux32v2.o, s390-linux64.o, s390-linux64v1.o)
	(s390-linux64v2.o, s390x-linux64.o, s390x-linux64v1.o)
	(s390x-linux64v2.o, tic6x-c64xp-linux.o, tic6x-c64x-linux.o)
	(tic6x-c62x-linux.o, reg-sh.o, reg-sparc64.o, reg-spu.o, amd64.o)
	(amd64-linux.o, amd64-avx.o, amd64-avx-linux.o, x32.o)
	(x32-linux.o, x32-avx.o, x32-avx-linux.o, reg-xtensa.o)
	(reg-tilegx.o): Remove.
	(all_object_files): New macro.
	Include .deps files.
	* aclocal.m4, configure: Rebuild.
	* acinclude.m4: Include depstand.m4, lead-dot.m4.
	* configure.ac: Invoke ZW_CREATE_DEPDIR,
	ZW_PROG_COMPILER_DEPENDENCIES.  Compute GMAKE condition.
2012-12-10 20:16:14 +00:00
Markus Metzger 945bf71318 2012-11-28 Markus Metzger <markus.t.metzger@intel.com>
gdb/
	* configure.ac: Check for linux/perf_event.h.
	* config.in: Regenerated.
	* configure: Regenerated.

gdb/gdbserver/
	* configure.ac: Check for linux/perf_event.h.
	* config.in: Regenerated.
	* configure: Regenerated.
2012-11-28 16:21:58 +00:00
Yao Qi 8c29b58e98 gdb/gdbserver/
2012-11-26  Yao Qi  <yao@codesourcery.com>

	* configure.ac (build_warnings): Append '-Wempty-body'.
	* configure: Regenerated.
	* linux-low.c (linux_create_inferior): Use braces for empty 'if'
	body.
2012-11-26 13:30:07 +00:00
Pierre Muller 8bdce1ffdf 2012-11-15 Pierre Muller <muller@sourceware.org>
ARI fixes: move gdb_wait and gdb_stat headers to common subdirectory.
	* gdb_stat.h: Delete. Moved to common directory.
	* common/gdb_stat.h: New file.
	* gdb_wait.h: Delete. Moved to common directory.
	* common/gdb_wait.h: New file.
	* Makefile.in (H_FILES_NO_SRC): Adapt to new header
	location.
	* contrib/ari/gdb_ari.sh (wait.h rule): Adapt to new gdb_wait.h
	location.
	(stat.h rule): Adapt to new gdb_stat.h location.
	* common/linux-osdata.c: Include "gdb_stat.h" header instead of
	<sys/stat.h> header.
	* common/linux-ptrace.c: Include "gdb_wait.h" header instead of
	<sys/wait.h> header.


gdbserver ChangeLog entry:

2012-11-15  Pierre Muller  <muller@sourceware.org>

	* configure.ac (AC_CHECK_HEADERS): Add wait.h header.
	* config.in: Regenerate.
	* configure: Regenerate.
	* linux-low.c: Use "gdb_stat.h" header instead of <sys/stat.h> header.
	Use "gdb_wait.h" header instead of <sys/wait.h> header.
	* lynx-low.c: Use "gdb_wait.h" header instead of <sys/wait.h> header.
	* remote-utils.c: Use "gdb_stat.h" header instead of <sys/stat.h>
	header.
	* server.c: Remove HAVE_WAIT_H conditional.  Use "gdb_wait.h" header
	instead of <sys/wait.h> header.
	* spu-low.c: Use "gdb_wait.h" header instead of <sys/wait.h> header.
2012-11-15 16:12:19 +00:00
Doug Evans e6712ff1b5 * gdb_string.h: Moved to ...
* common/gdb_string.h: ... here.
	* common/vec.h: Remove #ifndef GDBSERVER conditional inclusion of
	gdb_string.h and gdb_assert.h.

	gdbserver/
	* configure.ac: Add check for strstr.
	* config.in: Regenerate.
	* configure: Regenerate.

	* linux-thread-db.c: #include "gdb_vecs.h".
	(try_thread_db_load_from_pdir_1): New arg "subdir".  All callers
	updated.
	(try_thread_db_load_from_pdir): New arg "subdir".  All callers updated.
	(thread_db_load_search): Use a vector to iterate over path elements.
	Handle text appearing after "$pdir".

	gdbserver/
	* Makefile.in (SFILES): Add gdb_vecs.c.
	(OBS): Add gdb_vecs.o.
	(gdb_vecs_h, host_defs_h): New variables.
	(thread-db.o): Add $(gdb_vecs_h) dependency.
	(gdb_vecs.o): New rule.
	* thread-db.c: #include "gdb_vecs.h".
	(thread_db_load_search): Use a vector to iterate over path elements.
	Handle text appearing after "$pdir".
2012-08-08 19:48:19 +00:00
Pedro Alves 38ea300a20 2012-04-20 Pedro Alves <palves@redhat.com>
gdb/
	* acx_configure_dir.m4 (ACX_CONFIGURE_DIR): Handle absolute
	$srcdir.
	* configure: Regenerate.

	gdb/gdbserver/
	* configure: Regenerate.
2012-04-20 17:58:49 +00:00
Pedro Alves c971b7fa72 2012-04-19 Pedro Alves <palves@redhat.com>
gdb/
	* Makefile.in (GNULIB_BUILDDIR): New.
	(LIBGNU, INCGNU, GNULIB_H): Adjust.
	(SUBDIRS): Add $(GNULIB_BUILDDIR).
	(CLEANDIRS). Remove gnulib/import.
	(REQUIRED_SUBDIRS): Replace gnulib/import with $(GNULIB_BUILDDIR).
	(all-lib): Ditto.
	(distclean): Remove the $(GNULIB_BUILDDIR) directory.
	(gnulib/import/Makefile): Replace gnulib/import with
	$(GNULIB_BUILDDIR).  Set CONFIG_FILES to just Makefile.
	(ACLOCAL_AMFLAGS): Remove '-I gnulib/import/m4'.
	(aclocal_m4_deps): Remove the gnulib dependencies.  Add
	acx_configure_dir.m4.
	* acinclude.m4: Include acx_configure_dir.m4.
	* acx_configure_dir.m4: New file.
	* aclocal.m4: Regenerate.
        * configure.ac: Remove gl_EARLY, gl_INIT and AM_INIT_AUTOMAKE
        calls.  Configure gnulib using ACX_CONFIGURE_DIR.
        (GNULIB): New variable.
        (GNULIB_STDINT_H): Adjust.
        (AC_OUTPUT): Don't output gnulib/Makefile.
        * gdb/defs.h: Include build-gnulib/config.h.
        * aclocal.m4: Regenerate.
        * config.in: Regenerate.
        * configure: Regenerate.

        * gnulib/Makefile.in: New file.
        * gnulib/configure.ac: New file.
        * gnulib/aclocal.m4: New file.
        * gnulib/config.in: New file.
        * gnulib/configure: New file.
	* gnulib/: Re-run gnulib-tool to adjust.

        gdb/gdbserver/
        * Makefile.in (GNULIB_BUILDDIR): New.
	(LIBGNU, INCGNU, GNULIB_H): Adjust.
        (SUBDIRS, CLEANDIRS, REQUIRED_SUBDIRS): New.
        (all, install-only, uninstall, clean-info, all-lib, clean): No
        longer pass GNULIB_FLAGS_TO_PASS.  Use subdir_do.
        (maintainer-clean realclean distclean): Use subdir_do.
        (subdir_do): New.
        (gnulib/import/Makefile): Adjust.  Replace gnulib/import with
	$(GNULIB_BUILDDIR).  Don't pass argument to config.status.
        * acinclude.m4: Include acx_configure_dir.m4.
        * configure.ac: Remove gl_EARLY, gl_INIT, and AM_INIT_AUTOMAKE
        calls.  Call AC_PROG_RANLIB.  Configure gnulib using
        ACX_CONFIGURE_DIR.
        (GNULIB): New.
        (GNULIB_STDINT_H): Adjust.
        (AC_OUTPUT): Don't output gnulib/Makefile anymore.
        * gdbreplay.c: Include build-gnulib/config.h.
        * server.h: Likewise.
        * aclocal.m4: Regenerate.
        * config.in: Regenerate.
        * configure: Regenerate.
2012-04-19 19:34:52 +00:00
Pedro Alves 809277f8ce 2012-04-19 Pedro Alves <palves@redhat.com>
gdb/
	* gnulib/: Move whole directory ...
	* gnulib/import/: ... here, and re-rerun gnulib-tool to adjust.
	* Makefile.in (LIBGNU, INCGNU, GNULIB_H, CLEANDIRS)
	(REQUIRED_SUBDIRS, all-lib, gnulib/Makefile, ACLOCAL_AMFLAGS)
	(aclocal_m4_deps): Adjust.
	* aclocal.m4: Regenerate.
	* configure: Regenerate.
	* configure.ac: Adjust AC_OUTPUT output.

	gdbserver/
	* Makefile.in (LIBGNU, INCGNU): Adjust.
	(GNULIB_FLAGS_TO_PASS, GNULIB_H): Adjust.
	(all, install-only, uninstall, clean-info, all-lib, clean)
	(maintainer-clean, Makefile, gnulib/Makefile): Adjust.
	* configure.ac: Adjust AC_OUTPUT output.
	* aclocal.m4: Regenerate.
	* configure: Regenerate.
2012-04-19 15:27:52 +00:00
Pedro Alves 447d431953 2012-04-19 Pedro Alves <palves@redhat.com>
* configure.ac: Remove AC_CHECK_DECLS check for memmem.
	* server.h (memmem): Remove declaration.
	* config.in: Regenerate.
	* configure: Regenerate.
2012-04-19 10:23:03 +00:00
Pedro Alves 770d76d7b2 2012-04-18 Pedro Alves <palves@redhat.com>
Update gnulib from latest git.
	(639ea5ae15e39fe48d43e04864b2997301e4b969)

	* gnulib/Makefile.am: Update.
	* gnulib/dummy.c: Update.
	* gnulib/extra/arg-nonnull.h: Update.
	* gnulib/extra/c++defs.h: Update.
	* gnulib/extra/update-copyright: Update.
	* gnulib/extra/warn-on-use.h: Update.
	* gnulib/inttypes.in.h: Update.
	* gnulib/m4/00gnulib.m4: Update.
	* gnulib/m4/extensions.m4: Update.
	* gnulib/m4/gnulib-cache.m4: Update.
	* gnulib/m4/gnulib-common.m4: Update.
	* gnulib/m4/gnulib-comp.m4: Update.
	* gnulib/m4/gnulib-tool.m4: Update.
	* gnulib/m4/include_next.m4: Update.
	* gnulib/m4/inttypes-pri.m4: Update.
	* gnulib/m4/inttypes.m4: Update.
	* gnulib/m4/longlong.m4: Update.
	* gnulib/m4/memchr.m4: Update.
	* gnulib/m4/memmem.m4: Update.
	* gnulib/m4/mmap-anon.m4: Update.
	* gnulib/m4/multiarch.m4: Update.
	* gnulib/m4/onceonly.m4: Update.
	* gnulib/m4/stddef_h.m4: Update.
	* gnulib/m4/stdint.m4: Update.
	* gnulib/m4/string_h.m4: Update.
	* gnulib/m4/warn-on-use.m4: Update.
	* gnulib/m4/wchar_h.m4: Update.
	* gnulib/m4/wchar_t.m4: Update.
	* gnulib/m4/wint_t.m4: Update.
	* gnulib/memchr.c: Update.
	* gnulib/memmem.c: Update.
	* gnulib/stddef.in.h: Update.
	* gnulib/stdint.in.h: Update.
	* gnulib/str-two-way.h: Update.
	* gnulib/string.in.h: Update.
	* gnulib/wchar.in.h: Update.

	* gnulib/extra/arg-nonnull.h: Delete.
	* gnulib/extra/c++defs.h: Delete.
	* gnulib/extra/warn-on-use.h: Delete.
	* gnulib/m4/wchar_h.m4: Delete.
	* gnulib/m4/wint_t.m4: Delete.
	* gnulib/wchar.in.h: Delete.

	* gnulib/extra/snippets/arg-nonnull.h: New.
	* gnulib/extra/snippets/c++defs.h: New.
	* gnulib/extra/snippets/warn-on-use.h: New.

	* aclocal.m4: Regenerate.
	* config.in: Regenerate.
	* configure: Regenerate.
	* gnulib/Makefile.in: Regenerate.

	* gdbserver/aclocal.m4: Regenerate.
	* gdbserver/config.in: Regenerate.
	* gdbserver/configure: Regenerate.
2012-04-18 20:45:25 +00:00
Yao Qi 55a8c0761d gdb/
Import gnulib module inttypes from git
	(250b80067c1e1d8faa0c42fb572f721975b929c5)
	* Makefile.in (HFILES_NO_SRCDIR): Add gnulib/inttypes.in.h.
	(aclocal_m4_deps): Add gnulib/m4/inttypes.m4 and gnulib/m4/inttypes-pri.m4
	* aclocal.m4, config.in, configure: Regenerated.
	* gnulib/Makefile.am: Update.
	* gnulib/Makefile.in: Update.
	* gnulib/m4/gnulib-cache.m4: Update.
	* gnulib/m4/gnulib-comp.m4: Update.
	* gnulib/inttypes.in.h: New.
	* gnulib/m4/inttypes-pri.m4: New.
 	* gnulib/m4/inttypes.m4: New.

gdb/gdbserver/
	Import gnulib module inttypes.
	* aclocal.m4, config.in, configure: Regenerated.
2012-04-14 05:24:57 +00:00
Thiago Jung Bauermann 18f5fd8146 * acinclude.m4 (GDBSERVER_HAVE_THREAD_DB_TYPE): New macro based
on BFD_HAVE_SYS_PROCFS_TYPE.
	* configure.ac: Look for lwpid_t and psaddr_t in libthread_db.h.
	* configure: Regenerate.
	* config.in: Likewise.
2012-04-13 19:56:05 +00:00
Yao Qi c9a1864ab2 gdb/gdbserver/
* Makefile.in: Define abs_top_srcdir and abs_srcdir.
	(INCLUDE_CFLAGS): Append GNULIB_INCLUDE_DIR.
	(install-only, install-info, clean): Handle sub dir gnulib.
	(all-lib, am--refresh): New targets.
	(memmem.o): Remove target.
	* configure.ac: Remove AC_CONFIG_LIBOBJ_DIR.
	Invoke gl_EARLY.  Invoke AC_CHECK_PROGS for make.
	(AC_REPLACE_FUNCS): Remove memmem.
	Invoke gl_INIT and AM_INIT_AUTOMAKE.
	(AC_OUTPUT): Generate Makefile in gnulib/.
	* aclocal.m4, config.in, configure: Regenerated.
2012-04-12 11:11:01 +00:00
Thiago Jung Bauermann 8365dcf5f8 * configure.ac: Check whether Elf32_auxv_t and Elf64_auxv_t
are available.
	* linux-low.c [HAVE_ELF32_AUXV_T] (Elf32_auxv_t): Add typedef.
	[HAVE_ELF64_AUXV_T] (Elf64_auxv_t): Likewise.
	* config.in: Regenerate.
	* configure: Likewise.
2012-03-30 20:23:16 +00:00
Yao Qi 2fa291aca4 gdb:
* common/agent.c: New.
	* common/agent.h: New.
	* configure.ac: Add `sys/socket.h' and `sys/un.h' to
	AC_CHECK_HEADERS.
	* configure, configh.in: Regenerated.

gdb/gdbserver:

	* Makefile.in (OBS): Add agent.o.
	Add new rule for agent.o.
	Track dependence of tracepoint.c on agent.h.
	* tracepoint.c (run_inferior_command_1):
	(run_inferior_command): Call agent_run_command.
	(gdb_ust_connect_sync_socket): Deleted.  Move it to
	common/agent.c.
	(resume_thread, stop_thread): Likewise.
	(gdb_ust_socket_init): Renamed to ...
	(gdb_agent_socket_init): ... New.
	(gdb_ust_thread): Renamed to ...
	(gdb_agent_helper_thread): ... New.
	(gdb_ust_init): Move some code to ...
	(gdb_agent_init): ... here.  New.
	[HAVE_UST]: Call gdb_ust_init.
	(initialize_tracepoint_ftlib):  Call gdb_agent_init.
	* configure.ac: Add `sys/un.h' to AC_CHECK_HEADERS.
	* config.in, configure: Regenerated.
2012-03-03 03:08:36 +00:00
Joel Brobecker f8255c2a40 [gdbserver] return ENOSYS if readlink not supported.
This reproduces on the GDBserver side what GDB does when readlink is
not supported.

gdb/gdbserver/ChangeLog:

        * configure.ac: Add readlink to AC_CHECK_FUNCS list.
        * configure, config.in: Regenerate.
        * hostio.c: Provide an alternate implementation if HAVE_READLINK
        is not defined.
2012-02-09 17:29:34 +00:00
Ulrich Weigand 03583c206f * inferior.h (disable_randomization): Declare.
* infrun.c (disable_randomization): New global variable.
	(show_disable_randomization): New function.
	(set_disable_randomization): Likewise.
	(_initialize_infrun): Install set/show disable-randomization
	commands.
	* linux-nat.c (disable_randomization): Remove.
	(show_disable_randomization): Likewise.
	(set_disable_randomization): Likewise.
	(_initialize_linux_nat): No longer install set/show
	disable-randomization commands here.
	(linux_nat_supports_disable_randomization): New function.
	(linux_nat_add_target): Install it.
	* remote.c (PACKET_QDisableRandomization): New enum value.
	(remote_protocol_packets): Support QDisableRandomization.
	(_initialize_remote): Likewise.
	(remote_supports_disable_randomization): New function.
	(init_remote_ops): Install it.
	(extended_remote_supports_disable_randomization): New function.
	(init_extended_remote_ops): Install it.
	(extended_remote_disable_randomization): New function.
	(extended_remote_create_inferior_1): Call it.
	* target.h (struct target_ops): Add to_supports_disable_randomization.
	(target_supports_disable_randomization): Add prototype.
	* target.c (target_supports_disable_randomization): New function.
	(find_default_supports_disable_randomization): Likewise.
	(init_dummy_target): Install it.

doc/
	* gdb.texinfo (Starting your Program): "set disable-randomization"
	is no longer Linux-specific.
	(Remote Configuration): Document "set remote
	disable-randomization-packet".
	(General Query Packets): Document "QDisableRandomization" packet
	and add it to "qSupported" list.

gdbserver/
	* configure.ac: Check support for personality routine.
	* configure: Regenerate.
	* config.in: Likewise.
	* linux-low.c: Include <sys/personality.h>.
	Define ADDR_NO_RANDOMIZE if necessary.
	(linux_create_inferior): Disable address space randomization when
	forking inferior, if requested.
	(linux_supports_disable_randomization): New function.
	(linux_target_ops): Install it.
	* server.h (disable_randomization): Declare.
	* server.c (disable_randomization): New global variable.
	(handle_general_set): Handle QDisableRandomization.
	(handle_query): Likewise for qSupported.
	(main): Support --disable-randomization and --no-disable-randomization
	command line arguments.
	* target.h (struct target_ops): Add supports_disable_randomization.
	(target_supports_disable_randomization): New macro.
2011-10-07 12:06:48 +00:00
Kwok Yeung d26e3629bb 2011-07-22 Kwok Cheung Yeung <kcy@codesourcery.com>
gdb/
	* defs.h: Add guard against inclusion in gdbserver.
	(struct ptid, ptid_t): Move to common/ptid.h.
	(xfree, xzalloc, xasprintf, xvasprintf, xstrprintf, xstrvprintf,
	xsnprintf, internal_error): Move to common/common-utils.h.
	(nomem): Delete.
	* gdb_assert.h: Move into common/ sub-directory.
	* gdb_locale.h: Ditto.
	* gdb_dirent.h: Ditto.
	* inferior.h (minus_one_ptid, null_ptid, ptid_build, pid_to_ptid,
	ptid_get_pid, ptid_get_lwp, ptid_get_tid, ptid_equal, ptid_is_pid):
	Move into common/ptid.h.
	* xml-support.c (xml_escape_text): Move into common/xml-utils.c.
	(gdb_xml_create_parser_and_cleanup_1, xml_fetch_context_from_file):
	Change nomem to malloc_failure.
	* xml-support.h (xml_escape_text): Move into common/xml-utils.h.
	* utils.c (nomem): Rename to malloc_failure.
	(xmalloc, xzalloc, xrealloc, xcalloc, xfree, xstrprintf, xasprintf,
	xvasprintf, xstrvprintf, xsnprintf): Move to common/common-utils.c.
	(gdb_buildargv): Change nomem to malloc_failure.
	* infrun.c (null_ptid, minus_one_ptid, ptid_build, pid_to_ptid,
	ptid_get_pid, ptid_get_lwp, ptid_get_tid, ptid_equal,
	ptid_is_pid): Move into common/ptid.c.
	(initialize_infrun): Delete initialization of null_ptid and
	minus_one_ptid.
	* linux-nat.c (linux_nat_xfer_osdata): Defer to
	linux_common_xfer_osdata.
	* Makefile.in (SFILES): Add common/common-utils.c, common/xml-utils.c,
	common/ptid.c and common/buffer.c.
	(HFILES_NO_SRCDIR): Add common/common-utils.h, common/xml-utils.h,
	common/ptid.h, common/buffer.h and common/linux-osdata.h.
	(COMMON_OBS): Add xml-utils.o, common-utils.o, buffer.o and ptid.o.
	(common-utils.o, xml-utils.o, ptid.o, buffer.o, linux-osdata.o): New
	rules.
	* common/gdb_assert.h: New.
	* common/gdb_dirent.h: New.
	* common/gdb_locale.h: New.
	* common/buffer.c: New.
	* common/buffer.h: New.
	* common/ptid.c: New.
	* common/ptid.h: New.
	* common/xml-utils.c: New.
	* common/xml-utils.h: New.
	* common/common-utils.c: New.
	* common/common-utils.h: New.
	* common/linux-osdata.c: New.
	* common/linux-osdata.h: New.
	* config/alpha/alpha-linux.mh (NATDEPFILES): Add linux-osdata.o.
	* config/arm/linux.mh (NATDEPFILES): Ditto.
	* config/i386/linux.mh (NATDEPFILES): Ditto.
	* config/i386/linux64.mh (NATDEPFILES): Ditto.
	* config/ia64/linux.mh (NATDEPFILES): Ditto.
	* config/m32r/linux.mh (NATDEPFILES): Ditto.
	* config/m68k/linux.mh (NATDEPFILES): Ditto.
	* config/mips/linux.mh (NATDEPFILES): Ditto.
	* config/pa/linux.mh (NATDEPFILES): Ditto.
	* config/powerpc/linux.mh (NATDEPFILES): Ditto.
	* config/powerpc/ppc64-linux.mh (NATDEPFILES): Ditto.
	* config/s390/s390.mh (NATDEPFILES): Ditto.
	* config/sparc/linux.mh (NATDEPFILES): Ditto.
	* config/sparc/linux64.mh (NATDEPFILES): Ditto.
	* config/xtensa/linux.mh (NATDEPFILES): Ditto.

gdbserver/
	* linux-low.c (compare_ints, unique, list_threads, show_process,
	linux_core_of_thread): Delete.
	(linux_target_ops): Change linux_core_of_thread to
	linux_common_core_of_thread.
	(linux_qxfer_osdata): Defer to linux_common_xfer_osdata.
	* utils.c (malloc_failure): Change type of argument.
	(xmalloc, xrealloc, xcalloc, xsnprintf): Delete.
	* Makefile.in (SFILES): Add common/common-utils.c, common/xml-utils.c,
	common/linux-osdata.c, common/ptid.c and common/buffer.c.
	(OBS): Add xml-utils.o, common-utils.o, ptid.o and buffer.o.
	(IPA_OBJS): Add common-utils-ipa.o.
	(ptid_h, linux_osdata_h): New macros.
	(server_h): Add common/common-utils.h, common/xml-utils.h,
	common/buffer.h, common/gdb_assert.h, common/gdb_locale.h and
	common/ptid.h.
	(common-utils-ipa.o, common-utils.o, xml-utils.o, linux-osdata.o,
	ptid.o, buffer.o): New rules.
	(linux-low.o): Add common/linux-osdata.h as a dependency.
	* configure.srv (srv_tgtobj): Add linux-osdata.o to Linux targets.
	* configure.ac: Add AC_HEADER_DIRENT check.
	* config.in: Regenerate.
	* configure: Regenerate.
	* remote-utils.c (xml_escape_text): Delete.
	(buffer_grow, buffer_free, buffer_init, buffer_finish,
	buffer_xml_printf): Move to common/buffer.c.
	* server.c (main): Remove call to initialize_inferiors.
	* server.h (struct ptid, ptid_t, minus_one_ptid, null_ptid,
	ptid_build, pid_to_ptid, ptid_get_pid, ptid_get_lwp, ptid_get_tid,
	ptid_equal, ptid_is_pid, initialize_inferiors, xml_escape_text,
	internal_error, gdb_assert, gdb_assert_fail): Delete.
	(struct buffer, buffer_grow, buffer_free, buffer_init, buffer_finish,
	buffer_xml_printf, buffer_grow_str, buffer_grow_str0): Move to
	common/buffer.h.
	* inferiors.c (null_ptid, minus_one_ptid, ptid_build, pid_to_ptid,
	ptid_get_pid, ptid_get_lwp, ptid_get_tid, ptid_equal, ptid_is_pid,
	initialize_inferiors): Delete.
2011-07-21 23:46:12 +00:00
Yao Qi e637a4f593 gdb/
2011-03-09  Yao Qi  <yao@codesourcery.com>

	Revert:
	2011-02-11  Yao Qi  <yao@codesourcery.com>

	* common/Makefile.in: Add copyright header.

	2011-02-11  Yao Qi  <yao@codesourcery.com>

	* Makefile.in: Remove signals.o from COMMON_OBS.  Link
	libcommon.a.
	* configure.ac: Add common to sub dir.
	* configure: Regenerate.

gdb/gdbserver/
2011-03-09  Yao Qi  <yao@codesourcery.com>

	Revert:
	2011-03-04  Yao Qi  <yao@codesourcery.com>

	* Makefile.in: Remove GNU make feature --directory.

	2011-03-05  Yao Qi  <yao@codesourcery.com>

	* Makefile.in (CLEANDIRS, REQUIRED_SUBDIRS): New variable.
	(subdir_do): New make target.  Copied from gdb/Makefile.
	(maintainer-clean, realclean, distclean, clean): Call corresponding
	make targets in common/Makefile.

	2011-02-11  Yao Qi  <yao@codesourcery.com>

	* configure.ac: Call AC_PROG_RANLIB.
	* Makefile.in: Remove signals.o from OBS.  Link libcommon.a.
	* configure: Regenerate.
2011-03-09 06:10:40 +00:00
Yao Qi 4f3e6fb7a0 2011-02-11 Yao Qi <yao@codesourcery.com>
* Makefile.in: Remove signals.o from COMMON_OBS.  Link
	libcommon.a.
	* configure.ac: Add common to sub dir.
	* configure: Regenerate.

common/
2011-02-11  Yao Qi  <yao@codesourcery.com>

	Build libcommon.a.

	* Makefile.in: New.
	* configure.ac: New.
	* aclocal.m4: New.
	* configure: Generate.

gdbserver/
2011-02-11  Yao Qi  <yao@codesourcery.com>

	* configure.ac: Call AC_PROG_RANLIB.
	* Makefile.in: Remove signals.o from OBS.  Link libcommon.a.
	* configure: Regenerate.
2011-02-11 09:57:25 +00:00
Nathan Sidwell c2a66c29c9 * configure.ac: Add --enable-inprocess-agent option.
* configure: Rebuilt.
2010-09-09 13:16:38 +00:00
Joel Brobecker 8ed54b31b3 gdbserver support for powerpc-lynxos (4.x)
This patch adds support for powerpc-lynxos.

gdbserver/ChangeLog:

        * gdbserver/lynx-low.c, gdbserver/lynx-low.h,
        gdbserver/lynx-ppc-low.c: New files.
        * Makefile.in (lynx_low_h): New variable.
        (lynx-low.o, lynx-ppc-low.o): New rules.
        * configure.ac: On LynxOS, link with -lnetinet.
        * configure.srv: Add handling of powerpc-*-lynxos* targets.
        * configure: regenerate.
2010-09-01 18:57:12 +00:00
Joel Brobecker bb0116a433 Import vsnprintf from libiberty if not available.
vasprintf and vsnprintf are not available on LynxOS, at least not on
version 4.0.0.  This patch updates the configury to import them from
libiberty if not available out of the box.

gdbserver/
        * Makefile.in (vasprintf.o, vsnprintf.o): New rules.
        * configure.ac: Add check for vasprintf and vsnprintf.
        * configure, config.in: Regenerate.
        * server.h (vasprintf, vsnprintf): Add conditional declarations.
2010-09-01 18:56:45 +00:00
gdbadmin a1723c35ac include alloca.h if available.
On LynxOS, alloca is defined in allocal.h.  This fixes one warning that
occurs when building GDBserver for LynxOS.

gdb/gdbserver/ChangeLog:

        * configure.ac: Add configure check for alloca.
        * configure, config.in: Regenerate.
        * server.h: Include alloca.h if it exists.
        * gdbreplay.c: Include alloca.h if it exists.
2010-09-01 01:51:07 +00:00
Pedro Alves 854d88f03d * configure.ac (build_warnings): Add -Wno-char-subscripts.
* configure: Regenerate.
2010-08-27 10:20:07 +00:00
Pedro Alves d4596a3d79 * Makefile.in (WARN_CFLAGS): Get it from configure.
(WERROR_CFLAGS): New.
	(INTERNAL_CFLAGS): Add WERROR_CFLAGS.
	* configure.ac: Introduce --enable-werror, which adds -Werror to
	the compiler command line.  Enabled by default.  Disable with
	--disable-werror.  Add -Wdeclaration-after-statement
	Wpointer-arith and -Wformat-nonliteral to warning flags.
        * configure: Regenerate.
2010-08-26 18:03:02 +00:00
Pedro Alves 0fb4aa4bfc Static tracepoints support, and UST integration.
gdb/gdbserver/
	* configure.ac: Handle --with-ust.  substitute ustlibs and ustinc.
	* mem-break.c (uninsert_all_breakpoints)
	(reinsert_all_breakpoints): New.
	* mem-break.h (reinsert_all_breakpoints, uninsert_all_breakpoints):
	* tracepoint.c (ust_loaded, helper_thread_id, cmd_buf): New.
	(gdb_agent_ust_loaded, helper_thread_id)
	(gdb_agent_helper_thread_id): New macros.
	(struct ipa_sym_addresses): Add addr_ust_loaded,
	addr_helper_thread_id, addr_cmd_buf.
	(symbol_list): Add ust_loaded, helper_thread_id, cmd_buf.
	(in_process_agent_loaded_ust): New.
	(write_e_ust_not_loaded): New.
	(maybe_write_ipa_ust_not_loaded): New.
	(struct collect_static_trace_data_action): New.
	(enum tracepoint_type) <static_tracepoint>: New.
	(struct tracepoint) <handle>: Mention static tracepoints.
	(struct static_tracepoint_ctx): New.
	(CMD_BUF_SIZE): New.
	(add_tracepoint_action): Handle static tracepoint actions.
	(unprobe_marker_at): New.
	(clear_installed_tracepoints): Handle static tracepoints.
	(cmd_qtdp): Handle static tracepoints.
	(probe_marker_at): New.
	(cmd_qtstart): Handle static tracepoints.
	(response_tracepoint): Handle static tracepoints.
	(cmd_qtfstm, cmd_qtsstm, cmd_qtstmat): New.
	(handle_tracepoint_query): Handle qTfSTM, qTsSTM and qTSTMat.
	(get_context_regcache): Handle static tracepoints.
	(do_action_at_tracepoint): Handle static tracepoint actions.
	(traceframe_find_block_type): Handle static trace data blocks.
	(traceframe_read_sdata): New.
	(download_tracepoints): Download static tracepoint actions.
	[HAVE_UST] Include ust/ust.h, dlfcn.h, sys/socket.h, and sys/un.h.
	(GDB_PROBE_NAME): New.
	(ust_ops): New.
	(GET_UST_SYM): New.
	(USTF): New.
	(dlsym_ust): New.
	(ust_marker_to_static_tracepoint): New.
	(gdb_probe): New.
	(collect_ust_data_at_tracepoint): New.
	(gdb_ust_probe): New.
	(UNIX_PATH_MAX, SOCK_DIR): New.
	(gdb_ust_connect_sync_socket): New.
	(resume_thread, stop_thread): New.
	(run_inferior_command): New.
	(init_named_socket): New.
	(gdb_ust_socket_init): New.
	(cstr_to_hexstr): New.
	(next_st): New.
	(first_marker, next_marker): New.
	(response_ust_marker): New.
	(cmd_qtfstm, cmd_qtsstm): New.
	(unprobe_marker_at, probe_marker_at): New.
	(cmd_qtstmat, gdb_ust_thread): New.
	(gdb_ust_init): New.
	(initialize_tracepoint_ftlib): Call gdb_ust_init.
	* linux-amd64-ipa.c [HAVE_UST]: Include ust/processor.h
	(ST_REGENTRY): New.
	(x86_64_st_collect_regmap): New.
	(X86_64_NUM_ST_COLLECT_GREGS): New.
	(AMD64_RIP_REGNUM): New.
	(supply_static_tracepoint_registers): New.
	* linux-i386-ipa.c [HAVE_UST]: Include ust/processor.h
	(ST_REGENTRY): New.
	(i386_st_collect_regmap): New.
	(i386_NUM_ST_COLLECT_GREGS): New.
	(supply_static_tracepoint_registers): New.
	* server.c (handle_query): Handle qXfer:statictrace:read.
	<qSupported>: Report support for StaticTracepoints, and
	qXfer:statictrace:read features.
	* server.h (traceframe_read_sdata)
	(supply_static_tracepoint_registers): Declare.
	* remote-utils.c (convert_int_to_ascii, hexchars, ishex, tohex)
	(unpack_varlen_hex): Include in IPA build.
	* Makefile.in (ustlibs, ustinc): New.
	(IPA_OBJS): Add remote-utils-ipa.o.
	($(IPA_LIB)): Link -ldl and -lpthread.
	(UST_CFLAGS): New.
	(IPAGENT_CFLAGS): Add UST_CFLAGS.
	* config.in, configure: Regenerate.

	gdb/
	* NEWS: Mention new support for static tracepoints.
	(New packets): Mention qTfSTM, qTsSTM, qTSTMat and
	qXfer:statictrace:read.
	(New features in the GDB remote stub, GDBserver): Mention static
	tracepoints support using an UST based backend.
	(New commands): Mention "info static-tracepoint-markers" and
	"strace".
	* breakpoint.c (is_marker_spec): New.
	(is_tracepoint): Handle static tracepoints.
	(validate_commands_for_breakpoint): Static tracepoints can't do
	while-stepping.
	(static_tracepoints_here): New.
	(bpstat_what): Handle static tracepoints.
	(print_one_breakpoint_location, allocate_bp_location, mention):
	Ditto.
	(create_breakpoint_sal): Ditto.
	(decode_static_tracepoint_spec): New.
	(create_breakpoint): Replace `hardwareflag', and `traceflag' with
	`type_wanted'.  Adjust.  Handle static tracepoint marker
	locations.
	(break_command_1): Adjust.
	(update_static_tracepoint): New.
	(update_breakpoint_locations): Handle static tracepoints.
	(breakpoint_re_set_one): Handle static tracepoint marker
	locations.
	(disable_command, enable_command): Handle static tracepoints.
	(trace_command, ftrace_command): Adjust.
	(strace_command): New.
	(create_tracepoint_from_upload): Adjust.
	(save_breakpoints): Handle static tracepoints.
	(_initialize_breakpoint): Install the "strace" command.
	* breakpoint.h (enum bptype): New bp_static_tracepoint type.
	(struct breakpoint): New fields static_trace_marker_id and
	static_trace_marker_id_idx.
	(breakpoints_here_p): Declare.
	(create_breakpoint): Adjust.
	(static_tracepoints_here): Declare.
	* remote.c (struct remote_state) <static_tracepoints>: New field.
	(PACKET_qXfer_statictrace_read, PACKET_StaticTracepoints): New.
	(remote_static_tracepoint_marker_at): New.
	(remote_static_tracepoint_markers_by_strid): New.
	(remote_static_tracepoint_feature): New.
	(remote_disconnected_tracing_feature): Handle "StaticTracepoints".
	(remote_xfer_partial): Handle TARGET_OBJECT_STATIC_TRACE_DATA.
	(remote_supports_static_tracepoints): New.
	(remote_download_tracepoint): Download static tracepoints.
	(init_remote_ops): Install remote_static_tracepoint_marker_at and
	remote_static_tracepoint_markers_by_strid.
	(_initialize_remote): Install set|show remote static-tracepoints,
	and set|show remote read-sdata-object commands.
	* target.c (update_current_target): Inherit and default
	to_static_tracepoint_marker_at, and
	to_static_tracepoint_markers_by_strid.
	* target.h (static_tracepoint_marker): Forward declare.
	(enum target_object): New object TARGET_OBJECT_STATIC_TRACE_DATA.
	(static_tracepoint_marker_p): New typedef.
	(DEF_VEC_P(static_tracepoint_marker_p)): New VEC type.
	(struct target_ops): New fields to_static_tracepoint_marker_at and
	to_static_tracepoint_markers_by_strid.
	(target_static_tracepoint_marker_at)
	(target_static_tracepoint_markers_by_strid): New.
	* tracepoint.c: Include source.h.
	(validate_actionline): Handle $_sdata.
	(struct collection_list): New field strace_data.
	(add_static_trace_data): New.
	(clear_collection_list): Clear strace_data.
	(stringify_collection_list): Account for a possible static trace
	data collection.
	(encode_actions_1): Encode an $_sdata collection.
	(parse_tracepoint_definition): Handle static tracepoints.
	(parse_static_tracepoint_marker_definition): New.
	(release_static_tracepoint_marker): New.
	(print_one_static_tracepoint_marker): New.
	(info_static_tracepoint_markers_command): New.
	(sdata_make_value): New.
	(_initialize_tracepoint): Create the $_sdata convenience variable.
	Add the "info static-tracepoint-markers" command.
	Mention $_sdata in the "collect" command's help output.
	* tracepoint.h (struct static_tracepoint_marker): New.
	(parse_static_tracepoint_marker_definition)
	(release_static_tracepoint_marker): Declare.
	* mi/mi-cmd-break.c (mi_cmd_break_insert): Adjust.
	* python/py-breakpoint.c (bppy_new): Adjust.

	doc/
	* gdb.texinfo (Convenience Variables): Document $_sdata.
	(Commands to Set Tracepoints): Describe static tracepoints.  Add
	`Listing Static Tracepoint Markers' menu entry.  Document
	"strace".
	(Tracepoint Action Lists): Document collecting $_sdata.
	(Listing Static Tracepoint Markers): New subsection.
	(Tracepoints support in gdbserver): Mention static tracepoints.
	(remote packets, enabling and disabling): Mention
	read-sdata-object.
	(General Query Packets) <qSupported>: Document qXfer:sdata:read
	and StaticTracepoint.
	Mention qTfSTM, qTsSTM and qTSTMat as tracepoint packets.
	Document qXfer:sdata:read.
	(Tracepoint packets): Document qTfSTM, qTsSTM and qTSTMat.
2010-07-01 10:36:12 +00:00
Pedro Alves fa593d66d5 gdb/gdbserver/
2010-06-01  Pedro Alves  <pedro@codesourcery.com>
	    Stan Shebs  <stan@codesourcery.com>

	* Makefile.in (IPA_DEPFILES, extra_libraries): New.
	(all): Depend on $(extra_libraries).
	(install-only): Install the IPA.
	(IPA_OBJS, IPA_LIB): New.
	(clean): Remove the IPA lib.
	(IPAGENT_CFLAGS): New.
	(tracepoint-ipa.o, utils-ipa.o, remote-utils-ipa.o)
	(regcache-ipa.o, i386-linux-ipa.o, linux-i386-ipa.o)
	(linux-amd64-ipa.o, amd64-linux-ipa.o): New rules.
	* linux-amd64-ipa.c, linux-i386-ipa.c: New files.
	* configure.ac: Check for atomic builtins support in the compiler.
	(IPA_DEPFILES, extra_libraries): Define.
	* configure.srv (ipa_obj): Add description.
	(ipa_i386_linux_regobj, ipa_amd64_linux_regobj): Define.
	(i[34567]86-*-linux*): Set ipa_obj.
	(x86_64-*-linux*): Set ipa_obj.
	* linux-low.c (stabilizing_threads): New.
	(supports_fast_tracepoints): New.
	(linux_detach): Stabilize threads before detaching.
	(handle_tracepoints): Handle internal tracing breakpoints.  Assert
	the lwp is either not stabilizing, or is moving out of a jump pad.
	(linux_fast_tracepoint_collecting): New.
	(maybe_move_out_of_jump_pad): New.
	(enqueue_one_deferred_signal): New.
	(dequeue_one_deferred_signal): New.
	(linux_wait_for_event_1): If moving out of a jump pad, defer
	pending signals to later.
	(linux_stabilize_threads): New.
	(linux_wait_1): Check if threads need moving out of jump pads, and
	do it if so.
	(stuck_in_jump_pad_callback): New.
	(move_out_of_jump_pad_callback): New.
	(lwp_running): New.
	(linux_resume_one_lwp): Handle moving out of jump pads.
	(linux_set_resume_request): Dequeue deferred signals.
	(need_step_over_p): Also step over fast tracepoint jumps.
	(start_step_over): Also uninsert fast tracepoint jumps.
	(finish_step_over): Also reinsert fast tracepoint jumps.
	(linux_install_fast_tracepoint_jump): New.
	(linux_target_ops): Install linux_stabilize_threads and
	linux_install_fast_tracepoint_jump_pad.
	* linux-low.h (linux_target_ops) <get_thread_area,
	install_fast_tracepoint_jump_pad>: New fields.
	(struct lwp_info) <collecting_fast_tracepoint,
	pending_signals_to_report, exit_jump_pad_bkpt>: New fields.
	(linux_get_thread_area): Declare.
	* linux-x86-low.c (jump_insn): New.
	(x86_get_thread_area): New.
	(append_insns): New.
	(push_opcode): New.
	(amd64_install_fast_tracepoint_jump_pad): New.
	(i386_install_fast_tracepoint_jump_pad): New.
	(x86_install_fast_tracepoint_jump_pad): New.
	(the_low_target): Install x86_get_thread_area and
	x86_install_fast_tracepoint_jump_pad.
	* mem-break.c (set_raw_breakpoint_at): Use read_inferior_memory.
	(struct fast_tracepoint_jump): New.
	(fast_tracepoint_jump_insn): New.
	(fast_tracepoint_jump_shadow): New.
	(find_fast_tracepoint_jump_at): New.
	(fast_tracepoint_jump_here): New.
	(delete_fast_tracepoint_jump): New.
	(set_fast_tracepoint_jump): New.
	(uninsert_fast_tracepoint_jumps_at): New.
	(reinsert_fast_tracepoint_jumps_at): New.
	(set_breakpoint_at): Use write_inferior_memory.
	(uninsert_raw_breakpoint): Use write_inferior_memory.
	(check_mem_read): Mask out fast tracepoint jumps.
	(check_mem_write): Mask out fast tracepoint jumps.
	* mem-break.h (struct fast_tracepoint_jump): Forward declare.
	(set_fast_tracepoint_jump): Declare.
	(delete_fast_tracepoint_jump)
	(fast_tracepoint_jump_here, uninsert_fast_tracepoint_jumps_at)
	(reinsert_fast_tracepoint_jumps_at): Declare.
	* regcache.c: Don't compile many functions when building the
	in-process agent library.
	(init_register_cache) [IN_PROCESS_AGENT]: Don't allow allocating
	the register buffer in the heap.
	(free_register_cache): If the register buffer isn't owned by the
	regcache, don't free it.
	(set_register_cache) [IN_PROCESS_AGENT]: Don't re-alocate
	pre-existing register caches.
	* remote-utils.c (convert_int_to_ascii): Constify `from' parameter
	type.
	(convert_ascii_to_int): : Constify `from' parameter type.
	(decode_M_packet, decode_X_packet): Replace the `to' parameter by
	a `to_p' pointer to pointer parameter.  If TO_P is NULL, malloc
	the needed buffer in-place.
	(relocate_instruction): New.
	* server.c (handle_query) <qSymbols>: If the target supports
	tracepoints, give it a chance of looking up symbols.  Report
	support for fast tracepoints.
	(handle_status): Stabilize threads.
	(process_serial_event): Adjust.
	* server.h (struct fast_tracepoint_jump): Forward declare.
	(struct process_info) <fast_tracepoint_jumps>: New field.
	(convert_ascii_to_int, convert_int_to_ascii): Adjust.
	(decode_X_packet, decode_M_packet): Adjust.
	(relocate_instruction): Declare.
	(in_process_agent_loaded): Declare.
	(tracepoint_look_up_symbols): Declare.
	(struct fast_tpoint_collect_status): Declare.
	(fast_tracepoint_collecting): Declare.
	(force_unlock_trace_buffer): Declare.
	(handle_tracepoint_bkpts): Declare.
	(initialize_low_tracepoint)
	(supply_fast_tracepoint_registers) [IN_PROCESS_AGENT]: Declare.
	* target.h (struct target_ops) <stabilize_threads,
	install_fast_tracepoint_jump_pad>: New fields.
	(stabilize_threads, install_fast_tracepoint_jump_pad): New.
	* tracepoint.c [HAVE_MALLOC_H]: Include malloc.h.
	[HAVE_STDINT_H]: Include stdint.h.
	(trace_debug_1): Rename to ...
	(trace_vdebug): ... this.
	(trace_debug): Rename to ...
	(trace_debug_1): ... this.  Add `level' parameter.
	(trace_debug): New.
	(ATTR_USED, ATTR_NOINLINE): New.
	(IP_AGENT_EXPORT): New.
	(gdb_tp_heap_buffer, gdb_jump_pad_buffer, gdb_jump_pad_buffer_end)
	(collecting, gdb_collect, stop_tracing, flush_trace_buffer)
	(about_to_request_buffer_space, trace_buffer_is_full)
	(stopping_tracepoint, expr_eval_result, error_tracepoint)
	(tracepoints, tracing, trace_buffer_ctrl, trace_buffer_ctrl_curr)
	(trace_buffer_lo, trace_buffer_hi, traceframe_read_count)
	(traceframe_write_count, traceframes_created)
	(trace_state_variables)
	New renaming defines.
	(struct ipa_sym_addresses): New.
	(STRINGIZE_1, STRINGIZE, IPA_SYM): New.
	(symbol_list): New.
	(ipa_sym_addrs): New.
	(all_tracepoint_symbols_looked_up): New.
	(in_process_agent_loaded): New.
	(write_e_ipa_not_loaded): New.
	(maybe_write_ipa_not_loaded): New.
	(tracepoint_look_up_symbols): New.
	(debug_threads) [IN_PROCESS_AGENT]: New.
	(read_inferior_memory) [IN_PROCESS_AGENT]: New.
	(UNKNOWN_SIDE_EFFECTS): New.
	(stop_tracing): New.
	(flush_trace_buffer): New.
	(stop_tracing_bkpt): New.
	(flush_trace_buffer_bkpt): New.
	(read_inferior_integer): New.
	(read_inferior_uinteger): New.
	(read_inferior_data_pointer): New.
	(write_inferior_data_pointer): New.
	(write_inferior_integer): New.
	(write_inferior_uinteger): New.
	(struct collect_static_trace_data_action): Delete.
	(enum tracepoint_type): New.
	(struct tracepoint) <type>: New field `type'.
	<actions_str, step_actions, step_actions_str>: Only include in GDBserver.
	<orig_size, obj_addr_on_target, adjusted_insn_addr>
	<adjusted_insn_addr_end, jump_pad, jump_pad_end>: New fields.
	(tracepoints): Use IP_AGENT_EXPORT.
	(last_tracepoint): Don't include in the IPA.
	(stopping_tracepoint): Use IP_AGENT_EXPORT.
	(trace_buffer_is_full): Use IP_AGENT_EXPORT.
	(alloced_trace_state_variables): New.
	(trace_state_variables): Use IP_AGENT_EXPORT.
	(traceframe_t): Delete unused variable.
	(circular_trace_buffer): Don't include in the IPA.
	(trace_buffer_start): Delete.
	(struct trace_buffer_control): New.
	(trace_buffer_free): Delete.
	(struct ipa_trace_buffer_control): New.
	(GDBSERVER_FLUSH_COUNT_MASK, GDBSERVER_FLUSH_COUNT_MASK_PREV)
	(GDBSERVER_FLUSH_COUNT_MASK_CURR, GDBSERVER_UPDATED_FLUSH_COUNT_BIT):
	New.
	(trace_buffer_ctrl): New.
	(TRACE_BUFFER_CTRL_CURR): New.
	(trace_buffer_start, trace_buffer_free, trace_buffer_end_free):
	Reimplement as macros.
	(trace_buffer_wrap): Delete.
	(traceframe_write_count, traceframe_read_count)
	(traceframes_created, tracing): Use IP_AGENT_EXPORT.
	(struct tracepoint_hit_ctx) <type>: New field.
	(struct fast_tracepoint_ctx): New.
	(memory_barrier): New.
	(cmpxchg): New.
	(record_tracepoint_error): Update atomically in the IPA.
	(clear_inferior_trace_buffer): New.
	(about_to_request_buffer_space): New.
	(trace_buffer_alloc): Handle GDBserver and inferior simulatenous
	updating the same buffer.
	(add_tracepoint): Default the tracepoint's type to trap
	tracepoint, and orig_size to -1.
	(get_trace_state_variable) [IN_PROCESS_AGENT]: Handle allocated
	internal variables.
	(create_trace_state_variable): New parameter `gdb'.  Handle it.
	(clear_installed_tracepoints): Clear fast tracepoint jumps.
	(cmd_qtdp): Handle fast tracepoints.
	(cmd_qtdv): Adjust.
	(max_jump_pad_size): New.
	(gdb_jump_pad_head): New.
	(get_jump_space_head): New.
	(claim_jump_space): New.
	(sort_tracepoints): New.
	(MAX_JUMP_SIZE): New.
	(cmd_qtstart): Handle fast tracepoints.  Sync tracepoints with the
	IPA.
	(stop_tracing) [IN_PROCESS_AGENT]: Don't include the tdisconnected
	support.  Upload fast traceframes, and delete internal IPA
	breakpoints.
	(stop_tracing_handler): New.
	(flush_trace_buffer_handler): New.
	(cmd_qtstop): Upload fast tracepoints.
	(response_tracepoint): Handle fast tracepoints.
	(tracepoint_finished_step): Upload fast traceframes.  Set the
	tracepoint hit context's tracepoint type.
	(handle_tracepoint_bkpts): New.
	(tracepoint_was_hit): Set the tracepoint hit context's tracepoint
	type.  Add comment about fast tracepoints.
	(collect_data_at_tracepoint) [IN_PROCESS_AGENT]: Don't access the
	non-existing action_str field.
	(get_context_regcache): Handle fast tracepoints.
	(do_action_at_tracepoint) [!IN_PROCESS_AGENT]: Don't write the PC
	to the regcache.
	(fast_tracepoint_from_jump_pad_address): New.
	(fast_tracepoint_from_ipa_tpoint_address): New.
	(collecting_t): New.
	(force_unlock_trace_buffer): New.
	(fast_tracepoint_collecting): New.
	(collecting): New.
	(gdb_collect): New.
	(write_inferior_data_ptr): New.
	(target_tp_heap): New.
	(target_malloc): New.
	(download_agent_expr): New.
	(UALIGN): New.
	(download_tracepoints): New.
	(download_trace_state_variables): New.
	(upload_fast_traceframes): New.
	(IPA_FIRST_TRACEFRAME): New.
	(IPA_NEXT_TRACEFRAME_1): New.
	(IPA_NEXT_TRACEFRAME): New.
	[IN_PROCESS_AGENT]: Include sys/mman.h and fcntl.h.
	[IN_PROCESS_AGENT] (gdb_tp_heap_buffer, gdb_jump_pad_buffer)
	(gdb_jump_pad_buffer_end): New.
	[IN_PROCESS_AGENT] (initialize_tracepoint_ftlib): New.
	(initialize_tracepoint): Adjust.
	[IN_PROCESS_AGENT]: Allocate the IPA heap, and jump pad scratch
	buffer.  Initialize the low module.
	* utils.c (PREFIX, TOOLNAME): New.
	(malloc_failure): Use PREFIX.
	(error): In the IPA, an error causes an exit.
	(fatal, warning): Use PREFIX.
	(internal_error): Use TOOLNAME.
	(NUMCELLS): Increase to 10.
	* configure, config.in: Regenerate.

gdb/
2010-06-01  Pedro Alves  <pedro@codesourcery.com>

	* NEWS: Mention gdbserver fast tracepoints support.

gdb/doc/
2010-06-01  Pedro Alves  <pedro@codesourcery.com>

	* gdb.texinfo (Set Tracepoints): Mention tracepoints support in
	gdbserver, and add cross reference.
	(Tracepoints support in gdbserver): New subsection.
2010-06-01 13:20:52 +00:00
Jan Kratochvil f6528abd64 gdb/
* Makefile.in (RDYNAMIC): New.
	(SFILES): Add proc-service.list.
	* config/alpha/alpha-linux.mh (NAT_CDEPS): New.
	(LOADLIBES): Replace -rdynamic by $(RDYNAMIC).
	* config/arm/linux.mh: Likewise.
	* config/i386/linux.mh: Likewise.
	* config/i386/linux64.mh: Likewise.
	* config/ia64/linux.mh: Likewise.
	* config/m32r/linux.mh: Likewise.
	* config/m68k/linux.mh: Likewise.
	* config/mips/linux.mh: Likewise.
	* config/pa/linux.mh: Likewise.
	* config/powerpc/linux.mh: Likewise.
	* config/powerpc/ppc64-linux.mh: Likewise.
	* config/s390/s390.mh: Likewise.
	* config/sparc/linux.mh: Likewise.
	* config/sparc/linux64.mh: Likewise.
	* config/xtensa/linux.mh: Likewise.
	* configure.ac: New RDYNAMIC on native host and GCC.
	(solaris*): Replace -Wl,-export-dynamic by $RDYNAMIC.
	* configure: Regenerate.
	* proc-service.list: New.

gdb/gdbserver/
	* Makefile.in (SFILES): Add $(srcdir)/proc-service.list.
	(CDEPS): New.
	* configure.ac (RDYNAMIC): New AC_MSG_CHECKING wrapping.  Test also
	-Wl,--dynamic-list.
	* configure: Regenerate.
	* proc-service.list: New.
2010-05-28 18:50:35 +00:00
Pierre Muller 12ea4b6986 * configure.ac: Use `ws2_32' library for srv_mingw.
* configure: Regenerate.
	* gdbreplay.c: Include winsock2.h instead of winsock.h.
	* remote-utils.c: Likewise.
2010-04-17 20:43:13 +00:00
Pierre Muller 8e64287381 * configure: Regenerate. 2010-04-16 16:22:15 +00:00
Maxim Kuvyrkov 193f13e68b * configure.ac: Check for libdl. If it is not available link against
static libthread_db.
	* configure: Regenerate.
2010-02-23 19:16:16 +00:00
Doug Evans 10e86dd778 * configure.ac: Check for dladdr.
* config.in: Regenerate.
	* configure: Regenerate.
	* thread-db.c (dladdr_to_soname): Only define ifdef HAVE_DLADDR.
	(try_thread_db_load): Update.
2009-12-21 20:52:53 +00:00
Maxim Kuvyrkov 9ac544cece 2009-11-17 Nathan Sidwell <nathan@codesourcery.com>
2009-11-17  Vladimir Prus  <vladimir@codesourcery.com>

	* Makefile.in (reg-cf.o, reg-cf.c): New targets.
	* configure.ac: Check for __mcoldfire__ and set
	gdb_cv_m68k_is_coldfire.
	* configure.srv: Use gdb_cv_m68k_is_coldfire to select between
	reg-cf.o and reg-m68k.o.
	* configure: Regenerated.

2009-11-17  Nathan Sidwell  <nathan@codesourcery.com>

	* regformats/reg-cf.dat: New file.
2009-11-17 17:58:15 +00:00
Nathan Sidwell 8838b45ede * configure.ac (i[34567]86-*): Check if we're targetting x86-64
with an i686 compiler.
	* configure.srv (i[34567]86-*-linux*): Pull in x86-64 handling if
	needed.
	* configure: Rebuilt.
2009-11-03 09:33:18 +00:00
Paul Pluzhnikov 96f1593750 2009-10-29 Paul Pluzhnikov <ppluzhnikov@google.com>
* configure.ac: New --with-libthread-db option.
	* thread-db.c: Allow direct dependence on libthread_db.
	(thread_db_free): Adjust.
	* config.in: Regenerate.
	* configure: Likewise.
2009-10-29 17:43:44 +00:00
Paul Pluzhnikov cdbfd4198e doc/
2009-10-08  Paul Pluzhnikov  <ppluzhnikov@google.com>

	* gdb.texinfo (Server): Document libthread-db-search-path.

gdbserver/
2009-10-08  Paul Pluzhnikov  <ppluzhnikov@google.com>

	* acinclude.m4: (SRV_CHECK_THREAD_DB, SRV_CHECK_TLS_GET_ADDR): Remove.
	* configure.ac: Adjust.
	* linux-low.h (struct process_info_private): Move members to struct
	thread_db.
	(thread_db_free, thread_db_handle_monitor_command): New prototype.
	* linux-low.c (linux_remove_process): Adjust.
	(linux_wait_for_event_1, linux_look_up_symbols): Likewise.
	* server.c (handle_query): Move code ...
	(handle_monitor_command): ... here. New function.
	* target.h (struct target_ops): New member.
	* thread-db.c (struct thread_db): New.
	(libthread_db_search_path): New variable.
	(thread_db_create_event, thread_db_enable_reporting)
	(find_one_thread, maybe_attach_thread, find_new_threads_callback)
	(thread_db_find_new_threads, (thread_db_get_tls_address): Adjust.
	(try_thread_db_load_1, dladdr_to_soname): New functions.
	(try_thread_db_load, thread_db_load_search): New functions.
	(thread_db_init): Search for libthread_db.
	(thread_db_free): New function.
	(thread_db_handle_monitor_command): Likewise.
	* config.in: Regenerate.
	* configure: Regenerate.
2009-10-09 00:31:01 +00:00
Ralf Wildenhues 81ecdfbb4d Regenerate tree using Autoconf 2.64 and Automake 1.11.
config/:
	* override.m4 (_GCC_AUTOCONF_VERSION): Bump to 2.64.

/:
	* configure: Regenerate.

etc/:
	* configure: Regenerate.

sim/common/:
	* config.in: Regenerate.
	* configure: Likewise.

sim/iq2000/:
	* config.in: Regenerate.
	* configure: Likewise.

sim/d10v/:
	* config.in: Regenerate.
	* configure: Likewise.

sim/igen/:
	* config.in: Regenerate.
	* configure: Likewise.

sim/m32r/:
	* config.in: Regenerate.
	* configure: Likewise.

sim/frv/:
	* config.in: Regenerate.
	* configure: Likewise.

sim/:
	* avr/config.in: Regenerate.
	* avr/configure: Likewise.
	* configure: Likewise.
	* cris/config.in: Likewise.
	* cris/configure: Likewise.

sim/h8300/:
	* config.in: Regenerate.
	* configure: Likewise.

sim/mn10300/:
	* config.in: Regenerate.
	* configure: Likewise.

sim/ppc/:
	* config.in: Regenerate.
	* configure: Likewise.

sim/erc32/:
	* config.in: Regenerate.
	* configure: Likewise.

sim/arm/:
	* config.in: Regenerate.
	* configure: Likewise.

sim/m68hc11/:
	* config.in: Regenerate.
	* configure: Likewise.

sim/lm32/:
	* config.in: Regenerate.
	* configure: Likewise.

sim/sh64/:
	* config.in: Regenerate.
	* configure: Likewise.

sim/v850/:
	* config.in: Regenerate.
	* configure: Likewise.

sim/cr16/:
	* config.in: Regenerate.
	* configure: Likewise.

sim/moxie/:
	* config.in: Regenerate.
	* configure: Likewise.

sim/m32c/:
	* config.in: Regenerate.
	* configure: Likewise.

sim/mips/:
	* config.in: Regenerate.
	* configure: Likewise.

sim/mcore/:
	* config.in: Regenerate.
	* configure: Likewise.

sim/testsuite/d10v-elf/:
	* configure: Regenerate.

sim/testsuite/:
	* configure: Regenerate.

sim/testsuite/frv-elf/:
	* configure: Regenerate.

sim/testsuite/m32r-elf/:
	* configure: Regenerate.

sim/testsuite/mips64el-elf/:
	* configure: Regenerate.

sim/sh/:
	* config.in: Regenerate.
	* configure: Likewise.

gold/:
	* Makefile.in: Regenerate.
	* aclocal.m4: Likewise.
	* config.in: Likewise.
	* configure: Likewise.
	* testsuite/Makefile.in: Likewise.

gprof/:
	* Makefile.in: Regenerate.
	* aclocal.m4: Likewise.
	* configure: Likewise.
	* gconfig.in: Likewise.

opcodes/:
	* Makefile.in: Regenerate.
	* aclocal.m4: Likewise.
	* config.in: Likewise.
	* configure: Likewise.

gas/:
	* Makefile.in: Regenerate.
	* aclocal.m4: Likewise.
	* config.in: Likewise.
	* configure: Likewise.
	* doc/Makefile.in: Likewise.

ld/:
	* Makefile.in: Regenerate.
	* aclocal.m4: Likewise.
	* config.in: Likewise.
	* configure: Likewise.

gdb/:
	* aclocal.m4: Regenerate.
	* config.in: Likewise.
	* configure: Likewise.
	* gnulib/Makefile.in: Likewise.

gdb/doc/:
	* configure: Regenerate.

gdb/gdbserver/:
	* aclocal.m4: Regenerate.
	* config.in: Likewise.
	* configure: Likewise.

gdb/testsuite/:
	* configure: Regenerate.
	* gdb.hp/configure: Likewise.
	* gdb.hp/gdb.aCC/configure: Likewise.
	* gdb.hp/gdb.base-hp/configure: Likewise.
	* gdb.hp/gdb.compat/configure: Likewise.
	* gdb.hp/gdb.defects/configure: Likewise.
	* gdb.hp/gdb.objdbg/configure: Likewise.
	* gdb.stabs/configure: Likewise.

binutils/:
	* Makefile.in: Regenerate.
	* aclocal.m4: Likewise.
	* config.in: Likewise.
	* configure: Likewise.
	* doc/Makefile.in: Likewise.

bfd/:
	* Makefile.in: Regenerate.
	* aclocal.m4: Likewise.
	* config.in: Likewise.
	* configure: Likewise.

bfd/doc/:
	* Makefile.in: Regenerate.

readline/:
	* configure: Regenerate.

readline/examples/rlfe/:
	* configure: Regenerate.
2009-08-22 16:56:56 +00:00
Aleksandar Ristovski ac8c974e4f Adding Neutrino gdbserver.
* configure: Regenerated.
	* configure.ac: Add case for srv_qnx and set LIBS accordingly.
	* configure.srv (i[34567]86-*-nto*): New target.
	* nto-low.c, nto-low.h, nto-x86-low.c: New files.
	* remote-utils.c [__QNX__]: Include sys/iomgr.h
	(nto_comctrl) [__QNX__]: New function.
	(enable_async_io, disable_async_io) [__QNX__]: Call nto_comctrl.
2009-07-06 18:31:20 +00:00
Pedro Alves 1b3f60162b * i387-fp.c, linux-arm-low.c, linux-cris-low.c,
linux-crisv32-low.c, linux-i386-low.c, linux-low.c,
	linux-mips-low.c, linux-s390-low.c, linux-sparc-low.c,
	linux-x86-64-low.c, linux-xtensa-low.c, proc-service.c,
	regcache.c, remote-utils.c, server.c, spu-low.c, target.h,
	thread-db.c, win32-low.c, xtensa-xtregs.c, gdbreplay.c,
	Makefile.in, configure.ac: Fix whitespace throughout.
	* configure: Regenerate.
2009-03-22 23:57:10 +00:00
Pedro Alves ec56be1b4d * configure.ac: Check for memmem declaration.
* server.c [HAVE_MALLOC_H]: Include malloc.h.
	(disable_packet_vCont, disable_packet_Tthread, disable_packet_qC)
	(disable_packet_qfThreadInfo): Unconditionally compile.
	* server.h [!HAVE_DECL_MEMMEM]: Declare memmem.
	* configure, config.in: Regenerate.
2008-07-31 17:46:33 +00:00
Joseph Myers c16158bc9c 2008-06-05 Vladimir Prus <vladimir@codesourcery.com>
Nathan Sidwell  <nathan@codesourcery.com>
            Joseph Myers  <joseph@codesourcery.com>

	* acinclude.m4: Include ../config/acx.m4.
	* configure.ac: Use ACX_PKGVERSION and ACX_BUGURL.
	* configure, config.in: Regenerate.
	* main.c (print_gdb_help): Use REPORT_BUGS_TO for bug-reporting
	address.
	* top.c (print_gdb_version): Use PKGVERSION and REPORT_BUGS_TO.

doc:
2008-06-05  Vladimir Prus  <vladimir@codesourcery.com>
            Nathan Sidwell  <nathan@codesourcery.com>
            Joseph Myers  <joseph@codesourcery.com>

	* configure.ac: Include ../../config/acx.m4.  Use ACX_PKGVERSION
	and ACX_BUGURL.
	* configure: Regenerate.
	* Makefile.in (PKGVERSION, BUGURL_TEXI): Define.
	(GDBvn.texi): Define VERSION_PACKAGE, BUGURL and BUGURL_DEFAULT.
	* gdb.texinfo: Use VERSION_PACKAGE and BUGURL.  Remove
	mailing-list-specific text about bug reporting unless
	BUGURL_DEFAULT.

gdbserver:
2008-06-05  Vladimir Prus  <vladimir@codesourcery.com>
            Nathan Sidwell  <nathan@codesourcery.com>
            Joseph Myers  <joseph@codesourcery.com>

	* acinclude.m4: Include ../../config/acx.m4.
	* configure.ac: Use ACX_PKGVERSION and ACX_BUGURL.
	* configure, config.in: Regenerate.
	* Makefile.in (gdbreplay$(EXEEXT)): Add version.o.
	* server.c (gdbserver_version): Print PKGVERSION.
	(gdbsrever_usage): Add stream parameter.  Print REPORT_BUGS_TO.
	(main): Adjust gdbserver_usage calls.
	* gdbreplay.c (version, host_name): Add declarations.
	(gdbreplay_version, gdbreplay_usage): New.
	(main): Accept --version and --help options.
2008-06-05 22:36:57 +00:00
Paolo Bonzini fdc5970995 gdb:
2008-04-23  Paolo Bonzini  <bonzini@gnu.org>

        * acinclude.m4: Add override.m4.
        * configure: Regenerate.

gdb/gdbserver:
2008-04-23  Paolo Bonzini  <bonzini@gnu.org>

        * acinclude.m4: Add override.m4.
        * configure: Regenerate.

gdb/testsuite:
2008-04-23  Paolo Bonzini  <bonzini@gnu.org>

        * aclocal.m4: Add override.m4.
        * configure: Regenerate.
2008-04-23 12:21:50 +00:00
Daniel Jacobowitz e28b33320c * Makefile.in (LIBGNU, INCGNU): Define.
(INTERNAL_CFLAGS_BASE): Add INCGNU.
	(INTERNAL_LIBS, CLIBS, CDEPS): Add LIBGNU.
	(CLEANDIRS): New.
	($(LIBGNU), all-lib): New rules.
	(clean, distclean, do-maintainer-clean): Use CLEANDIRS.
	* configure.ac: Use gl_EARLY, gl_INIT, and AM_INIT_AUTOMAKE.
	Simplify AC_CONFIG_AUX_DIR.  Generate gnulib/Makefile.
	* gnulib: New directory, from gnulib-tool.
	* configure, aclocal.m4: Regenerated.

	* Makefile.in (LIBOBJS): New.
	(OBS): Use LIBOBJS.
	(memmem.o): New rule.
	* configure.ac: Use AC_CONFIG_LIBOBJ_DIR and check for memmem.
	* configure: Regenerated.
2008-04-14 18:04:00 +00:00
Ulrich Weigand 9b4b61c8db ChangeLog:
* features/Makefile (%.dat): Emit xmltarget statement.

	* regformats/regdat.sh: Support xmltarget and xmlarch statments.
	Generate code to set gdbserver_xmltarget in init_registers_${name}.

	* regformats/arm-with-iwmmxt.dat: Regenerate.
	* regformats/mips64-linux.dat: Regenerate.
	* regformats/mips-linux.dat: Regenerate.
	* regformats/rs6000/powerpc-32.dat: Regenerate.
	* regformats/rs6000/powerpc-64.dat: Regenerate.
	* regformats/rs6000/powerpc-e500.dat: Regenerate.

	* regformats/reg-arm.dat: Add xmlarch statement.
	* regformats/reg-i386.dat: Likewise.
	* regformats/reg-i386-linux.dat: Likewise.
	* regformats/reg-x86-64-linux.dat: Likewise.
	* regformats/reg-spu.dat: Likewise.

gdbserver/ChangeLog:

	* regcache.h (gdbserver_xmltarget): Add extern declaration.
	* server.c (gdbserver_xmltarget): Define.
	(get_features_xml): Use it to replace "target.xml" and arch_string.

	* configure.srv: Remove srv_xmltarget.  Add XML files that were
	mentioned there to srv_xmlfiles instead.  Remove conditional tests
	on gdb_cv_arm_iwmmxt, gdb_cv_ppc_altivec, gdb_cv_ppc_spe; set
	srv_xmlfiles and srv_regobj to include all possible choices.
	* configure.ac (srv_xmltarget): Remove.
	(srv_xmlfiles): Do not add "target.xml".
	(gdb_cv_arm_iwmmxt, gdb_cv_ppc_altivec, gdb_cv_ppc_spe): Remove
	checks for supplementary target information.
	* configure: Regenerate.
	* Makefile.in (XML_TARGET): Remove.
	(target.xml): Remove rule.
	(clean): Do not clean up target.xml.
	(.PRECIOUS): Do not mention target.xml.

	* target.h (struct target_ops): Remove arch_string member.
	* linux-low.c (linux_arch_string): Remove.
	(linux_target_ops): Remove arch_string initializer.
	* linux-low.h (struct linux_target_ops): Remove arch_string member.
	* linux-i386-low.c (the_low_target): Remove arch_string initializer.
	* linux-x86-64-low.c (the_low_target): Remove arch_string initializer.
	* spu-low.c (spu_arch_string): Remove.
	(spu_target_ops): Remove arch_string initializer.
	* win32-low.c (win32_arch_string): Remove.
	(win32_target_ops): Remove arch_string initializer.
	* win32-low.h (struct win32_target_ops): Remove arch_string member.
	* win32-arm-low.c (the_low_target): Remove arch_string initializer.
	* win32-i368-low.c (the_low_target): Remove arch_string initializer.
2008-02-28 05:54:10 +00:00
Pedro Alves 59a016f09f * hostio.c: Don't include errno.h.
(errno_to_fileio_errno): Move to hostio-errno.
	* hostio.c: (hostio_error): Remove the error parameter.  Defer the
	error number outputting to the target->hostio_last_error callback.
	(hostio_packet_error): Use FILEIO_EINVAL directly.
	(handle_open, handle_pread, hostio_error, handle_unlink): Update
	calls to hostio_error.
	* hostio-errno.c: New.
	* server.h (hostio_last_error_from_errno): Declare.
	* target.h (target_ops): Add hostio_last_error member.
	* linux-low.c (linux_target_op): Register hostio_last_error_from_errno
	as hostio_last_error handler.
	* spu-low.c (spu_target_ops): Likewise.
	* win32-low.c [_WIN32_WCE] (win32_error_to_fileio_error)
	(wince_hostio_last_error): New functions.
	(win32_target_ops) [_WIN32_WCE]: Register wince_hostio_last_error
	as hostio_last_error handler.
	(win32_target_ops) [!_WIN32_WCE]: Register
	hostio_last_error_from_errno as hostio_last_error handler.
	* Makefile.in (SFILES): Add hostio.c and hostio-errno.c.
	(hostio-errno.o): New rule.
	* configure.ac (GDBSERVER_DEPFILES): Add $srv_hostio_err_objs.
	* configure.srv (srv_hostio_err_objs): New variable.  Default to
	hostio-errno.o.
	(arm*-*-mingw32ce*): Set srv_hostio_err_objs to "".
	* configure: Regenerate.
2008-02-01 00:08:25 +00:00
Daniel Jacobowitz 4e79934594 * configure.ac: Check for pread and pwrite.
* hostio.c (handle_pread): Fall back to lseek and read.
	(handle_pwrite): Fall back to lseek and write.
	* config.in, configure: Regenerated.
2007-12-16 21:50:05 +00:00
Daniel Jacobowitz 30ed0a8f0b * Makefile.in (clean): Remove new files.
(powerpc-32.o, powerpc-32.c, powerpc-e500.o, powerpc-e500.c)
	(powerpc-64.o, powerpc-64.c): New rules.
	* configure.srv: Use alternate register sets for powerpc64-*-linux*
	with AltiVec, powerpc-*-linux* with AltiVec, and powerpc-*-linux*
	with SPE.
	* linux-ppc-low.c (ppc_regmap): Do not fetch the FP registers for
	SPE targets.
	(ppc_cannot_store_register): Do not check for FPSCR for SPE targets.
	(PTRACE_GETVRREGS, PTRACE_SETVRREGS, SIZEOF_VRREGS, ppc_fill_vrregset)
	(ppc_store_vrregset, PTRACE_GETEVRREGS, PTRACE_SETEVRREGS)
	(struct gdb_evrregset_t, ppc_fill_evrregset, ppc_store_evrregset): New.
	(target_regsets): Add AltiVec and SPE register sets.
	* configure.ac: Check for AltiVec and SPE.
	* linux-ppc64-low.c (PTRACE_GETVRREGS, PTRACE_SETVRREGS, SIZEOF_VRREGS)
	(ppc_fill_vrregset, ppc_store_vrregset): New.
	(target_regsets): Add AltiVec register set.
	* configure: Regenerated.

	* features/Makefile (WHICH): Add PowerPC register definitions.
	(rs6000/powerpc-32-expedite, rs6000/powerpc-e500-expedite)
	(rs6000/powerpc-64-expedite): New macros.
	($(outdir)/%.dat): Handle subdirectories.
	* regformats/rs6000/powerpc-32.dat, regformats/rs6000/powerpc-64.dat,
	regformats/rs6000/powerpc-e500.dat: New generated files.
2007-10-15 19:58:17 +00:00
Daniel Jacobowitz fd462a6189 * linux-low.c (O_LARGEFILE): Define.
(linux_read_memory): Use /proc/PID/mem.
	* configure.ac: Use AC_GNU_SOURCE.  Check for pread64.
	* configure, config.in: Regenerated.
2007-09-19 14:41:50 +00:00
Pedro Alves 68070c10c7 gdb/
* arm-wince-tdep.c: New.
	* config/arm/wince.mt (DEPRECATED_TM_FILE): Use tm-arm.h.
	(MT_CFLAGS): Delete.
	(TM_CLIBS): Delete.
	(TDEPFILES): Add arm-wince-tdep.o, corelow.o, solib.o,
	solib-legacy.o, solib-svr4.o, and remove wince.o.
	* configure.tgt (arm*-*-mingw32ce*): Add.
	* signals/signals.c [HAVE_SIGNAL_H]: Check.
	(do_target_signal_to_host): Silence 'not used' warning.
	* config/arm/tm-wince.h: Remove.

gdb/gdbserver/

	* gdbserver/configure.ac: Add errno checking.
	(AC_CHECK_HEADERS): Add errno.h, fcntl.h, signal.h,
	sys/file.h and malloc.h.
	(AC_CHECK_DECLS): Add perror.
	(srv_mingwce): Handle.
	* gdbserver/configure.srv (i[34567]86-*-cygwin*): Add
	win32-i386-low.o to srv_tgtobj.
	(i[34567]86-*-mingw*): Likewise.
	(arm*-*-mingw32ce*): Add case.
	* gdbreplay.c [HAVE_SYS_FILE_H, HAVE_SIGNAL_H,
	HAVE_FCNTL_H, HAVE_ERRNO_H, HAVE_MALLOC_H]: Check.
	[__MINGW32CE__] (strerror): New function.
	[__MINGW32CE__] (errno): Define to GetLastError.
	[__MINGW32CE__] (COUNTOF): New macro.
	(remote_open): Remove extra close call.
	* mem-break.c (delete_breakpoint_at): New function.
	* mem-break.h (delete_breakpoint_at): Declare.
	* remote-utils.c [HAVE_SYS_FILE_H, HAVE_SIGNAL_H,
	HAVE_FCNTL_H, HAVE_UNISTD_H, HAVE_ERRNO_H]: Check.
	[USE_WIN32API] (read, write): Add char* casts.
	* server.c [HAVE_UNISTD_H, HAVE_SIGNAL_H]: Check.
	* server.h: Include wincecompat.h on Windows CE.
	[HAVE_ERRNO_H]: Check.
	(perror): Declare if not declared.
	* utils.c: Add stdlib.h, errno.h and malloc.h includes.
	(perror_with_name): Remove errno declaration.
	* wincecompat.h: New.
	* wincecompat.c: New.
	* win32-low.h: New.
	* win32-arm-low.c: New.
	* win32-i386-low.c: New.
	(win32-low.c): Include mem-break.h and win32-low.h, and winnt.h.
	(OUTMSG2): Make it safe.
	(_T): New macro.
	(COUNTOF): New macro.
	(NUM_REGS): Get it from the low target.
	(CONTEXT_EXTENDED_REGISTERS, CONTEXT_FLOATING_POINT,
	CONTEXT_DEBUG_REGISTERS): Add fallbacks to 0.
	(thread_rec): Let low target handle debug registers.
	(child_add_thread): Likewise.
	(child_init_thread_list): Likewise.
	(continue_one_thread): Likewise.
	(regptr): New.
	(do_child_fetch_inferior_registers): Move to ...
	* win32-i386-low.c: ... here, and rename to ...
	(do_fetch_inferior_registers): ... this.
	* win32-low.c (child_fetch_inferior_registers):
	Go through the low target.
	(do_child_store_inferior_registers): Use regptr.
	(strwinerror): New function.
	(win32_create_inferior): Handle Windows CE.
	Use strwinerror instead of strerror on Windows error
	codes.  Add program to the error output.
	Don't close the main thread handle on Windows CE.
	(win32_attach): Use coredll.dll on Windows CE.
	(win32_kill): Close current process and current
	thread handles.
	(win32_detach): Use coredll.dll on Windows CE.
	(win32_resume): Let low target handle debug registers, and
	step request.
	(handle_exception): Add/Remove initial breakpoint.  Avoid
	non-existant WSTOPSIG on Windows CE.
	(win32_read_inferior_memory): Cast to remove warning.
	(win32_arch_string): Go through the low target.
	(initialize_low): Call set_breakpoint_data with the low
	target's breakpoint.
	* win32-low.c (dr, FLAG_TRACE_BIT, FCS_REGNUM,
	FOP_REGNUM, mappings): Move to ...
	* win32-i386-low.c: ... here.
	* win32-low.c (win32_thread_info): Move to ...
	* win32-low.h: ... here.
	* Makefile.in (SFILES): Add win32-low.c, win32-i386-low.c,
	win32-arm-low.c and wincecompat.c.
	(all:): Add $EXEEXT.
	(install-only:): Likewise.
	(gdbserver:): Likewise.
	(gdbreplay:): Likewise.
	* config.in: Regenerate.
	* configure: Regenerate.
2007-03-29 01:06:48 +00:00
Daniel Jacobowitz 61ff6e04e4 * remote-utils.c: Remove HAVE_TERMINAL_H check.
* configure.ac: Do not check for terminal.h.
	* configure, config.in: Regenerated.
2007-02-16 20:01:14 +00:00
Daniel Jacobowitz fb1e4ffce3 * features/Makefile, features/arm-with-iwmmxt.xml,
features/gdbserver-regs.xsl, features/number-regs.xsl,
	features/sort-regs.xsl, features/xscale-iwmmxt.xml: New files.
	* regformats/arm-with-iwmmxt.dat: Generate.
	* NEWS: Mention iWMMXt.

	* gdb.arch/iwmmxt-regs.c, gdb.arch/iwmmxt-regs.exp: New.

	* Makefile.in (OBS): Add $(XML_BUILTIN).
	(XML_DIR, XML_TARGET, XML_FILES, XML_BUILTIN): New.
	(clean): Update.
	(target.xml, xml-builtin.c, stamp-xml, arm-with-iwmmxt.o)
	(arm-with-iwmmxt.c): New.
	* config.in, configure: Regenerate.
	* configure.ac: Check for iWMMXt.  Handle srv_xmltarget,
	srv_xmlbuiltin, and srv_xmlfiles.  Define USE_XML.
	* configure.srv: Mention srv_xmltarget and srv_xmlfiles.
	(arm*-*-linux*): Add iWMMXt and regset support.
	* linux-arm-low.c (PTRACE_GETWMMXREGS, PTRACE_SETWMMXREGS): Define.
	(arm_fill_gregset, arm_store_gregset, arm_fill_wmmxregset)
	(arm_store_wmmxregset, target_regsets): New.
	* server.c (get_features_xml): Take annex argument.  Check builtin
	XML documents.
	(handle_query): Handle multiple annexes.
2007-02-08 21:39:04 +00:00
Daniel Jacobowitz cb7283db10 * configure.ac: Correct td_thr_tls_get_addr test.
* configure: Regenerated.
2006-11-16 22:04:09 +00:00
Daniel Jacobowitz dae5f5cf4b * acinclude.m4 (SRV_CHECK_TLS_GET_ADDR): New.
* configure.ac: Use it.  Define HAVE_TD_THR_TLS_GET_ADDR.
	* config.in, configure: Regenerated.
	* inferiors.c (gdb_id_to_thread): New function.
	(gdb_id_to_thread_id): Use it.
	* linux-low.c (linux_target_ops): Use thread_db_get_tls_address.
	* linux-low.h (struct process_info): Add th member.
	(thread_db_get_tls_address): New prototype.
	* remote-utils.c (decode_address): Make non-static.
	* server.c (handle_query): Handle qGetTLSAddr.
	* server.h (gdb_id_to_thread, decode_address): New prototypes.
	* target.h (struct target_ops): Add get_tls_address.
	* thread-db.c (maybe_attach_thread): Save the thread handle.
	(thread_db_get_tls_address): New.
2006-10-17 16:02:27 +00:00
Daniel Jacobowitz b80864fbe5 gdb/
* configure.tgt: Build gdbserver for Cygwin and mingw32.
gdb/gdbserver/
	* configure.ac: Check for more headers which are missing on
	Windows.  Automatically supply -lwsock32 and USE_WIN32API.
	* configure.srv: Add Cygwin and mingw32.
	* remote-utils.c: Don't include headers unconditionally which
	are missing on mingw32.  Include <winsock.h> for mingw32.
	(remote_open): Adjust for mingw32 support.  Flush
	standard error after writing to it.
	(remote_close, putpkt_binary, input_interrupt, block_async_io)
	(unblock_async_io, enable_async_io, disable_async_io)
	(readchar, getpkt): Update for Winsock support.
	(prepare_resume_reply): Expect a protocol signal number.
	* server.c: Disable <sys/wait.h> on mingw32.
	(start_inferior): Adjust for mingw32 support.  Flush
	standard error after writing to it.
	(attach_inferior): Likewise.  Use protocol signal
	numbers.
	(main): Skip 'D' packet on mingw32.  Use protocol signal numbers
	and names.
	* win32-i386-low.c: New file.
	* Makefile.in (XM_CLIBS): Set.
	(gdbserver, gdbreplay): Use $(INTERNAL_CFLAGS).
	(win32-i386-low.o): New dependency rule.
	* linux-low.c (linux_wait): Use target signal numbers.
	* target.h (struct target_ops): Doc fix.
	* server.h (target_signal_to_name): New prototype.
	* gdbreplay.c: Don't include headers unconditionally which
	are missing on mingw32.  Include <winsock.h> for mingw32.
	(remote_close, remote_open): Adjust for Winsock support.
	* configure, config.in: Regenerated.
2006-07-23 03:52:15 +00:00
Daniel Jacobowitz 0050a760a7 * configure.ac: Remove checks for prfpregset_t.
* gdb_proc_service.h: New file.
	* linux-i386-low.c, linux-x86-64-low.c, thread-db.c: Use the
	new "gdb_proc_service.h".
	* proc-service.c: Likewise.
	(ps_pglobal_lookup, ps_pdread, ps_pdwrite): Use psaddr_t.
	(ps_lgetfpregs, ps_lsetfpregs): Use a void* argument.
	* Makefile.in (gdb_proc_service_h): Updated.
	* configure, config.in: Regenerated.
2006-03-15 16:13:29 +00:00
Daniel Jacobowitz 3db0444b44 * acinclude.m4: Correct quoting.
* aclocal.m4: Regenerated.

	Suggested by SZOKOVACS Robert <szo@ies.hu>:
	* thread-db.c (thread_db_err_str): Handle TD_VERSION.
	(thread_db_init): Call thread_db_err_str.
	* configure.ac: Check for TD_VERSION.
	* config.in, configure: Regenerated.
2005-09-17 23:14:37 +00:00
Daniel Jacobowitz e9d25b9800 * configure.ac: Define HAVE_LINUX_REGSETS even if PTRACE_GETREGS
is not available.  Define HAVE_PTRACE_GETREGS if it is.
	* config.in, configure: Regenerated.
	* configure.srv: Set srv_linux_regsets for PowerPC and PowerPC64.
	* linux-i386-low.c, linux-m68k-low.c: Update to use
	HAVE_PTRACE_GETREGS.
	* linux-low.c (regsets_fetch_inferior_registers)
	(regsets_store_inferior_registers): Only return 0 if we processed
	GENERAL_REGS.
	* linux-ppc-low.c (ppc_fill_gregset, target_regsets): New.
	* linux-ppc64-low.c (ppc_fill_gregset, target_regsets): New.
2005-07-13 15:21:02 +00:00
Steve Ellcey e122f1f5f1 * configure.ac (BFD_NEED_DECLARATION): Replace with AC_CHECK_DECLS.
* configure: Regenerate.
	* config.in: Regenerate.
	* server.h (NEED_DECLARATION_STRERROR):
	Replace with !HAVE_DECL_STRERROR.
2005-07-01 17:18:06 +00:00
Mark Kettenis ccbd49121b * configure.ac: Simplify and improve check for socklen_t.
* configure, config.in: Regenerate.
2005-06-14 21:36:29 +00:00
Daniel Jacobowitz f450004a28 * acconfig.h: Remove.
* configure.ac: Add a test for socklen_t.  Use three-argument
	AC_DEFINE throughout.
	* config.in: Regenerated using autoheader 2.59.
	* configure: Regenerated.

	* gdbreplay.c (socklen_t): Provide a default.
	(remote_open): Use socklen_t.
	* remote-utils.c (socklen_t): Provide a default.
	(remote_open): Use socklen_t.
	(convert_int_to_ascii, convert_ascii_to_int, decode_M_packet): Use
	unsigned char.

	* i387-fp.c (struct i387_fsave, struct i387_fxsave): Use unsigned
	char for buffers.
	* linux-low.c (linux_read_memory, linux_write_memory)
	(linux_read_auxv): Likewise.
	* mem-break.c (breakpoint_data, set_breakpoint_data, check_mem_read)
	(check_mem_write): Likewise.
	* mem-break.h (set_breakpoint_data, check_mem_read, check_mem_write):
	Likewise.
	* regcache.c (struct inferior_rgcache_data, registers_to_string)
	(registers_from_string, register_data): Likewise.
	* server.c (handle_query, main): Likewise.
	* server.h (convert_ascii_to_int, convert_int_to_ascii)
	(decode_M_packet): Likewise.
	* target.c (read_inferior_memory, write_inferior_memory): Likewise.
	* target.h (struct target_ops): Update read_memory, write_memory,
	and read_auxv.
	(read_inferior_memory, write_inferior_memory): Update.
	* linux-low.h (struct linux_target_ops): Change type of breakpoint
	to unsigned char *.
	* linux-arm-low.c, linux-cris-low.c, linux-crisv32-low.c,
	linux-i386-low.c, linux-m32r-low.c, linux-m68k-low.c,
	linux-mips-low.c, linux-ppc-low.c, linux-ppc64-low.c,
	linux-s390-low.c, linux-sh-low.c: Update for changes in
	read_inferior_memory and the_low_target->breakpoint.
2005-06-13 01:59:22 +00:00
Daniel Jacobowitz dcdb98d29d * acinclude.m4: Include bfd/bfd.m4 directly.
* configure.ac: Use AC_ARG_PROGRAM.  Suggested by Aron Griffis
	<agriffis@toolchain.org>.
	* aclocal.m4, configure: Regenerated.
2005-02-24 20:26:32 +00:00
Andrew Cagney bec39cab00 Index: ChangeLog
2005-01-07  Andrew Cagney  <cagney@gnu.org>

	* configure.ac: Rename configure.in, require autoconf 2.59.
	* configure: Re-generate.

Index: doc/ChangeLog
2005-01-07  Andrew Cagney  <cagney@gnu.org>

	* configure.ac: Rename configure.in, require autoconf 2.59.
	* configure: Re-generate.

Index: gdbserver/ChangeLog
2005-01-07  Andrew Cagney  <cagney@gnu.org>

	* configure.ac: Rename configure.in, require autoconf 2.59.
	* configure: Re-generate.

Index: testsuite/ChangeLog
2005-01-07  Andrew Cagney  <cagney@gnu.org>

	* configure.ac: Rename configure.in, require autoconf 2.59.
	* configure: Re-generate.
	* gdb.stabs/configure.ac: Rename configure.in, require autoconf 2.59.
	* gdb.stabs/configure: Re-generate.
	* gdb.hp/configure.ac: Rename configure.in, require autoconf 2.59.
	* gdb.hp/configure: Re-generate.
	* gdb.hp/gdb.objdbg/configure.ac: Rename configure.in, require
	autoconf 2.59.
	* gdb.hp/gdb.objdbg/configure: Re-generate.
	* gdb.hp/gdb.defects/configure.ac: Rename configure.in, require
	autoconf 2.59.
	* gdb.hp/gdb.defects/configure: Re-generate.
	* gdb.hp/gdb.compat/configure.ac: Rename configure.in, require
	autoconf 2.59.
	* gdb.hp/gdb.compat/configure: Re-generate.
	* gdb.hp/gdb.base-hp/configure.ac: Rename configure.in, require
	autoconf 2.59.
	* gdb.hp/gdb.base-hp/configure: Re-generate.
	* gdb.hp/gdb.aCC/configure.ac: Rename configure.in, require
	autoconf 2.59.
	* gdb.hp/gdb.aCC/configure: Re-generate.
2005-01-07 21:53:26 +00:00
Daniel Jacobowitz 434c4c7751 * acinclude.m4 (SRV_CHECK_THREAD_DB): Add ps_get_thread_area. Reset
LIBS when finished.
	* aclocal.m4: Regenerated.
	* configure: Regenerated.
2004-12-08 15:50:29 +00:00
Daniel Jacobowitz f6de3c42a3 * configure.in: Test for -rdynamic.
* configure: Regenerated.
	* Makefile (INTERNAL_LDFLAGS): New.
	(gdbserver, gdbreplay): Use it.
2004-10-16 16:18:54 +00:00
Daniel Jacobowitz 43d5792ce1 * configure.in: Check whether we need to prototype strerror.
* server.h: Optionally prototype strerror.
	* gdbreplay.c (perror_with_name): Use strerror.
	* linux-low.c (linux_attach_lwp): Use strerror.
	* utils.c (perror_with_name): Use strerror.
	* config.in, configure: Regenerated.
2003-06-29 04:01:39 +00:00
Daniel Jacobowitz 94e1050898 * configure.in: Check for stdlib.h.
* configure: Regenerated.
	* config.in: Regenerated.
2003-03-17 19:39:53 +00:00
Kevin Buettner 18ff05380b * gdbserver/configure.in (unistd.h): Add to AC_CHECK_HEADERS list.
* gdbserver/configure: Regenerate.
	* gdbserver/config.in: Regenerate.
2002-07-24 21:30:46 +00:00
Daniel Jacobowitz 0d62e5e807 2002-06-11 Daniel Jacobowitz <drow@mvista.com>
* gdbserver/thread-db.c: New file.
	* gdbserver/proc-service.c: New file.
	* gdbserver/acinclude.m4: New file.
	* gdbserver/Makefile.in: Add GDBSERVER_LIBS, gdb_proc_service_h,
	proc-service.o, and thread-db.o.
	(linux-low.o): Add USE_THREAD_DB.
	* gdbserver/acconfig.h: Add HAVE_PRGREGSET_T, HAVE_PRFPREGSET_T,
	HAVE_LWPID_T, HAVE_PSADDR_T, and PRFPREGSET_T_BROKEN.
	* gdbserver/aclocal.m4: Regenerated.
	* gdbserver/config.in: Regenerated.
	* gdbserver/configure: Regenerated.
	* gdbserver/configure.in: Check for proc_service.h, sys/procfs.h,
	thread_db.h, and linux/elf.h headrs.
	Check for lwpid_t, psaddr_t, prgregset_t, prfpregset_t, and
	PRFPREGSET_T_BROKEN.  Introduce srv_thread_depfiles and USE_THREAD_DB.
	Check for -lthread_db and thread support.
	* gdbserver/configure.srv: Enable thread_db support for ARM, i386, MIPS,
	PowerPC, and SuperH.
	* gdbserver/i387-fp.c: Constify arguments.
	* gdbserver/i387-fp.h: Likewise.
	* gdbserver/inferiors.c: (struct thread_info): Renamed from
	`struct inferior_info'.  Remove PID member.  Use generic inferior
	list header.  All uses updated.
	(inferiors, signal_pid): Removed.
	(all_threads): New variable.
	(get_thread): Define.
	(add_inferior_to_list): New function.
	(for_each_inferior): New function.
	(change_inferior_id): New function.
	(add_inferior): Removed.
	(remove_inferior): New function.
	(add_thread): New function.
	(free_one_thread): New function.
	(remove_thread): New function.
	(clear_inferiors): Use for_each_inferior and free_one_thread.
	(find_inferior): New function.
	(find_inferior_id): New function.
	(inferior_target_data): Update argument type.
	(set_inferior_target_data): Likewise.
	(inferior_regcache_data): Likewise.
	(set_inferior_regcache_data): Likewise.
	* gdbserver/linux-low.c (linux_bp_reinsert): Remove.
	(all_processes, stopping_threads, using_thrads)
	(struct pending_signals, debug_threads, pid_of): New.
	(inferior_pid): Replace with macro.
	(struct inferior_linux_data): Remove.
	(get_stop_pc, add_process): New functions.
	(linux_create_inferior): Restore SIGRTMIN+1 before calling exec.
	Use add_process and add_thread.
	(linux_attach_lwp): New function, based on old linux_attach.  Use
	add_process and add_thread.  Set stop_expected for new threads.
	(linux_attach): New function.
	(linux_kill_one_process): New function.
	(linux_kill): Kill all LWPs.
	(linux_thread_alive): Use find_inferior_id.
	(check_removed_breakpoints, status_pending_p): New functions.
	(linux_wait_for_process): Renamed from linux_wait_for_one_inferior.
	Update.  Use WNOHANG.  Wait for cloned processes also.  Update process
	struct for the found process.
	(linux_wait_for_event): New function.
	(linux_wait): Use it.  Support LWPs.
	(send_sigstop, wait_for_sigstop, stop_all_processes)
	(linux_resume_one_process, linux_continue_one_process): New functions.
	(linux_resume): Support LWPs.
	(REGISTER_RAW_SIZE): Remove.
	(fetch_register): Use register_size instead.  Call supply_register.
	(usr_store_inferior_registers): Likewise.  Call collect_register.
	Fix recursive case.
	(regsets_fetch_inferior_registers): Improve error message.
	(regsets_store_inferior_registers): Add debugging.
	(linux_look_up_symbols): Call thread_db_init if USE_THREAD_DB.
	(unstopped_p, linux_signal_pid): New functions.
	(linux_target_ops): Add linux_signal_pid.
	(linux_init_signals): New function.
	(initialize_low): Call it.  Initialize using_threads.
	* gdbserver/regcache.c (inferior_regcache_data): Add valid
	flag.
	(get_regcache): Fetch registers lazily.  Add fetch argument
	and update all callers.
	(regcache_invalidate_one, regcache_invalidate): New
	functions.
	(new_register_cache): Renamed from create_register_cache.
	Return the new regcache.
	(free_register_cache): Change argument to a void *.
	(registers_to_string, registers_from_string): Call get_regcache
	with fetch flag set.
	(register_data): Make static.  Pass fetch flag to get_regcache.
	(supply_register): Call get_regcache with fetch flag clear.
	(collect_register): Call get_regcache with fetch flag set.
	(collect_register_as_string): New function.
	* gdbserver/regcache.h: Update.
	* gdbserver/remote-utils.c (putpkt): Flush after debug output and use
	stderr.
	Handle input interrupts while waiting for an ACK.
	(input_interrupt): Use signal_pid method.
	(getpkt): Flush after debug output and use stderr.
	(outreg): Use collect_register_as_string.
	(new_thread_notify, dead_thread_notify): New functions.
	(prepare_resume_reply): Check using_threads.  Set thread_from_wait
	and general_thread.
	(look_up_one_symbol): Flush after debug output.
	* gdbserver/server.c (step_thread, server_waiting): New variables.
	(start_inferior): Don't use signal_pid.  Update call to mywait.
	(attach_inferior): Update call to mywait.
	(handle_query): Handle qfThreadInfo and qsThreadInfo.
	(main): Don't fetch/store registers explicitly.  Use
	set_desired_inferior.  Support proposed ``Hs'' packet.  Update
	calls to mywait.
	* gdbserver/server.h: Update.
	(struct inferior_list, struct_inferior_list_entry): New.
	* gdbserver/target.c (set_desired_inferior): New.
	(write_inferior_memory): Constify.
	(mywait): New function.
	* gdbserver/target.h: Update.
	(struct target_ops): New signal_pid method.
	(mywait): Removed macro, added prototype.

	* gdbserver/linux-low.h (regset_func): Removed.
	(regset_fill_func, regset_store_func): New.
	(enum regset_type): New.
	(struct regset_info): Add type field.  Use new operation types.
	(struct linux_target_ops): stop_pc renamed to get_pc.
	Add decr_pc_after_break and breakpoint_at.
	(get_process, get_thread_proess, get_process_thread)
	(strut process_info, all_processes, linux_attach_lwp)
	(thread_db_init): New.

	* gdbserver/linux-arm-low.c (arm_get_pc, arm_set_pc,
	arm_breakpoint, arm_breakpoint_len, arm_breakpoint_at): New.
	(the_low_target): Add new members.
	* gdbserver/linux-i386-low.c (i386_store_gregset, i386_store_fpregset)
	(i386_store_fpxregset): Constify.
	(target_regsets): Add new kind identifier.
	(i386_get_pc): Renamed from i386_stop_pc.  Simplify.
	(i386_set_pc): Add debugging.
	(i386_breakpoint_at): New function.
	(the_low_target): Add new members.
	* gdbserver/linux-mips-low.c (mips_get_pc, mips_set_pc)
	(mips_breakpoint, mips_breakpoint_len, mips_reinsert_addr)
	(mips_breakpoint_at): New.
	(the_low_target): Add new members.
	* gdbserver/linux-ppc-low.c (ppc_get_pc, ppc_set_pc)
	(ppc_breakpoint, ppc_breakpoint_len, ppc_breakpoint_at): New.
	(the_low_target): Add new members.
	* gdbserver/linux-sh-low.c (sh_get_pc, sh_set_pc)
	(sh_breakpoint, sh_breakpoint_len, sh_breakpoint_at): New.
	(the_low_target): Add new members.
	* gdbserver/linux-x86-64-low.c (target_regsets): Add new kind
	identifier.
2002-06-11 17:32:40 +00:00
Daniel Jacobowitz c3a3ccc760 2002-04-09 Daniel Jacobowitz <drow@mvista.com>
* gdbserver/Makefile.in: Add stamp-h target.
        * gdbserver/configure.in: Create stamp-h.
        * gdbserver/configure: Regenerated.
2002-04-09 21:25:29 +00:00
Daniel Jacobowitz 0729219dab 2002-04-09 Daniel Jacobowitz <drow@mvista.com>
* gdbserver/Makefile.in: Add WARN_CFLAGS.  Update configury
        dependencies.
        * gdbserver/configure.in: Check for <string.h>
        * gdbserver/configure: Regenerate.
        * gdbserver/config.in: Regenerate.
        * gdbserver/gdbreplay.c: Include needed system headers.
        (remote_open): Remove strchr prototype.
        * gdbserver/linux-low.h: Correct #ifdef to HAVE_LINUX_USRREGS.
        * gdbserver/regcache.c (supply_register): Change buf argument to const void *.
        (supply_register_by_name): Likewise.
        (collect_register): Change buf argument to void *.
        (collect_register_by_name): Likewise.
        * gdbserver/regcache.h: Add missing prototypes.
        * gdbserver/remote-utils.c: Include <arpa/inet.h> for inet_ntoa.
        * gdbserver/server.c (handle_query): New function.
        (attached): New static variable, moved out of main.
        (main): Quiet longjmp clobber warnings.
        * gdbserver/server.h: Add ATTR_NORETURN and ATTR_FORMAT.  Update prototypes.
        * gdbserver/utils.c (error): Remove NORETURN.
        (fatal): Likewise.
2002-04-09 21:11:35 +00:00
Daniel Jacobowitz 58caa3dcdb 2002-02-27 Daniel Jacobowitz <drow@mvista.com>
* gdbserver/acconfig.h: New file.
        * gdbserver/i387-fp.c: New file.
        * gdbserver/i387-fp.h: New file.
        * gdbserver/linux-x86-64.c: New file.
        * regformats/reg-x86-64.dat: New file.
        * configure.tgt: Add x86_64-*-linux* gdbserver support.
        & gdbserver/configure.srv: Add x86_64-*-linux* and regset support.
        * gdbserver/configure.in: Add support for regsets.
        * gdbserver/config.in: Regenerate.
        * gdbserver/configure: Regenerate.
        * gdbserver/Makefile.in: Likewise.  Add $(linux_low_h).
        * gdbserver/linux-low.h: New file.
        * gdbserver/linux-low.c: Include "linux-low.h".  Add support
        for regsets.
        * gdbserver/linux-arm-low.c: Include "linux-low.h".
        * gdbserver/linux-ia64-low.c: Include "linux-low.h".
        * gdbserver/linux-m68k-low.c: Include "linux-low.h".
        * gdbserver/linux-mips-low.c: Include "linux-low.h".
        * gdbserver/linux-ppc-low.c: Include "linux-low.h".
        * gdbserver/linux-sh-low.c: Include "linux-low.h".
        * gdbserver/linux-i386-low.c: Include "linux-low.h".  Include
        "i387-fp.h".  Add PTRACE_GETREGS and friends.
        * gdbserver/regcache.c (supply_register): New function.
        (supply_register_by_name): New function.
        (collect_register): New function.
        (collect_register_by_name): New function.
2002-02-27 07:07:49 +00:00
Daniel Jacobowitz 7ea814144a 2002-02-24 Daniel Jacobowitz <drow@mvista.com>
* gdbserver/configure.srv: New file.
        * gdbserver/configure.in: Use configure.srv instead
        of the host/target makefile fragments.  Set GDBSERVER_DEPFILES
        from it.
        * gdbserver/configure: Regenerated.
        * gdbserver/terminal.h: New file.
        * gdbserver/Makefile.in: Update for configure changes.  Remove
        more unneeded include paths.
2002-02-25 02:49:02 +00:00
Daniel Jacobowitz ee6e2b82d8 2002-02-20 Daniel Jacobowitz <drow@mvista.com>
* gdbserver/configure.in: Remove AM_PROC_CC_STDC.  Change
        AC_STDC_HEADERS to AC_HEADER_STDC.
        * gdbserver/configure: Regenerated.
2002-02-20 16:46:36 +00:00
Daniel Jacobowitz 845630402f 2002-02-19 Daniel Jacobowitz <drow@mvista.com>
* gdbserver/README: Update documentation.
        * gdbserver/configure.in: Update configury to match documentation.
        * gdbserver/Makefile.in: Likewise.
        * gdbserver/configure: Regenerated.
        * gdbserver/aclocal.m4: New file, generated by aclocal.
        * gdbserver/config.in: New file, generated by autoheader.
2002-02-19 23:48:14 +00:00