Changeset 263 in dev for trunk/abdev/BasicCompiler_Common/DebugMiddleFile.cpp
- Timestamp:
- Aug 5, 2007, 3:47:49 AM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/abdev/BasicCompiler_Common/DebugMiddleFile.cpp
r259 r263 98 98 // コードと行番号の関係 99 99 //////////////////////// 100 extern int MaxLineInfoNum; 101 extern LINEINFO *pLineInfo; 102 103 //バッファが足りない場合は再確保 104 if(MaxLineInfoNum*sizeof(LINEINFO)<32768) i3=32768; 105 else i3=MaxLineInfoNum*sizeof(LINEINFO)+32768; 106 if(BufferSize<i2+i3){ 107 BufferSize+=i3; 108 buffer=(char *)HeapReAlloc(hHeap,0,buffer,BufferSize); 109 } 110 111 *(long *)(buffer+i2)=MaxLineInfoNum; 112 i2+=sizeof(long); 113 memcpy(buffer+i2,pLineInfo,MaxLineInfoNum*sizeof(LINEINFO)); 114 i2+=MaxLineInfoNum*sizeof(LINEINFO); 100 extern SourceLines oldSourceLines; 101 102 *(long *)(buffer+i2)=(long)oldSourceLines.size(); 103 i2+=sizeof(long); 104 BOOST_FOREACH( const SourceLine &sourceLine, oldSourceLines ) 105 { 106 *(long *)(buffer+i2) = sourceLine.GetLineNum(); 107 i2+=sizeof(long); 108 109 *(long *)(buffer+i2) = sourceLine.GetNativeCodePos(); 110 i2+=sizeof(long); 111 112 *(long *)(buffer+i2) = sourceLine.GetSourceCodePos(); 113 i2+=sizeof(long); 114 115 *(long *)(buffer+i2) = sourceLine.GetCodeType(); 116 i2+=sizeof(long); 117 118 //バッファが足りない場合は再確保 119 if(BufferSize<i2+32768){ 120 BufferSize+=32768; 121 buffer=(char *)HeapReAlloc(hHeap,0,buffer,BufferSize); 122 } 123 } 115 124 116 125 … … 431 440 memcpy(buffer,OpBuffer,SizeOf_CodeSection); 432 441 433 int i2;434 for(i2=0;i2<MaxLineInfoNum;i2++){442 BOOST_FOREACH( const SourceLine &sourceLine, oldSourceLines ) 443 { 435 444 if(!( 436 pLineInfo[i2].dwCodeType&CODETYPE_SYSTEMPROC||437 pLineInfo[i2].dwCodeType&CODETYPE_DEBUGPROC438 )){445 sourceLine.IsInSystemProc() 446 || sourceLine.IsInDebugProc() ) ) 447 { 439 448 //int 3 440 buffer[ pLineInfo[i2].TopObp]=(char)0xCC;449 buffer[sourceLine.GetNativeCodePos()]=(char)0xCC; 441 450 } 442 451 } … … 487 496 488 497 //コードと行番号の関係 489 MaxLineInfoNum=*(long *)(buffer+i2); 490 i2+=sizeof(long); 491 pLineInfo=(LINEINFO *)HeapAlloc(hHeap,0,MaxLineInfoNum*sizeof(LINEINFO)+1); 492 memcpy(pLineInfo,buffer+i2,MaxLineInfoNum*sizeof(LINEINFO)); 493 i2+=MaxLineInfoNum*sizeof(LINEINFO); 498 int maxLineInfoNum; 499 maxLineInfoNum=*(long *)(buffer+i2); 500 i2+=sizeof(long); 501 for(i3=0;i3<maxLineInfoNum;i3++){ 502 int lineNum = *(long *)(buffer+i2); 503 i2+=sizeof(long); 504 505 int nativeCodePos = *(long *)(buffer+i2); 506 i2+=sizeof(long); 507 508 int sourceCodePos = *(long *)(buffer+i2); 509 i2+=sizeof(long); 510 511 DWORD sourceLineType = *(DWORD *)(buffer+i2); 512 i2+=sizeof(long); 513 514 oldSourceLines.push_back( SourceLine( lineNum, nativeCodePos, sourceCodePos, sourceLineType ) ); 515 } 494 516 495 517 … … 837 859 838 860 //コードと行番号の関係 839 extern int MaxLineInfoNum; 840 extern LINEINFO *pLineInfo; 841 MaxLineInfoNum=this->MaxLineInfoNum; 842 pLineInfo=this->pLineInfo; 861 extern SourceLines oldSourceLines; 862 oldSourceLines = this->oldSourceLines; 843 863 844 864 BreakStepCodeBuffer=pobj_DBBreakPoint->update(OpBuffer,SizeOf_CodeSection); … … 956 976 957 977 //コードと行番号の関係 958 extern int MaxLineInfoNum; 959 extern LINEINFO *pLineInfo; 960 MaxLineInfoNum=this->MaxLineInfoNum; 961 pLineInfo=this->pLineInfo; 978 extern SourceLines oldSourceLines; 979 oldSourceLines = this->oldSourceLines; 962 980 963 981 // クラス情報 … … 996 1014 delete this->pobj_DBClass; 997 1015 this->pobj_DBClass=0; 998 999 //コードと行番号の関係を解放1000 HeapDefaultFree(pLineInfo);1001 1016 1002 1017 //コードバッファを解放
Note:
See TracChangeset
for help on using the changeset viewer.