diff --git a/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/AST2CPPTests.java b/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/AST2CPPTests.java index ff1f4eef230..ef945c40951 100644 --- a/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/AST2CPPTests.java +++ b/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/AST2CPPTests.java @@ -13,6 +13,7 @@ * Sergey Prigogin (Google) * Thomas Corbat (IFS) * Nathan Ridge + * Marc-Andre Laperle *******************************************************************************/ package org.eclipse.cdt.core.parser.tests.ast2; @@ -7481,6 +7482,14 @@ public class AST2CPPTests extends AST2TestBase { BindingAssertionHelper ba= getAssertionHelper(); ba.assertProblem("enum_name", 9); } + + // struct MyStruct { + // enum MyEnum {}; + // MyStruct(MyEnum value) {} + // }; + public void testEnumRedefinitionInStruct_385144() throws Exception { + parseAndCheckBindings(getAboveComment(), ParserLanguage.CPP); + } // class CL { // typedef int x; diff --git a/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/internal/pdom/tests/ChangeConfigurationTests.java b/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/internal/pdom/tests/ChangeConfigurationTests.java index d0b3a4375a8..c9fd02d96f5 100644 --- a/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/internal/pdom/tests/ChangeConfigurationTests.java +++ b/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/internal/pdom/tests/ChangeConfigurationTests.java @@ -104,14 +104,17 @@ public class ChangeConfigurationTests extends PDOMTestBase { Pattern testFunc2 = Pattern.compile("testFunc2"); int i = 0, noTrials = 50; do { + boolean isFirstConfig = i % 2 == 0; IIndex index = CCorePlugin.getIndexManager().getIndex(cProject); index.acquireReadLock(); - boolean isFirstConfig = i % 2 == 0; - IBinding[] bindings = index.findBindings(isFirstConfig ? testFunc1 : testFunc2, true, IndexFilter.ALL, new NullProgressMonitor()); - IBinding[] noBindings = index.findBindings(isFirstConfig ? testFunc2 : testFunc1, true, IndexFilter.ALL, new NullProgressMonitor()); - assertEquals(1, bindings.length); - assertEquals(0, noBindings.length); - index.releaseReadLock(); + try { + IBinding[] bindings = index.findBindings(isFirstConfig ? testFunc1 : testFunc2, true, IndexFilter.ALL, new NullProgressMonitor()); + IBinding[] noBindings = index.findBindings(isFirstConfig ? testFunc2 : testFunc1, true, IndexFilter.ALL, new NullProgressMonitor()); + assertEquals(1, bindings.length); + assertEquals(0, noBindings.length); + } finally { + index.releaseReadLock(); + } String nextConfig = isFirstConfig ? secondConfigName : firstConfigName; changeProjectConfiguration(project, nextConfig); diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/CModelManager.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/CModelManager.java index 16deb2d5f4e..b5b576cbcbe 100644 --- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/CModelManager.java +++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/CModelManager.java @@ -82,13 +82,17 @@ import org.eclipse.core.runtime.CoreException; import org.eclipse.core.runtime.IPath; import org.eclipse.core.runtime.IProgressMonitor; import org.eclipse.core.runtime.ISafeRunnable; +import org.eclipse.core.runtime.IStatus; import org.eclipse.core.runtime.Path; import org.eclipse.core.runtime.Platform; import org.eclipse.core.runtime.SafeRunner; +import org.eclipse.core.runtime.Status; import org.eclipse.core.runtime.content.IContentType; import org.eclipse.core.runtime.content.IContentTypeManager; import org.eclipse.core.runtime.content.IContentTypeManager.ContentTypeChangeEvent; import org.eclipse.core.runtime.content.IContentTypeManager.IContentTypeChangeListener; +import org.eclipse.core.runtime.jobs.ISchedulingRule; +import org.eclipse.core.runtime.jobs.Job; public class CModelManager implements IResourceChangeListener, IContentTypeChangeListener, ICProjectDescriptionListener, ILanguageSettingsChangeListener { @@ -979,28 +983,45 @@ public class CModelManager implements IResourceChangeListener, IContentTypeChang @Override public void handleEvent(ILanguageSettingsChangeEvent event) { - try { - IProject project = ResourcesPlugin.getWorkspace().getRoot().getProject(event.getProjectName()); + IProject project = ResourcesPlugin.getWorkspace().getRoot().getProject(event.getProjectName()); + ICProject cproject = CModelManager.getDefault().getCModel().getCProject(project); + final CElementDelta delta = new CElementDelta(cproject); + // Just add all possible flags, listeners tend to recalculate themselves anyway + int flag = ICElementDelta.F_CHANGED_PATHENTRY_PROJECT + | ICElementDelta.F_CHANGED_PATHENTRY_INCLUDE + | ICElementDelta.F_CHANGED_PATHENTRY_MACRO + | ICElementDelta.F_ADDED_PATHENTRY_LIBRARY + | ICElementDelta.F_REMOVED_PATHENTRY_LIBRARY + | ICElementDelta.F_PATHENTRY_REORDER; + delta.changed(cproject, flag); - // Recalculate cached settings unless already inside CProjectDescriptionManager.setProjectDescription() - if (!CProjectDescriptionManager.getInstance().isCurrentThreadSetProjectDescription()) { - CoreModel.getDefault().updateProjectDescriptions(new IProject[] {project}, null); - } - - // Notify listeners - ICProject cproject = CModelManager.getDefault().getCModel().getCProject(project); - CElementDelta delta = new CElementDelta(cproject); - // just add all possible flags, listeners tend to recalculate themselves anyway - int flag = ICElementDelta.F_CHANGED_PATHENTRY_PROJECT - | ICElementDelta.F_CHANGED_PATHENTRY_INCLUDE - | ICElementDelta.F_CHANGED_PATHENTRY_MACRO - | ICElementDelta.F_ADDED_PATHENTRY_LIBRARY - | ICElementDelta.F_REMOVED_PATHENTRY_LIBRARY - | ICElementDelta.F_PATHENTRY_REORDER; - delta.changed(cproject, flag); + if (CProjectDescriptionManager.getInstance().isCurrentThreadSetProjectDescription()) { + // If inside CProjectDescriptionManager.setProjectDescription() just send notifications fire(delta, ElementChangedEvent.POST_CHANGE); - } catch (CoreException e) { - CCorePlugin.log(e); + } else { + // If not inside CProjectDescriptionManager.setProjectDescription() recalculate cached settings + try { + CoreModel.getDefault().updateProjectDescriptions(new IProject[] {project}, null); + } catch (CoreException e) { + CCorePlugin.log(e); + } + // Fire notifications in a job with workspace rule to ensure running after the updateProjectDescriptions(...) + // which is run in separate thread with workspace rule + ISchedulingRule rule = ResourcesPlugin.getWorkspace().getRoot(); + Job job = new Job(CoreModelMessages.getFormattedString("CModelManager.LanguageSettingsChangeEventNotifications")) { //$NON-NLS-1$ + @Override + protected IStatus run(IProgressMonitor monitor) { + try { + fire(delta, ElementChangedEvent.POST_CHANGE); + } catch (Exception e){ + CCorePlugin.log(e); + } + return Status.OK_STATUS; + } + }; + job.setRule(rule); + job.setSystem(true); + job.schedule(); } } diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/CoreModelMessages.properties b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/CoreModelMessages.properties index 36d6101e170..c086dc11021 100644 --- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/CoreModelMessages.properties +++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/CoreModelMessages.properties @@ -73,3 +73,6 @@ CElementLabels.anonymous=(anonymous) CElementLabels.concat_string=\ -\ CElementLabels.comma_string=,\ CElementLabels.declseparator_string=\ :\ + +CModelManager.LanguageSettingsChangeEventNotifications=Language settings change notifications + diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPASTTemplateId.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPASTTemplateId.java index e42807c2099..da86aab3be9 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPASTTemplateId.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPASTTemplateId.java @@ -55,16 +55,12 @@ public class CPPASTTemplateId extends CPPASTNameBase implements ICPPASTTemplateI @Override public CPPASTTemplateId copy(CopyStyle style) { - CPPASTTemplateId copy = new CPPASTTemplateId(templateName == null ? - null : templateName.copy(style)); + CPPASTTemplateId copy = + new CPPASTTemplateId(templateName == null ? null : templateName.copy(style)); for (IASTNode arg : getTemplateArguments()) { copy.internalAddTemplateArgument(arg == null ? null : arg.copy(style)); } - copy.setOffsetAndLength(this); - if (style == CopyStyle.withLocations) { - copy.setCopyLocation(this); - } - return copy; + return copy(copy, style); } @Override diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/semantics/CPPVisitor.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/semantics/CPPVisitor.java index 8afc1bf3d89..f5762cf74ef 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/semantics/CPPVisitor.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/semantics/CPPVisitor.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2004, 2012 IBM Corporation and others. + * Copyright (c) 2004, 2013 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 @@ -12,6 +12,7 @@ * Sergey Prigogin (Google) * Thomas Corbat (IFS) * Nathan Ridge + * Marc-Andre Laperle *******************************************************************************/ package org.eclipse.cdt.internal.core.dom.parser.cpp.semantics; @@ -405,6 +406,9 @@ public class CPPVisitor extends ASTQueries { IBinding binding = scope.getBinding(name, false); if (binding instanceof CPPEnumeration) { CPPEnumeration e= (CPPEnumeration) binding; + if (name.equals(e.getDefinition())) { + return e; + } if (e.isScoped() == specifier.isScoped()) { IType ft2= e.getFixedType(); if (fixedType == ft2 || (fixedType != null && fixedType.isSameType(ft2))) { diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/LanguageSettingsChangeListener.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/LanguageSettingsChangeListener.java index b1c26471852..abfd4862e03 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/LanguageSettingsChangeListener.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/LanguageSettingsChangeListener.java @@ -49,7 +49,7 @@ public class LanguageSettingsChangeListener implements ILanguageSettingsChangeLi IProject project = wspRoot.getProject(event.getProjectName()); if (project != null) { - ICProjectDescription prjDescription = CCorePlugin.getDefault().getProjectDescription(project); + ICProjectDescription prjDescription = CCorePlugin.getDefault().getProjectDescription(project, false); if (prjDescription != null) { // cfgDescription being indexed ICConfigurationDescription cfgDescription = prjDescription.getDefaultSettingConfiguration(); diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPLinkage.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPLinkage.java index b21ab32e014..656dfb02abd 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPLinkage.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPLinkage.java @@ -898,7 +898,7 @@ class PDOMCPPLinkage extends PDOMLinkage implements IIndexCPPBindingConstants { case CPP_TEMPLATE_ALIAS: return new PDOMCPPAliasTemplate(this, record); case CPP_ENUMERATION_SPECIALIZATION: - return new PDOMCPPEnumeratorSpecialization(this, record); + return new PDOMCPPEnumerationSpecialization(this, record); case CPP_ENUMERATOR_SPECIALIZATION: return new PDOMCPPEnumeratorSpecialization(this, record); } diff --git a/doc/org.eclipse.cdt.doc.user/images/cdt_inline_rename.png b/doc/org.eclipse.cdt.doc.user/images/cdt_inline_rename.png new file mode 100755 index 00000000000..44047e88db8 Binary files /dev/null and b/doc/org.eclipse.cdt.doc.user/images/cdt_inline_rename.png differ diff --git a/doc/org.eclipse.cdt.doc.user/images/cdt_menu_refactor.png b/doc/org.eclipse.cdt.doc.user/images/cdt_menu_refactor.png index 99d958ed577..44acf0bf451 100644 Binary files a/doc/org.eclipse.cdt.doc.user/images/cdt_menu_refactor.png and b/doc/org.eclipse.cdt.doc.user/images/cdt_menu_refactor.png differ diff --git a/doc/org.eclipse.cdt.doc.user/images/cdt_refactor.png b/doc/org.eclipse.cdt.doc.user/images/cdt_refactor.png index 14897549720..22a4375c9ca 100644 Binary files a/doc/org.eclipse.cdt.doc.user/images/cdt_refactor.png and b/doc/org.eclipse.cdt.doc.user/images/cdt_refactor.png differ diff --git a/doc/org.eclipse.cdt.doc.user/images/cdt_rename_dialog.png b/doc/org.eclipse.cdt.doc.user/images/cdt_rename_dialog.png new file mode 100755 index 00000000000..4be0a7d5ff5 Binary files /dev/null and b/doc/org.eclipse.cdt.doc.user/images/cdt_rename_dialog.png differ diff --git a/doc/org.eclipse.cdt.doc.user/images/cdt_t_toggle_member.png b/doc/org.eclipse.cdt.doc.user/images/cdt_t_toggle_member.png deleted file mode 100644 index 7c594e1600f..00000000000 Binary files a/doc/org.eclipse.cdt.doc.user/images/cdt_t_toggle_member.png and /dev/null differ diff --git a/doc/org.eclipse.cdt.doc.user/images/cdt_t_toggle_selection.png b/doc/org.eclipse.cdt.doc.user/images/cdt_t_toggle_selection.png old mode 100644 new mode 100755 index 5b1c394d3c3..5f68cbc0aee Binary files a/doc/org.eclipse.cdt.doc.user/images/cdt_t_toggle_selection.png and b/doc/org.eclipse.cdt.doc.user/images/cdt_t_toggle_selection.png differ diff --git a/doc/org.eclipse.cdt.doc.user/images/cdt_t_toggle_selection2.png b/doc/org.eclipse.cdt.doc.user/images/cdt_t_toggle_selection2.png new file mode 100755 index 00000000000..1831f1f276d Binary files /dev/null and b/doc/org.eclipse.cdt.doc.user/images/cdt_t_toggle_selection2.png differ diff --git a/doc/org.eclipse.cdt.doc.user/images/cdt_t_toggle_selection3.png b/doc/org.eclipse.cdt.doc.user/images/cdt_t_toggle_selection3.png new file mode 100755 index 00000000000..00a6913dedd Binary files /dev/null and b/doc/org.eclipse.cdt.doc.user/images/cdt_t_toggle_selection3.png differ diff --git a/doc/org.eclipse.cdt.doc.user/reference/cdt_u_m_refactor.htm b/doc/org.eclipse.cdt.doc.user/reference/cdt_u_m_refactor.htm old mode 100644 new mode 100755 index f9046de7912..c648d84e533 --- a/doc/org.eclipse.cdt.doc.user/reference/cdt_u_m_refactor.htm +++ b/doc/org.eclipse.cdt.doc.user/reference/cdt_u_m_refactor.htm @@ -1,4 +1,4 @@ - + @@ -9,22 +9,73 @@ -

