void CBreakPoints::RemoveBreakPoint(u32 addr) { size_t bp = FindBreakpoint(addr); if (bp != INVALID_BREAKPOINT) { breakPoints_.erase(breakPoints_.begin() + bp); // Check again, there might've been an overlapping temp breakpoint. bp = FindBreakpoint(addr); if (bp != INVALID_BREAKPOINT) breakPoints_.erase(breakPoints_.begin() + bp); Update(addr); } }
BreakPointCond *CBreakPoints::GetBreakPointCondition(u32 addr) { size_t bp = FindBreakpoint(addr, true, false); if (bp != INVALID_BREAKPOINT && breakPoints_[bp].hasCond) return &breakPoints_[bp].cond; return NULL; }
void CDebuggerView::OnDbTogglebreakpoint() { int pos = m_editor.SendEditor(SCI_GETCURRENTPOS); int lineNumber = m_editor.SendEditor(SCI_LINEFROMPOSITION, pos); // Is there a breakpoint currently here? int breakpointIndex = FindBreakpoint(m_currentFileName, lineNumber); if (breakpointIndex == -1) { // No, add it. m_editor.SendEditor(SCI_MARKERDEFINE, MARKER_BREAKPOINT, SC_MARK_CIRCLE); m_editor.SendEditor(SCI_MARKERSETFORE, MARKER_BREAKPOINT, RGB(0x00, 0x00, 0)); m_editor.SendEditor(SCI_MARKERSETBACK, MARKER_BREAKPOINT, RGB(0xff, 0x00, 0x00)); m_editor.SendEditor(SCI_MARKERADD, lineNumber, MARKER_BREAKPOINT); // Add the breakpoint. BreakpointInfo info; info.m_fileName = m_currentFileName; info.m_lineNumber = lineNumber; m_breakpointInfo.Add(info); } else { // Remove the breakpoint. m_editor.SendEditor(SCI_MARKERDELETE, lineNumber, MARKER_BREAKPOINT); m_breakpointInfo.RemoveAt(breakpointIndex); } CString command; command.Format(_T("DebugSetBreakpoint('%s',%d,%s)"), m_currentFileName, lineNumber, (breakpointIndex == -1) ? _T("true") : _T("false")); theApp.GetNetworkClient().SendCommand(command); }
BreakAction CBreakPoints::ExecBreakPoint(u32 addr) { size_t bp = FindBreakpoint(addr, false); if (bp != INVALID_BREAKPOINT) { if (breakPoints_[bp].hasCond) { // Evaluate the breakpoint and abort if necessary. auto cond = CBreakPoints::GetBreakPointCondition(currentMIPS->pc); if (cond && !cond->Evaluate()) return BREAK_ACTION_IGNORE; } if (breakPoints_[bp].result & BREAK_ACTION_LOG) { if (breakPoints_[bp].logFormat.empty()) { NOTICE_LOG(JIT, "BKP PC=%08x (%s)", addr, g_symbolMap->GetDescription(addr).c_str()); } else { std::string formatted; CBreakPoints::EvaluateLogFormat(currentDebugMIPS, breakPoints_[bp].logFormat, formatted); NOTICE_LOG(JIT, "BKP PC=%08x: %s", addr, formatted.c_str()); } } if (breakPoints_[bp].result & BREAK_ACTION_PAUSE) { Core_EnableStepping(true); host->SetDebugMode(true); } return breakPoints_[bp].result; } return BREAK_ACTION_IGNORE; }
bool CBreakPoints::IsAddressBreakPoint(u32 addr, bool* enabled) { size_t bp = FindBreakpoint(addr); if (bp == INVALID_BREAKPOINT) return false; if (enabled != NULL) *enabled = breakPoints_[bp].enabled; return true; }
void CBreakPoints::ChangeBreakPointLogFormat(u32 addr, const std::string &fmt) { size_t bp = FindBreakpoint(addr, true, false); if (bp != INVALID_BREAKPOINT) { breakPoints_[bp].logFormat = fmt; Update(addr); } }
void CBreakPoints::RemoveBreakPoint(u32 addr) { std::unique_lock<std::mutex> guard(breakPointsMutex_); size_t bp = FindBreakpoint(addr); if (bp != INVALID_BREAKPOINT) { breakPoints_.erase(breakPoints_.begin() + bp); // Check again, there might've been an overlapping temp breakpoint. bp = FindBreakpoint(addr); if (bp != INVALID_BREAKPOINT) breakPoints_.erase(breakPoints_.begin() + bp); guard.unlock(); Update(addr); } }
BreakPointCond *CBreakPoints::GetBreakPointCondition(u32 addr) { std::lock_guard<std::mutex> guard(breakPointsMutex_); size_t bp = FindBreakpoint(addr); if (bp != INVALID_BREAKPOINT && breakPoints_[bp].hasCond) return &breakPoints_[bp].cond; return NULL; }
void CBreakPoints::ChangeBreakPoint(u32 addr, BreakAction result) { size_t bp = FindBreakpoint(addr); if (bp != INVALID_BREAKPOINT) { breakPoints_[bp].result = result; Update(addr); } }
void CBreakPoints::ChangeBreakPoint(u32 addr, bool status) { size_t bp = FindBreakpoint(addr); if (bp != INVALID_BREAKPOINT) { breakPoints_[bp].enabled = status; Update(addr); } }
bool CBreakPoints::IsAddressBreakPoint(u32 addr, bool* enabled) { std::lock_guard<std::mutex> guard(breakPointsMutex_); size_t bp = FindBreakpoint(addr); if (bp == INVALID_BREAKPOINT) return false; if (enabled != nullptr) *enabled = breakPoints_[bp].IsEnabled(); return true; }
void CBreakPoints::ChangeBreakPointRemoveCond(u32 addr) { size_t bp = FindBreakpoint(addr, true, false); if (bp != INVALID_BREAKPOINT) { breakPoints_[bp].hasCond = false; Update(); } }
void CBreakPoints::ChangeBreakPointLogFormat(u32 addr, const std::string &fmt) { std::unique_lock<std::mutex> guard(breakPointsMutex_); size_t bp = FindBreakpoint(addr, true, false); if (bp != INVALID_BREAKPOINT) { breakPoints_[bp].logFormat = fmt; guard.unlock(); Update(addr); } }
void CBreakPoints::ChangeBreakPointAddCond(u32 addr, const BreakPointCond &cond) { size_t bp = FindBreakpoint(addr, true, false); if (bp != INVALID_BREAKPOINT) { breakPoints_[bp].hasCond = true; breakPoints_[bp].cond = cond; Update(); } }
void CBreakPoints::ChangeBreakPoint(u32 addr, BreakAction result) { std::unique_lock<std::mutex> guard(breakPointsMutex_); size_t bp = FindBreakpoint(addr); if (bp != INVALID_BREAKPOINT) { breakPoints_[bp].result = result; guard.unlock(); Update(addr); } }
void CBreakPoints::ChangeBreakPointRemoveCond(u32 addr) { std::unique_lock<std::mutex> guard(breakPointsMutex_); size_t bp = FindBreakpoint(addr); if (bp != INVALID_BREAKPOINT) { breakPoints_[bp].hasCond = false; guard.unlock(); Update(addr); } }
void CBreakPoints::ChangeBreakPointAddCond(u32 addr, const BreakPointCond &cond) { std::unique_lock<std::mutex> guard(breakPointsMutex_); size_t bp = FindBreakpoint(addr); if (bp != INVALID_BREAKPOINT) { breakPoints_[bp].hasCond = true; breakPoints_[bp].cond = cond; guard.unlock(); Update(addr); } }
void CBreakPoints::ChangeBreakPoint(u32 addr, bool status) { size_t bp = FindBreakpoint(addr); if (bp != INVALID_BREAKPOINT) { if (status) breakPoints_[bp].result |= BREAK_ACTION_PAUSE; else breakPoints_[bp].result = BreakAction(breakPoints_[bp].result & ~BREAK_ACTION_PAUSE); Update(addr); } }
void LLDBConnector::MarkBreakpointForDeletion(LLDBBreakpoint::Ptr_t bp) { if(!IsBreakpointExists(bp)) { return; } LLDBBreakpoint::Vec_t::iterator iter = FindBreakpoint(bp); // add the breakpoint to the pending deletion breakpoints bp->SetId((*iter)->GetId()); m_pendingDeletionBreakpoints.push_back(bp); m_breakpoints.erase(iter); }
void CBreakPoints::ChangeBreakPoint(u32 addr, bool status) { std::unique_lock<std::mutex> guard(breakPointsMutex_); size_t bp = FindBreakpoint(addr); if (bp != INVALID_BREAKPOINT) { if (status) breakPoints_[bp].result |= BREAK_ACTION_PAUSE; else breakPoints_[bp].result = BreakAction(breakPoints_[bp].result & ~BREAK_ACTION_PAUSE); guard.unlock(); Update(addr); } }
void CBreakPoints::AddBreakPoint(u32 addr, bool temp) { size_t bp = FindBreakpoint(addr, true, temp); if (bp == INVALID_BREAKPOINT) { BreakPoint pt; pt.result |= BREAK_ACTION_PAUSE; pt.temporary = temp; pt.addr = addr; breakPoints_.push_back(pt); Update(addr); } else if (!breakPoints_[bp].IsEnabled()) { breakPoints_[bp].result |= BREAK_ACTION_PAUSE; breakPoints_[bp].hasCond = false; Update(addr); } }
void CBreakPoints::AddBreakPoint(u32 addr, bool temp) { size_t bp = FindBreakpoint(addr, true, temp); if (bp == INVALID_BREAKPOINT) { BreakPoint pt; pt.enabled = true; pt.temporary = temp; pt.addr = addr; breakPoints_.push_back(pt); Update(addr); } else if (!breakPoints_[bp].enabled) { breakPoints_[bp].enabled = true; breakPoints_[bp].hasCond = false; Update(addr); } }
bool CBreakPoints::IsTempBreakPoint(u32 addr) { std::lock_guard<std::mutex> guard(breakPointsMutex_); size_t bp = FindBreakpoint(addr, true, true); return bp != INVALID_BREAKPOINT; }
bool CBreakPoints::IsAddressBreakPoint(u32 addr) { size_t bp = FindBreakpoint(addr); return bp != INVALID_BREAKPOINT && breakPoints_[bp].result != BREAK_ACTION_IGNORE; }
bool CBreakPoints::IsAddressBreakPoint(u32 addr) { std::lock_guard<std::mutex> guard(breakPointsMutex_); size_t bp = FindBreakpoint(addr); return bp != INVALID_BREAKPOINT && breakPoints_[bp].result != BREAK_ACTION_IGNORE; }
bool LLDBConnector::IsBreakpointExists(LLDBBreakpoint::Ptr_t bp) const { return FindBreakpoint(bp) != m_breakpoints.end(); }
bool CBreakPoints::IsTempBreakPoint(u32 addr) { size_t bp = FindBreakpoint(addr, true, true); return bp != INVALID_BREAKPOINT; }
bool CBreakPoints::IsAddressBreakPoint(u32 addr) { size_t bp = FindBreakpoint(addr); return bp != INVALID_BREAKPOINT && breakPoints_[bp].enabled; }