示例#1
0
/*
 * GetLineNum
 */
bool GetLineNum( address *addr, char *fname, DWORD bufsize, DWORD *line )
{
    cue_handle  *cueh;

    cueh = walloca( DIPHandleSize( HK_CUE ) );
    if( DIPAddrCue( NO_MOD, *addr, cueh ) == SR_NONE ) {
        return( false );
    }
    DIPCueFile( cueh, fname, bufsize );
    *line = DIPCueLine( cueh );
    return( true );
}
示例#2
0
STATIC file_info  *loadFileInfo( mod_info *curr_mod, sym_handle *sym )
/********************************************************************/
{
    file_info       *sym_file;
    cue_handle      *ch;
    cue_fileid      fid;
    int             file_count;
    int             count;
    location_list   ll;

    if( DIPSymLocation( sym, NULL, &ll ) != DS_OK ) {
        return( curr_mod->mod_file[0] );
    }
    ch = alloca( DIPHandleSize( HK_CUE, false ) );
    switch( DIPAddrCue( curr_mod->mh, ll.e[0].u.addr, ch ) ) {
    case SR_NONE:
    case SR_FAIL:
        return( curr_mod->mod_file[0] );
    }
    fid = DIPCueFileId( ch );
    file_count = curr_mod->file_count;
    for( count = 0; count < file_count; ++count ) {
        sym_file = curr_mod->mod_file[count];
        if( sym_file->fid == fid ) {
            return( sym_file );
        }
    }
    curr_mod->file_count++;
    curr_mod->mod_file = ProfRealloc( curr_mod->mod_file, curr_mod->file_count * sizeof( pointer ) );
    count = DIPCueFile( ch, NULL, 0 ) + 1;
    sym_file = ProfCAlloc( sizeof( file_info ) + count );
    sym_file->fid = fid;
    DIPCueFile( ch, sym_file->name, count );
    initRoutineInfo( sym_file );
    curr_mod->mod_file[file_count] = sym_file;
    return( sym_file );
}