summaryrefslogtreecommitdiff
path: root/gdb/configure.ac
AgeCommit message (Collapse)Author
2018-01-08Fix GDB build failure when $development is falseYao Qi
We don't build GDB selftests bits when $development is false. However, if we turn bfd/development.sh:$development to false, common/selftest.c is compiled which is not expected. It causes the build failure, selftest.o: In function `selftests::run_tests(char const*)': binutils-gdb/gdb/common/selftest.c:97: undefined reference to `selftests::reset()' collect2: error: ld returned 1 exit status I fix this issue by putting selftest.o selftest-arch.o into CONFIG_OBS only when $development is true. After this is fixed, there are other build failures in maint.c, this patch fixes them as well. In the release mode, the output of these commands are: (gdb) maintenance selftest Selftests are not available in a non-development build. (gdb) maintenance selftest foo Selftests are not available in a non-development build. (gdb) maintenance info selftests Selftests are not available in a non-development build. gdb: 2018-01-08 Yao Qi <yao.qi@linaro.org> Simon Marchi <simon.marchi@ericsson.com> * Makefile.in (COMMON_SFILES): Remove selftest-arch.c and common/selftest.c. (COMMON_OBS): Remove selftest.o. * configure.ac: Append selftest-arch.c and common/selftest.c to CONFIG_SRCS. Append selftest-arch.o and selftest.o to COMMON_OBS. * configure: Re-generated. * maint.c (maintenance_selftest): Wrap selftests::run_tests with GDB_SELF_TEST. (maintenance_info_selftests): Likewise. gdb/testsuite: 2018-01-08 Simon Marchi <simon.marchi@ericsson.com> * gdb.gdb/unittest.exp: Match output in non-development mode.
2018-01-02Update copyright year range in all GDB filesJoel Brobecker
gdb/ChangeLog: Update copyright year range in all GDB files
2017-11-30Remove ioctl-based procfs support on SolarisRainer Orth
This is the previously mentioned patch to get rid of unstructured/ioctl-based procfs support in procfs.c. Given that support for structured procfs was introduced in Solaris 2.6 back in 1997 and we're just removing support for Solaris < 10, there's no point in carrying that baggage (and tons of support for IRIX and OSF/1 as well) around any longer. Most of the patch should be straightforward (removing support for !NEW_PROC_API, non-Solaris OSes and pre-Solaris 10 quirks). Only a few points need explanations: * <sys/syscall.h> was already included unconditionally in most places, so there's no need to have guards in a few remaining ones. * configure.host already obsoletes i?86-*-sysv4.2, i?86-*-sysv5, so NEW_PROC_API detection for those in configure.ac can go. * I'm still including <sys/procfs.h> with #define _STRUCTURED_PROC 1. Theoretically, it would be better to include <procfs.h> on Solaris (which includes that define), but that breaks the build over <procfs.h> vs. gdb's "procfs.h", and doesn't exist on Linux. * I've regenerated syscall_table[] in proc-events.c with a small script from Solaris 10, 11.3, 11.4 <sys/syscall.h>, so there should be no traces of older Solaris versions and other OSes left. * prsysent_t and DYNAMIC_SYSCALLS was only used for AIX 5, but AIX doesn't use procfs.c any longer, so all related code can go. The patch was generated with diff -w so one can easier see changes without being distracted by simple reindentations. So far, it has only been compiled and smoke-tested on amd64-pc-solaris2.1[01], sparcv9-sun-solaris2.1[01], and x86_64-pc-linux-gnu. Certainly needs more testing (Solaris 11.3 vs. 11.4, 32-bit gdb, testsuite once I've figured out what's wrong on Solaris 10 etc.), but it's enough to get a first impression how much cleanup is possible here. * configure.ac Don't check for sys/fault.h, sys/syscall.h, sys/proc.h. (NEW_PROC_API): Remove. (prsysent_t, pr_sigset_t, pr_sigaction64_t, pr_siginfo64_t): Likewise. * common/common.m4 (GDB_AC_COMMON): Don't check for sys/syscall.h. * configure: Regenerate. * config.in: Regenerate. * gdbserver/configure: Regenerate. * gdbserver/config.in: Regenerate. * i386-sol2-nat.c (_initialize_amd64_sol2_nat): Remove NEW_PROC_API test. * sparc-sol2-nat.c (_initialize_sparc_sol2_nat): Likewise. * linux-btrace.c: Remove HAVE_SYS_SYSCALL_H test. * proc-api.c: Remove !NEW_PROC_API support. Remove HAVE_SYS_PROC_H and HAVE_SYS_USER_H tests. Remove tests for macros always defined on Solaris. * proc-events.c: Remove !NEW_PROC_API support. Remove Remove HAVE_SYS_SYSCALL_H, HAVE_SYS_PROC_H and HAVE_SYS_USER_H tests. (init_syscall_table): Remove non-Solaris syscalls. Remove tests for syscalls present on all Solaris versions. Add missing Solaris 10+ syscalls. (signal_table): Remove non-Solaris signals. Remove tests for signals present on all Solaris versions. (fault_table): Remove non-Solaris faults. Remove tests for faults present on all Solaris versions. * proc-flags.c: Remove !NEW_PROC_API support. (pr_flag_table): Remove non-Solaris and pre-Solaris 7 comments. Remove non-Solaris flags. * proc-why.c: Remove !NEW_PROC_API support. (pr_why_table): Remove meaningless comments. Remove tests for reasons present on all Solaris versions. Remove OSF/1 cases. (proc_prettyfprint_why): Likewise. * procfs.c: Remove !NEW_PROC_API and DYNAMIC_SYSCALLS support. Remove HAVE_SYS_FAULT_H and HAVE_SYS_SYSCALL_H tests. Remove WA_READ test, IRIX watchpoint support. (gdb_sigset_t, gdb_sigaction_t, gdb_siginfo_t): Replace by base types. Change users. (gdb_praddset, gdb_prdelset, gdb_premptysysset, gdb_praddsysset) (gdb_prdelset, gdb_pr_issyssetmember): Replace by base macros. Change callers. Remove CTL_PROC_NAME_FMT tests. (gdb_prstatus_t, gdb_lwpstatus_t): Replace by base types. Change users. (sysset_t_size): Remove. Use sizeof (sysset_t) in callers. Remove PROCFS_DONT_PIOCSSIG_CURSIG support. (proc_modify_flag): Replace GDBRESET by PCUNSET. Remove PR_ASYNC, PR_KLC tests. (proc_unset_inherit_on_fork): Remove PR_ASYNC test. (proc_parent_pid): Remove PCWATCH etc. tests. (proc_set_watchpoint): Remove !PCWATCH && !PIOCSWATCH support. Remove PCAGENT test. (proc_get_nthreads) [PIOCNTHR && PIOCTLIST]: Remove. Remove SYS_lwpcreate || SYS_lwp_create test. (proc_get_current_thread): Likewise. [PIOCNTHR && PIOCTLIST]: Remove. [PIOCLSTATUS]: Remove. (procfs_debug_inferior): Remove non-Solaris cases, conditionals. [PRFS_STOPEXEC]: Remove. (syscall_is_lwp_exit): Remove non-Solaris cases, conditionals. (syscall_is_exit): Likewise. (syscall_is_exec): Likewise. (syscall_is_lwp_create): Likewise. Remove SYS_syssgi support. (procfs_wait): Remove PR_ASYNC, !PIOCSSPCACT tests. [SYS_syssgi]: Remove. Remove non-Solaris cases, conditionals. (unconditionally_kill_inferior) [PROCFS_NEED_PIOCSSIG_FOR_KILL]: Remove. (procfs_init_inferior) [SYS_syssgi]: Remove. (procfs_set_exec_trap) [PRFS_STOPEXEC]: Remove. (procfs_inferior_created) [SYS_syssgi]: Remove. (procfs_set_watchpoint): Remove !AIX5 test. (procfs_stopped_by_watchpoint): Remove FLTWATCH test, FLTKWATCH case. (mappingflags) [MA_PHYS]: Remove. (info_mappings_callback): Remove PCAGENT test. Remove PIOCOPENLWP || PCAGENT test.
2017-11-27Move python object files to python subdirectoryTom Tromey
Move the object files corresponding to python/*.c to the python subdirectory in the build tree. Because special CFLAGS are passed just to Python compilations, this patch also required the addition of a pattern rule to update INTERNAL_CFLAGS for here. ChangeLog 2017-11-27 Tom Tromey <tom@tromey.com> * Makefile.in (SUBDIR_PYTHON_OBS): Redefine. (CONFIG_SRC_SUBDIR): Add python. (%.o): Remove python rule. (python/%.o): New rule. * configure: Rebuild. * configure.ac (CONFIG_OBS): Refer to python/python.o
2017-11-27Move guile object files to guile subdirectoryTom Tromey
Move the object files corresponding to guile/*.c to the guile subdirectory in the build tree. ChangeLog 2017-11-27 Tom Tromey <tom@tromey.com> * configure: Rebuild. * configure.ac (CONFIG_OBS): Refer to guile/guile.o. * Makefile.in (SUBDIR_GUILE_OBS): Redefine. (CONFIG_SRC_SUBDIR): Add guile. (%.o): Remove guile rule.
2017-11-27A simpler way to make the "arch" build directoryTom Tromey
This implements a simpler way to make the "arch" build directory -- namely, now it is done as an order-only dependency in the Makefile, rather than being created when config.status is run. This simpler because it means that the build directories can be changed without re-running autoconf. ChangeLog 2017-11-27 Tom Tromey <tom@tromey.com> * configure.ac (CONFIG_SRC_SUBDIR): Don't subst. * configure: Rebuild. * Makefile.in (CONFIG_SRC_SUBDIR): Redefine. (CONFIG_DEP_SUBDIR): New variable. (%.o): Add order-only dependency. ($(CONFIG_DEP_SUBDIR)): New target.
2017-11-22Target FP: Make use of MPFR if availableUlrich Weigand
This second patch introduces mfpr_float_ops, an new implementation of target_float_ops. This implements precise emulation of target floating-point formats using the MPFR library. This is then used to perform operations on types that do not match any host type. Note that use of MPFR is still not required. The patch adds a configure option --with-mpfr similar to --with-expat. If use of MPFR is disabled via the option or MPFR is not available, code will fall back to current behavior. This means that operations on types that do not match any host type will be implemented on the host long double type instead. A new test case verifies that we can correctly print the largest __float128 value now. gdb/ChangeLog: 2017-11-22 Ulrich Weigand <uweigand@de.ibm.com> * NEWS: Document use of GNU MPFR. * README: Likewise. * Makefile.in (LIBMPFR): Add define. (CLIBS): Add $(LIBMPFR). * configure.ac: Add --with-mpfr configure option. * configure: Regenerate. * config.in: Regenerate. * target-float.c [HAVE_LIBMPFR]: Include <mpfr.h>. (class mpfr_float_ops): New type. (mpfr_float_ops::from_target): Two new overloaded functions. (mpfr_float_ops::to_target): Likewise. (mpfr_float_ops::to_string): New function. (mpfr_float_ops::from_string): Likewise. (mpfr_float_ops::to_longest): Likewise. (mpfr_float_ops::from_longest): Likewise. (mpfr_float_ops::from_ulongest): Likewise. (mpfr_float_ops::to_host_double): Likewise. (mpfr_float_ops::from_host_double): Likewise. (mpfr_float_ops::convert): Likewise. (mpfr_float_ops::binop): Likewise. (mpfr_float_ops::compare): Likewise. (get_target_float_ops): Use mpfr_float_ops if available. gdb/doc/ChangeLog: 2017-11-22 Ulrich Weigand <uweigand@de.ibm.com> * gdb.texinfo (Requirements): Document use of GNU MPFR. gdb/testsuite/ChangeLog: 2017-11-22 Ulrich Weigand <uweigand@de.ibm.com> * gdb.base/float128.c (large128): New variable. * gdb.base/float128.exp: Add test to print largest __float128 value.
2017-11-06Assume termios is available, remove support for termio and sgttyPedro Alves
This commit garbage collects the termio and sgtty support. GDB's terminal handling code still has support for the old termio and sgtty interfaces in addition to termios. However, I think it's pretty safe to assume that for a long, long time, Unix-like systems provide termios. GNU/Linux, Solaris, Cygwin, AIX, DJGPP, macOS and the BSDs all have had termios.h for many years. Looking around the web, I found discussions about FreeBSD folks trying to get rid of old sgtty.h a decade ago: https://lists.freebsd.org/pipermail/freebsd-hackers/2007-March/019983.html So I think support for termio and sgtty in GDB is just dead code that is never compiled anywhere and is just getting in the way. For example, serial_noflush_set_tty_state and the raw<->cooked concerns mentioned in inflow.c only exist because of sgtty (see hardwire_noflush_set_tty_state). Regtested on GNU/Linux. Confirmed that I can still build Solaris, DJGPP and AIX GDB and that the resulting GDBs still include the termios.h-guarded code. Confirmed mingw-w64 GDB still builds and skips the termios.h-guarded code. gdb/ChangeLog: 2017-11-06 Pedro Alves <palves@redhat.com> * Makefile.in (SER_HARDWIRE): Update comment. (HFILES_NO_SRCDIR): Remove gdb_termios.h. * common/gdb_termios.h: Delete file. * common/job-control.c: Include termios.h and unistd.h instead of gdb_termios.h. (gdb_setpgid): Remove HAVE_TERMIOS || TIOCGPGRP preprocessor check. (have_job_control): Check HAVE_TERMIOS_H instead of HAVE_TERMIOS. Remove sgtty code. * configure.ac: No longer check for termio.h and sgtty.h. * configure: Regenerate. * inflow.c: Include termios.h instead of gdb_termios.h. Replace PROCESS_GROUP_TYPE checks with HAVE_TERMIOS_H checks throughout. Replace PROCESS_GROUP_TYPE references with pid_t references throughout. (gdb_getpgrp): Delete. (set_initial_gdb_ttystate): Use tcgetpgrp instead of gdb_getpgrp. (child_terminal_inferior): Remove comment. Remove sgtty code. (child_terminal_ours_1): Use tcgetpgrp directly instead of gdb_getpgrp. Use serial_set_tty_state instead aof serial_noflush_set_tty_state. Remove sgtty code. * inflow.h: Include unistd.h instead of gdb_termios.h. Replace PROCESS_GROUP_TYPE check with HAVE_TERMIOS_H check. (inferior_process_group): Now returns pid_t. * ser-base.c (ser_base_noflush_set_tty_state): Delete. * ser-base.h (ser_base_noflush_set_tty_state): Delete. * ser-event.c (serial_event_ops): Update. * ser-go32.c (dos_noflush_set_tty_state): Delete. (dos_ops): Update. * ser-mingw.c (hardwire_ops, tty_ops, pipe_ops, tcp_ops): Update. * ser-pipe.c (pipe_ops): Update. * ser-tcp.c (tcp_ops): Update. * ser-unix.c: Include termios.h instead of gdb_termios.h. Remove HAVE_TERMIOS checks. [HAVE_TERMIO] (struct hardwire_ttystate): Delete. [HAVE_SGTTY] (struct hardwire_ttystate): Delete. (get_tty_state, set_tty_state): Drop termio and sgtty code, and assume termios. (hardwire_noflush_set_tty_state): Delete. (hardwire_print_tty_state, hardwire_drain_output) (hardwire_flush_output, hardwire_flush_input) (hardwire_send_break, hardwire_raw, hardwire_setbaudrate) (hardwire_setstopbits, hardwire_setparity): Drop termio and sgtty code, and assume termios. (hardwire_ops): Update. (_initialize_ser_hardwire): Remove HAVE_TERMIOS check. * serial.c (serial_noflush_set_tty_state): Delete. * serial.h (serial_noflush_set_tty_state): Delete. (serial_ops::noflush_set_tty_state): Delete. gdb/gdbserver/ChangeLog: 2017-11-06 Pedro Alves <palves@redhat.com> * configure.ac: No longer check for termio.h and sgtty.h. * configure: Regenerate. * remote-utils.c: Include termios.h instead of gdb_termios.h. (remote_open): Check HAVE_TERMIOS_H instead of HAVE_TERMIOS. Remove termio and sgtty code.
2017-10-09Don't try building gdb against guile-2.2Simon Marchi
GDB currently doesn't build with Guile 2.2 (see PR 21104). If one has both Guile 2.2 and 2.0 installed, GDB will pick up Guile 2.2 first and fail building. Until somebody does the work of adapting the GDB code to Guile 2.2, we should not try using it. This patch therefore removes it from configure. gdb/ChangeLog: * configure.ac (try_guile_versions): Remove guile-2.2. * configure: Regenerate.
2017-10-06[RFC] Replicate src dir in build dirYao Qi
Nowadays, GDB build tree is almost flat, but source tree isn't. We have arch/ nat/ target/ common/ cli/ mi/ tui/ python/ guile/ directories. We need to some rules in Makefile for source files in different source directories, like, # Rules for compiling .c files in the various source subdirectories. %.o: ${srcdir}/arch/%.c $(COMPILE) $< $(POSTCOMPILE) %.o: ${srcdir}/nat/%.c $(COMPILE) $< $(POSTCOMPILE) so we should take care of some special case that files' base name is the same, like, # Specify an explicit rule for gdb/common/agent.c, to avoid a clash with the # object file generate by gdb/agent.c. common-agent.o: $(srcdir)/common/agent.c $(COMPILE) $(srcdir)/common/agent.c $(POSTCOMPILE) As we add more and more files in different directories, it becomes tricky to name files, because we need take this into account. This patch takes the first step toward "Replicate src dir in build dir", that is, we create arch/ directory in buildtree, and put amd64.o there as an example. Dependency tracking is updated for files with directory name. Currently, when we build amd64.o, "-c -o amd64.o -MT amd64.o -MMD -MP -MF .deps/amd64.Tpo" with this patch applied, it becomes, "-c -o arch/amd64.o -MT arch/amd64.o -MMD -MP -MF arch/.deps/amd64.o.Tpo" "make clean" removes the object files, and "make distclean" removes .deps additionally. configure file create .deps directory in each of CONFIG_SRC_SUBDIR, and pass it to Makefile.in, so that "make clean" and "make distclean" can remove stuffs there. If people agree with this change, I'll add more directories to CONFIG_SRC_SUBDIR. gdb: 2017-10-06 Yao Qi <yao.qi@linaro.org> * Makefile.in (CONFIG_SRC_SUBDIR): New. (ALL_64_TARGET_OBS): Replace amd64.o with arch/amd64.o. (clean): Remove object files and dependency files. (distclean): Remove the directory. * configure.ac: Invoke AC_CONFIG_COMMANDS. * configure: Re-generated. * configure.tgt: Replace amd64.o with arch/amd64.o.
2017-09-26Allow linking GDB with ncurseswMatthias Klose
Triggered by https://launchpad.net/bugs/1275210, to be able to cope with UTF-8 characters in gdbtui. Reference: https://sourceware.org/ml/gdb-patches/2017-09/msg00356.html gdb/ChangeLog: 2017-09-26 Matthias Klose <doko@ubuntu.com> * configure.ac: Search ncursesw before ncurses. Check ncursesw/ncurses.h before ncurses/ncurses.h. * gdb_curses.h: Include <ncursesw/ncurses.h> * config.in, configure: Regenerate.
2017-09-26Remove support for Solaris < 10 (PR gdb/22185)Rainer Orth
Given that GCC has obsoleted/removed support for Solaris 9 in GCC 4.9/5 in 2013: https://gcc.gnu.org/gcc-4.9/changes.html https://gcc.gnu.org/ml/gcc-patches/2013-05/msg00728.html and the last gdb version that can be compiled with gcc 4.9 is 7.12.1 only when configured with --disable-build-with-cxx, it's time to obsolete/remove support for Solaris < 10. This patch does this, simplifying configure.nat along the way (only a single sol2 configuration with variants for i386 and sparc). Some configure checks for older Solaris versions can go, too, and the check for libthread_db.so.1 removed: * Since Solaris 10, dlopen has moved to libc and libdl.so is just a filter on ld.so.1, so no need to check. * $RDYNAMIC is already handled above (and is a no-op with Solaris ld anyway). Both proc-service.c and sol-thread.c lose support for (Solaris-only) PROC_SERVICE_IS_OLD. The attached revised patch has been tested on sparcv9-sun-solaris2.10, sparcv9-sun-solaris2.11.4, amd64-pc-solaris2.10, amd64-pc-solaris2.11.4, and x86_64-pc-linux-gnu. I've also started an i386-pc-solaris2.9 build to check that it really stops as expected. PR gdb/22185 * configure.host <*-*-solaris2.[01], *-*-solaris2.[2-9]*>: Mark as obsolete. Use gdb_host sol2 for i[34567]86-*-solaris2*, x86_64-*-solaris2*. Remove i386sol2 support. * configure.nat <i386sol2>: Remove. <sol2-64>: Fold into ... <sol2>: ... this. Move common settings to default section. Add sol-thread.o. * configure.tgt <i[34567]86-*-solaris2.1[0-9]*, x86_64-*-solaris2.1[0-9]*>: Rename to ... <i[34567]86-*-solaris2*, x86_64-*-solaris2*>: ... this. <i[34567]86-*-solaris*>: Remove. <sparc-*-solaris2.[0-6], sparc-*-solaris2.[0-6].*>: Remove. * configure.ac: Remove wctype in libw check. (_MSE_INT_H): Don't define on Solaris 7-9. <solaris*>: Remove libthread_db.so.1 check. * configure: Regenerate. * config.in: Regenerate. * proc-service.c: Remove PROC_SERVICE_IS_OLD handling. (gdb_ps_prochandle_t, gdb_ps_read_buf_t, gdb_ps_write_buf_t) (gdb_ps_size_t): Remove. Use base types in users. * sol-thread.c: Likewise, also for gdb_ps_addr_t. * NEWS (Changes since GDB 8.0): Document Solaris 2.0-9 removal.
2017-09-04Define _KMEMUSER before including BSD kernel headers.John Baldwin
Recent versions of NetBSD hide certain kernel structures needed by the KVM target from userland unless this macro is defined. gdb/ChangeLog: * bsd-kvm.o: Define _KMEMUSER. * configure.ac: Define _KMEMUSER when checking for "struct lwp". * configure: Regenerate.
2017-05-31config, btrace: check for pt_insn_event in libiptMarkus Metzger
Version 2 of libipt adds an event system to instruction flow decoders and deprecates indicating events via flags in struct pt_insn. Add configuration checks to determine which version we have. gdb/ * configure.ac: Check for pt_insn_event, struct pt_insn.enabled, and struct pt_insn.resynced. * configure: Regenerated. * config.in: Regenerated.
2017-05-17nat_extra_makefile_frag -> nat_makefile_fragPedro Alves
gdb/ChangeLog: 2017-05-17 Pedro Alves <palves@redhat.com> * Makefile.in (nat_extra_makefile_frag): Rename to ... (nat_makefile_frag): ... this. All references updated. * configure.ac: Likewise. * configure.nat: Likewise. Enhance comments. * configure: Regenerate.
2017-05-06Introduce "gdb/configure.nat" (and delete "gdb/config/*/*.mh" files)Sergio Durigan Junior
Due to my ongoing work to make it possible for gdbserver to start the inferior using the shell, I had to share the fork_inferior function under the "nat/" directory. In order to do that, I created a new file and put the function there; however, this meant that I now had to update some of the *.mh files (under "gdb/config") and add the new file as a dependency to be built natively. Bleh... After talking a bit to Pedro about this, the idea came up to write a new "gdb/configure.nat" file, a la "gdb/configure.tgt", which would concentrate all of the native settings for each host/system. I decided to tackle this issue. The patch is simple. All of the previous Makefile variables that were being declared inside the *.mh files are now inside "gdb/Makefile.in", and "gdb/configure" is responsible for AC_SUBST'ing them. The definitions of these variables were put inside "gdb/configure.nat", so now they're shell variables. For excerpts of Makefile code, one must create a file under "gdb/config/${gdb_cpu_host}" and reference it on the "nat_extra_makefile_frag" variable. It should now be easier to update the native dependencies of hosts in this single file. This has been tested on x86_64 without regressions. gdb/ChangeLog: 2017-05-06 Sergio Durigan Junior <sergiodj@redhat.com> * Makefile.in: Remove "@host_makefile_frag@". Add variables NAT_FILE, NATDEPFILES, NAT_CDEPS, LOADLIBES, MH_CFLAGS, XM_CLIBS, NAT_GENERATED_FILES, HAVE_NATIVE_GCORE_HOST. Add "@nat_extra_makefile_frag@". (Makefile): Remove dependency on "@frags@". ($(GNULIB_BUILDDIR)/Makefile): Likewise. (data-directory/Makefile): Likewise. * config/aarch64/linux.mh: Deleted; moved contents to "gdb/configure.nat". * config/alpha/alpha-linux.mh: Likewise. * config/alpha/nbsd.mh: Likewise. * config/arm/linux.mh: Likewise. * config/arm/nbsdelf.mh: Likewise. * config/i386/cygwin.mh: Likewise. * config/i386/cygwin64.mh: Likewise. * config/i386/darwin.mh: Likewise. * config/i386/fbsd.mh: Likewise. * config/i386/fbsd64.mh: Likewise. * config/i386/go32.mh: Likewise. * config/i386/i386gnu.mh: Likewise. * config/i386/i386sol2.mh: Likewise. * config/i386/linux.mh: Likewise. * config/i386/linux64.mh: Likewise. * config/i386/mingw.mh: Likewise. * config/i386/mingw64.mh: Likewise. * config/i386/nbsd64.mh: Likewise. * config/i386/nbsdelf.mh: Likewise. * config/i386/nto.mh: Likewise. * config/i386/obsd.mh: Likewise. * config/i386/obsd64.mh: Likewise. * config/i386/sol2-64.mh: Likewise. * config/ia64/linux.mh: Likewise. * config/m32r/linux.mh: Likewise. * config/m68k/linux.mh: Likewise. * config/m68k/nbsdelf.mh: Likewise. * config/m68k/obsd.mh: Likewise. * config/m88k/obsd.mh: Likewise. * config/mips/fbsd.mh: Likewise. * config/mips/linux.mh: Likewise. * config/mips/nbsd.mh: Likewise. * config/mips/obsd64.mh: Likewise. * config/pa/linux.mh: Likewise. * config/pa/nbsd.mh: Likewise. * config/pa/obsd.mh: Likewise. * config/powerpc/aix.mh: Likewise. * config/powerpc/fbsd.mh: Likewise. * config/powerpc/linux.mh: Likewise. * config/powerpc/nbsd.mh: Likewise. * config/powerpc/obsd.mh: Likewise. * config/powerpc/ppc64-linux.mh: Likewise. * config/powerpc/spu-linux.mh: Likewise. * config/s390/linux.mh: Likewise. * config/sh/nbsd.mh: Likewise. * config/sparc/fbsd.mh: Likewise. * config/sparc/linux.mh: Likewise. * config/sparc/linux64.mh: Likewise. * config/sparc/nbsd64.mh: Likewise. * config/sparc/nbsdelf.mh: Likewise. * config/sparc/obsd64.mh: Likewise. * config/sparc/sol2.mh: Likewise. * config/tilegx/linux.mh: Likewise. * config/vax/nbsdelf.mh: Likewise. * config/vax/obsd.mh: Likewise. * config/xtensa/linux.mh: Likewise. * config/i386/i386gnu.mn: New file, with excerpts from "config/i386/i386gnu.mh". * configure: Regenerate. * configure.ac: Rewrite code to use "gdb/configure.nat" instead of *.mh files under "gdb/config". * configure.nat: New file, with contents from the "gdb/config/*/*.mh" files. gdb/doc/ChangeLog: 2017-05-06 Sergio Durigan Junior <sergiodj@redhat.com> * Makefile: Remove "@host_makefile_frag@".
2017-02-23Introduce gdb::function_viewPedro Alves
This commit adds a new function_view type. This type holds a non-owning reference to a callable. It is meant to be used as callback type of functions, instead of using the C-style pair of function pointer and 'void *data' arguments. function_view allows passing references to stateful function objects / lambdas with captures as callbacks efficiently, while function pointer + 'void *' does not. See the intro in the new function-view.h header for more. Unit tests included, put into a new gdb/unittests/ subdir. gdb/ChangeLog: 2017-02-23 Pedro Alves <palves@redhat.com> * Makefile.in (SUBDIR_UNITTESTS_SRCS, SUBDIR_UNITTESTS_OBS): New. (%.o) <unittests/%.c>: New pattern. * configure.ac ($development): Add $(SUBDIR_UNITTESTS_OBS) to CONFIG_OBS, and $(SUBDIR_UNITTESTS_SRCS) to CONFIG_SRCS. * common/function-view.h: New file. * unittests/function-view-selftests.c: New file. * configure: Regenerate.
2017-01-01update copyright year range in GDB filesJoel Brobecker
This applies the second part of GDB's End of Year Procedure, which updates the copyright year range in all of GDB's files. gdb/ChangeLog: Update copyright year range in all GDB files.
2016-11-22Fix spelling mistakes in comments in configure scriptsAmbrogino Modigliani
All changes are limited to comments, and no run-time behavior is affected. bfd/ChangeLog: 2016-11-22 Ambrogino Modigliani <ambrogino.modigliani@gmail.com> * warning.m4: Fix spelling in comments. * configure.ac: Fix spelling in comments. * configure: Regenerate. binutils/ChangeLog: 2016-11-22 Ambrogino Modigliani <ambrogino.modigliani@gmail.com> * configure: Regenerate. gdb/ChangeLog: 2016-11-22 Ambrogino Modigliani <ambrogino.modigliani@gmail.com> * configure.ac: Fix spelling in comments. * configure: Regenerate. gas/ChangeLog: 2016-11-22 Ambrogino Modigliani <ambrogino.modigliani@gmail.com> * configure: Regenerate. gold/ChangeLog: 2016-11-22 Ambrogino Modigliani <ambrogino.modigliani@gmail.com> * configure: Regenerate. gprof/ChangeLog: 2016-11-22 Ambrogino Modigliani <ambrogino.modigliani@gmail.com> * configure: Regenerate. ld/ChangeLog: 2016-11-22 Ambrogino Modigliani <ambrogino.modigliani@gmail.com> * configure: Regenerate. opcodes/ChangeLog: 2016-11-22 Ambrogino Modigliani <ambrogino.modigliani@gmail.com> * configure: Regenerate.
2016-11-17Remove code that checks for GNU/non-GNU makeSimon Marchi
Since GNU make is now required to build GDB, we can remove everything that checks whether the current make implemention is the GNU one or not. I simply removed the @GMAKE_TRUE@ prefixes and removed the whole lines that were prefixed with @GMAKE_FALSE@. I removed the code in the configure scripts that set those variables. I also removed the following bits from the configure scripts: AC_CHECK_PROGS(MAKE, make): GNU make already defines a MAKE variable internally to be used when invoking Makefiles recursively. I don't see this variable being used anywhere else (in scripts for example), so I think it's safe for removal. AC_PROG_MAKE_SET: This macro defines a SET_MAKE output variable, which is meant to be used in Makefiles to define the MAKE variable when using an implementation of make that doesn't already define it. Since we are now requiring GNU make, we don't need it anymore. Plus, I don't see SET_MAKE being used anywhere, so I don't think it was actually doing anything... gdb/ChangeLog: * Makefile.in: Remove @GMAKE_TRUE@ prefixes and removes lines prefixed with @GMAKE_FALSE@. Update comment related to non-GNU make. * configure.ac: Remove checks for the make program. * configure: Re-generate. gdb/gdbserver/ChangeLog: * Makefile.in: Remove @GMAKE_TRUE@ prefixes and removes lines prefixed with @GMAKE_FALSE@. Update comment related to non-GNU make. * configure.ac: Remove checks for the make program. * configure: Re-generate. gdb/testsuite/ChangeLog: * Makefile.in: Remove @GMAKE_TRUE@ prefixes and removes lines prefixed with @GMAKE_FALSE@. Update comment related to non-GNU make. * configure.ac: Remove checks for the make program. * configure: Re-generate.
2016-10-31Remove IRIX 5 <sys/proc.h> _KMEMUSER workaroundMaciej W. Rozycki
Complement commit 3831839c089c ("Delete IRIX support") and remove the IRIX 5 <sys/proc.h> _KMEMUSER workaround from the `configure' script, as IRIX is no longer a supported host configuration. gdb/ * configure.ac <mips-sgi-irix5*>: Remove <sys/proc.h> _KMEMUSER workaround. * configure: Regenerate. * config.in: Regenerate.
2016-10-28gdb: Require C++11Pedro Alves
Use AX_CXX_COMPILE_STDCXX to detect if the compiler supports C++11, and if -std=xxx switches are necessary to enable C++11. We need to tweak AX_CXX_COMPILE_STDCXX a bit though. Pristine upstream AX_CXX_COMPILE_STDCXX appends -std=gnu++11 to CXX directly. That doesn't work for us, because the top level Makefile passes CXX down to subdirs, and that overrides whatever gdb/Makefile may set CXX to. The result would be that a make invocation from the build/gdb/ directory would use "g++ -std=gnu++11" as expected, while a make invocation at the top level would not. So instead of having AX_CXX_COMPILE_STDCXX set CXX directly, tweak it to AC_SUBST a separate variable -- CXX_DIALECT -- and use '$(CXX) (CXX_DIALECT)' to compile/link. Confirmed that this enables C++11 starting with gcc 4.8, the first gcc release with full C++11 support. Also confirmed that configure errors out gracefully with older GCC releases: checking whether /opt/gcc-4.7/bin/g++ supports C++11 features by default... no checking whether /opt/gcc-4.7/bin/g++ supports C++11 features with -std=gnu++11... no checking whether /opt/gcc-4.7/bin/g++ supports C++11 features with -std=gnu++0x... no checking whether /opt/gcc-4.7/bin/g++ supports C++11 features with -std=c++11... no checking whether /opt/gcc-4.7/bin/g++ supports C++11 features with -std=c++0x... no checking whether /opt/gcc-4.7/bin/g++ supports C++11 features with +std=c++11... no checking whether /opt/gcc-4.7/bin/g++ supports C++11 features with -h std=c++11... no configure: error: *** A compiler with support for C++11 language features is required. Makefile:9451: recipe for target 'configure-gdb' failed make[1]: *** [configure-gdb] Error 1 make[1]: Leaving directory '/home/pedro/brno/pedro/gdb/mygit/cxx-convertion/build-gcc-4.7' If we need to revert back to making C++11 optional, all that's necessary is to change the "mandatory" to "optional" in configure.ac and regenerate configure (both gdb and gdbserver). gdb/ChangeLog: 2016-10-28 Pedro Alves <palves@redhat.com> * Makefile.in (CXX_DIALECT): Get from configure. (COMPILE.pre, CC_LD): Append $(CXX_DIALECT). (FLAGS_TO_PASS): Pass CXX_DIALECT. * acinclude.m4: Include ax_cxx_compile_stdcxx.m4. * ax_cxx_compile_stdcxx.m4: Add FSF copyright header. Set and AC_SUBST CXX_DIALECT instead of changing CXX/CXXCPP. * configure.ac: Call AX_CXX_COMPILE_STDCXX. * config.in: Regenerate. * configure: Regenerate. gdb/gdbserver/ChangeLog: 2016-10-28 Pedro Alves <palves@redhat.com> * Makefile.in (CXX_DIALECT): Get from configure. (COMPILE.pre, CC_LD): Append $(CXX_DIALECT). * acinclude.m4: Include ../ax_cxx_compile_stdcxx.m4. * configure.ac: Call AX_CXX_COMPILE_STDCXX. * config.in: Regenerate. * configure: Regenerate.
2016-09-05gdb/: Require a C++ compilerPedro Alves
This removes all support for building gdb & gdbserver with a C compiler from gdb & gdbserver's build machinery. gdb/ChangeLog: 2016-09-05 Pedro Alves <palves@redhat.com> * NEWS: Mention that a C++ compiler is now required. * Makefile.in (COMPILER, COMPILER_CFLAGS): Remove. (COMPILE.pre, CC_LD): Use CXX directly. (INTERNAL_CFLAGS_BASE): Use CXXFLAGS directly. * acinclude.m4: Don't include build-with-cxx.m4. * build-with-cxx.m4: Delete file. * configure.ac: Remove GDB_AC_BUILD_WITH_CXX call. * warning.m4: Assume $enable_build_with_cxx is yes. * configure: Regenerate. gdb/gdbserver/ChangeLog: 2016-09-05 Pedro Alves <palves@redhat.com> * Makefile.in (COMPILER, COMPILER_CFLAGS): Remove. (COMPILE.pre, CC_LD): Use CXX directly. (INTERNAL_CFLAGS_BASE): Use CXXFLAGS directly. * acinclude.m4: Don't include build-with-cxx.m4. * configure.ac: Remove GDB_AC_BUILD_WITH_CXX call. * configure: Regenerate.
2016-07-23Implement catch syscall groupGabriel Krisman Bertazi
Implement support to add catchpoints for a group of related syscalls using the syntax: (gdb) catch syscall group:<group> or (gdb) catch syscall g:<group> Several groups are predefined in the xml files for all architectures supported by GDB over Linux. They are based on the groups defined by strace. gdb/ * xml-syscall.c (get_syscalls_by_group): New. (get_syscall_group_names): New. (struct syscall_group_desc): New structure to store group data. (struct syscalls_info): Include field to store the group list. (sysinfo_free_syscall_group_desc): New. (free_syscalls_info): Free group list. (syscall_group_create_syscall_group_desc): New. (syscall_group_add_syscall): New. (syscall_create_syscall_desc): Add syscall to its groups. (syscall_start_syscall): Load group attribute. (syscall_group_get_group_by_name): New. (xml_list_syscalls_by_group): New. (xml_list_of_groups): New. * xml-syscall.h (get_syscalls_by_group): Export function to retrieve a list of syscalls filtered by the group name. (get_syscall_group_names): Export function to retrieve the list of syscall groups. * break-catch-syscall.c (catch_syscall_split_args): Verify if argument is a syscall group and expand it to a list of syscalls when creating catchpoints. (catch_syscall_completer): Add word completion for system call groups. * configure.ac: Include dependency for xsltproc when building in maintainer-mode. * break-catch-syscall.c (_initialize_breakpoint): Update catch syscall command documentation. * NEWS: Include section about catching groups of syscalls. * configure: Regenerate. * data-directory/Makefile.in: Generate syscall xml when building in maintainer mode. * syscalls/gdb-syscalls.dtd: Include group attribute to the syscall element. * syscalls/apply-defaults.xsl: New. * syscalls/linux-defaults.xml.in: New. * syscalls/aarch64-linux.xml: Rename to aarch64-linux.xml.in. * syscalls/amd64-linux.xml: Rename to amd64-linux.xml.in. * syscalls/arm-linux.xml: Rename to arm-linux.xml.in. * syscalls/bfin-linux.xml: Rename to bfin-linux.xml.in. * syscalls/i386-linux.xml: Rename to i386-linux.xml.in. * syscalls/mips-n32-linux.xml: Rename to mips-n32-linux.xml.in. * syscalls/mips-n64-linux.xml: Rename to mips-n64-linux.xml.in. * syscalls/mips-o32-linux.xml: Rename to mips-o32-linux.xml.in. * syscalls/ppc-linux.xml: Rename to ppc-linux.xml.in. * syscalls/ppc64-linux.xml: Rename to ppc64-linux.xml.in. * syscalls/s390-linux.xml: Rename to s390-linux.xml.in. * syscalls/s390x-linux.xml: Rename to s390x-linux.xml.in. * syscalls/sparc-linux.xml: Rename to sparc-linux.xml.in. * syscalls/sparc64-linux.xml: Rename to sparc64-linux.xml.in. * syscalls/aarch64-linux.xml: Regenerate. * syscalls/amd64-linux.xml: Regenerate. * syscalls/arm-linux.xml: Regenerate. * syscalls/i386-linux.xml: Regenerate. * syscalls/mips-n32-linux.xml: Regenerate. * syscalls/mips-n64-linux.xml: Regenerate. * syscalls/mips-o32-linux.xml: Regenerate. * syscalls/ppc-linux.xml: Regenerate. * syscalls/ppc64-linux.xml: Regenerate. * syscalls/s390-linux.xml: Regenerate. * syscalls/s390x-linux.xml: Regenerate. * syscalls/sparc-linux.xml: Regenerate. * syscalls/sparc64-linux.xml: Regenerate. gdb/testsuite/ * gdb.base/catch-syscall.exp (do_syscall_tests): Add call to test_catch_syscall_group. (test_catch_syscall_group): New. gdb/doc/ * gdb.texinfo (Set Catchpoints): Add 'group' argument to catch syscall.
2016-07-05babeltrace compilation regressionJan Kratochvil
Since: commit 2d681be471cf8aff8f296cb7713c39e9aa4fc2bb Author: Andreas Arnez <arnez@linux.vnet.ibm.com> Date: Wed Apr 27 15:52:16 2016 +0200 Avoid non-C++-enabled babeltrace versions tested with: libbabeltrace-devel-1.2.4-4.fc24.x86_64 libbabeltrace-devel-1.4.0-2.fc25.x86_64 it can no longer build due to: configure:16435: gcc -o conftest -m64 -g3 -pipe -Wall -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -fno-diagno stics-show-caret -Werror -static-libstdc++ -static-libgcc conftest.c -ldl -ldl -lncurses -lm -ldl -lbabeltrace -lbabeltrace-ctf >&5 conftest.c: In function 'main': conftest.c:208:7: error: 'pos' is a pointer; did you mean to use '->'? gdb/ChangeLog 2016-07-05 Jan Kratochvil <jan.kratochvil@redhat.com> * configure: Regenerate. * configure.ac (HAVE_LIBBABELTRACE): Fix pos variable dereference.
2016-06-24Add support for catching system calls to native FreeBSD targets.John Baldwin
All platforms on FreeBSD use a shared system call table, so use a single XML file to describe the system calls available on each FreeBSD platform. Recent versions of FreeBSD include the identifier of the current system call when reporting a system call entry or exit event in the ptrace_lwpinfo structure obtained via PT_LWPINFO in fbsd_wait. As such, FreeBSD native targets do not use the gdbarch method to fetch the system call code. In addition, FreeBSD register sets fetched via ptrace do not include an equivalent of 'orig_rax' (on amd64 for example), so the system call code cannot be extracted from the available registers during a system call exit. However, GDB assumes that system call catch points are not supported if the gdbarch method is not present. As a workaround, FreeBSD ABIs install a dummy gdbarch method that throws an internal_error if it is ever invoked. gdb/ChangeLog: * configure.ac: Check for support for system call LWP fields on FreeBSD. * config.in, configure: Rebuild. * data-directory/Makefile.in (SYSCALLS_FILES): Add freebsd.xml. * fbsd-nat.c (fbsd_wait) [HAVE_STRUCT_PTRACE_LWPINFO_PL_SYSCALL_CODE]: Report system call events. [HAVE_STRUCT_PTRACE_LWPINFO_PL_SYSCALL_CODE] (fbsd_set_syscall_catchpoint): New function. (fbsd_nat_add_target) [HAVE_STRUCT_PTRACE_LWPINFO_PL_SYSCALL_CODE]: Set "to_set_syscall_catchpoint" to "fbsd_set_syscall_catchpoint". * fbsd-tdep.c: Include xml-syscall.h (fbsd_get_syscall_number): New function. (fbsd_init_abi): Set XML system call file name. Add "get_syscall_number" gdbarch method. * syscalls/freebsd.xml: New file.
2016-05-23Search for libutil-freebsd as alternative to libutilJon Boden
GDB needs kinfo_getvmmap() on GNU/kFreeBSD systems same as on pure FreeBSD. However on these systems the FreeBSD version of libutil is renamed to libutil-freebsd. 2016-05-23 Jon Boden <jon@ubuntubsd.org> * configure.ac: Search for libutil-freebsd as alternative to libutil. * configure: Re-generated.
2016-05-17Add self-test framework to gdbTom Tromey
I wanted to unit test the Rust lexer, so I added a simple unit testing command to gdb. The intent is that self tests will only be compiled into gdb in development mode. In release mode they simply won't exist. So, this exposes $development to C code as GDB_SELF_TEST. In development mode, test functions are registered with the self test module. A test function is just a function that does some checks, and throws an exception on failure. Then this adds a new "maint selftest" command which invokes the test functions, and a new dejagnu test case that invokes it. 2016-05-17 Tom Tromey <tom@tromey.com> * NEWS: Add "maint selftest" entry. * selftest.h: New file. * selftest.c: New file. * maint.c: Include selftest.h. (maintenance_selftest): New function. (_initialize_maint_cmds): Add "maint selftest" command. * configure.ac (GDB_SELF_TEST): Maybe define. * config.in, configure: Rebuild. * Makefile.in (SFILES): Add selftest.c. (COMMON_OBS): Add selftest.o. 2016-05-17 Tom Tromey <tom@tromey.com> * gdb.texinfo (Maintenance Commands): Document "maint selftest". 2016-05-17 Tom Tromey <tom@tromey.com> * gdb.gdb/unittest.exp: New file.
2016-05-03Fix PR gdb/16818, workaround Python's forcing of -export-dynamicPedro Alves
GDB's use of --dynamic-list to only export the proc-service symbols is broken due to Python's "python-config --ldflags" saying we should link with -export-dynamic, causing us to export _all_ extern symbols anyway. On Fedora 23: $ python-config --ldflags -lpython2.7 -lpthread -ldl -lutil -lm -Xlinker -export-dynamic $ python3.4-config --ldflags -L/usr/lib64 -lpython3.4m -lpthread -ldl -lutil -lm -Xlinker -export-dynamic Having GDB export all its symbols leads to issues such as PR gdb/16818 (GDB crashes when using name for target remote hostname:port), where a GDB symbol unintentionally preempts a symbol in one of the NSS modules glibc loads into the process. NSS modules should not define symbols outside the implementation namespace or the relevant standards, but, alas, that's a longstanding and hard to fix issue. See libc-alpha discussion at: [symbol name space issues with NSS modules] https://sourceware.org/ml/libc-alpha/2016-04/msg00130.html Python should instead be either using GCC's symbol visibility feature or -Wl,--dynamic-list as well, to only export Python API symbols, but, it doesn't. There are bugs open upstream for that: [Use -Wl,--dynamic-list=x.list, not -Xlinker -export-dynamic] http://bugs.python.org/issue10112 [Use GCC visibility attrs in PyAPI_*] http://bugs.python.org/issue11410 But that's taking a long while to resolve. I thought of working around this Python issue by making GDB build with -fvisibility=hidden, as Jan suggests in Python issue 10112, as then Python's "-Xlinker -export-dynamic" has no effect. However, that would need to be done in the whole source tree (bfd, libiberty, etc.), and I think that would break GCC plugins, as I believe those have access to all of GCCs symbols, by "design". So we'd need a new configure switch, or have the libraries in the tree detect which of GCC or GDB is being built, but that doesn't work, because the answer can be "both" with combined builds... So this patch instead works around Python's bug, by simply sed'ing away "-Xlinker -export-dynamic" from the result of python-config.py --ldflags, making -Wl,--dynamic-list work again as it used to. It's ugly, but so is the bug... Note that if -Wl,--dynamic-list doesn't work, we always link with -rdynamic, so static Python should still work. Tested on F23 with --python=python (Python 2.7) and --python=python3.4. gdb/ChangeLog:y 2016-05-03 Pedro Alves <palves@redhat.com> * configure.ac (PYTHON_LIBS): Sed away "-Xlinker -export-dynamic". * configure: Regenerate.
2016-05-03Fix "-Wl,--dynamic-list" gdb/configure testPedro Alves
The -Wl,--dynamic-list test is currently broken on Fedora 23, when you configure with --with-python=python3.4. We see: configure:13741: checking for the dynamic export flag configure:13796: gcc -o conftest -g3 -O0 -fno-strict-aliasing -DNDEBUG -fwrapv -Wl,--dynamic-list=/home/pedro/gdb/mygit/src/gdb/proc-service.list conftest.c -ldl -lncurses -lm -ldl -lpthread -ldl -lutil -lm -lpython3.4m -Xlinker -export-dynamic >&5 conftest.c:182:30: fatal error: python3.4/Python.h: No such file or directory compilation terminated. configure:13796: $? = 1 The correct -I path is in PYTHON_CPPFLAGS: PYTHON_CPPFLAGS='-I/usr/include/python3.4m -I/usr/include/python3.4m' (Other Python-related tests in the file are already doing this.) gdb/ChangeLog: 2016-05-03 Pedro Alves <palves@redhat.com> * configure.ac (checking for the dynamic export flag): Add $PYTHON_CPPFLAGS to CPPFLAGS. * configure: Regenerate.
2016-04-27Avoid non-C++-enabled babeltrace versionsAndreas Arnez
In some babeltrace versions before 1.2.0, the header file iterator.h declares the enum values `BT_SEEK_*' within the struct declaration of bt_iter_pos. The enum values are supposed to be globally-scoped, which works for C, but not for C++. Later babeltrace versions declare the enum outside the struct: https://lists.lttng.org/pipermail/lttng-dev/2013-September/021411.html Now that GDB is compiled with C++, the GDB build fails on a system with an affected babeltrace version: the compiler complains about a missing declaration of BT_SEEK_BEGIN in ctf.c. This patch enhances the configure check to recognize such babeltrace versions as unusable for GDB. gdb/ChangeLog: * configure.ac: Enhance configure check for babeltrace to reject non-C++-enabled versions. * configure: Regenerate.
2016-02-09Modernize configure.ac'sSimon Marchi
Using AC_OUTPUT with arguments has been deprecated for some time in autoconf, even in version 2.64, which we are using. This change should not affect functionality. I also removed the "exit 0"'s, they shouldn't be necessary. gdb/ChangeLog: * configure.ac: Use AC_CONFIG_FILES instead of passing arguments to AC_OUTPUT. Remove "exit 0" at the end. * configure: Regenerate. gdb/testsuite/ChangeLog: * configure.ac: Use AC_CONFIG_FILES instead of passing arguments to AC_OUTPUT. * configure: Regenerate. gdb/gdbserver/ChangeLog: * configure.ac: Use AC_CONFIG_FILES instead of passing arguments to AC_OUTPUT. * configure: Regenerate.
2016-01-19Add support for LWP-based threads on FreeBSD.John Baldwin
Older versions of FreeBSD supported userland threading via a pure user-space threading library (N threads scheduled on 1 process) and a N:M model (N threads scheduled on M LWPs). However, modern FreeBSD versions only support a M:M threading model where each user thread is backed by a dedicated LWP. This thread target only supports this threading model. It also uses ptrace to query and alter LWP state directly rather than using libthread_db to simplify the implementation. FreeBSD recently gained support for reporting LWP events (birth and death of LWPs). GDB will use LWP events when present. For older systems it fetches the list of LWPs in the to_update_thread_list target op to update the list of threads on each stop. This target supports scheduler locking by using ptrace to suspend individual LWPs as necessary before resuming a process. gdb/ChangeLog: * configure.ac: Check for support for LWP names on FreeBSD. * fbsd-nat.c [PT_LWPINFO] New variable debug_fbsd_lwp. [TDP_RFPPWAIT || HAVE_STRUCT_PTRACE_LWPINFO_PL_TDNAME] (fbsd_fetch_kinfo_proc): Move function earlier. [PT_LWPINFO] (fbsd_thread_alive): New function. [PT_LWPINFO] (fbsd_pid_to_str): New function. [HAVE_STRUCT_PTRACE_LWPINFO_PL_TDNAME] (fbsd_thread_name): New function. [PT_LWP_EVENTS] (fbsd_enable_lwp_events): New function. [PT_LWPINFO] (fbsd_add_threads): New function. [PT_LWPINFO] (fbsd_update_thread_list): New function. [PT_LWPINFO] New variable super_resume. [PT_LWPINFO] (resume_one_thread_cb): New function. [PT_LWPINFO] (resume_all_threads_cb): New function. [PT_LWPINFO] (fbsd_resume): New function. (fbsd_remember_child): Save full ptid instead of plain pid. (fbsd_is_child_pending): Return ptid of saved child process. (fbsd_wait): Include lwp in returned ptid and switch to LWP ptid on first stop. [PT_LWP_EVENTS] Handle LWP events. [TDP_RFPPWAIT] Include LWP in child ptid. (fbsd_post_startup_inferior) [PT_LWP_EVENTS]: Enable LWP events. (fbsd_post_attach) [PT_LWP_EVENTS]: Enable LWP events. Add threads for existing processes. (fbsd_nat_add_target) [PT_LWPINFO]: Set "to_thread_alive" to "fbsd_thread_alive". Set "to_pid_to_str" to "fbsd_pid_to_str". [HAVE_STRUCT_PTRACE_LWPINFO_PL_TDNAME]: Set "to_thread_name" to "fbsd_thread_name". [PT_LWPINFO]: Set "to_update_thread_list" to "fbsd_update_thread_list". Set "to_has_thread_control" to "tc_schedlock". Set "to_resume" to "fbsd_resume". (_initialize_fbsd_nat): New function. * configure: Regenerate. * config.in: Regenerate. gdb/doc/ChangeLog: * gdb.texinfo (Debugging Output): Document "set/show debug fbsd-lwp".
2016-01-19Fix detection of "r_fs" and "r_gs" on FreeBSD.John Baldwin
Include <sys/types.h> as a prerequisite for <machine/reg.h> when checking for the r_fs and r_gs members in struct reg. Note that the previous test for <machine/reg.h> already includes <sys/types.h> as a prerequisite. gdb/ChangeLog: * configure.ac: Include <sys/types.h when checking for "r_fs" in "struct reg". * configure: Regenerate.
2016-01-12Remove trademark acknowledgements throughoutPedro Alves
The GNU Coding Standards say: "Please do not include any trademark acknowledgements in GNU software packages or documentation." gdb/ChangeLog: 2016-01-12 Pedro Alves <palves@redhat.com> Remove use of the registered trademark symbol throughout. gdb/gdbserver/ChangeLog: 2016-01-12 Pedro Alves <palves@redhat.com> Remove use of the registered trademark symbol throughout. gdb/doc/ChangeLog: 2016-01-12 Pedro Alves <palves@redhat.com> Remove use of the registered trademark symbol throughout.
2016-01-11gdb: split out warnings helpersMike Frysinger
This will allow the sim tree to use the same set of warnings. The new code in warning.m4 is exactly the same (other than the AC_DEFUN wrapping).
2016-01-05Fix PR sim/13418: building with --enable-targets=all failsPedro Alves
Multitarget builds currently fail when: (1) simulator support is enabled (the main --target supports target sim) (2) powerpc is included in the --enable-targets list (3) powerpc is not the main/default target (--target) This is because the powerpc sim provides a non-standard API function sim_spr_register_name which gdb/rs6000-tdep.c utilizes. Since the sim does not yet support multitarget, only the sim (if one exists) for the main target is built. When that target isn't powerpc, this function is not available leading to linking errors: rs6000-tdep.c:(.text+0x1e34d): undefined reference to `sim_spr_register_name' Fix this by only using that API if the sim linked in is the powerpc sim. gdb/ChangeLog: 2016-01-05 Pedro Alves <palves@redhat.com> PR sim/13418 * configure.ac: Define WITH_PPC_SIM when linking in the sim and the target is powerpc*. * configure: Regenerate. * config.in: Regenerate.
2016-01-01GDB copyright headers update after running GDB's copyright.py script.Joel Brobecker
gdb/ChangeLog: Update year range in copyright notice of all files.
2015-12-17Remove support for LinuxThreads and vendor 2.4 kernels w/ backported NPTLPedro Alves
Since we now rely on PTRACE_EVENT_CLONE being available (added in Linux 2.5.46), we're relying on NPTL. This commit removes the support for older LinuxThreads, as well as the workarounds for vendor 2.4 kernels with NPTL backported. - Rely on tkill being available. - Assume gdb doesn't get cancel signals. - Remove code that checks the LinuxThreads restart and cancel signals in the inferior. - Assume that __WALL is available. - Assume that non-leader threads report WIFEXITED. - Thus, no longer need to send signal 0 to check whether threads are still alive. - Update comments throughout. Tested on x86_64 Fedora 20, native and gdbserver. gdb/ChangeLog: * configure.ac: Remove tkill checks. * configure, config.in: Regenerate. * linux-nat.c: Remove HAVE_TKILL_SYSCALL check. Update top level comments. (linux_nat_post_attach_wait): Remove 'cloned' parameter. Use __WALL. (attach_proc_task_lwp_callback): Don't set the cloned flag. (linux_nat_attach): Adjust. (kill_lwp): Remove HAVE_TKILL_SYSCALL check. No longer fall back to 'kill'. (linux_handle_extended_wait): Use __WALL. Don't set the cloned flag. (wait_lwp): Use __WALL. Update comments. (running_callback, stop_and_resume_callback): Delete. (linux_nat_filter_event): Don't stop and resume all lwps. Don't check if the event LWP has previously exited. (check_zombie_leaders): Update comments. (linux_nat_wait_1): Use __WALL. (kill_wait_callback): Don't handle clone processes separately. Use __WALL instead. (linux_thread_alive): Delete. (linux_nat_thread_alive): Return true as long as the LWP is in the LWP list. (linux_nat_update_thread_list): Assume the kernel supports PTRACE_EVENT_CLONE. (get_signo): Delete. (lin_thread_get_thread_signals): Remove LinuxThreads references. No longer check __pthread_sig_restart / __pthread_sig_cancel in the inferior. * linux-nat.h (struct lwp_info) <cloned>: Delete field. * linux-thread-db.c: Update comments. (_initialize_thread_db): Remove LinuxThreads references. * nat/linux-waitpid.c (my_waitpid): No longer emulate __WALL. Pass down flags unmodified. * linux-waitpid.h (my_waitpid): Update documentation. gdb/gdbserver/ChangeLog: * linux-low.c (linux_kill_one_lwp): Remove references to LinuxThreads. (kill_lwp): Remove HAVE_TKILL_SYSCALL check. No longer fall back to 'kill'. (linux_init_signals): Delete. (initialize_low): Adjust. * thread-db.c (thread_db_init): Remove LinuxThreads reference.
2015-12-16Fix -Wno-unknown-warning support detectionPedro Alves
Ref: https://sourceware.org/ml/gdb/2015-12/msg00024.html We have code in configure.ac that tries to detect whether the compiler supports each warning and suppress it if not, but that doesn't work with "-Wno-" options, because gcc doesn't error out for -Wno-unknown-warning unless other diagnostics are being produced. See https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html. Handle this by checking whether -Wfoo works when we actually want -Wno-foo. gdb/ChangeLog: 2015-12-16 Pedro Alves <palves@redhat.com> * configure.ac (compiler warning flags): When testing a -Wno-foo option, check whether -Wfoo works instead. * configure: Regenerate. gdb/gdbserver/ChangeLog: 2015-12-16 Pedro Alves <palves@redhat.com> * configure.ac (compiler warning flags): When testing a -Wno-foo option, check whether -Wfoo works instead. * configure: Regenerate.
2015-11-19[C++] Default to -Werror in C++ mode tooPedro Alves
Both x86_64 GNU/Linux and x86_64 mingw-w64 build cleanly with --enable-targets=all. This enables -Werror by default in C++ mode too, in order to let the buildbot catch C++ build regressions for us. gdb/ChangeLog: 2015-11-19 Pedro Alves <palves@redhat.com> * configure.ac (ERROR_ON_WARNING): Don't check whether in C++ mode. * configure: Regenerate. gdb/gdbserver/ChangeLog: 2015-11-19 Pedro Alves <palves@redhat.com> * configure.ac (ERROR_ON_WARNING): Don't check whether in C++ mode. * configure: Regenerate.
2015-08-27gdb: Drop use of obsolete AC_TYPE_SIGNALPedro Alves
Since we're using sighandler_t, nothing else refers to RETSIGTYPE in gdb. (Actually, given gdb/remote.c has been assuming signal handlers return void for a long time, we could have gotten get rid of this even without gnulib's sighandler_t.) gdb/ChangeLog: 2015-08-27 Pedro Alves <palves@redhat.com> * configure.ac: Remove AC_TYPE_SIGNAL call. * configure, config.in: Regenerate.
2015-08-07configure: check for perf_event.h versionMarkus Metzger
Intel(R) Processor Trace support requires a recent linux/perf_event.h header. When GDB is built on an older system, Intel(R) Processor Trace will not be available and there is no indication in the configure and build log as to what went wrong. Check for a compatible linux/perf_event.h at configure-time. gdb/ * configure.ac: Check for PERF_ATTR_SIZE_VER5 in linux/perf_event.h * configure: Regenerate.
2015-07-24make gdbserver use the same ptrace autoconf checks as gdbPedro Alves
This factors the ptrace checks out of gdb's configure.ac to a new ptrace.m4 file, and then makes gdbserver's configure.ac source it too. gdb/ChangeLog: 2015-07-24 Pedro Alves <palves@redhat.com> * acinclude.m4: Include ptrace.m4. * configure.ac: Call GDB_AC_PTRACE and move ptrace checks ... * ptrace.m4: ... to this new file. gdb/gdbserver/ChangeLog: 2015-07-24 Pedro Alves <palves@redhat.com> * acinclude.m4: Include ../ptrace.m4. * configure.ac: Call GDB_AC_PTRACE. * config.in, configure: Regenerate.
2015-07-15Revert the previous 7 commits of: Validate binary before useJan Kratochvil
ddc98fbf2fd9e244a215a4d09e559180dc573a14 Create empty nat/linux-maps.[ch] and common/target-utils.[ch] 6e5b4429db0d66e2d0b27e1bcfe4709f3dae73ed Move gdb_regex* to common/ f7af1fcd759fa126612018a5916cf808df7bb8bc Prepare linux_find_memory_regions_full & co. for move 9904185cfde13d6c6849f1f042c8e3b74974cf08 Move linux_find_memory_regions_full & co. 700ca40f6fc1addd7238f4ab57f76c095ad3c99f gdbserver build-id attribute generator ca5268b6be265580b91ef75c1a1a9815f581ae42 Validate symbol file using build-id 0a94970d663a053c523f23ac0d71deb25a77f709 Tests for validate symbol file using build-id gdb/ChangeLog 2015-07-15 Jan Kratochvil <jan.kratochvil@redhat.com> Revert the previous 6 commits: Create empty nat/linux-maps.[ch] and common/target-utils.[ch]. Move gdb_regex* to common/ Prepare linux_find_memory_regions_full & co. for move Move linux_find_memory_regions_full & co. gdbserver build-id attribute generator Validate symbol file using build-id gdb/gdbserver/ChangeLog 2015-07-15 Jan Kratochvil <jan.kratochvil@redhat.com> Revert the previous 3 commits: Move gdb_regex* to common/ Move linux_find_memory_regions_full & co. gdbserver build-id attribute generator gdb/doc/ChangeLog 2015-07-15 Jan Kratochvil <jan.kratochvil@redhat.com> Revert the previous 2 commits: gdbserver build-id attribute generator Validate symbol file using build-id gdb/testsuite/ChangeLog 2015-07-15 Jan Kratochvil <jan.kratochvil@redhat.com> Revert the previous commit: Tests for validate symbol file using build-id.
2015-07-15Move gdb_regex* to common/Jan Kratochvil
Later patches need regex support also in gdbserver. gdb/ChangeLog 2015-07-15 Jan Kratochvil <jan.kratochvil@redhat.com> * Makefile.in (HFILES_NO_SRCDIR): Change gdb_regex.h to common/gdb_regex.h. (COMMON_OBS): Add gdb_regex.o. (gdb_regex.o): New. * common/common.m4 (GDB_AC_COMMON): Add gdb_use_included_regex, --without-included-regex and USE_INCLUDED_REGEX. * common/gdb_regex.c: New file from utils.c functions. * common/gdb_regex.h: Move it here from gdb_regex.h, update include file wrapping define name. * configure: Rebuilt. * configure.ac (gdb_use_included_regex, --without-included-regex) (USE_INCLUDED_REGEX): Move them to common/common.m4. * gdb_regex.h: Move it to common/gdb_regex.h. * utils.c: Remove include gdb_regex.h. (do_regfree_cleanup, make_regfree_cleanup, get_regcomp_error) (compile_rx_or_error): Move them to common/gdb_regex.c. gdb/gdbserver/ChangeLog 2015-07-15 Jan Kratochvil <jan.kratochvil@redhat.com> * Makefile.in (OBS): Add gdb_regex.o. (gdb_regex.o): New. * config.in: Rebuilt. * configure: Rebuilt.
2015-07-02configure: check for libiptMarkus Metzger
Check for libipt, an Intel(R) Processor Trace decoder library. The sources can be found on github at: https://github.com/01org/processor-trace gdb/ * configure.ac: Check for libipt * configure: Regenerate. * config.in: Regenerate. * Makefile.in (LIBIPT): New. (CLIBS): Add $LIBIPT. * NEWS: document new configure options
2015-06-10Introduce nat/linux-namespaces.[ch]Gary Benson
This commit introduces new shared files nat/linux-namespaces.[ch] containing code to support Linux namespaces that will be used by both GDB and gdbserver. gdb/ChangeLog: * configure.ac (AC_CHECK_FUNCS): Add setns. * config.in: Regenerate. * configure: Likewise. * nat/linux-namespaces.h: New file. * nat/linux-namespaces.c: Likewise. * Makefile.in (HFILES_NO_SRCDIR): Add nat/linux-namespaces.h. (linux-namespaces.o): New rule. * config/aarch64/linux.mh (NATDEPFILES): Add linux-namespaces.o. * config/alpha/alpha-linux.mh (NATDEPFILES): Likewise. * config/arm/linux.mh (NATDEPFILES): Likewise. * config/i386/linux.mh (NATDEPFILES): Likewise. * config/i386/linux64.mh (NATDEPFILES): Likewise. * config/ia64/linux.mh (NATDEPFILES): Likewise. * config/m32r/linux.mh (NATDEPFILES): Likewise. * config/m68k/linux.mh (NATDEPFILES): Likewise. * config/mips/linux.mh (NATDEPFILES): Likewise. * config/pa/linux.mh (NATDEPFILES): Likewise. * config/powerpc/linux.mh (NATDEPFILES): Likewise. * config/powerpc/ppc64-linux.mh (NATDEPFILES): Likewise. * config/powerpc/spu-linux.mh (NATDEPFILES): Likewise. * config/s390/linux.mh (NATDEPFILES): Likewise. * config/sparc/linux.mh (NATDEPFILES): Likewise. * config/sparc/linux64.mh (NATDEPFILES): Likewise. * config/tilegx/linux.mh (NATDEPFILES): Likewise. * config/xtensa/linux.mh (NATDEPFILES): Likewise. gdb/gdbserver/ChangeLog: * configure.ac (AC_CHECK_FUNCS): Add setns. * config.in: Regenerate. * configure: Likewise. * Makefile.in (SFILES): Add nat/linux-namespaces.c. (linux-namespaces.o): New rule. * configure.srv (srv_linux_obj): Add linux-namespaces.o.
2015-04-06Fallback to stub-termcap.c on all hostsPedro Alves
Currently building gdb is impossible without an installed termcap or curses library. But, GDB already has a very minimal termcap in the tree to handle this situation for Windows -- gdb/stub-termcap.c. This patch makes that the fallback for all hosts. Testing this on GNU/Linux (by simply hacking away the termcap/curses detection in gdb/configure.ac), we trip on: ../readline/libreadline.a(terminal.o): In function `_rl_init_terminal_io': /home/pedro/gdb/mygit/src/readline/terminal.c:527: undefined reference to `PC' /home/pedro/gdb/mygit/src/readline/terminal.c:528: undefined reference to `BC' /home/pedro/gdb/mygit/src/readline/terminal.c:529: undefined reference to `UP' /home/pedro/gdb/mygit/src/readline/terminal.c:538: undefined reference to `PC' /home/pedro/gdb/mygit/src/readline/terminal.c:539: undefined reference to `BC' /home/pedro/gdb/mygit/src/readline/terminal.c:540: undefined reference to `UP' These are globals that are normally defined by termcap (or ncurses' termcap emulation). Now, we could just define replacements in stub-termcap.c, but readline/terminal.c (at least the copy in our tree) has this: #if !defined (__linux__) && !defined (NCURSES_VERSION) # if defined (__EMX__) || defined (NEED_EXTERN_PC) extern # endif /* __EMX__ || NEED_EXTERN_PC */ char PC, *BC, *UP; #endif /* !__linux__ && !NCURSES_VERSION */ which can result in readline defining the globals too. That will usually work out in C, given that "-fcommon" is usually the default for C compilers, but that won't work for C++, or C with -fno-common (link fails with "multiple definition" errors)... Mirroring those #ifdef conditions in the stub termcap screams "brittle" to me -- I can see them changing in latter readline versions. Work around that by simply using __attribute__((weak)). Windows/PE/COFF's do support weak, but not on gcc 3.4 based toolchains (4.8.x does work). Given the file never needed the variables while it was Windows-only, just continue not defining them there. All other supported hosts should support this. gdb/ChangeLog: 2015-04-06 Pedro Alves <palves@redhat.com> Bernd Edlinger <bernd.edlinger@hotmail.de> * configure.ac: Remove the mingw32-specific stub-termcap.o fallback, and instead fallback to the stub termcap on all hosts. * configure: Regenerate. * stub-termcap.c [!__MINGW32__] (PC, BC, UP): Define as weak symbols.
2015-03-13Remove HPUXJan Kratochvil
IIUC it is a pre-requisite for IPv6 support, some UNICes do not support getaddrinfo required for IPv6. But coincidentally such UNICes are no longer really supported by GDB. Therefore it was concluded we can remove all such UNICes and then we can implement IPv6 easily with getaddrinfo. In mail Re: getaddrinfo available on all GDB hosts? [Re: [PATCH v2] Add IPv6 support for remote TCP connections] Message-ID: <20140211034157.GG5485@adacore.com> https://sourceware.org/ml/gdb-patches/2014-02/msg00333.html Joel said: So I chose HP-UX first for this patch. gdb/ChangeLog 2014-10-16 Jan Kratochvil <jan.kratochvil@redhat.com> Remove HPUX. * Makefile.in (ALL_64_TARGET_OBS): Remove ia64-hpux-tdep.o. (ALL_TARGET_OBS): Remove hppa-hpux-tdep.o, solib-som.o and solib-pa64.o. (HFILES_NO_SRCDIR): Remove solib-som.h, inf-ttrace.h, solib-pa64.h and ia64-hpux-tdep.h, solib-ia64-hpux.h. (ALLDEPFILES): Remove hppa-hpux-tdep.c, hppa-hpux-nat.c, ia64-hpux-nat.c, ia64-hpux-tdep.c, somread.c and solib-som.c. * config/djgpp/fnchange.lst: Remove hppa-hpux-nat.c and hppa-hpux-tdep.c. * config/ia64/hpux.mh: Remove file. * config/pa/hpux.mh: Remove file. * configure: Rebuilt. * configure.ac (dlgetmodinfo, somread.o): Remove. * configure.host (hppa*-*-hpux*, ia64-*-hpux*): Make them obsolete. (ia64-*-hpux*): Remove its float format exception. * configure.tgt (hppa*-*-hpux*, ia64-*-hpux*): Make them obsolete. * hppa-hpux-nat.c: Remove file. * hppa-hpux-tdep.c: Remove file. * hppa-tdep.c (struct hppa_unwind_info, struct hppa_objfile_private): Move them here from hppa-tdep.h (hppa_objfile_priv_data, hppa_init_objfile_priv_data): Make it static. (hppa_frame_prev_register_helper): Remove HPPA_FLAGS_REGNUM exception. * hppa-tdep.h (struct hppa_unwind_info, struct hppa_objfile_private): Move them to hppa-tdep.c. (hppa_objfile_priv_data, hppa_init_objfile_priv_data): Remove declarations. * ia64-hpux-nat.c: Remove file. * ia64-hpux-tdep.c: Remove file. * ia64-hpux-tdep.h: Remove file. * inf-ttrace.c: Remove file. * inf-ttrace.h: Remove file. * solib-ia64-hpux.c: Remove file. * solib-ia64-hpux.h: Remove file. * solib-pa64.c: Remove file. * solib-pa64.h: Remove file. * solib-som.c: Remove file. * solib-som.h: Remove file. * somread.c: Remove file.