void XDLink::RemoveAllBreakpointsOnLine ( const JCharacter* fileName, const JIndex lineIndex ) { JBoolean changed = kJFalse; JPtrArray<CMBreakpoint> list(JPtrArrayT::kForgetAll); JString cmd; if (itsBPMgr->GetBreakpoints(fileName, &list)) { for (JIndex i=1; i<=list.GetElementCount(); i++) { CMBreakpoint* bp = list.NthElement(i); if (bp->GetLineNumber() == lineIndex) { cmd = "breakpoint_remove -d "; cmd += bp->GetDebuggerIndex(); Send(cmd); changed = kJTrue; } } } if (changed) { Broadcast(BreakpointsChanged()); } }
JBoolean CMBreakpointManager::GetBreakpoints ( const JCharacter* fileName, JPtrArray<CMBreakpoint>* list ) const { list->RemoveAll(); list->SetCleanUpAction(JPtrArrayT::kForgetAll); if (JIsAbsolutePath(fileName) && JFileExists(fileName)) { CMBreakpoint target(fileName, 1); JBoolean found; const JIndex startIndex = itsBPList->SearchSorted1(&target, JOrderedSetT::kFirstMatch, &found); const JSize count = itsBPList->GetElementCount(); for (JIndex i=startIndex; i<=count; i++) { CMBreakpoint* bp = itsBPList->NthElement(i); if (bp->GetFileID() == target.GetFileID()) { list->Append(bp); } else { break; } } } return !list->IsEmpty(); }
void CMLink::SetBreakpoint ( const CMBreakpoint& bp ) { SetBreakpoint(bp.GetFileName(), bp.GetLineNumber(), JI2B(bp.GetAction() == CMBreakpoint::kRemoveBreakpoint)); }
JBoolean CMBreakpointManager::GetBreakpoints ( const CMLocation& loc, JPtrArray<CMBreakpoint>* list ) const { list->RemoveAll(); list->SetCleanUpAction(JPtrArrayT::kForgetAll); if ((loc.GetFileID()).IsValid()) { CMBreakpoint target(loc.GetFileName(), loc.GetLineNumber()); JBoolean found; const JIndex startIndex = itsBPList->SearchSorted1(&target, JOrderedSetT::kFirstMatch, &found); const JSize count = itsBPList->GetElementCount(); for (JIndex i=startIndex; i<=count; i++) { CMBreakpoint* bp = itsBPList->NthElement(i); if (bp->GetLocation() == loc) { list->Append(bp); } else { break; } } } else if (!loc.GetFunctionName().IsEmpty()) { const JSize count = itsBPList->GetElementCount(); for (JIndex i=1; i<=count; i++) { CMBreakpoint* bp = itsBPList->NthElement(i); if (bp->GetFunctionName() == loc.GetFunctionName()) { list->Append(bp); } } } return !list->IsEmpty(); }
void CMLink::RemoveBreakpoint ( const CMBreakpoint& bp ) { RemoveBreakpoint(bp.GetDebuggerIndex()); }
void CMLineIndexTable::HandleLineMenu ( const JIndex index ) { // line JSize offset = 0; if (itsIsFullLineMenuFlag) { if (index == offset + kRunUntilCmd) { RunUntil(itsLineMenuLineIndex); return; } else if (index == offset + kSetExecPtCmd) { SetExecutionPoint(itsLineMenuLineIndex); return; } offset += kLineMenuItemCount; } // all breakpoints if (index == offset + kSetBreakpointCmd) { SetBreakpoint(itsLineMenuLineIndex, kJFalse); return; } else if (index == offset + kSetTempBreakpointCmd) { SetBreakpoint(itsLineMenuLineIndex, kJTrue); return; } else if (index == offset + kRemoveAllBreakpointsCmd) { RemoveAllBreakpointsOnLine(itsLineMenuLineIndex); return; } offset += kAllBreakpointsMenuItemCount; // individual breakpoints if (!itsLineMenuBPRange.IsNothing()) { for (JIndex i=itsLineMenuBPRange.first; i<=itsLineMenuBPRange.last; i++) { CMBreakpoint* bp = itsBPList->NthElement(i); if (index == offset + kShowBreakpointInfoCmd) { (itsDirector->GetCommandDirector()->GetBreakpointsDir()->GetBreakpointTable())->Show(bp); return; } else if (index == offset + kRemoveBreakpointCmd) { itsLink->RemoveBreakpoint(*bp); return; } else if (index == offset + kSetConditionCmd) { (itsDirector->GetCommandDirector()->GetBreakpointsDir()->GetBreakpointTable())->EditCondition(bp); return; } else if (index == offset + kRemoveConditionCmd) { bp->RemoveCondition(); return; } else if (index == offset + kToggleEnableCmd) { bp->ToggleEnabled(); return; } else if (index == offset + kIgnoreNextNCmd) { (itsDirector->GetCommandDirector()->GetBreakpointsDir()->GetBreakpointTable())->EditIgnoreCount(bp); return; } offset += kBreakpointMenuItemCount; } } }