Changeset View
Changeset View
Standalone View
Standalone View
head/devel/gdb/files/extrapatch-kgdb
diff --git gdb/Makefile.in gdb/Makefile.in | diff --git gdb/Makefile.in gdb/Makefile.in | ||||
index 5614cc3386..b9acc63c3f 100644 | index c3e074b21f..8d026a98cb 100644 | ||||
--- gdb/Makefile.in | --- gdb/Makefile.in | ||||
+++ gdb/Makefile.in | +++ gdb/Makefile.in | ||||
@@ -230,7 +230,8 @@ INCGNU = -I$(srcdir)/gnulib/import -I$(GNULIB_BUILDDIR)/import | @@ -648,6 +648,7 @@ TARGET_OBS = @TARGET_OBS@ | ||||
# 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 | |||||
@@ -632,6 +633,7 @@ TARGET_OBS = @TARGET_OBS@ | |||||
# All target-dependent objects files that require 64-bit CORE_ADDR | # All target-dependent objects files that require 64-bit CORE_ADDR | ||||
# (used with --enable-targets=all --enable-64-bit-bfd). | # (used with --enable-targets=all --enable-64-bit-bfd). | ||||
ALL_64_TARGET_OBS = \ | ALL_64_TARGET_OBS = \ | ||||
+ aarch64-fbsd-kern.o \ | + aarch64-fbsd-kern.o \ | ||||
aarch64-fbsd-tdep.o \ | aarch64-fbsd-tdep.o \ | ||||
aarch64-linux-tdep.o \ | aarch64-linux-tdep.o \ | ||||
aarch64-newlib-tdep.o \ | aarch64-newlib-tdep.o \ | ||||
@@ -646,6 +648,7 @@ ALL_64_TARGET_OBS = \ | @@ -662,6 +663,7 @@ ALL_64_TARGET_OBS = \ | ||||
amd64-darwin-tdep.o \ | amd64-darwin-tdep.o \ | ||||
amd64-dicos-tdep.o \ | amd64-dicos-tdep.o \ | ||||
amd64-fbsd-tdep.o \ | amd64-fbsd-tdep.o \ | ||||
+ amd64fbsd-kern.o \ | + amd64fbsd-kern.o \ | ||||
amd64-linux-tdep.o \ | amd64-linux-tdep.o \ | ||||
amd64-nbsd-tdep.o \ | amd64-nbsd-tdep.o \ | ||||
amd64-obsd-tdep.o \ | amd64-obsd-tdep.o \ | ||||
@@ -660,6 +663,7 @@ ALL_64_TARGET_OBS = \ | @@ -676,6 +678,7 @@ ALL_64_TARGET_OBS = \ | ||||
ia64-vms-tdep.o \ | ia64-vms-tdep.o \ | ||||
mips64-obsd-tdep.o \ | mips64-obsd-tdep.o \ | ||||
sparc64-fbsd-tdep.o \ | sparc64-fbsd-tdep.o \ | ||||
+ sparc64fbsd-kern.o \ | + sparc64fbsd-kern.o \ | ||||
sparc64-linux-tdep.o \ | sparc64-linux-tdep.o \ | ||||
sparc64-nbsd-tdep.o \ | sparc64-nbsd-tdep.o \ | ||||
sparc64-obsd-tdep.o \ | sparc64-obsd-tdep.o \ | ||||
@@ -676,6 +680,7 @@ ALL_TARGET_OBS = \ | @@ -694,6 +697,7 @@ ALL_TARGET_OBS = \ | ||||
arch/ppc-linux-common.o \ | arch/ppc-linux-common.o \ | ||||
arch/riscv.o \ | arch/riscv.o \ | ||||
arm-bsd-tdep.o \ | arm-bsd-tdep.o \ | ||||
+ arm-fbsd-kern.o \ | + arm-fbsd-kern.o \ | ||||
arm-fbsd-tdep.o \ | arm-fbsd-tdep.o \ | ||||
arm-linux-tdep.o \ | arm-linux-tdep.o \ | ||||
arm-nbsd-tdep.o \ | arm-nbsd-tdep.o \ | ||||
@@ -693,6 +698,8 @@ ALL_TARGET_OBS = \ | @@ -711,6 +715,8 @@ ALL_TARGET_OBS = \ | ||||
csky-linux-tdep.o \ | csky-linux-tdep.o \ | ||||
csky-tdep.o \ | csky-tdep.o \ | ||||
dicos-tdep.o \ | dicos-tdep.o \ | ||||
+ fbsd-kld.o \ | + fbsd-kld.o \ | ||||
+ fbsd-kthr.o \ | + fbsd-kthr.o \ | ||||
fbsd-tdep.o \ | fbsd-tdep.o \ | ||||
frv-linux-tdep.o \ | frv-linux-tdep.o \ | ||||
frv-tdep.o \ | frv-tdep.o \ | ||||
@@ -709,6 +716,7 @@ ALL_TARGET_OBS = \ | @@ -727,6 +733,7 @@ ALL_TARGET_OBS = \ | ||||
i386-darwin-tdep.o \ | i386-darwin-tdep.o \ | ||||
i386-dicos-tdep.o \ | i386-dicos-tdep.o \ | ||||
i386-fbsd-tdep.o \ | i386-fbsd-tdep.o \ | ||||
+ i386fbsd-kern.o \ | + i386fbsd-kern.o \ | ||||
i386-gnu-tdep.o \ | i386-gnu-tdep.o \ | ||||
i386-go32-tdep.o \ | i386-go32-tdep.o \ | ||||
i386-linux-tdep.o \ | i386-linux-tdep.o \ | ||||
@@ -732,6 +740,7 @@ ALL_TARGET_OBS = \ | @@ -750,6 +757,7 @@ ALL_TARGET_OBS = \ | ||||
mep-tdep.o \ | mep-tdep.o \ | ||||
microblaze-linux-tdep.o \ | microblaze-linux-tdep.o \ | ||||
microblaze-tdep.o \ | microblaze-tdep.o \ | ||||
+ mipsfbsd-kern.o \ | + mipsfbsd-kern.o \ | ||||
mips-fbsd-tdep.o \ | mips-fbsd-tdep.o \ | ||||
mips-linux-tdep.o \ | mips-linux-tdep.o \ | ||||
mips-nbsd-tdep.o \ | mips-nbsd-tdep.o \ | ||||
@@ -750,6 +759,7 @@ ALL_TARGET_OBS = \ | @@ -768,6 +776,7 @@ ALL_TARGET_OBS = \ | ||||
or1k-linux-tdep.o \ | or1k-linux-tdep.o \ | ||||
or1k-tdep.o \ | or1k-tdep.o \ | ||||
ppc-fbsd-tdep.o \ | ppc-fbsd-tdep.o \ | ||||
+ ppcfbsd-kern.o \ | + ppcfbsd-kern.o \ | ||||
ppc-linux-tdep.o \ | ppc-linux-tdep.o \ | ||||
ppc-nbsd-tdep.o \ | ppc-nbsd-tdep.o \ | ||||
ppc-obsd-tdep.o \ | ppc-obsd-tdep.o \ | ||||
@@ -757,6 +767,7 @@ ALL_TARGET_OBS = \ | @@ -775,6 +784,7 @@ ALL_TARGET_OBS = \ | ||||
ppc-sysv-tdep.o \ | ppc-sysv-tdep.o \ | ||||
ppc64-tdep.o \ | ppc64-tdep.o \ | ||||
ravenscar-thread.o \ | ravenscar-thread.o \ | ||||
+ riscv-fbsd-kern.o \ | + riscv-fbsd-kern.o \ | ||||
riscv-fbsd-tdep.o \ | riscv-fbsd-tdep.o \ | ||||
riscv-linux-tdep.o \ | riscv-linux-tdep.o \ | ||||
riscv-tdep.o \ | riscv-tdep.o \ | ||||
@@ -1629,7 +1640,7 @@ generated_files = \ | @@ -1648,7 +1658,7 @@ generated_files = \ | ||||
# Flags needed to compile Python code | # Flags needed to compile Python code | ||||
PYTHON_CFLAGS = @PYTHON_CFLAGS@ | PYTHON_CFLAGS = @PYTHON_CFLAGS@ | ||||
-all: gdb$(EXEEXT) $(CONFIG_ALL) gdb-gdb.py gdb-gdb.gdb | -all: gdb$(EXEEXT) $(CONFIG_ALL) gdb-gdb.py gdb-gdb.gdb | ||||
+all: gdb$(EXEEXT) kgdb$(EXEEXT) $(CONFIG_ALL) gdb-gdb.py gdb-gdb.gdb | +all: gdb$(EXEEXT) kgdb$(EXEEXT) $(CONFIG_ALL) gdb-gdb.py gdb-gdb.gdb | ||||
@$(MAKE) $(FLAGS_TO_PASS) DO=all "DODIRS=`echo $(SUBDIRS) | sed 's/testsuite//'`" subdir_do | @$(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. | # Rule for compiling .c files in the top-level gdb directory. | ||||
@@ -1894,6 +1905,12 @@ ifneq ($(CODESIGN_CERT),) | @@ -1913,6 +1923,12 @@ ifneq ($(CODESIGN_CERT),) | ||||
$(ECHO_SIGN) $(CODESIGN) -s $(CODESIGN_CERT) gdb$(EXEEXT) | $(ECHO_SIGN) $(CODESIGN) -s $(CODESIGN_CERT) gdb$(EXEEXT) | ||||
endif | endif | ||||
+kgdb$(EXEEXT): kgdb-main.o $(LIBGDB_OBS) $(ADD_DEPS) $(CDEPS) $(TDEPLIBS) | +kgdb$(EXEEXT): kgdb-main.o $(LIBGDB_OBS) $(ADD_DEPS) $(CDEPS) $(TDEPLIBS) | ||||
+ $(SILENCE) rm -f kgdb$(EXEEXT) | + $(SILENCE) rm -f kgdb$(EXEEXT) | ||||
+ $(ECHO_CXXLD) $(CC_LD) $(INTERNAL_LDFLAGS) $(WIN32LDAPP) \ | + $(ECHO_CXXLD) $(CC_LD) $(INTERNAL_LDFLAGS) $(WIN32LDAPP) \ | ||||
+ -o kgdb$(EXEEXT) kgdb-main.o $(LIBGDB_OBS) \ | + -o kgdb$(EXEEXT) kgdb-main.o $(LIBGDB_OBS) \ | ||||
+ $(TDEPLIBS) $(TUI_LIBRARY) $(CLIBS) $(LOADLIBES) | + $(TDEPLIBS) $(TUI_LIBRARY) $(CLIBS) $(LOADLIBES) | ||||
+ | + | ||||
# Convenience rule to handle recursion. | # Convenience rule to handle recursion. | ||||
$(LIBGNU) $(GNULIB_H): all-lib | .PHONY: all-data-directory | ||||
all-lib: $(GNULIB_BUILDDIR)/Makefile | all-data-directory: data-directory/Makefile | ||||
@@ -1940,6 +1957,7 @@ clean mostlyclean: $(CONFIG_CLEAN) | @@ -1953,6 +1969,7 @@ clean mostlyclean: $(CONFIG_CLEAN) | ||||
rm -f init.c stamp-init version.c stamp-version | rm -f init.c stamp-init version.c stamp-version | ||||
rm -f gdb$(EXEEXT) core make.log | rm -f gdb$(EXEEXT) core make.log | ||||
rm -f gdb[0-9]$(EXEEXT) | rm -f gdb[0-9]$(EXEEXT) | ||||
+ rm -f kgdb$(EXEEXT) | + rm -f kgdb$(EXEEXT) | ||||
rm -f test-cp-name-parser$(EXEEXT) | rm -f test-cp-name-parser$(EXEEXT) | ||||
rm -f xml-builtin.c stamp-xml | rm -f xml-builtin.c stamp-xml | ||||
rm -f $(DEPDIR)/* | rm -f $(DEPDIR)/* | ||||
@@ -2154,6 +2172,7 @@ force_update: | @@ -2152,6 +2169,7 @@ MAKEOVERRIDES = | ||||
MAKEOVERRIDES = | |||||
ALLDEPFILES = \ | ALLDEPFILES = \ | ||||
aarch32-tdep.c \ | |||||
+ aarch64-fbsd-kern.c \ | + aarch64-fbsd-kern.c \ | ||||
aarch64-fbsd-nat.c \ | aarch64-fbsd-nat.c \ | ||||
aarch64-fbsd-tdep.c \ | aarch64-fbsd-tdep.c \ | ||||
aarch64-linux-nat.c \ | aarch64-linux-nat.c \ | ||||
@@ -2173,6 +2192,7 @@ ALLDEPFILES = \ | @@ -2171,6 +2189,7 @@ ALLDEPFILES = \ | ||||
amd64-bsd-nat.c \ | amd64-bsd-nat.c \ | ||||
amd64-darwin-tdep.c \ | amd64-darwin-tdep.c \ | ||||
amd64-dicos-tdep.c \ | amd64-dicos-tdep.c \ | ||||
+ amd64fbsd-kern.c \ | + amd64fbsd-kern.c \ | ||||
amd64-fbsd-nat.c \ | amd64-fbsd-nat.c \ | ||||
amd64-fbsd-tdep.c \ | amd64-fbsd-tdep.c \ | ||||
amd64-linux-nat.c \ | amd64-linux-nat.c \ | ||||
@@ -2187,6 +2207,7 @@ ALLDEPFILES = \ | @@ -2185,6 +2204,7 @@ ALLDEPFILES = \ | ||||
arc-tdep.c \ | arc-tdep.c \ | ||||
arm.c \ | arm.c \ | ||||
arm-bsd-tdep.c \ | arm-bsd-tdep.c \ | ||||
+ arm-fbsd-kern.c \ | + arm-fbsd-kern.c \ | ||||
arm-fbsd-nat.c \ | arm-fbsd-nat.c \ | ||||
arm-fbsd-tdep.c \ | arm-fbsd-tdep.c \ | ||||
arm-get-next-pcs.c \ | arm-get-next-pcs.c \ | ||||
@@ -2207,6 +2228,9 @@ ALLDEPFILES = \ | @@ -2205,6 +2225,9 @@ ALLDEPFILES = \ | ||||
csky-tdep.c \ | csky-tdep.c \ | ||||
darwin-nat.c \ | darwin-nat.c \ | ||||
dicos-tdep.c \ | dicos-tdep.c \ | ||||
+ fbsd-kld.c \ | + fbsd-kld.c \ | ||||
+ fbsd-kthr.c \ | + fbsd-kthr.c \ | ||||
+ fbsd-kvm.c \ | + fbsd-kvm.c \ | ||||
fbsd-nat.c \ | fbsd-nat.c \ | ||||
fbsd-tdep.c \ | fbsd-tdep.c \ | ||||
fork-child.c \ | fork-child.c \ | ||||
@@ -2228,6 +2252,7 @@ ALLDEPFILES = \ | @@ -2226,6 +2249,7 @@ ALLDEPFILES = \ | ||||
i386-darwin-nat.c \ | i386-darwin-nat.c \ | ||||
i386-darwin-tdep.c \ | i386-darwin-tdep.c \ | ||||
i386-dicos-tdep.c \ | i386-dicos-tdep.c \ | ||||
+ i386fbsd-kern.c \ | + i386fbsd-kern.c \ | ||||
i386-fbsd-nat.c \ | i386-fbsd-nat.c \ | ||||
i386-fbsd-tdep.c \ | i386-fbsd-tdep.c \ | ||||
i386-gnu-nat.c \ | i386-gnu-nat.c \ | ||||
@@ -2264,6 +2289,7 @@ ALLDEPFILES = \ | @@ -2262,6 +2286,7 @@ ALLDEPFILES = \ | ||||
microblaze-linux-tdep.c \ | microblaze-linux-tdep.c \ | ||||
microblaze-tdep.c \ | microblaze-tdep.c \ | ||||
mingw-hdep.c \ | mingw-hdep.c \ | ||||
+ mipsfbsd-kern.c \ | + mipsfbsd-kern.c \ | ||||
mips-fbsd-nat.c \ | mips-fbsd-nat.c \ | ||||
mips-fbsd-tdep.c \ | mips-fbsd-tdep.c \ | ||||
mips-linux-nat.c \ | mips-linux-nat.c \ | ||||
@@ -2283,6 +2309,7 @@ ALLDEPFILES = \ | @@ -2281,6 +2306,7 @@ ALLDEPFILES = \ | ||||
obsd-nat.c \ | obsd-nat.c \ | ||||
obsd-tdep.c \ | obsd-tdep.c \ | ||||
posix-hdep.c \ | posix-hdep.c \ | ||||
+ ppcfbsd-kern.c \ | + ppcfbsd-kern.c \ | ||||
ppc-fbsd-nat.c \ | ppc-fbsd-nat.c \ | ||||
ppc-fbsd-tdep.c \ | ppc-fbsd-tdep.c \ | ||||
ppc-linux-nat.c \ | ppc-linux-nat.c \ | ||||
@@ -2297,6 +2324,7 @@ ALLDEPFILES = \ | @@ -2295,6 +2321,7 @@ ALLDEPFILES = \ | ||||
procfs.c \ | procfs.c \ | ||||
ravenscar-thread.c \ | ravenscar-thread.c \ | ||||
remote-sim.c \ | remote-sim.c \ | ||||
+ riscv-fbsd-kern.c \ | + riscv-fbsd-kern.c \ | ||||
riscv-fbsd-nat.c \ | riscv-fbsd-nat.c \ | ||||
riscv-fbsd-tdep.c \ | riscv-fbsd-tdep.c \ | ||||
riscv-linux-nat.c \ | riscv-linux-nat.c \ | ||||
@@ -2333,6 +2361,7 @@ ALLDEPFILES = \ | @@ -2330,6 +2357,7 @@ ALLDEPFILES = \ | ||||
sparc-sol2-nat.c \ | sparc-sol2-nat.c \ | ||||
sparc-sol2-tdep.c \ | sparc-sol2-tdep.c \ | ||||
sparc-tdep.c \ | sparc-tdep.c \ | ||||
+ sparc64fbsd-kern.c \ | + sparc64fbsd-kern.c \ | ||||
sparc64-fbsd-nat.c \ | sparc64-fbsd-nat.c \ | ||||
sparc64-fbsd-tdep.c \ | sparc64-fbsd-tdep.c \ | ||||
sparc64-linux-nat.c \ | sparc64-linux-nat.c \ | ||||
@@ -2596,7 +2625,7 @@ endif | @@ -2588,7 +2616,7 @@ endif | ||||
# A list of all the objects we might care about in this build, for | # A list of all the objects we might care about in this build, for | ||||
# dependency tracking. | # dependency tracking. | ||||
-all_object_files = gdb.o $(LIBGDB_OBS) gdbtk-main.o \ | -all_object_files = gdb.o $(LIBGDB_OBS) gdbtk-main.o \ | ||||
+all_object_files = kgdb-main.o 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 | test-cp-name-parser.o | ||||
# All the .deps files to include. | # All the .deps files to include. | ||||
diff --git gdb/config.in gdb/config.in | diff --git gdb/config.in gdb/config.in | ||||
index ea907d2b56..1019e448c5 100644 | index cb886ba8e1..b8a937f6de 100644 | ||||
--- gdb/config.in | --- gdb/config.in | ||||
+++ gdb/config.in | +++ gdb/config.in | ||||
@@ -219,6 +219,12 @@ | @@ -218,6 +218,12 @@ | ||||
/* Define to 1 if your system has the kinfo_getvmmap function. */ | /* Define to 1 if your system has the kinfo_getvmmap function. */ | ||||
#undef HAVE_KINFO_GETVMMAP | #undef HAVE_KINFO_GETVMMAP | ||||
+/* Define to 1 if your system has the kvm_kerndisp function. */ | +/* Define to 1 if your system has the kvm_kerndisp function. */ | ||||
+#undef HAVE_KVM_DISP | +#undef HAVE_KVM_DISP | ||||
+ | + | ||||
+/* Define to 1 if your system has the kvm_open2 function. */ | +/* Define to 1 if your system has the kvm_open2 function. */ | ||||
+#undef HAVE_KVM_OPEN2 | +#undef HAVE_KVM_OPEN2 | ||||
+ | + | ||||
/* Define if you have <langinfo.h> and nl_langinfo(CODESET). */ | /* Define if you have <langinfo.h> and nl_langinfo(CODESET). */ | ||||
#undef HAVE_LANGINFO_CODESET | #undef HAVE_LANGINFO_CODESET | ||||
diff --git gdb/configure gdb/configure | diff --git gdb/configure gdb/configure | ||||
index 854837c50a..df64effa90 100755 | index b572d414ca..12e08354cc 100755 | ||||
--- gdb/configure | --- gdb/configure | ||||
+++ gdb/configure | +++ gdb/configure | ||||
@@ -8107,6 +8107,126 @@ $as_echo "#define HAVE_KINFO_GETFILE 1" >>confdefs.h | @@ -8064,6 +8064,126 @@ $as_echo "#define HAVE_KINFO_GETFILE 1" >>confdefs.h | ||||
fi | fi | ||||
+# kgdb needs kvm_open2 for cross-debugging | +# kgdb needs kvm_open2 for cross-debugging | ||||
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing kvm_open2" >&5 | +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing kvm_open2" >&5 | ||||
+$as_echo_n "checking for library containing kvm_open2... " >&6; } | +$as_echo_n "checking for library containing kvm_open2... " >&6; } | ||||
+if ${ac_cv_search_kvm_open2+:} false; then : | +if ${ac_cv_search_kvm_open2+:} false; then : | ||||
+ $as_echo_n "(cached) " >&6 | + $as_echo_n "(cached) " >&6 | ||||
▲ Show 20 Lines • Show All 111 Lines • ▼ Show 20 Lines | |||||
+ | + | ||||
+fi | +fi | ||||
+ | + | ||||
+ | + | ||||
if test "X$prefix" = "XNONE"; then | if test "X$prefix" = "XNONE"; then | ||||
acl_final_prefix="$ac_default_prefix" | acl_final_prefix="$ac_default_prefix" | ||||
diff --git gdb/configure.ac gdb/configure.ac | diff --git gdb/configure.ac gdb/configure.ac | ||||
index 1527585839..7ff0361e69 100644 | index ca0da7980c..39dc6a3559 100644 | ||||
--- gdb/configure.ac | --- gdb/configure.ac | ||||
+++ gdb/configure.ac | +++ gdb/configure.ac | ||||
@@ -511,6 +511,16 @@ AC_SEARCH_LIBS(kinfo_getfile, util util-freebsd, | @@ -485,6 +485,16 @@ AC_SEARCH_LIBS(kinfo_getfile, util util-freebsd, | ||||
[AC_DEFINE(HAVE_KINFO_GETFILE, 1, | [AC_DEFINE(HAVE_KINFO_GETFILE, 1, | ||||
[Define to 1 if your system has the kinfo_getfile function. ])]) | [Define to 1 if your system has the kinfo_getfile function. ])]) | ||||
+# kgdb needs kvm_open2 for cross-debugging | +# kgdb needs kvm_open2 for cross-debugging | ||||
+AC_SEARCH_LIBS(kvm_open2, kvm, | +AC_SEARCH_LIBS(kvm_open2, kvm, | ||||
+ [AC_DEFINE(HAVE_KVM_OPEN2, 1, | + [AC_DEFINE(HAVE_KVM_OPEN2, 1, | ||||
+ [Define to 1 if your system has the kvm_open2 function. ])]) | + [Define to 1 if your system has the kvm_open2 function. ])]) | ||||
+ | + | ||||
+# kgdb needs kvm_kerndisp for relocatable kernels | +# kgdb needs kvm_kerndisp for relocatable kernels | ||||
+AC_SEARCH_LIBS(kvm_kerndisp, kvm, | +AC_SEARCH_LIBS(kvm_kerndisp, kvm, | ||||
+ [AC_DEFINE(HAVE_KVM_DISP, 1, | + [AC_DEFINE(HAVE_KVM_DISP, 1, | ||||
+ [Define to 1 if your system has the kvm_kerndisp function. ])]) | + [Define to 1 if your system has the kvm_kerndisp function. ])]) | ||||
+ | + | ||||
AM_ICONV | AM_ICONV | ||||
# GDB may fork/exec the iconv program to get the list of supported character | # GDB may fork/exec the iconv program to get the list of supported character | ||||
diff --git gdb/configure.nat gdb/configure.nat | diff --git gdb/configure.nat gdb/configure.nat | ||||
index 64ee101d83..f32e6328e0 100644 | index fb4522f579..a5059ff37d 100644 | ||||
--- gdb/configure.nat | --- gdb/configure.nat | ||||
+++ gdb/configure.nat | +++ gdb/configure.nat | ||||
@@ -63,7 +63,8 @@ case ${gdb_host} in | @@ -63,7 +63,8 @@ case ${gdb_host} in | ||||
LOADLIBES='-ldl $(RDYNAMIC)' | LOADLIBES='-ldl $(RDYNAMIC)' | ||||
;; | ;; | ||||
fbsd*) | fbsd*) | ||||
- NATDEPFILES='fork-child.o nat/fork-inferior.o inf-ptrace.o fbsd-nat.o' | - NATDEPFILES='fork-child.o nat/fork-inferior.o inf-ptrace.o fbsd-nat.o' | ||||
+ NATDEPFILES='fork-child.o nat/fork-inferior.o inf-ptrace.o fbsd-nat.o \ | + NATDEPFILES='fork-child.o nat/fork-inferior.o inf-ptrace.o fbsd-nat.o \ | ||||
+ fbsd-kvm.o' | + fbsd-kvm.o' | ||||
HAVE_NATIVE_GCORE_HOST=1 | HAVE_NATIVE_GCORE_HOST=1 | ||||
LOADLIBES='-lkvm' | LOADLIBES='-lkvm' | ||||
;; | ;; | ||||
diff --git gdb/configure.tgt gdb/configure.tgt | diff --git gdb/configure.tgt gdb/configure.tgt | ||||
index 27f122ad04..5fa0d0179e 100644 | index caa42be1c0..45668ccaed 100644 | ||||
--- gdb/configure.tgt | --- gdb/configure.tgt | ||||
+++ gdb/configure.tgt | +++ gdb/configure.tgt | ||||
@@ -98,7 +98,7 @@ esac | @@ -101,7 +101,7 @@ esac | ||||
case "${targ}" in | case "${targ}" in | ||||
*-*-freebsd* | *-*-kfreebsd*-gnu) | *-*-freebsd* | *-*-kfreebsd*-gnu) | ||||
- os_obs="fbsd-tdep.o solib-svr4.o";; | - os_obs="fbsd-tdep.o solib-svr4.o";; | ||||
+ os_obs="fbsd-tdep.o solib-svr4.o fbsd-kld.o fbsd-kthr.o";; | + os_obs="fbsd-tdep.o solib-svr4.o fbsd-kld.o fbsd-kthr.o";; | ||||
*-*-netbsd* | *-*-knetbsd*-gnu) | *-*-netbsd* | *-*-knetbsd*-gnu) | ||||
os_obs="nbsd-tdep.o solib-svr4.o";; | os_obs="nbsd-tdep.o solib-svr4.o";; | ||||
*-*-openbsd*) | *-*-openbsd*) | ||||
@@ -115,7 +115,7 @@ aarch64*-*-elf | aarch64*-*-rtems*) | @@ -118,7 +118,7 @@ aarch64*-*-elf | aarch64*-*-rtems*) | ||||
aarch64*-*-freebsd*) | aarch64*-*-freebsd*) | ||||
# Target: FreeBSD/aarch64 | # Target: FreeBSD/aarch64 | ||||
- gdb_target_obs="aarch64-fbsd-tdep.o" | - gdb_target_obs="aarch64-fbsd-tdep.o" | ||||
+ gdb_target_obs="aarch64-fbsd-tdep.o aarch64-fbsd-kern.o" | + gdb_target_obs="aarch64-fbsd-tdep.o aarch64-fbsd-kern.o" | ||||
;; | ;; | ||||
aarch64*-*-linux*) | aarch64*-*-linux*) | ||||
@@ -168,7 +168,7 @@ arm*-*-linux*) | @@ -171,7 +171,7 @@ arm*-*-linux*) | ||||
;; | ;; | ||||
arm*-*-freebsd*) | arm*-*-freebsd*) | ||||
# Target: FreeBSD/arm | # Target: FreeBSD/arm | ||||
- gdb_target_obs="arm-fbsd-tdep.o" | - gdb_target_obs="arm-fbsd-tdep.o" | ||||
+ gdb_target_obs="arm-fbsd-tdep.o arm-fbsd-kern.o" | + gdb_target_obs="arm-fbsd-tdep.o arm-fbsd-kern.o" | ||||
;; | ;; | ||||
arm*-*-netbsd* | arm*-*-knetbsd*-gnu) | arm*-*-netbsd* | arm*-*-knetbsd*-gnu) | ||||
# Target: NetBSD/arm | # Target: NetBSD/arm | ||||
@@ -267,7 +267,11 @@ i[34567]86-*-dicos*) | @@ -270,7 +270,11 @@ i[34567]86-*-dicos*) | ||||
;; | ;; | ||||
i[34567]86-*-freebsd* | i[34567]86-*-kfreebsd*-gnu) | i[34567]86-*-freebsd* | i[34567]86-*-kfreebsd*-gnu) | ||||
# Target: FreeBSD/i386 | # Target: FreeBSD/i386 | ||||
- gdb_target_obs="i386-bsd-tdep.o i386-fbsd-tdep.o " | - gdb_target_obs="i386-bsd-tdep.o i386-fbsd-tdep.o " | ||||
+ gdb_target_obs="i386-bsd-tdep.o i386-fbsd-tdep.o i386fbsd-kern.o" | + gdb_target_obs="i386-bsd-tdep.o i386-fbsd-tdep.o i386fbsd-kern.o" | ||||
+ if test "x$enable_64_bit_bfd" = "xyes"; then | + if test "x$enable_64_bit_bfd" = "xyes"; then | ||||
+ # Target: FreeBSD amd64 | + # Target: FreeBSD amd64 | ||||
+ gdb_target_obs="amd64fbsd-tdep.o amd64fbsd-kern.o ${gdb_target_obs}" | + gdb_target_obs="amd64fbsd-tdep.o amd64fbsd-kern.o ${gdb_target_obs}" | ||||
+ fi | + fi | ||||
;; | ;; | ||||
i[34567]86-*-netbsd* | i[34567]86-*-knetbsd*-gnu) | i[34567]86-*-netbsd* | i[34567]86-*-knetbsd*-gnu) | ||||
# Target: NetBSD/i386 | # Target: NetBSD/i386 | ||||
@@ -421,7 +425,7 @@ mips*-*-netbsd* | mips*-*-knetbsd*-gnu) | @@ -424,7 +428,7 @@ mips*-*-netbsd* | mips*-*-knetbsd*-gnu) | ||||
;; | ;; | ||||
mips*-*-freebsd*) | mips*-*-freebsd*) | ||||
# Target: MIPS running FreeBSD | # Target: MIPS running FreeBSD | ||||
- gdb_target_obs="mips-tdep.o mips-fbsd-tdep.o" | - gdb_target_obs="mips-tdep.o mips-fbsd-tdep.o" | ||||
+ gdb_target_obs="mips-tdep.o mips-fbsd-tdep.o mipsfbsd-kern.o" | + gdb_target_obs="mips-tdep.o mips-fbsd-tdep.o mipsfbsd-kern.o" | ||||
gdb_sim=../sim/mips/libsim.a | gdb_sim=../sim/mips/libsim.a | ||||
;; | ;; | ||||
mips64*-*-openbsd*) | mips64*-*-openbsd*) | ||||
@@ -488,7 +492,7 @@ or1k-*-* | or1knd-*-*) | @@ -491,7 +495,7 @@ or1k-*-* | or1knd-*-*) | ||||
powerpc*-*-freebsd*) | powerpc*-*-freebsd*) | ||||
# Target: FreeBSD/powerpc | # Target: FreeBSD/powerpc | ||||
gdb_target_obs="rs6000-tdep.o ppc-sysv-tdep.o ppc64-tdep.o \ | gdb_target_obs="rs6000-tdep.o ppc-sysv-tdep.o ppc64-tdep.o \ | ||||
- ppc-fbsd-tdep.o \ | - ppc-fbsd-tdep.o \ | ||||
+ ppc-fbsd-tdep.o ppcfbsd-kern.o \ | + ppc-fbsd-tdep.o ppcfbsd-kern.o \ | ||||
ravenscar-thread.o ppc-ravenscar-thread.o" | ravenscar-thread.o ppc-ravenscar-thread.o" | ||||
;; | ;; | ||||
@@ -543,7 +547,7 @@ s390*-*-linux*) | @@ -545,7 +549,7 @@ s390*-*-linux*) | ||||
riscv*-*-freebsd*) | riscv*-*-freebsd*) | ||||
# Target: FreeBSD/riscv | # Target: FreeBSD/riscv | ||||
- gdb_target_obs="riscv-fbsd-tdep.o" | - gdb_target_obs="riscv-fbsd-tdep.o" | ||||
+ gdb_target_obs="riscv-fbsd-tdep.o riscv-fbsd-kern.o" | + gdb_target_obs="riscv-fbsd-tdep.o riscv-fbsd-kern.o" | ||||
;; | ;; | ||||
riscv*-*-linux*) | riscv*-*-linux*) | ||||
@@ -622,6 +626,7 @@ sparc64-*-linux*) | @@ -624,6 +628,7 @@ sparc64-*-linux*) | ||||
sparc*-*-freebsd* | sparc*-*-kfreebsd*-gnu) | sparc*-*-freebsd* | sparc*-*-kfreebsd*-gnu) | ||||
# Target: FreeBSD/sparc64 | # Target: FreeBSD/sparc64 | ||||
gdb_target_obs="sparc-tdep.o sparc64-tdep.o sparc64-fbsd-tdep.o \ | gdb_target_obs="sparc-tdep.o sparc64-tdep.o sparc64-fbsd-tdep.o \ | ||||
+ sparc64fbsd-kern.o \ | + sparc64fbsd-kern.o \ | ||||
ravenscar-thread.o sparc-ravenscar-thread.o" | ravenscar-thread.o sparc-ravenscar-thread.o" | ||||
;; | ;; | ||||
sparc-*-netbsd* | sparc-*-knetbsd*-gnu) | sparc-*-netbsd* | sparc-*-knetbsd*-gnu) | ||||
@@ -749,8 +754,8 @@ x86_64-*-linux*) | @@ -745,8 +750,8 @@ x86_64-*-linux*) | ||||
;; | ;; | ||||
x86_64-*-freebsd* | x86_64-*-kfreebsd*-gnu) | x86_64-*-freebsd* | x86_64-*-kfreebsd*-gnu) | ||||
# Target: FreeBSD/amd64 | # Target: FreeBSD/amd64 | ||||
- gdb_target_obs="amd64-fbsd-tdep.o ${i386_tobjs} \ | - gdb_target_obs="amd64-fbsd-tdep.o ${i386_tobjs} \ | ||||
- i386-bsd-tdep.o i386-fbsd-tdep.o" | - i386-bsd-tdep.o i386-fbsd-tdep.o" | ||||
+ gdb_target_obs="amd64-fbsd-tdep.o amd64fbsd-kern.o ${i386_tobjs} \ | + gdb_target_obs="amd64-fbsd-tdep.o amd64fbsd-kern.o ${i386_tobjs} \ | ||||
+ i386-bsd-tdep.o i386-fbsd-tdep.o i386fbsd-kern.o" | + i386-bsd-tdep.o i386-fbsd-tdep.o i386fbsd-kern.o" | ||||
;; | ;; | ||||
x86_64-*-mingw* | x86_64-*-cygwin*) | x86_64-*-mingw* | x86_64-*-cygwin*) | ||||
# Target: MingW/amd64 | # Target: MingW/amd64 | ||||
diff --git gdb/defs.h gdb/defs.h | diff --git gdb/defs.h gdb/defs.h | ||||
index a44e186907..c4bfd42073 100644 | index 567f214b81..abbaa1f950 100644 | ||||
--- gdb/defs.h | --- gdb/defs.h | ||||
+++ gdb/defs.h | +++ gdb/defs.h | ||||
@@ -484,6 +484,7 @@ enum gdb_osabi | @@ -481,6 +481,7 @@ enum gdb_osabi | ||||
GDB_OSABI_SOLARIS, | GDB_OSABI_SOLARIS, | ||||
GDB_OSABI_LINUX, | GDB_OSABI_LINUX, | ||||
GDB_OSABI_FREEBSD, | GDB_OSABI_FREEBSD, | ||||
+ GDB_OSABI_FREEBSD_KERNEL, | + GDB_OSABI_FREEBSD_KERNEL, | ||||
GDB_OSABI_NETBSD, | GDB_OSABI_NETBSD, | ||||
GDB_OSABI_OPENBSD, | GDB_OSABI_OPENBSD, | ||||
GDB_OSABI_WINCE, | GDB_OSABI_WINCE, | ||||
diff --git gdb/gnulib/configure gdb/gnulib/configure | |||||
index 340c622cb3..bf0c4dd5d9 100644 | |||||
--- gdb/gnulib/configure | |||||
+++ gdb/gnulib/configure | |||||
@@ -18579,6 +18579,7 @@ else | |||||
case "$host_os" in | |||||
# Guess all is fine on glibc systems. | |||||
*-gnu*) gl_cv_func_gettimeofday_clobber="guessing no" ;; | |||||
+ freebsd*) gl_cv_func_gettimeofday_clobber="guessing no" ;; | |||||
# If we don't know, assume the worst. | |||||
*) gl_cv_func_gettimeofday_clobber="guessing yes" ;; | |||||
esac | |||||
diff --git gdb/osabi.c gdb/osabi.c | diff --git gdb/osabi.c gdb/osabi.c | ||||
index 5d4bbcdff8..a982b22624 100644 | index dec1bddc4c..06c514167e 100644 | ||||
--- gdb/osabi.c | --- gdb/osabi.c | ||||
+++ gdb/osabi.c | +++ gdb/osabi.c | ||||
@@ -66,6 +66,7 @@ static const struct osabi_names gdb_osabi_names[] = | @@ -66,6 +66,7 @@ static const struct osabi_names gdb_osabi_names[] = | ||||
{ "Solaris", NULL }, | { "Solaris", NULL }, | ||||
{ "GNU/Linux", "linux(-gnu[^-]*)?" }, | { "GNU/Linux", "linux(-gnu[^-]*)?" }, | ||||
{ "FreeBSD", NULL }, | { "FreeBSD", NULL }, | ||||
+ { "FreeBSD/kernel", NULL }, | + { "FreeBSD/kernel", NULL }, | ||||
{ "NetBSD", NULL }, | { "NetBSD", NULL }, | ||||
{ "OpenBSD", NULL }, | { "OpenBSD", NULL }, | ||||
{ "WindowsCE", NULL }, | { "WindowsCE", NULL }, | ||||
diff --git gdb/regcache.c gdb/regcache.c | diff --git gdb/regcache.c gdb/regcache.c | ||||
index 6e3eee9663..49ca1e1535 100644 | index 1580359cd4..50ff8d4039 100644 | ||||
--- gdb/regcache.c | --- gdb/regcache.c | ||||
+++ gdb/regcache.c | +++ gdb/regcache.c | ||||
@@ -1003,6 +1003,22 @@ reg_buffer::raw_supply_zeroed (int regnum) | @@ -996,6 +996,22 @@ reg_buffer::raw_supply_zeroed (int regnum) | ||||
m_register_status[regnum] = REG_VALID; | m_register_status[regnum] = REG_VALID; | ||||
} | } | ||||
+void | +void | ||||
+reg_buffer::raw_supply_unsigned (int regnum, ULONGEST val) | +reg_buffer::raw_supply_unsigned (int regnum, ULONGEST val) | ||||
+{ | +{ | ||||
+ enum bfd_endian byte_order = gdbarch_byte_order (m_descr->gdbarch); | + enum bfd_endian byte_order = gdbarch_byte_order (m_descr->gdbarch); | ||||
+ gdb_byte *regbuf; | + gdb_byte *regbuf; | ||||
+ size_t regsize; | + size_t regsize; | ||||
+ | + | ||||
+ assert_regnum (regnum); | + assert_regnum (regnum); | ||||
+ | + | ||||
+ regbuf = register_buffer (regnum); | + regbuf = register_buffer (regnum); | ||||
+ regsize = m_descr->sizeof_register[regnum]; | + regsize = m_descr->sizeof_register[regnum]; | ||||
+ | + | ||||
+ store_unsigned_integer (regbuf, regsize, byte_order, val); | + store_unsigned_integer (regbuf, regsize, byte_order, val); | ||||
+ m_register_status[regnum] = REG_VALID; | + m_register_status[regnum] = REG_VALID; | ||||
+} | +} | ||||
+ | + | ||||
/* See common/common-regcache.h. */ | /* See gdbsupport/common-regcache.h. */ | ||||
void | void | ||||
diff --git gdb/regcache.h gdb/regcache.h | diff --git gdb/regcache.h gdb/regcache.h | ||||
index 2b703ea4a4..d06e001957 100644 | index e2935eea74..83654be825 100644 | ||||
--- gdb/regcache.h | --- gdb/regcache.h | ||||
+++ gdb/regcache.h | +++ gdb/regcache.h | ||||
@@ -224,6 +224,8 @@ public: | @@ -226,6 +226,8 @@ public: | ||||
only LEN, without editing the rest of the register. */ | only LEN, without editing the rest of the register. */ | ||||
void raw_supply_part (int regnum, int offset, int len, const gdb_byte *in); | void raw_supply_part (int regnum, int offset, int len, const gdb_byte *in); | ||||
+ void raw_supply_unsigned (int regnum, ULONGEST val); | + void raw_supply_unsigned (int regnum, ULONGEST val); | ||||
+ | + | ||||
void invalidate (int regnum); | void invalidate (int regnum); | ||||
virtual ~reg_buffer () = default; | virtual ~reg_buffer () = default; | ||||
diff --git gnulib/configure gnulib/configure | |||||
index 7c74371e8f..396467f68d 100644 | |||||
--- gnulib/configure | |||||
+++ gnulib/configure | |||||
@@ -20267,6 +20267,8 @@ else | |||||
case "$host_os" in | |||||
# Guess all is fine on glibc systems. | |||||
*-gnu*) gl_cv_func_gettimeofday_clobber="guessing no" ;; | |||||
+ # Guess all is fine on FreeBSD. | |||||
+ freebsd*) gl_cv_func_gettimeofday_clobber="guessing no" ;; | |||||
# If we don't know, assume the worst. | |||||
*) gl_cv_func_gettimeofday_clobber="guessing yes" ;; | |||||
esac |