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 *);
_______________________________________________
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to