Expose SBPlatform through the public API.

Example code:

remote_platform = lldb.SBPlatform("remote-macosx"); 
remote_platform.SetWorkingDirectory("/private/tmp")
debugger.SetSelectedPlatform(remote_platform)

connect_options = lldb.SBPlatformConnectOptions("connect://localhost:1111"); 
err = remote_platform.ConnectRemote(connect_options)
if err.Success():
    print >> result, 'Connected to remote platform:'
    print >> result, 'hostname: %s' % (remote_platform.GetHostname())
    src = lldb.SBFileSpec("/Applications/Xcode.app/Contents/SharedFrameworks/LLDB.framework", False)
    dst = lldb.SBFileSpec()
    # copy src to platform working directory since "dst" is empty
    err = remote_platform.Install(src, dst);
    if err.Success():
        print >> result, '%s installed successfully' % (src)
    else:
        print >> result, 'error: failed to install "%s": %s' % (src, err)


Implemented many calls needed in lldb-platform to be able to install a directory that contains symlinks, file and directories.

The remote lldb-platform can now launch GDB servers on the remote system so that remote debugging can be spawned through the remote platform when connected to a remote platform.

The API in SBPlatform is subject to change and will be getting many new functions.

llvm-svn: 195273
This commit is contained in:
Greg Clayton
2013-11-20 21:07:01 +00:00
parent 884bde3031
commit fbb7634934
56 changed files with 2910 additions and 549 deletions

View File

@@ -162,6 +162,27 @@ SBModule::SetPlatformFileSpec (const lldb::SBFileSpec &platform_file)
return result;
}
lldb::SBFileSpec
SBModule::GetRemoteInstallFileSpec ()
{
SBFileSpec sb_file_spec;
ModuleSP module_sp (GetSP ());
if (module_sp)
sb_file_spec.SetFileSpec (module_sp->GetRemoteInstallFileSpec());
return sb_file_spec;
}
bool
SBModule::SetRemoteInstallFileSpec (lldb::SBFileSpec &file)
{
ModuleSP module_sp (GetSP ());
if (module_sp)
{
module_sp->SetRemoteInstallFileSpec(file.ref());
return true;
}
return false;
}
const uint8_t *