From owner-svn-src-all@FreeBSD.ORG Mon Jan 13 19:08:26 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 20EE4DD8; Mon, 13 Jan 2014 19:08:26 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 0CAEF1D5C; Mon, 13 Jan 2014 19:08:26 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id s0DJ8PoK021499; Mon, 13 Jan 2014 19:08:25 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id s0DJ8P6B021498; Mon, 13 Jan 2014 19:08:25 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201401131908.s0DJ8P6B021498@svn.freebsd.org> From: Marcel Moolenaar Date: Mon, 13 Jan 2014 19:08:25 +0000 (UTC) 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 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Jan 2014 19:08:26 -0000 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 *);