forked from qt-creator/qt-creator
debugger: fix markers for breakpoints in constructors
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user