"Clear all breakpoints" code question

Vladimir Prus ghost at cs.msu.su
Thu Nov 10 20:08:35 UTC 2005


On Thursday 10 November 2005 16:26, Andras Mantia wrote:

> > We iterate over all breakpoints (the "for" loop), and we repeat it
> > again and again until there are breakpoinst (the "while" loop). The
> > while loop was added by you in:
......
> Well, it was quite some time back (2 years?). But as I remember and see,
> the commit was more a workaround. The problem is somewhere that
> removeBreakpoint(btr) removes a row from a QTable and this breaks the
> walkthrough based on row (m_table->item query), and it will return a
> null pointer, which means removeBreakpoint won't remove anything, and
> we will remain with stale rows.

How could m_table->item return null? If we go from the last row index to 0, 
then row index should always be in the range, and item will return something.
Could it be due to bug in prior Qt version?

> A nicer solution might be two different loops:
> 1) gather all the BreakpointTableRow in a list
> 2) go through this list and call removeBreakpoint() for each list item
>
> Might be more understandable than now. ;-)

Yes, but if we can make single loop work, that would be even better ;-)

- Volodya




More information about the KDevelop-devel mailing list