Refactor Menu actions

+
+

Refactor Menu actions

-

Selecting Refactor Menu

+

+ Selecting Refactor Menu +

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

NameFunctionKeyboard Shortcut
Apply Script...Applies a previously saved list of refactorings. 
Create Script...Exports a list of previously done refactorings for later use. 
History...Displays a history of refactorings. 
Rename...Renames selected object (variable, + method, etc...) and propagates changes to other files in project.Alt+Shift+R
Extract Local Variable...Extracts selected subexpression into a new local variable.Alt+Shift+L
Extract Constant...Replaces all instances of selected literal with a named constant.Alt+C
Extract Function...Replaces selected statements with a call to a new function containing them.Alt+Shift+M
Toggle Function DefinitionMoves selected function definition from a header file (in- or outside a class definition) to an implementation file, or back.Alt+Shift+T
Hide Method...Makes selected method private. 
+
+

-NameFunctionKeyboard Shortcut - - Rename... - Renames selected object (variable, method, etc...) and propagates changes to other files in project. - Alt+Shift+R -

- -

-Intel Copyright Statement -

-
+

+ Intel Copyright Statement +

+
+ \ No newline at end of file diff --git a/doc/org.eclipse.cdt.doc.user/tasks/cdt_t_rename.htm b/doc/org.eclipse.cdt.doc.user/tasks/cdt_t_rename.htm old mode 100644 new mode 100755 index adbc2c21532..2f96212125a --- a/doc/org.eclipse.cdt.doc.user/tasks/cdt_t_rename.htm +++ b/doc/org.eclipse.cdt.doc.user/tasks/cdt_t_rename.htm @@ -1,39 +1,55 @@ - Rename Refactoring - - -

