From 73d3ef0ae695e9d5c9dba26750f85e058d9ce8f8 Mon Sep 17 00:00:00 2001 From: hjk Date: Mon, 4 Jul 2011 14:24:42 +0200 Subject: 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 --- src/plugins/debugger/breakpoint.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'src/plugins/debugger/breakpoint.cpp') 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 #include +#include 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(); } } -- cgit v1.2.1