mirror of https://github.com/x64dbg/GleeBug
performance improvements for tracing
This commit is contained in:
parent
367b37d773
commit
e7f709fcda
|
|
@ -113,7 +113,7 @@ namespace GleeBug
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
//clear trap flag when set by GleeBug (to prevent an EXCEPTION_SINGLE_STEP after detach
|
//clear trap flag when set by GleeBug (to prevent an EXCEPTION_SINGLE_STEP after detach)
|
||||||
if (mDetach && mThread)
|
if (mDetach && mThread)
|
||||||
{
|
{
|
||||||
if (mThread->isInternalStepping || mThread->isSingleStepping)
|
if (mThread->isInternalStepping || mThread->isSingleStepping)
|
||||||
|
|
|
||||||
|
|
@ -42,17 +42,14 @@ namespace GleeBug
|
||||||
|
|
||||||
bool Thread::RegReadContext()
|
bool Thread::RegReadContext()
|
||||||
{
|
{
|
||||||
SuspendThread(this->hThread);
|
|
||||||
memset(&this->mOldContext, 0, sizeof(CONTEXT));
|
memset(&this->mOldContext, 0, sizeof(CONTEXT));
|
||||||
this->mOldContext.ContextFlags = CONTEXT_ALL;
|
this->mOldContext.ContextFlags = CONTEXT_ALL; //TODO: granular control over what's required
|
||||||
bool bReturn = false;
|
|
||||||
if (GetThreadContext(this->hThread, &this->mOldContext))
|
if (GetThreadContext(this->hThread, &this->mOldContext))
|
||||||
{
|
{
|
||||||
this->registers.SetContext(this->mOldContext);
|
this->registers.SetContext(this->mOldContext);
|
||||||
bReturn = true;
|
return true;
|
||||||
}
|
}
|
||||||
ResumeThread(this->hThread);
|
return false;
|
||||||
return bReturn;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Thread::RegWriteContext() const
|
bool Thread::RegWriteContext() const
|
||||||
|
|
@ -61,10 +58,7 @@ namespace GleeBug
|
||||||
if (memcmp(&this->mOldContext, this->registers.GetContext(), sizeof(CONTEXT)) == 0)
|
if (memcmp(&this->mOldContext, this->registers.GetContext(), sizeof(CONTEXT)) == 0)
|
||||||
return true;
|
return true;
|
||||||
//update the context
|
//update the context
|
||||||
SuspendThread(this->hThread);
|
return !!SetThreadContext(this->hThread, this->registers.GetContext());
|
||||||
bool bReturn = !!SetThreadContext(this->hThread, this->registers.GetContext());
|
|
||||||
ResumeThread(this->hThread);
|
|
||||||
return bReturn;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void Thread::StepInto()
|
void Thread::StepInto()
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue