DBG+GUI: allow cbp to be used as register
This commit is contained in:
parent
af9481d980
commit
f284e6b259
|
@ -177,6 +177,8 @@ static bool isregister(const char* string)
|
|||
return true;
|
||||
if(scmp(string, "csp"))
|
||||
return true;
|
||||
if(scmp(string, "cbp"))
|
||||
return true;
|
||||
if(scmp(string, "cflags"))
|
||||
return true;
|
||||
|
||||
|
@ -860,6 +862,14 @@ duint getregister(int* size, const char* string)
|
|||
{
|
||||
return GetContextDataEx(hActiveThread, UE_CSP);
|
||||
}
|
||||
if(scmp(string, "cbp"))
|
||||
{
|
||||
#ifdef _WIN64
|
||||
return GetContextDataEx(hActiveThread, UE_RBP);
|
||||
#else
|
||||
return GetContextDataEx(hActiveThread, UE_EBP);
|
||||
#endif //_WIN64
|
||||
}
|
||||
if(scmp(string, "cflags"))
|
||||
{
|
||||
return GetContextDataEx(hActiveThread, UE_CFLAGS);
|
||||
|
@ -1167,6 +1177,12 @@ bool setregister(const char* string, duint value)
|
|||
return SetContextDataEx(hActiveThread, UE_CIP, value);
|
||||
if(scmp(string, "csp"))
|
||||
return SetContextDataEx(hActiveThread, UE_CSP, value);
|
||||
if(scmp(string, "cbp"))
|
||||
#ifdef _WIN64
|
||||
return SetContextDataEx(hActiveThread, UE_RBP, value);
|
||||
#else
|
||||
return SetContextDataEx(hActiveThread, UE_EBP, value);
|
||||
#endif //_WIN64
|
||||
if(scmp(string, "cflags"))
|
||||
return SetContextDataEx(hActiveThread, UE_CFLAGS, value);
|
||||
|
||||
|
|
|
@ -206,8 +206,8 @@ void CPUStack::setupContextMenu()
|
|||
mMenuBuilder->addAction(makeShortcutAction(DIcon("search-for.png"), tr("&Find Pattern..."), SLOT(findPattern()), "ActionFindPattern"));
|
||||
|
||||
//Follow CSP
|
||||
mMenuBuilder->addAction(makeShortcutAction(DIcon("neworigin.png"), ArchValue(tr("Follow E&SP"), tr("Follow R&SP")), SLOT(gotoSpSlot()), "ActionGotoOrigin"));
|
||||
mMenuBuilder->addAction(makeAction(DIcon("cbp.png"), ArchValue(tr("Follow E&BP"), tr("Follow R&BP")), SLOT(gotoBpSlot())), [this](QMenu*)
|
||||
mMenuBuilder->addAction(makeShortcutAction(DIcon("neworigin.png"), ArchValue(tr("Follow E&SP"), tr("Follow R&SP")), SLOT(gotoCspSlot()), "ActionGotoOrigin"));
|
||||
mMenuBuilder->addAction(makeAction(DIcon("cbp.png"), ArchValue(tr("Follow E&BP"), tr("Follow R&BP")), SLOT(gotoCbpSlot())), [this](QMenu*)
|
||||
{
|
||||
return DbgMemIsValidReadPtr(DbgValFromString("cbp"));
|
||||
});
|
||||
|
@ -322,7 +322,7 @@ void CPUStack::updateFreezeStackAction()
|
|||
else
|
||||
{
|
||||
mFreezeStack->setText(tr("Freeze the stack"));
|
||||
gotoSpSlot();
|
||||
gotoCspSlot();
|
||||
}
|
||||
mFreezeStack->setChecked(bStackFrozen);
|
||||
}
|
||||
|
@ -568,20 +568,14 @@ void CPUStack::stackDumpAt(duint addr, duint csp)
|
|||
printDumpAt(addr);
|
||||
}
|
||||
|
||||
void CPUStack::gotoSpSlot()
|
||||
void CPUStack::gotoCspSlot()
|
||||
{
|
||||
if(!DbgIsDebugging())
|
||||
return;
|
||||
DbgCmdExec("sdump csp");
|
||||
}
|
||||
|
||||
void CPUStack::gotoBpSlot()
|
||||
void CPUStack::gotoCbpSlot()
|
||||
{
|
||||
#ifdef _WIN64
|
||||
DbgCmdExec("sdump rbp");
|
||||
#else
|
||||
DbgCmdExec("sdump ebp");
|
||||
#endif //_WIN64
|
||||
DbgCmdExec("sdump cbp");
|
||||
}
|
||||
|
||||
int CPUStack::getCurrentFrame(const std::vector<CPUStack::CPUCallStack> & mCallstack, duint wVA)
|
||||
|
|
|
@ -31,8 +31,8 @@ public slots:
|
|||
void pushSlot();
|
||||
void popSlot();
|
||||
void stackDumpAt(duint addr, duint csp);
|
||||
void gotoSpSlot();
|
||||
void gotoBpSlot();
|
||||
void gotoCspSlot();
|
||||
void gotoCbpSlot();
|
||||
void gotoExpressionSlot();
|
||||
void gotoPreviousSlot();
|
||||
void gotoNextSlot();
|
||||
|
|
Loading…
Reference in New Issue