Commit c448ae84 authored by hjk's avatar hjk
Browse files

debugger: fix markers for breakpoints in constructors

parent 7ffa0927
......@@ -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();
}
......
......@@ -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);
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment