Changeset 741 in dev for trunk/ab5.0/abdev/BasicCompiler_Common/Debug.cpp
- Timestamp:
- Sep 7, 2008, 12:05:40 AM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/ab5.0/abdev/BasicCompiler_Common/Debug.cpp
r740 r741 23 23 int NextStepThreadNum; 24 24 25 DebugSectionCollection debugSectionCollection; 25 26 26 27 void Debugger_StepIn(void){ … … 129 130 130 131 StepCursorObpSchedule=oldSourceLines[i3].GetNativeCodePos(); 131 StepCursor_BackupChar= pobj_DBDebugSection->pobj_now->BreakStepCodeBuffer[StepCursorObpSchedule];132 133 pobj_DBDebugSection->pobj_now->BreakStepCodeBuffer[StepCursorObpSchedule]=(char)0xCC;132 StepCursor_BackupChar=debugSectionCollection.GetCurrent().BreakStepCodeBuffer[StepCursorObpSchedule]; 133 134 debugSectionCollection.GetCurrent().BreakStepCodeBuffer[StepCursorObpSchedule]=(char)0xCC; 134 135 135 136 break; … … 292 293 WriteProcessMemory(hDebugProcess, 293 294 (void *)(ULONG_PTR)(ImageBase+MemPos_CodeSection), 294 pobj_DBDebugSection->pobj_now->BreakStepCodeBuffer,295 debugSectionCollection.GetCurrent().BreakStepCodeBuffer, 295 296 FileSize_CodeSection,&lpAccBytes); 296 297 … … 298 299 if(ImageBase+MemPos_CodeSection<=EIP_RIP(*pContext)&&EIP_RIP(*pContext)<ImageBase+MemPos_CodeSection+FileSize_CodeSection){ 299 300 if(OpBuffer[EIP_RIP(*pContext)-ImageBase-MemPos_CodeSection-1]!= 300 pobj_DBDebugSection->pobj_now->BreakStepCodeBuffer[EIP_RIP(*pContext)-ImageBase-MemPos_CodeSection-1]){301 debugSectionCollection.GetCurrent().BreakStepCodeBuffer[EIP_RIP(*pContext)-ImageBase-MemPos_CodeSection-1]){ 301 302 //直前のブレークポイントがユーザー指定によるものだったとき 302 303 … … 312 313 if(StepCursorObpSchedule==(int)(EIP_RIP(*pContext)-ImageBase-MemPos_CodeSection)){ 313 314 //カーソル行までのステップ実行の場合 314 pobj_DBDebugSection->pobj_now->BreakStepCodeBuffer[StepCursorObpSchedule]=StepCursor_BackupChar;315 debugSectionCollection.GetCurrent().BreakStepCodeBuffer[StepCursorObpSchedule]=StepCursor_BackupChar; 315 316 StepCursorObpSchedule=-1; 316 317 } … … 340 341 void Set_DebugSys_dwThreadID() 341 342 { 342 BOOST_FOREACH( CDebugSection *pDebugSection, pobj_DBDebugSection->debugSections )343 BOOST_FOREACH( DebugSection *pDebugSection, debugSectionCollection.debugSections ) 343 344 { 344 345 ULONG_PTR lpAccBytes; … … 483 484 484 485 485 //デバッグ情報データベースを生成486 pobj_DBDebugSection=new CDBDebugSection();487 488 486 //デバッグスレッド情報(プロシージャの階層構造を管理)を生成 489 487 pobj_dti=new CDebugThreadInfo(); … … 538 536 539 537 //可能であればデバッグ情報を読みとる 540 if( pobj_DBDebugSection->add((HMODULE)de.u.LoadDll.lpBaseOfDll)){541 pobj_DBDebugSection->choice(0);538 if(debugSectionCollection.add((HMODULE)de.u.LoadDll.lpBaseOfDll)){ 539 debugSectionCollection.choice(0); 542 540 Set_DebugSys_dwThreadID(); 543 541 } … … 553 551 //DLLのアンロード 554 552 555 pobj_DBDebugSection->del((HMODULE)de.u.UnloadDll.lpBaseOfDll);553 debugSectionCollection.del((HMODULE)de.u.UnloadDll.lpBaseOfDll); 556 554 } 557 555 else if(de.dwDebugEventCode==CREATE_PROCESS_DEBUG_EVENT){ … … 559 557 hMainThread=de.u.CreateProcessInfo.hThread; 560 558 561 if( pobj_DBDebugSection->add((HMODULE)de.u.CreateProcessInfo.lpBaseOfImage)){562 pobj_DBDebugSection->choice(0);559 if(debugSectionCollection.add((HMODULE)de.u.CreateProcessInfo.lpBaseOfImage)){ 560 debugSectionCollection.choice(0); 563 561 } 564 562 … … 716 714 //シングルステップON 717 715 WriteProcessMemory(hDebugProcess,(void *)(ULONG_PTR)(ImageBase+MemPos_CodeSection), 718 pobj_DBDebugSection->pobj_now->SingleStepCodeBuffer,716 debugSectionCollection.GetCurrent().SingleStepCodeBuffer, 719 717 FileSize_CodeSection,&lpAccBytes); 720 718 … … 754 752 WriteProcessMemory(hDebugProcess, 755 753 (void *)(ULONG_PTR)(ImageBase+MemPos_CodeSection), 756 pobj_DBDebugSection->pobj_now->SingleStepCodeBuffer,754 debugSectionCollection.GetCurrent().SingleStepCodeBuffer, 757 755 GlobalOpBufferSize, 758 756 &lpAccBytes); … … 765 763 WriteProcessMemory(hDebugProcess, 766 764 (void *)rva_to_real(pUserProc->GetBeginOpAddress()), 767 pobj_DBDebugSection->pobj_now->SingleStepCodeBuffer+pUserProc->GetBeginOpAddress(),765 debugSectionCollection.GetCurrent().SingleStepCodeBuffer+pUserProc->GetBeginOpAddress(), 768 766 pUserProc->GetEndOpAddress()-pUserProc->GetBeginOpAddress(), 769 767 &lpAccBytes); … … 812 810 if(hDebugWnd) SendMessage(hDebugWnd,WM_COMMAND,IDCANCEL,0); 813 811 814 //デバッグに利用した情報を解放815 delete pobj_DBDebugSection;816 817 812 //デバッグスレッド情報を解放 818 813 delete pobj_dti;
Note:
See TracChangeset
for help on using the changeset viewer.