summaryrefslogtreecommitdiffstats
path: root/contrib/llvm/tools
diff options
context:
space:
mode:
authoremaste <emaste@FreeBSD.org>2014-03-19 13:16:58 +0000
committeremaste <emaste@FreeBSD.org>2014-03-19 13:16:58 +0000
commit7327a493ea46f46df221ed1a16d03d1981a284e0 (patch)
tree0888f902ab1b30bbe0225c59f06a491319f69168 /contrib/llvm/tools
parent0c694994982b90cdc0b0492cd1b0e775bbe3d40b (diff)
downloadFreeBSD-src-7327a493ea46f46df221ed1a16d03d1981a284e0.zip
FreeBSD-src-7327a493ea46f46df221ed1a16d03d1981a284e0.tar.gz
MFC r258873: 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 Sponsored by: DARPA, AFRL
Diffstat (limited to 'contrib/llvm/tools')
-rw-r--r--contrib/llvm/tools/lldb/source/Plugins/DynamicLoader/POSIX-DYLD/DynamicLoaderPOSIXDYLD.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/contrib/llvm/tools/lldb/source/Plugins/DynamicLoader/POSIX-DYLD/DynamicLoaderPOSIXDYLD.cpp b/contrib/llvm/tools/lldb/source/Plugins/DynamicLoader/POSIX-DYLD/DynamicLoaderPOSIXDYLD.cpp
index 4284558..284890f 100644
--- a/contrib/llvm/tools/lldb/source/Plugins/DynamicLoader/POSIX-DYLD/DynamicLoaderPOSIXDYLD.cpp
+++ b/contrib/llvm/tools/lldb/source/Plugins/DynamicLoader/POSIX-DYLD/DynamicLoaderPOSIXDYLD.cpp
@@ -454,6 +454,17 @@ DynamicLoaderPOSIXDYLD::LoadAllCurrentModules()
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);
OpenPOWER on IntegriCloud