summaryrefslogtreecommitdiffstats
path: root/lldb/source/Core/Module.cpp
diff options
context:
space:
mode:
authorGreg Clayton <gclayton@apple.com>2012-03-27 21:10:07 +0000
committerGreg Clayton <gclayton@apple.com>2012-03-27 21:10:07 +0000
commit741f3f9a5577ae5e8c2f594e1d5df70ac78092ce (patch)
treee0809897ef60ab37589c72526b9b6d2e6d7bc963 /lldb/source/Core/Module.cpp
parent52656d1047f53dd7018922793e132da87f7b52ff (diff)
downloadbcm5719-llvm-741f3f9a5577ae5e8c2f594e1d5df70ac78092ce.tar.gz
bcm5719-llvm-741f3f9a5577ae5e8c2f594e1d5df70ac78092ce.zip
lldb_private::Section objects have a boolean flag that can be set that
indicates that the section is thread specific. Any functions the load a module given a slide, will currently ignore any sections that are thread specific. lldb_private::Section now has: bool Section::IsThreadSpecific () const { return m_thread_specific; } void Section::SetIsThreadSpecific (bool b) { m_thread_specific = b; } The ELF plug-in has been modified to set this for the ".tdata" and the ".tbss" sections. Eventually we need to have each lldb_private::Thread subclass be able to resolve a thread specific section, but for now they will just not resolve. The code for that should be trivual to add, but the address resolving functions will need to be changed to take a "ExecutionContext" object instead of just a target so that thread specific sections can be resolved. llvm-svn: 153537
Diffstat (limited to 'lldb/source/Core/Module.cpp')
-rw-r--r--lldb/source/Core/Module.cpp17
1 files changed, 9 insertions, 8 deletions
diff --git a/lldb/source/Core/Module.cpp b/lldb/source/Core/Module.cpp
index 48fc499c91b..8ef4430119c 100644
--- a/lldb/source/Core/Module.cpp
+++ b/lldb/source/Core/Module.cpp
@@ -1104,11 +1104,11 @@ Module::SetArchitecture (const ArchSpec &new_arch)
bool
Module::SetLoadAddress (Target &target, lldb::addr_t offset, bool &changed)
{
- changed = false;
- ObjectFile *image_object_file = GetObjectFile();
- if (image_object_file)
+ size_t num_loaded_sections = 0;
+ ObjectFile *objfile = GetObjectFile();
+ if (objfile)
{
- SectionList *section_list = image_object_file->GetSectionList ();
+ SectionList *section_list = objfile->GetSectionList ();
if (section_list)
{
const size_t num_sections = section_list->GetSize();
@@ -1119,16 +1119,17 @@ Module::SetLoadAddress (Target &target, lldb::addr_t offset, bool &changed)
// first section that starts of file offset zero and that
// has bytes in the file...
Section *section = section_list->GetSectionAtIndex (sect_idx).get();
- if (section)
+ // Only load non-thread specific sections when given a slide
+ if (section && !section->IsThreadSpecific())
{
if (target.GetSectionLoadList().SetSectionLoadAddress (section, section->GetFileAddress() + offset))
- changed = true;
+ ++num_loaded_sections;
}
}
- return sect_idx > 0;
}
}
- return false;
+ changed = num_loaded_sections > 0;
+ return num_loaded_sections > 0;
}
OpenPOWER on IntegriCloud