diff options
author | Ravitheja Addepally <ravitheja.addepally@intel.com> | 2015-10-28 09:47:29 +0000 |
---|---|---|
committer | Ravitheja Addepally <ravitheja.addepally@intel.com> | 2015-10-28 09:47:29 +0000 |
commit | f546b411d01f5d320f6a840ea861b6f0c58eee96 (patch) | |
tree | a1fa89e5d0ed59ac6895f5438eb8318104f25d0d /lldb/source/Plugins/DynamicLoader/POSIX-DYLD/DynamicLoaderPOSIXDYLD.cpp | |
parent | 53ae707e3907ace69022c29d0ab4e14357fa2fef (diff) | |
download | bcm5719-llvm-f546b411d01f5d320f6a840ea861b6f0c58eee96.tar.gz bcm5719-llvm-f546b411d01f5d320f6a840ea861b6f0c58eee96.zip |
Changes for Bug 17384
Summary:
Virtual dynamic shared objects, or vdso files were
not loaded for Linux OS.In Bug 17384 the call
stack could not be unwinded from functions
residing in the vdso object.
This commit adds support for loading such files by
reading the Aux vectors since a vdso is invisibily
mapped to the inferiors address space and the
actual file is not present in the filesystem. The
presence of the vdso is detected by inspecting
the Aux vector for AT_SYSINFO_EHDR tag.
Reviewers: lldb-commits, ovyalov, tberghammer
Subscribers: lldb-commits
Differential Revision: http://reviews.llvm.org/D14118
llvm-svn: 251505
Diffstat (limited to 'lldb/source/Plugins/DynamicLoader/POSIX-DYLD/DynamicLoaderPOSIXDYLD.cpp')
-rw-r--r-- | lldb/source/Plugins/DynamicLoader/POSIX-DYLD/DynamicLoaderPOSIXDYLD.cpp | 26 |
1 files changed, 24 insertions, 2 deletions
diff --git a/lldb/source/Plugins/DynamicLoader/POSIX-DYLD/DynamicLoaderPOSIXDYLD.cpp b/lldb/source/Plugins/DynamicLoader/POSIX-DYLD/DynamicLoaderPOSIXDYLD.cpp index e563ad66b4a..6ba7b470d74 100644 --- a/lldb/source/Plugins/DynamicLoader/POSIX-DYLD/DynamicLoaderPOSIXDYLD.cpp +++ b/lldb/source/Plugins/DynamicLoader/POSIX-DYLD/DynamicLoaderPOSIXDYLD.cpp @@ -91,7 +91,8 @@ DynamicLoaderPOSIXDYLD::DynamicLoaderPOSIXDYLD(Process *process) m_load_offset(LLDB_INVALID_ADDRESS), m_entry_point(LLDB_INVALID_ADDRESS), m_auxv(), - m_dyld_bid(LLDB_INVALID_BREAK_ID) + m_dyld_bid(LLDB_INVALID_BREAK_ID), + m_vdso_base(LLDB_INVALID_ADDRESS) { } @@ -126,6 +127,8 @@ DynamicLoaderPOSIXDYLD::DidAttach() if (log) log->Printf ("DynamicLoaderPOSIXDYLD::%s pid %" PRIu64 " executable '%s', load_offset 0x%" PRIx64, __FUNCTION__, m_process ? m_process->GetID () : LLDB_INVALID_PROCESS_ID, executable_sp ? executable_sp->GetFileSpec().GetPath().c_str () : "<null executable>", load_offset); + EvalVdsoStatus(); + // if we dont have a load address we cant re-base bool rebase_exec = (load_offset == LLDB_INVALID_ADDRESS) ? false : true; @@ -213,6 +216,7 @@ DynamicLoaderPOSIXDYLD::DidLaunch() executable = GetTargetExecutable(); load_offset = ComputeLoadOffset(); + EvalVdsoStatus(); if (executable.get() && load_offset != LLDB_INVALID_ADDRESS) { @@ -503,7 +507,15 @@ DynamicLoaderPOSIXDYLD::LoadAllCurrentModules() // that ourselves here. ModuleSP executable = GetTargetExecutable(); m_loaded_modules[executable] = m_rendezvous.GetLinkMapAddress(); - + if (m_vdso_base != LLDB_INVALID_ADDRESS) + { + FileSpec file_spec("[vdso]", false); + ModuleSP module_sp = LoadModuleAtAddress(file_spec, LLDB_INVALID_ADDRESS, m_vdso_base, false); + if (module_sp.get()) + { + module_list.Append(module_sp); + } + } for (I = m_rendezvous.begin(), E = m_rendezvous.end(); I != E; ++I) { ModuleSP module_sp = LoadModuleAtAddress(I->file_spec, I->link_addr, I->base_addr, true); @@ -551,6 +563,16 @@ DynamicLoaderPOSIXDYLD::ComputeLoadOffset() return m_load_offset; } +void +DynamicLoaderPOSIXDYLD::EvalVdsoStatus() +{ + AuxVector::iterator I = m_auxv->FindEntry(AuxVector::AT_SYSINFO_EHDR); + + if (I != m_auxv->end()) + m_vdso_base = I->value; + +} + addr_t DynamicLoaderPOSIXDYLD::GetEntryPoint() { |