Skip to content

Commit 29d9060

Browse files
committed
Remove ant dependency from debug.examples.core
Having a preprocessor written in ant to be able to drive a tutorial step by step is total overkill and not helpful in this example. Initiated by eclipse-platform#2687 failure.
1 parent dbfae92 commit 29d9060

14 files changed

Lines changed: 11 additions & 469 deletions

File tree

debug/org.eclipse.debug.examples.core/.classpath

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-17"/>
44
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
55
<classpathentry kind="src" path="src"/>
6-
<classpathentry kind="src" path="src_ant"/>
76
<classpathentry kind="src" path="pdavm/src"/>
87
<classpathentry kind="output" path="bin"/>
98
</classpath>

debug/org.eclipse.debug.examples.core/META-INF/MANIFEST.MF

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,11 @@ Manifest-Version: 1.0
22
Bundle-ManifestVersion: 2
33
Bundle-Name: %Bundle-Name
44
Bundle-SymbolicName: org.eclipse.debug.examples.core;singleton:=true
5-
Bundle-Version: 1.6.700.qualifier
5+
Bundle-Version: 1.6.800.qualifier
66
Bundle-Activator: org.eclipse.debug.examples.core.pda.DebugCorePlugin
77
Require-Bundle: org.eclipse.core.runtime,
8-
org.eclipse.core.resources,
9-
org.eclipse.core.variables;bundle-version="3.2.800",
10-
org.eclipse.debug.core;bundle-version="3.9.0",
11-
org.apache.ant;bundle-version="1.9.2";resolution:=optional
12-
Export-Package: org.eclipse.debug.examples.ant.tasks;x-friends:="org.eclipse.debug.examples.ui",
13-
org.eclipse.debug.examples.core.midi.launcher;x-friends:="org.eclipse.debug.examples.ui",
8+
org.eclipse.debug.core;bundle-version="3.9.0"
9+
Export-Package: org.eclipse.debug.examples.core.midi.launcher;x-friends:="org.eclipse.debug.examples.ui",
1410
org.eclipse.debug.examples.core.pda;x-friends:="org.eclipse.debug.examples.ui",
1511
org.eclipse.debug.examples.core.pda.breakpoints;x-friends:="org.eclipse.debug.examples.ui",
1612
org.eclipse.debug.examples.core.pda.launcher;x-friends:="org.eclipse.debug.examples.ui",

debug/org.eclipse.debug.examples.core/build.properties

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
# IBM Corporation - initial API and implementation
1313
###############################################################################
1414
source.. = src/,\
15-
src_ant/,\
1615
pdavm/src/
1716
output.. = bin/
1817
bin.includes = plugin.xml,\

debug/org.eclipse.debug.examples.core/plugin.xml

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,6 @@
2222
name="perlExecutable"
2323
initialValue="c:\perl\bin\perl.exe"/>
2424
</extension>
25-
<!--#ifdef ex1-->
26-
<!--#else-->
2725
<extension
2826
point="org.eclipse.debug.core.launchConfigurationTypes">
2927
<launchConfigurationType
@@ -34,7 +32,6 @@
3432
id="pda.launchType"
3533
modes="run, debug"/>
3634
</extension>
37-
<!--#endif-->
3835

3936
<extension
4037
point="org.eclipse.debug.core.launchConfigurationTypes">
@@ -45,8 +42,6 @@
4542
modes="run, debug"/>
4643
</extension>
4744

48-
<!--#ifdef ex4-->
49-
<!--#else-->
5045
<extension
5146
point="org.eclipse.debug.core.sourceLocators">
5247
<sourceLocator
@@ -60,10 +55,7 @@
6055
class="org.eclipse.debug.examples.core.pda.sourcelookup.PDASourcePathComputerDelegate"
6156
id="pda.sourcePathComputer"/>
6257
</extension>
63-
<!--#endif-->
6458

65-
<!--#ifdef ex3-->
66-
<!--#else-->
6759
<extension
6860
point="org.eclipse.debug.core.breakpoints">
6961
<breakpoint
@@ -91,10 +83,7 @@
9183
<super type="org.eclipse.debug.examples.core.pda.markerType.lineBreakpoint"/>
9284
<persistent value="true"/>
9385
</extension>
94-
<!--#endif-->
9586

96-
<!--#ifdef ex6-->
97-
<!--#else-->
9887
<extension
9988
point="org.eclipse.debug.core.logicalStructureTypes">
10089
<logicalStructureType
@@ -103,5 +92,4 @@
10392
id="pda.wordStructure"
10493
modelIdentifier="pda.debugModel"/>
10594
</extension>
106-
<!--#endif-->
10795
</plugin>

