"Clear all breakpoints" code question

Vladimir Prus ghost at cs.msu.su
Thu Nov 10 18:24:04 UTC 2005


Hi Andras,
I have a question about kdevelop code that seems to be written by you.
In gdbbreakpointwidget.cpp, method 
GDBBreakpointWidget::slotRemoveAllBreakpoints(), we have this:

225765         jb void GDBBreakpointWidget::slotRemoveAllBreakpoints()
225765         jb {
281634    amantia   while (m_table->numRows() > 0)
284674   jriddell   {
225765         jb     for ( int row = m_table->numRows()-1; row>=0; row-- )
225765         jb     {
225765         jb         BreakpointTableRow* btr = (BreakpointTableRow *) 
m_table->item(row, Control);
225765         jb         removeBreakpoint(btr);
225765         jb     }
281634    amantia   }
225765         jb }

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:

   281634 | amantia | 2004-01-21 22:23:35 +0300 (Wed, 21 Jan 2004) | 2 lines

   Fix clear all breakpoints.

The log message is not clear for me. It does not say what problem there was, 
nor does it refer to a bug in the tracker. Can you clarify why "while" is 
needed?

Thanks, 
Volodya





More information about the KDevelop-devel mailing list