Changeset 743 in dev


Ignore:
Timestamp:
Sep 7, 2008, 12:38:43 AM (16 years ago)
Author:
dai
Message:

oldSourceLinesを排除。

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

Legend:

Unmodified
Added
Removed
  • trunk/ab5.0/abdev/BasicCompiler_Common/Compile.cpp

    r695 r743  
    1515//With情報
    1616WithInfos withInfos;
    17 
    18 //デバッグ用行番号情報
    19 SourceLines oldSourceLines;
    2017
    2118// オブジェクトモジュールリストに類似したソースコードリスト
  • trunk/ab5.0/abdev/BasicCompiler_Common/Debug.cpp

    r741 r743  
    114114        }
    115115
    116         if(i2==iLineNum){
    117             extern SourceLines oldSourceLines;
    118 
     116        if(i2==iLineNum)
     117        {
    119118loop:
    120119            int tempCp = GetSourceCodeIndexFromLine( pNowSource->GetBuffer(), FileBaseLine+i2 );
    121120
     121            const SourceLines &sourceLines = debugSectionCollection.GetCurrent()._oldSourceLines;
     122
    122123            int i3;
    123             for(i3=0;i3<(int)oldSourceLines.size()-1;i3++){
    124                 if(oldSourceLines[i3].GetSourceCodePosition().GetPos()==tempCp) break;
    125             }
    126             if(i3==oldSourceLines.size()-1){
     124            for( i3=0; i3<static_cast<int>(sourceLines.size()-1); i3++ )
     125            {
     126                if( sourceLines[i3].GetSourceCodePosition().GetPos() == tempCp )
     127                {
     128                    break;
     129                }
     130            }
     131            if( i3 == sourceLines.size() - 1 )
     132            {
    127133                i2--;
    128134                goto loop;
    129135            }
    130136
    131             StepCursorObpSchedule=oldSourceLines[i3].GetNativeCodePos();
     137            StepCursorObpSchedule = sourceLines[i3].GetNativeCodePos();
    132138            StepCursor_BackupChar=debugSectionCollection.GetCurrent().BreakStepCodeBuffer[StepCursorObpSchedule];
    133139
  • trunk/ab5.0/abdev/BasicCompiler_Common/DebugMiddleFile.cpp

    r741 r743  
    5151    }
    5252}
    53 void DebugSection::make(void){
     53void DebugSection::make( const SourceLines &sourceLines )
     54{
    5455    int i2,BufferSize;
    5556
     
    135136    // コードと行番号の関係
    136137    ////////////////////////
    137     extern SourceLines oldSourceLines;
    138 
    139     *(long *)(buffer+i2)=(long)oldSourceLines.size();
    140     i2+=sizeof(long);
    141     BOOST_FOREACH( const SourceLine &sourceLine, oldSourceLines )
     138    *(long *)(buffer+i2)=(long)sourceLines.size();
     139    i2+=sizeof(long);
     140    BOOST_FOREACH( const SourceLine &sourceLine, sourceLines )
    142141    {
    143142        *(long *)(buffer+i2) = sourceLine.GetNativeCodePos();
     
    168167}
    169168
    170 char *DebugSection::MakeSingleStepCode(void){
     169char *DebugSection::MakeSingleStepCode(){
    171170    char *buffer;
    172171    buffer=(char *)HeapAlloc(hHeap,0,SizeOf_CodeSection);
     
    187186    return buffer;
    188187}
    189 BOOL DebugSection::__load(void){
     188BOOL DebugSection::__load(){
    190189    int i2,i3;
    191190
     
    294293    sourcesLinkRelationalObjectModule = this->_sourcesLinkRelationalObjectModule;
    295294
    296     //コードと行番号の関係
    297     extern SourceLines oldSourceLines;
    298     oldSourceLines = this->_oldSourceLines;
    299 
    300     BreakStepCodeBuffer=pobj_DBBreakPoint->update(OpBuffer,SizeOf_CodeSection);
     295    BreakStepCodeBuffer=pobj_DBBreakPoint->update(OpBuffer,SizeOf_CodeSection, this->_oldSourceLines);
    301296
    302297    //プロセスメモリにコピー
     
    389384}
    390385
    391 void DebugSection::choice(void){
     386void DebugSection::choice(){
    392387    //イメージベース
    393388    extern DWORD ImageBase;
     
    407402    compiler.SelectObjectModule( &this->objectModule );
    408403
    409     //コードと行番号の関係
    410     extern SourceLines oldSourceLines;
    411     oldSourceLines = this->_oldSourceLines;
    412 
    413404    //グローバル実行領域のサイズ
    414405    extern int GlobalOpBufferSize;
     
    423414}
    424415
    425 void DebugSection::DeleteDebugInfo(void){
     416void DebugSection::DeleteDebugInfo(){
    426417    //コードバッファを解放
    427418    free(OpBuffer);
  • trunk/ab5.0/abdev/BasicCompiler_Common/DebugSection.h

    r741 r743  
    6666    ~DebugSection();
    6767
    68     void make(void);
     68    void make( const SourceLines &sourceLines );
    6969private:
    70     void UpdateBreakPoint(void);
    71     char *MakeSingleStepCode(void);
    72     BOOL __load(void);
     70    void UpdateBreakPoint();
     71    char *MakeSingleStepCode();
     72    BOOL __load();
    7373public:
    7474    BOOL load(HMODULE hModule);
    7575
    76     void choice(void);
     76    void choice();
    7777
    78     void DeleteDebugInfo(void);
     78    void DeleteDebugInfo();
    7979};
    8080
  • trunk/ab5.0/abdev/BasicCompiler_Common/VarList.cpp

    r739 r743  
    77//デバッグ用
    88#include "../BasicCompiler_Common/debug.h"
     9#include "../BasicCompiler_Common/DebugSection.h"
    910
    1011using namespace ActiveBasic::Compiler;
     
    612613
    613614    //行番号情報
    614     extern SourceLines oldSourceLines;
    615     for(i3=0;i3<(int)pobj_dti->iProcLevel+1;i3++){
    616         for(i2=0;i2<(int)oldSourceLines.size()-2;i2++){
    617             if((ULONG_PTR)(oldSourceLines[i2].GetNativeCodePos()+ImageBase+MemPos_CodeSection)<=pobj_dti->lplpObp[i3]&&
    618                 pobj_dti->lplpObp[i3]<=(ULONG_PTR)(oldSourceLines[i2+1].GetNativeCodePos()+ImageBase+MemPos_CodeSection)) break;
    619         }
    620         if(i2==oldSourceLines.size()-1) pobj_dti->lpdwCp[i3]=-1;
     615    for(i3=0;i3<(int)pobj_dti->iProcLevel+1;i3++)
     616    {
     617        extern DebugSectionCollection debugSectionCollection;
     618        const SourceLines &sourceLines = debugSectionCollection.GetCurrent()._oldSourceLines;
     619
     620        for( i2=0; i2<static_cast<int>(sourceLines.size()-2); i2++ )
     621        {
     622            if((ULONG_PTR)(sourceLines[i2].GetNativeCodePos()+ImageBase+MemPos_CodeSection)<=pobj_dti->lplpObp[i3]&&
     623                pobj_dti->lplpObp[i3]<=(ULONG_PTR)(sourceLines[i2+1].GetNativeCodePos()+ImageBase+MemPos_CodeSection))
     624            {
     625                break;
     626            }
     627        }
     628        if( i2 == sourceLines.size() - 1 )
     629        {
     630            pobj_dti->lpdwCp[i3] = -1;
     631        }
    621632        else
    622633        {
    623             pobj_dti->lpdwCp[i3]=oldSourceLines[i2].GetSourceCodePosition().GetPos();
    624             pobj_dti->relationalObjectModuleIndexes[i3]=oldSourceLines[i2].GetSourceCodePosition().GetRelationalObjectModuleIndex();
     634            pobj_dti->lpdwCp[i3] = sourceLines[i2].GetSourceCodePosition().GetPos();
     635            pobj_dti->relationalObjectModuleIndexes[i3] = sourceLines[i2].GetSourceCodePosition().GetRelationalObjectModuleIndex();
    625636        }
    626637    }
  • trunk/ab5.0/abdev/BasicCompiler_Common/include/BreakPoint.h

    r725 r743  
    1212    void remove(int iLineNum);
    1313
    14     void update(char *nativeCodeBuffer);
     14    void update( char *nativeCodeBuffer, const SourceLines &sourceLines );
    1515};
    1616typedef std::vector<BreakPointsPerFile> BreakPointsPerFiles;
     
    2626    void remove(const char *lpszFileName,int iLineNum);
    2727
    28     char *update(char *nativeCodeBuffer,int SizeOf_CodeSection);
     28    char *update( char *nativeCodeBuffer, int SizeOf_CodeSection, const SourceLines &sourceLines );
    2929};
    3030
  • trunk/ab5.0/abdev/BasicCompiler_Common/src/BreakPoint.cpp

    r725 r743  
    11#include "stdafx.h"
     2
     3#include "../../BasicCompiler_Common/DebugSection.h"
    24
    35//////////////////////////
     
    2830}
    2931
    30 void BreakPointsPerFile::update(char *nativeCodeBuffer)
     32void BreakPointsPerFile::update( char *nativeCodeBuffer, const SourceLines &sourceLines )
    3133{
    3234    int FileNum;
     
    8890
    8991        if(i2==this->lines[nCount]){
    90             extern SourceLines oldSourceLines;
    91 
    9292loop:
    9393            int tempCp = GetSourceCodeIndexFromLine( pNowSource->GetBuffer(), FileBaseLine+i2 );
    9494
    9595            int i3;
    96             for(i3=0;i3<(int)oldSourceLines.size()-1;i3++){
    97                 if(oldSourceLines[i3].GetSourceCodePosition().GetPos()==tempCp) break;
    98             }
    99             if(i3==oldSourceLines.size()-1){
     96            for( i3=0; i3<static_cast<int>(sourceLines.size()-1); i3++ )
     97            {
     98                if( sourceLines[i3].GetSourceCodePosition().GetPos() == tempCp )
     99                {
     100                    break;
     101                }
     102            }
     103            if( i3 == sourceLines.size() - 1 )
     104            {
    100105                i2--;
    101106                goto loop;
    102107            }
    103108
    104             nativeCodeBuffer[oldSourceLines[i3].GetNativeCodePos()]=(char)0xCC;
     109            nativeCodeBuffer[sourceLines[i3].GetNativeCodePos()] = (char)0xCC;
    105110
    106111            nCount++;
     
    192197}
    193198
    194 char *BreakPointManager::update(char *nativeCodeBuffer,int SizeOf_CodeSection){
     199char *BreakPointManager::update( char *nativeCodeBuffer, int SizeOf_CodeSection, const SourceLines &sourceLines )
     200{
    195201    char *buffer;
    196202    buffer=(char *)HeapAlloc(hHeap,0,SizeOf_CodeSection);
     
    199205    BOOST_FOREACH( BreakPointsPerFile &breakpointsPerFile, breakpointsPerFiles )
    200206    {
    201         breakpointsPerFile.update( buffer );
     207        breakpointsPerFile.update( buffer, sourceLines );
    202208    }
    203209
  • trunk/ab5.0/abdev/compiler_x86/MakePeHdr.cpp

    r741 r743  
    529529    compiler.linker.Link( compiler.GetObjectModule() );
    530530
    531     extern SourceLines oldSourceLines;
    532     oldSourceLines = compiler.linker.GetNativeCode().GetSourceLines();
    533 
    534531
    535532    /////////////////////////////////////////////////////////////////
     
    859856        compiler.messenger.Output( "デバッグ情報を生成しています。" );
    860857
    861         pobj_DebugSection->make();
     858        pobj_DebugSection->make( compiler.linker.GetNativeCode().GetSourceLines() );
    862859
    863860        compiler.messenger.Output( "デバッグ情報の生成が完了しました。" );
Note: See TracChangeset for help on using the changeset viewer.