Ignore:
Timestamp:
Aug 2, 2007, 11:23:36 PM (17 years ago)
Author:
dai_9181
Message:

Linkerの骨格を作成した

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/abdev/BasicCompiler_Common/include/NativeCode.h

    r257 r258  
    5050    {
    5151    }
    52     Schedule( Type type, long offset )
     52    Schedule( Type type, long offset, LONG_PTR lpValue = 0 )
    5353        : type( type )
    5454        , offset( offset )
    55         , lpValue( 0 )
    56     {
    57     }
    58     Schedule( const ::UserProc *pUserProc, long offest )
     55        , lpValue( lpValue )
     56    {
     57    }
     58    Schedule( const ::UserProc *pUserProc, long offset )
    5959        : type( Schedule::UserProc )
    6060        , offset( offset )
     
    6262    {
    6363    }
    64     Schedule( const ::DllProc *pDllProc, long offest )
     64    Schedule( const ::DllProc *pDllProc, long offset )
    6565        : type( Schedule::DllProc )
    6666        , offset( offset )
     
    8080        return offset;
    8181    }
     82    LONG_PTR GetLongPtrValue() const
     83    {
     84        return lpValue;
     85    }
    8286    const ::DllProc &GetDllProc() const
    8387    {
     
    9094    const ::UserProc &GetUserProc() const
    9195    {
    92         if( type != Schedule::UserProc )
     96        if( !( type == Schedule::UserProc || type == Schedule::AddressOf ) )
    9397        {
    9498            SetError();
     
    181185    {
    182186    }
    183     NativeCode( const NativeCode &nativeCode )
     187    NativeCode( const NativeCode &nativeCode, bool isOpBuffer )
    184188        : allocateSize( 8192 )
    185189        , codeBuffer( (char *)malloc( allocateSize ) )
    186190        , size( 0 )
    187191    {
    188         Put( nativeCode );
     192        Put( nativeCode, isOpBuffer );
    189193    }
    190194    NativeCode( const char *codeBuffer, int size )
     
    207211    {
    208212        Clear();
    209         Put( nativeCode );
     213        Put( nativeCode, false );
    210214    }
    211215
     
    250254    }
    251255
    252     void Put( const char *codeBuffer, int size )
     256    void Put( const char *codeBuffer, int size, bool isOpBuffer = true )
    253257    {
    254258        Realloc( this->size + size );
     
    258262
    259263        // 未完成
    260         extern char *OpBuffer;
    261         extern int obp;
    262         memcpy( OpBuffer + obp, codeBuffer, size );
    263         ObpPlus( size );
    264     }
    265     void Put( const NativeCode &nativeCode );
     264        if( isOpBuffer )
     265        {
     266            extern char *OpBuffer;
     267            extern int obp;
     268            memcpy( OpBuffer + obp, codeBuffer, size );
     269            ObpPlus( size );
     270        }
     271    }
     272    void Put( const NativeCode &nativeCode, bool isOpBuffer );
    266273    void Put( _int64 i64data )
    267274    {
Note: See TracChangeset for help on using the changeset viewer.