bool MachThread::ShouldStop(bool &step_more) { // See if this thread is at a breakpoint? nub_break_t breakID = CurrentBreakpoint(); if (NUB_BREAK_ID_IS_VALID(breakID)) { // This thread is sitting at a breakpoint, ask the breakpoint // if we should be stopping here. if (Process()->Breakpoints().ShouldStop(ProcessID(), ThreadID(), breakID)) return true; else { // The breakpoint said we shouldn't stop, but we may have gotten // a signal or the user may have requested to stop in some other // way. Stop if we have a valid exception (this thread won't if // another thread was the reason this process stopped) and that // exception, is NOT a breakpoint exception (a common case would // be a SIGINT signal). if (GetStopException().IsValid() && !GetStopException().IsBreakpoint()) return true; } } else { if (m_arch_ap->StepNotComplete()) { step_more = true; return false; } // The thread state is used to let us know what the thread was // trying to do. MachThread::ThreadWillResume() will set the // thread state to various values depending if the thread was // the current thread and if it was to be single stepped, or // resumed. if (GetState() == eStateRunning) { // If our state is running, then we should continue as we are in // the process of stepping over a breakpoint. return false; } else { // Stop if we have any kind of valid exception for this // thread. if (GetStopException().IsValid()) return true; } } return false; }
bool MachThread::ShouldStop(bool &step_more) { // See if this thread is at a breakpoint? DNBBreakpoint *bp = CurrentBreakpoint(); if (bp) { // This thread is sitting at a breakpoint, ask the breakpoint // if we should be stopping here. return true; } else { if (m_arch_ap->StepNotComplete()) { step_more = true; return false; } // The thread state is used to let us know what the thread was // trying to do. MachThread::ThreadWillResume() will set the // thread state to various values depending if the thread was // the current thread and if it was to be single stepped, or // resumed. if (GetState() == eStateRunning) { // If our state is running, then we should continue as we are in // the process of stepping over a breakpoint. return false; } else { // Stop if we have any kind of valid exception for this // thread. if (GetStopException().IsValid()) return true; } } return false; }