debug/org.eclipse.debug.examples.core/scripts/build.xml

Lines changed: 0 additions & 69 deletions
This file was deleted.

debug/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/breakpoints/PDALineBreakpoint.java

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*******************************************************************************
2-
* Copyright (c) 2005, 2018 IBM Corporation and others.
2+
* Copyright (c) 2005, 2026 IBM Corporation and others.
33
*
44
* This program and the accompanying materials
55
* are made available under the terms of the Eclipse Public License 2.0
@@ -108,11 +108,7 @@ public void install(PDADebugTarget target) throws CoreException {
108108
* @throws CoreException if request creation fails
109109
*/
110110
protected void createRequest(PDADebugTarget target) throws CoreException {
111-
//#ifdef ex3
112-
//# // TODO: Exercise 3 - create breakpoint request in interpreter
113-
//#else
114111
target.sendCommand(new PDASetBreakpointCommand((getLineNumber() - 1), false));
115-
//#endif
116112
}
117113

118114
/**
@@ -123,11 +119,7 @@ protected void createRequest(PDADebugTarget target) throws CoreException {
123119
* @throws CoreException if clearing the request fails
124120
*/
125121
protected void clearRequest(PDADebugTarget target) throws CoreException {
126-
//#ifdef ex3
127-
//# // TODO: Exercise 3 - clear breakpoint request in interpreter
128-
//#else
129122
target.sendCommand(new PDAClearBreakpointCommand((getLineNumber() - 1)));
130-
//#endif
131123
}
132124

133125
/**

debug/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/launcher/PDALaunchDelegate.java

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*******************************************************************************
2-
* Copyright (c) 2005, 2018 IBM Corporation and others.
2+
* Copyright (c) 2005, 2026 IBM Corporation and others.
33
*
44
* This program and the accompanying materials
55
* are made available under the terms of the Eclipse Public License 2.0
@@ -46,12 +46,6 @@
4646
public class PDALaunchDelegate extends LaunchConfigurationDelegate {
4747
@Override
4848
public void launch(ILaunchConfiguration configuration, String mode, ILaunch launch, IProgressMonitor monitor) throws CoreException {
49-
//#ifdef ex1
50-
//# // TODO: Exercise 1 - Launch a command shell as a system process to echo "foo"
51-
//#elseif ex1_answer
52-
//# Process process = DebugPlugin.exec(new String[]{"cmd", "/C", "\"echo foo\""}, null);
53-
//# new RuntimeProcess(launch, process, "Hello", null);
54-
//#else
5549

5650
List<String> commandList = new ArrayList<>();
5751

@@ -107,7 +101,6 @@ public void launch(ILaunchConfiguration configuration, String mode, ILaunch laun
107101
IDebugTarget target = new PDADebugTarget(launch, p, requestPort, eventPort);
108102
launch.addDebugTarget(target);
109103
}
110-
//#endif
111104
}
112105

113106
/**

debug/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/model/PDADebugTarget.java

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*******************************************************************************
2-
* Copyright (c) 2005, 2015 IBM Corporation and others.
2+
* Copyright (c) 2005, 2026 IBM Corporation and others.
33
*
44
* This program and the accompanying materials
55
* are made available under the terms of the Eclipse Public License 2.0
@@ -276,11 +276,7 @@ public synchronized boolean isTerminated() {
276276

277277
@Override
278278
public void terminate() throws DebugException {
279-
//#ifdef ex2
280-
//# // TODO: Exercise 2 - send termination request to interpreter
281-
//#else
282279
sendCommand(new PDATerminateCommand());
283-
//#endif
284280
}
285281

286282
@Override

debug/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/model/PDAThread.java

Lines changed: 1 addition & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*******************************************************************************
2-
* Copyright (c) 2005, 2018 IBM Corporation and others.
2+
* Copyright (c) 2005, 2026 IBM Corporation and others.
33
*
44
* This program and the accompanying materials
55
* are made available under the terms of the Eclipse Public License 2.0
@@ -191,20 +191,12 @@ public boolean isSuspended() {
191191

192192
@Override
193193
public void resume() throws DebugException {
194-
//#ifdef ex2
195-
//# // TODO: Exercise 2 - send resume request to interpreter
196-
//#else
197194
sendCommand(new PDAResumeCommand(fThreadId));
198-
//#endif
199195
}
200196

201197
@Override
202198
public void suspend() throws DebugException {
203-
//#ifdef ex2
204-
//# // TODO: Exercise 2 - send suspend request to interpreter
205-
//#else
206199
sendCommand(new PDASuspendCommand(fThreadId));
207-
//#endif
208200
}
209201

210202
@Override
@@ -307,46 +299,24 @@ public void handleEvent(PDAEvent _event) {
307299
if ("step".equals(event.fReason)) { //$NON-NLS-1$
308300
setStepping(true);
309301
resumed(DebugEvent.STEP_OVER);
310-
//#ifdef ex2
311-
//# }
312-
//# // TODO: Exercise 2 - handle/fire "client" resume event
313-
//#else
314302
} else if ("client".equals(event.fReason)) { //$NON-NLS-1$
315303
resumed(DebugEvent.CLIENT_REQUEST);
316304
}
317-
//#endif
318-
//#ifdef ex5
319-
//# // TODO: Exercise 5 - handle start of drop event
320-
//#else
321305
else if ("drop".equals(event.fReason)) { //$NON-NLS-1$
322306
resumed(DebugEvent.STEP_RETURN);
323307
}
324-
//#endif
325308
} else if (event instanceof PDASuspendedEvent || event instanceof PDAVMSuspendedEvent) {
326309
setSuspended(true);
327-
//#ifdef ex2
328-
//# // TODO: Exercise 2 - handle/fire "client" suspend event
329-
//# if (event.endsWith("step")) {
330-
//# suspended(DebugEvent.STEP_END);
331-
//# } else if (event.startsWith("suspended event") && getError() != null) {
332-
//# exceptionHit();
333-
//# }
334-
//#else
335310
if ("client".equals(event.fReason)) { //$NON-NLS-1$
336311
suspended(DebugEvent.CLIENT_REQUEST);
337312
} else if ("step".equals(event.fReason)) { //$NON-NLS-1$
338313
suspended(DebugEvent.STEP_END);
339314
} else if ("event".equals(event.fReason) && getError() != null) { //$NON-NLS-1$
340315
exceptionHit();
341316
}
342-
//#endif
343-
//#ifdef ex5
344-
//# // TODO: Exercise 5 - handle end of drop event
345-
//#else
346317
else if ("drop".equals(event.fReason)) { //$NON-NLS-1$
347318
suspended(DebugEvent.STEP_END);
348319
}
349-
//#endif
350320
} else if (_event instanceof PDANoSuchLabelEvent ||
351321
_event instanceof PDAUnimplementedInstructionEvent)
352322
{
@@ -421,11 +391,7 @@ protected IVariable[] getVariables(IStackFrame frame) {
421391
* @since 3.5
422392
*/
423393
public void popFrame() throws DebugException {
424-
//#ifdef ex5
425-
//# // TODO: Exercise 5 - send drop request
426-
//#else
427394
sendCommand(new PDADropFrameCommand(fThreadId));
428-
//#endif
429395
}
430396

431397
/**
@@ -436,14 +402,10 @@ public void popFrame() throws DebugException {
436402
* @since 3.5
437403
*/
438404
public boolean canPopFrame() {
439-
//#ifdef ex5
440-
//# // TODO: Exercise 5 - allow pop if there is more than 1 frame on the stack
441-
//#else
442405
try {
443406
return getStackFrames().length > 1;
444407
} catch (DebugException e) {
445408
}
446-
//#endif
447409
return false;
448410
}
449411

debug/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/model/WordStructureDelegate.java

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*******************************************************************************
2-
* Copyright (c) 2005, 2018 IBM Corporation and others.
2+
* Copyright (c) 2005, 2026 IBM Corporation and others.
33
*
44
* This program and the accompanying materials
55
* are made available under the terms of the Eclipse Public License 2.0
@@ -26,27 +26,18 @@ public class WordStructureDelegate implements ILogicalStructureTypeDelegate {
2626

2727
@Override
2828
public boolean providesLogicalStructure(IValue value) {
29-
//#ifdef ex6
30-
//# // TODO: Exercise 6 - provide logical structures if the value has multiple words
31-
//#else
3229
try {
3330
String string = value.getValueString();
3431
String[] words = string.split("\\W+"); //$NON-NLS-1$
3532
return words.length > 1;
3633
} catch (DebugException e) {
3734
}
38-
//#endif
3935
return false;
4036
}
4137

4238
@Override
4339
public IValue getLogicalStructure(IValue value) throws CoreException {
44-
//#ifdef ex6
45-
//# // TODO: Exercise 6 - create an array from the given value
46-
//# return null;
47-
//#else
4840
return new PDAArray((PDAValue)value);
49-
//#endif
5041
}
5142

5243
}

0 commit comments

Comments
 (0)