Rename Refactoring

- -

Use the C/C++ Projects, Outline, or the Editor view Refactor > Rename context menu to refactor class & type names, methods, function & member names.

- -

To refactor an object select the object, right click and select Refactor > Rename...

-

Editor View showing Refactor option

- - The refactoring engine will rename all instances of the object in all referenced files. You can Undo refactoring by right clicking a second time and selecting Refactor > Undo

-

Editor View showing Refactor Undo option

- -

Related concepts -
-Open Declaration
-CDT Projects
-C/C++ search

-

Related tasks -
-Searching for C/C++ elements

-

Related reference -
-C/C++ search page, Search dialog box

- -IBM Copyright Statement - -
- +
+

Rename Refactoring

+

+ Use the Refactor > Rename command to rename + variables, functions, classes, methods, fields or typedefs. +

+

+ In an Editor window, select an item and run Refactor + > Rename... from the context menu. +

+

+ Example of inline renaming. +

+

All uses of the name are highlighted, and updated in real time + as you type. If you want to view the preview, or change any options, + simply click on the triangle, or press the keyboard shortcut again. + Otherwise, the options are the same as the last time a rename + refactoring was done.

+

When you hit Enter, all the item's declarations, definitions + and references will be changed to use the new name. The standard Undo + command can be used to revert the changes, if necessary.

