summaryrefslogtreecommitdiffstats
path: root/gnu
diff options
context:
space:
mode:
authormarcel <marcel@FreeBSD.org>2014-01-13 19:08:25 +0000
committermarcel <marcel@FreeBSD.org>2014-01-13 19:08:25 +0000
commitab97b034c0a2edb1cb900ca69dc54989d4a0421c (patch)
treec8961c984430c77eed1fc88f9ea75f3c57f77833 /gnu
parentf07a13f9eb959ea181c0e0738af880c98a54089d (diff)
downloadFreeBSD-src-ab97b034c0a2edb1cb900ca69dc54989d4a0421c.zip
FreeBSD-src-ab97b034c0a2edb1cb900ca69dc54989d4a0421c.tar.gz
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.
Diffstat (limited to 'gnu')
-rw-r--r--gnu/usr.bin/gdb/kgdb/trgt.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/gnu/usr.bin/gdb/kgdb/trgt.c b/gnu/usr.bin/gdb/kgdb/trgt.c
index 85065cc..b2f6189 100644
--- a/gnu/usr.bin/gdb/kgdb/trgt.c
+++ b/gnu/usr.bin/gdb/kgdb/trgt.c
@@ -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 *);
OpenPOWER on IntegriCloud