Changeset 21

Show
Ignore:
Timestamp:
09/13/05 18:13:09 (3 years ago)
Author:
pragma
Message:

bugfixed bless and added the ddlinfo utility. Also bugfixed some bits in the OMF loader.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/bless.d

    r19 r21  
    3838 
    3939char[] helpText =  
    40 "Bless - DDL wrapper utility - V1.0 
     40"Bless - DDL wrapper utility - V1.1 
    4141Copyright (C) 2005 Eric Anderton 
    4242Documentation: http://www.dsource.org/projects/ddl 
     
    6161    if(args.length == 1){ 
    6262        writefln("%s",helpText); 
    63         writefln("\nSupported Object Extensions:"); 
     63        writefln("Supported Object Extensions:"); 
    6464        foreach(char[] ext; getDDLSupportedExtensions()){ 
    6565            writef("%s ",ext);   
     
    9696            return 1; 
    9797        } 
    98          
    99         writefln("arg: '%s'",args[i]); 
    100          
     98                 
    10199        // get args that are glommed together (eg. -xvnf"Hello world.obj") 
    102100        bit done = false; 
     
    131129        } 
    132130    } 
     131 
     132    // force lower case 
     133    extension = std.string.tolower(extension);   
    133134     
    134135    // validate the extension 
     
    180181     
    181182        // (attempt to) load the binary file 
    182         DynamicLibrary lib = loadDDL(filename,"omf"); 
     183        DynamicLibrary lib = loadDDL(filename,extension); 
    183184        ubyte[] binaryData = cast(ubyte[])std.file.read(filename); 
    184185 
  • trunk/ddl/omf/OMFBinary.d

    r19 r21  
    521521            if(dataType < 0x51){ 
    522522                debug writefln("COMDEF %s: segment #%d",communalName,dataType);  
     523                throw new FeatureNotSupportedException( 
     524                    std.string.format("COMDEF segment number only for %s is not supported",communalName,dataType) 
     525                ); 
    523526            } 
    524527            else if(dataType == 0x61){ 
     
    533536            else{ 
    534537                throw new FeatureNotSupportedException( 
    535                     std.string.format("COMDEF type %0.2X is not supported",dataType) 
     538                    std.string.format("COMDEF type %0.2X is not supported for %s",dataType,communalName) 
    536539                ); 
    537540            } 
     
    563566        uint grpIdx = cursor.getIndex(); // thrown out 
    564567        uint segIdx = cursor.getIndex(); 
    565         if(segIdx == 0) cursor.getWord(); // ignored 
     568         
     569        //TODO: verify what rule this is  
     570        if(segIdx == 0) cursor.getWord(); // ignored  
    566571         
    567572        uint nameIdx = cursor.getIndex(); 
     
    671676        // create addresses for all of the public symbols        
    672677        foreach(inout PublicSymbol pub; this.publics){ 
     678            //printf("name: %.*s segindex: %d offset: %d\n",pub.name,pub.segmentIndex,pub.offset); 
     679            if(pub.segmentIndex == 0) continue; // workaround for __nullext being located at 0:0 
     680             
    673681            pub.address = &this.segments[pub.segmentIndex].data[pub.offset]; 
    674682        } 
  • trunk/ddl/omf/OMFLoader.d

    r19 r21  
    5656        // load object format 
    5757        OMFModule mod = new OMFModule(stream); 
    58         lib.addModule(mod);      
     58        lib.addModule(mod); 
     59         
     60        return lib; 
    5961    } 
    6062     
  • trunk/ddltest.d

    r19 r21  
    3333    //test3(); 
    3434    //test4(); 
    35     test5(); 
     35    //test5(); 
     36    test6(); 
    3637} 
  • trunk/test/all.d

    r19 r21  
    3030import test.test4; 
    3131import test.test5; 
     32import test.test6; 
  • trunk/test/test5.d

    r19 r21  
    1 /* 
     1/+ 
    22    Copyright (c) 2005 Eric Anderton 
    33         
     
    2222    FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 
    2323    OTHER DEALINGS IN THE SOFTWARE. 
    24 *
     24+
    2525module test.test5; 
    2626