+

The options can be set using a dialog box, where you can + specify the new name, and set various options affecting how hard to + look for uses of the name that should be updated. From there you can + also view the Preview of the changes that will be made by the + refactoring.

+

+ Rename dialog box +

+

Items to be renamed can also be selected from the Project + Explorer window, although inline renaming is not available in this + case, so the dialog box comes up immediately.

+

+ Project Explorer context menu Refactor > Rename command +

+

+ Related reference
Refactor Menu actions +

+ IBM Copyright Statement +
+ diff --git a/doc/org.eclipse.cdt.doc.user/tasks/cdt_t_toggle.htm b/doc/org.eclipse.cdt.doc.user/tasks/cdt_t_toggle.htm old mode 100644 new mode 100755 index 1571d6a35df..a62fd373ff8 --- a/doc/org.eclipse.cdt.doc.user/tasks/cdt_t_toggle.htm +++ b/doc/org.eclipse.cdt.doc.user/tasks/cdt_t_toggle.htm @@ -1,36 +1,43 @@ - Toggle Function Definition Refactoring - - -

Toggle Function Definition

- -

Toggle Function Definition moves a function definition inside an C/C++ source editor from one -position to another and preserves correctness.

- -

Toggling is available whenever the cursor is inside a function declaration -or definition. Any selection between the first and the last character of -the function definition (without comments) is considered valid for toggling.

