aboutsummaryrefslogtreecommitdiff
path: root/lldb/source/API/SBModule.cpp
diff options
context:
space:
mode:
authorGreg Clayton <gclayton@apple.com>2013-07-08 22:22:41 +0000
committerGreg Clayton <gclayton@apple.com>2013-07-08 22:22:41 +0000
commit226cce25116af0f3132941b27492f349f62052a4 (patch)
treeaeee7174537ac09c746b680bcf52cf298ed2a7c0 /lldb/source/API/SBModule.cpp
parent8bad86c81be924bdfe1814da69dafda8b0237503 (diff)
downloadllvm-226cce25116af0f3132941b27492f349f62052a4.zip
llvm-226cce25116af0f3132941b27492f349f62052a4.tar.gz
llvm-226cce25116af0f3132941b27492f349f62052a4.tar.bz2
Added a way to extract the module specifications from a file. A module specification is information that is required to describe a module (executable, shared library, object file, ect). This information includes host path, platform path (remote path), symbol file path, UUID, object name (for objects in .a files for example you could have an object name of "foo.o"), and target triple. Module specification can be used to create a module, or used to add a module to a target. A list of module specifications can be used to enumerate objects in container objects (like universal mach files and BSD archive files).
There are two new classes: lldb::SBModuleSpec lldb::SBModuleSpecList The SBModuleSpec wraps up a lldb_private::ModuleSpec, and SBModuleSpecList wraps up a lldb_private::ModuleSpecList. llvm-svn: 185877
Diffstat (limited to 'lldb/source/API/SBModule.cpp')
-rw-r--r--lldb/source/API/SBModule.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/lldb/source/API/SBModule.cpp b/lldb/source/API/SBModule.cpp
index 11a2c6c..661fa56 100644
--- a/lldb/source/API/SBModule.cpp
+++ b/lldb/source/API/SBModule.cpp
@@ -10,6 +10,7 @@
#include "lldb/API/SBModule.h"
#include "lldb/API/SBAddress.h"
#include "lldb/API/SBFileSpec.h"
+#include "lldb/API/SBModuleSpec.h"
#include "lldb/API/SBProcess.h"
#include "lldb/API/SBStream.h"
#include "lldb/API/SBSymbolContextList.h"
@@ -39,6 +40,19 @@ SBModule::SBModule (const lldb::ModuleSP& module_sp) :
{
}
+SBModule::SBModule(const SBModuleSpec &module_spec) :
+ m_opaque_sp ()
+{
+ ModuleSP module_sp;
+ Error error = ModuleList::GetSharedModule (*module_spec.m_opaque_ap,
+ module_sp,
+ NULL,
+ NULL,
+ NULL);
+ if (module_sp)
+ SetSP(module_sp);
+}
+
SBModule::SBModule(const SBModule &rhs) :
m_opaque_sp (rhs.m_opaque_sp)
{