diff --git a/doc/images/qtcreator-android-application.png b/doc/images/qtcreator-android-application.png new file mode 100644 index 00000000000..cba4907dc97 Binary files /dev/null and b/doc/images/qtcreator-android-application.png differ diff --git a/doc/images/qtcreator-android-libraries.png b/doc/images/qtcreator-android-libraries.png new file mode 100644 index 00000000000..6058fed8311 Binary files /dev/null and b/doc/images/qtcreator-android-libraries.png differ diff --git a/doc/images/qtcreator-android-manifest.png b/doc/images/qtcreator-android-manifest.png new file mode 100644 index 00000000000..121ffc8b53f Binary files /dev/null and b/doc/images/qtcreator-android-manifest.png differ diff --git a/doc/images/qtcreator-android-permissions.png b/doc/images/qtcreator-android-permissions.png new file mode 100644 index 00000000000..32bd825bcd2 Binary files /dev/null and b/doc/images/qtcreator-android-permissions.png differ diff --git a/doc/images/qtcreator-android-sign-package.png b/doc/images/qtcreator-android-sign-package.png new file mode 100644 index 00000000000..6dc628db800 Binary files /dev/null and b/doc/images/qtcreator-android-sign-package.png differ diff --git a/doc/images/qtcreator-deploy-android.png b/doc/images/qtcreator-deploy-android.png new file mode 100644 index 00000000000..e886ff4b991 Binary files /dev/null and b/doc/images/qtcreator-deploy-android.png differ diff --git a/doc/images/qtcreator-options-android.png b/doc/images/qtcreator-options-android.png new file mode 100644 index 00000000000..247e102947b Binary files /dev/null and b/doc/images/qtcreator-options-android.png differ diff --git a/doc/src/android/androiddev.qdoc b/doc/src/android/androiddev.qdoc new file mode 100644 index 00000000000..48bb265603a --- /dev/null +++ b/doc/src/android/androiddev.qdoc @@ -0,0 +1,130 @@ +/**************************************************************************** +** +** This file is part of Qt Creator +** +** Copyright (c) 2012 Nokia Corporation and/or its subsidiary(-ies). +** +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** +** GNU Free Documentation License +** +** Alternatively, this file may be used under the terms of the GNU Free +** Documentation License version 1.3 as published by the Free Software +** Foundation and appearing in the file included in the packaging of this +** file. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +****************************************************************************/ + + /*! + + \contentspage index.html + \previouspage creator-developing-qnx.html + \page creator-developing-android.html + \nextpage creator-build-process-customizing.html + + \title Connecting Android Devices + + You can connect Android devices to the development PC to build, run, debug, + and analyze applications on them from \QC. + + If you have a tool chain for building applications for Android devices + installed on the development PC, you can add it to \QC. You can then select + the \gui {Android} target to run applications on Android devices. + + \section1 Requirements + + To use \QC to develop Qt applications for Android, you need the following: + + \list + + \o OpenJDK Java Development Kit + + To check whether you have OpenJDK installed, enter the following + command: + + \c {java -version} + + To install OpenJDK, enter the following command: + + \c {sudo apt-get install openjdk-6-jdk} + + \o \l{http://ant.apache.org/bindownload.cgi}{Apache Ant} 1.8.0, or + later + + To check the Ant version, enter the following command on the command + line: + + \c {ant -version} + + \o \l{http://necessitas.kde.org/necessitas/necessitas_sdk_installer.php} + {Necessitas SDK} + + \endlist + + \section1 Configuring Connections + + The Qt for Android SDK automatically sets the paths to the required software + in \QC. + + To configure connections between \QC and Android devices: + + \list 1 + + \o Select \gui Tools > \gui Options > \gui {Build & Run} > + \gui {Qt Versions} > \gui Add to add Qt for Android. + + \o In the \gui {qmake location} field, add the \c qmake path from the + Qt for Android SDK + (\c {/opt/necessitas/Android//bin/qmake} by default). + + \o Select \gui Tools > \gui Options > \gui Android to view and edit + paths to the required software. + + \image qtcreator-options-android.png "Android options" + + \o Select \gui Tools > \gui Options > \gui {Build & Run} > + \gui {Qt Versions} and build the GDB Helper to make the debugging + output for Qt specific constructs clean and easy to read. + + \o To build the GDB Helper, select Qt for Android, select \gui Details + in the \gui Helpers section, and then select \gui Build in the + \gui {GDB Helper} field. + + \o Select \gui {Start Android AVD Manager} to create Android virtual + devices (AVD) that enable you emulate device hardware and software + on the Android Emulator. + + \o To specify information for the Android manifest file, select + \gui Projects > \gui Run, and then select \gui Details to view the + \gui {Package configurations}. For more information about the + options you have, see + \l{Specifying Run Settings for Android Devices}. + + \o To specify settings for deploying applications to Android, select + \gui Details to view the \gui {Deploy configurations}. For more + information about the options you have, see + \l{Deploying Applications to Android Devices}. + + \endlist + + \section1 Debugging on Android Devices + + Android devices support debugging multi-thread applications in version + 2.2.1 and later. If you use AVD, select Android 2.3, or later. For more + information, see the Android documentation. + + In addition, debugging is supported at android-10 API level, or higher. In + the run settings for the project, in the \gui {Android target SDK} field, + select android-10, or higher. For more information about Android API levels, + see \l{http://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels} + {What is API Level?}. + + \note Select a \l{glossary-build-config}{debug build configuration} to build + the application for debugging. + +*/ + diff --git a/doc/src/android/creator-projects-settings-run-android.qdocinc b/doc/src/android/creator-projects-settings-run-android.qdocinc new file mode 100644 index 00000000000..81b1802b585 --- /dev/null +++ b/doc/src/android/creator-projects-settings-run-android.qdocinc @@ -0,0 +1,71 @@ + \section2 Specifying Run Settings for Android Devices + + In \gui {Package configurations}, you can specify information for the + Android manifest file. The Android system uses the information from the file + to start application components. + + \section3 Specifying Package Data + + In the \gui Manifest tab, you can select the API level to use for the + Android target SDK and the name and version number for the application + package. + + \image qtcreator-android-manifest.png "Manifest tab" + + For more information about Android API levels, see + \l{http://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels} + {What is API Level?}. + + \note The android-4 API level does not support multitouch. If your + application needs multitouch, select a higher API level. + + In the \gui {Package name} field, enter a package name for the application. + The application is launched by an automatically generated Java launcher that + is packaged with the application into an Android package (.apk). For more + information, see + \l{http://developer.android.com/guide/components/fundamentals.html} + {Android Application Fundamentals}. + + \section3 Specifying Application Data + + In the \gui Application tab, you can select an icon for the application and + give the application a name. + + \image qtcreator-android-application.png "Application tab" + + \section3 Setting Permissions + + In the \gui Permissions tab, you can specify the permissions that your + application needs. Users are asked to grant the permissions when they + install the application. Android OS then grants the application access to + the appropriate data and features. + + \image qtcreator-android-permissions.png "Permissions tab" + + Select from existing Android permissions or add new ones to deploy the + application to a particular Android OS. + + \section3 Selecting Qt Libraries + + In the \gui Libraries tab, specify which Qt libraries the application uses. + To automatically determine this, select \gui {Read Infomation from + Application (Must Be Compiled)}. Alternatively, you can manually select the + Qt libraries and the external libraries you think your application needs. + Make sure to arrange the libraries so that depended libraries appear before + the ones that depend on them. + + \image qtcreator-android-libraries.png "Libraries tab" + + These entries are used by the Ministro tool to determine which Qt libraries + to download. + + In addition, the Java Loader uses this list to determine which Qt Libraries + and other prebundled libraries to load with your application. + + \section3 Signing Android Packages + + In the \gui {Sign Package} tab, you can sign the Android package by using + a private key from the keystore. To create new keys, select \gui Create. + + \image qtcreator-android-sign-package.png "Sign Package tab" + diff --git a/doc/src/android/deploying-android.qdoc b/doc/src/android/deploying-android.qdoc new file mode 100644 index 00000000000..1534c792f7b --- /dev/null +++ b/doc/src/android/deploying-android.qdoc @@ -0,0 +1,64 @@ +/**************************************************************************** +** +** This file is part of Qt Creator +** +** Copyright (c) 2012 Nokia Corporation and/or its subsidiary(-ies). +** +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** +** GNU Free Documentation License +** +** Alternatively, this file may be used under the terms of the GNU Free +** Documentation License version 1.3 as published by the Free Software +** Foundation and appearing in the file included in the packaging of this +** file. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +****************************************************************************/ + + /*! + + \contentspage index.html + \previouspage creator-deployment-qnx.html + \page creator-deploying-android.html + \nextpage creator-connecting-mobile.html + + \title Deploying Applications to Android Devices + + To specify settings for deploying applications to Android devices, select + \gui Projects > \gui Run. + + \image qtcreator-deploy-android.png "Deploy configurations" + + Select the \gui {Use device's Qt libs} option to use Qt libraries installed + on the device. If you do not select the \gui {Use local Qt libs} option, + the application needs the Ministro package to run. However, if you select + the \gui {Use local Qt libs} option, \QC passes special parameters to the + application, forcing it to use Qt libraries from the \c{/data/local/qt} + folder on the device + + Select the \gui {Deploy local Qt libs} option to deploy Qt libraries from + the specified Qt for Android SDK (for exmple, android-lighthouse-4.8.0). + This option enables you to develop on the Qt framework to test it. + + The \gui {Deploy local Qt libs} option automatically selects the + \gui {Use local Qt libs} option. It is deselected automatically after \QC + pushes the Qt libs to the device. Select the option again to push your local + Qt modifications to devices. This option takes the same effect as the + \c{push_qt_libs.sh} script thas is located in the root folder of the + Qt for Android SDK. You can also use the \gui {Use local Qt libs} + independently of the \gui {Deploy local Qt libs} option. + + \section1 Installing Ministro + + To install Ministro, select the \gui {Install Ministro system} option. You + can also use it to install any Android package (.apk). You can use this + option to install applications on an Android Virtual Device (AVD). Download + the Ministro .apk from the Google Market or from the + \l{http://necessitas.kde.org/necessitas/ministro.php}{Ministro} home page. + +*/ + diff --git a/doc/src/overview/creator-deployment-overview.qdoc b/doc/src/overview/creator-deployment-overview.qdoc index 4f84bc5ec09..edfb0f8c590 100644 --- a/doc/src/overview/creator-deployment-overview.qdoc +++ b/doc/src/overview/creator-deployment-overview.qdoc @@ -58,6 +58,11 @@ When you deploy the application on the \gui{QNX} target, \QC generates a BAR package in the build directory and deploys it to the connected device. You can test and debug the application on the device. + \o \l{Deploying Applications to Android Devices} + + When you deploy the application on the Android target, \QC copies + the application files to the device. In addition, you can determine + the Qt libraries to use. \endlist \section1 Related Topics diff --git a/doc/src/overview/creator-getting-started.qdoc b/doc/src/overview/creator-getting-started.qdoc index b8bf9562e2b..6616f6f15ce 100644 --- a/doc/src/overview/creator-getting-started.qdoc +++ b/doc/src/overview/creator-getting-started.qdoc @@ -25,7 +25,7 @@ /*! \contentspage index.html - \previouspage index.html + \previouspage creator-glossary.html \page creator-getting-started.html \nextpage creator-overview.html diff --git a/doc/src/overview/creator-mobile-targets.qdoc b/doc/src/overview/creator-mobile-targets.qdoc index 31bc285de56..31d62f92125 100644 --- a/doc/src/overview/creator-mobile-targets.qdoc +++ b/doc/src/overview/creator-mobile-targets.qdoc @@ -25,7 +25,7 @@ /*! \contentspage index.html - \previouspage creator-deployment-qnx.html + \previouspage creator-deploying-android.html \page creator-connecting-mobile.html \nextpage creator-developing-meego.html @@ -81,6 +81,15 @@ supported for BlackBerry Playbook, and requires the BlackBerry NDK to be installed on the development PC. + \o \l{Connecting Android Devices} + + Qt applications for Android are compiled as \c {shared objects} that + are loaded by a Java launcher generated by the Qt for Android SDK. + This is totally transparent to users. As Qt is composed of libraries + referencing each other, Qt applications are only supported on + Android version 1.6, or later. You must install the Qt for Android + SDK to develop for Android devices. + \endlist */ diff --git a/doc/src/overview/creator-target-platforms.qdocinc b/doc/src/overview/creator-target-platforms.qdocinc index 30d6d83da1a..403bc29e95a 100644 --- a/doc/src/overview/creator-target-platforms.qdocinc +++ b/doc/src/overview/creator-target-platforms.qdocinc @@ -18,6 +18,8 @@ \o QNX + \o Android + \endlist The following table summarizes operating system support for developing @@ -25,8 +27,8 @@ \table \header - \o {1,7} Operating system - \o {7,1} Platform + \o {1,8} Operating system + \o {8,1} Platform \header \o Desktop \o \QS @@ -35,6 +37,7 @@ \o Generic Remote Linux \o Symbian \o QNX + \o Android \row \o Windows @@ -45,6 +48,8 @@ \o Yes \o Yes \o Yes (see \l{Running on QNX Devices} for limitations) + \o Yes + \row \o Linux \o Yes @@ -54,6 +59,7 @@ \o Yes \o Yes (by using Remote Compiler for building) \o Yes + \o Yes \row \o Mac OS X \o Yes @@ -63,4 +69,5 @@ \o Yes \o Yes (by using Remote Compiler for building) \o Yes + \o Yes \endtable diff --git a/doc/src/projects/creator-projects-builds-customizing.qdoc b/doc/src/projects/creator-projects-builds-customizing.qdoc index 004e395e6af..92d75271f0e 100644 --- a/doc/src/projects/creator-projects-builds-customizing.qdoc +++ b/doc/src/projects/creator-projects-builds-customizing.qdoc @@ -25,7 +25,7 @@ /*! \contentspage index.html - \previouspage creator-developing-qnx.html + \previouspage creator-developing-android.html \page creator-build-process-customizing.html \nextpage creator-maemo-emulator.html diff --git a/doc/src/projects/creator-projects-settings-run.qdoc b/doc/src/projects/creator-projects-settings-run.qdoc index 2ecfdd950c9..f399018661d 100644 --- a/doc/src/projects/creator-projects-settings-run.qdoc +++ b/doc/src/projects/creator-projects-settings-run.qdoc @@ -53,6 +53,7 @@ \input symbian/creator-projects-settings-run-symbian.qdocinc \input linux-mobile/creator-projects-settings-run-linux.qdocinc \input qnx/creator-projects-settings-run-qnx.qdocinc + \input android/creator-projects-settings-run-android.qdocinc \endif \section1 Specifying a Custom Executable to Run diff --git a/doc/src/qnx/creator-deployment-qnx.qdoc b/doc/src/qnx/creator-deployment-qnx.qdoc index 65d23dbb907..5726befbac5 100644 --- a/doc/src/qnx/creator-deployment-qnx.qdoc +++ b/doc/src/qnx/creator-deployment-qnx.qdoc @@ -28,7 +28,7 @@ \contentspage index.html \previouspage creator-deployment-maemo.html \page creator-deployment-qnx.html - \nextpage creator-connecting-mobile.html + \nextpage creator-deploying-android.html \title Deploying Applications to QNX Devices diff --git a/doc/src/qnx/creator-developing-qnx.qdoc b/doc/src/qnx/creator-developing-qnx.qdoc index b4efccaa650..db7c6309f80 100644 --- a/doc/src/qnx/creator-developing-qnx.qdoc +++ b/doc/src/qnx/creator-developing-qnx.qdoc @@ -22,7 +22,7 @@ \contentspage index.html \previouspage creator-developing-symbian.html \page creator-developing-qnx.html - \nextpage creator-build-process-customizing.html + \nextpage creator-developing-android.html \title Connecting QNX Devices diff --git a/doc/src/qtcreator.qdoc b/doc/src/qtcreator.qdoc index c79dcf7a5e3..c0bb733d499 100644 --- a/doc/src/qtcreator.qdoc +++ b/doc/src/qtcreator.qdoc @@ -239,6 +239,7 @@ \o \l{Deploying Applications to Symbian Devices} \o \l{Deploying Applications to Linux-Based Devices} \o \l{Deploying Applications to QNX Devices} + \o \l{Deploying Applications to Android Devices} \endlist \o \l{Connecting Mobile Targets} \list @@ -247,6 +248,7 @@ \o \l{Connecting Maemo Devices} \o \l{Connecting Symbian Devices} \o \l{Connecting QNX Devices} + \o \l{Connecting Android Devices} \endlist \o \l{Customizing the Build Process} \o \l{Using Maemo or MeeGo Harmattan Emulator} diff --git a/src/libs/utils/process_ctrlc_stub.cpp b/src/libs/utils/process_ctrlc_stub.cpp index 32a593cb1bb..d2901ef83e2 100644 --- a/src/libs/utils/process_ctrlc_stub.cpp +++ b/src/libs/utils/process_ctrlc_stub.cpp @@ -84,7 +84,7 @@ int main(int argc, char **) // Get the command line and remove the call to this executable. wchar_t *strCommandLine = _wcsdup(GetCommandLine()); const size_t strCommandLineLength = wcslen(strCommandLine); - size_t pos = 1; + size_t pos = 0; bool quoted = false; while (pos < strCommandLineLength) { if (strCommandLine[pos] == L'"') { diff --git a/src/plugins/android/androiddebugsupport.cpp b/src/plugins/android/androiddebugsupport.cpp index cf441de495b..8459b047433 100644 --- a/src/plugins/android/androiddebugsupport.cpp +++ b/src/plugins/android/androiddebugsupport.cpp @@ -82,7 +82,6 @@ RunControl *AndroidDebugSupport::createDebugRunControl(AndroidRunConfiguration * params.dumperLibrary = runConfig->dumperLib(); params.executable = project(runConfig)->rootQt4ProjectNode()->buildDir() + QLatin1String("/app_process"); params.remoteChannel = runConfig->remoteChannel(); - params.remoteArchitecture = QLatin1String("arm"); params.useServerStartScript = true; params.solibSearchPath.clear(); diff --git a/src/plugins/autotoolsprojectmanager/autotoolsbuildconfiguration.cpp b/src/plugins/autotoolsprojectmanager/autotoolsbuildconfiguration.cpp index 1a003558f87..5f93f43d333 100644 --- a/src/plugins/autotoolsprojectmanager/autotoolsbuildconfiguration.cpp +++ b/src/plugins/autotoolsprojectmanager/autotoolsbuildconfiguration.cpp @@ -33,6 +33,7 @@ **************************************************************************/ #include "autotoolsbuildconfiguration.h" +#include "autotoolsbuildsettingswidget.h" #include "makestep.h" #include "autotoolsproject.h" #include "autotoolsprojectconstants.h" diff --git a/src/plugins/autotoolsprojectmanager/autotoolsbuildconfiguration.h b/src/plugins/autotoolsprojectmanager/autotoolsbuildconfiguration.h index d6f712b044b..5177e24621a 100644 --- a/src/plugins/autotoolsprojectmanager/autotoolsbuildconfiguration.h +++ b/src/plugins/autotoolsprojectmanager/autotoolsbuildconfiguration.h @@ -35,8 +35,6 @@ #ifndef AUTOTOOLSBUILDCONFIGURATION_H #define AUTOTOOLSBUILDCONFIGURATION_H -#include "autotoolsbuildsettingswidget.h" - #include namespace AutotoolsProjectManager { diff --git a/src/plugins/autotoolsprojectmanager/autotoolsbuildsettingswidget.cpp b/src/plugins/autotoolsprojectmanager/autotoolsbuildsettingswidget.cpp index 9f8315c4cde..d8620049ab9 100644 --- a/src/plugins/autotoolsprojectmanager/autotoolsbuildsettingswidget.cpp +++ b/src/plugins/autotoolsprojectmanager/autotoolsbuildsettingswidget.cpp @@ -39,6 +39,8 @@ #include #include +#include + #include #include #include diff --git a/src/plugins/autotoolsprojectmanager/autotoolsbuildsettingswidget.h b/src/plugins/autotoolsprojectmanager/autotoolsbuildsettingswidget.h index 4550c4906ca..eb9fc4acbff 100644 --- a/src/plugins/autotoolsprojectmanager/autotoolsbuildsettingswidget.h +++ b/src/plugins/autotoolsprojectmanager/autotoolsbuildsettingswidget.h @@ -35,17 +35,16 @@ #ifndef AUTOTOOLSBUILDSETTINGSWIDGET_H #define AUTOTOOLSBUILDSETTINGSWIDGET_H -#include "autotoolsbuildconfiguration.h" - -#include -#include #include -#include QT_BEGIN_NAMESPACE class QComboBox; QT_END_NAMESPACE +namespace Utils { +class PathChooser; +} + namespace AutotoolsProjectManager { namespace Internal { diff --git a/src/plugins/autotoolsprojectmanager/autotoolsopenprojectwizard.cpp b/src/plugins/autotoolsprojectmanager/autotoolsopenprojectwizard.cpp index 9fd234d7537..474b29ed328 100644 --- a/src/plugins/autotoolsprojectmanager/autotoolsopenprojectwizard.cpp +++ b/src/plugins/autotoolsprojectmanager/autotoolsopenprojectwizard.cpp @@ -34,6 +34,8 @@ #include "autotoolsopenprojectwizard.h" +#include + #include #include #include diff --git a/src/plugins/autotoolsprojectmanager/autotoolsopenprojectwizard.h b/src/plugins/autotoolsprojectmanager/autotoolsopenprojectwizard.h index 043136399cd..ba3d2ce6be6 100644 --- a/src/plugins/autotoolsprojectmanager/autotoolsopenprojectwizard.h +++ b/src/plugins/autotoolsprojectmanager/autotoolsopenprojectwizard.h @@ -36,7 +36,10 @@ #define AUTOTOOLSOPENPROJECTWIZARD_H #include -#include + +namespace Utils { +class PathChooser; +} namespace AutotoolsProjectManager { namespace Internal { diff --git a/src/plugins/autotoolsprojectmanager/autotoolsproject.cpp b/src/plugins/autotoolsprojectmanager/autotoolsproject.cpp index 7f293b6141a..84c39c59140 100644 --- a/src/plugins/autotoolsprojectmanager/autotoolsproject.cpp +++ b/src/plugins/autotoolsprojectmanager/autotoolsproject.cpp @@ -54,6 +54,7 @@ #include #include #include +#include #include #include diff --git a/src/plugins/autotoolsprojectmanager/autotoolsproject.h b/src/plugins/autotoolsprojectmanager/autotoolsproject.h index 55612306bb3..97a8ce8a728 100644 --- a/src/plugins/autotoolsprojectmanager/autotoolsproject.h +++ b/src/plugins/autotoolsprojectmanager/autotoolsproject.h @@ -35,14 +35,18 @@ #ifndef AUTOTOOLSPROJECT_H #define AUTOTOOLSPROJECT_H -#include #include -#include -#include -#include -#include -#include +QT_FORWARD_DECLARE_CLASS(QDir) + +namespace Utils { +class FileSystemWatcher; +} + +namespace ProjectExplorer { +class Node; +class FolderNode; +} namespace AutotoolsProjectManager { namespace Internal { diff --git a/src/plugins/autotoolsprojectmanager/autotoolsprojectnode.cpp b/src/plugins/autotoolsprojectmanager/autotoolsprojectnode.cpp index 3234afbad46..a13c14657de 100644 --- a/src/plugins/autotoolsprojectmanager/autotoolsprojectnode.cpp +++ b/src/plugins/autotoolsprojectmanager/autotoolsprojectnode.cpp @@ -35,6 +35,8 @@ #include "autotoolsprojectnode.h" #include "autotoolsproject.h" +#include + using namespace AutotoolsProjectManager; using namespace AutotoolsProjectManager::Internal; using namespace ProjectExplorer; diff --git a/src/plugins/autotoolsprojectmanager/autotoolsprojectnode.h b/src/plugins/autotoolsprojectmanager/autotoolsprojectnode.h index 433e662eac9..ea6b6195584 100644 --- a/src/plugins/autotoolsprojectmanager/autotoolsprojectnode.h +++ b/src/plugins/autotoolsprojectmanager/autotoolsprojectnode.h @@ -36,7 +36,10 @@ #define AUTOTOOLSPROJECTNODE_H #include -#include + +namespace Core { +class IDocument; +} namespace AutotoolsProjectManager { namespace Internal { diff --git a/src/plugins/autotoolsprojectmanager/makefileparser.cpp b/src/plugins/autotoolsprojectmanager/makefileparser.cpp index 972f6bce0ac..a1fea7247f9 100644 --- a/src/plugins/autotoolsprojectmanager/makefileparser.cpp +++ b/src/plugins/autotoolsprojectmanager/makefileparser.cpp @@ -37,6 +37,7 @@ #include #include +#include #include #include diff --git a/src/plugins/autotoolsprojectmanager/makefileparser.h b/src/plugins/autotoolsprojectmanager/makefileparser.h index 8038f8c39fe..ce3e67a06e8 100644 --- a/src/plugins/autotoolsprojectmanager/makefileparser.h +++ b/src/plugins/autotoolsprojectmanager/makefileparser.h @@ -36,12 +36,11 @@ #define MAKEFILEPARSER_H #include -#include #include #include #include -#include -#include + +QT_FORWARD_DECLARE_CLASS(QDir) namespace AutotoolsProjectManager { namespace Internal { diff --git a/src/plugins/autotoolsprojectmanager/makefileparserthread.h b/src/plugins/autotoolsprojectmanager/makefileparserthread.h index e998c726cc9..5e3da0f5717 100644 --- a/src/plugins/autotoolsprojectmanager/makefileparserthread.h +++ b/src/plugins/autotoolsprojectmanager/makefileparserthread.h @@ -38,7 +38,7 @@ #include "makefileparser.h" #include -#include +#include #include namespace AutotoolsProjectManager { diff --git a/src/plugins/coreplugin/manhattanstyle.cpp b/src/plugins/coreplugin/manhattanstyle.cpp index fd32959e97c..c44013d32d9 100644 --- a/src/plugins/coreplugin/manhattanstyle.cpp +++ b/src/plugins/coreplugin/manhattanstyle.cpp @@ -47,7 +47,6 @@ #include #include #include -#include #include #include #include @@ -98,7 +97,6 @@ bool panelWidget(const QWidget *widget) while (p) { if (qobject_cast(p) || qobject_cast(p) || - qobject_cast(p) || p->property("panelwidget").toBool()) return styleEnabled(widget); p = p->parentWidget(); @@ -209,16 +207,12 @@ int ManhattanStyle::pixelMetric(PixelMetric metric, const QStyleOption *option, case PM_DockWidgetHandleExtent: case PM_DockWidgetSeparatorExtent: return 1; - case PM_MenuPanelWidth: - case PM_MenuBarHMargin: - case PM_MenuBarVMargin: case PM_ToolBarFrameWidth: if (panelWidget(widget)) retval = 1; break; case PM_ButtonShiftVertical: case PM_ButtonShiftHorizontal: - case PM_MenuBarPanelWidth: case PM_ToolBarItemMargin: case PM_ToolBarItemSpacing: if (panelWidget(widget)) @@ -643,52 +637,6 @@ void ManhattanStyle::drawControl(ControlElement element, const QStyleOption *opt } break; - case CE_MenuBarItem: - painter->save(); - if (const QStyleOptionMenuItem *mbi = qstyleoption_cast(option)) { - QColor highlightOutline = Utils::StyleHelper::borderColor().lighter(120); - bool act = mbi->state & State_Selected && mbi->state & State_Sunken; - bool dis = !(mbi->state & State_Enabled); - Utils::StyleHelper::menuGradient(painter, option->rect, option->rect); - QStyleOptionMenuItem item = *mbi; - item.rect = mbi->rect; - QPalette pal = mbi->palette; - pal.setBrush(QPalette::ButtonText, dis ? Qt::gray : Qt::black); - item.palette = pal; - QCommonStyle::drawControl(element, &item, painter, widget); - QRect r = option->rect; - - if (act) { - // Fill| - QColor baseColor = Utils::StyleHelper::baseColor(); - QLinearGradient grad(option->rect.topLeft(), option->rect.bottomLeft()); - grad.setColorAt(0, baseColor.lighter(120)); - grad.setColorAt(1, baseColor.lighter(130)); - painter->fillRect(option->rect.adjusted(1, 1, -1, 0), grad); - - // Outline - painter->setPen(QPen(highlightOutline, 0)); - painter->drawLine(QPoint(r.left(), r.top() + 1), QPoint(r.left(), r.bottom())); - painter->drawLine(QPoint(r.right(), r.top() + 1), QPoint(r.right(), r.bottom())); - painter->drawLine(QPoint(r.left() + 1, r.top()), QPoint(r.right() - 1, r.top())); - highlightOutline.setAlpha(60); - painter->setPen(QPen(highlightOutline, 0)); - painter->drawPoint(r.topLeft()); - painter->drawPoint(r.topRight()); - - QPalette pal = mbi->palette; - uint alignment = Qt::AlignCenter | Qt::TextShowMnemonic | Qt::TextDontClip | Qt::TextSingleLine; - if (!styleHint(SH_UnderlineShortcut, mbi, widget)) - alignment |= Qt::TextHideMnemonic; - pal.setBrush(QPalette::Text, dis ? Qt::gray : QColor(0, 0, 0, 60)); - drawItemText(painter, item.rect.translated(0, 1), alignment, pal, mbi->state & State_Enabled, mbi->text, QPalette::Text); - pal.setBrush(QPalette::Text, dis ? Qt::gray : Qt::white); - drawItemText(painter, item.rect, alignment, pal, mbi->state & State_Enabled, mbi->text, QPalette::Text); - } - } - painter->restore(); - break; - case CE_ComboBoxLabel: if (const QStyleOptionComboBox *cb = qstyleoption_cast(option)) { if (panelWidget(widget)) { @@ -769,15 +717,6 @@ void ManhattanStyle::drawControl(ControlElement element, const QStyleOption *opt } break; - case CE_MenuBarEmptyArea: { - Utils::StyleHelper::menuGradient(painter, option->rect, option->rect); - painter->save(); - painter->setPen(Utils::StyleHelper::borderColor()); - painter->drawLine(option->rect.bottomLeft(), option->rect.bottomRight()); - painter->restore(); - } - break; - case CE_ToolBar: { QRect rect = option->rect; diff --git a/src/plugins/debugger/debuggerdialogs.cpp b/src/plugins/debugger/debuggerdialogs.cpp index c99c4fe4faa..9b74cd31de1 100644 --- a/src/plugins/debugger/debuggerdialogs.cpp +++ b/src/plugins/debugger/debuggerdialogs.cpp @@ -706,19 +706,16 @@ class StartRemoteParameters public: StartRemoteParameters(); bool equals(const StartRemoteParameters &rhs) const; - QString displayName() const { return remoteChannel; } - bool isValid() const { return !remoteChannel.isEmpty(); } + QString displayName() const; void toSettings(QSettings *) const; void fromSettings(const QSettings *settings); + Id profileId; QString localExecutable; - QString remoteChannel; - QString remoteArchitecture; QString overrideStartScript; bool useServerStartScript; QString serverStartScript; - Id profileId; QString debugInfoLocation; }; @@ -747,8 +744,7 @@ StartRemoteParameters::StartRemoteParameters() : bool StartRemoteParameters::equals(const StartRemoteParameters &rhs) const { - return localExecutable == rhs.localExecutable && remoteChannel ==rhs.remoteChannel - && remoteArchitecture == rhs.remoteArchitecture + return localExecutable == rhs.localExecutable && overrideStartScript == rhs.overrideStartScript && useServerStartScript == rhs.useServerStartScript && serverStartScript == rhs.serverStartScript @@ -756,11 +752,15 @@ bool StartRemoteParameters::equals(const StartRemoteParameters &rhs) const && debugInfoLocation == rhs.debugInfoLocation; } +QString StartRemoteParameters::displayName() const +{ + Profile *profile = ProfileManager::instance()->find(profileId); + return profile ? profile->displayName() : QString(); +} + void StartRemoteParameters::toSettings(QSettings *settings) const { - settings->setValue(_("LastRemoteChannel"), remoteChannel); settings->setValue(_("LastLocalExecutable"), localExecutable); - settings->setValue(_("LastRemoteArchitecture"), remoteArchitecture); settings->setValue(_("LastServerStartScript"), serverStartScript); settings->setValue(_("LastUseServerStartScript"), useServerStartScript); settings->setValue(_("LastRemoteStartScript"), overrideStartScript); @@ -770,7 +770,6 @@ void StartRemoteParameters::toSettings(QSettings *settings) const void StartRemoteParameters::fromSettings(const QSettings *settings) { - remoteChannel = settings->value(_("LastRemoteChannel")).toString(); localExecutable = settings->value(_("LastLocalExecutable")).toString(); const QString profileIdString = settings->value(_("LastProfileId")).toString(); if (profileIdString.isEmpty()) { @@ -778,7 +777,6 @@ void StartRemoteParameters::fromSettings(const QSettings *settings) } else { profileId = Id(profileIdString); } - remoteArchitecture = settings->value(_("LastRemoteArchitecture")).toString(); serverStartScript = settings->value(_("LastServerStartScript")).toString(); useServerStartScript = settings->value(_("LastUseServerStartScript")).toBool(); overrideStartScript = settings->value(_("LastRemoteStartScript")).toString(); @@ -791,8 +789,6 @@ class StartRemoteDialogPrivate public: ProfileChooser *profileChooser; PathChooser *executablePathChooser; - QLineEdit *channelLineEdit; - QComboBox *architectureComboBox; PathChooser *debuginfoPathChooser; PathChooser *overrideStartScriptPathChooser; QCheckBox *useServerStartScriptCheckBox; @@ -815,12 +811,6 @@ StartRemoteDialog::StartRemoteDialog(QWidget *parent, bool enableStartScript) d->executablePathChooser->setExpectedKind(PathChooser::File); d->executablePathChooser->setPromptDialogTitle(tr("Select Executable")); - d->channelLineEdit = new QLineEdit(this); - d->channelLineEdit->setText(QString::fromUtf8("localhost:5115")); - - d->architectureComboBox = new QComboBox(this); - d->architectureComboBox->setEditable(true); - d->debuginfoPathChooser = new PathChooser(this); d->debuginfoPathChooser->setPromptDialogTitle(tr("Select Location of Debugging Information")); @@ -857,8 +847,6 @@ StartRemoteDialog::StartRemoteDialog(QWidget *parent, bool enableStartScript) formLayout->addRow(tr("Target:"), d->profileChooser); formLayout->addRow(tr("Local &executable:"), d->executablePathChooser); formLayout->setFieldGrowthPolicy(QFormLayout::AllNonFixedFieldsGrow); - formLayout->addRow(tr("&Host and port:"), d->channelLineEdit); - formLayout->addRow(tr("&Architecture:"), d->architectureComboBox); formLayout->addRow(tr("Location of debugging &information:"), d->debuginfoPathChooser); formLayout->addRow(tr("Override host GDB s&tart script:"), d->overrideStartScriptPathChooser); formLayout->addRow(d->serverStartScriptLabel, d->useServerStartScriptCheckBox); @@ -893,19 +881,11 @@ bool StartRemoteDialog::run(QWidget *parent, QSettings *settings, const QString arrayName = useScript ? _("StartRemoteScript") : _("StartRemote"); - QStringList arches; - arches << _("i386:x86-64:intel") << _("i386") << _("arm"); - QList history = readParameterHistory(settings, settingsGroup, arrayName); QTC_ASSERT(!history.isEmpty(), return false); - foreach (const StartRemoteParameters &h, history) - if (!arches.contains(h.remoteArchitecture)) - arches.prepend(h.remoteArchitecture); - StartRemoteDialog dialog(parent, useScript); - dialog.setRemoteArchitectures(arches); dialog.setHistory(history); dialog.setParameters(history.back()); if (dialog.exec() != QDialog::Accepted) @@ -920,8 +900,6 @@ bool StartRemoteDialog::run(QWidget *parent, QSettings *settings, } fillParameters(sp, dialog.profileId()); - sp->remoteChannel = newParameters.remoteChannel; - sp->remoteArchitecture = newParameters.remoteArchitecture; sp->executable = newParameters.localExecutable; sp->displayName = tr("Remote: \"%1\"").arg(sp->remoteChannel); sp->overrideStartScript = newParameters.overrideStartScript; @@ -934,9 +912,7 @@ bool StartRemoteDialog::run(QWidget *parent, QSettings *settings, StartRemoteParameters StartRemoteDialog::parameters() const { StartRemoteParameters result; - result.remoteChannel = d->channelLineEdit->text(); result.localExecutable = d->executablePathChooser->path(); - result.remoteArchitecture = d->architectureComboBox->currentText(); result.overrideStartScript = d->overrideStartScriptPathChooser->path(); result.useServerStartScript = d->useServerStartScriptCheckBox->isChecked(); result.serverStartScript = d->serverStartScriptPathChooser->path(); @@ -947,11 +923,7 @@ StartRemoteParameters StartRemoteDialog::parameters() const void StartRemoteDialog::setParameters(const StartRemoteParameters &p) { - d->channelLineEdit->setText(p.remoteChannel); d->executablePathChooser->setPath(p.localExecutable); - const int index = d->architectureComboBox->findText(p.remoteArchitecture); - if (index != -1) - d->architectureComboBox->setCurrentIndex(index); d->overrideStartScriptPathChooser->setPath(p.overrideStartScript); d->useServerStartScriptCheckBox->setChecked(p.useServerStartScript); d->serverStartScriptPathChooser->setPath(p.serverStartScript); @@ -962,10 +934,8 @@ void StartRemoteDialog::setParameters(const StartRemoteParameters &p) void StartRemoteDialog::setHistory(const QList &l) { d->historyComboBox->clear(); - for (int i = l.size() - 1; i >= 0; --i) - if (l.at(i).isValid()) - d->historyComboBox->addItem(l.at(i).displayName(), - QVariant::fromValue(l.at(i))); + for (int i = l.size(); --i >= 0; ) + d->historyComboBox->addItem(l.at(i).displayName(), QVariant::fromValue(l.at(i))); } void StartRemoteDialog::historyIndexChanged(int index) @@ -982,15 +952,6 @@ Id StartRemoteDialog::profileId() const return d->profileChooser->currentProfileId(); } -void StartRemoteDialog::setRemoteArchitectures(const QStringList &list) -{ - d->architectureComboBox->clear(); - if (!list.isEmpty()) { - d->architectureComboBox->insertItems(0, list); - d->architectureComboBox->setCurrentIndex(0); - } -} - void StartRemoteDialog::updateState() { bool enabled = d->useServerStartScriptCheckBox->isChecked(); diff --git a/src/plugins/debugger/debuggerdialogs.h b/src/plugins/debugger/debuggerdialogs.h index d97fd9cbe44..3b8ba8084a9 100644 --- a/src/plugins/debugger/debuggerdialogs.h +++ b/src/plugins/debugger/debuggerdialogs.h @@ -140,8 +140,6 @@ private: void setParameters(const StartRemoteParameters &); void setHistory(const QList &); - void setRemoteArchitectures(const QStringList &list); - Core::Id profileId() const; StartRemoteDialogPrivate *d; diff --git a/src/plugins/debugger/debuggerengine.cpp b/src/plugins/debugger/debuggerengine.cpp index 1616a1fd7b2..9137c60f0f1 100644 --- a/src/plugins/debugger/debuggerengine.cpp +++ b/src/plugins/debugger/debuggerengine.cpp @@ -126,7 +126,6 @@ QDebug operator<<(QDebug str, const DebuggerStartParameters &sp) << " attachPID=" << sp.attachPID << " useTerminal=" << sp.useTerminal << " remoteChannel=" << sp.remoteChannel - << " remoteArchitecture=" << sp.remoteArchitecture << " symbolFileName=" << sp.symbolFileName << " useServerStartScript=" << sp.useServerStartScript << " serverStartScript=" << sp.serverStartScript diff --git a/src/plugins/debugger/debuggerplugin.cpp b/src/plugins/debugger/debuggerplugin.cpp index 3e9acd6409c..d549c0213b1 100644 --- a/src/plugins/debugger/debuggerplugin.cpp +++ b/src/plugins/debugger/debuggerplugin.cpp @@ -550,9 +550,16 @@ void fillParameters(DebuggerStartParameters *sp, Id id) QTC_ASSERT(profile, return); sp->sysRoot = SysRootProfileInformation::sysRoot(profile).toString(); sp->debuggerCommand = DebuggerProfileInformation::debuggerCommand(profile).toString(); + ToolChain *tc = ToolChainProfileInformation::toolChain(profile); if (tc) sp->toolChainAbi = tc->targetAbi(); + + IDevice::ConstPtr device = DeviceProfileInformation::device(profile); + if (device) { + sp->connParams = device->sshParameters(); + sp->remoteChannel = QString("%1:%2").arg(sp->connParams.host).arg(sp->connParams.port); + } } static TextEditor::ITextEditor *currentTextEditor() @@ -777,7 +784,6 @@ public slots: Q_SLOT void attachExternalApplication(ProjectExplorer::RunControl *rc); void runScheduled(); void attachCore(); - void attachToRemoteServer(const QString &spec); void enableReverseDebuggingTriggered(const QVariant &value); void languagesChanged(); @@ -1308,7 +1314,7 @@ bool DebuggerPluginPrivate::parseArgument(QStringList::const_iterator &it, { const QString &option = *it; // '-debug ' - // '-debug [,server=|,core=][,arch=][,profile=]' + // '-debug [,server=][,core=][,profile=]' if (*it == _("-debug")) { ++it; if (it == cend) { @@ -1346,8 +1352,6 @@ bool DebuggerPluginPrivate::parseArgument(QStringList::const_iterator &it, sp.displayName = tr("Remote: \"%1\"").arg(sp.remoteChannel); sp.startMessage = tr("Attaching to remote server %1.").arg(sp.remoteChannel); } - else if (key == QLatin1String("arch")) - sp.remoteArchitecture = val; else if (key == QLatin1String("core")) { sp.startMode = AttachCore; sp.closeMode = DetachAtClose; @@ -1591,22 +1595,6 @@ void DebuggerPluginPrivate::attachCore() startDebugger(rc); } -void DebuggerPluginPrivate::attachToRemoteServer(const QString &spec) -{ - // spec is: profile@server:port@executable@architecture - const QChar delim(QLatin1Char('@')); - DebuggerStartParameters sp; - fillParameters(&sp, Id(spec.section(delim, 0, 0))); - sp.remoteChannel = spec.section(delim, 1, 1); - sp.executable = spec.section(delim, 2, 2); - sp.remoteArchitecture = spec.section(delim, 3, 3); - sp.displayName = tr("Remote: \"%1\"").arg(sp.remoteChannel); - sp.startMode = AttachToRemoteServer; - sp.closeMode = KillAtClose; - if (DebuggerRunControl *rc = createDebugger(sp)) - startDebugger(rc); -} - struct RemoteCdbMatcher : ProfileMatcher { RemoteCdbMatcher() : m_hostAbi(Abi::hostAbi()) {} @@ -2727,8 +2715,7 @@ static QString formatStartParameters(DebuggerStartParameters &sp) str << "QML server: " << sp.qmlServerAddress << ':' << sp.qmlServerPort << '\n'; if (!sp.remoteChannel.isEmpty()) { - str << "Remote: " << sp.remoteChannel << ", " - << sp.remoteArchitecture << '\n'; + str << "Remote: " << sp.remoteChannel << '\n'; if (!sp.remoteDumperLib.isEmpty()) str << "Remote dumpers: " << sp.remoteDumperLib << '\n'; if (!sp.remoteSourcesDir.isEmpty()) @@ -2737,8 +2724,6 @@ static QString formatStartParameters(DebuggerStartParameters &sp) str << "Remote mount point: " << sp.remoteMountPoint << " Local: " << sp.localMountDir << '\n'; } - if (!sp.gnuTarget.isEmpty()) - str << "Gnu target: " << sp.gnuTarget << '\n'; str << "Sysroot: " << sp.sysRoot << '\n'; str << "Debug Source Location: " << sp.debugSourceLocation.join(QLatin1String(":")) << '\n'; str << "Symbol file: " << sp.symbolFileName << '\n'; diff --git a/src/plugins/debugger/debuggerstartparameters.h b/src/plugins/debugger/debuggerstartparameters.h index c479e37480b..8ede708d611 100644 --- a/src/plugins/debugger/debuggerstartparameters.h +++ b/src/plugins/debugger/debuggerstartparameters.h @@ -111,8 +111,6 @@ public: QString qtInstallPath; // Used by remote debugging. QString remoteChannel; - QString remoteArchitecture; - QString gnuTarget; QString symbolFileName; bool useServerStartScript; QString serverStartScript; diff --git a/src/plugins/debugger/gdb/remotegdbserveradapter.cpp b/src/plugins/debugger/gdb/remotegdbserveradapter.cpp index d33b850c0cd..61b03434473 100644 --- a/src/plugins/debugger/gdb/remotegdbserveradapter.cpp +++ b/src/plugins/debugger/gdb/remotegdbserveradapter.cpp @@ -181,13 +181,10 @@ void GdbRemoteServerEngine::setupInferior() //const QByteArray sysroot = sp.sysroot.toLocal8Bit(); //const QByteArray remoteArch = sp.remoteArchitecture.toLatin1(); - //const QByteArray gnuTarget = sp.gnuTarget.toLatin1(); const QString args = sp.processArgs; // if (!remoteArch.isEmpty()) // postCommand("set architecture " + remoteArch); -// if (!gnuTarget.isEmpty()) -// postCommand("set gnutarget " + gnuTarget); const QString solibSearchPath = sp.solibSearchPath.join(QLatin1String(PATHSEP)); if (!solibSearchPath.isEmpty()) postCommand("set solib-search-path " + solibSearchPath.toLocal8Bit()); diff --git a/src/plugins/debugger/namedemangler/globalparsestate.cpp b/src/plugins/debugger/namedemangler/globalparsestate.cpp index f14cf6aae5b..c9841a14719 100644 --- a/src/plugins/debugger/namedemangler/globalparsestate.cpp +++ b/src/plugins/debugger/namedemangler/globalparsestate.cpp @@ -71,7 +71,7 @@ void GlobalParseState::addSubstitution(const ParseTreeNode *node) void GlobalParseState::addSubstitution(const QByteArray &symbol) { - if (!symbol.isEmpty() && !m_substitutions.contains(symbol)) + if (!symbol.isEmpty()) m_substitutions.append(symbol); } diff --git a/src/plugins/debugger/namedemangler/namedemangler.cpp b/src/plugins/debugger/namedemangler/namedemangler.cpp index 3a4e7cb261f..2414b2f0ba4 100644 --- a/src/plugins/debugger/namedemangler/namedemangler.cpp +++ b/src/plugins/debugger/namedemangler/namedemangler.cpp @@ -73,6 +73,21 @@ bool NameDemanglerPrivate::demangle(const QString &mangledName) "expected one.").arg(m_parseState.m_parseStack.count())); } m_demangledName = m_parseState.m_parseStack.top()->toByteArray(); + + /* + * FIXME: This is a hack we do because TypeNode::toByteArray() cannot catch all + * all nested reference due to the way substitutions are currently implented. + * Note that even with this hack, we do not catch things like + * "reference to reference to array", because the operators do not follow each other + * in the string. + * For a correct solution, we'll probably have to clone substitution nodes instead of + * just dumping their strings (which means adding a copy constructor and a clone function + * to every node). + */ + m_demangledName.replace("&& &&", "&&"); + m_demangledName.replace("&& &", "&"); + m_demangledName.replace(" & &", "&"); + success = true; } catch (const ParseException &p) { m_errorString = QString::fromLocal8Bit("Parse error at index %1 of mangled name '%2': %3.") diff --git a/src/plugins/debugger/namedemangler/parsetreenodes.cpp b/src/plugins/debugger/namedemangler/parsetreenodes.cpp index 92f88bfe0b1..435c6b564af 100644 --- a/src/plugins/debugger/namedemangler/parsetreenodes.cpp +++ b/src/plugins/debugger/namedemangler/parsetreenodes.cpp @@ -229,6 +229,7 @@ void BuiltinTypeNode::parse() if (next == 'u') { m_type = VendorType; PARSE_RULE_AND_ADD_RESULT_AS_CHILD(SourceNameNode); + parseState()->addSubstitution(this); return; } @@ -1581,6 +1582,7 @@ bool SubstitutionNode::mangledRepresentationStartsWith(char c) * ::= Si # ::std::basic_istream > * ::= So # ::std::basic_ostream > * ::= Sd # ::std::basic_iostream > + * ::= St # ::std:: */ void SubstitutionNode::parse() { @@ -1607,7 +1609,13 @@ void SubstitutionNode::parse() m_type = ActualSubstitutionType; m_substValue = parseState()->substitutionAt(0); break; - case 't': m_type = StdType; break; + case 't': + m_type = StdType; + if (UnqualifiedNameNode::mangledRepresentationStartsWith(PEEK())) { + PARSE_RULE_AND_ADD_RESULT_AS_CHILD(UnqualifiedNameNode); + parseState()->addSubstitution(this); + } + break; case 'a': m_type = StdAllocType; break; case 'b': m_type = StdBasicStringType; break; case 's': m_type = FullStdBasicStringType; break; @@ -1623,7 +1631,12 @@ QByteArray SubstitutionNode::toByteArray() const { switch (m_type) { case ActualSubstitutionType: return m_substValue; - case StdType: return "std"; + case StdType: { + QByteArray repr = "std"; + if (childCount() > 0) + repr.append("::").append(CHILD_TO_BYTEARRAY(0)); + return repr; + } case StdAllocType: return "std::allocator"; case StdBasicStringType: return "std::basic_string"; case FullStdBasicStringType: return "std::basic_string, " @@ -2194,15 +2207,14 @@ void PrefixNode::parse() parseState()->addSubstitution(this); PARSE_RULE_AND_ADD_RESULT_AS_CHILD(TemplateArgsNode); } - if (UnqualifiedNameNode::mangledRepresentationStartsWith(PEEK())) { + if (Prefix2Node::mangledRepresentationStartsWith(PEEK())) parseState()->addSubstitution(this); - PARSE_RULE_AND_ADD_RESULT_AS_CHILD(Prefix2Node); - } + PARSE_RULE_AND_ADD_RESULT_AS_CHILD(Prefix2Node); } else if (SubstitutionNode::mangledRepresentationStartsWith(next)) { PARSE_RULE_AND_ADD_RESULT_AS_CHILD(SubstitutionNode); if (TemplateArgsNode::mangledRepresentationStartsWith(PEEK())) { PARSE_RULE_AND_ADD_RESULT_AS_CHILD(TemplateArgsNode); - if (UnqualifiedNameNode::mangledRepresentationStartsWith(PEEK())) + if (Prefix2Node::mangledRepresentationStartsWith(PEEK())) parseState()->addSubstitution(this); } PARSE_RULE_AND_ADD_RESULT_AS_CHILD(Prefix2Node); @@ -2210,7 +2222,7 @@ void PrefixNode::parse() PARSE_RULE_AND_ADD_RESULT_AS_CHILD(SubstitutionNode); if (TemplateArgsNode::mangledRepresentationStartsWith(PEEK())) { PARSE_RULE_AND_ADD_RESULT_AS_CHILD(TemplateArgsNode); - if (UnqualifiedNameNode::mangledRepresentationStartsWith(PEEK())) + if (Prefix2Node::mangledRepresentationStartsWith(PEEK())) parseState()->addSubstitution(this); } PARSE_RULE_AND_ADD_RESULT_AS_CHILD(Prefix2Node); @@ -2289,8 +2301,10 @@ void TypeNode::parse() parseState()->addSubstitution(this); } else if (ArrayTypeNode::mangledRepresentationStartsWith(next)) { PARSE_RULE_AND_ADD_RESULT_AS_CHILD(ArrayTypeNode); + parseState()->addSubstitution(this); } else if (PointerToMemberTypeNode::mangledRepresentationStartsWith(next)) { PARSE_RULE_AND_ADD_RESULT_AS_CHILD(PointerToMemberTypeNode); + parseState()->addSubstitution(this); } else if (TemplateParamNode::mangledRepresentationStartsWith(next)) { PARSE_RULE_AND_ADD_RESULT_AS_CHILD(TemplateParamNode); // The type is now a substitution candidate, but the child node may contain a forward @@ -2378,8 +2392,10 @@ QByteArray TypeNode::toByteArray() const QList qualPtrRefList; const TypeNode *currentNode = this; bool leafType = false; + Type lastType = TypeNode::OtherType; while (!leafType) { - switch (currentNode->m_type) { + Type currentType = currentNode->m_type; + switch (currentType) { case QualifiedType: { const CvQualifiersNode * const cvNode = DEMANGLER_CAST(CvQualifiersNode, CHILD_AT(currentNode, 0)); @@ -2389,13 +2405,32 @@ QByteArray TypeNode::toByteArray() const break; } case PointerType: case ReferenceType: case RValueType: - qualPtrRefList << currentNode; + /* + * The Standard says (8.3.2/6) that nested references collapse according + * to the following rules: + * (1) Reference to reference -> reference + * (2) Reference to rvalue -> reference + * (3) Rvalue to reference -> reference + * (4) Rvalue to Rvalue -> Rvalue + */ + if (currentType == ReferenceType + && (lastType == ReferenceType || lastType == RValueType)) { // (1) and (3) + qualPtrRefList.removeLast(); + qualPtrRefList << currentNode; + } else if (currentType == RValueType + && (lastType == ReferenceType || lastType == RValueType)) { // (2) and (4) + // Ignore current element. + currentType = lastType; + } else { + qualPtrRefList << currentNode; + } currentNode = DEMANGLER_CAST(TypeNode, CHILD_AT(currentNode, 0)); break; default: leafType = true; break; } + lastType = currentType; } if (qualPtrRefList.isEmpty()) { @@ -2471,6 +2506,7 @@ QByteArray TypeNode::qualPtrRefListToByteArray(const QListtoByteArray()); } } + return repr; } diff --git a/src/plugins/qnx/blackberryruncontrolfactory.cpp b/src/plugins/qnx/blackberryruncontrolfactory.cpp index d1abfc3046c..2e649682f10 100644 --- a/src/plugins/qnx/blackberryruncontrolfactory.cpp +++ b/src/plugins/qnx/blackberryruncontrolfactory.cpp @@ -134,10 +134,8 @@ Debugger::DebuggerStartParameters BlackBerryRunControlFactory::startParameters( params.debuggerCommand = Debugger::DebuggerProfileInformation::debuggerCommand(profile).toString(); params.sysRoot = ProjectExplorer::SysRootProfileInformation::sysRoot(profile).toString(); - if (ProjectExplorer::ToolChain *tc = ProjectExplorer::ToolChainProfileInformation::toolChain(profile)) { + if (ProjectExplorer::ToolChain *tc = ProjectExplorer::ToolChainProfileInformation::toolChain(profile)) params.toolChainAbi = tc->targetAbi(); - params.remoteArchitecture = ProjectExplorer::Abi::toString(tc->targetAbi().architecture()); - } params.executable = runConfig->localExecutableFilePath(); params.remoteChannel = runConfig->deployConfiguration()->deviceHost() + QLatin1String(":8000"); diff --git a/src/plugins/qnx/qnxruncontrolfactory.cpp b/src/plugins/qnx/qnxruncontrolfactory.cpp index b0125af6c83..2d95b48609f 100644 --- a/src/plugins/qnx/qnxruncontrolfactory.cpp +++ b/src/plugins/qnx/qnxruncontrolfactory.cpp @@ -132,10 +132,8 @@ Debugger::DebuggerStartParameters QnxRunControlFactory::startParameters( params.debuggerCommand = Debugger::DebuggerProfileInformation::debuggerCommand(profile).toString(); params.sysRoot = ProjectExplorer::SysRootProfileInformation::sysRoot(profile).toString(); - if (ProjectExplorer::ToolChain *tc = ProjectExplorer::ToolChainProfileInformation::toolChain(profile)) { + if (ProjectExplorer::ToolChain *tc = ProjectExplorer::ToolChainProfileInformation::toolChain(profile)) params.toolChainAbi = tc->targetAbi(); - params.remoteArchitecture = ProjectExplorer::Abi::toString(tc->targetAbi().architecture()); - } params.symbolFileName = runConfig->localExecutableFilePath(); params.remoteExecutable = runConfig->remoteExecutableFilePath(); diff --git a/src/plugins/qt4projectmanager/unconfiguredsettingsoptionpage.cpp b/src/plugins/qt4projectmanager/unconfiguredsettingsoptionpage.cpp deleted file mode 100644 index f279ee2c41a..00000000000 --- a/src/plugins/qt4projectmanager/unconfiguredsettingsoptionpage.cpp +++ /dev/null @@ -1,155 +0,0 @@ -/************************************************************************** -** -** This file is part of Qt Creator -** -** Copyright (c) 2011 Nokia Corporation and/or its subsidiary(-ies). -** -** Contact: http://www.qt-project.org/ -** -** -** GNU Lesser General Public License Usage -** -** This file may be used under the terms of the GNU Lesser General Public -** License version 2.1 as published by the Free Software Foundation and -** appearing in the file LICENSE.LGPL included in the packaging of this file. -** Please review the following information to ensure the GNU Lesser General -** Public License version 2.1 requirements will be met: -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** Other Usage -** -** Alternatively, this file may be used in accordance with the terms and -** conditions contained in a signed written agreement between you and Nokia. -** -** -**************************************************************************/ - -#include "unconfiguredsettingsoptionpage.h" -#include "qt4projectmanagerconstants.h" - -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include - -using namespace Qt4ProjectManager; -using namespace Qt4ProjectManager::Internal; - -////////////////////////// -// UnConfiguredSettingsWidget -////////////////////////// - -UnConfiguredSettingsWidget::UnConfiguredSettingsWidget(QWidget *parent) - : QWidget(parent) -{ - QFormLayout *layout = new QFormLayout(this); - - QLabel *descriptionLabel = new QLabel; - descriptionLabel->setWordWrap(true); - descriptionLabel->setText(tr("Qt Creator can open qmake projects without configuring them for building.\n" - "The C++ and QML code models need a Qt version and tool chain to offer code completion.\n")); - layout->addRow(descriptionLabel); - - m_qtVersionComboBox = new QComboBox; - layout->addRow(tr("Qt Version:"), m_qtVersionComboBox); - - m_toolchainComboBox = new QComboBox; - layout->addRow(tr("Tool Chain:"), m_toolchainComboBox); - - Qt4Manager *qt4Manager = ExtensionSystem::PluginManager::getObject(); - Internal::UnConfiguredSettings ucs = qt4Manager->unconfiguredSettings(); - - QtSupport::QtVersionManager *vm = QtSupport::QtVersionManager::instance(); - foreach (QtSupport::BaseQtVersion *version, vm->validVersions()) - m_qtVersionComboBox->addItem(version->displayName(), version->uniqueId()); - - int index = ucs.version ? m_qtVersionComboBox->findData(ucs.version->uniqueId()) : 0; - if (index == -1) - index = 0; - if (index < m_qtVersionComboBox->count()) - m_qtVersionComboBox->setCurrentIndex(index); - - - ProjectExplorer::ToolChainManager *tm = ProjectExplorer::ToolChainManager::instance(); - foreach (ProjectExplorer::ToolChain *tc, tm->toolChains()) - m_toolchainComboBox->addItem(tc->displayName(), tc->id()); - - index = ucs.toolchain ? m_toolchainComboBox->findData(ucs.toolchain->id()) : 0; - if (index == -1) - index = 0; - if (index < m_toolchainComboBox->count()) - m_toolchainComboBox->setCurrentIndex(index); -} - -void UnConfiguredSettingsWidget::apply() -{ - Qt4Manager *qt4Manager = ExtensionSystem::PluginManager::getObject(); - Internal::UnConfiguredSettings ucs; - - int index = m_qtVersionComboBox->currentIndex(); - int qtVersionId = (index != -1) ? m_qtVersionComboBox->itemData(index).toInt() : -1; - ucs.version = QtSupport::QtVersionManager::instance()->version(qtVersionId); - index = m_toolchainComboBox->currentIndex(); - QString toolChainId = index != -1 ? m_toolchainComboBox->itemData(index).toString() : QString(); - ucs.toolchain = ProjectExplorer::ToolChainManager::instance()->findToolChain(toolChainId); - qt4Manager->setUnconfiguredSettings(ucs); -} - -bool UnConfiguredSettingsWidget::matches(const QString &searchKeyword) -{ - for (int i = 0; i < layout()->count(); ++i) { - if (QLabel *l = qobject_cast(layout()->itemAt(i)->widget())) - if (l->text().contains(searchKeyword)) - return true; - } - return false; -} - -////////////////////////// -// UnConfiguredSettingsOptionPage -////////////////////////// - -UnConfiguredSettingsOptionPage::UnConfiguredSettingsOptionPage() -{ - setId(Constants::UNCONFIGURED_SETTINGS_PAGE_ID); - setDisplayName(QCoreApplication::translate("Qt4ProjectManager", Constants::UNCONFIGURED_SETTINGS_PAGE_NAME)); - setCategory(QLatin1String(ProjectExplorer::Constants::PROJECTEXPLORER_SETTINGS_CATEGORY)); - setDisplayCategory(QCoreApplication::translate("ProjectExplorer", - ProjectExplorer::Constants::PROJECTEXPLORER_SETTINGS_TR_CATEGORY)); - setCategoryIcon(QLatin1String(ProjectExplorer::Constants::PROJECTEXPLORER_SETTINGS_CATEGORY_ICON)); -} - -bool UnConfiguredSettingsOptionPage::matches(const QString &searchKeyword) const -{ - return m_widget->matches(searchKeyword); -} - -QWidget *UnConfiguredSettingsOptionPage::createPage(QWidget *parent) -{ - m_widget = new UnConfiguredSettingsWidget(parent); - return m_widget; -} - -void UnConfiguredSettingsOptionPage::apply() -{ - if (m_widget) - m_widget->apply(); -} - -void UnConfiguredSettingsOptionPage::finish() -{ - -} diff --git a/src/plugins/remotelinux/remotelinuxdebugsupport.cpp b/src/plugins/remotelinux/remotelinuxdebugsupport.cpp index 943ab9234ed..ead5c41193e 100644 --- a/src/plugins/remotelinux/remotelinuxdebugsupport.cpp +++ b/src/plugins/remotelinux/remotelinuxdebugsupport.cpp @@ -117,15 +117,6 @@ DebuggerStartParameters AbstractRemoteLinuxDebugSupport::startParameters(const R params.startMode = AttachToRemoteServer; params.executable = runConfig->localExecutableFilePath(); params.remoteChannel = devConf->sshParameters().host + QLatin1String(":-1"); - - // TODO: This functionality should be inside the debugger. - ToolChain *tc = ToolChainProfileInformation::toolChain(profile); - if (tc) { - const Abi &abi = tc->targetAbi(); - params.remoteArchitecture = abi.toString(); - params.gnuTarget = QLatin1String(abi.architecture() == Abi::ArmArchitecture - ? "arm-none-linux-gnueabi": "i386-unknown-linux-gnu"); - } } else { params.startMode = AttachToRemoteServer; } diff --git a/src/plugins/remotelinux/startgdbserverdialog.cpp b/src/plugins/remotelinux/startgdbserverdialog.cpp index 196a9e3cf3b..135b480a20d 100644 --- a/src/plugins/remotelinux/startgdbserverdialog.cpp +++ b/src/plugins/remotelinux/startgdbserverdialog.cpp @@ -37,8 +37,7 @@ #include #include #include -#include -#include +#include #include #include #include @@ -87,17 +86,16 @@ public: LinuxDeviceConfiguration::ConstPtr currentDevice() const { - return deviceManagerModel->device(deviceComboBox->currentIndex()) - .dynamicCast(); + Profile *profile = profileChooser->currentProfile(); + IDevice::ConstPtr device = DeviceProfileInformation::device(profile); + return device.dynamicCast(); } StartGdbServerDialog *q; bool startServerOnly; AbstractRemoteLinuxProcessList *processList; QSortFilterProxyModel proxyModel; - DeviceManagerModel *deviceManagerModel; - QComboBox *deviceComboBox; QLineEdit *processFilterLineEdit; QTableView *tableView; QPushButton *attachProcessButton; @@ -117,13 +115,7 @@ StartGdbServerDialogPrivate::StartGdbServerDialogPrivate(StartGdbServerDialog *q { settings = ICore::settings(); - deviceComboBox = new QComboBox(q); - profileChooser = new ProfileChooser(q, ProfileChooser::RemoteDebugging); -// sysrootPathChooser = new PathChooser(q); -// sysrootPathChooser->setExpectedKind(PathChooser::Directory); -// sysrootPathChooser->setPromptDialogTitle(StartGdbServerDialog::tr("Select Sysroot")); -// sysrootPathChooser->setPath(settings->value(LastSysroot).toString()); //executablePathChooser = new PathChooser(q); //executablePathChooser->setExpectedKind(PathChooser::File); @@ -152,7 +144,6 @@ StartGdbServerDialogPrivate::StartGdbServerDialogPrivate(StartGdbServerDialog *q textBrowser->setEnabled(false); QFormLayout *formLayout = new QFormLayout(); - formLayout->addRow(StartGdbServerDialog::tr("Device:"), deviceComboBox); formLayout->addRow(StartGdbServerDialog::tr("Target:"), profileChooser); formLayout->addRow(StartGdbServerDialog::tr("&Filter entries:"), processFilterLineEdit); @@ -176,39 +167,32 @@ StartGdbServerDialog::StartGdbServerDialog(QWidget *parent) : { setWindowTitle(tr("List of Remote Processes")); - d->deviceManagerModel = new DeviceManagerModel(DeviceManager::instance(), this); - QObject::connect(d->closeButton, SIGNAL(clicked()), this, SLOT(reject())); - d->deviceComboBox->setModel(d->deviceManagerModel); - d->deviceComboBox->setCurrentIndex(d->settings->value(LastDevice).toInt()); connect(&d->gatherer, SIGNAL(error(QString)), SLOT(portGathererError(QString))); connect(&d->gatherer, SIGNAL(portListReady()), SLOT(portListReady())); - if (d->deviceManagerModel->rowCount() == 0) { - d->tableView->setEnabled(false); - } else { - d->tableView->setSelectionBehavior(QAbstractItemView::SelectRows); - d->proxyModel.setDynamicSortFilter(true); - d->proxyModel.setFilterKeyColumn(-1); - d->tableView->setModel(&d->proxyModel); - connect(d->processFilterLineEdit, SIGNAL(textChanged(QString)), - &d->proxyModel, SLOT(setFilterRegExp(QString))); - connect(d->tableView->selectionModel(), - SIGNAL(selectionChanged(QItemSelection,QItemSelection)), + d->tableView->setSelectionBehavior(QAbstractItemView::SelectRows); + d->proxyModel.setDynamicSortFilter(true); + d->proxyModel.setFilterKeyColumn(-1); + d->tableView->setModel(&d->proxyModel); + connect(d->processFilterLineEdit, SIGNAL(textChanged(QString)), + &d->proxyModel, SLOT(setFilterRegExp(QString))); + + connect(d->tableView->selectionModel(), + SIGNAL(selectionChanged(QItemSelection,QItemSelection)), + SLOT(updateButtons())); + connect(d->profileChooser, SIGNAL(activated(int)), SLOT(updateButtons())); - connect(d->profileChooser, SIGNAL(activated(int)), - SLOT(updateButtons())); - //connect(d->updateListButton, SIGNAL(clicked()), - // SLOT(updateProcessList())); - connect(d->attachProcessButton, SIGNAL(clicked()), SLOT(attachToProcess())); - connect(&d->proxyModel, SIGNAL(layoutChanged()), - SLOT(handleProcessListUpdated())); - connect(d->deviceComboBox, SIGNAL(currentIndexChanged(int)), - SLOT(attachToDevice(int))); - updateButtons(); - attachToDevice(d->deviceComboBox->currentIndex()); - } + //connect(d->updateListButton, SIGNAL(clicked()), + // SLOT(updateProcessList())); + connect(d->attachProcessButton, SIGNAL(clicked()), SLOT(attachToProcess())); + connect(&d->proxyModel, SIGNAL(layoutChanged()), + SLOT(handleProcessListUpdated())); + connect(d->profileChooser, SIGNAL(currentIndexChanged(int)), + SLOT(attachToDevice())); + updateButtons(); + attachToDevice(); } StartGdbServerDialog::~StartGdbServerDialog() @@ -217,11 +201,9 @@ StartGdbServerDialog::~StartGdbServerDialog() delete d; } -void StartGdbServerDialog::attachToDevice(int modelIndex) +void StartGdbServerDialog::attachToDevice() { - LinuxDeviceConfiguration::ConstPtr device - = d->deviceManagerModel->device(modelIndex) - .dynamicCast(); + LinuxDeviceConfiguration::ConstPtr device = d->currentDevice(); // TODO: display error on non-matching device. if (!device) return; @@ -282,7 +264,6 @@ void StartGdbServerDialog::attachToProcess() } d->settings->setValue(LastProfile, d->profileChooser->currentProfileId().toString()); - d->settings->setValue(LastDevice, d->deviceComboBox->currentIndex()); d->settings->setValue(LastProcessName, d->processFilterLineEdit->text()); startGdbServerOnPort(port, process.pid); diff --git a/src/plugins/remotelinux/startgdbserverdialog.h b/src/plugins/remotelinux/startgdbserverdialog.h index 1842d282fc3..2bd0c367938 100644 --- a/src/plugins/remotelinux/startgdbserverdialog.h +++ b/src/plugins/remotelinux/startgdbserverdialog.h @@ -54,7 +54,7 @@ signals: void processAborted(); private slots: - void attachToDevice(int modelIndex); + void attachToDevice(); void handleRemoteError(const QString &errorMessage); void handleProcessListUpdated(); void updateProcessList(); diff --git a/tests/auto/debugger/tst_namedemangler.cpp b/tests/auto/debugger/tst_namedemangler.cpp index 01578704c79..5567f31c6da 100644 --- a/tests/auto/debugger/tst_namedemangler.cpp +++ b/tests/auto/debugger/tst_namedemangler.cpp @@ -174,6 +174,13 @@ void NameDemanglerAutoTest::testCorrectlyMangledNames() TEST_CORRECTLY_MANGLED_NAME("_Z9weirdfuncIiEvT_DtfL0p_E", "void weirdfunc(int, decltype({param#1}))"); TEST_CORRECTLY_MANGLED_NAME("_Z9weirdfuncIiEvT_S0_S0_", "void weirdfunc(int, int, int)"); TEST_CORRECTLY_MANGLED_NAME("_Z9weirdfuncIiEvT_S0_DtfL0p0_E", "void weirdfunc(int, int, decltype({param#2}))"); + TEST_CORRECTLY_MANGLED_NAME("_Z8toStringIiESsT_", + "std::basic_string, std::allocator > toString(int)"); + + // TODO: The rvalue reference at the end has to actually collapse. Remove it once collapsing + // is properly implemented. + TEST_CORRECTLY_MANGLED_NAME("_ZSt9make_pairIiRA5_KcESt4pairINSt17__decay_and_stripIT_E6__typeENS4_IT0_E6__typeEEOS5_OS8_", + "std::pair::__type, std::__decay_and_strip::__type> std::make_pair(int &&, char const (&)[5] &&)"); // All examples from the ABI spec. TEST_CORRECTLY_MANGLED_NAME("_ZN1S1xE", "S::x");