Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 13 Jan 2014 19:08:25 +0000 (UTC)
From:      Marcel Moolenaar <marcel@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r260601 - head/gnu/usr.bin/gdb/kgdb
Message-ID:  <201401131908.s0DJ8P6B021498@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: marcel
Date: Mon Jan 13 19:08:25 2014
New Revision: 260601
URL: http://svnweb.freebsd.org/changeset/base/260601

Log:
  When building a cross-kgdb, suppress the registration of the
  standard core target by declaring coreops_suppress_target with
  initializer. This is also happening for non-cross kgdb, by
  virtue of having fbsd-threads.c in libgdb and having it do the
  exact same thing. Since fbsd-threads.c is not included in in
  libgdb when building a cross debugger, we ended up with more
  than 1 core file targets (the standard gdb core file target and
  kgdb's libkvm based core file target) and this behaves the same
  as not having a core target at all.

Modified:
  head/gnu/usr.bin/gdb/kgdb/trgt.c

Modified: head/gnu/usr.bin/gdb/kgdb/trgt.c
==============================================================================
--- head/gnu/usr.bin/gdb/kgdb/trgt.c	Mon Jan 13 19:02:31 2014	(r260600)
+++ head/gnu/usr.bin/gdb/kgdb/trgt.c	Mon Jan 13 19:08:25 2014	(r260601)
@@ -53,6 +53,18 @@ __FBSDID("$FreeBSD$");
 
 #include "kgdb.h"
 
+#ifdef CROSS_DEBUGGER
+/*
+ * We suppress the call to add_target() of core_ops in corelow.c because if
+ * there are multiple core_stratum targets, the find_core_target() function
+ * won't know which one to return and returns none. We need it to return
+ * our target. We only have to do that when we're building a cross-debugger
+ * because fbsd-threads.c is part of a native debugger and it too defines
+ * coreops_suppress_target with 1 as the initializer.
+ */
+int coreops_suppress_target = 1;
+#endif
+
 static CORE_ADDR stoppcbs;
 
 static void	kgdb_core_cleanup(void *);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201401131908.s0DJ8P6B021498>