diff --git a/src/plugins/debugger/breakhandler.cpp b/src/plugins/debugger/breakhandler.cpp index 3307a473e46..4c1963d7a3e 100644 --- a/src/plugins/debugger/breakhandler.cpp +++ b/src/plugins/debugger/breakhandler.cpp @@ -981,7 +981,23 @@ void BreakHandler::BreakpointItem::destroyMarker() QString BreakHandler::BreakpointItem::markerFileName() const { - return !response.fileName.isEmpty() ? response.fileName : data.fileName; + // Some heuristics to find a "good" file name. + if (!data.fileName.isEmpty()) { + QFileInfo fi(data.fileName); + if (fi.exists()) + return fi.absoluteFilePath(); + } + if (!response.fileName.isEmpty()) { + QFileInfo fi(response.fileName); + if (fi.exists()) + return fi.absoluteFilePath(); + } + if (response.fileName.endsWith(data.fileName)) + return response.fileName; + if (data.fileName.endsWith(response.fileName)) + return data.fileName; + return response.fileName.size() > data.fileName.size() + ? response.fileName : data.fileName; } @@ -1092,6 +1108,10 @@ QString BreakHandler::BreakpointItem::toToolTip() const << "
| " << tr("Property") << " | " << tr("Requested") |
|---|