pkgsrc-WIP-changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

gdb-netbsd-wip: Drop



Module Name:	pkgsrc-wip
Committed By:	Kamil Rytarowski <n54%gmx.com@localhost>
Pushed By:	kamil
Date:		Wed Apr 8 17:31:19 2020 +0200
Changeset:	af6a3d7cdcc7152eaf3fbdd650cfc572be5a8af6

Removed Files:
	gdb-netbsd-wip/DESCR
	gdb-netbsd-wip/Makefile
	gdb-netbsd-wip/PLIST.Linux
	gdb-netbsd-wip/PLIST.common
	gdb-netbsd-wip/distinfo
	gdb-netbsd-wip/options.mk
	gdb-netbsd-wip/patches/patch-gdb_nbsd-nat.c
	gdb-netbsd-wip/patches/patch-gdb_nbsd-nat.h

Log Message:
gdb-netbsd-wip: Drop

Local patches will be rebased to gdb-netbsd.

To see a diff of this commit:
https://wip.pkgsrc.org/cgi-bin/gitweb.cgi?p=pkgsrc-wip.git;a=commitdiff;h=af6a3d7cdcc7152eaf3fbdd650cfc572be5a8af6

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

diffstat:
 gdb-netbsd-wip/DESCR                        |  17 -
 gdb-netbsd-wip/Makefile                     | 100 -----
 gdb-netbsd-wip/PLIST.Linux                  |   4 -
 gdb-netbsd-wip/PLIST.common                 |  52 ---
 gdb-netbsd-wip/distinfo                     |  23 -
 gdb-netbsd-wip/options.mk                   |  13 -
 gdb-netbsd-wip/patches/patch-gdb_nbsd-nat.c | 639 ----------------------------
 gdb-netbsd-wip/patches/patch-gdb_nbsd-nat.h |  42 --
 8 files changed, 890 deletions(-)

