1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-04-29 19:45:01 +02:00

Merge remote-tracking branch 'cdt/master' into sd90

This commit is contained in:
Andrew Gvozdev 2013-02-17 22:07:36 -05:00
commit 8ce156e38d
26 changed files with 263 additions and 129 deletions

View file

@ -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;

View file

@ -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);

View file

@ -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();
}
}

View file

@ -73,3 +73,6 @@ CElementLabels.anonymous=(anonymous)
CElementLabels.concat_string=\ -\
CElementLabels.comma_string=,\
CElementLabels.declseparator_string=\ :\
CModelManager.LanguageSettingsChangeEventNotifications=Language settings change notifications

View file

@ -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

View file

@ -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))) {

View file

@ -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();

View file

@ -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);
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.3 KiB

After

Width:  |  Height:  |  Size: 28 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 25 KiB

After

Width:  |  Height:  |  Size: 55 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 27 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 10 KiB

After

Width:  |  Height:  |  Size: 35 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.2 KiB

View file

@ -1,4 +1,4 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html lang="en">
<head>
@ -9,22 +9,73 @@
</head>
<body>
<div role="main"><h1>Refactor Menu actions</h1>
<div role="main">
<h1>Refactor Menu actions</h1>
<p><img src="../images/cdt_menu_refactor.png" alt="Selecting Refactor Menu" ></p>
<p>
<img src="../images/cdt_menu_refactor.png"
alt="Selecting Refactor Menu">
</p>
<table border="1" cellspacing="0">
<tr>
<th id="name">Name</th>
<th id="function">Function</th>
<th id="keyboard">Keyboard Shortcut</th>
</tr>
<tr>
<td headers="name"><strong>Apply Script...</strong></td>
<td headers="function">Applies a previously saved list of refactorings.</td>
<td headers="keyboard">&nbsp;</td>
</tr>
<tr>
<td headers="name"><strong>Create Script...</strong></td>
<td headers="function">Exports a list of previously done refactorings for later use.</td>
<td headers="keyboard">&nbsp;</td>
</tr>
<tr>
<td headers="name"><strong>History...</strong></td>
<td headers="function">Displays a history of refactorings.</td>
<td headers="keyboard">&nbsp;</td>
</tr>
<tr>
<td headers="name"><strong>Rename...</strong></td>
<td headers="function">Renames selected object (variable,
method, etc...) and propagates changes to other files in project.</td>
<td headers="keyboard">Alt+Shift+R</td>
</tr>
<tr>
<td headers="name"><strong>Extract Local Variable...</strong></td>
<td headers="function">Extracts selected subexpression into a new local variable.</td>
<td headers="keyboard">Alt+Shift+L</td>
</tr>
<tr>
<td headers="name"><strong>Extract Constant...</strong></td>
<td headers="function">Replaces all instances of selected literal with a named constant.</td>
<td headers="keyboard">Alt+C</td>
</tr>
<tr>
<td headers="name"><strong>Extract Function...</strong></td>
<td headers="function">Replaces selected statements with a call to a new function containing them.</td>
<td headers="keyboard">Alt+Shift+M</td>
</tr>
<tr>
<td headers="name"><strong>Toggle Function Definition</strong></td>
<td headers="function">Moves selected function definition from a header file (in- or outside a class definition) to an implementation file, or back.</td>
<td headers="keyboard">Alt+Shift+T</td>
</tr>
<tr>
<td headers="name"><strong>Hide Method...</strong></td>
<td headers="function">Makes selected method private.</td>
<td headers="keyboard">&nbsp;</td>
</tr>
<p><table border="1" cellspacing="0">
</table>
<p></p>
<tr><th id="name">Name</th><th id="function">Function</th><th id="keyboard">Keyboard Shortcut</th></tr>
<tr>
<td headers="name"><strong>Rename...</strong></td>
<td headers="function">Renames selected object (variable, method, etc...) and propagates changes to other files in project.</td>
<td headers="keyboard">Alt+Shift+R</td>
</table><p></p>
<p>
<img src="../images/intl_07.gif" ALT="Intel Copyright Statement" >
</p>
</div></body>
<p>
<img src="../images/intl_07.gif" alt="Intel Copyright Statement">
</p>
</div>
</body>
</html>

74
doc/org.eclipse.cdt.doc.user/tasks/cdt_t_rename.htm Normal file → Executable file
View file

