Changeset 265 in dev for trunk/abdev/BasicCompiler_Common/DebugMiddleFile.cpp
- Timestamp:
- Aug 6, 2007, 11:44:42 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/abdev/BasicCompiler_Common/DebugMiddleFile.cpp
r264 r265 37 37 (*p)+=lstrlen(buffer+(*p))+1; 38 38 39 type.SetClassPtr( compiler. objectModule.meta.GetClasses().Find(szClassName) );39 type.SetClassPtr( compiler.GetObjectModule().meta.GetClasses().Find(szClassName) ); 40 40 } 41 41 else{ … … 48 48 49 49 CDebugSection::~CDebugSection(){ 50 if( pobj_DBClass) DeleteDebugInfo();50 if(dwImageBase) DeleteDebugInfo(); 51 51 if(buffer){ 52 52 HeapDefaultFree(buffer); … … 55 55 } 56 56 void CDebugSection::make(void){ 57 extern INCLUDEFILEINFO IncludeFileInfo;58 57 int i2,i3,BufferSize; 59 58 … … 82 81 // テキストデータにシリアライズ 83 82 std::string textString; 84 compiler. objectModule.WriteTextString( textString );83 compiler.GetObjectModule().WriteTextString( textString ); 85 84 86 85 // サイズ … … 105 104 106 105 //インクルード情報 106 extern INCLUDEFILEINFO IncludeFileInfo; 107 107 *(long *)(buffer+i2)=IncludeFileInfo.FilesNum; 108 108 i2+=sizeof(long); … … 115 115 buffer[i2++]=(char)IncludeFileInfo.LineOfFile[i3]; 116 116 if(IncludeFileInfo.LineOfFile[i3]==-1) break; 117 118 //バッファが足りない場合は再確保 119 if(BufferSize<i2+32768){ 120 BufferSize+=32768; 121 buffer=(char *)HeapReAlloc(hHeap,0,buffer,BufferSize); 122 } 117 123 } 118 124 119 125 //ソースコード 126 { 127 //バッファが足りない場合は再確保 128 int bufferLen = lstrlen( basbuf ); 129 if(BufferSize<i2+(int)bufferLen+32768){ 130 while( BufferSize<i2+(int)bufferLen+32768 ) 131 { 132 BufferSize+=32768; 133 } 134 135 buffer=(char *)HeapReAlloc(hHeap,0,buffer,BufferSize); 136 } 137 } 120 138 lstrcpy(buffer+i2,basbuf); 121 i2+=lstrlen( buffer+i2)+1;139 i2+=lstrlen( buffer + i2 )+1; 122 140 123 141 … … 150 168 } 151 169 152 153 154 ////////////////////////////////////////////155 // クラス情報(名前のみ。詳細は後で保存)156 ////////////////////////////////////////////157 158 //イテレータをリセット159 compiler.objectModule.meta.GetClasses().Iterator_Reset();160 161 //個数162 *(long *)(buffer+i2)=compiler.objectModule.meta.GetClasses().Iterator_GetMaxCount();163 i2+=sizeof(long);164 165 while(compiler.objectModule.meta.GetClasses().Iterator_HasNext()){166 CClass *pobj_c;167 pobj_c=compiler.objectModule.meta.GetClasses().Iterator_GetNext();168 169 //クラス名170 lstrcpy(buffer+i2,pobj_c->GetName().c_str());171 i2+=lstrlen(buffer+i2)+1;172 }173 174 175 176 //////////////////177 // TypeDef情報178 //////////////////179 *(long *)(buffer+i2)=(int)compiler.objectModule.meta.GetTypeDefs().size();180 i2+=sizeof(long);181 for(i3=0;i3<(int)compiler.objectModule.meta.GetTypeDefs().size();i3++){182 lstrcpy(buffer+i2,compiler.objectModule.meta.GetTypeDefs()[i3].GetName().c_str() );183 i2+=lstrlen(buffer+i2)+1;184 185 lstrcpy(buffer+i2,compiler.objectModule.meta.GetTypeDefs()[i3].GetBaseName().c_str() );186 i2+=lstrlen(buffer+i2)+1;187 188 //バッファが足りない場合は再確保189 if(BufferSize<i2+32768){190 BufferSize+=32768;191 buffer=(char *)HeapReAlloc(hHeap,0,buffer,BufferSize);192 }193 }194 195 196 //グローバル変数情報197 *(long *)(buffer+i2)=(int)compiler.objectModule.meta.GetGlobalVars().size();198 i2+=sizeof(long);199 BOOST_FOREACH( Variable *pVar, compiler.objectModule.meta.GetGlobalVars() ){200 //変数名201 lstrcpy(buffer+i2,pVar->GetName().c_str());202 i2+=lstrlen(buffer+i2)+1;203 204 //型205 *(long *)(buffer+i2)=pVar->GetType().GetBasicType();206 i2+=sizeof(long);207 208 //型の拡張情報209 SetLpIndex_DebugFile(buffer,&i2,pVar->GetType());210 211 buffer[i2++] = pVar->IsRef() ? 1 : 0;212 213 buffer[i2++] = pVar->IsArray() ? 1 : 0;214 215 if(pVar->IsArray()){216 *(long *)(buffer+i2)=(int)pVar->GetSubscripts().size();217 i2+=sizeof(long);218 BOOST_FOREACH( int indexMax, pVar->GetSubscripts() )219 {220 *(long *)(buffer+i2)=indexMax;221 i2+=sizeof(long);222 }223 }224 225 //レキシカルスコープ情報226 *(long *)(buffer+i2)=pVar->GetScopeStartAddress();227 i2+=sizeof(long);228 *(long *)(buffer+i2)=pVar->GetScopeEndAddress();229 i2+=sizeof(long);230 *(long *)(buffer+i2)=pVar->GetScopeLevel();231 i2+=sizeof(long);232 233 //メモリ位置234 *(long *)(buffer+i2)=pVar->GetOffsetAddress();235 i2+=sizeof(long);236 237 //バッファが足りない場合は再確保238 if(BufferSize<i2+32768){239 BufferSize+=32768;240 buffer=(char *)HeapReAlloc(hHeap,0,buffer,BufferSize);241 }242 }243 244 170 //グローバル実行領域のサイズ 245 171 extern int GlobalOpBufferSize; … … 247 173 i2+=sizeof(long); 248 174 249 //プロシージャ情報250 *(long *)(buffer+i2) = compiler.objectModule.meta.GetUserProcs().Iterator_GetMaxCount();251 i2+=sizeof(long);252 compiler.objectModule.meta.GetUserProcs().Iterator_Reset();253 while( compiler.objectModule.meta.GetUserProcs().Iterator_HasNext() )254 {255 UserProc *pUserProc = compiler.objectModule.meta.GetUserProcs().Iterator_GetNext();256 257 if(pUserProc->GetParentClassPtr()){258 lstrcpy(buffer+i2,pUserProc->GetParentClassPtr()->GetName().c_str());259 i2+=lstrlen(buffer+i2)+1;260 }261 else{262 lstrcpy(buffer+i2,"");263 i2+=lstrlen(buffer+i2)+1;264 }265 266 //ID267 *(long *)(buffer+i2)=pUserProc->GetId();268 i2+=sizeof(long);269 270 //関数名271 lstrcpy(buffer+i2,pUserProc->GetName().c_str());272 i2+=lstrlen(buffer+i2)+1;273 274 *(long *)(buffer+i2)=pUserProc->_beginOpAddressOld;275 i2+=sizeof(long);276 *(long *)(buffer+i2)=pUserProc->_endOpAddressOld;277 i2+=sizeof(long);278 279 //ローカル変数情報280 *(long *)(buffer+i2)=(int)pUserProc->GetLocalVars().size();281 i2+=sizeof(long);282 283 //バッファが足りない場合は再確保284 if(BufferSize<i2+32768){285 BufferSize+=32768;286 buffer=(char *)HeapReAlloc(hHeap,0,buffer,BufferSize);287 }288 289 BOOST_FOREACH( Variable *pVar, pUserProc->GetLocalVars() ){290 lstrcpy(buffer+i2,pVar->GetName().c_str());291 i2+=lstrlen(buffer+i2)+1;292 293 //型294 *(long *)(buffer+i2)=pVar->GetType().GetBasicType();295 i2+=sizeof(long);296 297 //型の拡張情報298 SetLpIndex_DebugFile(buffer,&i2,pVar->GetType());299 300 //参照型パラメータかどうか301 buffer[i2++] = pVar->IsRef() ? 1 : 0;302 303 //配列かどうか304 buffer[i2++] = pVar->IsArray() ? 1 : 0;305 306 //配列要素307 if(pVar->IsArray()){308 *(long *)(buffer+i2)=(int)pVar->GetSubscripts().size();309 i2+=sizeof(long);310 BOOST_FOREACH( int indexMax, pVar->GetSubscripts() )311 {312 *(long *)(buffer+i2)=indexMax;313 i2+=sizeof(long);314 }315 }316 317 //レキシカルスコープ情報318 *(long *)(buffer+i2)=pVar->GetScopeStartAddress();319 i2+=sizeof(long);320 *(long *)(buffer+i2)=pVar->GetScopeEndAddress();321 i2+=sizeof(long);322 *(long *)(buffer+i2)=pVar->GetScopeLevel();323 i2+=sizeof(long);324 325 //メモリ位置326 *(long *)(buffer+i2)=pVar->GetOffsetAddress();327 i2+=sizeof(long);328 329 330 331 332 //バッファが足りない場合は再確保333 if(BufferSize<i2+32768){334 BufferSize+=32768;335 buffer=(char *)HeapReAlloc(hHeap,0,buffer,BufferSize);336 }337 }338 }339 340 341 342 ///////////////////343 // クラス情報344 ///////////////////345 346 //イテレータをリセット347 compiler.objectModule.meta.GetClasses().Iterator_Reset();348 349 while(compiler.objectModule.meta.GetClasses().Iterator_HasNext()){350 CClass *pobj_c;351 pobj_c=compiler.objectModule.meta.GetClasses().Iterator_GetNext();352 353 354 //クラス名355 lstrcpy(buffer+i2,pobj_c->GetName().c_str());356 i2+=lstrlen(buffer+i2)+1;357 358 //仮想関数の数359 *(long *)(buffer+i2)=pobj_c->GetVtblNum();360 i2+=sizeof(long);361 362 //アラインメント363 *(long *)(buffer+i2)=pobj_c->GetFixedAlignment();364 i2+=sizeof(long);365 366 // 動的メンバ367 *(long *)(buffer+i2)=(int)pobj_c->GetDynamicMembers().size();368 i2+=sizeof(long);369 BOOST_FOREACH( CMember *member, pobj_c->GetDynamicMembers() ){370 // 名前371 lstrcpy(buffer+i2,member->GetName().c_str());372 i2+=lstrlen(buffer+i2)+1;373 374 // 型375 *(long *)(buffer+i2)=member->GetType().GetBasicType();376 i2+=sizeof(long);377 378 // 型の拡張情報379 SetLpIndex_DebugFile(buffer,&i2,member->GetType());380 381 // アクセシビリティ382 *(Prototype::Accessibility *)(buffer+i2)=member->GetAccessibility();383 i2+=sizeof(Prototype::Accessibility);384 385 *(long *)(buffer+i2)=(int)member->GetSubscripts().size();386 i2+=sizeof(long);387 BOOST_FOREACH( int indexMax, member->GetSubscripts() )388 {389 *(long *)(buffer+i2)=indexMax;390 i2+=sizeof(long);391 }392 393 //バッファが足りない場合は再確保394 if(BufferSize<i2+32768){395 BufferSize+=32768;396 buffer=(char *)HeapReAlloc(hHeap,0,buffer,BufferSize);397 }398 }399 400 // 動的メソッド401 *(long *)(buffer+i2)=(long)pobj_c->GetMethods().size();402 i2+=sizeof(long);403 BOOST_FOREACH( const CMethod *pMethod, pobj_c->GetMethods() ){404 *(Prototype::Accessibility *)(buffer+i2)=pMethod->GetAccessibility();405 i2+=sizeof(Prototype::Accessibility);406 if( pMethod->GetInheritsClassPtr() ){407 lstrcpy(buffer+i2,pMethod->GetInheritsClassPtr()->GetName().c_str());408 i2+=lstrlen(buffer+i2)+1;409 }410 else{411 lstrcpy(buffer+i2,"");412 i2+=lstrlen(buffer+i2)+1;413 }414 lstrcpy(buffer+i2,pMethod->GetUserProc().GetName().c_str());415 i2+=lstrlen(buffer+i2)+1;416 }417 418 //静的メンバ419 *(long *)(buffer+i2)=(long)pobj_c->GetStaticMembers().size();420 i2+=sizeof(long);421 BOOST_FOREACH( CMember *member, pobj_c->GetStaticMembers() ){422 // 名前423 lstrcpy(buffer+i2,member->GetName().c_str());424 i2+=lstrlen(buffer+i2)+1;425 426 // 型427 *(long *)(buffer+i2)=member->GetType().GetBasicType();428 i2+=sizeof(long);429 430 // 型の拡張情報431 SetLpIndex_DebugFile(buffer,&i2,member->GetType());432 433 // アクセシビリティ434 *(Prototype::Accessibility *)(buffer+i2)=member->GetAccessibility();435 i2+=sizeof(Prototype::Accessibility);436 437 // 配列438 *(long *)(buffer+i2)=(int)member->GetSubscripts().size();439 i2+=sizeof(long);440 BOOST_FOREACH( int indexMax, member->GetSubscripts() )441 {442 *(long *)(buffer+i2)=indexMax;443 i2+=sizeof(long);444 }445 446 //バッファが足りない場合は再確保447 if(BufferSize<i2+32768){448 BufferSize+=32768;449 buffer=(char *)HeapReAlloc(hHeap,0,buffer,BufferSize);450 }451 }452 453 //バッファが足りない場合は再確保454 if(BufferSize<i2+32768){455 BufferSize+=32768;456 buffer=(char *)HeapReAlloc(hHeap,0,buffer,BufferSize);457 }458 }459 460 175 length=i2; 461 176 } … … 467 182 memcpy(buffer,OpBuffer,SizeOf_CodeSection); 468 183 469 BOOST_FOREACH( const SourceLine &sourceLine, oldSourceLines )184 BOOST_FOREACH( const SourceLine &sourceLine, _oldSourceLines ) 470 185 { 471 186 if(!( … … 481 196 } 482 197 BOOL CDebugSection::__load(void){ 483 int i2,i3,i4,num; 484 char temp2[MAX_PATH],*temp5; 198 int i2,i3; 485 199 486 200 compiler.pCompilingClass = NULL; … … 502 216 i2+=sizeof(long); 503 217 504 MessageBox(0,"test","test",0);505 506 218 // オブジェクトモジュール 507 219 { … … 512 224 // バッファ 513 225 const std::string textString( (const char *)(buffer + i2), size ); 514 i2 += textString.size();226 i2 += size; 515 227 516 228 // テキストデータからシリアライズ 517 229 this->objectModule.ReadTextString( textString ); 230 231 compiler.SelectObjectModule( this->objectModule ); 518 232 } 519 233 520 234 //インクルード情報 521 IncludeFileInfo.FilesNum=*(long *)(buffer+i2);522 i2+=sizeof(long); 523 IncludeFileInfo.ppFileNames=(char **)malloc(IncludeFileInfo.FilesNum*sizeof(char *));524 for(i3=0;i3< IncludeFileInfo.FilesNum;i3++){235 _IncludeFileInfo.FilesNum=*(long *)(buffer+i2); 236 i2+=sizeof(long); 237 _IncludeFileInfo.ppFileNames=(char **)malloc(_IncludeFileInfo.FilesNum*sizeof(char *)); 238 for(i3=0;i3<_IncludeFileInfo.FilesNum;i3++){ 525 239 if(buffer[i2]=='\0') break; 526 IncludeFileInfo.ppFileNames[i3]=(char *)malloc(lstrlen(buffer+i2)+1);527 lstrcpy( IncludeFileInfo.ppFileNames[i3],buffer+i2);240 _IncludeFileInfo.ppFileNames[i3]=(char *)malloc(lstrlen(buffer+i2)+1); 241 lstrcpy(_IncludeFileInfo.ppFileNames[i3],buffer+i2); 528 242 i2+=lstrlen(buffer+i2)+1; 529 243 } 530 244 for(i2++,i3=0;;i2++,i3++){ 531 IncludeFileInfo.LineOfFile[i3]=(long)buffer[i2];532 if( IncludeFileInfo.LineOfFile[i3]==-1) break;245 _IncludeFileInfo.LineOfFile[i3]=(long)buffer[i2]; 246 if(_IncludeFileInfo.LineOfFile[i3]==-1) break; 533 247 } 534 248 … … 555 269 i2+=sizeof(long); 556 270 557 oldSourceLines.push_back( SourceLine( lineNum, nativeCodePos, sourceCodePos, sourceLineType ) ); 558 } 559 560 561 /////////////////////////////////////////// 562 // クラス情報(名前のみ。詳細は後で取得) 563 /////////////////////////////////////////// 564 565 this->pobj_DBClass=new Classes(); 566 567 int iMaxClassCount; 568 iMaxClassCount=*(long *)(buffer+i2); 569 i2+=sizeof(long); 570 for(i3=0;i3<iMaxClassCount;i3++){ 571 //クラス名 572 // TODO: 名前空間が未完成 573 this->pobj_DBClass->Add(NamespaceScopes(),NamespaceScopesCollection(),buffer+i2,0); 574 i2+=lstrlen(buffer+i2)+1; 575 } 576 577 compiler.objectModule.meta.SetClasses( this->pobj_DBClass ); 578 579 580 ////////////////// 581 // TypeDef情報 582 ////////////////// 583 584 //初期化 585 compiler.objectModule.meta.GetTypeDefs().clear(); 586 587 //個数を取得 588 num=*(long *)(buffer+i2); 589 i2+=sizeof(long); 590 for(i3=0;i3<num;i3++){ 591 temp5=buffer+i2; 592 i2+=lstrlen(buffer+i2)+1; 593 594 // 名前空間に未対応 595 compiler.objectModule.meta.GetTypeDefs().push_back( TypeDef( NamespaceScopes(), temp5, buffer+i2, -1 ) ); 596 597 i2+=lstrlen(buffer+i2)+1; 598 } 599 600 //定数を取得 601 GetConstInfo(); 602 this->globalConsts = compiler.objectModule.meta.GetGlobalConsts(); 603 this->globalConstMacros = compiler.objectModule.meta.GetGlobalConstMacros(); 604 605 //グローバル変数情報 606 compiler.objectModule.meta.GetGlobalVars().clear(); 607 int maxGlobalVars=*(long *)(buffer+i2); 608 i2+=sizeof(long); 609 for(i3=0;i3<maxGlobalVars;i3++){ 610 611 //変数名 612 char *name = buffer+i2; 613 i2+=lstrlen(buffer+i2)+1; 614 615 int basicType = *(long *)(buffer+i2); 616 i2+=sizeof(long); 617 618 Type type( basicType ); 619 GetLpIndex_DebugFile(buffer,&i2,type); 620 621 bool isRef = (buffer[i2++]) ? true:false; 622 623 bool isArray = (buffer[i2++]) ? true:false; 624 625 Variable *pVar = new Variable( name, type, false, isRef, "" ); 626 627 if(isArray){ 628 Subscripts subscripts; 629 int nSubScriptsNum = *(long *)(buffer+i2); 630 i2+=sizeof(long); 631 for( int i=0; i<nSubScriptsNum; i++ ) 632 { 633 subscripts.push_back( *(long *)(buffer+i2) ); 634 i2+=sizeof(long); 635 } 636 637 pVar->SetArray( subscripts ); 638 } 639 640 //レキシカルスコープ情報 641 pVar->SetScopeStartAddress( *(long *)(buffer+i2) ); 642 i2+=sizeof(long); 643 pVar->SetScopeEndAddress( *(long *)(buffer+i2) ); 644 i2+=sizeof(long); 645 pVar->SetScopeLevel( *(long *)(buffer+i2) ); 646 i2+=sizeof(long); 647 648 //メモリ位置 649 pVar->SetOffsetAddress( *(long *)(buffer+i2) ); 650 i2+=sizeof(long); 651 652 //変数を追加 653 compiler.objectModule.meta.GetGlobalVars().push_back( pVar ); 271 _oldSourceLines.push_back( SourceLine( lineNum, nativeCodePos, sourceCodePos, sourceLineType ) ); 654 272 } 655 273 … … 658 276 i2+=sizeof(long); 659 277 660 //プロシージャ情報661 userProcs.Clear();662 int subNum = *(long *)(buffer+i2);663 i2+=sizeof(long);664 for(int i6=0;i6<subNum;i6++){665 char szParentClassName[VN_SIZE];666 lstrcpy(szParentClassName,buffer+i2);667 i2+=lstrlen(buffer+i2)+1;668 669 const CClass *pClass = NULL;670 if(szParentClassName[0]){671 pClass=compiler.objectModule.meta.GetClasses().Find(szParentClassName);672 }673 674 //ID675 int id=*(long *)(buffer+i2);676 i2+=sizeof(long);677 678 //名前679 char *name = buffer+i2;680 i2+=lstrlen(buffer+i2)+1;681 682 // オブジェクトを生成683 // TODO: 名前空間が未完成684 UserProc *pUserProc = new UserProc( NamespaceScopes(), NamespaceScopesCollection(), name, Procedure::Function, false, false, false, id );685 pUserProc->SetParentClass( pClass );686 687 pUserProc->_beginOpAddressOld = *(long *)(buffer+i2);688 i2+=sizeof(long);689 pUserProc->_endOpAddressOld = *(long *)(buffer+i2);690 i2+=sizeof(long);691 692 pUserProc->CompleteCompile();693 694 //ローカル変数情報695 pUserProc->GetLocalVars().clear();696 int maxLocalVar=*(long *)(buffer+i2);697 i2+=sizeof(long);698 for(i3=0;i3<maxLocalVar;i3++){699 //変数名700 char *name = buffer+i2;701 i2+=lstrlen(buffer+i2)+1;702 703 int basicType = *(long *)(buffer+i2);704 i2+=sizeof(long);705 706 Type type( basicType );707 GetLpIndex_DebugFile(buffer,&i2,type);708 709 bool isRef = (buffer[i2++]) ? true:false;710 711 bool isArray = (buffer[i2++]) ? true:false;712 713 Variable *pVar = new Variable( name, type, false, isRef, "" );714 715 if(isArray){716 Subscripts subscripts;717 int nSubScriptsNum = *(long *)(buffer+i2);718 i2+=sizeof(long);719 for( int i=0; i<nSubScriptsNum; i++ )720 {721 subscripts.push_back( *(long *)(buffer+i2) );722 i2+=sizeof(long);723 }724 725 pVar->SetArray( subscripts );726 }727 728 //レキシカルスコープ情報729 pVar->SetScopeStartAddress( *(long *)(buffer+i2) );730 i2+=sizeof(long);731 pVar->SetScopeEndAddress( *(long *)(buffer+i2) );732 i2+=sizeof(long);733 pVar->SetScopeLevel( *(long *)(buffer+i2) );734 i2+=sizeof(long);735 736 //メモリ位置737 pVar->SetOffsetAddress( *(long *)(buffer+i2) );738 i2+=sizeof(long);739 740 //変数を追加741 pUserProc->GetLocalVars().push_back( pVar );742 }743 744 745 /////////////////////////////////746 // 格納位置を計算してpUserProcをセット747 /////////////////////////////////748 749 // ハッシュに追加750 if( !userProcs.Insert( pUserProc, -1 ) )751 {752 //return NULL;753 }754 }755 userProcs.Iterator_Init();756 757 //クラス情報758 CClass *pobj_c;759 for(i3=0;i3<iMaxClassCount;i3++){760 //クラス名761 char szClassName[VN_SIZE];762 lstrcpy(szClassName,buffer+i2);763 i2+=lstrlen(buffer+i2)+1;764 765 pobj_c = const_cast<CClass *>( compiler.objectModule.meta.GetClasses().Find(szClassName) );766 767 //仮想関数の数768 pobj_c->SetVtblNum( *(long *)(buffer+i2) );769 i2+=sizeof(long);770 771 //アラインメント772 pobj_c->SetFixedAlignment( *(long *)(buffer+i2) );773 i2+=sizeof(long);774 775 // 動的メンバ776 int nDynamicMember = *(long *)(buffer+i2);777 i2+=sizeof(long);778 for( i4=0; i4<nDynamicMember; i4++ ){779 // 名前780 string name = (char *)(buffer+i2);781 i2+=lstrlen(buffer+i2)+1;782 783 // 型784 Type type( *(long *)(buffer+i2) );785 i2+=sizeof(long);786 787 // 型の拡張情報788 GetLpIndex_DebugFile(buffer,&i2,type);789 790 // アクセシビリティ791 Prototype::Accessibility accessibility = *(Prototype::Accessibility *)(buffer+i2);792 i2+=sizeof(Prototype::Accessibility);793 794 Subscripts subscripts;795 int nSubScriptsNum = *(long *)(buffer+i2);796 i2+=sizeof(long);797 for( int i=0; i<nSubScriptsNum; i++ )798 {799 subscripts.push_back( *(long *)(buffer+i2) );800 i2+=sizeof(long);801 }802 803 CMember *member=new CMember( accessibility, name, type, false, subscripts, "", "" );804 805 pobj_c->GetDynamicMembers().push_back( member );806 }807 808 // 動的メソッド809 int nMethod = *(long *)(buffer+i2);810 i2+=sizeof(long);811 for( i4=0; i4<nMethod; i4++ ){812 813 Prototype::Accessibility accessibility=*(Prototype::Accessibility *)(buffer+i2);814 i2+=sizeof(Prototype::Accessibility);815 816 char szInherits[VN_SIZE];817 lstrcpy(szInherits,buffer+i2);818 i2+=lstrlen(buffer+i2)+1;819 820 const CClass *pobj_InheritsClass = NULL;821 if(szInherits[0]){822 pobj_InheritsClass=compiler.objectModule.meta.GetClasses().Find(szInherits);823 }824 825 lstrcpy(temp2,buffer+i2);826 i2+=lstrlen(buffer+i2)+1;827 828 const CClass *pobj_temp_c;829 pobj_temp_c=pobj_InheritsClass;830 if(pobj_temp_c==0) pobj_temp_c=pobj_c;831 832 UserProc *pUserProc = compiler.objectModule.meta.GetUserProcs().GetHashArrayElement( temp2 );833 while(pUserProc){834 if( pUserProc->GetName() == temp2 &&pUserProc->GetParentClassPtr()==pobj_temp_c)835 {836 break;837 }838 839 pUserProc=pUserProc->GetChainNext();840 }841 842 CMethod *pMethod = new DynamicMethod( pUserProc, accessibility, 0,0,false, pobj_InheritsClass);843 844 pobj_c->GetMethods().push_back( pMethod );845 }846 847 //静的メンバ848 int nStaticMember = *(long *)(buffer+i2);849 i2+=sizeof(long);850 for( i4=0; i4<nStaticMember; i4++ ){851 // 名前852 string name = (char *)(buffer+i2);853 i2+=lstrlen(buffer+i2)+1;854 855 // 型856 Type type( *(long *)(buffer+i2) );857 i2+=sizeof(long);858 859 // 型の拡張情報860 GetLpIndex_DebugFile(buffer,&i2,type);861 862 // アクセシビリティ863 Prototype::Accessibility accessibility = *(Prototype::Accessibility *)(buffer+i2);864 i2+=sizeof(Prototype::Accessibility);865 866 // 配列867 Subscripts subscripts;868 int nSubScriptsNum = *(long *)(buffer+i2);869 i2+=sizeof(long);870 for( int i=0; i<nSubScriptsNum; i++ )871 {872 subscripts.push_back( *(long *)(buffer+i2) );873 i2+=sizeof(long);874 }875 876 CMember *member=new CMember( accessibility, name, type, false, subscripts, "", "" );877 878 pobj_c->GetStaticMembers().push_back( member );879 }880 }881 278 882 279 HeapDefaultFree(buffer); … … 884 281 885 282 886 887 888 compiler.objectModule.meta.GetUserProcs() = userProcs; 889 pSub_DebugSys_EndProc=GetSubHash("_DebugSys_EndProc"); 283 this->pSub_DebugSys_EndProc=GetSubHash("_DebugSys_EndProc"); 284 if( this->pSub_DebugSys_EndProc == NULL ) 285 { 286 MessageBox( 0, "_DebugSys_EndProcが見つからない", "ActiveBasic", MB_OK ); 287 } 890 288 891 289 … … 899 297 //インクルード情報 900 298 extern INCLUDEFILEINFO IncludeFileInfo; 901 IncludeFileInfo=this-> IncludeFileInfo;299 IncludeFileInfo=this->_IncludeFileInfo; 902 300 903 301 //コードと行番号の関係 904 302 extern SourceLines oldSourceLines; 905 oldSourceLines = this-> oldSourceLines;303 oldSourceLines = this->_oldSourceLines; 906 304 907 305 BreakStepCodeBuffer=pobj_DBBreakPoint->update(OpBuffer,SizeOf_CodeSection); … … 1011 409 FileSize_CodeSection=this->SizeOf_CodeSection; 1012 410 411 // オブジェクトモジュール 412 compiler.SelectObjectModule( this->objectModule ); 413 1013 414 //インクルード情報 1014 415 extern INCLUDEFILEINFO IncludeFileInfo; 1015 IncludeFileInfo=this-> IncludeFileInfo;416 IncludeFileInfo=this->_IncludeFileInfo; 1016 417 1017 418 //ソースコード … … 1020 421 //コードと行番号の関係 1021 422 extern SourceLines oldSourceLines; 1022 oldSourceLines = this->oldSourceLines; 1023 1024 // クラス情報 1025 compiler.objectModule.meta.SetClasses( this->pobj_DBClass ); 1026 1027 //定数を取得 1028 compiler.objectModule.meta.GetGlobalConsts() = this->globalConsts; 1029 compiler.objectModule.meta.GetGlobalConstMacros() = this->globalConstMacros; 423 oldSourceLines = this->_oldSourceLines; 1030 424 1031 425 //グローバル実行領域のサイズ … … 1033 427 GlobalOpBufferSize=this->GlobalOpBufferSize; 1034 428 1035 //プロシージャ1036 compiler.objectModule.meta.GetUserProcs() = userProcs;1037 1038 429 extern const UserProc *pSub_DebugSys_EndProc; 1039 430 pSub_DebugSys_EndProc=this->pSub_DebugSys_EndProc; … … 1048 439 1049 440 //インクルード情報を解放 1050 for(i2=0;i2<IncludeFileInfo.FilesNum;i2++) 1051 { 1052 free(IncludeFileInfo.ppFileNames[i2]); 1053 } 1054 free(IncludeFileInfo.ppFileNames); 1055 1056 //クラスに関するメモリを解放 1057 delete this->pobj_DBClass; 1058 this->pobj_DBClass=0; 441 for(i2=0;i2<_IncludeFileInfo.FilesNum;i2++) 442 { 443 free(_IncludeFileInfo.ppFileNames[i2]); 444 } 445 free(_IncludeFileInfo.ppFileNames); 1059 446 1060 447 //コードバッファを解放
Note:
See TracChangeset
for help on using the changeset viewer.