summaryrefslogtreecommitdiffstats
path: root/lldb/source/API/SBModule.cpp
diff options
context:
space:
mode:
authorGreg Clayton <gclayton@apple.com>2011-04-30 01:09:13 +0000
committerGreg Clayton <gclayton@apple.com>2011-04-30 01:09:13 +0000
commit2289fa48209997bbda285c8ba2f25fa0f4eac39f (patch)
tree9923690777bc045d842494ee8a206c91ce1810eb /lldb/source/API/SBModule.cpp
parent3909e037abf5d411c2cdbf0b5ec7d8a0f1dffdc9 (diff)
downloadbcm5719-llvm-2289fa48209997bbda285c8ba2f25fa0f4eac39f.tar.gz
bcm5719-llvm-2289fa48209997bbda285c8ba2f25fa0f4eac39f.zip
Added the ability to set the Platform path for a module through the SBModule
interface. Added a quick way to set the platform though the SBDebugger interface. I will actually an a SBPlatform support soon, but for now this will do. ConnectionFileDescriptor can be passed a url formatted as: "fd://<fd>" where <fd> is a file descriptor in the current process. This is handy if you have services, deamons, or other tools that can spawn processes and give you a file handle. llvm-svn: 130565
Diffstat (limited to 'lldb/source/API/SBModule.cpp')
-rw-r--r--lldb/source/API/SBModule.cpp46
1 files changed, 46 insertions, 0 deletions
diff --git a/lldb/source/API/SBModule.cpp b/lldb/source/API/SBModule.cpp
index e7e95be1e8b..427850ec46c 100644
--- a/lldb/source/API/SBModule.cpp
+++ b/lldb/source/API/SBModule.cpp
@@ -71,6 +71,52 @@ SBModule::GetFileSpec () const
return file_spec;
}
+lldb::SBFileSpec
+SBModule::GetPlatformFileSpec () const
+{
+ LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
+
+ SBFileSpec file_spec;
+ if (m_opaque_sp)
+ file_spec.SetFileSpec(m_opaque_sp->GetPlatformFileSpec());
+
+ if (log)
+ {
+ log->Printf ("SBModule(%p)::GetPlatformFileSpec () => SBFileSpec(%p)",
+ m_opaque_sp.get(), file_spec.get());
+ }
+
+ return file_spec;
+
+}
+
+bool
+SBModule::SetPlatformFileSpec (const lldb::SBFileSpec &platform_file)
+{
+ bool result = false;
+ LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
+
+ if (m_opaque_sp)
+ {
+ m_opaque_sp->SetPlatformFileSpec(*platform_file);
+ result = true;
+ }
+
+ if (log)
+ {
+ log->Printf ("SBModule(%p)::SetPlatformFileSpec (SBFileSpec(%p (%s%s%s)) => %i",
+ m_opaque_sp.get(),
+ platform_file.get(),
+ platform_file->GetDirectory().GetCString(),
+ platform_file->GetDirectory() ? "/" : "",
+ platform_file->GetFilename().GetCString(),
+ result);
+ }
+ return result;
+}
+
+
+
const uint8_t *
SBModule::GetUUIDBytes () const
{
OpenPOWER on IntegriCloud