void BISetSrcFile( void ) { //=================== // Set Current Source Line char *name; if( _GenerateBrInfo() ) { if ( !( ProgSw & PS_FATAL_ERROR ) && CurrFile ) { name = BIMKFullPath( CurrFile->name ); DWSetFile( cBIId, name ); DWDeclFile( cBIId, name ); DWLineNum( cBIId, DW_LN_DEFAULT, CurrFile->rec, 0, 0 ); DWDeclPos( cBIId, CurrFile->rec, 0 ); } } }
static void TestEnum( void ) { dw_uconst value; /* enum colours { RED, GREEN, BLUE }; */ DWDeclFile( Client, "A_New_File" ); DWDeclPos( Client, 1, 5 ); EnumColours = DWBeginEnumeration( Client, 1, "colours", 0, 0 ); value = 2; DWAddConstant( Client, value, "BLUE" ); value = 1; DWAddConstant( Client, value, "GREEN" ); value = 0; DWAddConstant( Client, value, "RED" ); DWEndEnumeration( Client ); }
dw_client DwarfInit( void ) /*************************/ { dw_client client; dw_init_info info; dw_cu_info cu; size_t incsize; char *inclist; char *fname; dw_sectnum sect; static const dw_funcs cli_funcs = { dw_reloc, dw_write, dw_seek, dw_tell, dw_alloc, dw_free }; for( sect = 0; sect < DW_DEBUG_MAX; ++sect ) { dw_sections[sect].bufcount = 0; dw_sections[sect].bufptrs = NULL; dw_sections[sect].offset = 0; dw_sections[sect].length = 0; } info.language = DWLANG_C; info.compiler_options = DW_CM_BROWSER; info.producer_name = DWARF_PRODUCER_ID " V1"; memcpy( &info.exception_handler, Environment, sizeof( jmp_buf ) ); info.funcs = cli_funcs; info.abbrev_sym = NULL; relocValues[DW_W_LOW_PC] = 0x0; relocValues[DW_W_HIGH_PC] = 0x1; relocValues[DW_W_UNIT_SIZE] = 0x1; client = DWInit( &info ); if( client == NULL ) { CFatal( "dwarf: error in DWInit()" ); } fname = FNameFullPath( FNames ); incsize = 0; inclist = NULL; #if 0 if( HFileList != NULL ) { char *p; incsize = strlen( HFileList ) + 1; inclist = CMemAlloc( incsize ); memcpy( inclist, HFileList, incsize ); // need to handle the case where there are multiple ';' in a row for( p = inclist; *p != '\0'; p++ ) { if( *p == ';' ) { *p = '\0'; } } if( inclist[incsize - 2] == '\0' ) { --incsize; } } #endif cu.source_filename = fname; cu.directory = ""; cu.flags = 1; cu.offset_size = TARGET_NEAR_POINTER; cu.segment_size = 0; cu.model = DW_MODEL_NONE; cu.inc_list = inclist; cu.inc_list_len = incsize; cu.dbg_pch = NULL; DWBeginCompileUnit( client, &cu ); CMemFree( inclist ); DWDeclFile( client, fname ); return( client ); }
dw_client DwarfInit( void ) /********************/ { dw_client client; dw_init_info info; dw_cu_info cu; unsigned incsize; char *inclist; char *fname; static const dw_funcs cli_funcs = { dw_reloc, dw_write, dw_seek, dw_tell, dw_alloc, dw_free }; DWSectInit(); info.language = DWLANG_C; info.compiler_options = DW_CM_BROWSER; info.producer_name = "WATCOM C V10"; memcpy( &info.exception_handler, Environment, sizeof( jmp_buf ) ); info.funcs = cli_funcs; relocValues[ DW_W_LOW_PC ] = 0x0; relocValues[ DW_W_HIGH_PC ] = 0x1; relocValues[ DW_W_UNIT_SIZE ] = 0x1; client = DWInit( &info ); if( client == NULL ) { CFatal( "dwarf: error in DWInit()" ); } fname = FNameFullPath( FNames ); incsize = 0; inclist = NULL; #if 0 if( HFileList != NULL ) { char *p; incsize = strlen( HFileList ) + 1; inclist = CMemAlloc( incsize ); strcpy( inclist, HFileList ); // need to handle the case where there are multiple ';' in a row for( p = inclist; *p; p++ ) { if( *p == ';' ) *p = '\0'; } if( inclist[ incsize - 2 ] == '\0' ) --incsize; /* 27-may-94 */ } #endif cu.source_filename = fname; cu.directory = ""; cu.flags = 1; cu.offset_size = TARGET_NEAR_POINTER; cu.segment_size = 0; cu.model = DW_MODEL_NONE; cu.inc_list = inclist; cu.inc_list_len = incsize; cu.dbg_pch = NULL; DWBeginCompileUnit( client, &cu ); CMemFree( inclist ); DWDeclFile( client, fname ); return( client ); }