Index: trunk/abdev/BasicCompiler_Common/DebugMiddleFile.cpp
===================================================================
--- trunk/abdev/BasicCompiler_Common/DebugMiddleFile.cpp	(revision 264)
+++ trunk/abdev/BasicCompiler_Common/DebugMiddleFile.cpp	(revision 265)
@@ -37,5 +37,5 @@
 		(*p)+=lstrlen(buffer+(*p))+1;
 
-		type.SetClassPtr( compiler.objectModule.meta.GetClasses().Find(szClassName) );
+		type.SetClassPtr( compiler.GetObjectModule().meta.GetClasses().Find(szClassName) );
 	}
 	else{
@@ -48,5 +48,5 @@
 
 CDebugSection::~CDebugSection(){
-	if(pobj_DBClass) DeleteDebugInfo();
+	if(dwImageBase) DeleteDebugInfo();
 	if(buffer){
 		HeapDefaultFree(buffer);
@@ -55,5 +55,4 @@
 }
 void CDebugSection::make(void){
-	extern INCLUDEFILEINFO IncludeFileInfo;
 	int i2,i3,BufferSize;
 
@@ -82,5 +81,5 @@
 		// テキストデータにシリアライズ
 		std::string textString;
-		compiler.objectModule.WriteTextString( textString );
+		compiler.GetObjectModule().WriteTextString( textString );
 
 		// サイズ
@@ -105,4 +104,5 @@
 
 	//インクルード情報
+	extern INCLUDEFILEINFO IncludeFileInfo;
 	*(long *)(buffer+i2)=IncludeFileInfo.FilesNum;
 	i2+=sizeof(long);
@@ -115,9 +115,27 @@
 		buffer[i2++]=(char)IncludeFileInfo.LineOfFile[i3];
 		if(IncludeFileInfo.LineOfFile[i3]==-1) break;
+
+		//バッファが足りない場合は再確保
+		if(BufferSize<i2+32768){
+			BufferSize+=32768;
+			buffer=(char *)HeapReAlloc(hHeap,0,buffer,BufferSize);
+		}
 	}
 
 	//ソースコード
+	{
+		//バッファが足りない場合は再確保
+		int bufferLen = lstrlen( basbuf );
+		if(BufferSize<i2+(int)bufferLen+32768){
+			while( BufferSize<i2+(int)bufferLen+32768 )
+			{
+				BufferSize+=32768;
+			}
+
+			buffer=(char *)HeapReAlloc(hHeap,0,buffer,BufferSize);
+		}
+	}
 	lstrcpy(buffer+i2,basbuf);
-	i2+=lstrlen(buffer+i2)+1;
+	i2+=lstrlen( buffer + i2 )+1;
 
 
@@ -150,96 +168,4 @@
 	}
 
-
-
-	////////////////////////////////////////////
-	// クラス情報（名前のみ。詳細は後で保存）
-	////////////////////////////////////////////
-
-	//イテレータをリセット
-	compiler.objectModule.meta.GetClasses().Iterator_Reset();
-
-	//個数
-	*(long *)(buffer+i2)=compiler.objectModule.meta.GetClasses().Iterator_GetMaxCount();
-	i2+=sizeof(long);
-
-	while(compiler.objectModule.meta.GetClasses().Iterator_HasNext()){
-		CClass *pobj_c;
-		pobj_c=compiler.objectModule.meta.GetClasses().Iterator_GetNext();
-
-		//クラス名
-		lstrcpy(buffer+i2,pobj_c->GetName().c_str());
-		i2+=lstrlen(buffer+i2)+1;
-	}
-
-
-
-	//////////////////
-	// TypeDef情報
-	//////////////////
-	*(long *)(buffer+i2)=(int)compiler.objectModule.meta.GetTypeDefs().size();
-	i2+=sizeof(long);
-	for(i3=0;i3<(int)compiler.objectModule.meta.GetTypeDefs().size();i3++){
-		lstrcpy(buffer+i2,compiler.objectModule.meta.GetTypeDefs()[i3].GetName().c_str() );
-		i2+=lstrlen(buffer+i2)+1;
-
-		lstrcpy(buffer+i2,compiler.objectModule.meta.GetTypeDefs()[i3].GetBaseName().c_str() );
-		i2+=lstrlen(buffer+i2)+1;
-
-		//バッファが足りない場合は再確保
-		if(BufferSize<i2+32768){
-			BufferSize+=32768;
-			buffer=(char *)HeapReAlloc(hHeap,0,buffer,BufferSize);
-		}
-	}
-
-
-	//グローバル変数情報
-	*(long *)(buffer+i2)=(int)compiler.objectModule.meta.GetGlobalVars().size();
-	i2+=sizeof(long);
-	BOOST_FOREACH( Variable *pVar, compiler.objectModule.meta.GetGlobalVars() ){
-		//変数名
-		lstrcpy(buffer+i2,pVar->GetName().c_str());
-		i2+=lstrlen(buffer+i2)+1;
-
-		//型
-		*(long *)(buffer+i2)=pVar->GetType().GetBasicType();
-		i2+=sizeof(long);
-
-		//型の拡張情報
-		SetLpIndex_DebugFile(buffer,&i2,pVar->GetType());
-
-		buffer[i2++] = pVar->IsRef() ? 1 : 0;
-
-		buffer[i2++] = pVar->IsArray() ? 1 : 0;
-
-		if(pVar->IsArray()){
-			*(long *)(buffer+i2)=(int)pVar->GetSubscripts().size();
-			i2+=sizeof(long);
-			BOOST_FOREACH( int indexMax, pVar->GetSubscripts() )
-			{
-				*(long *)(buffer+i2)=indexMax;
-				i2+=sizeof(long);
-			}
-		}
-
-		//レキシカルスコープ情報
-		*(long *)(buffer+i2)=pVar->GetScopeStartAddress();
-		i2+=sizeof(long);
-		*(long *)(buffer+i2)=pVar->GetScopeEndAddress();
-		i2+=sizeof(long);
-		*(long *)(buffer+i2)=pVar->GetScopeLevel();
-		i2+=sizeof(long);
-
-		//メモリ位置
-		*(long *)(buffer+i2)=pVar->GetOffsetAddress();
-		i2+=sizeof(long);
-
-		//バッファが足りない場合は再確保
-		if(BufferSize<i2+32768){
-			BufferSize+=32768;
-			buffer=(char *)HeapReAlloc(hHeap,0,buffer,BufferSize);
-		}
-	}
-
 	//グローバル実行領域のサイズ
 	extern int GlobalOpBufferSize;
@@ -247,215 +173,4 @@
 	i2+=sizeof(long);
 
-	//プロシージャ情報
-	*(long *)(buffer+i2) = compiler.objectModule.meta.GetUserProcs().Iterator_GetMaxCount();
-	i2+=sizeof(long);
-	compiler.objectModule.meta.GetUserProcs().Iterator_Reset();
-	while( compiler.objectModule.meta.GetUserProcs().Iterator_HasNext() )
-	{
-		UserProc *pUserProc = compiler.objectModule.meta.GetUserProcs().Iterator_GetNext();
-
-		if(pUserProc->GetParentClassPtr()){
-			lstrcpy(buffer+i2,pUserProc->GetParentClassPtr()->GetName().c_str());
-			i2+=lstrlen(buffer+i2)+1;
-		}
-		else{
-			lstrcpy(buffer+i2,"");
-			i2+=lstrlen(buffer+i2)+1;
-		}
-
-		//ID
-		*(long *)(buffer+i2)=pUserProc->GetId();
-		i2+=sizeof(long);
-
-		//関数名
-		lstrcpy(buffer+i2,pUserProc->GetName().c_str());
-		i2+=lstrlen(buffer+i2)+1;
-
-		*(long *)(buffer+i2)=pUserProc->_beginOpAddressOld;
-		i2+=sizeof(long);
-		*(long *)(buffer+i2)=pUserProc->_endOpAddressOld;
-		i2+=sizeof(long);
-
-		//ローカル変数情報
-		*(long *)(buffer+i2)=(int)pUserProc->GetLocalVars().size();
-		i2+=sizeof(long);
-
-		//バッファが足りない場合は再確保
-		if(BufferSize<i2+32768){
-			BufferSize+=32768;
-			buffer=(char *)HeapReAlloc(hHeap,0,buffer,BufferSize);
-		}
-
-		BOOST_FOREACH( Variable *pVar, pUserProc->GetLocalVars() ){
-			lstrcpy(buffer+i2,pVar->GetName().c_str());
-			i2+=lstrlen(buffer+i2)+1;
-
-			//型
-			*(long *)(buffer+i2)=pVar->GetType().GetBasicType();
-			i2+=sizeof(long);
-
-			//型の拡張情報
-			SetLpIndex_DebugFile(buffer,&i2,pVar->GetType());
-
-			//参照型パラメータかどうか
-			buffer[i2++] = pVar->IsRef() ? 1 : 0;
-
-			//配列かどうか
-			buffer[i2++] = pVar->IsArray() ? 1 : 0;
-
-			//配列要素
-			if(pVar->IsArray()){
-				*(long *)(buffer+i2)=(int)pVar->GetSubscripts().size();
-				i2+=sizeof(long);
-				BOOST_FOREACH( int indexMax, pVar->GetSubscripts() )
-				{
-					*(long *)(buffer+i2)=indexMax;
-					i2+=sizeof(long);
-				}
-			}
-
-			//レキシカルスコープ情報
-			*(long *)(buffer+i2)=pVar->GetScopeStartAddress();
-			i2+=sizeof(long);
-			*(long *)(buffer+i2)=pVar->GetScopeEndAddress();
-			i2+=sizeof(long);
-			*(long *)(buffer+i2)=pVar->GetScopeLevel();
-			i2+=sizeof(long);
-
-			//メモリ位置
-			*(long *)(buffer+i2)=pVar->GetOffsetAddress();
-			i2+=sizeof(long);
-
-
-
-
-			//バッファが足りない場合は再確保
-			if(BufferSize<i2+32768){
-				BufferSize+=32768;
-				buffer=(char *)HeapReAlloc(hHeap,0,buffer,BufferSize);
-			}
-		}
-	}
-
-
-
-	///////////////////
-	// クラス情報
-	///////////////////
-
-	//イテレータをリセット
-	compiler.objectModule.meta.GetClasses().Iterator_Reset();
-
-	while(compiler.objectModule.meta.GetClasses().Iterator_HasNext()){
-		CClass *pobj_c;
-		pobj_c=compiler.objectModule.meta.GetClasses().Iterator_GetNext();
-
-
-		//クラス名
-		lstrcpy(buffer+i2,pobj_c->GetName().c_str());
-		i2+=lstrlen(buffer+i2)+1;
-
-		//仮想関数の数
-		*(long *)(buffer+i2)=pobj_c->GetVtblNum();
-		i2+=sizeof(long);
-
-		//アラインメント
-		*(long *)(buffer+i2)=pobj_c->GetFixedAlignment();
-		i2+=sizeof(long);
-
-		// 動的メンバ
-		*(long *)(buffer+i2)=(int)pobj_c->GetDynamicMembers().size();
-		i2+=sizeof(long);
-		BOOST_FOREACH( CMember *member, pobj_c->GetDynamicMembers() ){
-			// 名前
-			lstrcpy(buffer+i2,member->GetName().c_str());
-			i2+=lstrlen(buffer+i2)+1;
-
-			// 型
-			*(long *)(buffer+i2)=member->GetType().GetBasicType();
-			i2+=sizeof(long);
-
-			// 型の拡張情報
-			SetLpIndex_DebugFile(buffer,&i2,member->GetType());
-
-			// アクセシビリティ
-			*(Prototype::Accessibility *)(buffer+i2)=member->GetAccessibility();
-			i2+=sizeof(Prototype::Accessibility);
-
-			*(long *)(buffer+i2)=(int)member->GetSubscripts().size();
-			i2+=sizeof(long);
-			BOOST_FOREACH( int indexMax, member->GetSubscripts() )
-			{
-				*(long *)(buffer+i2)=indexMax;
-				i2+=sizeof(long);
-			}
-
-			//バッファが足りない場合は再確保
-			if(BufferSize<i2+32768){
-				BufferSize+=32768;
-				buffer=(char *)HeapReAlloc(hHeap,0,buffer,BufferSize);
-			}
-		}
-
-		// 動的メソッド
-		*(long *)(buffer+i2)=(long)pobj_c->GetMethods().size();
-		i2+=sizeof(long);
-		BOOST_FOREACH( const CMethod *pMethod, pobj_c->GetMethods() ){
-			*(Prototype::Accessibility *)(buffer+i2)=pMethod->GetAccessibility();
-			i2+=sizeof(Prototype::Accessibility);
-			if( pMethod->GetInheritsClassPtr() ){
-				lstrcpy(buffer+i2,pMethod->GetInheritsClassPtr()->GetName().c_str());
-				i2+=lstrlen(buffer+i2)+1;
-			}
-			else{
-				lstrcpy(buffer+i2,"");
-				i2+=lstrlen(buffer+i2)+1;
-			}
-			lstrcpy(buffer+i2,pMethod->GetUserProc().GetName().c_str());
-			i2+=lstrlen(buffer+i2)+1;
-		}
-
-		//静的メンバ
-		*(long *)(buffer+i2)=(long)pobj_c->GetStaticMembers().size();
-		i2+=sizeof(long);
-		BOOST_FOREACH( CMember *member, pobj_c->GetStaticMembers() ){
-			// 名前
-			lstrcpy(buffer+i2,member->GetName().c_str());
-			i2+=lstrlen(buffer+i2)+1;
-
-			// 型
-			*(long *)(buffer+i2)=member->GetType().GetBasicType();
-			i2+=sizeof(long);
-
-			// 型の拡張情報
-			SetLpIndex_DebugFile(buffer,&i2,member->GetType());
-
-			// アクセシビリティ
-			*(Prototype::Accessibility *)(buffer+i2)=member->GetAccessibility();
-			i2+=sizeof(Prototype::Accessibility);
-
-			// 配列
-			*(long *)(buffer+i2)=(int)member->GetSubscripts().size();
-			i2+=sizeof(long);
-			BOOST_FOREACH( int indexMax, member->GetSubscripts() )
-			{
-				*(long *)(buffer+i2)=indexMax;
-				i2+=sizeof(long);
-			}
-
-			//バッファが足りない場合は再確保
-			if(BufferSize<i2+32768){
-				BufferSize+=32768;
-				buffer=(char *)HeapReAlloc(hHeap,0,buffer,BufferSize);
-			}
-		}
-
-		//バッファが足りない場合は再確保
-		if(BufferSize<i2+32768){
-			BufferSize+=32768;
-			buffer=(char *)HeapReAlloc(hHeap,0,buffer,BufferSize);
-		}
-	}
-
 	length=i2;
 }
