Exemple #1
0
extern  void    DFObjLineFiniDbgInfo( void )
/******************************************/
{
    DWFiniDebugLine( Client );
    DWFini( Client );
    FiniLineSegBck();
}
Exemple #2
0
extern  void    DFObjFiniDbgInfo( offset codesize ) {
/******************************/
    segment_id      old;
    offset          here;
    back_handle     bck;

    if( _IsModel( DBG_LOCALS | DBG_TYPES ) ) {
        bck = Comp_High;
        if( bck != NULL ){
            old = SetOP( AskCodeSeg() );
            OutLabel( bck->lbl );
            SetOP( old );
            BEFreeBack( bck );
            Comp_High = NULL;
        }
        DWEndCompileUnit( Client );
        DWFini( Client );
        old = SetOP( UnitSize->segment );
        here = AskLocation();
        SetLocation( UnitSize->offset );
        DataLong( codesize );
        SetLocation( here );
        SetOP( old );
        FiniSegBck();
    }
}
Exemple #3
0
void    BIEnd( void ) {
//===============

    char        fn[_MAX_PATH];

    if( !_GenerateBrInfo() ) return;
    MakeName( SDFName( SrcName ), BrowseExtn, fn );
    DWEndCompileUnit( cBIId );
    DWLocTrash( cBIId, justJunk );
    DWFini( cBIId );
    CLIDump( fn );
    CLIClear();
}
Exemple #4
0
void main( void ) {
    /*****************/

    static const dw_funcs cli_funcs = {
        CLIReloc,
        CLIWrite,
        CLISeek,
        CLITell,
        CLIAlloc,
        CLIFree
    };
    dw_init_info        info;
    dw_loc_handle       seg;
    dw_cu_info          cuinfo;

    info.language = DW_LANG_C89;
    info.compiler_options = DW_CM_BROWSER;
    info.producer_name = "testcli";
    if( setjmp( info.exception_handler ) == 0 ) {
        info.funcs = cli_funcs;

        RelocValues[ DW_W_LOW_PC ] = 0x135;
        RelocValues[ DW_W_HIGH_PC ] = 0x34561ul;
        RelocValues[ DW_W_UNIT_SIZE ] = 0x34561ul - 0x135;
        Client = DWInit( &info );
        if( Client == NULL ) {
            fputs( "error in DWInit()\n", stderr );
            exit( 1 );
        }
        seg = DWLocFini( Client, DWLocInit( Client ) );
        memset( &cuinfo, 0, sizeof( cuinfo ));
        cuinfo.source_filename = "foo.bar";
        cuinfo.directory = "somewhere\\over\\the\\rainbow";

        DWBeginCompileUnit( Client, &cuinfo );
        Test();
        DWEndCompileUnit( Client );
        cuinfo.source_filename = "empty.unit";
        cuinfo.directory = "in\\a\\land\\far\\far\\away";
        DWBeginCompileUnit( Client, &cuinfo );
        DWEndCompileUnit( Client );
        DWLocTrash( Client, seg );
        DWFini( Client );
        DumpSections();
    } else {
        fputs( "fatal error %d in dwarf library\n", stderr );
        exit( 1 );
    }
    exit( 0 );
}
Exemple #5
0
extern void DwarfFini( dw_client  client )
/****************************************/
{
    int     i;
    int     status;
    char    *out_fname;
    FILE    *out_file;

    if( !CompFlags.emit_browser_info ) return;

    DWEndCompileUnit( client );
    DWFini( client );

    // close after writing
    for( i = 0 ; i < DW_DEBUG_MAX ; i++ ) {
        DwioCloseOutputFile( dw_sections[i].file );
    }

    out_fname = IoSuppOutFileName( OFT_MBR );
    out_file = SrcFileFOpen( out_fname, SFO_WRITE_BINARY );
    if( out_file == NULL ) {
        puts( strerror( errno ) );
        puts( out_fname );
        CFatal( "dwarf: unable to open file for writing" );
    }

    // concatenate files
    if( createBrowseFile( out_file,
                          &dw_sections[DW_DEBUG_ABBREV],
                          &dw_sections[DW_DEBUG_INFO],
                          &dw_sections[DW_DEBUG_REF],
                          &dw_sections[DW_DEBUG_LINE],
                          &dw_sections[DW_DEBUG_MACINFO] ) ) {
        puts( strerror( errno ) );
        CFatal( "dwarf: error in merging browse files" );
    }

    status = SrcFileFClose( out_file );
    if( status ) {
        puts( strerror( errno ) );
        puts( out_fname );
        CFatal( "dwarf: unable to close file" );
    }

    // delete
    for( i = 0 ; i < DW_DEBUG_MAX ; i++ ) {
        DwioFreeFile( dw_sections[i].file );
    }
    DwioFini();
}
Exemple #6
0
void DwarfFini( dw_client client )
/********************************/
{
    FILE    *out_file;

    DWEndCompileUnit( client );
    DWFini( client );

    out_file = OpenBrowseFile();
    if( out_file != NULL ) {
        // concatenate files
        createBrowseFile( out_file );
        fclose( out_file );
    }
}
Exemple #7
0
void DwarfFini( dw_client client )
/********************/
{
    FILE    *out_file;

    DWEndCompileUnit( client );
    DWFini( client );

    out_file = OpenBrowseFile();
    if( out_file != NULL ) {

        // concatenate files
        createBrowseFile( out_file,
                          &DWSections[DW_DEBUG_ABBREV],
                          &DWSections[DW_DEBUG_INFO],
                          &DWSections[DW_DEBUG_REF],
                          &DWSections[DW_DEBUG_LINE],
                          &DWSections[DW_DEBUG_MACINFO] );
        fclose( out_file );
    }
}