Index: /trunk/ab5.0/abdev/BasicCompiler_Common/CDebugThreadInfo.cpp
===================================================================
--- /trunk/ab5.0/abdev/BasicCompiler_Common/CDebugThreadInfo.cpp	(revision 740)
+++ /trunk/ab5.0/abdev/BasicCompiler_Common/CDebugThreadInfo.cpp	(revision 741)
@@ -10,4 +10,5 @@
 
 extern HANDLE hDebugProcess;
+extern DebugSectionCollection debugSectionCollection;
 
 CDebugThreadInfo *pobj_dti;
@@ -27,6 +28,6 @@
 
 	DWORD dwRWSectionPos;
-	dwRWSectionPos=pobj_DBDebugSection->debugSections[0]->dwImageBase+
-						pobj_DBDebugSection->debugSections[0]->dwRVA_RWSection;
+	dwRWSectionPos=debugSectionCollection.debugSections[0]->dwImageBase+
+						debugSectionCollection.debugSections[0]->dwRVA_RWSection;
 
 	ReadProcessMemory(hDebugProcess,
@@ -80,7 +81,7 @@
 	extern DWORD ImageBase;
 	if((HMODULE)(ULONG_PTR)ImageBase!=hTargetModule){
-		for(i=0;i<pobj_DBDebugSection->debugSections.size();i++){
-			if((HMODULE)(ULONG_PTR)pobj_DBDebugSection->debugSections[i]->dwImageBase==hTargetModule){
-				pobj_DBDebugSection->choice(i);
+		for(i=0;i<debugSectionCollection.debugSections.size();i++){
+			if((HMODULE)(ULONG_PTR)debugSectionCollection.debugSections[i]->dwImageBase==hTargetModule){
+				debugSectionCollection.choice(i);
 				break;
 			}
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;
Index: /trunk/ab5.0/abdev/BasicCompiler_Common/DebugMiddleFile.cpp
===================================================================
--- /trunk/ab5.0/abdev/BasicCompiler_Common/DebugMiddleFile.cpp	(revision 740)
+++ /trunk/ab5.0/abdev/BasicCompiler_Common/DebugMiddleFile.cpp	(revision 741)
@@ -44,5 +44,5 @@
 
 
-CDebugSection::~CDebugSection(){
+DebugSection::~DebugSection(){
 	if(dwImageBase) DeleteDebugInfo();
 	if(buffer){
@@ -51,5 +51,5 @@
 	}
 }
-void CDebugSection::make(void){
+void DebugSection::make(void){
 	int i2,BufferSize;
 
@@ -168,5 +168,5 @@
 }
 
-char *CDebugSection::MakeSingleStepCode(void){
+char *DebugSection::MakeSingleStepCode(void){
 	char *buffer;
 	buffer=(char *)HeapAlloc(hHeap,0,SizeOf_CodeSection);
@@ -187,5 +187,5 @@
 	return buffer;
 }
-BOOL CDebugSection::__load(void){
+BOOL DebugSection::__load(void){
 	int i2,i3;
 
@@ -311,5 +311,5 @@
 }
 
-BOOL CDebugSection::load(HMODULE hModule){
+BOOL DebugSection::load(HMODULE hModule){
 	if(buffer){
 		HeapDefaultFree(buffer);
@@ -389,5 +389,5 @@
 }
 
-void CDebugSection::choice(void){
+void DebugSection::choice(void){
 	//イメージベース
 	extern DWORD ImageBase;
@@ -423,5 +423,5 @@
 }
 
-void CDebugSection::DeleteDebugInfo(void){
+void DebugSection::DeleteDebugInfo(void){
 	//コードバッファを解放
 	free(OpBuffer);
@@ -437,10 +437,10 @@
 
 
-CDBDebugSection::CDBDebugSection()
+DebugSectionCollection::DebugSectionCollection()
 {
 }
-CDBDebugSection::~CDBDebugSection()
+DebugSectionCollection::~DebugSectionCollection()
 {
-	BOOST_FOREACH( CDebugSection *pDebugSection, debugSections )
+	BOOST_FOREACH( DebugSection *pDebugSection, debugSections )
 	{
 		delete pDebugSection;
@@ -449,7 +449,7 @@
 }
 
-BOOL CDBDebugSection::add(HMODULE hModule){
-	CDebugSection *pobj_d;
-	pobj_d=new CDebugSection();
+BOOL DebugSectionCollection::add(HMODULE hModule){
+	DebugSection *pobj_d;
+	pobj_d=new DebugSection();
 	if(!pobj_d->load(hModule)){
 		//デバッグ情報が存在しないとき
@@ -463,5 +463,5 @@
 }
 
-void CDBDebugSection::del(HMODULE hModule){
+void DebugSectionCollection::del(HMODULE hModule){
 	for( int i=0; i<static_cast<int>(this->debugSections.size()); i++ )
 	{
@@ -469,5 +469,5 @@
 		{
 			delete debugSections[i];
-			Jenga::Common::EraseVectorItem<std::vector<CDebugSection *>>( debugSections, i );
+			Jenga::Common::EraseVectorItem<std::vector<DebugSection *>>( debugSections, i );
 			break;
 		}
@@ -475,11 +475,7 @@
 }
 
-void CDBDebugSection::choice( int index )
+void DebugSectionCollection::choice( int index )
 {
-	pobj_now = debugSections[index];
-	pobj_now->choice();
-}
-
-
-
-CDBDebugSection *pobj_DBDebugSection;
+	pCurrent = debugSections[index];
+	pCurrent->choice();
+}
Index: /trunk/ab5.0/abdev/BasicCompiler_Common/DebugSection.h
===================================================================
--- /trunk/ab5.0/abdev/BasicCompiler_Common/DebugSection.h	(revision 740)
+++ /trunk/ab5.0/abdev/BasicCompiler_Common/DebugSection.h	(revision 741)
@@ -1,5 +1,5 @@
 #pragma once
 
-class CDebugSection{
+class DebugSection{
 public:
 	char szNowFilePath[MAX_PATH];
@@ -49,5 +49,5 @@
 
 
-	CDebugSection()
+	DebugSection()
 		: buffer( NULL )
 		, length( 0 )
@@ -64,5 +64,5 @@
 		szNowFilePath[0]=0;
 	}
-	~CDebugSection();
+	~DebugSection();
 
 	void make(void);
@@ -79,12 +79,11 @@
 };
 
-class CDBDebugSection{
+class DebugSectionCollection{
+	DebugSection *pCurrent;
 public:
-	std::vector<CDebugSection *> debugSections;
+	std::vector<DebugSection *> debugSections;
 
-	CDebugSection *pobj_now;
-
-	CDBDebugSection();
-	~CDBDebugSection();
+	DebugSectionCollection();
+	~DebugSectionCollection();
 
 	BOOL add(HMODULE hModule);
@@ -93,5 +92,8 @@
 	void choice(int index);
 
+	DebugSection &GetCurrent()
+	{
+		MyAssert( pCurrent != NULL );
+		return *pCurrent;
+	}
 };
-
-extern CDBDebugSection *pobj_DBDebugSection;
Index: /trunk/ab5.0/abdev/compiler_x86/MakePeHdr.cpp
===================================================================
--- /trunk/ab5.0/abdev/compiler_x86/MakePeHdr.cpp	(revision 740)
+++ /trunk/ab5.0/abdev/compiler_x86/MakePeHdr.cpp	(revision 741)
@@ -853,6 +853,6 @@
 
 	//デバッグセクションを生成
-	CDebugSection *pobj_DebugSection;
-	pobj_DebugSection=new CDebugSection();
+	DebugSection *pobj_DebugSection;
+	pobj_DebugSection=new DebugSection();
 	if( compiler.IsDebug() && !compiler.errorMessenger.HasError() )
 	{
