Changeset 266

Show
Ignore:
Timestamp:
10/14/06 17:22:47 (2 years ago)
Author:
AgentOrange
Message:

--

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/ddl/coff/COFFBinary.d

    r263 r266  
    7575public: 
    7676// state 
    77     debug static bit verbose = true;    // verbose output 
    78     else  static bit verbose = false;   // silent 
     77//  debug static bit verbose = true;    // verbose output 
     78//  else  static bit verbose = false;   // silent 
     79    static bit verbose = false; 
    7980 
    8081    COFF_TYPE coffType  = COFF_TYPE.UNKNOWN; 
     
    250251    COFFRelocationRecord[]  relocs;     // relocations 
    251252    COFFLineRecord[]        lines;      // line numbers 
    252  
     253     
     254    /* 
     255        properties 
     256    */ 
     257 
     258    uint getIndex() { return index; } 
     259    char[] getName() { return name; } 
     260    char[] getDescription() { return description; } 
     261    char[] getGroupName() { return group; } 
     262    uint getNextInGroup() { return nextInGroup; } 
     263 
     264    // coff section header properties 
     265    uint getFileAddress() { return header.PointerToRawData; } 
     266    uint getFileSize() { return header.SizeOfRawData; } 
     267    uint getAddress() { return header.VirtualAddress; } 
     268    uint getSize() { return header.VirtualSize; } 
     269    uint flags() { return header.Characteristics; } 
     270 
     271    /* 
     272        data management 
     273    */ 
     274 
     275    ubyte[] getData() { return data; } 
     276 
     277    void* getDataAt( uint ofs ) 
     278    { 
     279        assert( ofs < data.length ); 
     280        return &data[ofs]; 
     281    } 
    253282 
    254283    // add blocks according to alignment 
    255     public void addData(ubyte[] newBlock) 
     284    void addData(ubyte[] newBlock) 
    256285    { 
    257286        if(data.length == 0) 
     
    267296 
    268297    // getData - allows for grouped segments to represent neighboring places in memory, in order 
    269     public void* getData(COFFSection[] allSegments,uint offset) 
     298    void* getDataAt(COFFSection[] allSegments,uint offset) 
    270299    { 
    271300        if(offset >= data.length) 
     
    279308        return &data[offset]; 
    280309    } 
    281  
    282     // properties 
    283     uint flags()        { return header.Characteristics;        } 
    284  
    285     void* getData( uint ofs ) 
    286     { 
    287         assert( ofs < data.length ); 
    288         return &data[ofs]; 
    289     } 
    290  
    291310 
    292311} 
  • trunk/ddl/coff/COFFImage.d

    r263 r266  
    125125            valid = parse( file ); 
    126126        } 
    127         catch( ReadException e ) 
     127        catch( Exception e ) 
    128128        { 
    129129            writefln( "read exception: " ~ e.toString ); 
     
    207207        uint debug_dir = RVA2Offset( datadir.Debug.RVA ); 
    208208        uint dircnt = datadir.Debug.Size / COFFImageDebugDirectory.sizeof; 
    209         debug writefln( "Found %d debug director%s at file position 0x%X\n",dircnt,dircnt==1?"y":"ies",debug_dir); 
     209//        debug writefln( "Found %d debug director%s at file position 0x%X\n",dircnt,dircnt==1?"y":"ies",debug_dir); 
    210210         
    211211        // can only handle 1 debug directory right now