コード例 #1
0
bool
PlatformRemoteGDBServer::SetRemoteWorkingDirectory(const lldb_private::ConstString &path)
{
    if (IsConnected())
    {
        // Clear the working directory it case it doesn't get set correctly. This will
        // for use to re-read it
        Log *log = GetLogIfAnyCategoriesSet(LIBLLDB_LOG_PLATFORM);
        if (log)
            log->Printf("PlatformRemoteGDBServer::SetRemoteWorkingDirectory('%s')", path.GetCString());
        return m_gdb_client.SetWorkingDir(path.GetCString()) == 0;
    }
    else
        return Platform::SetRemoteWorkingDirectory(path);
}
コード例 #2
0
ファイル: SymbolFilePDB.cpp プロジェクト: kraj/lldb
uint32_t SymbolFilePDB::FindTypes(
    const lldb_private::SymbolContext &sc,
    const lldb_private::ConstString &name,
    const lldb_private::CompilerDeclContext *parent_decl_ctx, bool append,
    uint32_t max_matches,
    llvm::DenseSet<lldb_private::SymbolFile *> &searched_symbol_files,
    lldb_private::TypeMap &types) {
  if (!append)
    types.Clear();
  if (!name)
    return 0;

  searched_symbol_files.clear();
  searched_symbol_files.insert(this);

  std::string name_str = name.AsCString();

  // If this might be a regex, we have to return EVERY symbol and process them
  // one by one, which is going
  // to destroy performance on large PDB files.  So try really hard not to use a
  // regex match.
  if (name_str.find_first_of("[]?*.-+\\") != std::string::npos)
    FindTypesByRegex(name_str, max_matches, types);
  else
    FindTypesByName(name_str, max_matches, types);
  return types.GetSize();
}
コード例 #3
0
ファイル: SymbolFileSymtab.cpp プロジェクト: ztianjin/lldb
uint32_t
SymbolFileSymtab::FindTypes (const lldb_private::SymbolContext& sc, 
                             const lldb_private::ConstString &name, 
                             const ClangNamespaceDecl *namespace_decl, 
                             bool append, 
                             uint32_t max_matches, 
                             lldb_private::TypeList& types)
{
    if (!append)
        types.Clear();
        
    if (!m_objc_class_name_to_index.IsEmpty())
    {
        TypeMap::iterator iter = m_objc_class_types.find(name);
        
        if (iter != m_objc_class_types.end())
        {
            types.Insert(iter->second);
            return 1;
        }
        
        const Symtab::NameToIndexMap::Entry *match = m_objc_class_name_to_index.FindFirstValueForName(name.GetCString());
        
        if (match == NULL)
            return 0;
                    
        const bool isForwardDecl = false;
        const bool isInternal = true;
        
        ClangASTContext &ast = GetClangASTContext();
        
        lldb::clang_type_t objc_object_type = ast.CreateObjCClass (name.AsCString(), 
                                                                   ast.GetTranslationUnitDecl(), 
                                                                   isForwardDecl, 
                                                                   isInternal,
                                                                   0xffaaffaaffaaffaall);
        
        Declaration decl;
        
        lldb::TypeSP type(new Type (match->value,
                                    this,
                                    name,
                                    0,      // byte_size - don't change this from 0, we currently use that to identify these "synthetic" ObjC class types.
                                    NULL,   // SymbolContextScope*
                                    0,      // encoding_uid
                                    Type::eEncodingInvalid,
                                    decl,
                                    objc_object_type,
                                    Type::eResolveStateFull));
        
        m_objc_class_types[name] = type;
        
        types.Insert(type);
        
        return 1;
    }

    return 0;
}
コード例 #4
0
ファイル: NameToDIE.cpp プロジェクト: eightcien/lldb
size_t
NameToDIE::Find (const lldb_private::ConstString &name, std::vector<Info> &info_array) const
{
    const char *name_cstr = name.AsCString();
    const size_t initial_info_array_size = info_array.size();
    collection::const_iterator pos, end = m_collection.end();
    for (pos = m_collection.lower_bound (name_cstr); pos != end && pos->first == name_cstr; ++pos)
    {
        info_array.push_back (pos->second);
    }
    return info_array.size() - initial_info_array_size;
}