debugger: fix markers for breakpoints in constructors

This commit is contained in:
hjk
2010-11-18 15:47:50 +01:00
parent 7ffa0927cf
commit c448ae842d
2 changed files with 13 additions and 6 deletions

View File

@@ -407,7 +407,7 @@ QVariant BreakHandler::data(const QModelIndex &mi, int role) const
if (!response.fileName.isEmpty())
str = response.fileName;
if (str.isEmpty() && !data.fileName.isEmpty())
str = response.fileName;
str = data.fileName;
if (str.isEmpty()) {
QString s = QFileInfo(str).fileName();
if (!s.isEmpty())
@@ -582,6 +582,7 @@ void BreakHandler::setEngine(BreakpointId id, DebuggerEngine *value)
it->engine = value;
it->state = BreakpointInsertRequested;
it->response = BreakpointResponse();
it->response.fileName = it->data.fileName;
updateMarker(id);
scheduleSynchronization();
}

View File

@@ -1168,12 +1168,18 @@ void GdbEngine::handleStopResponse(const GdbMi &data)
if (bkptno && frame.isValid()) {
// Use opportunity to update the marker position.
const QString fileName =
QString::fromUtf8(frame.findChild("fullname").data());
const int lineNumber = frame.findChild("line").data().toInt();
BreakHandler *handler = breakHandler();
BreakpointId id = handler->findBreakpointByNumber(bkptno);
const BreakpointResponse &response = handler->response(id);
QString fileName = response.fileName;
if (fileName.isEmpty())
fileName = handler->fileName(id);
if (fileName.isEmpty())
fileName = QString::fromUtf8(frame.findChild("fullname").data());
if (fileName.isEmpty())
fileName = QString::fromUtf8(frame.findChild("file").data());
if (!fileName.isEmpty()) {
BreakHandler *handler = breakHandler();
BreakpointId id = handler->findBreakpointByNumber(bkptno);
int lineNumber = frame.findChild("line").data().toInt();
handler->setMarkerFileAndLine(id, fileName, lineNumber);
}
}