aboutsummaryrefslogtreecommitdiff
path: root/gdbserver/Makefile.in
AgeCommit message (Collapse)AuthorFilesLines
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.
2020-02-13gdbsupport: rename source files to .ccSimon Marchi1-28/+28
This patch renames the .c source files in gdbsupport to .cc. In the gdb directory, there is an argument against renaming the source files, which is that it makes using some git commands more difficult to do archeology. Some commands have some kind of "follow" option that makes git try to follow renames, but it doesn't work in all situations. Given that we have just moved the gdbsupport directory, that argument doesn't hold for source files in that directory. I therefore suggest renaming them to .cc, so that they are automatically recognized as C++ by various tools and editors. The original motivation behind this is that when building gdbsupport with clang, I get: CC agent.o clang: error: treating 'c' input as 'c++' when in C++ mode, this behavior is deprecated [-Werror,-Wdeprecated] In the gdb/ directory, we make clang happy by passing "-x c++". We could do this in gdbsupport too, but I think that renaming the files is a better long-term solution. gdbserver still does its own build of gdbsupport, so a few changes in its Makefile are necessary. gdbsupport/ChangeLog: * Makefile.am: Rename source files from .c to .cc. (CC, CFLAGS): Don't override. (AM_CFLAGS): Rename to ... (AM_CXXFLAGS): ... this. * Makefile.in: Re-generate. * %.c: Rename to %.cc. gdbserver/ChangeLog: * Makefile.in: Rename gdbsupport source files from .c to .cc.
2020-02-07Move gdbserver to top levelTom Tromey1-0/+719
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