Changeset 266
- Timestamp:
- 10/14/06 17:22:47 (2 years ago)
- Files:
-
- trunk/ddl/coff/COFFBinary.d (modified) (4 diffs)
- trunk/ddl/coff/COFFImage.d (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/ddl/coff/COFFBinary.d
r263 r266 75 75 public: 76 76 // 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; 79 80 80 81 COFF_TYPE coffType = COFF_TYPE.UNKNOWN; … … 250 251 COFFRelocationRecord[] relocs; // relocations 251 252 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 } 253 282 254 283 // add blocks according to alignment 255 publicvoid addData(ubyte[] newBlock)284 void addData(ubyte[] newBlock) 256 285 { 257 286 if(data.length == 0) … … 267 296 268 297 // 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) 270 299 { 271 300 if(offset >= data.length) … … 279 308 return &data[offset]; 280 309 } 281 282 // properties283 uint flags() { return header.Characteristics; }284 285 void* getData( uint ofs )286 {287 assert( ofs < data.length );288 return &data[ofs];289 }290 291 310 292 311 } trunk/ddl/coff/COFFImage.d
r263 r266 125 125 valid = parse( file ); 126 126 } 127 catch( ReadException e )127 catch( Exception e ) 128 128 { 129 129 writefln( "read exception: " ~ e.toString ); … … 207 207 uint debug_dir = RVA2Offset( datadir.Debug.RVA ); 208 208 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); 210 210 211 211 // can only handle 1 debug directory right now