@@ -467,5 +182,5 @@
 	memcpy(buffer,OpBuffer,SizeOf_CodeSection);
 
-	BOOST_FOREACH( const SourceLine &sourceLine, oldSourceLines )
+	BOOST_FOREACH( const SourceLine &sourceLine, _oldSourceLines )
 	{
 		if(!(
@@ -481,6 +196,5 @@
 }
 BOOL CDebugSection::__load(void){
-	int i2,i3,i4,num;
-	char temp2[MAX_PATH],*temp5;
+	int i2,i3;
 
 	compiler.pCompilingClass = NULL;
@@ -502,6 +216,4 @@
 	i2+=sizeof(long);
 
-	MessageBox(0,"test","test",0);
-
 	// オブジェクトモジュール
 	{
@@ -512,23 +224,25 @@
 		// バッファ
 		const std::string textString( (const char *)(buffer + i2), size );
-		i2 += textString.size();
+		i2 += size;
 
 		// テキストデータからシリアライズ
 		this->objectModule.ReadTextString( textString );
+
+		compiler.SelectObjectModule( this->objectModule );
 	}
 
 	//インクルード情報
-	IncludeFileInfo.FilesNum=*(long *)(buffer+i2);
-	i2+=sizeof(long);
-	IncludeFileInfo.ppFileNames=(char **)malloc(IncludeFileInfo.FilesNum*sizeof(char *));
-	for(i3=0;i3<IncludeFileInfo.FilesNum;i3++){
+	_IncludeFileInfo.FilesNum=*(long *)(buffer+i2);
+	i2+=sizeof(long);
+	_IncludeFileInfo.ppFileNames=(char **)malloc(_IncludeFileInfo.FilesNum*sizeof(char *));
+	for(i3=0;i3<_IncludeFileInfo.FilesNum;i3++){
 		if(buffer[i2]=='\0') break;
-		IncludeFileInfo.ppFileNames[i3]=(char *)malloc(lstrlen(buffer+i2)+1);
-		lstrcpy(IncludeFileInfo.ppFileNames[i3],buffer+i2);
+		_IncludeFileInfo.ppFileNames[i3]=(char *)malloc(lstrlen(buffer+i2)+1);
+		lstrcpy(_IncludeFileInfo.ppFileNames[i3],buffer+i2);
 		i2+=lstrlen(buffer+i2)+1;
 	}
 	for(i2++,i3=0;;i2++,i3++){
-		IncludeFileInfo.LineOfFile[i3]=(long)buffer[i2];
-		if(IncludeFileInfo.LineOfFile[i3]==-1) break;
+		_IncludeFileInfo.LineOfFile[i3]=(long)buffer[i2];
+		if(_IncludeFileInfo.LineOfFile[i3]==-1) break;
 	}
 
@@ -555,101 +269,5 @@
 		i2+=sizeof(long);
 
-		oldSourceLines.push_back( SourceLine( lineNum, nativeCodePos, sourceCodePos, sourceLineType ) );
-	}
-
-
-	///////////////////////////////////////////
-	// クラス情報（名前のみ。詳細は後で取得）
-	///////////////////////////////////////////
-
-	this->pobj_DBClass=new Classes();
-
-	int iMaxClassCount;
-	iMaxClassCount=*(long *)(buffer+i2);
-	i2+=sizeof(long);
-	for(i3=0;i3<iMaxClassCount;i3++){
-		//クラス名
-		// TODO: 名前空間が未完成
-		this->pobj_DBClass->Add(NamespaceScopes(),NamespaceScopesCollection(),buffer+i2,0);
-		i2+=lstrlen(buffer+i2)+1;
-	}
-
-	compiler.objectModule.meta.SetClasses( this->pobj_DBClass );
-
-
-	//////////////////
-	// TypeDef情報
-	//////////////////
-
-	//初期化
-	compiler.objectModule.meta.GetTypeDefs().clear();
-
-	//個数を取得
-	num=*(long *)(buffer+i2);
-	i2+=sizeof(long);
-	for(i3=0;i3<num;i3++){
-		temp5=buffer+i2;
-		i2+=lstrlen(buffer+i2)+1;
-
-		// 名前空間に未対応
-		compiler.objectModule.meta.GetTypeDefs().push_back( TypeDef( NamespaceScopes(), temp5, buffer+i2, -1 ) );
-
-		i2+=lstrlen(buffer+i2)+1;
-	}
-
-	//定数を取得
-	GetConstInfo();
-	this->globalConsts = compiler.objectModule.meta.GetGlobalConsts();
-	this->globalConstMacros = compiler.objectModule.meta.GetGlobalConstMacros();
-
-	//グローバル変数情報
-	compiler.objectModule.meta.GetGlobalVars().clear();
-	int maxGlobalVars=*(long *)(buffer+i2);
-	i2+=sizeof(long);
-	for(i3=0;i3<maxGlobalVars;i3++){
-
-		//変数名
-		char *name = buffer+i2;
-		i2+=lstrlen(buffer+i2)+1;
-
-		int basicType = *(long *)(buffer+i2);
-		i2+=sizeof(long);
-
-		Type type( basicType );
-		GetLpIndex_DebugFile(buffer,&i2,type);
-
-		bool isRef = (buffer[i2++]) ? true:false;
-
-		bool isArray = (buffer[i2++]) ? true:false;
-
-		Variable *pVar = new Variable( name, type, false, isRef, "" );
-
-		if(isArray){
-			Subscripts subscripts;
-			int nSubScriptsNum = *(long *)(buffer+i2);
-			i2+=sizeof(long);
-			for( int i=0; i<nSubScriptsNum; i++ )
-			{
-				subscripts.push_back( *(long *)(buffer+i2) );
-				i2+=sizeof(long);
-			}
-
-			pVar->SetArray( subscripts );
-		}
-
-		//レキシカルスコープ情報
-		pVar->SetScopeStartAddress( *(long *)(buffer+i2) );
-		i2+=sizeof(long);
-		pVar->SetScopeEndAddress( *(long *)(buffer+i2) );
-		i2+=sizeof(long);
-		pVar->SetScopeLevel( *(long *)(buffer+i2) );
-		i2+=sizeof(long);
-
-		//メモリ位置
-		pVar->SetOffsetAddress( *(long *)(buffer+i2) );
-		i2+=sizeof(long);
-
-		//変数を追加
-		compiler.objectModule.meta.GetGlobalVars().push_back( pVar );
+		_oldSourceLines.push_back( SourceLine( lineNum, nativeCodePos, sourceCodePos, sourceLineType ) );
 	}
 
@@ -658,225 +276,4 @@
 	i2+=sizeof(long);
 
-	//プロシージャ情報
-	userProcs.Clear();
-	int subNum = *(long *)(buffer+i2);
-	i2+=sizeof(long);
-	for(int i6=0;i6<subNum;i6++){
-		char szParentClassName[VN_SIZE];
-		lstrcpy(szParentClassName,buffer+i2);
-		i2+=lstrlen(buffer+i2)+1;
-
-		const CClass *pClass = NULL;
-		if(szParentClassName[0]){
-			pClass=compiler.objectModule.meta.GetClasses().Find(szParentClassName);
-		}
-
-		//ID
-		int id=*(long *)(buffer+i2);
-		i2+=sizeof(long);
-
-		//名前
-		char *name = buffer+i2;
-		i2+=lstrlen(buffer+i2)+1;
-
-		// オブジェクトを生成
-		// TODO: 名前空間が未完成
-		UserProc *pUserProc = new UserProc( NamespaceScopes(), NamespaceScopesCollection(), name, Procedure::Function, false, false, false, id );
-		pUserProc->SetParentClass( pClass );
-
-		pUserProc->_beginOpAddressOld = *(long *)(buffer+i2);
-		i2+=sizeof(long);
-		pUserProc->_endOpAddressOld = *(long *)(buffer+i2);
-		i2+=sizeof(long);
-
-		pUserProc->CompleteCompile();
-
-		//ローカル変数情報
-		pUserProc->GetLocalVars().clear();
-		int maxLocalVar=*(long *)(buffer+i2);
-		i2+=sizeof(long);
-		for(i3=0;i3<maxLocalVar;i3++){
-			//変数名
-			char *name = buffer+i2;
-			i2+=lstrlen(buffer+i2)+1;
-
-			int basicType = *(long *)(buffer+i2);
-			i2+=sizeof(long);
-
-			Type type( basicType );
-			GetLpIndex_DebugFile(buffer,&i2,type);
-
-			bool isRef = (buffer[i2++]) ? true:false;
-
-			bool isArray = (buffer[i2++]) ? true:false;
-
-			Variable *pVar = new Variable( name, type, false, isRef, "" );
-
-			if(isArray){
-				Subscripts subscripts;
-				int nSubScriptsNum = *(long *)(buffer+i2);
-				i2+=sizeof(long);
-				for( int i=0; i<nSubScriptsNum; i++ )
-				{
-					subscripts.push_back( *(long *)(buffer+i2) );
-					i2+=sizeof(long);
-				}
-
-				pVar->SetArray( subscripts );
-			}
-
-			//レキシカルスコープ情報
-			pVar->SetScopeStartAddress( *(long *)(buffer+i2) );
-			i2+=sizeof(long);
-			pVar->SetScopeEndAddress( *(long *)(buffer+i2) );
-			i2+=sizeof(long);
-			pVar->SetScopeLevel( *(long *)(buffer+i2) );
-			i2+=sizeof(long);
-
-			//メモリ位置
-			pVar->SetOffsetAddress( *(long *)(buffer+i2) );
-			i2+=sizeof(long);
-
-			//変数を追加
-			pUserProc->GetLocalVars().push_back( pVar );
-		}
-
-
-		/////////////////////////////////
-		// 格納位置を計算してpUserProcをセット
-		/////////////////////////////////
-
-		// ハッシュに追加
-		if( !userProcs.Insert( pUserProc, -1 ) )
-		{
-			//return NULL;
-		}
-	}
-	userProcs.Iterator_Init();
-
-	//クラス情報
-	CClass *pobj_c;
-	for(i3=0;i3<iMaxClassCount;i3++){
-		//クラス名
-		char szClassName[VN_SIZE];
-		lstrcpy(szClassName,buffer+i2);
-		i2+=lstrlen(buffer+i2)+1;
-
-		pobj_c =  const_cast<CClass *>( compiler.objectModule.meta.GetClasses().Find(szClassName) );
-
-		//仮想関数の数
-		pobj_c->SetVtblNum( *(long *)(buffer+i2) );
-		i2+=sizeof(long);
-
-		//アラインメント
-		pobj_c->SetFixedAlignment( *(long *)(buffer+i2) );
-		i2+=sizeof(long);
-
-		// 動的メンバ
-		int nDynamicMember = *(long *)(buffer+i2);
-		i2+=sizeof(long);
-		for( i4=0; i4<nDynamicMember; i4++ ){
-			// 名前
-			string name = (char *)(buffer+i2);
-			i2+=lstrlen(buffer+i2)+1;
-
-			// 型
-			Type type( *(long *)(buffer+i2) );
-			i2+=sizeof(long);
-
-			// 型の拡張情報
-			GetLpIndex_DebugFile(buffer,&i2,type);
-
-			// アクセシビリティ
-			Prototype::Accessibility accessibility = *(Prototype::Accessibility *)(buffer+i2);
-			i2+=sizeof(Prototype::Accessibility);
-
-			Subscripts subscripts;
-			int nSubScriptsNum = *(long *)(buffer+i2);
-			i2+=sizeof(long);
-			for( int i=0; i<nSubScriptsNum; i++ )
-			{
-				subscripts.push_back( *(long *)(buffer+i2) );
-				i2+=sizeof(long);
-			}
-
-			CMember *member=new CMember( accessibility, name, type, false, subscripts, "", "" );
-
-			pobj_c->GetDynamicMembers().push_back( member );
-		}
-
-		// 動的メソッド
-		int nMethod = *(long *)(buffer+i2);
-		i2+=sizeof(long);
-		for( i4=0; i4<nMethod; i4++ ){
-
-			Prototype::Accessibility accessibility=*(Prototype::Accessibility *)(buffer+i2);
-			i2+=sizeof(Prototype::Accessibility);
-
-			char szInherits[VN_SIZE];
-			lstrcpy(szInherits,buffer+i2);
-			i2+=lstrlen(buffer+i2)+1;
-
-			const CClass *pobj_InheritsClass = NULL;
-			if(szInherits[0]){
-				pobj_InheritsClass=compiler.objectModule.meta.GetClasses().Find(szInherits);
-			}
-
-			lstrcpy(temp2,buffer+i2);
-			i2+=lstrlen(buffer+i2)+1;
-
-			const CClass *pobj_temp_c;
-			pobj_temp_c=pobj_InheritsClass;
-			if(pobj_temp_c==0) pobj_temp_c=pobj_c;
-
-			UserProc *pUserProc = compiler.objectModule.meta.GetUserProcs().GetHashArrayElement( temp2 );
-			while(pUserProc){
-				if( pUserProc->GetName() == temp2 &&pUserProc->GetParentClassPtr()==pobj_temp_c)
-				{
-					break;
-				}
-
-				pUserProc=pUserProc->GetChainNext();
-			}
-
-			CMethod *pMethod = new DynamicMethod( pUserProc, accessibility, 0,0,false, pobj_InheritsClass);
-
-			pobj_c->GetMethods().push_back( pMethod );
-		}
-
-		//静的メンバ
-		int nStaticMember = *(long *)(buffer+i2);
-		i2+=sizeof(long);
-		for( i4=0; i4<nStaticMember; i4++ ){
-			// 名前
-			string name = (char *)(buffer+i2);
-			i2+=lstrlen(buffer+i2)+1;
-
-			// 型
-			Type type( *(long *)(buffer+i2) );
-			i2+=sizeof(long);
-
-			// 型の拡張情報
-			GetLpIndex_DebugFile(buffer,&i2,type);
-
-			// アクセシビリティ
-			Prototype::Accessibility accessibility = *(Prototype::Accessibility *)(buffer+i2);
-			i2+=sizeof(Prototype::Accessibility);
-
-			// 配列
-			Subscripts subscripts;
-			int nSubScriptsNum = *(long *)(buffer+i2);
-			i2+=sizeof(long);
-			for( int i=0; i<nSubScriptsNum; i++ )
-			{
-				subscripts.push_back( *(long *)(buffer+i2) );
-				i2+=sizeof(long);
-			}
-
-			CMember *member=new CMember( accessibility, name, type, false, subscripts, "", "" );
-
-			pobj_c->GetStaticMembers().push_back( member );
-		}
-	}
 
 	HeapDefaultFree(buffer);
@@ -884,8 +281,9 @@
 
 
-
-
-	compiler.objectModule.meta.GetUserProcs() = userProcs;
-	pSub_DebugSys_EndProc=GetSubHash("_DebugSys_EndProc");
+	this->pSub_DebugSys_EndProc=GetSubHash("_DebugSys_EndProc");
+	if( this->pSub_DebugSys_EndProc == NULL )
+	{
+		MessageBox( 0, "_DebugSys_EndProcが見つからない", "ActiveBasic", MB_OK );
+	}
 
 
@@ -899,9 +297,9 @@
 	//インクルード情報
 	extern INCLUDEFILEINFO IncludeFileInfo;
-	IncludeFileInfo=this->IncludeFileInfo;
+	IncludeFileInfo=this->_IncludeFileInfo;
 
 	//コードと行番号の関係
 	extern SourceLines oldSourceLines;
-	oldSourceLines = this->oldSourceLines;
+	oldSourceLines = this->_oldSourceLines;
 
 	BreakStepCodeBuffer=pobj_DBBreakPoint->update(OpBuffer,SizeOf_CodeSection);
@@ -1011,7 +409,10 @@
 	FileSize_CodeSection=this->SizeOf_CodeSection;
 
+	// オブジェクトモジュール
+	compiler.SelectObjectModule( this->objectModule );
+
 	//インクルード情報
 	extern INCLUDEFILEINFO IncludeFileInfo;
-	IncludeFileInfo=this->IncludeFileInfo;
+	IncludeFileInfo=this->_IncludeFileInfo;
 
 	//ソースコード
@@ -1020,12 +421,5 @@
 	//コードと行番号の関係
 	extern SourceLines oldSourceLines;
-	oldSourceLines = this->oldSourceLines;
-
-	// クラス情報
-	compiler.objectModule.meta.SetClasses( this->pobj_DBClass );
-
-	//定数を取得
-	compiler.objectModule.meta.GetGlobalConsts() = this->globalConsts;
-	compiler.objectModule.meta.GetGlobalConstMacros() = this->globalConstMacros;
+	oldSourceLines = this->_oldSourceLines;
 
 	//グローバル実行領域のサイズ
@@ -1033,7 +427,4 @@
 	GlobalOpBufferSize=this->GlobalOpBufferSize;
 
-	//プロシージャ
-	compiler.objectModule.meta.GetUserProcs() = userProcs;
-
 	extern const UserProc *pSub_DebugSys_EndProc;
 	pSub_DebugSys_EndProc=this->pSub_DebugSys_EndProc;
@@ -1048,13 +439,9 @@
 
 	//インクルード情報を解放
-	for(i2=0;i2<IncludeFileInfo.FilesNum;i2++)
-	{
-		free(IncludeFileInfo.ppFileNames[i2]);
-	}
-	free(IncludeFileInfo.ppFileNames);
-
-	//クラスに関するメモリを解放
-	delete this->pobj_DBClass;
-	this->pobj_DBClass=0;
+	for(i2=0;i2<_IncludeFileInfo.FilesNum;i2++)
+	{
+		free(_IncludeFileInfo.ppFileNames[i2]);
+	}
+	free(_IncludeFileInfo.ppFileNames);
 
 	//コードバッファを解放
