本文整理汇总了C++中CtrlDisAsmView::setDontRedraw方法的典型用法代码示例。如果您正苦于以下问题:C++ CtrlDisAsmView::setDontRedraw方法的具体用法?C++ CtrlDisAsmView::setDontRedraw怎么用?C++ CtrlDisAsmView::setDontRedraw使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CtrlDisAsmView
的用法示例。
在下文中一共展示了CtrlDisAsmView::setDontRedraw方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: stepOut
void CDisasm::stepOut()
{
auto threads = GetThreadsInfo();
u32 entry, stackTop;
for (size_t i = 0; i < threads.size(); i++)
{
if (threads[i].isCurrent)
{
entry = threads[i].entrypoint;
stackTop = threads[i].initialStack;
break;
}
}
auto frames = MIPSStackWalk::Walk(cpu->GetPC(),cpu->GetRegValue(0,31),cpu->GetRegValue(0,29),entry,stackTop);
if (frames.size() < 2) return;
u32 breakpointAddress = frames[1].pc;
// If the current PC is on a breakpoint, the user doesn't want to do nothing.
CBreakPoints::SetSkipFirst(currentMIPS->pc);
CtrlDisAsmView *ptr = CtrlDisAsmView::getFrom(GetDlgItem(m_hDlg,IDC_DISASMVIEW));
ptr->setDontRedraw(true);
SetDebugMode(false);
CBreakPoints::AddBreakPoint(breakpointAddress,true);
_dbg_update_();
Core_EnableStepping(false);
Sleep(1);
ptr->gotoAddr(breakpointAddress);
UpdateDialog();
}
示例2: SetDebugMode
void CDisasm::SetDebugMode(bool _bDebug, bool switchPC)
{
HWND hDlg = m_hDlg;
// Update Dialog Windows
if (_bDebug && globalUIState == UISTATE_INGAME && PSP_IsInited())
{
Core_WaitInactive(TEMP_BREAKPOINT_WAIT_MS);
CBreakPoints::ClearTemporaryBreakPoints();
breakpointList->reloadBreakpoints();
threadList->reloadThreads();
stackTraceView->loadStackTrace();
moduleList->loadModules();
updateThreadLabel(false);
SetDlgItemText(m_hDlg, IDC_STOPGO, L"Go");
EnableWindow( GetDlgItem(hDlg, IDC_STOPGO), TRUE);
EnableWindow( GetDlgItem(hDlg, IDC_STEP), TRUE);
EnableWindow( GetDlgItem(hDlg, IDC_STEPOVER), TRUE);
EnableWindow( GetDlgItem(hDlg, IDC_STEPHLE), TRUE);
EnableWindow( GetDlgItem(hDlg, IDC_STEPOUT), TRUE);
CtrlDisAsmView *ptr = CtrlDisAsmView::getFrom(GetDlgItem(m_hDlg,IDC_DISASMVIEW));
ptr->setDontRedraw(false);
if (switchPC)
ptr->gotoPC();
ptr->scanFunctions();
CtrlMemView *mem = CtrlMemView::getFrom(GetDlgItem(m_hDlg,IDC_DEBUGMEMVIEW));
mem->redraw();
// update the callstack
//CDisam::blah blah
UpdateDialog();
}
else
{
updateThreadLabel(true);
if (globalUIState == UISTATE_INGAME && PSP_IsInited())
{
SetDlgItemText(m_hDlg, IDC_STOPGO, L"Stop");
EnableWindow( GetDlgItem(hDlg, IDC_STOPGO), TRUE);
}
else
{
SetDlgItemText(m_hDlg, IDC_STOPGO, L"Go");
EnableWindow( GetDlgItem(hDlg, IDC_STOPGO), FALSE);
}
EnableWindow( GetDlgItem(hDlg, IDC_STEP), FALSE);
EnableWindow( GetDlgItem(hDlg, IDC_STEPOVER), FALSE);
EnableWindow( GetDlgItem(hDlg, IDC_STEPHLE), FALSE);
EnableWindow( GetDlgItem(hDlg, IDC_STEPOUT), FALSE);
CtrlRegisterList *reglist = CtrlRegisterList::getFrom(GetDlgItem(m_hDlg,IDC_REGLIST));
reglist->redraw();
}
}
示例3: stepOver
void CDisasm::stepOver()
{
if (Core_IsActive()) return;
CtrlDisAsmView *ptr = CtrlDisAsmView::getFrom(GetDlgItem(m_hDlg,IDC_DISASMVIEW));
lastTicks = CoreTiming::GetTicks();
// If the current PC is on a breakpoint, the user doesn't want to do nothing.
CBreakPoints::SetSkipFirst(currentMIPS->pc);
u32 currentPc = cpu->GetPC();
u32 windowEnd = ptr->getWindowEnd();
MIPSAnalyst::MipsOpcodeInfo info = MIPSAnalyst::GetOpcodeInfo(cpu,cpu->GetPC());
ptr->setDontRedraw(true);
u32 breakpointAddress = currentPc+cpu->getInstructionSize(0);
if (info.isBranch)
{
if (info.isConditional == false)
{
if (info.isLinkedBranch) // jal, jalr
{
// it's a function call with a delay slot - skip that too
breakpointAddress += cpu->getInstructionSize(0);
} else { // j, ...
// in case of absolute branches, set the breakpoint at the branch target
breakpointAddress = info.branchTarget;
}
} else { // beq, ...
if (info.conditionMet)
{
breakpointAddress = info.branchTarget;
} else {
breakpointAddress = currentPc+2*cpu->getInstructionSize(0);
if (breakpointAddress == windowEnd-4)
ptr->scrollWindow(1);
else if (breakpointAddress == windowEnd)
ptr->scrollWindow(2);
else if (breakpointAddress == windowEnd+4)
ptr->scrollWindow(3);
}
}
} else {
if (breakpointAddress == windowEnd-4)
ptr->scrollWindow(1);
else if (breakpointAddress == windowEnd)
ptr->scrollWindow(2);
}
SetDebugMode(false, true);
CBreakPoints::AddBreakPoint(breakpointAddress,true);
_dbg_update_();
Core_EnableStepping(false);
Sleep(1);
ptr->gotoAddr(breakpointAddress);
UpdateDialog();
}
示例4: runToLine
void CDisasm::runToLine()
{
CtrlDisAsmView *ptr = CtrlDisAsmView::getFrom(GetDlgItem(m_hDlg,IDC_DISASMVIEW));
u32 pos = ptr->getSelection();
lastTicks = CoreTiming::GetTicks();
ptr->setDontRedraw(true);
SetDebugMode(false);
CBreakPoints::AddBreakPoint(pos,true);
_dbg_update_();
Core_EnableStepping(false);
}
示例5: SetDebugMode
void CDisasm::SetDebugMode(bool _bDebug)
{
HWND hDlg = m_hDlg;
// Update Dialog Windows
if (_bDebug)
{
Core_WaitInactive(TEMP_BREAKPOINT_WAIT_MS);
CBreakPoints::ClearTemporaryBreakPoints();
breakpointList->update();
threadList->reloadThreads();
updateThreadLabel(false);
EnableWindow( GetDlgItem(hDlg, IDC_GO), TRUE);
EnableWindow( GetDlgItem(hDlg, IDC_STEP), TRUE);
EnableWindow( GetDlgItem(hDlg, IDC_STEPOVER), TRUE);
EnableWindow( GetDlgItem(hDlg, IDC_STEPHLE), TRUE);
EnableWindow( GetDlgItem(hDlg, IDC_STOP), FALSE);
EnableWindow( GetDlgItem(hDlg, IDC_SKIP), TRUE);
CtrlDisAsmView *ptr = CtrlDisAsmView::getFrom(GetDlgItem(m_hDlg,IDC_DISASMVIEW));
ptr->setDontRedraw(false);
ptr->gotoPC();
CtrlMemView *mem = CtrlMemView::getFrom(GetDlgItem(m_hDlg,IDC_DEBUGMEMVIEW));
mem->redraw();
// update the callstack
//CDisam::blah blah
UpdateDialog();
}
else
{
updateThreadLabel(true);
EnableWindow( GetDlgItem(hDlg, IDC_GO), FALSE);
EnableWindow( GetDlgItem(hDlg, IDC_STEP), FALSE);
EnableWindow( GetDlgItem(hDlg, IDC_STEPOVER), FALSE);
EnableWindow( GetDlgItem(hDlg, IDC_STEPHLE), FALSE);
EnableWindow( GetDlgItem(hDlg, IDC_STOP), TRUE);
EnableWindow( GetDlgItem(hDlg, IDC_SKIP), FALSE);
CtrlRegisterList *reglist = CtrlRegisterList::getFrom(GetDlgItem(m_hDlg,IDC_REGLIST));
reglist->redraw();
}
}
示例6: DlgProc
//.........这里部分代码省略.........
ptr->gotoAddr(addr);
SetFocus(GetDlgItem(m_hDlg, IDC_DISASMVIEW));
}
}
break;
};
break;
case IDC_GOTOINT:
switch (HIWORD(wParam))
{
case LBN_SELCHANGE:
{
HWND lb =GetDlgItem(m_hDlg,LOWORD(wParam));
int n = ComboBox_GetCurSel(lb);
unsigned int addr = (unsigned int)ComboBox_GetItemData(lb,n);
if (addr != 0xFFFFFFFF)
{
ptr->gotoAddr(addr);
SetFocus(GetDlgItem(m_hDlg, IDC_DISASMVIEW));
}
}
break;
};
break;
case IDC_STOPGO:
{
if (!PSP_IsInited()) {
break;
}
if (!Core_IsStepping()) // stop
{
ptr->setDontRedraw(false);
SetDebugMode(true, true);
Core_EnableStepping(true);
_dbg_update_();
Sleep(1); //let cpu catch up
ptr->gotoPC();
UpdateDialog();
vfpudlg->Update();
} else { // go
lastTicks = CoreTiming::GetTicks();
// If the current PC is on a breakpoint, the user doesn't want to do nothing.
CBreakPoints::SetSkipFirst(currentMIPS->pc);
SetDebugMode(false, true);
Core_EnableStepping(false);
}
}
break;
case IDC_STEP:
stepInto();
break;
case IDC_STEPOVER:
stepOver();
break;
case IDC_STEPOUT:
stepOut();
break;
case IDC_STEPHLE:
示例7: DlgProc
//.........这里部分代码省略.........
case IDC_STEP:
{
if (Core_IsActive()) break;
lastTicks = CoreTiming::GetTicks();
// If the current PC is on a breakpoint, the user doesn't want to do nothing.
CBreakPoints::SetSkipFirst(currentMIPS->pc);
Core_DoSingleStep();
Sleep(1);
_dbg_update_();
ptr->gotoPC();
UpdateDialog();
vfpudlg->Update();
CtrlMemView::getFrom(GetDlgItem(m_hDlg,IDC_DEBUGMEMVIEW))->redraw();
threadList->reloadThreads();
updateThreadLabel(false);
}
break;
case IDC_STEPOVER:
{
if (Core_IsActive()) break;
lastTicks = CoreTiming::GetTicks();
// If the current PC is on a breakpoint, the user doesn't want to do nothing.
CBreakPoints::SetSkipFirst(currentMIPS->pc);
const char* dis = cpu->disasm(cpu->GetPC(),4);
const char* pos = strstr(dis,"->$");
const char* reg = strstr(dis,"->");
ptr->setDontRedraw(true);
u32 breakpointAddress = cpu->GetPC()+cpu->getInstructionSize(0);
if (memcmp(dis,"jal\t",4) == 0 || memcmp(dis,"jalr\t",5) == 0)
{
// it's a function call with a delay slot - skip that too
breakpointAddress += cpu->getInstructionSize(0);
} else if (memcmp(dis,"j\t",2) == 0 || memcmp(dis,"b\t",2) == 0)
{
// in case of absolute branches, set the breakpoint at the branch target
sscanf(pos+3,"%08x",&breakpointAddress);
} else if (memcmp(dis,"jr\t",3) == 0)
{
// the same for jumps to registers
int regNum = -1;
for (int i = 0; i < 32; i++)
{
if (strcasecmp(reg+2,cpu->GetRegName(0,i)) == 0)
{
regNum = i;
break;
}
}
if (regNum == -1) break;
breakpointAddress = cpu->GetRegValue(0,regNum);
} else if (pos != NULL)
{
// get branch target
sscanf(pos+3,"%08x",&breakpointAddress);
CBreakPoints::AddBreakPoint(breakpointAddress,true);
// also add a breakpoint after the delay slot
breakpointAddress = cpu->GetPC()+2*cpu->getInstructionSize(0);
}
示例8: DlgProc
//.........这里部分代码省略.........
if (n!=-1)
{
unsigned int addr = (unsigned int)ListBox_GetItemData(lb,n);
ptr->gotoAddr(addr);
SetFocus(GetDlgItem(m_hDlg, IDC_DISASMVIEW));
}
}
break;
};
break;
case IDC_GOTOINT:
switch (HIWORD(wParam))
{
case LBN_SELCHANGE:
{
HWND lb =GetDlgItem(m_hDlg,LOWORD(wParam));
int n = ComboBox_GetCurSel(lb);
unsigned int addr = (unsigned int)ComboBox_GetItemData(lb,n);
if (addr != 0xFFFFFFFF)
{
ptr->gotoAddr(addr);
SetFocus(GetDlgItem(m_hDlg, IDC_DISASMVIEW));
}
}
break;
};
break;
case IDC_STOPGO:
{
if (!Core_IsStepping()) // stop
{
ptr->setDontRedraw(false);
SetDebugMode(true);
Core_EnableStepping(true);
_dbg_update_();
Sleep(1); //let cpu catch up
ptr->gotoPC();
UpdateDialog();
vfpudlg->Update();
} else { // go
lastTicks = CoreTiming::GetTicks();
// If the current PC is on a breakpoint, the user doesn't want to do nothing.
CBreakPoints::SetSkipFirst(currentMIPS->pc);
SetDebugMode(false);
Core_EnableStepping(false);
}
}
break;
case IDC_STEP:
stepInto();
break;
case IDC_STEPOVER:
stepOver();
break;
case IDC_STEPOUT:
stepOut();
break;
case IDC_STEPHLE: