summaryrefslogtreecommitdiff
path: root/gdb/gdbserver/Makefile.in
Commit message (Collapse)AuthorAgeFilesLines
* Move gdbserver to top levelTom Tromey2020-02-071-719/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch moves gdbserver to the top level. This patch is as close to a pure move as possible -- gdbserver still builds its own variant of gnulib and gdbsupport. Changing this will be done in a separate patch. [v2] Note that, per Simon's review comment, this patch changes the tree so that gdbserver is not built for or1k or score. This makes sense, because there is apparently not actually a gdbserver port here. [v3] This version of the patch also splits out some configury into a new file, gdbserver/configure.host, so that the top-level configure script can simply rely on it in order to decide whether gdbserver should be built. [v4] This version adds documentation and removes some unnecessary top-level dependencies. [v5] Update docs to mention "make all-gdbserver" and change how top-level configure decides whether to build gdbserver, switching to a single, shared script. Tested by the buildbot. ChangeLog 2020-02-07 Tom Tromey <tom@tromey.com> Pedro Alves <palves@redhat.com> * src-release.sh (GDB_SUPPORT_DIRS): Add gdbserver. * gdbserver: New directory, moved from gdb/gdbserver. * configure.ac (host_tools): Add gdbserver. Only build gdbserver on certain systems. * Makefile.in, configure: Rebuild. * Makefile.def (host_modules, dependencies): Add gdbserver. * MAINTAINERS: Add gdbserver. gdb/ChangeLog 2020-02-07 Tom Tromey <tom@tromey.com> * README: Update gdbserver documentation. * gdbserver: Move to top level. * configure.tgt (build_gdbserver): Remove. * configure.ac: Remove --enable-gdbserver. * configure: Rebuild. * Makefile.in (distclean): Don't mention gdbserver. Change-Id: I826b7565b54604711dc7a11edea0499cd51ff39e
* Add install-strip target to gdbserverHannes Domani2020-01-241-0/+10
| | | | | | | | | | | | | So far this was only possible indirectly when invoked from the gdb directory. This makes the install-strip target independent from gdb. 2020-01-24 Hannes Domani <ssbssa@yahoo.de> * Makefile.in (install-strip): New target. (install_sh, INSTALL_STRIP_PROGRAM, STRIP): New variables. * aclocal.m4: Regenerate. * configure: Regenerate. * configure.ac: Add AM_PROG_INSTALL_STRIP.
* gdbserver: Make `make TAGS' actually workMaciej W. Rozycki2020-01-241-17/+19
| | | | | | | | | | | | | | | | | | | | | | | | | Fix a: make: *** No rule to make target '.../gdb/gdbserver/arch/arm.c', needed by 'TAGS'. Stop. error produced by `make TAGS' by making the list of sources processed match actual file locations and by moving host-specific object files listed in DEPFILES to nat/ or target/ subdirectories as appropriate so that the location of the corresponding source file can be mechanically determined. gdb/gdbserver/ * Makefile.in (SFILES): Adjust paths to point to real files. (OBS): Move waitstatus.o to target/waitstatus.o. (TAGS): Transform paths appropriately. (%.o): Rename to... (nat/%.o): ... this pattern rule. (%.o): Rename to... (target/%.o): ... this pattern rule. * configure.srv: Adjust paths throughout to include nat/ prefix with the revant files. * configure.ac: Add `nat' and `target' to CONFIG_SRC_SUBDIR. * configure: Regenerate.
* gdbserver: Remove a stale TAGS recipe for config filesMaciej W. Rozycki2020-01-241-3/+1
| | | | | | | | | | Complement commit 7ea814144a31 ("Fully disentangle gdb and gdbserver"), <https://sourceware.org/ml/gdb-patches/2002-02/msg00692.html> (from 2002!), and remove a recipe to include config files in `make TAGS', which are no longer used by `gdbserver' as from that commit. gdb/gdbserver/ * Makefile.in (TAGS): Remove config files from the recipe.
* Move gdbsupport to the top levelTom Tromey2020-01-141-31/+33
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch moves the gdbsupport directory to the top level. This is the next step in the ongoing project to move gdbserver to the top level. The bulk of this patch was created by "git mv gdb/gdbsupport gdbsupport". This patch then adds a build system to gdbsupport and wires it into the top level. Then it changes gdb to use the top-level build. gdbserver, on the other hand, is not yet changed. It still does its own build of gdbsupport. ChangeLog 2020-01-14 Tom Tromey <tom@tromey.com> * src-release.sh (GDB_SUPPORT_DIRS): Add gdbsupport. * MAINTAINERS: Add gdbsupport. * configure: Rebuild. * configure.ac (configdirs): Add gdbsupport. * gdbsupport: New directory, move from gdb/gdbsupport. * Makefile.def (host_modules, dependencies): Add gnulib. * Makefile.in: Rebuild. gdb/ChangeLog 2020-01-14 Tom Tromey <tom@tromey.com> * nat/x86-linux-dregs.c: Include configh.h. * nat/linux-ptrace.c: Include configh.h. * nat/linux-btrace.c: Include configh.h. * defs.h: Include config.h, bfd.h. * configure.ac: Don't source common.host. (CONFIG_OBS, CONFIG_SRCS): Remove gdbsupport files. * configure: Rebuild. * acinclude.m4: Update path. * Makefile.in (SUPPORT, LIBSUPPORT, INCSUPPORT): New variables. (CONFIG_SRC_SUBDIR): Remove gdbsupport. (INTERNAL_CFLAGS_BASE): Add INCSUPPORT. (CLIBS): Add LIBSUPPORT. (CDEPS): Likewise. (COMMON_SFILES): Remove gdbsupport files. (HFILES_NO_SRCDIR): Likewise. (stamp-version): Update path to create-version.sh. (ALLDEPFILES): Remove gdbsupport files. gdb/gdbserver/ChangeLog 2020-01-14 Tom Tromey <tom@tromey.com> * server.h: Include config.h. * gdbreplay.c: Include config.h. * configure: Rebuild. * configure.ac: Don't source common.host. * acinclude.m4: Update path. * Makefile.in (INCSUPPORT): New variable. (INCLUDE_CFLAGS): Add INCSUPPORT. (SFILES): Update paths. (version-generated.c): Update path to create-version.sh. (gdbsupport/%-ipa.o, gdbsupport/%.o): Update paths. gdbsupport/ChangeLog 2020-01-14 Tom Tromey <tom@tromey.com> * common-defs.h: Add GDBSERVER case. Update includes. * acinclude.m4, aclocal.m4, config.in, configure, configure.ac, Makefile.am, Makefile.in, README: New files. * Moved from ../gdb/gdbsupport/ Change-Id: I07632e7798635c1bab389bf885971e584fb4bb78
* gdbserver: remove rule for files from regformats/i386Simon Marchi2020-01-131-3/+0
| | | | | | | | | | The dat files in regformats/i386 were removed a while ago, this rule is no longer necessary. gdb/gdbserver/ChangeLog: * Makefile.in (%-generated.c): Remove rule for files from regformats/i386.
* gdbserver: fix Makefile dependency of regformat-generated files on regdat.shSimon Marchi2020-01-131-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | The intent of the rules modified by this patch is that the *-generated.c files generated by regdat.sh are re-generated in the event that regdat.sh is modified. However, if I build, touch regdat.sh, and build again, the files are not re-generated during the second build. This is because regdat.sh is specified as an order-only dependency [1], after the pipe. Make therefore only ensures that regdat.sh exists before generating the target file, it doesn't check the timestamp of regdat.sh. This patch changes it to be a regular prerequisite. The rules use the $< variable, which is substituted by the first prerequisite only, so the command lines won't change. [1] https://www.gnu.org/software/make/manual/html_node/Prerequisite-Types.html gdb/gdbserver/ChangeLog: * Makefile.in (%-generated.c): Make $(regdat_sh) a regular prerequisite.
* Improve process exit status macros on MinGWEli Zaretskii2020-01-061-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When a Windows program is terminated by a fatal exception, its exit code is the value of that exception, as defined by the various EXCEPTION_* symbols in the Windows API headers. This commit emulates WTERMSIG etc. by translating the fatal exception codes to more-or-less equivalent Posix signals. gdb/ChangeLog: 2020-01-06 Eli Zaretskii <eliz@gnu.org> Pedro Alves <palves@redhat.com> * Makefile.in (COMMON_SFILES): Add gdbsupport/gdb_wait.c. * windows-tdep.c: New enumeration of WINDOWS_SIG* signals. (windows_gdb_signal_to_target): New function, uses the above enumeration to convert GDB internal signal codes to equivalent Windows codes. (windows_init_abi): Call set_gdbarch_gdb_signal_to_target. * windows-nat.c: Include "gdb_wait.h". (get_windows_debug_event): Extract the fatal exception from the exit status and convert to the equivalent Posix signal number. * cli/cli-cmds.c (exit_status_set_internal_vars): Account for the possibility that WTERMSIG returns GDB_SIGNAL_UNKNOWN. * gdbsupport/gdb_wait.c: New file, implements windows_status_to_termsig. * gdbsupport/gdb_wait.h (WIFEXITED, WIFSIGNALED, WEXITSTATUS) (WTERMSIG) [__MINGW32__]: Separate definitions for MinGW. gdb/gdbserver/ChangeLog: 2020-01-06 Eli Zaretskii <eliz@gnu.org> Pedro Alves <palves@redhat.com> * win32-low.c (get_child_debug_event): Extract the fatal exception from the exit status and convert to the equivalent Posix signal number. (win32_wait): Allow TARGET_WAITKIND_SIGNALLED status as well. * Makefile.in (OBS, SFILES): Add gdb_wait.[co].
* Fix install-strip for cross-compilationHannes Domani2020-01-011-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The variable INSTALL_PROGRAM_ENV sets up STRIPPROG for the cross-compiler. If this is not done, the host 'strip' is used, and fails: /bin/sh /c/src/repos/binutils-gdb.git/install-sh -c -s gdb.exe \ /gdb/gdb64-git/bin/$transformed_name.exe strip.exe:C:/gdb/gdb64-git/bin/_inst.33599_: file format not recognized With this change, it's fine: STRIPPROG='x86_64-w64-mingw32-strip' \ /bin/sh /c/src/repos/binutils-gdb.git/install-sh -c -s gdb.exe \ /gdb/gdb64-git/bin/$transformed_name.exe gdb/ChangeLog: 2020-01-01 Hannes Domani <ssbssa@yahoo.de> * Makefile.in: Use INSTALL_PROGRAM_ENV. gdb/gdbserver/ChangeLog: 2020-01-01 Hannes Domani <ssbssa@yahoo.de> * Makefile.in: Use INSTALL_PROGRAM_ENV.
* Update copyright year range in all GDB files.Joel Brobecker2020-01-011-1/+1
| | | | | | gdb/ChangeLog: Update copyright year range in all GDB files.
* Fix build with GNU Make 3.81Bernd Edlinger2019-12-191-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | GNU Make 3.81 is apparently confused when the same source file is processed by a pattern rule and an explicit rule at the same time with different output file. The pattern %.o: ../%.c and alloc-ipa.o: ../alloc.c both have the source ../alloc.c but two independent object files alloc.o and alloc-ipa.o, so while building gdbserver I see the following message: make[4]: Circular alloc-ipa.o <- ../alloc.c dependency dropped. CXX alloc-ipa.o g++: warning: '-x c++' after last input file has no effect g++: fatal error: no input files compilation terminated. In the make debug output I see the pattern is first correct: alloc-ipa.o: ../alloc.c | config.h build-gnulib-gdbserver/import/string.h $(IPAGENT_COMPILE) $(WARN_CFLAGS_NO_FORMAT) $< $(POSTCOMPILE) But after the "Circular" dependency is dropped, the pattern is changed to: alloc-ipa.o: | config.h build-gnulib-gdbserver/import/string.h $(IPAGENT_COMPILE) $(WARN_CFLAGS_NO_FORMAT) $< $(POSTCOMPILE) So indeed now $< is empty, and the build step fails. This happens only when alloc.o needs to be built, when alloc.o was already built, the build succeeds, but it takes often several attempts until the build succeeds. By rewriting the alloc-ipa.c: ../alloc.c rule into a pattern rule, the problem goes away. While already at it, this patch removes also the $(WARN_CFLAGS_NO_FORMAT) from the build rule, which is just a copy/paste thing that is not necessary for alloc.c at all.
* Replace the remaining uses of strerror with safe_strerrorChristian Biesinger2019-12-101-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | To do that, this patch makes IPA compile safe-strerror as well. Because it doesn't use Gnulib, it calls the Glibc version of strerror_r directly. Consequently this patch also removes the configure checks for strerror. gdb/ChangeLog: 2019-12-10 Christian Biesinger <cbiesinger@google.com> * config.in: Regenerate. * configure: Regenerate. * gdbsupport/agent.c (gdb_connect_sync_socket): Call safe_strerror instead of strerror. * gdbsupport/common.m4: Don't check for strerror. * gdbsupport/safe-strerror.c: Support both the glibc version of strerror_r and the XSI version. gdb/gdbserver/ChangeLog: 2019-12-10 Christian Biesinger <cbiesinger@google.com> * Makefile.in: Add safe-strerror.c to gdbreplay and IPA, and change UNDO_GNULIB_CFLAGS to undo strerror_r instead of strerror. * config.in: Regenerate. * configure: Regenerate. * configure.ac: Don't check for strerror. * linux-i386-ipa.c (initialize_fast_tracepoint_trampoline_buffer): Call safe_strerror instead of strerror. * server.h (strerror): Remove this now-unnecessary declaration. * tracepoint.c (init_named_socket): Call safe_strerror instead of strerror. (gdb_agent_helper_thread): Likewise. * utils.c (perror_with_name): Likewise. Change-Id: I74848f072dcde75cb55c435ef9398dc8f958cd73
* Add configure check for std::threadTom Tromey2019-11-261-2/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This adds a configure check for std::thread. This is needed because std::thread is not available on some systems, like some versions of mingw and DJGPP. This also adds configury to make sure that a threaded gdb links against the correct threading library (-lpthread or the like), and passes the right flags (e.g., -pthread) to the compilations. Note that this also links gdbserver against the thread library. This is not strictly necessary at this point in the series, but a later patch will change gdbsupport to use pthread_sigmask, at which point this will be needed. gdb/ChangeLog 2019-11-26 Tom Tromey <tom@tromey.com> * acinclude.m4: Include ax_pthread.m4. * Makefile.in (PTHREAD_CFLAGS, PTHREAD_LIBS): New variables. (INTERNAL_CFLAGS_BASE): Use PTHREAD_CFLAGS. (CLIBS): Use PTHREAD_LIBS. (aclocal_m4_deps): Add ax_pthread.m4. * config.in, configure: Rebuild. * gdbsupport/common.m4 (GDB_AC_COMMON): Check for std::thread. gdb/gdbserver/ChangeLog 2019-11-26 Tom Tromey <tom@tromey.com> * Makefile.in (PTHREAD_CFLAGS, PTHREAD_LIBS): New variables. (INTERNAL_CFLAGS_BASE): Use PTHREAD_CFLAGS. (GDBSERVER_LIBS): Use PTHREAD_LIBS. * acinclude.m4: Include ax_pthread.m4. * config.in, configure: Rebuild. Change-Id: I00ec55db6077f2615421a93461fc3be57e916aa0
* Use gnulib's strerror_r on MinGWChristian Biesinger2019-11-151-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There is no need to keep mingw-strerror around; we can just always use the code from posix-strerror. The main reason we had that code, it seems, is to handle winsock error codes, but gnulib's version handles those. Unfortunately the code can't be moved into common-utils.c because libinproctrace.so uses common-utils but not gnulib. gdb/ChangeLog: 2019-11-15 Christian Biesinger <cbiesinger@google.com> * Makefile.in: Replace {posix,mingw}-strerror.c with safe-strerror.c. * configure: Regenerate. * configure.ac: Don't source common.host. * gdbsupport/common.host: Remove. * gdbsupport/mingw-strerror.c: Remove. * gdbsupport/posix-strerror.c: Rename to... * gdbsupport/safe-strerror.c: ...this. gdb/gdbserver/ChangeLog: 2019-11-15 Christian Biesinger <cbiesinger@google.com> * Makefile.in: Add safe-strerror.c. * configure: Regenerate. * configure.ac: Don't source common.host. Change-Id: I9e6d8a752fc398784201f370cafee65e0ea05474
* Fix creation of stamp-h by gdb's configure scriptTom Tromey2019-10-171-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | I happened to notice that "make" would always print: CONFIG_HEADERS=config.h:config.in \ CONFIG_COMMANDS="default depdir" \ CONFIG_FILES= \ CONFIG_LINKS= \ /bin/sh config.status config.status: creating config.h config.status: config.h is unchanged on every rebuild. This seems to have changed due to an autoconf upgrade at some point in the past. In the autoconf gdb uses now, it works to use AC_CONFIG_HEADERS and then create the stamp file via the "commands" argument. This patch also fixes up Makefile.in to use the new-style config.status invocation. It's no longer necessary to pass the output file names via environment variables. gdb/ChangeLog 2019-10-17 Tom Tromey <tromey@adacore.com> * configure: Rebuild. * configure.ac: Use AC_CONFIG_HEADERS. Create stamp-h there, not in AC_CONFIG_FILES invocation. * Makefile.in (Makefile, data-directory/Makefile, stamp-h): Use new-style config.status invocation. gdb/gdbserver/ChangeLog 2019-10-17 Tom Tromey <tromey@adacore.com> * configure: Rebuild. * configure.ac: Use AC_CONFIG_HEADERS. Create stamp-h there, not in AC_CONFIG_FILES invocation. * Makefile.in (stamp-h, Makefile): Use new-style config.status invocation. Change-Id: Ia0530d1c5b9756812d29ddb8dc1062326155e61e
* gdb/gdbserver: Remove reference to vec-ipa.oAndrew Burgess2019-10-151-1/+0
| | | | | | | | | | | | | | | | | | | | | | | This comit: commit 0dc327459b19e6765c8fe80957f5c8620611628e Date: Mon Oct 7 16:38:53 2019 +0100 gdb: Remove vec.{c,h} and update code to not include vec.h Broke the GDB build due to leaving a reference to vec-ipa.o in the Makefile.in, this file is built from vec.c which has been removed. I got away with this as I had an old version of the vec-ipa.o file still in my build tree. With this commit in place a clean build now completed successfully. gdb/ChangeLog: * Makefile.in: Remove references to vec-ipa.o. Change-Id: I4cf55951158dd7ee8f60cd054311a7c367e1d7bf
* gdb: Remove vec.{c,h} and update code to not include vec.hAndrew Burgess2019-10-151-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Removes vec.c and vec.h from the source tree, and remove all the remaining includes of vec.h. There should be no user visible changes after this commit. I did have a few issues rebuilding GDB after applying this patch due to cached dependencies, I found that running this command in the build directory resolved my build issues without requiring a 'make clean': rm -fr gdb/gdbserver/gdbsupport/.deps/ gdb/ChangeLog: * Makefile.in: Remove references to vec.h and vec.c. * aarch64-tdep.c: No longer include vec.h. * ada-lang.c: Likewise. * ada-lang.h: Likewise. * arm-tdep.c: Likewise. * ax.h: Likewise. * breakpoint.h: Likewise. * charset.c: Likewise. * cp-support.h: Likewise. * dtrace-probe.c: Likewise. * dwarf2read.c: Likewise. * extension.h: Likewise. * gdb_bfd.c: Likewise. * gdbsupport/gdb_vecs.h: Likewise. * gdbsupport/vec.c: Remove. * gdbsupport/vec.h: Remove. * gdbthread.h: Likewise. * guile/scm-type.c: Likewise. * inline-frame.c: Likewise. * machoread.c: Likewise. * memattr.c: Likewise. * memrange.h: Likewise. * namespace.h: Likewise. * nat/linux-btrace.h: Likewise. * osdata.c: Likewise. * parser-defs.h: Likewise. * progspace.h: Likewise. * python/py-type.c: Likewise. * record-btrace.c: Likewise. * rust-exp.y: Likewise. * solib-target.c: Likewise. * stap-probe.c: Likewise. * target-descriptions.c: Likewise. * target-memory.c: Likewise. * target.h: Likewise. * varobj.c: Likewise. * varobj.h: Likewise. * xml-support.h: Likewise. gdb/gdbserver/ChangeLog: * Makefile.in: Remove references to vec.c. Change-Id: I0c91d7170bf1b5e992a387fcd9fe4f2abe343bb5
* Fix type of startup_with_shell in gdbserverTom Tromey2019-10-021-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | startup_with_shell was changed to be of "bool" type, but I noticed that the definition in gdbserver disagreed. This disagreement caused some regressions on a big-endian machine. This patch removes the redundant declaration and definition of startup_with_shell and ensures that such clashes will be diagnosed. This moves the declaration to common-inferior.h, and introduces a new common-inferior.c, as suggested by Pedro. gdb/ChangeLog 2019-10-02 Tom Tromey <tromey@adacore.com> * Makefile.in (COMMON_SFILES): Add common-inferior.c. * gdbsupport/common-inferior.c: New file. * infcmd.c (startup_with_shell): Don't define. * nat/fork-inferior.h (startup_with_shell): Don't declare. * gdbsupport/common-inferior.h (startup_with_shell): Declare. * inferior.h (startup_with_shell): Don't declare. gdb/gdbserver/ChangeLog 2019-10-02 Tom Tromey <tromey@adacore.com> * Makefile.in (SFILES): Add common-inferior.c. (OBS): Add common-inferior.o. * server.c (startup_with_shell): Don't define.
* Move gdb-dlfcn.[ch] to gdbsupport/Sergio Durigan Junior2019-08-231-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | I need to use 'gdb_dlopen' inside 'gdbsupport/', but it's not yet supported there. This commit moves 'gdb-dlfcn.[ch]' to 'gdbsupport/', which makes it available also on gdbserver. gdb/ChangeLog: 2019-08-23 Sergio Durigan Junior <sergiodj@redhat.com> * configure.ac: Don't check for 'dlfcn.h' (moved to gdbsupport/common.m4). * Makefile.in (COMMON_SFILES): Move 'gdb-dlfcn.c' to 'gdbsupport/'. (HFILES_NO_SRCDIR): Likewise, for 'gdb-dlfcn.h'. * compile/compile-c-support.c: Include 'gdbsupport/gdb-dlfcn.h'. * gdbsupport/common.m4: Check for 'dlfcn.h'. * gdb-dlfcn.c: Move to... * gdbsupport/gdb-dlfcn.c: ... here. * gdb-dlfcn.h: Move to... * gdbsupport/gdb-dlfcn.h: ... here. gdb/gdbserver/ChangeLog: 2019-08-23 Sergio Durigan Junior <sergiodj@redhat.com> * Makefile.in (SFILES): Add 'gdbsupport/gdb-dlfcn.c'. (OBS): Add 'gdbsupport/gdb-dlfcn.o'. * config.in: Regenerate. * configure: Regenerate.
* Rename common to gdbsupportTom Tromey2019-07-091-68/+68
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is the next patch in the ongoing series to move gdbsever to the top level. This patch just renames the "common" directory. The idea is to do this move in two parts: first rename the directory (this patch), then move the directory to the top. This approach makes the patches a bit more tractable. I chose the name "gdbsupport" for the directory. However, as this patch was largely written by sed, we could pick a new name without too much difficulty. Tested by the buildbot. gdb/ChangeLog 2019-07-09 Tom Tromey <tom@tromey.com> * contrib/ari/gdb_ari.sh: Change common to gdbsupport. * configure: Rebuild. * configure.ac: Change common to gdbsupport. * gdbsupport: Rename from common. * acinclude.m4: Change common to gdbsupport. * Makefile.in (CONFIG_SRC_SUBDIR, COMMON_SFILES) (HFILES_NO_SRCDIR, stamp-version, ALLDEPFILES): Change common to gdbsupport. * aarch64-tdep.c, ada-lang.c, ada-lang.h, agent.c, alloc.c, amd64-darwin-tdep.c, amd64-dicos-tdep.c, amd64-fbsd-nat.c, amd64-fbsd-tdep.c, amd64-linux-nat.c, amd64-linux-tdep.c, amd64-nbsd-tdep.c, amd64-obsd-tdep.c, amd64-sol2-tdep.c, amd64-tdep.c, amd64-windows-tdep.c, arch-utils.c, arch/aarch64-insn.c, arch/aarch64.c, arch/aarch64.h, arch/amd64.c, arch/amd64.h, arch/arm-get-next-pcs.c, arch/arm-linux.c, arch/arm.c, arch/i386.c, arch/i386.h, arch/ppc-linux-common.c, arch/riscv.c, arch/riscv.h, arch/tic6x.c, arm-tdep.c, auto-load.c, auxv.c, ax-gdb.c, ax-general.c, ax.h, breakpoint.c, breakpoint.h, btrace.c, btrace.h, build-id.c, build-id.h, c-lang.h, charset.c, charset.h, cli/cli-cmds.c, cli/cli-cmds.h, cli/cli-decode.c, cli/cli-dump.c, cli/cli-option.h, cli/cli-script.c, coff-pe-read.c, command.h, compile/compile-c-support.c, compile/compile-c.h, compile/compile-cplus-symbols.c, compile/compile-cplus-types.c, compile/compile-cplus.h, compile/compile-loc2c.c, compile/compile.c, completer.c, completer.h, contrib/ari/gdb_ari.sh, corefile.c, corelow.c, cp-support.c, cp-support.h, cp-valprint.c, csky-tdep.c, ctf.c, darwin-nat.c, debug.c, defs.h, disasm-selftests.c, disasm.c, disasm.h, dtrace-probe.c, dwarf-index-cache.c, dwarf-index-cache.h, dwarf-index-write.c, dwarf2-frame.c, dwarf2expr.c, dwarf2loc.c, dwarf2read.c, event-loop.c, event-top.c, exceptions.c, exec.c, extension.h, fbsd-nat.c, features/aarch64-core.c, features/aarch64-fpu.c, features/aarch64-pauth.c, features/aarch64-sve.c, features/i386/32bit-avx.c, features/i386/32bit-avx512.c, features/i386/32bit-core.c, features/i386/32bit-linux.c, features/i386/32bit-mpx.c, features/i386/32bit-pkeys.c, features/i386/32bit-segments.c, features/i386/32bit-sse.c, features/i386/64bit-avx.c, features/i386/64bit-avx512.c, features/i386/64bit-core.c, features/i386/64bit-linux.c, features/i386/64bit-mpx.c, features/i386/64bit-pkeys.c, features/i386/64bit-segments.c, features/i386/64bit-sse.c, features/i386/x32-core.c, features/riscv/32bit-cpu.c, features/riscv/32bit-csr.c, features/riscv/32bit-fpu.c, features/riscv/64bit-cpu.c, features/riscv/64bit-csr.c, features/riscv/64bit-fpu.c, features/tic6x-c6xp.c, features/tic6x-core.c, features/tic6x-gp.c, filename-seen-cache.h, findcmd.c, findvar.c, fork-child.c, gcore.c, gdb_bfd.c, gdb_bfd.h, gdb_proc_service.h, gdb_regex.c, gdb_select.h, gdb_usleep.c, gdbarch-selftests.c, gdbthread.h, gdbtypes.h, gnu-nat.c, go32-nat.c, guile/guile.c, guile/scm-ports.c, guile/scm-safe-call.c, guile/scm-type.c, i386-fbsd-nat.c, i386-fbsd-tdep.c, i386-go32-tdep.c, i386-linux-nat.c, i386-linux-tdep.c, i386-tdep.c, i387-tdep.c, ia64-libunwind-tdep.c, ia64-linux-nat.c, inf-child.c, inf-ptrace.c, infcall.c, infcall.h, infcmd.c, inferior-iter.h, inferior.c, inferior.h, inflow.c, inflow.h, infrun.c, infrun.h, inline-frame.c, language.h, linespec.c, linux-fork.c, linux-nat.c, linux-tdep.c, linux-thread-db.c, location.c, machoread.c, macrotab.h, main.c, maint.c, maint.h, memattr.c, memrange.h, mi/mi-cmd-break.h, mi/mi-cmd-env.c, mi/mi-cmd-stack.c, mi/mi-cmd-var.c, mi/mi-interp.c, mi/mi-main.c, mi/mi-parse.h, minsyms.c, mips-linux-tdep.c, namespace.h, nat/aarch64-linux-hw-point.c, nat/aarch64-linux-hw-point.h, nat/aarch64-linux.c, nat/aarch64-sve-linux-ptrace.c, nat/amd64-linux-siginfo.c, nat/fork-inferior.c, nat/linux-btrace.c, nat/linux-btrace.h, nat/linux-namespaces.c, nat/linux-nat.h, nat/linux-osdata.c, nat/linux-personality.c, nat/linux-procfs.c, nat/linux-ptrace.c, nat/linux-ptrace.h, nat/linux-waitpid.c, nat/mips-linux-watch.c, nat/mips-linux-watch.h, nat/ppc-linux.c, nat/x86-dregs.c, nat/x86-dregs.h, nat/x86-linux-dregs.c, nat/x86-linux.c, nto-procfs.c, nto-tdep.c, objfile-flags.h, objfiles.c, objfiles.h, obsd-nat.c, observable.h, osdata.c, p-valprint.c, parse.c, parser-defs.h, ppc-linux-nat.c, printcmd.c, probe.c, proc-api.c, procfs.c, producer.c, progspace.h, psymtab.h, python/py-framefilter.c, python/py-inferior.c, python/py-ref.h, python/py-type.c, python/python.c, record-btrace.c, record-full.c, record.c, record.h, regcache-dump.c, regcache.c, regcache.h, remote-fileio.c, remote-fileio.h, remote-sim.c, remote.c, riscv-tdep.c, rs6000-aix-tdep.c, rust-exp.y, s12z-tdep.c, selftest-arch.c, ser-base.c, ser-event.c, ser-pipe.c, ser-tcp.c, ser-unix.c, skip.c, solib-aix.c, solib-target.c, solib.c, source-cache.c, source.c, source.h, sparc-nat.c, spu-linux-nat.c, stack.c, stap-probe.c, symfile-add-flags.h, symfile.c, symfile.h, symtab.c, symtab.h, target-descriptions.c, target-descriptions.h, target-memory.c, target.c, target.h, target/waitstatus.c, target/waitstatus.h, thread-iter.h, thread.c, tilegx-tdep.c, top.c, top.h, tracefile-tfile.c, tracefile.c, tracepoint.c, tracepoint.h, tui/tui-io.c, ui-file.c, ui-out.h, unittests/array-view-selftests.c, unittests/child-path-selftests.c, unittests/cli-utils-selftests.c, unittests/common-utils-selftests.c, unittests/copy_bitwise-selftests.c, unittests/environ-selftests.c, unittests/format_pieces-selftests.c, unittests/function-view-selftests.c, unittests/lookup_name_info-selftests.c, unittests/memory-map-selftests.c, unittests/memrange-selftests.c, unittests/mkdir-recursive-selftests.c, unittests/observable-selftests.c, unittests/offset-type-selftests.c, unittests/optional-selftests.c, unittests/parse-connection-spec-selftests.c, unittests/ptid-selftests.c, unittests/rsp-low-selftests.c, unittests/scoped_fd-selftests.c, unittests/scoped_mmap-selftests.c, unittests/scoped_restore-selftests.c, unittests/string_view-selftests.c, unittests/style-selftests.c, unittests/tracepoint-selftests.c, unittests/unpack-selftests.c, unittests/utils-selftests.c, unittests/xml-utils-selftests.c, utils.c, utils.h, valarith.c, valops.c, valprint.c, value.c, value.h, varobj.c, varobj.h, windows-nat.c, x86-linux-nat.c, xml-support.c, xml-support.h, xml-tdesc.h, xstormy16-tdep.c, xtensa-linux-nat.c, dwarf2read.h: Change common to gdbsupport. gdb/gdbserver/ChangeLog 2019-07-09 Tom Tromey <tom@tromey.com> * configure: Rebuild. * configure.ac: Change common to gdbsupport. * acinclude.m4: Change common to gdbsupport. * Makefile.in (SFILES, OBS, GDBREPLAY_OBS, IPA_OBJS) (version-generated.c, gdbsupport/%-ipa.o, gdbsupport/%.o): Change common to gdbsupport. * ax.c, event-loop.c, fork-child.c, gdb_proc_service.h, gdbreplay.c, gdbthread.h, hostio-errno.c, hostio.c, i387-fp.c, inferiors.c, inferiors.h, linux-aarch64-tdesc-selftest.c, linux-amd64-ipa.c, linux-i386-ipa.c, linux-low.c, linux-tic6x-low.c, linux-x86-low.c, linux-x86-tdesc-selftest.c, linux-x86-tdesc.c, lynx-i386-low.c, lynx-low.c, mem-break.h, nto-x86-low.c, regcache.c, regcache.h, remote-utils.c, server.c, server.h, spu-low.c, symbol.c, target.h, tdesc.c, tdesc.h, thread-db.c, tracepoint.c, win32-i386-low.c, win32-low.c: Change common to gdbsupport.
* Move gnulib to top levelTom Tromey2019-06-141-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch moves the gdb/gnulib subdirectory to the top level. It adjusts the top-level build system to build gnulib when necessary, and changes gdb to use this. However, gdbserver still builds its own copy of gnulib, just from the new source location. A small hack was needed to ensure that gnulib is only built when gdb is enabled. The Makefile only provides an ordering -- the directory must be mentioned in configdirs to actually be compiled at all. Most of the patch is just a "git mv" of gnulib, though a few minor path adjustments were needed in some files there. Tested by the buildbot. ChangeLog 2019-06-14 Tom Tromey <tom@tromey.com> * MAINTAINERS: Add gnulib. * gnulib: New directory, move from gdb/gnulib. * configure.ac (host_libs): Add gnulib. * configure: Rebuild. * Makefile.def (host_modules, dependencies): Add gnulib. * Makefile.in: Rebuild. gdb/ChangeLog 2019-06-14 Tom Tromey <tom@tromey.com> * gnulib: Move directory to top-level. * configure.ac: Don't configure gnulib. * configure: Rebuild. * common/common-defs.h: Use new path to gnulib. * Makefile.in (GNULIB_BUILDDIR): Now ../gnulib. (GNULIB_H): Remove. (INCGNU): Look in new gnulib location. (HFILES_NO_SRCDIR): Remove gnulib files. (SUBDIR, REQUIRED_SUBDIRS): Remove gnulib. (generated_files): Remove GNULIB_H. ($(LIBGNU), all-lib): Remove targets. (distclean): Don't mention GNULIB_BUILDDIR. ($(GNULIB_BUILDDIR)/Makefile): Remove target. gdb/gdbserver/ChangeLog 2019-06-14 Tom Tromey <tom@tromey.com> * configure.ac: Use new path to gnulib. * configure: Rebuild. * Makefile.in (INCGNU, $(GNULIB_BUILDDIR)/Makefile): Use new path to gnulib. gnulib/ChangeLog 2019-06-14 Tom Tromey <tom@tromey.com> * update-gnulib.sh: Adjust paths. * Makefile.in: Adjust paths. * configure.ac: Adjust paths. Use ACX_LARGEFILE. * configure: Rebuild.
* Move gdb's xmalloc and friends to new fileTom Tromey2019-06-111-0/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | When "common" becomes a library, linking will cause a symbol clash, because "xmalloc" and some related symbols are defined in that library, libiberty, and readline. To work around this problem, this patch moves the clashing symbols to a new file, which is then compiled separately for both gdb and gdbserver. gdb/ChangeLog 2019-06-11 Tom Tromey <tom@tromey.com> * common/common-utils.c (xmalloc, xrealloc, xcalloc) (xmalloc_failed): Move to alloc.c. * alloc.c: New file. * Makefile.in (COMMON_SFILES): Add alloc.c. gdb/gdbserver/ChangeLog 2019-06-11 Tom Tromey <tom@tromey.com> * Makefile.in (SFILES): Add alloc.c. (OBS): Add alloc.o. (IPA_OBJS): Add alloc-ipa.o. (alloc-ipa.o): New target. (%.o: ../%.c): New pattern rule.
* Remove fromhex implementation from gdbreplayTom Tromey2019-06-021-0/+1
| | | | | | | | | | | gdbreplay had its own implementation of fromhex. This patch changes it to use the one in common/. gdb/gdbserver/ChangeLog 2019-06-02 Tom Tromey <tom@tromey.com> * gdbreplay.c (fromhex): Remove. * Makefile.in (GDBREPLAY_OBS): Add rsp-low.o.
* [PR gdb/23985] Fix libinproctrace.so buildSzabolcs Nagy2019-01-301-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The IPA objects currently may use gnulib replacement apis, which is wrong: gnulib is not linked into the produced dso and it cannot be because it is not built with -fPIC -fvisibility=hidden. The gnulib replacement detection is broken under cross compilation: for targets other than *-gnu*, replacements are enabled that depend on execution time detection. This causes unnecessary build failure when the target has proper support for the replaced api. This fix tries to undo the replacements, which is tricky because the gnulib headers are still used for various compile time fixups and there is no simple knob in gnulib to only turn the replacements off. Without this workaround gdb fails to cross build to non-gnu targets: ld: tracepoint-ipa.o: in function `gdb_agent_helper_thread(void*)': gdb/gdbserver/tracepoint.c:7221: undefined reference to `rpl_strerror' ... Makefile:434: recipe for target 'libinproctrace.so' failed gdb/gdbserver/ChangeLog: PR gdb/23985 * Makefile.in (IPAGENT_CFLAGS): Add UNDO_GNULIB_CFLAGS. (UNDO_GNULIB_CFLAGS): Undo gnulib replacements.
* Don't use -I for common subdirectoryTom Tromey2019-01-251-1/+1
| | | | | | | | | | | | | | | | This changes the Makefiles to remove the -I for the common/ subdirectory. This will enforce the rule that includes must use the 'common/filename.h' form. gdb/ChangeLog 2019-01-25 Tom Tromey <tom@tromey.com> * Makefile.in (GDB_CFLAGS): Don't add -I for common. gdb/gdbserver/ChangeLog 2019-01-25 Tom Tromey <tom@tromey.com> * Makefile.in (INCLUDE_CFLAGS): Don't add -I for common.
* Update copyright year range in all GDB files.Joel Brobecker2019-01-011-1/+1
| | | | | | | | | | | | | | | | This commit applies all changes made after running the gdb/copyright.py script. Note that one file was flagged by the script, due to an invalid copyright header (gdb/unittests/basic_string_view/element_access/char/empty.cc). As the file was copied from GCC's libstdc++-v3 testsuite, this commit leaves this file untouched for the time being; a patch to fix the header was sent to gcc-patches first. gdb/ChangeLog: Update copyright year range in all GDB files.
* Sort objects in gdb and gdbserver MakefilesSimon Marchi2018-09-161-3/+3
| | | | | | | | | | | | | | | | | Tom mentioned this a while ago, as a way to give you a cheap sense of progression in your build, as all object files will be built alphabetically (including the directory part). I tried it and I think it's nice. gdb/ChangeLog: * Makefile.in (LIBGDB_OBS): Sort COMMON_OBS. gdb/gdbserver/ChangeLog: * Makefile.in (gdbserver$(EXEEXT)): Sort OBS. (gdbreplay$(EXEEXT)): Sort GDBREPLAY_OBS. ($(IPA_LIB)): Sort IPA_OBJS.
* gdbserver/Makefile.in: Remove ADD_DEPSSimon Marchi2018-09-161-2/+2
| | | | | | | | | | ADD_DEPS is defined nowhere, so I presume it's not useful. If I'm wrong and this is actually used, there should be a comment explaining where it comes from. gdb/gdbserver/ChangeLog: * Makefile.in: Remove references to $(ADD_DEPS).
* Implement IPv6 support for GDB/gdbserverSergio Durigan Junior2018-07-111-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch implements IPv6 support for both GDB and gdbserver. Based on my research, it is the fourth attempt to do that since 2006. Since I used ideas from all of the previous patches, I also added their authors's names on the ChangeLogs as a way to recognize their efforts. For reference sake, you can find the previous attempts at: https://sourceware.org/ml/gdb-patches/2006-09/msg00192.html https://sourceware.org/ml/gdb-patches/2014-02/msg00248.html https://sourceware.org/ml/gdb-patches/2016-02/msg00226.html The basic idea behind the patch is to start using the new 'getaddrinfo'/'getnameinfo' calls, which are responsible for translating names and addresses in a protocol-independent way. This means that if we ever have a new version of the IP protocol, we won't need to change the code again (or, at least, won't have to change the majority of the code). The function 'getaddrinfo' returns a linked list of possible addresses to connect to. Dealing with multiple addresses proved to be a hard task with the current TCP auto-retry mechanism implemented on ser-tcp:net_open. For example, when gdbserver listened only on an IPv4 socket: $ ./gdbserver --once 127.0.0.1:1234 ./a.out and GDB was instructed to try to connect to both IPv6 and IPv4 sockets: $ ./gdb -ex 'target extended-remote localhost:1234' ./a.out the user would notice a somewhat big delay before GDB was able to connect to the IPv4 socket. This happened because GDB was trying to connect to the IPv6 socket first, and had to wait until the connection timed out before it tried to connect to the IPv4 socket. For that reason, I had to rewrite the main loop and implement a new method for handling multiple connections. After some discussion, Pedro and I agreed on the following algorithm: 1) For each entry returned by 'getaddrinfo', we try to open a socket and connect to it. 2.a) If we have a successful 'connect', we just use that connection. 2.b) If we don't have a successfull 'connect', but if we've got a ECONNREFUSED (meaning the the connection was refused), we keep track of this fact by using a flag. 2.c) If we don't have a successfull 'connect', but if we've got a EINPROGRESS (meaning that the connection is in progress), we perform a 'select' call on the socket until we have a result (either a successful connection, or an error on the socket). 3) If tcp_auto_retry is true, and we haven't gotten a successful connection, and at least one of our attempts failed with ECONNREFUSED, then we wait a little bit (i.e., call 'wait_for_connect'), check to see if there was a timeout/interruption (in which case we bail out), and then go back to (1). After multiple tests, I was able to connect without delay on the scenario described above, and was also able to connect in all other types of scenarios. I also implemented some hostname parsing functions (along with their corresponding unit tests) which are used to help GDB and gdbserver to parse hostname strings provided by the user. These new functions are living inside common/netstuff.[ch]. I've had to do that since IPv6 introduces a new URL scheme, which defines that square brackets can be used to enclose the host part and differentiate it from the port (e.g., "[::1]:1234" means "host ::1, port 1234"). I spent some time thinking about a reasonable way to interpret what the user wants, and I came up with the following: - If the user has provided a prefix that doesn't specify the protocol version (i.e., "tcp:" or "udp:"), or if the user has not provided any prefix, don't make any assumptions (i.e., assume AF_UNSPEC when dealing with 'getaddrinfo') *unless* the host starts with "[" (in which case, assume it's an IPv6 host). - If the user has provided a prefix that does specify the protocol version (i.e., "tcp4:", "tcp6:", "udp4:" or "udp6:"), then respect that. This method doesn't follow strictly what RFC 2732 proposes (that literal IPv6 addresses should be provided enclosed in "[" and "]") because IPv6 addresses still can be provided without square brackets in our case, but since we have prefixes to specify protocol versions I think this is not an issue. Another thing worth mentioning is the new 'GDB_TEST_SOCKETHOST' testcase parameter, which makes it possible to specify the hostname (without the port) to be used when testing GDB and gdbserver. For example, to run IPv6 tests: $ make check-gdb RUNTESTFLAGS='GDB_TEST_SOCKETHOST=tcp6:[::1]' Or, to run IPv4 tests: $ make check-gdb RUNTESTFLAGS='GDB_TEST_SOCKETHOST=tcp4:127.0.0.1' This required a few changes on the gdbserver-base.exp, and also a minimal adjustment on gdb.server/run-without-local-binary.exp. Finally, I've implemented a new testcase, gdb.server/server-connect.exp, which is supposed to run on the native host and perform various "smoke tests" using different connection methods. This patch has been regression-tested on BuildBot and locally, and also built using a x86_64-w64-mingw32 GCC, and no problems were found. gdb/ChangeLog: 2018-07-11 Sergio Durigan Junior <sergiodj@redhat.com> Jan Kratochvil <jan.kratochvil@redhat.com> Paul Fertser <fercerpav@gmail.com> Tsutomu Seki <sekiriki@gmail.com> Pedro Alves <palves@redhat.com> * Makefile.in (SUBDIR_UNITTESTS_SRCS): Add 'unittests/parse-connection-spec-selftests.c'. (COMMON_SFILES): Add 'common/netstuff.c'. (HFILES_NO_SRCDIR): Add 'common/netstuff.h'. * NEWS (Changes since GDB 8.2): Mention IPv6 support. * common/netstuff.c: New file. * common/netstuff.h: New file. * ser-tcp.c: Include 'netstuff.h' and 'wspiapi.h'. (wait_for_connect): Update comment. New parameter 'gdb::optional<int> sock' instead of 'struct serial *scb'. Use 'sock' directly instead of 'scb->fd'. (try_connect): New function, with code from 'net_open'. (net_open): Rewrite main loop to deal with multiple sockets/addresses. Handle IPv6-style hostnames; implement support for IPv6 connections. * unittests/parse-connection-spec-selftests.c: New file. gdb/gdbserver/ChangeLog: 2018-07-11 Sergio Durigan Junior <sergiodj@redhat.com> Jan Kratochvil <jan.kratochvil@redhat.com> Paul Fertser <fercerpav@gmail.com> Tsutomu Seki <sekiriki@gmail.com> * Makefile.in (SFILES): Add '$(srcdir)/common/netstuff.c'. (OBS): Add 'common/netstuff.o'. (GDBREPLAY_OBS): Likewise. * gdbreplay.c: Include 'wspiapi.h' and 'netstuff.h'. (remote_open): Implement support for IPv6 connections. * remote-utils.c: Include 'netstuff.h', 'filestuff.h' and 'wspiapi.h'. (handle_accept_event): Accept connections from IPv6 sources. (remote_prepare): Handle IPv6-style hostnames; implement support for IPv6 connections. (remote_open): Implement support for printing connections from IPv6 sources. gdb/testsuite/ChangeLog: 2018-07-11 Sergio Durigan Junior <sergiodj@redhat.com> Jan Kratochvil <jan.kratochvil@redhat.com> Paul Fertser <fercerpav@gmail.com> Tsutomu Seki <sekiriki@gmail.com> * README (Testsuite Parameters): Mention new 'GDB_TEST_SOCKETHOST' parameter. * boards/native-extended-gdbserver.exp: Do not set 'sockethost' by default. * boards/native-gdbserver.exp: Likewise. * gdb.server/run-without-local-binary.exp: Improve regexp used for detecting when a remote debugging connection succeeds. * gdb.server/server-connect.exp: New file. * lib/gdbserver-support.exp (gdbserver_default_get_comm_port): Do not prefix the port number with ":". (gdbserver_start): New global GDB_TEST_SOCKETHOST. Implement support for detecting and using it. Add '$debughost_gdbserver' to the list of arguments used to start gdbserver. Handle case when gdbserver cannot resolve a network name. gdb/doc/ChangeLog: 2018-07-11 Sergio Durigan Junior <sergiodj@redhat.com> Jan Kratochvil <jan.kratochvil@redhat.com> Paul Fertser <fercerpav@gmail.com> Tsutomu Seki <sekiriki@gmail.com> * gdb.texinfo (Remote Connection Commands): Add explanation about new IPv6 support. Add new connection prefixes.
* Ptrace support for Aarch64 SVEAlan Hayward2018-06-181-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add support for reading and writing registers for Aarch64 SVE. We need to support the cases where the kernel only gives us a fpsimd structure. This occurs when there is no active SVE state in the kernel (for example, after starting a new process). Added checks to make sure the vector length has not changed whilst the process is running. gdb/ * aarch64-linux-nat.c (fetch_sveregs_from_thread): New function. (store_sveregs_to_thread): Likewise. (aarch64_linux_fetch_inferior_registers): Check for SVE. (aarch64_linux_store_inferior_registers): Likewise. * nat/aarch64-sve-linux-ptrace.c (aarch64_sve_get_sveregs): New function. (aarch64_sve_regs_copy_to_regcache): Likewise. (aarch64_sve_regs_copy_from_regcache): Likewise. * nat/aarch64-sve-linux-ptrace.h (aarch64_sve_get_sveregs): New declaration. (aarch64_sve_regs_copy_to_regcache): Likewise. (aarch64_sve_regs_copy_from_regcache): Likewise. (sve_context): Structure from Linux headers. (SVE_SIG_ZREGS_SIZE): Define from Linux headers. (SVE_SIG_ZREG_SIZE): Likewise. (SVE_SIG_PREG_SIZE): Likewise. (SVE_SIG_FFR_SIZE): Likewise. (SVE_SIG_REGS_OFFSET): Likewise. (SVE_SIG_ZREGS_OFFSET): Likewise. (SVE_SIG_ZREG_OFFSET): Likewise. (SVE_SIG_ZREGS_SIZE): Likewise. (SVE_SIG_PREGS_OFFSET): Likewise. (SVE_SIG_PREG_OFFSET): Likewise. (SVE_SIG_PREGS_SIZE): Likewise. (SVE_SIG_FFR_OFFSET): Likewise. (SVE_SIG_REGS_SIZE): Likewise. (SVE_SIG_CONTEXT_SIZE): Likewise. (SVE_PT_REGS_MASK): Likewise. (SVE_PT_REGS_FPSIMD): Likewise. (SVE_PT_REGS_SVE): Likewise. (SVE_PT_VL_INHERIT): Likewise. (SVE_PT_VL_ONEXEC): Likewise. (SVE_PT_REGS_OFFSET): Likewise. (SVE_PT_FPSIMD_OFFSET): Likewise. (SVE_PT_FPSIMD_SIZE): Likewise. (SVE_PT_SVE_ZREG_SIZE): Likewise. (SVE_PT_SVE_PREG_SIZE): Likewise. (SVE_PT_SVE_FFR_SIZE): Likewise. (SVE_PT_SVE_FPSR_SIZE): Likewise. (SVE_PT_SVE_FPCR_SIZE): Likewise. (__SVE_SIG_TO_PT): Likewise. (SVE_PT_SVE_OFFSET): Likewise. (SVE_PT_SVE_ZREGS_OFFSET): Likewise. (SVE_PT_SVE_ZREG_OFFSET): Likewise. (SVE_PT_SVE_ZREGS_SIZE): Likewise. (SVE_PT_SVE_PREGS_OFFSET): Likewise. (SVE_PT_SVE_PREG_OFFSET): Likewise. (SVE_PT_SVE_PREGS_SIZE): Likewise. (SVE_PT_SVE_FFR_OFFSET): Likewise. (SVE_PT_SVE_FPSR_OFFSET): Likewise. (SVE_PT_SVE_FPCR_OFFSET): Likewise. (SVE_PT_SVE_SIZE): Likewise. (SVE_PT_SIZE): Likewise. (HAS_SVE_STATE): New define. gdbserver/ * Makefile.in: Add aarch64-sve-linux-ptrace.c.
* Make gdbreplay use more common routinesPedro Alves2018-06-081-1/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | This makes gdbreplay share a bit more code with gdbserver, and paves the way to share more in future. Including common-defs.h pulls in defines and headers that gdb and gdbserver assume are always defined/available too, such as for example _(), ansidecl.h or a set of system headers. Including that revealed (static vs extern conflict) gdbreplay had a local copy of perror_with_name (which exited directly instead of throwing an error). So I removed gdbreplay's local copy, and then added enough .o files until gdbreplay linked successfully. Also, use xstrdup instead of strdup. gdb/gdbserver/ChangeLog: 2018-06-08 Pedro Alves <palves@redhat.com> * Makefile.in (GDBREPLAY_OBS): Add common/cleanups.o, common/common-exceptions.o, common/common-utils.o, common/errors.o, common/print-utils.o and utils.o. * gdbreplay.c: Include "common-defs.h" instead of the two 'config.h's here. Don't include stdio.h, errno.h, stdlib.h, string.h or alloca.h. (perror_with_name): Delete. (remote_open): Use xstrdup instead of strdup. (main): Rename to ... (captured_main): ... this. (main): New.
* [PowerPC] Consolidate linux target description selectionPedro Franco de Carvalho2018-05-221-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Share target description declarations and selection among ppc linux native targets, core files, gdbserver and IPA. To avoid complicated define guards, gdbserver and IPA now have declarations for all descriptions, including 64-bit generated descriptions when compiled in 32-bit mode. These have always been linked into the gdbserver and IPA binaries. Because they might be uninitialized, the selection function checks that the selected description is initialized. gdb/ChangeLog: 2018-05-22 Pedro Franco de Carvalho <pedromfc@linux.vnet.ibm.com> * arch/ppc-linux-common.c: New file. * arch/ppc-linux-common.h: New file. * arch/ppc-linux-tdesc.h: New file. * configure.tgt (powerpc*-*-linux*): Add arch/ppc-linux-common.o. * Makefile.in (ALL_TARGET_OBS): Add arch/ppc-linux-common.o. (HFILES_NO_SRCDIR): Add arch/ppc-linux-common.h and arch/ppc-linux-tdesc.h. * ppc-linux-nat.c: Include arch/ppc-linux-common.h and arch/ppc-linux-tdesc.h. (ppc_linux_nat_target::read_description): Remove target description matching code. Fill a ppc_linux_features struct and call ppc_linux_match_description with it. Move comment about ISA 2.05 to ppc-linux-common.c. * ppc-linux-tdep.c: Include arch/ppc-linux-common.h and arch/ppc-linux-tdesc.h. (ppc_linux_core_read_description): Remove target description matching code. Fill a ppc_linux_features struct and call ppc_linux_match_description with it. * ppc-linux-tdep.h (tdesc_powerpc_32l, tdesc_powerpc_64l) (tdesc_powerpc_altivec32l, tdesc_powerpc_altivec64l) (tdesc_powerpc_cell32l, tdesc_powerpc_cell64l) (tdesc_powerpc_vsx32l, tdesc_powerpc_vsx64l) (tdesc_powerpc_isa205_32l, tdesc_powerpc_isa205_64l) (tdesc_powerpc_isa205_altivec32l, tdesc_powerpc_isa205_altivec64l) (tdesc_powerpc_isa205_vsx32l, tdesc_powerpc_isa205_vsx64l) (tdesc_powerpc_e500l): Remove. gdb/gdbserver/ChangeLog: 2018-05-22 Pedro Franco de Carvalho <pedromfc@linux.vnet.ibm.com> * configure.srv (srv_tgtobj): Add arch/ppc-linux-common.o. * Makefile.in (SFILES): Add arch/ppc-linux-common.c. * linux-ppc-tdesc.h: Rename to linux-ppc-tdesc-init.h. * linux-ppc-tdesc-init.h (tdesc_powerpc_32l, tdesc_powerpc_64l) (tdesc_powerpc_altivec32l, tdesc_powerpc_altivec64l) (tdesc_powerpc_cell32l, tdesc_powerpc_cell64l) (tdesc_powerpc_vsx32l, tdesc_powerpc_vsx64l) (tdesc_powerpc_isa205_32l, tdesc_powerpc_isa205_64l) (tdesc_powerpc_isa205_altivec32l, tdesc_powerpc_isa205_altivec64l) (tdesc_powerpc_isa205_vsx32l, tdesc_powerpc_isa205_vsx64l) (tdesc_powerpc_e500l): Remove. * linux-ppc-ipa.c: Include arch/ppc-linux-tdesc.h and linux-ppc-tdesc-init.h. Don't include linux-ppc-tdesc.h. * linux-ppc-low.c: Include arch/ppc-linux-common.h, arch/ppc-linux-tdesc.h, and linux-ppc-tdesc-init.h. Don't include linux-ppc-tdesc.h. (ppc_arch_setup): Remove target description matching code. Fill a ppc_linux_features struct and call ppc_linux_match_description with it.
* Fix dependency tracking in gdbserver subdirectoriesSimon Marchi2018-04-191-2/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The dependency tracking (the thing that knows which source file included which other source file during last build to know what to rebuild when an included file changes) is broken for gdbserver subdirectories (arch and common). The dependency tracking files are created in the form arch/.deps/i386.Po but we try to include .deps/arch/i386.Po An easy smoke test is too "touch" the gdb/features/i386/32bit-core.c file in the source directory and try to rebuild gdbserver. This file is included by gdb/arch/i386.c, so it should cause gdb/gdbserver/arch/i386.o in the build directory to be rebuilt. It currently isn't rebuilt, but is with this patch applied. This patch copies the technique used in GDB to transform the dep file paths to the proper form. Also, while testing using the depcomp method of dependency tracking (by just hacking the condition), I noticed that depcomp was not found. The path to depcomp seems to be missing a "..". gdb/gdbserver/ChangeLog: * Makefile.in (depcomp): Add "..". (all_deps_files): New and use it.
* Commonise tdesc_reg and makes use of it in gdbserver tdescAlan Hayward2018-04-181-0/+3
| | | | | | | | | | | | | | | | | | | | | gdb/ * Makefile.in: Add arch/tdesc.c * common/tdesc.c: New file. * common/tdesc.h (tdesc_element_visitor): Move to here. (tdesc_element): Likewise. (tdesc_reg): Likewise. (tdesc_reg_up): Likewise. * regformats/regdef.h (reg): Add offset to constructors. * target-descriptions.c (tdesc_element_visitor): Move from here. (tdesc_element): Likewise. (tdesc_reg): Likewise. (tdesc_reg_up): Likewise. gdbserver/ * Makefile.in: Add common/tdesc.c * tdesc.c (init_target_desc): init all reg_defs from register vector. (tdesc_create_reg): Create tdesc_reg. * tdesc.h (tdesc_feature): Add register vector.
* Add silent Makefile rulesSimon Marchi2018-03-161-27/+33
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Many projects (e.g. the Linux kernel) and build systems use "silent" rules, which means that they'll only print a summary of what's being done instead of printing all the detailed command lines. While chatting on the #gdb IRC channel, I realized a few people (including me) thought it would be nice to have it in GDB too. The idea is that too much text is not useful, the important information gets lost. If there's only the essential information, it's more likely to be useful. Most of the time, when I look at the build output, it's to see how it's progressing. By just printing a brief summary of each operation, I can easily spot what's currently being compiled and therefore how the build progresses (with time you know the order in which files are compiled almost by heart). As with other projects (Linux, automake-based things, probably others), it's possible to print the complete command lines by passing V=1 to make (or any other non-zero value). I had one hesitation about this: when people report build failures, we are more likely to miss the full compile command line. We'll probably sometimes need to ask people to include the build log with "make V=1". I don't think it's a big downside, if other projects the size of the Linux kernel can live with it, I'm sure we can too. gdb/ChangeLog: * silent-rules.mk: New. * Makefile.in: Include silent-rules.mk (srcdir, VPATH, top_srcdir): Move up. (COMPILE): Add ECHO_CXX. (test-cp-name-parser$(EXEEXT)): Add ECHO_CXXLD. (init.c): Add ECHO_INIT_C. (gdb$(EXEEXT)): Add SILENCE and ECHO_CXXLD. (version.c): Add ECHO_GEN. (printcmd.o): Add ECHO_CXX. (target-float.o): Add ECHO_CXX. (ada-exp.o): Add ECHO_CXX. (stamp-xml): Add SILENCE and ECHO_GEN_XML_BUILTIN. (insight$(EXEEXT)): Add ECHO_CXXLD. * gnulib/configure.ac: Add AM_SILENT_RULES. * gnulib/aclocal.m4: Re-generate. * gnulib/configure: Re-generate. * gnulib/import/Makefile.in: Re-generate. gdb/gdbserver/ChangeLog: * Makefile.in: Include silent-rules.mk. (srcdir, abs_top_srcdir, abs_srcdir, VPATH): Move up. (COMPILE): Add ECHO_CXX. (gdbserver$(EXEEXT)): Add SILENCE and ECHO_CXXLD. (gdbreplay$(EXEEXT)): Add SILENCE and ECHO_CXXLD. ($(IPA_LIB)): Add SILENCE and ECHO_CXXLD. (version-generated.c): Add ECHO_GEN. (stamp-xml): Add SILENCE and ECHO_GEN_XML_BUILTIN_GENERATED. (IPAGENT_COMPILE): Add ECHO_CXX. (%-generated.c): Add ECHO_REGDAT.
* Create new common/pathstuff.[ch]Sergio Durigan Junior2018-02-281-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit moves the path manipulation routines found on utils.c to a new common/pathstuff.c, and updates the Makefile.in's accordingly. The routines moved are "gdb_realpath", "gdb_realpath_keepfile" and "gdb_abspath". This will be needed because gdbserver will have to call "gdb_abspath" on my next patch, which implements a way to expand the path of the inferior provided by the user in order to allow specifying just the binary name when starting gdbserver, like: $ gdbserver :1234 a.out With the recent addition of the startup-with-shell feature on gdbserver, this scenario doesn't work anymore if the user doesn't have the current directory listed in the PATH variable. I had to do a minor adjustment on "gdb_abspath" because we don't have access to "tilde_expand" on gdbserver, so now the function is using "gdb_tilde_expand" instead. Otherwise, the code is the same. Regression tested on the BuildBot, without regressions. gdb/ChangeLog: 2018-02-28 Sergio Durigan Junior <sergiodj@redhat.com> * Makefile.in (COMMON_SFILES): Add "common/pathstuff.c". (HFILES_NO_SRCDIR): Add "common/pathstuff.h". * auto-load.c: Include "common/pathstuff.h". * common/common-def.h (current_directory): Move here. * common/gdb_tilde_expand.c (gdb_tilde_expand_up): New function. * common/gdb_tilde_expand.h (gdb_tilde_expand_up): New prototype. * common/pathstuff.c: New file. * common/pathstuff.h: New file. * compile/compile.c: Include "common/pathstuff.h". * defs.h (current_directory): Move to "common/common-defs.h". * dwarf2read.c: Include "common/pathstuff.h". * exec.c: Likewise. * guile/scm-safe-call.c: Likewise. * linux-thread-db.c: Likewise. * main.c: Likewise. * nto-tdep.c: Likewise. * objfiles.c: Likewise. * source.c: Likewise. * symtab.c: Likewise. * utils.c: Include "common/pathstuff.h". (gdb_realpath): Move to "common/pathstuff.c". (gdb_realpath_keepfile): Likewise. (gdb_abspath): Likewise. * utils.h (gdb_realpath): Move to "common/pathstuff.h". (gdb_realpath_keepfile): Likewise. (gdb_abspath): Likewise. gdb/gdbserver/ChangeLog: 2018-02-28 Sergio Durigan Junior <sergiodj@redhat.com> * Makefile.in (SFILES): Add "$(srcdir)/common/pathstuff.c". (OBJS): Add "pathstuff.o". * server.c (current_directory): New global variable. (captured_main): Initialize "current_directory".
* Fix make 3.81 build errorsAlan Hayward2018-02-201-13/+13
| | | | | gdbserver/ * Makefile.in: Switch order of make rules.
* Add common/ dir in build directoriesAlan Hayward2018-02-191-32/+32
| | | | | | | | | | | | | | | gdb/ * Makefile.in: (COMMON_SFILES): Add common/*.c files. (SFILES): Remove common/*.c files. (COMMON_OBS): Remove some *.o files built from common/*.c files. * common/common.host: Add common reference. * configure.ac: Likewise. * configure: Regenerate. gdbserver/ * Makefile.in: Add common directory in build. * configure.ac: Add common reference. * configure: Regenerate.
* Fix GDBserver build failure when $development is falseYao Qi2018-01-081-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When we set bfd/development.sh:$development to false, GDBserver failed to build, selftest.o: In function `selftests::run_tests(char const*)': binutils-gdb/gdb/gdbserver/../common/selftest.c:97:undefined reference to `selftests::reset()' collect2: error: ld returned 1 exit status selftest.o shouldn't be compiled and linked when $development is false. With this patch, in release mode, GDBserver doesn't nothing with option --selftest, $ ./gdbserver --selftest=foo Selftests are not available in a non-development build. $ ./gdbserver --selftest Selftests are not available in a non-development build. gdb/gdbserver: 2018-01-08 Yao Qi <yao.qi@linaro.org> Simon Marchi <simon.marchi@ericsson.com> * Makefile.in (OBS): Remove selftest.o. * configure.ac: Set srv_selftest_objs if $development is true. (GDBSERVER_DEPFILES): Append $srv_selftest_objs. * configure: Re-generated. * server.c (captured_main): Wrap variable selftest_filter with GDB_SELF_TEST. gdb/testsuite: 2018-01-08 Simon Marchi <simon.marchi@ericsson.com> * gdb.server/unittest.exp: Match the output in non-development mode.
* Update copyright year range in all GDB filesJoel Brobecker2018-01-021-1/+1
| | | | | | gdb/ChangeLog: Update copyright year range in all GDB files
* Better make rule for arch/ files built for IPAAlan Hayward2017-11-151-1/+1
| | | | | | gdbserver/ * Makefile.in: Update arch rules. * configure.srv: Explicitly mark arch/ files.
* [GDBserver] Move aarch64-insn.o to arch/ and remove one Makefile ruleYao Qi2017-10-171-4/+0
| | | | | | | | | gdb/gdbserver: 2017-10-17 Yao Qi <yao.qi@linaro.org> * Makefile.in: Remove one rule. * configure.srv: Rename aarch64-insn.o with arch/aarch64-insn.o.
* [GDBserver] Replicate src dir in build dirYao Qi2017-10-171-9/+14
| | | | | | | | | | | | | | | | | | | | Similar to f38307f5 (Replicate src dir in build dir), this patch change configure and Makefile to generate object files in arch/ directory. gdb/gdbserver: 2017-10-17 Yao Qi <yao.qi@linaro.org> * Makefile.in (CONFIG_SRC_SUBDIR): New variable. (clean): Remove .o files in CONFIG_SRC_SUBDIR. (distclean): Remove DEPDIR in CONFIG_SRC_SUBDIR. (arch-i386.o, arch-amd64.o): Remove rules. (arch/%.o): New rule. Update POSTCOMPILE and COMPILE.pre. * configure.ac: Invoke AC_CONFIG_COMMANDS. * configure: Re-generated. * configure.srv: Replace arch-i386.o with arch/i386.o. Replace arch-amd64.o with arch/amd64.o.
* Introduce gdb_tilde_expandSergio Durigan Junior2017-10-041-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently, whenever we want to handle paths provided by the user and perform tilde expansion on GDB, we rely on "tilde_expand", which comes from readline. This was enough for our use cases so far, but the situation will change when we start dealing with paths on gdbserver as well, which is what the next patches implement. Unfortunately it is not possible to use "tilde_expand" in this case because gdbserver doesn't use readline. For that reason I decided to implement a new "gdb_tilde_expand" function, which is basically a wrapper for "glob" and its GNU extension, GLOB_TILDE_CHECK. With the import of the "glob" module from gnulib, we're sure that "glob" always supports this extension. gdb/ChangeLog: 2017-10-04 Sergio Durigan Junior <sergiodj@redhat.com> * Makefile.in (SFILES): Add gdb_tilde_expand.c. (HFILES_NO_SRCDIR): Add gdb_tilde_expand.h. (COMMON_OBS): Add gdb_tilde_expand.o. * common/gdb_tilde_expand.c: New file. * common/gdb_tilde_expand.h: Likewise. gdb/gdbserver/ChangeLog: 2017-10-04 Sergio Durigan Junior <sergiodj@redhat.com> * Makefile.in (SFILES): Add $(srcdir)/common/gdb_tilde_expand.c. (OBS): Add gdb_tilde_expand.o.
* Convert amd64-linux target descriptionsYao Qi2017-09-051-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch changes amd64-linux target descriptions so that they can be dynamically generated in both GDB and GDBserver. gdb/gdbserver: 2017-09-05 Yao Qi <yao.qi@linaro.org> * Makefile.in (arch-amd64.o): New rule. * configure.srv: Append arch-amd64.o. * linux-amd64-ipa.c: Include common/x86-xstate.h. (get_ipa_tdesc): Call amd64_linux_read_description. (initialize_low_tracepoint): Don't call init_registers_x32_XXX and init_registers_amd64_XXX. * linux-x86-low.c (x86_linux_read_description): Call amd64_linux_read_description. (x86_get_ipa_tdesc_idx): Call amd64_get_ipa_tdesc_idx. (initialize_low_arch): Don't call init_registers_x32_XXX and init_registers_amd64_XXX. * linux-x86-tdesc-selftest.c: Declare init_registers_amd64_XXX and tdesc_amd64_XXX. [__x86_64__] (amd64_tdesc_test): New function. (initialize_low_tdesc) [__x86_64__]: Call init_registers_x32_XXX and init_registers_amd64_XXX. * linux-x86-tdesc.c: Include arch/amd64.h. (xcr0_to_tdesc_idx): New function. (i386_linux_read_description): New function. (amd64_get_ipa_tdesc_idx): New function. * linux-x86-tdesc.h (amd64_get_ipa_tdesc_idx): Declare. (amd64_get_ipa_tdesc): Declare. gdb: 2017-09-05 Yao Qi <yao.qi@linaro.org> * amd64-linux-tdep.c: Include arch/amd64.h. Don't include features/i386/*.c. (amd64_linux_read_description): Call amd64_create_target_description. * arch/amd64.c: New file. * arch/amd64.h: New file. * configure.tgt (x86_64-*-linux*): Append amd64.o. * Makefile.in (ALL_64_TARGET_OBS): Append amd64.o.
* Share i386-linux target description between GDB and GDBserverYao Qi2017-09-051-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The code on creating i386-linux target descriptions are quite similar between GDB and GDBserver, so this patch moves them into a shared file arch/i386.c. I didn't name it as i386-linux.c, because I want to reuse it to create other i386 non-linux target descriptions later. gdb: 2017-09-05 Yao Qi <yao.qi@linaro.org> * Makefile.in (ALL_TARGET_OBS): Add i386.o. (SFILES): Add arch/i386.c. (HFILES_NO_SRCDIR): Add arch/i386.h. * arch/i386.c: New file. * arch/i386.h: New file. * arch/tdesc.h (allocate_target_description): Declare. (set_tdesc_architecture): Declare. (set_tdesc_osabi): Declare. * configure.tgt (i[34567]86-*-linux*): Add i386.o. * i386-linux-tdep.c: Don't include ../features/i386/32bit-XXX.c. include arch/i386.h. (i386_linux_read_description): Remove code and call i386_create_target_description. (set_tdesc_architecture): New function. (set_tdesc_osabi): New function. * target-descriptions.h (allocate_target_description): Remove. gdb/gdbserver: 2017-09-05 Yao Qi <yao.qi@linaro.org> * Makefile.in (arch-i386.o): New rule. * configure.srv (i[34567]86-*-linux*): Add arch-i386.o. (x86_64-*-linux*): Likewise. * linux-x86-tdesc.c: Don't include ../features/i386/32bit-XXX.c, include arch/i386.h. (i386_linux_read_description): Remove code and call i386_create_target_description. * tdesc.c (allocate_target_description): New function. * tdesc.h (set_tdesc_architecture): Remove declaration. (set_tdesc_osabi): Likewise.
* Use VEC for target_desc.reg_defsYao Qi2017-09-051-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Nowadays, target_desc.reg_defs is a pointer points to a pre-generated array, which is not flexible. This patch changes it from an array to a VEC so that GDBserver can create target descriptions dynamically later. Instead of using pre-generated array, the -generated.c calls VEC_safe_push to add each register to vector. Since target_desc.reg_defs is used in IPA, we need to build common/vec.c for IPA too. gdb/gdbserver: 2017-09-05 Yao Qi <yao.qi@linaro.org> * Makefile.in (IPA_OBJS): Add vec-ipa.o * regcache.c (get_thread_regcache): Use VEC_length. (init_register_cache): Likewise. (regcache_cpy): Likewise. (registers_to_string): Iterate reg_defs via VEC_iterate. (find_regno): Likewise. (find_register_by_number): Use VEC_index. (register_size): Call find_register_by_number. (register_data): Call find_register_by_number. (supply_regblock): Use VEC_length. (regcache_raw_read_unsigned): Likewise. * tdesc.c (init_target_desc): Iterate reg_defs via VEC_iterate. (default_description): Update initializer. (copy_target_description): Don't update field num_registers. * tdesc.h (struct target_desc) <reg_defs>: Change it to VEC. <num_registers>: Remove. gdb: 2017-09-05 Yao Qi <yao.qi@linaro.org> * regformats/regdat.sh: Update generated code.
* gdbserver Makefile: don't delete intermediary filesSimon Marchi2017-09-041-0/+3
| | | | | | | | | | | | | | | | | If you "make" from scratch in gdbserver/, you'll notice that make deletes the files it considers as intermediary at the end: $ make clean && make ... rm i386-mmx-linux-generated.c x32-avx-avx512-linux-generated.c ... Then, if you type make again, make will rebuild these files and rebuild gdbserver. To avoid this, we can add the .SECONDARY special target. If it has no pre-requisites, all intermediary files will be kept. gdb/gdbserver/ChangeLog: * Makefile.in (.SECONDARY): Define target.
* GDBserver self testsYao Qi2017-08-181-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch uses GDB self test in GDBserver. The self tests are run if GDBserver is started with option --selftest. gdb: 2017-08-18 Yao Qi <yao.qi@linaro.org> * NEWS: Mention GDBserver's new option "--selftest". * Makefile.in (SFILES): Remove selftest.c, add common/selftest.c. * selftest.c: Move it to common/selftest.c. * selftest.h: Move it to common/selftest.h. * selftest-arch.c (reset): New function. (tests_with_arch): Call reset. gdb/gdbserver: 2017-08-18 Yao Qi <yao.qi@linaro.org> * Makefile.in (OBS): Add selftest.o. * configure.ac: AC_DEFINE GDB_SELF_TEST if $development. * configure, config.in: Re-generated. * server.c: Include common/sefltest.h. (captured_main): Handle option --selftest. gdb/testsuite: 2017-08-18 Yao Qi <yao.qi@linaro.org> * gdb.server/unittest.exp: New. gdb/doc: 2017-08-18 Yao Qi <yao.qi@linaro.org> * gdb.texinfo (Server): Document "--selftest".
* gdbserver/Makefile.in: Sort IPA_OBJSSimon Marchi2017-06-201-3/+12
| | | | | | gdb/gdbserver/ChangeLog: * Makefile.in (IPA_OBJS): Sort and format one item per line.