forked from qt-creator/qt-creator
		
	debugger: allow breakpoint removal also at the original position, not the "acknolegdged" one
Task-number: QTCREATORBUG-2264
This commit is contained in:
		@@ -571,17 +571,20 @@ void BreakHandler::removeAllBreakpoints()
 | 
				
			|||||||
    updateMarkers();
 | 
					    updateMarkers();
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
BreakpointData *BreakHandler::findBreakpoint(const QString &fileName, int lineNumber)
 | 
					BreakpointData *BreakHandler::findBreakpoint(const QString &fileName,
 | 
				
			||||||
 | 
					    int lineNumber, bool useMarkerPosition)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
    foreach (BreakpointData *data, m_bp)
 | 
					    foreach (BreakpointData *data, m_bp)
 | 
				
			||||||
        if (data->isLocatedAt(fileName, lineNumber))
 | 
					        if (data->isLocatedAt(fileName, lineNumber, useMarkerPosition))
 | 
				
			||||||
            return data;
 | 
					            return data;
 | 
				
			||||||
    return 0;
 | 
					    return 0;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void BreakHandler::toggleBreakpoint(const QString &fileName, int lineNumber)
 | 
					void BreakHandler::toggleBreakpoint(const QString &fileName, int lineNumber)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
    BreakpointData *data = findBreakpoint(fileName, lineNumber);
 | 
					    BreakpointData *data = findBreakpoint(fileName, lineNumber, true);
 | 
				
			||||||
 | 
					    if (!data)
 | 
				
			||||||
 | 
					        data = findBreakpoint(fileName, lineNumber, false);
 | 
				
			||||||
    if (data) {
 | 
					    if (data) {
 | 
				
			||||||
        removeBreakpoint(data);
 | 
					        removeBreakpoint(data);
 | 
				
			||||||
    } else {
 | 
					    } else {
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -93,7 +93,8 @@ public:
 | 
				
			|||||||
    void storeToTemplate(BreakHandler *other);
 | 
					    void storeToTemplate(BreakHandler *other);
 | 
				
			||||||
    void toggleBreakpoint(const QString &fileName, int lineNumber);
 | 
					    void toggleBreakpoint(const QString &fileName, int lineNumber);
 | 
				
			||||||
    void toggleBreakpointEnabled(const QString &fileName, int lineNumber);
 | 
					    void toggleBreakpointEnabled(const QString &fileName, int lineNumber);
 | 
				
			||||||
    BreakpointData *findBreakpoint(const QString &fileName, int lineNumber);
 | 
					    BreakpointData *findBreakpoint(const QString &fileName, int lineNumber,
 | 
				
			||||||
 | 
					        bool useMarkerPosition = true);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
public slots:
 | 
					public slots:
 | 
				
			||||||
    void appendBreakpoint(BreakpointData *data);
 | 
					    void appendBreakpoint(BreakpointData *data);
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -304,19 +304,11 @@ QString BreakpointData::toString() const
 | 
				
			|||||||
    return rc;
 | 
					    return rc;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
bool BreakpointData::isLocatedAt(const QString &fileName_, int lineNumber_) const
 | 
					bool BreakpointData::isLocatedAt(const QString &fileName_, int lineNumber_, 
 | 
				
			||||||
 | 
					    bool useMarkerPosition) const
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
    /*
 | 
					    int line = useMarkerPosition ? m_markerLineNumber : lineNumber.toInt();
 | 
				
			||||||
    if (lineNumber != QString::number(lineNumber_))
 | 
					    return lineNumber_ == line && fileNameMatch(fileName_, m_markerFileName);
 | 
				
			||||||
        return false;
 | 
					 | 
				
			||||||
    if (fileName == fileName_)
 | 
					 | 
				
			||||||
        return true;
 | 
					 | 
				
			||||||
    if (fileName_.endsWith(fileName))
 | 
					 | 
				
			||||||
        return true;
 | 
					 | 
				
			||||||
    return false;
 | 
					 | 
				
			||||||
    */
 | 
					 | 
				
			||||||
    return lineNumber_ == m_markerLineNumber
 | 
					 | 
				
			||||||
        && fileNameMatch(fileName_, m_markerFileName);
 | 
					 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
bool BreakpointData::isSimilarTo(const BreakpointData *needle) const
 | 
					bool BreakpointData::isSimilarTo(const BreakpointData *needle) const
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -58,7 +58,8 @@ public:
 | 
				
			|||||||
    QString toString() const;
 | 
					    QString toString() const;
 | 
				
			||||||
    BreakHandler *handler() { return m_handler; }
 | 
					    BreakHandler *handler() { return m_handler; }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    bool isLocatedAt(const QString &fileName, int lineNumber) const;
 | 
					    bool isLocatedAt(const QString &fileName, int lineNumber,
 | 
				
			||||||
 | 
					        bool useMarkerPosition) const;
 | 
				
			||||||
    bool isSimilarTo(const BreakpointData *needle) const;
 | 
					    bool isSimilarTo(const BreakpointData *needle) const;
 | 
				
			||||||
    bool conditionsMatch() const;
 | 
					    bool conditionsMatch() const;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user