Commit 13a947d1 authored by Eike Ziller's avatar Eike Ziller
Browse files

Debugger: Fix attaching to running debug server

For example when developing on Windows, cross compiling to Linux, the
result is not executable from the Windows perspective.
Reverts f2cfd3c0

 which changed the code
to use ExistingCommand to get the automatic expansion of app bundles on
OS X, and do automatic expansion of app bundles also when using path
chooser of type File. Choosing an app bundle in a path chooser of type
File would previously lead to an invalid entry in the path chooser
anyhow, because the app bundle itself is not a file.

Change-Id: Ie710c47918d2b8735009e290301ed2683e354f2c
Task-number: QTCREATORBUG-14412
Reviewed-by: default avatarOrgad Shaneh <>
Reviewed-by: default avatarhjk <>
Reviewed-by: default avatarEike Ziller <>
parent d2bb73ff
......@@ -53,6 +53,20 @@
This class has some validation logic for embedding into QWizardPage.
static QString appBundleExpandedPath(const QString &path)
if (Utils::HostOsInfo::hostOs() == Utils::OsTypeMac && path.endsWith(QLatin1String(".app"))) {
// possibly expand to
QFileInfo info(path);
if (info.isDir()) {
QString exePath = path + QLatin1String("/Contents/MacOS/") + info.completeBaseName();
if (QFileInfo(exePath).exists())
return exePath;
return path;
namespace Utils {
// ------------------ PathValidatingLineEdit
......@@ -387,20 +401,13 @@ void PathChooser::slotBrowse()
newPath = QFileDialog::getOpenFileName(this,
makeDialogTitle(tr("Choose Executable")), predefined,
if (HostOsInfo::hostOs() == OsTypeMac && newPath.endsWith(QLatin1String(".app"))) {
// possibly expand to
QFileInfo info(newPath);
if (info.isDir()) {
QString exePath = newPath + QLatin1String("/Contents/MacOS/") + info.completeBaseName();
if (QFileInfo(exePath).isExecutable())
newPath = exePath;
newPath = appBundleExpandedPath(newPath);
case PathChooser::File: // fall through
newPath = QFileDialog::getOpenFileName(this,
makeDialogTitle(tr("Choose File")), predefined,
newPath = appBundleExpandedPath(newPath);
case PathChooser::SaveFile:
newPath = QFileDialog::getSaveFileName(this,
......@@ -248,7 +248,7 @@ StartApplicationDialog::StartApplicationDialog(QWidget *parent)
d->serverAddressEdit = new QLineEdit(this);
d->localExecutablePathChooser = new PathChooser(this);
d->localExecutablePathChooser->setPromptDialogTitle(tr("Select Executable"));
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment