aboutsummaryrefslogtreecommitdiff
path: root/gdbserver/Makefile.in
AgeCommit message (Collapse)AuthorFilesLines
2024-06-20Revert "Remove LIBINTL_DEP"Alan Modra1-2/+3
This reverts commit e874cbd3879843a83e4bcc4b54cd7107387b1df6. The patch was wrong. LIBINTL_DEP is needed with an in-tree gettext.
2024-06-20Remove LIBINTL_DEPAlan Modra1-3/+2
The intl directory in the source no longer exists. LIBINTL_DEP is thus always empty. Remove references to it. config/ * gettext-sister.m4: Don't AC_SUBST LIBINTL_DEP. bfd/ * Makefile.in: Regenerate. * configure: Regenerate. binutils/ * Makefile.am (*_DEPENDENCIES): Remove LIBINTL_DEP. * Makefile.in: Regenerate. * configure: Regenerate. gas/ * Makefile.am (as_new_DEPENDENCIES): Remove LIBINTL_DEP. * Makefile.in: Regenerate. * configure: Regenerate. gdb/ * Makefile.in (INTL_DEPS): Don't set or reference. * configure: Regenerate. gdbserver/ * Makefile.in (INTL_DEPS): Don't set or reference. gdbsupport/ * Makefile.in: Regenerate. * configure: Regenerate. gold/ * Makefile.am (deps_var): Remove LIBINTL_DEP. (incremental_dump_DEPENDENCIES, dwp_DEPENDENCIES): Likewise. * Makefile.in: Regenerate. * configure: Regenerate. * testsuite/Makefile.am (DEPENDENCIES): Remove LIBINTL_DEP. * testsuite/Makefile.in: Regenerate. gprof/ * Makefile.am (gprof_DEPENDENCIES): Remove LIBINTL_DEP. * Makefile.in: Regenerate. * configure: Regenerate. ld/ * Makefile.am (ld_new_DEPENDENCIES): Remove LIBINTL_DEP. * Makefile.in: Regenerate. * configure: Regenerate. libctf/ * Makefile.in: Regenerate. * configure: Regenerate. opcodes/ * configure.ac (BUILD_LIBS): Remove LIBINTL. (BUILD_LIB_DEPS): Remove LIBINTL_DEP. * Makefile.in: Regenerate. * configure: Regenerate.
2024-04-10gdb, gdbserver: Add missing install-dvi Makefile targetChristophe Lyon1-0/+1
For some reason install-dvi is missing although other targets of the same family are present. This looks like an oversight. This enables calling 'make install-dvi' from the top-level build directory. Fix what looks like another oversight: include 'pdf' in 'all-doc' in gdb/doc/Makefile.in. Approved-By: Luis Machado <luis.machado@arm.com> Tested-By: Luis Machado <luis.machado@arm.com>
2024-03-26gdb, gdbserver, gdbsupport: include early header files with `-include`Simon Marchi1-2/+12
The motivation for this change is for analysis tools and IDEs to be better at analyzing header files on their own. There are some definitions and includes we want to occur at the very beginning of all translation units. The way we currently do that is by requiring all source files (.c and .cc files) to include one of defs.h (for gdb), server.h (for gdbserver) of common-defs.h (for gdbsupport and shared source files). These special header files define and include everything that needs to be included at the very beginning. Other header files are written in a way that assume that these special "prologue" header files have already been included. My problem with that is that my editor (clangd-based) provides a very bad experience when editing header files. Since clangd doesn't know that one of defs.h/server.h/common-defs.h was included already, a lot of things are flagged as errors. For instance, CORE_ADDR is not known. It's possible to edit the files in this state, but a lot of the power of the editor is unavailable. My proposal to help with this is to include those things we always want to be there using the compilers' `-include` option. Tom Tromey said that the current approach might exist because not all compilers used to have an option like this. But I believe that it's safe to assume they do today. With this change, clangd picks up the -include option from the compile command, and is able to analyze the header file correctly, as it sees all that stuff included or defined by that -include option. That works because when editing a header file, clangd tries to get the compilation flags from a source file that includes said header file. This change is a bit self-serving, because it addresses one of my frustrations when editing header files, but it might help others too. I'd be curious to know if others encounter the same kinds of problems when editing header files. Also, even if the change is not necessary by any means, I think the solution of using -include for stuff we always want to be there is more elegant than the current solution. Even with this -include flag, many header files currently don't include what they use, but rather depend on files included before them. This will still cause errors when editing them, but it should be easily fixable by adding the appropriate include. There's no rush to do so, as long as the code still compiles, it's just a convenience thing. The changes are: - Add the appropriate `-include` option to the various Makefiles. - There is one particularity for gdbserver's Makefile: we do not want to include server.h when building `gdbreplay.o`, as `gdbreplay.cc` doesn't include it. So we can't simply put the `-include` in `INTERNAL_CFLAGS`. Add the `-include server.h` option to the `COMPILE` and `IPAGENT_COMPILE` variables, and added a special rule to compile `gdbreplay.o` with `-include gdbsupport/common-defs.h`. - Remove the `-include` option from the `check-headers` rule in gdb/Makefile.in, since it is already included in `INTERNAL_CFLAGS`. Change-Id: If3e345d00a9fc42336322f1d8286687d22134340 Approved-By: Pedro Alves <pedro@palves.net>
2024-03-26{gdb,gdbserver}/Makefile.in: remove unnecessary intermediary variablesSimon Marchi1-9/+3
Remove `INTERNAL_CFLAGS_BASE` and `INTERNAL_WARN_CFLAGS`, inline their contents in `INTERNAL_CFLAGS`. Not functional changes expected. Change-Id: I6a09794835ca2cfd4a88a3e9f2e627c8f5bd569f Approved-By: Pedro Alves <pedro@palves.net>
2024-03-26gdb, gdbserver, gdbsupport: reformat some Makefile variables, one entry per lineSimon Marchi1-12/+38
Reformat some variables definitions. I think it makes them easier to read, and it also makes diffs clearer. Change-Id: I82f63ba0e6d0fe268eb1f1ad5ab22c3cd016ab02 Approved-By: Pedro Alves <pedro@palves.net>
2024-03-26Revert "gdb/gdbserver: share x86/linux tdesc caching"Andrew Burgess1-4/+0
This reverts commit 198ff6ff819c240545f9fc68b39636fd376d4ba9.
2024-03-26Revert "gdbserver/Makefile.in: add missing `-x c++`"Andrew Burgess1-1/+1
This reverts commit c7c9820071f8b81a64221f5cfafb3cbfeafe7916.
2024-03-25gdbserver/Makefile.in: add missing `-x c++`Simon Marchi1-1/+1
When building with Clang, I get: CXX nat/x86-linux-tdesc-ipa.o clang++: error: treating 'c' input as 'c++' when in C++ mode, this behavior is deprecated [-Werror,-Wdeprecated] Fix that by adding the missing `-x c++` in the rule building `gdb/nat/*.c` files for the in-process agent. Change-Id: Ie53e4b9a8b57bef9669397fdfaf21617107c7180 Approved-By: Tom Tromey <tom@tromey.com>
2024-03-25gdb/gdbserver: share x86/linux tdesc cachingAndrew Burgess1-0/+4
This commit builds on the previous series of commits to share the target description caching code between GDB and gdbserver for x86/Linux targets. The objective of this commit is to move the four functions (2 each of) i386_linux_read_description and amd64_linux_read_description into gdb/nat/x86-linux-tdesc.c and combine them so we have just a single copy of each. Then both GDB and gdbserver will link against these shared functions. It is worth reading the description of the previous commit to see why this merging is not as simple as it seems: on the gdbserver side we actually have two users of these functions, gdbserver itself, and the in process agent (IPA). However, the previous commit streamlined the gdbserver code, and so now it is simple to move the two functions along with all their support functions from the gdbserver directory into the gdb/nat/ directory, and then GDB is fine to call these functions. One small curiosity with this patch is the function x86_linux_post_init_tdesc. On the gdbserver side the two functions amd64_linux_read_description and i386_linux_read_description have some functionality that is not present on the GDB side, that is some additional configuration that is performed as each target description is created to setup the expedited registers. To support this I've added the function x86_linux_post_init_tdesc. This function is called from the two *_linux_read_description functions, but is implemented separately for GDB and gdbserver. This does mean adding back some non-shared code when this whole series has been about sharing code, but now the only non-shared bit is the single line that is actually different between GDB and gdbserver, all the rest, which is identical, is now shared. I did need to add a new rule to the gdbserver Makefile, this is to allow the nat/x86-linux-tdesc.c file to be compiled for the IPA. Approved-By: John Baldwin <jhb@FreeBSD.org>
2024-03-14gdbserver/linux: probe for libiconv in configureSimon Marchi1-1/+3
Make gdbserver's build system locate libiconv when building for Linux. Commit 07b3255c3bae ("Filter invalid encodings from Linux thread names") make libiconv madantory for building gdbserver on Linux. While trying to cross-compile gdb for xtensa-fsf-linux-uclibc (with a toolchain generated with crosstool-ng), I got: /home/smarchi/src/binutils-gdb/gdbserver/linux-low.cc:48:10: fatal error: iconv.h: No such file or directory 48 | #include <iconv.h> | ^~~~~~~~~ I downloaded GNU libiconv, built it for that host, and installed it in an arbitrary directory. I had to modify the gdbserver build system to locate libiconv and use it, the result is this patch. I eventually found that crosstool-ng has a config option to make uclibc provide an implementation of iconv, which is of course much easier. But given that this patch is now written, I think it would be worth merging it, it could help some people who do not have iconv built-in their libc in the future (and may not have the luxury of rebuilding their libc like I do). Using AM_ICONV in configure.ac adds these options for configure (the same we have for gdb): --with-libiconv-prefix[=DIR] search for libiconv in DIR/include and DIR/lib --without-libiconv-prefix don't search for libiconv in includedir and libdir --with-libiconv-type=TYPE type of library to search for (auto/static/shared) It sets the `LIBICONV` variable with whatever is needed to link with libiconv, and adds the necessary `-I` flag to `CPPFLAGS`. To avoid unnecessarily linking against libiconv on hosts that don't need it, set `MAYBE_LIBICONV` with the contents of `LIBICONV` only if the host is Linux, and use `MAYBE_LIBICONV` in `Makefile.in`. Since libiconv is a hard requirement for Linux hosts, error out if it is not found. The bits in acinclude.m4 are similar to what we have in gdb/acinclude.m4. Update the top-level build system to support building against an in-tree libiconv (I did not test this part though). Something tells me that the all-gdbserver dependency on all-libiconv is unnecessary, since there is already a dependency of configure-gdbserver on all-libiconv (and all-gdbserver surely depends on configure-gdbserver). I just copied what's done for GDB though. ChangeLog: * Makefile.def: Add configure-gdbserver and all-gdbserver dependencies on all-libiconv. * Makefile.in: Re-generate. Change-Id: I90f8ef88dd4917df5a68b45550d93622fc9cfed4 Approved-By: Tom Tromey <tom@tromey.com>
2024-01-12Update copyright year range in header of all files managed by GDBAndrew Burgess1-1/+1
This commit is the result of the following actions: - Running gdb/copyright.py to update all of the copyright headers to include 2024, - Manually updating a few files the copyright.py script told me to update, these files had copyright headers embedded within the file, - Regenerating gdbsupport/Makefile.in to refresh it's copyright date, - Using grep to find other files that still mentioned 2023. If these files were updated last year from 2022 to 2023 then I've updated them this year to 2024. I'm sure I've probably missed some dates. Feel free to fix them up as you spot them.
2023-10-04refactor: Rename SVE-specific filesLuis Machado1-1/+1
In preparation to the SME support patches, rename the SVE-specific files to something a bit more meaningful that can be shared with the SME code. In this case, I've renamed the "sve" in the names to "scalable". No functional changes. Regression-tested on aarch64-linux Ubuntu 22.04/20.04. Reviewed-by: Thiago Jung Bauermann <thiago.bauermann@linaro.org>
2023-01-18Fix 'make TAGS' in gdbserverTom Tromey1-3/+4
PR build/29003 points out that "make TAGS" is broken in gdbserver. This patch fixes the problem that is pointed out there, plus another one I noticed while working on that -- namely that the "sed" computes the wrong names for some source files. Finally, a couple of obsolete variable references are removed. Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=29003
2023-01-01Update copyright year range in header of all files managed by GDBJoel Brobecker1-1/+1
This commit is the result of running the gdb/copyright.py script, which automated the update of the copyright year range for all source files managed by the GDB project to be updated to include year 2023.
2022-09-13gdbserver/csky add csky gdbserver supportJiangshuai Li1-0/+2
Add new files: gdb/arch/csky.c gdb/arch/csky.h gdb/features/cskyv2-linux.c gdbserver/linux-csky-low.cc 1. In gdb/arch/csky.c file, add function "csky_create_target_description()" for csky_target::low_arch_setup(). later, it can be used for csky native gdb. 2. In gdb/features/cskyv2-linux.c file, create target_tdesc for csky, include gprs, pc, hi, lo, float, vector and float control registers. 3. In gdbserver/linux-csky-low.cc file, using PTRACE_GET/SET_RGESET to get/set registers. The main data structures in asm/ptrace.h are: struct pt_regs { unsigned long tls; unsigned long lr; unsigned long pc; unsigned long sr; unsigned long usp; /* * a0, a1, a2, a3: * r0, r1, r2, r3 */ unsigned long orig_a0; unsigned long a0; unsigned long a1; unsigned long a2; unsigned long a3; /* * r4 ~ r13 */ unsigned long regs[10]; /* r16 ~ r30 */ unsigned long exregs[15]; unsigned long rhi; unsigned long rlo; unsigned long dcsr; }; struct user_fp { unsigned long vr[96]; unsigned long fcr; unsigned long fesr; unsigned long fid; unsigned long reserved; };
2022-06-14gdbserver: Add LoongArch/Linux supportYouling Tang1-0/+2
Implement LoongArch/Linux support, including XML target description handling based on features determined, GPR regset support, and software breakpoint handling. In the Linux kernel code of LoongArch, ptrace implements PTRACE_POKEUSR and PTRACE_PEEKUSR in the arch_ptrace function, so srv_linux_usrregs is set to yes. With this patch on LoongArch: $ make check-gdb TESTS="gdb.server/server-connect.exp" [...] # of expected passes 18 [...] Signed-off-by: Youling Tang <tangyouling@loongson.cn> Signed-off-by: Tiezhu Yang <yangtiezhu@loongson.cn>
2022-04-28Fix libinproctrace.so build on PPCTom Tromey1-1/+2
The recent gnulib import caused a build failure of libinproctrace.so on PPC: alloc.c:(.text+0x20): undefined reference to `rpl_malloc' alloc.c:(.text+0x70): undefined reference to `rpl_realloc' This patch fixes the problem using the same workaround that was previously used for free.
2022-04-14Move target_read_string to target/target.cTom Tromey1-0/+2
This moves the two overloads of target_read_string to a new file, target/target.c, and updates both gdb and gdbserver to build this.
2022-01-01Automatic Copyright Year update after running gdb/copyright.pyJoel Brobecker1-1/+1
This commit brings all the changes made by running gdb/copyright.py as per GDB's Start of New Year Procedure. For the avoidance of doubt, all changes in this commits were performed by the script.
2021-11-16Remove config.cache in gdbserver's "distclean"Tom Tromey1-2/+1
PR gdb/28586 points out that "make distclean" fails to delete config.cache from gdbserver/. This patch fixes the bug, and removes a duplicate "Makefile" deletion that was also pointed out in the PR.
2021-10-29gdb: or1k: implement gdb serverStafford Horne1-0/+1
This patch adds gdbserver support for OpenRISC. This has been used for debugging the glibc port that in being worked on here: https://github.com/openrisc/or1k-glibc/tree/or1k-port-2 Hence the comment about registers definitions being inline with glibc.
2021-10-22Fix 'uninstall' targetTom Tromey1-1/+4
This adds some missing code to the 'uninstall' targets in gdb and gdbserver. It also changes gdb's uninstall target so that it no longer tries to remove any man page -- this is already done (and more correctly) by doc/Makefile.in. I tested this with 'make install' followed by 'make uninstall', then examining the install tree for regular files. Only the 'dir' file remains, but this appears to just be how 'install-info' is intended to work.
2021-10-22Remove unused variables from gdbserver's MakefileTom Tromey1-26/+1
This removes a number of unused variables from gdbserver's Makefile. I found these while working on the subsequent patches, and figured it would be cleaner to have a separate patch for the deletions.
2021-06-14gnulib: define the path to gnulib's parent dirMike Frysinger1-2/+2
The current setting assumes that gnulib is only used by dirs immediately under the source root. Trying to build it two or more levels deep fails. Switch GNULIB_BUILDDIR to a relative GNULIB_PARENT_DIR so that it can be used to construct both the build & source paths.
2021-04-13Remove process_stratum_target::hostio_last_error abstractionPedro Alves1-1/+0
Now that the WinCE port is gone, all ports map host I/O errors from errno, so this abstraction is no longer necessary. Basically undoes: https://sourceware.org/pipermail/gdb-patches/2008-January/055511.html https://sourceware.org/pipermail/gdb-patches/attachments/20080131/f44e7012/attachment.bin gdbserver/ChangeLog: * Makefile.in (SFILES): Remove hostio-errno.cc. * configure: Regenerate. * configure.ac (GDBSERVER_DEPFILES): No longer add $srv_hostio_err_objs. * configure.srv (srv_hostio_err_objs): Delete. * hostio-errno.cc: Delete. * hostio.cc (hostio_error): Inline hostio_last_error_from_errno here. * hostio.h (hostio_last_error_from_errno): Delete. * target.cc (process_stratum_target::hostio_last_error): Delete. * target.h (class process_stratum_target) <hostio_last_error>: Delete.
2021-03-24AArch64: Add gdbserver MTE supportLuis Machado1-0/+1
Adds the AArch64-specific memory tagging support (MTE) by implementing the required hooks and checks for GDBserver. gdbserver/ChangeLog: 2021-03-24 Luis Machado <luis.machado@linaro.org> * Makefile.in (SFILES): Add /../gdb/nat/aarch64-mte-linux-ptrace.c. * configure.srv (aarch64*-*-linux*): Add arch/aarch64-mte-linux.o and nat/aarch64-mte-linux-ptrace.o. * linux-aarch64-low.cc: Include nat/aarch64-mte-linux-ptrace.h. (class aarch64_target) <supports_memory_tagging> <fetch_memtags, store_memtags>: New method overrides. (aarch64_target::supports_memory_tagging) (aarch64_target::fetch_memtags) (aarch64_target::store_memtags): New methods.
2021-02-05gnulib: update to 776af40e0Paul E. Murphy1-1/+1
This fixes PR27184, a failure to compile gdb due to cdefs.h being out of sync with glibc on ppc64le targets which are compiled with -mabi=ieeelongdouble and glibc 2.32. Likewise, update usage of _GL_ATTRIBUTE_FORMAT_PRINTF to _GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD. Likewise, disable newly added rpl_free gnulib api in gdbserver support libraries. Likewise, undefine read/write macros before redefining them on mingw targets. Likewise, wrap C++ usage of free with GNULIB_NAMESPACE namespace as needed. Change-Id: I86517613c0d8ac8f5ea45bbc4ebe2b54a3aef29f
2021-01-07[gdb/build] Fix gdbserver build with -fsanitize=addressTom de Vries1-2/+11
When doing a gdbserver build with CFLAGS/CXXFLAGS/LDFLAGS=-fsanitize=address we run into: ... ld: ../libiberty/libiberty.a(safe-ctype.o): relocation R_X86_64_32 against `.data' can not be used when making a shared object; recompile with -fPIC collect2: error: ld returned 1 exit status make[1]: *** [libinproctrace.so] Error 1 ... This started with commit 96648494173 "gdbsupport: make use of safe-ctype functions from libiberty", which introduced a dependency of libinproctrace.so on libiberty. Fix this in gdbserver/Makefile.in by using a setup similar to what is done in gcc-repo/src/libcc1/Makefile.am, such that ../libiberty/noasan/libiberty.a is used instead. Build on x86_64-linux, both with and without -fsanitize=address. gdbserver/ChangeLog: 2021-01-07 Tom de Vries <tdevries@suse.de> * Makefile.in (LIBIBERTY_NORMAL, LIBIBERTY_NOASAN, LIBIBERTY_PIC): (LIBIBERTY_FOR_SHLIB): New var. (LIBIBERTY): Set using $(LIBIBERTY_NORMAL). (IPA_LIB): Use LIBIBERTY_FOR_SHLIB instead of LIBIBERTY in target rule.
2021-01-01Update copyright year range in all GDB filesJoel Brobecker1-1/+1
This commits the result of running gdb/copyright.py as per our Start of New Year procedure... gdb/ChangeLog Update copyright year range in copyright header of all GDB files.
2020-12-11gdbsupport: make use of safe-ctype functions from libibertyAndrew Burgess1-1/+1
Make use of the safe-ctype replacements for the standard ctype character checking functions in gdbsupport/common-utils.cc. The gdbsupport library is included into both gdb and gdbserver, and on the gdbserver side there are two targets, gdbserver itself, and also libinproctrace.so. libiberty was already being included in the gdbserver link command, but was missing from the libinproctrace.so link. As a result, after changing gdbsupport/common-utils.cc to depend on libiberty, libinproctrace.so would no longer link until I modified its link line. gdbserver/ChangeLog: * Makefile.in (IPA_LIB): Include libiberty library. gdbsupport/ChangeLog: * gdbsupport/common-utils.cc: Change 'ctype.h' include to 'safe-ctype.h'. (extract_string_maybe_quoted): Use safe-ctype function versions. (is_digit_in_base): Likewise. (digit_to_int): Likewise. (strtoulst): Likewise. (skip_spaces): Likewise. (skip_to_space): Likewise.
2020-10-09gnulib: Ensure all libraries are used when building gdb/gdbserverAndrew Burgess1-6/+5
An issue was reported here related to building GDB on MinGW: https://sourceware.org/pipermail/gdb/2020-September/048927.html It was suggested here: https://sourceware.org/pipermail/gdb/2020-September/048931.html that the solution might be to make use of $(LIB_GETRANDOM), a variable defined in the gnulib makefile, when linking GDB. In fact I think the issue is bigger than just LIB_GETRANDOM. When using the script binutils-gdb/gnulib/update-gnulib.sh to reimport gnulib there is a lot of output from gnulib's gnulib-tool. Part of that output is this: You may need to use the following makefile variables when linking. Use them in <program>_LDADD when linking a program, or in <library>_a_LDFLAGS or <library>_la_LDFLAGS when linking a library. $(FREXPL_LIBM) $(FREXP_LIBM) $(INET_NTOP_LIB) $(LIBTHREAD) $(LIB_GETLOGIN) $(LIB_GETRANDOM) $(LIB_HARD_LOCALE) $(LIB_MBRTOWC) $(LIB_SETLOCALE_NULL) $(LTLIBINTL) when linking with libtool, $(LIBINTL) otherwise What I think this is telling us is that we should be including the value of all these variables on the link line for gdb and gdbserver. The problem though is that these variables are define in gnulib's makefile, but are not (necessarily) defined in GDB's makefile. One solution would be to recreate the checks that gnulib performs in order to recreate these variables in both gdb's and gdbserver's makefile. Though this shouldn't be too hard, most (if not all) of these checks are in the form macros defined in m4 files in the gnulib tree, so we could just reference these as needed. However, in this commit I propose a different solution. Currently, in the top level makefile, we give gdb and gdbserver a dependency on gnulib. Once gnulib has finished building gdb and gdbserver can start, these projects then have a hard coded (relative) path to the compiled gnulib library in their makefiles. In this commit I extend the gnulib configure script to install a new makefile fragment in the gnulib build directory. This new file will have the usual variable substitutions applied to it, and so can include the complete list (see above) of all the extra libraries that are needed when linking against gnulib. In fact the new makefile fragment defines three variables, these are: LIBGNU: The path to the archive containing gnulib. Can be used as a dependency as when this file changes gdb/gdbserver should be relinked. LIBGNU_EXTRA_LIBS: A list of linker -l.... flags that should be included in the link line of gdb/gdbserver. These are libraries that $(LIBGNU) depends on. This list is taken from the output of gnulib-tool, which is run by our gnulib/update-gnulib.sh script. INCGNU: A list of -I.... include paths that should be passed to the compiler, these are where the gnulib headers can be found. Now both gdb and gdbserver can include the makefile fragment and make use of these variables. The makefile fragment relies on the variable GNULIB_BUILDDIR being defined. This is checked for in the fragment, and was already defined in the makefiles of gdb and gdbserver. gdb/ChangeLog: * Makefile.in: Include Makefile.gnulib.inc. Don't define LIBGNU or INCGNU. Make use of LIBGNU_EXTRA_LIBS when linking. gdbserver/ChangeLog: * Makefile.in: Include Makefile.gnulib.inc. Don't define LIBGNU or INCGNU. Make use of LIBGNU_EXTRA_LIBS when linking. gnulib/ChangeLog: * Makefile.gnulib.inc.in: New file. * Makefile.in: Regenerate. * configure: Regenerate. * configure.ac: Install the new file.
2020-10-07gdb: put user-supplied CFLAGS at the endSimon Marchi1-3/+11
GDB currently doesn't build cleanly with clang (a -Wdeprecated-copy-dtor error). I configured my clang-based GDB build with CXXFLAGS="-Wno-error=deprecated-copy-dtor", so I can use it despite that problem. However, I found that it had no effect. This is because my -Wno-error=Wdeprecated-copy-dtor switch is followed by -Werror in the command line, which switches back all warnings to be errors. If we want the user-supplied C(XX)FLAGS to be able to override flags added by our configure script, the user-supplied C(XX)FLAGS should appear after the configure-supplied flags. This patch moves the user-supplied CXXFLAGS at the very end of the compilation command line, which fixes the problem described above. This means moving it out of INTERNAL_CFLAGS and inlining it in the users of INTERNAL_CFLAGS. I observed the problem when building GDB, but the same problem could happen with GDBserver, so the change is done there too. In GDBserver, INTERNAL_CFLAGS is passed when linking gdb/ChangeLog: * Makefile.in (COMPILE): Add CXXFLAGS. (INTERNAL_CFLAGS_BASE): Remove CXXFLAGS. (check-headers): Add CXXFLAGS. gdbserver/ChangeLog: * Makefile.in (COMPILE): Add CXXFLAGS. (INTERNAL_CFLAGS_BASE): Remove CXXFLAGS. (gdbserver$(EXEEXT)): Add CXXFLAGS. (gdbreplay$(EXEEXT)): Add CXXFLAGS. ($(IPA_LIB)): Add CXXFLAGS. (IPAGENT_COMPILE): Add CXXFLAGS. Change-Id: I00e054506695e0e9536095c6d14827e48abd8f69
2020-10-07Add Makefile.in entry for "Add NetBSD/aarch64 gdbserver support"Kamil Rytarowski1-0/+1
The support is on par with NetBSD/amd64, thus GPR works, single step and software breakpoint are operational, and the SVR4 r_debug integration is functional. gdbserver/ChangeLog: * netbsd-aarch64-low.cc: Add. * Makefile.in (SFILES): Register "netbsd-aarch64-low.c". * configure.srv: Add aarch64*-*-netbsd*.
2020-10-07gdbserver: Add GNU/Linux support for ARCAnton Kolesov1-0/+2
This gdbserver implementation supports ARC ABI v3 and v4 (older ARC ABI versions are not supported by other modern GNU tools or Linux itself). Gdbserver supports inspection of ARC HS registers R30, R58 and R59 - feature that has been added to Linux 4.12. Whether gdbserver build will actually support this feature depends on the version of Linux headers used to build the server. v2 [1]: - Use "this->read_memory ()" instead of "the_target->read_memory ()". - Remove the unnecessary "arch-arc.o:" target from the "Makefile.in". - Got rid of "ntohs()" function and added lots of comments about endianness. - Clarify why "pc" value is read from and saved to different fields in user regs struct. - In function "is_reg_name_available_p()", use a range-based iterator to loop over the registers. - Removed mentioning of issue number that was not related to sourceware. - A few typo's fixed. [1] Remarks https://sourceware.org/pipermail/gdb-patches/2020-September/171911.html https://sourceware.org/pipermail/gdb-patches/2020-September/171919.html gdbserver/ChangeLog: * configure.srv: Support ARC architecture. * Makefile.in: Add linux-arc-low.cc and arch/arc.o. * linux-arc-low.cc: New file.
2020-10-02Add NetBSD/i386 gdbserver supportKamil Rytarowski1-0/+1
The support is on part with NetBSD/amd64, thus GPR works, single step and software breakpoint are operational, and the SVR4 r_debug integration is functional. gdbserver/ChangeLog: * netbsd-i386-low.cc: Add. * Makefile.in (SFILES): Register "netbsd-i386-low.c". * configure.srv: Add i[34567]86-*-netbsd*.
2020-09-10Add minimal and functional NetBSD/amd64 gdbserverKamil Rytarowski1-0/+3
Implement the following functionality: create_inferior, post_create_inferior, attach, kill, detach, mourn, join, thread_alive, resume, wait, fetch_registers, store_registers, read_memory, write_memory, request_interrupt, supports_read_auxv, read_auxv, supports_hardware_single_step, sw_breakpoint_from_kind, supports_z_point_type, insert_point, remove_point, stopped_by_sw_breakpoint, supports_qxfer_siginfo, qxfer_siginfo, supports_stopped_by_sw_breakpoint, supports_non_stop, supports_multi_process, supports_fork_events, supports_vfork_events, supports_exec_events, supports_disable_randomization, supports_qxfer_libraries_svr4, qxfer_libraries_svr4, supports_pid_to_exec_file, pid_to_exec_file, thread_name, supports_catch_syscall. The only CPU architecture supported: x86_64. Implement only support for hardware assisted single step and software breakpoint. Implement support only for regular X86 registers, thus no FPU. gdbserver/ChangeLog: * netbsd-low.cc: Add. * netbsd-low.h: Likewise. * netbsd-amd64-low.cc: Likewise. * Makefile.in (SFILES): Register "netbsd-low.cc", "netbsd-low.h", "netbsd-amd64-low.cc". * configure.srv: Add x86_64-*-netbsd*.
2020-06-17gdb, gdbserver: remove ARM regdat filesSimon Marchi1-3/+0
This patch removes the leftover regformats .dat files for the arm architecture. There are no longer relevant, since the arm architecture has been converted to use feature-based target-descriptions. These .dat files are used by GDBserver ports that still use static target descriptions. These .dat files are generated from corresponding .xml files in the features directory. And since the corresponding .xml files for these arm .dat files don't exist anymore, it is impossible to re-generated them. If you delete these .dat files and type "make" in the features directory, you'll get: make: *** No rule to make target '../regformats/arm/arm-with-iwmmxt.dat', needed by 'all'. Stop. So it removes the entries in the `WHICH` variable of gdb/features/Makefile. Finally, it removes the rule in gdbserver/Makefile to generate .cc files from `../gdb/regformats/arm/%.dat`. gdb/ChangeLog: * features/Makefile (WHICH): Remove arm files. * regformats/arm/arm-with-iwmmxt.dat: Remove. * regformats/arm/arm-with-neon.dat: Remove. * regformats/arm/arm-with-vfpv2.dat: Remove. * regformats/arm/arm-with-vfpv3.dat: Remove. gdbserver/ChangeLog: * Makefile.in (%-generated.cc: ../gdb/regformats/arm/%.dat): Remove. Change-Id: I3b7d989c50e2cb92235c1f7c7071a26839d84c78
2020-06-12gdbserver: remove support for ARM/WinCESimon Marchi1-2/+0
This port has been unmaintained for years, remove it. gdbserver/ChangeLog: * Makefile.in (SFILES): Remove win32-arm-low.cc, wincecompat.cc. * configure.srv: Remove mingw32ce cases. * server.h, win32-low.cc: Remove __MINGW32CE__-guarded code. * win32-low.h (to_back_slashes): Remove. * win32-arm-low.cc, wincecompat.cc, wincecompat.h: Remove. Change-Id: Ib75c0b55b0ab7caca38bbeff5f2fa9397a8e7e8d
2020-06-12gdbserver: remove support for TileSimon Marchi1-1/+0
This port has been unmaintained for years and the upstream Linux kernel does not support this architecture anymore, remove it. gdbserver/ChangeLog: * Makefile.in (SFILES): linux-tile-low.cc. * configure.srv: Remove tilegx case. * linux-tile-low.cc: Remove. Change-Id: I1c2910d04ddbd6013e5d228047106b41d80f9477
2020-06-12gdbserver: remove support for M32RSimon Marchi1-1/+0
This port has been unmaintained for years and the upstream Linux kernel does not support this architecture anymore, remove it. gdbserver/ChangeLog: * Makefile.in (SFILES): Remove linux-m32r-low.cc. * configure.srv: Remove m32r case. * linux-m32r-low.cc: Remove. Change-Id: I5617b2b1fd92aeec19b38e0e3c0b78adaafdb35b
2020-06-12gdbserver: remove support for CRISSimon Marchi1-2/+0
This port has been unmaintained for years and the upstream Linux kernel does not support this architecture anymore, remove it. gdbserver/ChangeLog: * Makefile.in (SFILES): Remove linux-cris-low.c. * configure.srv: Remove cris cases. * linux-cris-low.cc, linux-crisv32-low.cc: Remove. Change-Id: Ib3ff436b03373548215f15540a47f39cbec5f512
2020-06-12gdbserver: remove support for BlackfinSimon Marchi1-1/+0
This port has been unmaintained for years and the upstream Linux kernel does not support this architecture anymore, remove it. gdbserver/ChangeLog: * Makefile.in (SFILES): Remove linux-bfin-low.c. * configure.srv: Remove bfin case. * linux-bfin-low.cc: Remove. * linux-low.cc: Remove BFIN-conditional code. Change-Id: I846310d15e6386118ec7eabb1b87e647174560fb
2020-04-13Switch gdbserver to gdbsupport event loopTom Tromey1-1/+0
This changes gdbserver to use the gdbserver event loop, removing the ancient fork. gdbserver/ChangeLog 2020-04-13 Tom Tromey <tom@tromey.com> * server.h (handle_serial_event, handle_target_event): Update. * server.c: Don't call initialize_event_loop. (keep_processing_events): New global. (handle_serial_event): Return void. Set keep_processing_events. (handle_target_event): Return void. (start_event_loop): Move from event-loop.c. Rewrite. * remote-utils.c (handle_accept_event): Return void. (reset_readchar): Use delete_timer. (process_remaining): Return void. (reschedule): Use create_timer. * event-loop.h: Remove. * event-loop.cc: Remove. * Makefile.in (OBS): Use gdbsupport/event-loop.o, not event-loop.o.
2020-03-12Change gdbserver to use existing gdbsupportTom Tromey1-75/+13
This changes the gdbserver build to use the gdbsupport that was built for gdb. gdbserver and gdbreplay now must use WIN32APILIBS (aka -lws2_32). Before this change, gdbserver did not define USE_WIN32API when building gdbsupport, but now this is always done. ChangeLog 2020-03-12 Tom Tromey <tom@tromey.com> * Makefile.in: Rebuild. * Makefile.def (gdbserver): Depend on gdbsupport. gdbserver/ChangeLog 2020-03-12 Tom Tromey <tom@tromey.com> * configure: Rebuild. * configure.ac (GDBSERVER_DEPFILES): Remove srv_selftest_objs. (WIN32APILIBS): New subst. * Makefile.in (SFILES, OBS, TAGS, GDBREPLAY_OBS): Remove gdbsupport files. (gdbsupport/%.o): Remove target. (GDBSUPPORT_BUILDDIR, GDBSUPPORT): New variables. (gdbserver$(EXEEXT), gdbreplay$(EXEEXT)): Add GDBSUPPORT. (WIN32APILIBS): New variable. (gdbserver$(EXEEXT)): Add WIN32APILIBS. (gdbreplay$(EXEEXT)): Likewise.
2020-03-12Fix gdbserver build when intl already builtTom Tromey1-5/+15
gdbserver uses gdb's alloc.c, and this in turn can include headers from intl via gdbsupport/gdb_locale.h. This can cause build failures in some situations, for example if you build gdb and gdbserver on mingw. This patch restores the gdbsupport dependency on intl, and changes gdbserver to use ZW_GNU_GETTEXT_SISTER_DIR. This fixes this build problem. ChangeLog 2020-03-12 Tom Tromey <tom@tromey.com> * Makefile.in: Rebuild. * Makefile.def (gdbsupport): Depend on intl. gdbserver/ChangeLog 2020-03-12 Tom Tromey <tom@tromey.com> * config.in, configure: Rebuild. * configure.ac: Call ZW_GNU_GETTEXT_SISTER_DIR. * acinclude.m4: Include gettext-sister.m4. * Makefile.in (top_builddir, INTL, INTL_DEPS, INTL_CFLAGS): New variables. (INCLUDE_CFLAGS): Add INTL_CFLAGS. (gdbserver$(EXEEXT), gdbreplay$(EXEEXT)): Use INTL_DEPS, INTL.
2020-02-21Add a mostlyclean target to gdbserverTom Tromey1-1/+1
I noticed gdbserver's Makefile doesn't have a mostlyclean target. I use this sometimes, so this patch adds it. Adding it as a synonym of "clean" seemed to make sense, given the contents of that rule. gdbserver/ChangeLog 2020-02-21 Tom Tromey <tom@tromey.com> * Makefile.in (mostlyclean): New target.
2020-02-19gdbserver: Add RISC-V/Linux supportMaciej W. Rozycki1-0/+3
Implement RISC-V/Linux support for both RV64 and RV32 systems, including XML target description handling based on features determined, GPR and FPR regset support including dynamic sizing of the latter, and software breakpoint handling. Define two NT_FPREGSET regsets of a different size matching the FPR sizes supported for generic `gdbserver' code to pick from according to what the OS supplies. Also handle a glibc bug where ELF_NFPREG is defined in terms of NFPREG, however NFPREG is nowhere defined. 2020-02-19 Maciej W. Rozycki <macro@wdc.com> Andrew Burgess <andrew.burgess@embecosm.com> gdb/ * NEWS: Mention RISC-V GNU/Linux GDBserver support. gdbserver/ * linux-riscv-low.cc: New file. * Makefile.in (SFILES): Add linux-riscv-low.cc, arch/riscv.c, and nat/riscv-linux-tdesc.c. * configure.srv <riscv*-*-linux*> (srv_tgtobj) (srv_linux_regsets, srv_linux_usrregs, srv_linux_thread_db): Define.
2020-02-14Change gdbserver to use existing gnulib and libibertyTom Tromey1-55/+4
This changes gdbserver so that it no longer builds its own gnulib and libiberty. Instead, it now relies on the ones that were already built at the top level. gdbsupport is still built specially for gdbserver. This is more complicated and will be tackled in a subsequent patch. ChangeLog 2020-02-14 Tom Tromey <tom@tromey.com> * Makefile.in: Rebuild. * Makefile.def: Make gdbserver require gnulib and libiberty. gdbserver/ChangeLog 2020-02-14 Tom Tromey <tom@tromey.com> * acinclude.m4: Don't include acx_configure_dir.m4. * Makefile.in (LIBIBERTY_BUILDDIR, GNULIB_BUILDDIR): Update. (SUBDIRS, CLEANDIRS, REQUIRED_SUBDIRS): Remove. (all, install-only, uninstall, clean-info, clean) (maintainer-clean): Don't recurse. (subdir_do, all-lib): Remove. ($(LIBGNU) $(LIBIBERTY) $(GNULIB_H)): Remove rule. (GNULIB_H): Remove. (generated_files): Update. ($(GNULIB_BUILDDIR)/Makefile): Remove rule. * configure: Rebuild. * configure.ac: Don't configure gnulib or libiberty. (GNULIB): Update. gdbsupport/ChangeLog 2020-02-14 Tom Tromey <tom@tromey.com> * common-defs.h: Change path to gnulib/config.h. Change-Id: I469cbbf5db2ab37109c058e9e3a1e4f4dabdfc98
2020-02-13gdbserver: rename source files to .ccSimon Marchi1-66/+66
For the same reasons outlined in the previous patch, this patch renames gdbserver source files to .cc. I have moved the "-x c++" switch to only those rules that require it. gdbserver/ChangeLog: * Makefile.in: Rename source files from .c to .cc. * %.c: Rename to %.cc. * configure.ac: Rename server.c to server.cc. * configure: Re-generate.