static void addBreakPointInUnit(BreakPointInfoPtr bp, Unit* unit) { OffsetRangeVec offsets; if (!unit->getOffsetRanges(bp->m_line1, offsets) || offsets.size() == 0) { bp->m_bindState = BreakPointInfo::KnownToBeInvalid; return; } bp->m_bindState = BreakPointInfo::KnownToBeValid; TRACE(3, "Add to breakpoint filter for %s:%d, unit %p:\n", unit->filepath()->data(), bp->m_line1, unit); phpAddBreakPointRange(unit, offsets); }
// Looks up the offset range in the given unit, of the given breakpoint. // If the offset cannot be found, the breakpoint is marked as invalid. // Otherwise it is marked as valid and the offset is added to the // breakpoint filter and the offset range is black listed for the JIT. static void addBreakPointInUnit(Eval::BreakPointInfoPtr bp, Unit* unit) { OffsetRangeVec offsets; if (!unit->getOffsetRanges(bp->m_line1, offsets) || offsets.size() == 0) { bp->m_bindState = Eval::BreakPointInfo::KnownToBeInvalid; return; } bp->m_bindState = Eval::BreakPointInfo::KnownToBeValid; TRACE(3, "Add to breakpoint filter for %s:%d, unit %p:\n", unit->filepath()->data(), bp->m_line1, unit); getBreakPointFilter()->addRanges(unit, offsets); if (RuntimeOption::EvalJit) { blacklistRangesInJit(unit, offsets); } }
bool phpAddBreakPointLine(const Unit* unit, int line) { // Grab the unit offsets OffsetRangeVec offsets; if (!unit->getOffsetRanges(line, offsets)) { return false; } // Add to the breakpoint filter and the line filter phpAddBreakPointRange(unit, offsets); assertx(offsets.size() > 0); auto pc = unit->at(offsets[0].base); RID().m_lineBreakPointFilter.addPC(pc); return true; }
bool Unit::getOffsetRanges(int line, OffsetRangeVec& offsets) const { ASSERT(offsets.size() == 0); if (m_repoId == RepoIdInvalid) { return false; } UnitRepoProxy& urp = Repo::get().urp(); if (urp.getSourceLocPastOffsets(m_repoId).get(m_sn, line, offsets)) { return false; } for (OffsetRangeVec::iterator it = offsets.begin(); it != offsets.end(); ++it) { if (urp.getSourceLocBaseOffset(m_repoId).get(m_sn, *it)) { return false; } } return true; }