Skip to content

Commit

Permalink
Properly update the status when the user pauses the target. Fix Vecto…
Browse files Browse the repository at this point in the history
  • Loading branch information
xusheng6 committed Jun 28, 2024
1 parent c7737d3 commit cc30944
Showing 1 changed file with 6 additions and 18 deletions.
24 changes: 6 additions & 18 deletions core/debuggercontroller.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ DebugStopReason DebuggerController::LaunchAndWait()
return InternalError;

auto reason = LaunchAndWaitInternal();
if (!m_userRequestedBreak && (reason != ProcessExited) && (reason != InternalError))
if ((reason != ProcessExited) && (reason != InternalError))
NotifyStopped(reason);

m_targetControlMutex.unlock();
Expand Down Expand Up @@ -201,7 +201,7 @@ DebugStopReason DebuggerController::AttachAndWait()
return InternalError;

auto reason = AttachAndWaitInternal();
if (!m_userRequestedBreak && (reason != ProcessExited) && (reason != InternalError))
if ((reason != ProcessExited) && (reason != InternalError))
NotifyStopped(reason);

m_targetControlMutex.unlock();
Expand Down Expand Up @@ -241,7 +241,7 @@ DebugStopReason DebuggerController::ConnectAndWait()
return InternalError;

auto reason = ConnectAndWaitInternal();
if (!m_userRequestedBreak && (reason != ProcessExited) && (reason != InternalError))
if ((reason != ProcessExited) && (reason != InternalError))
NotifyStopped(reason);

m_targetControlMutex.unlock();
Expand Down Expand Up @@ -590,7 +590,6 @@ DebugStopReason DebuggerController::StepIntoReverseIL(BNFunctionGraphType il)

DebugStopReason DebuggerController::StepIntoReverseAndWaitInternal()
{
m_userRequestedBreak = false;
// TODO: check if StepInto() succeeds
return ExecuteAdapterAndWait(DebugAdapterStepIntoReverse);
}
Expand Down Expand Up @@ -921,8 +920,6 @@ DebugStopReason DebuggerController::EmulateStepReturnAndWait()

DebugStopReason DebuggerController::StepReturnAndWaitInternal()
{
m_userRequestedBreak = false;

if (true /* StepReturnAvailable() */)
{
return ExecuteAdapterAndWait(DebugAdapterStepReturn);
Expand All @@ -937,8 +934,6 @@ DebugStopReason DebuggerController::StepReturnAndWaitInternal()

DebugStopReason DebuggerController::StepReturnReverseAndWaitInternal()
{
m_userRequestedBreak = false;

if (true /* StepReturnReverseAvailable() */)
{
return ExecuteAdapterAndWait(DebugAdapterStepReturnReverse);
Expand Down Expand Up @@ -998,8 +993,6 @@ DebugStopReason DebuggerController::StepReturnReverseAndWait()

DebugStopReason DebuggerController::RunToAndWaitInternal(const std::vector<uint64_t>& remoteAddresses)
{
m_userRequestedBreak = false;

for (uint64_t remoteAddress : remoteAddresses)
{
if (!m_state->GetBreakpoints()->ContainsAbsolute(remoteAddress))
Expand Down Expand Up @@ -1266,7 +1259,9 @@ bool DebuggerController::Pause()
DebugStopReason DebuggerController::PauseAndWaitInternal()
{
m_userRequestedBreak = true;
return ExecuteAdapterAndWait(DebugAdapterPause);
auto ret = ExecuteAdapterAndWait(DebugAdapterPause);
m_userRequestedBreak = false;
return ret;
}


Expand All @@ -1280,20 +1275,17 @@ DebugStopReason DebuggerController::PauseAndWait()

DebugStopReason DebuggerController::GoAndWaitInternal()
{
m_userRequestedBreak = false;
return ExecuteAdapterAndWait(DebugAdapterGo);
}

DebugStopReason DebuggerController::GoReverseAndWaitInternal()
{
m_userRequestedBreak = false;
return ExecuteAdapterAndWait(DebugAdapterGoReverse);
}


DebugStopReason DebuggerController::StepIntoAndWaitInternal()
{
m_userRequestedBreak = false;
// TODO: check if StepInto() succeeds
return ExecuteAdapterAndWait(DebugAdapterStepInto);
}
Expand Down Expand Up @@ -1343,8 +1335,6 @@ DebugStopReason DebuggerController::EmulateStepOverAndWait()

DebugStopReason DebuggerController::StepOverAndWaitInternal()
{
m_userRequestedBreak = false;

if (true /* StepOverAvailable() */)
{
return ExecuteAdapterAndWait(DebugAdapterStepOver);
Expand All @@ -1358,8 +1348,6 @@ DebugStopReason DebuggerController::StepOverAndWaitInternal()

DebugStopReason DebuggerController::StepOverReverseAndWaitInternal()
{
m_userRequestedBreak = false;

if (true /* StepOverAvailable() */)
{
return ExecuteAdapterAndWait(DebugAdapterStepOverReverse);
Expand Down

0 comments on commit cc30944

Please sign in to comment.