From 895e0aa394c19d6f10d2743b9a0b267a2b55e1da Mon Sep 17 00:00:00 2001 From: Mikhail Khodjaiants Date: Fri, 15 Feb 2013 16:32:12 -0500 Subject: [PATCH 01/27] Bug 398913 - 'Connect' button remains disabled after being used Change-Id: I301e897b5c4c76e3edbcd6f517c15793e4323d04 Reviewed-on: https://git.eclipse.org/r/10345 Reviewed-by: Mikhail Khodjaiants IP-Clean: Mikhail Khodjaiants Tested-by: Mikhail Khodjaiants --- .../ui/commands/GdbConnectCommand.java | 9 +-- .../GdbDebugNewExecutableCommand.java | 7 +- .../ui/commands/RefreshableDebugCommand.java | 67 +++++++++++++++++++ 3 files changed, 76 insertions(+), 7 deletions(-) create mode 100644 dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/src/org/eclipse/cdt/dsf/gdb/internal/ui/commands/RefreshableDebugCommand.java diff --git a/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/src/org/eclipse/cdt/dsf/gdb/internal/ui/commands/GdbConnectCommand.java b/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/src/org/eclipse/cdt/dsf/gdb/internal/ui/commands/GdbConnectCommand.java index 5a50b774632..aab89ed89c5 100644 --- a/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/src/org/eclipse/cdt/dsf/gdb/internal/ui/commands/GdbConnectCommand.java +++ b/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/src/org/eclipse/cdt/dsf/gdb/internal/ui/commands/GdbConnectCommand.java @@ -40,8 +40,8 @@ import org.eclipse.cdt.dsf.gdb.IGDBLaunchConfigurationConstants; import org.eclipse.cdt.dsf.gdb.actions.IConnect; import org.eclipse.cdt.dsf.gdb.internal.ui.GdbUIPlugin; import org.eclipse.cdt.dsf.gdb.internal.ui.actions.ProcessInfo; -import org.eclipse.cdt.dsf.gdb.internal.ui.launching.NewExecutableInfo; import org.eclipse.cdt.dsf.gdb.internal.ui.launching.LaunchUIMessages; +import org.eclipse.cdt.dsf.gdb.internal.ui.launching.NewExecutableInfo; import org.eclipse.cdt.dsf.gdb.internal.ui.launching.ProcessPrompter; import org.eclipse.cdt.dsf.gdb.internal.ui.launching.ProcessPrompter.PrompterInfo; import org.eclipse.cdt.dsf.gdb.launching.GdbLaunch; @@ -61,7 +61,6 @@ import org.eclipse.core.runtime.IStatus; import org.eclipse.core.runtime.Path; import org.eclipse.core.runtime.Status; import org.eclipse.debug.core.IRequest; -import org.eclipse.debug.core.commands.AbstractDebugCommand; import org.eclipse.debug.core.commands.IDebugCommandRequest; import org.eclipse.debug.core.commands.IEnabledStateRequest; import org.eclipse.swt.SWT; @@ -70,7 +69,7 @@ import org.eclipse.swt.widgets.FileDialog; import org.eclipse.swt.widgets.Shell; import org.eclipse.ui.progress.UIJob; -public class GdbConnectCommand extends AbstractDebugCommand implements IConnectHandler, IConnect { +public class GdbConnectCommand extends RefreshableDebugCommand implements IConnectHandler, IConnect { private final GdbLaunch fLaunch; private final DsfExecutor fExecutor; @@ -279,7 +278,9 @@ public class GdbConnectCommand extends AbstractDebugCommand implements IConnectH // cancelled it. } catch (RejectedExecutionException e) { // Can be thrown if the session is shutdown - } + } finally { + updateEnablement(); + } } /* diff --git a/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/src/org/eclipse/cdt/dsf/gdb/internal/ui/commands/GdbDebugNewExecutableCommand.java b/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/src/org/eclipse/cdt/dsf/gdb/internal/ui/commands/GdbDebugNewExecutableCommand.java index 4631445ea5c..b7b4305c1e1 100644 --- a/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/src/org/eclipse/cdt/dsf/gdb/internal/ui/commands/GdbDebugNewExecutableCommand.java +++ b/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/src/org/eclipse/cdt/dsf/gdb/internal/ui/commands/GdbDebugNewExecutableCommand.java @@ -29,8 +29,8 @@ import org.eclipse.cdt.dsf.debug.service.IProcesses; import org.eclipse.cdt.dsf.debug.service.command.ICommandControlService; import org.eclipse.cdt.dsf.gdb.IGDBLaunchConfigurationConstants; import org.eclipse.cdt.dsf.gdb.internal.ui.GdbUIPlugin; -import org.eclipse.cdt.dsf.gdb.internal.ui.launching.NewExecutableInfo; import org.eclipse.cdt.dsf.gdb.internal.ui.launching.NewExecutableDialog; +import org.eclipse.cdt.dsf.gdb.internal.ui.launching.NewExecutableInfo; import org.eclipse.cdt.dsf.gdb.launching.GdbLaunch; import org.eclipse.cdt.dsf.gdb.service.IGDBBackend; import org.eclipse.cdt.dsf.gdb.service.SessionType; @@ -43,12 +43,11 @@ import org.eclipse.core.runtime.IStatus; import org.eclipse.core.runtime.Status; import org.eclipse.debug.core.ILaunchConfiguration; import org.eclipse.debug.core.IRequest; -import org.eclipse.debug.core.commands.AbstractDebugCommand; import org.eclipse.debug.core.commands.IEnabledStateRequest; import org.eclipse.jface.window.Window; import org.eclipse.ui.progress.UIJob; -public class GdbDebugNewExecutableCommand extends AbstractDebugCommand implements IDebugNewExecutableHandler { +public class GdbDebugNewExecutableCommand extends RefreshableDebugCommand implements IDebugNewExecutableHandler { private class PromptJob extends UIJob { @@ -188,6 +187,8 @@ public class GdbDebugNewExecutableCommand extends AbstractDebugCommand implement } catch( RejectedExecutionException e ) { // Can be thrown if the session is shutdown + } finally { + updateEnablement(); } } diff --git a/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/src/org/eclipse/cdt/dsf/gdb/internal/ui/commands/RefreshableDebugCommand.java b/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/src/org/eclipse/cdt/dsf/gdb/internal/ui/commands/RefreshableDebugCommand.java new file mode 100644 index 00000000000..c2f72c0d156 --- /dev/null +++ b/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/src/org/eclipse/cdt/dsf/gdb/internal/ui/commands/RefreshableDebugCommand.java @@ -0,0 +1,67 @@ +/******************************************************************************* + * Copyright (c) 2013 Mentor Graphics 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: + * Mentor Graphics - Initial API and implementation + *******************************************************************************/ + +package org.eclipse.cdt.dsf.gdb.internal.ui.commands; + +import org.eclipse.core.runtime.IProgressMonitor; +import org.eclipse.core.runtime.IStatus; +import org.eclipse.core.runtime.Status; +import org.eclipse.debug.core.commands.AbstractDebugCommand; +import org.eclipse.debug.ui.IDebugUIConstants; +import org.eclipse.jface.viewers.ISelectionProvider; +import org.eclipse.ui.IViewPart; +import org.eclipse.ui.IWorkbenchPage; +import org.eclipse.ui.IWorkbenchPartSite; +import org.eclipse.ui.IWorkbenchWindow; +import org.eclipse.ui.PlatformUI; +import org.eclipse.ui.progress.UIJob; + +/** + * The enablement of a {@link AbstractDebugCommand} is updated only when the current + * debug context is changed. In some cases we need to force an update without changing + * the context. This class provides such a functionality. + * The proper way is to modify {@link AbstractDebugCommand}. + */ +public abstract class RefreshableDebugCommand extends AbstractDebugCommand { + + protected class UpdateEnablementJob extends UIJob { + + protected UpdateEnablementJob() { + super("Update enablement job"); //$NON-NLS-1$ + } + + @Override + public IStatus runInUIThread(IProgressMonitor monitor) { + // Reseting the current selection in the Debug view will force the enablement update + IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow(); + if (window != null) { + IWorkbenchPage page = window.getActivePage(); + if (page != null) { + IViewPart view = page.findView(IDebugUIConstants.ID_DEBUG_VIEW); + if (view != null) { + IWorkbenchPartSite site = view.getSite(); + if (site != null) { + ISelectionProvider selProvider = site.getSelectionProvider(); + if (selProvider != null) { + selProvider.setSelection(selProvider.getSelection()); + } + } + } + } + } + return Status.OK_STATUS; + } + } + + protected void updateEnablement() { + new UpdateEnablementJob().schedule(); + } +} From f0a597bc2bf3d70f51eb6995e6582de099917ea0 Mon Sep 17 00:00:00 2001 From: Nathan Ridge Date: Thu, 21 Feb 2013 05:03:49 -0500 Subject: [PATCH 02/27] Bug 401400 - Another error involving variadic non-type template parameters Change-Id: Ic5c64de6d32a203d13274053da61923d9d8e2ad3 Reviewed-on: https://git.eclipse.org/r/10559 Reviewed-by: Sergey Prigogin IP-Clean: Sergey Prigogin Tested-by: Sergey Prigogin --- .../parser/tests/ast2/AST2TemplateTests.java | 22 +++++++++++++++++++ .../dom/ast/cpp/ICPPTemplateParameterMap.java | 9 ++++++++ .../parser/cpp/CPPTemplateParameterMap.java | 1 + .../dom/parser/cpp/semantics/EvalBinding.java | 9 +++++++- 4 files changed, 40 insertions(+), 1 deletion(-) diff --git a/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/AST2TemplateTests.java b/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/AST2TemplateTests.java index 57a89c6ff7b..10fb36e671f 100644 --- a/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/AST2TemplateTests.java +++ b/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/AST2TemplateTests.java @@ -7312,4 +7312,26 @@ public class AST2TemplateTests extends AST2TestBase { public void testVariadicNonTypeTemplateParameter_401142() throws Exception { parseAndCheckBindings(); } + + // template + // struct ice_or; + // template <> + // struct ice_or<> { + // static const bool value = false; + // }; + // template + // struct ice_or { + // static const bool value = ice_or::value; + // }; + // template struct S {}; + // template <> + // struct S { + // typedef int type; + // }; + // int main() { + // S::value>::type t; + // } + public void testVariadicNonTypeTemplateParameter_401400() throws Exception { + parseAndCheckBindings(); + } } diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/cpp/ICPPTemplateParameterMap.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/cpp/ICPPTemplateParameterMap.java index 2a4b0a11e40..45db3a318da 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/cpp/ICPPTemplateParameterMap.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/cpp/ICPPTemplateParameterMap.java @@ -44,6 +44,15 @@ public interface ICPPTemplateParameterMap { */ public ICPPTemplateArgument[] getPackExpansion(ICPPTemplateParameter param); + /** + * If 'param' is not a parameter pack, returns the value for 'param' in the map. + * If 'param' is a parmameter pack, returns the value at position 'packOffset' + * in the pack of values for 'param' in the map. + * Returns null is 'param' is not mapped. + * @since 5.5 + */ + public ICPPTemplateArgument getArgument(ICPPTemplateParameter param, int packOffset); + /** * Returns the array of template parameter positions, for which a mapping exists. */ diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPTemplateParameterMap.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPTemplateParameterMap.java index c1c7c5db9fa..2cc251a30d4 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPTemplateParameterMap.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPTemplateParameterMap.java @@ -114,6 +114,7 @@ public class CPPTemplateParameterMap implements ICPPTemplateParameterMap { return null; } + @Override public ICPPTemplateArgument getArgument(ICPPTemplateParameter tpar, int packOffset) { return getArgument(tpar.getParameterID(), packOffset); } diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/semantics/EvalBinding.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/semantics/EvalBinding.java index 17a09e84790..a59760b7055 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/semantics/EvalBinding.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/semantics/EvalBinding.java @@ -27,6 +27,7 @@ import org.eclipse.cdt.core.dom.ast.IVariable; import org.eclipse.cdt.core.dom.ast.cpp.ICPPClassSpecialization; import org.eclipse.cdt.core.dom.ast.cpp.ICPPFunction; import org.eclipse.cdt.core.dom.ast.cpp.ICPPParameter; +import org.eclipse.cdt.core.dom.ast.cpp.ICPPParameterPackType; import org.eclipse.cdt.core.dom.ast.cpp.ICPPSpecialization; import org.eclipse.cdt.core.dom.ast.cpp.ICPPTemplateArgument; import org.eclipse.cdt.core.dom.ast.cpp.ICPPTemplateDefinition; @@ -246,6 +247,12 @@ public class EvalBinding extends CPPDependentEvaluation { } if (binding instanceof ICPPTemplateNonTypeParameter) { IType type= ((ICPPTemplateNonTypeParameter) binding).getType(); + // If the binding is a non-type parameter pack, it must have been + // referenced from inside the expansion pattern of a pack expansion. + // In such a context, the type of the binding is the type of each + // parameter in the parameter pack, not the type of the pack itself. + if (type instanceof ICPPParameterPackType) + type = ((ICPPParameterPackType) type).getType(); return prvalueType(type); } if (binding instanceof IVariable) { @@ -329,7 +336,7 @@ public class EvalBinding extends CPPDependentEvaluation { ICPPClassSpecialization within, int maxdepth, IASTNode point) { IBinding origBinding = getBinding(); if (origBinding instanceof ICPPTemplateNonTypeParameter) { - ICPPTemplateArgument argument = tpMap.getArgument((ICPPTemplateNonTypeParameter) origBinding); + ICPPTemplateArgument argument = tpMap.getArgument((ICPPTemplateNonTypeParameter) origBinding, packOffset); if (argument != null && argument.isNonTypeValue()) { return argument.getNonTypeEvaluation(); } From b502c8ab5da4c672cca9bd833b38abc34755b3ce Mon Sep 17 00:00:00 2001 From: Jesse Weinstein Date: Fri, 22 Feb 2013 18:52:14 -0500 Subject: [PATCH 03/27] Bug 400955: move some styling into css classes The edit menu docs will be updated in a later patch. Change-Id: I5a8975d1159e39e580e87f502160d3f46d71b3f0 Reviewed-on: https://git.eclipse.org/r/10604 Reviewed-by: Sergey Prigogin IP-Clean: Sergey Prigogin Tested-by: Sergey Prigogin --- doc/org.eclipse.cdt.doc.user/help.css | 3 + .../reference/cdt_u_m_file.htm | 148 +++++++++--------- .../reference/cdt_u_m_navigate.htm | 98 ++++++------ .../reference/cdt_u_m_project.htm | 24 +-- .../reference/cdt_u_m_refactor.htm | 20 +-- .../reference/cdt_u_m_run.htm | 66 ++++---- .../reference/cdt_u_m_search.htm | 10 +- .../reference/cdt_u_m_window.htm | 26 +-- 8 files changed, 199 insertions(+), 196 deletions(-) mode change 100644 => 100755 doc/org.eclipse.cdt.doc.user/help.css mode change 100644 => 100755 doc/org.eclipse.cdt.doc.user/reference/cdt_u_m_file.htm mode change 100644 => 100755 doc/org.eclipse.cdt.doc.user/reference/cdt_u_m_navigate.htm mode change 100644 => 100755 doc/org.eclipse.cdt.doc.user/reference/cdt_u_m_project.htm mode change 100644 => 100755 doc/org.eclipse.cdt.doc.user/reference/cdt_u_m_run.htm mode change 100644 => 100755 doc/org.eclipse.cdt.doc.user/reference/cdt_u_m_search.htm mode change 100644 => 100755 doc/org.eclipse.cdt.doc.user/reference/cdt_u_m_window.htm diff --git a/doc/org.eclipse.cdt.doc.user/help.css b/doc/org.eclipse.cdt.doc.user/help.css old mode 100644 new mode 100755 index 797473964ab..fc9c54455aa --- a/doc/org.eclipse.cdt.doc.user/help.css +++ b/doc/org.eclipse.cdt.doc.user/help.css @@ -42,6 +42,9 @@ th { font-weight: bold } display: none; } +.menu td { vertical-align: top; } +td.menu_name {font-weight: bold;} + /* Mike Behm's addition to the style sheet */ .userinput { font-family: monospace; } .guitab, .important, .guibutton, .selectblue, .guimenu, .guilabel, diff --git a/doc/org.eclipse.cdt.doc.user/reference/cdt_u_m_file.htm b/doc/org.eclipse.cdt.doc.user/reference/cdt_u_m_file.htm old mode 100644 new mode 100755 index 2ef7d4914e5..e796bb266de --- a/doc/org.eclipse.cdt.doc.user/reference/cdt_u_m_file.htm +++ b/doc/org.eclipse.cdt.doc.user/reference/cdt_u_m_file.htm @@ -14,122 +14,122 @@

