From 2289fa48209997bbda285c8ba2f25fa0f4eac39f Mon Sep 17 00:00:00 2001 From: Greg Clayton Date: Sat, 30 Apr 2011 01:09:13 +0000 Subject: 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://" where 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 --- lldb/source/API/SBModule.cpp | 46 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) (limited to 'lldb/source/API/SBModule.cpp') diff --git a/lldb/source/API/SBModule.cpp b/lldb/source/API/SBModule.cpp index e7e95be1e8bd..427850ec46c2 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 { -- cgit v1.2.3