diff options
author | hjk <qtc-committer@nokia.com> | 2011-07-04 14:24:42 +0200 |
---|---|---|
committer | hjk <qthjk@ovi.com> | 2011-07-04 14:19:03 +0200 |
commit | 73d3ef0ae695e9d5c9dba26750f85e058d9ce8f8 (patch) | |
tree | 9d4d6e0ef6a60437cdd5862f1e3f3ab4c329c99d /src/plugins/debugger/breakpoint.cpp | |
parent | 7020cdc587b8f8a53f373cd7cd8ad2a3d84b2f36 (diff) | |
download | qt-creator-73d3ef0ae695e9d5c9dba26750f85e058d9ce8f8.tar.gz |
debugger: only update location when the information gets better
The contents of the "original location" field is sometimes worse than
what we collected otherwise. Use it only if it points to a readable file.
Change-Id: I6c7229ead803e9f7970b8322f29469bfbe350b5d
Reviewed-on: http://codereview.qt.nokia.com/1072
Reviewed-by: hjk <qthjk@ovi.com>
Diffstat (limited to 'src/plugins/debugger/breakpoint.cpp')
-rw-r--r-- | src/plugins/debugger/breakpoint.cpp | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/plugins/debugger/breakpoint.cpp b/src/plugins/debugger/breakpoint.cpp index f348cf45c2..4d1f9c5be7 100644 --- a/src/plugins/debugger/breakpoint.cpp +++ b/src/plugins/debugger/breakpoint.cpp @@ -36,6 +36,7 @@ #include <QtCore/QByteArray> #include <QtCore/QDebug> +#include <QtCore/QFileInfo> namespace Debugger { namespace Internal { @@ -234,12 +235,17 @@ bool BreakpointParameters::conditionsMatch(const QByteArray &other) const return s1 == s2; } -void BreakpointParameters::setLocation(const QByteArray &location) +void BreakpointParameters::updateLocation(const QByteArray &location) { if (location.size()) { int pos = location.indexOf(':'); lineNumber = location.mid(pos + 1).toInt(); - fileName = QString::fromUtf8(location.left(pos)); + QString file = QString::fromUtf8(location.left(pos)); + if (file.startsWith(QLatin1Char('"')) && file.endsWith(QLatin1Char('"'))) + file = file.mid(1, file.size() - 2); + QFileInfo fi(file); + if (fi.isReadable()) + fileName = fi.absoluteFilePath(); } } |