Changeset 743 in dev for trunk/ab5.0/abdev/BasicCompiler_Common
- Timestamp:
- Sep 7, 2008, 12:38:43 AM (16 years ago)
- Location:
- trunk/ab5.0/abdev/BasicCompiler_Common
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/ab5.0/abdev/BasicCompiler_Common/Compile.cpp
r695 r743 15 15 //With情報 16 16 WithInfos withInfos; 17 18 //デバッグ用行番号情報19 SourceLines oldSourceLines;20 17 21 18 // オブジェクトモジュールリストに類似したソースコードリスト -
trunk/ab5.0/abdev/BasicCompiler_Common/Debug.cpp
r741 r743 114 114 } 115 115 116 if(i2==iLineNum){ 117 extern SourceLines oldSourceLines; 118 116 if(i2==iLineNum) 117 { 119 118 loop: 120 119 int tempCp = GetSourceCodeIndexFromLine( pNowSource->GetBuffer(), FileBaseLine+i2 ); 121 120 121 const SourceLines &sourceLines = debugSectionCollection.GetCurrent()._oldSourceLines; 122 122 123 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 { 127 133 i2--; 128 134 goto loop; 129 135 } 130 136 131 StepCursorObpSchedule =oldSourceLines[i3].GetNativeCodePos();137 StepCursorObpSchedule = sourceLines[i3].GetNativeCodePos(); 132 138 StepCursor_BackupChar=debugSectionCollection.GetCurrent().BreakStepCodeBuffer[StepCursorObpSchedule]; 133 139 -
trunk/ab5.0/abdev/BasicCompiler_Common/DebugMiddleFile.cpp
r741 r743 51 51 } 52 52 } 53 void DebugSection::make(void){ 53 void DebugSection::make( const SourceLines &sourceLines ) 54 { 54 55 int i2,BufferSize; 55 56 … … 135 136 // コードと行番号の関係 136 137 //////////////////////// 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 ) 142 141 { 143 142 *(long *)(buffer+i2) = sourceLine.GetNativeCodePos(); … … 168 167 } 169 168 170 char *DebugSection::MakeSingleStepCode( void){169 char *DebugSection::MakeSingleStepCode(){ 171 170 char *buffer; 172 171 buffer=(char *)HeapAlloc(hHeap,0,SizeOf_CodeSection); … … 187 186 return buffer; 188 187 } 189 BOOL DebugSection::__load( void){188 BOOL DebugSection::__load(){ 190 189 int i2,i3; 191 190 … … 294 293 sourcesLinkRelationalObjectModule = this->_sourcesLinkRelationalObjectModule; 295 294 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); 301 296 302 297 //プロセスメモリにコピー … … 389 384 } 390 385 391 void DebugSection::choice( void){386 void DebugSection::choice(){ 392 387 //イメージベース 393 388 extern DWORD ImageBase; … … 407 402 compiler.SelectObjectModule( &this->objectModule ); 408 403 409 //コードと行番号の関係410 extern SourceLines oldSourceLines;411 oldSourceLines = this->_oldSourceLines;412 413 404 //グローバル実行領域のサイズ 414 405 extern int GlobalOpBufferSize; … … 423 414 } 424 415 425 void DebugSection::DeleteDebugInfo( void){416 void DebugSection::DeleteDebugInfo(){ 426 417 //コードバッファを解放 427 418 free(OpBuffer); -
trunk/ab5.0/abdev/BasicCompiler_Common/DebugSection.h
r741 r743 66 66 ~DebugSection(); 67 67 68 void make( void);68 void make( const SourceLines &sourceLines ); 69 69 private: 70 void UpdateBreakPoint( void);71 char *MakeSingleStepCode( void);72 BOOL __load( void);70 void UpdateBreakPoint(); 71 char *MakeSingleStepCode(); 72 BOOL __load(); 73 73 public: 74 74 BOOL load(HMODULE hModule); 75 75 76 void choice( void);76 void choice(); 77 77 78 void DeleteDebugInfo( void);78 void DeleteDebugInfo(); 79 79 }; 80 80 -
trunk/ab5.0/abdev/BasicCompiler_Common/VarList.cpp
r739 r743 7 7 //デバッグ用 8 8 #include "../BasicCompiler_Common/debug.h" 9 #include "../BasicCompiler_Common/DebugSection.h" 9 10 10 11 using namespace ActiveBasic::Compiler; … … 612 613 613 614 //行番号情報 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 } 621 632 else 622 633 { 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(); 625 636 } 626 637 } -
trunk/ab5.0/abdev/BasicCompiler_Common/include/BreakPoint.h
r725 r743 12 12 void remove(int iLineNum); 13 13 14 void update( char *nativeCodeBuffer);14 void update( char *nativeCodeBuffer, const SourceLines &sourceLines ); 15 15 }; 16 16 typedef std::vector<BreakPointsPerFile> BreakPointsPerFiles; … … 26 26 void remove(const char *lpszFileName,int iLineNum); 27 27 28 char *update( char *nativeCodeBuffer,int SizeOf_CodeSection);28 char *update( char *nativeCodeBuffer, int SizeOf_CodeSection, const SourceLines &sourceLines ); 29 29 }; 30 30 -
trunk/ab5.0/abdev/BasicCompiler_Common/src/BreakPoint.cpp
r725 r743 1 1 #include "stdafx.h" 2 3 #include "../../BasicCompiler_Common/DebugSection.h" 2 4 3 5 ////////////////////////// … … 28 30 } 29 31 30 void BreakPointsPerFile::update( char *nativeCodeBuffer)32 void BreakPointsPerFile::update( char *nativeCodeBuffer, const SourceLines &sourceLines ) 31 33 { 32 34 int FileNum; … … 88 90 89 91 if(i2==this->lines[nCount]){ 90 extern SourceLines oldSourceLines;91 92 92 loop: 93 93 int tempCp = GetSourceCodeIndexFromLine( pNowSource->GetBuffer(), FileBaseLine+i2 ); 94 94 95 95 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 { 100 105 i2--; 101 106 goto loop; 102 107 } 103 108 104 nativeCodeBuffer[ oldSourceLines[i3].GetNativeCodePos()]=(char)0xCC;109 nativeCodeBuffer[sourceLines[i3].GetNativeCodePos()] = (char)0xCC; 105 110 106 111 nCount++; … … 192 197 } 193 198 194 char *BreakPointManager::update(char *nativeCodeBuffer,int SizeOf_CodeSection){ 199 char *BreakPointManager::update( char *nativeCodeBuffer, int SizeOf_CodeSection, const SourceLines &sourceLines ) 200 { 195 201 char *buffer; 196 202 buffer=(char *)HeapAlloc(hHeap,0,SizeOf_CodeSection); … … 199 205 BOOST_FOREACH( BreakPointsPerFile &breakpointsPerFile, breakpointsPerFiles ) 200 206 { 201 breakpointsPerFile.update( buffer );207 breakpointsPerFile.update( buffer, sourceLines ); 202 208 } 203 209
Note:
See TracChangeset
for help on using the changeset viewer.