Changeset 263 in dev for trunk/abdev/BasicCompiler64/MakePeHdr.cpp
- Timestamp:
- Aug 5, 2007, 3:47:49 AM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/abdev/BasicCompiler64/MakePeHdr.cpp
r262 r263 222 222 223 223 //コードと行番号の関係 224 extern LINEINFO *pLineInfo; 225 extern int MaxLineInfoNum; 226 pLineInfo=(LINEINFO *)HeapAlloc(hHeap,0,1); 227 MaxLineInfoNum=0; 224 extern SourceLines oldSourceLines; 225 oldSourceLines.clear(); 228 226 229 227 … … 387 385 388 386 //未完成 389 // OpBuffer[obp++]=(char)0xCC;387 //breakpoint; 390 388 391 389 //sub rsp,スタックフレームサイズ … … 503 501 ////////////////////////////////////////////////////////// 504 502 503 504 505 trace( "コード生成が終了しました。" ); 506 507 vector<ObjectModule *> masterObjectModules; 508 masterObjectModules.push_back( &compiler.objectModule ); 509 compiler.linker.Link( masterObjectModules ); 505 510 506 511 … … 836 841 837 842 //機械語コードとBasicコードの関係を整理 838 extern LINEINFO *pLineInfo; 839 extern int MaxLineInfoNum; 843 extern SourceLines oldSourceLines; 840 844 int MinObp,MaxObp; 841 LINEINFO *pTempLineInfo; 842 pTempLineInfo=(LINEINFO *)HeapAlloc(hHeap,0,MaxLineInfoNum*sizeof(LINEINFO)); 843 i2=0; 845 SourceLines tempSourceLines; 844 846 MaxObp=0; 845 847 while(1){ 846 for(i3=0,MinObp=0x0FFFFFFF;i3< MaxLineInfoNum;i3++){847 if( pLineInfo[i3].TopObp<MinObp&&MaxObp<pLineInfo[i3].TopObp){848 MinObp= pLineInfo[i3].TopObp;848 for(i3=0,MinObp=0x0FFFFFFF;i3<oldSourceLines.size();i3++){ 849 if(oldSourceLines[i3].GetNativeCodePos()<MinObp&&MaxObp<oldSourceLines[i3].GetNativeCodePos()){ 850 MinObp=oldSourceLines[i3].GetNativeCodePos(); 849 851 i4=i3; 850 852 } 851 853 } 852 854 if(MinObp==0x0FFFFFFF) break; 853 pTempLineInfo[i2]=pLineInfo[i4]; 854 MaxObp=pTempLineInfo[i2].TopObp; 855 i2++; 856 } 857 HeapDefaultFree(pLineInfo); 858 pLineInfo=(LINEINFO *)HeapAlloc(hHeap,0,i2*sizeof(LINEINFO)); 859 memcpy(pLineInfo,pTempLineInfo,i2*sizeof(LINEINFO)); 860 MaxLineInfoNum=i2; 861 HeapDefaultFree(pTempLineInfo); 855 tempSourceLines.push_back( oldSourceLines[i4] ); 856 MaxObp=tempSourceLines.back().GetNativeCodePos(); 857 } 858 oldSourceLines = tempSourceLines; 862 859 863 860 //デバッグセクションを生成 … … 1165 1162 1166 1163 1164 1165 compiler.linker.SetImageBase( ImageBase ); 1166 compiler.linker.ResolveDataTableSchedules( MemPos_DataSection ); 1167 compiler.linker.ResolveDllProcSchedules( MemPos_CodeSection, MemPos_ImportSection, LookupSize, HintSize ); 1168 compiler.linker.ResolveUserProcSchedules( MemPos_CodeSection ); 1169 compiler.linker.ResolveGlobalVarSchedules( MemPos_RWSection ); 1170 1171 if( obp == compiler.linker.GetNativeCode().GetSize() ) 1172 { 1173 memcpy( OpBuffer, compiler.linker.GetNativeCode().GetCodeBuffer(), compiler.linker.GetNativeCode().GetSize() ); 1174 } 1175 else 1176 { 1177 SetError(); 1178 } 1179 1180 1167 1181 //////////////////////////////// 1168 1182 // リソースアドレススケジュール
Note:
See TracChangeset
for help on using the changeset viewer.