Index: trunk/ab5.0/abdev/BasicCompiler_Common/Debug.cpp
===================================================================
--- trunk/ab5.0/abdev/BasicCompiler_Common/Debug.cpp	(revision 740)
+++ trunk/ab5.0/abdev/BasicCompiler_Common/Debug.cpp	(revision 741)
@@ -23,4 +23,5 @@
 int NextStepThreadNum;
 
+DebugSectionCollection debugSectionCollection;
 
 void Debugger_StepIn(void){
@@ -129,7 +130,7 @@
 
 			StepCursorObpSchedule=oldSourceLines[i3].GetNativeCodePos();
-			StepCursor_BackupChar=pobj_DBDebugSection->pobj_now->BreakStepCodeBuffer[StepCursorObpSchedule];
-
-			pobj_DBDebugSection->pobj_now->BreakStepCodeBuffer[StepCursorObpSchedule]=(char)0xCC;
+			StepCursor_BackupChar=debugSectionCollection.GetCurrent().BreakStepCodeBuffer[StepCursorObpSchedule];
+
+			debugSectionCollection.GetCurrent().BreakStepCodeBuffer[StepCursorObpSchedule]=(char)0xCC;
 
 			break;
@@ -292,5 +293,5 @@
 	WriteProcessMemory(hDebugProcess,
 		(void *)(ULONG_PTR)(ImageBase+MemPos_CodeSection),
-		pobj_DBDebugSection->pobj_now->BreakStepCodeBuffer,
+		debugSectionCollection.GetCurrent().BreakStepCodeBuffer,
 		FileSize_CodeSection,&lpAccBytes);
 
@@ -298,5 +299,5 @@
 	if(ImageBase+MemPos_CodeSection<=EIP_RIP(*pContext)&&EIP_RIP(*pContext)<ImageBase+MemPos_CodeSection+FileSize_CodeSection){
 		if(OpBuffer[EIP_RIP(*pContext)-ImageBase-MemPos_CodeSection-1]!=
-			pobj_DBDebugSection->pobj_now->BreakStepCodeBuffer[EIP_RIP(*pContext)-ImageBase-MemPos_CodeSection-1]){
+			debugSectionCollection.GetCurrent().BreakStepCodeBuffer[EIP_RIP(*pContext)-ImageBase-MemPos_CodeSection-1]){
 			//直前のブレークポイントがユーザー指定によるものだったとき
 
@@ -312,5 +313,5 @@
 			if(StepCursorObpSchedule==(int)(EIP_RIP(*pContext)-ImageBase-MemPos_CodeSection)){
 				//カーソル行までのステップ実行の場合
-				pobj_DBDebugSection->pobj_now->BreakStepCodeBuffer[StepCursorObpSchedule]=StepCursor_BackupChar;
+				debugSectionCollection.GetCurrent().BreakStepCodeBuffer[StepCursorObpSchedule]=StepCursor_BackupChar;
 				StepCursorObpSchedule=-1;
 			}
@@ -340,5 +341,5 @@
 void Set_DebugSys_dwThreadID()
 {
-	BOOST_FOREACH( CDebugSection *pDebugSection, pobj_DBDebugSection->debugSections )
+	BOOST_FOREACH( DebugSection *pDebugSection, debugSectionCollection.debugSections )
 	{
 		ULONG_PTR lpAccBytes;
@@ -483,7 +484,4 @@
 
 
-	//デバッグ情報データベースを生成
-	pobj_DBDebugSection=new CDBDebugSection();
-
 	//デバッグスレッド情報（プロシージャの階層構造を管理）を生成
 	pobj_dti=new CDebugThreadInfo();
@@ -538,6 +536,6 @@
 
 			//可能であればデバッグ情報を読みとる
-			if(pobj_DBDebugSection->add((HMODULE)de.u.LoadDll.lpBaseOfDll)){
-				pobj_DBDebugSection->choice(0);
+			if(debugSectionCollection.add((HMODULE)de.u.LoadDll.lpBaseOfDll)){
+				debugSectionCollection.choice(0);
 				Set_DebugSys_dwThreadID();
 			}
@@ -553,5 +551,5 @@
 			//DLLのアンロード
 
-			pobj_DBDebugSection->del((HMODULE)de.u.UnloadDll.lpBaseOfDll);
+			debugSectionCollection.del((HMODULE)de.u.UnloadDll.lpBaseOfDll);
 		}
 		else if(de.dwDebugEventCode==CREATE_PROCESS_DEBUG_EVENT){
@@ -559,6 +557,6 @@
 			hMainThread=de.u.CreateProcessInfo.hThread;
 
-			if(pobj_DBDebugSection->add((HMODULE)de.u.CreateProcessInfo.lpBaseOfImage)){
-				pobj_DBDebugSection->choice(0);
+			if(debugSectionCollection.add((HMODULE)de.u.CreateProcessInfo.lpBaseOfImage)){
+				debugSectionCollection.choice(0);
 			}
 
@@ -716,5 +714,5 @@
 						//シングルステップON
 						WriteProcessMemory(hDebugProcess,(void *)(ULONG_PTR)(ImageBase+MemPos_CodeSection),
-							pobj_DBDebugSection->pobj_now->SingleStepCodeBuffer,
+							debugSectionCollection.GetCurrent().SingleStepCodeBuffer,
 							FileSize_CodeSection,&lpAccBytes);
 
@@ -754,5 +752,5 @@
 							WriteProcessMemory(hDebugProcess,
 								(void *)(ULONG_PTR)(ImageBase+MemPos_CodeSection),
-								pobj_DBDebugSection->pobj_now->SingleStepCodeBuffer,
+								debugSectionCollection.GetCurrent().SingleStepCodeBuffer,
 								GlobalOpBufferSize,
 								&lpAccBytes);
@@ -765,5 +763,5 @@
 							WriteProcessMemory(hDebugProcess,
 								(void *)rva_to_real(pUserProc->GetBeginOpAddress()),
-								pobj_DBDebugSection->pobj_now->SingleStepCodeBuffer+pUserProc->GetBeginOpAddress(),
+								debugSectionCollection.GetCurrent().SingleStepCodeBuffer+pUserProc->GetBeginOpAddress(),
 								pUserProc->GetEndOpAddress()-pUserProc->GetBeginOpAddress(),
 								&lpAccBytes);
@@ -812,7 +810,4 @@
 	if(hDebugWnd) SendMessage(hDebugWnd,WM_COMMAND,IDCANCEL,0);
 
-	//デバッグに利用した情報を解放
-	delete pobj_DBDebugSection;
-
 	//デバッグスレッド情報を解放
 	delete pobj_dti;