Selecting File Menu

- +
- - - - - - - - - - + + + + - - + + + + + + + - + - - + - + - - + - + - - - + + + - - + - - - - - - - - - - - - - - - - - - - + - - + + + + + + + + + + + + + + + + + + + - + - - - - + + + + - - - + + + - - - - + + + + - - - + + + - - - - + + + + - - - - + + + + - - - - + + + +

diff --git a/doc/org.eclipse.cdt.doc.user/reference/cdt_u_m_navigate.htm b/doc/org.eclipse.cdt.doc.user/reference/cdt_u_m_navigate.htm old mode 100644 new mode 100755 index bad8cc190da..040681fcade --- a/doc/org.eclipse.cdt.doc.user/reference/cdt_u_m_navigate.htm +++ b/doc/org.eclipse.cdt.doc.user/reference/cdt_u_m_navigate.htm @@ -13,21 +13,21 @@

Selecting Navigate Menu

- +
- - - + + + - - + - + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - + - + - - - + + + - - - + + + - - - + + + - - + - + - - + - + - - + - + - - + - + - - + - + diff --git a/doc/org.eclipse.cdt.doc.user/reference/cdt_u_m_project.htm b/doc/org.eclipse.cdt.doc.user/reference/cdt_u_m_project.htm old mode 100644 new mode 100755 index 3ee5ce890cd..143baaaa5ad --- a/doc/org.eclipse.cdt.doc.user/reference/cdt_u_m_project.htm +++ b/doc/org.eclipse.cdt.doc.user/reference/cdt_u_m_project.htm @@ -14,31 +14,31 @@

Selecting Project Menu

-

+

- + - + - + - + - + - + - + - + - + - + - +