From 0dc61f55c3919765ae0fd453de2719daeb4f0718 Mon Sep 17 00:00:00 2001 From: hjk Date: Tue, 14 Mar 2023 18:18:39 +0100 Subject: Debugger: Use more FilePath in source file handling Needed for the double-remote case. With this we have proper breakpoint markers in the text editor for a remotely running gdb on a remotely loaded project. Change-Id: If80e4a4108a4a0bcdd7612a59e2bd695213f5ea5 Reviewed-by: Orgad Shaneh --- src/plugins/debugger/qml/qmlengine.cpp | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) (limited to 'src/plugins/debugger/qml/qmlengine.cpp') diff --git a/src/plugins/debugger/qml/qmlengine.cpp b/src/plugins/debugger/qml/qmlengine.cpp index eb1ebc939a..0730caaf78 100644 --- a/src/plugins/debugger/qml/qmlengine.cpp +++ b/src/plugins/debugger/qml/qmlengine.cpp @@ -1802,10 +1802,10 @@ void QmlEnginePrivate::messageReceived(const QByteArray &data) updateScriptSource(name, lineOffset, columnOffset, source); } - QMap files; + QMap files; for (const QString &file : std::as_const(sourceFiles)) { QString shortName = file; - QString fullName = engine->toFileInProject(file); + FilePath fullName = engine->toFileInProject(file); files.insert(shortName, fullName); } @@ -1915,7 +1915,7 @@ void QmlEnginePrivate::messageReceived(const QByteArray &data) const QVariantMap script = body.value("script").toMap(); QUrl fileUrl(script.value(NAME).toString()); - QString filePath = engine->toFileInProject(fileUrl); + FilePath filePath = engine->toFileInProject(fileUrl); const QVariantMap exception = body.value("exception").toMap(); QString errorMessage = exception.value("text").toString(); @@ -2045,8 +2045,7 @@ StackFrame QmlEnginePrivate::extractStackFrame(const QVariant &bodyVal) stackFrame.function = extractString(body.value("func")); if (stackFrame.function.isEmpty()) stackFrame.function = Tr::tr("Anonymous Function"); - stackFrame.file = FilePath::fromString( - engine->toFileInProject(extractString(body.value("script")))); + stackFrame.file = engine->toFileInProject(extractString(body.value("script"))); stackFrame.usable = stackFrame.file.isReadableFile(); stackFrame.receiver = extractString(body.value("receiver")); stackFrame.line = body.value("line").toInt() + 1; @@ -2444,7 +2443,7 @@ void QmlEnginePrivate::flushSendBuffer() sendBuffer.clear(); } -QString QmlEngine::toFileInProject(const QUrl &fileUrl) +FilePath QmlEngine::toFileInProject(const QUrl &fileUrl) { // make sure file finder is properly initialized const DebuggerRunParameters &rp = runParameters(); @@ -2453,7 +2452,7 @@ QString QmlEngine::toFileInProject(const QUrl &fileUrl) d->fileFinder.setAdditionalSearchDirectories(rp.additionalSearchDirectories); d->fileFinder.setSysroot(rp.sysRoot); - return d->fileFinder.findFile(fileUrl).constFirst().toString(); + return d->fileFinder.findFile(fileUrl).constFirst(); } DebuggerEngine *createQmlEngine() -- cgit v1.2.1