aboutsummaryrefslogtreecommitdiff
path: root/gnu
diff options
context:
space:
mode:
authorMarcel Moolenaar <marcel@FreeBSD.org>2014-01-13 19:08:25 +0000
committerMarcel Moolenaar <marcel@FreeBSD.org>2014-01-13 19:08:25 +0000
commit2d34114497ebf7f09b864b35b9c8c885d71637a2 (patch)
treec8961c984430c77eed1fc88f9ea75f3c57f77833 /gnu
parentcfe2be2b5e194a2349a0de60a43e56598321753e (diff)
downloadsrc-2d34114497ebf7f09b864b35b9c8c885d71637a2.tar.gz
src-2d34114497ebf7f09b864b35b9c8c885d71637a2.zip
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.
Notes
Notes: svn path=/head/; revision=260601
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 85065ccc383a..b2f61890b2a7 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 *);