[Midnightbsd-cvs] mports [24716] trunk/devel/gdb/pkg-plist: update gdb to 8.2

laffer1 at midnightbsd.org laffer1 at midnightbsd.org
Mon Nov 26 12:06:28 EST 2018


Revision: 24716
          http://svnweb.midnightbsd.org/mports/?rev=24716
Author:   laffer1
Date:     2018-11-26 12:06:28 -0500 (Mon, 26 Nov 2018)
Log Message:
-----------
update gdb to 8.2

Modified Paths:
--------------
    trunk/devel/gdb/Makefile
    trunk/devel/gdb/distinfo
    trunk/devel/gdb/files/patch-unified
    trunk/devel/gdb/pkg-plist

Added Paths:
-----------
    trunk/devel/gdb/files/commit-8aa0243d54
    trunk/devel/gdb/files/extrapatch-kgdb
    trunk/devel/gdb/files/kgdb/
    trunk/devel/gdb/files/kgdb/aarch64-fbsd-kern.c
    trunk/devel/gdb/files/kgdb/amd64fbsd-kern.c
    trunk/devel/gdb/files/kgdb/arm-fbsd-kern.c
    trunk/devel/gdb/files/kgdb/fbsd-kld.c
    trunk/devel/gdb/files/kgdb/fbsd-kthr.c
    trunk/devel/gdb/files/kgdb/fbsd-kvm.c
    trunk/devel/gdb/files/kgdb/i386fbsd-kern.c
    trunk/devel/gdb/files/kgdb/kgdb-main.c
    trunk/devel/gdb/files/kgdb/kgdb.1
    trunk/devel/gdb/files/kgdb/kgdb.h
    trunk/devel/gdb/files/kgdb/mipsfbsd-kern.c
    trunk/devel/gdb/files/kgdb/ppcfbsd-kern.c
    trunk/devel/gdb/files/kgdb/sparc64fbsd-kern.c
    trunk/devel/gdb/files/patch-fixes
    trunk/devel/gdb/files/patch-gdb_aarch64-fbsd-tdep.c
    trunk/devel/gdb/files/patch-gdb_aarch64-linux-tdep.c
    trunk/devel/gdb/files/patch-gdb_aarch64-tdep.c
    trunk/devel/gdb/files/patch-gdb_alpha-tdep.c
    trunk/devel/gdb/files/patch-gdb_amd64-bsd-nat.c
    trunk/devel/gdb/files/patch-gdb_arch_arm-get-next-pcs.c
    trunk/devel/gdb/files/patch-gdb_arm-fbsd-tdep.c
    trunk/devel/gdb/files/patch-gdb_arm-linux-tdep.c
    trunk/devel/gdb/files/patch-gdb_arm-obsd-tdep.c
    trunk/devel/gdb/files/patch-gdb_bfin-linux-tdep.c
    trunk/devel/gdb/files/patch-gdb_common_common-defs.h
    trunk/devel/gdb/files/patch-gdb_completer.c
    trunk/devel/gdb/files/patch-gdb_configure
    trunk/devel/gdb/files/patch-gdb_fbsd-nat.c
    trunk/devel/gdb/files/patch-gdb_gdb__wchar.h
    trunk/devel/gdb/files/patch-gdb_gnulib_import_stddef.in.h
    trunk/devel/gdb/files/patch-gdb_hppa-nbsd-tdep.c
    trunk/devel/gdb/files/patch-gdb_i386-fbsd-nat.c
    trunk/devel/gdb/files/patch-gdb_i386-nbsd-tdep.c
    trunk/devel/gdb/files/patch-gdb_linespec.c
    trunk/devel/gdb/files/patch-gdb_microblaze-linux-tdep.c
    trunk/devel/gdb/files/patch-gdb_mips-fbsd-tdep.c
    trunk/devel/gdb/files/patch-gdb_mips-linux-tdep.c
    trunk/devel/gdb/files/patch-gdb_mips-tdep.c
    trunk/devel/gdb/files/patch-gdb_mips64-obsd-tdep.c
    trunk/devel/gdb/files/patch-gdb_mn10300-linux-tdep.c
    trunk/devel/gdb/files/patch-gdb_nios2-linux-tdep.c
    trunk/devel/gdb/files/patch-gdb_ppc-linux-tdep.c
    trunk/devel/gdb/files/patch-gdb_ppc-nbsd-tdep.c
    trunk/devel/gdb/files/patch-gdb_ppc64-tdep.c
    trunk/devel/gdb/files/patch-gdb_python_python-config.py
    trunk/devel/gdb/files/patch-gdb_rs6000-tdep.c
    trunk/devel/gdb/files/patch-gdb_sparc-linux-tdep.c
    trunk/devel/gdb/files/patch-gdb_sparc64-linux-tdep.c
    trunk/devel/gdb/files/patch-gdb_tick6x-linux-tdep.c
    trunk/devel/gdb/files/patch-gdb_tilegx-linux-tdep.c
    trunk/devel/gdb/files/patch-gdb_tramp-frame.h
    trunk/devel/gdb/files/patch-gdb_xtensa-tdep.h
    trunk/devel/gdb/files/patch-include_libiberty.h
    trunk/devel/gdb/files/patch-libiberty_configure

Removed Paths:
-------------
    trunk/devel/gdb/files/extrapatch-gdb-Makefile.in
    trunk/devel/gdb/files/extrapatch-gdb-configure.tgt
    trunk/devel/gdb/files/fbsd-threads.c
    trunk/devel/gdb/files/patch-bfd-coffcode.h
    trunk/devel/gdb/files/patch-bfd-ecoff.c
    trunk/devel/gdb/files/patch-bfd-elf32-hppa.c
    trunk/devel/gdb/files/patch-bfd-elf32-m32r.c
    trunk/devel/gdb/files/patch-bfd-elf32-tic6x.c
    trunk/devel/gdb/files/patch-bfd-elf32-v850.c
    trunk/devel/gdb/files/patch-bfd-elf64-alpha.c
    trunk/devel/gdb/files/patch-bfd-elfnn-ia64.c
    trunk/devel/gdb/files/patch-bfd-elfxx-mips.c
    trunk/devel/gdb/files/patch-bfd-elfxx-tilegx.c
    trunk/devel/gdb/files/patch-bfd-mach-o.c
    trunk/devel/gdb/files/patch-bfd-mmo.c
    trunk/devel/gdb/files/patch-bfd-opncls.c
    trunk/devel/gdb/files/patch-bfd-peicode.h
    trunk/devel/gdb/files/patch-bfd-vms-alpha.c
    trunk/devel/gdb/files/patch-bfd-xcofflink.c
    trunk/devel/gdb/files/patch-gdb-amd64bsd-nat.c
    trunk/devel/gdb/files/patch-gdb-amd64fbsd-nat.c
    trunk/devel/gdb/files/patch-gdb-amd64fbsd-tdep.c
    trunk/devel/gdb/files/patch-gdb-configure
    trunk/devel/gdb/files/patch-gdb-i386bsd-nat.c
    trunk/devel/gdb/files/patch-gdb-i386bsd-nat.h
    trunk/devel/gdb/files/patch-gdb-i386fbsd-nat.c
    trunk/devel/gdb/files/patch-gdb-i386fbsd-tdep.c
    trunk/devel/gdb/files/patch-opcodes-cr16-opc.c
    trunk/devel/gdb/files/patch-opcodes-crx-opc.c
    trunk/devel/gdb/files/patch-opcodes-i386-dis.c
    trunk/devel/gdb/files/patch-opcodes-ia64-asmtab.c
    trunk/devel/gdb/files/patch-opcodes-v850-dis.c

Property Changed:
----------------
    trunk/devel/gdb/files/patch-unified

Modified: trunk/devel/gdb/Makefile
===================================================================
--- trunk/devel/gdb/Makefile	2018-11-26 17:02:39 UTC (rev 24715)
+++ trunk/devel/gdb/Makefile	2018-11-26 17:06:28 UTC (rev 24716)
@@ -1,8 +1,7 @@
 # $MidnightBSD$
 
 PORTNAME=	gdb
-PORTVERSION=	7.6
-PORTREVISION=	1
+PORTVERSION=	8.2
 CATEGORIES=	devel
 MASTER_SITES=	GNU
 
@@ -10,119 +9,136 @@
 COMMENT=	GNU GDB of newer version than comes with the system
 
 LICENSE=	gpl3
+LICENSE_FILE=	${WRKSRC}/COPYING3
 
+# untested on sparc64, might work
+ONLY_FOR_ARCHS=	aarch64 amd64 armv6 armv7 i386 mips powerpc powerpc64
+
+LIB_DEPENDS=	libmpfr.so:math/mpfr
+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 1.0 crashes while building this port.
+# Requiring C++14 forces 1.0 to use an external version of clang
+USES=		compiler:c++14-lang cpe gettext-runtime gmake libtool tar:xz
 USE_CSTD=	gnu89
-USE_GMAKE=	yes
-USES=		iconv tar:bzip2
+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} \
-		--without-libunwind-ia64 \
-		--enable-targets=all
+		--with-expat=yes --with-libexpat-prefix=${LOCALBASE} \
+		--without-libunwind-ia64 --with-system-zlib
 CFLAGS:=	${CFLAGS:C/ +$//}	# blanks at EOL creep in sometimes
-CFLAGS+=	-DRL_NO_COMPAT
+CFLAGS+=	-DRL_NO_COMPAT -Wno-unused-function -Wno-unused-variable
+CFLAGS+=	-Wno-unknown-warning-option
 EXCLUDE=	dejagnu expect sim texinfo intl
 EXTRACT_AFTER_ARGS=	${EXCLUDE:S/^/--exclude /}
-VER=	${PORTVERSION:S/.//g}
+EXTRA_PATCHES=	${FILESDIR}/commit-8aa0243d54
+LIB_DEPENDS+=	libexpat.so:textproc/expat2
+
+VER=		${PORTVERSION:S/.//g}
 PLIST_SUB=	VER=${VER}
 
-OPTIONS_DEFINE=	DEBUG EXPAT PYTHON THREADS TUI GDB_LINK
-OPTIONS_SINGLE_READLINE=	BASE_READLINE BUNDLED_READLINE PORT_READLINE
-OPTIONS_SINGLE=	READLINE
-BASE_READLINE_DESC=	from base system(EXPERIMENTAL)
+OPTIONS_DEFINE=	DEBUG GDB_LINK GUILE KGDB PYTHON TUI
+
+OPTIONS_DEFAULT=	GDB_LINK KGDB PYTHON TUI PORT_READLINE PORT_ICONV SYSTEM_ZLIB
+
+OPTIONS_SINGLE=	READLINE ICONV ZLIB
+OPTIONS_SINGLE_READLINE=	BUNDLED_READLINE PORT_READLINE
+OPTIONS_SINGLE_ICONV=	PORT_ICONV SYSTEM_ICONV
+OPTIONS_SINGLE_ZLIB=	BUNDLED_ZLIB SYSTEM_ZLIB
+
+GDB_LINK_DESC=		Create ${PREFIX}/bin/gdb symlink
+KGDB_DESC=		Kernel Debugging Support
 BUNDLED_READLINE_DESC=	from gdb distfile
+BUNDLED_ZLIB_DESC=	from gdb distfile
 PORT_READLINE_DESC=	from devel/readline port
-GDB_LINK_DESC=	Create the gdb link
-TUI_DESC=	Text User Interface enabled
-OPTIONS_DEFAULT=	THREADS TUI GDB_LINK PORT_READLINE
+PORT_ICONV_DESC=	use libiconv, with wider charset support
+SYSTEM_ICONV_DESC=	use libc iconv, with no wchar support
+SYSTEM_ZLIB_DESC=	use system zlib
+TUI_DESC=		Text User Interface enabled
 
-.include <bsd.mport.options.mk>
+OPTIONS_SUB=	yes
 
-.if ${PORT_OPTIONS:MGDB_LINK}
-PLIST_SUB+=	GDB_LINK=""
-.else
-PLIST_SUB+=	GDB_LINK="@comment "
-.endif
+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
+PORT_ICONV_USES=	iconv:wchar_t
+PYTHON_CONFIGURE_ON=	--with-python=${PYTHON_CMD}
+PYTHON_CONFIGURE_OFF=	--without-python
+PYTHON_USES=		python
+SYSTEM_ICONV_USES=	iconv
+SYSTEM_ZLIB_WITH=	system-zlib
+TUI_CONFIGURE_ENABLE=	tui
 
-.if ${PORT_OPTIONS:MTUI}
-CONFIGURE_ARGS+=	--enable-tui
-PLIST_SUB+=	TUI_LINK=""
-.else
-CONFIGURE_ARGS+=	--disable-tui
-PLIST_SUB+=	TUI_LINK="@comment "
-.endif
+.include <bsd.port.pre.mk>
 
-.if empty(PORT_OPTIONS:MBUNDLED_READLINE)
+.if ! ${PORT_OPTIONS:MBUNDLED_READLINE}
 EXCLUDE+=	readline
-CONFIGURE_ARGS+=	--with-system-readline
 .endif
 
-.if ${PORT_OPTIONS:MBASE_READLINE}
-CFLAGS+=	-D_rl_echoing_p=readline_echoing_p
-USES+=		readline
+.if ! ${PORT_OPTIONS:MBUNDLED_ZLIB}
+EXCLUDE+=	zlib
 .endif
 
-.if ${PORT_OPTIONS:MPORT_READLINE}
-USES+=		readline:port
+.if ${ARCH} == "amd64"
+CONFIGURE_TARGET=	x86_64-portbld-freebsd10.4
 .endif
 
-.if ${PORT_OPTIONS:MPYTHON}
-USE_PYTHON=	2.5-2.7
-CONFIGURE_ARGS+=	--with-python=${PYTHON_CMD}
-PLIST_SUB+=		PYTHON=""
-.else
-CONFIGURE_ARGS+=	--without-python
-PLIST_SUB+=		PYTHON="@comment "
+.if ${COMPILER_TYPE} == "clang"
+CFLAGS+=	-Wno-extended-offsetof
 .endif
 
-.include <bsd.port.pre.mk>
+post-patch:
+	@${REINPLACE_CMD} -e 's|$$| [GDB v${PORTVERSION} for MidnightBSD]|' \
+		${WRKSRC}/gdb/version.in
 
-.if ${PORT_OPTIONS:MTHREADS}
-EXTRA_PATCHES=	${FILESDIR}/extrapatch-gdb-configure.tgt ${FILESDIR}/extrapatch-gdb-Makefile.in
-.endif
+post-patch-KGDB-on:
+	@${CP} -r ${FILESDIR}/kgdb/*.[ch] ${WRKSRC}/gdb/
+	@${PATCH} -d ${PATCH_WRKSRC} ${PATCH_ARGS} < ${FILESDIR}/extrapatch-kgdb
 
-.if ${PORT_OPTIONS:MDEBUG}
-CFLAGS+=	-g
-.endif
+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} ${FAKE_MAKEARGS} install-syscalls )
 
-.if ${PORT_OPTIONS:MEXPAT}
-LIB_DEPENDS+=	expat:${PORTSDIR}/textproc/expat2
-CONFIGURE_ARGS+=	--with-expat=yes
-.else
-CONFIGURE_ARGS+=	--without-expat
-.endif
+do-install-KGDB-on:
+	${INSTALL_PROGRAM} ${WRKSRC}/gdb/kgdb \
+		${FAKE_DESTDIR}${PREFIX}/bin/kgdb${VER}
+	${INSTALL_MAN} ${FILESDIR}/kgdb/kgdb.1 \
+		${FAKE_DESTDIR}${MAN1PREFIX}/man/man1/kgdb${VER}.1
 
-.if ${ARCH} == "amd64"
-CONFIGURE_TARGET=	x86_64-portbld-freebsd9.1
-.endif
+do-install-TUI-on:
+	${LN} -sf gdb${VER} ${FAKE_DESTDIR}${PREFIX}/bin/gdbtui${VER}
 
-post-patch:
-	@${REINPLACE_CMD} -e 's/$$/ [GDB v${PORTVERSION} for FreeBSD]/' \
-		${WRKSRC}/gdb/version.in
-.if ${PORT_OPTIONS:MTHREADS}
-	@${CP} ${FILESDIR}/fbsd-threads.c ${WRKSRC}/gdb/
+do-install-GDB_LINK-on:
+	${LN} -sf gdb${VER} ${FAKE_DESTDIR}${PREFIX}/bin/gdb
+.if ${PORT_OPTIONS:MKGDB}
+	${LN} -sf kgdb${VER} ${FAKE_DESTDIR}${PREFIX}/bin/kgdb
 .endif
 
-do-install:
-	${INSTALL_PROGRAM} ${WRKSRC}/gdb/gdb ${PREFIX}/bin/gdb${VER}
-	${INSTALL_MAN} ${WRKSRC}/gdb/gdb.1 ${MAN1PREFIX}/man/man1/gdb${VER}.1
-.if ${PORT_OPTIONS:MTUI}
-	${LN} -sf ${PREFIX}/bin/gdb${VER} ${PREFIX}/bin/gdbtui${VER}
-.endif
-.if ${PORT_OPTIONS:MGDB_LINK}
-	${LN} -sf gdb${VER} ${PREFIX}/bin/gdb
-.endif
-.if ${PORT_OPTIONS:MPYTHON}
-	(cd ${WRKSRC}/gdb; ${GMAKE} install-python )
-	(cd ${WRKSRC}/gdb/data-directory; ${GMAKE} install-python )
-.endif
+do-install-PYTHON-on:
+	(cd ${WRKSRC}/gdb; ${SETENV} ${MAKE_ENV} ${MAKE_CMD} ${MAKE_ARGS} ${FAKE_MAKEARGS} install-python )
+	(cd ${WRKSRC}/gdb/data-directory ; \
+		${SETENV} ${MAKE_ENV} ${MAKE_CMD} ${MAKE_ARGS} ${FAKE_MAKEARGS} install-python )
+. for f in gdb gdb/command gdb/function gdb/printer
+	@(cd ${STAGEDIR}${PREFIX}/share/gdb${VER}/python/${f} ; ${CHMOD} 644 *.py* )
+. endfor
 
-post-install:
-.if ${PORT_OPTIONS:MPYTHON}
-	${CHMOD} u+w ${PREFIX}/share/gdb${VER}/python/gdb/*.py*
-	${CHMOD} u+w ${PREFIX}/share/gdb${VER}/python/gdb/command/*.py*
-.endif
+do-install-GUILE-on:
+	(cd ${WRKSRC}/gdb; ${SETENV} ${MAKE_ENV} ${MAKE_CMD} ${MAKE_ARGS} ${FAKE_MAKEARGS} install-guile )
+	(cd ${WRKSRC}/gdb/data-directory ; \
+		${SETENV} ${MAKE_ENV} ${MAKE_CMD} ${MAKE_ARGS} ${FAKE_MAKEARGS} install-guile )
 
 .include <bsd.port.post.mk>

Modified: trunk/devel/gdb/distinfo
===================================================================
--- trunk/devel/gdb/distinfo	2018-11-26 17:02:39 UTC (rev 24715)
+++ trunk/devel/gdb/distinfo	2018-11-26 17:06:28 UTC (rev 24716)
@@ -1,2 +1,3 @@
-SHA256 (gdb-7.6.tar.bz2) = a410e8f35ee70cce83dbbf1da9e2a8373f271ac0e4b71db4336ae293fc7bdf1b
-SIZE (gdb-7.6.tar.bz2) = 24333590
+TIMESTAMP = 1536418789
+SHA256 (gdb-8.2.tar.xz) = c3a441a29c7c89720b734e5a9c6289c0a06be7e0c76ef538f7bbcef389347c39
+SIZE (gdb-8.2.tar.xz) = 20173112

Added: trunk/devel/gdb/files/commit-8aa0243d54
===================================================================
--- trunk/devel/gdb/files/commit-8aa0243d54	                        (rev 0)
+++ trunk/devel/gdb/files/commit-8aa0243d54	2018-11-26 17:06:28 UTC (rev 24716)
@@ -0,0 +1,197 @@
+commit 739ab2e92e1840c9285f3cfce1f1236c0fa68730
+Author: Simon Ser <contact at emersion.fr>
+Date:   Thu Sep 6 15:03:19 2018 -0700
+
+    Generate NT_PROCSTAT_{AUXV,VMMAP,PS_STRINGS} in FreeBSD coredumps
+    
+    gcore generates NT_AUXV and NT_FILE notes for Linux targets.  On
+    FreeBSD auxv is stored in a NT_PROCSTAT_AUXV section, virtual memory
+    mappings are stored in a NT_PROCSTAT_VMMAP, and both are prefixed with
+    the struct size.  In addition, store a NT_PROCSTAT_PS_STRINGS note
+    saving the initial location of the argv[] and environment[] arrays.
+    
+    gdb/ChangeLog:
+    
+            PR gdb/23105
+            * fbsd-nat.c (fbsd_nat_target::xfer_partial): Add support for
+            TARGET_OBJECT_FREEBSD_VMMAP and TARGET_OBJECT_FREEBSD_PS_STRINGS.
+            * fbsd-tdep.c (fbsd_make_note_desc): New.
+            (fbsd_make_corefile_notes): Write NT_PROCSTAT_AUXV,
+            NT_PROCSTAT_VMMAP and NT_PROCSTAT_PS_STRINGS notes.
+            * target.h (enum target_object) Add FreeBSD-specific
+            TARGET_OBJECT_FREEBSD_VMMAP and TARGET_OBJECT_FREEBSD_PS_STRINGS.
+
+diff --git gdb/ChangeLog gdb/ChangeLog
+index 410fbef920..e6f44a3ac2 100644
+--- gdb/ChangeLog
++++ gdb/ChangeLog
+@@ -1,3 +1,14 @@
++2018-09-06  Simon Ser  <contact at emersion.fr>
++
++	PR gdb/23105
++	* fbsd-nat.c (fbsd_nat_target::xfer_partial): Add support for
++	TARGET_OBJECT_FREEBSD_VMMAP and TARGET_OBJECT_FREEBSD_PS_STRINGS.
++	* fbsd-tdep.c (fbsd_make_note_desc): New.
++	(fbsd_make_corefile_notes): Write NT_PROCSTAT_AUXV,
++	NT_PROCSTAT_VMMAP and NT_PROCSTAT_PS_STRINGS notes.
++	* target.h (enum target_object) Add FreeBSD-specific
++	TARGET_OBJECT_FREEBSD_VMMAP and TARGET_OBJECT_FREEBSD_PS_STRINGS.
++
+ 2018-09-06  Simon Marchi  <simon.marchi at ericsson.com>
+ 
+ 	* compile/compile-c.h (generate_c_for_variable_locations):
+diff --git gdb/fbsd-nat.c gdb/fbsd-nat.c
+index 115deac070..a255318d14 100644
+--- gdb/fbsd-nat.c
++++ gdb/fbsd-nat.c
+@@ -751,6 +751,61 @@ fbsd_nat_target::xfer_partial (enum target_object object,
+ 	  }
+ 	return TARGET_XFER_E_IO;
+       }
++    case TARGET_OBJECT_FREEBSD_VMMAP:
++    case TARGET_OBJECT_FREEBSD_PS_STRINGS:
++      {
++	gdb::byte_vector buf_storage;
++	gdb_byte *buf;
++	size_t buflen;
++	int mib[4];
++
++	int proc_target;
++	uint32_t struct_size;
++	switch (object)
++	  {
++	  case TARGET_OBJECT_FREEBSD_VMMAP:
++	    proc_target = KERN_PROC_VMMAP;
++	    struct_size = sizeof (struct kinfo_vmentry);
++	    break;
++	  case TARGET_OBJECT_FREEBSD_PS_STRINGS:
++	    proc_target = KERN_PROC_PS_STRINGS;
++	    struct_size = sizeof (void *);
++	    break;
++	  }
++
++	if (writebuf != NULL)
++	  return TARGET_XFER_E_IO;
++
++	mib[0] = CTL_KERN;
++	mib[1] = KERN_PROC;
++	mib[2] = proc_target;
++	mib[3] = pid;
++
++	if (sysctl (mib, 4, NULL, &buflen, NULL, 0) != 0)
++	  return TARGET_XFER_E_IO;
++	buflen += sizeof (struct_size);
++
++	if (offset >= buflen)
++	  {
++	    *xfered_len = 0;
++	    return TARGET_XFER_EOF;
++	  }
++
++	buf_storage.resize (buflen);
++	buf = buf_storage.data ();
++
++	memcpy (buf, &struct_size, sizeof (struct_size));
++	buflen -= sizeof (struct_size);
++	if (sysctl (mib, 4, buf + sizeof (struct_size), &buflen, NULL, 0) != 0)
++	  return TARGET_XFER_E_IO;
++	buflen += sizeof (struct_size);
++
++	if (buflen - offset < len)
++	  len = buflen - offset;
++	memcpy (readbuf, buf + offset, len);
++	*xfered_len = len;
++	return TARGET_XFER_OK;
++      }
+     default:
+       return inf_ptrace_target::xfer_partial (object, annex,
+ 					      readbuf, writebuf, offset,
+diff --git gdb/fbsd-tdep.c gdb/fbsd-tdep.c
+index 78d0c3d830..ed43087169 100644
+--- gdb/fbsd-tdep.c
++++ gdb/fbsd-tdep.c
+@@ -512,6 +512,28 @@ fbsd_corefile_thread (struct thread_info *info,
+      args->note_size, args->stop_signal);
+ }
+ 
++/* Return a byte_vector containing the contents of a core dump note
++   for the target object of type OBJECT.  If STRUCTSIZE is non-zero,
++   the data is prefixed with a 32-bit integer size to match the format
++   used in FreeBSD NT_PROCSTAT_* notes.  */
++
++static gdb::optional<gdb::byte_vector>
++fbsd_make_note_desc (enum target_object object, uint32_t structsize)
++{
++  gdb::optional<gdb::byte_vector> buf =
++    target_read_alloc (current_top_target (), object, NULL);
++  if (!buf || buf->empty ())
++    return {};
++
++  if (structsize == 0)
++    return buf;
++
++  gdb::byte_vector desc (sizeof (structsize) + buf->size ());
++  memcpy (desc.data (), &structsize, sizeof (structsize));
++  memcpy (desc.data () + sizeof (structsize), buf->data (), buf->size ());
++  return desc;
++}
++
+ /* Create appropriate note sections for a corefile, returning them in
+    allocated memory.  */
+ 
+@@ -586,6 +608,40 @@ fbsd_make_corefile_notes (struct gdbarch *gdbarch, bfd *obfd, int *note_size)
+ 
+   note_data = thread_args.note_data;
+ 
++  /* Auxiliary vector.  */
++  uint32_t structsize = gdbarch_ptr_bit (gdbarch) / 4; /* Elf_Auxinfo  */
++  gdb::optional<gdb::byte_vector> note_desc =
++    fbsd_make_note_desc (TARGET_OBJECT_AUXV, structsize);
++  if (note_desc && !note_desc->empty ())
++    {
++      note_data = elfcore_write_note (obfd, note_data, note_size, "FreeBSD",
++				      NT_FREEBSD_PROCSTAT_AUXV,
++				      note_desc->data (), note_desc->size ());
++      if (!note_data)
++	return NULL;
++    }
++
++  /* Virtual memory mappings.  */
++  note_desc = fbsd_make_note_desc (TARGET_OBJECT_FREEBSD_VMMAP, 0);
++  if (note_desc && !note_desc->empty ())
++    {
++      note_data = elfcore_write_note (obfd, note_data, note_size, "FreeBSD",
++				      NT_FREEBSD_PROCSTAT_VMMAP,
++				      note_desc->data (), note_desc->size ());
++      if (!note_data)
++	return NULL;
++    }
++
++  note_desc = fbsd_make_note_desc (TARGET_OBJECT_FREEBSD_PS_STRINGS, 0);
++  if (note_desc && !note_desc->empty ())
++    {
++      note_data = elfcore_write_note (obfd, note_data, note_size, "FreeBSD",
++				      NT_FREEBSD_PROCSTAT_PSSTRINGS,
++				      note_desc->data (), note_desc->size ());
++      if (!note_data)
++	return NULL;
++    }
++
+   return note_data;
+ }
+ 
+diff --git gdb/target.h gdb/target.h
+index 229b5d0551..a3000c80c6 100644
+--- gdb/target.h
++++ gdb/target.h
+@@ -202,6 +202,10 @@ enum target_object
+      of the process ID of the process in question, in hexadecimal
+      format.  */
+   TARGET_OBJECT_EXEC_FILE,
++  /* FreeBSD virtual memory mappings.  */
++  TARGET_OBJECT_FREEBSD_VMMAP,
++  /* FreeBSD process strings.  */
++  TARGET_OBJECT_FREEBSD_PS_STRINGS,
+   /* Possible future objects: TARGET_OBJECT_FILE, ...  */
+ };
+ 


Property changes on: trunk/devel/gdb/files/commit-8aa0243d54
___________________________________________________________________
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
Deleted: trunk/devel/gdb/files/extrapatch-gdb-Makefile.in
===================================================================
--- trunk/devel/gdb/files/extrapatch-gdb-Makefile.in	2018-11-26 17:02:39 UTC (rev 24715)
+++ trunk/devel/gdb/files/extrapatch-gdb-Makefile.in	2018-11-26 17:06:28 UTC (rev 24716)
@@ -1,39 +0,0 @@
---- gdb/Makefile.in.orig	2013-04-02 19:38:43.000000000 +0200
-+++ gdb/Makefile.in	2013-05-18 13:08:47.000000000 +0200
-@@ -566,8 +566,8 @@
- 	moxie-tdep.o \
- 	mt-tdep.o \
- 	nto-tdep.o \
--	ppc-linux-tdep.o ppcnbsd-tdep.o ppcobsd-tdep.o ppc-sysv-tdep.o \
--	ppc64-tdep.o rl78-tdep.o \
-+	ppc-linux-tdep.o ppcfbsd-tdep.o ppcnbsd-tdep.o ppcobsd-tdep.o \
-+	ppc-sysv-tdep.o ppc64-tdep.o rl78-tdep.o \
- 	rs6000-aix-tdep.o rs6000-tdep.o ppc-ravenscar-thread.o \
- 	rs6000-lynx178-tdep.o \
- 	rx-tdep.o \
-@@ -585,6 +585,7 @@
- 	xtensa-config.o xtensa-tdep.o xtensa-linux-tdep.o \
- 	glibc-tdep.o \
- 	bsd-uthread.o \
-+	fbsd-threads.o \
- 	nbsd-tdep.o obsd-tdep.o \
- 	sol2-tdep.o \
- 	solib-frv.o solib-irix.o solib-svr4.o \
-@@ -1164,7 +1164,7 @@
- # Removing the old gdb first works better if it is running, at least on SunOS.
- gdb$(EXEEXT): gdb.o $(LIBGDB_OBS) $(ADD_DEPS) $(CDEPS) $(TDEPLIBS)
- 	rm -f gdb$(EXEEXT)
--	$(CC_LD) $(INTERNAL_LDFLAGS) $(WIN32LDAPP) \
-+	$(CC_LD) $(INTERNAL_LDFLAGS) $(WIN32LDAPP) -Wl,-E \
- 		-o gdb$(EXEEXT) gdb.o $(LIBGDB_OBS) \
- 		$(TDEPLIBS) $(TUI_LIBRARY) $(CLIBS) $(LOADLIBES)
- 
-@@ -1429,7 +1429,7 @@
- 	armnbsd-nat.c armbsd-tdep.c armnbsd-tdep.c armobsd-tdep.c \
- 	avr-tdep.c \
- 	bfin-linux-tdep.c bfin-tdep.c \
--	bsd-uthread.c bsd-kvm.c \
-+	bsd-uthread.c fbsd-threads.c bsd-kvm.c \
- 	core-regset.c \
- 	dcache.c dicos-tdep.c darwin-nat.c \
- 	exec.c \

Deleted: trunk/devel/gdb/files/extrapatch-gdb-configure.tgt
===================================================================
--- trunk/devel/gdb/files/extrapatch-gdb-configure.tgt	2018-11-26 17:02:39 UTC (rev 24715)
+++ trunk/devel/gdb/files/extrapatch-gdb-configure.tgt	2018-11-26 17:06:28 UTC (rev 24716)
@@ -1,29 +0,0 @@
---- gdb/configure.tgt.orig	2013-03-05 14:37:10.000000000 +0100
-+++ gdb/configure.tgt	2013-05-18 13:11:06.000000000 +0200
-@@ -188,7 +188,7 @@
- i[34567]86-*-freebsd* | i[34567]86-*-kfreebsd*-gnu)
- 	# Target: FreeBSD/i386
- 	gdb_target_obs="i386-tdep.o i387-tdep.o i386bsd-tdep.o i386fbsd-tdep.o \
--			bsd-uthread.o solib-svr4.o"
-+			fbsd-threads.o solib-svr4.o"
- 	;;
- i[34567]86-*-netbsd* | i[34567]86-*-knetbsd*-gnu)
- 	# Target: NetBSD/i386
-@@ -398,7 +398,7 @@
- powerpc*-*-freebsd*)
- 	# Target: FreeBSD/powerpc
- 	gdb_target_obs="rs6000-tdep.o ppc-sysv-tdep.o ppc64-tdep.o \
--		        ppcfbsd-tdep.o solib-svr4.o \
-+		        ppcfbsd-tdep.o solib-svr4.o fbsd-threads.o \
- 			ravenscar-thread.o ppc-ravenscar-thread.o"
- 	;;
- 
-@@ -650,7 +650,7 @@
- 	# Target: FreeBSD/amd64
- 	gdb_target_obs="amd64-tdep.o amd64fbsd-tdep.o i386-tdep.o \
- 			i387-tdep.o i386bsd-tdep.o i386fbsd-tdep.o \
--			bsd-uthread.o solib-svr4.o"
-+			fbsd-threads.o solib-svr4.o"
- 	;;
- x86_64-*-mingw*)
-         # Target: MingW/amd64

Added: trunk/devel/gdb/files/extrapatch-kgdb
===================================================================
--- trunk/devel/gdb/files/extrapatch-kgdb	                        (rev 0)
+++ trunk/devel/gdb/files/extrapatch-kgdb	2018-11-26 17:06:28 UTC (rev 24716)
@@ -0,0 +1,457 @@
+diff --git gdb/Makefile.in gdb/Makefile.in
+index 13627e07e0..a72fd8fe0f 100644
+--- gdb/Makefile.in
++++ gdb/Makefile.in
+@@ -236,7 +236,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
+@@ -643,6 +644,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-linux-tdep.o \
+ 	aarch64-newlib-tdep.o \
+@@ -656,6 +658,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 \
+@@ -670,6 +673,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 \
+@@ -685,6 +689,7 @@ ALL_TARGET_OBS = \
+ 	arch/i386.o \
+ 	arch/ppc-linux-common.o \
+ 	arm-bsd-tdep.o \
++	arm-fbsd-kern.o \
+ 	arm-fbsd-tdep.o \
+ 	arm-linux-tdep.o \
+ 	arm-nbsd-tdep.o \
+@@ -699,6 +704,8 @@ ALL_TARGET_OBS = \
+ 	cris-linux-tdep.o \
+ 	cris-tdep.o \
+ 	dicos-tdep.o \
++	fbsd-kld.o \
++	fbsd-kthr.o \
+ 	fbsd-tdep.o \
+ 	frv-linux-tdep.o \
+ 	frv-tdep.o \
+@@ -715,6 +722,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 \
+@@ -738,6 +746,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 \
+@@ -755,6 +764,7 @@ ALL_TARGET_OBS = \
+ 	obsd-tdep.o \
+ 	or1k-tdep.o \
+ 	ppc-fbsd-tdep.o \
++	ppcfbsd-kern.o \
+ 	ppc-linux-tdep.o \
+ 	ppc-nbsd-tdep.o \
+ 	ppc-obsd-tdep.o \
+@@ -1611,7 +1621,7 @@ generated_files = \
+ # Flags needed to compile Python code
+ PYTHON_CFLAGS = @PYTHON_CFLAGS@
+ 
+-all: gdb$(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
+ 
+ # Rule for compiling .c files in the top-level gdb directory.
+@@ -1924,6 +1934,12 @@ ifneq ($(CODESIGN_CERT),)
+ 	$(ECHO_SIGN) $(CODESIGN) -s $(CODESIGN_CERT) gdb$(EXEEXT)
+ endif
+ 
++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
+@@ -1968,7 +1984,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
+-	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
+@@ -2183,6 +2199,7 @@ MAKEOVERRIDES =
+ 
+ ALLDEPFILES = \
+ 	aarch64-fbsd-nat.c \
++	aarch64-fbsd-kern.c \
+ 	aarch64-fbsd-tdep.c \
+ 	aarch64-linux-nat.c \
+ 	aarch64-linux-tdep.c \
+@@ -2200,6 +2217,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 \
+@@ -2214,6 +2232,7 @@ ALLDEPFILES = \
+ 	arc-tdep.c \
+ 	arm.c \
+ 	arm-bsd-tdep.c \
++	arm-fbsd-kern.c \
+ 	arm-fbsd-nat.c \
+ 	arm-fbsd-tdep.c \
+ 	arm-get-next-pcs.c \
+@@ -2233,6 +2252,9 @@ ALLDEPFILES = \
+ 	darwin-nat.c \
+ 	dicos-tdep.c \
+ 	exec.c \
++	fbsd-kld.c \
++	fbsd-kthr.c \
++	fbsd-kvm.c \
+ 	fbsd-nat.c \
+ 	fbsd-tdep.c \
+ 	fork-child.c \
+@@ -2254,6 +2276,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 \
+@@ -2293,6 +2316,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 \
+@@ -2310,6 +2334,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 \
+@@ -2355,6 +2380,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 \
+@@ -2643,7 +2669,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
+ 
+ # All the .deps files to include.
+diff --git gdb/config.in gdb/config.in
+index 527290296e..8e0e90fd67 100644
+--- gdb/config.in
++++ gdb/config.in
+@@ -228,6 +228,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 <langinfo.h> and nl_langinfo(CODESET). */
+ #undef HAVE_LANGINFO_CODESET
+ 
+diff --git gdb/configure gdb/configure
+index 3849b9494f..18d2e363dc 100755
+--- gdb/configure
++++ gdb/configure
+@@ -8082,6 +8082,66 @@ $as_echo "#define HAVE_KINFO_GETFILE 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 4c20ea5178..df156b484f 100644
+--- gdb/configure.ac
++++ gdb/configure.ac
+@@ -534,6 +534,11 @@ AC_SEARCH_LIBS(kinfo_getfile, util util-freebsd,
+   [AC_DEFINE(HAVE_KINFO_GETFILE, 1,
+             [Define to 1 if your system has the kinfo_getfile 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.nat gdb/configure.nat
+index 7611266d86..8656015365 100644
+--- gdb/configure.nat
++++ gdb/configure.nat
+@@ -62,7 +62,8 @@ case ${gdb_host} in
+ 	LOADLIBES='-ldl $(RDYNAMIC)'
+ 	;;
+     fbsd*)
+-	NATDEPFILES='fork-child.o fork-inferior.o inf-ptrace.o fbsd-nat.o'
++	NATDEPFILES='fork-child.o fork-inferior.o inf-ptrace.o fbsd-nat.o \
++		fbsd-kvm.o'
+ 	HAVE_NATIVE_GCORE_HOST=1
+ 	LOADLIBES='-lkvm'
+ 	;;
+diff --git gdb/configure.tgt gdb/configure.tgt
+index f197160896..ced1140328 100644
+--- gdb/configure.tgt
++++ gdb/configure.tgt
+@@ -94,7 +94,7 @@ esac
+ 
+ case "${targ}" in
+ *-*-freebsd* | *-*-kfreebsd*-gnu)
+-	os_obs="fbsd-tdep.o solib-svr4.o";;
++	os_obs="fbsd-tdep.o solib-svr4.o fbsd-kld.o fbsd-kthr.o";;
+ *-*-netbsd* | *-*-knetbsd*-gnu)
+ 	os_obs="nbsd-tdep.o solib-svr4.o";;
+ *-*-openbsd*)
+@@ -111,7 +111,7 @@ aarch64*-*-elf | aarch64*-*-rtems*)
+ 
+ aarch64*-*-freebsd*)
+ 	# Target: FreeBSD/aarch64
+-	gdb_target_obs="aarch64-fbsd-tdep.o"
++	gdb_target_obs="aarch64-fbsd-tdep.o aarch64-fbsd-kern.o"
+ 	;;
+ 
+ aarch64*-*-linux*)
+@@ -164,7 +164,7 @@ arm*-*-linux*)
+ 	;;
+ arm*-*-freebsd*)
+ 	# Target: FreeBSD/arm
+-	gdb_target_obs="arm-fbsd-tdep.o"
++	gdb_target_obs="arm-fbsd-tdep.o arm-fbsd-kern.o"
+ 	;;
+ arm*-*-netbsd* | arm*-*-knetbsd*-gnu)
+ 	# Target: NetBSD/arm
+@@ -251,7 +251,11 @@ i[34567]86-*-dicos*)
+ 	;;
+ i[34567]86-*-freebsd* | i[34567]86-*-kfreebsd*-gnu)
+ 	# 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 i386fbsd-kern.o"
++	if test "x$enable_64_bit_bfd" = "xyes"; then
++	    # Target: FreeBSD amd64
++	    gdb_target_obs="amd64fbsd-tdep.o amd64fbsd-kern.o ${gdb_target_obs}"
++	fi
+ 	;;
+ i[34567]86-*-netbsd* | i[34567]86-*-knetbsd*-gnu)
+ 	# Target: NetBSD/i386
+@@ -405,7 +409,7 @@ mips*-*-netbsd* | mips*-*-knetbsd*-gnu)
+ 	;;
+ mips*-*-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 mipsfbsd-kern.o"
+ 	gdb_sim=../sim/mips/libsim.a
+ 	;;
+ mips64*-*-openbsd*)
+@@ -464,7 +468,7 @@ or1k-*-* | or1knd-*-*)
+ powerpc*-*-freebsd*)
+ 	# Target: FreeBSD/powerpc
+ 	gdb_target_obs="rs6000-tdep.o ppc-sysv-tdep.o ppc64-tdep.o \
+-		        ppc-fbsd-tdep.o \
++		        ppc-fbsd-tdep.o ppcfbsd-kern.o \
+ 			ravenscar-thread.o ppc-ravenscar-thread.o"
+ 	;;
+ 
+@@ -587,6 +591,7 @@ sparc64-*-linux*)
+ sparc*-*-freebsd* | sparc*-*-kfreebsd*-gnu)
+ 	# Target: FreeBSD/sparc64
+ 	gdb_target_obs="sparc-tdep.o sparc64-tdep.o sparc64-fbsd-tdep.o \
++			sparc64fbsd-kern.o \
+ 			ravenscar-thread.o sparc-ravenscar-thread.o"
+ 	;;
+ sparc-*-netbsd* | sparc-*-knetbsd*-gnu)
+@@ -709,8 +714,8 @@ x86_64-*-linux*)
+ 	;;
+ x86_64-*-freebsd* | x86_64-*-kfreebsd*-gnu)
+ 	# Target: FreeBSD/amd64
+-	gdb_target_obs="amd64-fbsd-tdep.o ${i386_tobjs} \
+-			i386-bsd-tdep.o i386-fbsd-tdep.o"
++	gdb_target_obs="amd64-fbsd-tdep.o amd64fbsd-kern.o ${i386_tobjs} \
++			i386-bsd-tdep.o i386-fbsd-tdep.o i386fbsd-kern.o"
+ 	;;
+ x86_64-*-mingw* | x86_64-*-cygwin*)
+         # Target: MingW/amd64
+diff --git gdb/defs.h gdb/defs.h
+index fc4217005a..3d2eb6b1e9 100644
+--- gdb/defs.h
++++ gdb/defs.h
+@@ -481,6 +481,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/gnulib/configure gdb/gnulib/configure
+index a152abcb76..140c4ad6a8 100644
+--- gdb/gnulib/configure
++++ gdb/gnulib/configure
+@@ -17214,6 +17214,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
+index 7d0540b181..c61c518652 100644
+--- gdb/osabi.c
++++ gdb/osabi.c
+@@ -66,6 +66,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 f3f845aad6..7ca007a422 100644
+--- gdb/regcache.c
++++ gdb/regcache.c
+@@ -1035,6 +1035,22 @@ reg_buffer::raw_supply_zeroed (int regnum)
+   m_register_status[regnum] = REG_VALID;
+ }
+ 
++void
++reg_buffer::raw_supply_unsigned (int regnum, ULONGEST val)
++{
++  enum bfd_endian byte_order = gdbarch_byte_order (m_descr->gdbarch);
++  gdb_byte *regbuf;
++  size_t regsize;
++
++  assert_regnum (regnum);
++
++  regbuf = register_buffer (regnum);
++  regsize = m_descr->sizeof_register[regnum];
++
++  store_unsigned_integer (regbuf, regsize, byte_order, val);
++  m_register_status[regnum] = REG_VALID;
++}
++
+ /* See common/common-regcache.h.  */
+ 
+ void
+diff --git gdb/regcache.h gdb/regcache.h
+index 4a45f33871..94f542c087 100644
+--- gdb/regcache.h
++++ gdb/regcache.h
+@@ -207,6 +207,8 @@ public:
+      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_unsigned (int regnum, ULONGEST val);
++
+   void invalidate (int regnum);
+ 
+   virtual ~reg_buffer () = default;


Property changes on: trunk/devel/gdb/files/extrapatch-kgdb
___________________________________________________________________
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
Deleted: trunk/devel/gdb/files/fbsd-threads.c
===================================================================
--- trunk/devel/gdb/files/fbsd-threads.c	2018-11-26 17:02:39 UTC (rev 24715)
+++ trunk/devel/gdb/files/fbsd-threads.c	2018-11-26 17:06:28 UTC (rev 24716)
@@ -1,1660 +0,0 @@
-/* $FreeBSD$ */
-/* FreeBSD libthread_db assisted debugging support.
-   Copyright 1999, 2000, 2001 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 2 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, write to the Free Software
-   Foundation, Inc., 59 Temple Place - Suite 330,
-   Boston, MA 02111-1307, USA.  */
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <err.h>
-
-#include <sys/param.h>
-#include <sys/sysctl.h>
-#include <sys/user.h>
-#include <libutil.h>
-
-#include <dlfcn.h>
-#include <sys/types.h>
-#include <sys/ptrace.h>
-#include <signal.h>
-
-#include "proc_service.h"
-#include "thread_db.h"
-
-#include "defs.h"
-#include "bfd.h"
-#include "elf-bfd.h"
-#include "gdb_assert.h"
-#include "gdbcore.h"
-#include "gdbthread.h"
-#include "inferior.h"
-#include "objfiles.h"
-#include "regcache.h"
-#include "symfile.h"
-#include "symtab.h"
-#include "target.h"
-#include "observer.h"
-#include "gdbcmd.h"
-#include "gregset.h"
-#ifdef PT_GETXMMREGS
-#include "i387-tdep.h"
-#endif
-
-#define LIBTHREAD_DB_SO "libthread_db.so"
-
-struct private_thread_info
-{
-  char *lwp_name;
-};
-
-struct ps_prochandle
-{
-  pid_t pid;
-};
-
-/* Defining the prototype of _initialize_thread_db to remove warning */
-extern initialize_file_ftype _initialize_thread_db;
-
-/* This module's target vectors.  */
-static struct target_ops fbsd_thread_ops;
-
-/* Non-zero if there is a thread module */
-static int fbsd_thread_present;
-
-/* Non-zero if we're using this module's target vector.  */
-static int fbsd_thread_active;
-
-/* Non-zero if we have to keep this module's target vector active
-   across re-runs.  */
-static int keep_thread_db;
-
-/* Structure that identifies the child process for the
-   <proc_service.h> interface.  */
-static struct ps_prochandle proc_handle;
-
-/* Connection to the libthread_db library.  */
-static td_thragent_t *thread_agent;
-
-/* The last thread we are single stepping */
-static ptid_t last_single_step_thread;
-
-
-/* Pointers to the libthread_db functions.  */
-static td_err_e (*td_init_p) (void);
-
-static td_err_e (*td_ta_new_p) (struct ps_prochandle *ps, td_thragent_t **ta);
-static td_err_e (*td_ta_delete_p) (td_thragent_t *);
-static td_err_e (*td_ta_map_id2thr_p) (const td_thragent_t *ta, thread_t pt,
-				       td_thrhandle_t *__th);
-static td_err_e (*td_ta_map_lwp2thr_p) (const td_thragent_t *ta, lwpid_t lwpid,
-					td_thrhandle_t *th);
-static td_err_e (*td_ta_thr_iter_p) (const td_thragent_t *ta,
-				     td_thr_iter_f *callback,
-				     void *cbdata_p, td_thr_state_e state,
-				     int ti_pri, sigset_t *ti_sigmask_p,
-				     unsigned int ti_user_flags);
-static td_err_e (*td_ta_event_addr_p) (const td_thragent_t *ta,
-				       td_event_e event, td_notify_t *ptr);
-static td_err_e (*td_ta_set_event_p) (const td_thragent_t *ta,
-				      td_thr_events_t *event);
-static td_err_e (*td_ta_event_getmsg_p) (const td_thragent_t *ta,
-					 td_event_msg_t *msg);
-static td_err_e (*td_thr_get_info_p) (const td_thrhandle_t *th,
-				      td_thrinfo_t *infop);
-#ifdef PT_GETXMMREGS
-static td_err_e (*td_thr_getxmmregs_p) (const td_thrhandle_t *th,
-					char *regset);
-#endif
-static td_err_e (*td_thr_getfpregs_p) (const td_thrhandle_t *th,
-				       prfpregset_t *regset);
-static td_err_e (*td_thr_getgregs_p) (const td_thrhandle_t *th,
-				      prgregset_t gregs);
-#ifdef PT_GETXMMREGS
-static td_err_e (*td_thr_setxmmregs_p) (const td_thrhandle_t *th,
-					const char *fpregs);
-#endif
-static td_err_e (*td_thr_setfpregs_p) (const td_thrhandle_t *th,
-				       const prfpregset_t *fpregs);
-static td_err_e (*td_thr_setgregs_p) (const td_thrhandle_t *th,
-				      prgregset_t gregs);
-static td_err_e (*td_thr_event_enable_p) (const td_thrhandle_t *th, int event);
-
-static td_err_e (*td_thr_sstep_p) (td_thrhandle_t *th, int step);
-
-static td_err_e (*td_ta_tsd_iter_p) (const td_thragent_t *ta,
-				 td_key_iter_f *func, void *data);
-static td_err_e (*td_thr_tls_get_addr_p) (const td_thrhandle_t *th,
-                                          void *map_address,
-                                          size_t offset, void **address);
-static td_err_e (*td_thr_dbsuspend_p) (const td_thrhandle_t *);
-static td_err_e (*td_thr_dbresume_p) (const td_thrhandle_t *);
-
-static CORE_ADDR td_create_bp_addr;
-
-/* Location of the thread death event breakpoint.  */
-static CORE_ADDR td_death_bp_addr;
-
-/* Prototypes for local functions.  */
-static void fbsd_find_lwp_name(long lwpid, struct private_thread_info *info);
-static void fbsd_thread_find_new_threads (struct target_ops *ops);
-static int fbsd_thread_alive (struct target_ops *ops, ptid_t ptid);
-static void attach_thread (ptid_t ptid, const td_thrhandle_t *th_p,
-               const td_thrinfo_t *ti_p, int verbose);
-static void fbsd_thread_detach (struct target_ops *ops, char *args,
-				int from_tty);
-
-CORE_ADDR fbsd_thread_get_local_address(struct target_ops *ops,
-		ptid_t ptid, CORE_ADDR lm, CORE_ADDR offset);
-
-/* Building process ids.  */
-
-#define GET_PID(ptid)		ptid_get_pid (ptid)
-#define GET_LWP(ptid)		ptid_get_lwp (ptid)
-#define GET_THREAD(ptid)	ptid_get_tid (ptid)
-
-#define IS_LWP(ptid)		(GET_LWP (ptid) != 0)
-#define IS_THREAD(ptid)		(GET_THREAD (ptid) != 0)
-
-#define BUILD_LWP(lwp, pid)	ptid_build (pid, lwp, 0)
-#define BUILD_THREAD(tid, pid)	ptid_build (pid, 0, tid)
-
-static void
-free_private_thread_info(struct private_thread_info *info)
-{
-  xfree(info->lwp_name);
-  xfree(info);
-}
-
-static char *
-thread_db_err_str (td_err_e err)
-{
-  static char buf[64];
-
-  switch (err)
-    {
-    case TD_OK:
-      return "generic 'call succeeded'";
-    case TD_ERR:
-      return "generic error";
-    case TD_NOTHR:
-      return "no thread to satisfy query";
-    case TD_NOSV:
-      return "no sync handle to satisfy query";
-    case TD_NOLWP:
-      return "no LWP to satisfy query";
-    case TD_BADPH:
-      return "invalid process handle";
-    case TD_BADTH:
-      return "invalid thread handle";
-    case TD_BADSH:
-      return "invalid synchronization handle";
-    case TD_BADTA:
-      return "invalid thread agent";
-    case TD_BADKEY:
-      return "invalid key";
-    case TD_NOMSG:
-      return "no event message for getmsg";
-    case TD_NOFPREGS:
-      return "FPU register set not available";
-    case TD_NOLIBTHREAD:
-      return "application not linked with libthread";
-    case TD_NOEVENT:
-      return "requested event is not supported";
-    case TD_NOCAPAB:
-      return "capability not available";
-    case TD_DBERR:
-      return "debugger service failed";
-    case TD_NOAPLIC:
-      return "operation not applicable to";
-    case TD_NOTSD:
-      return "no thread-specific data for this thread";
-    case TD_MALLOC:
-      return "malloc failed";
-    case TD_PARTIALREG:
-      return "only part of register set was written/read";
-    case TD_NOXREGS:
-      return "X register set not available for this thread";
-    default:
-      snprintf (buf, sizeof (buf), "unknown thread_db error '%d'", err);
-      return buf;
-    }
-}
-
-static char *
-thread_db_state_str (td_thr_state_e state)
-{
-  static char buf[64];
-
-  switch (state)
-    {
-    case TD_THR_STOPPED:
-      return "stopped by debugger";
-    case TD_THR_RUN:
-      return "runnable";
-    case TD_THR_ACTIVE:
-      return "active";
-    case TD_THR_ZOMBIE:
-      return "zombie";
-    case TD_THR_SLEEP:
-      return "sleeping";
-    case TD_THR_STOPPED_ASLEEP:
-      return "stopped by debugger AND blocked";
-    default:
-      snprintf (buf, sizeof (buf), "unknown thread_db state %d", state);
-      return buf;
-    }
-}
-
-/* Convert LWP to user-level thread id. */
-static ptid_t
-thread_from_lwp (ptid_t ptid, td_thrhandle_t *th, td_thrinfo_t *ti)
-{
-  td_err_e err;
-
-  gdb_assert (IS_LWP (ptid));
-
-  if (fbsd_thread_active)
-    {
-      err = td_ta_map_lwp2thr_p (thread_agent, GET_LWP (ptid), th);
-      if (err == TD_OK)
-        {
-          err = td_thr_get_info_p (th, ti);
-          if (err != TD_OK)
-            error ("Cannot get thread info: %s", thread_db_err_str (err));
-          return BUILD_THREAD (ti->ti_tid, GET_PID (ptid));
-        }
-    }
-
-  /* the LWP is not mapped to user thread */
-  return BUILD_LWP (GET_LWP (ptid), GET_PID (ptid));
-}
-
-static void
-fbsd_core_get_first_lwp (bfd *abfd, asection *asect, void *obj)
-{
-  if (strncmp (bfd_section_name (abfd, asect), ".reg/", 5) != 0)
-    return;
-
-  if (*(lwpid_t *)obj != 0)
-    return;
-
-  *(lwpid_t *)obj = atoi (bfd_section_name (abfd, asect) + 5);
-}
-
-static long
-get_current_lwp (int pid)
-{
-  struct ptrace_lwpinfo pl;
-  lwpid_t lwpid;
-
-  if (!target_has_execution)
-    {
-      lwpid = 0;
-      bfd_map_over_sections (core_bfd, fbsd_core_get_first_lwp, &lwpid);
-      return lwpid;
-    }
-  if (ptrace (PT_LWPINFO, pid, (caddr_t)&pl, sizeof(pl)))
-    perror_with_name("PT_LWPINFO");
-
-  return (long)pl.pl_lwpid;
-}
-
-static void
-get_current_thread ()
-{
-  td_thrhandle_t th;
-  td_thrinfo_t ti;
-  long lwp;
-  ptid_t tmp, ptid;
-
-  lwp = get_current_lwp (proc_handle.pid);
-  tmp = BUILD_LWP (lwp, proc_handle.pid);
-  ptid = thread_from_lwp (tmp, &th, &ti);
-  if (!in_thread_list (ptid))
-    {
-      attach_thread (ptid, &th, &ti, 1);
-    }
-  inferior_ptid = ptid;
-}
-
-static CORE_ADDR
-extract_func_ptr(void *value)
-{
-
-  return (extract_typed_address
-	  ((gdb_byte *)value,
-	   builtin_type (target_gdbarch ())->builtin_func_ptr));
-}
-
-static CORE_ADDR
-extract_data_ptr(void *value)
-{
-
-  return (extract_typed_address
-	  ((gdb_byte *)value,
-	   builtin_type (target_gdbarch ())->builtin_data_ptr));
-}
-
-static td_err_e
-enable_thread_event (td_thragent_t *thread_agent, int event, CORE_ADDR *bp)
-{
-  td_notify_t notify;
-  td_err_e err;
-
-  /* Get the breakpoint address for thread EVENT.  */
-  err = td_ta_event_addr_p (thread_agent, event, &notify);
-  if (err != TD_OK)
-    return err;
-
-  /* Set up the breakpoint.  */
-  (*bp) = (gdbarch_convert_from_func_ptr_addr
-	   (target_gdbarch (),
-	    extract_func_ptr(&notify.u.bptaddr),
-	    &current_target));
-  create_thread_event_breakpoint (target_gdbarch (), (*bp));
-
-  return TD_OK;
-}
-
-static void
-enable_thread_event_reporting (void)
-{
-  td_thr_events_t events;
-  td_notify_t notify;
-  td_err_e err;
-
-  /* We cannot use the thread event reporting facility if these
-     functions aren't available.  */
-  if (td_ta_event_addr_p == NULL || td_ta_set_event_p == NULL
-      || td_ta_event_getmsg_p == NULL || td_thr_event_enable_p == NULL)
-    return;
-
-  /* Set the process wide mask saying which events we're interested in.  */
-  td_event_emptyset (&events);
-  td_event_addset (&events, TD_CREATE);
-  td_event_addset (&events, TD_DEATH);
-
-  err = td_ta_set_event_p (thread_agent, &events);
-  if (err != TD_OK)
-    {
-      warning ("Unable to set global thread event mask: %s",
-	       thread_db_err_str (err));
-      return;
-    }
-
-  /* Delete previous thread event breakpoints, if any.  */
-  remove_thread_event_breakpoints ();
-  td_create_bp_addr = 0;
-  td_death_bp_addr = 0;
-
-  /* Set up the thread creation event.  */
-  err = enable_thread_event (thread_agent, TD_CREATE, &td_create_bp_addr);
-  if (err != TD_OK)
-    {
-      warning ("Unable to get location for thread creation breakpoint: %s",
-	       thread_db_err_str (err));
-      return;
-    }
-
-  /* Set up the thread death event.  */
-  err = enable_thread_event (thread_agent, TD_DEATH, &td_death_bp_addr);
-  if (err != TD_OK)
-    {
-      warning ("Unable to get location for thread death breakpoint: %s",
-	       thread_db_err_str (err));
-      return;
-    }
-}
-
-static void
-disable_thread_event_reporting (void)
-{
-  td_thr_events_t events;
-
-  /* Set the process wide mask saying we aren't interested in any
-     events anymore.  */
-  td_event_emptyset (&events);
-  td_ta_set_event_p (thread_agent, &events);
-
-  td_create_bp_addr = 0;
-  td_death_bp_addr = 0;
-}
-
-static void
-fbsd_thread_activate (void)
-{
-  fbsd_thread_active = 1;
-  init_thread_list();
-  if (target_has_execution)
-    enable_thread_event_reporting ();
-  fbsd_thread_find_new_threads (NULL);
-  get_current_thread ();
-}
-
-static void
-fbsd_thread_deactivate (void)
-{
-  if (target_has_execution)
-    disable_thread_event_reporting();
-  td_ta_delete_p (thread_agent);
-
-  inferior_ptid = pid_to_ptid (proc_handle.pid);
-  proc_handle.pid = 0;
-  fbsd_thread_active = 0;
-  fbsd_thread_present = 0;
-}
-
-static void
-check_for_thread_db (void)
-{
-  td_err_e err;
-
-  if (td_ta_new_p == NULL)
-    return;
-
-  /* Don't try to attach to a dead target if there is no core file. */
-  if (!target_has_execution && core_bfd == NULL)
-    return;
-
-  /* Nothing to do.  The thread library was already detected and the
-     target vector was already activated.  */
-  if (fbsd_thread_active)
-    return;
-
-  /* Now, initialize libthread_db.  This needs to be done after the
-     shared libraries are located because it needs information from
-     the user's thread library.  */
-
-  err = td_init_p ();
-  if (err != TD_OK)
-    {
-      warning ("Cannot initialize libthread_db: %s", thread_db_err_str (err));
-      return;
-    }
-
-  /* Initialize the structure that identifies the child process.  Note
-     that at this point there is no guarantee that we actually have a
-     child process.  */
-  proc_handle.pid = GET_PID (inferior_ptid);
-
-  /* Now attempt to open a connection to the thread library.  */
-  err = td_ta_new_p (&proc_handle, &thread_agent);
-  switch (err)
-    {
-    case TD_NOLIBTHREAD:
-      /* No thread library was detected.  */
-      break;
-
-    case TD_OK:
-      /* The thread library was detected.  Activate the thread_db target.  */
-      push_target(&fbsd_thread_ops);
-      fbsd_thread_present = 1;
-      fbsd_thread_activate();
-
-      break;
-
-    default:
-      warning ("Cannot initialize thread debugging library: %s",
-               thread_db_err_str (err));
-      break;
-    }
-}
-
-static void
-fbsd_thread_new_objfile (struct objfile *objfile)
-{
-  if (objfile != NULL)
-    check_for_thread_db ();
-}
-
-static void
-fbsd_thread_detach (struct target_ops *ops, char *args, int from_tty)
-{
-  struct target_ops *beneath = find_target_beneath (ops);
-
-  fbsd_thread_deactivate ();
-
-  /* Delete thread event breakpoints, if any.  */
-  remove_thread_event_breakpoints ();
-
-  unpush_target (&fbsd_thread_ops);
-
-  beneath->to_detach (beneath, args, from_tty);
-}
-
-static int
-suspend_thread_callback (const td_thrhandle_t *th_p, void *data)
-{
-  int err = td_thr_dbsuspend_p (th_p);
-  if (err != 0)
-	fprintf_filtered(gdb_stderr, "%s %s\n", __func__, thread_db_err_str (err));
-  return (err);
-}
-
-static int
-resume_thread_callback (const td_thrhandle_t *th_p, void *data)
-{
-  int err = td_thr_dbresume_p (th_p);
-  if (err != 0)
-	fprintf_filtered(gdb_stderr, "%s %s\n", __func__, thread_db_err_str (err));
-  return (err);
-}
-
-static void
-fbsd_thread_resume (struct target_ops *ops,
-		    ptid_t ptid, int step, enum gdb_signal signo)
-{
-  struct target_ops *beneath = find_target_beneath (ops);
-  td_thrhandle_t th;
-  td_thrinfo_t ti;
-  ptid_t work_ptid;
-  int resume_all, ret;
-  long lwp, thvalid = 0;
-
-  if (!fbsd_thread_active)
-    {
-      // XXX: I don't think this can happen
-      printf_unfiltered ("%s: called without active threads\n", __func__);
-      beneath->to_resume (beneath, ptid, step, signo);
-      return;
-    }
-
-  if (GET_PID(ptid) != -1 && step != 0)
-    {
-      resume_all = 0;
-      work_ptid = ptid;
-    }
-  else
-    {
-      resume_all = 1;
-      work_ptid = inferior_ptid;
-    }
-
-  lwp = GET_LWP (work_ptid);
-  if (lwp == 0)
-    {
-      /* check user thread */
-      ret = td_ta_map_id2thr_p (thread_agent, GET_THREAD(work_ptid), &th);
-      if (ret)
-        error ("%s: %s", __func__, thread_db_err_str (ret));
-
-      /* For M:N thread, we need to tell UTS to set/unset single step
-         flag at context switch time, the flag will be written into
-         thread mailbox. This becauses some architecture may not have
-         machine single step flag in ucontext, so we put the flag in mailbox,
-         when the thread switches back, kse_switchin restores the single step
-         state.  */
-      ret = td_thr_sstep_p (&th, step);
-      if (ret)
-        error ("%s: %s", __func__, thread_db_err_str (ret));
-      ret = td_thr_get_info_p (&th, &ti);
-      if (ret)
-        error ("%s: %s", __func__, thread_db_err_str (ret));
-      thvalid = 1;
-      lwp = ti.ti_lid;
-    }
-
-  if (lwp)
-    {
-      int req = step ? PT_SETSTEP : PT_CLEARSTEP;
-      if (ptrace (req, (pid_t) lwp, (caddr_t) 1, gdb_signal_to_host(signo)))
-        perror_with_name ("PT_SETSTEP/PT_CLEARSTEP");
-    }
-
-  if (!ptid_equal (last_single_step_thread, null_ptid))
-    {
-       ret = td_ta_thr_iter_p (thread_agent, resume_thread_callback, NULL,
-          TD_THR_ANY_STATE, TD_THR_LOWEST_PRIORITY,
-          TD_SIGNO_MASK, TD_THR_ANY_USER_FLAGS);
-      if (ret != TD_OK)
-        error ("resume error: %s", thread_db_err_str (ret));
-    }
-
-  if (!resume_all)
-    {
-      ret = td_ta_thr_iter_p (thread_agent, suspend_thread_callback, NULL,
-          TD_THR_ANY_STATE, TD_THR_LOWEST_PRIORITY,
-          TD_SIGNO_MASK, TD_THR_ANY_USER_FLAGS);
-      if (ret != TD_OK)
-        error ("suspend error: %s", thread_db_err_str (ret));
-      last_single_step_thread = work_ptid;
-    }
-  else
-    last_single_step_thread = null_ptid;
-
-  if (thvalid)
-    {
-      ret = td_thr_dbresume_p (&th);
-      if (ret != TD_OK)
-        error ("resume error: %s", thread_db_err_str (ret));
-    }
-  else
-    {
-      /* it is not necessary, put it here for completness */
-      ret = ptrace(PT_RESUME, lwp, 0, 0);
-    }
-
-  /* now continue the process, suspended thread wont run */
-  if (ptrace (PT_CONTINUE, proc_handle.pid , (caddr_t)1,
-	      gdb_signal_to_host(signo)))
-    perror_with_name ("PT_CONTINUE");
-}
-
-static void
-attach_thread (ptid_t ptid, const td_thrhandle_t *th_p,
-               const td_thrinfo_t *ti_p, int verbose)
-{
-  struct private_thread_info *private;
-  struct thread_info *tp = NULL;
-  char *lwpstr = NULL;
-  td_err_e err;
-
-  /* Add the thread to GDB's thread list.  */
-  if (!in_thread_list (ptid))
-  {
-    /* Add thread with info */
-    private = xmalloc(sizeof(struct private_thread_info));
-    gdb_assert(private != NULL);
-    // Thread name is assigned when printed
-    memset(private, 0, sizeof(struct private_thread_info));
-
-    tp = add_thread_with_info(ptid, private);
-    tp->private = private;
-    tp->private_dtor = free_private_thread_info;
-  }
-
-  if (ti_p->ti_state == TD_THR_UNKNOWN || ti_p->ti_state == TD_THR_ZOMBIE)
-    return;                     /* A zombie thread -- do not attach.  */
-
-  if (! IS_THREAD(ptid))
-    return;
-  if (!target_has_execution)
-    return;
-  /* Enable thread event reporting for this thread. */
-  err = td_thr_event_enable_p (th_p, 1);
-  if (err != TD_OK)
-    error ("Cannot enable thread event reporting for %s: %s",
-           target_pid_to_str (ptid), thread_db_err_str (err));
-}
-
-static void
-detach_thread (ptid_t ptid, int verbose)
-{
-  if (verbose)
-    printf_unfiltered ("[%s exited]\n", target_pid_to_str (ptid));
-}
-
-static void
-check_event (ptid_t ptid)
-{
-  struct regcache *regcache = get_thread_regcache (ptid);
-  struct gdbarch *gdbarch = get_regcache_arch (regcache);
-  td_event_msg_t msg;
-  td_thrinfo_t ti;
-  td_err_e err;
-  CORE_ADDR stop_pc;
-  int loop = 0;
-
-  /* Bail out early if we're not at a thread event breakpoint.  */
-  stop_pc = regcache_read_pc (regcache)
-	    - gdbarch_decr_pc_after_break (gdbarch);
-  if (stop_pc != td_create_bp_addr && stop_pc != td_death_bp_addr)
-    return;
-  loop = 1;
-
-  do
-    {
-      err = td_ta_event_getmsg_p (thread_agent, &msg);
-      if (err != TD_OK)
-        {
-	  if (err == TD_NOMSG)
-	    return;
-          error ("Cannot get thread event message: %s",
-		 thread_db_err_str (err));
-        }
-      err = td_thr_get_info_p ((void *)(uintptr_t)msg.th_p, &ti);
-      if (err != TD_OK)
-        error ("Cannot get thread info: %s", thread_db_err_str (err));
-      ptid = BUILD_THREAD (ti.ti_tid, GET_PID (ptid));
-      switch (msg.event)
-        {
-        case TD_CREATE:
-          /* We may already know about this thread, for instance when the
-             user has issued the `info threads' command before the SIGTRAP
-             for hitting the thread creation breakpoint was reported.  */
-          attach_thread (ptid, (void *)(uintptr_t)msg.th_p, &ti, 1);
-          break;
-       case TD_DEATH:
-         if (!in_thread_list (ptid))
-           error ("Spurious thread death event.");
-         detach_thread (ptid, 1);
-         break;
-       default:
-          error ("Spurious thread event.");
-       }
-    }
-  while (loop);
-}
-
-static ptid_t
-fbsd_thread_wait (struct target_ops *ops,
-		  ptid_t ptid, struct target_waitstatus *ourstatus, int options)
-{
-  struct target_ops *beneath = find_target_beneath (ops);
-  ptid_t ret;
-  long lwp;
-  CORE_ADDR stop_pc;
-  td_thrhandle_t th;
-  td_thrinfo_t ti;
-
-  ret = beneath->to_wait (beneath, ptid, ourstatus, options);
-  if (GET_PID(ret) >= 0 && ourstatus->kind == TARGET_WAITKIND_STOPPED)
-    {
-      lwp = get_current_lwp (GET_PID(ret));
-      ret = thread_from_lwp (BUILD_LWP(lwp, GET_PID(ret)),
-         &th, &ti);
-      if (!in_thread_list(ret)) {
-        /*
-         * We have to enable event reporting for initial thread
-         * which was not mapped before.
-	 */
-        attach_thread(ret, &th, &ti, 1);
-      }
-      if (ourstatus->value.sig == GDB_SIGNAL_TRAP)
-        check_event(ret);
-      /* this is a hack, if an event won't cause gdb to stop, for example,
-         SIGALRM, gdb resumes the process immediatly without setting
-         inferior_ptid to the new thread returned here, this is a bug
-         because inferior_ptid may already not exist there, and passing
-         a non-existing thread to fbsd_thread_resume causes error. However,
-         if the exiting thread is the currently selected thread,
-         then that is handled later in handle_inferior_event(), and we must
-         not delete the currently selected thread.
-      */
-      if (!fbsd_thread_alive (ops, inferior_ptid) && !ptid_equal(inferior_ptid, ret))
-        {
-          ptid_t save_ptid;
-          save_ptid = inferior_ptid;
-          inferior_ptid = ret;
-          delete_thread (save_ptid);
-        }
-    }
-
-  return (ret);
-}
-
-static void
-fbsd_lwp_fetch_registers (struct target_ops *ops,
-			  struct regcache *regcache, int regnum)
-{
-  gregset_t gregs;
-  fpregset_t fpregs;
-  lwpid_t lwp;
-#ifdef PT_GETXMMREGS
-  char xmmregs[512];
-#endif
-
-  if (!target_has_execution)
-    {
-      struct target_ops *beneath = find_target_beneath (ops);
-
-      beneath->to_fetch_registers (ops, regcache, regnum);
-      return;
-    }
-
-  lwp = GET_LWP (inferior_ptid);
-
-  if (ptrace (PT_GETREGS, lwp, (caddr_t) &gregs, 0) == -1)
-    error ("Cannot get lwp %d registers: %s\n", lwp, safe_strerror (errno));
-  supply_gregset (regcache, &gregs);
-
-#ifdef PT_GETXMMREGS
-  if (ptrace (PT_GETXMMREGS, lwp, xmmregs, 0) == 0)
-    {
-      i387_supply_fxsave (regcache, -1, xmmregs);
-    }
-  else
-    {
-#endif
-      if (ptrace (PT_GETFPREGS, lwp, (caddr_t) &fpregs, 0) == -1)
-	error ("Cannot get lwp %d registers: %s\n ", lwp, safe_strerror (errno));
-      supply_fpregset (regcache, &fpregs);
-#ifdef PT_GETXMMREGS
-    }
-#endif
-}
-
-static void
-fbsd_thread_fetch_registers (struct target_ops *ops,
-			     struct regcache *regcache, int regnum)
-{
-  prgregset_t gregset;
-  prfpregset_t fpregset;
-  td_thrhandle_t th;
-  td_err_e err;
-#ifdef PT_GETXMMREGS
-  char xmmregs[512];
-#endif
-
-  if (!IS_THREAD (inferior_ptid))
-    {
-      fbsd_lwp_fetch_registers (ops, regcache, regnum);
-      return;
-    }
-
-  err = td_ta_map_id2thr_p (thread_agent, GET_THREAD (inferior_ptid), &th);
-  if (err != TD_OK)
-    error ("Cannot find thread %d: Thread ID=%ld, %s",
-           pid_to_thread_id (inferior_ptid),
-           GET_THREAD (inferior_ptid), thread_db_err_str (err));
-
-  err = td_thr_getgregs_p (&th, gregset);
-  if (err != TD_OK)
-    error ("Cannot fetch general-purpose registers for thread %d: Thread ID=%ld, %s",
-           pid_to_thread_id (inferior_ptid),
-           GET_THREAD (inferior_ptid), thread_db_err_str (err));
-#ifdef PT_GETXMMREGS
-  err = td_thr_getxmmregs_p (&th, xmmregs);
-  if (err == TD_OK)
-    {
-      i387_supply_fxsave (regcache, -1, xmmregs);
-    }
-  else
-    {
-#endif
-      err = td_thr_getfpregs_p (&th, &fpregset);
-      if (err != TD_OK)
-	error ("Cannot get floating-point registers for thread %d: Thread ID=%ld, %s",
-	       pid_to_thread_id (inferior_ptid),
-	       GET_THREAD (inferior_ptid), thread_db_err_str (err));
-      supply_fpregset (regcache, &fpregset);
-#ifdef PT_GETXMMREGS
-    }
-#endif
-
-  supply_gregset (regcache, gregset);
-}
-
-static void
-fbsd_lwp_store_registers (struct target_ops *ops,
-			  struct regcache *regcache, int regnum)
-{
-  gregset_t gregs;
-  fpregset_t fpregs;
-  lwpid_t lwp;
-#ifdef PT_GETXMMREGS
-  char xmmregs[512];
-#endif
-
-  /* FIXME, is it possible ? */
-  if (!IS_LWP (inferior_ptid))
-    {
-      struct target_ops *beneath = find_target_beneath (ops);
-
-      beneath->to_store_registers (ops, regcache, regnum);
-      return ;
-    }
-
-  lwp = GET_LWP (inferior_ptid);
-  if (regnum != -1)
-    if (ptrace (PT_GETREGS, lwp, (caddr_t) &gregs, 0) == -1)
-      error ("Cannot get lwp %d registers: %s\n", lwp, safe_strerror (errno));
-
-  fill_gregset (regcache, &gregs, regnum);
-  if (ptrace (PT_SETREGS, lwp, (caddr_t) &gregs, 0) == -1)
-      error ("Cannot set lwp %d registers: %s\n", lwp, safe_strerror (errno));
-
-#ifdef PT_GETXMMREGS
-  if (regnum != -1)
-    if (ptrace (PT_GETXMMREGS, lwp, xmmregs, 0) == -1)
-      goto noxmm;
-
-  i387_collect_fxsave (regcache, regnum, xmmregs);
-  if (ptrace (PT_SETXMMREGS, lwp, xmmregs, 0) == -1)
-    goto noxmm;
-
-  return;
-
-noxmm:
-#endif
-
-  if (regnum != -1)
-    if (ptrace (PT_GETFPREGS, lwp, (caddr_t) &fpregs, 0) == -1)
-      error ("Cannot get lwp %d float registers: %s\n", lwp,
-             safe_strerror (errno));
-
-  fill_fpregset (regcache, &fpregs, regnum);
-  if (ptrace (PT_SETFPREGS, lwp, (caddr_t) &fpregs, 0) == -1)
-     error ("Cannot set lwp %d float registers: %s\n", lwp,
-            safe_strerror (errno));
-}
-
-static void
-fbsd_thread_store_registers (struct target_ops *ops,
-			     struct regcache *regcache, int regnum)
-{
-  prgregset_t gregset;
-  prfpregset_t fpregset;
-  td_thrhandle_t th;
-  td_err_e err;
-#ifdef PT_GETXMMREGS
-  char xmmregs[512];
-#endif
-
-  if (!IS_THREAD (inferior_ptid))
-    {
-      fbsd_lwp_store_registers (ops, regcache, regnum);
-      return;
-    }
-
-  err = td_ta_map_id2thr_p (thread_agent, GET_THREAD (inferior_ptid), &th);
-  if (err != TD_OK)
-    error ("Cannot find thread %d: Thread ID=%ld, %s",
-           pid_to_thread_id (inferior_ptid),
-           GET_THREAD (inferior_ptid),
-           thread_db_err_str (err));
-
-  if (regnum != -1)
-    {
-      char old_value[MAX_REGISTER_SIZE];
-
-      regcache_raw_collect (regcache, regnum, old_value);
-      err = td_thr_getgregs_p (&th, gregset);
-      if (err != TD_OK)
-        error ("%s: td_thr_getgregs %s", __func__, thread_db_err_str (err));
-#ifdef PT_GETXMMREGS
-      err = td_thr_getxmmregs_p (&th, xmmregs);
-      if (err != TD_OK)
-        {
-#endif
-          err = td_thr_getfpregs_p (&th, &fpregset);
-          if (err != TD_OK)
-            error ("%s: td_thr_getfpgregs %s", __func__, thread_db_err_str (err));
-#ifdef PT_GETXMMREGS
-        }
-#endif
-      regcache_raw_supply (regcache, regnum, old_value);
-    }
-
-  fill_gregset (regcache, gregset, regnum);
-  err = td_thr_setgregs_p (&th, gregset);
-  if (err != TD_OK)
-    error ("Cannot store general-purpose registers for thread %d: Thread ID=%ld, %s",
-           pid_to_thread_id (inferior_ptid), GET_THREAD (inferior_ptid),
-           thread_db_err_str (err));
-
-#ifdef PT_GETXMMREGS
-  i387_collect_fxsave (regcache, regnum, xmmregs);
-  err = td_thr_setxmmregs_p (&th, xmmregs);
-  if (err == TD_OK)
-    return;
-#endif
-
-  fill_fpregset (regcache, &fpregset, regnum);
-  err = td_thr_setfpregs_p (&th, &fpregset);
-  if (err != TD_OK)
-    error ("Cannot store floating-point registers for thread %d: Thread ID=%ld, %s",
-           pid_to_thread_id (inferior_ptid), GET_THREAD (inferior_ptid),
-           thread_db_err_str (err));
-}
-
-static void
-fbsd_thread_mourn_inferior (struct target_ops *ops)
-{
-  struct target_ops *beneath = find_target_beneath (ops);
-
-  fbsd_thread_deactivate ();
-
-  beneath->to_mourn_inferior (beneath);
-
-  /* Delete thread event breakpoints, if any.  */
-  remove_thread_event_breakpoints ();
-
-  unpush_target (ops);
-}
-
-static void
-fbsd_core_check_lwp (bfd *abfd, asection *asect, void *obj)
-{
-  lwpid_t lwp;
-
-  if (strncmp (bfd_section_name (abfd, asect), ".reg/", 5) != 0)
-    return;
-
-  /* already found */
-  if (*(lwpid_t *)obj == 0)
-    return;
-
-  lwp = atoi (bfd_section_name (abfd, asect) + 5);
-  if (*(lwpid_t *)obj == lwp)
-    *(lwpid_t *)obj = 0;
-}
-
-static int
-fbsd_thread_alive (struct target_ops *ops, ptid_t ptid)
-{
-  td_thrhandle_t th;
-  td_thrinfo_t ti;
-  td_err_e err;
-  gregset_t gregs;
-  lwpid_t lwp;
-
-  if (IS_THREAD (ptid))
-    {
-      err = td_ta_map_id2thr_p (thread_agent, GET_THREAD (ptid), &th);
-      if (err != TD_OK)
-        return 0;
-
-      err = td_thr_get_info_p (&th, &ti);
-      if (err != TD_OK)
-        return 0;
-
-      /* A zombie thread. */
-      if (ti.ti_state == TD_THR_UNKNOWN || ti.ti_state == TD_THR_ZOMBIE)
-        return 0;
-
-      return 1;
-    }
-  else if (GET_LWP (ptid) == 0)
-    {
-      /* we sometimes are called with lwp == 0 */
-      return 1;
-    }
-
-  if (fbsd_thread_active)
-    {
-      err = td_ta_map_lwp2thr_p (thread_agent, GET_LWP (ptid), &th);
-
-      /*
-       * if the lwp was already mapped to user thread, don't use it
-       * directly, please use user thread id instead.
-       */
-      if (err == TD_OK)
-        return 0;
-    }
-
-  if (!target_has_execution)
-    {
-      lwp = GET_LWP (ptid);
-      bfd_map_over_sections (core_bfd, fbsd_core_check_lwp, &lwp);
-      return (lwp == 0);
-    }
-
-  /* check lwp in kernel */
-  return ptrace (PT_GETREGS, GET_LWP (ptid), (caddr_t)&gregs, 0) == 0;
-}
-
-static int
-find_new_threads_callback (const td_thrhandle_t *th_p, void *data)
-{
-  td_thrinfo_t ti;
-  td_err_e err;
-  ptid_t ptid;
-
-  err = td_thr_get_info_p (th_p, &ti);
-  if (err != TD_OK)
-    error ("Cannot get thread info: %s", thread_db_err_str (err));
-
-  /* Ignore zombie */
-  if (ti.ti_state == TD_THR_UNKNOWN || ti.ti_state == TD_THR_ZOMBIE)
-    return 0;
-
-  ptid = BUILD_THREAD (ti.ti_tid, proc_handle.pid);
-  attach_thread (ptid, th_p, &ti, 1);
-  return 0;
-}
-
-static void
-fbsd_thread_find_new_threads (struct target_ops *ops)
-{
-  td_err_e err;
-
-  /* Iterate over all user-space threads to discover new threads. */
-  err = td_ta_thr_iter_p (thread_agent, find_new_threads_callback, NULL,
-          TD_THR_ANY_STATE, TD_THR_LOWEST_PRIORITY,
-          TD_SIGNO_MASK, TD_THR_ANY_USER_FLAGS);
-  if (err != TD_OK)
-    error ("Cannot find new threads: %s", thread_db_err_str (err));
-}
-
-static void
-fbsd_find_lwp_name(long lwpid, struct private_thread_info *info)
-{
-  int error, name[4];
-  unsigned int i;
-  struct kinfo_proc *kipp, *kip;
-  char *lwpstr = info->lwp_name;
-  int pid = inferior_ptid.pid;
-  size_t len = 0;
-
-  name[0] = CTL_KERN;
-  name[1] = KERN_PROC;
-  name[2] = KERN_PROC_PID | KERN_PROC_INC_THREAD;
-  name[3] = pid;
-
-  error = sysctl(name, 4, NULL, &len, NULL, 0);
-  if (error < 0 && errno != ESRCH) {
-      warn("sysctl: kern.proc.pid: %d", pid);
-      return;
-  }
-  if (error < 0)
-    return;
-
-  kip = malloc(len);
-  if (kip == NULL)
-    err(-1, "malloc");
-
-  if (sysctl(name, 4, kip, &len, NULL, 0) < 0) {
-      warn("sysctl: kern.proc.pid: %d", pid);
-      free(kip);
-      return;
-  }
-
-  for (i = 0; i < len / sizeof(*kipp); i++) {
-      kipp = &kip[i];
-      if ((kipp->ki_tid == lwpid) && strlen(kipp->ki_ocomm) &&
-          (strcmp(kipp->ki_comm, kipp->ki_ocomm) != 0))
-        {
-          // Found the LWP, update the name field
-          if (lwpstr != NULL)
-            {
-              if (strcmp(lwpstr, kipp->ki_ocomm) != 0)
-                {
-                  xfree(lwpstr);
-                }
-              else
-                {
-                  // Name hasn't changed, just return
-                  break;
-                }
-            }
-
-          len = strlen(kipp->ki_ocomm);
-          lwpstr = xmalloc(len);
-          strcpy(lwpstr, kipp->ki_ocomm);
-          info->lwp_name = lwpstr;
-          break;
-        }
-  }
-
-  free(kip);
-}
-
-static char *
-fbsd_thread_pid_to_str (struct target_ops *ops, ptid_t ptid)
-{
-  static char buf[64];
-  struct thread_info *tinfo = NULL;
-
-  if (IS_THREAD (ptid))
-    {
-      td_thrhandle_t th;
-      td_thrinfo_t ti;
-      td_err_e err;
-
-      err = td_ta_map_id2thr_p (thread_agent, GET_THREAD (ptid), &th);
-      if (err != TD_OK)
-        error ("Cannot find thread, Thread ID=%ld, %s",
-                GET_THREAD (ptid), thread_db_err_str (err));
-
-      err = td_thr_get_info_p (&th, &ti);
-      if (err != TD_OK)
-        error ("Cannot get thread info, Thread ID=%ld, %s",
-               GET_THREAD (ptid), thread_db_err_str (err));
-
-      tinfo = find_thread_ptid(ptid);
-      gdb_assert(tinfo != NULL);
-
-      if (ti.ti_lid != 0)
-        {
-          // Need to find the name of this LWP, even though it shouldn't change
-          fbsd_find_lwp_name(ti.ti_lid, tinfo->private);
-
-          if (tinfo->private->lwp_name == NULL)
-            {
-              snprintf(buf, sizeof (buf), "Thread %llx (LWP %d)",
-                  (unsigned long long)th.th_thread, ti.ti_lid);
-            }
-          else
-            {
-              snprintf(buf, sizeof (buf), "Thread %llx (LWP %d %s)",
-                  (unsigned long long)th.th_thread, ti.ti_lid,
-                  tinfo->private->lwp_name);
-            }
-        }
-      else
-        {
-          snprintf (buf, sizeof (buf), "Thread %llx (%s)",
-		    (unsigned long long)th.th_thread,
-		    thread_db_state_str (ti.ti_state));
-        }
-
-      return buf;
-    }
-  else if (IS_LWP (ptid))
-    {
-      snprintf (buf, sizeof (buf), "LWP %d", (int) GET_LWP (ptid));
-      return buf;
-    }
-  return normal_pid_to_str (ptid);
-}
-
-CORE_ADDR
-fbsd_thread_get_local_address(struct target_ops *ops,
-			      ptid_t ptid,
-			      CORE_ADDR lm,
-                              CORE_ADDR offset)
-{
-  td_thrhandle_t th;
-  void *address;
-  int ret;
-
-  if (IS_THREAD (ptid))
-    {
-      if (!td_thr_tls_get_addr_p)
-        error ("Cannot find thread-local interface in thread_db library.");
-
-      ret = td_ta_map_id2thr_p (thread_agent, GET_THREAD(ptid), &th);
-
-      /* get the address of the variable. */
-      ret = td_thr_tls_get_addr_p (&th, (void *)lm, offset, &address);
-
-      if (ret != TD_OK)
-        {
-            error ("Cannot find thread-local storage for thread %ld\n%s",
-                   (long) GET_THREAD (ptid), thread_db_err_str (ret));
-        }
-
-      /* Cast assuming host == target. */
-      return extract_data_ptr (&address);
-    }
-  return (0);
-}
-
-static int
-tsd_cb (thread_key_t key, void (*destructor)(void *), void *ignore)
-{
-  struct minimal_symbol *ms;
-  const char *name;
-
-  ms = lookup_minimal_symbol_by_pc (extract_func_ptr (&destructor));
-  if (!ms)
-    name = "???";
-  else
-    name = SYMBOL_PRINT_NAME (ms);
-
-  printf_filtered ("Key %d, destructor %p <%s>\n", key, destructor, name);
-  return 0;
-}
-
-static void
-fbsd_thread_tsd_cmd (char *exp, int from_tty)
-{
-  if (fbsd_thread_active)
-    td_ta_tsd_iter_p (thread_agent, tsd_cb, NULL);
-}
-
-static void
-fbsd_print_sigset (sigset_t *set)
-{
-  int i;
-
-  for (i = 1; i <= _SIG_MAXSIG; ++i) {
-     if (sigismember(set, i)) {
-       if (i < sizeof(sys_signame)/sizeof(sys_signame[0]))
-         printf_filtered("%s ", sys_signame[i]);
-       else
-         printf_filtered("sig%d ", i);
-     }
-  }
-  printf_filtered("\n");
-}
-
-static void
-fbsd_thread_signal_cmd (char *exp, int from_tty)
-{
-  td_thrhandle_t th;
-  td_thrinfo_t ti;
-  td_err_e err;
-#ifdef PL_FLAG_SI
-  const char *code;
-#endif
-
-  if (!fbsd_thread_active || !IS_THREAD(inferior_ptid))
-    return;
-
-  err = td_ta_map_id2thr_p (thread_agent, GET_THREAD (inferior_ptid), &th);
-  if (err != TD_OK)
-    return;
-
-  err = td_thr_get_info_p (&th, &ti);
-  if (err != TD_OK)
-    return;
-
-  printf_filtered("signal mask:\n");
-  fbsd_print_sigset(&ti.ti_sigmask);
-  printf_filtered("signal pending:\n");
-  fbsd_print_sigset(&ti.ti_pending);
-#ifdef PL_FLAG_SI
-  if (ti.ti_siginfo.si_signo != 0) {
-   printf_filtered("si_signo %d si_errno %d", ti.ti_siginfo.si_signo,
-     ti.ti_siginfo.si_errno);
-   if (ti.ti_siginfo.si_errno != 0)
-    printf_filtered(" (%s)", strerror(ti.ti_siginfo.si_errno));
-   printf_filtered("\n");
-   switch (ti.ti_siginfo.si_code) {
-   case SI_NOINFO:
-	code = "NOINFO";
-	break;
-    case SI_USER:
-	code = "USER";
-	break;
-    case SI_QUEUE:
-	code = "QUEUE";
-	break;
-    case SI_TIMER:
-	code = "TIMER";
-	break;
-    case SI_ASYNCIO:
-	code = "ASYNCIO";
-	break;
-    case SI_MESGQ:
-	code = "MESGQ";
-	break;
-    case SI_KERNEL:
-	code = "KERNEL";
-	break;
-    default:
-	code = "UNKNOWN";
-	break;
-    }
-    printf_filtered("si_code %s si_pid %d si_uid %d si_status %x si_addr %p\n",
-      code, ti.ti_siginfo.si_pid, ti.ti_siginfo.si_uid, ti.ti_siginfo.si_status,
-      ti.ti_siginfo.si_addr);
-  }
-#endif
-}
-
-static void
-init_fbsd_thread_ops (void)
-{
-  fbsd_thread_ops.to_shortname = "freebsd-threads";
-  fbsd_thread_ops.to_longname = "FreeBSD multithreaded child process.";
-  fbsd_thread_ops.to_doc = "FreeBSD threads support.";
-  fbsd_thread_ops.to_detach = fbsd_thread_detach;
-  fbsd_thread_ops.to_resume = fbsd_thread_resume;
-  fbsd_thread_ops.to_wait = fbsd_thread_wait;
-  fbsd_thread_ops.to_fetch_registers = fbsd_thread_fetch_registers;
-  fbsd_thread_ops.to_store_registers = fbsd_thread_store_registers;
-  fbsd_thread_ops.to_mourn_inferior = fbsd_thread_mourn_inferior;
-  fbsd_thread_ops.to_thread_alive = fbsd_thread_alive;
-  fbsd_thread_ops.to_find_new_threads = fbsd_thread_find_new_threads;
-  fbsd_thread_ops.to_pid_to_str = fbsd_thread_pid_to_str;
-  fbsd_thread_ops.to_stratum = thread_stratum;
-  fbsd_thread_ops.to_get_thread_local_address = fbsd_thread_get_local_address;
-  fbsd_thread_ops.to_magic = OPS_MAGIC;
-}
-
-static int
-thread_db_load (void)
-{
-  void *handle;
-  td_err_e err;
-
-  handle = dlopen (LIBTHREAD_DB_SO, RTLD_NOW);
-  if (handle == NULL)
-      return 0;
-
-#define resolve(X)			\
- if (!(X##_p = dlsym (handle, #X)))	\
-   return 0;
-
-  resolve(td_init);
-  resolve(td_ta_new);
-  resolve(td_ta_delete);
-  resolve(td_ta_map_id2thr);
-  resolve(td_ta_map_lwp2thr);
-  resolve(td_ta_thr_iter);
-  resolve(td_thr_get_info);
-#ifdef PT_GETXMMREGS
-  resolve(td_thr_getxmmregs);
-#endif
-  resolve(td_thr_getfpregs);
-  resolve(td_thr_getgregs);
-#ifdef PT_GETXMMREGS
-  resolve(td_thr_setxmmregs);
-#endif
-  resolve(td_thr_setfpregs);
-  resolve(td_thr_setgregs);
-  resolve(td_thr_sstep);
-  resolve(td_ta_tsd_iter);
-  resolve(td_thr_dbsuspend);
-  resolve(td_thr_dbresume);
-  resolve(td_thr_tls_get_addr);
-
-  /* These are not essential.  */
-  td_ta_event_addr_p = dlsym (handle, "td_ta_event_addr");
-  td_ta_set_event_p = dlsym (handle, "td_ta_set_event");
-  td_ta_event_getmsg_p = dlsym (handle, "td_ta_event_getmsg");
-  td_thr_event_enable_p = dlsym (handle, "td_thr_event_enable");
-  td_thr_tls_get_addr_p = dlsym (handle, "td_thr_tls_get_addr");
-
-  return 1;
-}
-
-void
-_initialize_thread_db (void)
-{
-
-  init_fbsd_thread_ops ();
-
-  if (thread_db_load ())
-    {
-      add_target (&fbsd_thread_ops);
-
-      /* "thread tsd" command */
-      add_cmd ("tsd", class_run, fbsd_thread_tsd_cmd,
-            "Show the thread-specific data keys and destructors "
-            "for the process.\n",
-           &thread_cmd_list);
-
-      add_cmd ("signal", class_run, fbsd_thread_signal_cmd,
-            "Show the thread signal info.\n",
-           &thread_cmd_list);
-
-      /* Hook into new_objfile notification.  */
-      observer_attach_new_objfile (fbsd_thread_new_objfile);
-    }
-  else
-    {
-      fprintf_unfiltered (gdb_stderr,
-        "[GDB will not be able to debug user-mode threads: %s]\n", dlerror());
-    }
-}
-
-/* proc service functions */
-void
-ps_plog (const char *fmt, ...)
-{
-  va_list args;
-
-  va_start (args, fmt);
-  vfprintf_filtered (gdb_stderr, fmt, args);
-  va_end (args);
-}
-
-ps_err_e
-ps_pglobal_lookup (struct ps_prochandle *ph, const char *obj,
-   const char *name, psaddr_t *sym_addr)
-{
-  struct minimal_symbol *ms;
-  CORE_ADDR addr;
-
-  ms = lookup_minimal_symbol (name, NULL, NULL);
-  if (ms == NULL)
-    return PS_NOSYM;
-
-  *sym_addr = SYMBOL_VALUE_ADDRESS (ms);
-  return PS_OK;
-}
-
-ps_err_e
-ps_pread (struct ps_prochandle *ph, psaddr_t addr, void *buf, size_t len)
-{
-  int err = target_read_memory (extract_data_ptr (&addr), buf, len);
-  return (err == 0 ? PS_OK : PS_ERR);
-}
-
-ps_err_e
-ps_pwrite (struct ps_prochandle *ph, psaddr_t addr, const void *buf,
-            size_t len)
-{
-  int err = target_write_memory (extract_data_ptr (&addr), (void *)buf, len);
-  return (err == 0 ? PS_OK : PS_ERR);
-}
-
-ps_err_e
-ps_lgetregs (struct ps_prochandle *ph, lwpid_t lwpid, prgregset_t gregset)
-{
-  struct cleanup *old_chain;
-  struct regcache *regcache;
-
-  old_chain = save_inferior_ptid ();
-
-  inferior_ptid = BUILD_LWP (lwpid, ph->pid);
-  regcache = get_thread_arch_regcache (inferior_ptid, target_gdbarch ());
-
-  target_fetch_registers (regcache, -1);
-  fill_gregset (regcache, gregset, -1);
-  do_cleanups (old_chain);
-  return PS_OK;
-}
-
-ps_err_e
-ps_lsetregs (struct ps_prochandle *ph, lwpid_t lwpid, const prgregset_t gregset)
-{
-  struct cleanup *old_chain;
-  struct regcache *regcache;
-
-  old_chain = save_inferior_ptid ();
-  inferior_ptid = BUILD_LWP (lwpid, ph->pid);
-  regcache = get_thread_arch_regcache (inferior_ptid, target_gdbarch ());
-
-  supply_gregset (regcache, gregset);
-  target_store_registers (regcache, -1);
-  do_cleanups (old_chain);
-  return PS_OK;
-}
-
-ps_err_e
-ps_lgetfpregs (struct ps_prochandle *ph, lwpid_t lwpid, prfpregset_t *fpregset)
-{
-  struct cleanup *old_chain;
-  struct regcache *regcache;
-
-  old_chain = save_inferior_ptid ();
-  inferior_ptid = BUILD_LWP (lwpid, ph->pid);
-  regcache = get_thread_arch_regcache (inferior_ptid, target_gdbarch ());
-
-  target_fetch_registers (regcache, -1);
-  fill_fpregset (regcache, fpregset, -1);
-  do_cleanups (old_chain);
-  return PS_OK;
-}
-
-ps_err_e
-ps_lsetfpregs (struct ps_prochandle *ph, lwpid_t lwpid,
-               const prfpregset_t *fpregset)
-{
-  struct cleanup *old_chain;
-  struct regcache *regcache;
-
-  old_chain = save_inferior_ptid ();
-  inferior_ptid = BUILD_LWP (lwpid, ph->pid);
-  regcache = get_thread_arch_regcache (inferior_ptid, target_gdbarch ());
-
-  supply_fpregset (regcache, fpregset);
-  target_store_registers (regcache, -1);
-  do_cleanups (old_chain);
-  return PS_OK;
-}
-
-#ifdef PT_GETXMMREGS
-ps_err_e
-ps_lgetxmmregs (struct ps_prochandle *ph, lwpid_t lwpid, char *xmmregs)
-{
-  struct cleanup *old_chain;
-  struct regcache *regcache;
-
-  old_chain = save_inferior_ptid ();
-  inferior_ptid = BUILD_LWP (lwpid, ph->pid);
-  regcache = get_thread_arch_regcache (inferior_ptid, target_gdbarch ());
-
-  target_fetch_registers (regcache, -1);
-  i387_collect_fxsave (regcache, -1, xmmregs);
-  do_cleanups (old_chain);
-  return PS_OK;
-}
-
-ps_err_e
-ps_lsetxmmregs (struct ps_prochandle *ph, lwpid_t lwpid,
-		const char *xmmregs)
-{
-  struct cleanup *old_chain;
-  struct regcache *regcache;
-
-  old_chain = save_inferior_ptid ();
-  inferior_ptid = BUILD_LWP (lwpid, ph->pid);
-  regcache = get_thread_arch_regcache (inferior_ptid, target_gdbarch ());
-
-  i387_supply_fxsave (regcache, -1, xmmregs);
-  target_store_registers (regcache, -1);
-  do_cleanups (old_chain);
-  return PS_OK;
-}
-#endif
-
-ps_err_e
-ps_lstop(struct ps_prochandle *ph, lwpid_t lwpid)
-{
-  if (ptrace (PT_SUSPEND, lwpid, 0, 0) == -1)
-    return PS_ERR;
-  return PS_OK;
-}
-
-ps_err_e
-ps_lcontinue(struct ps_prochandle *ph, lwpid_t lwpid)
-{
-  if (ptrace (PT_RESUME, lwpid, 0, 0) == -1)
-    return PS_ERR;
-  return PS_OK;
-}
-
-ps_err_e
-ps_linfo(struct ps_prochandle *ph, lwpid_t lwpid, void *info)
-{
-  if (!target_has_execution) {
-    /* XXX should verify lwpid and make a pseudo lwp info */
-    memset(info, 0, sizeof(struct ptrace_lwpinfo));
-    return PS_OK;
-  }
-
-  if (ptrace (PT_LWPINFO, lwpid, info, sizeof(struct ptrace_lwpinfo)) == -1)
-    return PS_ERR;
-  return PS_OK;
-}

Added: trunk/devel/gdb/files/kgdb/aarch64-fbsd-kern.c
===================================================================
--- trunk/devel/gdb/files/kgdb/aarch64-fbsd-kern.c	                        (rev 0)
+++ trunk/devel/gdb/files/kgdb/aarch64-fbsd-kern.c	2018-11-26 17:06:28 UTC (rev 24716)
@@ -0,0 +1,201 @@
+/*-
+ * Copyright (c) 2017 John Baldwin <jhb at FreeBSD.org>
+ * 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: head/devel/gdb/files/kgdb/aarch64-fbsd-kern.c 475318 2018-07-25 17:28:36Z jhb $
+ */
+
+/* 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_PC_REGNUM, 8 },
+    { 1, REGCACHE_MAP_SKIP, 8 },
+    { 1, AARCH64_SP_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 + i, 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_el0_sync") == 0)
+		   || (strcmp (name, "handle_el0_irq") == 0)
+		   || (strcmp (name, "handle_el0_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);
+
+  /* The kernel is linked at a virtual address with the upper 4 bits
+     set, so all 64 bits of virtual addresses need to be treated as
+     significant.  */
+  set_gdbarch_significant_addr_bit (gdbarch, 64);
+}
+
+/* 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: trunk/devel/gdb/files/kgdb/aarch64-fbsd-kern.c
___________________________________________________________________
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
Added: trunk/devel/gdb/files/kgdb/amd64fbsd-kern.c
===================================================================
--- trunk/devel/gdb/files/kgdb/amd64fbsd-kern.c	                        (rev 0)
+++ trunk/devel/gdb/files/kgdb/amd64fbsd-kern.c	2018-11-26 17:06:28 UTC (rev 24716)
@@ -0,0 +1,311 @@
+/*
+ * 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 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.
+ */
+
+#include <sys/cdefs.h>
+__FBSDID("$FreeBSD: head/devel/gdb/files/kgdb/amd64fbsd-kern.c 480613 2018-09-24 17:23:35Z jhb $");
+
+#include "defs.h"
+#include "frame-unwind.h"
+#include "gdbcore.h"
+#include "osabi.h"
+#include "regcache.h"
+#include "solib.h"
+#include "stack.h"
+#include "symtab.h"
+#include "trad-frame.h"
+#include "amd64-tdep.h"
+#include "x86-xstate.h"
+
+#ifdef __amd64__
+#include <machine/pcb.h>
+#include <machine/frame.h>
+#endif
+
+#include "kgdb.h"
+
+static const int amd64fbsd_pcb_offset[] = {
+  -1,				/* %rax */
+  6 * 8,			/* %rbx */
+  -1,				/* %rcx */
+  -1,				/* %rdx */
+  -1,				/* %rsi */
+  -1,				/* %rdi */
+  4 * 8,			/* %rbp */
+  5 * 8,			/* %rsp */
+  -1,				/* %r8 ...  */
+  -1,
+  -1,
+  -1,
+  3 * 8,
+  2 * 8,
+  1 * 8,
+  0 * 8,			/* ... %r15 */
+  7 * 8,			/* %rip */
+  -1,				/* %eflags */
+  -1,				/* %cs */
+  -1,				/* %ss */
+  -1,				/* %ds */
+  -1,				/* %es */
+  -1,				/* %fs */
+  -1				/* %gs */
+};
+
+#define	CODE_SEL	(4 << 3)
+#define	DATA_SEL	(5 << 3)
+
+static void
+amd64fbsd_supply_pcb(struct regcache *regcache, CORE_ADDR pcb_addr)
+{
+  gdb_byte buf[8];
+  int i;
+
+  memset(buf, 0, sizeof(buf));
+
+  /*
+   * XXX The PCB may have been swapped out.  Supply a dummy %rip value
+   * so as to avoid triggering an exception during stack unwinding.
+   */
+  regcache->raw_supply(AMD64_RIP_REGNUM, buf);
+  for (i = 0; i < ARRAY_SIZE (amd64fbsd_pcb_offset); i++)
+    if (amd64fbsd_pcb_offset[i] != -1) {
+      if (target_read_memory(pcb_addr + amd64fbsd_pcb_offset[i], buf,
+			     sizeof buf) != 0)
+	continue;
+      regcache->raw_supply(i, buf);
+    }
+
+  regcache->raw_supply_unsigned(AMD64_CS_REGNUM, CODE_SEL);
+  regcache->raw_supply_unsigned(AMD64_SS_REGNUM, DATA_SEL);
+}
+
+static const int amd64fbsd_trapframe_offset[] = {
+  6 * 8,			/* %rax */
+  7 * 8,			/* %rbx */
+  3 * 8,			/* %rcx */
+  2 * 8,			/* %rdx */
+  1 * 8,			/* %rsi */
+  0 * 8,			/* %rdi */
+  8 * 8,			/* %rbp */
+  22 * 8,			/* %rsp */
+  4 * 8,			/* %r8 ...  */
+  5 * 8,
+  9 * 8,
+  10 * 8,
+  11 * 8,
+  12 * 8,
+  13 * 8,
+  14 * 8,			/* ... %r15 */
+  19 * 8,			/* %rip */
+  21 * 8,			/* %eflags */
+  20 * 8,			/* %cs */
+  23 * 8,			/* %ss */
+  -1,				/* %ds */
+  -1,				/* %es */
+  -1,				/* %fs */
+  -1				/* %gs */
+};
+
+#define TRAPFRAME_SIZE	192
+
+static struct trad_frame_cache *
+amd64fbsd_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, AMD64_RSP_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 %rsp
+	 in the pcb points to the trapframe.  GDB has auto-adjusted
+	 %rsp for this frame to account for the "call" into
+	 fork_trampoline, so "undo" the adjustment.  */
+      sp += 8;
+    }
+  
+  for (i = 0; i < ARRAY_SIZE (amd64fbsd_trapframe_offset); i++)
+    if (amd64fbsd_trapframe_offset[i] != -1)
+      trad_frame_set_reg_addr (cache, i, sp + amd64fbsd_trapframe_offset[i]);
+
+  /* Read %rip from trap frame.  */
+  addr = sp + amd64fbsd_trapframe_offset[AMD64_RIP_REGNUM];
+  pc = read_memory_unsigned_integer (addr, 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 + TRAPFRAME_SIZE, func));
+    }
+
+  return cache;
+}
+
+static void
+amd64fbsd_trapframe_this_id (struct frame_info *this_frame,
+			     void **this_cache, struct frame_id *this_id)
+{
+  struct trad_frame_cache *cache =
+    amd64fbsd_trapframe_cache (this_frame, this_cache);
+  
+  trad_frame_get_id (cache, this_id);
+}
+
+static struct value *
+amd64fbsd_trapframe_prev_register (struct frame_info *this_frame,
+				   void **this_cache, int regnum)
+{
+  struct trad_frame_cache *cache =
+    amd64fbsd_trapframe_cache (this_frame, this_cache);
+
+  return trad_frame_get_register (cache, this_frame, regnum);
+}
+
+static int
+amd64fbsd_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, "calltrap") == 0)
+		   || (strcmp (name, "fast_syscall_common") == 0)
+		   || (strcmp (name, "fork_trampoline") == 0)
+		   || (strcmp (name, "mchk_calltrap") == 0)
+		   || (strcmp (name, "nmi_calltrap") == 0)
+		   || (name[0] == 'X' && name[1] != '_')));
+}
+
+static const struct frame_unwind amd64fbsd_trapframe_unwind = {
+  SIGTRAMP_FRAME,
+  default_frame_unwind_stop_reason,
+  amd64fbsd_trapframe_this_id,
+  amd64fbsd_trapframe_prev_register,
+  NULL,
+  amd64fbsd_trapframe_sniffer
+};
+
+static void
+amd64fbsd_kernel_init_abi(struct gdbarch_info info, struct gdbarch *gdbarch)
+{
+
+	amd64_init_abi(info, gdbarch,
+		       amd64_target_description (X86_XSTATE_SSE_MASK, true));
+
+	frame_unwind_prepend_unwinder(gdbarch, &amd64fbsd_trapframe_unwind);
+
+	set_solib_ops(gdbarch, &kld_so_ops);
+
+	fbsd_vmcore_set_supply_pcb(gdbarch, amd64fbsd_supply_pcb);
+	fbsd_vmcore_set_cpu_pcb_addr(gdbarch, kgdb_trgt_stop_pcb);
+}
+
+void
+_initialize_amd64_kgdb_tdep(void)
+{
+	gdbarch_register_osabi (bfd_arch_i386, bfd_mach_x86_64,
+	    GDB_OSABI_FREEBSD_KERNEL, amd64fbsd_kernel_init_abi);
+
+#ifdef __amd64__
+	gdb_assert(offsetof(struct pcb, pcb_rbx)
+		   == amd64fbsd_pcb_offset[AMD64_RBX_REGNUM]);
+	gdb_assert(offsetof(struct pcb, pcb_rbp)
+		   == amd64fbsd_pcb_offset[AMD64_RBP_REGNUM]);
+	gdb_assert(offsetof(struct pcb, pcb_rsp)
+		   == amd64fbsd_pcb_offset[AMD64_RSP_REGNUM]);
+	gdb_assert(offsetof(struct pcb, pcb_r12)
+		   == amd64fbsd_pcb_offset[AMD64_R12_REGNUM]);
+	gdb_assert(offsetof(struct pcb, pcb_r13)
+		   == amd64fbsd_pcb_offset[AMD64_R13_REGNUM]);
+	gdb_assert(offsetof(struct pcb, pcb_r14)
+		   == amd64fbsd_pcb_offset[AMD64_R14_REGNUM]);
+	gdb_assert(offsetof(struct pcb, pcb_r15)
+		   == amd64fbsd_pcb_offset[AMD64_R15_REGNUM]);
+	gdb_assert(offsetof(struct pcb, pcb_rip)
+		   == amd64fbsd_pcb_offset[AMD64_RIP_REGNUM]);
+	gdb_assert(CODE_SEL == GSEL(GCODE_SEL, SEL_KPL));
+	gdb_assert(DATA_SEL == GSEL(GDATA_SEL, SEL_KPL));
+	gdb_assert(sizeof(struct trapframe) == TRAPFRAME_SIZE);
+	gdb_assert(offsetof(struct trapframe, tf_rax)
+		   == amd64fbsd_trapframe_offset[AMD64_RAX_REGNUM]);
+	gdb_assert(offsetof(struct trapframe, tf_rbx)
+		   == amd64fbsd_trapframe_offset[AMD64_RBX_REGNUM]);
+	gdb_assert(offsetof(struct trapframe, tf_rcx)
+		   == amd64fbsd_trapframe_offset[AMD64_RCX_REGNUM]);
+	gdb_assert(offsetof(struct trapframe, tf_rdx)
+		   == amd64fbsd_trapframe_offset[AMD64_RDX_REGNUM]);
+	gdb_assert(offsetof(struct trapframe, tf_rsi)
+		   == amd64fbsd_trapframe_offset[AMD64_RSI_REGNUM]);
+	gdb_assert(offsetof(struct trapframe, tf_rdi)
+		   == amd64fbsd_trapframe_offset[AMD64_RDI_REGNUM]);
+	gdb_assert(offsetof(struct trapframe, tf_rbp)
+		   == amd64fbsd_trapframe_offset[AMD64_RBP_REGNUM]);
+	gdb_assert(offsetof(struct trapframe, tf_rsp)
+		   == amd64fbsd_trapframe_offset[AMD64_RSP_REGNUM]);
+	gdb_assert(offsetof(struct trapframe, tf_r8)
+		   == amd64fbsd_trapframe_offset[AMD64_R8_REGNUM]);
+	gdb_assert(offsetof(struct trapframe, tf_r9)
+		   == amd64fbsd_trapframe_offset[AMD64_R9_REGNUM]);
+	gdb_assert(offsetof(struct trapframe, tf_r10)
+		   == amd64fbsd_trapframe_offset[AMD64_R10_REGNUM]);
+	gdb_assert(offsetof(struct trapframe, tf_r11)
+		   == amd64fbsd_trapframe_offset[AMD64_R11_REGNUM]);
+	gdb_assert(offsetof(struct trapframe, tf_r12)
+		   == amd64fbsd_trapframe_offset[AMD64_R12_REGNUM]);
+	gdb_assert(offsetof(struct trapframe, tf_r13)
+		   == amd64fbsd_trapframe_offset[AMD64_R13_REGNUM]);
+	gdb_assert(offsetof(struct trapframe, tf_r14)
+		   == amd64fbsd_trapframe_offset[AMD64_R14_REGNUM]);
+	gdb_assert(offsetof(struct trapframe, tf_r15)
+		   == amd64fbsd_trapframe_offset[AMD64_R15_REGNUM]);
+	gdb_assert(offsetof(struct trapframe, tf_rip)
+		   == amd64fbsd_trapframe_offset[AMD64_RIP_REGNUM]);
+	gdb_assert(offsetof(struct trapframe, tf_rflags)
+		   == amd64fbsd_trapframe_offset[AMD64_EFLAGS_REGNUM]);
+	gdb_assert(offsetof(struct trapframe, tf_cs)
+		   == amd64fbsd_trapframe_offset[AMD64_CS_REGNUM]);
+	gdb_assert(offsetof(struct trapframe, tf_ss)
+		   == amd64fbsd_trapframe_offset[AMD64_SS_REGNUM]);
+#endif
+}


Property changes on: trunk/devel/gdb/files/kgdb/amd64fbsd-kern.c
___________________________________________________________________
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
Added: trunk/devel/gdb/files/kgdb/arm-fbsd-kern.c
===================================================================
--- trunk/devel/gdb/files/kgdb/arm-fbsd-kern.c	                        (rev 0)
+++ trunk/devel/gdb/files/kgdb/arm-fbsd-kern.c	2018-11-26 17:06:28 UTC (rev 24716)
@@ -0,0 +1,199 @@
+/*-
+ * Copyright (c) 2018 John Baldwin <jhb at FreeBSD.org>
+ * 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: head/devel/gdb/files/kgdb/arm-fbsd-kern.c 475318 2018-07-25 17:28:36Z jhb $
+ */
+
+/* Target-dependent code for FreeBSD/arm kernels.  */
+
+#include "defs.h"
+
+#include "arm-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 arm_fbsd_pcbmap[] =
+  {
+    { 9, 4, 4 }, /* r4 ... r12 */
+    { 1, ARM_SP_REGNUM, 4 },
+    { 1, ARM_LR_REGNUM, 4 },
+    { 1, ARM_PC_REGNUM, 4 },
+    { 0 }
+  };
+
+static const struct regset arm_fbsd_pcbregset =
+  {
+    arm_fbsd_pcbmap,
+    regcache_supply_regset, regcache_collect_regset
+  };
+
+static void
+arm_fbsd_supply_pcb(struct regcache *regcache, CORE_ADDR pcb_addr)
+{
+  gdb_byte buf[4 * 12];
+
+  if (target_read_memory (pcb_addr, buf, sizeof buf) == 0)
+    regcache->supply_regset (&arm_fbsd_pcbregset, -1, buf, sizeof (buf));
+
+  /*
+   * XXX: This is a gross hack, but the ARM frame unwinders need the value
+   * of xPSR to determine if Thumb mode is active.  FreeBSD's kernels never
+   * use Thumb.
+   */
+  regcache->raw_supply_unsigned(ARM_PS_REGNUM, 0);
+}
+
+static struct trad_frame_cache *
+arm_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, ARM_SP_REGNUM);
+
+  find_pc_partial_function (func, &name, NULL, NULL);
+
+  for (i = 0; i <= 12; i++)
+    trad_frame_set_reg_addr (cache, ARM_A1_REGNUM + i, sp + 4 + i * 4);
+  trad_frame_set_reg_addr (cache, ARM_SP_REGNUM, sp + 14 * 4);
+  trad_frame_set_reg_addr (cache, ARM_LR_REGNUM, sp + 15 * 4);
+  trad_frame_set_reg_addr (cache, ARM_PC_REGNUM, sp + 18 * 4);
+  trad_frame_set_reg_addr (cache, ARM_PS_REGNUM, sp);
+
+  /* Read $PC from trap frame.  */
+  pc = read_memory_unsigned_integer (sp + 18 * 4, 4, byte_order);
+
+  if (pc == 0 && strcmp(name, "swi_entry") == 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 + 4 * 19, func));
+    }
+
+  return cache;
+}
+
+static void
+arm_fbsd_trapframe_this_id (struct frame_info *this_frame,
+			     void **this_cache, struct frame_id *this_id)
+{
+  struct trad_frame_cache *cache =
+    arm_fbsd_trapframe_cache (this_frame, this_cache);
+  
+  trad_frame_get_id (cache, this_id);
+}
+
+static struct value *
+arm_fbsd_trapframe_prev_register (struct frame_info *this_frame,
+				   void **this_cache, int regnum)
+{
+  struct trad_frame_cache *cache =
+    arm_fbsd_trapframe_cache (this_frame, this_cache);
+
+  return trad_frame_get_register (cache, this_frame, regnum);
+}
+
+static int
+arm_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, "data_abort_entry") == 0)
+		   || (strcmp (name, "prefetch_abort_entry") == 0)
+		   || (strcmp (name, "undefined_entry") == 0)
+		   || (strcmp (name, "exception_exit") == 0)
+		   || (strcmp (name, "irq_entry") == 0)
+		   || (strcmp (name, "swi_entry") == 0)
+		   || (strcmp (name, "swi_exit") == 0)));
+}
+
+static const struct frame_unwind arm_fbsd_trapframe_unwind = {
+  SIGTRAMP_FRAME,
+  default_frame_unwind_stop_reason,
+  arm_fbsd_trapframe_this_id,
+  arm_fbsd_trapframe_prev_register,
+  NULL,
+  arm_fbsd_trapframe_sniffer
+};
+
+/* Implement the 'init_osabi' method of struct gdb_osabi_handler.  */
+
+static void
+arm_fbsd_kernel_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
+{
+  struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
+
+  frame_unwind_prepend_unwinder (gdbarch, &arm_fbsd_trapframe_unwind);
+
+  set_solib_ops (gdbarch, &kld_so_ops);
+
+  tdep->jb_pc = 24;
+  tdep->jb_elt_size = 4;
+
+  fbsd_vmcore_set_supply_pcb (gdbarch, arm_fbsd_supply_pcb);
+  fbsd_vmcore_set_cpu_pcb_addr (gdbarch, kgdb_trgt_stop_pcb);
+
+  /* Single stepping.  */
+  set_gdbarch_software_single_step (gdbarch, arm_software_single_step);
+}
+
+/* Provide a prototype to silence -Wmissing-prototypes.  */
+extern initialize_file_ftype _initialize_arm_kgdb_tdep;
+
+void
+_initialize_arm_kgdb_tdep (void)
+{
+  gdbarch_register_osabi_sniffer(bfd_arch_arm,
+				 bfd_target_elf_flavour,
+				 fbsd_kernel_osabi_sniffer);
+  gdbarch_register_osabi (bfd_arch_arm, 0, GDB_OSABI_FREEBSD_KERNEL,
+			  arm_fbsd_kernel_init_abi);
+}


Property changes on: trunk/devel/gdb/files/kgdb/arm-fbsd-kern.c
___________________________________________________________________
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
Added: trunk/devel/gdb/files/kgdb/fbsd-kld.c
===================================================================
--- trunk/devel/gdb/files/kgdb/fbsd-kld.c	                        (rev 0)
+++ trunk/devel/gdb/files/kgdb/fbsd-kld.c	2018-11-26 17:06:28 UTC (rev 24716)
@@ -0,0 +1,572 @@
+/*
+ * 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 <sys/cdefs.h>
+__FBSDID("$FreeBSD: head/devel/gdb/files/kgdb/fbsd-kld.c 480613 2018-09-24 17:23:35Z jhb $");
+
+#include "defs.h"
+#include "command.h"
+#include "completer.h"
+#include "environ.h"
+#include "exec.h"
+#include "frame-unwind.h"
+#include "inferior.h"
+#include "objfiles.h"
+#include "gdbcore.h"
+#include "language.h"
+#include "solib.h"
+#include "solist.h"
+
+#include "kgdb.h"
+
+struct lm_info_kld : public lm_info_base {
+	CORE_ADDR base_address;
+};
+
+struct kld_info {
+	/* Offsets of fields in linker_file structure. */
+	CORE_ADDR off_address, off_filename, off_pathname, off_next;
+
+	/* KVA of 'linker_path' which corresponds to the kern.module_path sysctl .*/
+	CORE_ADDR module_path_addr;
+	CORE_ADDR linker_files_addr;
+	CORE_ADDR kernel_file_addr;
+};
+
+struct target_so_ops kld_so_ops;
+
+/* Per-program-space data key.  */
+static const struct program_space_data *kld_pspace_data;
+
+static void
+kld_pspace_data_cleanup (struct program_space *pspace, void *arg)
+{
+  struct kld_info *info = (struct kld_info *)arg;
+
+  xfree (info);
+}
+
+/* Get the current kld data.  If none is found yet, add it now.  This
+   function always returns a valid object.  */
+
+static struct kld_info *
+get_kld_info (void)
+{
+  struct kld_info *info;
+
+  info = (struct kld_info *)
+    program_space_data (current_program_space, kld_pspace_data);
+  if (info != NULL)
+    return info;
+
+  info = XCNEW (struct kld_info);
+  set_program_space_data (current_program_space, kld_pspace_data, info);
+  return info;
+}
+
+static int
+kld_ok (char *path)
+{
+	struct stat sb;
+
+	if (stat(path, &sb) == 0 && S_ISREG(sb.st_mode))
+		return (1);
+	return (0);
+}
+
+/*
+ * Look for a matching file checking for debug suffixes before the raw file:
+ * - filename + ".debug" (e.g. foo.ko.debug)
+ * - filename (e.g. foo.ko)
+ */
+static const char *kld_suffixes[] = {
+	".debug",
+	".symbols",
+	"",
+	NULL
+};
+
+static int
+check_kld_path (char *path, size_t path_size)
+{
+	const char **suffix;
+	char *ep;
+
+	ep = path + strlen(path);
+	suffix = kld_suffixes;
+	while (*suffix != NULL) {
+		if (strlcat(path, *suffix, path_size) < path_size) {
+			if (kld_ok(path))
+				return (1);
+		}
+
+		/* Restore original path to remove suffix. */
+		*ep = '\0';
+		suffix++;
+	}
+	return (0);
+}
+
+/*
+ * Try to find the path for a kld by looking in the kernel's directory and
+ * in the various paths in the module path.
+ */
+static int
+find_kld_path (const char *filename, char *path, size_t path_size)
+{
+	struct kld_info *info;
+	struct cleanup *cleanup;
+	gdb::unique_xmalloc_ptr<char> module_path;
+	char *module_dir, *cp;
+	int error;
+
+	info = get_kld_info();
+	if (exec_bfd) {
+		std::string kernel_dir = ldirname(bfd_get_filename(exec_bfd));
+		if (!kernel_dir.empty()) {
+			snprintf(path, path_size, "%s/%s", kernel_dir.c_str(),
+			    filename);
+			if (check_kld_path(path, path_size))
+				return (1);
+		}
+	}
+	if (info->module_path_addr != 0) {
+		target_read_string(info->module_path_addr, &module_path,
+		    PATH_MAX, &error);
+		if (error == 0) {
+			cp = module_path.get();
+			while ((module_dir = strsep(&cp, ";")) != NULL) {
+				snprintf(path, path_size, "%s/%s", module_dir,
+				    filename);
+				if (check_kld_path(path, path_size))
+					return (1);
+			}
+		}
+	}
+	return (0);
+}
+
+/*
+ * Read a kernel pointer given a KVA in 'address'.
+ */
+static CORE_ADDR
+read_pointer (CORE_ADDR address)
+{
+	struct type *ptr_type;
+	gdb_byte ptr_buf[8];
+	int arch_size;
+
+	arch_size = bfd_get_arch_size (exec_bfd);
+	if (arch_size == -1)
+		return (0);
+	ptr_type = builtin_type (target_gdbarch ())->builtin_data_ptr;
+	if (target_read_memory(address, ptr_buf, arch_size / 8) != 0)
+		return (0);
+	return (extract_typed_address (ptr_buf, ptr_type));
+}
+
+/*
+ * Try to find this kld in the kernel linker's list of linker files.
+ */
+static int
+find_kld_address (const char *arg, CORE_ADDR *address)
+{
+	struct kld_info *info;
+	CORE_ADDR kld;
+	gdb::unique_xmalloc_ptr<char> kld_filename;
+	const char *filename;
+	int error;
+
+	info = get_kld_info();
+	if (info->linker_files_addr == 0 || info->off_address == 0 ||
+	    info->off_filename == 0 || info->off_next == 0)
+		return (0);
+
+	filename = lbasename(arg);
+	for (kld = read_pointer(info->linker_files_addr); kld != 0;
+	     kld = read_pointer(kld + info->off_next)) {
+		/* Try to read this linker file's filename. */
+		target_read_string(read_pointer(kld + info->off_filename),
+		    &kld_filename, PATH_MAX, &error);
+		if (error)
+			continue;
+
+		/* Compare this kld's filename against our passed in name. */
+		if (strcmp(kld_filename.get(), filename) != 0)
+			continue;
+
+		/*
+		 * We found a match, use its address as the base
+		 * address if we can read it.
+		 */
+		*address = read_pointer(kld + info->off_address);
+		if (*address == 0)
+			return (0);
+		return (1);
+	}
+	return (0);
+}
+
+static void
+adjust_section_address (struct target_section *sec, CORE_ADDR *curr_base)
+{
+	struct bfd_section *asect = sec->the_bfd_section;
+	bfd *abfd = asect->owner;
+
+	if ((abfd->flags & (EXEC_P | DYNAMIC)) != 0) {
+		sec->addr += *curr_base;
+		sec->endaddr += *curr_base;
+		return;
+	}
+
+	*curr_base = align_power(*curr_base,
+	    bfd_get_section_alignment(abfd, asect));
+	sec->addr = *curr_base;
+	sec->endaddr = sec->addr + bfd_section_size(abfd, asect);
+	*curr_base = sec->endaddr;
+}
+
+static void
+load_kld (char *path, CORE_ADDR base_addr, int from_tty)
+{
+	struct target_section *sections = NULL, *sections_end = NULL, *s;
+	struct cleanup *cleanup;
+	gdb_bfd_ref_ptr bfd;
+	CORE_ADDR curr_addr;
+	symfile_add_flags add_flags;
+	int i;
+
+	/* Open the kld. */
+	bfd = gdb_bfd_openr(path, gnutarget);
+	if (bfd == NULL)
+		error("\"%s\": can't open: %s", path,
+		    bfd_errmsg(bfd_get_error()));
+
+	if (!bfd_check_format(bfd.get(), bfd_object))
+		error("\%s\": not an object file", path);
+
+	/* Make sure we have a .text section. */
+	if (bfd_get_section_by_name (bfd.get(), ".text") == NULL)
+		error("\"%s\": can't find text section", path);
+
+	/* Build a section table from the bfd and relocate the sections. */
+	if (build_section_table (bfd.get(), &sections, &sections_end))
+		error("\"%s\": can't find file sections", path);
+	cleanup = make_cleanup(xfree, sections);
+	curr_addr = base_addr;
+	for (s = sections; s < sections_end; s++)
+		adjust_section_address(s, &curr_addr);
+
+	/* Build a section addr info to pass to symbol_file_add(). */
+	section_addr_info sap
+	    = build_section_addr_info_from_section_table (sections,
+		sections_end);
+
+	printf_unfiltered("add symbol table from file \"%s\" at\n", path);
+	for (i = 0; i < sap.size(); i++)
+		printf_unfiltered("\t%s_addr = %s\n", sap[i].name.c_str(),
+		    paddress(target_gdbarch(), sap[i].addr));		
+
+	if (from_tty && (!query("%s", "")))
+		error("Not confirmed.");
+
+	add_flags = 0;
+	if (from_tty)
+		add_flags |= SYMFILE_VERBOSE;
+	symbol_file_add_from_bfd(bfd.get(), path, add_flags, &sap,
+	    OBJF_USERLOADED, NULL);
+
+	do_cleanups(cleanup);
+}
+
+static void
+kgdb_add_kld_cmd (const char *arg, int from_tty)
+{
+	char path[PATH_MAX];
+	CORE_ADDR base_addr;
+
+	if (!exec_bfd)
+		error("No kernel symbol file");
+
+	/* Try to open the raw path to handle absolute paths first. */
+	snprintf(path, sizeof(path), "%s", arg);
+	if (!check_kld_path(path, sizeof(path))) {
+
+		/*
+		 * If that didn't work, look in the various possible
+		 * paths for the module.
+		 */
+		if (!find_kld_path(arg, path, sizeof(path))) {
+			error("Unable to locate kld");
+			return;
+		}
+	}
+
+	if (!find_kld_address(arg, &base_addr)) {
+		error("Unable to find kld in kernel");
+		return;
+	}
+
+	load_kld(path, base_addr, from_tty);
+
+	reinit_frame_cache();
+}
+
+static void
+kld_relocate_section_addresses (struct so_list *so, struct target_section *sec)
+{
+  lm_info_kld *li = (lm_info_kld *) so->lm_info;
+  static CORE_ADDR curr_addr;
+
+  if (sec == so->sections)
+    curr_addr = li->base_address;
+
+  adjust_section_address(sec, &curr_addr);
+}
+
+static void
+kld_free_so (struct so_list *so)
+{
+  lm_info_kld *li = (lm_info_kld *) so->lm_info;
+
+  delete li;
+}
+
+static void
+kld_clear_so (struct so_list *so)
+{
+  lm_info_kld *li = (lm_info_kld *) so->lm_info;
+
+  if (li != NULL)
+    li->base_address = 0;
+}
+
+static void
+kld_clear_solib (void)
+{
+	struct kld_info *info;
+
+	info = get_kld_info();
+
+	memset(info, 0, sizeof(*info));
+}
+
+static void
+kld_solib_create_inferior_hook (int from_tty)
+{
+	struct kld_info *info;
+
+	info = get_kld_info();
+	
+	/*
+	 * Compute offsets of relevant members in struct linker_file
+	 * and the addresses of global variables.  Newer kernels
+	 * include constants we can use without requiring debug
+	 * symbols.  If those aren't present, fall back to using
+	 * home-grown offsetof() equivalents.
+	 */
+	TRY {
+		info->off_address = parse_and_eval_long("kld_off_address");
+		info->off_filename = parse_and_eval_long("kld_off_filename");
+		info->off_pathname = parse_and_eval_long("kld_off_pathname");
+		info->off_next = parse_and_eval_long("kld_off_next");
+	} CATCH(e, RETURN_MASK_ERROR) {
+		TRY {
+			info->off_address = parse_and_eval_address(
+			    "&((struct linker_file *)0)->address");
+			info->off_filename = parse_and_eval_address(
+			    "&((struct linker_file *)0)->filename");
+			info->off_pathname = parse_and_eval_address(
+			    "&((struct linker_file *)0)->pathname");
+			info->off_next = parse_and_eval_address(
+			    "&((struct linker_file *)0)->link.tqe_next");
+		} CATCH(e, RETURN_MASK_ERROR) {
+			return;
+		}
+		END_CATCH
+	}
+	END_CATCH
+
+	TRY {
+		info->module_path_addr = parse_and_eval_address("linker_path");
+		info->linker_files_addr = kgdb_lookup("linker_files");
+		info->kernel_file_addr = kgdb_lookup("linker_kernel_file");
+	} CATCH(e, RETURN_MASK_ERROR) {
+		return;
+	}
+	END_CATCH
+
+	solib_add(NULL, from_tty, auto_solib_add);
+}
+
+static struct so_list *
+kld_current_sos (void)
+{
+	struct so_list *head, **prev, *newobj;
+	struct kld_info *info;
+	CORE_ADDR kld, kernel;
+	gdb::unique_xmalloc_ptr<char> path;
+	int error;
+
+	info = get_kld_info();
+	if (info->linker_files_addr == 0 || info->kernel_file_addr == 0 ||
+	    info->off_address == 0 || info->off_filename == 0 ||
+	    info->off_next == 0)
+		return (NULL);
+
+	head = NULL;
+	prev = &head;
+
+	/*
+	 * Walk the list of linker files creating so_list entries for
+	 * each non-kernel file.
+	 */
+	kernel = read_pointer(info->kernel_file_addr);
+	for (kld = read_pointer(info->linker_files_addr); kld != 0;
+	     kld = read_pointer(kld + info->off_next)) {
+		/* Skip the main kernel file. */
+		if (kld == kernel)
+			continue;
+
+		newobj = XCNEW (struct so_list);
+
+		lm_info_kld *li = new lm_info_kld;
+		li->base_address = 0;
+
+		newobj->lm_info = li;
+
+		/* Read the base filename and store it in so_original_name. */
+		target_read_string(read_pointer(kld + info->off_filename),
+		    &path, sizeof(newobj->so_original_name), &error);
+		if (error != 0) {
+			warning("kld_current_sos: Can't read filename: %s\n",
+			    safe_strerror(error));
+			free_so(newobj);
+			continue;
+		}
+		strlcpy(newobj->so_original_name, path.get(),
+		    sizeof(newobj->so_original_name));
+
+		/*
+		 * Try to read the pathname (if it exists) and store
+		 * it in so_name.
+		 */
+		if (find_kld_path(newobj->so_original_name, newobj->so_name,
+		    sizeof(newobj->so_name))) {
+			/* we found the kld */;
+		} else if (info->off_pathname != 0) {
+			target_read_string(read_pointer(kld +
+			    info->off_pathname),
+			    &path, sizeof(newobj->so_name), &error);
+			if (error != 0) {
+				warning(
+		    "kld_current_sos: Can't read pathname for \"%s\": %s\n",
+				    newobj->so_original_name,
+				    safe_strerror(error));
+				strlcpy(newobj->so_name, newobj->so_original_name,
+				    sizeof(newobj->so_name));
+			} else {
+				strlcpy(newobj->so_name, path.get(),
+				    sizeof(newobj->so_name));
+			}
+		} else
+			strlcpy(newobj->so_name, newobj->so_original_name,
+			    sizeof(newobj->so_name));
+
+		/* Read this kld's base address. */
+		li->base_address = read_pointer(kld + info->off_address);
+		if (li->base_address == 0) {
+			warning(
+			    "kld_current_sos: Invalid address for kld \"%s\"",
+			    newobj->so_original_name);
+			free_so(newobj);
+			continue;
+		}
+
+		/* Append to the list. */
+		*prev = newobj;
+		prev = &newobj->next;
+	}
+
+	return (head);
+}
+
+static int
+kld_open_symbol_file_object (int from_tty)
+{
+
+	return (0);
+}
+
+static int
+kld_in_dynsym_resolve_code (CORE_ADDR pc)
+{
+
+	return (0);
+}
+
+static int
+kld_find_and_open_solib (const char *solib, unsigned o_flags,
+    gdb::unique_xmalloc_ptr<char> *temp_pathname)
+{
+	char path[PATH_MAX];
+	int fd;
+
+	temp_pathname->reset (NULL);
+	if (!find_kld_path(solib, path, sizeof(path))) {
+		errno = ENOENT;
+		return (-1);
+	}
+	fd = open(path, o_flags, 0);
+	if (fd >= 0)
+		temp_pathname->reset(xstrdup(path));
+	return (fd);
+}
+
+void
+_initialize_kld_target(void)
+{
+	struct cmd_list_element *c;
+
+	kld_so_ops.relocate_section_addresses = kld_relocate_section_addresses;
+	kld_so_ops.free_so = kld_free_so;
+	kld_so_ops.clear_so = kld_clear_so;
+	kld_so_ops.clear_solib = kld_clear_solib;
+	kld_so_ops.solib_create_inferior_hook = kld_solib_create_inferior_hook;
+	kld_so_ops.current_sos = kld_current_sos;
+	kld_so_ops.open_symbol_file_object = kld_open_symbol_file_object;
+	kld_so_ops.in_dynsym_resolve_code = kld_in_dynsym_resolve_code;
+	kld_so_ops.bfd_open = solib_bfd_open;
+	kld_so_ops.find_and_open_solib = kld_find_and_open_solib;
+
+	c = add_com("add-kld", class_files, kgdb_add_kld_cmd,
+	   "Usage: add-kld FILE\n\
+Load the symbols from the kernel loadable module FILE.");
+	set_cmd_completer(c, filename_completer);
+
+	kld_pspace_data = register_program_space_data_with_cleanup (NULL,
+	    kld_pspace_data_cleanup);
+}


Property changes on: trunk/devel/gdb/files/kgdb/fbsd-kld.c
___________________________________________________________________
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
Added: trunk/devel/gdb/files/kgdb/fbsd-kthr.c
===================================================================
--- trunk/devel/gdb/files/kgdb/fbsd-kthr.c	                        (rev 0)
+++ trunk/devel/gdb/files/kgdb/fbsd-kthr.c	2018-11-26 17:06:28 UTC (rev 24716)
@@ -0,0 +1,339 @@
+/*
+ * 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 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.
+ */
+
+#include <sys/cdefs.h>
+__FBSDID("$FreeBSD: head/devel/gdb/files/kgdb/fbsd-kthr.c 475318 2018-07-25 17:28:36Z jhb $");
+
+#include <sys/param.h>
+#include <sys/proc.h>
+#include <stdbool.h>
+
+#include <defs.h>
+#include "gdbcore.h"
+#include "objfiles.h"
+#include "value.h"
+
+#include "kgdb.h"
+
+static CORE_ADDR dumppcb;
+static LONGEST dumptid;
+
+static CORE_ADDR stopped_cpus;
+static LONGEST mp_maxid;
+
+static struct kthr *first;
+struct kthr *curkthr;
+
+static int proc_off_p_pid, proc_off_p_comm, proc_off_p_list, proc_off_p_threads;
+static int thread_off_td_tid, thread_off_td_oncpu, thread_off_td_pcb;
+static int thread_off_td_name, thread_off_td_plist;
+static int thread_oncpu_size;
+
+CORE_ADDR
+kgdb_lookup(const char *sym)
+{
+	struct bound_minimal_symbol msym;
+
+	msym = lookup_minimal_symbol(sym, NULL, NULL);
+	if (msym.minsym == NULL)
+		return (0);
+	return (BMSYMBOL_VALUE_ADDRESS(msym));
+}
+
+/*
+ * Perform the equivalent of CPU_ISSET() to see if 'cpu' is set in the
+ * kernel's stopped_cpus set.  The set contains an array of longs.
+ * This function determines the specific long to read and tests the
+ * necessary bit in the long.
+ */
+static bool
+cpu_stopped(int cpu)
+{
+	struct gdbarch *gdbarch = target_gdbarch ();
+	CORE_ADDR addr;
+	ULONGEST mask;
+	int bit, long_bytes, word;
+
+	if (cpu < 0 || cpu > mp_maxid || stopped_cpus == 0)
+		return (false);
+	bit = cpu % gdbarch_long_bit (gdbarch);
+	word = cpu / gdbarch_long_bit (gdbarch);
+	long_bytes = gdbarch_long_bit (gdbarch) / 8;
+	addr = stopped_cpus + word * long_bytes;
+	mask = read_memory_unsigned_integer (addr, long_bytes,
+	    gdbarch_byte_order (gdbarch));
+	return (mask & ((ULONGEST)1 << bit)) != 0;
+}
+
+struct kthr *
+kgdb_thr_first(void)
+{
+	return (first);
+}
+
+static void
+kgdb_thr_add_procs(CORE_ADDR paddr, CORE_ADDR (*cpu_pcb_addr) (u_int))
+{
+	struct gdbarch *gdbarch = target_gdbarch ();
+	struct type *ptr_type = builtin_type (gdbarch)->builtin_data_ptr;
+	enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
+	struct kthr *kt;
+	CORE_ADDR pcb, pnext, tdaddr, tdnext;
+	ULONGEST oncpu;
+	LONGEST pid, tid;
+
+	while (paddr != 0) {
+		TRY {
+			tdaddr = read_memory_typed_address (paddr +
+			    proc_off_p_threads, ptr_type);
+			pid = read_memory_integer (paddr + proc_off_p_pid, 4,
+			    byte_order);
+			pnext = read_memory_typed_address (paddr +
+			    proc_off_p_list, ptr_type);
+		} CATCH(e, RETURN_MASK_ERROR) {
+			break;
+		} END_CATCH
+		while (tdaddr != 0) {
+			TRY {
+				tid = read_memory_integer (tdaddr +
+				    thread_off_td_tid, 4, byte_order);
+				oncpu = read_memory_unsigned_integer (tdaddr +
+				    thread_off_td_oncpu, thread_oncpu_size,
+				    byte_order);
+				pcb = read_memory_typed_address (tdaddr +
+				    thread_off_td_pcb, ptr_type);
+				tdnext = read_memory_typed_address (tdaddr +
+				    thread_off_td_plist, ptr_type);
+			} CATCH(e, RETURN_MASK_ERROR) {
+				break;
+			} END_CATCH
+			kt = XNEW (struct kthr);
+			kt->next = first;
+			kt->kaddr = tdaddr;
+			if (tid == dumptid)
+				kt->pcb = dumppcb;
+			else if (cpu_stopped(oncpu))
+				kt->pcb = cpu_pcb_addr(oncpu);
+			else
+				kt->pcb = pcb;
+			kt->tid = tid;
+			kt->pid = pid;
+			kt->paddr = paddr;
+			kt->cpu = oncpu;
+			first = kt;
+			tdaddr = tdnext;
+		}
+		paddr = pnext;
+	}
+}
+
+struct kthr *
+kgdb_thr_init(CORE_ADDR (*cpu_pcb_addr) (u_int))
+{
+	struct gdbarch *gdbarch = target_gdbarch ();
+	struct type *ptr_type = builtin_type (gdbarch)->builtin_data_ptr;
+	enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
+	struct kthr *kt;
+	CORE_ADDR addr, paddr;
+	
+	while (first != NULL) {
+		kt = first;
+		first = kt->next;
+		free(kt);
+	}
+
+	addr = kgdb_lookup("allproc");
+	if (addr == 0)
+		return (NULL);
+	TRY {
+		paddr = read_memory_typed_address (addr, ptr_type);
+	} CATCH(e, RETURN_MASK_ERROR) {
+		return (NULL);
+	} END_CATCH
+
+	dumppcb = kgdb_lookup("dumppcb");
+	if (dumppcb == 0)
+		return (NULL);
+
+	TRY {
+		dumptid = parse_and_eval_long("dumptid");
+	} CATCH(e, RETURN_MASK_ERROR) {
+		dumptid = -1;
+	} END_CATCH
+
+	TRY {
+		mp_maxid = parse_and_eval_long("mp_maxid");
+	} CATCH(e, RETURN_MASK_ERROR) {
+		mp_maxid = 0;
+	} END_CATCH
+	stopped_cpus = kgdb_lookup("stopped_cpus");
+
+	/*
+	 * Newer kernels export a set of global variables with the offsets
+	 * of certain members in struct proc and struct thread.  For older
+	 * kernels, try to extract these offsets using debug symbols.  If
+	 * that fails, use native values.
+	 */
+	TRY {
+		proc_off_p_pid = parse_and_eval_long("proc_off_p_pid");
+		proc_off_p_comm = parse_and_eval_long("proc_off_p_comm");
+		proc_off_p_list = parse_and_eval_long("proc_off_p_list");
+		proc_off_p_threads = parse_and_eval_long("proc_off_p_threads");
+		thread_off_td_tid = parse_and_eval_long("thread_off_td_tid");
+		thread_off_td_name = parse_and_eval_long("thread_off_td_name");
+		thread_off_td_oncpu = parse_and_eval_long("thread_off_td_oncpu");
+		thread_off_td_pcb = parse_and_eval_long("thread_off_td_pcb");
+		thread_off_td_plist = parse_and_eval_long("thread_off_td_plist");
+		thread_oncpu_size = 4;
+	} CATCH(e, RETURN_MASK_ERROR) {
+		TRY {
+			proc_off_p_pid = parse_and_eval_address(
+			    "&((struct proc *)0)->p_pid");
+			proc_off_p_comm = parse_and_eval_address(
+			    "&((struct proc *)0)->p_comm");
+			proc_off_p_list = parse_and_eval_address(
+			    "&((struct proc *)0)->p_list");
+			proc_off_p_threads = parse_and_eval_address(
+			    "&((struct proc *)0)->p_threads");
+			thread_off_td_tid = parse_and_eval_address(
+			    "&((struct thread *)0)->td_tid");
+			thread_off_td_name = parse_and_eval_address(
+			    "&((struct thread *)0)->td_name");
+			thread_off_td_oncpu = parse_and_eval_address(
+			    "&((struct thread *)0)->td_oncpu");
+			thread_off_td_pcb = parse_and_eval_address(
+			    "&((struct thread *)0)->td_pcb");
+			thread_off_td_plist = parse_and_eval_address(
+			    "&((struct thread *)0)->td_plist");
+			thread_oncpu_size = parse_and_eval_long(
+			    "sizeof(((struct thread *)0)->td_oncpu)");
+		} CATCH(e, RETURN_MASK_ERROR) {
+			proc_off_p_pid = offsetof(struct proc, p_pid);
+			proc_off_p_comm = offsetof(struct proc, p_comm);
+			proc_off_p_list = offsetof(struct proc, p_list);
+			proc_off_p_threads = offsetof(struct proc, p_threads);
+			thread_off_td_tid = offsetof(struct thread, td_tid);
+			thread_off_td_name = offsetof(struct thread, td_name);
+			thread_off_td_oncpu = offsetof(struct thread, td_oncpu);
+			thread_off_td_pcb = offsetof(struct thread, td_pcb);
+			thread_off_td_plist = offsetof(struct thread, td_plist);
+			thread_oncpu_size =
+			    sizeof(((struct thread *)0)->td_oncpu);
+		} END_CATCH
+	} END_CATCH
+
+	kgdb_thr_add_procs(paddr, cpu_pcb_addr);
+	addr = kgdb_lookup("zombproc");
+	if (addr != 0) {
+		TRY {
+			paddr = read_memory_typed_address (addr, ptr_type);
+			kgdb_thr_add_procs(paddr, cpu_pcb_addr);
+		} CATCH(e, RETURN_MASK_ERROR) {
+		} END_CATCH
+	}
+	curkthr = kgdb_thr_lookup_tid(dumptid);
+	if (curkthr == NULL)
+		curkthr = first;
+	return (first);
+}
+
+struct kthr *
+kgdb_thr_lookup_tid(int tid)
+{
+	struct kthr *kt;
+
+	kt = first;
+	while (kt != NULL && kt->tid != tid)
+		kt = kt->next;
+	return (kt);
+}
+
+struct kthr *
+kgdb_thr_lookup_taddr(uintptr_t taddr)
+{
+	struct kthr *kt;
+
+	kt = first;
+	while (kt != NULL && kt->kaddr != taddr)
+		kt = kt->next;
+	return (kt);
+}
+
+struct kthr *
+kgdb_thr_lookup_pid(int pid)
+{
+	struct kthr *kt;
+
+	kt = first;
+	while (kt != NULL && kt->pid != pid)
+		kt = kt->next;
+	return (kt);
+}
+
+struct kthr *
+kgdb_thr_lookup_paddr(uintptr_t paddr)
+{
+	struct kthr *kt;
+
+	kt = first;
+	while (kt != NULL && kt->paddr != paddr)
+		kt = kt->next;
+	return (kt);
+}
+
+struct kthr *
+kgdb_thr_next(struct kthr *kt)
+{
+	return (kt->next);
+}
+
+const char *
+kgdb_thr_extra_thread_info(int tid)
+{
+	char comm[MAXCOMLEN + 1];
+	char td_name[MAXCOMLEN + 1];
+	struct kthr *kt;
+	static char buf[64];
+
+	kt = kgdb_thr_lookup_tid(tid);
+	if (kt == NULL)
+		return (NULL);	
+	snprintf(buf, sizeof(buf), "PID=%d", kt->pid);
+	TRY {
+		read_memory_string (kt->paddr + proc_off_p_comm, comm,
+		    sizeof(comm));
+		strlcat(buf, ": ", sizeof(buf));
+		strlcat(buf, comm, sizeof(buf));
+		read_memory_string (kt->kaddr + thread_off_td_name, td_name,
+		    sizeof(td_name));
+		if (strcmp(comm, td_name) != 0) {
+			strlcat(buf, "/", sizeof(buf));
+			strlcat(buf, td_name, sizeof(buf));
+		}
+	} CATCH(e, RETURN_MASK_ERROR) {
+	} END_CATCH
+	return (buf);
+}


Property changes on: trunk/devel/gdb/files/kgdb/fbsd-kthr.c
___________________________________________________________________
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
Added: trunk/devel/gdb/files/kgdb/fbsd-kvm.c
===================================================================
--- trunk/devel/gdb/files/kgdb/fbsd-kvm.c	                        (rev 0)
+++ trunk/devel/gdb/files/kgdb/fbsd-kvm.c	2018-11-26 17:06:28 UTC (rev 24716)
@@ -0,0 +1,628 @@
+/*
+ * 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 <sys/cdefs.h>
+__FBSDID("$FreeBSD: head/devel/gdb/files/kgdb/fbsd-kvm.c 480613 2018-09-24 17:23:35Z jhb $");
+
+#include "defs.h"
+#include "command.h"
+#include "elf-bfd.h"
+#include "filenames.h"
+#include "gdbcore.h"
+#include "gdbthread.h"
+#include "gdb_obstack.h"
+#include "inferior.h"
+#include "objfiles.h"
+#include "osabi.h"
+#include "solib.h"
+#include "target.h"
+#include "value.h"
+#include "readline/tilde.h"
+
+#include <sys/user.h>
+#include <fcntl.h>
+#include <kvm.h>
+
+#include "kgdb.h"
+
+static CORE_ADDR stoppcbs;
+static LONGEST pcb_size;
+
+static char *vmcore;
+
+/* 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;
+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_t(inferior_ptid.pid(), 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_t(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;
+
+	/* 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);
+}
+
+/* The FreeBSD libkvm target.  */
+
+static const target_info fbsd_kvm_target_info = {
+  "vmcore",
+  N_("Kernel core dump file"),
+  N_("Use a vmcore file as a target.\n\
+If no filename is specified, /dev/mem is used to examine the running kernel.\n\
+target vmcore [-w] [filename]")
+};
+
+class fbsd_kvm_target final : public target_ops
+{
+public:
+  fbsd_kvm_target ()
+  { this->to_stratum = process_stratum; }
+
+  const target_info &info () const override
+  { return fbsd_kvm_target_info; }
+
+  void close () override;
+
+  void fetch_registers (struct regcache *, int) override;
+  enum target_xfer_status xfer_partial (enum target_object object,
+					const char *annex,
+					gdb_byte *readbuf,
+					const gdb_byte *writebuf,
+					ULONGEST offset, ULONGEST len,
+					ULONGEST *xfered_len) override;
+
+  void files_info () override;
+  bool thread_alive (ptid_t ptid) override;
+  void update_thread_list () override;
+  const char *pid_to_str (ptid_t) override;
+  const char *extra_thread_info (thread_info *) override;
+
+  bool has_memory () override { return true; }
+  bool has_stack () override { return true; }
+  bool has_registers () override { return true; }
+};
+
+/* Target ops for libkvm interface.  */
+static fbsd_kvm_target fbsd_kvm_ops;
+
+#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
+fbsd_kvm_target_open (const char *args, int from_tty)
+{
+	struct fbsd_vmcore_ops *ops = (struct fbsd_vmcore_ops *)
+	    gdbarch_data (target_gdbarch(), fbsd_vmcore_data);
+	char kvm_err[_POSIX2_LINE_MAX];
+	struct inferior *inf;
+	struct cleanup *old_chain;
+	struct thread_info *ti;
+	struct kthr *kt;
+	kvm_t *nkvm;
+	char *temp, *kernel, *filename;
+	bool writeable;
+	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");
+
+	writeable = false;
+	filename = NULL;
+	if (args != NULL) {
+		gdb_argv built_argv (args);
+
+		for (char **argv = built_argv.get (); *argv != NULL; argv++) {
+			if (**argv == '-') {
+				if (strcmp (*argv, "-w") == 0)
+					writeable = true;
+				else
+					error (_("Invalid argument"));
+			} else {
+				if (filename != NULL)
+					error (_("Invalid argument"));
+
+				filename = tilde_expand (*argv);
+				if (!IS_ABSOLUTE_PATH (filename)) {
+					temp = concat (current_directory, "/",
+					    filename, NULL);
+					xfree(filename);
+					filename = temp;
+				}
+			}
+		}
+	}
+
+	old_chain = make_cleanup (xfree, filename);
+
+#ifdef HAVE_KVM_OPEN2
+	nkvm = kvm_open2(kernel, filename,
+	    writeable ? O_RDWR : O_RDONLY, kvm_err, kgdb_resolve_symbol);
+#else
+	nkvm = kvm_openfiles(kernel, filename, NULL,
+	    writeable ? 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(&fbsd_kvm_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) {
+		pcb_size = 0;
+	} END_CATCH
+
+	if (pcb_size == 0) {
+		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
+	}
+
+	kvm = nkvm;
+	vmcore = filename;
+	push_target (&fbsd_kvm_ops);
+
+	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);
+}
+
+void
+fbsd_kvm_target::close()
+{
+
+	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;
+}
+
+#if 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");
+}
+#endif
+
+const char *
+fbsd_kvm_target::extra_thread_info(thread_info *ti)
+{
+
+	return (kgdb_thr_extra_thread_info(ti->ptid.tid()));
+}
+
+void
+fbsd_kvm_target::files_info()
+{
+
+	printf_filtered ("\t`%s', ", vmcore);
+	wrap_here ("        ");
+	printf_filtered ("file type %s.\n", "FreeBSD kernel vmcore");
+}
+
+void
+fbsd_kvm_target::update_thread_list()
+{
+	/*
+	 * 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
+}
+
+const char *
+fbsd_kvm_target::pid_to_str(ptid_t ptid)
+{
+	static char buf[33];
+
+	snprintf(buf, sizeof(buf), "Thread %ld", ptid.tid());
+	return (buf);
+}
+
+bool
+fbsd_kvm_target::thread_alive(ptid_t ptid)
+{
+	return (kgdb_thr_lookup_tid(ptid.tid()) != NULL);
+}
+
+void
+fbsd_kvm_target::fetch_registers(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(inferior_ptid.tid());
+	if (kt == NULL)
+		return;
+	ops->supply_pcb(regcache, kt->pcb);
+}
+
+enum target_xfer_status
+fbsd_kvm_target::xfer_partial(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;
+	}
+}
+
+#if 0
+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;
+}
+#endif
+
+static void
+kgdb_switch_to_thread(const char *arg, int tid)
+{
+  struct thread_info *tp;
+
+  tp = find_thread_ptid (fbsd_vmcore_ptid (tid));
+  if (tp == NULL)
+    error ("invalid tid");
+  thread_select (arg, tp);
+}
+
+static void
+kgdb_set_proc_cmd (const 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(arg, thr->tid);
+}
+
+static void
+kgdb_set_tid_cmd (const 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(arg, addr);
+}
+
+void
+_initialize_kgdb_target(void)
+{
+
+	add_target(fbsd_kvm_target_info, fbsd_kvm_target_open);
+
+	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);
+}


Property changes on: trunk/devel/gdb/files/kgdb/fbsd-kvm.c
___________________________________________________________________
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
Added: trunk/devel/gdb/files/kgdb/i386fbsd-kern.c
===================================================================
--- trunk/devel/gdb/files/kgdb/i386fbsd-kern.c	                        (rev 0)
+++ trunk/devel/gdb/files/kgdb/i386fbsd-kern.c	2018-11-26 17:06:28 UTC (rev 24716)
@@ -0,0 +1,580 @@
+/*
+ * 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 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.
+ */
+
+#include <sys/cdefs.h>
+__FBSDID("$FreeBSD: head/devel/gdb/files/kgdb/i386fbsd-kern.c 480613 2018-09-24 17:23:35Z jhb $");
+
+#include "defs.h"
+#include "frame-unwind.h"
+#include "gdbcore.h"
+#include "inferior.h"
+#include "osabi.h"
+#include "regcache.h"
+#include "progspace.h"
+#include "solib.h"
+#include "trad-frame.h"
+#include "i386-tdep.h"
+
+#ifdef __i386__
+#include <sys/proc.h>
+#include <machine/pcb.h>
+#include <machine/frame.h>
+#include <machine/segments.h>
+#include <machine/tss.h>
+#endif
+
+#include "kgdb.h"
+
+struct i386fbsd_info {
+	int ofs_fix;
+};
+
+/* Per-program-space data key.  */
+static const struct program_space_data *i386fbsd_pspace_data;
+
+static void
+i386fbsd_pspace_data_cleanup (struct program_space *pspace, void *arg)
+{
+  struct i386fbsd_info *info = (struct i386fbsd_info *)arg;
+
+  xfree (info);
+}
+
+/* Get the current i386fbsd data.  If none is found yet, add it now.  This
+   function always returns a valid object.  */
+
+static struct i386fbsd_info *
+get_i386fbsd_info (void)
+{
+  struct i386fbsd_info *info;
+
+  info = (struct i386fbsd_info *)
+    program_space_data (current_program_space, i386fbsd_pspace_data);
+  if (info != NULL)
+    return info;
+
+  info = XCNEW (struct i386fbsd_info);
+  set_program_space_data (current_program_space, i386fbsd_pspace_data, info);
+
+  /*
+   * In revision 1.117 of i386/i386/exception.S trap handlers
+   * were changed to pass trapframes by reference rather than
+   * by value.  Detect this by seeing if the first instruction
+   * at the 'calltrap' label is a "push %esp" which has the
+   * opcode 0x54.
+   */
+  if (parse_and_eval_long("((char *)calltrap)[0]") == 0x54)
+    info->ofs_fix = 4;
+  else
+    info->ofs_fix = 0;
+  return info;
+}
+
+/*
+ * Even though the pcb contains fields for the segment selectors, only
+ * %gs is updated on each context switch.  The other selectors are
+ * saved in stoppcbs[], but we just hardcode their known values rather
+ * than handling that special case.
+ */
+static const int i386fbsd_pcb_offset[] = {
+  -1,				/* %eax */
+  -1,				/* %ecx */
+  -1,				/* %edx */
+  4 * 4,			/* %ebx */
+  3 * 4,			/* %esp */
+  2 * 4,			/* %ebp */
+  1 * 4,			/* %esi */
+  0 * 4,			/* %edi */
+  5 * 4,			/* %eip */
+  -1,				/* %eflags */
+  -1,				/* %cs */
+  -1,				/* %ss */
+  -1,				/* %ds */
+  -1,				/* %es */
+  -1,				/* %fs */
+  -1,				/* %gs */
+};
+
+#define	CODE_SEL	(4 << 3)
+#define	DATA_SEL	(5 << 3)
+#define	PRIV_SEL	(1 << 3)
+
+static void
+i386fbsd_supply_pcb(struct regcache *regcache, CORE_ADDR pcb_addr)
+{
+  gdb_byte buf[4];
+  int i;
+
+  memset(buf, 0, sizeof(buf));
+
+  /*
+   * XXX The PCB may have been swapped out.  Supply a dummy %eip value
+   * so as to avoid triggering an exception during stack unwinding.
+   */
+  regcache->raw_supply(I386_EIP_REGNUM, buf);
+  for (i = 0; i < ARRAY_SIZE (i386fbsd_pcb_offset); i++)
+    if (i386fbsd_pcb_offset[i] != -1) {
+      if (target_read_memory(pcb_addr + i386fbsd_pcb_offset[i], buf, sizeof buf)
+	  != 0)
+	continue;
+      regcache->raw_supply(i, buf);
+    }
+  regcache->raw_supply_unsigned(I386_CS_REGNUM, CODE_SEL);
+  regcache->raw_supply_unsigned(I386_DS_REGNUM, DATA_SEL);
+  regcache->raw_supply_unsigned(I386_ES_REGNUM, DATA_SEL);
+  regcache->raw_supply_unsigned(I386_FS_REGNUM, PRIV_SEL);
+  regcache->raw_supply_unsigned(I386_GS_REGNUM, DATA_SEL);
+  regcache->raw_supply_unsigned(I386_SS_REGNUM, DATA_SEL);
+}
+
+#ifdef __i386__
+/* TODO: Make this cross-debugger friendly. */
+static const int i386fbsd_tss_offset[] = {
+  10 * 4,			/* %eax */
+  11 * 4,			/* %ecx */
+  12 * 4,			/* %edx */
+  13 * 4,			/* %ebx */
+  14 * 4,			/* %esp */
+  15 * 4,			/* %ebp */
+  16 * 4,			/* %esi */
+  17 * 4,			/* %edi */
+  8 * 4,			/* %eip */
+  9 * 4,			/* %eflags */
+  19 * 4,			/* %cs */
+  20 * 4,			/* %ss */
+  21 * 4,			/* %ds */
+  18 * 4,			/* %es */
+  22 * 4,			/* %fs */
+  23 * 4,			/* %gs */
+};
+
+/*
+ * If the current thread is executing on a CPU, fetch the common_tss
+ * for that CPU.
+ *
+ * This is painful because 'struct pcpu' is variant sized, so we can't
+ * use it.  Instead, we lookup the GDT selector for this CPU and
+ * extract the base of the TSS from there.
+ */
+static CORE_ADDR
+i386fbsd_fetch_tss(void)
+{
+	struct kthr *kt;
+	struct segment_descriptor sd;
+	CORE_ADDR addr, cpu0prvpage, tss;
+
+	kt = kgdb_thr_lookup_tid(inferior_ptid.tid());
+	if (kt == NULL || kt->cpu == NOCPU || kt->cpu < 0)
+		return (0);
+
+	addr = kgdb_lookup("gdt");
+	if (addr == 0)
+		return (0);
+	addr += (kt->cpu * NGDT + GPROC0_SEL) * sizeof(sd);
+	if (target_read_memory(addr, (gdb_byte *)&sd, sizeof(sd)) != 0)
+		return (0);
+	if (sd.sd_type != SDT_SYS386BSY) {
+		warning ("descriptor is not a busy TSS");
+		return (0);
+	}
+	tss = sd.sd_hibase << 24 | sd.sd_lobase;
+
+	/*
+	 * In SMP kernels, the TSS is stored as part of the per-CPU
+	 * data.  On older kernels, the CPU0's private page
+	 * is stored at an address that isn't mapped in minidumps.
+	 * However, the data is mapped at the alternate cpu0prvpage
+	 * address.  Thus, if the TSS is at the invalid address,
+	 * change it to be relative to cpu0prvpage instead.
+	 */ 
+	if (trunc_page(tss) == 0xffc00000) {
+		TRY {
+			cpu0prvpage = parse_and_eval_address("cpu0prvpage");
+		} CATCH(e, RETURN_MASK_ERROR) {
+			return (0);
+		} END_CATCH
+		tss = cpu0prvpage + (tss & PAGE_MASK);
+	}
+	return (tss);
+}
+
+static struct trad_frame_cache *
+i386fbsd_dblfault_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, tss;
+  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);
+  tss = i386fbsd_fetch_tss ();
+
+  for (i = 0; i < ARRAY_SIZE (i386fbsd_tss_offset); i++)
+    if (i386fbsd_tss_offset[i] != -1)
+      trad_frame_set_reg_addr (cache, i, tss + i386fbsd_tss_offset[i]);
+
+  /* Construct the frame ID using the function start.  */
+  /* XXX: Stack address should be dbfault_stack + PAGE_SIZE. */
+  trad_frame_set_id (cache, frame_id_build (tss + sizeof(struct i386tss),
+					    func));
+
+  return cache;
+}
+
+static void
+i386fbsd_dblfault_this_id (struct frame_info *this_frame,
+			     void **this_cache, struct frame_id *this_id)
+{
+  struct trad_frame_cache *cache =
+    i386fbsd_dblfault_cache (this_frame, this_cache);
+  
+  trad_frame_get_id (cache, this_id);
+}
+
+static struct value *
+i386fbsd_dblfault_prev_register (struct frame_info *this_frame,
+				   void **this_cache, int regnum)
+{
+  struct trad_frame_cache *cache =
+    i386fbsd_dblfault_cache (this_frame, this_cache);
+
+  return trad_frame_get_register (cache, this_frame, regnum);
+}
+
+static int
+i386fbsd_dblfault_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, "dblfault_handler") == 0);
+}
+
+static const struct frame_unwind i386fbsd_dblfault_unwind = {
+  SIGTRAMP_FRAME,
+  default_frame_unwind_stop_reason,
+  i386fbsd_dblfault_this_id,
+  i386fbsd_dblfault_prev_register,
+  NULL,
+  i386fbsd_dblfault_sniffer
+};
+#endif
+
+static const int i386fbsd_trapframe_offset[] = {
+  10 * 4,			/* %eax */
+  9 * 4,			/* %ecx */
+  8 * 4,			/* %edx */
+  7 * 4,			/* %ebx */
+  16 * 4,			/* %esp */
+  5 * 4,			/* %ebp */
+  4 * 4,			/* %esi */
+  3 * 4,			/* %edi */
+  13 * 4,			/* %eip */
+  15 * 4,			/* %eflags */
+  14 * 4,			/* %cs */
+  17 * 4,			/* %ss */
+  2 * 4,			/* %ds */
+  1 * 4,			/* %es */
+  0 * 4,			/* %fs */
+  -1				/* %gs */
+};
+
+#define	TRAPFRAME_SIZE		72
+
+static struct trad_frame_cache *
+i386fbsd_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;
+  struct i386fbsd_info *info;
+  CORE_ADDR addr, cs, func, pc, sp;
+  const char *name;
+  int i;
+
+  if (*this_cache != NULL)
+    return ((struct trad_frame_cache *)*this_cache);
+
+  info = get_i386fbsd_info();
+  cache = trad_frame_cache_zalloc (this_frame);
+  *this_cache = cache;
+
+  func = get_frame_func (this_frame);
+  sp = get_frame_register_unsigned (this_frame, I386_ESP_REGNUM);
+
+  find_pc_partial_function (func, &name, NULL, NULL);
+  if (strcmp(name, "calltrap") == 0 ||
+      strcmp(name, "Xlcall_syscall") == 0 ||
+      strcmp(name, "Xint0x80_syscall") == 0)
+    /* Traps in later kernels pass the trap frame by reference. */
+    sp += info->ofs_fix;
+  else if (strcmp(name, "Xtimerint") == 0)
+    /* Timer interrupts also pass the trap frame by reference. */
+    sp += info->ofs_fix;
+  else if (strcmp(name, "Xcpustop") == 0 ||
+	   strcmp(name, "Xrendezvous") == 0 ||
+	   strcmp(name, "Xipi_intr_bitmap_handler") == 0 ||
+	   strcmp(name, "Xlazypmap") == 0)
+    /* These handlers push a trap frame only. */
+    ;
+  else if (strcmp(name, "fork_trampoline") == 0)
+    if (get_frame_pc (this_frame) == func)
+      {
+	/* fork_exit hasn't been called (kthread has never run), so
+	   %esp in the pcb points to the word above the trapframe.  */
+	sp += 4;
+      }
+    else
+      {
+	/* fork_exit has been called, so %esp in fork_exit's
+	   frame is &tf - 12.  */
+	sp += 12;
+      }
+  else {
+    /* Interrupt frames pass the IDT vector in addition to the trap frame. */
+    sp += info->ofs_fix + 4;
+  }
+
+  addr = sp + i386fbsd_trapframe_offset[I386_CS_REGNUM];
+  cs = read_memory_unsigned_integer (addr, 4, byte_order);
+  for (i = 0; i < ARRAY_SIZE (i386fbsd_trapframe_offset); i++)
+    {
+      /* %ss/%esp are only present in the trapframe for a trap from
+          userland.  */
+      if ((cs & I386_SEL_RPL) == I386_SEL_KPL)
+	{
+	  if (i == I386_SS_REGNUM)
+	    continue;
+	  if (i == I386_ESP_REGNUM)
+	    {
+	      trad_frame_set_reg_value (cache, i, sp + TRAPFRAME_SIZE - 8);
+	      continue;
+	    }
+	}
+      if (i386fbsd_trapframe_offset[i] != -1)
+	trad_frame_set_reg_addr (cache, i, sp + i386fbsd_trapframe_offset[i]);
+    }
+
+  /* Read %eip from trap frame.  */
+  addr = sp + i386fbsd_trapframe_offset[I386_EIP_REGNUM];
+  pc = read_memory_unsigned_integer (addr, 4, 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.  */
+      sp += TRAPFRAME_SIZE;
+      if ((cs & I386_SEL_RPL) == I386_SEL_KPL)
+	sp -= 8;
+      trad_frame_set_id (cache, frame_id_build (sp, func));
+    }
+
+  return cache;
+}
+
+static void
+i386fbsd_trapframe_this_id (struct frame_info *this_frame,
+			     void **this_cache, struct frame_id *this_id)
+{
+  struct trad_frame_cache *cache =
+    i386fbsd_trapframe_cache (this_frame, this_cache);
+  
+  trad_frame_get_id (cache, this_id);
+}
+
+static struct value *
+i386fbsd_trapframe_prev_register (struct frame_info *this_frame,
+				   void **this_cache, int regnum)
+{
+  struct trad_frame_cache *cache =
+    i386fbsd_trapframe_cache (this_frame, this_cache);
+
+  return trad_frame_get_register (cache, this_frame, regnum);
+}
+
+static int
+i386fbsd_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, "calltrap") == 0)
+		   || (strcmp (name, "fork_trampoline") == 0)
+		   || (name[0] == 'X' && name[1] != '_')));
+}
+
+static const struct frame_unwind i386fbsd_trapframe_unwind = {
+  SIGTRAMP_FRAME,
+  default_frame_unwind_stop_reason,
+  i386fbsd_trapframe_this_id,
+  i386fbsd_trapframe_prev_register,
+  NULL,
+  i386fbsd_trapframe_sniffer
+};
+
+static void
+i386fbsd_kernel_init_abi(struct gdbarch_info info, struct gdbarch *gdbarch)
+{
+
+	i386_elf_init_abi(info, gdbarch);
+
+#ifdef __i386__
+	frame_unwind_prepend_unwinder(gdbarch, &i386fbsd_dblfault_unwind);
+#endif
+	frame_unwind_prepend_unwinder(gdbarch, &i386fbsd_trapframe_unwind);
+
+	set_solib_ops(gdbarch, &kld_so_ops);
+
+	fbsd_vmcore_set_supply_pcb(gdbarch, i386fbsd_supply_pcb);
+	fbsd_vmcore_set_cpu_pcb_addr(gdbarch, kgdb_trgt_stop_pcb);
+}
+
+void
+_initialize_i386_kgdb_tdep(void)
+{
+	/* This is used for both i386 and amd64, but amd64 always
+	   includes this target, so just include it here.  */
+	gdbarch_register_osabi_sniffer(bfd_arch_i386,
+				       bfd_target_elf_flavour,
+				       fbsd_kernel_osabi_sniffer);
+	gdbarch_register_osabi (bfd_arch_i386, 0,
+	    GDB_OSABI_FREEBSD_KERNEL, i386fbsd_kernel_init_abi);
+
+	i386fbsd_pspace_data = register_program_space_data_with_cleanup (NULL,
+	    i386fbsd_pspace_data_cleanup);
+
+#ifdef __i386__
+	/*
+	 * FreeBSD/i386 kernels prior to the introduction of AVX
+	 * support used a different layout for the PCB.  If gdb is
+	 * compiled on these systems, these asserts will fail.  The
+	 * package builders build packages on older systems which are
+	 * then run on newer systems.  These binaries trip over these
+	 * assertions even when debugging user programs and even
+	 * though the running kernel is new enough.  To cope, disable
+	 * the assertion checks unless gdb is built against a new
+	 * enough world.  Note that this means kgdb is not going to
+	 * parse PCBs correctly on FreeBSD/i386 kernels before AVX was
+	 * merged.
+	 */
+#if __FreeBSD_version >= 1001505
+	gdb_assert(offsetof(struct pcb, pcb_ebx)
+		   == i386fbsd_pcb_offset[I386_EBX_REGNUM]);
+	gdb_assert(offsetof(struct pcb, pcb_esp)
+		   == i386fbsd_pcb_offset[I386_ESP_REGNUM]);
+	gdb_assert(offsetof(struct pcb, pcb_ebp)
+		   == i386fbsd_pcb_offset[I386_EBP_REGNUM]);
+	gdb_assert(offsetof(struct pcb, pcb_esi)
+		   == i386fbsd_pcb_offset[I386_ESI_REGNUM]);
+	gdb_assert(offsetof(struct pcb, pcb_edi)
+		   == i386fbsd_pcb_offset[I386_EDI_REGNUM]);
+	gdb_assert(offsetof(struct pcb, pcb_eip)
+		   == i386fbsd_pcb_offset[I386_EIP_REGNUM]);
+#endif
+	gdb_assert(CODE_SEL == GSEL(GCODE_SEL, SEL_KPL));
+	gdb_assert(DATA_SEL == GSEL(GDATA_SEL, SEL_KPL));
+	gdb_assert(PRIV_SEL == GSEL(GPRIV_SEL, SEL_KPL));
+	gdb_assert(sizeof(struct trapframe) == TRAPFRAME_SIZE);
+	gdb_assert(offsetof(struct trapframe, tf_eax)
+		   == i386fbsd_trapframe_offset[I386_EAX_REGNUM]);
+	gdb_assert(offsetof(struct trapframe, tf_ecx)
+		   == i386fbsd_trapframe_offset[I386_ECX_REGNUM]);
+	gdb_assert(offsetof(struct trapframe, tf_edx)
+		   == i386fbsd_trapframe_offset[I386_EDX_REGNUM]);
+	gdb_assert(offsetof(struct trapframe, tf_ebx)
+		   == i386fbsd_trapframe_offset[I386_EBX_REGNUM]);
+	gdb_assert(offsetof(struct trapframe, tf_esp)
+		   == i386fbsd_trapframe_offset[I386_ESP_REGNUM]);
+	gdb_assert(offsetof(struct trapframe, tf_ebp)
+		   == i386fbsd_trapframe_offset[I386_EBP_REGNUM]);
+	gdb_assert(offsetof(struct trapframe, tf_esi)
+		   == i386fbsd_trapframe_offset[I386_ESI_REGNUM]);
+	gdb_assert(offsetof(struct trapframe, tf_edi)
+		   == i386fbsd_trapframe_offset[I386_EDI_REGNUM]);
+	gdb_assert(offsetof(struct trapframe, tf_eip)
+		   == i386fbsd_trapframe_offset[I386_EIP_REGNUM]);
+	gdb_assert(offsetof(struct trapframe, tf_eflags)
+		   == i386fbsd_trapframe_offset[I386_EFLAGS_REGNUM]);
+	gdb_assert(offsetof(struct trapframe, tf_cs)
+		   == i386fbsd_trapframe_offset[I386_CS_REGNUM]);
+	gdb_assert(offsetof(struct trapframe, tf_ss)
+		   == i386fbsd_trapframe_offset[I386_SS_REGNUM]);
+	gdb_assert(offsetof(struct trapframe, tf_ds)
+		   == i386fbsd_trapframe_offset[I386_DS_REGNUM]);
+	gdb_assert(offsetof(struct trapframe, tf_es)
+		   == i386fbsd_trapframe_offset[I386_ES_REGNUM]);
+	gdb_assert(offsetof(struct trapframe, tf_fs)
+		   == i386fbsd_trapframe_offset[I386_FS_REGNUM]);
+
+	gdb_assert(offsetof(struct i386tss, tss_eax)
+		   == i386fbsd_tss_offset[I386_EAX_REGNUM]);
+	gdb_assert(offsetof(struct i386tss, tss_ecx)
+		   == i386fbsd_tss_offset[I386_ECX_REGNUM]);
+	gdb_assert(offsetof(struct i386tss, tss_edx)
+		   == i386fbsd_tss_offset[I386_EDX_REGNUM]);
+	gdb_assert(offsetof(struct i386tss, tss_ebx)
+		   == i386fbsd_tss_offset[I386_EBX_REGNUM]);
+	gdb_assert(offsetof(struct i386tss, tss_esp)
+		   == i386fbsd_tss_offset[I386_ESP_REGNUM]);
+	gdb_assert(offsetof(struct i386tss, tss_ebp)
+		   == i386fbsd_tss_offset[I386_EBP_REGNUM]);
+	gdb_assert(offsetof(struct i386tss, tss_esi)
+		   == i386fbsd_tss_offset[I386_ESI_REGNUM]);
+	gdb_assert(offsetof(struct i386tss, tss_edi)
+		   == i386fbsd_tss_offset[I386_EDI_REGNUM]);
+	gdb_assert(offsetof(struct i386tss, tss_eip)
+		   == i386fbsd_tss_offset[I386_EIP_REGNUM]);
+	gdb_assert(offsetof(struct i386tss, tss_eflags)
+		   == i386fbsd_tss_offset[I386_EFLAGS_REGNUM]);
+	gdb_assert(offsetof(struct i386tss, tss_cs)
+		   == i386fbsd_tss_offset[I386_CS_REGNUM]);
+	gdb_assert(offsetof(struct i386tss, tss_ss)
+		   == i386fbsd_tss_offset[I386_SS_REGNUM]);
+	gdb_assert(offsetof(struct i386tss, tss_ds)
+		   == i386fbsd_tss_offset[I386_DS_REGNUM]);
+	gdb_assert(offsetof(struct i386tss, tss_es)
+		   == i386fbsd_tss_offset[I386_ES_REGNUM]);
+	gdb_assert(offsetof(struct i386tss, tss_fs)
+		   == i386fbsd_tss_offset[I386_FS_REGNUM]);
+	gdb_assert(offsetof(struct i386tss, tss_gs)
+		   == i386fbsd_tss_offset[I386_GS_REGNUM]);
+#endif
+}


Property changes on: trunk/devel/gdb/files/kgdb/i386fbsd-kern.c
___________________________________________________________________
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
Added: trunk/devel/gdb/files/kgdb/kgdb-main.c
===================================================================
--- trunk/devel/gdb/files/kgdb/kgdb-main.c	                        (rev 0)
+++ trunk/devel/gdb/files/kgdb/kgdb-main.c	2018-11-26 17:06:28 UTC (rev 24716)
@@ -0,0 +1,412 @@
+/*
+ * 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 <sys/cdefs.h>
+__FBSDID("$FreeBSD: head/devel/gdb/files/kgdb/kgdb-main.c 480613 2018-09-24 17:23:35Z jhb $");
+
+#include <sys/param.h>
+#include <sys/stat.h>
+#include <sys/types.h>
+#include <sys/ioctl.h>
+#include <sys/resource.h>
+#include <sys/select.h>
+#include <sys/time.h>
+#include <sys/wait.h>
+#include <errno.h>
+#include <err.h>
+#include <kvm.h>
+#include <limits.h>
+#include <paths.h>
+
+/* libgdb stuff. */
+#include <defs.h>
+#include <frame.h>
+#include <frame-unwind.h>
+#include <inferior.h>
+#include <interps.h>
+#include <cli-out.h>
+#include <main.h>
+#include <objfiles.h>
+#include <target.h>
+#include <top.h>
+#include <ui-file.h>
+#include <bfd.h>
+#include <gdbcore.h>
+
+#include <unistd.h>
+
+#include "kgdb.h"
+
+static int verbose;
+
+static char crashdir[PATH_MAX];
+static char *dumpnr;
+static char *kernel;
+static char *remote;
+static char *vmcore;
+
+/*
+ * TODO:
+ * - test remote kgdb (see if threads and klds work)
+ * - possibly split kthr.c out into a separate thread_stratum target that
+ *   uses new_objfile test to push itself when a FreeBSD kernel is loaded
+ *   (check for kernel osabi) (probably don't bother with this)
+ * + test alternate kgdb_lookup()
+ * + fix kgdb build on amd64 to include i386 cross-debug support
+ * - propose expanded libkvm interface that supports cross-debug and moves
+ *   MD bits of kgdb into the library (examining PCB's and exporting a
+ *   stable-ABI struct of registers, similarly for trapframe handling and
+ *   stop-pcb stuff
+ * + use tid's as lwp IDs instead of PIDs in ptid's
+ */
+
+static void
+usage(void)
+{
+
+	fprintf(stderr,
+	    "usage: %s [-afqvw] [-b rate] [-d crashdir] [-c core | -n dumpnr | -r device]\n"
+	    "\t[kernel [core]]\n", getprogname());
+	exit(1);
+}
+
+static void
+kernel_from_dumpnr(const char *nr)
+{
+	char line[PATH_MAX], path[PATH_MAX];
+	FILE *info;
+	char *dir;
+	struct stat st;
+	int l;
+
+	/*
+	 * If there's a kernel image right here in the crash directory, then
+	 * use it.  The kernel image is either called kernel.<nr> or is in a
+	 * subdirectory kernel.<nr> and called kernel.  The latter allows us
+	 * to collect the modules in the same place.
+	 */
+	snprintf(path, sizeof(path), "%s/kernel.%s", crashdir, nr);
+	if (stat(path, &st) == 0) {
+		if (S_ISREG(st.st_mode)) {
+			kernel = strdup(path);
+			return;
+		}
+		if (S_ISDIR(st.st_mode)) {
+			snprintf(path, sizeof(path), "%s/kernel.%s/kernel",
+			    crashdir, nr);
+			if (stat(path, &st) == 0 && S_ISREG(st.st_mode)) {
+				kernel = strdup(path);
+				return;
+			}
+		}
+	}
+
+	/*
+	 * No kernel image here.  Parse the dump header.  The kernel object
+	 * directory can be found there and we probably have the kernel
+	 * image still in it.  The object directory may also have a kernel
+	 * with debugging info (called either kernel.full or kernel.debug).
+	 * If we have a debug kernel, use it.
+	 */
+	snprintf(path, sizeof(path), "%s/info.%s", crashdir, nr);
+	info = fopen(path, "r");
+	if (info == NULL) {
+		warn("%s", path);
+		return;
+	}
+	while (fgets(line, sizeof(line), info) != NULL) {
+		l = strlen(line);
+		if (l > 0 && line[l - 1] == '\n')
+			line[--l] = '\0';
+		if (strncmp(line, "    ", 4) == 0) {
+			fclose(info);
+			dir = strchr(line, ':');
+			dir = (dir == NULL) ? line + 4 : dir + 1;
+
+			/*
+			 * Check for kernel.full first as if it exists
+			 * kernel.debug will also exist, but will only
+			 * contain debug symbols and not be recognized
+			 * as a valid kernel by the osabi sniffer.
+			 */
+			snprintf(path, sizeof(path), "%s/kernel.full", dir);
+			if (stat(path, &st) == 0 && S_ISREG(st.st_mode)) {
+				kernel = strdup(path);
+				return;
+			}
+			snprintf(path, sizeof(path), "%s/kernel.debug", dir);
+			if (stat(path, &st) == 0 && S_ISREG(st.st_mode)) {
+				kernel = strdup(path);
+				return;
+			}
+			snprintf(path, sizeof(path), "%s/kernel", dir);
+			if (stat(path, &st) == 0 && S_ISREG(st.st_mode)) {
+				kernel = strdup(path);
+				return;
+			}
+			return;
+		}
+	}
+	fclose(info);
+}
+
+/*
+ * Remote targets can support any number of syntaxes and we want to
+ * support them all with one addition: we support specifying a device
+ * node for a serial device without the "/dev/" prefix.
+ *
+ * What we do is to stat(2) the existing remote target first.  If that
+ * fails, we try it with "/dev/" prepended.  If that succeeds we use
+ * the resulting path, otherwise we use the original target.  If
+ * either stat(2) succeeds make sure the file is either a character
+ * device or a FIFO.
+ */
+static void
+verify_remote(void)
+{
+	char path[PATH_MAX];
+	struct stat st;
+
+	if (stat(remote, &st) != 0) {
+		snprintf(path, sizeof(path), "/dev/%s", remote);
+		if (stat(path, &st) != 0)
+			return;
+		free(remote);
+		remote = strdup(path);
+	}
+	if (!S_ISCHR(st.st_mode) && !S_ISFIFO(st.st_mode))
+		errx(1, "%s: not a special file, FIFO or socket", remote);
+}
+
+static void
+add_arg(struct captured_main_args *args, char const *arg)
+{
+
+	args->argc++;
+	args->argv = (char **)reallocf(args->argv, (args->argc + 1) *
+	    sizeof(char *));
+	if (args->argv == NULL)
+		err(1, "Out of memory building argument list");
+	args->argv[args->argc] = (char *)arg;
+}
+
+int
+main(int argc, char *argv[])
+{
+	char path[PATH_MAX];
+	struct stat st;
+	struct captured_main_args args;
+	char *s;
+	int a, ch, writeable;
+
+	dumpnr = NULL;
+	writeable = 0;
+
+	strlcpy(crashdir, "/var/crash", sizeof(crashdir));
+	s = getenv("KGDB_CRASH_DIR");
+	if (s != NULL)
+		strlcpy(crashdir, s, sizeof(crashdir));
+
+	/* Convert long options into short options. */
+	for (a = 1; a < argc; a++) {
+		s = argv[a];
+		if (s[0] == '-') {
+			s++;
+			/* Long options take either 1 or 2 dashes. */
+			if (s[0] == '-')
+				s++;
+			if (strcmp(s, "quiet") == 0)
+				argv[a] = (char *)"-q";
+			else if (strcmp(s, "fullname") == 0)
+				argv[a] = (char *)"-f";
+		}
+	}
+
+	kgdb_quiet = 0;
+	memset (&args, 0, sizeof args);
+	args.interpreter_p = INTERP_CONSOLE;
+	args.argv = (char **)xmalloc(sizeof(char *));
+	args.argv[0] = argv[0];
+
+	while ((ch = getopt(argc, argv, "ab:c:d:fn:qr:vw")) != -1) {
+		switch (ch) {
+		case 'a':
+			annotation_level++;
+			break;
+		case 'b': {
+			int i;
+			char *p;
+
+			i = strtol(optarg, &p, 0);
+			if (*p != '\0' || p == optarg)
+				warnx("warning: could not set baud rate to `%s'.\n",
+				    optarg);
+			else
+				baud_rate = i;
+			break;
+		}
+		case 'c':	/* use given core file. */
+			if (vmcore != NULL) {
+				warnx("option %c: can only be specified once",
+				    optopt);
+				usage();
+				/* NOTREACHED */
+			}
+			vmcore = strdup(optarg);
+			break;
+		case 'd':	/* lookup dumps in given directory. */
+			strlcpy(crashdir, optarg, sizeof(crashdir));
+			break;
+		case 'f':
+			annotation_level = 1;
+			break;
+		case 'n':	/* use dump with given number. */
+			dumpnr = optarg;
+			break;
+		case 'q':
+			kgdb_quiet = 1;
+			add_arg(&args, "-q");
+			break;
+		case 'r':	/* use given device for remote session. */
+			if (remote != NULL) {
+				warnx("option %c: can only be specified once",
+				    optopt);
+				usage();
+				/* NOTREACHED */
+			}
+			remote = strdup(optarg);
+			break;
+		case 'v':	/* increase verbosity. */
+			verbose++;
+			break;
+		case 'w':	/* core file is writeable. */
+			writeable = 1;
+			break;
+		case '?':
+		default:
+			usage();
+		}
+	}
+
+	if (((vmcore != NULL) ? 1 : 0) + ((dumpnr != NULL) ? 1 : 0) +
+	    ((remote != NULL) ? 1 : 0) > 1) {
+		warnx("options -c, -n and -r are mutually exclusive");
+		usage();
+		/* NOTREACHED */
+	}
+
+	if (verbose > 1)
+		warnx("using %s as the crash directory", crashdir);
+
+	if (argc > optind)
+		kernel = strdup(argv[optind++]);
+
+	if (argc > optind && (dumpnr != NULL || remote != NULL)) {
+		warnx("options -n and -r do not take a core file. Ignored");
+		optind = argc;
+	}
+
+	if (dumpnr != NULL) {
+		snprintf(path, sizeof(path), "%s/vmcore.%s", crashdir, dumpnr);
+		if (stat(path, &st) == -1)
+			err(1, "%s", path);
+		if (!S_ISREG(st.st_mode))
+			errx(1, "%s: not a regular file", path);
+		vmcore = strdup(path);
+	} else if (remote != NULL) {
+		verify_remote();
+	} else if (argc > optind) {
+		if (vmcore == NULL)
+			vmcore = strdup(argv[optind++]);
+		if (argc > optind)
+			warnx("multiple core files specified. Ignored");
+	} else if (vmcore == NULL && kernel == NULL) {
+		vmcore = strdup(_PATH_MEM);
+		kernel = strdup(getbootfile());
+	}
+
+	if (verbose) {
+		if (vmcore != NULL)
+			warnx("core file: %s", vmcore);
+		if (remote != NULL)
+			warnx("device file: %s", remote);
+		if (kernel != NULL)
+			warnx("kernel image: %s", kernel);
+	}
+
+	/* A remote target requires an explicit kernel argument. */
+	if (remote != NULL && kernel == NULL) {
+		warnx("remote debugging requires a kernel");
+		usage();
+		/* NOTREACHED */
+	}
+
+	/* If we don't have a kernel image yet, try to find one. */
+	if (kernel == NULL) {
+		if (dumpnr != NULL)
+			kernel_from_dumpnr(dumpnr);
+
+		if (kernel == NULL)
+			errx(1, "couldn't find a suitable kernel image");
+		if (verbose)
+			warnx("kernel image: %s", kernel);
+	}
+
+	/* Set an alternate prompt. */
+	add_arg(&args, "-iex");
+	add_arg(&args, "set prompt (kgdb) ");
+
+	/* Change osabi to assume a FreeBSD kernel. */
+	add_arg(&args, "-iex");
+	add_arg(&args, "set osabi FreeBSD/kernel");
+
+	/* Open the vmcore if requested. */
+	if (vmcore != NULL) {
+		add_arg(&args, "-ex");
+		if (asprintf(&s, "target vmcore %s%s", writeable ? "-w " : "",
+		    vmcore) < 0)
+			err(1, "couldn't build command line");
+		add_arg(&args, s);
+	}
+
+	/* Open the remote target if requested. */
+	if (remote != NULL) {
+		add_arg(&args, "-ex");
+		if (asprintf(&s, "target remote %s", remote) < 0)
+			err(1, "couldn't build command line");
+		add_arg(&args, s);
+	}
+
+	add_arg(&args, kernel);
+
+	/* The libgdb code uses optind too. Reset it... */
+	optind = 0;
+
+	/* Terminate argv list. */
+	add_arg(&args, NULL);
+
+	return (gdb_main(&args));
+}


Property changes on: trunk/devel/gdb/files/kgdb/kgdb-main.c
___________________________________________________________________
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
Added: trunk/devel/gdb/files/kgdb/kgdb.1
===================================================================
--- trunk/devel/gdb/files/kgdb/kgdb.1	                        (rev 0)
+++ trunk/devel/gdb/files/kgdb/kgdb.1	2018-11-26 17:06:28 UTC (rev 24716)
@@ -0,0 +1,140 @@
+.\" 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.
+.\"
+.\" $FreeBSD: head/devel/gdb/files/kgdb/kgdb.1 440447 2017-05-08 19:02:25Z jhb $
+.\"
+.Dd October 11, 2006
+.Dt KGDB 1
+.Os
+.Sh NAME
+.Nm kgdb
+.Nd "kernel debugger"
+.Sh SYNOPSIS
+.Nm
+.Op Fl a | Fl f | Fl fullname
+.Op Fl b Ar rate
+.Op Fl q | Fl quiet
+.Op Fl v
+.Op Fl w
+.Op Fl d Ar crashdir
+.Op Fl c Ar core | Fl n Ar dumpnr | Fl r Ar device
+.Op Ar kernel Op Ar core
+.Sh DESCRIPTION
+The
+.Nm
+utility is a debugger based on
+.Xr gdb 1
+that allows debugging of kernel core files.
+.Pp
+The options are as follows:
+.Bl -tag -width ".Fl d Ar crashdir"
+.It Fl a
+Increase the annotation level.
+An annotation level of 1 features the historical
+.Fl fullname
+option of
+.Xr gdb 1 .
+This is useful when running
+.Nm
+in Emacs.
+The
+.Fl f
+or
+.Fl fullname
+options are supported for backward compatibility as well.
+.It Fl b Ar rate
+Set the baudrate to
+.Ar rate .
+.It Fl q
+Suppress printing of the banner when the debugger starts.
+The
+.Fl quiet
+form is supported for compatibility as well.
+.It Fl v
+Increase verbosity.
+.It Fl w
+Opens kmem-based targets in read-write mode.
+(This is identical to what
+.Fl -wcore
+used to do in previous
+gdb versions for
+.Fx . )
+.It Fl d Ar crashdir
+Use
+.Ar crashdir
+instead of the default,
+.Pa /var/crash
+to locate kernel core dump files in.
+The name
+.Pa vmcore.
+plus the dump number will be appended to determine
+the actual dump file name.
+.It Fl c Ar core
+Explicitly use
+.Ar core
+as the core dump file.
+.It Fl n Ar dumpnr
+Use the kernel core dump file numbered
+.Ar dumpnr
+for debugging.
+.It Fl r Ar device
+Use
+.Ar device
+to connect
+.Nm
+to for a remote debugging session.
+.El
+.Pp
+The
+.Fl c , n ,
+and
+.Fl r
+options are mutually exclusive.
+.Pp
+Optionally, the name of the kernel symbol file and
+the name of the core dump file can be supplied on the
+command-line as positional arguments.
+If no kernel symbol file name has been given, the
+symbol file of the currently running kernel will be
+used.
+If no core dump file has been specified through either
+of the options or the last command-line argument,
+.Pa /dev/mem
+will be opened to allow debugging the currently running
+kernel.
+.Sh FILES
+.Bl -tag -width ".Pa /var/crash"
+.It Pa /dev/mem
+Default memory image to open if no core dump file
+has been specified.
+.It Pa /var/crash
+Default directory to locate kernel core dump files.
+.El
+.Sh SEE ALSO
+.Xr gdb 1
+.Sh HISTORY
+The
+.Nm
+utility first appeared in its current form in
+.Fx 5.3 .


Property changes on: trunk/devel/gdb/files/kgdb/kgdb.1
___________________________________________________________________
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
Added: trunk/devel/gdb/files/kgdb/kgdb.h
===================================================================
--- trunk/devel/gdb/files/kgdb/kgdb.h	                        (rev 0)
+++ trunk/devel/gdb/files/kgdb/kgdb.h	2018-11-26 17:06:28 UTC (rev 24716)
@@ -0,0 +1,66 @@
+/*
+ * 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.
+ *
+ * $FreeBSD: head/devel/gdb/files/kgdb/kgdb.h 480613 2018-09-24 17:23:35Z jhb $
+ */
+
+#ifndef _KGDB_H_
+#define	_KGDB_H_
+
+struct kthr {
+	struct kthr	*next;
+	CORE_ADDR	paddr;
+	CORE_ADDR	kaddr;
+	CORE_ADDR	pcb;
+	int		tid;
+	int		pid;
+	int		cpu;
+};
+
+extern struct kthr *curkthr;
+extern struct target_so_ops kld_so_ops;
+extern int kgdb_quiet;
+
+CORE_ADDR kgdb_trgt_stop_pcb(u_int);
+
+struct kthr *kgdb_thr_first(void);
+struct kthr *kgdb_thr_init(CORE_ADDR (*cpu_pcb_addr) (u_int));
+struct kthr *kgdb_thr_lookup_tid(int);
+struct kthr *kgdb_thr_lookup_pid(int);
+struct kthr *kgdb_thr_lookup_paddr(uintptr_t);
+struct kthr *kgdb_thr_lookup_taddr(uintptr_t);
+struct kthr *kgdb_thr_next(struct kthr *);
+const char  *kgdb_thr_extra_thread_info(int);
+
+enum gdb_osabi fbsd_kernel_osabi_sniffer(bfd *abfd);
+void fbsd_vmcore_set_supply_pcb (struct gdbarch *gdbarch,
+				 void (*supply_pcb) (struct regcache *,
+						     CORE_ADDR));
+void fbsd_vmcore_set_cpu_pcb_addr (struct gdbarch *gdbarch,
+				   CORE_ADDR (*cpu_pcb_addr) (u_int));
+
+CORE_ADDR kgdb_lookup(const char *sym);
+
+#endif /* _KGDB_H_ */


Property changes on: trunk/devel/gdb/files/kgdb/kgdb.h
___________________________________________________________________
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
Added: trunk/devel/gdb/files/kgdb/mipsfbsd-kern.c
===================================================================
--- trunk/devel/gdb/files/kgdb/mipsfbsd-kern.c	                        (rev 0)
+++ trunk/devel/gdb/files/kgdb/mipsfbsd-kern.c	2018-11-26 17:06:28 UTC (rev 24716)
@@ -0,0 +1,298 @@
+/*
+ * Copyright (c) 2007 Juniper Networks, Inc.
+ * 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 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.
+ *
+ * from: src/gnu/usr.bin/gdb/kgdb/trgt_alpha.c,v 1.2.2.1 2005/09/15 05:32:10 marcel
+ */
+
+#include <sys/cdefs.h>
+__FBSDID("$FreeBSD: head/gnu/usr.bin/gdb/kgdb/trgt_mips.c 249878 2013-04-25 04:53:01Z imp $");
+
+#include "defs.h"
+#include "frame-unwind.h"
+#include "osabi.h"
+#include "regcache.h"
+#include "solib.h"
+#include "trad-frame.h"
+#include "mips-tdep.h"
+
+#ifdef __mips__
+#include <machine/asm.h>
+#include <machine/pcb.h>
+#include <machine/frame.h>
+#endif
+
+#include "kgdb.h"
+
+/* Size of struct trapframe in registers. */
+#define	TRAPFRAME_WORDS	74
+
+/* From sys/mips/include/pcb.h.  Offsets in the pcb_context[] array. */
+#define	FBSD_PCB_REG_S0	0
+#define	FBSD_PCB_REG_S1	1
+#define	FBSD_PCB_REG_S2	2
+#define	FBSD_PCB_REG_S3	3
+#define	FBSD_PCB_REG_S4	4
+#define	FBSD_PCB_REG_S5	5
+#define	FBSD_PCB_REG_S6	6
+#define	FBSD_PCB_REG_S7	7
+#define	FBSD_PCB_REG_SP	8
+#define	FBSD_PCB_REG_S8	9
+#define	FBSD_PCB_REG_RA	10
+#define	FBSD_PCB_REG_SR	11
+#define	FBSD_PCB_REG_GP	12
+#define	FBSD_PCB_REG_PC	13
+
+#ifdef __mips__
+_Static_assert(TRAPFRAME_WORDS * sizeof(register_t) ==
+	       sizeof(struct trapframe), "TRAPFRAME_WORDS mismatch");
+_Static_assert(FBSD_PCB_REG_S0 == PCB_REG_S0, "PCB_REG_S0 mismatch");
+_Static_assert(FBSD_PCB_REG_S1 == PCB_REG_S1, "PCB_REG_S1 mismatch");
+_Static_assert(FBSD_PCB_REG_S2 == PCB_REG_S2, "PCB_REG_S2 mismatch");
+_Static_assert(FBSD_PCB_REG_S3 == PCB_REG_S3, "PCB_REG_S3 mismatch");
+_Static_assert(FBSD_PCB_REG_S4 == PCB_REG_S4, "PCB_REG_S4 mismatch");
+_Static_assert(FBSD_PCB_REG_S5 == PCB_REG_S5, "PCB_REG_S5 mismatch");
+_Static_assert(FBSD_PCB_REG_S6 == PCB_REG_S6, "PCB_REG_S6 mismatch");
+_Static_assert(FBSD_PCB_REG_S7 == PCB_REG_S7, "PCB_REG_S7 mismatch");
+_Static_assert(FBSD_PCB_REG_SP == PCB_REG_SP, "PCB_REG_SP mismatch");
+_Static_assert(FBSD_PCB_REG_S8 == PCB_REG_S8, "PCB_REG_S8 mismatch");
+_Static_assert(FBSD_PCB_REG_RA == PCB_REG_RA, "PCB_REG_RA mismatch");
+_Static_assert(FBSD_PCB_REG_SR == PCB_REG_SR, "PCB_REG_SR mismatch");
+_Static_assert(FBSD_PCB_REG_GP == PCB_REG_GP, "PCB_REG_GP mismatch");
+_Static_assert(FBSD_PCB_REG_PC == PCB_REG_PC, "PCB_REG_PC mismatch");
+#endif
+
+static void
+mipsfbsd_supply_pcb(struct regcache *regcache, CORE_ADDR pcb_addr)
+{
+  struct gdbarch *gdbarch = regcache->arch ();
+  size_t regsize = mips_isa_regsize (gdbarch);
+  gdb_byte buf[regsize * (FBSD_PCB_REG_PC + 1)];
+
+  /* Read the entire pcb_context[] array in one go.  The pcb_context[]
+     array is after the pcb_regs member which is a trapframe.  */
+  if (target_read_memory (pcb_addr + TRAPFRAME_WORDS * regsize, buf,
+			  sizeof(buf)) != 0)
+    return;
+
+  regcache->raw_supply_unsigned (MIPS_ZERO_REGNUM, 0);
+  regcache->raw_supply (MIPS_S2_REGNUM - 2,
+			buf + (regsize * FBSD_PCB_REG_S0));
+  regcache->raw_supply (MIPS_S2_REGNUM - 1,
+			buf + (regsize * FBSD_PCB_REG_S1));
+  regcache->raw_supply (MIPS_S2_REGNUM,
+			buf + (regsize * FBSD_PCB_REG_S2));
+  regcache->raw_supply (MIPS_S2_REGNUM + 1,
+			buf + (regsize * FBSD_PCB_REG_S3));
+  regcache->raw_supply (MIPS_S2_REGNUM + 2,
+			buf + (regsize * FBSD_PCB_REG_S4));
+  regcache->raw_supply (MIPS_S2_REGNUM + 3,
+			buf + (regsize * FBSD_PCB_REG_S5));
+  regcache->raw_supply (MIPS_S2_REGNUM + 4,
+			buf + (regsize * FBSD_PCB_REG_S6));
+  regcache->raw_supply (MIPS_S2_REGNUM + 5,
+			buf + (regsize * FBSD_PCB_REG_S7));
+  regcache->raw_supply (MIPS_SP_REGNUM,
+			buf + (regsize * FBSD_PCB_REG_SP));
+  regcache->raw_supply (MIPS_S2_REGNUM + 6,
+			buf + (regsize * FBSD_PCB_REG_S8));
+  regcache->raw_supply (MIPS_RA_REGNUM,
+			buf + (regsize * FBSD_PCB_REG_RA));
+  regcache->raw_supply (MIPS_PS_REGNUM,
+			buf + (regsize * FBSD_PCB_REG_SR));
+  regcache->raw_supply (MIPS_GP_REGNUM,
+			buf + (regsize * FBSD_PCB_REG_GP));
+  regcache->raw_supply (MIPS_EMBED_PC_REGNUM,
+			buf + (regsize * FBSD_PCB_REG_PC));
+}
+
+static struct trad_frame_cache *
+mipsfbsd_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);
+  size_t regsize = mips_isa_regsize (gdbarch);
+  struct trad_frame_cache *cache;
+  CORE_ADDR addr, func, pc, sp;
+  int regnum;
+
+  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_signed (this_frame,
+				  MIPS_SP_REGNUM + gdbarch_num_regs (gdbarch));
+
+  /* Skip over CALLFRAME_SIZ.  */
+  addr = sp;
+  if (regsize == 8)
+    addr += regsize * 4;
+  else
+    addr += regsize * (4 + 2);
+
+  /* GPRs.  Skip zero.  */
+  addr += regsize;
+  for (regnum = MIPS_AT_REGNUM; regnum <= MIPS_RA_REGNUM; regnum++)
+    {
+      trad_frame_set_reg_addr (cache,
+			       regnum + gdbarch_num_regs (gdbarch),
+			       addr);
+      addr += regsize;
+    }
+
+  regnum = MIPS_PS_REGNUM;
+  trad_frame_set_reg_addr (cache,
+			   regnum + gdbarch_num_regs (gdbarch),
+			   addr);
+  addr += regsize;
+
+  /* HI and LO.  */
+  regnum = mips_regnum (gdbarch)->lo;
+  trad_frame_set_reg_addr (cache,
+			   regnum + gdbarch_num_regs (gdbarch),
+			   addr);
+  addr += regsize;
+  regnum = mips_regnum (gdbarch)->hi;
+  trad_frame_set_reg_addr (cache,
+			   regnum + gdbarch_num_regs (gdbarch),
+			   addr);
+  addr += regsize;
+
+  /* BADVADDR.  */
+  regnum = mips_regnum (gdbarch)->badvaddr;
+  trad_frame_set_reg_addr (cache,
+			   regnum + gdbarch_num_regs (gdbarch),
+			   addr);
+  addr += regsize;
+
+  /* CAUSE.  */
+  regnum = mips_regnum (gdbarch)->cause;
+  trad_frame_set_reg_addr (cache,
+			   regnum + gdbarch_num_regs (gdbarch),
+			   addr);
+  addr += regsize;
+
+  /* PC.  */
+  regnum = mips_regnum (gdbarch)->pc;
+  trad_frame_set_reg_addr (cache,
+			   regnum + gdbarch_num_regs (gdbarch),
+			   addr);
+  
+  trad_frame_set_id (cache, frame_id_build (sp + TRAPFRAME_WORDS * regsize,
+					    func));
+  return cache;
+}
+
+static void
+mipsfbsd_trapframe_this_id (struct frame_info *this_frame,
+			    void **this_cache, struct frame_id *this_id)
+{
+  struct trad_frame_cache *cache =
+    mipsfbsd_trapframe_cache (this_frame, this_cache);
+  
+  trad_frame_get_id (cache, this_id);
+}
+
+static struct value *
+mipsfbsd_trapframe_prev_register (struct frame_info *this_frame,
+				  void **this_cache, int regnum)
+{
+  struct trad_frame_cache *cache =
+    mipsfbsd_trapframe_cache (this_frame, this_cache);
+
+  return trad_frame_get_register (cache, this_frame, regnum);
+}
+
+static int
+mipsfbsd_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, "MipsKernIntr") == 0) ||
+		   (strcmp(name, "MipsKernGenException") == 0) ||
+		   (strcmp(name, "MipsTLBInvalidException") == 0)));
+}
+
+static const struct frame_unwind mipsfbsd_trapframe_unwind = {
+  SIGTRAMP_FRAME,
+  default_frame_unwind_stop_reason,
+  mipsfbsd_trapframe_this_id,
+  mipsfbsd_trapframe_prev_register,
+  NULL,
+  mipsfbsd_trapframe_sniffer
+};
+
+static void
+mipsfbsd_kernel_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
+{
+  enum mips_abi abi = mips_abi (gdbarch);
+
+  set_gdbarch_software_single_step (gdbarch, mips_software_single_step);
+
+  switch (abi)
+    {
+      case MIPS_ABI_O32:
+	break;
+      case MIPS_ABI_N32:
+	set_gdbarch_long_double_bit (gdbarch, 128);
+	/* These floatformats should probably be renamed.  MIPS uses
+	   the same 128-bit IEEE floating point format that IA-64 uses,
+	   except that the quiet/signalling NaN bit is reversed (GDB
+	   does not distinguish between quiet and signalling NaNs).  */
+	set_gdbarch_long_double_format (gdbarch, floatformats_ia64_quad);
+	break;
+      case MIPS_ABI_N64:
+	set_gdbarch_long_double_bit (gdbarch, 128);
+	/* These floatformats should probably be renamed.  MIPS uses
+	   the same 128-bit IEEE floating point format that IA-64 uses,
+	   except that the quiet/signalling NaN bit is reversed (GDB
+	   does not distinguish between quiet and signalling NaNs).  */
+	set_gdbarch_long_double_format (gdbarch, floatformats_ia64_quad);
+	break;
+    }
+
+  frame_unwind_prepend_unwinder (gdbarch, &mipsfbsd_trapframe_unwind);
+
+  set_solib_ops (gdbarch, &kld_so_ops);
+
+  fbsd_vmcore_set_supply_pcb (gdbarch, mipsfbsd_supply_pcb);
+  fbsd_vmcore_set_cpu_pcb_addr (gdbarch, kgdb_trgt_stop_pcb);
+}
+
+void
+_initialize_mips_kgdb_tdep (void)
+{
+  gdbarch_register_osabi_sniffer(bfd_arch_mips,
+				 bfd_target_elf_flavour,
+				 fbsd_kernel_osabi_sniffer);
+  gdbarch_register_osabi (bfd_arch_mips, 0, GDB_OSABI_FREEBSD_KERNEL,
+			  mipsfbsd_kernel_init_abi);
+}


Property changes on: trunk/devel/gdb/files/kgdb/mipsfbsd-kern.c
___________________________________________________________________
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
Added: trunk/devel/gdb/files/kgdb/ppcfbsd-kern.c
===================================================================
--- trunk/devel/gdb/files/kgdb/ppcfbsd-kern.c	                        (rev 0)
+++ trunk/devel/gdb/files/kgdb/ppcfbsd-kern.c	2018-11-26 17:06:28 UTC (rev 24716)
@@ -0,0 +1,249 @@
+/*-
+ * Copyright (c) 2006 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 <sys/cdefs.h>
+__FBSDID("$FreeBSD: head/devel/gdb/files/kgdb/ppcfbsd-kern.c 464493 2018-03-14 14:33:21Z pizzamig $");
+
+#include "defs.h"
+#include "frame-unwind.h"
+#include "gdbcore.h"
+#include "osabi.h"
+#include "regcache.h"
+#include "solib.h"
+#include "symtab.h"
+#include "trad-frame.h"
+#include "ppc-tdep.h"
+#include "ppc64-tdep.h"
+
+#ifdef __powerpc__
+#include <machine/pcb.h>
+#include <machine/frame.h>
+#endif
+
+#include "kgdb.h"
+
+#ifdef __powerpc__
+static void
+ppcfbsd_supply_pcb(struct regcache *regcache, CORE_ADDR pcb_addr)
+{
+	struct pcb pcb;
+	struct gdbarch_tdep *tdep;
+	int i;
+
+	tdep = gdbarch_tdep (regcache->arch ());
+
+	if (target_read_memory(pcb_addr, (gdb_byte *)&pcb, sizeof(pcb)) != 0)
+		memset(&pcb, 0, sizeof(pcb));
+
+	/*
+	 * r14-r31 are saved in the pcb
+	 */
+	for (i = 14; i <= 31; i++) {
+		regcache->raw_supply(tdep->ppc_gp0_regnum + i,
+		    (char *)&pcb.pcb_context[i]);
+	}
+
+	/* r1 is saved in the sp field */
+	regcache->raw_supply(tdep->ppc_gp0_regnum + 1,
+			    (char *)&pcb.pcb_sp);
+	if (tdep->wordsize == 8)
+	  /* r2 is saved in the toc field */
+	  regcache->raw_supply(tdep->ppc_gp0_regnum + 2,
+			      (char *)&pcb.pcb_toc);
+
+	regcache->raw_supply(tdep->ppc_lr_regnum, (char *)&pcb.pcb_lr);
+	regcache->raw_supply(tdep->ppc_cr_regnum, (char *)&pcb.pcb_cr);
+}
+#endif
+
+#define	OFF_FIXREG	0
+#define	OFF_LR		32
+#define	OFF_CR		33
+#define	OFF_XER		34
+#define	OFF_CTR		35
+#define	OFF_SRR0	36
+#define	TRAPFRAME_SIZE	42
+
+#ifdef __powerpc__
+_Static_assert(sizeof(struct trapframe) == TRAPFRAME_SIZE * sizeof(register_t),
+	       "trapframe size");
+_Static_assert(offsetof(struct trapframe, fixreg)
+	       == OFF_FIXREG * sizeof(register_t), "fixreg offset");
+_Static_assert(offsetof(struct trapframe, lr) == OFF_LR * sizeof(register_t),
+	       "lr offset");
+_Static_assert(offsetof(struct trapframe, cr) == OFF_CR * sizeof(register_t),
+	       "cr offset");
+_Static_assert(offsetof(struct trapframe, xer) == OFF_XER * sizeof(register_t),
+	       "xer offset");
+_Static_assert(offsetof(struct trapframe, ctr) == OFF_CTR * sizeof(register_t),
+	       "ctr offset");
+_Static_assert(offsetof(struct trapframe, srr0)
+	       == OFF_SRR0 * sizeof(register_t), "srr0 offset");
+#endif
+
+static struct trad_frame_cache *
+ppcfbsd_trapframe_cache (struct frame_info *this_frame, void **this_cache)
+{
+  struct gdbarch *gdbarch = get_frame_arch (this_frame);
+  struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
+  enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
+  struct trad_frame_cache *cache;
+  CORE_ADDR base;
+  int i, regnum;
+
+  if (*this_cache)
+    return (struct trad_frame_cache *)*this_cache;
+
+  cache = trad_frame_cache_zalloc (this_frame);
+  *this_cache = cache;
+
+  base = get_frame_register_unsigned (this_frame, gdbarch_sp_regnum (gdbarch));
+  if (tdep->wordsize == 8)
+    base += 48;
+  else
+    base += 8;
+
+  for (i = 0; i < ppc_num_gprs; i++)
+    trad_frame_set_reg_addr (cache, tdep->ppc_gp0_regnum + i, base
+			     + (OFF_FIXREG + i) * tdep->wordsize);
+  trad_frame_set_reg_addr (cache, tdep->ppc_lr_regnum, base
+			   + OFF_LR * tdep->wordsize);
+  trad_frame_set_reg_addr (cache, tdep->ppc_cr_regnum, base
+			   + OFF_CR * tdep->wordsize);
+  trad_frame_set_reg_addr (cache, tdep->ppc_xer_regnum, base
+			   + OFF_XER * tdep->wordsize);
+  trad_frame_set_reg_addr (cache, tdep->ppc_ctr_regnum, base
+			   + OFF_CTR * tdep->wordsize);
+  /* SRR0?  */
+  trad_frame_set_reg_addr (cache, gdbarch_pc_regnum (gdbarch), base
+			   + OFF_SRR0 * tdep->wordsize);
+
+  /* Construct the frame ID using the function start.  */
+  trad_frame_set_id (cache, frame_id_build (base, get_frame_func (this_frame)));
+  
+  return cache;
+}
+
+static void
+ppcfbsd_trapframe_this_id (struct frame_info *this_frame,
+			       void **this_cache, struct frame_id *this_id)
+{
+  struct trad_frame_cache *cache =
+    ppcfbsd_trapframe_cache (this_frame, this_cache);
+
+  trad_frame_get_id (cache, this_id);
+}
+
+static struct value *
+ppcfbsd_trapframe_prev_register (struct frame_info *this_frame,
+				     void **this_cache, int regnum)
+{
+  struct trad_frame_cache *cache =
+    ppcfbsd_trapframe_cache (this_frame, this_cache);
+
+  return trad_frame_get_register (cache, this_frame, regnum);
+}
+
+static int
+ppcfbsd_trapframe_sniffer (const struct frame_unwind *self,
+			       struct frame_info *this_frame,
+			       void **this_cache)
+{
+  CORE_ADDR pc;
+  const char *name;
+
+  pc = get_frame_func (this_frame);
+  find_pc_partial_function (pc, &name, NULL, NULL);
+  if (name && (strcmp(name, "asttrapexit") == 0
+	       || strcmp(name, "trapexit") == 0))
+    return 1;
+
+  return 0;
+}
+
+static const struct frame_unwind ppcfbsd_trapframe_unwind =
+{
+  SIGTRAMP_FRAME,
+  default_frame_unwind_stop_reason,
+  ppcfbsd_trapframe_this_id,
+  ppcfbsd_trapframe_prev_register,
+  NULL,
+  ppcfbsd_trapframe_sniffer
+};
+
+static void
+ppcfbsd_kernel_init_abi(struct gdbarch_info info, struct gdbarch *gdbarch)
+{
+  struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
+
+  frame_unwind_prepend_unwinder(gdbarch, &ppcfbsd_trapframe_unwind);
+
+  set_solib_ops(gdbarch, &kld_so_ops);
+
+#ifdef __powerpc__
+  if (tdep->wordsize == sizeof(register_t))
+    {
+      fbsd_vmcore_set_supply_pcb(gdbarch, ppcfbsd_supply_pcb);
+      fbsd_vmcore_set_cpu_pcb_addr(gdbarch, kgdb_trgt_stop_pcb);
+    }
+#endif
+
+  /* FreeBSD doesn't support the 128-bit `long double' from the psABI.  */
+  set_gdbarch_long_double_bit (gdbarch, 64);
+  set_gdbarch_long_double_format (gdbarch, floatformats_ieee_double);
+
+  if (tdep->wordsize == 4)
+    {
+      set_gdbarch_return_value (gdbarch, ppc_sysv_abi_broken_return_value);
+    }
+
+  if (tdep->wordsize == 8)
+    {
+      set_gdbarch_convert_from_func_ptr_addr
+	(gdbarch, ppc64_convert_from_func_ptr_addr);
+      set_gdbarch_elf_make_msymbol_special (gdbarch,
+					    ppc64_elf_make_msymbol_special);
+    }
+}
+
+void
+_initialize_ppc_kgdb_tdep(void)
+{
+	gdbarch_register_osabi_sniffer(bfd_arch_powerpc,
+				       bfd_target_elf_flavour,
+				       fbsd_kernel_osabi_sniffer);
+	gdbarch_register_osabi (bfd_arch_powerpc, bfd_mach_ppc,
+	    GDB_OSABI_FREEBSD_KERNEL, ppcfbsd_kernel_init_abi);
+	gdbarch_register_osabi (bfd_arch_powerpc, bfd_mach_ppc64,
+	    GDB_OSABI_FREEBSD_KERNEL, ppcfbsd_kernel_init_abi);
+
+	/* Not sure about this one. */
+	gdbarch_register_osabi_sniffer(bfd_arch_rs6000,
+				       bfd_target_elf_flavour,
+				       fbsd_kernel_osabi_sniffer);
+	gdbarch_register_osabi (bfd_arch_rs6000, 0,
+	    GDB_OSABI_FREEBSD_KERNEL, ppcfbsd_kernel_init_abi);
+}


Property changes on: trunk/devel/gdb/files/kgdb/ppcfbsd-kern.c
___________________________________________________________________
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
Added: trunk/devel/gdb/files/kgdb/sparc64fbsd-kern.c
===================================================================
--- trunk/devel/gdb/files/kgdb/sparc64fbsd-kern.c	                        (rev 0)
+++ trunk/devel/gdb/files/kgdb/sparc64fbsd-kern.c	2018-11-26 17:06:28 UTC (rev 24716)
@@ -0,0 +1,314 @@
+/*
+ * 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 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.
+ */
+
+#include <sys/cdefs.h>
+__FBSDID("$FreeBSD: head/devel/gdb/files/kgdb/sparc64fbsd-kern.c 464493 2018-03-14 14:33:21Z pizzamig $");
+
+#include "defs.h"
+#include "gdbcore.h"
+#include "osabi.h"
+#include "regcache.h"
+#include "target.h"
+#include "frame-unwind.h"
+#include "solib.h"
+#include "trad-frame.h"
+#include "sparc-tdep.h"
+#include "sparc64-tdep.h"
+
+#ifdef __sparc64__
+#include <machine/asm.h>
+#include <machine/pcb.h>
+#include <machine/frame.h>
+#endif
+
+#include "kgdb.h"
+
+#ifdef __sparc64__
+static void
+sparc64fbsd_supply_pcb(struct regcache *regcache, CORE_ADDR pcb_addr)
+{
+	struct pcb pcb;
+
+	if (target_read_memory(pcb_addr, &pcb, sizeof(pcb)) != 0)
+		memset(&pcb, 0, sizeof(pcb));
+
+	regcache_raw_supply(regcache, SPARC_SP_REGNUM, (char *)&pcb.pcb_sp);
+	sparc_supply_rwindow(regcache, pcb.pcb_sp, -1);
+	regcache_raw_supply(regcache, SPARC64_PC_REGNUM, (char *)&pcb.pcb_pc);
+	pcb.pcb_pc += 4;
+	regcache_raw_supply(regcache, SPARC64_NPC_REGNUM, (char *)&pcb.pcb_pc);
+}
+#endif
+
+#define	OFF_TF_SP	(14 * 8)
+#define	OFF_TF_TPC	(25 * 8)
+#define	OFF_TF_TNPC	(24 * 8)
+#define	OFF_TF_OUT	(8 * 8)
+#define	TRAPFRAME_SIZE	(32 * 8)
+
+#ifdef __sparc64__
+_Static_assert(sizeof(struct trapframe) == TRAPFRAME_SIZE, "trapframe size");
+_Static_assert(offsetof(struct trapframe, tf_sp) == OFF_TF_SP, "tf_sp offset");
+_Static_assert(offsetof(struct trapframe, tf_tpc) == OFF_TF_TPC,
+	       "tf_tpc offset");
+_Static_assert(offsetof(struct trapframe, tf_tnpc) == OFF_TF_TNPC,
+	       "tf_tnpc offset");
+_Static_assert(offsetof(struct trapframe, tf_out) == OFF_TF_OUT,
+	       "tf_out offset");
+#endif
+
+static struct sparc_frame_cache *
+sparc64fbsd_trapframe_cache (struct frame_info *this_frame, void **this_cache)
+{
+  struct sparc_frame_cache *cache;
+  CORE_ADDR fp, sp, trapframe_addr;
+  int regnum;
+
+  if (*this_cache)
+    return (struct sparc_frame_cache *)*this_cache;
+
+  cache = sparc_frame_cache (this_frame, this_cache);
+  gdb_assert (cache == *this_cache);
+
+  fp = get_frame_register_unsigned (this_frame, SPARC_FP_REGNUM);
+  trapframe_addr = fp + BIAS - TRAPFRAME_SIZE;
+  sp = get_frame_register_unsigned (this_frame, SPARC_SP_REGNUM);
+
+  cache->saved_regs = trad_frame_alloc_saved_regs (this_frame);
+
+  cache->saved_regs[SPARC_SP_REGNUM].addr = trapframe_addr + OFF_TF_SP;
+#ifdef notyet
+  cache->saved_regs[SPARC64_STATE_REGNUM].addr = trapframe_addr + OFF_TF_TSTATE;
+#endif
+  cache->saved_regs[SPARC64_PC_REGNUM].addr = trapframe_addr + OFF_TF_TPC;
+  cache->saved_regs[SPARC64_NPC_REGNUM].addr = trapframe_addr + OFF_TF_TNPC;
+  for (regnum = SPARC_O0_REGNUM; regnum <= SPARC_O7_REGNUM; regnum++)
+    cache->saved_regs[regnum].addr =
+      trapframe_addr + OFF_TF_OUT + (regnum - SPARC_O0_REGNUM) * 8;
+  for (regnum = SPARC_L0_REGNUM; regnum <= SPARC_I7_REGNUM; regnum++)
+    cache->saved_regs[regnum].addr =
+      sp + BIAS + (regnum - SPARC_L0_REGNUM) * 8;
+
+  return cache;
+}
+
+static void
+sparc64fbsd_trapframe_this_id (struct frame_info *this_frame,
+			       void **this_cache, struct frame_id *this_id)
+{
+  struct sparc_frame_cache *cache =
+    sparc64fbsd_trapframe_cache (this_frame, this_cache);
+
+  (*this_id) = frame_id_build (cache->base, cache->pc);
+}
+
+static struct value *
+sparc64fbsd_trapframe_prev_register (struct frame_info *this_frame,
+				     void **this_cache, int regnum)
+{
+  struct sparc_frame_cache *cache =
+    sparc64fbsd_trapframe_cache (this_frame, this_cache);
+
+  return trad_frame_get_prev_register (this_frame, cache->saved_regs, regnum);
+}
+
+static int
+sparc64fbsd_trapframe_sniffer (const struct frame_unwind *self,
+			       struct frame_info *this_frame,
+			       void **this_cache)
+{
+  CORE_ADDR pc;
+  const char *name;
+
+  pc = get_frame_address_in_block (this_frame);
+  find_pc_partial_function (pc, &name, NULL, NULL);
+  if (name && (strcmp(name, "tl0_intr") == 0
+	       || strcmp(name, "tl0_trap") == 0
+	       || strcmp(name, "tl1_intr") == 0
+	       || strcmp(name, "tl1_trap") == 0))
+    return 1;
+
+  return 0;
+}
+
+static const struct frame_unwind sparc64fbsd_trapframe_unwind =
+{
+  SIGTRAMP_FRAME,
+  default_frame_unwind_stop_reason,
+  sparc64fbsd_trapframe_this_id,
+  sparc64fbsd_trapframe_prev_register,
+  NULL,
+  sparc64fbsd_trapframe_sniffer
+};
+
+#if 0
+struct kgdb_frame_cache {
+	CORE_ADDR	pc;
+	CORE_ADDR	sp;
+	CORE_ADDR	fp;
+};
+
+static struct kgdb_frame_cache *
+kgdb_trgt_frame_cache(struct frame_info *next_frame, void **this_cache)
+{
+	char buf[MAX_REGISTER_SIZE];
+	struct kgdb_frame_cache *cache;
+
+	cache = *this_cache;
+	if (cache == NULL) {
+		cache = FRAME_OBSTACK_ZALLOC(struct kgdb_frame_cache);
+		*this_cache = cache;
+		cache->pc = frame_func_unwind(next_frame);
+		frame_unwind_register(next_frame, SPARC_SP_REGNUM, buf);
+		cache->sp = extract_unsigned_integer(buf,
+		    register_size(current_gdbarch, SPARC_SP_REGNUM));
+		frame_unwind_register(next_frame, SPARC_FP_REGNUM, buf);
+		cache->fp = extract_unsigned_integer(buf,
+		    register_size(current_gdbarch, SPARC_FP_REGNUM));
+		cache->fp += BIAS - sizeof(struct trapframe);
+	}
+	return (cache);
+}
+
+static void
+kgdb_trgt_trapframe_this_id(struct frame_info *next_frame, void **this_cache,
+    struct frame_id *this_id)
+{
+	struct kgdb_frame_cache *cache;
+
+	cache = kgdb_trgt_frame_cache(next_frame, this_cache);
+	*this_id = frame_id_build(cache->sp, cache->pc);
+}
+
+static void
+kgdb_trgt_trapframe_prev_register(struct frame_info *next_frame,
+    void **this_cache, int regnum, int *optimizedp, enum lval_type *lvalp,
+    CORE_ADDR *addrp, int *realnump, void *valuep)
+{
+	char dummy_valuep[MAX_REGISTER_SIZE];
+	struct kgdb_frame_cache *cache;
+	int ofs, regsz;
+
+	regsz = register_size(current_gdbarch, regnum);
+
+	if (valuep == NULL)
+		valuep = dummy_valuep;
+	memset(valuep, 0, regsz);
+	*optimizedp = 0;
+	*addrp = 0;
+	*lvalp = not_lval;
+	*realnump = -1;
+
+	cache = kgdb_trgt_frame_cache(next_frame, this_cache);
+
+	switch (regnum) {
+	case SPARC_SP_REGNUM:
+		ofs = offsetof(struct trapframe, tf_sp);
+		break;
+	case SPARC64_PC_REGNUM:
+		ofs = offsetof(struct trapframe, tf_tpc);
+		break;
+	case SPARC64_NPC_REGNUM:
+		ofs = offsetof(struct trapframe, tf_tnpc);
+		break;
+	case SPARC_O0_REGNUM:
+	case SPARC_O1_REGNUM:
+	case SPARC_O2_REGNUM:
+	case SPARC_O3_REGNUM:
+	case SPARC_O4_REGNUM:
+	case SPARC_O5_REGNUM:
+	case SPARC_O7_REGNUM:
+		ofs = offsetof(struct trapframe, tf_out) +
+		    (regnum - SPARC_O0_REGNUM) * 8;
+		break;
+	default:
+		if (regnum >= SPARC_L0_REGNUM && regnum <= SPARC_I7_REGNUM) {
+			ofs = (regnum - SPARC_L0_REGNUM) * 8;
+			*addrp = cache->sp + BIAS + ofs;
+			*lvalp = lval_memory;
+			target_read_memory(*addrp, valuep, regsz);
+		}
+		return;
+	}
+
+	*addrp = cache->fp + ofs;
+	*lvalp = lval_memory;
+	target_read_memory(*addrp, valuep, regsz);
+}
+
+static const struct frame_unwind kgdb_trgt_trapframe_unwind = {
+        UNKNOWN_FRAME,
+        &kgdb_trgt_trapframe_this_id,
+        &kgdb_trgt_trapframe_prev_register
+};
+
+const struct frame_unwind *
+kgdb_trgt_trapframe_sniffer(struct frame_info *next_frame)
+{
+	char *pname;
+	CORE_ADDR pc;
+
+	pc = frame_func_unwind(next_frame);
+	pname = NULL;
+	find_pc_partial_function(pc, &pname, NULL, NULL);
+	if (pname == NULL)
+		return (NULL);
+	if (strcmp(pname, "tl0_intr") == 0 ||
+	    strcmp(pname, "tl0_trap") == 0 ||
+	    strcmp(pname, "tl1_intr") == 0 ||
+	    strcmp(pname, "tl1_trap") == 0)
+		return (&kgdb_trgt_trapframe_unwind);
+	/* printf("%s: %lx =%s\n", __func__, pc, pname); */
+	return (NULL);
+}
+#endif
+
+static void
+sparc64fbsd_kernel_init_abi(struct gdbarch_info info, struct gdbarch *gdbarch)
+{
+
+	sparc64_init_abi(info, gdbarch);
+
+	frame_unwind_prepend_unwinder(gdbarch, &sparc64fbsd_trapframe_unwind);
+
+	set_solib_ops(gdbarch, &kld_so_ops);
+
+#ifdef __sparc64__
+	fbsd_vmcore_set_supply_pcb(gdbarch, sparc64fbsd_supply_pcb);
+	fbsd_vmcore_set_cpu_pcb_addr(gdbarch, kgdb_trgt_stop_pcb);
+#endif
+}
+
+void
+_initialize_sparc64_kgdb_tdep(void)
+{
+	gdbarch_register_osabi_sniffer(bfd_arch_sparc,
+				       bfd_target_elf_flavour,
+				       fbsd_kernel_osabi_sniffer);
+	gdbarch_register_osabi (bfd_arch_sparc, bfd_mach_sparc_v9,
+	    GDB_OSABI_FREEBSD_KERNEL, sparc64fbsd_kernel_init_abi);
+}
+


Property changes on: trunk/devel/gdb/files/kgdb/sparc64fbsd-kern.c
___________________________________________________________________
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
Deleted: trunk/devel/gdb/files/patch-bfd-coffcode.h
===================================================================
--- trunk/devel/gdb/files/patch-bfd-coffcode.h	2018-11-26 17:02:39 UTC (rev 24715)
+++ trunk/devel/gdb/files/patch-bfd-coffcode.h	2018-11-26 17:06:28 UTC (rev 24716)
@@ -1,11 +0,0 @@
---- bfd/coffcode.h.orig	2012-12-18 14:22:56.000000000 +0100
-+++ bfd/coffcode.h	2012-12-18 14:23:11.000000000 +0100
-@@ -3442,7 +3442,7 @@
- 	 incremented in coff_set_section_contents.  This is right for
- 	 SVR3.2.  */
-       if (strcmp (current->name, _LIB) == 0)
--	bfd_set_section_vma (abfd, current, 0);
-+	(void)bfd_set_section_vma (abfd, current, 0);
- #endif
- 
- #ifdef ALIGN_SECTIONS_IN_FILE

Deleted: trunk/devel/gdb/files/patch-bfd-ecoff.c
===================================================================
--- trunk/devel/gdb/files/patch-bfd-ecoff.c	2018-11-26 17:02:39 UTC (rev 24715)
+++ trunk/devel/gdb/files/patch-bfd-ecoff.c	2018-11-26 17:06:28 UTC (rev 24716)
@@ -1,11 +0,0 @@
---- bfd/ecoff.c.orig	2013-03-11 12:42:03.000000000 +0100
-+++ bfd/ecoff.c	2013-03-11 12:44:29.000000000 +0100
-@@ -1888,7 +1888,7 @@
-   ret = (bfd_coff_filhsz (abfd)
- 	 + bfd_coff_aoutsz (abfd)
- 	 + c * bfd_coff_scnhsz (abfd));
--  return BFD_ALIGN (ret, 16);
-+  return (int)BFD_ALIGN (ret, 16);
- }
- 
- /* Get the contents of a section.  */

Deleted: trunk/devel/gdb/files/patch-bfd-elf32-hppa.c
===================================================================
--- trunk/devel/gdb/files/patch-bfd-elf32-hppa.c	2018-11-26 17:02:39 UTC (rev 24715)
+++ trunk/devel/gdb/files/patch-bfd-elf32-hppa.c	2018-11-26 17:06:28 UTC (rev 24716)
@@ -1,11 +0,0 @@
---- bfd/elf32-hppa.c.orig	2013-03-07 09:56:40.000000000 +0100
-+++ bfd/elf32-hppa.c	2013-03-07 09:57:07.000000000 +0100
-@@ -2384,7 +2384,7 @@
- 	      bfd_size_type mask;
- 
- 	      if (gotalign > pltalign)
--		bfd_set_section_alignment (dynobj, sec, gotalign);
-+		(void)bfd_set_section_alignment (dynobj, sec, gotalign);
- 	      mask = ((bfd_size_type) 1 << gotalign) - 1;
- 	      sec->size = (sec->size + sizeof (plt_stub) + mask) & ~mask;
- 	    }

Deleted: trunk/devel/gdb/files/patch-bfd-elf32-m32r.c
===================================================================
--- trunk/devel/gdb/files/patch-bfd-elf32-m32r.c	2018-11-26 17:02:39 UTC (rev 24715)
+++ trunk/devel/gdb/files/patch-bfd-elf32-m32r.c	2018-11-26 17:06:28 UTC (rev 24716)
@@ -1,11 +0,0 @@
---- bfd/elf32-m32r.c.orig	2013-03-07 09:57:30.000000000 +0100
-+++ bfd/elf32-m32r.c	2013-03-07 09:57:53.000000000 +0100
-@@ -1390,7 +1390,7 @@
- 						  flags);
- 	  if (s == NULL)
- 	    return FALSE;
--	  bfd_set_section_alignment (abfd, s, 2);
-+	  (void)bfd_set_section_alignment (abfd, s, 2);
- 	}
- 
-       bh = bfd_link_hash_lookup (info->hash, "_SDA_BASE_",

Deleted: trunk/devel/gdb/files/patch-bfd-elf32-tic6x.c
===================================================================
--- trunk/devel/gdb/files/patch-bfd-elf32-tic6x.c	2018-11-26 17:02:39 UTC (rev 24715)
+++ trunk/devel/gdb/files/patch-bfd-elf32-tic6x.c	2018-11-26 17:06:28 UTC (rev 24716)
@@ -1,30 +0,0 @@
---- bfd/elf32-tic6x.c.orig	2013-03-07 10:03:28.000000000 +0100
-+++ bfd/elf32-tic6x.c	2013-03-07 10:08:19.000000000 +0100
-@@ -3043,7 +3043,7 @@
-       *secp = bfd_make_section_old_way (abfd, ".scommon");
-       (*secp)->flags |= SEC_IS_COMMON;
-       *valp = sym->st_size;
--      bfd_set_section_alignment (abfd, *secp, bfd_log2 (sym->st_value));
-+      (void)bfd_set_section_alignment (abfd, *secp, bfd_log2 (sym->st_value));
-       break;
-     }
- 
-@@ -3319,8 +3319,6 @@
-     {
-       bfd_signed_vma *local_got;
-       bfd_signed_vma *end_local_got;
--      char *local_tls_type;
--      bfd_vma *local_tlsdesc_gotent;
-       bfd_size_type locsymcount;
-       Elf_Internal_Shdr *symtab_hdr;
-       asection *srel;
-@@ -3361,8 +3359,7 @@
-       end_local_got = local_got + locsymcount;
-       s = htab->elf.sgot;
-       srel = htab->elf.srelgot;
--      for (; local_got < end_local_got;
--	   ++local_got, ++local_tls_type, ++local_tlsdesc_gotent)
-+      for (; local_got < end_local_got; ++local_got)
- 	{
- 	  if (*local_got > 0)
- 	    {

Deleted: trunk/devel/gdb/files/patch-bfd-elf32-v850.c
===================================================================
--- trunk/devel/gdb/files/patch-bfd-elf32-v850.c	2018-11-26 17:02:39 UTC (rev 24715)
+++ trunk/devel/gdb/files/patch-bfd-elf32-v850.c	2018-11-26 17:06:28 UTC (rev 24716)
@@ -1,11 +0,0 @@
---- bfd/elf32-v850.c.orig	2013-03-11 12:55:48.000000000 +0100
-+++ bfd/elf32-v850.c	2013-03-11 12:57:45.000000000 +0100
-@@ -2933,7 +2933,7 @@
- 
- 	  if (alignmoveto < alignto)
- 	    {
--	      unsigned int i;
-+	      bfd_vma i;
- 
- 	      align_pad_size = alignto - alignmoveto;
- #ifdef DEBUG_RELAX

Deleted: trunk/devel/gdb/files/patch-bfd-elf64-alpha.c
===================================================================
--- trunk/devel/gdb/files/patch-bfd-elf64-alpha.c	2018-11-26 17:02:39 UTC (rev 24715)
+++ trunk/devel/gdb/files/patch-bfd-elf64-alpha.c	2018-11-26 17:06:28 UTC (rev 24716)
@@ -1,63 +0,0 @@
---- bfd/elf64-alpha.c.orig	2013-03-11 10:52:58.000000000 +0100
-+++ bfd/elf64-alpha.c	2013-03-11 11:50:24.000000000 +0100
-@@ -3585,9 +3585,9 @@
-   use_gottprel = FALSE;
-   new_symndx = is_gd ? ELF64_R_SYM (irel->r_info) : STN_UNDEF;
- 
--  switch (!dynamic && !info->link_info->shared)
--    {
--    case 1:
-+  {
-+    int skip_default = 0;
-+    if (!dynamic && !info->link_info->shared)
-       {
- 	bfd_vma tp_base;
- 	bfd_signed_vma disp;
-@@ -3605,7 +3605,7 @@
- 	    irel[0].r_offset = pos[0] - info->contents;
- 	    irel[0].r_info = ELF64_R_INFO (new_symndx, R_ALPHA_TPREL16);
- 	    irel[1].r_info = ELF64_R_INFO (0, R_ALPHA_NONE);
--	    break;
-+	    skip_default = 1;
- 	  }
- 	else if (disp >= -(bfd_signed_vma) 0x80000000
- 		 && disp < (bfd_signed_vma) 0x7fff8000
-@@ -3620,24 +3620,23 @@
- 	    irel[0].r_info = ELF64_R_INFO (new_symndx, R_ALPHA_TPRELHI);
- 	    irel[1].r_offset = pos[1] - info->contents;
- 	    irel[1].r_info = ELF64_R_INFO (new_symndx, R_ALPHA_TPRELLO);
--	    break;
-+	    skip_default = 1;
- 	  }
-       }
--      /* FALLTHRU */
--
--    default:
--      use_gottprel = TRUE;
--
--      insn = (OP_LDQ << 26) | (tlsgd_reg << 21) | (29 << 16);
--      bfd_put_32 (info->abfd, (bfd_vma) insn, pos[0]);
--      bfd_put_32 (info->abfd, (bfd_vma) INSN_UNOP, pos[1]);
--
--      irel[0].r_offset = pos[0] - info->contents;
--      irel[0].r_info = ELF64_R_INFO (new_symndx, R_ALPHA_GOTTPREL);
--      irel[1].r_info = ELF64_R_INFO (0, R_ALPHA_NONE);
--      break;
--    }
-+      /* FALLTHRU (default) */
-+    if (skip_default != 1 )
-+      {
-+        use_gottprel = TRUE;
- 
-+        insn = (OP_LDQ << 26) | (tlsgd_reg << 21) | (29 << 16);
-+        bfd_put_32 (info->abfd, (bfd_vma) insn, pos[0]);
-+        bfd_put_32 (info->abfd, (bfd_vma) INSN_UNOP, pos[1]);
-+
-+        irel[0].r_offset = pos[0] - info->contents;
-+        irel[0].r_info = ELF64_R_INFO (new_symndx, R_ALPHA_GOTTPREL);
-+        irel[1].r_info = ELF64_R_INFO (0, R_ALPHA_NONE);
-+      }
-+  }
-   bfd_put_32 (info->abfd, (bfd_vma) INSN_RDUNIQ, pos[2]);
- 
-   insn = INSN_ADDQ | (16 << 21) | (0 << 16) | (0 << 0);

Deleted: trunk/devel/gdb/files/patch-bfd-elfnn-ia64.c
===================================================================
--- trunk/devel/gdb/files/patch-bfd-elfnn-ia64.c	2018-11-26 17:02:39 UTC (rev 24715)
+++ trunk/devel/gdb/files/patch-bfd-elfnn-ia64.c	2018-11-26 17:06:28 UTC (rev 24716)
@@ -1,11 +0,0 @@
---- bfd/elfnn-ia64.c.orig	2013-03-11 10:21:19.000000000 +0100
-+++ bfd/elfnn-ia64.c	2013-03-11 10:21:43.000000000 +0100
-@@ -1546,7 +1546,7 @@
-     bfd_set_section_flags (abfd, ia64_info->root.sgot,
- 			   SEC_SMALL_DATA | flags);
-     /* The .got section is always aligned at 8 bytes.  */
--    bfd_set_section_alignment (abfd, ia64_info->root.sgot, 3);
-+    (void)bfd_set_section_alignment (abfd, ia64_info->root.sgot, 3);
-   }
- 
-   if (!get_pltoff (abfd, info, ia64_info))

Deleted: trunk/devel/gdb/files/patch-bfd-elfxx-mips.c
===================================================================
--- trunk/devel/gdb/files/patch-bfd-elfxx-mips.c	2018-11-26 17:02:39 UTC (rev 24715)
+++ trunk/devel/gdb/files/patch-bfd-elfxx-mips.c	2018-11-26 17:06:28 UTC (rev 24716)
@@ -1,28 +0,0 @@
---- bfd/elfxx-mips.c.orig	2013-03-07 10:12:06.000000000 +0100
-+++ bfd/elfxx-mips.c	2013-03-07 10:13:30.000000000 +0100
-@@ -7292,20 +7292,20 @@
-       /* Change alignments of some sections.  */
-       s = bfd_get_linker_section (abfd, ".hash");
-       if (s != NULL)
--	bfd_set_section_alignment (abfd, s, MIPS_ELF_LOG_FILE_ALIGN (abfd));
-+	(void)bfd_set_section_alignment (abfd, s, MIPS_ELF_LOG_FILE_ALIGN (abfd));
-       s = bfd_get_linker_section (abfd, ".dynsym");
-       if (s != NULL)
--	bfd_set_section_alignment (abfd, s, MIPS_ELF_LOG_FILE_ALIGN (abfd));
-+	(void)bfd_set_section_alignment (abfd, s, MIPS_ELF_LOG_FILE_ALIGN (abfd));
-       s = bfd_get_linker_section (abfd, ".dynstr");
-       if (s != NULL)
--	bfd_set_section_alignment (abfd, s, MIPS_ELF_LOG_FILE_ALIGN (abfd));
-+	(void)bfd_set_section_alignment (abfd, s, MIPS_ELF_LOG_FILE_ALIGN (abfd));
-       /* ??? */
-       s = bfd_get_section_by_name (abfd, ".reginfo");
-       if (s != NULL)
--	bfd_set_section_alignment (abfd, s, MIPS_ELF_LOG_FILE_ALIGN (abfd));
-+	(void)bfd_set_section_alignment (abfd, s, MIPS_ELF_LOG_FILE_ALIGN (abfd));
-       s = bfd_get_linker_section (abfd, ".dynamic");
-       if (s != NULL)
--	bfd_set_section_alignment (abfd, s, MIPS_ELF_LOG_FILE_ALIGN (abfd));
-+	(void)bfd_set_section_alignment (abfd, s, MIPS_ELF_LOG_FILE_ALIGN (abfd));
-     }
- 
-   if (!info->shared)

Deleted: trunk/devel/gdb/files/patch-bfd-elfxx-tilegx.c
===================================================================
--- trunk/devel/gdb/files/patch-bfd-elfxx-tilegx.c	2018-11-26 17:02:39 UTC (rev 24715)
+++ trunk/devel/gdb/files/patch-bfd-elfxx-tilegx.c	2018-11-26 17:06:28 UTC (rev 24716)
@@ -1,20 +0,0 @@
---- bfd/elfxx-tilegx.c.orig	2013-03-07 10:14:34.000000000 +0100
-+++ bfd/elfxx-tilegx.c	2013-03-07 10:15:31.000000000 +0100
-@@ -1205,7 +1205,7 @@
- };
- 
- /* Reuse an existing info 10 bundle.  */
--static const bfd_byte const *tilegx64_plt_tail_entry =
-+static const bfd_byte *tilegx64_plt_tail_entry =
-   &tilegx64_short_plt_entry[4 * TILEGX_BUNDLE_SIZE_IN_BYTES];
- 
- static const bfd_byte
-@@ -1250,7 +1250,7 @@
- };
- 
- /* Reuse an existing info 10 bundle.  */
--static const bfd_byte const *tilegx32_plt_tail_entry =
-+static const bfd_byte *tilegx32_plt_tail_entry =
-   &tilegx64_short_plt_entry[4 * TILEGX_BUNDLE_SIZE_IN_BYTES];
- 
- static int

Deleted: trunk/devel/gdb/files/patch-bfd-mach-o.c
===================================================================
--- trunk/devel/gdb/files/patch-bfd-mach-o.c	2018-11-26 17:02:39 UTC (rev 24715)
+++ trunk/devel/gdb/files/patch-bfd-mach-o.c	2018-11-26 17:06:28 UTC (rev 24716)
@@ -1,11 +0,0 @@
---- bfd/mach-o.c.orig	2013-03-07 10:15:55.000000000 +0100
-+++ bfd/mach-o.c	2013-03-07 10:16:09.000000000 +0100
-@@ -2683,7 +2683,7 @@
- 	  s->flags = xlat->macho_sectype | xlat->macho_secattr;
- 	  s->align = xlat->sectalign > bfdalign ? xlat->sectalign 
- 						: bfdalign;
--	  bfd_set_section_alignment (abfd, sec, s->align);
-+	  (void)bfd_set_section_alignment (abfd, sec, s->align);
- 	  bfd_flags = bfd_get_section_flags (abfd, sec);
- 	  if (bfd_flags == SEC_NO_FLAGS)
- 	    bfd_set_section_flags (abfd, sec, xlat->bfd_flags);

Deleted: trunk/devel/gdb/files/patch-bfd-mmo.c
===================================================================
--- trunk/devel/gdb/files/patch-bfd-mmo.c	2018-11-26 17:02:39 UTC (rev 24715)
+++ trunk/devel/gdb/files/patch-bfd-mmo.c	2018-11-26 17:06:28 UTC (rev 24716)
@@ -1,29 +0,0 @@
---- bfd/mmo.c.orig	2013-03-11 12:17:57.000000000 +0100
-+++ bfd/mmo.c	2013-03-11 12:17:21.000000000 +0100
-@@ -663,7 +663,7 @@
- 	return NULL;
- 
-       if (! sec->user_set_vma)
--	bfd_set_section_vma (abfd, sec, vma);
-+	(void)bfd_set_section_vma (abfd, sec, vma);
-       if (! bfd_set_section_flags (abfd, sec,
- 				   bfd_get_section_flags (abfd, sec)
- 				   | SEC_CODE | SEC_LOAD | SEC_ALLOC))
-@@ -677,7 +677,7 @@
- 	return NULL;
- 
-       if (! sec->user_set_vma)
--	bfd_set_section_vma (abfd, sec, vma);
-+	(void)bfd_set_section_vma (abfd, sec, vma);
-       if (! bfd_set_section_flags (abfd, sec,
- 				   bfd_get_section_flags (abfd, sec)
- 				   | SEC_LOAD | SEC_ALLOC))
-@@ -693,7 +693,7 @@
-   sprintf (sec_name, ".MMIX.sec.%d", abfd->tdata.mmo_data->sec_no++);
-   sec = mmo_make_section (abfd, sec_name);
-   if (! sec->user_set_vma)
--    bfd_set_section_vma (abfd, sec, vma);
-+    (void)bfd_set_section_vma (abfd, sec, vma);
- 
-   if (! bfd_set_section_flags (abfd, sec,
- 			       bfd_get_section_flags (abfd, sec)

Deleted: trunk/devel/gdb/files/patch-bfd-opncls.c
===================================================================
--- trunk/devel/gdb/files/patch-bfd-opncls.c	2018-11-26 17:02:39 UTC (rev 24715)
+++ trunk/devel/gdb/files/patch-bfd-opncls.c	2018-11-26 17:06:28 UTC (rev 24716)
@@ -1,11 +0,0 @@
---- bfd/opncls.c.orig	2012-12-18 14:18:47.000000000 +0100
-+++ bfd/opncls.c	2012-12-18 14:19:18.000000000 +0100
-@@ -254,7 +254,7 @@
-      then it may have been opened with special flags that make it
-      unsafe to close and reopen the file.  */
-   if (fd == -1)
--    bfd_set_cacheable (nbfd, TRUE);
-+    (void)bfd_set_cacheable (nbfd, TRUE);
- 
-   return nbfd;
- }

Deleted: trunk/devel/gdb/files/patch-bfd-peicode.h
===================================================================
--- trunk/devel/gdb/files/patch-bfd-peicode.h	2018-11-26 17:02:39 UTC (rev 24715)
+++ trunk/devel/gdb/files/patch-bfd-peicode.h	2018-11-26 17:06:28 UTC (rev 24716)
@@ -1,11 +0,0 @@
---- bfd/peicode.h.orig	2012-12-18 14:22:02.000000000 +0100
-+++ bfd/peicode.h	2012-12-18 14:22:21.000000000 +0100
-@@ -602,7 +602,7 @@
- 
-   bfd_set_section_flags (vars->abfd, sec, flags | extra_flags);
- 
--  bfd_set_section_alignment (vars->abfd, sec, 2);
-+  (void)bfd_set_section_alignment (vars->abfd, sec, 2);
- 
-   /* Check that we will not run out of space.  */
-   BFD_ASSERT (vars->data + size < vars->bim->buffer + vars->bim->size);

Deleted: trunk/devel/gdb/files/patch-bfd-vms-alpha.c
===================================================================
--- trunk/devel/gdb/files/patch-bfd-vms-alpha.c	2018-11-26 17:02:39 UTC (rev 24715)
+++ trunk/devel/gdb/files/patch-bfd-vms-alpha.c	2018-11-26 17:06:28 UTC (rev 24716)
@@ -1,20 +0,0 @@
---- bfd/vms-alpha.c.orig	2013-03-11 10:40:39.000000000 +0100
-+++ bfd/vms-alpha.c	2013-03-11 12:31:12.000000000 +0100
-@@ -6044,7 +6044,7 @@
-                      unsigned char *rec, unsigned int rec_len)
- {
-   unsigned int off = sizeof (struct vms_egsd);
--  unsigned int sec_len;
-+  unsigned int sec_len = 0;
- 
-   fprintf (file, _("  %s (len=%u+%u):\n"), name,
-            (unsigned)(rec_len - sizeof (struct vms_eobjrec)),
-@@ -9118,7 +9118,7 @@
-   vms_debug2 ((1, "vms_new_section_hook (%p, [%d]%s)\n",
-                abfd, section->index, section->name));
- 
--  bfd_set_section_alignment (abfd, section, 0);
-+  (void)bfd_set_section_alignment (abfd, section, 0);
- 
-   vms_debug2 ((7, "%d: %s\n", section->index, section->name));
- 

Deleted: trunk/devel/gdb/files/patch-bfd-xcofflink.c
===================================================================
--- trunk/devel/gdb/files/patch-bfd-xcofflink.c	2018-11-26 17:02:39 UTC (rev 24715)
+++ trunk/devel/gdb/files/patch-bfd-xcofflink.c	2018-11-26 17:06:28 UTC (rev 24716)
@@ -1,11 +0,0 @@
---- bfd/xcofflink.c.orig	2013-03-07 10:16:45.000000000 +0100
-+++ bfd/xcofflink.c	2013-03-07 10:19:50.000000000 +0100
-@@ -6273,7 +6273,7 @@
-       irel = flinfo.section_info[o->target_index].relocs;
-       irelend = irel + o->reloc_count;
-       rel_hash = flinfo.section_info[o->target_index].rel_hashes;
--      for (; irel < irelend; irel++, rel_hash++, erel += relsz)
-+      for (; irel < irelend; irel++, rel_hash++)
- 	{
- 	  if (*rel_hash != NULL)
- 	    {

Added: trunk/devel/gdb/files/patch-fixes
===================================================================
--- trunk/devel/gdb/files/patch-fixes	                        (rev 0)
+++ trunk/devel/gdb/files/patch-fixes	2018-11-26 17:06:28 UTC (rev 24716)
@@ -0,0 +1,10 @@
+--- gdb/compile/compile-loc2c.c.orig 2017-09-14 09:28:17 UTC
++++ gdb/compile/compile-loc2c.c
+@@ -669,6 +669,7 @@ do_compile_dwarf_expr_to_c (int indent, string_file &stream,
+       uint64_t uoffset, reg;
+       int64_t offset;
+ 
++      uoffset = 0;
+       print_spaces (indent - 2, &stream);
+       if (info[op_ptr - base].label)
+ 	{


Property changes on: trunk/devel/gdb/files/patch-fixes
___________________________________________________________________
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
Deleted: trunk/devel/gdb/files/patch-gdb-amd64bsd-nat.c
===================================================================
--- trunk/devel/gdb/files/patch-gdb-amd64bsd-nat.c	2018-11-26 17:02:39 UTC (rev 24715)
+++ trunk/devel/gdb/files/patch-gdb-amd64bsd-nat.c	2018-11-26 17:06:28 UTC (rev 24716)
@@ -1,36 +0,0 @@
---- gdb/amd64bsd-nat.c.orig	2013-04-09 16:45:15.000000000 +0200
-+++ gdb/amd64bsd-nat.c	2013-04-09 18:53:22.000000000 +0200
-@@ -29,6 +29,7 @@
- #include <sys/types.h>
- #include <sys/ptrace.h>
- #include <machine/reg.h>
-+#include <machine/psl.h>
- 
- #include "amd64-tdep.h"
- #include "amd64-nat.h"
-@@ -81,14 +82,24 @@
- 
-   if (regnum == -1 || amd64_native_gregset_supplies_p (gdbarch, regnum))
-     {
--      struct reg regs;
-+      struct reg regs, oldregs;
- 
-+      memset( &regs, 0, sizeof(struct reg));
-+      memset( &oldregs, 0, sizeof(struct reg));
-       if (ptrace (PT_GETREGS, PIDGET (inferior_ptid),
-                   (PTRACE_TYPE_ARG3) &regs, 0) == -1)
-         perror_with_name (_("Couldn't get registers"));
- 
-+      ptrace (PT_GETREGS, PIDGET (inferior_ptid),
-+                  (PTRACE_TYPE_ARG3) &oldregs, 0);
-       amd64_collect_native_gregset (regcache, &regs, regnum);
- 
-+      if( (regs.r_rflags ^ oldregs.r_rflags ) & ~PSL_USERCHANGE) {
-+        //printf("regs.r_rflags = 0x%8.8lX\n", regs.r_rflags );
-+        //printf("oldregs.r_rflags = 0x%8.8lX\n", oldregs.r_rflags );
-+        regs.r_rflags ^= (regs.r_rflags ^ oldregs.r_rflags ) & ~PSL_USERCHANGE;
-+        //printf("    allowed regs.r_rflags = 0x%8.8X\n", regs.r_rflags );
-+      }
-       if (ptrace (PT_SETREGS, PIDGET (inferior_ptid),
- 	          (PTRACE_TYPE_ARG3) &regs, 0) == -1)
-         perror_with_name (_("Couldn't write registers"));

Deleted: trunk/devel/gdb/files/patch-gdb-amd64fbsd-nat.c
===================================================================
--- trunk/devel/gdb/files/patch-gdb-amd64fbsd-nat.c	2018-11-26 17:02:39 UTC (rev 24715)
+++ trunk/devel/gdb/files/patch-gdb-amd64fbsd-nat.c	2018-11-26 17:06:28 UTC (rev 24716)
@@ -1,63 +0,0 @@
---- gdb/amd64fbsd-nat.c.orig	2012-02-09 17:06:44.000000000 +0100
-+++ gdb/amd64fbsd-nat.c	2012-08-30 10:58:55.000000000 +0200
-@@ -21,11 +21,13 @@
- #include "inferior.h"
- #include "regcache.h"
- #include "target.h"
-+#include "gregset.h"
- 
- #include "gdb_assert.h"
- #include <signal.h>
- #include <stddef.h>
- #include <sys/types.h>
-+#include <sys/procfs.h>
- #include <sys/ptrace.h>
- #include <sys/sysctl.h>
- #include <machine/reg.h>
-@@ -93,6 +95,46 @@
- };
- 

- 
-+/* Transfering the registers between GDB, inferiors and core files.  */
-+
-+/* Fill GDB's register array with the general-purpose register values
-+   in *GREGSETP.  */
-+
-+void
-+supply_gregset (struct regcache *regcache, const gregset_t *gregsetp)
-+{
-+  amd64_supply_native_gregset (regcache, gregsetp, -1);
-+}
-+
-+/* Fill register REGNUM (if it is a general-purpose register) in
-+   *GREGSETPS with the value in GDB's register array.  If REGNUM is -1,
-+   do this for all registers.  */
-+
-+void
-+fill_gregset (const struct regcache *regcache, gdb_gregset_t *gregsetp, int regnum)
-+{
-+  amd64_collect_native_gregset (regcache, gregsetp, regnum);
-+}
-+
-+/* Fill GDB's register array with the floating-point register values
-+   in *FPREGSETP.  */
-+
-+void
-+supply_fpregset (struct regcache *regcache, const fpregset_t *fpregsetp)
-+{
-+  amd64_supply_fxsave (regcache, -1, fpregsetp);
-+}
-+
-+/* Fill register REGNUM (if it is a floating-point register) in
-+   *FPREGSETP with the value in GDB's register array.  If REGNUM is -1,
-+   do this for all registers.  */
-+
-+void
-+fill_fpregset (const struct regcache *regcache, gdb_fpregset_t *fpregsetp, int regnum)
-+{
-+  amd64_collect_fxsave (regcache, regnum, fpregsetp);
-+}
-+

- /* Support for debugging kernel virtual memory images.  */
- 
- #include <sys/types.h>

Deleted: trunk/devel/gdb/files/patch-gdb-amd64fbsd-tdep.c
===================================================================
--- trunk/devel/gdb/files/patch-gdb-amd64fbsd-tdep.c	2018-11-26 17:02:39 UTC (rev 24715)
+++ trunk/devel/gdb/files/patch-gdb-amd64fbsd-tdep.c	2018-11-26 17:06:28 UTC (rev 24716)
@@ -1,86 +0,0 @@
---- gdb/amd64fbsd-tdep.c.orig	2010-01-01 02:31:29.000000000 -0500
-+++ gdb/amd64fbsd-tdep.c	2011-01-05 17:27:29.264869000 -0500
-@@ -29,7 +29,6 @@
- #include "gdb_string.h"
- 
- #include "amd64-tdep.h"
--#include "bsd-uthread.h"
- #include "solib-svr4.h"
- 
- /* Support for signal handlers.  */
-@@ -40,12 +39,16 @@
- static CORE_ADDR
- amd64fbsd_sigcontext_addr (struct frame_info *this_frame)
- {
-+  struct gdbarch *gdbarch = get_frame_arch (this_frame);
-+  enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
-   CORE_ADDR sp;
-+  gdb_byte buf[8];
- 
-   /* The `struct sigcontext' (which really is an `ucontext_t' on
-      FreeBSD/amd64) lives at a fixed offset in the signal frame.  See
-      <machine/sigframe.h>.  */
--  sp = frame_unwind_register_unsigned (this_frame, AMD64_RSP_REGNUM);
-+  get_frame_register (this_frame, AMD64_RSP_REGNUM, buf);
-+  sp = extract_unsigned_integer (buf, 8, byte_order);
-   return sp + 16;
- }
- 

-@@ -142,46 +145,6 @@
- };
- 
- static void
--amd64fbsd_supply_uthread (struct regcache *regcache,
--			  int regnum, CORE_ADDR addr)
--{
--  gdb_byte buf[8];
--  int i;
--
--  gdb_assert (regnum >= -1);
--
--  for (i = 0; i < ARRAY_SIZE (amd64fbsd_jmp_buf_reg_offset); i++)
--    {
--      if (amd64fbsd_jmp_buf_reg_offset[i] != -1
--	  && (regnum == -1 || regnum == i))
--	{
--	  read_memory (addr + amd64fbsd_jmp_buf_reg_offset[i], buf, 8);
--	  regcache_raw_supply (regcache, i, buf);
--	}
--    }
--}
--
--static void
--amd64fbsd_collect_uthread (const struct regcache *regcache,
--			   int regnum, CORE_ADDR addr)
--{
--  gdb_byte buf[8];
--  int i;
--
--  gdb_assert (regnum >= -1);
--
--  for (i = 0; i < ARRAY_SIZE (amd64fbsd_jmp_buf_reg_offset); i++)
--    {
--      if (amd64fbsd_jmp_buf_reg_offset[i] != -1
--	  && (regnum == -1 || regnum == i))
--	{
--	  regcache_raw_collect (regcache, i, buf);
--	  write_memory (addr + amd64fbsd_jmp_buf_reg_offset[i], buf, 8);
--	}
--    }
--}
--
--static void
- amd64fbsd_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
- {
-   struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
-@@ -201,10 +164,6 @@
-   tdep->sc_reg_offset = amd64fbsd_sc_reg_offset;
-   tdep->sc_num_regs = ARRAY_SIZE (amd64fbsd_sc_reg_offset);
- 
--  /* FreeBSD provides a user-level threads implementation.  */
--  bsd_uthread_set_supply_uthread (gdbarch, amd64fbsd_supply_uthread);
--  bsd_uthread_set_collect_uthread (gdbarch, amd64fbsd_collect_uthread);
--
-   /* FreeBSD uses SVR4-style shared libraries.  */
-   set_solib_svr4_fetch_link_map_offsets
-     (gdbarch, svr4_lp64_fetch_link_map_offsets);

Deleted: trunk/devel/gdb/files/patch-gdb-configure
===================================================================
--- trunk/devel/gdb/files/patch-gdb-configure	2018-11-26 17:02:39 UTC (rev 24715)
+++ trunk/devel/gdb/files/patch-gdb-configure	2018-11-26 17:06:28 UTC (rev 24716)
@@ -1,22 +0,0 @@
---- gdb/configure.orig	2012-08-24 14:03:52.000000000 +0200
-+++ gdb/configure	2012-08-24 14:05:06.000000000 +0200
-@@ -10590,7 +10590,8 @@
- 
- # See if <machine/reg.h> supports the %fs and %gs i386 segment registers.
- # Older i386 BSD's don't have the r_fs and r_gs members of `struct reg'.
--ac_fn_c_check_member "$LINENO" "struct reg" "r_fs" "ac_cv_member_struct_reg_r_fs" "#include <machine/reg.h>
-+ac_fn_c_check_member "$LINENO" "struct reg" "r_fs" "ac_cv_member_struct_reg_r_fs" "#include <sys/types.h>
-+#include <machine/reg.h>
- "
- if test "x$ac_cv_member_struct_reg_r_fs" = x""yes; then :
- 
-@@ -10600,7 +10601,8 @@
- 
- 
- fi
--ac_fn_c_check_member "$LINENO" "struct reg" "r_gs" "ac_cv_member_struct_reg_r_gs" "#include <machine/reg.h>
-+ac_fn_c_check_member "$LINENO" "struct reg" "r_gs" "ac_cv_member_struct_reg_r_gs" "#include <sys/types.h>
-+#include <machine/reg.h>
- "
- if test "x$ac_cv_member_struct_reg_r_gs" = x""yes; then :
- 

Deleted: trunk/devel/gdb/files/patch-gdb-i386bsd-nat.c
===================================================================
--- trunk/devel/gdb/files/patch-gdb-i386bsd-nat.c	2018-11-26 17:02:39 UTC (rev 24715)
+++ trunk/devel/gdb/files/patch-gdb-i386bsd-nat.c	2018-11-26 17:06:28 UTC (rev 24716)
@@ -1,20 +0,0 @@
---- gdb/i386bsd-nat.c.orig	2010-10-21 11:18:03.171107000 -0400
-+++ gdb/i386bsd-nat.c	2010-10-21 11:18:18.849642000 -0400
-@@ -88,7 +88,7 @@
- 
- /* Supply the general-purpose registers in GREGS, to REGCACHE.  */
- 
--static void
-+void
- i386bsd_supply_gregset (struct regcache *regcache, const void *gregs)
- {
-   const char *regs = gregs;
-@@ -107,7 +107,7 @@
-    GREGS.  If REGNUM is -1, collect and store all appropriate
-    registers.  */
- 
--static void
-+void
- i386bsd_collect_gregset (const struct regcache *regcache,
- 			 void *gregs, int regnum)
- {

Deleted: trunk/devel/gdb/files/patch-gdb-i386bsd-nat.h
===================================================================
--- trunk/devel/gdb/files/patch-gdb-i386bsd-nat.h	2018-11-26 17:02:39 UTC (rev 24715)
+++ trunk/devel/gdb/files/patch-gdb-i386bsd-nat.h	2018-11-26 17:06:28 UTC (rev 24716)
@@ -1,15 +0,0 @@
---- gdb/i386bsd-nat.h.orig	2010-10-21 11:18:08.097659000 -0400
-+++ gdb/i386bsd-nat.h	2010-10-21 11:20:49.341989000 -0400
-@@ -35,4 +35,12 @@
- 
- extern unsigned long i386bsd_dr_get_status (void);
- 
-+/* low level i386 register functions used in i386fbsd-nat.c. */
-+
-+extern void i386bsd_supply_gregset (struct regcache *regcache,
-+				    const void *gregs);
-+
-+extern void i386bsd_collect_gregset (const struct regcache *regcache,
-+				     void *gregs, int regnum);
-+
- #endif /* i386bsd-nat.h */

Deleted: trunk/devel/gdb/files/patch-gdb-i386fbsd-nat.c
===================================================================
--- trunk/devel/gdb/files/patch-gdb-i386fbsd-nat.c	2018-11-26 17:02:39 UTC (rev 24715)
+++ trunk/devel/gdb/files/patch-gdb-i386fbsd-nat.c	2018-11-26 17:06:28 UTC (rev 24716)
@@ -1,71 +0,0 @@
---- gdb/i386fbsd-nat.c.orig	2012-05-24 18:39:09.000000000 +0200
-+++ gdb/i386fbsd-nat.c	2012-08-29 17:19:57.000000000 +0200
-@@ -21,8 +21,10 @@
- #include "inferior.h"
- #include "regcache.h"
- #include "target.h"
-+#include "gregset.h"
- 
- #include <sys/types.h>
-+#include <sys/procfs.h>
- #include <sys/ptrace.h>
- #include <sys/sysctl.h>
- 
-@@ -80,6 +82,49 @@
- }
- 

- 
-+/* Transfering the registers between GDB, inferiors and core files.  */
-+
-+/* Fill GDB's register array with the general-purpose register values
-+   in *GREGSETP.  */
-+
-+void
-+supply_gregset (struct regcache *regcache, const gregset_t *gregsetp)
-+{
-+  i386bsd_supply_gregset (regcache, gregsetp);
-+}
-+
-+/* Fill register REGNUM (if it is a general-purpose register) in
-+   *GREGSETPS with the value in GDB's register array.  If REGNUM is -1,
-+   do this for all registers.  */
-+
-+void
-+fill_gregset (const struct regcache *regcache, gdb_gregset_t *gregsetp, int regnum)
-+{
-+  i386bsd_collect_gregset (regcache, gregsetp, regnum);
-+}
-+
-+#include "i387-tdep.h"
-+
-+/* Fill GDB's register array with the floating-point register values
-+   in *FPREGSETP.  */
-+
-+void
-+supply_fpregset (struct regcache *regcache, const fpregset_t *fpregsetp)
-+{
-+  i387_supply_fsave (regcache, -1, fpregsetp);
-+}
-+
-+/* Fill register REGNUM (if it is a floating-point register) in
-+   *FPREGSETP with the value in GDB's register array.  If REGNUM is -1,
-+   do this for all registers.  */
-+
-+void
-+fill_fpregset (const struct regcache *regcache, gdb_fpregset_t *fpregsetp, int regnum)
-+{
-+  i387_collect_fsave (regcache, regnum, fpregsetp);
-+}
-+

-+
- /* Support for debugging kernel virtual memory images.  */
- 
- #include <sys/types.h>
-@@ -141,7 +186,6 @@
- #endif /* HAVE_PT_GETDBREGS */
- 
- 
--  t->to_resume = i386fbsd_resume;
-   t->to_pid_to_exec_file = fbsd_pid_to_exec_file;
-   t->to_find_memory_regions = fbsd_find_memory_regions;
-   t->to_make_corefile_notes = fbsd_make_corefile_notes;

Deleted: trunk/devel/gdb/files/patch-gdb-i386fbsd-tdep.c
===================================================================
--- trunk/devel/gdb/files/patch-gdb-i386fbsd-tdep.c	2018-11-26 17:02:39 UTC (rev 24715)
+++ trunk/devel/gdb/files/patch-gdb-i386fbsd-tdep.c	2018-11-26 17:06:28 UTC (rev 24716)
@@ -1,68 +0,0 @@
---- gdb/i386fbsd-tdep.c.orig	2010-09-30 13:39:50.654492000 -0400
-+++ gdb/i386fbsd-tdep.c	2010-09-30 13:40:43.858675000 -0400
-@@ -28,7 +28,6 @@
- 
- #include "i386-tdep.h"
- #include "i387-tdep.h"
--#include "bsd-uthread.h"
- #include "solib-svr4.h"
- 
- /* FreeBSD 3.0-RELEASE or later.  */
-@@ -84,46 +83,6 @@
- };
- 
- static void
--i386fbsd_supply_uthread (struct regcache *regcache,
--			 int regnum, CORE_ADDR addr)
--{
--  gdb_byte buf[4];
--  int i;
--
--  gdb_assert (regnum >= -1);
--
--  for (i = 0; i < ARRAY_SIZE (i386fbsd_jmp_buf_reg_offset); i++)
--    {
--      if (i386fbsd_jmp_buf_reg_offset[i] != -1
--	  && (regnum == -1 || regnum == i))
--	{
--	  read_memory (addr + i386fbsd_jmp_buf_reg_offset[i], buf, 4);
--	  regcache_raw_supply (regcache, i, buf);
--	}
--    }
--}
--
--static void
--i386fbsd_collect_uthread (const struct regcache *regcache,
--			  int regnum, CORE_ADDR addr)
--{
--  gdb_byte buf[4];
--  int i;
--
--  gdb_assert (regnum >= -1);
--
--  for (i = 0; i < ARRAY_SIZE (i386fbsd_jmp_buf_reg_offset); i++)
--    {
--      if (i386fbsd_jmp_buf_reg_offset[i] != -1
--	  && (regnum == -1 || regnum == i))
--	{
--	  regcache_raw_collect (regcache, i, buf);
--	  write_memory (addr + i386fbsd_jmp_buf_reg_offset[i], buf, 4);
--	}
--    }
--}
--
--static void
- i386fbsdaout_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
- {
-   struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
-@@ -148,10 +107,6 @@
-   /* FreeBSD has a more complete `struct sigcontext'.  */
-   tdep->sc_reg_offset = i386fbsd_sc_reg_offset;
-   tdep->sc_num_regs = ARRAY_SIZE (i386fbsd_sc_reg_offset);
--
--  /* FreeBSD provides a user-level threads implementation.  */
--  bsd_uthread_set_supply_uthread (gdbarch, i386fbsd_supply_uthread);
--  bsd_uthread_set_collect_uthread (gdbarch, i386fbsd_collect_uthread);
- }
- 
- static void

Added: trunk/devel/gdb/files/patch-gdb_aarch64-fbsd-tdep.c
===================================================================
--- trunk/devel/gdb/files/patch-gdb_aarch64-fbsd-tdep.c	                        (rev 0)
+++ trunk/devel/gdb/files/patch-gdb_aarch64-fbsd-tdep.c	2018-11-26 17:06:28 UTC (rev 24716)
@@ -0,0 +1,19 @@
+--- gdb/aarch64-fbsd-tdep.c.orig	2018-03-15 16:39:29.951492000 +0100
++++ gdb/aarch64-fbsd-tdep.c	2018-03-15 16:40:31.553135000 +0100
+@@ -118,11 +118,11 @@
+   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}
++    {0x910003e0, static_cast<ULONGEST>(-1)},		/* mov  x0, sp  */
++    {0x91014000, static_cast<ULONGEST>(-1)},		/* add  x0, x0, #SF_UC  */
++    {0xd2803428, static_cast<ULONGEST>(-1)},		/* mov  x8, #SYS_sigreturn  */
++    {0xd4000001, static_cast<ULONGEST>(-1)},		/* svc  0x0  */
++    {TRAMP_SENTINEL_INSN, static_cast<ULONGEST>(-1)}
+   },
+   aarch64_fbsd_sigframe_init
+ };


Property changes on: trunk/devel/gdb/files/patch-gdb_aarch64-fbsd-tdep.c
___________________________________________________________________
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
Added: trunk/devel/gdb/files/patch-gdb_aarch64-linux-tdep.c
===================================================================
--- trunk/devel/gdb/files/patch-gdb_aarch64-linux-tdep.c	                        (rev 0)
+++ trunk/devel/gdb/files/patch-gdb_aarch64-linux-tdep.c	2018-11-26 17:06:28 UTC (rev 24716)
@@ -0,0 +1,18 @@
+--- gdb/aarch64-linux-tdep.c.orig	2018-03-15 16:42:39.445907000 +0100
++++ gdb/aarch64-linux-tdep.c	2018-03-15 16:43:15.167745000 +0100
+@@ -176,12 +176,12 @@
+   {
+     /* movz x8, 0x8b (S=1,o=10,h=0,i=0x8b,r=8)
+        Soo1 0010 1hhi iiii iiii iiii iiir rrrr  */
+-    {0xd2801168, -1},
++    {0xd2801168, static_cast<ULONGEST>(-1)},
+ 
+     /* svc  0x0      (o=0, l=1)
+        1101 0100 oooi iiii iiii iiii iii0 00ll  */
+-    {0xd4000001, -1},
+-    {TRAMP_SENTINEL_INSN, -1}
++    {0xd4000001, static_cast<ULONGEST>(-1)},
++    {TRAMP_SENTINEL_INSN, static_cast<ULONGEST>(-1)}
+   },
+   aarch64_linux_sigframe_init
+ };


Property changes on: trunk/devel/gdb/files/patch-gdb_aarch64-linux-tdep.c
___________________________________________________________________
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
Added: trunk/devel/gdb/files/patch-gdb_aarch64-tdep.c
===================================================================
--- trunk/devel/gdb/files/patch-gdb_aarch64-tdep.c	                        (rev 0)
+++ trunk/devel/gdb/files/patch-gdb_aarch64-tdep.c	2018-11-26 17:06:28 UTC (rev 24716)
@@ -0,0 +1,11 @@
+--- gdb/aarch64-tdep.c.orig	2018-03-15 16:44:16.746186000 +0100
++++ gdb/aarch64-tdep.c	2018-03-15 16:44:52.315010000 +0100
+@@ -2412,7 +2412,7 @@
+   const int insn_size = 4;
+   const int atomic_sequence_length = 16; /* Instruction sequence length.  */
+   CORE_ADDR pc = regcache_read_pc (regcache);
+-  CORE_ADDR breaks[2] = { -1, -1 };
++  CORE_ADDR breaks[2] = { static_cast<CORE_ADDR>(-1), static_cast<CORE_ADDR>(-1) };
+   CORE_ADDR loc = pc;
+   CORE_ADDR closing_insn = 0;
+   uint32_t insn = read_memory_unsigned_integer (loc, insn_size,


Property changes on: trunk/devel/gdb/files/patch-gdb_aarch64-tdep.c
___________________________________________________________________
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
Added: trunk/devel/gdb/files/patch-gdb_alpha-tdep.c
===================================================================
--- trunk/devel/gdb/files/patch-gdb_alpha-tdep.c	                        (rev 0)
+++ trunk/devel/gdb/files/patch-gdb_alpha-tdep.c	2018-11-26 17:06:28 UTC (rev 24716)
@@ -0,0 +1,11 @@
+--- gdb/alpha-tdep.c.orig	2018-03-15 16:45:58.726244000 +0100
++++ gdb/alpha-tdep.c	2018-03-15 16:46:30.051357000 +0100
+@@ -769,7 +769,7 @@
+ static std::vector<CORE_ADDR>
+ alpha_deal_with_atomic_sequence (struct gdbarch *gdbarch, CORE_ADDR pc)
+ {
+-  CORE_ADDR breaks[2] = {-1, -1};
++  CORE_ADDR breaks[2] = {static_cast<CORE_ADDR>(-1), static_cast<CORE_ADDR>(-1)};
+   CORE_ADDR loc = pc;
+   CORE_ADDR closing_insn; /* Instruction that closes the atomic sequence.  */
+   unsigned int insn = alpha_read_insn (gdbarch, loc);


Property changes on: trunk/devel/gdb/files/patch-gdb_alpha-tdep.c
___________________________________________________________________
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
Added: trunk/devel/gdb/files/patch-gdb_amd64-bsd-nat.c
===================================================================
--- trunk/devel/gdb/files/patch-gdb_amd64-bsd-nat.c	                        (rev 0)
+++ trunk/devel/gdb/files/patch-gdb_amd64-bsd-nat.c	2018-11-26 17:06:28 UTC (rev 24716)
@@ -0,0 +1,30 @@
+--- gdb/amd64-bsd-nat.c.orig 2017-09-14 09:28:17 UTC
++++ gdb/amd64-bsd-nat.c
+@@ -28,6 +28,7 @@
+ #include <sys/types.h>
+ #include <sys/ptrace.h>
+ #include <machine/reg.h>
++#include <machine/psl.h>
+ 
+ #include "amd64-tdep.h"
+ #include "amd64-nat.h"
+@@ -95,12 +96,19 @@ amd64bsd_store_inferior_registers (struct target_ops *ops,
+   if (regnum == -1 || amd64_native_gregset_supplies_p (gdbarch, regnum))
+     {
+       struct reg regs;
++      register_t old_rflags;
+ 
+       if (ptrace (PT_GETREGS, pid, (PTRACE_TYPE_ARG3) &regs, 0) == -1)
+         perror_with_name (_("Couldn't get registers"));
+ 
++      old_rflags = regs.r_rflags;
+       amd64_collect_native_gregset (regcache, &regs, regnum);
+ 
++      /* This is a workaround about the PSL_USERCHANGE posix limitation.  */
++      if ((regs.r_rflags ^ old_rflags ) & ~PSL_USERCHANGE)
++        {
++          regs.r_rflags ^= (regs.r_rflags ^ old_rflags ) & ~PSL_USERCHANGE;
++        }
+       if (ptrace (PT_SETREGS, pid, (PTRACE_TYPE_ARG3) &regs, 0) == -1)
+         perror_with_name (_("Couldn't write registers"));
+ 


Property changes on: trunk/devel/gdb/files/patch-gdb_amd64-bsd-nat.c
___________________________________________________________________
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
Added: trunk/devel/gdb/files/patch-gdb_arch_arm-get-next-pcs.c
===================================================================
--- trunk/devel/gdb/files/patch-gdb_arch_arm-get-next-pcs.c	                        (rev 0)
+++ trunk/devel/gdb/files/patch-gdb_arch_arm-get-next-pcs.c	2018-11-26 17:06:28 UTC (rev 24716)
@@ -0,0 +1,20 @@
+--- gdb/arch/arm-get-next-pcs.c.orig	2018-03-15 10:02:33.823447000 +0100
++++ gdb/arch/arm-get-next-pcs.c	2018-03-15 10:29:48.532027000 +0100
+@@ -49,7 +49,7 @@
+ thumb_deal_with_atomic_sequence_raw (struct arm_get_next_pcs *self)
+ {
+   int byte_order_for_code = self->byte_order_for_code;
+-  CORE_ADDR breaks[2] = {-1, -1};
++  CORE_ADDR breaks[2] = {static_cast<CORE_ADDR>(-1), static_cast<CORE_ADDR>(-1)};
+   CORE_ADDR pc = regcache_read_pc (self->regcache);
+   CORE_ADDR loc = pc;
+   unsigned short insn1, insn2;
+@@ -187,7 +187,7 @@
+ arm_deal_with_atomic_sequence_raw (struct arm_get_next_pcs *self)
+ {
+   int byte_order_for_code = self->byte_order_for_code;
+-  CORE_ADDR breaks[2] = {-1, -1};
++  CORE_ADDR breaks[2] = {static_cast<CORE_ADDR>(-1), static_cast<CORE_ADDR>(-1)};
+   CORE_ADDR pc = regcache_read_pc (self->regcache);
+   CORE_ADDR loc = pc;
+   unsigned int insn;


Property changes on: trunk/devel/gdb/files/patch-gdb_arch_arm-get-next-pcs.c
___________________________________________________________________
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
Added: trunk/devel/gdb/files/patch-gdb_arm-fbsd-tdep.c
===================================================================
--- trunk/devel/gdb/files/patch-gdb_arm-fbsd-tdep.c	                        (rev 0)
+++ trunk/devel/gdb/files/patch-gdb_arm-fbsd-tdep.c	2018-11-26 17:06:28 UTC (rev 24716)
@@ -0,0 +1,19 @@
+--- gdb/arm-fbsd-tdep.c.orig	2018-03-15 10:31:28.468820000 +0100
++++ gdb/arm-fbsd-tdep.c	2018-03-15 10:39:51.558505000 +0100
+@@ -123,11 +123,11 @@
+   SIGTRAMP_FRAME,
+   4,
+   {
+-    {0xe1a0000d, -1},		/* mov  r0, sp  */
+-    {0xe2800040, -1},		/* add  r0, r0, #SIGF_UC  */
+-    {0xe59f700c, -1},		/* ldr  r7, [pc, #12]  */
+-    {0xef0001a1, -1},		/* swi  SYS_sigreturn  */
+-    {TRAMP_SENTINEL_INSN, -1}
++    {0xe1a0000d, static_cast<ULONGEST>(-1)},		/* mov  r0, sp  */
++    {0xe2800040, static_cast<ULONGEST>(-1)},		/* add  r0, r0, #SIGF_UC  */
++    {0xe59f700c, static_cast<ULONGEST>(-1)},		/* ldr  r7, [pc, #12]  */
++    {0xef0001a1, static_cast<ULONGEST>(-1)},		/* swi  SYS_sigreturn  */
++    {TRAMP_SENTINEL_INSN, static_cast<ULONGEST>(-1)}
+   },
+   arm_fbsd_sigframe_init
+ };


Property changes on: trunk/devel/gdb/files/patch-gdb_arm-fbsd-tdep.c
___________________________________________________________________
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
Added: trunk/devel/gdb/files/patch-gdb_arm-linux-tdep.c
===================================================================
--- trunk/devel/gdb/files/patch-gdb_arm-linux-tdep.c	                        (rev 0)
+++ trunk/devel/gdb/files/patch-gdb_arm-linux-tdep.c	2018-11-26 17:06:28 UTC (rev 24716)
@@ -0,0 +1,90 @@
+--- gdb/arm-linux-tdep.c.orig	2018-03-15 10:36:38.853100000 +0100
++++ gdb/arm-linux-tdep.c	2018-03-15 10:42:37.222568000 +0100
+@@ -385,7 +385,7 @@
+   SIGTRAMP_FRAME,
+   4,
+   {
+-    { ARM_LINUX_SIGRETURN_INSTR, -1 },
++    { ARM_LINUX_SIGRETURN_INSTR, static_cast<ULONGEST>(-1) },
+     { TRAMP_SENTINEL_INSN }
+   },
+   arm_linux_sigreturn_init
+@@ -395,7 +395,7 @@
+   SIGTRAMP_FRAME,
+   4,
+   {
+-    { ARM_LINUX_RT_SIGRETURN_INSTR, -1 },
++    { ARM_LINUX_RT_SIGRETURN_INSTR, static_cast<ULONGEST>(-1) },
+     { TRAMP_SENTINEL_INSN }
+   },
+   arm_linux_rt_sigreturn_init
+@@ -405,8 +405,8 @@
+   SIGTRAMP_FRAME,
+   4,
+   {
+-    { ARM_SET_R7_SIGRETURN, -1 },
+-    { ARM_EABI_SYSCALL, -1 },
++    { ARM_SET_R7_SIGRETURN, static_cast<ULONGEST>(-1) },
++    { ARM_EABI_SYSCALL, static_cast<ULONGEST>(-1) },
+     { TRAMP_SENTINEL_INSN }
+   },
+   arm_linux_sigreturn_init
+@@ -416,8 +416,8 @@
+   SIGTRAMP_FRAME,
+   4,
+   {
+-    { ARM_SET_R7_RT_SIGRETURN, -1 },
+-    { ARM_EABI_SYSCALL, -1 },
++    { ARM_SET_R7_RT_SIGRETURN, static_cast<ULONGEST>(-1) },
++    { ARM_EABI_SYSCALL, static_cast<ULONGEST>(-1) },
+     { TRAMP_SENTINEL_INSN }
+   },
+   arm_linux_rt_sigreturn_init
+@@ -427,9 +427,9 @@
+   SIGTRAMP_FRAME,
+   2,
+   {
+-    { THUMB2_SET_R7_SIGRETURN1, -1 },
+-    { THUMB2_SET_R7_SIGRETURN2, -1 },
+-    { THUMB2_EABI_SYSCALL, -1 },
++    { THUMB2_SET_R7_SIGRETURN1, static_cast<ULONGEST>(-1) },
++    { THUMB2_SET_R7_SIGRETURN2, static_cast<ULONGEST>(-1) },
++    { THUMB2_EABI_SYSCALL, static_cast<ULONGEST>(-1) },
+     { TRAMP_SENTINEL_INSN }
+   },
+   arm_linux_sigreturn_init
+@@ -439,9 +439,9 @@
+   SIGTRAMP_FRAME,
+   2,
+   {
+-    { THUMB2_SET_R7_RT_SIGRETURN1, -1 },
+-    { THUMB2_SET_R7_RT_SIGRETURN2, -1 },
+-    { THUMB2_EABI_SYSCALL, -1 },
++    { THUMB2_SET_R7_RT_SIGRETURN1, static_cast<ULONGEST>(-1) },
++    { THUMB2_SET_R7_RT_SIGRETURN2, static_cast<ULONGEST>(-1) },
++    { THUMB2_EABI_SYSCALL, static_cast<ULONGEST>(-1) },
+     { TRAMP_SENTINEL_INSN }
+   },
+   arm_linux_rt_sigreturn_init
+@@ -451,8 +451,8 @@
+   NORMAL_FRAME,
+   4,
+   {
+-    { ARM_OABI_SYSCALL_RESTART_SYSCALL, -1 },
+-    { ARM_LDR_PC_SP_12, -1 },
++    { ARM_OABI_SYSCALL_RESTART_SYSCALL, static_cast<ULONGEST>(-1) },
++    { ARM_LDR_PC_SP_12, static_cast<ULONGEST>(-1) },
+     { TRAMP_SENTINEL_INSN }
+   },
+   arm_linux_restart_syscall_init
+@@ -462,8 +462,8 @@
+   NORMAL_FRAME,
+   4,
+   {
+-    { ARM_OABI_SYSCALL_RESTART_SYSCALL, -1 },
+-    { ARM_LDR_PC_SP_4, -1 },
++    { ARM_OABI_SYSCALL_RESTART_SYSCALL, static_cast<ULONGEST>(-1) },
++    { ARM_LDR_PC_SP_4, static_cast<ULONGEST>(-1) },
+     { TRAMP_SENTINEL_INSN }
+   },
+   arm_linux_restart_syscall_init


Property changes on: trunk/devel/gdb/files/patch-gdb_arm-linux-tdep.c
___________________________________________________________________
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
Added: trunk/devel/gdb/files/patch-gdb_arm-obsd-tdep.c
===================================================================
--- trunk/devel/gdb/files/patch-gdb_arm-obsd-tdep.c	                        (rev 0)
+++ trunk/devel/gdb/files/patch-gdb_arm-obsd-tdep.c	2018-11-26 17:06:28 UTC (rev 24716)
@@ -0,0 +1,19 @@
+--- gdb/arm-obsd-tdep.c.orig	2018-03-15 10:43:44.244835000 +0100
++++ gdb/arm-obsd-tdep.c	2018-03-15 10:44:36.608679000 +0100
+@@ -58,11 +58,11 @@
+   SIGTRAMP_FRAME,
+   4,
+   {
+-    { 0xe28d0010, -1 },		/* add     r0, sp, #16 */
+-    { 0xef000067, -1 },		/* swi     SYS_sigreturn */
+-    { 0xef000001, -1 },		/* swi     SYS_exit */
+-    { 0xeafffffc, -1 },		/* b       . - 8 */
+-    { TRAMP_SENTINEL_INSN, -1 }
++    { 0xe28d0010, static_cast<ULONGEST>(-1) },		/* add     r0, sp, #16 */
++    { 0xef000067, static_cast<ULONGEST>(-1) },		/* swi     SYS_sigreturn */
++    { 0xef000001, static_cast<ULONGEST>(-1) },		/* swi     SYS_exit */
++    { 0xeafffffc, static_cast<ULONGEST>(-1) },		/* b       . - 8 */
++    { TRAMP_SENTINEL_INSN, static_cast<ULONGEST>(-1) }
+   },
+   armobsd_sigframe_init
+ };


Property changes on: trunk/devel/gdb/files/patch-gdb_arm-obsd-tdep.c
___________________________________________________________________
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
Added: trunk/devel/gdb/files/patch-gdb_bfin-linux-tdep.c
===================================================================
--- trunk/devel/gdb/files/patch-gdb_bfin-linux-tdep.c	                        (rev 0)
+++ trunk/devel/gdb/files/patch-gdb_bfin-linux-tdep.c	2018-11-26 17:06:28 UTC (rev 24716)
@@ -0,0 +1,11 @@
+--- gdb/bfin-linux-tdep.c.orig	2018-03-15 10:45:37.746477000 +0100
++++ gdb/bfin-linux-tdep.c	2018-03-15 10:46:02.925435000 +0100
+@@ -121,7 +121,7 @@
+   {
+     { 0x00ADE128, 0xffffffff },	/* P0 = __NR_rt_sigreturn; */
+     { 0x00A0, 0xffff },		/* EXCPT 0; */
+-    { TRAMP_SENTINEL_INSN, -1 },
++    { TRAMP_SENTINEL_INSN, static_cast<ULONGEST>(-1) },
+   },
+   bfin_linux_sigframe_init,
+ };


Property changes on: trunk/devel/gdb/files/patch-gdb_bfin-linux-tdep.c
___________________________________________________________________
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
Added: trunk/devel/gdb/files/patch-gdb_common_common-defs.h
===================================================================
--- trunk/devel/gdb/files/patch-gdb_common_common-defs.h	                        (rev 0)
+++ trunk/devel/gdb/files/patch-gdb_common_common-defs.h	2018-11-26 17:06:28 UTC (rev 24716)
@@ -0,0 +1,18 @@
+--- gdb/common/common-defs.h.orig	2017-09-12 12:25:12 UTC
++++ gdb/common/common-defs.h
+@@ -44,9 +44,15 @@
+ 
+    Must do this before including any system header, since other system
+    headers may include stdint.h/inttypes.h.  */
++#ifndef __STDC_CONSTANT_MACROS
+ #define __STDC_CONSTANT_MACROS 1
++#endif
++#ifndef __STDC_LIMIT_MACROS
+ #define __STDC_LIMIT_MACROS 1
++#endif
++#ifndef __STDC_FORMAT_MACROS
+ #define __STDC_FORMAT_MACROS 1
++#endif
+ 
+ #include <stdarg.h>
+ #include <stdio.h>


Property changes on: trunk/devel/gdb/files/patch-gdb_common_common-defs.h
___________________________________________________________________
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
Added: trunk/devel/gdb/files/patch-gdb_completer.c
===================================================================
--- trunk/devel/gdb/files/patch-gdb_completer.c	                        (rev 0)
+++ trunk/devel/gdb/files/patch-gdb_completer.c	2018-11-26 17:06:28 UTC (rev 24716)
@@ -0,0 +1,11 @@
+--- gdb/completer.c.orig	2018-03-15 16:51:01.106677000 +0100
++++ gdb/completer.c	2018-03-15 16:51:47.055214000 +0100
+@@ -2038,7 +2038,7 @@
+       /* We don't rely on readline appending the quote char as
+ 	 delimiter as then readline wouldn't append the ' ' after the
+ 	 completion.  */
+-      char buf[2] = { quote_char () };
++      char buf[2] = { static_cast<char> (quote_char ()) };
+ 
+       match_list[0] = reconcat (match_list[0], match_list[0],
+ 				buf, (char *) NULL);


Property changes on: trunk/devel/gdb/files/patch-gdb_completer.c
___________________________________________________________________
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
Added: trunk/devel/gdb/files/patch-gdb_configure
===================================================================
--- trunk/devel/gdb/files/patch-gdb_configure	                        (rev 0)
+++ trunk/devel/gdb/files/patch-gdb_configure	2018-11-26 17:06:28 UTC (rev 24716)
@@ -0,0 +1,16 @@
+--- gdb/configure.orig 2017-09-14 09:28:17 UTC
++++ gdb/configure
+@@ -15467,10 +15467,10 @@ fi
+ 
+ # The options we'll try to enable.
+ build_warnings="-Wall -Wpointer-arith \
+--Wno-unused -Wunused-value -Wunused-function \
++-Wno-unused  \
+ -Wno-switch -Wno-char-subscripts \
+--Wempty-body -Wunused-but-set-parameter -Wunused-but-set-variable \
+--Wno-sign-compare -Wno-narrowing -Wno-error=maybe-uninitialized \
++-Wempty-body \
++-Wno-sign-compare -Wno-narrowing \
+ -Wno-mismatched-tags \
+ -Wno-error=deprecated-register \
+ -Wsuggest-override \


Property changes on: trunk/devel/gdb/files/patch-gdb_configure
___________________________________________________________________
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
Added: trunk/devel/gdb/files/patch-gdb_fbsd-nat.c
===================================================================
--- trunk/devel/gdb/files/patch-gdb_fbsd-nat.c	                        (rev 0)
+++ trunk/devel/gdb/files/patch-gdb_fbsd-nat.c	2018-11-26 17:06:28 UTC (rev 24716)
@@ -0,0 +1,17 @@
+--- gdb/fbsd-nat.c.orig 2017-09-14 09:28:17 UTC
++++ gdb/fbsd-nat.c
+@@ -1108,6 +1108,14 @@ fbsd_nat_target::resume (ptid_t ptid, int step, enum gdb_signal signo)
+       struct thread_info *tp;
+       int request;
+ 
++#ifndef PT_LWP_EVENTS
++      /* When LWP events are not supported, a new thread might already be
++	 running that has not yet reported an event when GDB wishes to
++         only run a single thread.  Force an update of the thread list
++	 to ensure that any such threads are suspended before the process
++	 is resumed.  */
++      fbsd_add_threads (ptid_get_pid (ptid));
++#endif
+       ALL_NON_EXITED_THREADS (tp)
+         {
+ 	  if (tp->ptid.pid () != ptid.pid ())


Property changes on: trunk/devel/gdb/files/patch-gdb_fbsd-nat.c
___________________________________________________________________
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
Added: trunk/devel/gdb/files/patch-gdb_gdb__wchar.h
===================================================================
--- trunk/devel/gdb/files/patch-gdb_gdb__wchar.h	                        (rev 0)
+++ trunk/devel/gdb/files/patch-gdb_gdb__wchar.h	2018-11-26 17:06:28 UTC (rev 24716)
@@ -0,0 +1,20 @@
+--- gdb/gdb_wchar.h.orig  2017-09-14 09:28:17 UTC
++++ gdb/gdb_wchar.h
+@@ -59,7 +59,7 @@
+    iconvlist.  */
+ #if defined (HAVE_ICONV) && defined (HAVE_BTOWC) \
+   && (defined (__STDC_ISO_10646__) \
+-      || (defined (_LIBICONV_VERSION) && _LIBICONV_VERSION >= 0x108))
++      || (!defined (LIBICONV_PLUG) && defined (_LIBICONV_VERSION) && _LIBICONV_VERSION >= 0x108))
+ 
+ typedef wchar_t gdb_wchar_t;
+ typedef wint_t gdb_wint_t;
+@@ -82,7 +82,7 @@ typedef wint_t gdb_wint_t;
+ #define INTERMEDIATE_ENCODING intermediate_encoding ()
+ const char *intermediate_encoding (void);
+ 
+-#elif defined (_LIBICONV_VERSION) && _LIBICONV_VERSION >= 0x108
++#elif !defined (LIBICONV_PLUG) && defined (_LIBICONV_VERSION) && _LIBICONV_VERSION >= 0x108
+ #define INTERMEDIATE_ENCODING "wchar_t"
+ #else
+ /* This shouldn't happen, because the earlier #if should have filtered


Property changes on: trunk/devel/gdb/files/patch-gdb_gdb__wchar.h
___________________________________________________________________
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
Added: trunk/devel/gdb/files/patch-gdb_gnulib_import_stddef.in.h
===================================================================
--- trunk/devel/gdb/files/patch-gdb_gnulib_import_stddef.in.h	                        (rev 0)
+++ trunk/devel/gdb/files/patch-gdb_gnulib_import_stddef.in.h	2018-11-26 17:06:28 UTC (rev 24716)
@@ -0,0 +1,11 @@
+--- gdb/gnulib/import/stddef.in.h.orig 2017-09-14 09:28:17 UTC
++++ gdb/gnulib/import/stddef.in.h
+@@ -84,7 +84,7 @@
+ /* Some platforms lack max_align_t.  The check for _GCC_MAX_ALIGN_T is
+    a hack in case the configure-time test was done with g++ even though
+    we are currently compiling with gcc.  */
+-#if ! (@HAVE_MAX_ALIGN_T@ || defined _GCC_MAX_ALIGN_T)
++#if 0
+ /* On the x86, the maximum storage alignment of double, long, etc. is 4,
+    but GCC's C11 ABI for x86 says that max_align_t has an alignment of 8,
+    and the C11 standard allows this.  Work around this problem by


Property changes on: trunk/devel/gdb/files/patch-gdb_gnulib_import_stddef.in.h
___________________________________________________________________
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
Added: trunk/devel/gdb/files/patch-gdb_hppa-nbsd-tdep.c
===================================================================
--- trunk/devel/gdb/files/patch-gdb_hppa-nbsd-tdep.c	                        (rev 0)
+++ trunk/devel/gdb/files/patch-gdb_hppa-nbsd-tdep.c	2018-11-26 17:06:28 UTC (rev 24716)
@@ -0,0 +1,44 @@
+--- gdb/hppa-nbsd-tdep.c.orig	2018-03-15 15:58:14.876431000 +0100
++++ gdb/hppa-nbsd-tdep.c	2018-03-15 16:00:44.247395000 +0100
+@@ -71,25 +71,25 @@
+   SIGTRAMP_FRAME,
+   4,
+   {
+-    { 0xc7d7c012, -1 },	/*	bb,>=,n %arg3, 30, 1f		*/
+-    { 0xd6e01c1e, -1 },	/*	 depwi 0,31,2,%arg3		*/
+-    { 0x0ee81093, -1 },	/*	ldw 4(%arg3), %r19		*/
+-    { 0x0ee01097, -1 },	/*	ldw 0(%arg3), %arg3		*/
++    { 0xc7d7c012, static_cast<ULONGEST>(-1) },	/*	bb,>=,n %arg3, 30, 1f		*/
++    { 0xd6e01c1e, static_cast<ULONGEST>(-1) },	/*	 depwi 0,31,2,%arg3		*/
++    { 0x0ee81093, static_cast<ULONGEST>(-1) },	/*	ldw 4(%arg3), %r19		*/
++    { 0x0ee01097, static_cast<ULONGEST>(-1) },	/*	ldw 0(%arg3), %arg3		*/
+ 			/* 1: 					*/
+-    { 0xe8404000, -1 },	/* 	blr %r0, %rp			*/
+-    { 0xeae0c002, -1 },	/*	bv,n %r0(%arg3)			*/
+-    { 0x08000240, -1 },	/*	 nop				*/
++    { 0xe8404000, static_cast<ULONGEST>(-1) },	/* 	blr %r0, %rp			*/
++    { 0xeae0c002, static_cast<ULONGEST>(-1) },	/*	bv,n %r0(%arg3)			*/
++    { 0x08000240, static_cast<ULONGEST>(-1) },	/*	 nop				*/
+ 
+-    { 0x0803025a, -1 },	/*	copy %r3, %arg0			*/
+-    { 0x20200801, -1 },	/*	ldil -40000000, %r1		*/
+-    { 0xe420e008, -1 },	/*	be,l 4(%sr7, %r1), %sr0, %r31	*/
+-    { 0x34160268, -1 },	/*	 ldi 134, %t1 ; SYS_setcontext	*/
++    { 0x0803025a, static_cast<ULONGEST>(-1) },	/*	copy %r3, %arg0			*/
++    { 0x20200801, static_cast<ULONGEST>(-1) },	/*	ldil -40000000, %r1		*/
++    { 0xe420e008, static_cast<ULONGEST>(-1) },	/*	be,l 4(%sr7, %r1), %sr0, %r31	*/
++    { 0x34160268, static_cast<ULONGEST>(-1) },	/*	 ldi 134, %t1 ; SYS_setcontext	*/
+ 
+-    { 0x081c025a, -1 },	/*	copy ret0, %arg0		*/
+-    { 0x20200801, -1 },	/*	ldil -40000000, %r1		*/
+-    { 0xe420e008, -1 },	/*	be,l 4(%sr7, %r1), %sr0, %r31	*/
+-    { 0x34160002, -1 },	/*	 ldi 1, %t1 ; SYS_exit		*/
+-    { TRAMP_SENTINEL_INSN, -1 }
++    { 0x081c025a, static_cast<ULONGEST>(-1) },	/*	copy ret0, %arg0		*/
++    { 0x20200801, static_cast<ULONGEST>(-1) },	/*	ldil -40000000, %r1		*/
++    { 0xe420e008, static_cast<ULONGEST>(-1) },	/*	be,l 4(%sr7, %r1), %sr0, %r31	*/
++    { 0x34160002, static_cast<ULONGEST>(-1) },	/*	 ldi 1, %t1 ; SYS_exit		*/
++    { TRAMP_SENTINEL_INSN, static_cast<ULONGEST>(-1) }
+   },
+   hppanbsd_sigtramp_cache_init
+ };


Property changes on: trunk/devel/gdb/files/patch-gdb_hppa-nbsd-tdep.c
___________________________________________________________________
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
Added: trunk/devel/gdb/files/patch-gdb_i386-fbsd-nat.c
===================================================================
--- trunk/devel/gdb/files/patch-gdb_i386-fbsd-nat.c	                        (rev 0)
+++ trunk/devel/gdb/files/patch-gdb_i386-fbsd-nat.c	2018-11-26 17:06:28 UTC (rev 24716)
@@ -0,0 +1,27 @@
+--- gdb/i386-fbsd-nat.c 2017-09-14 09:28:17 UTC
++++ gdb/i386-fbsd-nat.c
+@@ -43,8 +43,6 @@ public:
+   const struct target_desc *read_description () override;
+ #endif
+ 
+-  void resume (ptid_t, int, enum gdb_signal) override;
+-
+ #if defined(HAVE_PT_GETDBREGS) && defined(USE_SIGTRAP_SIGINFO)
+   bool supports_stopped_by_hw_breakpoint () override;
+ #endif
+@@ -52,6 +50,7 @@ public:
+ 
+ static i386_fbsd_nat_target the_i386_fbsd_nat_target;
+ 
++#if 0
+ /* Resume execution of the inferior process.  If STEP is nonzero,
+    single-step it.  If SIGNAL is nonzero, give it that signal.  */
+ 
+@@ -98,6 +97,7 @@ i386_fbsd_nat_target::resume (ptid_t ptid, int step, enum gdb_signal signal)
+ 	      gdb_signal_to_host (signal)) == -1)
+     perror_with_name (("ptrace"));
+ }
++#endif
+ 

+ 
+ /* Support for debugging kernel virtual memory images.  */


Property changes on: trunk/devel/gdb/files/patch-gdb_i386-fbsd-nat.c
___________________________________________________________________
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
Added: trunk/devel/gdb/files/patch-gdb_i386-nbsd-tdep.c
===================================================================
--- trunk/devel/gdb/files/patch-gdb_i386-nbsd-tdep.c	                        (rev 0)
+++ trunk/devel/gdb/files/patch-gdb_i386-nbsd-tdep.c	2018-11-26 17:06:28 UTC (rev 24716)
@@ -0,0 +1,157 @@
+--- gdb/i386-nbsd-tdep.c.orig	2018-03-15 10:50:06.446434000 +0100
++++ gdb/i386-nbsd-tdep.c	2018-03-15 11:04:42.700720000 +0100
+@@ -106,19 +106,19 @@
+   SIGTRAMP_FRAME,
+   1,
+   {
+-    { 0x8d, -1 }, { 0x44, -1 }, { 0x24, -1 }, { 0x10, -1 },
++    { 0x8d, static_cast<ULONGEST>(-1) }, { 0x44, static_cast<ULONGEST>(-1) }, { 0x24, static_cast<ULONGEST>(-1) }, { 0x10, static_cast<ULONGEST>(-1) },
+ 			/* leal  0x10(%esp), %eax */
+-    { 0x50, -1 },	/* pushl %eax */
+-    { 0x50, -1 },	/* pushl %eax */
+-    { 0xb8, -1 }, { 0x27, -1 }, {0x01, -1 }, {0x00, -1 }, {0x00, -1 },
++    { 0x50, static_cast<ULONGEST>(-1) },	/* pushl %eax */
++    { 0x50, static_cast<ULONGEST>(-1) },	/* pushl %eax */
++    { 0xb8, static_cast<ULONGEST>(-1) }, { 0x27, static_cast<ULONGEST>(-1) }, {0x01, static_cast<ULONGEST>(-1) }, {0x00, static_cast<ULONGEST>(-1) }, {0x00, static_cast<ULONGEST>(-1) },
+ 			/* movl  $0x127, %eax		# __sigreturn14 */
+-    { 0xcd, -1 }, { 0x80, -1},
++    { 0xcd, static_cast<ULONGEST>(-1) }, { 0x80, static_cast<ULONGEST>(-1)},
+ 			/* int   $0x80 */
+-    { 0xb8, -1 }, { 0x01, -1 }, {0x00, -1 }, {0x00, -1 }, {0x00, -1 },
++    { 0xb8, static_cast<ULONGEST>(-1) }, { 0x01, static_cast<ULONGEST>(-1) }, {0x00, static_cast<ULONGEST>(-1) }, {0x00, static_cast<ULONGEST>(-1) }, {0x00, static_cast<ULONGEST>(-1) },
+ 			/* movl  $0x1, %eax		# exit */
+-    { 0xcd, -1 }, { 0x80, -1},
++    { 0xcd, static_cast<ULONGEST>(-1) }, { 0x80, static_cast<ULONGEST>(-1)},
+ 			/* int   $0x80 */
+-    { TRAMP_SENTINEL_INSN, -1 }
++    { TRAMP_SENTINEL_INSN, static_cast<ULONGEST>(-1) }
+   },
+   i386nbsd_sigtramp_cache_init
+ };
+@@ -128,21 +128,21 @@
+   SIGTRAMP_FRAME,
+   1,
+   {
+-    { 0x8d, -1 }, { 0x44, -1 }, { 0x24, -1 }, { 0x0c, -1 },
++    { 0x8d, static_cast<ULONGEST>(-1) }, { 0x44, static_cast<ULONGEST>(-1) }, { 0x24, static_cast<ULONGEST>(-1) }, { 0x0c, static_cast<ULONGEST>(-1) },
+ 			/* leal  0x0c(%esp), %eax */
+-    { 0x89, -1 }, { 0x44, -1 }, { 0x24, -1 }, { 0x04, -1 },
++    { 0x89, static_cast<ULONGEST>(-1) }, { 0x44, static_cast<ULONGEST>(-1) }, { 0x24, static_cast<ULONGEST>(-1) }, { 0x04, static_cast<ULONGEST>(-1) },
+ 			/* movl  %eax, 0x4(%esp) */
+-    { 0xb8, -1 }, { 0x27, -1 }, {0x01, -1 }, {0x00, -1 }, {0x00, -1 },
++    { 0xb8, static_cast<ULONGEST>(-1) }, { 0x27, static_cast<ULONGEST>(-1) }, {0x01, static_cast<ULONGEST>(-1) }, {0x00, static_cast<ULONGEST>(-1) }, {0x00, static_cast<ULONGEST>(-1) },
+ 			/* movl  $0x127, %eax		# __sigreturn14 */
+-    { 0xcd, -1 }, { 0x80, -1},
++    { 0xcd, static_cast<ULONGEST>(-1) }, { 0x80, static_cast<ULONGEST>(-1)},
+ 			/* int   $0x80 */
+-    { 0x89, -1 }, { 0x44, -1 }, { 0x24, -1 }, { 0x04, -1 },
++    { 0x89, static_cast<ULONGEST>(-1) }, { 0x44, static_cast<ULONGEST>(-1) }, { 0x24, static_cast<ULONGEST>(-1) }, { 0x04, static_cast<ULONGEST>(-1) },
+ 			/* movl  %eax, 0x4(%esp) */
+-    { 0xb8, -1 }, { 0x01, -1 }, {0x00, -1 }, {0x00, -1 }, {0x00, -1 },
++    { 0xb8, static_cast<ULONGEST>(-1) }, { 0x01, static_cast<ULONGEST>(-1) }, {0x00, static_cast<ULONGEST>(-1) }, {0x00, static_cast<ULONGEST>(-1) }, {0x00, static_cast<ULONGEST>(-1) },
+ 			/* movl  $0x1, %eax */
+-    { 0xcd, -1 }, { 0x80, -1},
++    { 0xcd, static_cast<ULONGEST>(-1) }, { 0x80, static_cast<ULONGEST>(-1)},
+ 			/* int   $0x80 */
+-    { TRAMP_SENTINEL_INSN, -1 }
++    { TRAMP_SENTINEL_INSN, static_cast<ULONGEST>(-1) }
+   },
+   i386nbsd_sigtramp_cache_init
+ };
+@@ -152,21 +152,22 @@
+   SIGTRAMP_FRAME,
+   1,
+   {
+-    { 0x8b, -1 }, { 0x44, -1 }, { 0x24, -1 }, { 0x08, -1 },
++    { 0x8b, static_cast<ULONGEST>(-1) }, { 0x44, static_cast<ULONGEST>(-1) }, { 0x24, static_cast<ULONGEST>(-1) }, { 0x08, static_cast<ULONGEST>(-1) },
+ 			/* movl  8(%esp),%eax */
+-    { 0x89, -1 }, { 0x44, -1 }, { 0x24, -1 }, { 0x04, -1 },
++    { 0x89, static_cast<ULONGEST>(-1) }, { 0x44, static_cast<ULONGEST>(-1) }, { 0x24, static_cast<ULONGEST>(-1) }, { 0x04, static_cast<ULONGEST>(-1) },
+ 			/* movl  %eax, 0x4(%esp) */
+-    { 0xb8, -1 }, { 0x34, -1 }, { 0x01, -1 }, { 0x00, -1 }, { 0x00, -1 },
++    { 0xb8, static_cast<ULONGEST>(-1) }, { 0x34, static_cast<ULONGEST>(-1) }, { 0x01, static_cast<ULONGEST>(-1) }, { 0x00, static_cast<ULONGEST>(-1) }, { 0x00, static_cast<ULONGEST>(-1) },
+ 			/* movl  $0x134, %eax            # setcontext */
+-    { 0xcd, -1 }, { 0x80, -1 },
++    { 0xcd, static_cast<ULONGEST>(-1) }, { 0x80, static_cast<ULONGEST>(-1) },
+ 			/* int   $0x80 */
+-    { 0x89, -1 }, { 0x44, -1 }, { 0x24, -1 }, { 0x04, -1 },
++    { 0x89, static_cast<ULONGEST>(-1) }, { 0x44, static_cast<ULONGEST>(-1) }, { 0x24, static_cast<ULONGEST>(-1) }, { 0x04, static_cast<ULONGEST>(-1) },
++    { 0x89, static_cast<ULONGEST>(-1) }, { 0x44, static_cast<ULONGEST>(-1) }, { 0x24, static_cast<ULONGEST>(-1) }, { 0x04, static_cast<ULONGEST>(-1) },
+ 			/* movl  %eax, 0x4(%esp) */
+-    { 0xb8, -1 }, { 0x01, -1 }, { 0x00, -1 }, { 0x00, -1 }, { 0x00, -1 },
++    { 0xb8, static_cast<ULONGEST>(-1) }, { 0x01, static_cast<ULONGEST>(-1) }, {0x00, static_cast<ULONGEST>(-1) }, {0x00, static_cast<ULONGEST>(-1) }, {0x00, static_cast<ULONGEST>(-1) },
+ 			/* movl  $0x1, %eax */
+-    { 0xcd, -1 }, { 0x80, -1 },
++    { 0xcd, static_cast<ULONGEST>(-1) }, { 0x80, static_cast<ULONGEST>(-1)},
+ 			/* int   $0x80 */
+-    { TRAMP_SENTINEL_INSN, -1 }
++    { TRAMP_SENTINEL_INSN, static_cast<ULONGEST>(-1) }
+   },
+   i386nbsd_sigtramp_cache_init
+ };
+@@ -176,22 +177,22 @@
+   SIGTRAMP_FRAME,
+   1,
+   {
+-    { 0x8d, -1 }, { 0x84, -1 }, { 0x24, -1 },
+-        { 0x8c, -1 }, { 0x00, -1 }, { 0x00, -1 }, { 0x00, -1 },
++    { 0x8d, static_cast<ULONGEST>(-1) }, { 0x84, static_cast<ULONGEST>(-1) }, { 0x24, static_cast<ULONGEST>(-1) },
++        { 0x8c, static_cast<ULONGEST>(-1) }, { 0x00, static_cast<ULONGEST>(-1) }, { 0x00, static_cast<ULONGEST>(-1) }, { 0x00, static_cast<ULONGEST>(-1) },
+ 			/* leal  0x8c(%esp), %eax */
+-    { 0x89, -1 }, { 0x44, -1 }, { 0x24, -1 }, { 0x04, -1 },
++    { 0x89, static_cast<ULONGEST>(-1) }, { 0x44, static_cast<ULONGEST>(-1) }, { 0x24, static_cast<ULONGEST>(-1) }, { 0x04, static_cast<ULONGEST>(-1) },
+ 			/* movl  %eax, 0x4(%esp) */
+-    { 0xb8, -1 }, { 0x34, -1 }, { 0x01, -1 }, { 0x00, -1 }, { 0x00, -1 },
++    { 0xb8, static_cast<ULONGEST>(-1) }, { 0x34, static_cast<ULONGEST>(-1) }, { 0x01, static_cast<ULONGEST>(-1) }, { 0x00, static_cast<ULONGEST>(-1) }, { 0x00, static_cast<ULONGEST>(-1) },
+ 			/* movl  $0x134, %eax            # setcontext */
+-    { 0xcd, -1 }, { 0x80, -1},
++    { 0xcd, static_cast<ULONGEST>(-1) }, { 0x80, static_cast<ULONGEST>(-1)},
+ 			/* int   $0x80 */
+-    { 0x89, -1 }, { 0x44, -1 }, { 0x24, -1 }, { 0x04, -1 },
++    { 0x89, static_cast<ULONGEST>(-1) }, { 0x44, static_cast<ULONGEST>(-1) }, { 0x24, static_cast<ULONGEST>(-1) }, { 0x04, static_cast<ULONGEST>(-1) },
+ 			/* movl  %eax, 0x4(%esp) */
+-    { 0xb8, -1 }, { 0x01, -1 }, {0x00, -1 }, {0x00, -1 }, {0x00, -1 },
++    { 0xb8, static_cast<ULONGEST>(-1) }, { 0x01, static_cast<ULONGEST>(-1) }, {0x00, static_cast<ULONGEST>(-1) }, {0x00, static_cast<ULONGEST>(-1) }, {0x00, static_cast<ULONGEST>(-1) },
+ 			/* movl  $0x1, %eax */
+-    { 0xcd, -1 }, { 0x80, -1},
++    { 0xcd, static_cast<ULONGEST>(-1) }, { 0x80, static_cast<ULONGEST>(-1)},
+ 			/* int   $0x80 */
+-    { TRAMP_SENTINEL_INSN, -1 }
++    { TRAMP_SENTINEL_INSN, static_cast<ULONGEST>(-1) }
+   },
+   i386nbsd_sigtramp_cache_init
+ };
+@@ -201,23 +202,23 @@
+   SIGTRAMP_FRAME,
+   1,
+   {
+-    { 0x8d, -1 }, { 0x84, -1 }, { 0x24, -1 },
+-        { 0x8c, -1 }, { 0x00, -1 }, { 0x00, -1 }, { 0x00, -1 },
++    { 0x8d, static_cast<ULONGEST>(-1) }, { 0x84, static_cast<ULONGEST>(-1) }, { 0x24, static_cast<ULONGEST>(-1) },
++        { 0x8c, static_cast<ULONGEST>(-1) }, { 0x00, static_cast<ULONGEST>(-1) }, { 0x00, static_cast<ULONGEST>(-1) }, { 0x00, static_cast<ULONGEST>(-1) },
+ 			/* leal  0x8c(%esp), %eax */
+-    { 0x89, -1 }, { 0x44, -1 }, { 0x24, -1 }, { 0x04, -1 },
++    { 0x89, static_cast<ULONGEST>(-1) }, { 0x44, static_cast<ULONGEST>(-1) }, { 0x24, static_cast<ULONGEST>(-1) }, { 0x04, static_cast<ULONGEST>(-1) },
+ 			/* movl  %eax, 0x4(%esp) */
+-    { 0xb8, -1 }, { 0x34, -1 }, { 0x01, -1 }, { 0x00, -1 }, { 0x00, -1 },
++    { 0xb8, static_cast<ULONGEST>(-1) }, { 0x34, static_cast<ULONGEST>(-1) }, { 0x01, static_cast<ULONGEST>(-1) }, { 0x00, static_cast<ULONGEST>(-1) }, { 0x00, static_cast<ULONGEST>(-1) },
+ 			/* movl  $0x134, %eax            # setcontext */
+-    { 0xcd, -1 }, { 0x80, -1},
++    { 0xcd, static_cast<ULONGEST>(-1) }, { 0x80, static_cast<ULONGEST>(-1)},
+ 			/* int   $0x80 */
+-    { 0xc7, -1 }, { 0x44, -1 }, { 0x24, -1 }, { 0x04, -1 },
+-        { 0xff, -1 }, { 0xff, -1 }, { 0xff, -1 }, { 0xff, -1 },
++    { 0xc7, static_cast<ULONGEST>(-1) }, { 0x44, static_cast<ULONGEST>(-1) }, { 0x24, static_cast<ULONGEST>(-1) }, { 0x04, static_cast<ULONGEST>(-1) },
++        { 0xff, static_cast<ULONGEST>(-1) }, { 0xff, static_cast<ULONGEST>(-1) }, { 0xff, static_cast<ULONGEST>(-1) }, { 0xff, static_cast<ULONGEST>(-1) },
+ 			/* movl   $0xffffffff,0x4(%esp) */
+-    { 0xb8, -1 }, { 0x01, -1 }, {0x00, -1 }, {0x00, -1 }, {0x00, -1 },
++    { 0xb8, static_cast<ULONGEST>(-1) }, { 0x01, static_cast<ULONGEST>(-1) }, {0x00, static_cast<ULONGEST>(-1) }, {0x00, static_cast<ULONGEST>(-1) }, {0x00, static_cast<ULONGEST>(-1) },
+ 			/* movl  $0x1, %eax */
+-    { 0xcd, -1 }, { 0x80, -1},
++    { 0xcd, static_cast<ULONGEST>(-1) }, { 0x80, static_cast<ULONGEST>(-1)},
+ 			/* int   $0x80 */
+-    { TRAMP_SENTINEL_INSN, -1 }
++    { TRAMP_SENTINEL_INSN, static_cast<ULONGEST>(-1) }
+   },
+   i386nbsd_sigtramp_cache_init
+ };


Property changes on: trunk/devel/gdb/files/patch-gdb_i386-nbsd-tdep.c
___________________________________________________________________
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
Added: trunk/devel/gdb/files/patch-gdb_linespec.c
===================================================================
--- trunk/devel/gdb/files/patch-gdb_linespec.c	                        (rev 0)
+++ trunk/devel/gdb/files/patch-gdb_linespec.c	2018-11-26 17:06:28 UTC (rev 24716)
@@ -0,0 +1,11 @@
+--- gdb/linespec.c.orig	2018-03-15 16:52:46.342610000 +0100
++++ gdb/linespec.c	2018-03-15 16:53:18.324077000 +0100
+@@ -2912,7 +2912,7 @@
+ 	     new "quote" char.  */
+ 	  if (tracker.quote_char ())
+ 	    {
+-	      char quote_char_str[2] = { tracker.quote_char () };
++	      char quote_char_str[2] = { static_cast<char>(tracker.quote_char () )};
+ 
+ 	      fn = reconcat (fn, fn, quote_char_str, (char *) NULL);
+ 	      tracker.set_quote_char (':');


Property changes on: trunk/devel/gdb/files/patch-gdb_linespec.c
___________________________________________________________________
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
Added: trunk/devel/gdb/files/patch-gdb_microblaze-linux-tdep.c
===================================================================
--- trunk/devel/gdb/files/patch-gdb_microblaze-linux-tdep.c	                        (rev 0)
+++ trunk/devel/gdb/files/patch-gdb_microblaze-linux-tdep.c	2018-11-26 17:06:28 UTC (rev 24716)
@@ -0,0 +1,13 @@
+--- gdb/microblaze-linux-tdep.c.orig	2018-03-15 11:06:05.114101000 +0100
++++ gdb/microblaze-linux-tdep.c	2018-03-15 11:06:36.384643000 +0100
+@@ -107,8 +107,8 @@
+   SIGTRAMP_FRAME,
+   4,
+   {
+-    { 0x31800077, -1 }, /* addik R12,R0,119.  */
+-    { 0xb9cc0008, -1 }, /* brki R14,8.  */
++    { 0x31800077, static_cast<ULONGEST>(-1) }, /* addik R12,R0,119.  */
++    { 0xb9cc0008, static_cast<ULONGEST>(-1) }, /* brki R14,8.  */
+     { TRAMP_SENTINEL_INSN },
+   },
+   microblaze_linux_sighandler_cache_init


Property changes on: trunk/devel/gdb/files/patch-gdb_microblaze-linux-tdep.c
___________________________________________________________________
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
Added: trunk/devel/gdb/files/patch-gdb_mips-fbsd-tdep.c
===================================================================
--- trunk/devel/gdb/files/patch-gdb_mips-fbsd-tdep.c	                        (rev 0)
+++ trunk/devel/gdb/files/patch-gdb_mips-fbsd-tdep.c	2018-11-26 17:06:28 UTC (rev 24716)
@@ -0,0 +1,53 @@
+--- gdb/mips-fbsd-tdep.c.orig	2018-03-15 11:11:08.892968000 +0100
++++ gdb/mips-fbsd-tdep.c	2018-03-15 11:14:38.323126000 +0100
+@@ -342,11 +342,11 @@
+   SIGTRAMP_FRAME,
+   MIPS_INSN32_SIZE,
+   {
+-    { MIPS_INST_ADDIU_A0_SP_O32, -1 },	/* addiu   a0, sp, SIGF_UC */
+-    { MIPS_INST_LI_V0_SIGRETURN, -1 },	/* li      v0, SYS_sigreturn */
+-    { MIPS_INST_SYSCALL, -1 },		/* syscall */
+-    { MIPS_INST_BREAK, -1 },		/* break */
+-    { TRAMP_SENTINEL_INSN, -1 }
++    { MIPS_INST_ADDIU_A0_SP_O32, static_cast<ULONGEST>(-1) },	/* addiu   a0, sp, SIGF_UC */
++    { MIPS_INST_LI_V0_SIGRETURN, static_cast<ULONGEST>(-1) },	/* li      v0, SYS_sigreturn */
++    { MIPS_INST_SYSCALL, static_cast<ULONGEST>(-1) },		/* syscall */
++    { MIPS_INST_BREAK, static_cast<ULONGEST>(-1) },		/* break */
++    { TRAMP_SENTINEL_INSN, static_cast<ULONGEST>(-1) }
+   },
+   mips_fbsd_sigframe_init
+ };
+@@ -434,11 +434,11 @@
+   SIGTRAMP_FRAME,
+   MIPS_INSN32_SIZE,
+   {
+-    { MIPS_INST_ADDIU_A0_SP_N32, -1 },	/* addiu   a0, sp, SIGF_UC */
+-    { MIPS_INST_LI_V0_SIGRETURN, -1 },	/* li      v0, SYS_sigreturn */
+-    { MIPS_INST_SYSCALL, -1 },		/* syscall */
+-    { MIPS_INST_BREAK, -1 },		/* break */
+-    { TRAMP_SENTINEL_INSN, -1 }
++    { MIPS_INST_ADDIU_A0_SP_N32, static_cast<ULONGEST>(-1) },	/* addiu   a0, sp, SIGF_UC */
++    { MIPS_INST_LI_V0_SIGRETURN, static_cast<ULONGEST>(-1) },	/* li      v0, SYS_sigreturn */
++    { MIPS_INST_SYSCALL, static_cast<ULONGEST>(-1) },		/* syscall */
++    { MIPS_INST_BREAK, static_cast<ULONGEST>(-1) },		/* break */
++    { TRAMP_SENTINEL_INSN, static_cast<ULONGEST>(-1) }
+   },
+   mips64_fbsd_sigframe_init
+ };
+@@ -451,11 +451,11 @@
+   SIGTRAMP_FRAME,
+   MIPS_INSN32_SIZE,
+   {
+-    { MIPS_INST_DADDIU_A0_SP_N64, -1 },	/* daddiu  a0, sp, SIGF_UC */
+-    { MIPS_INST_LI_V0_SIGRETURN, -1 },	/* li      v0, SYS_sigreturn */
+-    { MIPS_INST_SYSCALL, -1 },		/* syscall */
+-    { MIPS_INST_BREAK, -1 },		/* break */
+-    { TRAMP_SENTINEL_INSN, -1 }
++    { MIPS_INST_DADDIU_A0_SP_N64, static_cast<ULONGEST>(-1) },	/* daddiu  a0, sp, SIGF_UC */
++    { MIPS_INST_LI_V0_SIGRETURN, static_cast<ULONGEST>(-1) },	/* li      v0, SYS_sigreturn */
++    { MIPS_INST_SYSCALL, static_cast<ULONGEST>(-1) },		/* syscall */
++    { MIPS_INST_BREAK, static_cast<ULONGEST>(-1) },		/* break */
++    { TRAMP_SENTINEL_INSN, static_cast<ULONGEST>(-1) }
+   },
+   mips64_fbsd_sigframe_init
+ };


Property changes on: trunk/devel/gdb/files/patch-gdb_mips-fbsd-tdep.c
___________________________________________________________________
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
Added: trunk/devel/gdb/files/patch-gdb_mips-linux-tdep.c
===================================================================
--- trunk/devel/gdb/files/patch-gdb_mips-linux-tdep.c	                        (rev 0)
+++ trunk/devel/gdb/files/patch-gdb_mips-linux-tdep.c	2018-11-26 17:06:28 UTC (rev 24716)
@@ -0,0 +1,122 @@
+--- gdb/mips-linux-tdep.c.orig	2018-03-15 11:07:40.749034000 +0100
++++ gdb/mips-linux-tdep.c	2018-03-15 11:09:52.878504000 +0100
+@@ -831,9 +831,9 @@
+   SIGTRAMP_FRAME,
+   4,
+   {
+-    { MIPS_INST_LI_V0_SIGRETURN, -1 },
+-    { MIPS_INST_SYSCALL, -1 },
+-    { TRAMP_SENTINEL_INSN, -1 }
++    { MIPS_INST_LI_V0_SIGRETURN, static_cast<ULONGEST>(-1) },
++    { MIPS_INST_SYSCALL, static_cast<ULONGEST>(-1) },
++    { TRAMP_SENTINEL_INSN, static_cast<ULONGEST>(-1) }
+   },
+   mips_linux_o32_sigframe_init,
+   mips_linux_sigframe_validate
+@@ -843,9 +843,9 @@
+   SIGTRAMP_FRAME,
+   4,
+   {
+-    { MIPS_INST_LI_V0_RT_SIGRETURN, -1 },
+-    { MIPS_INST_SYSCALL, -1 },
+-    { TRAMP_SENTINEL_INSN, -1 } },
++    { MIPS_INST_LI_V0_RT_SIGRETURN, static_cast<ULONGEST>(-1) },
++    { MIPS_INST_SYSCALL, static_cast<ULONGEST>(-1) },
++    { TRAMP_SENTINEL_INSN, static_cast<ULONGEST>(-1) } },
+   mips_linux_o32_sigframe_init,
+   mips_linux_sigframe_validate
+ };
+@@ -854,9 +854,9 @@
+   SIGTRAMP_FRAME,
+   4,
+   {
+-    { MIPS_INST_LI_V0_N32_RT_SIGRETURN, -1 },
+-    { MIPS_INST_SYSCALL, -1 },
+-    { TRAMP_SENTINEL_INSN, -1 }
++    { MIPS_INST_LI_V0_N32_RT_SIGRETURN, static_cast<ULONGEST>(-1) },
++    { MIPS_INST_SYSCALL, static_cast<ULONGEST>(-1) },
++    { TRAMP_SENTINEL_INSN, static_cast<ULONGEST>(-1) }
+   },
+   mips_linux_n32n64_sigframe_init,
+   mips_linux_sigframe_validate
+@@ -866,9 +866,9 @@
+   SIGTRAMP_FRAME,
+   4,
+   {
+-    { MIPS_INST_LI_V0_N64_RT_SIGRETURN, -1 },
+-    { MIPS_INST_SYSCALL, -1 },
+-    { TRAMP_SENTINEL_INSN, -1 }
++    { MIPS_INST_LI_V0_N64_RT_SIGRETURN, static_cast<ULONGEST>(-1) },
++    { MIPS_INST_SYSCALL, static_cast<ULONGEST>(-1) },
++    { TRAMP_SENTINEL_INSN, static_cast<ULONGEST>(-1) }
+   },
+   mips_linux_n32n64_sigframe_init,
+   mips_linux_sigframe_validate
+@@ -878,11 +878,11 @@
+   SIGTRAMP_FRAME,
+   2,
+   {
+-    { MICROMIPS_INST_LI_V0, -1 },
+-    { MIPS_NR_sigreturn, -1 },
+-    { MICROMIPS_INST_POOL32A, -1 },
+-    { MICROMIPS_INST_SYSCALL, -1 },
+-    { TRAMP_SENTINEL_INSN, -1 }
++    { MICROMIPS_INST_LI_V0, static_cast<ULONGEST>(-1) },
++    { MIPS_NR_sigreturn, static_cast<ULONGEST>(-1) },
++    { MICROMIPS_INST_POOL32A, static_cast<ULONGEST>(-1) },
++    { MICROMIPS_INST_SYSCALL, static_cast<ULONGEST>(-1) },
++    { TRAMP_SENTINEL_INSN, static_cast<ULONGEST>(-1) }
+   },
+   mips_linux_o32_sigframe_init,
+   micromips_linux_sigframe_validate
+@@ -892,11 +892,11 @@
+   SIGTRAMP_FRAME,
+   2,
+   {
+-    { MICROMIPS_INST_LI_V0, -1 },
+-    { MIPS_NR_rt_sigreturn, -1 },
+-    { MICROMIPS_INST_POOL32A, -1 },
+-    { MICROMIPS_INST_SYSCALL, -1 },
+-    { TRAMP_SENTINEL_INSN, -1 }
++    { MICROMIPS_INST_LI_V0, static_cast<ULONGEST>(-1) },
++    { MIPS_NR_rt_sigreturn, static_cast<ULONGEST>(-1) },
++    { MICROMIPS_INST_POOL32A, static_cast<ULONGEST>(-1) },
++    { MICROMIPS_INST_SYSCALL, static_cast<ULONGEST>(-1) },
++    { TRAMP_SENTINEL_INSN, static_cast<ULONGEST>(-1) }
+   },
+   mips_linux_o32_sigframe_init,
+   micromips_linux_sigframe_validate
+@@ -906,11 +906,11 @@
+   SIGTRAMP_FRAME,
+   2,
+   {
+-    { MICROMIPS_INST_LI_V0, -1 },
+-    { MIPS_NR_N32_rt_sigreturn, -1 },
+-    { MICROMIPS_INST_POOL32A, -1 },
+-    { MICROMIPS_INST_SYSCALL, -1 },
+-    { TRAMP_SENTINEL_INSN, -1 }
++    { MICROMIPS_INST_LI_V0, static_cast<ULONGEST>(-1) },
++    { MIPS_NR_N32_rt_sigreturn, static_cast<ULONGEST>(-1) },
++    { MICROMIPS_INST_POOL32A, static_cast<ULONGEST>(-1) },
++    { MICROMIPS_INST_SYSCALL, static_cast<ULONGEST>(-1) },
++    { TRAMP_SENTINEL_INSN, static_cast<ULONGEST>(-1) }
+   },
+   mips_linux_n32n64_sigframe_init,
+   micromips_linux_sigframe_validate
+@@ -920,11 +920,11 @@
+   SIGTRAMP_FRAME,
+   2,
+   {
+-    { MICROMIPS_INST_LI_V0, -1 },
+-    { MIPS_NR_N64_rt_sigreturn, -1 },
+-    { MICROMIPS_INST_POOL32A, -1 },
+-    { MICROMIPS_INST_SYSCALL, -1 },
+-    { TRAMP_SENTINEL_INSN, -1 }
++    { MICROMIPS_INST_LI_V0, static_cast<ULONGEST>(-1) },
++    { MIPS_NR_N64_rt_sigreturn, static_cast<ULONGEST>(-1) },
++    { MICROMIPS_INST_POOL32A, static_cast<ULONGEST>(-1) },
++    { MICROMIPS_INST_SYSCALL, static_cast<ULONGEST>(-1) },
++    { TRAMP_SENTINEL_INSN, static_cast<ULONGEST>(-1) }
+   },
+   mips_linux_n32n64_sigframe_init,
+   micromips_linux_sigframe_validate


Property changes on: trunk/devel/gdb/files/patch-gdb_mips-linux-tdep.c
___________________________________________________________________
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
Added: trunk/devel/gdb/files/patch-gdb_mips-tdep.c
===================================================================
--- trunk/devel/gdb/files/patch-gdb_mips-tdep.c	                        (rev 0)
+++ trunk/devel/gdb/files/patch-gdb_mips-tdep.c	2018-11-26 17:06:28 UTC (rev 24716)
@@ -0,0 +1,20 @@
+--- gdb/mips-tdep.c.orig	2018-03-15 11:15:08.500010000 +0100
++++ gdb/mips-tdep.c	2018-03-15 11:16:05.745083000 +0100
+@@ -3882,7 +3882,7 @@
+ static std::vector<CORE_ADDR>
+ mips_deal_with_atomic_sequence (struct gdbarch *gdbarch, CORE_ADDR pc)
+ {
+-  CORE_ADDR breaks[2] = {-1, -1};
++  CORE_ADDR breaks[2] = {static_cast<CORE_ADDR>(-1), static_cast<CORE_ADDR>(-1)};
+   CORE_ADDR loc = pc;
+   CORE_ADDR branch_bp; /* Breakpoint at branch instruction's destination.  */
+   ULONGEST insn;
+@@ -3985,7 +3985,7 @@
+ {
+   const int atomic_sequence_length = 16; /* Instruction sequence length.  */
+   int last_breakpoint = 0; /* Defaults to 0 (no breakpoints placed).  */
+-  CORE_ADDR breaks[2] = {-1, -1};
++  CORE_ADDR breaks[2] = {static_cast<CORE_ADDR>(-1), static_cast<CORE_ADDR>(-1)};
+   CORE_ADDR branch_bp = 0; /* Breakpoint at branch instruction's
+ 			      destination.  */
+   CORE_ADDR loc = pc;


Property changes on: trunk/devel/gdb/files/patch-gdb_mips-tdep.c
___________________________________________________________________
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
Added: trunk/devel/gdb/files/patch-gdb_mips64-obsd-tdep.c
===================================================================
--- trunk/devel/gdb/files/patch-gdb_mips64-obsd-tdep.c	                        (rev 0)
+++ trunk/devel/gdb/files/patch-gdb_mips64-obsd-tdep.c	2018-11-26 17:06:28 UTC (rev 24716)
@@ -0,0 +1,19 @@
+--- gdb/mips64-obsd-tdep.c.orig	2018-03-15 16:47:34.626536000 +0100
++++ gdb/mips64-obsd-tdep.c	2018-03-15 16:48:17.150853000 +0100
+@@ -127,11 +127,11 @@
+   SIGTRAMP_FRAME,
+   MIPS_INSN32_SIZE,
+   {
+-    { 0x67a40020, -1 },		/* daddiu  a0,sp,32 */
+-    { 0x24020067, -1 },		/* li      v0,103 */
+-    { 0x0000000c, -1 },		/* syscall */
+-    { 0x0000000d, -1 },		/* break */
+-    { TRAMP_SENTINEL_INSN, -1 }
++    { 0x67a40020, static_cast<ULONGEST>(-1) },		/* daddiu  a0,sp,32 */
++    { 0x24020067, static_cast<ULONGEST>(-1) },		/* li      v0,103 */
++    { 0x0000000c, static_cast<ULONGEST>(-1) },		/* syscall */
++    { 0x0000000d, static_cast<ULONGEST>(-1) },		/* break */
++    { TRAMP_SENTINEL_INSN, static_cast<ULONGEST>(-1) }
+   },
+   mips64obsd_sigframe_init
+ };


Property changes on: trunk/devel/gdb/files/patch-gdb_mips64-obsd-tdep.c
___________________________________________________________________
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
Added: trunk/devel/gdb/files/patch-gdb_mn10300-linux-tdep.c
===================================================================
--- trunk/devel/gdb/files/patch-gdb_mn10300-linux-tdep.c	                        (rev 0)
+++ trunk/devel/gdb/files/patch-gdb_mn10300-linux-tdep.c	2018-11-26 17:06:28 UTC (rev 24716)
@@ -0,0 +1,42 @@
+--- gdb/mn10300-linux-tdep.c.orig	2018-03-15 11:17:21.462824000 +0100
++++ gdb/mn10300-linux-tdep.c	2018-03-15 11:20:05.266582000 +0100
+@@ -476,13 +476,13 @@
+   1,
+   {
+     /* mov     119,d0 */
+-    { 0x2c, -1 },
+-    { 0x77, -1 },
+-    { 0x00, -1 },
++    { 0x2c, static_cast<ULONGEST>(-1) },
++    { 0x77, static_cast<ULONGEST>(-1) },
++    { 0x00, static_cast<ULONGEST>(-1) },
+     /* syscall 0 */
+-    { 0xf0, -1 },
+-    { 0xe0, -1 },
+-    { TRAMP_SENTINEL_INSN, -1 }
++    { 0xf0, static_cast<ULONGEST>(-1) },
++    { 0xe0, static_cast<ULONGEST>(-1) },
++    { TRAMP_SENTINEL_INSN, static_cast<ULONGEST>(-1) }
+   },
+   am33_linux_sigframe_cache_init
+ };
+@@ -492,13 +492,13 @@
+   1,
+   {
+     /* mov     173,d0 */
+-    { 0x2c, -1 },
+-    { 0xad, -1 },
+-    { 0x00, -1 },
++    { 0x2c, static_cast<ULONGEST>(-1) },
++    { 0xad, static_cast<ULONGEST>(-1) },
++    { 0x00, static_cast<ULONGEST>(-1) },
+     /* syscall 0 */
+-    { 0xf0, -1 },
+-    { 0xe0, -1 },
+-    { TRAMP_SENTINEL_INSN, -1 }
++    { 0xf0, static_cast<ULONGEST>(-1) },
++    { 0xe0, static_cast<ULONGEST>(-1) },
++    { TRAMP_SENTINEL_INSN, static_cast<ULONGEST>(-1) }
+   },
+   am33_linux_sigframe_cache_init
+ };


Property changes on: trunk/devel/gdb/files/patch-gdb_mn10300-linux-tdep.c
___________________________________________________________________
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
Added: trunk/devel/gdb/files/patch-gdb_nios2-linux-tdep.c
===================================================================
--- trunk/devel/gdb/files/patch-gdb_nios2-linux-tdep.c	                        (rev 0)
+++ trunk/devel/gdb/files/patch-gdb_nios2-linux-tdep.c	2018-11-26 17:06:28 UTC (rev 24716)
@@ -0,0 +1,24 @@
+--- gdb/nios2-linux-tdep.c.orig	2018-03-15 11:23:52.815692000 +0100
++++ gdb/nios2-linux-tdep.c	2018-03-15 11:55:44.876122000 +0100
+@@ -164,8 +164,8 @@
+   SIGTRAMP_FRAME,
+   4,
+   {
+-    { MATCH_R1_MOVI | SET_IW_I_B (2) | SET_IW_I_IMM16 (139), -1 },
+-    { MATCH_R1_TRAP | SET_IW_R_IMM5 (0), -1},
++    { MATCH_R1_MOVI | SET_IW_I_B (2) | SET_IW_I_IMM16 (139), static_cast<ULONGEST>(-1) },
++    { MATCH_R1_TRAP | SET_IW_R_IMM5 (0), static_cast<ULONGEST>(-1)},
+     { TRAMP_SENTINEL_INSN }
+   },
+   nios2_linux_rt_sigreturn_init
+@@ -176,8 +176,8 @@
+   SIGTRAMP_FRAME,
+   4,
+   {
+-    { MATCH_R2_MOVI | SET_IW_F2I16_B (2) | SET_IW_F2I16_IMM16 (139), -1 },
+-    { MATCH_R2_TRAP | SET_IW_X2L5_IMM5 (0), -1},
++    { MATCH_R2_MOVI | SET_IW_F2I16_B (2) | SET_IW_F2I16_IMM16 (139), static_cast<ULONGEST>(-1) },
++    { MATCH_R2_TRAP | SET_IW_X2L5_IMM5 (0), static_cast<ULONGEST>(-1)},
+     { TRAMP_SENTINEL_INSN }
+   },
+   nios2_linux_rt_sigreturn_init


Property changes on: trunk/devel/gdb/files/patch-gdb_nios2-linux-tdep.c
___________________________________________________________________
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
Added: trunk/devel/gdb/files/patch-gdb_ppc-linux-tdep.c
===================================================================
--- trunk/devel/gdb/files/patch-gdb_ppc-linux-tdep.c	                        (rev 0)
+++ trunk/devel/gdb/files/patch-gdb_ppc-linux-tdep.c	2018-11-26 17:06:28 UTC (rev 24716)
@@ -0,0 +1,50 @@
+--- gdb/ppc-linux-tdep.c.orig	2018-03-15 11:56:24.120083000 +0100
++++ gdb/ppc-linux-tdep.c	2018-03-15 11:57:57.568381000 +0100
+@@ -663,8 +663,8 @@
+   SIGTRAMP_FRAME,
+   4,
+   { 
+-    { 0x380000ac, -1 }, /* li r0, 172 */
+-    { 0x44000002, -1 }, /* sc */
++    { 0x380000ac, static_cast<ULONGEST>(-1) }, /* li r0, 172 */
++    { 0x44000002, static_cast<ULONGEST>(-1) }, /* sc */
+     { TRAMP_SENTINEL_INSN },
+   },
+   ppc32_linux_sigaction_cache_init
+@@ -673,9 +673,9 @@
+   SIGTRAMP_FRAME,
+   4,
+   {
+-    { 0x38210080, -1 }, /* addi r1,r1,128 */
+-    { 0x380000ac, -1 }, /* li r0, 172 */
+-    { 0x44000002, -1 }, /* sc */
++    { 0x38210080, static_cast<ULONGEST>(-1) }, /* addi r1,r1,128 */
++    { 0x380000ac, static_cast<ULONGEST>(-1) }, /* li r0, 172 */
++    { 0x44000002, static_cast<ULONGEST>(-1) }, /* sc */
+     { TRAMP_SENTINEL_INSN },
+   },
+   ppc64_linux_sigaction_cache_init
+@@ -684,8 +684,8 @@
+   SIGTRAMP_FRAME,
+   4,
+   { 
+-    { 0x38000077, -1 }, /* li r0,119 */
+-    { 0x44000002, -1 }, /* sc */
++    { 0x38000077, static_cast<ULONGEST>(-1) }, /* li r0,119 */
++    { 0x44000002, static_cast<ULONGEST>(-1) }, /* sc */
+     { TRAMP_SENTINEL_INSN },
+   },
+   ppc32_linux_sighandler_cache_init
+@@ -694,9 +694,9 @@
+   SIGTRAMP_FRAME,
+   4,
+   { 
+-    { 0x38210080, -1 }, /* addi r1,r1,128 */
+-    { 0x38000077, -1 }, /* li r0,119 */
+-    { 0x44000002, -1 }, /* sc */
++    { 0x38210080, static_cast<ULONGEST>(-1) }, /* addi r1,r1,128 */
++    { 0x38000077, static_cast<ULONGEST>(-1) }, /* li r0,119 */
++    { 0x44000002, static_cast<ULONGEST>(-1) }, /* sc */
+     { TRAMP_SENTINEL_INSN },
+   },
+   ppc64_linux_sighandler_cache_init


Property changes on: trunk/devel/gdb/files/patch-gdb_ppc-linux-tdep.c
___________________________________________________________________
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
Added: trunk/devel/gdb/files/patch-gdb_ppc-nbsd-tdep.c
===================================================================
--- trunk/devel/gdb/files/patch-gdb_ppc-nbsd-tdep.c	                        (rev 0)
+++ trunk/devel/gdb/files/patch-gdb_ppc-nbsd-tdep.c	2018-11-26 17:06:28 UTC (rev 24716)
@@ -0,0 +1,48 @@
+--- gdb/ppc-nbsd-tdep.c.orig	2018-03-15 13:48:32.041494000 +0100
++++ gdb/ppc-nbsd-tdep.c	2018-03-15 13:50:31.332926000 +0100
+@@ -137,14 +137,14 @@
+   SIGTRAMP_FRAME,
+   4,
+   {
+-    { 0x3821fff0, -1 },		/* add r1,r1,-16 */
+-    { 0x4e800021, -1 },		/* blrl */
+-    { 0x38610018, -1 },		/* addi r3,r1,24 */
+-    { 0x38000127, -1 },		/* li r0,295 */
+-    { 0x44000002, -1 },		/* sc */
+-    { 0x38000001, -1 },		/* li r0,1 */
+-    { 0x44000002, -1 },		/* sc */
+-    { TRAMP_SENTINEL_INSN, -1 }
++    { 0x3821fff0, static_cast<ULONGEST>(-1) },		/* add r1,r1,-16 */
++    { 0x4e800021, static_cast<ULONGEST>(-1) },		/* blrl */
++    { 0x38610018, static_cast<ULONGEST>(-1) },		/* addi r3,r1,24 */
++    { 0x38000127, static_cast<ULONGEST>(-1) },		/* li r0,295 */
++    { 0x44000002, static_cast<ULONGEST>(-1) },		/* sc */
++    { 0x38000001, static_cast<ULONGEST>(-1) },		/* li r0,1 */
++    { 0x44000002, static_cast<ULONGEST>(-1) },		/* sc */
++    { TRAMP_SENTINEL_INSN, static_cast<ULONGEST>(-1) }
+   },
+   ppcnbsd_sigtramp_cache_init
+ };
+@@ -156,14 +156,14 @@
+   SIGTRAMP_FRAME,
+   4,
+   {
+-    { 0x3821fff0, -1 },		/* add r1,r1,-16 */
+-    { 0x4e800021, -1 },		/* blrl */
+-    { 0x38610010, -1 },		/* addi r3,r1,16 */
+-    { 0x38000127, -1 },		/* li r0,295 */
+-    { 0x44000002, -1 },		/* sc */
+-    { 0x38000001, -1 },		/* li r0,1 */
+-    { 0x44000002, -1 },		/* sc */
+-    { TRAMP_SENTINEL_INSN, -1 }
++    { 0x3821fff0, static_cast<ULONGEST>(-1) },		/* add r1,r1,-16 */
++    { 0x4e800021, static_cast<ULONGEST>(-1) },		/* blrl */
++    { 0x38610010, static_cast<ULONGEST>(-1) },		/* addi r3,r1,16 */
++    { 0x38000127, static_cast<ULONGEST>(-1) },		/* li r0,295 */
++    { 0x44000002, static_cast<ULONGEST>(-1) },		/* sc */
++    { 0x38000001, static_cast<ULONGEST>(-1) },		/* li r0,1 */
++    { 0x44000002, static_cast<ULONGEST>(-1) },		/* sc */
++    { TRAMP_SENTINEL_INSN, static_cast<ULONGEST>(-1) }
+   },
+   ppcnbsd_sigtramp_cache_init
+ };


Property changes on: trunk/devel/gdb/files/patch-gdb_ppc-nbsd-tdep.c
___________________________________________________________________
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
Added: trunk/devel/gdb/files/patch-gdb_ppc64-tdep.c
===================================================================
--- trunk/devel/gdb/files/patch-gdb_ppc64-tdep.c	                        (rev 0)
+++ trunk/devel/gdb/files/patch-gdb_ppc64-tdep.c	2018-11-26 17:06:28 UTC (rev 24716)
@@ -0,0 +1,252 @@
+--- gdb/ppc64-tdep.c.orig	2018-03-15 16:02:11.651610000 +0100
++++ gdb/ppc64-tdep.c	2018-03-15 16:10:27.958608000 +0100
+@@ -30,24 +30,27 @@
+    you can use -1 to make masks.  */
+ 
+ #define insn_d(opcd, rts, ra, d)                \
++  static_cast<unsigned int>(                    \
+   ((((opcd) & 0x3f) << 26)                      \
+    | (((rts) & 0x1f) << 21)                     \
+    | (((ra) & 0x1f) << 16)                      \
+-   | ((d) & 0xffff))
++   | ((d) & 0xffff)))
+ 
+ #define insn_ds(opcd, rts, ra, d, xo)           \
++  static_cast<unsigned int>(                    \
+   ((((opcd) & 0x3f) << 26)                      \
+    | (((rts) & 0x1f) << 21)                     \
+    | (((ra) & 0x1f) << 16)                      \
+    | ((d) & 0xfffc)                             \
+-   | ((xo) & 0x3))
++   | ((xo) & 0x3)))
+ 
+ #define insn_xfx(opcd, rts, spr, xo)            \
++  static_cast<unsigned int>(                    \
+   ((((opcd) & 0x3f) << 26)                      \
+    | (((rts) & 0x1f) << 21)                     \
+    | (((spr) & 0x1f) << 16)                     \
+    | (((spr) & 0x3e0) << 6)                     \
+-   | (((xo) & 0x3ff) << 1))
++   | (((xo) & 0x3ff) << 1)))
+ 
+ /* PLT_OFF is the TOC-relative offset of a 64-bit PowerPC PLT entry.
+    Return the function's entry point.  */
+@@ -86,7 +89,7 @@
+     { insn_d (-1, -1, -1, 0), insn_d (15, 12, 2, 0), 0 },
+ 
+     /* std r2, 40(r1) */
+-    { -1, insn_ds (62, 2, 1, 40, 0), 0 },
++    { static_cast<unsigned int>(-1), insn_ds (62, 2, 1, 40, 0), 0 },
+ 
+     /* ld r11, <any>(r12) */
+     { insn_ds (-1, -1, -1, 0, -1), insn_ds (58, 11, 12, 0, 0), 0 },
+@@ -107,7 +110,7 @@
+     { insn_ds (-1, -1, -1, 0, -1), insn_ds (58, 11, 12, 0, 0), 1 },
+ 
+     /* bctr */
+-    { -1, 0x4e800420, 0 },
++    { static_cast<unsigned int>(-1), 0x4e800420, 0 },
+ 
+     { 0, 0, 0 }
+   };
+@@ -122,13 +125,13 @@
+ static struct ppc_insn_pattern ppc64_standard_linkage2[] =
+   {
+     /* std r2, 40(r1) <optional> */
+-    { -1, insn_ds (62, 2, 1, 40, 0), 1 },
++    { static_cast<unsigned int>(-1), insn_ds (62, 2, 1, 40, 0), 1 },
+ 
+     /* addis r12, r2, <any> */
+     { insn_d (-1, -1, -1, 0), insn_d (15, 12, 2, 0), 0 },
+ 
+     /* std r2, 40(r1) <optional> */
+-    { -1, insn_ds (62, 2, 1, 40, 0), 1 },
++    { static_cast<unsigned int>(-1), insn_ds (62, 2, 1, 40, 0), 1 },
+ 
+     /* ld r11, <any>(r12) */
+     { insn_ds (-1, -1, -1, 0, -1), insn_ds (58, 11, 12, 0, 0), 0 },
+@@ -140,10 +143,10 @@
+     { insn_xfx (-1, -1, -1, -1), insn_xfx (31, 11, 9, 467), 0 },
+ 
+     /* xor r11, r11, r11 <optional> */
+-    { -1, 0x7d6b5a78, 1 },
++    { static_cast<unsigned int>(-1), 0x7d6b5a78, 1 },
+ 
+     /* add r12, r12, r11 <optional> */
+-    { -1, 0x7d8c5a14, 1 },
++    { static_cast<unsigned int>(-1), 0x7d8c5a14, 1 },
+ 
+     /* ld r2, <any>(r12) */
+     { insn_ds (-1, -1, -1, 0, -1), insn_ds (58, 2, 12, 0, 0), 0 },
+@@ -152,10 +155,10 @@
+     { insn_ds (-1, -1, -1, 0, -1), insn_ds (58, 11, 12, 0, 0), 1 },
+ 
+     /* bctr <optional> */
+-    { -1, 0x4e800420, 1 },
++    { static_cast<unsigned int>(-1), 0x4e800420, 1 },
+ 
+     /* cmpldi r2, 0 <optional> */
+-    { -1, 0x28220000, 1 },
++    { static_cast<unsigned int>(-1), 0x28220000, 1 },
+ 
+     { 0, 0, 0 }
+   };
+@@ -165,7 +168,7 @@
+ static struct ppc_insn_pattern ppc64_standard_linkage3[] =
+   {
+     /* std r2, 40(r1) <optional> */
+-    { -1, insn_ds (62, 2, 1, 40, 0), 1 },
++    { static_cast<unsigned int>(-1), insn_ds (62, 2, 1, 40, 0), 1 },
+ 
+     /* ld r11, <any>(r2) */
+     { insn_ds (-1, -1, -1, 0, -1), insn_ds (58, 11, 2, 0, 0), 0 },
+@@ -177,10 +180,10 @@
+     { insn_xfx (-1, -1, -1, -1), insn_xfx (31, 11, 9, 467), 0 },
+ 
+     /* xor r11, r11, r11 <optional> */
+-    { -1, 0x7d6b5a78, 1 },
++    { static_cast<unsigned int>(-1), 0x7d6b5a78, 1 },
+ 
+     /* add r2, r2, r11 <optional> */
+-    { -1, 0x7c425a14, 1 },
++    { static_cast<unsigned int>(-1), 0x7c425a14, 1 },
+ 
+     /* ld r11, <any>(r2) <optional> */
+     { insn_ds (-1, -1, -1, 0, -1), insn_ds (58, 11, 2, 0, 0), 1 },
+@@ -189,10 +192,10 @@
+     { insn_ds (-1, -1, -1, 0, -1), insn_ds (58, 2, 2, 0, 0), 0 },
+ 
+     /* bctr <optional> */
+-    { -1, 0x4e800420, 1 },
++    { static_cast<unsigned int>(-1), 0x4e800420, 1 },
+ 
+     /* cmpldi r2, 0 <optional> */
+-    { -1, 0x28220000, 1 },
++    { static_cast<unsigned int>(-1), 0x28220000, 1 },
+ 
+     { 0, 0, 0 }
+   };
+@@ -204,7 +207,7 @@
+ static struct ppc_insn_pattern ppc64_standard_linkage4[] =
+   {
+     /* std r2, 40(r1) <optional> */
+-    { -1, insn_ds (62, 2, 1, 40, 0), 1 },
++    { static_cast<unsigned int>(-1), insn_ds (62, 2, 1, 40, 0), 1 },
+ 
+     /* addis r11, r2, <any> */
+     { insn_d (-1, -1, -1, 0), insn_d (15, 11, 2, 0), 0 },
+@@ -219,10 +222,10 @@
+     { insn_xfx (-1, -1, -1, -1), insn_xfx (31, 12, 9, 467), 0 },
+ 
+     /* xor r2, r12, r12 <optional> */
+-    { -1, 0x7d826278, 1 },
++    { static_cast<unsigned int>(-1), 0x7d826278, 1 },
+ 
+     /* add r11, r11, r2 <optional> */
+-    { -1, 0x7d6b1214, 1 },
++    { static_cast<unsigned int>(-1), 0x7d6b1214, 1 },
+ 
+     /* ld r2, <any>(r11) */
+     { insn_ds (-1, -1, -1, 0, -1), insn_ds (58, 2, 11, 0, 0), 0 },
+@@ -231,10 +234,10 @@
+     { insn_ds (-1, -1, -1, 0, -1), insn_ds (58, 11, 11, 0, 0), 1 },
+ 
+     /* bctr <optional> */
+-    { -1, 0x4e800420, 1 },
++    { static_cast<unsigned int>(-1), 0x4e800420, 1 },
+ 
+     /* cmpldi r2, 0 <optional> */
+-    { -1, 0x28220000, 1 },
++    { static_cast<unsigned int>(-1), 0x28220000, 1 },
+ 
+     { 0, 0, 0 }
+   };
+@@ -246,7 +249,7 @@
+ static struct ppc_insn_pattern ppc64_standard_linkage5[] =
+   {
+     /* std r2, 40(r1) <optional> */
+-    { -1, insn_ds (62, 2, 1, 40, 0), 1 },
++    { static_cast<unsigned int>(-1), insn_ds (62, 2, 1, 40, 0), 1 },
+ 
+     /* ld r12, <any>(r2) */
+     { insn_ds (-1, -1, -1, 0, -1), insn_ds (58, 12, 2, 0, 0), 0 },
+@@ -258,10 +261,10 @@
+     { insn_xfx (-1, -1, -1, -1), insn_xfx (31, 12, 9, 467), 0 },
+ 
+     /* xor r11, r12, r12 <optional> */
+-    { -1, 0x7d8b6278, 1 },
++    { static_cast<unsigned int>(-1), 0x7d8b6278, 1 },
+ 
+     /* add r2, r2, r11 <optional> */
+-    { -1, 0x7c425a14, 1 },
++    { static_cast<unsigned int>(-1), 0x7c425a14, 1 },
+ 
+     /* ld r11, <any>(r2) <optional> */
+     { insn_ds (-1, -1, -1, 0, -1), insn_ds (58, 11, 2, 0, 0), 1 },
+@@ -270,10 +273,10 @@
+     { insn_ds (-1, -1, -1, 0, -1), insn_ds (58, 2, 2, 0, 0), 0 },
+ 
+     /* bctr <optional> */
+-    { -1, 0x4e800420, 1 },
++    { static_cast<unsigned int>(-1), 0x4e800420, 1 },
+ 
+     /* cmpldi r2, 0 <optional> */
+-    { -1, 0x28220000, 1 },
++    { static_cast<unsigned int>(-1), 0x28220000, 1 },
+ 
+     { 0, 0, 0 }
+   };
+@@ -283,7 +286,7 @@
+ static struct ppc_insn_pattern ppc64_standard_linkage6[] =
+   {
+     /* std r2, 24(r1) <optional> */
+-    { -1, insn_ds (62, 2, 1, 24, 0), 1 },
++    { static_cast<unsigned int>(-1), insn_ds (62, 2, 1, 24, 0), 1 },
+ 
+     /* addis r11, r2, <any> */
+     { insn_d (-1, -1, -1, 0), insn_d (15, 11, 2, 0), 0 },
+@@ -295,7 +298,7 @@
+     { insn_xfx (-1, -1, -1, -1), insn_xfx (31, 12, 9, 467), 0 },
+ 
+     /* bctr */
+-    { -1, 0x4e800420, 0 },
++    { static_cast<unsigned int>(-1), 0x4e800420, 0 },
+ 
+     { 0, 0, 0 }
+   };
+@@ -305,7 +308,7 @@
+ static struct ppc_insn_pattern ppc64_standard_linkage7[] =
+   {
+     /* std r2, 24(r1) <optional> */
+-    { -1, insn_ds (62, 2, 1, 24, 0), 1 },
++    { static_cast<unsigned int>(-1), insn_ds (62, 2, 1, 24, 0), 1 },
+ 
+     /* ld r12, <any>(r2) */
+     { insn_ds (-1, -1, -1, 0, -1), insn_ds (58, 12, 2, 0, 0), 0 },
+@@ -314,7 +317,7 @@
+     { insn_xfx (-1, -1, -1, -1), insn_xfx (31, 12, 9, 467), 0 },
+ 
+     /* bctr */
+-    { -1, 0x4e800420, 0 },
++    { static_cast<unsigned int>(-1), 0x4e800420, 0 },
+ 
+     { 0, 0, 0 }
+   };
+@@ -325,7 +328,7 @@
+ static struct ppc_insn_pattern ppc64_standard_linkage8[] =
+   {
+     /* std r2, 24(r1) <optional> */
+-    { -1, insn_ds (62, 2, 1, 24, 0), 1 },
++    { static_cast<unsigned int>(-1), insn_ds (62, 2, 1, 24, 0), 1 },
+ 
+     /* addis r12, r2, <any> */
+     { insn_d (-1, -1, -1, 0), insn_d (15, 12, 2, 0), 0 },
+@@ -337,7 +340,7 @@
+     { insn_xfx (-1, -1, -1, -1), insn_xfx (31, 12, 9, 467), 0 },
+ 
+     /* bctr */
+-    { -1, 0x4e800420, 0 },
++    { static_cast<unsigned int>(-1), 0x4e800420, 0 },
+ 
+     { 0, 0, 0 }
+   };


Property changes on: trunk/devel/gdb/files/patch-gdb_ppc64-tdep.c
___________________________________________________________________
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
Added: trunk/devel/gdb/files/patch-gdb_python_python-config.py
===================================================================
--- trunk/devel/gdb/files/patch-gdb_python_python-config.py	                        (rev 0)
+++ trunk/devel/gdb/files/patch-gdb_python_python-config.py	2018-11-26 17:06:28 UTC (rev 24716)
@@ -0,0 +1,11 @@
+--- gdb/python/python-config.py 2017-09-14 09:28:17 UTC
++++ gdb/python/python-config.py
+@@ -59,6 +59,8 @@ for opt in opt_flags:
+ 
+     elif opt in ('--libs', '--ldflags'):
+         libs = ['-lpython' + pyver + abiflags]
++        if getvar('LDFLAGS') is not None:
++            libs.extend(getvar('LDFLAGS').split())
+         if getvar('LIBS') is not None:
+             libs.extend(getvar('LIBS').split())
+         if getvar('SYSLIBS') is not None:


Property changes on: trunk/devel/gdb/files/patch-gdb_python_python-config.py
___________________________________________________________________
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
Added: trunk/devel/gdb/files/patch-gdb_rs6000-tdep.c
===================================================================
--- trunk/devel/gdb/files/patch-gdb_rs6000-tdep.c	                        (rev 0)
+++ trunk/devel/gdb/files/patch-gdb_rs6000-tdep.c	2018-11-26 17:06:28 UTC (rev 24716)
@@ -0,0 +1,11 @@
+--- gdb/rs6000-tdep.c.orig	2018-03-15 16:11:47.189448000 +0100
++++ gdb/rs6000-tdep.c	2018-03-15 16:12:36.114973000 +0100
+@@ -1173,7 +1173,7 @@
+   struct gdbarch *gdbarch = regcache->arch ();
+   enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
+   CORE_ADDR pc = regcache_read_pc (regcache);
+-  CORE_ADDR breaks[2] = {-1, -1};
++  CORE_ADDR breaks[2] = {static_cast<CORE_ADDR>(-1),static_cast<CORE_ADDR>(-1)};
+   CORE_ADDR loc = pc;
+   CORE_ADDR closing_insn; /* Instruction that closes the atomic sequence.  */
+   int insn = read_memory_integer (loc, PPC_INSN_SIZE, byte_order);


Property changes on: trunk/devel/gdb/files/patch-gdb_rs6000-tdep.c
___________________________________________________________________
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
Added: trunk/devel/gdb/files/patch-gdb_sparc-linux-tdep.c
===================================================================
--- trunk/devel/gdb/files/patch-gdb_sparc-linux-tdep.c	                        (rev 0)
+++ trunk/devel/gdb/files/patch-gdb_sparc-linux-tdep.c	2018-11-26 17:06:28 UTC (rev 24716)
@@ -0,0 +1,28 @@
+--- gdb/sparc-linux-tdep.c.orig	2018-03-15 16:27:40.393176000 +0100
++++ gdb/sparc-linux-tdep.c	2018-03-15 16:29:00.339581000 +0100
+@@ -68,9 +68,9 @@
+   SIGTRAMP_FRAME,
+   4,
+   {
+-    { 0x821020d8, -1 },		/* mov __NR_sugreturn, %g1 */
+-    { 0x91d02010, -1 },		/* ta  0x10 */
+-    { TRAMP_SENTINEL_INSN, -1 }
++    { 0x821020d8, static_cast<ULONGEST>(-1) },		/* mov __NR_sugreturn, %g1 */
++    { 0x91d02010, static_cast<ULONGEST>(-1) },		/* ta  0x10 */
++    { TRAMP_SENTINEL_INSN, static_cast<ULONGEST>(-1) }
+   },
+   sparc32_linux_sigframe_init
+ };
+@@ -83,9 +83,9 @@
+   SIGTRAMP_FRAME,
+   4,
+   {
+-    { 0x82102065, -1 },		/* mov __NR_rt_sigreturn, %g1 */
+-    { 0x91d02010, -1 },		/* ta  0x10 */
+-    { TRAMP_SENTINEL_INSN, -1 }
++    { 0x82102065, static_cast<ULONGEST>(-1) },		/* mov __NR_rt_sigreturn, %g1 */
++    { 0x91d02010, static_cast<ULONGEST>(-1) },		/* ta  0x10 */
++    { TRAMP_SENTINEL_INSN, static_cast<ULONGEST>(-1) }
+   },
+   sparc32_linux_sigframe_init
+ };


Property changes on: trunk/devel/gdb/files/patch-gdb_sparc-linux-tdep.c
___________________________________________________________________
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
Added: trunk/devel/gdb/files/patch-gdb_sparc64-linux-tdep.c
===================================================================
--- trunk/devel/gdb/files/patch-gdb_sparc64-linux-tdep.c	                        (rev 0)
+++ trunk/devel/gdb/files/patch-gdb_sparc64-linux-tdep.c	2018-11-26 17:06:28 UTC (rev 24716)
@@ -0,0 +1,15 @@
+--- gdb/sparc64-linux-tdep.c.orig	2018-03-15 16:48:31.376247000 +0100
++++ gdb/sparc64-linux-tdep.c	2018-03-15 16:49:05.405119000 +0100
+@@ -64,9 +64,9 @@
+   SIGTRAMP_FRAME,
+   4,
+   {
+-    { 0x82102065, -1 },		/* mov __NR_rt_sigreturn, %g1 */
+-    { 0x91d0206d, -1 },		/* ta  0x6d */
+-    { TRAMP_SENTINEL_INSN, -1 }
++    { 0x82102065, static_cast<ULONGEST>(-1) },		/* mov __NR_rt_sigreturn, %g1 */
++    { 0x91d0206d, static_cast<ULONGEST>(-1) },		/* ta  0x6d */
++    { TRAMP_SENTINEL_INSN, static_cast<ULONGEST>(-1) }
+   },
+   sparc64_linux_sigframe_init
+ };


Property changes on: trunk/devel/gdb/files/patch-gdb_sparc64-linux-tdep.c
___________________________________________________________________
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
Added: trunk/devel/gdb/files/patch-gdb_tick6x-linux-tdep.c
===================================================================
--- trunk/devel/gdb/files/patch-gdb_tick6x-linux-tdep.c	                        (rev 0)
+++ trunk/devel/gdb/files/patch-gdb_tick6x-linux-tdep.c	2018-11-26 17:06:28 UTC (rev 24716)
@@ -0,0 +1,11 @@
+--- gdb/tic6x-linux-tdep.c.orig	2018-03-15 16:29:54.131451000 +0100
++++ gdb/tic6x-linux-tdep.c	2018-03-15 16:30:19.640674000 +0100
+@@ -137,7 +137,7 @@
+   4,
+   {
+     {0x000045aa, 0x0fffffff},	/* mvk .S2 139,b0 */
+-    {0x10000000, -1},		/* swe */
++    {0x10000000, static_cast<ULONGEST>(-1)},		/* swe */
+     {TRAMP_SENTINEL_INSN}
+   },
+   tic6x_linux_rt_sigreturn_init


Property changes on: trunk/devel/gdb/files/patch-gdb_tick6x-linux-tdep.c
___________________________________________________________________
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
Added: trunk/devel/gdb/files/patch-gdb_tilegx-linux-tdep.c
===================================================================
--- trunk/devel/gdb/files/patch-gdb_tilegx-linux-tdep.c	                        (rev 0)
+++ trunk/devel/gdb/files/patch-gdb_tilegx-linux-tdep.c	2018-11-26 17:06:28 UTC (rev 24716)
@@ -0,0 +1,15 @@
+--- gdb/tilegx-linux-tdep.c.orig	2018-03-15 16:31:44.623131000 +0100
++++ gdb/tilegx-linux-tdep.c	2018-03-15 16:32:29.603585000 +0100
+@@ -65,9 +65,9 @@
+   SIGTRAMP_FRAME,
+   8,
+   {
+-    { 0x00045fe551483000ULL, -1 }, /* { moveli r10, 139 } */
+-    { 0x286b180051485000ULL, -1 }, /* { swint1 } */
+-    { TRAMP_SENTINEL_INSN, -1 }
++    { 0x00045fe551483000ULL, static_cast<ULONGEST>(-1) }, /* { moveli r10, 139 } */
++    { 0x286b180051485000ULL, static_cast<ULONGEST>(-1) }, /* { swint1 } */
++    { TRAMP_SENTINEL_INSN, static_cast<ULONGEST>(-1) }
+   },
+   tilegx_linux_sigframe_init
+ };


Property changes on: trunk/devel/gdb/files/patch-gdb_tilegx-linux-tdep.c
___________________________________________________________________
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
Added: trunk/devel/gdb/files/patch-gdb_tramp-frame.h
===================================================================
--- trunk/devel/gdb/files/patch-gdb_tramp-frame.h	                        (rev 0)
+++ trunk/devel/gdb/files/patch-gdb_tramp-frame.h	2018-11-26 17:06:28 UTC (rev 24716)
@@ -0,0 +1,11 @@
+--- gdb/tramp-frame.h.orig	2018-03-15 10:38:21.385046000 +0100
++++ gdb/tramp-frame.h	2018-03-15 10:38:49.942224000 +0100
+@@ -41,7 +41,7 @@
+ 
+ /* Magic instruction that to mark the end of the signal trampoline
+    instruction sequence.  */
+-#define TRAMP_SENTINEL_INSN ((LONGEST) -1)
++#define TRAMP_SENTINEL_INSN ((ULONGEST) -1)
+ 
+ struct tramp_frame
+ {


Property changes on: trunk/devel/gdb/files/patch-gdb_tramp-frame.h
___________________________________________________________________
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
Added: trunk/devel/gdb/files/patch-gdb_xtensa-tdep.h
===================================================================
--- trunk/devel/gdb/files/patch-gdb_xtensa-tdep.h	                        (rev 0)
+++ trunk/devel/gdb/files/patch-gdb_xtensa-tdep.h	2018-11-26 17:06:28 UTC (rev 24716)
@@ -0,0 +1,20 @@
+--- gdb/xtensa-tdep.h.orig	2018-03-15 16:33:53.194056000 +0100
++++ gdb/xtensa-tdep.h	2018-03-15 16:37:44.151472000 +0100
+@@ -130,7 +130,7 @@
+ 	 ct, bsz, sz, al, tnum, flg, cp, mas, fet, sto},
+ #define XTREG_END \
+   {0, 0, (xtensa_register_type_t) 0, (xtensa_register_group_t) 0,	\
+-   0, 0, 0, 0, -1, 0, 0, 0, 0, 0},
++   0, 0, 0, 0, static_cast<unsigned int>(-1), 0, 0, 0, 0, 0},
+ 
+ #define XTENSA_REGISTER_FLAGS_PRIVILEGED	0x0001
+ #define XTENSA_REGISTER_FLAGS_READABLE		0x0002
+@@ -228,7 +228,7 @@
+ #define XTENSA_GDBARCH_TDEP_INSTANTIATE(rmap,spillsz)			\
+   {									\
+     0,				/* target_flags */			\
+-    -1,				/* spill_location */			\
++    static_cast<unsigned int>(-1),	/* spill_location */			\
+     (spillsz),			/* spill_size */			\
+     0,				/* unused */				\
+     (XSHAL_ABI == XTHAL_ABI_CALL0					\


Property changes on: trunk/devel/gdb/files/patch-gdb_xtensa-tdep.h
___________________________________________________________________
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
Added: trunk/devel/gdb/files/patch-include_libiberty.h
===================================================================
--- trunk/devel/gdb/files/patch-include_libiberty.h	                        (rev 0)
+++ trunk/devel/gdb/files/patch-include_libiberty.h	2018-11-26 17:06:28 UTC (rev 24716)
@@ -0,0 +1,11 @@
+--- include/libiberty.h 2017-09-14 09:28:17 UTC
++++ include/libiberty.h
+@@ -109,7 +109,7 @@
+  || defined (__FreeBSD__) || defined (__OpenBSD__) || defined (__NetBSD__) \
+  || defined (__CYGWIN__) || defined (__CYGWIN32__) || defined (__MINGW32__) \
+  || defined (__DragonFly__) || defined (HAVE_DECL_BASENAME) 
+-extern char *basename (const char *) ATTRIBUTE_RETURNS_NONNULL ATTRIBUTE_NONNULL(1);
++#include <libgen.h>
+ #else
+ /* Do not allow basename to be used if there is no prototype seen.  We
+    either need to use the above prototype or have one from


Property changes on: trunk/devel/gdb/files/patch-include_libiberty.h
___________________________________________________________________
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
Added: trunk/devel/gdb/files/patch-libiberty_configure
===================================================================
--- trunk/devel/gdb/files/patch-libiberty_configure	                        (rev 0)
+++ trunk/devel/gdb/files/patch-libiberty_configure	2018-11-26 17:06:28 UTC (rev 24716)
@@ -0,0 +1,12 @@
+--- libiberty/configure.orig	2017-09-12 12:10:11 UTC
++++ libiberty/configure
+@@ -4398,8 +4398,7 @@
+ ac_libiberty_warn_cflags=
+ save_CFLAGS="$CFLAGS"
+ for real_option in -W -Wall -Wwrite-strings -Wc++-compat \
+-			  -Wstrict-prototypes \
+-			  -Wshadow=local; do
++			  -Wstrict-prototypes ; do
+   # Do the check with the no- prefix removed since gcc silently
+   # accepts any -Wno-* option on purpose
+   case $real_option in


Property changes on: trunk/devel/gdb/files/patch-libiberty_configure
___________________________________________________________________
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
Deleted: trunk/devel/gdb/files/patch-opcodes-cr16-opc.c
===================================================================
--- trunk/devel/gdb/files/patch-opcodes-cr16-opc.c	2018-11-26 17:02:39 UTC (rev 24715)
+++ trunk/devel/gdb/files/patch-opcodes-cr16-opc.c	2018-11-26 17:06:28 UTC (rev 24716)
@@ -1,65 +0,0 @@
---- opcodes/cr16-opc.c.orig	2013-03-07 10:34:48.000000000 +0100
-+++ opcodes/cr16-opc.c	2013-03-07 10:33:49.000000000 +0100
-@@ -502,36 +502,36 @@
- const reg_entry cr16_pregtab[] =
- {
- /* Build a processor register.  */
--  REG(dbs,   0x0, CR16_P_REGTYPE),
--  REG(dsr,   0x1, CR16_P_REGTYPE),
--  REG(dcrl,  0x2, CR16_P_REGTYPE),
--  REG(dcrh,  0x3, CR16_P_REGTYPE),
--  REG(car0l, 0x4, CR16_P_REGTYPE),
--  REG(car0h, 0x5, CR16_P_REGTYPE),
--  REG(car1l, 0x6, CR16_P_REGTYPE),
--  REG(car1h, 0x7, CR16_P_REGTYPE),
--  REG(cfg,   0x8, CR16_P_REGTYPE),
--  REG(psr,   0x9, CR16_P_REGTYPE),
--  REG(intbasel, 0xa, CR16_P_REGTYPE),
--  REG(intbaseh, 0xb, CR16_P_REGTYPE),
--  REG(ispl,  0xc, CR16_P_REGTYPE),
--  REG(isph,  0xd, CR16_P_REGTYPE),
--  REG(uspl,  0xe, CR16_P_REGTYPE),
--  REG(usph,  0xf, CR16_P_REGTYPE),
-+  REG((reg)dbs,   0x0, CR16_P_REGTYPE),
-+  REG((reg)dsr,   0x1, CR16_P_REGTYPE),
-+  REG((reg)dcrl,  0x2, CR16_P_REGTYPE),
-+  REG((reg)dcrh,  0x3, CR16_P_REGTYPE),
-+  REG((reg)car0l, 0x4, CR16_P_REGTYPE),
-+  REG((reg)car0h, 0x5, CR16_P_REGTYPE),
-+  REG((reg)car1l, 0x6, CR16_P_REGTYPE),
-+  REG((reg)car1h, 0x7, CR16_P_REGTYPE),
-+  REG((reg)cfg,   0x8, CR16_P_REGTYPE),
-+  REG((reg)psr,   0x9, CR16_P_REGTYPE),
-+  REG((reg)intbasel, 0xa, CR16_P_REGTYPE),
-+  REG((reg)intbaseh, 0xb, CR16_P_REGTYPE),
-+  REG((reg)ispl,  0xc, CR16_P_REGTYPE),
-+  REG((reg)isph,  0xd, CR16_P_REGTYPE),
-+  REG((reg)uspl,  0xe, CR16_P_REGTYPE),
-+  REG((reg)usph,  0xf, CR16_P_REGTYPE),
- };
- 
- const reg_entry cr16_pregptab[] =
- {
--  REG(dbs,   0, CR16_P_REGTYPE),
--  REG(dsr,   1, CR16_P_REGTYPE),
--  REG(dcr,   2, CR16_P_REGTYPE),
--  REG(car0,  4, CR16_P_REGTYPE),
--  REG(car1,  6, CR16_P_REGTYPE),
--  REG(cfg,   8, CR16_P_REGTYPE),
--  REG(psr,   9, CR16_P_REGTYPE),
--  REG(intbase, 10, CR16_P_REGTYPE),
--  REG(isp,   12, CR16_P_REGTYPE),
--  REG(usp,   14, CR16_P_REGTYPE),
-+  REG((reg)dbs,   0, CR16_P_REGTYPE),
-+  REG((reg)dsr,   1, CR16_P_REGTYPE),
-+  REG((reg)dcr,   2, CR16_P_REGTYPE),
-+  REG((reg)car0,  4, CR16_P_REGTYPE),
-+  REG((reg)car1,  6, CR16_P_REGTYPE),
-+  REG((reg)cfg,   8, CR16_P_REGTYPE),
-+  REG((reg)psr,   9, CR16_P_REGTYPE),
-+  REG((reg)intbase, 10, CR16_P_REGTYPE),
-+  REG((reg)isp,   12, CR16_P_REGTYPE),
-+  REG((reg)usp,   14, CR16_P_REGTYPE),
- };
- 
- const unsigned int cr16_num_pregs =  ARRAY_SIZE (cr16_pregtab);

Deleted: trunk/devel/gdb/files/patch-opcodes-crx-opc.c
===================================================================
--- trunk/devel/gdb/files/patch-opcodes-crx-opc.c	2018-11-26 17:02:39 UTC (rev 24715)
+++ trunk/devel/gdb/files/patch-opcodes-crx-opc.c	2018-11-26 17:06:28 UTC (rev 24716)
@@ -1,20 +0,0 @@
---- opcodes/crx-opc.c.orig	2013-03-07 10:35:06.000000000 +0100
-+++ opcodes/crx-opc.c	2013-03-07 10:40:31.000000000 +0100
-@@ -632,7 +632,7 @@
- const reg_entry crx_copregtab[] =
- {
- /* Build a Coprocessor register c<N>.  */
--#define REG_C(N)    REG(CONCAT2(c,N), N, CRX_C_REGTYPE)
-+#define REG_C(N)    REG((reg)CONCAT2(c,N), N, CRX_C_REGTYPE)
- 
-   REG_C(0),  REG_C(1),	REG_C(2),  REG_C(3),
-   REG_C(4),  REG_C(5),	REG_C(6),  REG_C(7),
-@@ -640,7 +640,7 @@
-   REG_C(12), REG_C(13), REG_C(14), REG_C(15),
- 
- /* Build a Coprocessor Special register cs<N>.  */
--#define REG_CS(N)    REG(CONCAT2(cs,N), N, CRX_CS_REGTYPE)
-+#define REG_CS(N)    REG((reg)CONCAT2(cs,N), N, CRX_CS_REGTYPE)
- 
-   REG_CS(0),  REG_CS(1),  REG_CS(2),  REG_CS(3),
-   REG_CS(4),  REG_CS(5),  REG_CS(6),  REG_CS(7),

Deleted: trunk/devel/gdb/files/patch-opcodes-i386-dis.c
===================================================================
--- trunk/devel/gdb/files/patch-opcodes-i386-dis.c	2018-11-26 17:02:39 UTC (rev 24715)
+++ trunk/devel/gdb/files/patch-opcodes-i386-dis.c	2018-11-26 17:06:28 UTC (rev 24716)
@@ -1,59 +0,0 @@
---- opcodes/i386-dis.c.orig	2012-07-16 14:58:29.000000000 +0200
-+++ opcodes/i386-dis.c	2012-12-18 15:22:10.000000000 +0100
-@@ -11991,7 +11991,7 @@
- static void
- OP_ST (int bytemode ATTRIBUTE_UNUSED, int sizeflag ATTRIBUTE_UNUSED)
- {
--  oappend ("%st" + intel_syntax);
-+  oappend (&"%st"[(short)intel_syntax]);
- }
- 
- static void
-@@ -12520,32 +12520,32 @@
-   if (prefixes & PREFIX_CS)
-     {
-       used_prefixes |= PREFIX_CS;
--      oappend ("%cs:" + intel_syntax);
-+      oappend (&"%cs:"[(short)intel_syntax]);
-     }
-   if (prefixes & PREFIX_DS)
-     {
-       used_prefixes |= PREFIX_DS;
--      oappend ("%ds:" + intel_syntax);
-+      oappend (&"%ds:"[(short)intel_syntax]);
-     }
-   if (prefixes & PREFIX_SS)
-     {
-       used_prefixes |= PREFIX_SS;
--      oappend ("%ss:" + intel_syntax);
-+      oappend (&"%ss:"[(short)intel_syntax]);
-     }
-   if (prefixes & PREFIX_ES)
-     {
-       used_prefixes |= PREFIX_ES;
--      oappend ("%es:" + intel_syntax);
-+      oappend (&"%es:"[(short)intel_syntax]);
-     }
-   if (prefixes & PREFIX_FS)
-     {
-       used_prefixes |= PREFIX_FS;
--      oappend ("%fs:" + intel_syntax);
-+      oappend (&"%fs:"[(short)intel_syntax]);
-     }
-   if (prefixes & PREFIX_GS)
-     {
-       used_prefixes |= PREFIX_GS;
--      oappend ("%gs:" + intel_syntax);
-+      oappend (&"%gs:"[(short)intel_syntax]);
-     }
- }
- 
-@@ -13876,7 +13876,7 @@
- 	  intel_operand_size (b_mode, sizeflag);
- 	}
-     }
--  oappend ("%es:" + intel_syntax);
-+  oappend (&"%es:"[(short)intel_syntax]);
-   ptr_reg (code, sizeflag);
- }
- 

Deleted: trunk/devel/gdb/files/patch-opcodes-ia64-asmtab.c
===================================================================
--- trunk/devel/gdb/files/patch-opcodes-ia64-asmtab.c	2018-11-26 17:02:39 UTC (rev 24715)
+++ trunk/devel/gdb/files/patch-opcodes-ia64-asmtab.c	2018-11-26 17:06:28 UTC (rev 24716)
@@ -1,37 +0,0 @@
---- opcodes/ia64-asmtab.c.orig	2013-04-28 14:55:03.000000000 +0200
-+++ opcodes/ia64-asmtab.c	2013-04-28 14:56:48.000000000 +0200
-@@ -102,7 +102,7 @@
-   { "CPUID#", 7, 0, 5, -1, NULL, },
-   { "CR[CMCV]", 29, 0, 3, 74, NULL, },
-   { "CR[DCR]", 29, 0, 3, 0, NULL, },
--  { "CR[EOI]", 29, 0, 7, 67, "SC Section 5.8.3.4, \"End of External Interrupt Register (EOI \xD0 CR67)\" on page 2:119", },
-+  { "CR[EOI]", 29, 0, 7, 67, "SC Section 5.8.3.4, \"End of External Interrupt Register (EOI CR67)\" on page 2:119", },
-   { "CR[GPTA]", 29, 0, 3, 9, NULL, },
-   { "CR[IFA]", 29, 0, 1, 20, NULL, },
-   { "CR[IFA]", 29, 0, 3, 20, NULL, },
-@@ -124,13 +124,13 @@
-   { "CR[ITM]", 29, 0, 3, 1, NULL, },
-   { "CR[ITV]", 29, 0, 3, 72, NULL, },
-   { "CR[IVA]", 29, 0, 4, 2, NULL, },
--  { "CR[IVR]", 29, 0, 7, 65, "SC Section 5.8.3.2, \"External Interrupt Vector Register (IVR \xD0 CR65)\" on page 2:118", },
--  { "CR[LID]", 29, 0, 7, 64, "SC Section 5.8.3.1, \"Local ID (LID \xD0 CR64)\" on page 2:117", },
-+  { "CR[IVR]", 29, 0, 7, 65, "SC Section 5.8.3.2, \"External Interrupt Vector Register (IVR CR65)\" on page 2:118", },
-+  { "CR[LID]", 29, 0, 7, 64, "SC Section 5.8.3.1, \"Local ID (LID CR64)\" on page 2:117", },
-   { "CR[LRR%], % in 0 - 1", 10, 0, 3, -1, NULL, },
-   { "CR[PMV]", 29, 0, 3, 73, NULL, },
-   { "CR[PTA]", 29, 0, 3, 8, NULL, },
-   { "CR[TPR]", 29, 0, 3, 66, NULL, },
--  { "CR[TPR]", 29, 0, 7, 66, "SC Section 5.8.3.3, \"Task Priority Register (TPR \xD0 CR66)\" on page 2:119", },
-+  { "CR[TPR]", 29, 0, 7, 66, "SC Section 5.8.3.3, \"Task Priority Register (TPR  CR66)\" on page 2:119", },
-   { "CR[TPR]", 29, 0, 1, 66, NULL, },
-   { "CR%, % in 3-7, 10-15, 18, 28-63, 75-79, 82-127", 11, 0, 0, -1, NULL, },
-   { "DAHR%, % in 0-7", 12, 0, 1, -1, NULL, },
-@@ -305,7 +305,7 @@
-   { "CPUID#", 7, 1, 0, -1, NULL, },
-   { "CR[CMCV]", 29, 1, 2, 74, NULL, },
-   { "CR[DCR]", 29, 1, 2, 0, NULL, },
--  { "CR[EOI]", 29, 1, 7, 67, "SC Section 5.8.3.4, \"End of External Interrupt Register (EOI \xD0 CR67)\" on page 2:119", },
-+  { "CR[EOI]", 29, 1, 7, 67, "SC Section 5.8.3.4, \"End of External Interrupt Register (EOI CR67)\" on page 2:119", },
-   { "CR[GPTA]", 29, 1, 2, 9, NULL, },
-   { "CR[IFA]", 29, 1, 2, 20, NULL, },
-   { "CR[IFS]", 29, 1, 2, 23, NULL, },

Deleted: trunk/devel/gdb/files/patch-opcodes-v850-dis.c
===================================================================
--- trunk/devel/gdb/files/patch-opcodes-v850-dis.c	2018-11-26 17:02:39 UTC (rev 24715)
+++ trunk/devel/gdb/files/patch-opcodes-v850-dis.c	2018-11-26 17:06:28 UTC (rev 24716)
@@ -1,20 +0,0 @@
---- opcodes/v850-dis.c.orig	2013-01-24 12:14:05.000000000 +0100
-+++ opcodes/v850-dis.c	2013-04-29 10:10:25.000000000 +0200
-@@ -73,7 +73,7 @@
-   "chbwbd", "cibid", "cibiwbd", "cibwbd", "cfald", "cistd", "cildd"
- };
- 
--static const int const v850_cacheop_codes[] =
-+static const int v850_cacheop_codes[] =
- {
-   0x00, 0x20, 0x40, 0x60, 0x61, 0x04, 0x06,
-   0x07, 0x24, 0x26, 0x27, 0x44, 0x64, 0x65, -1
-@@ -82,7 +82,7 @@
- static const char *const v850_prefop_names[] =
- { "prefi", "prefd" };
- 
--static const int const v850_prefop_codes[] =
-+static const int v850_prefop_codes[] =
- { 0x00, 0x04, -1};
- 
- static void

Modified: trunk/devel/gdb/files/patch-unified
===================================================================
--- trunk/devel/gdb/files/patch-unified	2018-11-26 17:02:39 UTC (rev 24715)
+++ trunk/devel/gdb/files/patch-unified	2018-11-26 17:06:28 UTC (rev 24716)
@@ -1,24 +1,15 @@
---- gdb/gdb.c	Thu Feb 13 13:07:24 2003
-+++ gdb/gdb.c	Wed May 17 00:24:39 2006
-@@ -23,4 +23,5 @@
- #include "gdb_string.h"
- #include "interps.h"
-+#include <libgen.h>
- 
- int
-@@ -31,6 +32,14 @@
+--- gdb/gdb.c.orig 2017-09-14 09:28:17 UTC
++++ gdb/gdb.c
+@@ -28,6 +28,12 @@ main (int argc, char **argv)
+   memset (&args, 0, sizeof args);
    args.argc = argc;
    args.argv = argv;
--  args.use_windows = 0;
 -  args.interpreter_p = INTERP_CONSOLE;
 +  if (strncmp(basename(argv[0]), "insight", 7) == 0) {
-+    args.use_windows = 1;
 +    args.interpreter_p = "insight";
 +  } else if (strncmp(basename(argv[0]), "gdbtui", 6) == 0) {
-+    args.use_windows = 0;
 +    args.interpreter_p = INTERP_TUI;
 +  } else {
-+    args.use_windows = 0;
 +    args.interpreter_p = INTERP_CONSOLE;
 +  }
    return gdb_main (&args);


Property changes on: trunk/devel/gdb/files/patch-unified
___________________________________________________________________
Deleted: cvs2svn:cvs-rev
## -1 +0,0 ##
-1.1
\ No newline at end of property
Modified: trunk/devel/gdb/pkg-plist
===================================================================
--- trunk/devel/gdb/pkg-plist	2018-11-26 17:02:39 UTC (rev 24715)
+++ trunk/devel/gdb/pkg-plist	2018-11-26 17:06:28 UTC (rev 24716)
@@ -1,15 +1,59 @@
 %%GDB_LINK%%bin/gdb
+%%GDB_LINK%%%%KGDB%%bin/kgdb
 bin/gdb%%VER%%
-%%TUI_LINK%%bin/gdbtui%%VER%%
-%%PYTHON%%share/gdb%%VER%%/python/gdb/__init__.py
-%%PYTHON%%share/gdb%%VER%%/python/gdb/types.py
-%%PYTHON%%share/gdb%%VER%%/python/gdb/printing.py
-%%PYTHON%%share/gdb%%VER%%/python/gdb/prompt.py
-%%PYTHON%%share/gdb%%VER%%/python/gdb/command/__init__.py
-%%PYTHON%%share/gdb%%VER%%/python/gdb/command/pretty_printers.py
-%%PYTHON%%share/gdb%%VER%%/python/gdb/command/prompt.py
-%%PYTHON%%share/gdb%%VER%%/python/gdb/command/explore.py
-%%PYTHON%%@dirrm share/gdb%%VER%%/python/gdb/command
-%%PYTHON%%@dirrm share/gdb%%VER%%/python/gdb
-%%PYTHON%%@dirrm share/gdb%%VER%%/python
-%%PYTHON%%@dirrm share/gdb%%VER%%
+%%TUI%%bin/gdbtui%%VER%%
+%%KGDB%%bin/kgdb%%VER%%
+man/man1/gdb%%VER%%.1.gz
+%%KGDB%%man/man1/kgdb%%VER%%.1.gz
+%%PYTHON%%%%DATADIR%%%%VER%%/python/gdb/__init__.py
+%%PYTHON%%%%DATADIR%%%%VER%%/python/gdb/FrameDecorator.py
+%%PYTHON%%%%DATADIR%%%%VER%%/python/gdb/FrameIterator.py
+%%PYTHON%%%%DATADIR%%%%VER%%/python/gdb/frames.py
+%%PYTHON%%%%DATADIR%%%%VER%%/python/gdb/printing.py
+%%PYTHON%%%%DATADIR%%%%VER%%/python/gdb/prompt.py
+%%PYTHON%%%%DATADIR%%%%VER%%/python/gdb/types.py
+%%PYTHON%%%%DATADIR%%%%VER%%/python/gdb/unwinder.py
+%%PYTHON%%%%DATADIR%%%%VER%%/python/gdb/xmethod.py
+%%PYTHON%%%%DATADIR%%%%VER%%/python/gdb/command/__init__.py
+%%PYTHON%%%%DATADIR%%%%VER%%/python/gdb/command/explore.py
+%%PYTHON%%%%DATADIR%%%%VER%%/python/gdb/command/frame_filters.py
+%%PYTHON%%%%DATADIR%%%%VER%%/python/gdb/command/pretty_printers.py
+%%PYTHON%%%%DATADIR%%%%VER%%/python/gdb/command/prompt.py
+%%PYTHON%%%%DATADIR%%%%VER%%/python/gdb/command/type_printers.py
+%%PYTHON%%%%DATADIR%%%%VER%%/python/gdb/command/unwinders.py
+%%PYTHON%%%%DATADIR%%%%VER%%/python/gdb/command/xmethods.py
+%%PYTHON%%%%DATADIR%%%%VER%%/python/gdb/function/__init__.py
+%%PYTHON%%%%DATADIR%%%%VER%%/python/gdb/function/as_string.py
+%%PYTHON%%%%DATADIR%%%%VER%%/python/gdb/function/caller_is.py
+%%PYTHON%%%%DATADIR%%%%VER%%/python/gdb/function/strfns.py
+%%PYTHON%%%%DATADIR%%%%VER%%/python/gdb/printer/__init__.py
+%%PYTHON%%%%DATADIR%%%%VER%%/python/gdb/printer/bound_registers.py
+%%GUILE%%%%DATADIR%%%%VER%%/guile/gdb.go
+%%GUILE%%%%DATADIR%%%%VER%%/guile/gdb.scm
+%%GUILE%%%%DATADIR%%%%VER%%/guile/gdb/boot.scm
+%%GUILE%%%%DATADIR%%%%VER%%/guile/gdb/experimental.go
+%%GUILE%%%%DATADIR%%%%VER%%/guile/gdb/experimental.scm
+%%GUILE%%%%DATADIR%%%%VER%%/guile/gdb/init.scm
+%%GUILE%%%%DATADIR%%%%VER%%/guile/gdb/iterator.go
+%%GUILE%%%%DATADIR%%%%VER%%/guile/gdb/iterator.scm
+%%GUILE%%%%DATADIR%%%%VER%%/guile/gdb/printing.go
+%%GUILE%%%%DATADIR%%%%VER%%/guile/gdb/printing.scm
+%%GUILE%%%%DATADIR%%%%VER%%/guile/gdb/support.go
+%%GUILE%%%%DATADIR%%%%VER%%/guile/gdb/support.scm
+%%GUILE%%%%DATADIR%%%%VER%%/guile/gdb/types.go
+%%GUILE%%%%DATADIR%%%%VER%%/guile/gdb/types.scm
+%%DATADIR%%%%VER%%/syscalls/aarch64-linux.xml
+%%DATADIR%%%%VER%%/syscalls/amd64-linux.xml
+%%DATADIR%%%%VER%%/syscalls/arm-linux.xml
+%%DATADIR%%%%VER%%/syscalls/freebsd.xml
+%%DATADIR%%%%VER%%/syscalls/gdb-syscalls.dtd
+%%DATADIR%%%%VER%%/syscalls/i386-linux.xml
+%%DATADIR%%%%VER%%/syscalls/mips-n32-linux.xml
+%%DATADIR%%%%VER%%/syscalls/mips-n64-linux.xml
+%%DATADIR%%%%VER%%/syscalls/mips-o32-linux.xml
+%%DATADIR%%%%VER%%/syscalls/ppc-linux.xml
+%%DATADIR%%%%VER%%/syscalls/ppc64-linux.xml
+%%DATADIR%%%%VER%%/syscalls/s390-linux.xml
+%%DATADIR%%%%VER%%/syscalls/s390x-linux.xml
+%%DATADIR%%%%VER%%/syscalls/sparc-linux.xml
+%%DATADIR%%%%VER%%/syscalls/sparc64-linux.xml



More information about the Midnightbsd-cvs mailing list