-

Selection
Valid selection region

- -

Toggle free functions

-

The refactoring moves free functions from an implementation file to a header file with the same name and back. - If the header file does not exist the file is created.

- -

Toggle member functions

-

The function definition of a member function can by moved from the class declaration in the header file to an inline definition - in the header file to the implementation file and back to the class definition.

-

Toggle Member Function Definition

- -IBM Copyright Statement - -
- +
+

Toggle Function Definition

+

+ Use the Refactor > Toggle Function Definition + command to toggle the location where a function is defined. +

+

+ In an Editor window, place the cursor inside a function declaration + or definition, then run Refactor > Toggle + Function Definition from the context menu. Any cursor position + between the first and the last characters of the function definition + (but not including comments preceding the function) will cause that + function to be selected for the refactoring. +

+

+ +

+

This refactoring switches a function definition from a header + file to a correspondingly-named implementation file. If the necessary + file does not exist, it will be created (after a confirmation + dialog).

+

+ +

+

For methods, it can also switch the method from being defined + within its parent class declaration to being defined using an inline + definition in the same header file.

+

+ +

+ IBM Copyright Statement +
+ diff --git a/dsf-gdb/org.eclipse.cdt.dsf.gdb.multicorevisualizer.ui/src/org/eclipse/cdt/dsf/gdb/multicorevisualizer/internal/ui/view/MulticoreVisualizerEventListener.java b/dsf-gdb/org.eclipse.cdt.dsf.gdb.multicorevisualizer.ui/src/org/eclipse/cdt/dsf/gdb/multicorevisualizer/internal/ui/view/MulticoreVisualizerEventListener.java index cacb15f641b..bd8e70615a7 100644 --- a/dsf-gdb/org.eclipse.cdt.dsf.gdb.multicorevisualizer.ui/src/org/eclipse/cdt/dsf/gdb/multicorevisualizer/internal/ui/view/MulticoreVisualizerEventListener.java +++ b/dsf-gdb/org.eclipse.cdt.dsf.gdb.multicorevisualizer.ui/src/org/eclipse/cdt/dsf/gdb/multicorevisualizer/internal/ui/view/MulticoreVisualizerEventListener.java @@ -7,6 +7,7 @@ * * Contributors: * Marc Khouzam (Ericsson) - initial API and implementation + * Marc Dumais (Ericsson) - Bug 400231 *******************************************************************************/ package org.eclipse.cdt.dsf.gdb.multicorevisualizer.internal.ui.view; @@ -187,7 +188,10 @@ public class MulticoreVisualizerEventListener { fVisualizer.getModel().markThreadExited(tid); - fVisualizer.getMulticoreVisualizerCanvas().requestUpdate(); + MulticoreVisualizerCanvas canvas = fVisualizer.getMulticoreVisualizerCanvas(); + if (canvas != null) { + canvas.requestUpdate(); + } } } } diff --git a/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/META-INF/MANIFEST.MF b/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/META-INF/MANIFEST.MF index 8d3a7df5824..0e79e45f0b2 100644 --- a/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/META-INF/MANIFEST.MF +++ b/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/META-INF/MANIFEST.MF @@ -23,7 +23,9 @@ Require-Bundle: org.eclipse.ui, org.eclipse.jface.text;bundle-version="3.4.0", org.eclipse.ui.editors;bundle-version="3.4.0", org.eclipse.core.filesystem;bundle-version="1.2.0", - org.eclipse.cdt.launch;bundle-version="6.1.0" + org.eclipse.cdt.launch;bundle-version="6.1.0", + org.eclipse.debug.core, + org.eclipse.core.resources Bundle-ActivationPolicy: lazy Bundle-RequiredExecutionEnvironment: JavaSE-1.6 Export-Package: org.eclipse.cdt.dsf.gdb.internal.ui;x-internal:=true, diff --git a/dsf-gdb/org.eclipse.cdt.dsf.gdb/META-INF/MANIFEST.MF b/dsf-gdb/org.eclipse.cdt.dsf.gdb/META-INF/MANIFEST.MF index 5c2b5640892..875fd3ece60 100644 --- a/dsf-gdb/org.eclipse.cdt.dsf.gdb/META-INF/MANIFEST.MF +++ b/dsf-gdb/org.eclipse.cdt.dsf.gdb/META-INF/MANIFEST.MF @@ -13,7 +13,8 @@ Require-Bundle: org.eclipse.core.runtime, org.eclipse.cdt.debug.core, org.eclipse.core.variables, org.eclipse.cdt.launch;bundle-version="6.1.0", - org.eclipse.cdt.gdb;bundle-version="7.0.0" + org.eclipse.cdt.gdb;bundle-version="7.0.0", + org.eclipse.core.resources Bundle-ActivationPolicy: lazy Bundle-RequiredExecutionEnvironment: JavaSE-1.6 Export-Package: org.eclipse.cdt.dsf.gdb, diff --git a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/command/CLIEventProcessor.java b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/command/CLIEventProcessor.java index 454272a7de8..059b177f822 100644 --- a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/command/CLIEventProcessor.java +++ b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/command/CLIEventProcessor.java @@ -218,18 +218,25 @@ public class CLIEventProcessor { // We know something change, we just do not know what. // So the easiest way is to let the top layer handle it. - MIEvent event = new MIBreakpointChangedEvent( - DMContexts.getAncestorOfType(dmc, IBreakpointsTargetDMContext.class), 0); - fCommandControl.getSession().dispatchEvent(event, fCommandControl.getProperties()); + IBreakpointsTargetDMContext bpTargetDmc = DMContexts.getAncestorOfType(dmc, IBreakpointsTargetDMContext.class); + if (bpTargetDmc != null) { + MIEvent event = new MIBreakpointChangedEvent(bpTargetDmc, 0); + fCommandControl.getSession().dispatchEvent(event, fCommandControl.getProperties()); + } } else if (isSettingSignal(operation)) { - // We do no know which signal let the upper layer find it. - MIEvent event = new MISignalChangedEvent( - DMContexts.getAncestorOfType(dmc, ISignalsDMContext.class), ""); //$NON-NLS-1$ - fCommandControl.getSession().dispatchEvent(event, fCommandControl.getProperties()); + // We do no know which signal let the upper layer find it. + ISignalsDMContext signalDmc = DMContexts.getAncestorOfType(dmc, ISignalsDMContext.class); + if (signalDmc != null) { + MIEvent event = new MISignalChangedEvent(signalDmc, ""); //$NON-NLS-1$ + fCommandControl.getSession().dispatchEvent(event, fCommandControl.getProperties()); + } } else if (isDetach(operation)) { // if it was a "detach" command change the state. - MIEvent event = new MIDetachedEvent(DMContexts.getAncestorOfType(dmc, ICommandControlDMContext.class), token); - fCommandControl.getSession().dispatchEvent(event, fCommandControl.getProperties()); + ICommandControlDMContext controlDmc = DMContexts.getAncestorOfType(dmc, ICommandControlDMContext.class); + if (controlDmc != null) { + MIEvent event = new MIDetachedEvent(controlDmc, token); + fCommandControl.getSession().dispatchEvent(event, fCommandControl.getProperties()); + } } } diff --git a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/command/CLIEventProcessor_7_0.java b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/command/CLIEventProcessor_7_0.java index 681d26ba0ee..b91401806dd 100644 --- a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/command/CLIEventProcessor_7_0.java +++ b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/command/CLIEventProcessor_7_0.java @@ -169,18 +169,25 @@ public class CLIEventProcessor_7_0 { // We know something change, we just do not know what. // So the easiest way is to let the top layer handle it. - MIEvent event = new MIBreakpointChangedEvent( - DMContexts.getAncestorOfType(dmc, IBreakpointsTargetDMContext.class), 0); - fCommandControl.getSession().dispatchEvent(event, fCommandControl.getProperties()); + IBreakpointsTargetDMContext bpTargetDmc = DMContexts.getAncestorOfType(dmc, IBreakpointsTargetDMContext.class); + if (bpTargetDmc != null) { + MIEvent event = new MIBreakpointChangedEvent(bpTargetDmc, 0); + fCommandControl.getSession().dispatchEvent(event, fCommandControl.getProperties()); + } } else if (isSettingSignal(operation)) { - // We do no know which signal let the upper layer find it. - MIEvent event = new MISignalChangedEvent( - DMContexts.getAncestorOfType(dmc, ISignalsDMContext.class), ""); //$NON-NLS-1$ - fCommandControl.getSession().dispatchEvent(event, fCommandControl.getProperties()); + // We do no know which signal let the upper layer find it. + ISignalsDMContext signalDmc = DMContexts.getAncestorOfType(dmc, ISignalsDMContext.class); + if (signalDmc != null) { + MIEvent event = new MISignalChangedEvent(signalDmc, ""); //$NON-NLS-1$ + fCommandControl.getSession().dispatchEvent(event, fCommandControl.getProperties()); + } } else if (isDetach(operation)) { // if it was a "detach" command change the state. - MIEvent event = new MIDetachedEvent(DMContexts.getAncestorOfType(dmc, ICommandControlDMContext.class), token); - fCommandControl.getSession().dispatchEvent(event, fCommandControl.getProperties()); + ICommandControlDMContext controlDmc = DMContexts.getAncestorOfType(dmc, ICommandControlDMContext.class); + if (controlDmc != null) { + MIEvent event = new MIDetachedEvent(controlDmc, token); + fCommandControl.getSession().dispatchEvent(event, fCommandControl.getProperties()); + } } } diff --git a/dsf/org.eclipse.cdt.dsf.ui/META-INF/MANIFEST.MF b/dsf/org.eclipse.cdt.dsf.ui/META-INF/MANIFEST.MF index 25dadc0dba0..3050f5a8653 100644 --- a/dsf/org.eclipse.cdt.dsf.ui/META-INF/MANIFEST.MF +++ b/dsf/org.eclipse.cdt.dsf.ui/META-INF/MANIFEST.MF @@ -18,7 +18,9 @@ Require-Bundle: org.eclipse.ui;bundle-version="3.5.0", org.eclipse.ui.ide;bundle-version="3.5.0", org.eclipse.cdt.ui;bundle-version="5.1.0", org.eclipse.core.expressions;bundle-version="3.4.0", - org.eclipse.core.filesystem;bundle-version="1.2.0" + org.eclipse.core.filesystem;bundle-version="1.2.0", + org.eclipse.debug.core, + org.eclipse.core.resources Bundle-ActivationPolicy: lazy Export-Package: org.eclipse.cdt.dsf.debug.internal.ui;x-internal:=true, org.eclipse.cdt.dsf.debug.internal.ui.actions;x-internal:=true, diff --git a/dsf/org.eclipse.cdt.dsf/META-INF/MANIFEST.MF b/dsf/org.eclipse.cdt.dsf/META-INF/MANIFEST.MF index 91aa88e256d..62acb0a310a 100644 --- a/dsf/org.eclipse.cdt.dsf/META-INF/MANIFEST.MF +++ b/dsf/org.eclipse.cdt.dsf/META-INF/MANIFEST.MF @@ -9,7 +9,8 @@ Bundle-Localization: plugin Require-Bundle: org.eclipse.core.runtime, org.eclipse.debug.core, org.eclipse.cdt.core, - org.eclipse.cdt.debug.core + org.eclipse.cdt.debug.core, + org.eclipse.core.resources Bundle-ActivationPolicy: lazy Export-Package: org.eclipse.cdt.dsf.concurrent, org.eclipse.cdt.dsf.datamodel,