diffs:
diff --git a/gdb-netbsd-wip/DESCR b/gdb-netbsd-wip/DESCR
deleted file mode 100644
index c7c2207693..0000000000
--- a/gdb-netbsd-wip/DESCR
+++ /dev/null
@@ -1,17 +0,0 @@
-   The purpose of a debugger such as GDB is to allow you to see what
-is going on "inside" another program while it executes--or what
-another program was doing at the moment it crashed.
-
-   GDB can do four main kinds of things (plus other things in support
-of these) to help you catch bugs in the act:
-
-   * Start your program, specifying anything that might affect its
-     behavior.
-
-   * Make your program stop on specified conditions.
-
-   * Examine what has happened, when your program has stopped.
-
-   * Change things in your program, so you can experiment with
-     correcting the effects of one bug and go on to learn about
-     another.
diff --git a/gdb-netbsd-wip/Makefile b/gdb-netbsd-wip/Makefile
deleted file mode 100644
index 19bf7e4a35..0000000000
--- a/gdb-netbsd-wip/Makefile
+++ /dev/null
@@ -1,100 +0,0 @@
-# $NetBSD: Makefile,v 1.62 2019/04/25 07:32:45 maya Exp $
-
-DISTNAME=	gdb-8.2.1
-CATEGORIES=	devel
-
-MASTER_SITES=		${MASTER_SITE_GITHUB:=bminor/}
-GITHUB_PROJECT=		binutils-gdb
-GITHUB_TAG=		33aa3c10f663b834c9573ede439b2df3c92f0cfe
-
-HOMEPAGE=	https://www.gnu.org/software/gdb/gdb.html
-COMMENT=	Symbolic debugger for multiple language frontends
-LICENSE=	gnu-gpl-v3
-
-USE_LANGUAGES=		c c++11
-
-BROKEN_GETTEXT_DETECTION=	yes
-GNU_CONFIGURE=			YES
-USE_PKGLOCALEDIR=		YES
-USE_LIBTOOL=			YES
-USE_TOOLS+=			gmake msgfmt makeinfo perl:build
-REPLACE_LOCALEDIR_PATTERNS+=	Make-in
-INSTALL_TARGET=			install install-info
-TEST_TARGET=			check
-INFO_FILES=			yes
-CONFIGURE_ENV+=			CONFIG_LDFLAGS=${LDFLAGS:M*:Q}
-
-# In gdb/configure, depcomp is parsed with sed.
-SUBST_CLASSES+=			fix-depcomp
-SUBST_STAGE.fix-depcomp+=	pre-configure
-SUBST_MESSAGE.fix-depcomp+=	Read depcomp directly
-SUBST_FILES.fix-depcomp+=	gdb/configure
-SUBST_SED.fix-depcomp+=		-e 's,< ./depcomp,${_OVERRIDE_PATH.depcomp},'
-
-CONFIGURE_ARGS+=	--disable-binutils
-CONFIGURE_ARGS+=	--disable-gprof
-CONFIGURE_ARGS+=	--disable-gold
-CONFIGURE_ARGS+=	--disable-gas
-CONFIGURE_ARGS+=	--disable-ld
-
-CONFIGURE_ARGS+=	--enable-targets=all
-
-AUTO_MKDIRS=		yes
-
-.include "options.mk"
-
-.include "../../mk/bsd.prefs.mk"
-
-PLIST_VARS+=	gcore
-.if (${OPSYS} == "SunOS" || ${OPSYS} == "NetBSD" \
-    || ${OPSYS} == "Linux" || ${OPSYS} == "FreeBSD")
-PLIST.gcore=	yes
-.endif
-
-.if ${OPSYS} == "SunOS"
-# Work around a bug in gdb's configure
-CONFIGURE_ENV+=		ac_cv_header_curses_h=yes
-.elif ${OPSYS} == "NetBSD"
-.include "../../mk/curses.buildlink3.mk"
-CONFIGURE_ARGS+= -with-curses
-CONFIGURE_ENV+= gdb_cv_var_elf=yes
-MAKE_ENV+= gdb_cv_var_elf=yes
-CONFIGURE_ENV+= gdb_cv_struct_lwp=yes
-MAKE_ENV+= gdb_cv_struct_lwp=yes
-
-CONFIGURE_ARGS+=	--with-separate-debug-dir=/usr/libdata/debug
-.elif ${OPSYS} == "DragonFly"
-TARGET_STR=		${MACHINE_ARCH}--dragonfly
-BUILD_DEFS+=		${TARGET_STR}
-## Remove "-pc" string, without this, getting following message:
-##	   *** Gdb does not support native target i386-pc-dragonfly"
-CONFIGURE_ARGS+=	--target=${TARGET_STR}
-TEST_ENV=		DEJAGNU=${WRKDIR}/../files/dragonfly-default.exp
-.endif
-
-post-install:
-	${RM} -f ${DESTDIR}/${PREFIX}/lib/charset.alias
-.if ${OPSYS} == "DragonFly"
-# Following are installed by binutils
-#. for f in ansidecl.h bfdlink.h dis-asm.h symcat.h
-#	(cd ${WRKSRC}/include; ${INSTALL_DATA} ${f}  ${DESTDIR}${PREFIX}/include)
-#. endfor
-	(cd ${DESTDIR}${PREFIX}/bin;               ${LN} ${TARGET_STR}-gdb gdb)
-	(cd ${DESTDIR}${PREFIX}/${PKGMANDIR}/man1; ${LN} ${TARGET_STR}-gdb.1 gdb.1)
-.endif
-#
-# PATH of libiberty.a differs between clang and gcc: (and conflicts to other toolchain)
-# Rename to avoid conflict to native and other toolchain
-# and clang differs its path so, (the same as avr-binutils).
-
-	(cd ${DESTDIR}${PREFIX};				\
-	for d in ${MACHINE_ARCH}/libiberty.a libiberty.a;	\
-	  do if [ -f lib/$$d ]; then				\
-		${MV}	lib/$$d	 lib/gdb/libiberty.a;		\
-		break;						\
-	     fi;						\
-	  done;	)
-
-.include "../../mk/termcap.buildlink3.mk"
-.include "../../devel/gettext-lib/buildlink3.mk"
-.include "../../mk/bsd.pkg.mk"
diff --git a/gdb-netbsd-wip/PLIST.Linux b/gdb-netbsd-wip/PLIST.Linux
deleted file mode 100644
index e4fe491ac0..0000000000
--- a/gdb-netbsd-wip/PLIST.Linux
+++ /dev/null
@@ -1,4 +0,0 @@
-@comment $NetBSD: PLIST.Linux,v 1.5 2018/01/31 20:33:11 maya Exp $
-bin/gdbserver
-lib/libinproctrace.so
-man/man1/gcore.1
diff --git a/gdb-netbsd-wip/PLIST.common b/gdb-netbsd-wip/PLIST.common
deleted file mode 100644
index 9e7295ea95..0000000000
--- a/gdb-netbsd-wip/PLIST.common
+++ /dev/null
@@ -1,52 +0,0 @@
-@comment $NetBSD: PLIST.common,v 1.13 2018/01/31 20:33:11 maya Exp $
-bin/gdb
-bin/gdb-add-index
-include/gdb/jit-reader.h
-info/annotate.info
-info/gdb.info
-info/stabs.info
-man/man1/gdb.1
-man/man1/gdb-add-index.1
-man/man1/gdbserver.1
-man/man5/gdbinit.5
-share/gdb/python/gdb/FrameDecorator.py
-share/gdb/python/gdb/FrameIterator.py
-share/gdb/python/gdb/__init__.py
-share/gdb/python/gdb/command/__init__.py
-share/gdb/python/gdb/command/explore.py
-share/gdb/python/gdb/command/frame_filters.py
-share/gdb/python/gdb/command/pretty_printers.py
-share/gdb/python/gdb/command/prompt.py
-share/gdb/python/gdb/command/type_printers.py
-share/gdb/python/gdb/command/unwinders.py
-share/gdb/python/gdb/command/xmethods.py
-share/gdb/python/gdb/frames.py
-share/gdb/python/gdb/function/__init__.py
-share/gdb/python/gdb/function/as_string.py
-share/gdb/python/gdb/function/caller_is.py
-share/gdb/python/gdb/function/strfns.py
-share/gdb/python/gdb/printer/__init__.py
-share/gdb/python/gdb/printer/bound_registers.py
-share/gdb/python/gdb/printing.py
-share/gdb/python/gdb/prompt.py
-share/gdb/python/gdb/types.py
-share/gdb/python/gdb/unwinder.py
-share/gdb/python/gdb/xmethod.py
-share/gdb/syscalls/aarch64-linux.xml
-share/gdb/syscalls/amd64-linux.xml
-share/gdb/syscalls/arm-linux.xml
-share/gdb/syscalls/freebsd.xml
-share/gdb/syscalls/gdb-syscalls.dtd
-share/gdb/syscalls/i386-linux.xml
-share/gdb/syscalls/mips-n32-linux.xml
-share/gdb/syscalls/mips-n64-linux.xml
-share/gdb/syscalls/mips-o32-linux.xml
-share/gdb/syscalls/ppc-linux.xml
-share/gdb/syscalls/ppc64-linux.xml
-share/gdb/syscalls/s390-linux.xml
-share/gdb/syscalls/s390x-linux.xml
-share/gdb/syscalls/sparc-linux.xml
-share/gdb/syscalls/sparc64-linux.xml
-share/gdb/system-gdbinit/elinos.py
-share/gdb/system-gdbinit/wrs-linux.py
-${PLIST.gcore}bin/gcore
diff --git a/gdb-netbsd-wip/distinfo b/gdb-netbsd-wip/distinfo
deleted file mode 100644
index 961ca88be4..0000000000
--- a/gdb-netbsd-wip/distinfo
+++ /dev/null
@@ -1,23 +0,0 @@
-$NetBSD$
-
-SHA1 (gdb-8.2.1-33aa3c10f663b834c9573ede439b2df3c92f0cfe.tar.gz) = dca9e71b06c0cbf05eb5ad11bedffd55f43b57b1
-RMD160 (gdb-8.2.1-33aa3c10f663b834c9573ede439b2df3c92f0cfe.tar.gz) = f14784efc6a426c7c41d7ecde0ca93a607291ce4
-SHA512 (gdb-8.2.1-33aa3c10f663b834c9573ede439b2df3c92f0cfe.tar.gz) = 253df909aef34a54337d551f59cb09d346dfb2be4ffee5d9f04045cb22e9a97bb5be4c60e1f8bdd359d0ae995a3e5a7059f6b34d753f4f8dfb6cb1d9162e766b
-Size (gdb-8.2.1-33aa3c10f663b834c9573ede439b2df3c92f0cfe.tar.gz) = 60273852 bytes
-SHA1 (patch-gdb_ChangeLog) = 3af6d71e729b345d4f8c8f2cb75124e807062d7c
-SHA1 (patch-gdb_alpha-nbsd-tdep.c) = fb37c90da1983f3c3b501c24136df98a6c136a3d
-SHA1 (patch-gdb_amd64-nbsd-tdep.c) = 57648d15c6a8e75980115265c5bc7d1ecece43dd
-SHA1 (patch-gdb_arm-nbsd-tdep.c) = 21a27a998772c6bf2d2162296a7b1c1a946e9532
-SHA1 (patch-gdb_hppa-nbsd-tdep.c) = 1b6caec16c2a689a44376a11f8276b50ca9bc98e
-SHA1 (patch-gdb_i386-nbsd-tdep.c) = a704bbf9eca5915150dd398a5c877112e746f498
-SHA1 (patch-gdb_mips-nbsd-tdep.c) = abf0b5cf60392fba3baac03410bd57e94a928cf1
-SHA1 (patch-gdb_nbsd-nat.c) = 14502e3c5d7d9b0eb6643daf753cc47390df4ebc
-SHA1 (patch-gdb_nbsd-nat.h) = 4075ef6f0a5283b2e7ff9b37b3c8568f87e2f73d
-SHA1 (patch-gdb_nbsd-tdep.c) = eecd02895d2914f05a83f71c4591d55941f461ca
-SHA1 (patch-gdb_nbsd-tdep.h) = e0cbf6b18f3c5b7c424c5b74031c7812faf28659
-SHA1 (patch-gdb_ppc-nbsd-tdep.c) = fcd8a089b9c2b4a13066c98238d39344e3774825
-SHA1 (patch-gdb_sh-nbsd-tdep.c) = 9415910f10f4252839526d1b5245561e0b79c229
-SHA1 (patch-gdb_sparc-nbsd-tdep.c) = 0ffcf7396623b37d1190bd0d93b8fab30f3dd9d5
-SHA1 (patch-gdb_sparc64-nbsd-tdep.c) = de3efccb4f9f1da132dd2430a0a8eeac66827ab8
-SHA1 (patch-gdb_thread.c) = 869149fe721879a5f5d5fb6847a9993da3d8ff6a
-SHA1 (patch-gdb_vax-nbsd-tdep.c) = 278a85b0db7dab449c0d993b31f009199d7f6828
diff --git a/gdb-netbsd-wip/options.mk b/gdb-netbsd-wip/options.mk
deleted file mode 100644
index 3a52d30fcb..0000000000
--- a/gdb-netbsd-wip/options.mk
+++ /dev/null
@@ -1,13 +0,0 @@
-# $NetBSD: options.mk,v 1.6 2019/04/26 13:13:49 maya Exp $
-
-PKG_OPTIONS_VAR=	PKG_OPTIONS.gdb
-PKG_SUPPORTED_OPTIONS=	python
-PKG_SUGGESTED_OPTIONS=	python
-
-.include "../../mk/bsd.options.mk"
-
-.if !empty(PKG_OPTIONS:Mpython)
-CONFIGURE_ARGS+=	--with-python=${PYTHONBIN}
-PYTHON_VERSIONS_ACCEPTED=	 27
-.include "../../lang/python/application.mk"
-.endif
diff --git a/gdb-netbsd-wip/patches/patch-gdb_nbsd-nat.c b/gdb-netbsd-wip/patches/patch-gdb_nbsd-nat.c
deleted file mode 100644
index 4ac3c26a11..0000000000
--- a/gdb-netbsd-wip/patches/patch-gdb_nbsd-nat.c
+++ /dev/null
@@ -1,639 +0,0 @@
-$NetBSD$
-
---- gdb/nbsd-nat.c.orig	2020-03-25 17:24:08.000000000 +0000
-+++ gdb/nbsd-nat.c
-@@ -20,10 +20,17 @@
- #include "defs.h"
- 
- #include "nbsd-nat.h"
-+#include "gdbarch.h"
-+#include "gdbthread.h"
-+#include "inferior.h"
-+#include "regcache.h"
- 
- #include <sys/types.h>
- #include <sys/ptrace.h>
- #include <sys/sysctl.h>
-+#include <sys/wait.h>
-+
-+#include <forward_list>
- 
- /* Return the name of a file that can be opened to get the symbols for
-    the child process identified by PID.  */
-@@ -39,3 +46,616 @@ nbsd_nat_target::pid_to_exec_file (int p
-     return NULL;
-   return buf;
- }
-+
-+/* Generic thread (LWP) lister within a specified process.  The callback
-+   parameters is a C++ function that is called for each detected thread.  */
-+
-+static void
-+nbsd_thread_lister (const pid_t pid,
-+		    std::function<bool (const struct kinfo_lwp *)> callback)
-+{
-+  int mib[5] = {CTL_KERN, KERN_LWP, pid, sizeof (struct kinfo_lwp), 0};
-+  size_t size;
-+
-+  if (sysctl (mib, ARRAY_SIZE (mib), NULL, &size, NULL, 0) == -1 || size == 0)
-+    perror_with_name (("sysctl"));
-+
-+  mib[4] = size / sizeof (size_t);
-+
-+  gdb::unique_xmalloc_ptr<struct kinfo_lwp> kl
-+    ((struct kinfo_lwp *) xcalloc (size, 1));
-+  if (kl == NULL)
-+    perror_with_name (("calloc"));
-+
-+  if (sysctl (mib, ARRAY_SIZE (mib), kl.get (), &size, NULL, 0) == -1 ||
-+      size == 0)
-+    perror_with_name (("sysctl"));
-+
-+  for (size_t i = 0; i < size / sizeof (struct kinfo_lwp); i++)
-+    {
-+      struct kinfo_lwp *l = &kl.get ()[i];
-+
-+      /* Return true if the specified thread is alive.  */
-+      auto lwp_alive =
-+	[&l]()
-+	{
-+	  switch (l->l_stat)
-+	    {
-+	    case LSSLEEP:
-+	    case LSRUN:
-+	    case LSONPROC:
-+	    case LSSTOP:
-+	    case LSSUSPENDED:
-+	      return true;
-+	    default:
-+	      return false;
-+	    }
-+	};
-+
-+      /* Ignore embryonic or demised threads.  */
-+      if (!lwp_alive ())
-+	continue;
-+
-+      if (callback (l))
-+	break;
-+    }
-+}
-+
-+/* Return true if PTID is still active in the inferior.  */
-+
-+bool
-+nbsd_nat_target::thread_alive (ptid_t ptid)
-+{
-+  pid_t pid = ptid.pid ();
-+  int lwp = ptid.lwp ();
-+  bool found = false;
-+
-+  fprintf_unfiltered (gdb_stderr, "THREAD ALIVE: (pid=%d, lwp=%ld, tid=%ld)\n", ptid.pid (), ptid.lwp (), ptid.tid ());
-+  
-+  auto fn =
-+    [&lwp, &found] (const struct kinfo_lwp *kl)
-+    {
-+      if (kl->l_lid == lwp)
-+	{
-+	  found = true;
-+	  return true;
-+	}
-+      return false;
-+    };
-+
-+  nbsd_thread_lister (pid, fn);
-+
-+  return found;
-+}
-+
-+/* Return the name assigned to a thread by an application.  Returns
-+   the string in a static buffer.  */
-+
-+const char *
-+nbsd_nat_target::thread_name (struct thread_info *thr)
-+{
-+  ptid_t ptid = thr->ptid;
-+  pid_t pid = ptid.pid ();
-+  int lwp = ptid.lwp ();
-+
-+  fprintf_unfiltered (gdb_stderr, "THREAD NAME: (pid=%d, lwp=%ld, tid=%ld)\n", ptid.pid (), ptid.lwp (), ptid.tid ());
-+  
-+  static char buf[KI_LNAMELEN] = {};
-+
-+  auto fn =
-+    [&lwp] (const struct kinfo_lwp *kl)
-+    {
-+      if (kl->l_lid == lwp)
-+	{
-+	  xsnprintf (buf, sizeof buf, "%s", kl->l_name);
-+	  return true;
-+	}
-+      return false;
-+    };
-+
-+  nbsd_thread_lister (pid, fn);
-+
-+  return buf;
-+}
-+
-+/* Implement the "post_attach" target_ops method.  */
-+
-+static void
-+nbsd_add_threads (nbsd_nat_target *target, pid_t pid)
-+{
-+  fprintf_unfiltered (gdb_stderr, "%s() %s:%d NBSD_ADD_THREADS JESTEM TU !!!!!!!!!!!!!\n", __func__, __FILE__, __LINE__);
-+  
-+  auto fn =
-+    [&target, &pid] (const struct kinfo_lwp *kl)
-+    {
-+      ptid_t ptid = ptid_t (pid, kl->l_lid, 0);
-+      if (!in_thread_list (target, ptid))
-+	{
-+	  if (inferior_ptid.lwp () == 0)
-+	    thread_change_ptid (target, inferior_ptid, ptid);
-+	  else
-+	    add_thread (target, ptid);
-+	}
-+      return false;
-+    };
-+
-+  
-+  nbsd_thread_lister (pid, fn);
-+
-+  fprintf_unfiltered (gdb_stderr, "%s() %s:%d NBSD_ADD_THREADS JESTEM TU !!!!!!!!!!!!!\n", __func__, __FILE__, __LINE__);
-+}
-+
-+/* Enable additional event reporting on new processes.  */
-+
-+static void
-+nbsd_enable_proc_events (pid_t pid)
-+{
-+  int events;
-+
-+  fprintf_unfiltered (gdb_stderr, "ENABLE PROC EVENTS: (pid=%d)\n", pid);
-+
-+  if (ptrace (PT_GET_EVENT_MASK, pid, &events, sizeof (events)) == -1)
-+    perror_with_name (("ptrace"));
-+
-+  events |= PTRACE_FORK;
-+  events |= PTRACE_VFORK;
-+  events |= PTRACE_VFORK_DONE;
-+  events |= PTRACE_LWP_CREATE;
-+  events |= PTRACE_LWP_EXIT;
-+
-+  if (ptrace (PT_SET_EVENT_MASK, pid, &events, sizeof (events)) == -1)
-+    perror_with_name (("ptrace"));
-+}
-+
-+/* Implement the "post_attach" target_ops method.  */
-+
-+void
-+nbsd_nat_target::post_attach (int pid)
-+{
-+  fprintf_unfiltered (gdb_stderr, "POST ATTACH: (pid=%d)\n", pid);
-+    
-+  nbsd_enable_proc_events (pid);
-+  nbsd_add_threads (this, pid);
-+}
-+
-+/* Implement the "update_thread_list" target_ops method.  */
-+
-+void
-+nbsd_nat_target::update_thread_list ()
-+{
-+  fprintf_unfiltered (gdb_stderr, "UPDATE THREAD LIST\n");
-+    
-+  prune_threads ();
-+
-+  nbsd_add_threads (this, inferior_ptid.pid ());
-+}
-+
-+/* Convert PTID to a string.  */
-+
-+std::string
-+nbsd_nat_target::pid_to_str (ptid_t ptid)
-+{
-+  int lwp = ptid.lwp ();
-+
-+  fprintf_unfiltered (gdb_stderr, "PID TO STR: (pid=%d, lwp=%ld, tid=%ld)\n", ptid.pid (), ptid.lwp (), ptid.tid ());
-+  
-+  if (lwp != 0)
-+    {
-+      pid_t pid = ptid.pid ();
-+
-+      return string_printf ("LWP %d of process %d", lwp, pid);
-+    }
-+
-+  return normal_pid_to_str (ptid);
-+}
-+
-+static std::list<ptid_t> nbsd_pending_children;
-+
-+/* Record a new child process event that is reported before the                                                                                                                                      
-+   corresponding fork event in the parent.  */
-+
-+static void
-+nbsd_remember_child (ptid_t pid)
-+{
-+  nbsd_pending_children.push_front (pid);
-+}
-+
-+/* Check for a previously-recorded new child process event for PID.                                                                                                                                  
-+   If one is found, remove it from the list and return the PTID.  */
-+
-+static ptid_t
-+nbsd_is_child_pending (pid_t pid)
-+{
-+  for (auto it = nbsd_pending_children.begin ();
-+       it != nbsd_pending_children.end (); it++)
-+    if (it->pid () == pid)
-+      {
-+        ptid_t ptid = *it;
-+        nbsd_pending_children.erase (it);
-+        return ptid;
-+      }
-+  return null_ptid;
-+}
-+
-+/* Wait for the child specified by PTID to do something.  Return the
-+   process ID of the child, or MINUS_ONE_PTID in case of error; store
-+   the status in *OURSTATUS.  */
-+
-+ptid_t
-+nbsd_nat_target::wait (ptid_t ptid, struct target_waitstatus *ourstatus,
-+                       int target_options)
-+{
-+  ptid_t wptid;
-+
-+  while (true)
-+    {
-+      wptid = inf_ptrace_target::wait (ptid, ourstatus, target_options);
-+
-+      if (ourstatus->kind != TARGET_WAITKIND_STOPPED)
-+	return wptid;
-+
-+      pid_t pid = wptid. pid();
-+
-+      /* Extract the event and thread that received a signal.  */
-+      ptrace_siginfo_t psi;
-+      if (ptrace (PT_GET_SIGINFO, pid, &psi, sizeof (psi)) == -1)
-+        perror_with_name (("ptrace"));
-+
-+      /* Pick child's siginfo_t.  */
-+      siginfo_t *si = &psi.psi_siginfo;
-+
-+      int lwp = psi.psi_lwpid;
-+
-+      /* Construct PTID.  */
-+      wptid = ptid_t (pid, lwp, 0);
-+
-+      int signo = si->si_signo;
-+      int code = si->si_code;
-+
-+      /* Stop examining here uninteresting events.  */
-+      if (signo != SIGTRAP || code <= SI_USER || code == SI_NOINFO)
-+	return wptid;
-+
-+      ptrace_state_t pst;
-+      if (ptrace (PT_GET_PROCESS_STATE, pid, &pst, sizeof (pst)) == -1)
-+	perror_with_name (("ptrace"));
-+
-+      int event = pst.pe_report_event;
-+      
-+      if (code == TRAP_LWP && event == PTRACE_LWP_EXIT)
-+	{
-+	  /* If GDB attaches to a multi-threaded process, exiting
-+	     threads might be skipped during post_attach that
-+	     have not yet reported their PL_FLAG_EXITED event.
-+	     Ignore EXITED events for an unknown LWP.  */
-+	  thread_info *thr = find_thread_ptid (this, wptid);
-+	  if (thr != nullptr)
-+	    {
-+	      delete_thread (thr);
-+	    }
-+	  if (ptrace (PT_CONTINUE, pid, (void *) 1, 0) == -1)
-+	    perror_with_name (("ptrace"));
-+	  continue;
-+	}
-+      
-+      /* Switch to an LWP PTID on the first stop in a new process.
-+	 This is done after handling PL_FLAG_EXITED to avoid
-+	 switching to an exited LWP.  It is done before checking
-+	 PL_FLAG_BORN in case the first stop reported after
-+	 attaching to an existing process is a PL_FLAG_BORN
-+	 event.  */
-+
-+      bool newborn_process = !in_thread_list (this, ptid_t (pid));
-+
-+      if (!newborn_process)
-+	{
-+	  thread_change_ptid (this, ptid_t (pid), wptid);
-+	}
-+
-+      if (code == TRAP_LWP && event == PTRACE_LWP_CREATE)
-+	{
-+	  /* If GDB attaches to a multi-threaded process, newborn
-+	     threads might be added by fbsd_add_threads that have
-+	     not yet reported their PL_FLAG_BORN event.  Ignore
-+	     BORN events for an already-known LWP.  */
-+              if (!in_thread_list (this, wptid))
-+                {
-+                  add_thread (this, wptid);
-+                }
-+              ourstatus->kind = TARGET_WAITKIND_SPURIOUS;
-+              return wptid;
-+	}
-+      
-+      if (code == TRAP_CHLD && (event == PTRACE_FORK || event == PTRACE_VFORK))
-+	{
-+	  if (newborn_process)
-+	    {
-+	      nbsd_remember_child (wptid);
-+	      continue;
-+	    }
-+
-+	  bool forked = event == PTRACE_FORK;
-+	  ourstatus->kind =
-+	    forked ? TARGET_WAITKIND_FORKED : TARGET_WAITKIND_VFORKED;
-+
-+	  pid_t child = pst.pe_other_pid;
-+	  ptid_t child_ptid = nbsd_is_child_pending (child);
-+	  if (child_ptid == null_ptid)
-+	    {
-+	      int status;
-+	      pid = waitpid (child, &status, 0);
-+	      if (pid == -1)
-+		perror_with_name (("waitpid"));
-+
-+	      gdb_assert (pid == child);
-+
-+	      if (!WIFSTOPPED (status))
-+		  {
-+		    /* Abnormal situation (process killed?)... bail out.  */
-+		    ourstatus->kind = TARGET_WAITKIND_SPURIOUS;
-+		    return wptid;
-+		  }
-+	      
-+	      if (ptrace (PT_GET_SIGINFO, child, &psi, sizeof psi) == -1)
-+		perror_with_name (("ptrace"));
-+
-+	      gdb_assert (psi.psi_siginfo.si_signo == SIGTRAP);
-+	      gdb_assert (psi.psi_siginfo.si_code == TRAP_CHLD);
-+
-+	      child_ptid = ptid_t (child, psi.psi_lwpid, 0);
-+	    }
-+	  
-+	  /* Enable additional events on the child process.  */
-+	  nbsd_enable_proc_events (child);
-+
-+	  ourstatus->value.related_pid = child_ptid;
-+
-+	  return wptid;
-+	}
-+
-+      if (code == TRAP_CHLD && event == PTRACE_VFORK_DONE)
-+	{
-+	  ourstatus->kind = TARGET_WAITKIND_VFORK_DONE;
-+	  return wptid;
-+	}
-+
-+      if (code == TRAP_EXEC)
-+	{
-+	  ourstatus->kind = TARGET_WAITKIND_EXECD;
-+	  ourstatus->value.execd_pathname = xstrdup (pid_to_exec_file (pid));
-+	  return wptid;
-+	}
-+
-+      if (code == TRAP_TRACE || code == TRAP_DBREG)
-+	{
-+	  /* Unhandled at this level.  */
-+	  return wptid;
-+	}
-+
-+      if (code == TRAP_SCE || code == TRAP_SCX)
-+	{
-+	  int sysnum = si->si_sysnum;
-+	  
-+	  if (!catch_syscall_enabled () || !catching_syscall_number (sysnum))
-+	    {
-+	      /* If the core isn't interested in this event, just  
-+                 continue the process explicitly and wait for another
-+                 event.  */
-+              if (ptrace (PT_CONTINUE, pid, (void *) 1, 0) == -1)
-+                perror_with_name (("ptrace"));
-+              continue;
-+	    }
-+
-+	  ourstatus->kind =
-+	    (code == TRAP_SCE) ? TARGET_WAITKIND_SYSCALL_ENTRY :
-+	    TARGET_WAITKIND_SYSCALL_RETURN;
-+	  ourstatus->value.syscall_number = sysnum;
-+	  return wptid;
-+	}
-+      
-+      if (code == TRAP_BRKPT)
-+	{
-+#if 0
-+	  struct regcache *regcache = get_thread_regcache (this, ptid);
-+	  struct gdbarch *gdbarch = regcache->arch ();
-+	  int decr_pc = gdbarch_decr_pc_after_break (gdbarch);
-+
-+	  if (decr_pc != 0)
-+	    {
-+	      CORE_ADDR pc;
-+
-+	      pc = regcache_read_pc (regcache);
-+	      regcache_write_pc (regcache, pc - decr_pc);
-+	    }
-+#endif	  
-+	  return wptid;
-+	}
-+
-+      return wptid;
-+    }
-+
-+  __unreachable();
-+}
-+
-+/* Implement the "post_startup_inferior" target_ops method.  */
-+
-+void
-+nbsd_nat_target::post_startup_inferior (ptid_t ptid)
-+{
-+  fprintf_unfiltered (gdb_stderr, "POST STARTUP INFERIOR: (pid=%d, lwp=%ld, tid=%ld)\n", ptid.pid (), ptid.lwp (), ptid.tid ());
-+  
-+  nbsd_enable_proc_events (ptid.pid ());
-+}
-+
-+/* Target hook for follow_fork.  On entry and at return inferior_ptid is
-+   the ptid of the followed inferior.  */
-+
-+bool
-+nbsd_nat_target::follow_fork (bool follow_child, bool detach_fork)
-+{
-+  fprintf_unfiltered (gdb_stderr, "FOLLOW FORK\n");
-+    
-+  if (!follow_child && detach_fork)
-+    {
-+      struct thread_info *tp = inferior_thread ();
-+      pid_t child_pid = tp->pending_follow.value.related_pid.pid ();
-+
-+      /* Breakpoints have already been detached from the child by
-+         infrun.c.  */
-+
-+      if (ptrace (PT_DETACH, child_pid, (void *)1, 0) == -1)
-+        perror_with_name (("ptrace"));
-+    }
-+
-+  return 0;
-+}
-+
-+/* Implement the "insert_fork_catchpoint" target_ops method.  */
-+
-+int
-+nbsd_nat_target::insert_fork_catchpoint (int pid)
-+{
-+  fprintf_unfiltered (gdb_stderr, "INSERT FORK CATCHPOINT: (pid=%d)\n", pid);
-+    
-+  return 0;
-+}
-+
-+/* Implement the "remove_fork_catchpoint" target_ops method.  */
-+
-+int
-+nbsd_nat_target::remove_fork_catchpoint (int pid)
-+{
-+  fprintf_unfiltered (gdb_stderr, "REMOVE FORK CATCHPOINT: (pid=%d)\n", pid);
-+  return 0;
-+}
-+
-+/* Implement the "insert_vfork_catchpoint" target_ops method.  */
-+
-+int
-+nbsd_nat_target::insert_vfork_catchpoint (int pid)
-+{
-+  fprintf_unfiltered (gdb_stderr, "INSERT VFORK CATCHPOINT: (pid=%d)\n", pid);
-+  return 0;
-+}
-+
-+/* Implement the "remove_vfork_catchpoint" target_ops method.  */
-+
-+int
-+nbsd_nat_target::remove_vfork_catchpoint (int pid)
-+{
-+  fprintf_unfiltered (gdb_stderr, "REMOVE VFORK CATCHPOINT: (pid=%d)\n", pid);
-+  return 0;
-+}
-+
-+/* Implement the "insert_exec_catchpoint" target_ops method.  */
-+
-+int
-+nbsd_nat_target::insert_exec_catchpoint (int pid)
-+{
-+  fprintf_unfiltered (gdb_stderr, "INSERT EXEC CATCHPOINT: (pid=%d)\n", pid);
-+  return 0;
-+}
-+
-+/* Implement the "" target_ops method.  */
-+
-+int
-+nbsd_nat_target::remove_exec_catchpoint (int pid)
-+{
-+  fprintf_unfiltered (gdb_stderr, "REMOVE EXEC CATCHPOINT: (pid=%d)\n", pid);
-+  return 0;
-+}
-+
-+/* Implement the "" target_ops method.  */
-+
-+int
-+nbsd_nat_target::set_syscall_catchpoint (int pid, bool needed,
-+                                         int any_count,
-+                                         gdb::array_view<const int> syscall_counts)
-+{
-+  fprintf_unfiltered (gdb_stderr, "SET SYSCALL CATCHPOINT: (pid=%d)\n", pid);
-+  /* Ignore the arguments.  inf-ptrace.c will use PT_SYSCALL which
-+     will catch all system call entries and exits.  The system calls
-+     are filtered by GDB rather than the kernel.  */
-+  return 0;
-+}
-+
-+/* Implement the "stopped_by_sw_breakpoint" target_ops method.  */
-+#if 0
-+bool
-+nbsd_nat_target::stopped_by_sw_breakpoint ()
-+{
-+  pid_t pid = inferior_ptid.pid ();
-+  ptrace_siginfo_t psi;
-+
-+  fprintf_unfiltered (gdb_stderr, "STOPPED BY SW BREAKPOINT\n");
-+  
-+  if (ptrace (PT_GET_SIGINFO, pid, &psi, sizeof (psi)) == -1)
-+    return false;
-+
-+  siginfo_t *si = &psi.psi_siginfo;
-+  return si->si_signo == SIGTRAP && si->si_code == TRAP_BRKPT;
-+}
-+
-+/* Implement the "supports_stopped_by_sw_breakpoint" target_ops method.  */
-+
-+bool
-+nbsd_nat_target::supports_stopped_by_sw_breakpoint ()
-+{
-+  fprintf_unfiltered (gdb_stderr, "SUPPORTS STOPPED BY SW BREAKPOINT\n");
-+  return true;
-+}
-+#endif
-+
-+/* Implement the "resume" target_ops method.  */
-+
-+void
-+nbsd_nat_target::resume (ptid_t ptid, int step, enum gdb_signal signo)
-+{
-+  fprintf_unfiltered (gdb_stderr, "RESUME: (pid=%d, lwp=%ld, tid=%ld)\n", ptid.pid (), ptid.lwp (), ptid.tid ());
-+
-+  if (ptid.lwp_p ())
-+    {
-+      /* If ptid is a specific LWP, suspend all other LWPs in the process.  */
-+      inferior *inf = find_inferior_ptid (this, ptid);
-+
-+      for (thread_info *tp : inf->non_exited_threads ())
-+        {
-+          int request;
-+
-+          if (tp->ptid.lwp () == ptid.lwp ())
-+            request = PT_RESUME;
-+          else
-+            request = PT_SUSPEND;
-+
-+          if (ptrace (request, tp->ptid.pid (), NULL, tp->ptid.lwp ()) == -1)
-+            perror_with_name (("ptrace"));
-+        }
-+    }
-+  else
-+    {
-+      /* If ptid is a wildcard, resume all matching threads (they won't run
-+         until the process is continued however).  */
-+      for (thread_info *tp : all_non_exited_threads (this, ptid))
-+        if (ptrace (PT_RESUME, tp->ptid.pid (), NULL, tp->ptid.lwp ()) == -1)
-+          perror_with_name (("ptrace"));
-+      ptid = inferior_ptid;
-+    }
-+
-+  if (step)
-+    {
-+      for (thread_info *tp : all_non_exited_threads (this, ptid))
-+	if (ptrace (PT_SETSTEP, tp->ptid.pid (), NULL, tp->ptid.lwp ()) == -1)
-+	  perror_with_name (("ptrace"));
-+      step = 0;
-+    }
-+  else
-+    {
-+      for (thread_info *tp : all_non_exited_threads (this, ptid))
-+	if (ptrace (PT_CLEARSTEP, tp->ptid.pid (), NULL, tp->ptid.lwp ()) == -1)
-+	  perror_with_name (("ptrace"));
-+    }
-+
-+  ptid = ptid_t (ptid.pid ());
-+
-+  inf_ptrace_target::resume (ptid, step, signo);
-+}
diff --git a/gdb-netbsd-wip/patches/patch-gdb_nbsd-nat.h b/gdb-netbsd-wip/patches/patch-gdb_nbsd-nat.h
deleted file mode 100644
index c2afa3d061..0000000000
--- a/gdb-netbsd-wip/patches/patch-gdb_nbsd-nat.h
+++ /dev/null
@@ -1,42 +0,0 @@
-$NetBSD$
-
---- gdb/nbsd-nat.h.orig	2020-03-25 17:24:08.000000000 +0000
-+++ gdb/nbsd-nat.h
-@@ -22,11 +22,37 @@
- 
- #include "inf-ptrace.h"
- 
-+struct thread_info;
-+
- /* A prototype NetBSD target.  */
- 
- struct nbsd_nat_target : public inf_ptrace_target
- {
-   char *pid_to_exec_file (int pid) override;
-+
-+  bool thread_alive (ptid_t ptid) override;
-+  const char *thread_name (struct thread_info *thr) override;
-+  void post_attach (int pid) override;
-+  void update_thread_list () override;
-+  std::string pid_to_str (ptid_t ptid) override;
-+  ptid_t wait (ptid_t ptid, struct target_waitstatus *ourstatus,
-+	       int target_options) override;
-+  void post_startup_inferior (ptid_t ptid) override;
-+  bool follow_fork (bool follow_child, bool detach_fork) override;
-+  int insert_fork_catchpoint (int pid) override;
-+  int remove_fork_catchpoint (int pid) override;
-+  int insert_vfork_catchpoint (int pid) override;
-+  int remove_vfork_catchpoint (int pid) override;
-+  int insert_exec_catchpoint (int pid) override;
-+  int remove_exec_catchpoint (int pid) override;
-+  int set_syscall_catchpoint (int pid, bool needed, int any_count,
-+			      gdb::array_view<const int> syscall_counts)
-+    override;
-+#if 0
-+  bool stopped_by_sw_breakpoint () override;
-+  bool supports_stopped_by_sw_breakpoint () override;
-+#endif
-+  void resume (ptid_t ptid, int step, enum gdb_signal signo) override;
- };
- 
- #endif /* nbsd-nat.h */


Home | Main Index | Thread Index | Old Index