Пример #1
0
static image_entry *CreateImage( const char *exe, const char *symfile )
{
    image_entry         *image;
    bool                local;
    const char          *curr_name;
    unsigned            curr_len;
    const char          *this_name;
    unsigned            this_len;
    char_ring           *curr;
    open_access         ind;

    if( exe != NULL && symfile == NULL ) {
        local = false;
        this_name = SkipPathInfo( exe, OP_REMOTE );
        this_len = ExtPointer( exe, OP_REMOTE ) - exe;
        for( curr = LocalDebugInfo; curr != NULL; curr = curr->next ) {
            curr_name = SkipPathInfo( curr->name, OP_LOCAL );
            curr_name = RealFName( curr_name, &ind );
            if( curr_name[0] == '@' && curr_name[1] == 'l' )
                curr_name += 2;
            curr_len = ExtPointer( curr_name, OP_LOCAL ) - curr_name;
            local = ( this_len == curr_len && strnicmp( this_name, curr_name, this_len ) == 0 );
            if( local ) {
                symfile = curr->name;
                break;
            }
        }
    }

    _SwitchOn( SW_ERROR_RETURNS );
    image = DoCreateImage( exe, symfile );
    _SwitchOff( SW_ERROR_RETURNS );
    return( image );
}
Пример #2
0
static image_entry *CreateImage( const char *exe, const char *symfile )
{
    image_entry         *image;
    bool                local;
    const char          *curr_name;
    unsigned            curr_len;
    const char          *this_name;
    unsigned            this_len;
    char_ring           *curr;
    obj_attrs           oattrs;

    if( exe != NULL && symfile == NULL ) {
        local = false;
        this_name = SkipPathInfo( exe, OP_REMOTE );
        this_len = ExtPointer( exe, OP_REMOTE ) - exe;
        for( curr = LocalDebugInfo; curr != NULL; curr = curr->next ) {
            oattrs = 0;
            curr_name = SkipPathInfo( curr->name, OP_LOCAL );
            curr_name = RealFName( curr_name, &oattrs );
            if( curr_name[0] == '@' && curr_name[1] == 'l' )
                curr_name += 2;
            curr_len = ExtPointer( curr_name, OP_LOCAL ) - curr_name;
            local = ( this_len == curr_len && strnicmp( this_name, curr_name, this_len ) == 0 );
            if( local ) {
                symfile = curr->name;
                break;
            }
        }
    }
    image = DoCreateImage( exe, symfile );
    if( image == NULL ) {
        ErrorRet( ERR_NONE, LIT_ENG( ERR_NO_MEMORY_FOR_DEBUG ) );
    }
    return( image );
}