Commit 15fc9396b5065fd8146f7c3415bbd2ccb9d70091
debugger: allow breakpoint removal also at the original position, not the "acknolegdged" one
Task-number: QTCREATORBUG-2264
| |   |
| 571 | 571 | updateMarkers(); |
| 572 | 572 | } |
| 573 | 573 | |
| BreakpointData *BreakHandler::findBreakpoint(const QString &fileName, int lineNumber) |
| BreakpointData *BreakHandler::findBreakpoint(const QString &fileName, |
| int lineNumber, bool useMarkerPosition) |
| 575 | 576 | { |
| 576 | 577 | foreach (BreakpointData *data, m_bp) |
| if (data->isLocatedAt(fileName, lineNumber)) |
| if (data->isLocatedAt(fileName, lineNumber, useMarkerPosition)) |
| 578 | 579 | return data; |
| 579 | 580 | return 0; |
| 580 | 581 | } |
| 581 | 582 | |
| 582 | 583 | void BreakHandler::toggleBreakpoint(const QString &fileName, int lineNumber) |
| 583 | 584 | { |
| BreakpointData *data = findBreakpoint(fileName, lineNumber); |
| BreakpointData *data = findBreakpoint(fileName, lineNumber, true); |
| if (!data) |
| data = findBreakpoint(fileName, lineNumber, false); |
| 585 | 588 | if (data) { |
| 586 | 589 | removeBreakpoint(data); |
| 587 | 590 | } else { |
| |   |
| 93 | 93 | void storeToTemplate(BreakHandler *other); |
| 94 | 94 | void toggleBreakpoint(const QString &fileName, int lineNumber); |
| 95 | 95 | void toggleBreakpointEnabled(const QString &fileName, int lineNumber); |
| BreakpointData *findBreakpoint(const QString &fileName, int lineNumber); |
| BreakpointData *findBreakpoint(const QString &fileName, int lineNumber, |
| bool useMarkerPosition = true); |
| 97 | 98 | |
| 98 | 99 | public slots: |
| 99 | 100 | void appendBreakpoint(BreakpointData *data); |
| |   |
| 304 | 304 | return rc; |
| 305 | 305 | } |
| 306 | 306 | |
| bool BreakpointData::isLocatedAt(const QString &fileName_, int lineNumber_) const |
| bool BreakpointData::isLocatedAt(const QString &fileName_, int lineNumber_, |
| bool useMarkerPosition) const |
| 308 | 309 | { |
| /* |
| if (lineNumber != QString::number(lineNumber_)) |
| return false; |
| if (fileName == fileName_) |
| return true; |
| if (fileName_.endsWith(fileName)) |
| return true; |
| return false; |
| */ |
| return lineNumber_ == m_markerLineNumber |
| && fileNameMatch(fileName_, m_markerFileName); |
| int line = useMarkerPosition ? m_markerLineNumber : lineNumber.toInt(); |
| return lineNumber_ == line && fileNameMatch(fileName_, m_markerFileName); |
| 320 | 312 | } |
| 321 | 313 | |
| 322 | 314 | bool BreakpointData::isSimilarTo(const BreakpointData *needle) const |
| |   |
| 58 | 58 | QString toString() const; |
| 59 | 59 | BreakHandler *handler() { return m_handler; } |
| 60 | 60 | |
| bool isLocatedAt(const QString &fileName, int lineNumber) const; |
| bool isLocatedAt(const QString &fileName, int lineNumber, |
| bool useMarkerPosition) const; |
| 62 | 63 | bool isSimilarTo(const BreakpointData *needle) const; |
| 63 | 64 | bool conditionsMatch() const; |
| 64 | 65 | |