@ -1,39 +1,55 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html lang="en">
<head>
<meta http-equiv="Content-Language" content="en-us">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Rename Refactoring</title>
<link rel="stylesheet" type="text/css" href="../help.css">
</head>
<body>
<div role="main"><h1>Rename Refactoring</h1>
<p>Use the C/C++ Projects, Outline, or the Editor view <strong>Refactor &gt; Rename</strong> context menu to refactor class &amp; type names, methods, function &amp; member names.</p>
<p>To refactor an object select the object, right click and select <strong>Refactor &gt; Rename...</strong></p>
<p> <img src="../images/cdt_refactor.png" alt="Editor View showing Refactor option" ></p>
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 <strong>Refactor &gt; Undo</strong></p>
<p> <img src="../images/cdt_refactor_undo.png" alt="Editor View showing Refactor Undo option" ></p>
<p><img src="../images/ngconcepts.gif" ALT="Related concepts" width="143" height="21">
<br>
<a href="../concepts/cdt_c_open_declarations.htm">Open Declaration</a><br>
<a href="../concepts/cdt_c_projects.htm">CDT Projects</a><br>
<a href="../concepts/cdt_c_search.htm">C/C++ search</a></p>
<p><img src="../images/ngtasks.gif" ALT="Related tasks" width="143" height="21">
<br>
<a href="cdt_t_search.htm">Searching for C/C++ elements</a></p>
<p><img src="../images/ngref.gif" ALT="Related reference" width="143" height="21">
<br>
<a href="../reference/cdt_u_search.htm">C/C++ search page, Search dialog box</a></p>
<img src="../images/ng00_07.gif" ALT="IBM Copyright Statement" >
</div></body>
<div role="main">
<h1>Rename Refactoring</h1>
<p>
Use the <strong>Refactor &gt; Rename</strong> command to rename
variables, functions, classes, methods, fields or typedefs.
</p>
<p>
In an Editor window, select an item and run <strong>Refactor
&gt; Rename...</strong> from the context menu.
</p>
<p>
<img src="../images/cdt_inline_rename.png"
alt="Example of inline renaming.">
</p>
<p>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.</p>
<p>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.</p>
<p>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.</p>
<p>
<img src="../images/cdt_rename_dialog.png" alt="Rename dialog box">
</p>
<p>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.</p>
<p>
<img src="../images/cdt_refactor.png"
alt="Project Explorer context menu Refactor &gt; Rename command">
</p>
<p>
<img src="../images/ngref.gif" alt="Related reference" width="143"
height="21"> <br> <a
href="../reference/cdt_u_m_refactor.htm">Refactor Menu actions</a>
</p>
<img src="../images/ng00_07.gif" alt="IBM Copyright Statement">
</div>
</body>
</html>

59
doc/org.eclipse.cdt.doc.user/tasks/cdt_t_toggle.htm Normal file → Executable file
View file

@ -1,36 +1,43 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html lang="en">
<head>
<meta http-equiv="Content-Language" content="en-us">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Toggle Function Definition Refactoring</title>
<link rel="stylesheet" type="text/css" href="../help.css">
</head>
<body>
<div role="main"><h1>Toggle Function Definition</h1>
<p>Toggle Function Definition moves a function definition inside an C/C++ source editor from one
position to another and preserves correctness.</p>
<p>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.</p>
<p><img alt="Selection" src="../images/cdt_t_toggle_selection.png" title="Valid selection region"><br/>Valid selection region</p>
<h2>Toggle free functions</h2>
<p>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.</p>
<h2>Toggle member functions</h2>
<p>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.</p>
<p><img alt="Toggle Member Function Definition" src="../images/cdt_t_toggle_member.png"></p>
<img src="../images/ng00_07.gif" ALT="IBM Copyright Statement" >
</div></body>
<div role="main">
<h1>Toggle Function Definition</h1>
<p>
Use the <strong>Refactor &gt; Toggle Function Definition</strong>
command to toggle the location where a function is defined.
</p>
<p>
In an Editor window, place the cursor inside a function declaration
or definition, then run <strong>Refactor &gt; Toggle
Function Definition</strong> 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.
</p>
<p>
<img alt="" src="../images/cdt_t_toggle_selection.png">
</p>
<p>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).</p>
<p>
<img alt="" src="../images/cdt_t_toggle_selection2.png">
</p>
<p>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.</p>
<p>
<img alt="" src="../images/cdt_t_toggle_selection3.png">
</p>
<img src="../images/ng00_07.gif" ALT="IBM Copyright Statement">
</div>
</body>
</html>

View file

@ -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();
}
}
}
}

View file

@ -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,

View file

@ -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,

View file

@ -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());
}
}
}

View file

@ -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());
}
}
}

View file

@ -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,

View file

@ -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,