Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 3 Dec 2013 18:12:52 +0000 (UTC)
From:      Ed Maste <emaste@FreeBSD.org>
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
Message-ID:  <201312031812.rB3ICqBW029748@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
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);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201312031812.rB3ICqBW029748>