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.
git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@130565 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/source/API/SBModule.cpp b/source/API/SBModule.cpp
index e7e95be..427850e 100644
--- a/source/API/SBModule.cpp
+++ b/source/API/SBModule.cpp
@@ -71,6 +71,52 @@
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
{