Example #1
0
/*
 * UnloadDbgInfo
 */
void UnloadDbgInfo( ModuleNode *mod )
{
    if( mod->syminfo != NULL ) {
        DIPUnloadInfo( mod->syminfo->hdl );
        DIPDestroyProcess( mod->syminfo->procinfo );
        MemFree( mod->syminfo );
        mod->syminfo = NULL;
    }
}
Example #2
0
/**
 * Dumps the debug information in a file.
 *
 * @returns 0 on success, exit code on failure.
 * @param   file    The filename.
 * @param   dips    The dips to load and use.
 */
static int DumpFile( const char *file, char **dips )
{
    int             rc = 1;
    dig_fhandle     fh;

    /*
     * Open the file
     */
    fh = DIGCliOpen( file, DIG_READ );
    if( fh == DIG_NIL_HANDLE ) {
        return( ErrorMsg( "Failed to open '%s'\n", file ) );
    }

    /*
     * Init DIP, create a process and load the file into the process.
     */
    if( InitDIP( dips ) ) {
        process_info    *proc = DIPCreateProcess();

        if( proc != NULL ) {
            int         prty;
            mod_handle  mh = 0;

            for( prty = DIPPriority( 0 ); prty != 0; prty = DIPPriority( prty ) ) {
                DIGCliSeek( fh, 0, DIG_ORG );
                mh = DIPLoadInfo( fh, 0, prty );
                if( mh != NO_MOD ) {
                    break;
                }
            }
            if( mh != NO_MOD ) {
                DIPMapInfo( mh, NULL );
                InfoMsg( "DIP opened '%s' at prty=%d, mh=%lx\n", file, prty, (long)mh );

                /*
                 * Enumerate the debug info.
                 */
                rc = DumpIt( file, mh, proc );

                /*
                 * Cleanup.
                 */
                DIPUnloadInfo( mh );
            } else {
                ErrorMsg( "DIP failed to open '%s'.\n", file);
            }
            DIPDestroyProcess( proc );
        }
        TermDIP();
    }
    DIGCliClose( fh );
    return( rc );
}
Example #3
0
void UnLoadImgSymInfo( image_entry *image, bool nofree )
{
    if( image->dip_handle != NO_MOD ) {
        image->nofree = nofree;
        DIPUnloadInfo( image->dip_handle );
        if( nofree ) {
            image->dip_handle = NO_MOD;
            image->nofree = false;
        }
        DbgUpdate( UP_SYMBOLS_LOST );
        FClearOpenSourceCache();
    }
}
Example #4
0
/*
 * SymFileClose - close the current symfile
 */
void SymFileClose( void ) {

    if( curModHdl != NO_MOD ) {
        DIPUnloadInfo( curModHdl );
    }
    if( curProcess != NULL ) {
        DIPDestroyProcess( curProcess );
    }
    if( curFileHdl != -1 ) {
        DIGCliClose( curFileHdl );
    }
    curProcess = NULL;
    curModHdl = NO_MOD;
    curFileHdl = -1;
}