Example #1
0
SBError
SBPlatform::Put (SBFileSpec &src,
                 SBFileSpec &dst)
{
  return ExecuteConnected(
      [&](const lldb::PlatformSP& platform_sp)
      {
          if (src.Exists())
          {
              uint32_t permissions = src.ref().GetPermissions();
              if (permissions == 0)
              {
                  if (src.ref().GetFileType() == FileSpec::eFileTypeDirectory)
                      permissions = eFilePermissionsDirectoryDefault;
                  else
                      permissions = eFilePermissionsFileDefault;
              }

              return platform_sp->PutFile(src.ref(), dst.ref(), permissions);
          }

          Error error;
          error.SetErrorStringWithFormat("'src' argument doesn't exist: '%s'", src.ref().GetPath().c_str());
          return error;
      });
}
Example #2
0
SBError
SBPlatform::Install (SBFileSpec &src,
                     SBFileSpec &dst)
{
  return ExecuteConnected(
      [&](const lldb::PlatformSP& platform_sp)
      {
          if (src.Exists())
              return platform_sp->Install(src.ref(), dst.ref());

          Error error;
          error.SetErrorStringWithFormat("'src' argument doesn't exist: '%s'", src.ref().GetPath().c_str());
          return error;
      });
}
Example #3
0
SBError
SBPlatform::Get (SBFileSpec &src,
                 SBFileSpec &dst)
{
    SBError sb_error;
    PlatformSP platform_sp(GetSP());
    if (platform_sp)
    {
        sb_error.ref() = platform_sp->GetFile(src.ref(), dst.ref());
    }
    else
    {
        sb_error.SetErrorString("invalid platform");
    }
    return sb_error;
}
Example #4
0
void SBLaunchInfo::SetExecutableFile(SBFileSpec exe_file,
                                     bool add_as_first_arg) {
  LLDB_RECORD_METHOD(void, SBLaunchInfo, SetExecutableFile,
                     (lldb::SBFileSpec, bool), exe_file, add_as_first_arg);

  m_opaque_sp->SetExecutableFile(exe_file.ref(), add_as_first_arg);
}
Example #5
0
void
SBAttachInfo::SetExecutable (SBFileSpec exe_file)
{
    if (exe_file.IsValid())
        m_opaque_sp->GetExecutableFile() = exe_file.ref();
    else
        m_opaque_sp->GetExecutableFile().Clear();
}
Example #6
0
uint32_t SBCompileUnit::FindSupportFileIndex(uint32_t start_idx,
                                             const SBFileSpec &sb_file,
                                             bool full) {
  if (m_opaque_ptr) {
    FileSpecList &support_files = m_opaque_ptr->GetSupportFiles();
    return support_files.FindFileIndex(start_idx, sb_file.ref(), full);
  }
  return 0;
}
Example #7
0
size_t
SBSourceManager::DisplaySourceLinesWithLineNumbers
(
    const SBFileSpec &file,
    uint32_t line,
    uint32_t context_before,
    uint32_t context_after,
    const char *current_line_cstr,
    SBStream &s
)
{
    if (m_opaque_ap.get() == NULL)
        return 0;

    return m_opaque_ap->DisplaySourceLinesWithLineNumbers (file.ref(),
                                                           line,
                                                           context_before,
                                                           context_after,
                                                           current_line_cstr,
                                                           s.get());
}
Example #8
0
uint32_t SBFileSpecList::FindFileIndex(uint32_t idx, const SBFileSpec &sb_file,
                                       bool full) {
  return m_opaque_ap->FindFileIndex(idx, sb_file.ref(), full);
}
Example #9
0
bool SBFileSpecList::AppendIfUnique(const SBFileSpec &sb_file) {
  return m_opaque_ap->AppendIfUnique(sb_file.ref());
}
Example #10
0
void SBFileSpecList::Append(const SBFileSpec &sb_file) {
  m_opaque_ap->Append(sb_file.ref());
}