Index: head/devel/gdb/Makefile =================================================================== --- head/devel/gdb/Makefile (revision 448626) +++ head/devel/gdb/Makefile (revision 448627) @@ -1,144 +1,144 @@ # Created by: Steven Kreuzer # $FreeBSD$ PORTNAME= gdb PORTVERSION= 8.0 -PORTREVISION= 1 +PORTREVISION= 2 CATEGORIES= devel MASTER_SITES= GNU MAINTAINER= luca.pizzamiglio@gmail.com COMMENT= GNU GDB of newer version than comes with the system LICENSE= GPLv3 TEST_DEPENDS= runtest:misc/dejagnu TEST_TARGET= check # XXX: This should be compiler:c++11-lib as GDB doesn't really require # C++14. However, clang in 10.3 crashes while building this port. # Requiring C++14 forces 10.3 to use an external version of clang while # still using the base system clang on 11.0 and later. USES= compiler:c++14-lang cpe iconv gmake libtool tar:xz USE_CSTD= gnu89 CPE_VENDOR= gnu GNU_CONFIGURE= yes CONFIGURE_ENV= CONFIGURED_M4=m4 CONFIGURED_BISON=byacc CONFIGURE_ARGS= --program-suffix=${PORTVERSION:S/.//g} \ --enable-targets=all --enable-64-bit-bfd \ --with-gdb-datadir=${PREFIX}/share/gdb${PORTVERSION:S/.//g} \ --with-separate-debug-dir=/usr/lib/debug \ ${ICONV_CONFIGURE_ARG} \ --with-expat=yes --with-libexpat-prefix=${LOCALBASE} \ --without-libunwind-ia64 CFLAGS:= ${CFLAGS:C/ +$//} # blanks at EOL creep in sometimes CFLAGS+= -DRL_NO_COMPAT -Wno-unused-function -Wno-unused-variable EXCLUDE= dejagnu expect sim texinfo intl EXTRACT_AFTER_ARGS= ${EXCLUDE:S/^/--exclude /} EXTRA_PATCHES= ${FILESDIR}/commit-45eba0ab7d \ ${FILESDIR}/commit-3c3ae77e68 \ ${FILESDIR}/commit-b5430a3ced \ ${FILESDIR}/commit-762c974a09 \ ${FILESDIR}/commit-929edea98d \ ${FILESDIR}/commit-6e5eab33ab \ ${FILESDIR}/commit-382b69bbb7 \ ${FILESDIR}/commit-2af9fc4432 \ ${FILESDIR}/commit-0b9305edf1 \ ${FILESDIR}/commit-e6f3b9c319 \ ${FILESDIR}/commit-4b654465bf \ ${FILESDIR}/commit-b30ff123fb \ ${FILESDIR}/commit-48aeef91c2 \ ${FILESDIR}/commit-0aa37b654c LIB_DEPENDS+= libexpat.so:textproc/expat2 VER= ${PORTVERSION:S/.//g} PLIST_SUB= VER=${VER} # untested elsewhere, might work -ONLY_FOR_ARCHS= amd64 armv6 i386 mips powerpc powerpc64 +ONLY_FOR_ARCHS= aarch64 amd64 armv6 i386 mips powerpc powerpc64 OPTIONS_DEFINE= DEBUG GDB_LINK GUILE KGDB PYTHON TUI OPTIONS_DEFAULT= GDB_LINK KGDB PYTHON TUI PORT_READLINE OPTIONS_SINGLE= READLINE OPTIONS_SINGLE_READLINE= BUNDLED_READLINE PORT_READLINE GDB_LINK_DESC= Create ${PREFIX}/bin/gdb symlink KGDB_DESC= Kernel Debugging Support BUNDLED_READLINE_DESC= from gdb distfile PORT_READLINE_DESC= from devel/readline port TUI_DESC= Text User Interface enabled OPTIONS_SUB= yes BUNDLED_READLINE_CONFIGURE_OFF= --with-system-readline DEBUG_CFLAGS= -g GUILE_CONFIGURE_WITH= guile GUILE_USES= pkgconfig GUILE_LIB_DEPENDS= libguile-2.0.so:lang/guile2 PORT_READLINE_USES= readline:port PYTHON_CONFIGURE_ON= --with-python=${PYTHON_CMD} PYTHON_CONFIGURE_OFF= --without-python PYTHON_USES= python TUI_CONFIGURE_ENABLE= tui .include .if ! ${PORT_OPTIONS:MBUNDLED_READLINE} EXCLUDE+= readline .endif .if ${ARCH} == "amd64" CONFIGURE_TARGET= x86_64-portbld-freebsd${OSREL} .endif .if ${COMPILER_TYPE} == "clang" CFLAGS+= -Wno-extended-offsetof .endif post-patch: @${REINPLACE_CMD} -e 's|$$| [GDB v${PORTVERSION} for FreeBSD]|' \ ${WRKSRC}/gdb/version.in post-patch-KGDB-on: @${CP} -r ${FILESDIR}/kgdb/*.[ch] ${WRKSRC}/gdb/ @${PATCH} -d ${PATCH_WRKSRC} ${PATCH_ARGS} < ${FILESDIR}/extrapatch-kgdb do-install: ${INSTALL_PROGRAM} ${WRKSRC}/gdb/gdb \ ${STAGEDIR}${PREFIX}/bin/gdb${VER} ${INSTALL_MAN} ${WRKSRC}/gdb/doc/gdb.1 \ ${STAGEDIR}${MAN1PREFIX}/man/man1/gdb${VER}.1 (cd ${WRKSRC}/gdb/data-directory ; \ ${SETENV} ${MAKE_ENV} ${MAKE_CMD} ${MAKE_ARGS} install-syscalls ) do-install-KGDB-on: ${INSTALL_PROGRAM} ${WRKSRC}/gdb/kgdb \ ${STAGEDIR}${PREFIX}/bin/kgdb${VER} ${INSTALL_MAN} ${FILESDIR}/kgdb/kgdb.1 \ ${STAGEDIR}${MAN1PREFIX}/man/man1/kgdb${VER}.1 do-install-TUI-on: ${LN} -sf gdb${VER} ${STAGEDIR}${PREFIX}/bin/gdbtui${VER} do-install-GDB_LINK-on: ${LN} -sf gdb${VER} ${STAGEDIR}${PREFIX}/bin/gdb .if ${PORT_OPTIONS:MKGDB} ${LN} -sf kgdb${VER} ${STAGEDIR}${PREFIX}/bin/kgdb .endif do-install-PYTHON-on: (cd ${WRKSRC}/gdb; ${SETENV} ${MAKE_ENV} ${MAKE_CMD} ${MAKE_ARGS} install-python ) (cd ${WRKSRC}/gdb/data-directory ; \ ${SETENV} ${MAKE_ENV} ${MAKE_CMD} ${MAKE_ARGS} install-python ) . for f in gdb gdb/command gdb/function gdb/printer @(cd ${STAGEDIR}${PREFIX}/share/gdb${VER}/python/${f} ; ${CHMOD} 644 *.py* ) . endfor do-install-GUILE-on: (cd ${WRKSRC}/gdb; ${SETENV} ${MAKE_ENV} ${MAKE_CMD} ${MAKE_ARGS} install-guile ) (cd ${WRKSRC}/gdb/data-directory ; \ ${SETENV} ${MAKE_ENV} ${MAKE_CMD} ${MAKE_ARGS} install-guile ) .include Index: head/devel/gdb/files/extrapatch-kgdb =================================================================== --- head/devel/gdb/files/extrapatch-kgdb (revision 448626) +++ head/devel/gdb/files/extrapatch-kgdb (revision 448627) @@ -1,400 +1,416 @@ diff --git gdb/Makefile.in gdb/Makefile.in -index 6e96a88a98..98c5fd2664 100644 +index cf59ae7143..0dd72d35d1 100644 --- gdb/Makefile.in +++ gdb/Makefile.in @@ -227,7 +227,8 @@ INCGNU = -I$(srcdir)/gnulib/import -I$(GNULIB_BUILDDIR)/import # Generated headers in the gnulib directory. These must be listed # so that they are generated before other files are compiled. -GNULIB_H = $(GNULIB_BUILDDIR)/import/string.h @GNULIB_STDINT_H@ +GNULIB_H = $(GNULIB_BUILDDIR)/import/string.h \ + $(GNULIB_BUILDDIR)/import/alloca.h @GNULIB_STDINT_H@ # # CLI sub directory definitons -@@ -758,6 +759,7 @@ ALL_64_TARGET_OBS = \ +@@ -745,6 +746,7 @@ TARGET_OBS = @TARGET_OBS@ + # All target-dependent objects files that require 64-bit CORE_ADDR + # (used with --enable-targets=all --enable-64-bit-bfd). + ALL_64_TARGET_OBS = \ ++ aarch64-fbsd-kern.o \ + aarch64-fbsd-tdep.o \ + aarch64-insn.o \ + aarch64-linux-tdep.o \ +@@ -759,6 +761,7 @@ ALL_64_TARGET_OBS = \ amd64-darwin-tdep.o \ amd64-dicos-tdep.o \ amd64-fbsd-tdep.o \ + amd64fbsd-kern.o \ amd64-linux-tdep.o \ amd64-nbsd-tdep.o \ amd64-obsd-tdep.o \ -@@ -769,6 +771,7 @@ ALL_64_TARGET_OBS = \ +@@ -770,6 +773,7 @@ ALL_64_TARGET_OBS = \ ia64-vms-tdep.o \ mips64-obsd-tdep.o \ sparc64-fbsd-tdep.o \ + sparc64fbsd-kern.o \ sparc64-linux-tdep.o \ sparc64-nbsd-tdep.o \ sparc64-obsd-tdep.o \ -@@ -796,6 +799,9 @@ ALL_TARGET_OBS = \ +@@ -797,6 +801,9 @@ ALL_TARGET_OBS = \ cris-linux-tdep.o \ cris-tdep.o \ dicos-tdep.o \ + fbsd-kld.o \ + fbsd-kthr.o \ + fbsd-kvm.o \ fbsd-tdep.o \ frv-linux-tdep.o \ frv-tdep.o \ -@@ -812,6 +818,7 @@ ALL_TARGET_OBS = \ +@@ -813,6 +820,7 @@ ALL_TARGET_OBS = \ i386-darwin-tdep.o \ i386-dicos-tdep.o \ i386-fbsd-tdep.o \ + i386fbsd-kern.o \ i386-gnu-tdep.o \ i386-go32-tdep.o \ i386-linux-tdep.o \ -@@ -836,6 +843,7 @@ ALL_TARGET_OBS = \ +@@ -837,6 +845,7 @@ ALL_TARGET_OBS = \ mep-tdep.o \ microblaze-linux-tdep.o \ microblaze-tdep.o \ + mipsfbsd-kern.o \ mips-fbsd-tdep.o \ mips-linux-tdep.o \ mips-nbsd-tdep.o \ -@@ -853,6 +861,7 @@ ALL_TARGET_OBS = \ +@@ -854,6 +863,7 @@ ALL_TARGET_OBS = \ nto-tdep.o \ obsd-tdep.o \ ppc-fbsd-tdep.o \ + ppcfbsd-kern.o \ ppc-linux-tdep.o \ ppc-nbsd-tdep.o \ ppc-obsd-tdep.o \ -@@ -1870,7 +1879,7 @@ generated_files = \ +@@ -1871,7 +1881,7 @@ generated_files = \ # Flags needed to compile Python code PYTHON_CFLAGS = @PYTHON_CFLAGS@ -all: gdb$(EXEEXT) $(CONFIG_ALL) +all: gdb$(EXEEXT) kgdb$(EXEEXT) $(CONFIG_ALL) @$(MAKE) $(FLAGS_TO_PASS) DO=all "DODIRS=`echo $(SUBDIRS) | sed 's/testsuite//'`" subdir_do # Rule for compiling .c files in the top-level gdb directory. -@@ -2209,6 +2218,12 @@ gdb$(EXEEXT): gdb.o $(LIBGDB_OBS) $(ADD_DEPS) $(CDEPS) $(TDEPLIBS) +@@ -2210,6 +2220,12 @@ gdb$(EXEEXT): gdb.o $(LIBGDB_OBS) $(ADD_DEPS) $(CDEPS) $(TDEPLIBS) -o gdb$(EXEEXT) gdb.o $(LIBGDB_OBS) \ $(TDEPLIBS) $(TUI_LIBRARY) $(CLIBS) $(LOADLIBES) +kgdb$(EXEEXT): kgdb-main.o $(LIBGDB_OBS) $(ADD_DEPS) $(CDEPS) $(TDEPLIBS) + rm -f kgdb$(EXEEXT) + $(CC_LD) $(INTERNAL_LDFLAGS) $(WIN32LDAPP) \ + -o kgdb$(EXEEXT) kgdb-main.o $(LIBGDB_OBS) \ + $(TDEPLIBS) $(TUI_LIBRARY) $(CLIBS) $(LOADLIBES) + # Convenience rule to handle recursion. $(LIBGNU) $(GNULIB_H): all-lib all-lib: $(GNULIB_BUILDDIR)/Makefile -@@ -2253,7 +2268,7 @@ clean mostlyclean: $(CONFIG_CLEAN) +@@ -2254,7 +2270,7 @@ clean mostlyclean: $(CONFIG_CLEAN) @$(MAKE) $(FLAGS_TO_PASS) DO=clean "DODIRS=$(CLEANDIRS)" subdir_do rm -f *.o *.a $(ADD_FILES) *~ init.c-tmp init.l-tmp version.c-tmp rm -f init.c version.c observer.h observer.inc - rm -f gdb$(EXEEXT) core make.log + rm -f gdb$(EXEEXT) core make.log kgdb$(EXEEXT) rm -f gdb[0-9]$(EXEEXT) rm -f test-cp-name-parser$(EXEEXT) rm -f xml-builtin.c stamp-xml -@@ -2475,6 +2490,7 @@ ALLDEPFILES = \ +@@ -2461,6 +2477,7 @@ MAKEOVERRIDES = + + ALLDEPFILES = \ + aarch64-fbsd-nat.c \ ++ aarch64-fbsd-kern.c \ + aarch64-fbsd-tdep.c \ + aarch64-linux-nat.c \ + aarch64-linux-tdep.c \ +@@ -2478,6 +2495,7 @@ ALLDEPFILES = \ amd64-bsd-nat.c \ amd64-darwin-tdep.c \ amd64-dicos-tdep.c \ + amd64fbsd-kern.c \ amd64-fbsd-nat.c \ amd64-fbsd-tdep.c \ amd64-linux-nat.c \ -@@ -2510,6 +2526,9 @@ ALLDEPFILES = \ +@@ -2513,6 +2531,9 @@ ALLDEPFILES = \ dcache.c \ dicos-tdep.c \ exec.c \ + fbsd-kld.c \ + fbsd-kthr.c \ + fbsd-kvm.c \ fbsd-nat.c \ fbsd-tdep.c \ fork-child.c \ -@@ -2531,6 +2550,7 @@ ALLDEPFILES = \ +@@ -2534,6 +2555,7 @@ ALLDEPFILES = \ i386-darwin-nat.c \ i386-darwin-tdep.c \ i386-dicos-tdep.c \ + i386fbsd-kern.c \ i386-fbsd-nat.c \ i386-fbsd-tdep.c \ i386-gnu-nat.c \ -@@ -2572,6 +2592,7 @@ ALLDEPFILES = \ +@@ -2575,6 +2597,7 @@ ALLDEPFILES = \ mingw-hdep.c \ mips-fbsd-nat.c \ mips-fbsd-tdep.c \ + mipsfbsd-kern.c \ mips-linux-nat.c \ mips-linux-tdep.c \ mips-nbsd-nat.c \ -@@ -2589,6 +2610,7 @@ ALLDEPFILES = \ +@@ -2592,6 +2615,7 @@ ALLDEPFILES = \ obsd-nat.c \ obsd-tdep.c \ posix-hdep.c \ + ppcfbsd-kern.c \ ppc-fbsd-nat.c \ ppc-fbsd-tdep.c \ ppc-linux-nat.c \ -@@ -2633,6 +2655,7 @@ ALLDEPFILES = \ +@@ -2636,6 +2660,7 @@ ALLDEPFILES = \ sparc-sol2-nat.c \ sparc-sol2-tdep.c \ sparc-tdep.c \ + sparc64fbsd-kern.c \ sparc64-fbsd-nat.c \ sparc64-fbsd-tdep.c \ sparc64-linux-nat.c \ -@@ -2664,6 +2687,12 @@ ALLDEPFILES = \ +@@ -2667,6 +2692,12 @@ ALLDEPFILES = \ xtensa-linux-tdep.c \ xtensa-tdep.c \ xtensa-xtregs.c \ + kgdb/kld.c \ + kgdb/kthr.c \ + kgdb/trgt.c \ + kgdb/trgt_amd64.c \ + kgdb/trgt_i386.c \ + kgdb/trgt_sparc64.c \ common/mingw-strerror.c \ common/posix-strerror.c -@@ -2925,7 +2954,7 @@ endif +@@ -2928,7 +2959,7 @@ endif # A list of all the objects we might care about in this build, for # dependency tracking. -all_object_files = gdb.o $(LIBGDB_OBS) gdbtk-main.o \ +all_object_files = kgdb-main.o gdb.o $(LIBGDB_OBS) gdbtk-main.o \ test-cp-name-parser.o # Ensure that generated files are created early. Use order-only diff --git gdb/config.in gdb/config.in index 3f8a72326b..bb1e8c23bf 100644 --- gdb/config.in +++ gdb/config.in @@ -222,6 +222,9 @@ /* Define to 1 if your system has the kinfo_getvmmap function. */ #undef HAVE_KINFO_GETVMMAP +/* Define to 1 if your system has the kvm_open2 function. */ +#undef HAVE_KVM_OPEN2 + /* Define if you have and nl_langinfo(CODESET). */ #undef HAVE_LANGINFO_CODESET diff --git gdb/config/mips/fbsd.mh gdb/config/mips/fbsd.mh index f433347a20..5470795612 100644 --- gdb/config/mips/fbsd.mh +++ gdb/config/mips/fbsd.mh @@ -1,3 +1,5 @@ # Host: FreeBSD/mips NATDEPFILES= fork-child.o inf-ptrace.o fbsd-nat.o mips-fbsd-nat.o HAVE_NATIVE_GCORE_HOST = 1 + +LOADLIBES= -lkvm diff --git gdb/configure gdb/configure index e14886b67d..5682ce42d6 100755 --- gdb/configure +++ gdb/configure @@ -7968,6 +7968,66 @@ $as_echo "#define HAVE_KINFO_GETVMMAP 1" >>confdefs.h fi +# kgdb needs kvm_open2 for cross-debugging +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing kvm_open2" >&5 +$as_echo_n "checking for library containing kvm_open2... " >&6; } +if test "${ac_cv_search_kvm_open2+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + ac_func_search_save_LIBS=$LIBS +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char kvm_open2 (); +int +main () +{ +return kvm_open2 (); + ; + return 0; +} +_ACEOF +for ac_lib in '' kvm; do + if test -z "$ac_lib"; then + ac_res="none required" + else + ac_res=-l$ac_lib + LIBS="-l$ac_lib $ac_func_search_save_LIBS" + fi + if ac_fn_c_try_link "$LINENO"; then : + ac_cv_search_kvm_open2=$ac_res +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext + if test "${ac_cv_search_kvm_open2+set}" = set; then : + break +fi +done +if test "${ac_cv_search_kvm_open2+set}" = set; then : + +else + ac_cv_search_kvm_open2=no +fi +rm conftest.$ac_ext +LIBS=$ac_func_search_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_kvm_open2" >&5 +$as_echo "$ac_cv_search_kvm_open2" >&6; } +ac_res=$ac_cv_search_kvm_open2 +if test "$ac_res" != no; then : + test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" + +$as_echo "#define HAVE_KVM_OPEN2 1" >>confdefs.h + +fi + + if test "X$prefix" = "XNONE"; then acl_final_prefix="$ac_default_prefix" diff --git gdb/configure.ac gdb/configure.ac index 50f6f592ba..89cdc9cc8e 100644 --- gdb/configure.ac +++ gdb/configure.ac @@ -530,6 +530,11 @@ AC_SEARCH_LIBS(kinfo_getvmmap, util util-freebsd, [AC_DEFINE(HAVE_KINFO_GETVMMAP, 1, [Define to 1 if your system has the kinfo_getvmmap function. ])]) +# kgdb needs kvm_open2 for cross-debugging +AC_SEARCH_LIBS(kvm_open2, kvm, + [AC_DEFINE(HAVE_KVM_OPEN2, 1, + [Define to 1 if your system has the kvm_open2 function. ])]) + AM_ICONV # GDB may fork/exec the iconv program to get the list of supported character diff --git gdb/configure.tgt gdb/configure.tgt -index fdcb7b1d69..d99aa325ab 100644 +index f72a0dbbc1..2d73300961 100644 --- gdb/configure.tgt +++ gdb/configure.tgt -@@ -198,7 +198,13 @@ i[34567]86-*-dicos*) +@@ -203,7 +203,13 @@ i[34567]86-*-dicos*) i[34567]86-*-freebsd* | i[34567]86-*-kfreebsd*-gnu) # Target: FreeBSD/i386 gdb_target_obs="i386-tdep.o i387-tdep.o i386-bsd-tdep.o i386-fbsd-tdep.o \ - fbsd-tdep.o solib-svr4.o" + fbsd-tdep.o solib-svr4.o \ + fbsd-kld.o fbsd-kthr.o fbsd-kvm.o i386fbsd-kern.o" + if test "x$enable_64_bit_bfd" = "xyes"; then + # Target: FreeBSD amd64 + gdb_target_obs="amd64-tdep.o amd64fbsd-tdep.o amd64fbsd-kern.o \ + ${gdb_target_obs}" + fi ;; i[34567]86-*-netbsd* | i[34567]86-*-knetbsd*-gnu) # Target: NetBSD/i386 -@@ -372,7 +378,8 @@ mips*-*-netbsd* | mips*-*-knetbsd*-gnu) +@@ -377,7 +383,8 @@ mips*-*-netbsd* | mips*-*-knetbsd*-gnu) ;; mips*-*-freebsd*) # Target: MIPS running FreeBSD - gdb_target_obs="mips-tdep.o mips-fbsd-tdep.o solib-svr4.o fbsd-tdep.o" + gdb_target_obs="mips-tdep.o mips-fbsd-tdep.o solib-svr4.o fbsd-tdep.o \ + fbsd-kld.o fbsd-kthr.o fbsd-kvm.o mipsfbsd-kern.o" gdb_sim=../sim/mips/libsim.a ;; mips64*-*-openbsd*) -@@ -431,7 +438,8 @@ powerpc*-*-freebsd*) +@@ -436,7 +443,8 @@ powerpc*-*-freebsd*) # Target: FreeBSD/powerpc gdb_target_obs="rs6000-tdep.o ppc-sysv-tdep.o ppc64-tdep.o \ ppc-fbsd-tdep.o fbsd-tdep.o solib-svr4.o \ - ravenscar-thread.o ppc-ravenscar-thread.o" + ravenscar-thread.o ppc-ravenscar-thread.o \ + fbsd-kld.o fbsd-kthr.o fbsd-kvm.o ppcfbsd-kern.o" ;; powerpc-*-netbsd* | powerpc-*-knetbsd*-gnu) -@@ -555,7 +563,8 @@ sparc*-*-freebsd* | sparc*-*-kfreebsd*-gnu) +@@ -560,7 +568,8 @@ sparc*-*-freebsd* | sparc*-*-kfreebsd*-gnu) # Target: FreeBSD/sparc64 gdb_target_obs="sparc-tdep.o sparc64-tdep.o sparc64-fbsd-tdep.o \ fbsd-tdep.o solib-svr4.o \ - ravenscar-thread.o sparc-ravenscar-thread.o" + ravenscar-thread.o sparc-ravenscar-thread.o \ + fbsd-kld.o fbsd-kthr.o fbsd-kvm.o sparc64fbsd-kern.o" ;; sparc-*-netbsd* | sparc-*-knetbsd*-gnu) # Target: NetBSD/sparc -@@ -686,7 +695,9 @@ x86_64-*-freebsd* | x86_64-*-kfreebsd*-gnu) +@@ -691,7 +700,9 @@ x86_64-*-freebsd* | x86_64-*-kfreebsd*-gnu) # Target: FreeBSD/amd64 gdb_target_obs="amd64-tdep.o amd64-fbsd-tdep.o i386-tdep.o \ i387-tdep.o i386-bsd-tdep.o i386-fbsd-tdep.o \ - fbsd-tdep.o solib-svr4.o" + fbsd-tdep.o solib-svr4.o \ + fbsd-kld.o fbsd-kthr.o fbsd-kvm.o amd64fbsd-kern.o \ + i386fbsd-kern.o" ;; x86_64-*-mingw* | x86_64-*-cygwin*) # Target: MingW/amd64 diff --git gdb/defs.h gdb/defs.h index a0b586f401..44d3d112ed 100644 --- gdb/defs.h +++ gdb/defs.h @@ -590,6 +590,7 @@ enum gdb_osabi GDB_OSABI_SOLARIS, GDB_OSABI_LINUX, GDB_OSABI_FREEBSD, + GDB_OSABI_FREEBSD_KERNEL, GDB_OSABI_NETBSD, GDB_OSABI_OPENBSD, GDB_OSABI_WINCE, diff --git gdb/osabi.c gdb/osabi.c index 84fa9c0273..5c49e22657 100644 --- gdb/osabi.c +++ gdb/osabi.c @@ -65,6 +65,7 @@ static const struct osabi_names gdb_osabi_names[] = { "Solaris", NULL }, { "GNU/Linux", "linux(-gnu)?" }, { "FreeBSD", NULL }, + { "FreeBSD/kernel", NULL }, { "NetBSD", NULL }, { "OpenBSD", NULL }, { "WindowsCE", NULL }, diff --git gdb/regcache.c gdb/regcache.c index 37bc2f0046..9da3aaa514 100644 --- gdb/regcache.c +++ gdb/regcache.c @@ -1105,6 +1105,20 @@ regcache_raw_supply (struct regcache *regcache, int regnum, const void *buf) } } +void +regcache_raw_supply_unsigned (struct regcache *regcache, int regnum, + ULONGEST val) +{ + gdb_byte *buf; + + gdb_assert (regcache != NULL); + gdb_assert (regnum >=0 && regnum < regcache->descr->nr_raw_registers); + buf = (gdb_byte *)alloca (regcache->descr->sizeof_register[regnum]); + store_unsigned_integer (buf, regcache->descr->sizeof_register[regnum], + gdbarch_byte_order (regcache->descr->gdbarch), val); + regcache_raw_supply (regcache, regnum, buf); +} + /* Collect register REGNUM from REGCACHE and store its contents in BUF. */ void diff --git gdb/regcache.h gdb/regcache.h index 1d60fa7616..9b8a4723a3 100644 --- gdb/regcache.h +++ gdb/regcache.h @@ -149,6 +149,8 @@ extern void regcache_write_pc (struct regcache *regcache, CORE_ADDR pc); extern void regcache_raw_supply (struct regcache *regcache, int regnum, const void *buf); +extern void regcache_raw_supply_unsigned (struct regcache *regcache, + int regnum, ULONGEST val); extern void regcache_raw_collect (const struct regcache *regcache, int regnum, void *buf); Index: head/devel/gdb/files/kgdb/aarch64-fbsd-kern.c =================================================================== --- head/devel/gdb/files/kgdb/aarch64-fbsd-kern.c (nonexistent) +++ head/devel/gdb/files/kgdb/aarch64-fbsd-kern.c (revision 448627) @@ -0,0 +1,196 @@ +/*- + * Copyright (c) 2017 John Baldwin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * $FreeBSD$ + */ + +/* Target-dependent code for FreeBSD/aarch64 kernels. */ + +#include "defs.h" + +#include "aarch64-tdep.h" +#include "frame-unwind.h" +#include "gdbcore.h" +#include "osabi.h" +#include "regcache.h" +#include "regset.h" +#include "solib.h" +#include "target.h" +#include "trad-frame.h" + +#include "kgdb.h" + +static const struct regcache_map_entry aarch64_fbsd_pcbmap[] = + { + { 30, AARCH64_X0_REGNUM, 8 }, /* x0 ... x29 */ + { 1, AARCH64_LR_REGNUM, 8 }, + { 1, AARCH64_SP_REGNUM, 8 }, + { 1, AARCH64_PC_REGNUM, 8 }, + { 0 } + }; + +static const struct regset aarch64_fbsd_pcbregset = + { + aarch64_fbsd_pcbmap, + regcache_supply_regset, regcache_collect_regset + }; + +static void +aarch64_fbsd_supply_pcb(struct regcache *regcache, CORE_ADDR pcb_addr) +{ + gdb_byte buf[8 * 33]; + + if (target_read_memory (pcb_addr, buf, sizeof buf) == 0) + regcache_supply_regset (&aarch64_fbsd_pcbregset, regcache, -1, buf, + sizeof (buf)); +} + +static struct trad_frame_cache * +aarch64_fbsd_trapframe_cache (struct frame_info *this_frame, void **this_cache) +{ + struct gdbarch *gdbarch = get_frame_arch (this_frame); + enum bfd_endian byte_order = gdbarch_byte_order (gdbarch); + struct trad_frame_cache *cache; + CORE_ADDR addr, func, pc, sp; + const char *name; + int i; + + if (*this_cache != NULL) + return ((struct trad_frame_cache *)*this_cache); + + cache = trad_frame_cache_zalloc (this_frame); + *this_cache = cache; + + func = get_frame_func (this_frame); + sp = get_frame_register_unsigned (this_frame, AARCH64_SP_REGNUM); + + find_pc_partial_function (func, &name, NULL, NULL); + if (strcmp(name, "fork_trampoline") == 0 && get_frame_pc (this_frame) == func) + { + /* fork_exit hasn't been called (kthread has never run), so SP + hasn't been initialized yet. The stack pointer is stored in + the X2 in the pcb. */ + sp = get_frame_register_unsigned (this_frame, AARCH64_X0_REGNUM + 2); + } + + trad_frame_set_reg_addr (cache, AARCH64_SP_REGNUM, sp); + trad_frame_set_reg_addr (cache, AARCH64_LR_REGNUM, sp + 8); + trad_frame_set_reg_addr (cache, AARCH64_PC_REGNUM, sp + 16); + trad_frame_set_reg_addr (cache, AARCH64_CPSR_REGNUM, sp + 24); + for (i = 0; i < 30; i++) + trad_frame_set_reg_addr (cache, AARCH64_X0_REGNUM + 1, sp + 32 + i * 8); + + /* Read $PC from trap frame. */ + pc = read_memory_unsigned_integer (sp + 16, 8, byte_order); + + if (pc == 0 && strcmp(name, "fork_trampoline") == 0) + { + /* Initial frame of a kthread; terminate backtrace. */ + trad_frame_set_id (cache, outer_frame_id); + } + else + { + /* Construct the frame ID using the function start. */ + trad_frame_set_id (cache, frame_id_build (sp + 8 * 34, func)); + } + + return cache; +} + +static void +aarch64_fbsd_trapframe_this_id (struct frame_info *this_frame, + void **this_cache, struct frame_id *this_id) +{ + struct trad_frame_cache *cache = + aarch64_fbsd_trapframe_cache (this_frame, this_cache); + + trad_frame_get_id (cache, this_id); +} + +static struct value * +aarch64_fbsd_trapframe_prev_register (struct frame_info *this_frame, + void **this_cache, int regnum) +{ + struct trad_frame_cache *cache = + aarch64_fbsd_trapframe_cache (this_frame, this_cache); + + return trad_frame_get_register (cache, this_frame, regnum); +} + +static int +aarch64_fbsd_trapframe_sniffer (const struct frame_unwind *self, + struct frame_info *this_frame, + void **this_prologue_cache) +{ + const char *name; + + find_pc_partial_function (get_frame_func (this_frame), &name, NULL, NULL); + return (name && ((strcmp (name, "handle_el1h_sync") == 0) + || (strcmp (name, "handle_el1h_irq") == 0) + || (strcmp (name, "handle_el0h_sync") == 0) + || (strcmp (name, "handle_el0h_irq") == 0) + || (strcmp (name, "handle_el0h_error") == 0) + || (strcmp (name, "fork_trampoline") == 0))); +} + +static const struct frame_unwind aarch64_fbsd_trapframe_unwind = { + SIGTRAMP_FRAME, + default_frame_unwind_stop_reason, + aarch64_fbsd_trapframe_this_id, + aarch64_fbsd_trapframe_prev_register, + NULL, + aarch64_fbsd_trapframe_sniffer +}; + +/* Implement the 'init_osabi' method of struct gdb_osabi_handler. */ + +static void +aarch64_fbsd_kernel_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch) +{ + struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch); + + frame_unwind_prepend_unwinder (gdbarch, &aarch64_fbsd_trapframe_unwind); + + set_solib_ops (gdbarch, &kld_so_ops); + + /* Enable longjmp. */ + tdep->jb_pc = 13; + + fbsd_vmcore_set_supply_pcb (gdbarch, aarch64_fbsd_supply_pcb); + fbsd_vmcore_set_cpu_pcb_addr (gdbarch, kgdb_trgt_stop_pcb); +} + +/* Provide a prototype to silence -Wmissing-prototypes. */ +extern initialize_file_ftype _initialize_aarch64_kgdb_tdep; + +void +_initialize_aarch64_kgdb_tdep (void) +{ + gdbarch_register_osabi_sniffer(bfd_arch_aarch64, + bfd_target_elf_flavour, + fbsd_kernel_osabi_sniffer); + gdbarch_register_osabi (bfd_arch_aarch64, 0, GDB_OSABI_FREEBSD_KERNEL, + aarch64_fbsd_kernel_init_abi); +} Property changes on: head/devel/gdb/files/kgdb/aarch64-fbsd-kern.c ___________________________________________________________________ Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +FreeBSD=%H \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Index: head/devel/gdb/files/kgdb/fbsd-kvm.c =================================================================== --- head/devel/gdb/files/kgdb/fbsd-kvm.c (revision 448626) +++ head/devel/gdb/files/kgdb/fbsd-kvm.c (revision 448627) @@ -1,596 +1,618 @@ /* * Copyright (c) 2004 Marcel Moolenaar * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #include __FBSDID("$FreeBSD$"); #include #include #include #include #include #include #include #include #include #include #include #include "elf-bfd.h" #include #include "filenames.h" #include #include #include #include #include "gdb_obstack.h" #include #include #include "objfiles.h" +#include "osabi.h" #include #include #include #include #include "kgdb.h" static CORE_ADDR stoppcbs; static LONGEST pcb_size; static void kgdb_core_cleanup(void *); static char *vmcore; struct target_ops kgdb_trgt_ops; /* Per-architecture data key. */ static struct gdbarch_data *fbsd_vmcore_data; struct fbsd_vmcore_ops { /* Supply registers for a pcb to a register cache. */ void (*supply_pcb)(struct regcache *, CORE_ADDR); /* Return address of pcb for thread running on a CPU. */ CORE_ADDR (*cpu_pcb_addr)(u_int); }; static void * fbsd_vmcore_init (struct obstack *obstack) { struct fbsd_vmcore_ops *ops; ops = OBSTACK_ZALLOC (obstack, struct fbsd_vmcore_ops); return ops; } /* Set the function that supplies registers from a pcb for architecture GDBARCH to SUPPLY_PCB. */ void fbsd_vmcore_set_supply_pcb (struct gdbarch *gdbarch, void (*supply_pcb) (struct regcache *, CORE_ADDR)) { struct fbsd_vmcore_ops *ops = (struct fbsd_vmcore_ops *) gdbarch_data (gdbarch, fbsd_vmcore_data); ops->supply_pcb = supply_pcb; } /* Set the function that returns the address of the pcb for a thread running on a CPU for architecture GDBARCH to CPU_PCB_ADDR. */ void fbsd_vmcore_set_cpu_pcb_addr (struct gdbarch *gdbarch, CORE_ADDR (*cpu_pcb_addr) (u_int)) { struct fbsd_vmcore_ops *ops = (struct fbsd_vmcore_ops *) gdbarch_data (gdbarch, fbsd_vmcore_data); ops->cpu_pcb_addr = cpu_pcb_addr; } static CORE_ADDR kernstart; static kvm_t *kvm; static char kvm_err[_POSIX2_LINE_MAX]; int kgdb_quiet; static ptid_t fbsd_vmcore_ptid(int tid) { if (kvm == NULL) /* * The remote target stores the 'tid' in the lwp * field. */ return ptid_build(ptid_get_pid(inferior_ptid), tid, 0); /* * This follows the model described in bsd-kvm.c except that * in kernel tids are used as the tid of the ptid instead of a * process ID. */ return ptid_build(1, 1, tid); } #define MSGBUF_SEQ_TO_POS(size, seq) ((seq) % (size)) static void kgdb_dmesg(void) { CORE_ADDR bufp; int size, rseq, wseq; gdb_byte c; /* * Display the unread portion of the message buffer. This gives the * user a some initial data to work from. */ if (kgdb_quiet) return; TRY { bufp = parse_and_eval_address("msgbufp->msg_ptr"); size = parse_and_eval_long("msgbufp->msg_size"); rseq = parse_and_eval_long("msgbufp->msg_rseq"); wseq = parse_and_eval_long("msgbufp->msg_wseq"); } CATCH(e, RETURN_MASK_ERROR) { return; } END_CATCH rseq = MSGBUF_SEQ_TO_POS(size, rseq); wseq = MSGBUF_SEQ_TO_POS(size, wseq); if (rseq == wseq) return; printf("\nUnread portion of the kernel message buffer:\n"); while (rseq < wseq) { read_memory(bufp + rseq, &c, 1); putchar(c); rseq++; if (rseq == size) rseq = 0; } if (c != '\n') putchar('\n'); putchar('\n'); } #define KERNEL_INTERP "/red/herring" enum gdb_osabi fbsd_kernel_osabi_sniffer(bfd *abfd) { asection *s; bfd_byte buf[sizeof(KERNEL_INTERP)]; bfd_byte *bufp; - /* FreeBSD ELF kernels have a FreeBSD/ELF OS ABI. */ - if (elf_elfheader(abfd)->e_ident[EI_OSABI] != ELFOSABI_FREEBSD) + /* First, determine if this is a FreeBSD/ELF binary. */ + switch (elf_elfheader(abfd)->e_ident[EI_OSABI]) { + case ELFOSABI_FREEBSD: + break; + case ELFOSABI_NONE: { + enum gdb_osabi osabi = GDB_OSABI_UNKNOWN; + + bfd_map_over_sections (abfd, + generic_elf_osabi_sniff_abi_tag_sections, + &osabi); + + /* + * aarch64 kernels don't have the right note tag for + * kernels so just look for /red/herring anyway. + */ + if (osabi == GDB_OSABI_UNKNOWN && + elf_elfheader(abfd)->e_machine == EM_AARCH64) + break; + if (osabi != GDB_OSABI_FREEBSD) + return (GDB_OSABI_UNKNOWN); + } + default: return (GDB_OSABI_UNKNOWN); + } /* FreeBSD ELF kernels have an interpreter path of "/red/herring". */ bufp = buf; s = bfd_get_section_by_name(abfd, ".interp"); if (s != NULL && bfd_section_size(abfd, s) == sizeof(buf) && bfd_get_full_section_contents(abfd, s, &bufp) && memcmp(buf, KERNEL_INTERP, sizeof(buf)) == 0) return (GDB_OSABI_FREEBSD_KERNEL); return (GDB_OSABI_UNKNOWN); } #ifdef HAVE_KVM_OPEN2 static int kgdb_resolve_symbol(const char *name, kvaddr_t *kva) { struct bound_minimal_symbol ms; ms = lookup_minimal_symbol (name, NULL, NULL); if (ms.minsym == NULL) return (1); *kva = BMSYMBOL_VALUE_ADDRESS (ms); return (0); } #endif static void kgdb_trgt_open(const char *arg, int from_tty) { struct fbsd_vmcore_ops *ops = (struct fbsd_vmcore_ops *) gdbarch_data (target_gdbarch(), fbsd_vmcore_data); struct inferior *inf; struct cleanup *old_chain; struct thread_info *ti; struct kthr *kt; kvm_t *nkvm; char *temp, *kernel, *filename; int ontop; if (ops == NULL || ops->supply_pcb == NULL || ops->cpu_pcb_addr == NULL) error ("ABI doesn't support a vmcore target"); target_preopen (from_tty); kernel = get_exec_file (1); if (kernel == NULL) error ("Can't open a vmcore without a kernel"); if (arg != NULL) { filename = tilde_expand (arg); if (!IS_ABSOLUTE_PATH (filename)) { temp = concat (current_directory, "/", filename, NULL); xfree(filename); filename = temp; } } else filename = NULL; old_chain = make_cleanup (xfree, filename); #ifdef HAVE_KVM_OPEN2 nkvm = kvm_open2(kernel, filename, write_files ? O_RDWR : O_RDONLY, kvm_err, kgdb_resolve_symbol); #else nkvm = kvm_openfiles(kernel, filename, NULL, write_files ? O_RDWR : O_RDONLY, kvm_err); #endif if (nkvm == NULL) error ("Failed to open vmcore: %s", kvm_err); /* Don't free the filename now and close any previous vmcore. */ discard_cleanups(old_chain); unpush_target(&kgdb_trgt_ops); /* * Determine the first address in KVA. Newer kernels export * VM_MAXUSER_ADDRESS and the first kernel address can be * determined by adding one. Older kernels do not provide a * symbol that is valid on all platforms, but kernbase is close * for most platforms. */ TRY { kernstart = parse_and_eval_address("vm_maxuser_address") + 1; } CATCH(e, RETURN_MASK_ERROR) { kernstart = kgdb_lookup("kernbase"); } END_CATCH /* * Lookup symbols needed for stoppcbs[] handling, but don't * fail if they aren't present. */ stoppcbs = kgdb_lookup("stoppcbs"); TRY { pcb_size = parse_and_eval_long("pcb_size"); } CATCH(e, RETURN_MASK_ERROR) { TRY { pcb_size = parse_and_eval_long("sizeof(struct pcb)"); } CATCH(e, RETURN_MASK_ERROR) { #ifdef HAVE_KVM_OPEN2 if (kvm_native(nkvm)) pcb_size = sizeof(struct pcb); else pcb_size = 0; #else pcb_size = sizeof(struct pcb); #endif } END_CATCH } END_CATCH kvm = nkvm; vmcore = filename; old_chain = make_cleanup(kgdb_core_cleanup, NULL); push_target (&kgdb_trgt_ops); discard_cleanups (old_chain); kgdb_dmesg(); inf = current_inferior(); if (inf->pid == 0) { inferior_appeared(inf, 1); inf->fake_pid_p = 1; } solib_create_inferior_hook(0); init_thread_list(); kt = kgdb_thr_init(ops->cpu_pcb_addr); while (kt != NULL) { ti = add_thread_silent(fbsd_vmcore_ptid(kt->tid)); kt = kgdb_thr_next(kt); } if (curkthr != 0) inferior_ptid = fbsd_vmcore_ptid(curkthr->tid); target_fetch_registers (get_current_regcache (), -1); reinit_frame_cache (); print_stack_frame (get_selected_frame (NULL), 0, SRC_AND_LOC, 1); } static void kgdb_trgt_close(struct target_ops *self) { if (kvm != NULL) { clear_solib(); if (kvm_close(kvm) != 0) warning("cannot close \"%s\": %s", vmcore, kvm_geterr(kvm)); kvm = NULL; xfree(vmcore); vmcore = NULL; } inferior_ptid = null_ptid; } static void kgdb_core_cleanup(void *arg) { kgdb_trgt_close(0); } static void kgdb_trgt_detach(struct target_ops *ops, const char *args, int from_tty) { if (args) error ("Too many arguments"); unpush_target(&kgdb_trgt_ops); reinit_frame_cache(); if (from_tty) printf_filtered("No vmcore file now.\n"); } static const char * kgdb_trgt_extra_thread_info(struct target_ops *ops, struct thread_info *ti) { return (kgdb_thr_extra_thread_info(ptid_get_tid(ti->ptid))); } static void kgdb_trgt_files_info(struct target_ops *target) { printf_filtered ("\t`%s', ", vmcore); wrap_here (" "); printf_filtered ("file type %s.\n", "FreeBSD kernel vmcore"); } static void kgdb_trgt_update_thread_list(struct target_ops *ops) { /* * XXX: We should probably rescan the thread list here and update * it if there are any changes. One nit though is that we'd have * to detect exited threads. */ gdb_assert(kvm != NULL); #if 0 prune_threads(); #endif #if 0 struct target_ops *tb; if (kvm != NULL) return; tb = find_target_beneath(ops); if (tb->to_update_thread_list != NULL) tb->to_update_thread_list(tb); #endif } static const char * kgdb_trgt_pid_to_str(struct target_ops *ops, ptid_t ptid) { static char buf[33]; snprintf(buf, sizeof(buf), "Thread %ld", ptid_get_tid(ptid)); return (buf); } static int kgdb_trgt_thread_alive(struct target_ops *ops, ptid_t ptid) { return (kgdb_thr_lookup_tid(ptid_get_tid(ptid)) != NULL); } static void kgdb_trgt_fetch_registers(struct target_ops *tops, struct regcache *regcache, int regnum) { struct fbsd_vmcore_ops *ops = (struct fbsd_vmcore_ops *) gdbarch_data (target_gdbarch(), fbsd_vmcore_data); struct kthr *kt; if (ops->supply_pcb == NULL) return; kt = kgdb_thr_lookup_tid(ptid_get_tid(inferior_ptid)); if (kt == NULL) return; ops->supply_pcb(regcache, kt->pcb); } static enum target_xfer_status kgdb_trgt_xfer_partial(struct target_ops *ops, enum target_object object, const char *annex, gdb_byte *readbuf, const gdb_byte *writebuf, ULONGEST offset, ULONGEST len, ULONGEST *xfered_len) { ssize_t nbytes; gdb_assert(kvm != NULL); switch (object) { case TARGET_OBJECT_MEMORY: nbytes = len; if (readbuf != NULL) #ifdef HAVE_KVM_OPEN2 nbytes = kvm_read2(kvm, offset, readbuf, len); #else nbytes = kvm_read(kvm, offset, readbuf, len); #endif if (writebuf != NULL && len > 0) nbytes = kvm_write(kvm, offset, writebuf, len); if (nbytes < 0) return TARGET_XFER_E_IO; if (nbytes == 0) return TARGET_XFER_EOF; *xfered_len = nbytes; return TARGET_XFER_OK; default: return TARGET_XFER_E_IO; } } static int kgdb_trgt_insert_breakpoint(struct target_ops *ops, struct gdbarch *gdbarch, struct bp_target_info *bp_tgt) { return 0; } static int kgdb_trgt_remove_breakpoint(struct target_ops *ops, struct gdbarch *gdbarch, struct bp_target_info *bp_tgt, enum remove_bp_reason reason) { return 0; } static void kgdb_switch_to_thread(int tid) { char buf[16]; int thread_id; thread_id = ptid_to_global_thread_id(fbsd_vmcore_ptid(tid)); if (thread_id == 0) error ("invalid tid"); snprintf(buf, sizeof(buf), "%d", thread_id); gdb_thread_select(current_uiout, buf, NULL); } static void kgdb_set_proc_cmd (char *arg, int from_tty) { CORE_ADDR addr; struct kthr *thr; if (!arg) error_no_arg ("proc address for the new context"); if (kvm == NULL) error ("only supported for core file target"); addr = parse_and_eval_address (arg); if (addr < kernstart) { thr = kgdb_thr_lookup_pid((int)addr); if (thr == NULL) error ("invalid pid"); } else { thr = kgdb_thr_lookup_paddr(addr); if (thr == NULL) error("invalid proc address"); } kgdb_switch_to_thread(thr->tid); } static void kgdb_set_tid_cmd (char *arg, int from_tty) { CORE_ADDR addr; struct kthr *thr; if (!arg) error_no_arg ("TID or thread address for the new context"); addr = (CORE_ADDR) parse_and_eval_address (arg); if (kvm != NULL && addr >= kernstart) { thr = kgdb_thr_lookup_taddr(addr); if (thr == NULL) error("invalid thread address"); addr = thr->tid; } kgdb_switch_to_thread(addr); } static int kgdb_trgt_return_one(struct target_ops *ops) { return 1; } void _initialize_kgdb_target(void); void _initialize_kgdb_target(void) { kgdb_trgt_ops.to_magic = OPS_MAGIC; kgdb_trgt_ops.to_shortname = "vmcore"; kgdb_trgt_ops.to_longname = "kernel core dump file"; kgdb_trgt_ops.to_doc = "Use a vmcore file as a target. Specify the filename of the vmcore file."; kgdb_trgt_ops.to_stratum = process_stratum; kgdb_trgt_ops.to_has_memory = kgdb_trgt_return_one; kgdb_trgt_ops.to_has_registers = kgdb_trgt_return_one; kgdb_trgt_ops.to_has_stack = kgdb_trgt_return_one; kgdb_trgt_ops.to_open = kgdb_trgt_open; kgdb_trgt_ops.to_close = kgdb_trgt_close; kgdb_trgt_ops.to_detach = kgdb_trgt_detach; kgdb_trgt_ops.to_extra_thread_info = kgdb_trgt_extra_thread_info; kgdb_trgt_ops.to_fetch_registers = kgdb_trgt_fetch_registers; kgdb_trgt_ops.to_files_info = kgdb_trgt_files_info; kgdb_trgt_ops.to_update_thread_list = kgdb_trgt_update_thread_list; kgdb_trgt_ops.to_pid_to_str = kgdb_trgt_pid_to_str; kgdb_trgt_ops.to_thread_alive = kgdb_trgt_thread_alive; kgdb_trgt_ops.to_xfer_partial = kgdb_trgt_xfer_partial; kgdb_trgt_ops.to_insert_breakpoint = kgdb_trgt_insert_breakpoint; kgdb_trgt_ops.to_remove_breakpoint = kgdb_trgt_remove_breakpoint; add_target(&kgdb_trgt_ops); fbsd_vmcore_data = gdbarch_data_register_pre_init(fbsd_vmcore_init); add_com ("proc", class_obscure, kgdb_set_proc_cmd, "Set current process context"); add_com ("tid", class_obscure, kgdb_set_tid_cmd, "Set current thread context"); } CORE_ADDR kgdb_trgt_stop_pcb(u_int cpuid) { if (stoppcbs == 0 || pcb_size == 0) return 0; return (stoppcbs + pcb_size * cpuid); } Index: head/devel/gdb/files/patch-aarch64-fbsd =================================================================== --- head/devel/gdb/files/patch-aarch64-fbsd (nonexistent) +++ head/devel/gdb/files/patch-aarch64-fbsd (revision 448627) @@ -0,0 +1,470 @@ +diff --git gdb/Makefile.in gdb/Makefile.in +index 1d2dbaf3f7..d8e2b49523 100644 +--- gdb/Makefile.in ++++ gdb/Makefile.in +@@ -745,6 +745,7 @@ TARGET_OBS = @TARGET_OBS@ + # All target-dependent objects files that require 64-bit CORE_ADDR + # (used with --enable-targets=all --enable-64-bit-bfd). + ALL_64_TARGET_OBS = \ ++ aarch64-fbsd-tdep.o \ + aarch64-insn.o \ + aarch64-linux-tdep.o \ + aarch64-newlib-tdep.o \ +@@ -2458,6 +2459,8 @@ force_update: + MAKEOVERRIDES = + + ALLDEPFILES = \ ++ aarch64-fbsd-nat.c \ ++ aarch64-fbsd-tdep.c \ + aarch64-linux-nat.c \ + aarch64-linux-tdep.c \ + aarch64-newlib-tdep.c \ +diff --git gdb/aarch64-fbsd-nat.c gdb/aarch64-fbsd-nat.c +new file mode 100644 +index 0000000000..f7855b9c0b +--- /dev/null ++++ gdb/aarch64-fbsd-nat.c +@@ -0,0 +1,133 @@ ++/* Native-dependent code for FreeBSD/aarch64. ++ ++ Copyright (C) 2017 Free Software Foundation, Inc. ++ ++ This file is part of GDB. ++ ++ This program is free software; you can redistribute it and/or modify ++ it under the terms of the GNU General Public License as published by ++ the Free Software Foundation; either version 3 of the License, or ++ (at your option) any later version. ++ ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU General Public License for more details. ++ ++ You should have received a copy of the GNU General Public License ++ along with this program. If not, see . */ ++ ++#include "defs.h" ++#include "target.h" ++ ++#include ++#include ++#include ++ ++#include "fbsd-nat.h" ++#include "aarch64-tdep.h" ++#include "aarch64-fbsd-tdep.h" ++#include "inf-ptrace.h" ++ ++/* Determine if PT_GETREGS fetches REGNUM. */ ++ ++static bool ++getregs_supplies (struct gdbarch *gdbarch, int regnum) ++{ ++ return (regnum >= AARCH64_X0_REGNUM && regnum <= AARCH64_CPSR_REGNUM); ++} ++ ++/* Determine if PT_GETFPREGS fetches REGNUM. */ ++ ++static bool ++getfpregs_supplies (struct gdbarch *gdbarch, int regnum) ++{ ++ return (regnum >= AARCH64_V0_REGNUM && regnum <= AARCH64_FPCR_REGNUM); ++} ++ ++/* Fetch register REGNUM from the inferior. If REGNUM is -1, do this ++ for all registers. */ ++ ++static void ++aarch64_fbsd_fetch_inferior_registers (struct target_ops *ops, ++ struct regcache *regcache, int regnum) ++{ ++ pid_t pid = get_ptrace_pid (regcache_get_ptid (regcache)); ++ ++ struct gdbarch *gdbarch = get_regcache_arch (regcache); ++ if (regnum == -1 || getregs_supplies (gdbarch, regnum)) ++ { ++ struct reg regs; ++ ++ if (ptrace (PT_GETREGS, pid, (PTRACE_TYPE_ARG3) ®s, 0) == -1) ++ perror_with_name (_("Couldn't get registers")); ++ ++ regcache_supply_regset (&aarch64_fbsd_gregset, regcache, regnum, ®s, ++ sizeof (regs)); ++ } ++ ++ if (regnum == -1 || getfpregs_supplies (gdbarch, regnum)) ++ { ++ struct fpreg fpregs; ++ ++ if (ptrace (PT_GETFPREGS, pid, (PTRACE_TYPE_ARG3) &fpregs, 0) == -1) ++ perror_with_name (_("Couldn't get floating point status")); ++ ++ regcache_supply_regset (&aarch64_fbsd_fpregset, regcache, regnum, &fpregs, ++ sizeof (fpregs)); ++ } ++} ++ ++/* Store register REGNUM back into the inferior. If REGNUM is -1, do ++ this for all registers. */ ++ ++static void ++aarch64_fbsd_store_inferior_registers (struct target_ops *ops, ++ struct regcache *regcache, int regnum) ++{ ++ pid_t pid = get_ptrace_pid (regcache_get_ptid (regcache)); ++ ++ struct gdbarch *gdbarch = get_regcache_arch (regcache); ++ if (regnum == -1 || getregs_supplies (gdbarch, regnum)) ++ { ++ struct reg regs; ++ ++ if (ptrace (PT_GETREGS, pid, (PTRACE_TYPE_ARG3) ®s, 0) == -1) ++ perror_with_name (_("Couldn't get registers")); ++ ++ regcache_collect_regset (&aarch64_fbsd_gregset, regcache, regnum, ®s, ++ sizeof (regs)); ++ ++ if (ptrace (PT_SETREGS, pid, (PTRACE_TYPE_ARG3) ®s, 0) == -1) ++ perror_with_name (_("Couldn't write registers")); ++ } ++ ++ if (regnum == -1 || getfpregs_supplies (gdbarch, regnum)) ++ { ++ struct fpreg fpregs; ++ ++ if (ptrace (PT_GETFPREGS, pid, (PTRACE_TYPE_ARG3) &fpregs, 0) == -1) ++ perror_with_name (_("Couldn't get floating point status")); ++ ++ regcache_collect_regset (&aarch64_fbsd_fpregset, regcache, regnum, &fpregs, ++ sizeof (fpregs)); ++ ++ if (ptrace (PT_SETFPREGS, pid, (PTRACE_TYPE_ARG3) &fpregs, 0) == -1) ++ perror_with_name (_("Couldn't write floating point status")); ++ } ++} ++ ++ ++/* Provide a prototype to silence -Wmissing-prototypes. */ ++void _initialize_aarch64_fbsd_nat (void); ++ ++void ++_initialize_aarch64_fbsd_nat (void) ++{ ++ struct target_ops *t; ++ ++ t = inf_ptrace_target (); ++ t->to_fetch_registers = aarch64_fbsd_fetch_inferior_registers; ++ t->to_store_registers = aarch64_fbsd_store_inferior_registers; ++ fbsd_nat_add_target (t); ++} +diff --git gdb/aarch64-fbsd-tdep.c gdb/aarch64-fbsd-tdep.c +new file mode 100644 +index 0000000000..f8ce627282 +--- /dev/null ++++ gdb/aarch64-fbsd-tdep.c +@@ -0,0 +1,208 @@ ++/* Target-dependent code for FreeBSD/aarch64. ++ ++ Copyright (C) 2017 Free Software Foundation, Inc. ++ ++ This file is part of GDB. ++ ++ This program is free software; you can redistribute it and/or modify ++ it under the terms of the GNU General Public License as published by ++ the Free Software Foundation; either version 3 of the License, or ++ (at your option) any later version. ++ ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU General Public License for more details. ++ ++ You should have received a copy of the GNU General Public License ++ along with this program. If not, see . */ ++ ++#include "defs.h" ++ ++#include "gdbarch.h" ++#include "fbsd-tdep.h" ++#include "aarch64-tdep.h" ++#include "aarch64-fbsd-tdep.h" ++#include "osabi.h" ++#include "solib-svr4.h" ++#include "target.h" ++#include "tramp-frame.h" ++#include "trad-frame.h" ++ ++/* In a signal frame, sp points to a 'struct sigframe' which is ++ defined as: ++ ++ struct sigframe { ++ siginfo_t sf_si; ++ ucontext_t sf_uc; ++ }; ++ ++ ucontext_t is defined as: ++ ++ struct __ucontext { ++ sigset_t uc_sigmask; ++ mcontext_t uc_mcontext; ++ ... ++ }; ++ ++ The mcontext_t contains the general purpose register set followed ++ by the floating point register set. The floating point register ++ set is only valid if the _MC_FP_VALID flag is set in mc_flags. */ ++ ++#define AARCH64_MCONTEXT_REG_SIZE 8 ++#define AARCH64_MCONTEXT_FPREG_SIZE 16 ++#define AARCH64_SIGFRAME_UCONTEXT_OFFSET 80 ++#define AARCH64_UCONTEXT_MCONTEXT_OFFSET 16 ++#define AARCH64_MCONTEXT_FPREGS_OFFSET 272 ++#define AARCH64_MCONTEXT_FLAGS_OFFSET 800 ++#define AARCH64_MCONTEXT_FLAG_FP_VALID 0x1 ++ ++/* Implement the "init" method of struct tramp_frame. */ ++ ++static void ++aarch64_fbsd_sigframe_init (const struct tramp_frame *self, ++ struct frame_info *this_frame, ++ struct trad_frame_cache *this_cache, ++ CORE_ADDR func) ++{ ++ struct gdbarch *gdbarch = get_frame_arch (this_frame); ++ enum bfd_endian byte_order = gdbarch_byte_order (gdbarch); ++ CORE_ADDR sp = get_frame_register_unsigned (this_frame, AARCH64_SP_REGNUM); ++ CORE_ADDR mcontext_addr = ++ sp ++ + AARCH64_SIGFRAME_UCONTEXT_OFFSET ++ + AARCH64_UCONTEXT_MCONTEXT_OFFSET; ++ gdb_byte buf[4]; ++ int i; ++ ++ for (i = 0; i < 30; i++) ++ { ++ trad_frame_set_reg_addr (this_cache, ++ AARCH64_X0_REGNUM + i, ++ mcontext_addr + i * AARCH64_MCONTEXT_REG_SIZE); ++ } ++ trad_frame_set_reg_addr (this_cache, AARCH64_LR_REGNUM, ++ mcontext_addr + 30 * AARCH64_MCONTEXT_REG_SIZE); ++ trad_frame_set_reg_addr (this_cache, AARCH64_SP_REGNUM, ++ mcontext_addr + 31 * AARCH64_MCONTEXT_REG_SIZE); ++ trad_frame_set_reg_addr (this_cache, AARCH64_PC_REGNUM, ++ mcontext_addr + 32 * AARCH64_MCONTEXT_REG_SIZE); ++ trad_frame_set_reg_addr (this_cache, AARCH64_CPSR_REGNUM, ++ mcontext_addr + 33 * AARCH64_MCONTEXT_REG_SIZE); ++ ++ if (target_read_memory (mcontext_addr + AARCH64_MCONTEXT_FLAGS_OFFSET, buf, ++ 4) == 0 ++ && (extract_unsigned_integer (buf, 4, byte_order) ++ & AARCH64_MCONTEXT_FLAG_FP_VALID)) ++ { ++ for (i = 0; i < 32; i++) ++ { ++ trad_frame_set_reg_addr (this_cache, AARCH64_V0_REGNUM + i, ++ mcontext_addr ++ + AARCH64_MCONTEXT_FPREGS_OFFSET ++ + i * AARCH64_MCONTEXT_FPREG_SIZE); ++ } ++ trad_frame_set_reg_addr (this_cache, AARCH64_FPSR_REGNUM, ++ mcontext_addr + AARCH64_MCONTEXT_FPREGS_OFFSET ++ + 32 * AARCH64_MCONTEXT_FPREG_SIZE); ++ trad_frame_set_reg_addr (this_cache, AARCH64_FPCR_REGNUM, ++ mcontext_addr + AARCH64_MCONTEXT_FPREGS_OFFSET ++ + 32 * AARCH64_MCONTEXT_FPREG_SIZE + 4); ++ } ++ ++ trad_frame_set_id (this_cache, frame_id_build (sp, func)); ++} ++ ++static const struct tramp_frame aarch64_fbsd_sigframe = ++{ ++ SIGTRAMP_FRAME, ++ 4, ++ { ++ {0x910003e0, -1}, /* mov x0, sp */ ++ {0x91014000, -1}, /* add x0, x0, #SF_UC */ ++ {0xd2803428, -1}, /* mov x8, #SYS_sigreturn */ ++ {0xd4000001, -1}, /* svc 0x0 */ ++ {TRAMP_SENTINEL_INSN, -1} ++ }, ++ aarch64_fbsd_sigframe_init ++}; ++ ++/* Register maps. */ ++ ++static const struct regcache_map_entry aarch64_fbsd_gregmap[] = ++ { ++ { 30, AARCH64_X0_REGNUM, 8 }, /* x0 ... x29 */ ++ { 1, AARCH64_LR_REGNUM, 8 }, ++ { 1, AARCH64_SP_REGNUM, 8 }, ++ { 1, AARCH64_PC_REGNUM, 8 }, ++ { 1, AARCH64_CPSR_REGNUM, 4 }, ++ { 0 } ++ }; ++ ++static const struct regcache_map_entry aarch64_fbsd_fpregmap[] = ++ { ++ { 32, AARCH64_V0_REGNUM, 16 }, /* v0 ... v31 */ ++ { 1, AARCH64_FPSR_REGNUM, 4 }, ++ { 1, AARCH64_FPCR_REGNUM, 4 }, ++ { 0 } ++ }; ++ ++/* Register set definitions. */ ++ ++const struct regset aarch64_fbsd_gregset = ++ { ++ aarch64_fbsd_gregmap, ++ regcache_supply_regset, regcache_collect_regset ++ }; ++ ++const struct regset aarch64_fbsd_fpregset = ++ { ++ aarch64_fbsd_fpregmap, ++ regcache_supply_regset, regcache_collect_regset ++ }; ++ ++/* Implement the "regset_from_core_section" gdbarch method. */ ++ ++static void ++aarch64_fbsd_iterate_over_regset_sections (struct gdbarch *gdbarch, ++ iterate_over_regset_sections_cb *cb, ++ void *cb_data, ++ const struct regcache *regcache) ++{ ++ cb (".reg", AARCH64_FBSD_SIZEOF_GREGSET, &aarch64_fbsd_gregset, ++ NULL, cb_data); ++ cb (".reg2", AARCH64_FBSD_SIZEOF_FPREGSET, &aarch64_fbsd_fpregset, ++ NULL, cb_data); ++} ++ ++/* Implement the 'init_osabi' method of struct gdb_osabi_handler. */ ++ ++static void ++aarch64_fbsd_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch) ++{ ++ struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch); ++ ++ /* Generic FreeBSD support. */ ++ fbsd_init_abi (info, gdbarch); ++ ++ set_solib_svr4_fetch_link_map_offsets (gdbarch, ++ svr4_lp64_fetch_link_map_offsets); ++ ++ tramp_frame_prepend_unwinder (gdbarch, &aarch64_fbsd_sigframe); ++ ++ /* Enable longjmp. */ ++ tdep->jb_pc = 13; ++ ++ set_gdbarch_iterate_over_regset_sections ++ (gdbarch, aarch64_fbsd_iterate_over_regset_sections); ++} ++ ++/* Provide a prototype to silence -Wmissing-prototypes. */ ++extern initialize_file_ftype _initialize_aarch64_fbsd_tdep; ++ ++void ++_initialize_aarch64_fbsd_tdep (void) ++{ ++ gdbarch_register_osabi (bfd_arch_aarch64, 0, GDB_OSABI_FREEBSD, ++ aarch64_fbsd_init_abi); ++} +diff --git gdb/aarch64-fbsd-tdep.h gdb/aarch64-fbsd-tdep.h +new file mode 100644 +index 0000000000..0f66dd3925 +--- /dev/null ++++ gdb/aarch64-fbsd-tdep.h +@@ -0,0 +1,33 @@ ++/* FreeBSD/aarch64 target support, prototypes. ++ ++ Copyright (C) 2017 Free Software Foundation, Inc. ++ ++ This file is part of GDB. ++ ++ This program is free software; you can redistribute it and/or modify ++ it under the terms of the GNU General Public License as published by ++ the Free Software Foundation; either version 3 of the License, or ++ (at your option) any later version. ++ ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU General Public License for more details. ++ ++ You should have received a copy of the GNU General Public License ++ along with this program. If not, see . */ ++ ++#include "regset.h" ++ ++/* The general-purpose regset consists of 30 X registers, plus LR, SP, ++ ELR, and SPSR registers. SPSR is 32 bits but the structure is ++ passed to 64 bit alignment. */ ++#define AARCH64_FBSD_SIZEOF_GREGSET (34 * X_REGISTER_SIZE) ++ ++/* The fp regset consists of 32 V registers, plus FPSR and FPCR which ++ are 4 bytes wide each, and the whole structure is padded to 128 bit ++ alignment. */ ++#define AARCH64_FBSD_SIZEOF_FPREGSET (33 * V_REGISTER_SIZE) ++ ++extern const struct regset aarch64_fbsd_gregset; ++extern const struct regset aarch64_fbsd_fpregset; +diff --git gdb/config/aarch64/fbsd.mh gdb/config/aarch64/fbsd.mh +new file mode 100644 +index 0000000000..4171987bc9 +--- /dev/null ++++ gdb/config/aarch64/fbsd.mh +@@ -0,0 +1,23 @@ ++# Host: Freebsd/aarch64 ++# ++# Copyright (C) 2017 Free Software Foundation, Inc. ++# ++# This file is part of GDB. ++# ++# This program is free software; you can redistribute it and/or modify ++# it under the terms of the GNU General Public License as published by ++# the Free Software Foundation; either version 3 of the License, or ++# (at your option) any later version. ++# ++# This program is distributed in the hope that it will be useful, ++# but WITHOUT ANY WARRANTY; without even the implied warranty of ++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++# GNU General Public License for more details. ++# ++# You should have received a copy of the GNU General Public License ++# along with this program. If not, see . ++ ++NATDEPFILES= inf-ptrace.o fork-child.o aarch64-fbsd-nat.o fbsd-nat.o ++HAVE_NATIVE_GCORE_HOST = 1 ++ ++LOADLIBES= -lkvm +diff --git gdb/configure.host gdb/configure.host +index d74fd04934..304675f137 100644 +--- gdb/configure.host ++++ gdb/configure.host +@@ -84,6 +84,7 @@ case "${host}" in + *-*-darwin*) gdb_host=darwin ;; + + aarch64*-*-linux*) gdb_host=linux ;; ++aarch64*-*-freebsd*) gdb_host=fbsd ;; + + alpha*-*-linux*) gdb_host=alpha-linux ;; + alpha*-*-netbsd* | alpha*-*-knetbsd*-gnu) +diff --git gdb/configure.tgt gdb/configure.tgt +index fdcb7b1d69..f72a0dbbc1 100644 +--- gdb/configure.tgt ++++ gdb/configure.tgt +@@ -44,6 +44,11 @@ aarch64*-*-elf | aarch64*-*-rtems*) + gdb_target_obs="aarch64-tdep.o aarch64-newlib-tdep.o aarch64-insn.o" + ;; + ++aarch64*-*-freebsd*) ++ # Target: FreeBSD/aarch64 ++ gdb_target_obs="aarch64-tdep.o aarch64-fbsd-tdep.o aarch64-insn.o" ++ ;; ++ + aarch64*-*-linux*) + # Target: AArch64 linux + gdb_target_obs="aarch64-tdep.o aarch64-linux-tdep.o aarch64-insn.o \ Property changes on: head/devel/gdb/files/patch-aarch64-fbsd ___________________________________________________________________ Added: fbsd:nokeywords ## -0,0 +1 ## +yes \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property