aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDawid Pakuła2018-04-29 20:21:26 -0400
committerDawid Pakula2018-05-15 12:27:35 -0400
commiteb2655b2e45f2133e4dd39b3e6af13a2e7c2b397 (patch)
tree5578dc3dca10db93b475a3a87c4dac80015fb4cd
parentcc9287f895a11f5f1def764644f880258c54e602 (diff)
downloadorg.eclipse.pdt-eb2655b2e45f2133e4dd39b3e6af13a2e7c2b397.zip
org.eclipse.pdt-eb2655b2e45f2133e4dd39b3e6af13a2e7c2b397.tar.gz
org.eclipse.pdt-eb2655b2e45f2133e4dd39b3e6af13a2e7c2b397.tar.xz
Bug 533101 - Support xDebug profiling
* Import xDebug CacheGrind file * Navigation support * Correct relation between flow and statistics * Stable call tree * PHP executable launch profiling support * XDebug profile trigger for web launch Change-Id: I0b35d83b635474f2843c21ee71ee7596cabc377a Signed-off-by: Dawid Pakuła <zulus@w3des.net>
-rw-r--r--features/org.eclipse.php.profiler-feature/feature.properties7
-rw-r--r--plugins/org.eclipse.php.core/src/org/eclipse/php/core/ast/nodes/MultipleTypeBinding.java233
-rw-r--r--plugins/org.eclipse.php.debug.core/src/org/eclipse/php/internal/debug/core/IPHPDebugConstants.java6
-rw-r--r--plugins/org.eclipse.php.debug.core/src/org/eclipse/php/internal/debug/core/PHPDebugCoreMessages.java409
-rw-r--r--plugins/org.eclipse.php.debug.core/src/org/eclipse/php/internal/debug/core/PHPDebugCoreMessages.properties363
-rw-r--r--plugins/org.eclipse.php.debug.core/src/org/eclipse/php/internal/debug/core/launching/PHPLaunchDelegateProxy.java30
-rw-r--r--plugins/org.eclipse.php.debug.core/src/org/eclipse/php/internal/debug/core/launching/PHPLaunchUtilities.java94
-rw-r--r--plugins/org.eclipse.php.debug.core/src/org/eclipse/php/internal/debug/core/launching/PHPProcess.java53
-rw-r--r--plugins/org.eclipse.php.debug.core/src/org/eclipse/php/internal/debug/core/launching/XDebugExeLaunchConfigurationDelegate.java51
-rw-r--r--plugins/org.eclipse.php.debug.core/src/org/eclipse/php/internal/debug/core/launching/XDebugWebLaunchConfigurationDelegate.java652
-rw-r--r--plugins/org.eclipse.php.debug.core/src/org/eclipse/php/internal/debug/core/zend/debugger/DebugParametersInitializersRegistry.java3
-rw-r--r--plugins/org.eclipse.php.debug.core/src/org/eclipse/php/internal/debug/core/zend/debugger/parameters/DefaultDebugParametersInitializer.java13
-rw-r--r--plugins/org.eclipse.php.profile.core/META-INF/MANIFEST.MF1
-rw-r--r--plugins/org.eclipse.php.profile.core/plugin.properties2
-rw-r--r--plugins/org.eclipse.php.profile.core/plugin.xml203
-rw-r--r--plugins/org.eclipse.php.profile.core/src/org/eclipse/php/profile/core/PHPProfileCoreMessages.java8
-rw-r--r--plugins/org.eclipse.php.profile.core/src/org/eclipse/php/profile/core/PHPProfileCoreMessages.properties9
-rw-r--r--plugins/org.eclipse.php.profile.core/src/org/eclipse/php/profile/core/PHPProfileCorePlugin.java7
-rw-r--r--plugins/org.eclipse.php.profile.core/src/org/eclipse/php/profile/core/data/ProfilerCallTrace.java4
-rw-r--r--plugins/org.eclipse.php.profile.core/src/org/eclipse/php/profile/core/data/ProfilerCallTraceLayer.java9
-rw-r--r--plugins/org.eclipse.php.profile.core/src/org/eclipse/php/profile/core/data/ProfilerFunctionData.java12
-rw-r--r--plugins/org.eclipse.php.profile.core/src/org/eclipse/php/profile/core/engine/PHPLaunchListener.java107
-rw-r--r--plugins/org.eclipse.php.profile.core/src/org/eclipse/php/profile/core/engine/ProfileParametersInitializer.java28
-rw-r--r--plugins/org.eclipse.php.profile.core/src/org/eclipse/php/profile/core/engine/ProfilerDataSerializationUtil.java10
-rw-r--r--plugins/org.eclipse.php.profile.core/src/org/eclipse/php/profile/core/engine/XProfiler.java71
-rw-r--r--plugins/org.eclipse.php.profile.core/src/org/eclipse/php/profile/core/engine/ZProfiler.java45
-rw-r--r--plugins/org.eclipse.php.profile.core/src/org/eclipse/php/profile/core/engine/cachegrind/CacheGrindModelParser.java405
-rw-r--r--plugins/org.eclipse.php.profile.core/src/org/eclipse/php/profile/core/engine/cachegrind/CacheGrindParser.java719
-rw-r--r--plugins/org.eclipse.php.profile.ui/plugin.xml2
-rw-r--r--plugins/org.eclipse.php.profile.ui/src/org/eclipse/php/profile/ui/PHPProfileUIMessages.properties5
-rw-r--r--plugins/org.eclipse.php.profile.ui/src/org/eclipse/php/profile/ui/ProfilerUIConstants.java3
-rw-r--r--plugins/org.eclipse.php.profile.ui/src/org/eclipse/php/profile/ui/actions/ExecutionFlowActionGroup.java5
-rw-r--r--plugins/org.eclipse.php.profile.ui/src/org/eclipse/php/profile/ui/launcher/AbstractPHPLaunchConfigurationProfilerTab.java42
-rw-r--r--plugins/org.eclipse.php.profile.ui/src/org/eclipse/php/profile/ui/launcher/AbstractProfileExeLaunchSettingsSection.java27
-rw-r--r--plugins/org.eclipse.php.profile.ui/src/org/eclipse/php/profile/ui/launcher/Messages.java5
-rw-r--r--plugins/org.eclipse.php.profile.ui/src/org/eclipse/php/profile/ui/launcher/XDebugProfileExeLaunchSettingsSection.java35
-rw-r--r--plugins/org.eclipse.php.profile.ui/src/org/eclipse/php/profile/ui/launcher/XDebugProfileWebLaunchSettingsSection.java69
-rw-r--r--plugins/org.eclipse.php.profile.ui/src/org/eclipse/php/profile/ui/launcher/ZendDebuggerProfileExeLaunchSettingsSection.java27
-rw-r--r--plugins/org.eclipse.php.profile.ui/src/org/eclipse/php/profile/ui/launcher/messages.properties3
-rw-r--r--plugins/org.eclipse.php.profile.ui/src/org/eclipse/php/profile/ui/preferences/PreferenceKeys.java1
-rw-r--r--plugins/org.eclipse.php.profile.ui/src/org/eclipse/php/profile/ui/utils/ProfileUITools.java10
-rw-r--r--plugins/org.eclipse.php.profile.ui/src/org/eclipse/php/profile/ui/views/ExecutionFlowView.java16
-rw-r--r--plugins/org.eclipse.php.profile.ui/src/org/eclipse/php/profile/ui/views/ExecutionStatisticsSorter.java6
-rw-r--r--plugins/org.eclipse.php.profile.ui/src/org/eclipse/php/profile/ui/views/ExecutionStatisticsView.java14
-rw-r--r--plugins/org.eclipse.php.profile.ui/src/org/eclipse/php/profile/ui/views/FunctionInvocationStatisticsView.java27
-rw-r--r--plugins/org.eclipse.php.profile.ui/src/org/eclipse/php/profile/ui/wizards/ImportSessionWizard.java12
-rw-r--r--plugins/org.eclipse.php.profile.ui/src/org/eclipse/php/profile/ui/wizards/ImportSessionWizardFirstPage.java56
-rw-r--r--plugins/org.eclipse.php.ui/src/org/eclipse/php/internal/ui/util/EditorUtility.java14
-rw-r--r--tests/org.eclipse.php.profile.core.tests/.classpath7
-rw-r--r--tests/org.eclipse.php.profile.core.tests/.project28
-rw-r--r--tests/org.eclipse.php.profile.core.tests/.settings/org.eclipse.jdt.core.prefs297
-rw-r--r--tests/org.eclipse.php.profile.core.tests/.settings/org.eclipse.jdt.ui.prefs113
-rw-r--r--tests/org.eclipse.php.profile.core.tests/META-INF/MANIFEST.MF17
-rw-r--r--tests/org.eclipse.php.profile.core.tests/build.properties7
-rw-r--r--tests/org.eclipse.php.profile.core.tests/plugin.properties3
-rw-r--r--tests/org.eclipse.php.profile.core.tests/pom.xml37
-rw-r--r--tests/org.eclipse.php.profile.core.tests/resources/cachegrind/profile_header.0134
-rw-r--r--tests/org.eclipse.php.profile.core.tests/src/org/eclipse/php/profile/core/test/Activator.java69
-rw-r--r--tests/org.eclipse.php.profile.core.tests/src/org/eclipse/php/profile/core/test/AllTests.java27
-rw-r--r--tests/org.eclipse.php.profile.core.tests/src/org/eclipse/php/profile/core/test/cachegrind/CacheGrindModelTest.java15
-rw-r--r--tests/org.eclipse.php.profile.core.tests/src/org/eclipse/php/profile/core/test/cachegrind/CacheGrindParserTest.java274
-rw-r--r--tests/org.eclipse.php.profile.core.tests/test.xml40
-rw-r--r--tests/pom.xml1
63 files changed, 3677 insertions, 1225 deletions
diff --git a/features/org.eclipse.php.profiler-feature/feature.properties b/features/org.eclipse.php.profiler-feature/feature.properties
index 4045499..93a7bac 100644
--- a/features/org.eclipse.php.profiler-feature/feature.properties
+++ b/features/org.eclipse.php.profiler-feature/feature.properties
@@ -15,17 +15,17 @@
# This file should be translated.
# "featureName" property - name of the feature
-featureName=PHP Development Tools (PDT) Zend Profiler Support
+featureName=PHP Development Tools (PDT) Zend and xDebug Profiler Support
# "providerName" property - name of the company that provides the feature
providerName=Eclipse PDT
# "description" property - description of the feature
-description=This feature provides Zend Profiler Support for PDT.
+description=This feature provides Zend and xDebug Profiler Support for PDT.
# "copyright" property - text of the "Feature Update Copyright"
copyright=\
-Copyright (c) 2017 Rogue Wave Software Inc. and others.\n\
+Copyright (c) 2018 Rogue Wave Software Inc. and others.\n\
All rights reserved. This program and the accompanying materials\n\
are made available under the terms of the Eclipse Public License v1.0\n\
which accompanies this distribution, and is available at\n\
@@ -33,4 +33,5 @@ http://www.eclipse.org/legal/epl-v10.html\n\
\n\
Contributors:\n\
Rogue Wave Software Inc. - initial API and implementation\n
+ Dawid Pakula -xDebug support
################ end of copyright property ####################################
diff --git a/plugins/org.eclipse.php.core/src/org/eclipse/php/core/ast/nodes/MultipleTypeBinding.java b/plugins/org.eclipse.php.core/src/org/eclipse/php/core/ast/nodes/MultipleTypeBinding.java
new file mode 100644
index 0000000..277ca16
--- /dev/null
+++ b/plugins/org.eclipse.php.core/src/org/eclipse/php/core/ast/nodes/MultipleTypeBinding.java
@@ -0,0 +1,233 @@
+package org.eclipse.php.core.ast.nodes;
+
+import java.util.Arrays;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+
+import org.eclipse.dltk.core.IModelElement;
+import org.eclipse.dltk.core.IType;
+import org.eclipse.dltk.ti.types.IEvaluatedType;
+
+public class MultipleTypeBinding implements ITypeBinding {
+ private final static IVariableBinding[] NO_VARIABLES = new IVariableBinding[0];
+ private final static IMethodBinding[] NO_METHODS = new IMethodBinding[0];
+ private ITypeBinding[] subTypes;
+ private IVariableBinding[] fields;
+ private IMethodBinding[] methods;
+ private IEvaluatedType type;
+ private int modifiers = -1;
+ private ITypeBinding[] interfaces;
+
+ public MultipleTypeBinding(IEvaluatedType type, ITypeBinding[] subTypes) {
+ this.type = type;
+ this.subTypes = subTypes;
+ }
+
+ @Override
+ public int getKind() {
+ return ITypeBinding.TYPE;
+ }
+
+ @Override
+ public boolean isDeprecated() {
+ for (ITypeBinding binding : subTypes) {
+ if (binding.isDeprecated()) {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ @Override
+ public IModelElement getPHPElement() {
+ IModelElement element;
+ for (ITypeBinding binding : subTypes) {
+ element = binding.getPHPElement();
+ if (element != null) {
+ return element;
+ }
+ }
+ return null;
+ }
+
+ @Override
+ public String getKey() {
+ StringBuilder sb = new StringBuilder("mutli_");
+ for (ITypeBinding binding : subTypes) {
+ sb.append(binding.getKey());
+ }
+ return null;
+ }
+
+ @Override
+ public ITypeBinding createArrayType(int dimension) {
+ return null;
+ }
+
+ @Override
+ public String getBinaryName() {
+ if (isUnknown() || isAmbiguous()) {
+ return null;
+ }
+ return getKey();
+ }
+
+ @Override
+ public ITypeBinding getComponentType() {
+ if (!isArray()) {
+ return null;
+ }
+ // TODO - This should be implemented as soon as the we will be able to
+ // identify the types that
+ // the array is holding.
+ // Once we have that, we can return a TypeBinding or a
+ // CompositeTypeBinding for multiple types array.
+ return null;
+ }
+
+ @Override
+ public IVariableBinding[] getDeclaredFields() {
+
+ if (fields == null) {
+ if (isUnknown()) {
+ fields = NO_VARIABLES;
+ } else {
+ Set<IVariableBinding> tmp = new HashSet<>();
+ for (ITypeBinding binging : subTypes) {
+ tmp.addAll(Arrays.asList(binging.getDeclaredFields()));
+ }
+ fields = tmp.toArray(NO_VARIABLES);
+ }
+ }
+
+ return fields;
+ }
+
+ @Override
+ public IMethodBinding[] getDeclaredMethods() {
+ if (methods == null) {
+ if (isUnknown()) {
+ methods = NO_METHODS;
+ } else {
+ Set<IMethodBinding> tmp = new HashSet<>();
+ for (ITypeBinding binging : subTypes) {
+ tmp.addAll(Arrays.asList(binging.getDeclaredMethods()));
+ }
+ methods = tmp.toArray(NO_METHODS);
+ }
+ }
+
+ return methods;
+ }
+
+ @Override
+ public int getModifiers() {
+ int mods = 0;
+ for (ITypeBinding type : subTypes) {
+ mods = mods | type.getModifiers();
+ }
+ return 0;
+ }
+
+ @Override
+ public int getDimensions() {
+ return 0;
+ }
+
+ @Override
+ public ITypeBinding getElementType() {
+ return null;
+ }
+
+ @Override
+ public ITypeBinding[] getInterfaces() {
+ return null;
+ }
+
+ @Override
+ public String getName() {
+ return subTypes[0].getName();
+ }
+
+ @Override
+ public IEvaluatedType getEvaluatedType() {
+ return null;
+ }
+
+ @Override
+ public ITypeBinding getSuperclass() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public ITypeBinding getTypeDeclaration() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public boolean isArray() {
+ // TODO Auto-generated method stub
+ return false;
+ }
+
+ @Override
+ public boolean isClass() {
+ // TODO Auto-generated method stub
+ return false;
+ }
+
+ @Override
+ public boolean isTrait() {
+ // TODO Auto-generated method stub
+ return false;
+ }
+
+ @Override
+ public boolean isInterface() {
+ // TODO Auto-generated method stub
+ return false;
+ }
+
+ @Override
+ public boolean isNullType() {
+ // TODO Auto-generated method stub
+ return false;
+ }
+
+ @Override
+ public boolean isPrimitive() {
+ // TODO Auto-generated method stub
+ return false;
+ }
+
+ @Override
+ public boolean isSubTypeCompatible(ITypeBinding type) {
+ return false;
+ }
+
+ @Override
+ public boolean isAmbiguous() {
+ return true;
+ }
+
+ @Override
+ public boolean isUnknown() {
+ return false;
+ }
+
+ @Override
+ public List<IType> getTraitList(boolean isMethod, String classMemberName, boolean includeSuper) {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public IModelElement[] getPHPElements() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+}
diff --git a/plugins/org.eclipse.php.debug.core/src/org/eclipse/php/internal/debug/core/IPHPDebugConstants.java b/plugins/org.eclipse.php.debug.core/src/org/eclipse/php/internal/debug/core/IPHPDebugConstants.java
index bd79b94..8256d32 100644
--- a/plugins/org.eclipse.php.debug.core/src/org/eclipse/php/internal/debug/core/IPHPDebugConstants.java
+++ b/plugins/org.eclipse.php.debug.core/src/org/eclipse/php/internal/debug/core/IPHPDebugConstants.java
@@ -39,6 +39,8 @@ public interface IPHPDebugConstants {
String RUN_WITH_DEBUG_INFO = ID_PHP_DEBUG_CORE + ".RunWithDebugInfo"; //$NON-NLS-1$
String OPEN_IN_BROWSER = ID_PHP_DEBUG_CORE + ".OpenInBrowser"; //$NON-NLS-1$
+ String CacheGrind_File = ID_PHP_DEBUG_CORE + ".CacheGrind_File"; //$NON-NLS-1$
+
String PHPEXELaunchType = "org.eclipse.php.debug.core.launching.PHPExeLaunchConfigurationType"; //$NON-NLS-1$
String PHPServerLaunchType = "org.eclipse.php.debug.core.launching.webPageLaunch"; //$NON-NLS-1$
String PHPRemoteLaunchType = "org.eclipse.php.debug.core.remotePHPLaunchConfigurationType"; //$NON-NLS-1$
@@ -85,4 +87,8 @@ public interface IPHPDebugConstants {
String DEBUGGING_COLLECT_CODE_COVERAGE = "collectCodeCoverage"; //$NON-NLS-1$
String PREF_STEP_FILTERS_LIST = ID_PHP_DEBUG_CORE + ".pref_step_filters_list"; //$NON-NLS-1$
+
+ // TODO: Keep this in profile plugin
+ String XDEBUG_PROFILE_TRIGGER = ID_PHP_DEBUG_CORE + ".XDebugProfileTrigger"; //$NON-NLS-1$
+ String XDEBUG_PROFILE_TRIGGER_VALUE = ID_PHP_DEBUG_CORE + ".XDebugProfileTriggerValue"; //$NON-NLS-1$
}
diff --git a/plugins/org.eclipse.php.debug.core/src/org/eclipse/php/internal/debug/core/PHPDebugCoreMessages.java b/plugins/org.eclipse.php.debug.core/src/org/eclipse/php/internal/debug/core/PHPDebugCoreMessages.java
index 4bd4643..80ba953 100644
--- a/plugins/org.eclipse.php.debug.core/src/org/eclipse/php/internal/debug/core/PHPDebugCoreMessages.java
+++ b/plugins/org.eclipse.php.debug.core/src/org/eclipse/php/internal/debug/core/PHPDebugCoreMessages.java
@@ -1,204 +1,205 @@
-/*******************************************************************************
- * Copyright (c) 2009 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- * Zend Technologies
- *******************************************************************************/
-package org.eclipse.php.internal.debug.core;
-
-import org.eclipse.osgi.util.NLS;
-
-/**
- * Strings used by PHP Debugger Core
- *
- */
-public class PHPDebugCoreMessages extends NLS {
-
- private static final String BUNDLE_NAME = "org.eclipse.php.internal.debug.core.PHPDebugCoreMessages"; //$NON-NLS-1$
-
- public static String LineBreakPointMessage_1;
- public static String ConditionalBreakPointMessage_1;
- public static String ConditionalBreakPointMessage_2;
- public static String DBGpMultiSessionTarget_Multisession_PHP_process;
- public static String DBGpProxyConnection_Registering_DBGp_proxy;
- public static String DebuggerFileNotFound_1;
- public static String DebuggerDebugPortInUse_1;
- public static String DebuggerConnection_Problem_1;
- public static String DebuggerConnection_Problem_2;
- public static String DebuggerConnection_Problem_3;
- public static String DebuggerConnection_Problem_4;
- public static String DebuggerConnection_Problem_5;
- public static String DebuggerConnection_Failed_1;
- public static String Debugger_Unexpected_Error_1;
- public static String Debugger_ResourceNotFound;
- public static String Debugger_LaunchError_title;
- public static String Debugger_InvalidDebugResource;
- public static String Debugger_General_Error;
- public static String Debugger_Launch_Error;
- public static String Debugger_Error_Message;
- public static String Debugger_Error_Message_2;
- public static String Debugger_Error_Message_3;
- public static String Debugger_Error_Crash_Message;
- public static String Debugger_Incompatible_Protocol;
- public static String PHPDebugPlugin_PerformingPostStartupOperations;
- public static String PHPDebugPlugin_PostStartup;
- public static String PHPExecutableDebuggerInitializer_6;
- public static String PHPExecutableDebuggerInitializer_7;
- public static String PHPExecutableLaunchDelegate_0;
- public static String PHPExecutableLaunchDelegate_4;
- public static String PHPLaunchUtilities_0;
- public static String PHPLaunchUtilities_7;
- public static String PHPLaunchUtilities_8;
- public static String PHPLaunchUtilities_activeLaunchDetected;
- public static String PHPLaunchUtilities_confirmation;
- public static String PHPLaunchUtilities_multipleLaunchesPrompt;
- public static String PHPLaunchUtilities_phpLaunchTitle;
- public static String PHPLaunchUtilities_rememberDecision;
- public static String PHPLaunchUtilities_PHPPerspectiveSwitchTitle;
- public static String PHPLaunchUtilities_PHPPerspectiveSwitchMessage;
- public static String PHPLaunchUtilities_terminate;
- public static String PHPLaunchUtilities_waitingForDebugger;
- public static String PHPWebPageLaunchDelegate_DialogError;
- public static String PHPWebPageLaunchDelegate_DialogErrorDebug;
- public static String PHPWebPageLaunchDelegate_DialogErrorProfile;
- public static String PHPWebPageLaunchDelegate_DialogErrorRun;
- public static String PHPWebPageLaunchDelegate_serverNotFound;
- public static String DebugConfigurationDialog_invalidPortRange;
- public static String DebugConfigurationDialog_invalidPort;
- public static String DebugConfigurationDialog_PortInUse;
- public static String DebuggerConfigurationDialog_debugPort;
- public static String DebuggerConfigurationDialog_invalidPortRange;
- public static String ServerDebugHandler_0;
- public static String ZendDebuggerConfiguration_ZendDebuggerNotInstalledError;
- public static String ZendDebuggerConfigurationDialog_AutoMode;
- public static String ZendDebuggerConfigurationDialog_Broadcast_port;
- public static String ZendDebuggerConfigurationDialog_client_host_ip;
- public static String ZendDebuggerConfigurationDialog_Connection_settings_group;
- public static String ZendDebuggerConfigurationDialog_debug_response_timeout;
- public static String ZendDebuggerConfigurationDialog_Dialog_description;
- public static String ZendDebuggerConfigurationDialog_Dialog_title;
- public static String ZendDebuggerConfigurationDialog_Dummy_file_name;
- public static String ZendDebuggerConfigurationDialog_General_settings_group;
- public static String ZendDebuggerConfigurationDialog_invalid_response_time;
- public static String ZendDebuggerConfigurationDialog_invalid_response_time_exc;
- public static String ZendDebuggerConfigurationDialog_ManualMode;
- public static String ZendDebuggerConfigurationDialog_Note_label;
- public static String ZendDebuggerConfigurationDialog_Note_text;
- public static String ZendDebuggerConfigurationDialog_runWithDebugInfo;
- public static String ZendDebuggerConfigurationDialog_useNewProtocol;
- public static String ZendDebuggerConfigurationDialog_zendDebuggerSettings;
- public static String ZendDebuggerConfigurationDialog_UseSSLEncryption;
- public static String ZendDebuggerConfigurationDialog_Reload;
- public static String ZendDebuggerConfigurationDialog_Configure;
- public static String ZendDebuggerConfigurationDialog_ClientIPWarning;
- public static String ZendDebuggerConfigurationDialog_ClientIPsWarning;
- public static String XDebugCommunicationDaemon_Dont_show_this_message_again;
- public static String XDebugCommunicationDaemon_Remote_debug_session_does_not_refer_to_localhost;
- public static String XDebugCommunicationDaemon_Remote_debug_session_for_localhost;
- public static String XDebugCommunicationDaemon_XDebug_remote_session_title;
- public static String XDebugConfigurationDialog_mainTitle;
- public static String XDebugConfigurationDialog_generalGroup;
- public static String XDebugConfigurationDialog_captureGroup;
- public static String XDebugConfigurationDialog_proxyGroup;
- public static String XDebugConfigurationDialog_invalidTimeout;
- public static String XDebugConfigurationDialog_invalidTimeoutValue;
- public static String XDebugConfigurationDialog_useExtendedProperties;
- public static String XDebugConfigurationDialog_maxArrayDepth;
- public static String XDebugConfigurationDialog_maxChildren;
- public static String XDebugConfigurationDialog_showSuperGlobals;
- public static String XDebugConfigurationDialog_useMultisession;
- public static String XDebugConfigurationDialog_remoteSession;
- public static String XDebugConfigurationDialog_remoteSessionOption_off;
- public static String XDebugConfigurationDialog_remoteSessionOption_localhost;
- public static String XDebugConfigurationDialog_remoteSessionOption_any;
- public static String XDebugConfigurationDialog_remoteSessionOption_prompt;
- public static String XDebugConfigurationDialog_captureStdout;
- public static String XDebugConfigurationDialog_captureStderr;
- public static String XDebugConfigurationDialog_capture_off;
- public static String XDebugConfigurationDialog_capture_copy;
- public static String XDebugConfigurationDialog_capture_redirect;
- public static String XDebugConfigurationDialog_Connection_settings_group;
- public static String XDebugConfigurationDialog_Dialog_description;
- public static String XDebugConfigurationDialog_Dialog_title;
- public static String XDebugConfigurationDialog_General_settings_group;
- public static String XDebugConfigurationDialog_useProxy;
- public static String XDebugConfigurationDialog_idekey;
- public static String XDebugConfigurationDialog_MaxData;
- public static String XDebugConfigurationDialog_Note_label;
- public static String XDebugConfigurationDialog_Note_text;
- public static String XDebugConfigurationDialog_proxy;
- public static String XDebugMessage_debugError;
- public static String XDebugMessage_unexpectedTermination;
- public static String XDebugMessage_remoteSessionTitle;
- public static String XDebugMessage_remoteSessionPrompt;
- public static String XDebug_DBGpProxyHandler_0;
- public static String XDebug_DBGpProxyHandler_1;
- public static String XDebug_DBGpProxyHandler_2;
- public static String XDebug_DBGpProxyHandler_3;
- public static String XDebug_ExeLaunchConfigurationDelegate_0;
- public static String XDebug_ExeLaunchConfigurationDelegate_1;
- public static String XDebug_ExeLaunchConfigurationDelegate_2;
- public static String XDebug_ExeLaunchConfigurationDelegate_3;
- public static String XDebug_ExeLaunchConfigurationDelegate_4;
- public static String XDebug_WebLaunchConfigurationDelegate_0;
- public static String XDebug_WebLaunchConfigurationDelegate_1;
- public static String XDebug_WebLaunchConfigurationDelegate_2;
- public static String XDebug_WebLaunchConfigurationDelegate_3;
- public static String XDebug_WebLaunchConfigurationDelegate_4;
- public static String XDebug_DBGpTarget_0;
- public static String XDebug_DBGpTarget_1;
- public static String XDebug_DBGpTarget_2;
- public static String XDebug_DBGpContainerValue_0;
- public static String XDebug_DBGpMultiSessionTarget_0;
- public static String XDebug_DBGpStackFrame_0;
- public static String XDebug_DBGpStringValue_0;
- public static String XDebug_DBGpThread_0;
- public static String XDebug_DBGpVariable_0;
- public static String XDebug_DBGpVariable_1;
- public static String XDebug_IDBGpModelConstants_0;
- public static String XDebug_IDBGpModelConstants_1;
- public static String NoneDebuggerConfiguration_Launching;
- public static String NoneDebuggerConfiguration_PHP_executable_file_is_invalid;
- public static String NoneDebuggerConfiguration_PHP_script_file_is_invalid;
- public static String NoneDebuggerConfiguration_PHP_source_file_is_invalid;
- public static String NoneDebuggerConfiguration_There_is_no_debugger_attached_for_PHP_executable;
- public static String NoneDebuggerConfiguration_There_is_no_debugger_attached_for_PHP_server;
- public static String NoneDebuggerConfiguration_There_is_no_PHP_runtime_environment;
- public static String NoneDebuggerConfiguration_There_is_no_PHP_server_specified;
- public static String ExeLaunchConfigurationDelegate_PortInUse;
- public static String WebLaunchConfigurationDelegate_PortInUse;
- public static String XDebugDebuggerConfiguration_XDebugNotEnabledError;
- public static String XDebugDebuggerConfiguration_XDebugNotInstalledError;
- public static String XDebugWebLaunchConfigurationDelegate_PHP_process;
- public static String PHPProcess_Zend_Debugger_suffix;
- public static String PHPProcess_XDebug_suffix;
- public static String RemoteDebugger_LicenseError;
- public static String RemoteDebugger_WarnNoneI5;
- public static String RemoteDebugger_RequestFileFromServer;
- public static String ConfigureHostsDialog_Address_could_not_be_detected;
- public static String ConfigureHostsDialog_Down_button;
- public static String ConfigureHostsDialog_Up_button;
- public static String ConfigureHostsDialog_Address_column;
- public static String ConfigureHostsDialog_Cancel_button;
- public static String ConfigureHostsDialog_Configure_client_IPs;
- public static String ConfigureHostsDialog_Deselect_all_button;
- public static String ConfigureHostsDialog_OK_button;
- public static String ConfigureHostsDialog_Reset_button;
- public static String ConfigureHostsDialog_Select_all_button;
- public static String ConfigureHostsDialog_Select_addresses;
- public static String ConfigureHostsDialog_Type_column;
-
- static {
- // load message values from bundle file
- NLS.initializeMessages(BUNDLE_NAME, PHPDebugCoreMessages.class);
- }
-
- private PHPDebugCoreMessages() {
- // cannot create new instance
- }
-}
+/*******************************************************************************
+ * Copyright (c) 2009 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ * Zend Technologies
+ *******************************************************************************/
+package org.eclipse.php.internal.debug.core;
+
+import org.eclipse.osgi.util.NLS;
+
+/**
+ * Strings used by PHP Debugger Core
+ *
+ */
+public class PHPDebugCoreMessages extends NLS {
+
+ private static final String BUNDLE_NAME = "org.eclipse.php.internal.debug.core.PHPDebugCoreMessages"; //$NON-NLS-1$
+
+ public static String LineBreakPointMessage_1;
+ public static String ConditionalBreakPointMessage_1;
+ public static String ConditionalBreakPointMessage_2;
+ public static String DBGpMultiSessionTarget_Multisession_PHP_process;
+ public static String DBGpProxyConnection_Registering_DBGp_proxy;
+ public static String DebuggerFileNotFound_1;
+ public static String DebuggerDebugPortInUse_1;
+ public static String DebuggerConnection_Problem_1;
+ public static String DebuggerConnection_Problem_2;
+ public static String DebuggerConnection_Problem_3;
+ public static String DebuggerConnection_Problem_4;
+ public static String DebuggerConnection_Problem_5;
+ public static String DebuggerConnection_Failed_1;
+ public static String Debugger_Unexpected_Error_1;
+ public static String Debugger_ResourceNotFound;
+ public static String Debugger_LaunchError_title;
+ public static String Debugger_InvalidDebugResource;
+ public static String Debugger_General_Error;
+ public static String Debugger_Launch_Error;
+ public static String Debugger_Error_Message;
+ public static String Debugger_Error_Message_2;
+ public static String Debugger_Error_Message_3;
+ public static String Debugger_Error_Crash_Message;
+ public static String Debugger_Incompatible_Protocol;
+ public static String PHPDebugPlugin_PerformingPostStartupOperations;
+ public static String PHPDebugPlugin_PostStartup;
+ public static String PHPExecutableDebuggerInitializer_6;
+ public static String PHPExecutableDebuggerInitializer_7;
+ public static String PHPExecutableLaunchDelegate_0;
+ public static String PHPExecutableLaunchDelegate_4;
+ public static String PHPLaunchUtilities_0;
+ public static String PHPLaunchUtilities_7;
+ public static String PHPLaunchUtilities_8;
+ public static String PHPLaunchUtilities_activeLaunchDetected;
+ public static String PHPLaunchUtilities_confirmation;
+ public static String PHPLaunchUtilities_multipleLaunchesPrompt;
+ public static String PHPLaunchUtilities_phpLaunchTitle;
+ public static String PHPLaunchUtilities_rememberDecision;
+ public static String PHPLaunchUtilities_PHPPerspectiveSwitchTitle;
+ public static String PHPLaunchUtilities_PHPPerspectiveSwitchMessage;
+ public static String PHPLaunchUtilities_terminate;
+ public static String PHPLaunchUtilities_waitingForDebugger;
+ public static String PHPWebPageLaunchDelegate_DialogError;
+ public static String PHPWebPageLaunchDelegate_DialogErrorDebug;
+ public static String PHPWebPageLaunchDelegate_DialogErrorProfile;
+ public static String PHPWebPageLaunchDelegate_DialogErrorRun;
+ public static String PHPWebPageLaunchDelegate_serverNotFound;
+ public static String DebugConfigurationDialog_invalidPortRange;
+ public static String DebugConfigurationDialog_invalidPort;
+ public static String DebugConfigurationDialog_PortInUse;
+ public static String DebuggerConfigurationDialog_debugPort;
+ public static String DebuggerConfigurationDialog_invalidPortRange;
+ public static String ServerDebugHandler_0;
+ public static String ZendDebuggerConfiguration_ZendDebuggerNotInstalledError;
+ public static String ZendDebuggerConfigurationDialog_AutoMode;
+ public static String ZendDebuggerConfigurationDialog_Broadcast_port;
+ public static String ZendDebuggerConfigurationDialog_client_host_ip;
+ public static String ZendDebuggerConfigurationDialog_Connection_settings_group;
+ public static String ZendDebuggerConfigurationDialog_debug_response_timeout;
+ public static String ZendDebuggerConfigurationDialog_Dialog_description;
+ public static String ZendDebuggerConfigurationDialog_Dialog_title;
+ public static String ZendDebuggerConfigurationDialog_Dummy_file_name;
+ public static String ZendDebuggerConfigurationDialog_General_settings_group;
+ public static String ZendDebuggerConfigurationDialog_invalid_response_time;
+ public static String ZendDebuggerConfigurationDialog_invalid_response_time_exc;
+ public static String ZendDebuggerConfigurationDialog_ManualMode;
+ public static String ZendDebuggerConfigurationDialog_Note_label;
+ public static String ZendDebuggerConfigurationDialog_Note_text;
+ public static String ZendDebuggerConfigurationDialog_runWithDebugInfo;
+ public static String ZendDebuggerConfigurationDialog_useNewProtocol;
+ public static String ZendDebuggerConfigurationDialog_zendDebuggerSettings;
+ public static String ZendDebuggerConfigurationDialog_UseSSLEncryption;
+ public static String ZendDebuggerConfigurationDialog_Reload;
+ public static String ZendDebuggerConfigurationDialog_Configure;
+ public static String ZendDebuggerConfigurationDialog_ClientIPWarning;
+ public static String ZendDebuggerConfigurationDialog_ClientIPsWarning;
+ public static String XDebugCommunicationDaemon_Dont_show_this_message_again;
+ public static String XDebugCommunicationDaemon_Remote_debug_session_does_not_refer_to_localhost;
+ public static String XDebugCommunicationDaemon_Remote_debug_session_for_localhost;
+ public static String XDebugCommunicationDaemon_XDebug_remote_session_title;
+ public static String XDebugConfigurationDialog_mainTitle;
+ public static String XDebugConfigurationDialog_generalGroup;
+ public static String XDebugConfigurationDialog_captureGroup;
+ public static String XDebugConfigurationDialog_proxyGroup;
+ public static String XDebugConfigurationDialog_invalidTimeout;
+ public static String XDebugConfigurationDialog_invalidTimeoutValue;
+ public static String XDebugConfigurationDialog_useExtendedProperties;
+ public static String XDebugConfigurationDialog_maxArrayDepth;
+ public static String XDebugConfigurationDialog_maxChildren;
+ public static String XDebugConfigurationDialog_showSuperGlobals;
+ public static String XDebugConfigurationDialog_useMultisession;
+ public static String XDebugConfigurationDialog_remoteSession;
+ public static String XDebugConfigurationDialog_remoteSessionOption_off;
+ public static String XDebugConfigurationDialog_remoteSessionOption_localhost;
+ public static String XDebugConfigurationDialog_remoteSessionOption_any;
+ public static String XDebugConfigurationDialog_remoteSessionOption_prompt;
+ public static String XDebugConfigurationDialog_captureStdout;
+ public static String XDebugConfigurationDialog_captureStderr;
+ public static String XDebugConfigurationDialog_capture_off;
+ public static String XDebugConfigurationDialog_capture_copy;
+ public static String XDebugConfigurationDialog_capture_redirect;
+ public static String XDebugConfigurationDialog_Connection_settings_group;
+ public static String XDebugConfigurationDialog_Dialog_description;
+ public static String XDebugConfigurationDialog_Dialog_title;
+ public static String XDebugConfigurationDialog_General_settings_group;
+ public static String XDebugConfigurationDialog_useProxy;
+ public static String XDebugConfigurationDialog_idekey;
+ public static String XDebugConfigurationDialog_MaxData;
+ public static String XDebugConfigurationDialog_Note_label;
+ public static String XDebugConfigurationDialog_Note_text;
+ public static String XDebugConfigurationDialog_proxy;
+ public static String XDebugMessage_debugError;
+ public static String XDebugMessage_unexpectedTermination;
+ public static String XDebugMessage_remoteSessionTitle;
+ public static String XDebugMessage_remoteSessionPrompt;
+ public static String XDebug_DBGpProxyHandler_0;
+ public static String XDebug_DBGpProxyHandler_1;
+ public static String XDebug_DBGpProxyHandler_2;
+ public static String XDebug_DBGpProxyHandler_3;
+ public static String XDebug_ExeLaunchConfigurationDelegate_0;
+ public static String XDebug_ExeLaunchConfigurationDelegate_1;
+ public static String XDebug_ExeLaunchConfigurationDelegate_2;
+ public static String XDebug_ExeLaunchConfigurationDelegate_3;
+ public static String XDebug_ExeLaunchConfigurationDelegate_4;
+ public static String XDebug_ExeLaunchConfigurationDelegate_5;
+ public static String XDebug_WebLaunchConfigurationDelegate_0;
+ public static String XDebug_WebLaunchConfigurationDelegate_1;
+ public static String XDebug_WebLaunchConfigurationDelegate_2;
+ public static String XDebug_WebLaunchConfigurationDelegate_3;
+ public static String XDebug_WebLaunchConfigurationDelegate_4;
+ public static String XDebug_DBGpTarget_0;
+ public static String XDebug_DBGpTarget_1;
+ public static String XDebug_DBGpTarget_2;
+ public static String XDebug_DBGpContainerValue_0;
+ public static String XDebug_DBGpMultiSessionTarget_0;
+ public static String XDebug_DBGpStackFrame_0;
+ public static String XDebug_DBGpStringValue_0;
+ public static String XDebug_DBGpThread_0;
+ public static String XDebug_DBGpVariable_0;
+ public static String XDebug_DBGpVariable_1;
+ public static String XDebug_IDBGpModelConstants_0;
+ public static String XDebug_IDBGpModelConstants_1;
+ public static String NoneDebuggerConfiguration_Launching;
+ public static String NoneDebuggerConfiguration_PHP_executable_file_is_invalid;
+ public static String NoneDebuggerConfiguration_PHP_script_file_is_invalid;
+ public static String NoneDebuggerConfiguration_PHP_source_file_is_invalid;
+ public static String NoneDebuggerConfiguration_There_is_no_debugger_attached_for_PHP_executable;
+ public static String NoneDebuggerConfiguration_There_is_no_debugger_attached_for_PHP_server;
+ public static String NoneDebuggerConfiguration_There_is_no_PHP_runtime_environment;
+ public static String NoneDebuggerConfiguration_There_is_no_PHP_server_specified;
+ public static String ExeLaunchConfigurationDelegate_PortInUse;
+ public static String WebLaunchConfigurationDelegate_PortInUse;
+ public static String XDebugDebuggerConfiguration_XDebugNotEnabledError;
+ public static String XDebugDebuggerConfiguration_XDebugNotInstalledError;
+ public static String XDebugWebLaunchConfigurationDelegate_PHP_process;
+ public static String PHPProcess_Zend_Debugger_suffix;
+ public static String PHPProcess_XDebug_suffix;
+ public static String RemoteDebugger_LicenseError;
+ public static String RemoteDebugger_WarnNoneI5;
+ public static String RemoteDebugger_RequestFileFromServer;
+ public static String ConfigureHostsDialog_Address_could_not_be_detected;
+ public static String ConfigureHostsDialog_Down_button;
+ public static String ConfigureHostsDialog_Up_button;
+ public static String ConfigureHostsDialog_Address_column;
+ public static String ConfigureHostsDialog_Cancel_button;
+ public static String ConfigureHostsDialog_Configure_client_IPs;
+ public static String ConfigureHostsDialog_Deselect_all_button;
+ public static String ConfigureHostsDialog_OK_button;
+ public static String ConfigureHostsDialog_Reset_button;
+ public static String ConfigureHostsDialog_Select_all_button;
+ public static String ConfigureHostsDialog_Select_addresses;
+ public static String ConfigureHostsDialog_Type_column;
+
+ static {
+ // load message values from bundle file
+ NLS.initializeMessages(BUNDLE_NAME, PHPDebugCoreMessages.class);
+ }
+
+ private PHPDebugCoreMessages() {
+ // cannot create new instance
+ }
+}
diff --git a/plugins/org.eclipse.php.debug.core/src/org/eclipse/php/internal/debug/core/PHPDebugCoreMessages.properties b/plugins/org.eclipse.php.debug.core/src/org/eclipse/php/internal/debug/core/PHPDebugCoreMessages.properties
index 9f1cb4c..07dded0 100644
--- a/plugins/org.eclipse.php.debug.core/src/org/eclipse/php/internal/debug/core/PHPDebugCoreMessages.properties
+++ b/plugins/org.eclipse.php.debug.core/src/org/eclipse/php/internal/debug/core/PHPDebugCoreMessages.properties
@@ -1,182 +1,183 @@
-###############################################################################
-# Copyright (c) 2009 IBM Corporation and others.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# IBM Corporation - initial API and implementation
-# Zend Technologies
-###############################################################################
-LineBreakPointMessage_1=Line Breakpoint: {0} [line: {1} ]
-ConditionalBreakPointMessage_1=Conditional Breakpoint: {0} [line: {1} ]
-ConditionalBreakPointMessage_2=\nCondition: {0}
-DBGpMultiSessionTarget_Multisession_PHP_process=Multisession PHP Process
-DBGpProxyConnection_Registering_DBGp_proxy=Registering with DBGp Proxy...
-DebuggerFileNotFound_1=Debugger didn't find file to debug.
-DebuggerConnection_Problem_1=Unable to connect to Web Server. The server might not have been started.
-DebuggerDebugPortInUse_1=Debug Port already in use. Enter a different Debug Port number in the Installed Debuggers preferences page (PHP|Debug|Installed Debuggers).
-DebuggerConnection_Problem_2=Unexpected response by Web Server.
-DebuggerConnection_Problem_3=Could not connect to the specified Debug Server.\nEnsure the Host Name/IP is correct and that the specified server is accessible by your client.
-DebuggerConnection_Problem_4=Unknown host:
-DebuggerConnection_Problem_5=Unable to connect to URL:
-DebuggerConnection_Failed_1=Connection Failed:\n Could not open the URL: ''{0}''\n Please verify that the file ''{1}'' exists under the server''s document root.
-Debugger_Unexpected_Error_1=Unexpected error. See error log for more information.
-Debugger_ResourceNotFound=Could not find the resource {0}.
-Debugger_InvalidDebugResource={0} is an invalid debugging resource.
-Debugger_LaunchError_title=Launch Error
-Debugger_General_Error=Error
-Debugger_Launch_Error=Launch Error - Session Terminated
-Debugger_Error_Message=Error while communicating with the debugger.\nPossible causes:\n 1. The Zend Debugger was not properly installed.\n 2. You are not using the latest Zend Debugger.
-Debugger_Error_Message_2=Error launching ''{0}''\n\nThe debug session could not be started.\nPlease make sure that the debugger is properly configured as a php.ini directive.
-Debugger_Error_Message_3=Error launching ''{0}''\n\nThe session could not be started.\nIn order to generate debug information, please make sure that the debugger is properly configured as a php.ini directive.
-Debugger_Error_Crash_Message=The session terminated due to a PHP process crash
-Debugger_Incompatible_Protocol=Incompatible debugger version.\nThe remote debugger version might not match the expected protocol version ({0}).
-PHPDebugPlugin_PerformingPostStartupOperations=Performing Post Startup Operations...
-PHPDebugPlugin_PostStartup=Post Startup...
-PHPExecutableDebuggerInitializer_6=Error
-PHPExecutableDebuggerInitializer_7=Error running PHP executable:\n\n{0}
-PHPExecutableLaunchDelegate_0=Please set a valid PHP file for this launch.
-PHPExecutableLaunchDelegate_4=Please set a valid PHP executable for this launch.
-PHPLaunchUtilities_0=A previous launch with 'Debug All Pages' or 'Start Debug From' attribute was identifed.\nLaunching a new session will terminate and remove the old launch, directing all future debug requests associated with it to the new launch.\nDo you wish to continue and launch a new session?
-PHPLaunchUtilities_7=The requested launch has a 'Debug All Pages' attribute.\nLaunching this type of session will terminate and remove any other previous launches.\nDo you wish to continue and launch the new session?
-PHPLaunchUtilities_8=The requested launch has a 'Start Debug From' attribute.\nLaunching this type of session will terminate and remove any other previous launches.\nDo you wish to continue and launch the new session?
-PHPLaunchUtilities_phpLaunchTitle=PHP Launch
-PHPLaunchUtilities_activeLaunchDetected=An active PHP launch was detected.\nSince you have previously chosen not to allow multiple sessions,\nthe current launch is denied.\n\nYou can change these settings through the Workbench Options preferences page (PHP|Debug|Workbench Options).
-PHPLaunchUtilities_confirmation=Launch Confirmation
-PHPLaunchUtilities_multipleLaunchesPrompt=An active PHP launch was detected.\nDo you wish to launch another session?
-PHPLaunchUtilities_rememberDecision=&Remember my decision
-PHPLaunchUtilities_PHPPerspectiveSwitchTitle=Confirm Open Perspective
-PHPLaunchUtilities_PHPPerspectiveSwitchMessage=The debug session was terminated. Do you wish to switch back to the {0} perspective?
-PHPLaunchUtilities_terminate=Terminate
-PHPLaunchUtilities_waitingForDebugger=Waiting for the debugger's response...
-PHPWebPageLaunchDelegate_DialogError=Error
-PHPWebPageLaunchDelegate_DialogErrorDebug=Debug Error
-PHPWebPageLaunchDelegate_DialogErrorProfile=Profile Error
-PHPWebPageLaunchDelegate_DialogErrorRun=Run Error
-PHPWebPageLaunchDelegate_serverNotFound=The selected launch uses a nonexistent PHP server ''{0}''. Configure the server from the PHP Servers preferences page (PHP|PHP Servers).
-DebugConfigurationDialog_invalidPort=Invalid port number.
-DebugConfigurationDialog_invalidPortRange=Invalid port number. Enter a port number in the range 1-65535.
-DebugConfigurationDialog_PortInUse=Port {0} is already in use. Please select a different port.
-ZendDebuggerConfiguration_ZendDebuggerNotInstalledError=Zend Debugger extension is not installed.
-ZendDebuggerConfigurationDialog_AutoMode=Auto
-ZendDebuggerConfigurationDialog_Broadcast_port=Broadcast Port:
-ZendDebuggerConfigurationDialog_client_host_ip=Client Host/IP:
-ZendDebuggerConfigurationDialog_Connection_settings_group=Connection Settings (Default)
-ZendDebuggerConfigurationDialog_debug_response_timeout=Debug Response Timeout (ms):
-ZendDebuggerConfigurationDialog_Dialog_description=Configure Zend debugger global settings.
-ZendDebuggerConfigurationDialog_Dialog_title=Zend Debugger
-ZendDebuggerConfigurationDialog_Dummy_file_name=Dummy File Name:
-ZendDebuggerConfigurationDialog_General_settings_group=General Settings
-ZendDebuggerConfigurationDialog_invalid_response_time=Debug response time must be greater than {0} ms.
-ZendDebuggerConfigurationDialog_invalid_response_time_exc=Invalid debug response time.
-ZendDebuggerConfigurationDialog_ManualMode=Manual
-ZendDebuggerConfigurationDialog_Note_label=NOTE:
-ZendDebuggerConfigurationDialog_Note_text=Default connection settings can be overridden at debugger owner level.
-ZendDebuggerConfigurationDialog_zendDebuggerSettings=Zend Debugger Configuration
-ZendDebuggerConfigurationDialog_runWithDebugInfo=Display debug information when running.
-ZendDebuggerConfigurationDialog_useNewProtocol=Use New Protocol
-DebuggerConfigurationDialog_invalidPortRange=Invalid Port Number.\nEnter a port number in the range 1-65535.
-DebuggerConfigurationDialog_debugPort=Debug Port:
-ServerDebugHandler_0=Incompatible Debug Server version.
-XDebugCommunicationDaemon_Dont_show_this_message_again=Don't show this message again.
-XDebugCommunicationDaemon_Remote_debug_session_does_not_refer_to_localhost=Remote debug session that doesn't refer to localhost is requested to be started.\n\nTo accept remote sessions that don't refer to localhost, you need to set 'Allow remote session (JIT)' option to 'any' in debugger general settings.\n\nYou can configure the debugger general settings <a>here</a>.
-XDebugCommunicationDaemon_Remote_debug_session_for_localhost=Remote debug session for localhost is requested to be started.\n\nTo accept remote sessions for localhost, you need to set 'Allow remote session (JIT)' option to 'localhost' or 'any' in debugger general settings.\n\nYou can configure the debugger general settings <a>here</a>.
-XDebugCommunicationDaemon_XDebug_remote_session_title=XDebug Remote Session
-XDebugConfigurationDialog_mainTitle=XDebug Configuration
-XDebugConfigurationDialog_generalGroup=General Settings
-XDebugConfigurationDialog_captureGroup=Output Capture
-XDebugConfigurationDialog_proxyGroup=DBGp Proxy
-XDebugConfigurationDialog_showSuperGlobals=Show super globals
-XDebugConfigurationDialog_useExtendedProperties=Use extended properties
-XDebugConfigurationDialog_maxArrayDepth=Max array depth:
-XDebugConfigurationDialog_maxChildren=Max children:
-XDebugConfigurationDialog_invalidTimeout=Invalid Timeout. Enter a number in the range 10 - 99999.
-XDebugConfigurationDialog_invalidTimeoutValue=Invalid Timeout Value
-XDebugConfigurationDialog_useMultisession=Use multisession
-XDebugConfigurationDialog_remoteSession=Accept remote session (JIT):
-XDebugConfigurationDialog_remoteSessionOption_off=off
-XDebugConfigurationDialog_remoteSessionOption_localhost=localhost
-XDebugConfigurationDialog_remoteSessionOption_any=any
-XDebugConfigurationDialog_remoteSessionOption_prompt=prompt
-XDebugConfigurationDialog_captureStdout=Capture stdout:
-XDebugConfigurationDialog_captureStderr=Capture stderr:
-XDebugConfigurationDialog_capture_off=off
-XDebugConfigurationDialog_capture_copy=copy
-XDebugConfigurationDialog_capture_redirect=redirect
-XDebugConfigurationDialog_Connection_settings_group=Connection Settings (Default)
-XDebugConfigurationDialog_Dialog_description=Configure XDebug debugger global settings.
-XDebugConfigurationDialog_Dialog_title=XDebug
-XDebugConfigurationDialog_General_settings_group=General Settings
-XDebugConfigurationDialog_useProxy=Use Proxy
-XDebugConfigurationDialog_idekey=IDE Key:
-XDebugConfigurationDialog_MaxData=Max data:
-XDebugConfigurationDialog_Note_label=NOTE:
-XDebugConfigurationDialog_Note_text=Default connection settings can be overridden at debugger owner level.
-XDebugConfigurationDialog_proxy=Proxy (host:port):
-XDebugMessage_debugError=Debugger Error
-XDebugMessage_unexpectedTermination=Unexpected termination of script, debugging ended.
-XDebugMessage_remoteSessionTitle=PHP Debug
-XDebugMessage_remoteSessionPrompt=Remote debug session requested from {0}.\nAccept ?
-XDebug_DBGpProxyHandler_0=proxy port cannot be the same as debug port.\nproxy use disabled
-XDebug_DBGpProxyHandler_1=Unable to connect to proxy\n
-XDebug_DBGpProxyHandler_2=invalid response from proxy.
-XDebug_DBGpProxyHandler_3=Debug Error
-XDebug_ExeLaunchConfigurationDelegate_0=No script specified
-XDebug_ExeLaunchConfigurationDelegate_1=Specified script cannot be found
-XDebug_ExeLaunchConfigurationDelegate_2=Unable to connect to proxy\n
-XDebug_ExeLaunchConfigurationDelegate_3=Launching script
-XDebug_ExeLaunchConfigurationDelegate_4=waiting for XDebug session
-XDebug_WebLaunchConfigurationDelegate_0=Web Launch Already Running
-XDebug_WebLaunchConfigurationDelegate_1=Could not launch.\nInvalid server configuration.
-XDebug_WebLaunchConfigurationDelegate_2=Unable to connect to proxy\n
-XDebug_WebLaunchConfigurationDelegate_3=Launching XDebug session URL...
-XDebug_WebLaunchConfigurationDelegate_4=Waiting for XDebug session...
-XDebug_DBGpTarget_0=No appropriate file located or no file selected. Debug Terminated
-XDebug_DBGpTarget_1=Remote Launch
-XDebug_DBGpTarget_2=Unknown PHP Program
-XDebug_DBGpContainerValue_0=Unknown Object Type
-XDebug_DBGpMultiSessionTarget_0=MultiSession Manager
-XDebug_DBGpStackFrame_0=lineno
-XDebug_DBGpStringValue_0=length
-XDebug_DBGpThread_0=PHP Thread
-XDebug_DBGpVariable_0=setValue called, but verifyValue failed
-XDebug_DBGpVariable_1=program under debug rejected value change
-XDebug_IDBGpModelConstants_0=<Invalid>
-XDebug_IDBGpModelConstants_1=<Uninitialized>
-XDebugDebuggerConfiguration_XDebugNotEnabledError=XDebug is not enabled. Please add xdebug.remote_enable=1 to php.ini configuration file.
-XDebugDebuggerConfiguration_XDebugNotInstalledError=XDebug extension is not installed. Please visit http://xdebug.org/docs/install to see how to install it.
-XDebugWebLaunchConfigurationDelegate_PHP_process=PHP Process
-ExeLaunchConfigurationDelegate_PortInUse=Port {0} is already in use. Please select a different port for debugger in corresponding PHP executable configuration ({1}).
-WebLaunchConfigurationDelegate_PortInUse=Port {0} is already in use. Please select a different port for debugger in corresponding PHP server configuration ({1}).
-NoneDebuggerConfiguration_Launching=Launching...
-NoneDebuggerConfiguration_PHP_executable_file_is_invalid=PHP executable file is invalid.\nPlease set a valid PHP executable file in ''{0}'' launch configuration.
-NoneDebuggerConfiguration_PHP_script_file_is_invalid=PHP script file is invalid.\nPlease set a valid PHP script file in ''{0}'' launch configuration.
-NoneDebuggerConfiguration_PHP_source_file_is_invalid=PHP source file is invalid.\nPlease set a valid PHP source file in ''{0}'' launch configuration.
-NoneDebuggerConfiguration_There_is_no_debugger_attached_for_PHP_executable=Launch configuration ''{0}'' could not be started in debug mode.\nThere is no debugger specified in corresponding ''{1}'' executable configuration.
-NoneDebuggerConfiguration_There_is_no_debugger_attached_for_PHP_server=Launch configuration ''{0}'' could not be started in debug mode. There is no debugger specified in corresponding ''{1}'' server configuration.
-NoneDebuggerConfiguration_There_is_no_PHP_runtime_environment=There is no PHP runtime environment specified in ''{0}'' launch configuration.
-NoneDebuggerConfiguration_There_is_no_PHP_server_specified=There is no PHP server specified in ''{0}'' launch configuration.
-PHPProcess_Zend_Debugger_suffix=[Zend Debugger]
-PHPProcess_XDebug_suffix=[XDebug]
-RemoteDebugger_LicenseError=License error
-RemoteDebugger_WarnNoneI5=Zend Studio i5 version only supports remote debugging on i5 servers
-RemoteDebugger_RequestFileFromServer=Requesting file content from server...
-ConfigureHostsDialog_Address_could_not_be_detected=Entry may not be a valid network address (address is either invalid or inaccessible).
-ConfigureHostsDialog_Down_button=Down
-ConfigureHostsDialog_Up_button=Up
-ConfigureHostsDialog_Address_column=Address
-ConfigureHostsDialog_Cancel_button=Cancel
-ConfigureHostsDialog_Configure_client_IPs=Configure Client IP(s)/Host
-ConfigureHostsDialog_Deselect_all_button=Deselect All
-ConfigureHostsDialog_OK_button=OK
-ConfigureHostsDialog_Reset_button=Reset
-ConfigureHostsDialog_Select_all_button=Select All
-ConfigureHostsDialog_Select_addresses=Select the addresses that you would like to add to the 'Client IP(s)/Host' list.
-ConfigureHostsDialog_Type_column=Type
-ZendDebuggerConfigurationDialog_UseSSLEncryption=Use SSL Encryption
-ZendDebuggerConfigurationDialog_Reload=Reload...
-ZendDebuggerConfigurationDialog_Configure=Configure...
-ZendDebuggerConfigurationDialog_ClientIPWarning=Client IP/host {0} may not be a valid network address (address is either invalid or inaccessible).
+###############################################################################
+# Copyright (c) 2009 IBM Corporation and others.
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Eclipse Public License v1.0
+# which accompanies this distribution, and is available at
+# http://www.eclipse.org/legal/epl-v10.html
+#
+# Contributors:
+# IBM Corporation - initial API and implementation
+# Zend Technologies
+###############################################################################
+LineBreakPointMessage_1=Line Breakpoint: {0} [line: {1} ]
+ConditionalBreakPointMessage_1=Conditional Breakpoint: {0} [line: {1} ]
+ConditionalBreakPointMessage_2=\nCondition: {0}
+DBGpMultiSessionTarget_Multisession_PHP_process=Multisession PHP Process
+DBGpProxyConnection_Registering_DBGp_proxy=Registering with DBGp Proxy...
+DebuggerFileNotFound_1=Debugger didn't find file to debug.
+DebuggerConnection_Problem_1=Unable to connect to Web Server. The server might not have been started.
+DebuggerDebugPortInUse_1=Debug Port already in use. Enter a different Debug Port number in the Installed Debuggers preferences page (PHP|Debug|Installed Debuggers).
+DebuggerConnection_Problem_2=Unexpected response by Web Server.
+DebuggerConnection_Problem_3=Could not connect to the specified Debug Server.\nEnsure the Host Name/IP is correct and that the specified server is accessible by your client.
+DebuggerConnection_Problem_4=Unknown host:
+DebuggerConnection_Problem_5=Unable to connect to URL:
+DebuggerConnection_Failed_1=Connection Failed:\n Could not open the URL: ''{0}''\n Please verify that the file ''{1}'' exists under the server''s document root.
+Debugger_Unexpected_Error_1=Unexpected error. See error log for more information.
+Debugger_ResourceNotFound=Could not find the resource {0}.
+Debugger_InvalidDebugResource={0} is an invalid debugging resource.
+Debugger_LaunchError_title=Launch Error
+Debugger_General_Error=Error
+Debugger_Launch_Error=Launch Error - Session Terminated
+Debugger_Error_Message=Error while communicating with the debugger.\nPossible causes:\n 1. The Zend Debugger was not properly installed.\n 2. You are not using the latest Zend Debugger.
+Debugger_Error_Message_2=Error launching ''{0}''\n\nThe debug session could not be started.\nPlease make sure that the debugger is properly configured as a php.ini directive.
+Debugger_Error_Message_3=Error launching ''{0}''\n\nThe session could not be started.\nIn order to generate debug information, please make sure that the debugger is properly configured as a php.ini directive.
+Debugger_Error_Crash_Message=The session terminated due to a PHP process crash
+Debugger_Incompatible_Protocol=Incompatible debugger version.\nThe remote debugger version might not match the expected protocol version ({0}).
+PHPDebugPlugin_PerformingPostStartupOperations=Performing Post Startup Operations...
+PHPDebugPlugin_PostStartup=Post Startup...
+PHPExecutableDebuggerInitializer_6=Error
+PHPExecutableDebuggerInitializer_7=Error running PHP executable:\n\n{0}
+PHPExecutableLaunchDelegate_0=Please set a valid PHP file for this launch.
+PHPExecutableLaunchDelegate_4=Please set a valid PHP executable for this launch.
+PHPLaunchUtilities_0=A previous launch with 'Debug All Pages' or 'Start Debug From' attribute was identifed.\nLaunching a new session will terminate and remove the old launch, directing all future debug requests associated with it to the new launch.\nDo you wish to continue and launch a new session?
+PHPLaunchUtilities_7=The requested launch has a 'Debug All Pages' attribute.\nLaunching this type of session will terminate and remove any other previous launches.\nDo you wish to continue and launch the new session?
+PHPLaunchUtilities_8=The requested launch has a 'Start Debug From' attribute.\nLaunching this type of session will terminate and remove any other previous launches.\nDo you wish to continue and launch the new session?
+PHPLaunchUtilities_phpLaunchTitle=PHP Launch
+PHPLaunchUtilities_activeLaunchDetected=An active PHP launch was detected.\nSince you have previously chosen not to allow multiple sessions,\nthe current launch is denied.\n\nYou can change these settings through the Workbench Options preferences page (PHP|Debug|Workbench Options).
+PHPLaunchUtilities_confirmation=Launch Confirmation
+PHPLaunchUtilities_multipleLaunchesPrompt=An active PHP launch was detected.\nDo you wish to launch another session?
+PHPLaunchUtilities_rememberDecision=&Remember my decision
+PHPLaunchUtilities_PHPPerspectiveSwitchTitle=Confirm Open Perspective
+PHPLaunchUtilities_PHPPerspectiveSwitchMessage=The debug session was terminated. Do you wish to switch back to the {0} perspective?
+PHPLaunchUtilities_terminate=Terminate
+PHPLaunchUtilities_waitingForDebugger=Waiting for the debugger's response...
+PHPWebPageLaunchDelegate_DialogError=Error
+PHPWebPageLaunchDelegate_DialogErrorDebug=Debug Error
+PHPWebPageLaunchDelegate_DialogErrorProfile=Profile Error
+PHPWebPageLaunchDelegate_DialogErrorRun=Run Error
+PHPWebPageLaunchDelegate_serverNotFound=The selected launch uses a nonexistent PHP server ''{0}''. Configure the server from the PHP Servers preferences page (PHP|PHP Servers).
+DebugConfigurationDialog_invalidPort=Invalid port number.
+DebugConfigurationDialog_invalidPortRange=Invalid port number. Enter a port number in the range 1-65535.
+DebugConfigurationDialog_PortInUse=Port {0} is already in use. Please select a different port.
+ZendDebuggerConfiguration_ZendDebuggerNotInstalledError=Zend Debugger extension is not installed.
+ZendDebuggerConfigurationDialog_AutoMode=Auto
+ZendDebuggerConfigurationDialog_Broadcast_port=Broadcast Port:
+ZendDebuggerConfigurationDialog_client_host_ip=Client Host/IP:
+ZendDebuggerConfigurationDialog_Connection_settings_group=Connection Settings (Default)
+ZendDebuggerConfigurationDialog_debug_response_timeout=Debug Response Timeout (ms):
+ZendDebuggerConfigurationDialog_Dialog_description=Configure Zend debugger global settings.
+ZendDebuggerConfigurationDialog_Dialog_title=Zend Debugger
+ZendDebuggerConfigurationDialog_Dummy_file_name=Dummy File Name:
+ZendDebuggerConfigurationDialog_General_settings_group=General Settings
+ZendDebuggerConfigurationDialog_invalid_response_time=Debug response time must be greater than {0} ms.
+ZendDebuggerConfigurationDialog_invalid_response_time_exc=Invalid debug response time.
+ZendDebuggerConfigurationDialog_ManualMode=Manual
+ZendDebuggerConfigurationDialog_Note_label=NOTE:
+ZendDebuggerConfigurationDialog_Note_text=Default connection settings can be overridden at debugger owner level.
+ZendDebuggerConfigurationDialog_zendDebuggerSettings=Zend Debugger Configuration
+ZendDebuggerConfigurationDialog_runWithDebugInfo=Display debug information when running.
+ZendDebuggerConfigurationDialog_useNewProtocol=Use New Protocol
+DebuggerConfigurationDialog_invalidPortRange=Invalid Port Number.\nEnter a port number in the range 1-65535.
+DebuggerConfigurationDialog_debugPort=Debug Port:
+ServerDebugHandler_0=Incompatible Debug Server version.
+XDebugCommunicationDaemon_Dont_show_this_message_again=Don't show this message again.
+XDebugCommunicationDaemon_Remote_debug_session_does_not_refer_to_localhost=Remote debug session that doesn't refer to localhost is requested to be started.\n\nTo accept remote sessions that don't refer to localhost, you need to set 'Allow remote session (JIT)' option to 'any' in debugger general settings.\n\nYou can configure the debugger general settings <a>here</a>.
+XDebugCommunicationDaemon_Remote_debug_session_for_localhost=Remote debug session for localhost is requested to be started.\n\nTo accept remote sessions for localhost, you need to set 'Allow remote session (JIT)' option to 'localhost' or 'any' in debugger general settings.\n\nYou can configure the debugger general settings <a>here</a>.
+XDebugCommunicationDaemon_XDebug_remote_session_title=XDebug Remote Session
+XDebugConfigurationDialog_mainTitle=XDebug Configuration
+XDebugConfigurationDialog_generalGroup=General Settings
+XDebugConfigurationDialog_captureGroup=Output Capture
+XDebugConfigurationDialog_proxyGroup=DBGp Proxy
+XDebugConfigurationDialog_showSuperGlobals=Show super globals
+XDebugConfigurationDialog_useExtendedProperties=Use extended properties
+XDebugConfigurationDialog_maxArrayDepth=Max array depth:
+XDebugConfigurationDialog_maxChildren=Max children:
+XDebugConfigurationDialog_invalidTimeout=Invalid Timeout. Enter a number in the range 10 - 99999.
+XDebugConfigurationDialog_invalidTimeoutValue=Invalid Timeout Value
+XDebugConfigurationDialog_useMultisession=Use multisession
+XDebugConfigurationDialog_remoteSession=Accept remote session (JIT):
+XDebugConfigurationDialog_remoteSessionOption_off=off
+XDebugConfigurationDialog_remoteSessionOption_localhost=localhost
+XDebugConfigurationDialog_remoteSessionOption_any=any
+XDebugConfigurationDialog_remoteSessionOption_prompt=prompt
+XDebugConfigurationDialog_captureStdout=Capture stdout:
+XDebugConfigurationDialog_captureStderr=Capture stderr:
+XDebugConfigurationDialog_capture_off=off
+XDebugConfigurationDialog_capture_copy=copy
+XDebugConfigurationDialog_capture_redirect=redirect
+XDebugConfigurationDialog_Connection_settings_group=Connection Settings (Default)
+XDebugConfigurationDialog_Dialog_description=Configure XDebug debugger global settings.
+XDebugConfigurationDialog_Dialog_title=XDebug
+XDebugConfigurationDialog_General_settings_group=General Settings
+XDebugConfigurationDialog_useProxy=Use Proxy
+XDebugConfigurationDialog_idekey=IDE Key:
+XDebugConfigurationDialog_MaxData=Max data:
+XDebugConfigurationDialog_Note_label=NOTE:
+XDebugConfigurationDialog_Note_text=Default connection settings can be overridden at debugger owner level.
+XDebugConfigurationDialog_proxy=Proxy (host:port):
+XDebugMessage_debugError=Debugger Error
+XDebugMessage_unexpectedTermination=Unexpected termination of script, debugging ended.
+XDebugMessage_remoteSessionTitle=PHP Debug
+XDebugMessage_remoteSessionPrompt=Remote debug session requested from {0}.\nAccept ?
+XDebug_DBGpProxyHandler_0=proxy port cannot be the same as debug port.\nproxy use disabled
+XDebug_DBGpProxyHandler_1=Unable to connect to proxy\n
+XDebug_DBGpProxyHandler_2=invalid response from proxy.
+XDebug_DBGpProxyHandler_3=Debug Error
+XDebug_ExeLaunchConfigurationDelegate_0=No script specified
+XDebug_ExeLaunchConfigurationDelegate_1=Specified script cannot be found
+XDebug_ExeLaunchConfigurationDelegate_2=Unable to connect to proxy\n
+XDebug_ExeLaunchConfigurationDelegate_3=Launching script
+XDebug_ExeLaunchConfigurationDelegate_4=waiting for XDebug session
+XDebug_ExeLaunchConfigurationDelegate_5=Unable create profiling file
+XDebug_WebLaunchConfigurationDelegate_0=Web Launch Already Running
+XDebug_WebLaunchConfigurationDelegate_1=Could not launch.\nInvalid server configuration.
+XDebug_WebLaunchConfigurationDelegate_2=Unable to connect to proxy\n
+XDebug_WebLaunchConfigurationDelegate_3=Launching XDebug session URL...
+XDebug_WebLaunchConfigurationDelegate_4=Waiting for XDebug session...
+XDebug_DBGpTarget_0=No appropriate file located or no file selected. Debug Terminated
+XDebug_DBGpTarget_1=Remote Launch
+XDebug_DBGpTarget_2=Unknown PHP Program
+XDebug_DBGpContainerValue_0=Unknown Object Type
+XDebug_DBGpMultiSessionTarget_0=MultiSession Manager
+XDebug_DBGpStackFrame_0=lineno
+XDebug_DBGpStringValue_0=length
+XDebug_DBGpThread_0=PHP Thread
+XDebug_DBGpVariable_0=setValue called, but verifyValue failed
+XDebug_DBGpVariable_1=program under debug rejected value change
+XDebug_IDBGpModelConstants_0=<Invalid>
+XDebug_IDBGpModelConstants_1=<Uninitialized>
+XDebugDebuggerConfiguration_XDebugNotEnabledError=XDebug is not enabled. Please add xdebug.remote_enable=1 to php.ini configuration file.
+XDebugDebuggerConfiguration_XDebugNotInstalledError=XDebug extension is not installed. Please visit http://xdebug.org/docs/install to see how to install it.
+XDebugWebLaunchConfigurationDelegate_PHP_process=PHP Process
+ExeLaunchConfigurationDelegate_PortInUse=Port {0} is already in use. Please select a different port for debugger in corresponding PHP executable configuration ({1}).
+WebLaunchConfigurationDelegate_PortInUse=Port {0} is already in use. Please select a different port for debugger in corresponding PHP server configuration ({1}).
+NoneDebuggerConfiguration_Launching=Launching...
+NoneDebuggerConfiguration_PHP_executable_file_is_invalid=PHP executable file is invalid.\nPlease set a valid PHP executable file in ''{0}'' launch configuration.
+NoneDebuggerConfiguration_PHP_script_file_is_invalid=PHP script file is invalid.\nPlease set a valid PHP script file in ''{0}'' launch configuration.
+NoneDebuggerConfiguration_PHP_source_file_is_invalid=PHP source file is invalid.\nPlease set a valid PHP source file in ''{0}'' launch configuration.
+NoneDebuggerConfiguration_There_is_no_debugger_attached_for_PHP_executable=Launch configuration ''{0}'' could not be started in debug mode.\nThere is no debugger specified in corresponding ''{1}'' executable configuration.
+NoneDebuggerConfiguration_There_is_no_debugger_attached_for_PHP_server=Launch configuration ''{0}'' could not be started in debug mode. There is no debugger specified in corresponding ''{1}'' server configuration.
+NoneDebuggerConfiguration_There_is_no_PHP_runtime_environment=There is no PHP runtime environment specified in ''{0}'' launch configuration.
+NoneDebuggerConfiguration_There_is_no_PHP_server_specified=There is no PHP server specified in ''{0}'' launch configuration.
+PHPProcess_Zend_Debugger_suffix=[Zend Debugger]
+PHPProcess_XDebug_suffix=[XDebug]
+RemoteDebugger_LicenseError=License error
+RemoteDebugger_WarnNoneI5=Zend Studio i5 version only supports remote debugging on i5 servers
+RemoteDebugger_RequestFileFromServer=Requesting file content from server...
+ConfigureHostsDialog_Address_could_not_be_detected=Entry may not be a valid network address (address is either invalid or inaccessible).
+ConfigureHostsDialog_Down_button=Down
+ConfigureHostsDialog_Up_button=Up
+ConfigureHostsDialog_Address_column=Address
+ConfigureHostsDialog_Cancel_button=Cancel
+ConfigureHostsDialog_Configure_client_IPs=Configure Client IP(s)/Host
+ConfigureHostsDialog_Deselect_all_button=Deselect All
+ConfigureHostsDialog_OK_button=OK
+ConfigureHostsDialog_Reset_button=Reset
+ConfigureHostsDialog_Select_all_button=Select All
+ConfigureHostsDialog_Select_addresses=Select the addresses that you would like to add to the 'Client IP(s)/Host' list.
+ConfigureHostsDialog_Type_column=Type
+ZendDebuggerConfigurationDialog_UseSSLEncryption=Use SSL Encryption
+ZendDebuggerConfigurationDialog_Reload=Reload...
+ZendDebuggerConfigurationDialog_Configure=Configure...
+ZendDebuggerConfigurationDialog_ClientIPWarning=Client IP/host {0} may not be a valid network address (address is either invalid or inaccessible).
ZendDebuggerConfigurationDialog_ClientIPsWarning=Client IPs/hosts {0} may not be valid network addresses (addresses are either invalid or inaccessible). \ No newline at end of file
diff --git a/plugins/org.eclipse.php.debug.core/src/org/eclipse/php/internal/debug/core/launching/PHPLaunchDelegateProxy.java b/plugins/org.eclipse.php.debug.core/src/org/eclipse/php/internal/debug/core/launching/PHPLaunchDelegateProxy.java
index 18cbe02..b5aa194 100644
--- a/plugins/org.eclipse.php.debug.core/src/org/eclipse/php/internal/debug/core/launching/PHPLaunchDelegateProxy.java
+++ b/plugins/org.eclipse.php.debug.core/src/org/eclipse/php/internal/debug/core/launching/PHPLaunchDelegateProxy.java
@@ -57,25 +57,12 @@ public class PHPLaunchDelegateProxy implements ILaunchConfigurationDelegate2 {
return false;
}
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.debug.core.model.ILaunchConfigurationDelegate2#
- * finalLaunchCheck (org.eclipse.debug.core.ILaunchConfiguration,
- * java.lang.String, org.eclipse.core.runtime.IProgressMonitor)
- */
@Override
public boolean finalLaunchCheck(ILaunchConfiguration configuration, String mode, IProgressMonitor monitor)
throws CoreException {
return getConfigurationDelegate(configuration).finalLaunchCheck(configuration, mode, monitor);
}
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.debug.core.model.ILaunchConfigurationDelegate2#getLaunch(
- * org.eclipse.debug.core.ILaunchConfiguration, java.lang.String)
- */
@Override
public ILaunch getLaunch(ILaunchConfiguration configuration, String mode) throws CoreException {
ILaunchManager lm = DebugPlugin.getDefault().getLaunchManager();
@@ -90,27 +77,12 @@ public class PHPLaunchDelegateProxy implements ILaunchConfigurationDelegate2 {
return getConfigurationDelegate(configuration).getLaunch(configuration, mode);
}
- /*
- * (non-Javadoc)
- *
- * @see
- * org.eclipse.debug.core.model.ILaunchConfigurationDelegate2#preLaunchCheck
- * (org.eclipse.debug.core.ILaunchConfiguration, java.lang.String,
- * org.eclipse.core.runtime.IProgressMonitor)
- */
@Override
public boolean preLaunchCheck(ILaunchConfiguration configuration, String mode, IProgressMonitor monitor)
throws CoreException {
return getConfigurationDelegate(configuration).preLaunchCheck(configuration, mode, monitor);
}
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.debug.core.model.ILaunchConfigurationDelegate#launch(org.
- * eclipse.debug.core.ILaunchConfiguration, java.lang.String,
- * org.eclipse.debug.core.ILaunch, org.eclipse.core.runtime.IProgressMonitor)
- */
@Override
public void launch(ILaunchConfiguration configuration, String mode, ILaunch launch, IProgressMonitor monitor)
throws CoreException {
@@ -130,7 +102,7 @@ public class PHPLaunchDelegateProxy implements ILaunchConfigurationDelegate2 {
* plug-in as Eclipse-RegisterBuddy: org.eclipse.php.debug.core
*
* @param configuration
- * An {@link ILaunchConfiguration}
+ * An {@link ILaunchConfiguration}
*/
protected ILaunchConfigurationDelegate2 getConfigurationDelegate(ILaunchConfiguration configuration)
throws CoreException {
diff --git a/plugins/org.eclipse.php.debug.core/src/org/eclipse/php/internal/debug/core/launching/PHPLaunchUtilities.java b/plugins/org.eclipse.php.debug.core/src/org/eclipse/php/internal/debug/core/launching/PHPLaunchUtilities.java
index 3a199ef..043b30c 100644
--- a/plugins/org.eclipse.php.debug.core/src/org/eclipse/php/internal/debug/core/launching/PHPLaunchUtilities.java
+++ b/plugins/org.eclipse.php.debug.core/src/org/eclipse/php/internal/debug/core/launching/PHPLaunchUtilities.java
@@ -18,6 +18,7 @@ import java.io.IOException;
import java.io.UnsupportedEncodingException;
import java.net.*;
import java.util.*;
+import java.util.Map.Entry;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IResource;
@@ -74,6 +75,9 @@ import org.eclipse.ui.*;
*/
public class PHPLaunchUtilities {
+ private static final String OFF = "off"; //$NON-NLS-1$
+ private static final String ON = "on" //$NON-NLS-1$
+ ;
public static final String ID_PHPDebugOutput = "org.eclipse.debug.ui.PHPDebugOutput"; //$NON-NLS-1$
public static final String ID_PHPBrowserOutput = "org.eclipse.debug.ui.PHPBrowserOutput"; //$NON-NLS-1$
private static DebuggerDelayProgressMonitorDialog progressDialog;
@@ -389,7 +393,7 @@ public class PHPLaunchUtilities {
* pages'.
*
* @param launchConfiguration
- * An {@link ILaunchConfiguration}
+ * An {@link ILaunchConfiguration}
* @return True, if the configuration holds an attribute for 'debug all pages'.
* @throws CoreException
*/
@@ -403,7 +407,7 @@ public class PHPLaunchUtilities {
* from'.
*
* @param launchConfiguration
- * An {@link ILaunchConfiguration}
+ * An {@link ILaunchConfiguration}
* @return True, if the configuration holds an attribute for 'start debug from'.
* @throws CoreException
*/
@@ -496,7 +500,7 @@ public class PHPLaunchUtilities {
* or has a different version.
*
* @param errorMessage
- * The message to display.
+ * The message to display.
*/
public static void showLaunchErrorMessage(final String errorMessage) {
showDebuggerErrorMessage(PHPDebugCoreMessages.Debugger_Launch_Error, errorMessage);
@@ -508,9 +512,9 @@ public class PHPLaunchUtilities {
* or has a different version.
*
* @param title
- * The error message title.
+ * The error message title.
* @param errorMessage
- * The message to display.
+ * The message to display.
*/
public static void showDebuggerErrorMessage(final String title, final String errorMessage) {
Display.getDefault().syncExec(new Runnable() {
@@ -584,9 +588,9 @@ public class PHPLaunchUtilities {
* the given mode.
*
* @param configuration
- * An {@link ILaunchConfiguration}
+ * An {@link ILaunchConfiguration}
* @param mode
- * The launch mode (Run/Debug)
+ * The launch mode (Run/Debug)
*/
public static void openLaunchConfigurationDialog(final ILaunchConfiguration configuration, final String mode) {
// Run it on the UI thread
@@ -631,12 +635,12 @@ public class PHPLaunchUtilities {
* configuration attribute is set for the given launch.
*
* @param configuration
- * the launch configuration
+ * the launch configuration
* @param additionalEnv
- * additional environment strings
+ * additional environment strings
* @return the complete environment
* @throws CoreException
- * rethrown exception
+ * rethrown exception
*/
public static String[] getEnvironment(ILaunchConfiguration configuration, String[] additionalEnv)
throws CoreException {
@@ -826,9 +830,9 @@ public class PHPLaunchUtilities {
* libraries depending on the OS.
*
* @param env
- * Hash map to append environment variable to
+ * Hash map to append environment variable to
* @param phpExeDir
- * Directory handle where PHP.exe is located
+ * Directory handle where PHP.exe is located
*/
public static void appendLibrarySearchPathEnv(Map<String, String> env, File phpExeDir) {
String variable = getLibrarySearchEnvVariable();
@@ -843,9 +847,9 @@ public class PHPLaunchUtilities {
* Append PHP executable at the beginning of PATH env variable
*
* @param env
- * Hash map to append environment variable to
+ * Hash map to append environment variable to
* @param phpExe
- * php executable location
+ * php executable location
*/
public static void appendExecutableToPathEnv(Map<String, String> env, File phpExeDir) {
String phpPath = phpExeDir.getPath();
@@ -879,7 +883,7 @@ public class PHPLaunchUtilities {
* libraries depending on the OS.
*
* @param phpExeDir
- * Directory handle where PHP.exe is located
+ * Directory handle where PHP.exe is located
* @return string containing variable=value for appending it to the process
* environment vars array
*/
@@ -943,30 +947,34 @@ public class PHPLaunchUtilities {
* PHP script.
*
* @param configuration
- * Launch configuration
+ * Launch configuration
* @param phpExe
- * PHP Executable path
+ * PHP Executable path
* @param phpConfigDir
- * PHP configuration file location (directory where php.ini resides)
+ * PHP configuration file location (directory where
+ * php.ini resides)
* @param scriptPath
- * Script path
+ * Script path
* @param phpIniLocation
- * PHP configuration file path
+ * PHP configuration file path
* @param args
- * Command line arguments, if using PHP CLI, otherwise -
- * <code>null</code>
+ * Command line arguments, if using PHP CLI, otherwise
+ * - <code>null</code>
* @param phpVersion
* @return commands array
* @throws CoreException
*/
public static String[] getCommandLine(ILaunchConfiguration configuration, String phpExe, String phpConfigDir,
- String scriptPath, String[] args, String phpVersion) throws CoreException {
+ Map<String, String> additionalconfig, String scriptPath, String[] args, String phpVersion)
+ throws CoreException {
// Check if we should treat ASP tags as PHP tags
IProject project = getProject(configuration);
- String aspTags = ProjectOptions.isSupportingASPTags(project) ? "on" //$NON-NLS-1$
- : "off"; //$NON-NLS-1$
- String shortOpenTag = ProjectOptions.useShortTags(project) ? "on" //$NON-NLS-1$
- : "off"; //$NON-NLS-1$
+ Map<String, String> phpConfig = new TreeMap<>();
+ phpConfig.put("asp_tags", ProjectOptions.isSupportingASPTags(project) ? ON : OFF); //$NON-NLS-1$
+ phpConfig.put("short_open_tag", ProjectOptions.useShortTags(project) ? ON : OFF); //$NON-NLS-1$
+ if (additionalconfig != null) {
+ phpConfig.putAll(additionalconfig);
+ }
boolean builtIn = false;
final PHPexeItem[] phpItems = PHPexes.getInstance().getAllItems();
@@ -977,15 +985,18 @@ public class PHPLaunchUtilities {
}
}
List<String> cmdLineList = new LinkedList<>();
+ cmdLineList.add(phpExe);
if (builtIn) {
- cmdLineList.addAll(Arrays.asList(new String[] { phpExe, "-n", "-c", //$NON-NLS-1$ //$NON-NLS-2$
- phpConfigDir, "-d", "asp_tags=" + aspTags, "-d", //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- "short_open_tag=" + shortOpenTag, scriptPath })); //$NON-NLS-1$
- } else {
- cmdLineList.addAll(Arrays.asList(new String[] { phpExe, "-c", //$NON-NLS-1$
- phpConfigDir, "-d", "asp_tags=" + aspTags, "-d", //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- "short_open_tag=" + shortOpenTag, scriptPath })); //$NON-NLS-1$
+ cmdLineList.add("-n"); //$NON-NLS-1$
+ }
+ cmdLineList.add("-c"); //$NON-NLS-1$
+ cmdLineList.add(phpConfigDir);
+ for (Entry<String, String> cfg : phpConfig.entrySet()) {
+ cmdLineList.add("-d"); //$NON-NLS-1$
+ cmdLineList.add(new StringBuilder(cfg.getKey()).append('=').append(cfg.getValue()).toString());
}
+
+ cmdLineList.add(scriptPath);
if (args != null) {
cmdLineList.addAll(Arrays.asList(args));
}
@@ -993,6 +1004,11 @@ public class PHPLaunchUtilities {
}
public static String[] getCommandLine(ILaunchConfiguration configuration, String phpExe, String phpConfigDir,
+ String scriptPath, String[] args, String phpVersion) throws CoreException {
+ return getCommandLine(configuration, phpExe, phpConfigDir, null, scriptPath, args, phpVersion);
+ }
+
+ public static String[] getCommandLine(ILaunchConfiguration configuration, String phpExe, String phpConfigDir,
String scriptPath, String[] args) throws CoreException {
return getCommandLine(configuration, phpExe, phpConfigDir, scriptPath, args, null);
}
@@ -1002,10 +1018,8 @@ public class PHPLaunchUtilities {
throws CoreException {
// Check if we should treat ASP tags as PHP tags
IProject project = getProject(configuration);
- String aspTags = ProjectOptions.isSupportingASPTags(project) ? "on" //$NON-NLS-1$
- : "off"; //$NON-NLS-1$
- String shortOpenTag = ProjectOptions.useShortTags(project) ? "on" //$NON-NLS-1$
- : "off"; //$NON-NLS-1$
+ String aspTags = ProjectOptions.isSupportingASPTags(project) ? ON : OFF; // $NON-NLS-1$
+ String shortOpenTag = ProjectOptions.useShortTags(project) ? ON : OFF; // $NON-NLS-1$
if (server.startsWith("http://")) { //$NON-NLS-1$
server = server.substring(7);
} else if (server.startsWith("https://")) { //$NON-NLS-1$
@@ -1093,10 +1107,10 @@ public class PHPLaunchUtilities {
* configuration attribute.
*
* @param configuration
- * the launch configuration
+ * the launch configuration
* @return the program arguments
* @throws CoreException
- * rethrown exception
+ * rethrown exception
*/
public static String[] getProgramArguments(ILaunchConfiguration configuration) throws CoreException {
String arguments = configuration.getAttribute(IDebugParametersKeys.EXE_CONFIG_PROGRAM_ARGUMENTS, (String) null);
diff --git a/plugins/org.eclipse.php.debug.core/src/org/eclipse/php/internal/debug/core/launching/PHPProcess.java b/plugins/org.eclipse.php.debug.core/src/org/eclipse/php/internal/debug/core/launching/PHPProcess.java
index b7fe3e8..d700ba7 100644
--- a/plugins/org.eclipse.php.debug.core/src/org/eclipse/php/internal/debug/core/launching/PHPProcess.java
+++ b/plugins/org.eclipse.php.debug.core/src/org/eclipse/php/internal/debug/core/launching/PHPProcess.java
@@ -47,11 +47,6 @@ public class PHPProcess extends PlatformObject implements IProcess {
fireCreationEvent();
}
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.debug.core.model.IProcess#getLabel()
- */
@Override
public String getLabel() {
String suffix = null;
@@ -65,32 +60,16 @@ public class PHPProcess extends PlatformObject implements IProcess {
return suffix != null ? (fName + ' ' + suffix) : fName;
}
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.debug.core.model.IProcess#getLaunch()
- */
@Override
public ILaunch getLaunch() {
return fLaunch;
}
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.debug.core.model.IProcess#getStreamsProxy()
- */
@Override
public IStreamsProxy getStreamsProxy() {
return fProxy;
}
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.debug.core.model.IProcess#setAttribute(java.lang.String,
- * java.lang.String)
- */
@Override
public void setAttribute(String key, String value) {
if (fAttributes == null) {
@@ -104,11 +83,6 @@ public class PHPProcess extends PlatformObject implements IProcess {
fireChangeEvent();
}
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.debug.core.model.IProcess#getAttribute(java.lang.String)
- */
@Override
public String getAttribute(String key) {
if (fAttributes == null) {
@@ -117,21 +91,11 @@ public class PHPProcess extends PlatformObject implements IProcess {
return fAttributes.get(key);
}
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.debug.core.model.IProcess#getExitValue()
- */
@Override
public int getExitValue() throws DebugException {
return fExitValue;
}
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.core.runtime.PlatformObject#getAdapter(java.lang.Class)
- */
@SuppressWarnings({ "unchecked", "rawtypes" })
@Override
public Object getAdapter(Class adapter) {
@@ -154,31 +118,16 @@ public class PHPProcess extends PlatformObject implements IProcess {
return super.getAdapter(adapter);
}
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.debug.core.model.ITerminate#canTerminate()
- */
@Override
public boolean canTerminate() {
return !isTerminated();
}
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.debug.core.model.ITerminate#isTerminated()
- */
@Override
public boolean isTerminated() {
return fDebugTarget.isTerminated();
}
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.debug.core.model.ITerminate#terminate()
- */
@Override
public void terminate() throws DebugException {
// Terminate debug target
@@ -276,7 +225,7 @@ public class PHPProcess extends PlatformObject implements IProcess {
* Fires the given debug event.
*
* @param event
- * debug event to fire
+ * debug event to fire
*/
protected void fireEvent(DebugEvent event) {
DebugPlugin manager = DebugPlugin.getDefault();
diff --git a/plugins/org.eclipse.php.debug.core/src/org/eclipse/php/internal/debug/core/launching/XDebugExeLaunchConfigurationDelegate.java b/plugins/org.eclipse.php.debug.core/src/org/eclipse/php/internal/debug/core/launching/XDebugExeLaunchConfigurationDelegate.java
index 3a392c1..b749490 100644
--- a/plugins/org.eclipse.php.debug.core/src/org/eclipse/php/internal/debug/core/launching/XDebugExeLaunchConfigurationDelegate.java
+++ b/plugins/org.eclipse.php.debug.core/src/org/eclipse/php/internal/debug/core/launching/XDebugExeLaunchConfigurationDelegate.java
@@ -12,8 +12,10 @@
package org.eclipse.php.internal.debug.core.launching;
import java.io.File;
+import java.io.IOException;
import java.util.HashMap;
import java.util.Map;
+import java.util.TreeMap;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IResource;
@@ -49,24 +51,11 @@ import org.eclipse.swt.widgets.Display;
public class XDebugExeLaunchConfigurationDelegate extends LaunchConfigurationDelegate {
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.debug.core.model.LaunchConfigurationDelegate#getLaunch(org.
- * eclipse.debug.core.ILaunchConfiguration, java.lang.String)
- */
@Override
public ILaunch getLaunch(ILaunchConfiguration configuration, String mode) throws CoreException {
return new XDebugLaunch(configuration, mode, null);
}
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.debug.core.model.ILaunchConfigurationDelegate#launch(org.
- * eclipse.debug.core.ILaunchConfiguration, java.lang.String,
- * org.eclipse.debug.core.ILaunch, org.eclipse.core.runtime.IProgressMonitor)
- */
@Override
public void launch(ILaunchConfiguration configuration, String mode, ILaunch launch, IProgressMonitor monitor)
throws CoreException {
@@ -175,7 +164,8 @@ public class XDebugExeLaunchConfigurationDelegate extends LaunchConfigurationDel
// determine the environment variables
String[] envVarString = null;
DBGpTarget target = null;
- if (mode.equals(ILaunchManager.DEBUG_MODE)) {
+ boolean enableDebugging = mode.equals(ILaunchManager.DEBUG_MODE);
+ if (enableDebugging) {
// check the launch for stop at first line, if not there go to
// project specifics
boolean stopAtFirstLine = PHPProjectPreferences.getStopAtFirstLine(project);
@@ -259,7 +249,22 @@ public class XDebugExeLaunchConfigurationDelegate extends LaunchConfigurationDel
// define the command line for launching
String[] cmdLine = null;
- cmdLine = PHPLaunchUtilities.getCommandLine(configuration, phpExe.toOSString(), tempIni.toString(),
+ Map<String, String> phpCfg = new TreeMap<>();
+ if (mode.equals(ILaunchManager.PROFILE_MODE)) {
+ try {
+ File tmp = File.createTempFile("xdebug", ".cachegrind"); //$NON-NLS-1$ //$NON-NLS-2$
+ phpCfg.put("xdebug.profiler_enable", "on"); //$NON-NLS-1$ //$NON-NLS-2$
+ phpCfg.put("xdebug.profiler_output_dir", tmp.getParentFile().getAbsolutePath()); //$NON-NLS-1$
+ phpCfg.put("xdebug.profiler_output_name", tmp.getName()); //$NON-NLS-1$
+ launch.setAttribute(IPHPDebugConstants.CacheGrind_File, tmp.getAbsolutePath());
+ } catch (IOException e) {
+ PHPLaunchUtilities.showLaunchErrorMessage(PHPDebugCoreMessages.XDebug_ExeLaunchConfigurationDelegate_5);
+ monitor.setCanceled(true);
+ monitor.done();
+ return;
+ }
+ }
+ cmdLine = PHPLaunchUtilities.getCommandLine(configuration, phpExe.toOSString(), tempIni.toString(), phpCfg,
phpFile.toOSString(), args, phpV);
// Launch the process
@@ -270,7 +275,7 @@ public class XDebugExeLaunchConfigurationDelegate extends LaunchConfigurationDel
IProcess eclipseProcessWrapper = null;
if (phpExeProcess != null) {
subMonitor.worked(10);
- String processName = mode.equals(ILaunchManager.DEBUG_MODE)
+ String processName = enableDebugging
? (phpExe.toOSString() + ' ' + PHPDebugCoreMessages.PHPProcess_XDebug_suffix)
: phpExe.toOSString();
eclipseProcessWrapper = DebugPlugin.newProcess(launch, phpExeProcess, processName, processAttributes);
@@ -285,7 +290,7 @@ public class XDebugExeLaunchConfigurationDelegate extends LaunchConfigurationDel
// if launching in debug mode, create the debug infrastructure and
// link it with the launched process
- if (mode.equals(ILaunchManager.DEBUG_MODE) && target != null) {
+ if (enableDebugging && target != null) {
target.setProcess(eclipseProcessWrapper);
launch.addDebugTarget(target);
subMonitor.subTask(PHPDebugCoreMessages.XDebug_ExeLaunchConfigurationDelegate_4);
@@ -295,7 +300,7 @@ public class XDebugExeLaunchConfigurationDelegate extends LaunchConfigurationDel
} else {
// we did not launch
- if (mode.equals(ILaunchManager.DEBUG_MODE)) {
+ if (enableDebugging) {
DBGpSessionHandler.getInstance().removeSessionListener(target);
}
DebugPlugin.getDefault().getLaunchManager().removeLaunch(launch);
@@ -307,14 +312,14 @@ public class XDebugExeLaunchConfigurationDelegate extends LaunchConfigurationDel
* create any environment variables that may be required
*
* @param configuration
- * launch configuration
+ * launch configuration
* @param sessionID
- * the DBGp Session Id
+ * the DBGp Session Id
* @param ideKey
- * the DBGp ide key
+ * the DBGp ide key
* @return string array containing the environment
* @throws CoreException
- * rethrown exception
+ * rethrown exception
*/
public String[] createDebugLaunchEnvironment(ILaunchConfiguration configuration, String sessionID, String ideKey,
IPath phpExe) throws CoreException {
@@ -353,7 +358,7 @@ public class XDebugExeLaunchConfigurationDelegate extends LaunchConfigurationDel
* Displays a dialog with an error message.
*
* @param message
- * The error to display.
+ * The error to display.
*/
protected void displayErrorMessage(final String message) {
Display.getDefault().asyncExec(new Runnable() {
diff --git a/plugins/org.eclipse.php.debug.core/src/org/eclipse/php/internal/debug/core/launching/XDebugWebLaunchConfigurationDelegate.java b/plugins/org.eclipse.php.debug.core/src/org/eclipse/php/internal/debug/core/launching/XDebugWebLaunchConfigurationDelegate.java
index e4941cb..9e31508 100644
--- a/plugins/org.eclipse.php.debug.core/src/org/eclipse/php/internal/debug/core/launching/XDebugWebLaunchConfigurationDelegate.java
+++ b/plugins/org.eclipse.php.debug.core/src/org/eclipse/php/internal/debug/core/launching/XDebugWebLaunchConfigurationDelegate.java
@@ -1,314 +1,338 @@
-/*******************************************************************************
- * Copyright (c) 2009 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- * Zend Technologies
- *******************************************************************************/
-package org.eclipse.php.internal.debug.core.launching;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.*;
-import org.eclipse.debug.core.*;
-import org.eclipse.debug.core.model.IProcess;
-import org.eclipse.debug.core.model.LaunchConfigurationDelegate;
-import org.eclipse.jface.dialogs.MessageDialog;
-import org.eclipse.osgi.util.NLS;
-import org.eclipse.php.debug.core.debugger.launching.ILaunchDelegateListener;
-import org.eclipse.php.debug.core.debugger.parameters.IDebugParametersKeys;
-import org.eclipse.php.internal.debug.core.*;
-import org.eclipse.php.internal.debug.core.pathmapper.PathMapperRegistry;
-import org.eclipse.php.internal.debug.core.preferences.PHPProjectPreferences;
-import org.eclipse.php.internal.debug.core.xdebug.IDELayerFactory;
-import org.eclipse.php.internal.debug.core.xdebug.XDebugPreferenceMgr;
-import org.eclipse.php.internal.debug.core.xdebug.communication.XDebugCommunicationDaemon;
-import org.eclipse.php.internal.debug.core.xdebug.dbgp.DBGpBreakpointFacade;
-import org.eclipse.php.internal.debug.core.xdebug.dbgp.DBGpProxyHandler;
-import org.eclipse.php.internal.debug.core.xdebug.dbgp.DBGpProxyHandlersManager;
-import org.eclipse.php.internal.debug.core.xdebug.dbgp.XDebugDebuggerSettingsUtil;
-import org.eclipse.php.internal.debug.core.xdebug.dbgp.model.DBGpMultiSessionTarget;
-import org.eclipse.php.internal.debug.core.xdebug.dbgp.model.DBGpTarget;
-import org.eclipse.php.internal.debug.core.xdebug.dbgp.model.IDBGpDebugTarget;
-import org.eclipse.php.internal.debug.core.xdebug.dbgp.session.DBGpSessionHandler;
-import org.eclipse.php.internal.debug.core.xdebug.dbgp.session.IDBGpSessionListener;
-import org.eclipse.php.internal.server.core.Server;
-import org.eclipse.php.internal.server.core.manager.ServersManager;
-import org.eclipse.php.internal.server.core.tunneling.SSHTunnel;
-import org.eclipse.swt.widgets.Display;
-
-public class XDebugWebLaunchConfigurationDelegate extends LaunchConfigurationDelegate {
-
- private static final String LAUNCH_LISTENERS_EXTENSION_ID = "org.eclipse.php.debug.core.phpLaunchDelegateListener"; //$NON-NLS-1$
-
- /*
- * list of registered ILaunchDelegateListeners
- */
- private List<ILaunchDelegateListener> preLaunchListeners = new ArrayList<>();
-
- public XDebugWebLaunchConfigurationDelegate() {
- registerLaunchListeners();
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.debug.core.model.LaunchConfigurationDelegate#getLaunch(org.
- * eclipse.debug.core.ILaunchConfiguration, java.lang.String)
- */
- @Override
- public ILaunch getLaunch(ILaunchConfiguration configuration, String mode) throws CoreException {
- return new XDebugLaunch(configuration, mode, null);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.debug.core.model.ILaunchConfigurationDelegate#launch(org.
- * eclipse.debug.core.ILaunchConfiguration, java.lang.String,
- * org.eclipse.debug.core.ILaunch, org.eclipse.core.runtime.IProgressMonitor)
- */
- @Override
- public void launch(ILaunchConfiguration configuration, String mode, ILaunch launch, IProgressMonitor monitor)
- throws CoreException {
- // Notify all listeners of a pre-launch event.
- int resultCode = notifyPreLaunch(configuration, mode, launch, monitor);
- if (resultCode != 0) { // cancel launch
- monitor.setCanceled(true);
- monitor.done();
- return; // canceled
- }
- if (mode.equals(ILaunchManager.DEBUG_MODE)) {
- if (XDebugLaunchListener.getInstance().isWebLaunchActive()) {
- displayErrorMessage(PHPDebugCoreMessages.XDebug_WebLaunchConfigurationDelegate_0);
- DebugPlugin.getDefault().getLaunchManager().removeLaunch(launch);
- return;
- }
- PHPLaunchUtilities.showDebugView();
- }
- // Resolve the server
- Server server = ServersManager.getServer(configuration.getAttribute(Server.NAME, "")); //$NON-NLS-1$
- if (server == null) {
- Logger.log(Logger.ERROR, "Launch configuration could not find server"); //$NON-NLS-1$
- displayErrorMessage(PHPDebugCoreMessages.XDebug_WebLaunchConfigurationDelegate_1);
- DebugPlugin.getDefault().getLaunchManager().removeLaunch(launch);
- return;
- }
- // Get the project from the file name
- String fileName = configuration.getAttribute(Server.FILE_NAME, (String) null);
- IPath filePath = new Path(fileName);
- IProject proj = null;
- try {
- proj = ResourcesPlugin.getWorkspace().getRoot().getProject(filePath.segment(0));
- } catch (Throwable t) {
- if (proj == null) {
- Logger.logException("Could not execute the debug (Project is null).", t); //$NON-NLS-1$
- DebugPlugin.getDefault().getLaunchManager().removeLaunch(launch);
- return;
- }
- }
- // Save the project name for source lookup
- ILaunchConfigurationWorkingCopy wc = configuration.getWorkingCopy();
- String project = proj.getFullPath().toString();
- wc.setAttribute(IPHPDebugConstants.PHP_Project, project);
- wc.setAttribute(IDebugParametersKeys.TRANSFER_ENCODING, PHPProjectPreferences.getTransferEncoding(proj));
- wc.setAttribute(IDebugParametersKeys.OUTPUT_ENCODING, PHPProjectPreferences.getOutputEncoding(proj));
- wc.doSave();
- /*
- * Determine stop at first line (first calculate the default and then try to
- * extract the configuration attribute).
- */
- boolean stopAtFirstLine = PHPProjectPreferences.getStopAtFirstLine(proj);
- stopAtFirstLine = wc.getAttribute(IDebugParametersKeys.FIRST_LINE_BREAKPOINT, stopAtFirstLine);
- /*
- * Generate a session id for this launch and start the listener then create the
- * start and stop debug URLs
- */
- String[] startStopURLs;
- String baseURL = new String(configuration.getAttribute(Server.BASE_URL, "").getBytes()); //$NON-NLS-1$
- IDBGpDebugTarget target = null;
- SSHTunnel tunnel = null;
- if (mode.equals(ILaunchManager.DEBUG_MODE)) {
- String sessionId = DBGpSessionHandler.getInstance().generateSessionId();
- String ideKey = null;
- DBGpProxyHandler proxyHandler = DBGpProxyHandlersManager.INSTANCE.getHandler(server.getUniqueId());
- if (proxyHandler != null && proxyHandler.useProxy()) {
- ideKey = proxyHandler.getCurrentIdeKey();
- if (proxyHandler.registerWithProxy() == false) {
- displayErrorMessage(
- PHPDebugCoreMessages.XDebug_WebLaunchConfigurationDelegate_2 + proxyHandler.getErrorMsg());
- DebugPlugin.getDefault().getLaunchManager().removeLaunch(launch);
- return;
- }
- } else {
- ideKey = DBGpSessionHandler.getInstance().getIDEKey();
- }
- startStopURLs = generateStartStopDebugURLs(baseURL, sessionId, ideKey);
- String launchScript = configuration.getAttribute(Server.FILE_NAME, (String) null);
- // Check if a tunneled connection is needed and create request for a
- // tunnel if needed.
- tunnel = PHPLaunchUtilities.getSSHTunnel(configuration);
- // determine if we should use the multisession manager or the single
- // session manager
- if (XDebugPreferenceMgr.useMultiSession() == true) {
- target = new DBGpMultiSessionTarget(launch, launchScript, startStopURLs[1], ideKey, stopAtFirstLine);
- target.setPathMapper(PathMapperRegistry.getByServer(server));
- launch.addDebugTarget(target); // has to be added now, not
- } else {
- target = new DBGpTarget(launch, launchScript, startStopURLs[1], ideKey, null, stopAtFirstLine);
- target.setPathMapper(PathMapperRegistry.getByServer(server));
- IProcess process = new PHPProcess(launch,
- PHPDebugCoreMessages.XDebugWebLaunchConfigurationDelegate_PHP_process);
- process.setAttribute(IProcess.ATTR_PROCESS_TYPE, IPHPDebugConstants.PHPProcessType);
- ((DBGpTarget) target).setProcess(process);
- ((PHPProcess) process).setDebugTarget(target);
- launch.addProcess(process);
- }
- DBGpSessionHandler.getInstance().addSessionListener((IDBGpSessionListener) target);
- int requestPort = getDebugPort(server);
- if (!PHPLaunchUtilities.isDebugDaemonActive(requestPort, XDebugCommunicationDaemon.XDEBUG_DEBUGGER_ID)) {
- PHPLaunchUtilities.showLaunchErrorMessage(NLS.bind(
- PHPDebugCoreMessages.WebLaunchConfigurationDelegate_PortInUse, requestPort, server.getName()));
- monitor.setCanceled(true);
- monitor.done();
- return;
- }
-
- } else {
- startStopURLs = new String[] { baseURL, null };
- }
- final String startURL = startStopURLs[0];
- // Will be used in the future?
- @SuppressWarnings("unused")
- final SSHTunnel sshTunnel = tunnel;
- // load the URL into the appropriate web browser
- monitor.beginTask("", 10); //$NON-NLS-1$
- monitor.subTask(PHPDebugCoreMessages.XDebug_WebLaunchConfigurationDelegate_3);
- try {
- PHPDebugUtil.openLaunchURL(startURL);
- } catch (Exception e) {
- if (mode.equals(ILaunchManager.DEBUG_MODE)) {
- DBGpSessionHandler.getInstance().removeSessionListener((IDBGpSessionListener) target);
- }
- DebugPlugin.getDefault().getLaunchManager().removeLaunch(launch);
- monitor.done();
- return;
- }
- monitor.worked(5);
- if (mode.equals(ILaunchManager.DEBUG_MODE)) {
- launch.addDebugTarget(target);
- monitor.subTask(PHPDebugCoreMessages.XDebug_WebLaunchConfigurationDelegate_4);
- if (target != null) {
- target.waitForInitialSession((DBGpBreakpointFacade) IDELayerFactory.getIDELayer(),
- XDebugPreferenceMgr.createSessionPreferences(), monitor);
- }
- } else {
- /*
- * launched is not in debug mode, so remove the launch from the debug view as we
- * are not debugging anything.
- */
- DebugPlugin.getDefault().getLaunchManager().removeLaunch(launch);
- }
- monitor.worked(5);
- monitor.done();
- }
-
- /**
- * generate the URLS that start the debug environment and stop the debug
- * environment.
- *
- * @param baseURL
- * the base URL
- * @param sessionId
- * the DBGp session Id
- * @param ideKey
- * the DBGp IDE Key
- * @return start and stop queries
- */
- protected String[] generateStartStopDebugURLs(String baseURL, String sessionId, String ideKey) {
- String[] startStopURLs = new String[2];
- if (baseURL.indexOf("?") > -1) { //$NON-NLS-1$
- baseURL += "&"; //$NON-NLS-1$
- } else {
- baseURL += "?"; //$NON-NLS-1$
- }
- startStopURLs[0] = baseURL + "XDEBUG_SESSION_START=" + ideKey + "&KEY=" + sessionId; //$NON-NLS-1$ //$NON-NLS-2$
- startStopURLs[1] = baseURL + "XDEBUG_SESSION_STOP_NO_EXEC=" + ideKey + "&KEY=" + sessionId; //$NON-NLS-1$ //$NON-NLS-2$
- return startStopURLs;
- }
-
- protected int getDebugPort(Server server) {
- // Set custom port if any from debugger's owner settings
- int customRequestPort = XDebugDebuggerSettingsUtil.getDebugPort(server.getUniqueId());
- if (customRequestPort != -1) {
- return customRequestPort;
- }
- return PHPDebugPlugin.getDebugPort(XDebugCommunicationDaemon.XDEBUG_DEBUGGER_ID);
- }
-
- /**
- * Displays a dialog with an error message.
- *
- * @param message
- * The error to display.
- */
- protected void displayErrorMessage(final String message) {
- Display.getDefault().asyncExec(new Runnable() {
- @Override
- public void run() {
- MessageDialog.openError(Display.getDefault().getActiveShell(),
- PHPDebugCoreMessages.XDebugMessage_debugError, message);
- }
- });
- }
-
- protected int notifyPreLaunch(ILaunchConfiguration configuration, String mode, ILaunch launch,
- IProgressMonitor monitor) {
- for (ILaunchDelegateListener listener : preLaunchListeners) {
- int returnCode = listener.preLaunch(configuration, mode, launch, monitor);
- if (returnCode != 0) {
- return returnCode;
- }
- }
- return 0;
- }
-
- /**
- * Registers all pre-launch listeners.
- */
- private void registerLaunchListeners() {
- IConfigurationElement[] config = Platform.getExtensionRegistry()
- .getConfigurationElementsFor(LAUNCH_LISTENERS_EXTENSION_ID);
- try {
- for (IConfigurationElement e : config) {
- final Object o = e.createExecutableExtension("class"); //$NON-NLS-1$
- if (o instanceof ILaunchDelegateListener) {
- ISafeRunnable runnable = new ISafeRunnable() {
- @Override
- public void run() throws Exception {
- ILaunchDelegateListener listener = (ILaunchDelegateListener) o;
- Assert.isNotNull(listener);
- preLaunchListeners.add(listener);
- }
-
- @Override
- public void handleException(Throwable exception) {
- Logger.logException(exception);
- }
- };
- SafeRunner.run(runnable);
- }
- }
- } catch (CoreException ex) {
- Logger.logException(ex);
- }
- }
-
-}
+/*******************************************************************************
+ * Copyright (c) 2009 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ * Zend Technologies
+ *******************************************************************************/
+package org.eclipse.php.internal.debug.core.launching;
+
+import java.io.UnsupportedEncodingException;
+import java.net.URLEncoder;
+import java.util.ArrayList;
+import java.util.Enumeration;
+import java.util.Hashtable;
+import java.util.List;
+
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.*;
+import org.eclipse.debug.core.*;
+import org.eclipse.debug.core.model.IProcess;
+import org.eclipse.debug.core.model.LaunchConfigurationDelegate;
+import org.eclipse.jface.dialogs.MessageDialog;
+import org.eclipse.osgi.util.NLS;
+import org.eclipse.php.debug.core.debugger.launching.ILaunchDelegateListener;
+import org.eclipse.php.debug.core.debugger.parameters.IDebugParametersInitializer;
+import org.eclipse.php.debug.core.debugger.parameters.IDebugParametersKeys;
+import org.eclipse.php.internal.debug.core.*;
+import org.eclipse.php.internal.debug.core.pathmapper.PathMapperRegistry;
+import org.eclipse.php.internal.debug.core.preferences.PHPProjectPreferences;
+import org.eclipse.php.internal.debug.core.xdebug.IDELayerFactory;
+import org.eclipse.php.internal.debug.core.xdebug.XDebugPreferenceMgr;
+import org.eclipse.php.internal.debug.core.xdebug.communication.XDebugCommunicationDaemon;
+import org.eclipse.php.internal.debug.core.xdebug.dbgp.DBGpBreakpointFacade;
+import org.eclipse.php.internal.debug.core.xdebug.dbgp.DBGpProxyHandler;
+import org.eclipse.php.internal.debug.core.xdebug.dbgp.DBGpProxyHandlersManager;
+import org.eclipse.php.internal.debug.core.xdebug.dbgp.XDebugDebuggerSettingsUtil;
+import org.eclipse.php.internal.debug.core.xdebug.dbgp.model.DBGpMultiSessionTarget;
+import org.eclipse.php.internal.debug.core.xdebug.dbgp.model.DBGpTarget;
+import org.eclipse.php.internal.debug.core.xdebug.dbgp.model.IDBGpDebugTarget;
+import org.eclipse.php.internal.debug.core.xdebug.dbgp.session.DBGpSessionHandler;
+import org.eclipse.php.internal.debug.core.xdebug.dbgp.session.IDBGpSessionListener;
+import org.eclipse.php.internal.debug.core.zend.debugger.DebugParametersInitializersRegistry;
+import org.eclipse.php.internal.server.core.Server;
+import org.eclipse.php.internal.server.core.manager.ServersManager;
+import org.eclipse.php.internal.server.core.tunneling.SSHTunnel;
+import org.eclipse.swt.widgets.Display;
+
+public class XDebugWebLaunchConfigurationDelegate extends LaunchConfigurationDelegate {
+
+ private static final String LAUNCH_LISTENERS_EXTENSION_ID = "org.eclipse.php.debug.core.phpLaunchDelegateListener"; //$NON-NLS-1$
+
+ /*
+ * list of registered ILaunchDelegateListeners
+ */
+ private List<ILaunchDelegateListener> preLaunchListeners = new ArrayList<>();
+
+ public XDebugWebLaunchConfigurationDelegate() {
+ registerLaunchListeners();
+ }
+
+ @Override
+ public ILaunch getLaunch(ILaunchConfiguration configuration, String mode) throws CoreException {
+ return new XDebugLaunch(configuration, mode, null);
+ }
+
+ @Override
+ public void launch(ILaunchConfiguration configuration, String mode, ILaunch launch, IProgressMonitor monitor)
+ throws CoreException {
+ // Notify all listeners of a pre-launch event.
+ int resultCode = notifyPreLaunch(configuration, mode, launch, monitor);
+ if (resultCode != 0) { // cancel launch
+ monitor.setCanceled(true);
+ monitor.done();
+ return; // canceled
+ }
+ if (mode.equals(ILaunchManager.DEBUG_MODE)) {
+ if (XDebugLaunchListener.getInstance().isWebLaunchActive()) {
+ displayErrorMessage(PHPDebugCoreMessages.XDebug_WebLaunchConfigurationDelegate_0);
+ DebugPlugin.getDefault().getLaunchManager().removeLaunch(launch);
+ return;
+ }
+ PHPLaunchUtilities.showDebugView();
+ }
+ // Resolve the server
+ Server server = ServersManager.getServer(configuration.getAttribute(Server.NAME, "")); //$NON-NLS-1$
+ if (server == null) {
+ Logger.log(Logger.ERROR, "Launch configuration could not find server"); //$NON-NLS-1$
+ displayErrorMessage(PHPDebugCoreMessages.XDebug_WebLaunchConfigurationDelegate_1);
+ DebugPlugin.getDefault().getLaunchManager().removeLaunch(launch);
+ return;
+ }
+ // Get the project from the file name
+ String fileName = configuration.getAttribute(Server.FILE_NAME, (String) null);
+ IPath filePath = new Path(fileName);
+ IProject proj = null;
+ try {
+ proj = ResourcesPlugin.getWorkspace().getRoot().getProject(filePath.segment(0));
+ } catch (Throwable t) {
+ if (proj == null) {
+ Logger.logException("Could not execute the debug (Project is null).", t); //$NON-NLS-1$
+ DebugPlugin.getDefault().getLaunchManager().removeLaunch(launch);
+ return;
+ }
+ }
+ // Save the project name for source lookup
+ ILaunchConfigurationWorkingCopy wc = configuration.getWorkingCopy();
+ String project = proj.getFullPath().toString();
+ wc.setAttribute(IPHPDebugConstants.PHP_Project, project);
+ wc.setAttribute(IDebugParametersKeys.TRANSFER_ENCODING, PHPProjectPreferences.getTransferEncoding(proj));
+ wc.setAttribute(IDebugParametersKeys.OUTPUT_ENCODING, PHPProjectPreferences.getOutputEncoding(proj));
+ wc.doSave();
+ /*
+ * Determine stop at first line (first calculate the default and then try to
+ * extract the configuration attribute).
+ */
+ boolean stopAtFirstLine = PHPProjectPreferences.getStopAtFirstLine(proj);
+ stopAtFirstLine = wc.getAttribute(IDebugParametersKeys.FIRST_LINE_BREAKPOINT, stopAtFirstLine);
+ /*
+ * Generate a session id for this launch and start the listener then create the
+ * start and stop debug URLs
+ */
+ String[] startStopURLs;
+ String baseURL = new String(configuration.getAttribute(Server.BASE_URL, "").getBytes()); //$NON-NLS-1$
+
+ IDebugParametersInitializer parametersInitializer = DebugParametersInitializersRegistry
+ .getBestMatchDebugParametersInitializer(launch);
+
+ Hashtable<String, String> params = parametersInitializer.getDebugParameters(launch);
+
+ IDBGpDebugTarget target = null;
+ SSHTunnel tunnel = null;
+ if (mode.equals(ILaunchManager.DEBUG_MODE)) {
+ String sessionId = DBGpSessionHandler.getInstance().generateSessionId();
+ String ideKey = null;
+ DBGpProxyHandler proxyHandler = DBGpProxyHandlersManager.INSTANCE.getHandler(server.getUniqueId());
+ if (proxyHandler != null && proxyHandler.useProxy()) {
+ ideKey = proxyHandler.getCurrentIdeKey();
+ if (proxyHandler.registerWithProxy() == false) {
+ displayErrorMessage(
+ PHPDebugCoreMessages.XDebug_WebLaunchConfigurationDelegate_2 + proxyHandler.getErrorMsg());
+ DebugPlugin.getDefault().getLaunchManager().removeLaunch(launch);
+ return;
+ }
+ } else {
+ ideKey = DBGpSessionHandler.getInstance().getIDEKey();
+ }
+ startStopURLs = generateStartStopDebugURLs(baseURL, sessionId, ideKey, params);
+ String launchScript = configuration.getAttribute(Server.FILE_NAME, (String) null);
+ // Check if a tunneled connection is needed and create request for a
+ // tunnel if needed.
+ tunnel = PHPLaunchUtilities.getSSHTunnel(configuration);
+ // determine if we should use the multisession manager or the single
+ // session manager
+ if (XDebugPreferenceMgr.useMultiSession() == true) {
+ target = new DBGpMultiSessionTarget(launch, launchScript, startStopURLs[1], ideKey, stopAtFirstLine);
+ target.setPathMapper(PathMapperRegistry.getByServer(server));
+ launch.addDebugTarget(target); // has to be added now, not
+ } else {
+ target = new DBGpTarget(launch, launchScript, startStopURLs[1], ideKey, null, stopAtFirstLine);
+ target.setPathMapper(PathMapperRegistry.getByServer(server));
+ IProcess process = new PHPProcess(launch,
+ PHPDebugCoreMessages.XDebugWebLaunchConfigurationDelegate_PHP_process);
+ process.setAttribute(IProcess.ATTR_PROCESS_TYPE, IPHPDebugConstants.PHPProcessType);
+ ((DBGpTarget) target).setProcess(process);
+ ((PHPProcess) process).setDebugTarget(target);
+ launch.addProcess(process);
+ }
+ DBGpSessionHandler.getInstance().addSessionListener((IDBGpSessionListener) target);
+ int requestPort = getDebugPort(server);
+ if (!PHPLaunchUtilities.isDebugDaemonActive(requestPort, XDebugCommunicationDaemon.XDEBUG_DEBUGGER_ID)) {
+ PHPLaunchUtilities.showLaunchErrorMessage(NLS.bind(
+ PHPDebugCoreMessages.WebLaunchConfigurationDelegate_PortInUse, requestPort, server.getName()));
+ monitor.setCanceled(true);
+ monitor.done();
+ return;
+ }
+
+ } else {
+ startStopURLs = generateStartStopDebugURLs(baseURL, null, null, params);
+ }
+ final String startURL = startStopURLs[0];
+ // Will be used in the future?
+ @SuppressWarnings("unused")
+ final SSHTunnel sshTunnel = tunnel;
+ // load the URL into the appropriate web browser
+ monitor.beginTask("", 10); //$NON-NLS-1$
+ monitor.subTask(PHPDebugCoreMessages.XDebug_WebLaunchConfigurationDelegate_3);
+ try {
+ PHPDebugUtil.openLaunchURL(startURL);
+ } catch (Exception e) {
+ if (mode.equals(ILaunchManager.DEBUG_MODE)) {
+ DBGpSessionHandler.getInstance().removeSessionListener((IDBGpSessionListener) target);
+ }
+ DebugPlugin.getDefault().getLaunchManager().removeLaunch(launch);
+ monitor.done();
+ return;
+ }
+ monitor.worked(5);
+ if (mode.equals(ILaunchManager.DEBUG_MODE)) {
+ launch.addDebugTarget(target);
+ monitor.subTask(PHPDebugCoreMessages.XDebug_WebLaunchConfigurationDelegate_4);
+ if (target != null) {
+ target.waitForInitialSession((DBGpBreakpointFacade) IDELayerFactory.getIDELayer(),
+ XDebugPreferenceMgr.createSessionPreferences(), monitor);
+ }
+ } else {
+ /*
+ * launched is not in debug mode, so remove the launch from the debug view as we
+ * are not debugging anything.
+ */
+ DebugPlugin.getDefault().getLaunchManager().removeLaunch(launch);
+ }
+ monitor.worked(5);
+ monitor.done();
+ }
+
+ /**
+ * generate the URLS that start the debug environment and stop the debug
+ * environment.
+ *
+ * @param baseURL
+ * the base URL
+ * @param sessionId
+ * the DBGp session Id
+ * @param ideKey
+ * the DBGp IDE Key
+ * @return start and stop queries
+ */
+ protected String[] generateStartStopDebugURLs(String baseURL, String sessionId, String ideKey,
+ Hashtable<String, String> params) {
+ String[] startStopURLs = new String[2];
+ StringBuilder sb = new StringBuilder(baseURL);
+ if (sessionId != null || params.size() > 0) {
+ if (baseURL.indexOf("?") > -1) { //$NON-NLS-1$
+ sb.append('&');
+ } else {
+ sb.append('?');
+ }
+
+ Enumeration<String> e = params.keys();
+ while (e.hasMoreElements()) {
+ String key = e.nextElement();
+ sb.append(key).append('=');
+ try {
+ sb.append(URLEncoder.encode(params.get(key), "UTF-8")); //$NON-NLS-1$
+ } catch (UnsupportedEncodingException exc) {
+ }
+ sb.append('&');
+ }
+ if (sessionId == null) {
+ sb.setLength(sb.length() - 1);
+ }
+ }
+
+ if (sessionId == null) {
+ startStopURLs[0] = sb.toString();
+ } else {
+ baseURL = sb.toString();
+ startStopURLs[0] = baseURL + "XDEBUG_SESSION_START=" + ideKey + "&KEY=" + sessionId; //$NON-NLS-1$ //$NON-NLS-2$
+ startStopURLs[1] = baseURL + "XDEBUG_SESSION_STOP_NO_EXEC=" + ideKey + "&KEY=" + sessionId; //$NON-NLS-1$ //$NON-NLS-2$
+
+ }
+ return startStopURLs;
+ }
+
+ protected int getDebugPort(Server server) {
+ // Set custom port if any from debugger's owner settings
+ int customRequestPort = XDebugDebuggerSettingsUtil.getDebugPort(server.getUniqueId());
+ if (customRequestPort != -1) {
+ return customRequestPort;
+ }
+ return PHPDebugPlugin.getDebugPort(XDebugCommunicationDaemon.XDEBUG_DEBUGGER_ID);
+ }
+
+ /**
+ * Displays a dialog with an error message.
+ *
+ * @param message
+ * The error to display.
+ */
+ protected void displayErrorMessage(final String message) {
+ Display.getDefault().asyncExec(new Runnable() {
+ @Override
+ public void run() {
+ MessageDialog.openError(Display.getDefault().getActiveShell(),
+ PHPDebugCoreMessages.XDebugMessage_debugError, message);
+ }
+ });
+ }
+
+ protected int notifyPreLaunch(ILaunchConfiguration configuration, String mode, ILaunch launch,
+ IProgressMonitor monitor) {
+ for (ILaunchDelegateListener listener : preLaunchListeners) {
+ int returnCode = listener.preLaunch(configuration, mode, launch, monitor);
+ if (returnCode != 0) {
+ return returnCode;
+ }
+ }
+ return 0;
+ }
+
+ /**
+ * Registers all pre-launch listeners.
+ */
+ private void registerLaunchListeners() {
+ IConfigurationElement[] config = Platform.getExtensionRegistry()
+ .getConfigurationElementsFor(LAUNCH_LISTENERS_EXTENSION_ID);
+ try {
+ for (IConfigurationElement e : config) {
+ final Object o = e.createExecutableExtension("class"); //$NON-NLS-1$
+ if (o instanceof ILaunchDelegateListener) {
+ ISafeRunnable runnable = new ISafeRunnable() {
+ @Override
+ public void run() throws Exception {
+ ILaunchDelegateListener listener = (ILaunchDelegateListener) o;
+ Assert.isNotNull(listener);
+ preLaunchListeners.add(listener);
+ }
+
+ @Override
+ public void handleException(Throwable exception) {
+ Logger.logException(exception);
+ }
+ };
+ SafeRunner.run(runnable);
+ }
+ }
+ } catch (CoreException ex) {
+ Logger.logException(ex);
+ }
+ }
+
+}
diff --git a/plugins/org.eclipse.php.debug.core/src/org/eclipse/php/internal/debug/core/zend/debugger/DebugParametersInitializersRegistry.java b/plugins/org.eclipse.php.debug.core/src/org/eclipse/php/internal/debug/core/zend/debugger/DebugParametersInitializersRegistry.java
index c7dc4d5..4569392 100644
--- a/plugins/org.eclipse.php.debug.core/src/org/eclipse/php/internal/debug/core/zend/debugger/DebugParametersInitializersRegistry.java
+++ b/plugins/org.eclipse.php.debug.core/src/org/eclipse/php/internal/debug/core/zend/debugger/DebugParametersInitializersRegistry.java
@@ -94,7 +94,7 @@ public class DebugParametersInitializersRegistry {
* IDebugParametersInitializer is always a new instance.
*
* @param id
- * The debug parameters initializer ID
+ * The debug parameters initializer ID
* @return A new instance of an IDebugParametersInitializer
*/
public static IDebugParametersInitializer getParametersInitializer(String id) throws Exception {
@@ -140,7 +140,6 @@ public class DebugParametersInitializersRegistry {
try {
Dictionary<String, DebugParametersInitializerFactory> factories = getInstance()
.getInitializersFactories(launch.getLaunchMode());
-
// 1st try to get the one with matching configuration type
for (Enumeration<DebugParametersInitializerFactory> e = factories.elements(); e.hasMoreElements();) {
DebugParametersInitializerFactory initializerFactory = e.nextElement();
diff --git a/plugins/org.eclipse.php.debug.core/src/org/eclipse/php/internal/debug/core/zend/debugger/parameters/DefaultDebugParametersInitializer.java b/plugins/org.eclipse.php.debug.core/src/org/eclipse/php/internal/debug/core/zend/debugger/parameters/DefaultDebugParametersInitializer.java
index 6d11c13..b1d1fbe 100644
--- a/plugins/org.eclipse.php.debug.core/src/org/eclipse/php/internal/debug/core/zend/debugger/parameters/DefaultDebugParametersInitializer.java
+++ b/plugins/org.eclipse.php.debug.core/src/org/eclipse/php/internal/debug/core/zend/debugger/parameters/DefaultDebugParametersInitializer.java
@@ -25,6 +25,7 @@ import org.eclipse.php.debug.core.debugger.parameters.IWebDebugParametersInitial
import org.eclipse.php.internal.debug.core.IPHPDebugConstants;
import org.eclipse.php.internal.debug.core.Logger;
import org.eclipse.php.internal.debug.core.PHPDebugPlugin;
+import org.eclipse.php.internal.debug.core.launching.XDebugLaunch;
import org.eclipse.php.internal.debug.core.preferences.PHPDebugCorePreferenceNames;
import org.eclipse.php.internal.debug.core.zend.debugger.ZendDebuggerSettingsUtil;
import org.eclipse.php.internal.server.core.Server;
@@ -51,16 +52,14 @@ public class DefaultDebugParametersInitializer extends AbstractDebugParametersIn
public static final String IS_PROFILE_URL = "isProfileURL"; //$NON-NLS-1$
public static final String DEBUG_LINE_BP = "debug_line_bp"; //$NON-NLS-1$
- /*
- * (non-Javadoc)
- *
- * @seeorg.eclipse.php.internal.debug.core.debugger.parameters.
- * IDebugParametersInitializer
- * #generateQueryParameters(org.eclipse.debug.core.ILaunch)
- */
@Override
public Hashtable<String, String> getDebugParameters(ILaunch launch) {
Hashtable<String, String> parameters = new Hashtable<>();
+
+ if (launch instanceof XDebugLaunch) {
+ return parameters;
+ }
+
ILaunchConfiguration launchConfiguration = launch.getLaunchConfiguration();
parameters.put(START_DEBUG, "1"); //$NON-NLS-1$
diff --git a/plugins/org.eclipse.php.profile.core/META-INF/MANIFEST.MF b/plugins/org.eclipse.php.profile.core/META-INF/MANIFEST.MF
index 1132a24..1df5984 100644
--- a/plugins/org.eclipse.php.profile.core/META-INF/MANIFEST.MF
+++ b/plugins/org.eclipse.php.profile.core/META-INF/MANIFEST.MF
@@ -16,4 +16,5 @@ Bundle-Vendor: Eclipse PDT
Export-Package: org.eclipse.php.profile.core,
org.eclipse.php.profile.core.data,
org.eclipse.php.profile.core.engine,
+ org.eclipse.php.profile.core.engine.cachegrind,
org.eclipse.php.profile.core.messages
diff --git a/plugins/org.eclipse.php.profile.core/plugin.properties b/plugins/org.eclipse.php.profile.core/plugin.properties
index 0ad2144..7982eeb 100644
--- a/plugins/org.eclipse.php.profile.core/plugin.properties
+++ b/plugins/org.eclipse.php.profile.core/plugin.properties
@@ -8,4 +8,4 @@
# Contributors:
# Rogue Wave Software Inc. - initial API and implementation
###############################################################################
-PHPPDTLaunchDelegate.profile.label=Eclipse PDT (Zend Profiler) \ No newline at end of file
+PHPPDTLaunchDelegate.profile.label=Eclipse PDT (Profiler)
diff --git a/plugins/org.eclipse.php.profile.core/plugin.xml b/plugins/org.eclipse.php.profile.core/plugin.xml
index 82ff8b6..306f202 100644
--- a/plugins/org.eclipse.php.profile.core/plugin.xml
+++ b/plugins/org.eclipse.php.profile.core/plugin.xml
@@ -1,99 +1,104 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<?eclipse version="3.4"?>
-<!--
- Copyright (c) 2017 Rogue Wave Software Inc. and others.
- All rights reserved. This program and the accompanying materials
- are made available under the terms of the Eclipse Public License v1.0
- which accompanies this distribution, and is available at
- http://www.eclipse.org/legal/epl-v10.html
-
- Contributors:
- Rogue Wave Software Inc. - initial implementation
- -->
-<plugin>
- <extension
- point="org.eclipse.php.debug.core.phpDebugMessages">
- <message
- class="org.eclipse.php.profile.core.messages.GetProfilerCallTraceRequest"
- id="org.eclipse.php.profile.core.messages.GetProfilerCallTraceRequest"
- name="Get Profiler Call Trace Request"/>
- <message
- class="org.eclipse.php.profile.core.messages.GetProfilerCallTraceResponse"
- id="org.eclipse.php.profile.core.messages.GetProfilerCallTraceResponse"
- name="Get Profiler Call Trace Response"/>
- <message
- class="org.eclipse.php.profile.core.messages.GetProfilerFileRequest"
- id="org.eclipse.php.profile.core.messages.GetProfilerFileRequest"
- name="Get Profiler File Request"/>
- <message
- class="org.eclipse.php.profile.core.messages.GetProfilerFileResponse"
- id="org.eclipse.php.profile.core.messages.GetProfilerFileResponse"
- name="Get Profiler File Response"/>
- <message
- class="org.eclipse.php.profile.core.messages.GetProfilerRequest"
- id="org.eclipse.php.profile.core.messages.GetProfilerRequest"
- name="Get Profiler Request"/>
- <message
- class="org.eclipse.php.profile.core.messages.GetProfilerResponse"
- id="org.eclipse.php.profile.core.messages.GetProfilerResponse"
- name="Get Profiler Response"/>
- </extension>
- <extension
- point="org.eclipse.php.debug.core.phpDebugHandlers">
- <handler
- class="org.eclipse.php.profile.core.engine.ZProfiler"
- id="org.eclipse.php.profile.core.engine.ZProfiler"
- name="Zend Profiler">
- </handler>
- </extension>
- <extension
- point="org.eclipse.php.debug.core.phpDebugParametersInitializers">
- <initializer
- class="org.eclipse.php.profile.core.engine.ProfileParametersInitializer"
- handler="org.eclipse.php.profile.core.engine.ZProfiler"
- id="org.eclipse.php.profile.core.engine.ProfileParametersInitializer"
- mode="profile"
- name="Profile Parameters Initializer">
- </initializer>
- </extension>
- <extension
- point="org.eclipse.debug.core.launchDelegates">
- <launchDelegate
- delegate="org.eclipse.php.internal.debug.core.launching.PHPLaunchDelegateProxy"
- id="org.eclipse.php.debug.core.launching.launchDelegate.phpExeProfile"
- modes="profile"
- name="%PHPPDTLaunchDelegate.profile.label"
- sourceLocatorId="org.eclipse.php.debug.core.sourceLookupDirector.php"
- sourcePathComputerId="org.eclipse.php.debug.core.sourcePathComputer.php"
- type="org.eclipse.php.debug.core.launching.PHPExeLaunchConfigurationType">
- <modeCombination
- modes="profile">
- </modeCombination>
- </launchDelegate>
- <launchDelegate
- delegate="org.eclipse.php.internal.debug.core.launching.PHPLaunchDelegateProxy"
- id="org.eclipse.php.debug.core.launching.launchDelegate.phpWebProfile"
- modes="profile"
- name="%PHPPDTLaunchDelegate.profile.label"
- sourceLocatorId="org.eclipse.php.debug.core.sourceLookupDirector.php"
- sourcePathComputerId="org.eclipse.php.debug.core.sourcePathComputer.php"
- type="org.eclipse.php.debug.core.launching.webPageLaunch">
- <modeCombination
- modes="profile">
- </modeCombination>
- </launchDelegate>
- <launchDelegate
- delegate="org.eclipse.php.internal.debug.core.launching.PHPRemoteLaunchConfigurationDelegate"
- id="org.eclipse.php.debug.core.launching.launchDelegate.remotePHPProfile"
- modes="profile"
- name="%PHPPDTLaunchDelegate.profile.label"
- sourceLocatorId="org.eclipse.php.debug.core.sourceLookupDirector.php"
- sourcePathComputerId="org.eclipse.php.debug.core.sourcePathComputer.php"
- type="org.eclipse.php.debug.core.remotePHPLaunchConfigurationType">
- <modeCombination
- modes="profile">
- </modeCombination>
- </launchDelegate>
- </extension>
-
-</plugin>
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse version="3.4"?>
+<!--
+ Copyright (c) 2017 Rogue Wave Software Inc. and others.
+ All rights reserved. This program and the accompanying materials
+ are made available under the terms of the Eclipse Public License v1.0
+ which accompanies this distribution, and is available at
+ http://www.eclipse.org/legal/epl-v10.html
+
+ Contributors:
+ Rogue Wave Software Inc. - initial implementation
+ -->
+<plugin>
+ <extension
+ point="org.eclipse.php.debug.core.phpDebugMessages">
+ <message
+ class="org.eclipse.php.profile.core.messages.GetProfilerCallTraceRequest"
+ id="org.eclipse.php.profile.core.messages.GetProfilerCallTraceRequest"
+ name="Get Profiler Call Trace Request"/>
+ <message
+ class="org.eclipse.php.profile.core.messages.GetProfilerCallTraceResponse"
+ id="org.eclipse.php.profile.core.messages.GetProfilerCallTraceResponse"
+ name="Get Profiler Call Trace Response"/>
+ <message
+ class="org.eclipse.php.profile.core.messages.GetProfilerFileRequest"
+ id="org.eclipse.php.profile.core.messages.GetProfilerFileRequest"
+ name="Get Profiler File Request"/>
+ <message
+ class="org.eclipse.php.profile.core.messages.GetProfilerFileResponse"
+ id="org.eclipse.php.profile.core.messages.GetProfilerFileResponse"
+ name="Get Profiler File Response"/>
+ <message
+ class="org.eclipse.php.profile.core.messages.GetProfilerRequest"
+ id="org.eclipse.php.profile.core.messages.GetProfilerRequest"
+ name="Get Profiler Request"/>
+ <message
+ class="org.eclipse.php.profile.core.messages.GetProfilerResponse"
+ id="org.eclipse.php.profile.core.messages.GetProfilerResponse"
+ name="Get Profiler Response"/>
+ </extension>
+ <extension
+ point="org.eclipse.php.debug.core.phpDebugHandlers">
+ <handler
+ class="org.eclipse.php.profile.core.engine.ZProfiler"
+ id="org.eclipse.php.profile.core.engine.ZProfiler"
+ name="Zend Profiler">
+ </handler>
+ <handler
+ class="org.eclipse.php.profile.core.engine.XProfiler"
+ id="org.eclipse.php.profile.core.engine.XProfiler"
+ name="xDebug Profiler">
+ </handler>
+ </extension>
+ <extension
+ point="org.eclipse.php.debug.core.phpDebugParametersInitializers">
+ <initializer
+ class="org.eclipse.php.profile.core.engine.ProfileParametersInitializer"
+ handler="org.eclipse.php.profile.core.engine.ZProfiler"
+ id="org.eclipse.php.profile.core.engine.ProfileParametersInitializer"
+ mode="profile"
+ name="Profile Parameters Initializer">
+ </initializer>
+ </extension>
+ <extension
+ point="org.eclipse.debug.core.launchDelegates">
+ <launchDelegate
+ delegate="org.eclipse.php.internal.debug.core.launching.PHPLaunchDelegateProxy"
+ id="org.eclipse.php.debug.core.launching.launchDelegate.phpExeProfile"
+ modes="profile"
+ name="%PHPPDTLaunchDelegate.profile.label"
+ sourceLocatorId="org.eclipse.php.debug.core.sourceLookupDirector.php"
+ sourcePathComputerId="org.eclipse.php.debug.core.sourcePathComputer.php"
+ type="org.eclipse.php.debug.core.launching.PHPExeLaunchConfigurationType">
+ <modeCombination
+ modes="profile">
+ </modeCombination>
+ </launchDelegate>
+ <launchDelegate
+ delegate="org.eclipse.php.internal.debug.core.launching.PHPLaunchDelegateProxy"
+ id="org.eclipse.php.debug.core.launching.launchDelegate.phpWebProfile"
+ modes="profile"
+ name="%PHPPDTLaunchDelegate.profile.label"
+ sourceLocatorId="org.eclipse.php.debug.core.sourceLookupDirector.php"
+ sourcePathComputerId="org.eclipse.php.debug.core.sourcePathComputer.php"
+ type="org.eclipse.php.debug.core.launching.webPageLaunch">
+ <modeCombination
+ modes="profile">
+ </modeCombination>
+ </launchDelegate>
+ <launchDelegate
+ delegate="org.eclipse.php.internal.debug.core.launching.PHPRemoteLaunchConfigurationDelegate"
+ id="org.eclipse.php.debug.core.launching.launchDelegate.remotePHPProfile"
+ modes="profile"
+ name="%PHPPDTLaunchDelegate.profile.label"
+ sourceLocatorId="org.eclipse.php.debug.core.sourceLookupDirector.php"
+ sourcePathComputerId="org.eclipse.php.debug.core.sourcePathComputer.php"
+ type="org.eclipse.php.debug.core.remotePHPLaunchConfigurationType">
+ <modeCombination
+ modes="profile">
+ </modeCombination>
+ </launchDelegate>
+ </extension>
+
+</plugin>
diff --git a/plugins/org.eclipse.php.profile.core/src/org/eclipse/php/profile/core/PHPProfileCoreMessages.java b/plugins/org.eclipse.php.profile.core/src/org/eclipse/php/profile/core/PHPProfileCoreMessages.java
index d03cd5a..3a8231f 100644
--- a/plugins/org.eclipse.php.profile.core/src/org/eclipse/php/profile/core/PHPProfileCoreMessages.java
+++ b/plugins/org.eclipse.php.profile.core/src/org/eclipse/php/profile/core/PHPProfileCoreMessages.java
@@ -24,6 +24,14 @@ public class PHPProfileCoreMessages extends NLS {
NLS.initializeMessages(BUNDLE_NAME, PHPProfileCoreMessages.class);
}
+ public static String PHPLaunchListener_0;
+ public static String PHPLaunchListener_1;
+ public static String PHPLaunchListener_2;
+ public static String PHPLaunchListener_3;
+ public static String PHPLaunchListener_4;
+ public static String PHPLaunchListener_5;
+ public static String PHPLaunchListener_6;
+ public static String PHPLaunchListener_7;
public static String PHPProfilePerspectiveOpener_confirmDialog_0;
public static String PHPProfilePerspectiveOpener_confirmDialog_1;
public static String PHPProfilePerspectiveOpener_confirmDialog_2;
diff --git a/plugins/org.eclipse.php.profile.core/src/org/eclipse/php/profile/core/PHPProfileCoreMessages.properties b/plugins/org.eclipse.php.profile.core/src/org/eclipse/php/profile/core/PHPProfileCoreMessages.properties
index 23ef448..f4aef84 100644
--- a/plugins/org.eclipse.php.profile.core/src/org/eclipse/php/profile/core/PHPProfileCoreMessages.properties
+++ b/plugins/org.eclipse.php.profile.core/src/org/eclipse/php/profile/core/PHPProfileCoreMessages.properties
@@ -8,8 +8,17 @@
# Contributors:
# Rogue Wave Software Inc. - initial API and implementation
###############################################################################
+PHPLaunchListener_0=xDebug profiling session:
PHPProfilePerspectiveOpener_confirmDialog_0=Confirm Open Perspective
PHPProfilePerspectiveOpener_confirmDialog_1=The PHP Profiler is associated with the {0} perspective. Do you want to open that perspective now?
PHPProfilePerspectiveOpener_confirmDialog_2=&Remember my decision
ProfilerGlobalData_0=Not available
ZProfiler_0=Collecting profiling information...
+
+PHPLaunchListener_1=Wait for CacheGrind file
+PHPLaunchListener_2=Waiting for process ends
+PHPLaunchListener_3=Importing file
+PHPLaunchListener_4=No profiling session found
+PHPLaunchListener_5=Read error: {0}
+PHPLaunchListener_6=Cache Grind file is empty
+PHPLaunchListener_7=Cache Grind file not exists
diff --git a/plugins/org.eclipse.php.profile.core/src/org/eclipse/php/profile/core/PHPProfileCorePlugin.java b/plugins/org.eclipse.php.profile.core/src/org/eclipse/php/profile/core/PHPProfileCorePlugin.java
index 5b653ba..809c6d7 100644
--- a/plugins/org.eclipse.php.profile.core/src/org/eclipse/php/profile/core/PHPProfileCorePlugin.java
+++ b/plugins/org.eclipse.php.profile.core/src/org/eclipse/php/profile/core/PHPProfileCorePlugin.java
@@ -13,6 +13,8 @@ package org.eclipse.php.profile.core;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Plugin;
import org.eclipse.core.runtime.Status;
+import org.eclipse.debug.core.DebugPlugin;
+import org.eclipse.php.profile.core.engine.PHPLaunchListener;
import org.osgi.framework.BundleContext;
/**
@@ -23,6 +25,8 @@ public class PHPProfileCorePlugin extends Plugin {
public static final String ID = "org.eclipse.php.profile.core"; //$NON-NLS-1$
public static final int INTERNAL_ERROR = 10001;
+ private PHPLaunchListener listener;
+
// The shared instance.
private static PHPProfileCorePlugin plugin;
@@ -39,6 +43,8 @@ public class PHPProfileCorePlugin extends Plugin {
@Override
public void start(BundleContext context) throws Exception {
super.start(context);
+ listener = new PHPLaunchListener();
+ DebugPlugin.getDefault().getLaunchManager().addLaunchListener(listener);
}
/**
@@ -47,6 +53,7 @@ public class PHPProfileCorePlugin extends Plugin {
@Override
public void stop(BundleContext context) throws Exception {
super.stop(context);
+ DebugPlugin.getDefault().getLaunchManager().removeLaunchListener(listener);
plugin = null;
}
diff --git a/plugins/org.eclipse.php.profile.core/src/org/eclipse/php/profile/core/data/ProfilerCallTrace.java b/plugins/org.eclipse.php.profile.core/src/org/eclipse/php/profile/core/data/ProfilerCallTrace.java
index 237467e..ce14b6c 100644
--- a/plugins/org.eclipse.php.profile.core/src/org/eclipse/php/profile/core/data/ProfilerCallTrace.java
+++ b/plugins/org.eclipse.php.profile.core/src/org/eclipse/php/profile/core/data/ProfilerCallTrace.java
@@ -10,7 +10,7 @@
*******************************************************************************/
package org.eclipse.php.profile.core.data;
-import java.util.ArrayList;
+import java.util.LinkedList;
import java.util.List;
/**
@@ -22,7 +22,7 @@ public class ProfilerCallTrace {
private int fLayersCount;
public ProfilerCallTrace() {
- fLayers = new ArrayList<>();
+ fLayers = new LinkedList<>();
}
public ProfilerCallTrace(List<ProfilerCallTraceLayer> layers) {
diff --git a/plugins/org.eclipse.php.profile.core/src/org/eclipse/php/profile/core/data/ProfilerCallTraceLayer.java b/plugins/org.eclipse.php.profile.core/src/org/eclipse/php/profile/core/data/ProfilerCallTraceLayer.java
index 3170b69..601b648 100644
--- a/plugins/org.eclipse.php.profile.core/src/org/eclipse/php/profile/core/data/ProfilerCallTraceLayer.java
+++ b/plugins/org.eclipse.php.profile.core/src/org/eclipse/php/profile/core/data/ProfilerCallTraceLayer.java
@@ -136,9 +136,10 @@ public class ProfilerCallTraceLayer {
* Sets the duration in according to the timestamp(enter time) and the exit time
*
* @param exitTimeSeconds
- * - the exit time from the function in seconds
+ * - the exit time from the function in seconds
* @param exitTimeMicroseconds
- * - the exit time from the function in microseconds
+ * - the exit time from the function in
+ * microseconds
*/
public void setDuration(long exitTimeSeconds, long exitTimeMicroseconds) {
long startSecond = fTimestampSeconds;
@@ -160,14 +161,14 @@ public class ProfilerCallTraceLayer {
/**
* Sets the line number
*/
- private void setLine(int lineNumber) {
+ public void setLine(int lineNumber) {
this.fLineNumber = lineNumber;
}
/**
* Sets the calledID
*/
- private void setCalledID(int calledID) {
+ public void setCalledID(int calledID) {
this.fCalledID = calledID;
}
}
diff --git a/plugins/org.eclipse.php.profile.core/src/org/eclipse/php/profile/core/data/ProfilerFunctionData.java b/plugins/org.eclipse.php.profile.core/src/org/eclipse/php/profile/core/data/ProfilerFunctionData.java
index 2cae8d6..c247b20 100644
--- a/plugins/org.eclipse.php.profile.core/src/org/eclipse/php/profile/core/data/ProfilerFunctionData.java
+++ b/plugins/org.eclipse.php.profile.core/src/org/eclipse/php/profile/core/data/ProfilerFunctionData.java
@@ -10,7 +10,8 @@
*******************************************************************************/
package org.eclipse.php.profile.core.data;
-import java.io.File;
+import java.nio.file.Path;
+import java.nio.file.Paths;
import java.util.regex.Pattern;
/**
@@ -96,8 +97,8 @@ public class ProfilerFunctionData {
* Sets the file name
*/
public void setFileName(String fileName) {
- File f = new File(fileName);
- this.fFileName = f.getName();
+ Path p = Paths.get(fileName);
+ this.fFileName = p.getFileName().toString();
this.fAbsoluteFileName = fileName;
}
@@ -112,7 +113,7 @@ public class ProfilerFunctionData {
* Sets local file name
*
* @param String
- * file name
+ * file name
*/
public void setLocalFileName(String name) {
this.fLocalFileName = name;
@@ -124,6 +125,9 @@ public class ProfilerFunctionData {
* @return String file name
*/
public String getLocalFileName() {
+ if (this.fLocalFileName == null) {
+ return this.fAbsoluteFileName;
+ }
return this.fLocalFileName;
}
diff --git a/plugins/org.eclipse.php.profile.core/src/org/eclipse/php/profile/core/engine/PHPLaunchListener.java b/plugins/org.eclipse.php.profile.core/src/org/eclipse/php/profile/core/engine/PHPLaunchListener.java
new file mode 100644
index 0000000..409c187
--- /dev/null
+++ b/plugins/org.eclipse.php.profile.core/src/org/eclipse/php/profile/core/engine/PHPLaunchListener.java
@@ -0,0 +1,107 @@
+/*******************************************************************************
+ * Copyright (c) 2018 Dawid Pakula and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Dawid Pakula - initial implementation
+ *******************************************************************************/
+package org.eclipse.php.profile.core.engine;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileNotFoundException;
+import java.io.IOException;
+import java.util.Date;
+
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.core.runtime.SubMonitor;
+import org.eclipse.core.runtime.jobs.Job;
+import org.eclipse.debug.core.ILaunch;
+import org.eclipse.debug.core.ILaunchListener;
+import org.eclipse.debug.core.ILaunchManager;
+import org.eclipse.osgi.util.NLS;
+import org.eclipse.php.internal.debug.core.IPHPDebugConstants;
+import org.eclipse.php.profile.core.PHPProfileCoreMessages;
+import org.eclipse.php.profile.core.PHPProfileCorePlugin;
+import org.eclipse.php.profile.core.data.ProfilerData;
+import org.eclipse.php.profile.core.engine.cachegrind.CacheGrindModelParser;
+
+public class PHPLaunchListener implements ILaunchListener {
+
+ @Override
+ public void launchRemoved(ILaunch launch) {
+
+ }
+
+ @Override
+ public void launchAdded(ILaunch launch) {
+ }
+
+ @Override
+ public void launchChanged(ILaunch launch) {
+ if (launch.getLaunchMode().equals(ILaunchManager.PROFILE_MODE)
+ && launch.getAttribute(IPHPDebugConstants.CacheGrind_File) != null) {
+ new Job(PHPProfileCoreMessages.PHPLaunchListener_0 + launch.getLaunchConfiguration().getName()) {
+
+ @Override
+ protected IStatus run(IProgressMonitor monitor) {
+ SubMonitor sub = SubMonitor.convert(monitor, 2);
+ sub.beginTask(PHPProfileCoreMessages.PHPLaunchListener_1, 2);
+ sub.setBlocked(new Status(IStatus.OK, PHPProfileCorePlugin.ID,
+ PHPProfileCoreMessages.PHPLaunchListener_2));
+ while (!monitor.isCanceled() && !launch.isTerminated()) {
+ try {
+ Thread.sleep(50);
+ } catch (InterruptedException e) {
+ return Status.CANCEL_STATUS;
+ }
+ }
+ sub.clearBlocked();
+ sub.worked(1);
+ sub.beginTask(PHPProfileCoreMessages.PHPLaunchListener_3, 1);
+ if (monitor.isCanceled()) {
+ return Status.CANCEL_STATUS;
+ }
+ File f = new File(launch.getAttribute(IPHPDebugConstants.CacheGrind_File));
+ if (f.exists()) {
+ if (f.length() > 0) {
+ try {
+ CacheGrindModelParser tmp = new CacheGrindModelParser(new FileInputStream(f));
+ ProfilerData[] models = tmp.buildModel();
+ if (monitor.isCanceled()) {
+ return Status.CANCEL_STATUS;
+ }
+ for (ProfilerData model : models) {
+ ProfileSessionsManager.addSession(new DefaultProfilerDB(model, new Date()));
+ }
+ f.delete();
+ if (models.length == 0) {
+ return new Status(IStatus.ERROR, PHPProfileCorePlugin.ID,
+ PHPProfileCoreMessages.PHPLaunchListener_4);
+ }
+ } catch (FileNotFoundException e) {
+ // ignore, already checked
+ } catch (IOException e) {
+ return new Status(IStatus.ERROR, PHPProfileCorePlugin.ID,
+ NLS.bind(PHPProfileCoreMessages.PHPLaunchListener_5, e.getMessage()));
+ }
+ } else {
+ return new Status(IStatus.ERROR, PHPProfileCorePlugin.ID,
+ PHPProfileCoreMessages.PHPLaunchListener_6);
+ }
+ } else {
+ return new Status(IStatus.ERROR, PHPProfileCorePlugin.ID,
+ PHPProfileCoreMessages.PHPLaunchListener_7);
+ }
+ return Status.OK_STATUS;
+ }
+ }.schedule();
+ }
+ }
+
+}
diff --git a/plugins/org.eclipse.php.profile.core/src/org/eclipse/php/profile/core/engine/ProfileParametersInitializer.java b/plugins/org.eclipse.php.profile.core/src/org/eclipse/php/profile/core/engine/ProfileParametersInitializer.java
index 5f22c54..21b97b3 100644
--- a/plugins/org.eclipse.php.profile.core/src/org/eclipse/php/profile/core/engine/ProfileParametersInitializer.java
+++ b/plugins/org.eclipse.php.profile.core/src/org/eclipse/php/profile/core/engine/ProfileParametersInitializer.java
@@ -12,19 +12,39 @@ package org.eclipse.php.profile.core.engine;
import java.util.Hashtable;
+import org.eclipse.core.runtime.CoreException;
import org.eclipse.debug.core.ILaunch;
+import org.eclipse.debug.core.ILaunchManager;
+import org.eclipse.php.internal.debug.core.IPHPDebugConstants;
+import org.eclipse.php.internal.debug.core.Logger;
+import org.eclipse.php.internal.debug.core.launching.XDebugLaunch;
import org.eclipse.php.internal.debug.core.zend.debugger.parameters.DefaultDebugParametersInitializer;
/**
- * Zend profiler parameters initializer.
+ * Zend and xdebug profiler parameters initializer.
*/
public class ProfileParametersInitializer extends DefaultDebugParametersInitializer {
@Override
public Hashtable<String, String> getDebugParameters(ILaunch launch) {
- // Fill standard parameters
- Hashtable<String, String> parameters = super.getDebugParameters(launch);
- parameters.put(START_PROFILE, "1"); //$NON-NLS-1$
+ Hashtable<String, String> parameters;
+ if (launch instanceof XDebugLaunch) {
+ parameters = new Hashtable<>();
+ if (launch.getLaunchMode().equals(ILaunchManager.PROFILE_MODE)) {
+ try {
+ if (launch.getLaunchConfiguration().getAttribute(IPHPDebugConstants.XDEBUG_PROFILE_TRIGGER, true)) {
+ parameters.put("XDEBUG_PROFILE", launch.getLaunchConfiguration() //$NON-NLS-1$
+ .getAttribute(IPHPDebugConstants.XDEBUG_PROFILE_TRIGGER_VALUE, "")); //$NON-NLS-1$
+ }
+ } catch (CoreException e) {
+ Logger.logException(e);
+ }
+ }
+ return parameters;
+ } else {
+ parameters = super.getDebugParameters(launch);
+ parameters.put(START_PROFILE, "1"); //$NON-NLS-1$
+ }
return parameters;
}
}
diff --git a/plugins/org.eclipse.php.profile.core/src/org/eclipse/php/profile/core/engine/ProfilerDataSerializationUtil.java b/plugins/org.eclipse.php.profile.core/src/org/eclipse/php/profile/core/engine/ProfilerDataSerializationUtil.java
index fa59448..8cd2183 100644
--- a/plugins/org.eclipse.php.profile.core/src/org/eclipse/php/profile/core/engine/ProfilerDataSerializationUtil.java
+++ b/plugins/org.eclipse.php.profile.core/src/org/eclipse/php/profile/core/engine/ProfilerDataSerializationUtil.java
@@ -23,12 +23,7 @@ import javax.xml.parsers.DocumentBuilderFactory;
import org.eclipse.php.internal.core.util.XMLWriter;
import org.eclipse.php.internal.debug.core.zend.debugger.CodeCoverageData;
import org.eclipse.php.profile.core.PHPProfileCorePlugin;
-import org.eclipse.php.profile.core.data.ProfilerCallTrace;
-import org.eclipse.php.profile.core.data.ProfilerCallTraceLayer;
-import org.eclipse.php.profile.core.data.ProfilerData;
-import org.eclipse.php.profile.core.data.ProfilerFileData;
-import org.eclipse.php.profile.core.data.ProfilerFunctionData;
-import org.eclipse.php.profile.core.data.ProfilerGlobalData;
+import org.eclipse.php.profile.core.data.*;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
@@ -45,7 +40,7 @@ public class ProfilerDataSerializationUtil {
* Used for serialization
*
* @param XMLWriter
- * xml
+ * xml
*/
private ProfilerDataSerializationUtil(XMLWriter xml) {
fXML = xml;
@@ -258,6 +253,7 @@ public class ProfilerDataSerializationUtil {
profilerDBs.add(db);
}
}
+
return profilerDBs.toArray(new ProfilerDB[profilerDBs.size()]);
} catch (Exception e) {
diff --git a/plugins/org.eclipse.php.profile.core/src/org/eclipse/php/profile/core/engine/XProfiler.java b/plugins/org.eclipse.php.profile.core/src/org/eclipse/php/profile/core/engine/XProfiler.java
new file mode 100644
index 0000000..1e6082b
--- /dev/null
+++ b/plugins/org.eclipse.php.profile.core/src/org/eclipse/php/profile/core/engine/XProfiler.java
@@ -0,0 +1,71 @@
+/*******************************************************************************
+ * Copyright (c) 2017 Rogue Wave Software Inc. and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Rogue Wave Software Inc. - initial implementation
+ *******************************************************************************/
+package org.eclipse.php.profile.core.engine;
+
+import org.eclipse.php.debug.core.debugger.IDebugHandler;
+import org.eclipse.php.internal.debug.core.zend.debugger.DebugError;
+import org.eclipse.php.internal.debug.core.zend.debugger.IRemoteDebugger;
+import org.eclipse.php.internal.debug.core.zend.model.ServerDebugHandler;
+import org.eclipse.php.profile.core.data.ProfilerCallTrace;
+import org.eclipse.php.profile.core.data.ProfilerData;
+import org.eclipse.php.profile.core.data.ProfilerFileData;
+import org.eclipse.php.profile.core.data.ProfilerGlobalData;
+
+public class XProfiler extends ServerDebugHandler implements IProfiler, IDebugHandler {
+
+ private ProfilerDBManager fDBManager;
+ private boolean fParsingErrorOccurred;
+
+ @Override
+ protected IRemoteDebugger createRemoteDebugger() {
+ return new ZRemoteProfiler(this, fDebugConnection);
+ }
+
+ public ProfilerDB getProfilerDB() {
+ return fDBManager;
+ }
+
+ @Override
+ public ProfilerGlobalData getProfilerGlobalData() {
+ return null;
+ }
+
+ @Override
+ public ProfilerFileData getProfilerFileData(int fileNumber) {
+ return null;
+ }
+
+ @Override
+ public ProfilerCallTrace getProfilerCallTrace() {
+ return null;
+ }
+
+ @Override
+ public ProfilerData getProfilerData() {
+ return null;
+ }
+
+ @Override
+ public void handleScriptEnded() {
+
+ }
+
+ @Override
+ public void sessionStarted(String fileName, String uri, String query, String options) {
+
+ }
+
+ @Override
+ public void parsingErrorOccured(DebugError debugError) {
+
+ }
+
+}
diff --git a/plugins/org.eclipse.php.profile.core/src/org/eclipse/php/profile/core/engine/ZProfiler.java b/plugins/org.eclipse.php.profile.core/src/org/eclipse/php/profile/core/engine/ZProfiler.java
index ee7551b..9806c7f 100644
--- a/plugins/org.eclipse.php.profile.core/src/org/eclipse/php/profile/core/engine/ZProfiler.java
+++ b/plugins/org.eclipse.php.profile.core/src/org/eclipse/php/profile/core/engine/ZProfiler.java
@@ -35,12 +35,6 @@ public class ZProfiler extends ServerDebugHandler implements IProfiler, IDebugHa
private String fAdditionalOptions = ""; //$NON-NLS-1$
private boolean fParsingErrorOccurred;
- /*
- * (non-Javadoc)
- *
- * @see com.zend.php.debug.core.debugger.AdvancedDebugHandler#
- * createRemoteDebugger ()
- */
@Override
protected IRemoteDebugger createRemoteDebugger() {
return new ZRemoteProfiler(this, fDebugConnection);
@@ -50,56 +44,30 @@ public class ZProfiler extends ServerDebugHandler implements IProfiler, IDebugHa
return fDBManager;
}
- /*
- * (non-Javadoc)
- *
- * @see com.zend.php.profile.core.profiler.IProfiler#getProfilerGlobalData()
- */
@Override
public ProfilerGlobalData getProfilerGlobalData() {
ZRemoteProfiler remoteProfiler = (ZRemoteProfiler) getRemoteDebugger();
return remoteProfiler.getProfilerGlobalData();
}
- /*
- * (non-Javadoc)
- *
- * @see com.zend.php.profile.core.profiler.IProfiler#getProfilerFileData(int)
- */
@Override
public ProfilerFileData getProfilerFileData(int fileNumber) {
ZRemoteProfiler remoteProfiler = (ZRemoteProfiler) getRemoteDebugger();
return remoteProfiler.getProfilerFileData(fileNumber);
}
- /*
- * (non-Javadoc)
- *
- * @see com.zend.php.profile.core.profiler.IProfiler#getProfilerCallTrace()
- */
@Override
public ProfilerCallTrace getProfilerCallTrace() {
ZRemoteProfiler remoteProfiler = (ZRemoteProfiler) getRemoteDebugger();
return remoteProfiler.getProfilerCallTrace();
}
- /*
- * (non-Javadoc)
- *
- * @see com.zend.php.profile.core.profiler.IProfiler#getProfilerData()
- */
@Override
public ProfilerData getProfilerData() {
ZRemoteProfiler remoteProfiler = (ZRemoteProfiler) getRemoteDebugger();
return remoteProfiler.getProfilerData();
}
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.php.internal.debug.core.debugger.IDebugHandler#
- * handleScriptEnded ()
- */
@Override
public void handleScriptEnded() {
try {
@@ -147,25 +115,12 @@ public class ZProfiler extends ServerDebugHandler implements IProfiler, IDebugHa
}
}
- /*
- * (non-Javadoc)
- *
- * @see
- * org.eclipse.php.internal.debug.core.debugger.IDebugHandler#sessionStarted
- * (java.lang.String, java.lang.String, java.lang.String, java.lang.String)
- */
@Override
public void sessionStarted(String fileName, String uri, String query, String options) {
super.sessionStarted(fileName, uri, query, options);
fParsingErrorOccurred = false;
}
- /*
- * (non-Javadoc)
- *
- * @seeorg.eclipse.php.internal.debug.core.model.ServerDebugHandler#
- * parsingErrorOccured (org.eclipse.php.internal.debug.core.debugger.DebugError)
- */
@Override
public void parsingErrorOccured(DebugError debugError) {
if (DebugError.isError(debugError)) {
diff --git a/plugins/org.eclipse.php.profile.core/src/org/eclipse/php/profile/core/engine/cachegrind/CacheGrindModelParser.java b/plugins/org.eclipse.php.profile.core/src/org/eclipse/php/profile/core/engine/cachegrind/CacheGrindModelParser.java
new file mode 100644
index 0000000..4698560
--- /dev/null
+++ b/plugins/org.eclipse.php.profile.core/src/org/eclipse/php/profile/core/engine/cachegrind/CacheGrindModelParser.java
@@ -0,0 +1,405 @@
+/*******************************************************************************
+ * Copyright (c) 2018 Dawid Pakuła and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Dawid Pakuła - initial implementation
+ *******************************************************************************/
+package org.eclipse.php.profile.core.engine.cachegrind;
+
+import java.io.FileInputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.*;
+
+import org.eclipse.php.profile.core.data.*;
+import org.eclipse.php.profile.core.engine.DefaultProfilerDB;
+import org.eclipse.php.profile.core.engine.ProfilerDB;
+import org.eclipse.php.profile.core.engine.cachegrind.CacheGrindParser.CacheGrindParserListener;
+
+public class CacheGrindModelParser {
+ private static final String MAIN = "{main}"; //$NON-NLS-1$
+ private CacheGrindParser source;
+ private ProfilerData model;
+ private List<ProfilerData> models = new ArrayList<>();
+
+ private class File {
+ public int index;
+ public String name;
+ public Map<Integer, Function> functions = new HashMap<>();
+
+ public File(int index) {
+ this.index = index;
+ }
+ }
+
+ private class Function {
+ public int index;
+ public int id;
+ public String name;
+ public int position = -1;
+ public int cost = 0;
+ public int totalCost = 0;
+ public int calls = 0;
+ public Deque<Invocation> pendingInvocations = new ArrayDeque<>();
+
+ public Function(int id, int index) {
+ this.id = id;
+ this.index = index;
+ }
+
+ }
+
+ private class Invocation {
+ public Function function;
+ public List<Invocation> calls = new LinkedList<>();
+ public int cost;
+ public int position;
+ public int count = 0;
+ }
+
+ private int fileCounter = 1;
+ private int functionCounter = 1;
+ private int fileFunctionCounter = 1;
+ private int timeIndex = 0;
+
+ private Map<String, Integer> fileIds = new HashMap<>();
+ private Map<String, Integer> functionIds = new HashMap<>();
+ private Map<Integer, String> functionNames = new HashMap<>();
+ private Map<Integer, File> files = new HashMap<>();
+ private Map<Integer, Invocation> invocations = new HashMap<>();
+
+ private File lastFile;
+ private File callFile;
+ private Invocation lastFunction;
+ private Invocation lastCall;
+ private Invocation mainCall;
+
+ private class ParserListener implements CacheGrindParserListener {
+
+ @Override
+ public void cmd(String cmd) {
+ finishCurrent();
+ model = new ProfilerData(new ProfilerGlobalData(), new LinkedList<>(), new ProfilerCallTrace());
+ models.add(model);
+ model.getGlobalData().setPath(cmd);
+ model.getGlobalData().setOriginalURL(ProfilerGlobalData.URL_NOT_AVAILABLE_MSG);
+ }
+
+ @Override
+ public void events(String[] events) {
+ int pos = 0;
+ for (String item : events) {
+ if (item.equalsIgnoreCase("Time")) { //$NON-NLS-1$
+ timeIndex = pos;
+ break;
+ }
+ pos++;
+ }
+ }
+
+ public int getTime(int[] values) {
+ if (values.length <= timeIndex) {
+ return 0;
+ } else {
+ return values[timeIndex] * 100;
+ }
+ }
+
+ @Override
+ public void file(int id, String name) {
+ finishSubCalls();
+ lastFunction = null;
+ callFile = null;
+ lastCall = null;
+
+ lastFile = regFile(id, name);
+ }
+
+ @Override
+ public void function(int id, String name) {
+ if (lastFile == null) {
+ return;
+ }
+ lastFunction = null;
+ callFile = null;
+ lastCall = null;
+
+ boolean main = false;
+ if (id < 0) {
+ if (!functionIds.containsKey(name)) {
+ id = functionCounter++;
+ functionIds.put(name, id);
+ if (MAIN.equals(name)) {
+ main = true;
+ }
+ } else {
+ id = functionIds.get(name);
+ }
+ } else if (name != null) {
+ if (MAIN.equals(name)) {
+ main = true;
+ }
+ functionIds.put(name, id);
+ }
+
+ Function fnc;
+ if (!lastFile.functions.containsKey(id)) {
+ fnc = new Function(fileFunctionCounter++, id);
+ lastFile.functions.put(id, fnc);
+ } else {
+ fnc = lastFile.functions.get(id);
+ }
+ if (name != null) {
+ fnc.name = name;
+ functionNames.put(id, name);
+ }
+
+ lastFunction = new Invocation();
+ lastFunction.function = fnc;
+ fnc.pendingInvocations.push(lastFunction);
+ if (main) {
+ mainCall = lastFunction;
+ }
+ }
+
+ @Override
+ public void cost(int pos, int[] events) {
+ int cost = getTime(events);
+ if (lastCall != null) {
+ lastCall.position = pos;
+ lastFunction.function.totalCost += cost;
+ lastFunction.cost += cost;
+ } else if (lastFunction != null) {
+ lastFunction.function.position = pos;
+ lastFunction.function.cost += cost;
+ lastFunction.function.totalCost += cost;
+ lastFunction.cost += cost;
+ lastFunction.position = pos;
+ }
+ }
+
+ @Override
+ public void calls(int count, int[] values) {
+ if (lastCall != null) {
+ lastCall.count += count;
+ }
+ }
+
+ @Override
+ public void nextFile(int id, String name) {
+ if (lastFile == null) {
+ return;
+ }
+ callFile = regFile(id, name);
+ }
+
+ @Override
+ public void nextFunction(int id, String name) {
+ if (lastFile == null) {
+ return;
+ }
+ if (callFile == null) {
+ callFile = lastFile;
+ }
+
+ if (id < 0) {
+ if (!functionIds.containsKey(name)) {
+ id = functionCounter++;
+ functionIds.put(name, id);
+ } else {
+ id = functionIds.get(name);
+ }
+ } else if (name != null) {
+ functionIds.put(name, id);
+ }
+
+ Function fnc;
+ if (!callFile.functions.containsKey(id)) {
+ fnc = new Function(fileFunctionCounter++, id);
+ callFile.functions.put(id, fnc);
+ } else {
+ fnc = callFile.functions.get(id);
+ }
+ if (name != null) {
+ fnc.name = name;
+ }
+ lastCall = new Invocation();
+ lastCall.function = fnc;
+ lastFunction.calls.add(lastCall);
+
+ callFile = null;
+ }
+
+ @Override
+ public void summary(int[] sum) {
+ model.getGlobalData().setTimeMicroSeconds(getTime(sum));
+ }
+ }
+
+ public CacheGrindModelParser(InputStream file) {
+ source = new CacheGrindParser(file);
+ }
+
+ private File regFile(int id, String name) {
+ if (id == -1) {
+ if (fileIds.containsKey(name)) {
+ return files.get(fileIds.get(name));
+ } else {
+ id = fileCounter--;
+
+ File tmp = new File(id);
+ tmp.name = name;
+ fileIds.put(name, id);
+ files.put(id, tmp);
+ return tmp;
+ }
+ } else {
+ File tmp;
+ if (files.containsKey(id)) {
+ tmp = files.get(id);
+ } else {
+ tmp = new File(id);
+ files.put(id, tmp);
+ }
+ if (name != null) {
+ tmp.name = name;
+ }
+ return tmp;
+ }
+ }
+
+ public ProfilerData[] buildModel() throws IOException {
+ model = new ProfilerData(new ProfilerGlobalData(), new ArrayList<>(), new ProfilerCallTrace());
+ source.parse(new ParserListener());
+
+ finishCurrent();
+
+ return models.toArray(new ProfilerData[0]);
+ }
+
+ private void finishCurrent() {
+ if (model.getGlobalData().getPath() == null) {
+ return;
+ }
+ if (mainCall == null) {
+ mainCall = lastFunction;
+ }
+ finishSubCalls();
+ if (mainCall != null) {
+ buildCallTree(mainCall);
+ }
+
+ List<String> fileNames = new ArrayList<>(files.size());
+ for (File file : files.values()) {
+ if (file.name == null) {
+ file.name = String.valueOf(file.index);
+ }
+ ProfilerFileData modelFile = new ProfilerFileData(file.name);
+ for (Function fnc : file.functions.values()) {
+ if (fnc.name == null) {
+ fnc.name = functionNames.get(fnc.index);
+ if (fnc.name == null) {
+ fnc.name = String.valueOf(fnc.index);
+ }
+ }
+ ProfilerFunctionData modelFnc = new ProfilerFunctionData(file.name);
+ int i = fnc.name.indexOf("::"); //$NON-NLS-1$
+ if (i == -1) {
+ i = fnc.name.indexOf("->"); //$NON-NLS-1$
+ }
+ if (i != -1) {
+ String className = fnc.name.substring(0, i);
+ String fName = fnc.name.substring(i + 2);
+ if (fName.equals(file.name)) {
+ modelFnc.setFunctionName(new StringBuilder(className).append(':').append(fName).toString());
+ } else {
+ if (!file.name.equals("php:internal") && !className.equals("php")) { //$NON-NLS-1$ //$NON-NLS-2$
+ modelFnc.setClassName(className);
+ }
+ modelFnc.setFunctionName(fName);
+ }
+ } else {
+ modelFnc.setFunctionName(fnc.name);
+ }
+
+ modelFnc.setLineNumber(fnc.position);
+ modelFnc.setCallsCount(fnc.calls);
+ modelFnc.setTotalTimeMicroseconds(fnc.totalCost);
+ modelFnc.setOwnTimeMicroseconds(fnc.cost);
+ if (mainCall != null) {
+ modelFnc.setID(fnc.id == mainCall.function.id ? -1 : fnc.id);
+ }
+
+ modelFile.addFunction(modelFnc);
+ }
+ model.addFile(modelFile);
+ fileNames.add(file.name);
+ }
+
+ model.getGlobalData().setFileCount(files.size());
+ model.getGlobalData().setFileNames(fileNames.toArray(new String[0]));
+
+ fileIds.clear();
+ functionNames.clear();
+ functionIds.clear();
+ files.clear();
+ invocations.clear();
+ fileCounter = functionCounter = fileFunctionCounter = 1;
+ timeIndex = 0;
+
+ lastFile = null;
+ lastFunction = null;
+ mainCall = null;
+ }
+
+ private void finishSubCalls() {
+ if (lastFunction == null || lastFunction.calls.isEmpty()) {
+ return;
+ }
+
+ ListIterator<Invocation> it = lastFunction.calls.listIterator(lastFunction.calls.size());
+ Invocation[] realCalls = new Invocation[lastFunction.calls.size()];
+ while (it.hasPrevious()) {
+ int index = it.previousIndex();
+ Invocation call = it.previous();
+ Invocation realCall = call.function.pendingInvocations.pop();
+ realCall.position = call.position;
+ realCalls[index] = realCall;
+ realCall.function.calls += call.count;
+ }
+ lastFunction.calls = Arrays.asList(realCalls);
+ }
+
+ private void buildCallTree(Invocation inv) {
+
+ ProfilerCallTraceLayer lr = new ProfilerCallTraceLayer();
+ int id = inv == mainCall ? -1 : inv.function.id;
+ lr.setCalledID(id);
+ lr.setType(ProfilerCallTraceLayer.ENTER);
+ lr.setLine(inv.position);
+ model.getCallTrace().addLayer(lr);
+ for (Invocation sub : inv.calls) {
+ buildCallTree(sub);
+ }
+
+ lr = new ProfilerCallTraceLayer();
+ lr.setCalledID(id);
+ lr.setTimestampMicroseconds(inv.cost);
+ lr.setType(ProfilerCallTraceLayer.EXIT);
+ lr.setLine(inv.position);
+ model.getCallTrace().addLayer(lr);
+ }
+
+ public static ProfilerDB[] build(FileInputStream stream) throws IOException {
+ CacheGrindModelParser tmp = new CacheGrindModelParser(stream);
+ List<ProfilerDB> db = new ArrayList<>();
+ for (ProfilerData model : tmp.buildModel()) {
+ db.add(new DefaultProfilerDB(model, new Date()));
+ }
+ return db.toArray(new ProfilerDB[0]);
+ }
+}
diff --git a/plugins/org.eclipse.php.profile.core/src/org/eclipse/php/profile/core/engine/cachegrind/CacheGrindParser.java b/plugins/org.eclipse.php.profile.core/src/org/eclipse/php/profile/core/engine/cachegrind/CacheGrindParser.java
new file mode 100644
index 0000000..a428a46
--- /dev/null
+++ b/plugins/org.eclipse.php.profile.core/src/org/eclipse/php/profile/core/engine/cachegrind/CacheGrindParser.java
@@ -0,0 +1,719 @@
+/*******************************************************************************
+ * Copyright (c) 2018 Dawid Pakuła and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Dawid Pakuła - initial implementation
+ *******************************************************************************/
+package org.eclipse.php.profile.core.engine.cachegrind;
+
+import java.io.*;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+import java.util.stream.Collectors;
+
+public class CacheGrindParser {
+ private InputStream fFile;
+
+ public static interface CacheGrindParserListener {
+ default void events(String[] events) {
+ }
+
+ default void version(String version) {
+ }
+
+ default void creator(String creator) {
+ }
+
+ default void unknown(String line) {
+ }
+
+ default void positions(String[] type) {
+ }
+
+ default void part(int part) {
+ }
+
+ default void cmd(String cmd) {
+ }
+
+ default void calls(int count, int[] values) {
+ }
+
+ default void pid(int pid) {
+ }
+
+ default void summary(int[] sum) {
+ }
+
+ default void totals(int[] sum) {
+ }
+
+ default void file(int id, String name) {
+ }
+
+ default void function(int id, String name) {
+ }
+
+ default void nextFile(int id, String name) {
+ }
+
+ default void nextFunction(int id, String name) {
+ }
+
+ default void cost(int pos, int[] events) {
+ }
+
+ }
+
+ private static interface State {
+ boolean valid(char letter);
+
+ default void consume(CacheGrindParserListener listener) {
+ }
+
+ void reset();
+ }
+
+ private static abstract class TagState implements State {
+ private final char[] name;
+ private int pointer = 0;
+
+ public TagState(char[] name) {
+ this.name = name;
+ }
+
+ @Override
+ public boolean valid(char letter) {
+ if (pointer > name.length) {
+ if (pointer == name.length + 1) {
+ pointer++;
+ return letter == ' ' || letter == '\t';
+ }
+ return next().valid(letter);
+ } else if (pointer == name.length && letter == ':') {
+ pointer++;
+ return true;
+ } else if (name[pointer] == letter) {
+ pointer++;
+ return true;
+ }
+ return false;
+ }
+
+ public abstract State next();
+
+ public void reset() {
+ pointer = 0;
+ next().reset();
+ }
+ }
+
+ private static abstract class BlockState implements State {
+ private final char[] name;
+ private int pointer = 0;
+
+ public BlockState(char[] name) {
+ this.name = name;
+ }
+
+ @Override
+ public boolean valid(char letter) {
+ if (pointer >= name.length) {
+ return next().valid(letter);
+ } else if (name.length > pointer && name[pointer] == letter) {
+ pointer++;
+ return true;
+ }
+ return false;
+ }
+
+ public abstract State next();
+
+ public void reset() {
+ pointer = 0;
+ next().reset();
+ }
+ }
+
+ private static class StringState implements State {
+
+ private StringBuilder sb = new StringBuilder();
+
+ @Override
+ public boolean valid(char letter) {
+ sb.append(letter);
+ return true;
+ }
+
+ @Override
+ public void reset() {
+ sb.setLength(0);
+ }
+
+ public String result() {
+ return sb.toString();
+ }
+ }
+
+ private static class StringsState implements State {
+
+ private StringBuilder sb = new StringBuilder();
+ private List<String> strings = new ArrayList<>();
+
+ @Override
+ public boolean valid(char letter) {
+ if (letter == ' ' || letter == '\t') {
+ collect();
+ } else {
+ sb.append(letter);
+ }
+ return true;
+ }
+
+ @Override
+ public void reset() {
+ sb.setLength(0);
+ strings.clear();
+ }
+
+ private void collect() {
+ if (sb.length() > 0) {
+ strings.add(sb.toString());
+ sb.setLength(0);
+ }
+ }
+
+ public String[] result() {
+ collect();
+ return strings.toArray(new String[0]);
+ }
+ }
+
+ private static class NameState implements State {
+ private static final int WAIT_INDEX = -1;
+ private static final int WAIT_INDEX_NUM = -2;
+ private static final int WAIT_SPACE = -4;
+ private static final int WAIT_NAME = -8;
+ private int index = WAIT_INDEX;
+ private NumberState num = new NumberState();
+ private StringState name = new StringState();
+
+ @Override
+ public boolean valid(char letter) {
+ if (index == WAIT_INDEX) {
+ if (letter == '(') {
+ index = WAIT_INDEX_NUM;
+ return true;
+ } else {
+ index = WAIT_NAME;
+ }
+ } else if (index == WAIT_INDEX_NUM) {
+ if (letter == ')') {
+ index = WAIT_SPACE;
+ return true;
+ } else {
+ return num.valid(letter);
+ }
+ } else if (index == WAIT_SPACE) {
+ if (letter == ' ' || letter == '\t') {
+ index = this.num.result();
+ return true;
+ } else {
+ return false;
+ }
+ }
+ return name.valid(letter);
+ }
+
+ @Override
+ public void reset() {
+ num.reset();
+ name.reset();
+ index = -1;
+ }
+
+ public String name() {
+ if (index == WAIT_NAME || index > 0) {
+ String val = name.result();
+ if (val.length() == 0) {
+ return null;
+ }
+ return val;
+ } else {
+ return null;
+ }
+ }
+
+ public int index() {
+ if (index == WAIT_SPACE) {
+ index = this.num.result();
+ }
+ if (index >= 0) {
+ return index;
+ } else {
+ return -1;
+ }
+ }
+
+ }
+
+ private static class NumberState implements State {
+
+ private StringBuilder sb = new StringBuilder();
+
+ @Override
+ public boolean valid(char letter) {
+ if (Character.isDigit(letter) || (sb.length() == 0 && (letter == '+' || letter == '-'))) {
+ sb.append(letter);
+ return true;
+ }
+ return false;
+ }
+
+ @Override
+ public void reset() {
+ sb.setLength(0);
+ }
+
+ public int result() {
+ if (sb.length() == 0) {
+ return 0;
+ }
+ return Integer.valueOf(sb.toString());
+ }
+
+ }
+
+ private static class NumbersState implements State {
+
+ private StringBuilder sb = new StringBuilder();
+ private List<Integer> numbers = new ArrayList<>();
+
+ @Override
+ public boolean valid(char letter) {
+ if (letter == ' ' || letter == '\t') {
+ collect();
+ return true;
+ } else if (Character.isDigit(letter) || (sb.length() == 0 && (letter == '+' || letter == '-'))) {
+ sb.append(letter);
+ return true;
+ }
+
+ return false;
+ }
+
+ @Override
+ public void reset() {
+ sb.setLength(0);
+ numbers.clear();
+ }
+
+ private void collect() {
+ if (sb.length() > 0) {
+ numbers.add(Integer.valueOf(sb.toString()));
+ sb.setLength(0);
+ }
+ }
+
+ public int[] result() {
+ collect();
+ return numbers.stream().mapToInt(Integer::intValue).toArray();
+ }
+ }
+
+ private static class CreatorState extends TagState {
+
+ private StringState next = new StringState();
+
+ public CreatorState() {
+ super("creator".toCharArray()); //$NON-NLS-1$
+ }
+
+ @Override
+ public void consume(CacheGrindParserListener listener) {
+ listener.creator((String) next.result());
+ }
+
+ @Override
+ public State next() {
+ return next;
+ }
+
+ }
+
+ private static class VersionState extends TagState {
+
+ private StringState next = new StringState();
+
+ public VersionState() {
+ super("version".toCharArray()); //$NON-NLS-1$
+ }
+
+ @Override
+ public void consume(CacheGrindParserListener listener) {
+ listener.version((String) next.result());
+ }
+
+ @Override
+ public State next() {
+ return next;
+ }
+
+ }
+
+ private static class CMDState extends TagState {
+
+ private StringState next = new StringState();
+
+ public CMDState() {
+ super("cmd".toCharArray()); //$NON-NLS-1$
+ }
+
+ @Override
+ public void consume(CacheGrindParserListener listener) {
+ listener.cmd((String) next.result());
+ }
+
+ @Override
+ public State next() {
+ return next;
+ }
+
+ }
+
+ private static class PIDState extends TagState {
+
+ private NumberState next = new NumberState();
+
+ public PIDState() {
+ super("pid".toCharArray()); //$NON-NLS-1$
+ }
+
+ @Override
+ public void consume(CacheGrindParserListener listener) {
+ listener.pid(next.result());
+ }
+
+ @Override
+ public State next() {
+ return next;
+ }
+ }
+
+ private static class PartState extends TagState {
+
+ private NumberState next = new NumberState();
+
+ public PartState() {
+ super("part".toCharArray()); //$NON-NLS-1$
+ }
+
+ @Override
+ public void consume(CacheGrindParserListener listener) {
+ listener.part(next.result());
+ }
+
+ @Override
+ public State next() {
+ return next;
+ }
+ }
+
+ private static class EventsState extends TagState {
+
+ private StringsState next = new StringsState();
+
+ public EventsState() {
+ super("events".toCharArray()); //$NON-NLS-1$
+ }
+
+ @Override
+ public void consume(CacheGrindParserListener listener) {
+ listener.events(next.result());
+ }
+
+ @Override
+ public State next() {
+ return next;
+ }
+ }
+
+ private static class PositionsState extends TagState {
+
+ private StringsState next = new StringsState();
+
+ public PositionsState() {
+ super("positions".toCharArray()); //$NON-NLS-1$
+ }
+
+ @Override
+ public void consume(CacheGrindParserListener listener) {
+ listener.positions(next.result());
+ }
+
+ @Override
+ public State next() {
+ return next;
+ }
+ }
+
+ private static class TotalsState extends TagState {
+
+ private NumbersState next = new NumbersState();
+
+ public TotalsState() {
+ super("totals".toCharArray()); //$NON-NLS-1$
+ }
+
+ @Override
+ public void consume(CacheGrindParserListener listener) {
+ listener.totals(next.result());
+ }
+
+ @Override
+ public State next() {
+ return next;
+ }
+ }
+
+ private static class SummaryState extends TagState {
+
+ private NumbersState next = new NumbersState();
+
+ public SummaryState() {
+ super("summary".toCharArray()); //$NON-NLS-1$
+ }
+
+ @Override
+ public void consume(CacheGrindParserListener listener) {
+ listener.summary(next.result());
+ }
+
+ @Override
+ public State next() {
+ return next;
+ }
+ }
+
+ private static class CallsState extends BlockState {
+
+ private NumbersState next = new NumbersState();
+
+ public CallsState() {
+ super("calls=".toCharArray()); //$NON-NLS-1$
+ }
+
+ @Override
+ public void consume(CacheGrindParserListener listener) {
+ int[] nums = next.result();
+ if (nums.length > 1) {
+ listener.calls(nums[0], Arrays.stream(nums).skip(1).toArray());
+ } else {
+ listener.unknown("calls="); //$NON-NLS-1$
+ }
+ }
+
+ @Override
+ public State next() {
+ return next;
+ }
+ }
+
+ private static class CostState extends BlockState {
+
+ private NumbersState next = new NumbersState();
+
+ public CostState() {
+ super("".toCharArray()); //$NON-NLS-1$
+ }
+
+ @Override
+ public void consume(CacheGrindParserListener listener) {
+ int[] nums = next.result();
+ listener.cost(nums[0], Arrays.stream(nums).skip(1).toArray());
+ }
+
+ @Override
+ public State next() {
+ return next;
+ }
+ }
+
+ private static class FunctionState extends BlockState {
+
+ private NameState next = new NameState();
+
+ public FunctionState() {
+ super("fn=".toCharArray()); //$NON-NLS-1$
+ }
+
+ @Override
+ public void consume(CacheGrindParserListener listener) {
+ listener.function(next.index(), next.name());
+ }
+
+ @Override
+ public State next() {
+ return next;
+ }
+ }
+
+ private static class FileState extends BlockState {
+
+ private NameState next = new NameState();
+
+ public FileState(String name) {
+ super(name.toCharArray());
+ }
+
+ @Override
+ public void consume(CacheGrindParserListener listener) {
+ listener.file(next.index(), next.name());
+ }
+
+ @Override
+ public State next() {
+ return next;
+ }
+ }
+
+ private static class NextFunctionState extends BlockState {
+
+ private NameState next = new NameState();
+
+ public NextFunctionState() {
+ super("cfn=".toCharArray()); //$NON-NLS-1$
+ }
+
+ @Override
+ public void consume(CacheGrindParserListener listener) {
+ listener.nextFunction(next.index(), next.name());
+ }
+
+ @Override
+ public State next() {
+ return next;
+ }
+ }
+
+ private static class NextFileState extends BlockState {
+
+ private NameState next = new NameState();
+
+ public NextFileState(String name) {
+ super(name.toCharArray());
+ }
+
+ @Override
+ public void consume(CacheGrindParserListener listener) {
+ listener.nextFile(next.index(), next.name());
+ }
+
+ @Override
+ public State next() {
+ return next;
+ }
+ }
+
+ private static class CommentState implements State {
+ private boolean test = true;
+
+ @Override
+ public boolean valid(char letter) {
+ if (test && letter != '#') {
+ return false;
+ } else {
+ test = false;
+ }
+ return true;
+ }
+
+ @Override
+ public void consume(CacheGrindParserListener listener) {
+
+ }
+
+ @Override
+ public void reset() {
+ test = true;
+ }
+
+ }
+
+ private static final List<State> mainStates = new ArrayList<>();
+ static {
+ mainStates.add(new FunctionState());
+ mainStates.add(new FileState("fl=")); //$NON-NLS-1$
+ mainStates.add(new FileState("fi=")); //$NON-NLS-1$
+ mainStates.add(new FileState("fe=")); //$NON-NLS-1$
+
+ mainStates.add(new NextFunctionState());
+ mainStates.add(new NextFileState("cfl=")); //$NON-NLS-1$
+ mainStates.add(new NextFileState("cfi=")); //$NON-NLS-1$
+
+ mainStates.add(new CostState());
+ mainStates.add(new CallsState());
+ mainStates.add(new CreatorState());
+ mainStates.add(new VersionState());
+ mainStates.add(new CMDState());
+ mainStates.add(new PIDState());
+ mainStates.add(new PartState());
+ mainStates.add(new PositionsState());
+ mainStates.add(new EventsState());
+ mainStates.add(new SummaryState());
+ mainStates.add(new TotalsState());
+ mainStates.add(new CommentState());
+ }
+
+ public CacheGrindParser(InputStream file) {
+ fFile = file;
+ }
+
+ public void parse(CacheGrindParserListener listener) throws IOException {
+ try {
+ Reader reader = new BufferedReader(new InputStreamReader(fFile));
+ int letter = reader.read();
+ StringBuilder buff = new StringBuilder();
+ List<State> states = CacheGrindParser.mainStates;
+ while (letter != -1) {
+ if (letter == '\n') {
+ if (states.size() != 1) {
+ if (buff.length() > 0) {
+ listener.unknown(buff.toString());
+ }
+ } else if (states.size() == 1) {
+ states.get(0).consume(listener);
+ }
+ if (states.size() > 0) {
+ states.forEach(s -> s.reset());
+ }
+ buff.setLength(0);
+ states = CacheGrindParser.mainStates;
+ } else if (states.size() > 0) {
+ char tmp = (char) letter;
+ states = states.stream().filter(s -> {
+ if (s.valid(tmp)) {
+ return true;
+ }
+ s.reset();
+ return false;
+ }).collect(Collectors.toList());
+ buff.append(tmp);
+ } else {
+ buff.append((char) letter);
+ }
+
+ letter = reader.read();
+
+ }
+ } finally {
+ CacheGrindParser.mainStates.forEach(s -> s.reset());
+ }
+ }
+
+}
diff --git a/plugins/org.eclipse.php.profile.ui/plugin.xml b/plugins/org.eclipse.php.profile.ui/plugin.xml
index 4be4c03..36a9a1e 100644
--- a/plugins/org.eclipse.php.profile.ui/plugin.xml
+++ b/plugins/org.eclipse.php.profile.ui/plugin.xml
@@ -192,7 +192,7 @@
launchTypeId="org.eclipse.php.debug.core.launching.webPageLaunch"
name="XDebug Profiler Web Launch Settings"
profilerId="org.eclipse.php.debug.core.xdebugDebugger"
- section="org.eclipse.php.profile.ui.launcher.ZendDebuggerProfileWebLaunchSettingsSection">
+ section="org.eclipse.php.profile.ui.launcher.XDebugProfileWebLaunchSettingsSection">
</phpProfilerLaunchSettingsSection>
<phpProfilerLaunchSettingsSection
id="org.eclipse.php.profile.ui.zendDebuggerProfilerExeLaunchSettings"
diff --git a/plugins/org.eclipse.php.profile.ui/src/org/eclipse/php/profile/ui/PHPProfileUIMessages.properties b/plugins/org.eclipse.php.profile.ui/src/org/eclipse/php/profile/ui/PHPProfileUIMessages.properties
index cbfadea..1d337a8 100644
--- a/plugins/org.eclipse.php.profile.ui/src/org/eclipse/php/profile/ui/PHPProfileUIMessages.properties
+++ b/plugins/org.eclipse.php.profile.ui/src/org/eclipse/php/profile/ui/PHPProfileUIMessages.properties
@@ -178,12 +178,15 @@ HTMLReporter.8=Profiling {0} {1}
OpenCodeCoverageViewAction.0=Open &code coverage statistics
ImportSessionWizardPage1.0=Import Profile Session
ImportSessionWizardPage1.1=Import Profile Session
-ImportSessionWizardPage1.2=Select the file containing the saved profile session:
+ImportSessionWizardPage1.2=Select the file:
ImportSessionWizardPage1.3=&Browse
ImportSessionWizardPage1.4=Select the file containing the saved profile session:
ImportSessionWizardPage1.5=Source file must be specified
ImportSessionWizardPage1.6=Source file ''{0}'' doesn't exist
ImportSessionWizardPage1.7=Import profile sessions from the local file system.
+ImportSessionWizardPage1.8=Session type:
+ImportSessionWizardPage1.9=Eclipse Session (XML)
+ImportSessionWizardPage1.10=xDebug (CacheGrind)
ImportSessionWizard.0=Import profile sessions...
ImportSessionWizard.1=Error
ImportSessionWizard.2=File: {0}\ndoesn't contain a profile session
diff --git a/plugins/org.eclipse.php.profile.ui/src/org/eclipse/php/profile/ui/ProfilerUIConstants.java b/plugins/org.eclipse.php.profile.ui/src/org/eclipse/php/profile/ui/ProfilerUIConstants.java
index 3bff7d4..ad4daf2 100644
--- a/plugins/org.eclipse.php.profile.ui/src/org/eclipse/php/profile/ui/ProfilerUIConstants.java
+++ b/plugins/org.eclipse.php.profile.ui/src/org/eclipse/php/profile/ui/ProfilerUIConstants.java
@@ -31,4 +31,7 @@ public class ProfilerUIConstants {
public static int GROUP_BY_FILE = 0;
public static int GROUP_BY_CLASS = 1;
public static int GROUP_BY_FUNCTION = 2;
+
+ public static final int ECLIPSE_TYPE = 0;
+ public static final int XDEBUG_TYPE = 1;
}
diff --git a/plugins/org.eclipse.php.profile.ui/src/org/eclipse/php/profile/ui/actions/ExecutionFlowActionGroup.java b/plugins/org.eclipse.php.profile.ui/src/org/eclipse/php/profile/ui/actions/ExecutionFlowActionGroup.java
index fca1728..32d650e 100644
--- a/plugins/org.eclipse.php.profile.ui/src/org/eclipse/php/profile/ui/actions/ExecutionFlowActionGroup.java
+++ b/plugins/org.eclipse.php.profile.ui/src/org/eclipse/php/profile/ui/actions/ExecutionFlowActionGroup.java
@@ -94,12 +94,15 @@ public class ExecutionFlowActionGroup extends ActionGroup {
ProfilerFunctionData data = (ProfilerFunctionData) (caller.isRootElement() ? element.getData()
: caller.getData());
try {
- if (EditorUtility.openLocalFile(data.getLocalFileName(), layer.getLineNumber()) == null) {
+ if (data.getLocalFileName() == null
+ || EditorUtility.openLocalFile(data.getLocalFileName(), layer.getLineNumber()) == null) {
String url = fView.getInput().getGlobalData().getOriginalURL();
if (!ProfilerGlobalData.URL_NOT_AVAILABLE_MSG.equals(url)) {
// try to retrieve the file from server
RemoteDebugger.requestRemoteFile(new OpenRemoteFileContentRequestor(),
data.getAbsoluteFileName(), layer.getLineNumber(), url);
+ } else {
+
}
}
} catch (CoreException e) {
diff --git a/plugins/org.eclipse.php.profile.ui/src/org/eclipse/php/profile/ui/launcher/AbstractPHPLaunchConfigurationProfilerTab.java b/plugins/org.eclipse.php.profile.ui/src/org/eclipse/php/profile/ui/launcher/AbstractPHPLaunchConfigurationProfilerTab.java
index 5b22b14..20743f6 100644
--- a/plugins/org.eclipse.php.profile.ui/src/org/eclipse/php/profile/ui/launcher/AbstractPHPLaunchConfigurationProfilerTab.java
+++ b/plugins/org.eclipse.php.profile.ui/src/org/eclipse/php/profile/ui/launcher/AbstractPHPLaunchConfigurationProfilerTab.java
@@ -123,32 +123,16 @@ public abstract class AbstractPHPLaunchConfigurationProfilerTab extends Abstract
private Composite settingsComposite;
private Map<String, IProfilerLaunchSettingsSection> currentSection = new HashMap<>();
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.debug.ui.ILaunchConfigurationTab#getName()
- */
@Override
public String getName() {
return Messages.AbstractPHPLaunchConfigurationProfilerTab_Profiler_group_name;
}
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.debug.ui.AbstractLaunchConfigurationTab#getImage()
- */
@Override
public Image getImage() {
return ProfilerUIImages.get(ProfilerUIImages.IMG_OBJ_PROFILE_CONF);
}
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.debug.ui.ILaunchConfigurationTab#createControl(org.eclipse
- * .swt.widgets.Composite)
- */
@Override
public void createControl(Composite parent) {
// Create main composite
@@ -164,37 +148,18 @@ public abstract class AbstractPHPLaunchConfigurationProfilerTab extends Abstract
setControl(mainComposite);
}
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.php.internal.debug.ui.launching.
- * AbstractPHPLaunchConfigurationTab#setDefaults(org.eclipse.debug.core.
- * ILaunchConfigurationWorkingCopy)
- */
@Override
public void setDefaults(ILaunchConfigurationWorkingCopy configuration) {
super.setDefaults(configuration);
getSection().setDefaults(configuration);
}
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.debug.ui.ILaunchConfigurationTab#performApply(org.eclipse.
- * debug.core.ILaunchConfigurationWorkingCopy)
- */
@Override
public void performApply(ILaunchConfigurationWorkingCopy configuration) {
configuration.setAttribute(PHPDebugCorePreferenceNames.PHP_DEBUGGER_ID, getCurrentProfilerId());
getSection().performApply(configuration);
}
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.debug.ui.AbstractLaunchConfigurationTab#isValid(org.eclipse.
- * debug.core.ILaunchConfiguration)
- */
@Override
public boolean isValid(ILaunchConfiguration launchConfig) {
setMessage(null);
@@ -215,13 +180,6 @@ public abstract class AbstractPHPLaunchConfigurationProfilerTab extends Abstract
}
}
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.php.internal.debug.ui.launching.
- * AbstractPHPLaunchConfigurationTab#initialize(org.eclipse.debug.core.
- * ILaunchConfiguration)
- */
@Override
protected void initialize(ILaunchConfiguration configuration) {
getSection().initialize(configuration);
diff --git a/plugins/org.eclipse.php.profile.ui/src/org/eclipse/php/profile/ui/launcher/AbstractProfileExeLaunchSettingsSection.java b/plugins/org.eclipse.php.profile.ui/src/org/eclipse/php/profile/ui/launcher/AbstractProfileExeLaunchSettingsSection.java
index 910b10e..545cd1b 100644
--- a/plugins/org.eclipse.php.profile.ui/src/org/eclipse/php/profile/ui/launcher/AbstractProfileExeLaunchSettingsSection.java
+++ b/plugins/org.eclipse.php.profile.ui/src/org/eclipse/php/profile/ui/launcher/AbstractProfileExeLaunchSettingsSection.java
@@ -28,49 +28,22 @@ public abstract class AbstractProfileExeLaunchSettingsSection implements IProfil
protected WidgetListener widgetListener;
private ILaunchConfiguration configuration;
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.php.profile.ui.launcher.IProfilerLaunchSettingsSection#
- * createSection(org.eclipse.swt.widgets.Composite,
- * org.eclipse.php.profile.ui.launcher.
- * AbstractPHPLaunchConfigurationProfilerTab.WidgetListener)
- */
@Override
public final void createSection(Composite parent, WidgetListener widgetListener) {
this.widgetListener = widgetListener;
buildSection(parent);
}
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.php.profile.ui.launcher.IProfilerLaunchSettingsSection#
- * initialize(org.eclipse.debug.core.ILaunchConfiguration)
- */
@Override
public void initialize(ILaunchConfiguration configuration) {
this.configuration = configuration;
}
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.php.profile.ui.launcher.IProfilerLaunchSettingsSection#
- * setDefaults(org.eclipse.debug.core.ILaunchConfigurationWorkingCopy)
- */
@Override
public void setDefaults(ILaunchConfigurationWorkingCopy configuration) {
this.configuration = configuration;
}
- /*
- * (non-Javadoc)
- *
- * @see
- * org.eclipse.php.profile.ui.launcher.IProfilerLaunchSettingsSection#isValid(
- * org.eclipse.debug.core.ILaunchConfiguration)
- */
@Override
public StatusMessage isValid(ILaunchConfiguration configuration) {
// Nothing to validate here
diff --git a/plugins/org.eclipse.php.profile.ui/src/org/eclipse/php/profile/ui/launcher/Messages.java b/plugins/org.eclipse.php.profile.ui/src/org/eclipse/php/profile/ui/launcher/Messages.java
index 4890588..5f8eb6c 100644
--- a/plugins/org.eclipse.php.profile.ui/src/org/eclipse/php/profile/ui/launcher/Messages.java
+++ b/plugins/org.eclipse.php.profile.ui/src/org/eclipse/php/profile/ui/launcher/Messages.java
@@ -49,7 +49,10 @@ public class Messages extends NLS {
public static String PHPExeLaunchConfigurationProfilerTab_No_profiler_is_attached;
public static String PHPExeLaunchConfigurationProfilerTab_None;
public static String PHPWebPageLaunchConfigurationProfilerTab_No_profiler_is_attached;
- public static String XDebugProfileLaunchSettingsSection_Profiling_is_not_supported;
+
+ public static String XDebugProfileWebLaunchSettingsSection_0;
+
+ public static String XDebugProfileWebLaunchSettingsSection_1;
public static String ZendDebuggerProfileExeLaunchSettingsSection_General_group_name;
public static String ZendDebuggerProfileExeLaunchSettingsSection_Show_code_coverage;
public static String ZendDebuggerProfileWebLaunchSettingsSection_Browser;
diff --git a/plugins/org.eclipse.php.profile.ui/src/org/eclipse/php/profile/ui/launcher/XDebugProfileExeLaunchSettingsSection.java b/plugins/org.eclipse.php.profile.ui/src/org/eclipse/php/profile/ui/launcher/XDebugProfileExeLaunchSettingsSection.java
index 11557af..d7d1b3c 100644
--- a/plugins/org.eclipse.php.profile.ui/src/org/eclipse/php/profile/ui/launcher/XDebugProfileExeLaunchSettingsSection.java
+++ b/plugins/org.eclipse.php.profile.ui/src/org/eclipse/php/profile/ui/launcher/XDebugProfileExeLaunchSettingsSection.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2017 Rogue Wave Software Inc. and others.
+ * Copyright (c) 2017, 2018 Rogue Wave Software Inc. and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -7,13 +7,13 @@
*
* Contributors:
* Rogue Wave Software Inc. - initial implementation
+ * Dawid Pakuła - xDebug profiling
*******************************************************************************/
package org.eclipse.php.profile.ui.launcher;
import org.eclipse.debug.core.ILaunchConfiguration;
import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
-import org.eclipse.jface.dialogs.IMessageProvider;
-import org.eclipse.php.profile.ui.launcher.AbstractPHPLaunchConfigurationProfilerTab.StatusMessage;
+import org.eclipse.swt.widgets.Composite;
/**
* XDebug profiler settings section for CLI profiling (not supported yet).
@@ -22,28 +22,23 @@ import org.eclipse.php.profile.ui.launcher.AbstractPHPLaunchConfigurationProfile
*/
public class XDebugProfileExeLaunchSettingsSection extends AbstractProfileExeLaunchSettingsSection {
- /*
- * (non-Javadoc)
- *
- * @see
- * org.eclipse.php.profile.ui.launcher.AbstractProfileExeLaunchSettingsSection#
- * isValid(org.eclipse.debug.core.ILaunchConfiguration)
- */
@Override
- public StatusMessage isValid(ILaunchConfiguration configuration) {
- return new StatusMessage(IMessageProvider.ERROR,
- Messages.XDebugProfileLaunchSettingsSection_Profiling_is_not_supported);
+ public void setDefaults(ILaunchConfigurationWorkingCopy configuration) {
+ super.setDefaults(configuration);
+ }
+
+ @Override
+ public void initialize(ILaunchConfiguration configuration) {
+ super.initialize(configuration);
+
}
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.php.profile.ui.launcher.IProfilerLaunchSettingsSection#
- * performApply(org.eclipse.debug.core.ILaunchConfigurationWorkingCopy)
- */
@Override
public void performApply(ILaunchConfigurationWorkingCopy configuration) {
- // Ignore
+ }
+
+ @Override
+ protected void buildSection(Composite parent) {
}
}
diff --git a/plugins/org.eclipse.php.profile.ui/src/org/eclipse/php/profile/ui/launcher/XDebugProfileWebLaunchSettingsSection.java b/plugins/org.eclipse.php.profile.ui/src/org/eclipse/php/profile/ui/launcher/XDebugProfileWebLaunchSettingsSection.java
index 74801ae..ac5570d 100644
--- a/plugins/org.eclipse.php.profile.ui/src/org/eclipse/php/profile/ui/launcher/XDebugProfileWebLaunchSettingsSection.java
+++ b/plugins/org.eclipse.php.profile.ui/src/org/eclipse/php/profile/ui/launcher/XDebugProfileWebLaunchSettingsSection.java
@@ -10,10 +10,16 @@
*******************************************************************************/
package org.eclipse.php.profile.ui.launcher;
+import org.eclipse.core.runtime.CoreException;
import org.eclipse.debug.core.ILaunchConfiguration;
-import org.eclipse.jface.dialogs.IMessageProvider;
-import org.eclipse.php.profile.ui.launcher.AbstractPHPLaunchConfigurationProfilerTab.StatusMessage;
-import org.eclipse.swt.widgets.Composite;
+import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
+import org.eclipse.php.internal.debug.core.IPHPDebugConstants;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.*;
/**
* XDebug profiler settings section for web profiling (not supported yet).
@@ -21,23 +27,56 @@ import org.eclipse.swt.widgets.Composite;
* @author Bartlomiej Laczkowski
*/
public class XDebugProfileWebLaunchSettingsSection extends AbstractProfileWebLaunchSettingsSection {
+ private Button useTrigger;
+
+ private Text triggerValue;
+
+ @Override
+ public void initialize(ILaunchConfiguration configuration) {
+ super.initialize(configuration);
+ try {
+ useTrigger.setSelection(configuration.getAttribute(IPHPDebugConstants.XDEBUG_PROFILE_TRIGGER, true));
+ triggerValue.setText(configuration.getAttribute(IPHPDebugConstants.XDEBUG_PROFILE_TRIGGER_VALUE, "")); //$NON-NLS-1$
+
+ } catch (CoreException e) {
+ }
+ }
@Override
- protected void createTunnelGroup(Composite composite) {
- // Do not create SSH tunnel group
+ protected void buildSection(Composite parent) {
+ // super.buildSection(parent);
+ Group triggerGroup = new Group(parent, SWT.NONE);
+ triggerGroup.setLayout(new GridLayout(1, false));
+ triggerGroup.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
+
+ useTrigger = new Button(triggerGroup, SWT.CHECK);
+ useTrigger.setText(
+ Messages.XDebugProfileWebLaunchSettingsSection_0);
+ useTrigger.addSelectionListener(new SelectionAdapter() {
+ @Override
+ public void widgetSelected(SelectionEvent e) {
+ triggerValue.setEnabled(useTrigger.getSelection());
+ }
+ });
+ useTrigger.addSelectionListener(widgetListener);
+
+ Composite sub = new Composite(triggerGroup, SWT.NONE);
+ sub.setLayout(new GridLayout(2, false));
+ GridData data = new GridData(GridData.FILL_HORIZONTAL);
+ data.horizontalIndent = 20;
+ sub.setLayoutData(data);
+
+ new Label(sub, SWT.NONE).setText(Messages.XDebugProfileWebLaunchSettingsSection_1);
+ triggerValue = new Text(sub, SWT.BORDER | SWT.SINGLE);
+ triggerValue.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
+ triggerValue.addModifyListener(widgetListener);
}
- /*
- * (non-Javadoc)
- *
- * @see
- * org.eclipse.php.profile.ui.launcher.AbstractProfileWebLaunchSettingsSection#
- * isValid(org.eclipse.debug.core.ILaunchConfiguration)
- */
@Override
- public StatusMessage isValid(ILaunchConfiguration configuration) {
- return new StatusMessage(IMessageProvider.ERROR,
- Messages.XDebugProfileLaunchSettingsSection_Profiling_is_not_supported);
+ public void performApply(ILaunchConfigurationWorkingCopy configuration) {
+ super.performApply(configuration);
+ configuration.setAttribute(IPHPDebugConstants.XDEBUG_PROFILE_TRIGGER, useTrigger.getSelection());
+ configuration.setAttribute(IPHPDebugConstants.XDEBUG_PROFILE_TRIGGER_VALUE, triggerValue.getText());
}
}
diff --git a/plugins/org.eclipse.php.profile.ui/src/org/eclipse/php/profile/ui/launcher/ZendDebuggerProfileExeLaunchSettingsSection.java b/plugins/org.eclipse.php.profile.ui/src/org/eclipse/php/profile/ui/launcher/ZendDebuggerProfileExeLaunchSettingsSection.java
index 6fe0317..0709236 100644
--- a/plugins/org.eclipse.php.profile.ui/src/org/eclipse/php/profile/ui/launcher/ZendDebuggerProfileExeLaunchSettingsSection.java
+++ b/plugins/org.eclipse.php.profile.ui/src/org/eclipse/php/profile/ui/launcher/ZendDebuggerProfileExeLaunchSettingsSection.java
@@ -32,26 +32,12 @@ public class ZendDebuggerProfileExeLaunchSettingsSection extends AbstractProfile
private Group fGeneralGroup;
private Button fCodeCoverageButton;
- /*
- * (non-Javadoc)
- *
- * @see
- * org.eclipse.php.profile.ui.launcher.AbstractProfileExeLaunchSettingsSection#
- * setDefaults(org.eclipse.debug.core.ILaunchConfigurationWorkingCopy)
- */
@Override
public void setDefaults(ILaunchConfigurationWorkingCopy configuration) {
super.setDefaults(configuration);
configuration.setAttribute(IPHPDebugConstants.ATTR_ENABLE_CODE_COVERAGE, true);
}
- /*
- * (non-Javadoc)
- *
- * @see
- * org.eclipse.php.profile.ui.launcher.AbstractProfileExeLaunchSettingsSection#
- * initialize(org.eclipse.debug.core.ILaunchConfiguration)
- */
@Override
public void initialize(ILaunchConfiguration configuration) {
super.initialize(configuration);
@@ -66,12 +52,6 @@ public class ZendDebuggerProfileExeLaunchSettingsSection extends AbstractProfile
}
}
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.php.profile.ui.launcher.IProfilerLaunchSettingsSection#
- * performApply(org.eclipse.debug.core.ILaunchConfigurationWorkingCopy)
- */
@Override
public void performApply(ILaunchConfigurationWorkingCopy configuration) {
if (fGeneralGroup != null) {
@@ -80,13 +60,6 @@ public class ZendDebuggerProfileExeLaunchSettingsSection extends AbstractProfile
}
}
- /*
- * (non-Javadoc)
- *
- * @see
- * org.eclipse.php.profile.ui.launcher.AbstractProfileExeLaunchSettingsSection#
- * buildSection(org.eclipse.swt.widgets.Composite)
- */
@Override
protected void buildSection(Composite parent) {
createGeneralGroup(parent);
diff --git a/plugins/org.eclipse.php.profile.ui/src/org/eclipse/php/profile/ui/launcher/messages.properties b/plugins/org.eclipse.php.profile.ui/src/org/eclipse/php/profile/ui/launcher/messages.properties
index ace063f..bc513c0 100644
--- a/plugins/org.eclipse.php.profile.ui/src/org/eclipse/php/profile/ui/launcher/messages.properties
+++ b/plugins/org.eclipse.php.profile.ui/src/org/eclipse/php/profile/ui/launcher/messages.properties
@@ -38,7 +38,8 @@ AbstractPHPLaunchConfigurationProfilerTab_Unsupported_profiler_type=Unsupported
PHPExeLaunchConfigurationProfilerTab_No_profiler_is_attached=No profiler (debugger) is attached to ''{0}'' executable configuration.
PHPExeLaunchConfigurationProfilerTab_None=<none>
PHPWebPageLaunchConfigurationProfilerTab_No_profiler_is_attached=No profiler (debugger) is attached to ''{0}'' server configuration.
-XDebugProfileLaunchSettingsSection_Profiling_is_not_supported=Profiling with XDebug is not supported.
+XDebugProfileWebLaunchSettingsSection_0=Append XDebug trigger GET parameter to URL. Disable if you set 'xdebug.profiler_enable_trigger' as 0
+XDebugProfileWebLaunchSettingsSection_1=xdebug.profiler_enable_trigger_value (xdebug >= 2.3)
ZendDebuggerProfileExeLaunchSettingsSection_General_group_name=General
ZendDebuggerProfileExeLaunchSettingsSection_Show_code_coverage=Show Code Coverage
ZendDebuggerProfileWebLaunchSettingsSection_Browser=Browser
diff --git a/plugins/org.eclipse.php.profile.ui/src/org/eclipse/php/profile/ui/preferences/PreferenceKeys.java b/plugins/org.eclipse.php.profile.ui/src/org/eclipse/php/profile/ui/preferences/PreferenceKeys.java
index 3c51add..86bf226 100644
--- a/plugins/org.eclipse.php.profile.ui/src/org/eclipse/php/profile/ui/preferences/PreferenceKeys.java
+++ b/plugins/org.eclipse.php.profile.ui/src/org/eclipse/php/profile/ui/preferences/PreferenceKeys.java
@@ -27,6 +27,7 @@ public class PreferenceKeys {
public static final String PROFILING_MONITOR_SORT_ORDER = "profilingMonitorSortOrder"; //$NON-NLS-1$
public static final String EXECUTION_STATISTICS_VIEW_FILTERS = "executionStatisticsViewFilters"; //$NON-NLS-1$
public static final String EXECUTION_STATISTICS_SELECTED_FILTER = "executionStatisticsSelectedFilter"; //$NON-NLS-1$
+ public static final String IMPORT_TYPE = "importType"; //$NON-NLS-1$
public static IPreferenceStore getPreferenceStore() {
return ProfilerUiPlugin.getDefault().getPreferenceStore();
diff --git a/plugins/org.eclipse.php.profile.ui/src/org/eclipse/php/profile/ui/utils/ProfileUITools.java b/plugins/org.eclipse.php.profile.ui/src/org/eclipse/php/profile/ui/utils/ProfileUITools.java
index 3858281..051e0d6 100644
--- a/plugins/org.eclipse.php.profile.ui/src/org/eclipse/php/profile/ui/utils/ProfileUITools.java
+++ b/plugins/org.eclipse.php.profile.ui/src/org/eclipse/php/profile/ui/utils/ProfileUITools.java
@@ -13,7 +13,7 @@ package org.eclipse.php.profile.ui.utils;
import org.eclipse.php.debug.core.debugger.IDebugHandler;
import org.eclipse.php.internal.debug.core.PHPDebugPlugin;
import org.eclipse.php.internal.debug.core.zend.debugger.IRemoteDebugger;
-import org.eclipse.php.profile.core.engine.ZProfiler;
+import org.eclipse.php.profile.core.engine.IProfiler;
import org.eclipse.php.profile.ui.ProfilerUiPlugin;
import org.eclipse.ui.*;
@@ -28,11 +28,11 @@ public class ProfileUITools {
*
* @return profiler
*/
- public static ZProfiler getProfileContext() {
+ public static IProfiler getProfileContext() {
IRemoteDebugger debugger = PHPDebugPlugin.getActiveRemoteDebugger();
IDebugHandler debugHandler = debugger.getDebugHandler();
- if (debugHandler instanceof ZProfiler) {
- return (ZProfiler) debugHandler;
+ if (debugHandler instanceof IProfiler) {
+ return (IProfiler) debugHandler;
}
return null;
}
@@ -41,7 +41,7 @@ public class ProfileUITools {
* Finds existing or opens new view using its ID
*
* @param String
- * id of the view
+ * id of the view
* @return IViewPart view, or <code>null</code> if didn's succeed
*/
public static IViewPart findExistingView(String id) {
diff --git a/plugins/org.eclipse.php.profile.ui/src/org/eclipse/php/profile/ui/views/ExecutionFlowView.java b/plugins/org.eclipse.php.profile.ui/src/org/eclipse/php/profile/ui/views/ExecutionFlowView.java
index 62c0d42..8760ec0 100644
--- a/plugins/org.eclipse.php.profile.ui/src/org/eclipse/php/profile/ui/views/ExecutionFlowView.java
+++ b/plugins/org.eclipse.php.profile.ui/src/org/eclipse/php/profile/ui/views/ExecutionFlowView.java
@@ -94,11 +94,6 @@ public class ExecutionFlowView extends AbstractProfilerFunctionsView
PlatformUI.getWorkbench().getHelpSystem().setHelp(parent, IPHPHelpContextIds.EXECUTION_FLOW_VIEW);
}
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.ui.part.WorkbenchPart#dispose()
- */
@Override
public void dispose() {
if (fViewer != null) {
@@ -112,22 +107,11 @@ public class ExecutionFlowView extends AbstractProfilerFunctionsView
public void setFocus() {
}
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.php.profile.ui.views.AbstractProfilerView#getInput()
- */
@Override
public ProfilerDB getInput() {
return fProfilerDB;
}
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.php.profile.ui.views.AbstractProfilerView#setInput(org.
- * eclipse. php.profile.core.profiler.ProfilerDB)
- */
@Override
public void setInput(ProfilerDB profilerDB) {
if (fViewer == null || fViewer.getContentProvider() == null) {
diff --git a/plugins/org.eclipse.php.profile.ui/src/org/eclipse/php/profile/ui/views/ExecutionStatisticsSorter.java b/plugins/org.eclipse.php.profile.ui/src/org/eclipse/php/profile/ui/views/ExecutionStatisticsSorter.java
index 8ff1c2d..55c1b54 100644
--- a/plugins/org.eclipse.php.profile.ui/src/org/eclipse/php/profile/ui/views/ExecutionStatisticsSorter.java
+++ b/plugins/org.eclipse.php.profile.ui/src/org/eclipse/php/profile/ui/views/ExecutionStatisticsSorter.java
@@ -20,12 +20,6 @@ import org.eclipse.php.profile.ui.preferences.PreferenceKeys;
*/
public class ExecutionStatisticsSorter extends AbstractTableSorter {
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.viewers.ViewerSorter#compare(org.eclipse.jface.viewers
- * .Viewer, java.lang.Object, java.lang.Object)
- */
@Override
public int compare(Viewer viewer, Object e1, Object e2) {
TreeElement i1 = (TreeElement) e1;
diff --git a/plugins/org.eclipse.php.profile.ui/src/org/eclipse/php/profile/ui/views/ExecutionStatisticsView.java b/plugins/org.eclipse.php.profile.ui/src/org/eclipse/php/profile/ui/views/ExecutionStatisticsView.java
index 5521114..fff5993 100644
--- a/plugins/org.eclipse.php.profile.ui/src/org/eclipse/php/profile/ui/views/ExecutionStatisticsView.java
+++ b/plugins/org.eclipse.php.profile.ui/src/org/eclipse/php/profile/ui/views/ExecutionStatisticsView.java
@@ -96,12 +96,6 @@ public class ExecutionStatisticsView extends AbstractProfilerFunctionsView
final int field = i;
tableColumn.addSelectionListener(new SelectionAdapter() {
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.swt.events.SelectionAdapter#widgetSelected(org
- * .eclipse.swt.events.SelectionEvent)
- */
@Override
public void widgetSelected(SelectionEvent e) {
fSorter.setColumn(field);
@@ -130,7 +124,7 @@ public class ExecutionStatisticsView extends AbstractProfilerFunctionsView
}
fTreeViewer = new TreeViewer(fTree);
- fTreeViewer.setAutoExpandLevel(TreeViewer.ALL_LEVELS);
+ // fTreeViewer.setAutoExpandLevel(TreeViewer.ALL_LEVELS);
fTreeViewer.setContentProvider(new ExecutionStatisticsContentProvider());
fTreeViewer.setLabelProvider(new ExecutionStatisticsLabelProvider());
fTreeViewer.setSorter(fSorter);
@@ -212,12 +206,14 @@ public class ExecutionStatisticsView extends AbstractProfilerFunctionsView
SimpleHTMLPresentableTreeElement root = new SimpleHTMLPresentableTreeElement();
for (int i = 0; i < files.length; ++i) {
SimpleHTMLPresentableTreeElement fileItem = new SimpleHTMLPresentableTreeElement(root, files[i]);
+ fileItem.setExpanded(true);
root.addChild(fileItem);
ProfilerClassData[] classes = files[i].getClasses();
for (int j = 0; j < classes.length; ++j) {
SimpleHTMLPresentableTreeElement classItem = new SimpleHTMLPresentableTreeElement(fileItem,
classes[j]);
+ classItem.setExpanded(true);
fileItem.addChild(classItem);
ProfilerFunctionData[] methods = classes[j].getMethods();
@@ -232,6 +228,7 @@ public class ExecutionStatisticsView extends AbstractProfilerFunctionsView
if (functions[j].getClassName() == null) {
SimpleHTMLPresentableTreeElement element = new SimpleHTMLPresentableTreeElement(fileItem,
functions[j]);
+ element.setExpanded(false);
fileItem.addChild(element);
}
}
@@ -272,7 +269,8 @@ public class ExecutionStatisticsView extends AbstractProfilerFunctionsView
if (element instanceof ProfilerFunctionData) {
ProfilerFunctionData data = (ProfilerFunctionData) element;
try {
- if (EditorUtility.openLocalFile(data.getLocalFileName(), data.getLineNumber()) == null) {
+ if (data.getLocalFileName() == null
+ || EditorUtility.openLocalFile(data.getLocalFileName(), data.getLineNumber()) == null) {
String url = fProfilerDB.getGlobalData().getOriginalURL();
if (!ProfilerGlobalData.URL_NOT_AVAILABLE_MSG.equals(url)) {
// try to retrieve the file from server
diff --git a/plugins/org.eclipse.php.profile.ui/src/org/eclipse/php/profile/ui/views/FunctionInvocationStatisticsView.java b/plugins/org.eclipse.php.profile.ui/src/org/eclipse/php/profile/ui/views/FunctionInvocationStatisticsView.java
index c476d7c..4c85775 100644
--- a/plugins/org.eclipse.php.profile.ui/src/org/eclipse/php/profile/ui/views/FunctionInvocationStatisticsView.java
+++ b/plugins/org.eclipse.php.profile.ui/src/org/eclipse/php/profile/ui/views/FunctionInvocationStatisticsView.java
@@ -333,9 +333,9 @@ public class FunctionInvocationStatisticsView extends ViewPart {
* Sets the data for the current view.
*
* @param profiler
- * db
+ * db
* @param function
- * data
+ * data
*/
public void setInput(ProfilerDB db, ProfilerFunctionData function) {
fProfilerDB = db;
@@ -541,12 +541,6 @@ public class FunctionInvocationStatisticsView extends ViewPart {
}
class InvokeFunctionSorter extends AbstractTableSorter {
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.php.profile.ui.views.AbstractTableSorter#compare(org.
- * eclipse .jface.viewers.Viewer, java.lang.Object, java.lang.Object)
- */
@Override
public int compare(Viewer viewer, Object e1, Object e2) {
if (e1 instanceof InvokeFunctionTableElement && e2 instanceof InvokeFunctionTableElement) {
@@ -765,31 +759,14 @@ public class FunctionInvocationStatisticsView extends ViewPart {
class MethodInvokesContentProvider implements IStructuredContentProvider {
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.viewers.IContentProvider#dispose()
- */
@Override
public void dispose() {
}
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.viewers.IContentProvider#inputChanged(org.eclipse
- * .jface.viewers.Viewer, java.lang.Object, java.lang.Object)
- */
@Override
public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
}
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.viewers.IStructuredContentProvider#getElements(
- * java.lang.Object)
- */
@Override
public Object[] getElements(Object inputElement) {
if (inputElement instanceof ProfilerFunctionData) {
diff --git a/plugins/org.eclipse.php.profile.ui/src/org/eclipse/php/profile/ui/wizards/ImportSessionWizard.java b/plugins/org.eclipse.php.profile.ui/src/org/eclipse/php/profile/ui/wizards/ImportSessionWizard.java
index 8c658b1..d3809bf 100644
--- a/plugins/org.eclipse.php.profile.ui/src/org/eclipse/php/profile/ui/wizards/ImportSessionWizard.java
+++ b/plugins/org.eclipse.php.profile.ui/src/org/eclipse/php/profile/ui/wizards/ImportSessionWizard.java
@@ -24,7 +24,9 @@ import org.eclipse.osgi.util.NLS;
import org.eclipse.php.profile.core.engine.ProfileSessionsManager;
import org.eclipse.php.profile.core.engine.ProfilerDB;
import org.eclipse.php.profile.core.engine.ProfilerDataSerializationUtil;
+import org.eclipse.php.profile.core.engine.cachegrind.CacheGrindModelParser;
import org.eclipse.php.profile.ui.PHPProfileUIMessages;
+import org.eclipse.php.profile.ui.ProfilerUIConstants;
import org.eclipse.php.profile.ui.ProfilerUIImages;
import org.eclipse.swt.graphics.Image;
import org.eclipse.swt.widgets.Display;
@@ -47,8 +49,14 @@ public class ImportSessionWizard extends Wizard implements IImportWizard {
@Override
protected IStatus run(IProgressMonitor monitor) {
try {
- ProfilerDB[] profilerDBs = ProfilerDataSerializationUtil
- .deserialize(new FileInputStream(page1.getSourceFile()));
+ FileInputStream stream = new FileInputStream(page1.getSourceFile());
+ ProfilerDB[] profilerDBs;
+ if (page1.getSourceType() == ProfilerUIConstants.XDEBUG_TYPE) {
+ profilerDBs = CacheGrindModelParser.build(stream);
+ } else {
+ profilerDBs = ProfilerDataSerializationUtil.deserialize(stream);
+ }
+
if (profilerDBs != null && profilerDBs.length > 0) {
for (int i = 0; i < profilerDBs.length; ++i) {
ProfileSessionsManager.addSession(profilerDBs[i]);
diff --git a/plugins/org.eclipse.php.profile.ui/src/org/eclipse/php/profile/ui/wizards/ImportSessionWizardFirstPage.java b/plugins/org.eclipse.php.profile.ui/src/org/eclipse/php/profile/ui/wizards/ImportSessionWizardFirstPage.java
index 758e50b..6e0ee18 100644
--- a/plugins/org.eclipse.php.profile.ui/src/org/eclipse/php/profile/ui/wizards/ImportSessionWizardFirstPage.java
+++ b/plugins/org.eclipse.php.profile.ui/src/org/eclipse/php/profile/ui/wizards/ImportSessionWizardFirstPage.java
@@ -13,10 +13,14 @@ package org.eclipse.php.profile.ui.wizards;
import java.io.File;
import org.eclipse.core.runtime.Path;
+import org.eclipse.jface.viewers.*;
import org.eclipse.jface.wizard.WizardPage;
import org.eclipse.osgi.util.NLS;
import org.eclipse.php.internal.ui.IPHPHelpContextIds;
import org.eclipse.php.profile.ui.PHPProfileUIMessages;
+import org.eclipse.php.profile.ui.ProfilerUIConstants;
+import org.eclipse.php.profile.ui.ProfilerUiPlugin;
+import org.eclipse.php.profile.ui.preferences.PreferenceKeys;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent;
@@ -40,6 +44,7 @@ public class ImportSessionWizardFirstPage extends WizardPage {
private Text fSourceField;
private Button fSourceBtn;
private String fSourceFile;
+ private int fSourceType;
public ImportSessionWizardFirstPage() {
super(PHPProfileUIMessages.getString("ImportSessionWizardPage1.0")); //$NON-NLS-1$
@@ -52,23 +57,64 @@ public class ImportSessionWizardFirstPage extends WizardPage {
return fSourceFile;
}
+ public int getSourceType() {
+ return fSourceType;
+ }
+
@Override
public void createControl(Composite parent) {
initializeDialogUnits(parent);
+ try {
+ fSourceType = ProfilerUiPlugin.getDefault().getDialogSettings().getInt(PreferenceKeys.IMPORT_TYPE);
+ } catch (NumberFormatException e) {
+ fSourceType = ProfilerUIConstants.ECLIPSE_TYPE;
+ }
Composite composite = new Composite(parent, SWT.NULL);
GridLayout layout = new GridLayout();
layout.verticalSpacing = 10;
- layout.numColumns = 2;
+ layout.numColumns = 3;
composite.setLayout(layout);
composite.setLayoutData(new GridData(GridData.FILL_BOTH));
composite.setFont(parent.getFont());
Label label = new Label(composite, SWT.NONE);
- label.setText(PHPProfileUIMessages.getString("ImportSessionWizardPage1.2")); //$NON-NLS-1$
+ label.setText(PHPProfileUIMessages.getString("ImportSessionWizardPage1.8")); //$NON-NLS-1$
+ ComboViewer typeCombo = new ComboViewer(composite, SWT.READ_ONLY);
+ typeCombo.setContentProvider(ArrayContentProvider.getInstance());
+ typeCombo.setLabelProvider(new LabelProvider() {
+ @Override
+ public String getText(Object element) {
+ if (element instanceof Integer) {
+ switch (Integer.valueOf((Integer) element)) {
+ case ProfilerUIConstants.ECLIPSE_TYPE:
+ return PHPProfileUIMessages.getString("ImportSessionWizardPage1.9"); //$NON-NLS-1$
+ case ProfilerUIConstants.XDEBUG_TYPE:
+ return PHPProfileUIMessages.getString("ImportSessionWizardPage1.10"); //$NON-NLS-1$
+ }
+ }
+ return super.getText(element);
+ }
+ });
+ typeCombo.setInput(new Integer[] { ProfilerUIConstants.ECLIPSE_TYPE, ProfilerUIConstants.XDEBUG_TYPE });
+ typeCombo.addSelectionChangedListener(new ISelectionChangedListener() {
+
+ @Override
+ public void selectionChanged(SelectionChangedEvent event) {
+ if (event.getStructuredSelection() != null
+ && event.getStructuredSelection().getFirstElement() instanceof Integer) {
+ fSourceType = (Integer) event.getStructuredSelection().getFirstElement();
+ ProfilerUiPlugin.getDefault().getDialogSettings().put(PreferenceKeys.IMPORT_TYPE, fSourceType);
+ }
+ }
+ });
+ typeCombo.setSelection(new StructuredSelection(fSourceType));
GridData gridData = new GridData();
gridData.horizontalSpan = 2;
- label.setLayoutData(gridData);
+ typeCombo.getCombo().setLayoutData(gridData);
+
+ label = new Label(composite, SWT.NONE);
+ label.setText(PHPProfileUIMessages.getString("ImportSessionWizardPage1.2")); //$NON-NLS-1$
fSourceField = new Text(composite, SWT.BORDER);
fSourceField.addListener(SWT.Modify, fieldModifyListener);
@@ -80,7 +126,9 @@ public class ImportSessionWizardFirstPage extends WizardPage {
@Override
public void widgetSelected(SelectionEvent e) {
FileDialog dialog = new FileDialog(fSourceBtn.getShell(), SWT.OPEN);
- dialog.setFilterExtensions(new String[] { "*.xml", "*.*" }); //$NON-NLS-1$ //$NON-NLS-2$
+ if (fSourceType == ProfilerUIConstants.ECLIPSE_TYPE) {
+ dialog.setFilterExtensions(new String[] { "*.xml", "*.*" }); //$NON-NLS-1$ //$NON-NLS-2$
+ }
dialog.setText(PHPProfileUIMessages.getString("ImportSessionWizardPage1.4")); //$NON-NLS-1$
String dirName = new File(fSourceField.getText().trim()).getParent();
diff --git a/plugins/org.eclipse.php.ui/src/org/eclipse/php/internal/ui/util/EditorUtility.java b/plugins/org.eclipse.php.ui/src/org/eclipse/php/internal/ui/util/EditorUtility.java
index 38e6af4..8103530 100644
--- a/plugins/org.eclipse.php.ui/src/org/eclipse/php/internal/ui/util/EditorUtility.java
+++ b/plugins/org.eclipse.php.ui/src/org/eclipse/php/internal/ui/util/EditorUtility.java
@@ -95,13 +95,23 @@ public class EditorUtility {
});
}
+ public static IEditorPart openAbsoluteFile(String filePath, int lineNumber) throws CoreException {
+ IResource member = ResourcesPlugin.getWorkspace().getRoot().findMember(filePath);
+ if (member instanceof IFile) {
+ IEditorPart editor = org.eclipse.dltk.internal.ui.editor.EditorUtility.openInEditor(member, true);
+ org.eclipse.dltk.internal.ui.editor.EditorUtility.revealInEditor(editor, lineNumber);
+ return editor;
+ }
+ return null;
+ }
+
/**
* Opens local file in editor just like {@link OpenLocalFileAction} does.
*
* @param filePath
- * Full path string of the local file
+ * Full path string of the local file
* @param lineNumber
- * Line number to reveal
+ * Line number to reveal
* @throws CoreException
*/
public static IEditorPart openLocalFile(String filePath, int lineNumber) throws CoreException {
diff --git a/tests/org.eclipse.php.profile.core.tests/.classpath b/tests/org.eclipse.php.profile.core.tests/.classpath
new file mode 100644
index 0000000..4f83b23
--- /dev/null
+++ b/tests/org.eclipse.php.profile.core.tests/.classpath
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
diff --git a/tests/org.eclipse.php.profile.core.tests/.project b/tests/org.eclipse.php.profile.core.tests/.project
new file mode 100644
index 0000000..4c99098
--- /dev/null
+++ b/tests/org.eclipse.php.profile.core.tests/.project
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.eclipse.php.profile.core.tests</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.ManifestBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.SchemaBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.pde.PluginNature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ </natures>
+</projectDescription>
diff --git a/tests/org.eclipse.php.profile.core.tests/.settings/org.eclipse.jdt.core.prefs b/tests/org.eclipse.php.profile.core.tests/.settings/org.eclipse.jdt.core.prefs
new file mode 100644
index 0000000..fafb98c
--- /dev/null
+++ b/tests/org.eclipse.php.profile.core.tests/.settings/org.eclipse.jdt.core.prefs
@@ -0,0 +1,297 @@
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.methodParameters=do not generate
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
+org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
+org.eclipse.jdt.core.compiler.compliance=1.8
+org.eclipse.jdt.core.compiler.debug.lineNumber=generate
+org.eclipse.jdt.core.compiler.debug.localVariable=generate
+org.eclipse.jdt.core.compiler.debug.sourceFile=generate
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.source=1.8
+org.eclipse.jdt.core.formatter.align_type_members_on_columns=false
+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=16
+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_annotation=0
+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant=16
+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_explicit_constructor_call=16
+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_method_invocation=16
+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_qualified_allocation_expression=16
+org.eclipse.jdt.core.formatter.alignment_for_assignment=0
+org.eclipse.jdt.core.formatter.alignment_for_binary_expression=16
+org.eclipse.jdt.core.formatter.alignment_for_compact_if=16
+org.eclipse.jdt.core.formatter.alignment_for_conditional_expression=80
+org.eclipse.jdt.core.formatter.alignment_for_enum_constants=0
+org.eclipse.jdt.core.formatter.alignment_for_expressions_in_array_initializer=16
+org.eclipse.jdt.core.formatter.alignment_for_method_declaration=0
+org.eclipse.jdt.core.formatter.alignment_for_multiple_fields=16
+org.eclipse.jdt.core.formatter.alignment_for_parameters_in_constructor_declaration=16
+org.eclipse.jdt.core.formatter.alignment_for_parameters_in_method_declaration=16
+org.eclipse.jdt.core.formatter.alignment_for_resources_in_try=80
+org.eclipse.jdt.core.formatter.alignment_for_selector_in_method_invocation=16
+org.eclipse.jdt.core.formatter.alignment_for_superclass_in_type_declaration=16
+org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_enum_declaration=16
+org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_type_declaration=16
+org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_constructor_declaration=16
+org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_method_declaration=16
+org.eclipse.jdt.core.formatter.alignment_for_union_type_in_multicatch=16
+org.eclipse.jdt.core.formatter.blank_lines_after_imports=1
+org.eclipse.jdt.core.formatter.blank_lines_after_package=1
+org.eclipse.jdt.core.formatter.blank_lines_before_field=0
+org.eclipse.jdt.core.formatter.blank_lines_before_first_class_body_declaration=0
+org.eclipse.jdt.core.formatter.blank_lines_before_imports=1
+org.eclipse.jdt.core.formatter.blank_lines_before_member_type=1
+org.eclipse.jdt.core.formatter.blank_lines_before_method=1
+org.eclipse.jdt.core.formatter.blank_lines_before_new_chunk=1
+org.eclipse.jdt.core.formatter.blank_lines_before_package=0
+org.eclipse.jdt.core.formatter.blank_lines_between_import_groups=1
+org.eclipse.jdt.core.formatter.blank_lines_between_type_declarations=1
+org.eclipse.jdt.core.formatter.brace_position_for_annotation_type_declaration=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_anonymous_type_declaration=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_array_initializer=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_block=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_block_in_case=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_constructor_declaration=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_enum_constant=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_enum_declaration=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_lambda_body=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_method_declaration=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_switch=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_type_declaration=end_of_line
+org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_block_comment=false
+org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_javadoc_comment=false
+org.eclipse.jdt.core.formatter.comment.format_block_comments=true
+org.eclipse.jdt.core.formatter.comment.format_header=false
+org.eclipse.jdt.core.formatter.comment.format_html=true
+org.eclipse.jdt.core.formatter.comment.format_javadoc_comments=true
+org.eclipse.jdt.core.formatter.comment.format_line_comments=true
+org.eclipse.jdt.core.formatter.comment.format_source_code=true
+org.eclipse.jdt.core.formatter.comment.indent_parameter_description=true
+org.eclipse.jdt.core.formatter.comment.indent_root_tags=true
+org.eclipse.jdt.core.formatter.comment.insert_new_line_before_root_tags=insert
+org.eclipse.jdt.core.formatter.comment.insert_new_line_for_parameter=insert
+org.eclipse.jdt.core.formatter.comment.line_length=80
+org.eclipse.jdt.core.formatter.comment.new_lines_at_block_boundaries=true
+org.eclipse.jdt.core.formatter.comment.new_lines_at_javadoc_boundaries=true
+org.eclipse.jdt.core.formatter.comment.preserve_white_space_between_code_and_line_comments=false
+org.eclipse.jdt.core.formatter.compact_else_if=true
+org.eclipse.jdt.core.formatter.continuation_indentation=2
+org.eclipse.jdt.core.formatter.continuation_indentation_for_array_initializer=2
+org.eclipse.jdt.core.formatter.disabling_tag=@formatter\:off
+org.eclipse.jdt.core.formatter.enabling_tag=@formatter\:on
+org.eclipse.jdt.core.formatter.format_guardian_clause_on_one_line=false
+org.eclipse.jdt.core.formatter.format_line_comment_starting_on_first_column=true
+org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_annotation_declaration_header=true
+org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_constant_header=true
+org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_declaration_header=true
+org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_type_header=true
+org.eclipse.jdt.core.formatter.indent_breaks_compare_to_cases=true
+org.eclipse.jdt.core.formatter.indent_empty_lines=false
+org.eclipse.jdt.core.formatter.indent_statements_compare_to_block=true
+org.eclipse.jdt.core.formatter.indent_statements_compare_to_body=true
+org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_cases=true
+org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_switch=false
+org.eclipse.jdt.core.formatter.indentation.size=4
+org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_field=insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_local_variable=insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_method=insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_package=insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_parameter=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_type=insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_label=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_opening_brace_in_array_initializer=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_type_annotation=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_at_end_of_file_if_missing=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_before_catch_in_try_statement=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_before_closing_brace_in_array_initializer=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_before_else_in_if_statement=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_before_finally_in_try_statement=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_before_while_in_do_statement=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_annotation_declaration=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_anonymous_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_block=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_constant=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_declaration=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_method_body=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_after_and_in_type_parameter=insert
+org.eclipse.jdt.core.formatter.insert_space_after_assignment_operator=insert
+org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation_type_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_binary_operator=insert
+org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_arguments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_parameters=insert
+org.eclipse.jdt.core.formatter.insert_space_after_closing_brace_in_block=insert
+org.eclipse.jdt.core.formatter.insert_space_after_closing_paren_in_cast=insert
+org.eclipse.jdt.core.formatter.insert_space_after_colon_in_assert=insert
+org.eclipse.jdt.core.formatter.insert_space_after_colon_in_case=insert
+org.eclipse.jdt.core.formatter.insert_space_after_colon_in_conditional=insert
+org.eclipse.jdt.core.formatter.insert_space_after_colon_in_for=insert
+org.eclipse.jdt.core.formatter.insert_space_after_colon_in_labeled_statement=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_allocation_expression=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_annotation=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_array_initializer=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_parameters=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_throws=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_constant_arguments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_declarations=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_explicitconstructorcall_arguments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_increments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_inits=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_parameters=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_throws=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_invocation_arguments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_field_declarations=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_local_declarations=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_parameterized_type_reference=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_superinterfaces=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_arguments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_parameters=insert
+org.eclipse.jdt.core.formatter.insert_space_after_ellipsis=insert
+org.eclipse.jdt.core.formatter.insert_space_after_lambda_arrow=insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_parameterized_type_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_parameters=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_brace_in_array_initializer=insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_allocation_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_annotation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_cast=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_catch=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_constructor_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_enum_constant=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_for=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_if=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_invocation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_parenthesized_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_switch=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_synchronized=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_try=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_while=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_postfix_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_prefix_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_question_in_conditional=insert
+org.eclipse.jdt.core.formatter.insert_space_after_question_in_wildcard=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_for=insert
+org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_try_resources=insert
+org.eclipse.jdt.core.formatter.insert_space_after_unary_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_and_in_type_parameter=insert
+org.eclipse.jdt.core.formatter.insert_space_before_assignment_operator=insert
+org.eclipse.jdt.core.formatter.insert_space_before_at_in_annotation_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_binary_operator=insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_parameterized_type_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_parameters=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_brace_in_array_initializer=insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_allocation_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_annotation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_cast=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_catch=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_constructor_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_enum_constant=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_for=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_if=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_invocation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_parenthesized_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_switch=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_synchronized=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_try=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_while=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_assert=insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_case=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_conditional=insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_default=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_for=insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_labeled_statement=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_allocation_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_annotation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_array_initializer=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_parameters=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_throws=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_constant_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_declarations=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_explicitconstructorcall_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_increments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_inits=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_parameters=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_throws=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_invocation_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_field_declarations=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_local_declarations=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_parameterized_type_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_superinterfaces=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_parameters=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_ellipsis=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_lambda_arrow=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_parameterized_type_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_parameters=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_annotation_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_anonymous_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_array_initializer=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_block=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_constructor_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_constant=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_method_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_switch=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_allocation_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_type_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation_type_member_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_catch=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_constructor_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_enum_constant=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_for=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_if=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_invocation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_parenthesized_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_switch=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_synchronized=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_try=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_while=insert
+org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_return=insert
+org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_throw=insert
+org.eclipse.jdt.core.formatter.insert_space_before_postfix_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_prefix_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_question_in_conditional=insert
+org.eclipse.jdt.core.formatter.insert_space_before_question_in_wildcard=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_semicolon=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_for=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_try_resources=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_unary_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_brackets_in_array_type_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_braces_in_array_initializer=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_brackets_in_array_allocation_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_annotation_type_member_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_constructor_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_enum_constant=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_invocation=do not insert
+org.eclipse.jdt.core.formatter.join_lines_in_comments=true
+org.eclipse.jdt.core.formatter.join_wrapped_lines=true
+org.eclipse.jdt.core.formatter.keep_else_statement_on_same_line=false
+org.eclipse.jdt.core.formatter.keep_empty_array_initializer_on_one_line=false
+org.eclipse.jdt.core.formatter.keep_imple_if_on_one_line=false
+org.eclipse.jdt.core.formatter.keep_then_statement_on_same_line=false
+org.eclipse.jdt.core.formatter.lineSplit=120
+org.eclipse.jdt.core.formatter.never_indent_block_comments_on_first_column=false
+org.eclipse.jdt.core.formatter.never_indent_line_comments_on_first_column=false
+org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_method_body=0
+org.eclipse.jdt.core.formatter.number_of_empty_lines_to_preserve=1
+org.eclipse.jdt.core.formatter.put_empty_statement_on_new_line=true
+org.eclipse.jdt.core.formatter.tabulation.char=tab
+org.eclipse.jdt.core.formatter.tabulation.size=4
+org.eclipse.jdt.core.formatter.use_on_off_tags=false
+org.eclipse.jdt.core.formatter.use_tabs_only_for_leading_indentations=false
+org.eclipse.jdt.core.formatter.wrap_before_binary_operator=true
+org.eclipse.jdt.core.formatter.wrap_before_or_operator_multicatch=true
+org.eclipse.jdt.core.formatter.wrap_outer_expressions_when_nested=true
+org.eclipse.jdt.core.javaFormatter=org.eclipse.jdt.core.defaultJavaFormatter
diff --git a/tests/org.eclipse.php.profile.core.tests/.settings/org.eclipse.jdt.ui.prefs b/tests/org.eclipse.php.profile.core.tests/.settings/org.eclipse.jdt.ui.prefs
new file mode 100644
index 0000000..7f4574b
--- /dev/null
+++ b/tests/org.eclipse.php.profile.core.tests/.settings/org.eclipse.jdt.ui.prefs
@@ -0,0 +1,113 @@
+cleanup.add_default_serial_version_id=true
+cleanup.add_generated_serial_version_id=false
+cleanup.add_missing_annotations=true
+cleanup.add_missing_deprecated_annotations=true
+cleanup.add_missing_methods=false
+cleanup.add_missing_nls_tags=false
+cleanup.add_missing_override_annotations=true
+cleanup.add_missing_override_annotations_interface_methods=true
+cleanup.add_serial_version_id=false
+cleanup.always_use_blocks=true
+cleanup.always_use_parentheses_in_expressions=false
+cleanup.always_use_this_for_non_static_field_access=false
+cleanup.always_use_this_for_non_static_method_access=false
+cleanup.convert_functional_interfaces=false
+cleanup.convert_to_enhanced_for_loop=false
+cleanup.correct_indentation=false
+cleanup.format_source_code=false
+cleanup.format_source_code_changes_only=false
+cleanup.insert_inferred_type_arguments=false
+cleanup.make_local_variable_final=true
+cleanup.make_parameters_final=false
+cleanup.make_private_fields_final=true
+cleanup.make_type_abstract_if_missing_method=false
+cleanup.make_variable_declarations_final=false
+cleanup.never_use_blocks=false
+cleanup.never_use_parentheses_in_expressions=true
+cleanup.organize_imports=false
+cleanup.qualify_static_field_accesses_with_declaring_class=false
+cleanup.qualify_static_member_accesses_through_instances_with_declaring_class=true
+cleanup.qualify_static_member_accesses_through_subtypes_with_declaring_class=true
+cleanup.qualify_static_member_accesses_with_declaring_class=false
+cleanup.qualify_static_method_accesses_with_declaring_class=false
+cleanup.remove_private_constructors=true
+cleanup.remove_redundant_type_arguments=true
+cleanup.remove_trailing_whitespaces=false
+cleanup.remove_trailing_whitespaces_all=true
+cleanup.remove_trailing_whitespaces_ignore_empty=false
+cleanup.remove_unnecessary_casts=true
+cleanup.remove_unnecessary_nls_tags=true
+cleanup.remove_unused_imports=true
+cleanup.remove_unused_local_variables=false
+cleanup.remove_unused_private_fields=true
+cleanup.remove_unused_private_members=false
+cleanup.remove_unused_private_methods=true
+cleanup.remove_unused_private_types=true
+cleanup.sort_members=false
+cleanup.sort_members_all=false
+cleanup.use_anonymous_class_creation=false
+cleanup.use_blocks=true
+cleanup.use_blocks_only_for_return_and_throw=false
+cleanup.use_lambda=true
+cleanup.use_parentheses_in_expressions=false
+cleanup.use_this_for_non_static_field_access=false
+cleanup.use_this_for_non_static_field_access_only_if_necessary=true
+cleanup.use_this_for_non_static_method_access=false
+cleanup.use_this_for_non_static_method_access_only_if_necessary=true
+cleanup_profile=_PDT
+cleanup_settings_version=2
+eclipse.preferences.version=1
+editor_save_participant_org.eclipse.jdt.ui.postsavelistener.cleanup=true
+formatter_profile=org.eclipse.jdt.ui.default.eclipse_profile
+formatter_settings_version=12
+sp_cleanup.add_default_serial_version_id=true
+sp_cleanup.add_generated_serial_version_id=false
+sp_cleanup.add_missing_annotations=true
+sp_cleanup.add_missing_deprecated_annotations=true
+sp_cleanup.add_missing_methods=false
+sp_cleanup.add_missing_nls_tags=false
+sp_cleanup.add_missing_override_annotations=true
+sp_cleanup.add_serial_version_id=false
+sp_cleanup.always_use_blocks=true
+sp_cleanup.always_use_parentheses_in_expressions=false
+sp_cleanup.always_use_this_for_non_static_field_access=false
+sp_cleanup.always_use_this_for_non_static_method_access=false
+sp_cleanup.convert_to_enhanced_for_loop=false
+sp_cleanup.correct_indentation=false
+sp_cleanup.format_source_code=true
+sp_cleanup.format_source_code_changes_only=false
+sp_cleanup.make_local_variable_final=false
+sp_cleanup.make_parameters_final=false
+sp_cleanup.make_private_fields_final=true
+sp_cleanup.make_type_abstract_if_missing_method=false
+sp_cleanup.make_variable_declarations_final=true
+sp_cleanup.never_use_blocks=false
+sp_cleanup.never_use_parentheses_in_expressions=true
+sp_cleanup.on_save_use_additional_actions=false
+sp_cleanup.organize_imports=true
+sp_cleanup.qualify_static_field_accesses_with_declaring_class=false
+sp_cleanup.qualify_static_member_accesses_through_instances_with_declaring_class=true
+sp_cleanup.qualify_static_member_accesses_through_subtypes_with_declaring_class=true
+sp_cleanup.qualify_static_member_accesses_with_declaring_class=false
+sp_cleanup.qualify_static_method_accesses_with_declaring_class=false
+sp_cleanup.remove_private_constructors=true
+sp_cleanup.remove_trailing_whitespaces=false
+sp_cleanup.remove_trailing_whitespaces_all=true
+sp_cleanup.remove_trailing_whitespaces_ignore_empty=false
+sp_cleanup.remove_unnecessary_casts=true
+sp_cleanup.remove_unnecessary_nls_tags=false
+sp_cleanup.remove_unused_imports=false
+sp_cleanup.remove_unused_local_variables=false
+sp_cleanup.remove_unused_private_fields=true
+sp_cleanup.remove_unused_private_members=false
+sp_cleanup.remove_unused_private_methods=true
+sp_cleanup.remove_unused_private_types=true
+sp_cleanup.sort_members=false
+sp_cleanup.sort_members_all=false
+sp_cleanup.use_blocks=false
+sp_cleanup.use_blocks_only_for_return_and_throw=false
+sp_cleanup.use_parentheses_in_expressions=false
+sp_cleanup.use_this_for_non_static_field_access=false
+sp_cleanup.use_this_for_non_static_field_access_only_if_necessary=true
+sp_cleanup.use_this_for_non_static_method_access=false
+sp_cleanup.use_this_for_non_static_method_access_only_if_necessary=true
diff --git a/tests/org.eclipse.php.profile.core.tests/META-INF/MANIFEST.MF b/tests/org.eclipse.php.profile.core.tests/META-INF/MANIFEST.MF
new file mode 100644
index 0000000..4afa2cd
--- /dev/null
+++ b/tests/org.eclipse.php.profile.core.tests/META-INF/MANIFEST.MF
@@ -0,0 +1,17 @@
+Manifest-Version: 1.0
+Automatic-Module-Name: org.eclipse.php.profile.core.tests
+Bundle-ManifestVersion: 2
+Bundle-Name: %Bundle-Name
+Bundle-SymbolicName: org.eclipse.php.profile.core.tests;singleton:=true
+Bundle-Version: 6.0.0.qualifier
+Bundle-Activator: org.eclipse.php.profile.core.test.Activator
+Bundle-Vendor: %Bundle-Vendor
+Bundle-Localization: plugin
+Require-Bundle: org.eclipse.core.runtime,
+ org.eclipse.php.core,
+ org.eclipse.php.core.tests,
+ org.eclipse.php.profile.core,
+ org.junit,
+ org.eclipse.core.resources
+Bundle-RequiredExecutionEnvironment: JavaSE-1.8
+Bundle-ActivationPolicy: lazy
diff --git a/tests/org.eclipse.php.profile.core.tests/build.properties b/tests/org.eclipse.php.profile.core.tests/build.properties
new file mode 100644
index 0000000..452988a
--- /dev/null
+++ b/tests/org.eclipse.php.profile.core.tests/build.properties
@@ -0,0 +1,7 @@
+source.. = src/
+output.. = target/classes/
+bin.includes = META-INF/,\
+ .,\
+ test.xml,\
+ resources/,\
+ plugin.properties
diff --git a/tests/org.eclipse.php.profile.core.tests/plugin.properties b/tests/org.eclipse.php.profile.core.tests/plugin.properties
new file mode 100644
index 0000000..4eda3cd
--- /dev/null
+++ b/tests/org.eclipse.php.profile.core.tests/plugin.properties
@@ -0,0 +1,3 @@
+# properties file for org.eclipse.php.profile.core.test
+Bundle-Vendor = Eclipse PDT
+Bundle-Name = Profile Core Tests
diff --git a/tests/org.eclipse.php.profile.core.tests/pom.xml b/tests/org.eclipse.php.profile.core.tests/pom.xml
new file mode 100644
index 0000000..31b6d08
--- /dev/null
+++ b/tests/org.eclipse.php.profile.core.tests/pom.xml
@@ -0,0 +1,37 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <artifactId>tests</artifactId>
+ <groupId>org.eclipse.php</groupId>
+ <version>6.0.0-SNAPSHOT</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+ <artifactId>org.eclipse.php.profile.core.tests</artifactId>
+ <packaging>eclipse-test-plugin</packaging>
+ <properties>
+ <!-- Workaround for https://bugs.eclipse.org/bugs/show_bug.cgi?id=397015 -->
+ <sonar.sources></sonar.sources>
+ <sonar.tests>src</sonar.tests>
+ </properties>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.eclipse.tycho</groupId>
+ <artifactId>tycho-surefire-plugin</artifactId>
+ <version>${tycho-version}</version>
+ <configuration>
+ <testClass>org.eclipse.php.profile.core.test.AllTests</testClass>
+ <argLine>${tycho.testArgLine}</argLine>
+ <dependencies>
+ <dependency>
+ <type>p2-installable-unit</type>
+ <artifactId>org.eclipse.dltk.core.index.lucene</artifactId>
+ </dependency>
+ </dependencies>
+ <testFailureIgnore>false</testFailureIgnore>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+</project>
diff --git a/tests/org.eclipse.php.profile.core.tests/resources/cachegrind/profile_header.01 b/tests/org.eclipse.php.profile.core.tests/resources/cachegrind/profile_header.01
new file mode 100644
index 0000000..f0ea13d
--- /dev/null
+++ b/tests/org.eclipse.php.profile.core.tests/resources/cachegrind/profile_header.01
@@ -0,0 +1,34 @@
+# callgrind format
+events: Cycles Instructions Flops
+creator: xdebug 2.6.0 (PHP 7.1.13)
+version: something
+cmd: /src/web/app_dev.php
+part: 1
+positions: instr line
+pid: 10
+totals: 10 11
+summary: 10 12
+desc: unsupported
+version: 1
+
+fl=file1.c
+fi=file2.c
+fe=file3.c
+fn=main
+calls=23 -3 4
+23 0 0 3
+
+fl=(1) file1.c
+fl=(1)
+fn=(1) main
+
+cfl=cfile1.c
+cfi=cfile2.c
+cfn=main
+
+cfl=(2)
+
+
+
+
+
diff --git a/tests/org.eclipse.php.profile.core.tests/src/org/eclipse/php/profile/core/test/Activator.java b/tests/org.eclipse.php.profile.core.tests/src/org/eclipse/php/profile/core/test/Activator.java
new file mode 100644
index 0000000..0342834
--- /dev/null
+++ b/tests/org.eclipse.php.profile.core.tests/src/org/eclipse/php/profile/core/test/Activator.java
@@ -0,0 +1,69 @@
+/*******************************************************************************
+ * Copyright (c) 2005, 2018 Zend Technologies and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Zend Technologies - initial API and implementation
+ * Dawid Pakuła - Profiler tests
+ *******************************************************************************/
+package org.eclipse.php.profile.core.test;
+
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.core.runtime.Plugin;
+import org.eclipse.php.core.tests.TestUtils;
+import org.eclipse.php.core.tests.TestUtils.ColliderType;
+import org.eclipse.php.internal.core.Logger;
+import org.osgi.framework.BundleContext;
+
+/**
+ * The activator class controls the plug-in life cycle
+ */
+public class Activator extends Plugin {
+
+ // The plug-in ID
+ public static final String PLUGIN_ID = "org.eclipse.php.profile.core.test";
+
+ // The shared instance
+ private static Activator plugin;
+
+ /**
+ * The constructor
+ */
+ public Activator() {
+ }
+
+ @Override
+ public void start(BundleContext context) throws Exception {
+ super.start(context);
+ plugin = this;
+ TestUtils.disableColliders(ColliderType.ALL);
+ }
+
+ @Override
+ public void stop(BundleContext context) throws Exception {
+ // Save workspace to avoid errors after finishing tests.
+ try {
+ ResourcesPlugin.getWorkspace().save(true, new NullProgressMonitor());
+ } catch (CoreException e) {
+ Logger.logException(e);
+ }
+ TestUtils.enableColliders(ColliderType.ALL);
+ plugin = null;
+ super.stop(context);
+ }
+
+ /**
+ * Returns the shared instance
+ *
+ * @return the shared instance
+ */
+ public static Activator getDefault() {
+ return plugin;
+ }
+
+}
diff --git a/tests/org.eclipse.php.profile.core.tests/src/org/eclipse/php/profile/core/test/AllTests.java b/tests/org.eclipse.php.profile.core.tests/src/org/eclipse/php/profile/core/test/AllTests.java
new file mode 100644
index 0000000..c9a1d0f
--- /dev/null
+++ b/tests/org.eclipse.php.profile.core.tests/src/org/eclipse/php/profile/core/test/AllTests.java
@@ -0,0 +1,27 @@
+/*******************************************************************************
+ * Copyright (c) 2018 Dawid Pakuła and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Dawid Pakuła - initial implementation
+ *******************************************************************************/
+package org.eclipse.php.profile.core.test;
+
+import org.eclipse.php.core.tests.TestAllSuiteWatcher;
+import org.eclipse.php.profile.core.test.cachegrind.CacheGrindParserTest;
+import org.junit.ClassRule;
+import org.junit.rules.TestWatcher;
+import org.junit.runner.RunWith;
+import org.junit.runners.Suite;
+
+@RunWith(Suite.class)
+@Suite.SuiteClasses({ CacheGrindParserTest.class })
+public class AllTests {
+
+ @ClassRule
+ public static TestWatcher watcher = new TestAllSuiteWatcher();
+
+}
diff --git a/tests/org.eclipse.php.profile.core.tests/src/org/eclipse/php/profile/core/test/cachegrind/CacheGrindModelTest.java b/tests/org.eclipse.php.profile.core.tests/src/org/eclipse/php/profile/core/test/cachegrind/CacheGrindModelTest.java
new file mode 100644
index 0000000..0a4172d
--- /dev/null
+++ b/tests/org.eclipse.php.profile.core.tests/src/org/eclipse/php/profile/core/test/cachegrind/CacheGrindModelTest.java
@@ -0,0 +1,15 @@
+/*******************************************************************************
+ * Copyright (c) 2018 Dawid Pakuła and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Dawid Pakuła - initial implementation
+ *******************************************************************************/
+package org.eclipse.php.profile.core.test.cachegrind;
+
+public class CacheGrindModelTest {
+
+}
diff --git a/tests/org.eclipse.php.profile.core.tests/src/org/eclipse/php/profile/core/test/cachegrind/CacheGrindParserTest.java b/tests/org.eclipse.php.profile.core.tests/src/org/eclipse/php/profile/core/test/cachegrind/CacheGrindParserTest.java
new file mode 100644
index 0000000..87a2826
--- /dev/null
+++ b/tests/org.eclipse.php.profile.core.tests/src/org/eclipse/php/profile/core/test/cachegrind/CacheGrindParserTest.java
@@ -0,0 +1,274 @@
+/*******************************************************************************
+ * Copyright (c) 2018 Dawid Pakuła and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Dawid Pakuła - initial implementation
+ *******************************************************************************/
+package org.eclipse.php.profile.core.test.cachegrind;
+
+import static org.junit.Assert.assertArrayEquals;
+import static org.junit.Assert.assertEquals;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+
+import org.eclipse.php.profile.core.engine.cachegrind.CacheGrindParser;
+import org.eclipse.php.profile.core.engine.cachegrind.CacheGrindParser.CacheGrindParserListener;
+import org.eclipse.php.profile.core.test.Activator;
+import org.junit.Test;
+
+public class CacheGrindParserTest {
+
+ private InputStream getFile(String path) throws IOException {
+ return Activator.getDefault().getBundle().getEntry(path).openStream();
+ }
+
+ private class Name {
+ public int index;
+ public String name;
+
+ public Name(int index, String name) {
+ this.index = index;
+ this.name = name;
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ if (obj instanceof Name) {
+ Name tmp = (Name) obj;
+ if (tmp.index != this.index) {
+ return false;
+ }
+ if (tmp.name == null && name != null || name == null && tmp.name != null) {
+ return false;
+ } else if (tmp.name != null) {
+ return tmp.name.equals(name);
+ }
+ return true;
+
+ }
+ return super.equals(obj);
+ }
+
+ @Override
+ public String toString() {
+ return new StringBuilder("Name(").append(index).append(',').append(name == null ? "null" : name).append(')')
+ .toString();
+ }
+ }
+
+ private class Nums {
+ public int first;
+ public int[] other;
+
+ public Nums(int first, int[] other) {
+ this.first = first;
+ this.other = other;
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ if (obj instanceof Nums) {
+ Nums tmp = (Nums) obj;
+ if (first != tmp.first) {
+ return false;
+ }
+
+ if (tmp.other == null && other != null || other == null && tmp.other != null) {
+ return false;
+ } else if (tmp.other != null) {
+ if (tmp.other.length != other.length) {
+ return false;
+ }
+ int index = 0;
+ for (int val : tmp.other) {
+ if (other[index++] != val) {
+ return false;
+ }
+ }
+ }
+ return true;
+ }
+ return super.equals(obj);
+ }
+
+ @Override
+ public String toString() {
+ StringBuilder sb = new StringBuilder("Nums(").append(first).append(',');
+ if (other == null) {
+ sb.append("null");
+ } else {
+ sb.append('[');
+ Arrays.stream(other).forEach(i -> sb.append(i).append(','));
+ sb.append(']');
+ }
+ return sb.append(')').toString();
+
+ }
+ }
+
+ private class Listener implements CacheGrindParserListener {
+ public String[] events;
+ public String[] positions;
+ public String creator;
+ public String version;
+ public String cmd;
+ public int part;
+ public List<String> unknown = new ArrayList<>();
+ public List<Name> files = new ArrayList<>();
+ public List<Name> functions = new ArrayList<>();
+ public List<Name> nextFiles = new ArrayList<>();
+ public List<Name> nextFunctions = new ArrayList<>();
+
+ public List<Nums> costs = new ArrayList<>();
+ public List<Nums> calls = new ArrayList<>();
+
+ public int[] totals;
+ public int[] summary;
+ public int pid;
+
+ @Override
+ public void version(String version) {
+ this.version = version;
+ }
+
+ @Override
+ public void creator(String creator) {
+ this.creator = creator;
+ }
+
+ @Override
+ public void events(String[] events) {
+ this.events = events;
+ }
+
+ @Override
+ public void unknown(String line) {
+ unknown.add(line);
+ }
+
+ @Override
+ public void cmd(String cmd) {
+ this.cmd = cmd;
+ }
+
+ @Override
+ public void part(int part) {
+ this.part = part;
+ }
+
+ @Override
+ public void totals(int[] sum) {
+ this.totals = sum;
+ }
+
+ @Override
+ public void summary(int[] sum) {
+ this.summary = sum;
+ }
+
+ @Override
+ public void pid(int pid) {
+ this.pid = pid;
+ }
+
+ @Override
+ public void positions(String[] type) {
+ this.positions = type;
+ }
+
+ @Override
+ public void function(int id, String name) {
+ functions.add(new Name(id, name));
+ }
+
+ @Override
+ public void file(int id, String name) {
+ files.add(new Name(id, name));
+ }
+
+ @Override
+ public void nextFunction(int id, String name) {
+ nextFunctions.add(new Name(id, name));
+ }
+
+ @Override
+ public void nextFile(int id, String name) {
+ nextFiles.add(new Name(id, name));
+ }
+
+ @Override
+ public void calls(int count, int[] values) {
+ calls.add(new Nums(count, values));
+ }
+
+ @Override
+ public void cost(int pos, int[] events) {
+ costs.add(new Nums(pos, events));
+ }
+
+ }
+
+ @Test
+ public void test() throws IOException {
+ InputStream file = getFile("/resources/cachegrind/profile_header.01");
+
+ CacheGrindParser parser = new CacheGrindParser(file);
+ Listener listener = new Listener();
+ parser.parse(listener);
+
+ assertEquals("xdebug 2.6.0 (PHP 7.1.13)", listener.creator);
+ assertEquals("1", listener.version);
+ assertEquals("/src/web/app_dev.php", listener.cmd);
+ assertEquals(10, listener.pid);
+ assertEquals(1, listener.part);
+
+ assertArrayEquals(new String[] { "instr", "line" }, listener.positions);
+ assertArrayEquals(new String[] { "Cycles", "Instructions", "Flops" }, listener.events);
+
+ assertArrayEquals(new int[] { 10, 11 }, listener.totals);
+ assertArrayEquals(new int[] { 10, 12 }, listener.summary);
+ assertArrayEquals(new String[] { "desc: unsupported" }, listener.unknown.toArray(new String[0]));
+
+ // files
+ assertEquals(5, listener.files.size());
+ assertEquals(new Name(-1, "file1.c"), listener.files.get(0));
+ assertEquals(new Name(-1, "file2.c"), listener.files.get(1));
+ assertEquals(new Name(-1, "file3.c"), listener.files.get(2));
+ assertEquals(new Name(1, "file1.c"), listener.files.get(3));
+ assertEquals(new Name(1, null), listener.files.get(4));
+
+ // functions
+ assertEquals(2, listener.functions.size());
+ assertEquals(new Name(-1, "main"), listener.functions.get(0));
+ assertEquals(new Name(1, "main"), listener.functions.get(1));
+
+ // next files
+ assertEquals(3, listener.nextFiles.size());
+ assertEquals(new Name(-1, "cfile1.c"), listener.nextFiles.get(0));
+ assertEquals(new Name(-1, "cfile2.c"), listener.nextFiles.get(1));
+ assertEquals(new Name(2, null), listener.nextFiles.get(2));
+
+ // next functions
+ assertEquals(1, listener.nextFunctions.size());
+ assertEquals(new Name(-1, "main"), listener.nextFunctions.get(0));
+
+ // calls
+ assertEquals(1, listener.calls.size());
+ assertEquals(new Nums(23, new int[] { -3, 4 }), listener.calls.get(0));
+
+ // cost
+ assertEquals(1, listener.costs.size());
+ assertEquals(new Nums(23, new int[] { 0, 0, 3 }), listener.costs.get(0));
+
+ file.close();
+
+ }
+}
diff --git a/tests/org.eclipse.php.profile.core.tests/test.xml b/tests/org.eclipse.php.profile.core.tests/test.xml
new file mode 100644
index 0000000..be4e959
--- /dev/null
+++ b/tests/org.eclipse.php.profile.core.tests/test.xml
@@ -0,0 +1,40 @@
+<?xml version="1.0"?>
+
+<project name="testsuite" default="run" basedir=".">
+ <!-- The property ${eclipse-home} should be passed into this script -->
+ <!-- Set a meaningful default value for when it is not. -->
+ <property name="eclipse-home" value="${basedir}\..\.."/>
+
+ <!-- sets the properties plugin-name, and library-file -->
+ <property name="plugin-name" value="org.eclipse.php.profile.core.tests"/>
+ <property name="library-file" value="${eclipse-home}/plugins/org.eclipse.test/library.xml" />
+
+ <!-- This target holds all initialization code that needs to be done for -->
+ <!-- all tests that are to be run. Initialization for individual tests -->
+ <!-- should be done within the body of the suite target. -->
+ <target name="init">
+ <tstamp/>
+ </target>
+
+ <!-- This target defines the tests that need to be run. -->
+ <target name="suite">
+ <property name="studio-folder" value="${eclipse-home}/studio_folder"/>
+ <delete dir="${studio-folder}" quiet="true"/>
+ <ant target="ui-test" antfile="${library-file}" dir="${eclipse-home}">
+ <property name="data-dir" value="${studio-folder}"/>
+ <property name="plugin-name" value="${plugin-name}"/>
+ <property name="classname" value="org.eclipse.php.profile.core.test.AllTests"/>
+ </ant>
+ </target>
+
+ <!-- This target holds code to cleanup the testing environment after -->
+ <!-- after all of the tests have been run. You can use this target to -->
+ <!-- delete temporary files that have been created. -->
+ <target name="cleanup">
+ </target>
+
+ <!-- This target runs the test suite. Any actions that need to happen -->
+ <!-- after all the tests have been run should go here. -->
+ <target name="run" depends="init,suite,cleanup">
+ </target>
+</project> \ No newline at end of file
diff --git a/tests/pom.xml b/tests/pom.xml
index a4667f0..b488e15 100644
--- a/tests/pom.xml
+++ b/tests/pom.xml
@@ -115,6 +115,7 @@
<module>org.eclipse.php.ui.tests</module>
<module>org.eclipse.php.composer.api.tests</module>
<module>org.eclipse.php.composer.tests</module>
+ <module>org.eclipse.php.profile.core.tests</module>
</modules>
</project>