summaryrefslogtreecommitdiffstats
path: root/lldb/source/Core/Module.cpp
diff options
context:
space:
mode:
authorGreg Clayton <gclayton@apple.com>2011-09-21 03:57:31 +0000
committerGreg Clayton <gclayton@apple.com>2011-09-21 03:57:31 +0000
commit593577a13a45ee5f7666f412ecbb1e6aa7269e78 (patch)
tree0f8bcdb27eeb3cf48c83349b934c641ffa7893b3 /lldb/source/Core/Module.cpp
parent11ab5f8a020bce5e726ad8880f181ef3d6509f4b (diff)
downloadbcm5719-llvm-593577a13a45ee5f7666f412ecbb1e6aa7269e78.tar.gz
bcm5719-llvm-593577a13a45ee5f7666f412ecbb1e6aa7269e78.zip
The first part of a fix for being able to select an architecture slice from
a file when the target has a triple with an unknown vendor and/or OS and the slice of the file itself has a valid vendor and/or OS. The Module now adopts the ObjectFile's architecture after a valid architecture has been loaded to make sure the module matches the object file. llvm-svn: 140236
Diffstat (limited to 'lldb/source/Core/Module.cpp')
-rw-r--r--lldb/source/Core/Module.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/lldb/source/Core/Module.cpp b/lldb/source/Core/Module.cpp
index dc0c55c483a..e2c921e1430 100644
--- a/lldb/source/Core/Module.cpp
+++ b/lldb/source/Core/Module.cpp
@@ -637,6 +637,13 @@ Module::GetObjectFile()
Timer scoped_timer(__PRETTY_FUNCTION__,
"Module::GetObjectFile () module = %s", GetFileSpec().GetFilename().AsCString(""));
m_objfile_sp = ObjectFile::FindPlugin(this, &m_file, m_object_offset, m_file.GetByteSize());
+ if (m_objfile_sp)
+ {
+ // Once we get the object file, update our module with the object file's
+ // architecture since it might differ in vendor/os if some parts were
+ // unknown.
+ m_objfile_sp->GetArchitecture (m_arch);
+ }
}
return m_objfile_sp.get();
}
OpenPOWER on IntegriCloud