Пример #1
0
Module::Module( const char *name, WCValSList<String> & enabled,
                WCValSList<String> & disabled )
//------------------------------------------------------------
{
    WCPtrOrderedVector<ComponentFile> components;
    FileInfo                          finf( name );
    int                               i;
    MsgRetType                        ret;

    _dataFile = new ElfFile( name, false );

    DwarfFileMerger merger( name, enabled, disabled );

    if( !merger.upToDate() ) {
        if( !finf.exists() ) {
            merger.doMerge();
        } else {
            if( enabled.entries() != 0 ) {
                ret = WMessageDialog::messagef( topWindow,
                        MsgQuestion, MsgYesNo, "Source Browser",
                        "Database %s is not consistent with module files.\n"
                        "Merge the database now?", name );

                if( ret == MsgRetYes ) {
                    merger.doMerge();
                }
            }
        }
    }

    _dataFile->initSections();

    _dataFile->getEnabledComponents( &components );
    for( i = 0; i < components.entries(); i += 1 ) {
        _enabledFiles.add( new WFileName( components[i]->name ) );
    }

    components.clear();
    _dataFile->getDisabledComponents( &components );
    for( i = 0; i < components.entries(); i += 1 ) {
        _disabledFiles.add( new WFileName( components[i]->name ) );
    }

    checkSourceTime();

    _dbgInfo = DRDbgInit( this, _dataFile->getDRSizes(), false );
    DRSetDebug( _dbgInfo );
}
Пример #2
0
void DTViewClass::addDescriptions()
//---------------------------------
// add the non-symbol lines
{
    int             i;
    ClassMember *   mem;
    dr_access       prevAccess = (dr_access) 0;
    dr_handle       prevParent = _symbol->getHandle();
    char *          tmpName;
    WCPtrOrderedVector<ClassMember> desc;

    for( i = 0; i < _members->entries(); i += 1 ) {
        mem  = (*_members)[ i ];
        if( mem->_parent != prevParent ) {
            prevAccess = (dr_access) 0;
            prevParent = mem->_parent;
            if( mem->_parent ) {
                tmpName = DRGetName( mem->_parent );
            } else {
                tmpName = NULL;
            }
            desc.append( new ClassMember( mem->_parent, (dr_access) 0,
                                tmpName ) );
            WBRFree( tmpName );
        }
        if( mem->_access != prevAccess ) {
            prevAccess = mem->_access;
            desc.append( new ClassMember( mem->_parent, mem->_access,
                                AccessStr[ mem->_access ] ) );
        }
    }

    for( i = 0; i < desc.entries(); i += 1 ) {
        _members->insert( desc[ i ] );
    }

    desc.clear();       // don't own elements, so don't destroy
}