From owner-svn-src-head@FreeBSD.ORG Tue Dec 3 18:12:52 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 440D83D3; Tue, 3 Dec 2013 18:12:52 +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 30C501704; Tue, 3 Dec 2013 18:12:52 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rB3ICq4u029749; Tue, 3 Dec 2013 18:12:52 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rB3ICqBW029748; Tue, 3 Dec 2013 18:12:52 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201312031812.rB3ICqBW029748@svn.freebsd.org> From: Ed Maste Date: Tue, 3 Dec 2013 18:12:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r258873 - head/contrib/llvm/tools/lldb/source/Plugins/DynamicLoader/POSIX-DYLD X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 03 Dec 2013 18:12:52 -0000 Author: emaste Date: Tue Dec 3 18:12:51 2013 New Revision: 258873 URL: http://svnweb.freebsd.org/changeset/base/258873 Log: Workaround lldb issue with main module base address On FreeBSD lldb sometimes reloads the the main module's (executable's) symbols at the wrong address. Work around this for now by explicitly reloading at base_address=0 when it happens. A proper fix is needed but early testers have reported this issue so this workaround should allow them to make further progress. http://llvm.org/bugs/show_bug.cgi?id=17880 Modified: head/contrib/llvm/tools/lldb/source/Plugins/DynamicLoader/POSIX-DYLD/DynamicLoaderPOSIXDYLD.cpp Modified: head/contrib/llvm/tools/lldb/source/Plugins/DynamicLoader/POSIX-DYLD/DynamicLoaderPOSIXDYLD.cpp ============================================================================== --- head/contrib/llvm/tools/lldb/source/Plugins/DynamicLoader/POSIX-DYLD/DynamicLoaderPOSIXDYLD.cpp Tue Dec 3 18:12:39 2013 (r258872) +++ head/contrib/llvm/tools/lldb/source/Plugins/DynamicLoader/POSIX-DYLD/DynamicLoaderPOSIXDYLD.cpp Tue Dec 3 18:12:51 2013 (r258873) @@ -454,6 +454,17 @@ DynamicLoaderPOSIXDYLD::LoadAllCurrentMo const char *module_path = I->path.c_str(); FileSpec file(module_path, false); ModuleSP module_sp = LoadModuleAtAddress(file, I->link_addr, I->base_addr); +#ifdef __FreeBSD__ // llvm.org/pr17880 + if (module_sp == executable) + { + Log *log(GetLogIfAnyCategoriesSet(LIBLLDB_LOG_DYNAMIC_LOADER)); + if (log) + log->Printf("DynamicLoaderPOSIXDYLD::%s reloading main module, ignoring rendezvous base addr %" PRIx64, + __FUNCTION__, I->base_addr); + ModuleSP module_sp = LoadModuleAtAddress(file, I->link_addr, 0); + } +#endif + if (module_sp.get()) { module_list.Append(module_sp);