Debugger: Fix automatic source mapping for Qt

- The QtVersion::sourcePath() was wrong because QT_INSTALL_PREFIX/src
  doesn't return the right path. Work around by checking if sources are
  found, and otherwise trying the location that we know the installers
  to put them.
- Pass the sourcePath along to the debugger run control, and use that
  instead of looking for qmake in the PATH (which fails because it is
  not in PATH).

Fixes: QTCREATORBUG-28950
Change-Id: Iffa262d6c87dbc979c449d43cd4a85e1320bcd37
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: David Schulz <david.schulz@qt.io>
This commit is contained in:
Eike Ziller
2023-06-15 11:38:21 +02:00
parent 6f6f6d3f97
commit 562c5774e3
4 changed files with 24 additions and 36 deletions

View File

@@ -863,8 +863,10 @@ DebuggerRunTool::DebuggerRunTool(RunControl *runControl, AllowTerminal allowTerm
m_runParameters.debugger = DebuggerKitAspect::runnable(kit);
m_runParameters.cppEngineType = DebuggerKitAspect::engineType(kit);
if (QtSupport::QtVersion *qtVersion = QtSupport::QtKitAspect::qtVersion(kit))
if (QtSupport::QtVersion *qtVersion = QtSupport::QtKitAspect::qtVersion(kit)) {
m_runParameters.qtPackageSourceLocation = qtVersion->qtPackageSourcePath().toString();
m_runParameters.qtSourceLocation = qtVersion->sourcePath();
}
if (auto aspect = runControl->aspect<DebuggerRunConfigurationAspect>()) {
if (!aspect->useCppDebugger)