Changeset 459 in dev


Ignore:
Timestamp:
Mar 23, 2008, 10:38:38 AM (16 years ago)
Author:
dai_9181
Message:

・Compiler::IsDebugメソッドを導入した(bDebugCompileグローバル変数は廃止)。
・bStrictグローバル変数は意味を成さないので廃止した。

Location:
trunk/ab5.0/abdev
Files:
11 edited

Legend:

Unmodified
Added
Removed
  • trunk/ab5.0/abdev/BasicCompiler32/Compile_CallProc.cpp

    r435 r459  
    2424}
    2525
    26 bool Opcode_CallProcPtr( const char *variable, const char *lpszParms,ProcPointer *pProcPointer){
    27 
    28     extern BOOL bDebugCompile;
     26bool Opcode_CallProcPtr( const char *variable, const char *lpszParms,ProcPointer *pProcPointer)
     27{
    2928    extern BOOL bDebugSupportProc;
    30     if(bDebugCompile&&bDebugSupportProc==0)
     29    if( compiler.IsDebug() && bDebugSupportProc == 0 )
     30    {
    3131        Call_DebugSys_SaveContext();
     32    }
    3233
    3334
     
    433434}
    434435
    435 bool Opcode_CallDllProc( const char *lpszParms, const DllProc *pDllProc ){
    436 
    437     extern BOOL bDebugCompile;
     436bool Opcode_CallDllProc( const char *lpszParms, const DllProc *pDllProc )
     437{
    438438    extern BOOL bDebugSupportProc;
    439     if(bDebugCompile&&bDebugSupportProc==0&& pDllProc->IsEqualSymbol( "DebugBreak" ) ){
     439    if( compiler.IsDebug() && bDebugSupportProc==0 && pDllProc->IsEqualSymbol( "DebugBreak" ) )
     440    {
    440441        Call_DebugSys_SaveContext();
    441442    }
     
    487488void Opcode_CallDelegate( const Delegate &dg, const char *methodPtrValueStr, const char *objPtrValueStr, const char *params )
    488489{
    489     extern BOOL bDebugCompile;
    490490    extern BOOL bDebugSupportProc;
    491     if(bDebugCompile&&bDebugSupportProc==0)
     491    if( compiler.IsDebug() && bDebugSupportProc == 0 )
     492    {
    492493        Call_DebugSys_SaveContext();
     494    }
    493495
    494496
  • trunk/ab5.0/abdev/BasicCompiler32/Compile_ProcOp.cpp

    r402 r459  
    4242        cp=-1;
    4343
    44         extern BOOL bDebugCompile;
    45         if(bDebugCompile){
     44        if( compiler.IsDebug() )
     45        {
    4646            //デバッグ用の変数を定義
    4747            DebugVariable();
     
    283283    extern char *basbuf;
    284284    extern HANDLE hHeap;
    285     extern BOOL bDebugCompile;
    286285    int i3,i4,BaseOffset;
    287286    char temporary[VN_SIZE];
     
    301300
    302301    extern BOOL bDebugSupportProc;
    303     if(memcmp(pUserProc->GetName().c_str(),"_DebugSys_",10)==0){
    304         if(!bDebugCompile){
     302    if(memcmp(pUserProc->GetName().c_str(),"_DebugSys_",10)==0)
     303    {
     304        if( !compiler.IsDebug() )
     305        {
    305306            return;
    306307        }
     
    476477
    477478    const PertialSchedule *pEspOffsetPertialSchedule = NULL;
    478     if(bDebugCompile&&bDebugSupportProc==0){
     479    if( compiler.IsDebug() && bDebugSupportProc == 0 )
     480    {
    479481        //push dword ptr[ebp+(AllLocalVarSize-BaseOffset)](スケジュール)
    480482        pEspOffsetPertialSchedule = compiler.codeGenerator.op_push_M( REG_EBP, 0, Schedule::None, true );
     
    633635    compiler.codeGenerator.ResolveExitSubSchedule();
    634636
    635     if(bDebugCompile&&bDebugSupportProc==0){
     637    if( compiler.IsDebug() && bDebugSupportProc == 0 )
     638    {
    636639        compiler.codeGenerator.opfix( pEspOffsetPertialSchedule, AllLocalVarSize-BaseOffset-sizeof(long) );
    637640
     
    739742    compiler.codeGenerator.op_pop(REG_EBX);
    740743
    741     if(bDebugCompile){
     744    if( compiler.IsDebug() )
     745    {
    742746        //cmp esp,ebp
    743747        compiler.codeGenerator.op_cmp_RR( REG_ESP, REG_EBP );
  • trunk/ab5.0/abdev/BasicCompiler32/MakePeHdr.cpp

    r451 r459  
    102102    extern HWND hOwnerEditor;
    103103    extern HANDLE hHeap;
    104     extern BOOL bDebugCompile;
    105104    extern DWORD ImageBase;
    106105    extern char *basbuf;
     
    130129    //////////////////
    131130    // データテーブル
    132     if(bDebugCompile){
     131    if( compiler.IsDebug() ){
    133132        compiler.GetObjectModule().dataTable.Add( (long)0x00000002 );
    134133    }
     
    401400            compiler.codeGenerator.op_push(REG_EBP);
    402401
    403             if(bDebugCompile)
     402            if( compiler.IsDebug() )
    404403            {
    405404                // デバッグ用の変数を定義
     
    832831    CDebugSection *pobj_DebugSection;
    833832    pobj_DebugSection=new CDebugSection();
    834     extern BOOL bDebugCompile;
    835833    extern BOOL bError;
    836     if(bDebugCompile&&bError==0){
     834    if( compiler.IsDebug() && bError == 0 )
     835    {
    837836        CompileMessage( "デバッグ情報を生成しています。" );
    838837
  • trunk/ab5.0/abdev/BasicCompiler_Common/BasicCompiler.cpp

    r457 r459  
    620620        {
    621621            // デバッグ ビルド
    622             bDebugCompile = 1;
     622            compiler.SetDebugMark( true );
    623623        }
    624624        else if( cmdLine.GetCommand() == "run" )
     
    726726        if( compiler.IsStaticLibrary() )
    727727        {
    728             if(bDebugCompile||bDebugRun)
     728            if( bDebugRun || compiler.IsDebug() )
    729729            {
    730730                lstrcat(OutputFileName,"_debug.abobj");
     
    737737        else
    738738        {
    739             if(bDebugCompile||bDebugRun)
     739            if( bDebugRun || compiler.IsDebug() )
    740740            {
    741741                lstrcat(OutputFileName,"_debug.exe");
  • trunk/ab5.0/abdev/BasicCompiler_Common/BasicCompiler.h

    r334 r459  
    2020
    2121//プログラム情報
    22 BOOL bStrict;
    2322DWORD ImageBase;
    2423
     
    4443
    4544//デバッグ
    46 BOOL bDebugCompile=0;
    4745BOOL bDebugRun=0;
    4846BOOL bAttach=0;
  • trunk/ab5.0/abdev/BasicCompiler_Common/Compile.cpp

    r438 r459  
    442442
    443443        case COM_DEBUG:
    444             extern BOOL bDebugCompile;
    445444            //int 3
    446             if(bDebugCompile)
     445            if( compiler.IsDebug() )
    447446            {
    448447                breakpoint;
  • trunk/ab5.0/abdev/BasicCompiler_Common/Intermediate_Step1.cpp

    r402 r459  
    244244    int i,i2,i3;
    245245    char temporary[VN_SIZE];
    246 
    247     extern BOOL bStrict;
    248     bStrict=1;
    249246
    250247    for(i=0;;i++){
  • trunk/ab5.0/abdev/BasicCompiler_Common/MakeExe.cpp

    r350 r459  
    157157
    158158            const char *coreFileName = "core.lib";
    159             if( bDebugCompile )
     159            if( compiler.IsDebug() )
    160160            {
    161161                coreFileName = "cored.lib";
     
    282282}
    283283int MainThread(DWORD dummy){
    284     extern BOOL bDebugCompile;
    285284    extern BOOL bDebugRun;
    286285    extern int bError;
    287286
    288287    if(bDebugRun){
    289         if(bDebugCompile){
     288        if( compiler.IsDebug() )
     289        {
    290290            bDebugRun=0;
    291291
  • trunk/ab5.0/abdev/BasicCompiler_Common/error.cpp

    r457 r459  
    496496    }
    497497
    498     //#strictが指定されていないときは型チェックを行わないようにする
    499     extern BOOL bStrict;
    500     if(bStrict==0) return true;
    501 
    502498    if( calcType.GetBasicType() & FLAG_PTR )
    503499    {
  • trunk/ab5.0/abdev/BasicCompiler_Common/include/Compiler.h

    r407 r459  
    1414class Compiler
    1515{
     16public:
     17    // ターゲット
     18    enum TargetModuleType
     19    {
     20        Exe,
     21        Dll,
     22        StaticLibrary,
     23    };
     24
     25private:
    1626    // モジュール名
    1727    std::string moduleName;
     28
     29    // モジュール タイプ
     30    TargetModuleType targetModuleType;
     31
     32    // デバッグ ビルドかどうか
     33    bool isDebug;
    1834
    1935    // 名前空間サポート
     
    3046        , pNowObjectModule( pObjectModule )
    3147        , targetModuleType( Exe )
     48        , isDebug( false )
    3249        , isCore( false )
    3350    {
     
    87104    }
    88105
    89 
    90     // ターゲット
    91     enum TargetModuleType
    92     {
    93         Exe,
    94         Dll,
    95         StaticLibrary,
    96     };
    97 
    98     TargetModuleType targetModuleType;
    99 
    100106    bool IsExe() const
    101107    {
     
    127133    }
    128134
     135    void SetDebugMark( bool isDebug )
     136    {
     137        this->isDebug = isDebug;
     138    }
     139    bool IsDebug() const
     140    {
     141        return isDebug;
     142    }
     143
    129144
    130145    // コアモジュールかどうか
  • trunk/ab5.0/abdev/BasicCompiler_Common/src/Source.cpp

    r402 r459  
    105105//////////////////////////////////////
    106106
    107 CDefine::CDefine( int majorVer ){
     107CDefine::CDefine( int majorVer )
     108{
    108109    Init( majorVer );
    109110}
    110 CDefine::~CDefine(){
    111 }
    112 void CDefine::Init( int majorVer ){
     111CDefine::~CDefine()
     112{
     113}
     114void CDefine::Init( int majorVer )
     115{
    113116    names.clear();
    114117
    115     extern BOOL bDebugCompile;
    116     if(bDebugCompile) add("_DEBUG");
     118    if( compiler.IsDebug() )
     119    {
     120        add("_DEBUG");
     121    }
    117122
    118123#ifdef _AMD64_
     
    120125#endif
    121126
    122     if( compiler.IsDll() ){
     127    if( compiler.IsDll() )
     128    {
    123129        add("_DLL");
    124130    }
    125131
    126     if( Smoothie::IsUnicode() ){
     132    if( Smoothie::IsUnicode() )
     133    {
    127134        add( "UNICODE" );
    128135    }
Note: See TracChangeset for help on using the changeset viewer.