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
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;
}