#include <EmulationDebugSystem.h>
Onikiri::EmulationDebugSystemに対する継承グラフ
Public メソッド | |
void | Run (SystemContext *context) |
EmulationDebugSystem.h の 42 行で定義されています。
void EmulationDebugSystem::Run | ( | SystemContext * | context | ) |
EmulationDebugSystem.cpp の 44 行で定義されています。
参照先 Onikiri::Addr::address・Onikiri::OpInfo::GetSrcNum()・Onikiri::SimISAInfoDef::SimISAInfo_IW32_RW64_AS64::INSTRUCTION_WORD_BYTE_SIZE・Onikiri::DebugStub::OnExec()・THROW_RUNTIME_ERROR.
参照元 Onikiri::SystemManager::RunEmulationDebug().
00045 { 00046 int processCount = context->emulator->GetProcessCount(); 00047 if( processCount != 1 ){ 00048 THROW_RUNTIME_ERROR( 00049 "Remote debugging is not supported in the execution of multi processes." 00050 ); 00051 } 00052 00053 // WX^ 00054 ArchitectureStateList& archStateList = context->architectureStateList; 00055 00056 s64 insnCount = 0; 00057 int curPID = 0; 00058 int terminateProcesses = 0; 00059 vector<u64> opID( processCount ); 00060 00061 m_debugStub = new DebugStub(context, curPID); 00062 00063 while( insnCount < context->executionInsns ){ 00064 00065 // Decide a thread executed in this iteration. 00066 PC& curThreadPC = archStateList[curPID].pc; 00067 00068 if( curThreadPC.address == 0 ) { 00069 terminateProcesses++; 00070 if(terminateProcesses >= processCount){ 00071 break; 00072 } 00073 else{ 00074 continue; 00075 } 00076 } 00077 00078 EmulationDebugOp op( context->emulator->GetMemImage() ); 00079 00080 // PC 00081 std::pair<OpInfo**, int> ops = 00082 context->emulator->GetOp( curThreadPC ); 00083 OpInfo** opInfoArray = ops.first; 00084 int opCount = ops.second; 00085 00086 // opInfoArray Sタs 00087 for(int opIndex = 0; opIndex < opCount; opIndex ++){ 00088 OpInfo* opInfo = opInfoArray[opIndex]; 00089 op.SetPC( curThreadPC ); 00090 op.SetTakenPC( Addr(curThreadPC.pid, curThreadPC.tid, curThreadPC.address+4) ); 00091 op.SetOpInfo(opInfo); 00092 op.SetTaken(false); 00093 00094 // \[XIyh 00095 int srcCount = opInfo->GetSrcNum(); 00096 for (int i = 0; i < srcCount; i ++) { 00097 op.SetSrc(i, archStateList[curPID].registerValue[ opInfo->GetSrcOperand(i) ] ); 00098 } 00099 00100 context->emulator->Execute( &op, opInfo ); 00101 00102 // 00103 int dstCount = opInfo->GetDstNum(); 00104 for (int i = 0; i < dstCount; i ++) { 00105 archStateList[curPID].registerValue[ opInfo->GetDstOperand(i) ] = op.GetDst(i); 00106 } 00107 00108 ++opID[curPID]; 00109 } 00110 00111 // PC 00112 if (op.GetTaken()) 00113 curThreadPC = op.GetTakenPC(); 00114 else 00115 curThreadPC.address += SimISAInfo::INSTRUCTION_WORD_BYTE_SIZE; 00116 00117 insnCount ++; 00118 curPID = (curPID + 1) % processCount; // Round robin 00119 m_debugStub->OnExec(&op); 00120 00121 } 00122 00123 delete m_debugStub; 00124 00125 context->executedInsns.clear(); 00126 context->executedInsns.push_back( insnCount ); 00127 context->executedCycles = insnCount; 00128 }
関数の呼び出しグラフ:
Here is the caller graph for this function: