Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'org.eclipse.debug.examples.core')
-rw-r--r--org.eclipse.debug.examples.core/.classpath9
-rw-r--r--org.eclipse.debug.examples.core/.cvsignore1
-rw-r--r--org.eclipse.debug.examples.core/.project34
-rw-r--r--org.eclipse.debug.examples.core/.settings/org.eclipse.jdt.core.prefs47
-rw-r--r--org.eclipse.debug.examples.core/META-INF/MANIFEST.MF21
-rw-r--r--org.eclipse.debug.examples.core/about.html28
-rw-r--r--org.eclipse.debug.examples.core/build.properties21
-rw-r--r--org.eclipse.debug.examples.core/pdavm/src/org/eclipse/debug/examples/pdavm/PDAVirtualMachine.java1427
-rw-r--r--org.eclipse.debug.examples.core/pdavm/tests/vmtest10.pda38
-rw-r--r--org.eclipse.debug.examples.core/pdavm/tests/vmtest2.pda48
-rw-r--r--org.eclipse.debug.examples.core/pdavm/tests/vmtest3.pda13
-rw-r--r--org.eclipse.debug.examples.core/pdavm/tests/vmtest6.pda31
-rw-r--r--org.eclipse.debug.examples.core/pdavm/tests/vmtest8.pda14
-rw-r--r--org.eclipse.debug.examples.core/pdavm/tests/vmtest9.pda23
-rw-r--r--org.eclipse.debug.examples.core/pdavm/tests/vmtest_children.pda8
-rw-r--r--org.eclipse.debug.examples.core/plugin.xml103
-rw-r--r--org.eclipse.debug.examples.core/readme.html11
-rw-r--r--org.eclipse.debug.examples.core/samples/counter.pda11
-rw-r--r--org.eclipse.debug.examples.core/samples/drop.pda12
-rw-r--r--org.eclipse.debug.examples.core/samples/example.pda35
-rw-r--r--org.eclipse.debug.examples.core/samples/fibonacci.pda32
-rw-r--r--org.eclipse.debug.examples.core/samples/registers.pda72
-rw-r--r--org.eclipse.debug.examples.core/samples/stack.pda21
-rw-r--r--org.eclipse.debug.examples.core/samples/structures.pda29
-rw-r--r--org.eclipse.debug.examples.core/scripts/build.xml66
-rw-r--r--org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/midi/launcher/ClockControl.java93
-rw-r--r--org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/midi/launcher/LengthControl.java36
-rw-r--r--org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/midi/launcher/MidiLaunch.java165
-rw-r--r--org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/midi/launcher/MidiLaunchDelegate.java126
-rw-r--r--org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/midi/launcher/SequencerControl.java132
-rw-r--r--org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/midi/launcher/TempoControl.java89
-rw-r--r--org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/midi/launcher/TimeControl.java88
-rw-r--r--org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/DebugCorePlugin.java133
-rw-r--r--org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/breakpoints/PDALineBreakpoint.java206
-rw-r--r--org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/breakpoints/PDARunToLineBreakpoint.java70
-rw-r--r--org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/breakpoints/PDAWatchpoint.java231
-rw-r--r--org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/launcher/PDALaunchDelegate.java152
-rw-r--r--org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/model/IPDAEventListener.java44
-rw-r--r--org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/model/PDAArray.java51
-rw-r--r--org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/model/PDAArrayEntry.java98
-rw-r--r--org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/model/PDADebugElement.java109
-rw-r--r--org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/model/PDADebugTarget.java582
-rw-r--r--org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/model/PDAStackFrame.java260
-rw-r--r--org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/model/PDAStackValue.java92
-rw-r--r--org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/model/PDAThread.java563
-rw-r--r--org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/model/PDAValue.java109
-rw-r--r--org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/model/PDAVariable.java114
-rw-r--r--org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/model/WordStructureDelegate.java53
-rw-r--r--org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDABitFieldData.java41
-rw-r--r--org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAChildrenCommand.java34
-rw-r--r--org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAClearBreakpointCommand.java31
-rw-r--r--org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDACommand.java40
-rw-r--r--org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDACommandResult.java27
-rw-r--r--org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDADataCommand.java35
-rw-r--r--org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDADropFrameCommand.java44
-rw-r--r--org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAEvalCommand.java43
-rw-r--r--org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAEvalResultEvent.java32
-rw-r--r--org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAEvent.java75
-rw-r--r--org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAEventStopCommand.java48
-rw-r--r--org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAExitedEvent.java29
-rw-r--r--org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAFrameCommand.java36
-rw-r--r--org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAFrameCommandResult.java30
-rw-r--r--org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAFrameData.java46
-rw-r--r--org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAGroupsCommand.java33
-rw-r--r--org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAListResult.java43
-rw-r--r--org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDANoSuchLabelEvent.java40
-rw-r--r--org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAPopDataCommand.java34
-rw-r--r--org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAPushDataCommand.java36
-rw-r--r--org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDARegisterData.java43
-rw-r--r--org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDARegistersCommand.java33
-rw-r--r--org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDARegistersCommandResult.java39
-rw-r--r--org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDARegistersEvent.java30
-rw-r--r--org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDARestartCommand.java35
-rw-r--r--org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAResumeCommand.java40
-rw-r--r--org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAResumedEvent.java29
-rw-r--r--org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDARunControlEvent.java69
-rw-r--r--org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDASetBreakpointCommand.java46
-rw-r--r--org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDASetDataCommand.java36
-rw-r--r--org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDASetVarCommand.java38
-rw-r--r--org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAStackCommand.java39
-rw-r--r--org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAStackCommandResult.java40
-rw-r--r--org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAStackDepthCommand.java36
-rw-r--r--org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAStackDepthCommandResult.java31
-rw-r--r--org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAStartedEvent.java30
-rw-r--r--org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAStepCommand.java45
-rw-r--r--org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAStepReturnCommand.java46
-rw-r--r--org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDASuspendCommand.java40
-rw-r--r--org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDASuspendedEvent.java43
-rw-r--r--org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDATerminateCommand.java34
-rw-r--r--org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDATerminatedEvent.java29
-rw-r--r--org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAUnimplementedInstructionEvent.java41
-rw-r--r--org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAVMResumeCommand.java37
-rw-r--r--org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAVMResumedEvent.java36
-rw-r--r--org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAVMStartedEvent.java30
-rw-r--r--org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAVMSuspendCommand.java37
-rw-r--r--org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAVMSuspendedEvent.java44
-rw-r--r--org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAVMTerminatedEvent.java29
-rw-r--r--org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAVarCommand.java39
-rw-r--r--org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAWatchCommand.java43
-rw-r--r--org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/package.html99
-rw-r--r--org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/sourcelookup/PDASourceLookupDirector.java32
-rw-r--r--org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/sourcelookup/PDASourceLookupParticipant.java38
-rw-r--r--org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/sourcelookup/PDASourcePathComputerDelegate.java65
-rw-r--r--org.eclipse.debug.examples.core/src_ant/org/eclipse/debug/examples/ant/tasks/PreProcessor.java295
104 files changed, 0 insertions, 8244 deletions
diff --git a/org.eclipse.debug.examples.core/.classpath b/org.eclipse.debug.examples.core/.classpath
deleted file mode 100644
index 9f8cf0e63..000000000
--- a/org.eclipse.debug.examples.core/.classpath
+++ /dev/null
@@ -1,9 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry kind="src" path="src"/>
- <classpathentry kind="src" path="src_ant"/>
- <classpathentry kind="src" path="pdavm/src"/>
- <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.4"/>
- <classpathentry kind="output" path="bin"/>
-</classpath>
diff --git a/org.eclipse.debug.examples.core/.cvsignore b/org.eclipse.debug.examples.core/.cvsignore
deleted file mode 100644
index ba077a403..000000000
--- a/org.eclipse.debug.examples.core/.cvsignore
+++ /dev/null
@@ -1 +0,0 @@
-bin
diff --git a/org.eclipse.debug.examples.core/.project b/org.eclipse.debug.examples.core/.project
deleted file mode 100644
index b1f1fe3ee..000000000
--- a/org.eclipse.debug.examples.core/.project
+++ /dev/null
@@ -1,34 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.debug.examples.core</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>
- <buildCommand>
- <name>org.eclipse.pde.api.tools.apiAnalysisBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.pde.PluginNature</nature>
- <nature>org.eclipse.jdt.core.javanature</nature>
- <nature>org.eclipse.pde.api.tools.apiAnalysisNature</nature>
- </natures>
-</projectDescription>
diff --git a/org.eclipse.debug.examples.core/.settings/org.eclipse.jdt.core.prefs b/org.eclipse.debug.examples.core/.settings/org.eclipse.jdt.core.prefs
deleted file mode 100644
index d6de6c150..000000000
--- a/org.eclipse.debug.examples.core/.settings/org.eclipse.jdt.core.prefs
+++ /dev/null
@@ -1,47 +0,0 @@
-#Mon Jan 24 20:23:34 CST 2005
-eclipse.preferences.version=1
-org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=disabled
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.2
-org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
-org.eclipse.jdt.core.compiler.compliance=1.4
-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=warning
-org.eclipse.jdt.core.compiler.problem.deprecation=warning
-org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled
-org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=disabled
-org.eclipse.jdt.core.compiler.problem.emptyStatement=warning
-org.eclipse.jdt.core.compiler.problem.enumIdentifier=warning
-org.eclipse.jdt.core.compiler.problem.fieldHiding=ignore
-org.eclipse.jdt.core.compiler.problem.finalParameterBound=ignore
-org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=warning
-org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=warning
-org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=warning
-org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=warning
-org.eclipse.jdt.core.compiler.problem.localVariableHiding=ignore
-org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=warning
-org.eclipse.jdt.core.compiler.problem.missingSerialVersion=warning
-org.eclipse.jdt.core.compiler.problem.noEffectAssignment=warning
-org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=warning
-org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=ignore
-org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning
-org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=ignore
-org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled
-org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=warning
-org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=ignore
-org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=warning
-org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=ignore
-org.eclipse.jdt.core.compiler.problem.unnecessaryElse=ignore
-org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=warning
-org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore
-org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=ignore
-org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=disabled
-org.eclipse.jdt.core.compiler.problem.unusedImport=warning
-org.eclipse.jdt.core.compiler.problem.unusedLocal=warning
-org.eclipse.jdt.core.compiler.problem.unusedParameter=ignore
-org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=disabled
-org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled
-org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=warning
-org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning
-org.eclipse.jdt.core.compiler.source=1.3
diff --git a/org.eclipse.debug.examples.core/META-INF/MANIFEST.MF b/org.eclipse.debug.examples.core/META-INF/MANIFEST.MF
deleted file mode 100644
index 7e1ec2ad8..000000000
--- a/org.eclipse.debug.examples.core/META-INF/MANIFEST.MF
+++ /dev/null
@@ -1,21 +0,0 @@
-Manifest-Version: 1.0
-Bundle-ManifestVersion: 2
-Bundle-Name: Example Debug Core Plug-in
-Bundle-SymbolicName: org.eclipse.debug.examples.core;singleton:=true
-Bundle-Version: 1.2.0
-Bundle-Activator: org.eclipse.debug.examples.core.pda.DebugCorePlugin
-Require-Bundle: org.eclipse.core.runtime,
- org.eclipse.core.resources,
- org.eclipse.core.variables,
- org.eclipse.debug.core,
- org.apache.ant;bundle-version="1.7.0";resolution:=optional
-Eclipse-LazyStart: true
-Export-Package: org.eclipse.debug.examples.core.midi.launcher,
- org.eclipse.debug.examples.core.pda,
- org.eclipse.debug.examples.core.pda.breakpoints,
- org.eclipse.debug.examples.core.pda.launcher,
- org.eclipse.debug.examples.core.pda.model,
- org.eclipse.debug.examples.core.pda.protocol,
- org.eclipse.debug.examples.core.pda.sourcelookup
-Bundle-RequiredExecutionEnvironment: J2SE-1.4
-Bundle-ActivationPolicy: lazy
diff --git a/org.eclipse.debug.examples.core/about.html b/org.eclipse.debug.examples.core/about.html
deleted file mode 100644
index 460233046..000000000
--- a/org.eclipse.debug.examples.core/about.html
+++ /dev/null
@@ -1,28 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml">
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"/>
-<title>About</title>
-</head>
-<body lang="EN-US">
-<h2>About This Content</h2>
-
-<p>June 2, 2006</p>
-<h3>License</h3>
-
-<p>The Eclipse Foundation makes available all content in this plug-in (&quot;Content&quot;). Unless otherwise
-indicated below, the Content is provided to you under the terms and conditions of the
-Eclipse Public License Version 1.0 (&quot;EPL&quot;). A copy of the EPL is available
-at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.
-For purposes of the EPL, &quot;Program&quot; will mean the Content.</p>
-
-<p>If you did not receive this Content directly from the Eclipse Foundation, the Content is
-being redistributed by another party (&quot;Redistributor&quot;) and different terms and conditions may
-apply to your use of any object code in the Content. Check the Redistributor's license that was
-provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise
-indicated below, the terms and conditions of the EPL still apply to any source code in the Content
-and such source code may be obtained at <a href="http://www.eclipse.org">http://www.eclipse.org</a>.</p>
-
-</body>
-</html> \ No newline at end of file
diff --git a/org.eclipse.debug.examples.core/build.properties b/org.eclipse.debug.examples.core/build.properties
deleted file mode 100644
index f50444bad..000000000
--- a/org.eclipse.debug.examples.core/build.properties
+++ /dev/null
@@ -1,21 +0,0 @@
-###############################################################################
-# Copyright (c) 2005, 2007 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
-###############################################################################
-source.. = src/
-output.. = bin/
-bin.includes = plugin.xml,\
- pdavm/,\
- META-INF/,\
- about.html,\
- .,\
- readme.html,\
- samples/
-src.includes = about.html,\
- src/
diff --git a/org.eclipse.debug.examples.core/pdavm/src/org/eclipse/debug/examples/pdavm/PDAVirtualMachine.java b/org.eclipse.debug.examples.core/pdavm/src/org/eclipse/debug/examples/pdavm/PDAVirtualMachine.java
deleted file mode 100644
index e140e1085..000000000
--- a/org.eclipse.debug.examples.core/pdavm/src/org/eclipse/debug/examples/pdavm/PDAVirtualMachine.java
+++ /dev/null
@@ -1,1427 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2009 Wind River Systems 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:
- * Bjorn Freeman-Benson - initial API and implementation
- * Pawel Piech (Wind River) - ported PDA Virtual Machine to Java (Bug 261400)
- *******************************************************************************/
-package org.eclipse.debug.examples.pdavm;
-
-import java.io.BufferedReader;
-import java.io.FileReader;
-import java.io.IOException;
-import java.io.InputStreamReader;
-import java.io.OutputStream;
-import java.io.PrintStream;
-import java.io.StringWriter;
-import java.net.ServerSocket;
-import java.net.Socket;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.LinkedHashMap;
-import java.util.LinkedList;
-import java.util.List;
-import java.util.Map;
-import java.util.StringTokenizer;
-import java.util.TreeSet;
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
-
-/**
- * Push Down Automata interpreter.
- *
- * @since 3.5
- */
-public class PDAVirtualMachine {
-
- static class Stack extends LinkedList {
- private static final long serialVersionUID = 1L;
-
- public Object pop() {
- return isEmpty() ? new Integer(0) : remove(size() - 1);
- }
-
- public void push(Object value) {
- add(value);
- }
- }
-
- static class Register {
- Register(String name) {
- fName = name;
- }
- String fName;
- String fGroup = "<no_group>";
- boolean fIsWriteable = true;
- Map fBitFields = new LinkedHashMap(0);
- int fValue;
- }
-
- static class BitField {
- BitField(String name) {
- fName = name;
- }
- String fName;
- int fBitOffset;
- int fBitCount;
- Map fMnemonics = new LinkedHashMap(0);
- }
-
- Map fRegisters = new LinkedHashMap(0);
-
- class Args {
- final String[] fArgs;
-
- int next = 0;
-
- Args(String[] args) {
- fArgs = args;
- }
-
- boolean hasNextArg() {
- return fArgs.length > next;
- }
-
- String getNextStringArg() {
- if (fArgs.length > next) {
- return fArgs[next++];
- }
- return "";
- }
-
- int getNextIntArg() {
- String arg = getNextStringArg();
- try {
- return Integer.parseInt(arg);
- } catch (NumberFormatException e) {
- }
- return 0;
- }
-
- boolean getNextBooleanArg() {
- String arg = getNextStringArg();
- try {
- return Boolean.getBoolean(arg);
- } catch (NumberFormatException e) {
- }
- return false;
- }
-
- Object getNextIntOrStringArg() {
- String arg = getNextStringArg();
- try {
- return new Integer(arg);
- } catch (NumberFormatException e) {
- }
- return arg;
- }
-
- PDAThread getThreadArg() {
- int id = getNextIntArg();
- return (PDAThread)fThreads.get( new Integer(id) );
- }
- }
-
- class PDAThread {
- final int fID;
-
- /** The push down automata data stack (the data stack). */
- final Stack fStack = new Stack();
-
- /**
- * PDAThread copy of the code. It can differ from the program if
- * performing an evaluation.
- */
- String[] fThreadCode;
-
- /** PDAThread copy of the labels. */
- Map fThreadLabels;
-
- /** The stack of stack frames (the control stack) */
- final List fFrames = new LinkedList();
-
- /** Current stack frame (not includced in fFrames) */
- Frame fCurrentFrame;
-
- /**
- * The run flag is true if the thread is running. If the run flag is
- * false, the thread exits the next time the main instruction loop runs.
- */
- boolean fRun = true;
-
- String fSuspend = null;
-
- boolean fStep = false;
-
- boolean fStepReturn = false;
-
- int fSavedPC;
-
- boolean fPerformingEval = false;
-
- PDAThread(int id, String function, int pc) {
- fID = id;
- fCurrentFrame = new Frame(function, pc);
- fThreadCode = fCode;
- fThreadLabels = fLabels;
- }
- }
-
- final Map fThreads = new LinkedHashMap();
-
- int fNextThreadId = 1;
-
- boolean fStarted = true;
- /**
- * The code is stored as an array of strings, each line of the source file
- * being one entry in the array.
- */
- final String[] fCode;
-
- /** A mapping of labels to indicies in the code array */
- final Map fLabels;
-
- /** Each stack frame is a mapping of variable names to values. */
- class Frame {
- final Map fLocalVariables = new LinkedHashMap();
-
- /**
- * The name of the function in this frame
- */
- final String fFunction;
-
- /**
- * The current program counter in the frame the pc points to the next
- * instruction to be executed
- */
- int fPC;
-
- Frame(String function, int pc) {
- fFunction = function;
- fPC = pc;
- }
-
- void set(String name, Object value) {
- if (name.startsWith("$")) {
- setRegisterValue(name, value);
- } else {
- fLocalVariables.put(name, value);
- }
- }
-
- Object get(String name) {
- if (name.startsWith("$")) {
- return getRegisterValue(name);
- } else {
- return fLocalVariables.get(name);
- }
- }
- }
-
- void setRegisterValue(String name, Object value) {
- Register reg = (Register)fRegisters.get(getRegisterPartOfName(name));
- if (reg == null) return;
- String bitFieldName = getBitFieldPartOfName(name);
- if (bitFieldName != null) {
- BitField bitField = (BitField)reg.fBitFields.get(bitFieldName);
- if (bitField == null) return;
- Integer intValue = null;
- if (value instanceof Integer) {
- intValue = (Integer)value;
- } else if (value instanceof String) {
- intValue = (Integer)bitField.fMnemonics.get(value);
- }
- if (intValue != null) {
- int bitFieldMask = 2^(bitField.fBitCount - 1);
- int registerMask = ~(bitFieldMask << bitField.fBitOffset);
- int bitFieldValue = intValue.intValue() & bitFieldMask;
- reg.fValue = (reg.fValue & registerMask) | (bitFieldValue << bitField.fBitOffset);
- }
- } else if (value instanceof Integer) {
- reg.fValue = ((Integer)value).intValue();
- }
- }
-
- Object getRegisterValue(String name) {
- Register reg = (Register)fRegisters.get(getRegisterPartOfName(name));
- if (reg == null) return null;
- String bitFieldName = getBitFieldPartOfName(name);
- if (bitFieldName != null) {
- BitField bitField = (BitField)reg.fBitFields.get(bitFieldName);
- if (bitField == null) return null;
- int bitFieldMask = 2^(bitField.fBitCount - 1);
- int registerMask = bitFieldMask << bitField.fBitOffset;
- return new Integer( (reg.fValue & registerMask) >> bitField.fBitOffset );
- } else {
- return new Integer(reg.fValue);
- }
- }
-
- /**
- * Breakpoints are stored per each each line of code. The boolean indicates
- * whether the whole VM should suspend or just the triggering thread.
- */
- final Map fBreakpoints = new HashMap();
-
- /**
- * The suspend flag is true if the VM should suspend running the program and
- * just listen for debug commands.
- */
- String fSuspendVM;
-
- /** Flag indicating whether the debugger is performing a step. */
- boolean fStepVM = false;
-
- /** Flag indicating whether the debugger is performing a step return */
- boolean fStepReturnVM = false;
-
- int fSteppingThread = 0;
-
- /** Name of the pda program being debugged */
- final String fFilename;
-
- /** The command line argument to start a debug session. */
- final boolean fDebug;
-
- /** The port to listen for debug commands on */
- final int fCommandPort;
-
- /**
- * Command socket for receiving debug commands and sending command responses
- */
- Socket fCommandSocket;
-
- /** Command socket reader */
- BufferedReader fCommandReceiveStream;
-
- /** Command socket write stream. */
- OutputStream fCommandResponseStream;
-
- /** The port to send debug events to */
- final int fEventPort;
-
- /** Event socket */
- Socket fEventSocket;
-
- /** Event socket and write stream. */
- OutputStream fEventStream;
-
- /** The eventstops table holds which events cause suspends and which do not. */
- final Map fEventStops = new HashMap();
- {
- fEventStops.put("unimpinstr", Boolean.FALSE);
- fEventStops.put("nosuchlabel", Boolean.FALSE);
- }
-
- /**
- * The watchpoints table holds watchpoint information.
- * <p/>
- * variablename_stackframedepth => N
- * <ul>
- * <li>N = 0 is no watch</li>
- * <li>N = 1 is read watch</li>
- * <li>N = 2 is write watch</li>
- * <li>N = 3 is both, etc.</li>
- */
- final Map fWatchpoints = new HashMap();
-
- public static void main(String[] args) {
- String programFile = args.length >= 1 ? args[0] : null;
- if (programFile == null) {
- System.err.println("Error: No program specified");
- return;
- }
-
- String debugFlag = args.length >= 2 ? args[1] : "";
- boolean debug = "-debug".equals(debugFlag);
- int commandPort = 0;
- int eventPort = 0;
-
- if (debug) {
- String commandPortStr = args.length >= 3 ? args[2] : "";
- try {
- commandPort = Integer.parseInt(commandPortStr);
- } catch (NumberFormatException e) {
- System.err.println("Error: Invalid command port");
- return;
- }
-
- String eventPortStr = args.length >= 4 ? args[3] : "";
- try {
- eventPort = Integer.parseInt(eventPortStr);
- } catch (NumberFormatException e) {
- System.err.println("Error: Invalid event port");
- return;
- }
- }
-
- PDAVirtualMachine pdaVM = null;
- try {
- pdaVM = new PDAVirtualMachine(programFile, debug, commandPort, eventPort);
- pdaVM.startDebugger();
- } catch (IOException e) {
- System.err.println("Error: " + e.toString());
- return;
- }
- pdaVM.run();
- }
-
- PDAVirtualMachine(String inputFile, boolean debug, int commandPort, int eventPort) throws IOException {
- fFilename = inputFile;
-
- // Load all the code into memory
- FileReader fileReader = new FileReader(inputFile);
- StringWriter stringWriter = new StringWriter();
- List code = new LinkedList();
- int c = fileReader.read();
- while (c != -1) {
- if (c == '\n') {
- code.add(stringWriter.toString().trim());
- stringWriter = new StringWriter();
- } else {
- stringWriter.write(c);
- }
- c = fileReader.read();
- }
- code.add(stringWriter.toString().trim());
- fCode = (String[])code.toArray(new String[code.size()]);
-
- fLabels = mapLabels(fCode);
-
- fDebug = debug;
- fCommandPort = commandPort;
- fEventPort = eventPort;
- }
-
- /**
- * Initializes the labels map
- */
- Map mapLabels(String[] code) {
- Map labels = new HashMap();
- for (int i = 0; i < code.length; i++) {
- if (code[i].length() != 0 && code[i].charAt(0) == ':') {
- labels.put(code[i].substring(1), new Integer(i));
- }
- }
- return labels;
- }
-
- void sendCommandResponse(String response) {
- try {
- fCommandResponseStream.write(response.getBytes());
- fCommandResponseStream.flush();
- } catch (IOException e) {
- }
- }
-
- void sendDebugEvent(String event, boolean error) {
- if (fDebug) {
- try {
- fEventStream.write(event.getBytes());
- fEventStream.write('\n');
- fEventStream.flush();
- } catch (IOException e) {
- System.err.println("Error: " + e);
- System.exit(1);
- }
- } else if (error) {
- System.err.println("Error: " + event);
- }
- }
-
- void startDebugger() throws IOException {
- if (fDebug) {
- System.out.println("-debug " + fCommandPort + " " + fEventPort);
- }
-
- ServerSocket commandServerSocket = new ServerSocket(fCommandPort);
- fCommandSocket = commandServerSocket.accept();
- fCommandReceiveStream = new BufferedReader(new InputStreamReader(fCommandSocket.getInputStream()));
- fCommandResponseStream = new PrintStream(fCommandSocket.getOutputStream());
- commandServerSocket.close();
-
- ServerSocket eventServerSocket = new ServerSocket(fEventPort);
- fEventSocket = eventServerSocket.accept();
- fEventStream = new PrintStream(fEventSocket.getOutputStream());
- eventServerSocket.close();
-
- System.out.println("debug connection accepted");
-
- fSuspendVM = "client";
- }
-
- void run() {
- int id = fNextThreadId++;
- sendDebugEvent("vmstarted", false);
- fThreads.put(new Integer(id), new PDAThread(id, "main", 0));
- if (fDebug) {
- sendDebugEvent("started " + id, false);
- }
-
- boolean allThreadsSuspended = false;
- while (!fThreads.isEmpty()) {
- checkForBreakpoint();
-
- if (fSuspendVM != null) {
- debugUI();
- } else {
- yieldToDebug(allThreadsSuspended);
- if (fSuspendVM != null) {
- // Received a command to suspend VM, skip executing threads.
- continue;
- }
- }
-
- PDAThread[] threadsCopy = (PDAThread[])fThreads.values().toArray(new PDAThread[fThreads.size()]);
- allThreadsSuspended = true;
- for (int i = 0; i < threadsCopy.length; i++) {
- PDAThread thread = threadsCopy[i];
- if (thread.fSuspend == null) {
- allThreadsSuspended = false;
-
- String instruction = thread.fThreadCode[thread.fCurrentFrame.fPC];
- thread.fCurrentFrame.fPC++;
- doOneInstruction(thread, instruction);
- if (thread.fCurrentFrame.fPC >= thread.fThreadCode.length) {
- // Thread reached end of code, exit from the thread.
- thread.fRun = false;
- } else if (thread.fStepReturn) {
- // If this thread is in a step-return operation, check
- // if we've returned from a call.
- instruction = thread.fThreadCode[thread.fCurrentFrame.fPC];
- if ("return".equals(instruction)) {
- // Note: this will only be triggered if the current
- // thread also has the fStepReturn flag set.
- if (fStepReturnVM) {
- fSuspendVM = thread.fID + " step";
- } else {
- thread.fSuspend = "step";
- }
- }
- }
- if (!thread.fRun) {
- sendDebugEvent("exited " + thread.fID, false);
- fThreads.remove(new Integer(thread.fID));
- } else if (thread.fSuspend != null) {
- sendDebugEvent("suspended " + thread.fID + " " + thread.fSuspend, false);
- thread.fStep = thread.fStepReturn = thread.fPerformingEval = false;
- }
- }
- }
-
- // Force thread context switch to avoid starving out other
- // processes in the system.
- Thread.yield();
- }
-
- sendDebugEvent("vmterminated", false);
- if (fDebug) {
- try {
- fCommandReceiveStream.close();
- fCommandResponseStream.close();
- fCommandSocket.close();
- fEventStream.close();
- fEventSocket.close();
- } catch (IOException e) {
- System.out.println("Error: " + e);
- }
- }
-
- }
-
- void doOneInstruction(PDAThread thread, String instr) {
- StringTokenizer tokenizer = new StringTokenizer(instr);
- String op = tokenizer.nextToken();
- List tokens = new LinkedList();
- while (tokenizer.hasMoreTokens()) {
- tokens.add(tokenizer.nextToken());
- }
- Args args = new Args( (String[])tokens.toArray(new String[tokens.size()]) );
-
- boolean opValid = true;
- if (op.equals("add")) iAdd(thread, args);
- else if (op.equals("branch_not_zero")) iBranchNotZero(thread, args);
- else if (op.equals("call")) iCall(thread, args);
- else if (op.equals("dec")) iDec(thread, args);
- else if (op.equals("def")) iDef(thread, args);
- else if (op.equals("dup")) iDup(thread, args);
- else if (op.equals("exec")) iExec(thread, args);
- else if (op.equals("halt")) iHalt(thread, args);
- else if (op.equals("output")) iOutput(thread, args);
- else if (op.equals("pop")) iPop(thread, args);
- else if (op.equals("push")) iPush(thread, args);
- else if (op.equals("return")) iReturn(thread, args);
- else if (op.equals("var")) iVar(thread, args);
- else if (op.equals("xyzzy")) iInternalEndEval(thread, args);
- else if (op.startsWith(":")) {} // label
- else if (op.startsWith("#")) {} // comment
- else {
- opValid = false;
- }
-
- if (!opValid) {
- sendDebugEvent("unimplemented instruction " + op, true);
- if ( ((Boolean)fEventStops.get("unimpinstr")).booleanValue() ) {
- fSuspendVM = thread.fID + " event unimpinstr";
- thread.fCurrentFrame.fPC--;
- }
- } else if (thread.fStep) {
- if (fStepVM) {
- fSuspendVM = thread.fID + " step";
- fStepVM = false;
- } else {
- thread.fSuspend = "step";
- }
- thread.fStep = false;
- }
- }
-
- void checkForBreakpoint() {
- if (fDebug) {
- for (Iterator itr = fThreads.values().iterator(); itr.hasNext();) {
- PDAThread thread = (PDAThread)itr.next();
- Integer pc = new Integer(thread.fCurrentFrame.fPC);
- // Suspend for breakpoint if:
- // - the VM is not yet set to suspend, for e.g. as a result of step end,
- // - the thread is not yet suspended and is not performing an evaluation
- // - the breakpoints table contains a breakpoint for the given line.
- if (fSuspendVM == null &&
- thread.fSuspend == null && !thread.fPerformingEval &&
- fBreakpoints.containsKey(pc))
- {
- if ( ((Boolean)fBreakpoints.get(pc)).booleanValue() ) {
- fSuspendVM = thread.fID + " breakpoint " + pc;
- } else {
- thread.fSuspend = "breakpoint " + pc;
- thread.fStep = thread.fStepReturn = false;
- sendDebugEvent("suspended " + thread.fID + " " + thread.fSuspend, false);
- }
- }
- }
- }
- }
-
- /**
- * After each instruction, we check the debug command channel for control input. If
- * there are commands, process them.
- */
- void yieldToDebug(boolean allThreadsSuspended) {
- if (fDebug) {
- String line = "";
- try {
- if (allThreadsSuspended || fCommandReceiveStream.ready()) {
- line = fCommandReceiveStream.readLine();
- processDebugCommand(line);
- }
- } catch (IOException e) {
- System.err.println("Error: " + e);
- System.exit(1);
- }
- }
- }
-
- /**
- * Service the debugger commands while the VM is suspended
- */
- void debugUI() {
- if (!fStarted) {
- sendDebugEvent("vmsuspended " + fSuspendVM, false);
- } else {
- fStarted = false;
- }
-
- // Clear all stepping flags. In case the VM suspended while
- // a step operation was being performed for the VM or some thread.
- fStepVM = fStepReturnVM = false;
- for (Iterator itr = fThreads.values().iterator(); itr.hasNext();) {
- PDAThread thread = (PDAThread)itr.next();
- thread.fSuspend = null;
- thread.fStep = thread.fStepReturn = thread.fPerformingEval = false;
- }
-
- while (fSuspendVM != null) {
- String line = "";
- try {
- line = fCommandReceiveStream.readLine();
- } catch (IOException e) {
- System.err.println("Error: " + e);
- System.exit(1);
- return;
- }
- processDebugCommand(line);
- }
-
- if (fStepVM || fStepReturnVM) {
- sendDebugEvent("vmresumed step", false);
- } else {
- sendDebugEvent("vmresumed client", false);
- }
- }
-
- void processDebugCommand(String line) {
- StringTokenizer tokenizer = new StringTokenizer(line.trim());
- if (line.length() == 0) {
- return;
- }
-
- String command = tokenizer.nextToken();
- List tokens = new LinkedList();
- while (tokenizer.hasMoreTokens()) {
- tokens.add(tokenizer.nextToken());
- }
- Args args = new Args( (String[])tokens.toArray(new String[tokens.size()]));
-
- if ("children".equals(command)) debugChildren(args);
- else if ("clear".equals(command)) debugClearBreakpoint(args);
- else if ("data".equals(command)) debugData(args);
- else if ("drop".equals(command)) debugDropFrame(args);
- else if ("eval".equals(command)) debugEval(args);
- else if ("eventstop".equals(command)) debugEventStop(args);
- else if ("frame".equals(command)) debugFrame(args);
- else if ("groups".equals(command)) debugGroups(args);
- else if ("popdata".equals(command)) debugPopData(args);
- else if ("pushdata".equals(command)) debugPushData(args);
- else if ("registers".equals(command)) debugRegisters(args);
- else if ("restart".equals(command)) debugRestart(args);
- else if ("resume".equals(command)) debugResume(args);
- else if ("set".equals(command)) debugSetBreakpoint(args);
- else if ("setdata".equals(command)) debugSetData(args);
- else if ("setvar".equals(command)) debugSetVariable(args);
- else if ("stack".equals(command)) debugStack(args);
- else if ("stackdepth".equals(command)) debugStackDepth(args);
- else if ("state".equals(command)) debugState(args);
- else if ("step".equals(command)) debugStep(args);
- else if ("stepreturn".equals(command)) debugStepReturn(args);
- else if ("suspend".equals(command)) debugSuspend(args);
- else if ("terminate".equals(command)) debugTerminate();
- else if ("threads".equals(command)) debugThreads();
- else if ("var".equals(command)) debugVar(args);
- else if ("vmresume".equals(command)) debugVMResume();
- else if ("vmsuspend".equals(command)) debugVMSuspend();
- else if ("watch".equals(command)) debugWatch(args);
- else {
- sendCommandResponse("error: invalid command\n");
- }
- }
-
- void debugChildren(Args args) {
- PDAThread thread = args.getThreadArg();
- if (thread == null) {
- sendCommandResponse("error: invalid thread\n");
- return;
- }
-
- int sfnumber = args.getNextIntArg();
- String var = args.getNextStringArg();
-
- Frame frame = sfnumber >= thread.fFrames.size()
- ? thread.fCurrentFrame : (Frame)thread.fFrames.get(sfnumber);
-
- String varDot = var + ".";
- List children = new ArrayList();
- for (Iterator itr = frame.fLocalVariables.keySet().iterator(); itr.hasNext();) {
- String localVar = (String)itr.next();
- if (localVar.startsWith(varDot) && localVar.indexOf('.', varDot.length() + 1) == -1) {
- children.add(localVar);
- }
- }
-
- StringBuffer result = new StringBuffer();
- for (Iterator itr = children.iterator(); itr.hasNext();) {
- result.append(itr.next());
- result.append('|');
- }
- result.append('\n');
-
- sendCommandResponse(result.toString());
- }
-
- void debugClearBreakpoint(Args args) {
- int line = args.getNextIntArg();
-
- fBreakpoints.remove( new Integer(line) );
- sendCommandResponse("ok\n");
- }
-
- private static Pattern fPackPattern = Pattern.compile("%([a-fA-F0-9][a-fA-F0-9])");
-
- void debugData(Args args) {
- PDAThread thread = args.getThreadArg();
- if (thread == null) {
- sendCommandResponse("error: invalid thread\n");
- return;
- }
-
- StringBuffer result = new StringBuffer();
- for (Iterator itr = thread.fStack.iterator(); itr.hasNext();) {
- result.append(itr.next());
- result.append('|');
- }
- result.append('\n');
- sendCommandResponse(result.toString());
- }
-
- void debugDropFrame(Args args) {
- PDAThread thread = args.getThreadArg();
- if (thread == null) {
- sendCommandResponse("error: invalid thread\n");
- return;
- }
-
- if (!thread.fFrames.isEmpty()) {
- thread.fCurrentFrame = (Frame)thread.fFrames.remove(thread.fFrames.size() - 1);
- }
- thread.fCurrentFrame.fPC--;
- sendCommandResponse("ok\n");
- if (fSuspendVM != null) {
- sendDebugEvent("vmresumed drop", false);
- sendDebugEvent("vmsuspended " + thread.fID + " drop", false);
- } else {
- sendDebugEvent("resumed " + thread.fID + " drop", false);
- sendDebugEvent("suspended " + thread.fID + " drop", false);
- }
- }
-
- void debugEval(Args args) {
- if (fSuspendVM != null) {
- sendCommandResponse("error: cannot evaluate while vm is suspended\n");
- return;
- }
-
- PDAThread thread = args.getThreadArg();
- if (thread == null) {
- sendCommandResponse("error: invalid thread\n");
- return;
- }
-
- if (thread.fSuspend == null) {
- sendCommandResponse("error: thread running\n");
- return;
- }
-
- StringTokenizer tokenizer = new StringTokenizer(args.getNextStringArg(), "|");
- tokenizer.countTokens();
-
- int numEvalLines = tokenizer.countTokens();
- thread.fThreadCode = new String[fCode.length + numEvalLines + 1];
- System.arraycopy(fCode, 0, thread.fThreadCode, 0, fCode.length);
- for (int i = 0; i < numEvalLines; i++) {
- String line = tokenizer.nextToken();
- StringBuffer lineBuf = new StringBuffer(line.length());
- Matcher matcher = fPackPattern.matcher(line);
- int lastMatchEnd = 0;
- while (matcher.find()) {
- lineBuf.append(line.substring(lastMatchEnd, matcher.start()));
- String charCode = line.substring(matcher.start() + 1, matcher.start() + 3);
- try {
- lineBuf.append((char) Integer.parseInt(charCode, 16));
- } catch (NumberFormatException e) {
- }
- lastMatchEnd = matcher.end();
- }
- if (lastMatchEnd < line.length()) {
- lineBuf.append(line.substring(lastMatchEnd));
- }
- thread.fThreadCode[fCode.length + i] = lineBuf.toString();
- }
- thread.fThreadCode[fCode.length + numEvalLines] = "xyzzy";
- thread.fThreadLabels = mapLabels(fCode);
-
- thread.fSavedPC = thread.fCurrentFrame.fPC;
- thread.fCurrentFrame.fPC = fCode.length;
- thread.fPerformingEval = true;
-
- thread.fSuspend = null;
-
- sendCommandResponse("ok\n");
-
- sendDebugEvent("resumed " + thread.fID + " eval", false);
- }
-
- void debugEventStop(Args args) {
- String event = args.getNextStringArg();
- int stop = args.getNextIntArg();
- fEventStops.put(event, new Boolean(stop > 0));
- sendCommandResponse("ok\n");
- }
-
- void debugTerminate() {
- sendCommandResponse("ok\n");
- sendDebugEvent("vmterminated", false);
- System.exit(0);
- }
-
- void debugFrame(Args args) {
- PDAThread thread = args.getThreadArg();
- if (thread == null) {
- sendCommandResponse("error: invalid thread\n");
- return;
- }
-
- int sfnumber = args.getNextIntArg();
- Frame frame = null;
- if (sfnumber >= thread.fFrames.size()) {
- frame = thread.fCurrentFrame;
- } else {
- frame = (Frame)thread.fFrames.get(sfnumber);
- }
- sendCommandResponse(printFrame(frame) + "\n");
- }
-
- void debugGroups(Args args) {
- TreeSet groups = new TreeSet();
- for (Iterator itr = fRegisters.values().iterator(); itr.hasNext();) {
- Register reg = (Register)itr.next();
- groups.add(reg.fGroup);
- }
- StringBuffer response = new StringBuffer();
- for (Iterator itr = groups.iterator(); itr.hasNext();) {
- response.append(itr.next());
- response.append('|');
- }
- response.append('\n');
- sendCommandResponse(response.toString());
- }
-
- void debugPopData(Args args) {
- PDAThread thread = args.getThreadArg();
- if (thread == null) {
- sendCommandResponse("error: invalid thread\n");
- return;
- }
-
- thread.fStack.pop();
- sendCommandResponse("ok\n");
- }
-
- void debugPushData(Args args) {
- PDAThread thread = args.getThreadArg();
- if (thread == null) {
- sendCommandResponse("error: invalid thread\n");
- return;
- }
-
- Object val = args.getNextIntOrStringArg();
- thread.fStack.push(val);
- sendCommandResponse("ok\n");
- }
-
- void debugRegisters(Args args) {
- String group = args.getNextStringArg();
-
- StringBuffer response = new StringBuffer();
- for (Iterator itr = fRegisters.values().iterator(); itr.hasNext();) {
- Register reg = (Register)itr.next();
- if (group.equals(reg.fGroup)) {
- response.append(reg.fName);
- response.append(' ');
- response.append(reg.fIsWriteable);
- for (Iterator itr2 = reg.fBitFields.values().iterator(); itr2.hasNext();) {
- BitField bitField = (BitField)itr2.next();
- response.append('|');
- response.append(bitField.fName);
- response.append(' ');
- response.append(bitField.fBitOffset);
- response.append(' ');
- response.append(bitField.fBitCount);
- response.append(' ');
- for (Iterator itr3 = bitField.fMnemonics.entrySet().iterator(); itr3.hasNext();) {
- Map.Entry mnemonicEntry = (Map.Entry)itr3.next();
- response.append(mnemonicEntry.getKey());
- response.append(' ');
- response.append(mnemonicEntry.getValue());
- response.append(' ');
- }
- }
-
- response.append('#');
- }
- }
- response.append('\n');
- sendCommandResponse(response.toString());
- }
-
- void debugRestart(Args args) {
- fSuspendVM = "restart";
-
- for (Iterator itr = fThreads.keySet().iterator(); itr.hasNext();) {
- Integer id = (Integer)itr.next();
- sendDebugEvent("exited " + id, false);
- }
- fThreads.clear();
-
- int id = fNextThreadId++;
- fThreads.put(new Integer(id), new PDAThread(id, "main", 0));
- sendDebugEvent("started " + id, false);
-
- fRegisters.clear();
-
- sendCommandResponse("ok\n");
- }
-
- void debugResume(Args args) {
- PDAThread thread = args.getThreadArg();
- if (thread == null) {
- sendCommandResponse("error: invalid thread\n");
- return;
- }
- if (fSuspendVM != null) {
- sendCommandResponse("error: cannot resume thread when vm is suspended\n");
- return;
- }
- if (thread.fSuspend == null) {
- sendCommandResponse("error: thread already running\n");
- return;
- }
-
- thread.fSuspend = null;
- sendDebugEvent("resumed " + thread.fID + " client", false);
-
- sendCommandResponse("ok\n");
- }
-
- void debugSetBreakpoint(Args args) {
- int line = args.getNextIntArg();
- int stopVM = args.getNextIntArg();
-
- fBreakpoints.put(new Integer(line), new Boolean(stopVM != 0));
- sendCommandResponse("ok\n");
- }
-
- void debugSetData(Args args) {
- PDAThread thread = args.getThreadArg();
- if (thread == null) {
- sendCommandResponse("error: invalid thread\n");
- return;
- }
-
- int offset = args.getNextIntArg();
- Object val = args.getNextIntOrStringArg();
-
- if (offset < thread.fStack.size()) {
- thread.fStack.set(offset, val);
- } else {
- thread.fStack.add(0, val);
- }
- sendCommandResponse("ok\n");
- }
-
- void debugSetVariable(Args args) {
- PDAThread thread = args.getThreadArg();
- if (thread == null) {
- sendCommandResponse("error: invalid thread\n");
- return;
- }
-
- int sfnumber = args.getNextIntArg();
- String var = args.getNextStringArg();
- Object val = args.getNextIntOrStringArg();
- while (args.hasNextArg()) {
- val = val.toString() + " " + args.getNextStringArg();
- }
-
- if (sfnumber >= thread.fFrames.size()) {
- thread.fCurrentFrame.set(var, val);
- } else {
- ((Frame)thread.fFrames.get(sfnumber)).set(var, val);
- }
- sendCommandResponse("ok\n");
- }
-
- void debugStack(Args args) {
- PDAThread thread = args.getThreadArg();
- if (thread == null) {
- sendCommandResponse("error: invalid thread\n");
- return;
- }
-
- StringBuffer result = new StringBuffer();
-
- for (Iterator itr = thread.fFrames.iterator(); itr.hasNext();) {
- Frame frame = (Frame)itr.next();
- result.append(printFrame(frame));
- result.append('#');
- }
- result.append(printFrame(thread.fCurrentFrame));
- result.append('\n');
- sendCommandResponse(result.toString());
- }
-
- void debugStackDepth(Args args) {
- PDAThread thread = args.getThreadArg();
- if (thread == null) {
- sendCommandResponse("error: invalid thread\n");
- return;
- }
- sendCommandResponse( Integer.toString(thread.fFrames.size() + 1) + "\n" );
- }
-
-
- /**
- * The stack frame output is: frame # frame # frame ... where each frame is:
- * filename | line number | function name | var | var | var | var ...
- */
- private String printFrame(Frame frame) {
- StringBuffer buf = new StringBuffer();
- buf.append(fFilename);
- buf.append('|');
- buf.append(frame.fPC);
- buf.append('|');
- buf.append(frame.fFunction);
- for (Iterator itr = frame.fLocalVariables.keySet().iterator(); itr.hasNext();) {
- String var = (String)itr.next();
- if (var.indexOf('.') == -1) {
- buf.append('|');
- buf.append(var);
- }
- }
- return buf.toString();
- }
-
- void debugState(Args args) {
- PDAThread thread = args.getThreadArg();
- String response = null;
- if (thread == null) {
- response = fSuspendVM == null ? "running" : fSuspendVM;
- } else if (fSuspendVM != null) {
- response = "vm";
- } else {
- response = thread.fSuspend == null ? "running" : thread.fSuspend;
- }
- sendCommandResponse(response + "\n");
- }
-
- void debugStep(Args args) {
- PDAThread thread = args.getThreadArg();
- if (thread == null) {
- sendCommandResponse("error: invalid thread\n");
- return;
- }
-
- // Set suspend to null to allow the debug loop to exit back to the
- // instruction loop and thus run an instruction. However, we want to
- // come back to the debug loop right away, so the step flag is set to
- // true which will cause the suspend flag to get set to true when we
- // get to the next instruction.
- if (fSuspendVM != null) {
- // All threads are suspended, so suspend all threads again when
- // step completes.
- fSuspendVM = null;
- fStepVM = true;
- // Also mark the thread that initiated the step to mark it as
- // the triggering thread when suspending.
- thread.fStep = true;
- } else {
- if (thread.fSuspend == null) {
- sendCommandResponse("error: thread already running\n");
- return;
- }
- thread.fSuspend = null;
- thread.fStep = true;
- sendDebugEvent("resumed " + thread.fID + " step", false);
- }
- sendCommandResponse("ok\n");
- }
-
- void debugStepReturn(Args args) {
- PDAThread thread = args.getThreadArg();
- if (thread == null) {
- sendCommandResponse("error: invalid thread\n");
- return;
- }
-
- if (fSuspendVM != null) {
- fSuspendVM = null;
- fStepReturnVM = true;
- thread.fStepReturn = true;
- } else {
- if (thread.fSuspend == null) {
- sendCommandResponse("error: thread running\n");
- return;
- }
- thread.fSuspend = null;
- thread.fStepReturn = true;
- sendDebugEvent("resumed " + thread.fID + " step", false);
- }
- sendCommandResponse("ok\n");
- }
-
- void debugSuspend(Args args) {
- PDAThread thread = args.getThreadArg();
- if (thread == null) {
- sendCommandResponse("error: invalid thread\n");
- return;
- }
- if (fSuspendVM != null) {
- sendCommandResponse("error: vm already suspended\n");
- return;
- }
- if (thread.fSuspend != null) {
- sendCommandResponse("error: thread already suspended\n");
- return;
- }
-
- thread.fSuspend = "client";
- sendDebugEvent("suspended " + thread.fID + " client", false);
- sendCommandResponse("ok\n");
- }
-
- void debugThreads() {
- StringBuffer response = new StringBuffer();
- for (Iterator itr = fThreads.keySet().iterator(); itr.hasNext();) {
- response.append(itr.next());
- response.append(' ');
- }
- sendCommandResponse(response.toString().trim() + "\n");
- }
-
- void debugVar(Args args) {
- PDAThread thread = args.getThreadArg();
- if (thread == null) {
- sendCommandResponse("error: invalid thread\n");
- return;
- }
-
- int sfnumber = args.getNextIntArg();
- String var = args.getNextStringArg();
-
- Frame frame = sfnumber >= thread.fFrames.size()
- ? thread.fCurrentFrame : (Frame)thread.fFrames.get(sfnumber);
-
- Object val = frame.get(var);
- if (val == null) {
- sendCommandResponse("error: variable undefined\n");
- } else {
- sendCommandResponse(val.toString() + "\n");
- }
- }
-
- void debugVMResume() {
- if (fSuspendVM == null) {
- sendCommandResponse("error: vm already running\n");
- return;
- }
-
- fSuspendVM = null;
- sendCommandResponse("ok\n");
- }
-
- void debugVMSuspend() {
- if (fSuspendVM != null) {
- sendCommandResponse("error: vm already suspended\n");
- return;
- }
-
- fSuspendVM = "client";
- sendCommandResponse("ok\n");
- }
-
- void debugWatch(Args args) {
- String funcAndVar = args.getNextStringArg();
- int flags = args.getNextIntArg();
- fWatchpoints.put(funcAndVar, new Integer(flags));
- sendCommandResponse("ok\n");
- }
-
- void iAdd(PDAThread thread, Args args) {
- Object val1 = thread.fStack.pop();
- Object val2 = thread.fStack.pop();
- if (val1 instanceof Integer && val2 instanceof Integer) {
- int intVal1 = ((Integer) val1).intValue();
- int intVal2 = ((Integer) val2).intValue();
- thread.fStack.push( new Integer(intVal1 + intVal2) );
- } else {
- thread.fStack.push( new Integer(-1) );
- }
- }
-
- void iBranchNotZero(PDAThread thread, Args args) {
- Object val = thread.fStack.pop();
- if (val instanceof Integer && ((Integer) val).intValue() != 0) {
- String label = args.getNextStringArg();
- if (thread.fThreadLabels.containsKey(label)) {
- thread.fCurrentFrame.fPC = ((Integer)thread.fThreadLabels.get(label)).intValue();
- } else {
- sendDebugEvent("no such label " + label, true);
- if ( ((Boolean)fEventStops.get("nosuchlabel")).booleanValue() ) {
- fSuspendVM = thread.fID + " event nosuchlabel";
- thread.fStack.push(val);
- thread.fCurrentFrame.fPC--;
- }
- }
- }
- }
-
- void iCall(PDAThread thread, Args args) {
- String label = args.getNextStringArg();
- if (thread.fThreadLabels.containsKey(label)) {
- thread.fFrames.add(thread.fCurrentFrame);
- thread.fCurrentFrame = new Frame(label, ((Integer)thread.fThreadLabels.get(label)).intValue());
- } else {
- sendDebugEvent("no such label " + label, true);
- if ( ((Boolean)fEventStops.get("nosuchlabel")).booleanValue() ) {
- fSuspendVM = thread.fID + " event nosuchlabel";
- thread.fCurrentFrame.fPC--;
- }
- }
- }
-
- void iDec(PDAThread thread, Args args) {
- Object val = thread.fStack.pop();
- if (val instanceof Integer) {
- val = new Integer(((Integer) val).intValue() - 1);
- }
- thread.fStack.push(val);
- }
-
- void iDef(PDAThread thread, Args args) {
- String type = args.getNextStringArg();
-
- String name = args.getNextStringArg();
- String regName = getRegisterPartOfName(name);
- String bitFieldName = getBitFieldPartOfName(name);
-
- if ("register".equals(type)) {
- Register reg = new Register(regName);
- reg.fGroup = args.getNextStringArg();
- fRegisters.put(regName, reg);
- reg.fIsWriteable = args.getNextBooleanArg();
- } else if ("bitfield".equals(type)) {
- Register reg = (Register)fRegisters.get(regName);
- if (reg == null) return;
- BitField bitField = new BitField(bitFieldName);
- bitField.fBitOffset = args.getNextIntArg();
- bitField.fBitCount = args.getNextIntArg();
- reg.fBitFields.put(bitFieldName, bitField);
- } else if ("mnemonic".equals(type)) {
- Register reg = (Register)fRegisters.get(regName);
- if (reg == null) return;
- BitField bitField = (BitField)reg.fBitFields.get(bitFieldName);
- if (bitField == null) return;
- bitField.fMnemonics.put(args.getNextStringArg(), new Integer(args.getNextIntArg()));
- }
- sendDebugEvent("registers", false);
- }
-
- private String getRegisterPartOfName(String name) {
- if (name.startsWith("$")) {
- int end = name.indexOf('.');
- end = end != -1 ? end : name.length();
- return name.substring(1, end);
- }
- return null;
- }
-
- private String getBitFieldPartOfName(String name) {
- int start = name.indexOf('.');
- if (name.startsWith("$") && start != -1) {
- return name.substring(start + 1, name.length());
- }
- return null;
- }
-
- void iDup(PDAThread thread, Args args) {
- Object val = thread.fStack.pop();
- thread.fStack.push(val);
- thread.fStack.push(val);
- }
-
- void iExec(PDAThread thread, Args args) {
- String label = args.getNextStringArg();
- if (fLabels.containsKey(label)) {
- int id = fNextThreadId++;
- fThreads.put( new Integer(id), new PDAThread(id, label, ((Integer)fLabels.get(label)).intValue()) );
- sendDebugEvent("started " + id, false);
- } else {
- sendDebugEvent("no such label " + label, true);
- if ( ((Boolean)fEventStops.get("nosuchlabel")).booleanValue() ) {
- thread.fSuspend = "event nosuchlabel";
- thread.fCurrentFrame.fPC--;
- }
- }
- }
-
- void iHalt(PDAThread thread, Args args) {
- thread.fRun = false;
- }
-
- void iOutput(PDAThread thread, Args args) {
- System.out.println(thread.fStack.pop());
- }
-
- void iPop(PDAThread thread, Args args) {
- String arg = args.getNextStringArg();
- if (arg.startsWith("$")) {
- String var = arg.substring(1);
- thread.fCurrentFrame.set(var, thread.fStack.pop());
- String key = thread.fCurrentFrame.fFunction + "::" + var;
- if ( fWatchpoints.containsKey(key) && (((Integer)fWatchpoints.get(key)).intValue() & 2) != 0 ) {
- fSuspendVM = thread.fID + " watch write " + key;
- }
- } else {
- thread.fStack.pop();
- }
- }
-
- void iPush(PDAThread thread, Args args) {
- String arg = args.getNextStringArg();
- while (arg.length() != 0) {
- if (arg.startsWith("$")) {
- String var = arg.substring(1);
- Object val = thread.fCurrentFrame.get(var);
- if (val == null) val = "<undefined>";
- thread.fStack.push(val);
- String key = thread.fCurrentFrame.fFunction + "::" + var;
- if (fWatchpoints.containsKey(key) && (((Integer)fWatchpoints.get(key)).intValue() & 1) != 0) {
- fSuspendVM = thread.fID + " watch read " + key;
- }
- } else {
- Object val = arg;
- if (args.hasNextArg()) {
- while (args.hasNextArg()) {
- val = val.toString() + " " + args.getNextStringArg();
- }
- } else {
- try {
- val = new Integer(arg);
- } catch (NumberFormatException e) {
- }
- }
- thread.fStack.push(val);
- }
-
- arg = args.getNextStringArg();
- }
- }
-
- void iReturn(PDAThread thread, Args args) {
- if (!thread.fFrames.isEmpty()) {
- thread.fCurrentFrame = (Frame)thread.fFrames.remove(thread.fFrames.size() - 1);
- } else {
- // Execution returned from the top frame, which means this thread
- // should exit.
- thread.fRun = false;
- }
- }
-
- void iVar(PDAThread thread, Args args) {
- String var = args.getNextStringArg();
- thread.fCurrentFrame.set(var, new Integer(0));
- }
-
- void iInternalEndEval(PDAThread thread, Args args) {
- Object result = thread.fStack.pop();
- thread.fThreadCode = fCode;
- thread.fThreadLabels = fLabels;
- thread.fCurrentFrame.fPC = thread.fSavedPC;
- sendDebugEvent("evalresult " + result, false);
- thread.fSuspend = "eval";
- thread.fPerformingEval = false;
- }
-
-}
diff --git a/org.eclipse.debug.examples.core/pdavm/tests/vmtest10.pda b/org.eclipse.debug.examples.core/pdavm/tests/vmtest10.pda
deleted file mode 100644
index 837277f5f..000000000
--- a/org.eclipse.debug.examples.core/pdavm/tests/vmtest10.pda
+++ /dev/null
@@ -1,38 +0,0 @@
-def register $reg1 group1 true
-def register $reg2 group1 false
-def register $reg3 group2 true
-def bitfield $reg1.field1 0 2
-def bitfield $reg1.field2 2 2
-def mnemonic $reg1.field2 zero 0
-def mnemonic $reg1.field2 one 1
-def mnemonic $reg1.field2 two 2
-def mnemonic $reg1.field2 three 3
-push 1
-pop $$reg1
-push $$reg1
-output
-push 2
-pop $$reg1.field1
-push $$reg1.field1
-output
-push 4
-pop $$reg1.field1
-push $$reg1.field1
-output
-push 1
-pop $$reg1.field2
-push $$reg1
-output
-push zero
-pop $$reg1.field2
-push $$reg1.field2
-output
-push $$reg1
-output
-push 2
-pop $$reg1.field2
-push $$reg1.field2
-output
-push $$reg1
-output
-halt \ No newline at end of file
diff --git a/org.eclipse.debug.examples.core/pdavm/tests/vmtest2.pda b/org.eclipse.debug.examples.core/pdavm/tests/vmtest2.pda
deleted file mode 100644
index 95a35f04f..000000000
--- a/org.eclipse.debug.examples.core/pdavm/tests/vmtest2.pda
+++ /dev/null
@@ -1,48 +0,0 @@
-push 6
-push 7
-push 8
-push 9
-push 10
-call sub1
-output
-call sub3
-call sub5
-push 3
-halt
-:sub2
-push 27
-return
-:sub1
-var m
-var n
-call sub2
-pop $n
-pop $m
-push $n
-push $m
-return
-# zero-based line 23
-:sub3
-push 1
-call sub4
-push 2
-call sub4
-push 3
-return
-:sub4
-push 4
-return
-# zero-based line 34
-:sub5
-var a
-var b
-var c
-pop $c
-pop $b
-call sub6
-push $a
-return
-:sub6
-var b
-pop $b
-return
diff --git a/org.eclipse.debug.examples.core/pdavm/tests/vmtest3.pda b/org.eclipse.debug.examples.core/pdavm/tests/vmtest3.pda
deleted file mode 100644
index 5aecdc5e6..000000000
--- a/org.eclipse.debug.examples.core/pdavm/tests/vmtest3.pda
+++ /dev/null
@@ -1,13 +0,0 @@
-push 1
-push 2
-push 3
-foobar swish
-push 4
-add
-add
-call zippy
-add
-output
-push 1
-branch_not_zero swishy
-halt
diff --git a/org.eclipse.debug.examples.core/pdavm/tests/vmtest6.pda b/org.eclipse.debug.examples.core/pdavm/tests/vmtest6.pda
deleted file mode 100644
index d90a960cf..000000000
--- a/org.eclipse.debug.examples.core/pdavm/tests/vmtest6.pda
+++ /dev/null
@@ -1,31 +0,0 @@
-var a
-var b
-push 1
-pop $a
-push 2
-pop $b
-push 3
-push 4
-#
-call inner
-#
-push $a
-push 2
-add
-pop $b
-output
-#
-halt
-#
-:inner
-var a
-var c
-pop $a
-pop $c
-push $a
-push $a
-add
-return
-:other
-push 15
-return \ No newline at end of file
diff --git a/org.eclipse.debug.examples.core/pdavm/tests/vmtest8.pda b/org.eclipse.debug.examples.core/pdavm/tests/vmtest8.pda
deleted file mode 100644
index 7729409c2..000000000
--- a/org.eclipse.debug.examples.core/pdavm/tests/vmtest8.pda
+++ /dev/null
@@ -1,14 +0,0 @@
-var a
-call inner
-push 1
-output
-halt
-:inner
-var b
-call inner2
-push 2
-return
-:inner2
-var c
-push 3
-return
diff --git a/org.eclipse.debug.examples.core/pdavm/tests/vmtest9.pda b/org.eclipse.debug.examples.core/pdavm/tests/vmtest9.pda
deleted file mode 100644
index 336a251d9..000000000
--- a/org.eclipse.debug.examples.core/pdavm/tests/vmtest9.pda
+++ /dev/null
@@ -1,23 +0,0 @@
-push 5
-:thread_create
-exec foo
-dec
-dup
-branch_not_zero thread_create
-push finished
-output
-halt
-:foo
-push thread_created
-output
-call inner
-halt
-:inner
-var b
-call inner2
-push 2
-return
-:inner2
-var c
-push 3
-return
diff --git a/org.eclipse.debug.examples.core/pdavm/tests/vmtest_children.pda b/org.eclipse.debug.examples.core/pdavm/tests/vmtest_children.pda
deleted file mode 100644
index b0bbd163d..000000000
--- a/org.eclipse.debug.examples.core/pdavm/tests/vmtest_children.pda
+++ /dev/null
@@ -1,8 +0,0 @@
-var a
-var a.b
-var a.c
-push 1
-pop $a.b
-push $a.b
-output
-halt
diff --git a/org.eclipse.debug.examples.core/plugin.xml b/org.eclipse.debug.examples.core/plugin.xml
deleted file mode 100644
index dadb0fe8f..000000000
--- a/org.eclipse.debug.examples.core/plugin.xml
+++ /dev/null
@@ -1,103 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<?eclipse version="3.0"?> <!--
- Copyright (c) 2005, 2008 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
- -->
-
-<plugin>
- <extension
- point="org.eclipse.core.variables.valueVariables">
- <variable
- description="Path to Perl executable in the local file system"
- name="perlExecutable"
- initialValue="c:\perl\bin\perl.exe"/>
- </extension>
-<!--#ifdef ex1-->
-<!--#else-->
- <extension
- point="org.eclipse.debug.core.launchConfigurationTypes">
- <launchConfigurationType
- sourceLocatorId="pda.sourceLocator"
- delegate="org.eclipse.debug.examples.core.pda.launcher.PDALaunchDelegate"
- sourcePathComputerId="pda.sourcePathComputer"
- name="PDA Application"
- id="pda.launchType"
- modes="run, debug"/>
- </extension>
-<!--#endif-->
-
- <extension
- point="org.eclipse.debug.core.launchConfigurationTypes">
- <launchConfigurationType
- delegate="org.eclipse.debug.examples.core.midi.launcher.MidiLaunchDelegate"
- name="MIDI Sequence"
- id="midi.launchType"
- modes="run, debug"/>
- </extension>
-
-<!--#ifdef ex4-->
-<!--#else-->
- <extension
- point="org.eclipse.debug.core.sourceLocators">
- <sourceLocator
- class="org.eclipse.debug.examples.core.pda.sourcelookup.PDASourceLookupDirector"
- name="PDA Source Locator"
- id="pda.sourceLocator"/>
- </extension>
- <extension
- point="org.eclipse.debug.core.sourcePathComputers">
- <sourcePathComputer
- class="org.eclipse.debug.examples.core.pda.sourcelookup.PDASourcePathComputerDelegate"
- id="pda.sourcePathComputer"/>
- </extension>
-<!--#endif-->
-
-<!--#ifdef ex3-->
-<!--#else-->
- <extension
- point="org.eclipse.debug.core.breakpoints">
- <breakpoint
- class="org.eclipse.debug.examples.core.pda.breakpoints.PDALineBreakpoint"
- name="PDA Line Breakpoints"
- markerType="org.eclipse.debug.examples.core.pda.markerType.lineBreakpoint"
- id="pda.lineBreakpoint"/>
- <breakpoint
- class="org.eclipse.debug.examples.core.pda.breakpoints.PDAWatchpoint"
- name="PDA Watchpoints"
- markerType="org.eclipse.debug.examples.core.pda.markerType.watchpoint"
- id="pda.watchpoint"/>
- </extension>
- <extension
- id="pda.markerType.lineBreakpoint"
- name="PDA Line Breakpoint Marker"
- point="org.eclipse.core.resources.markers">
- <super type="org.eclipse.debug.core.lineBreakpointMarker"/>
- <persistent value="true"/>
- </extension>
- <extension
- id="pda.markerType.watchpoint"
- name="PDA Watchpoint Marker"
- point="org.eclipse.core.resources.markers">
- <super type="org.eclipse.debug.examples.core.pda.markerType.lineBreakpoint"/>
- <persistent value="true"/>
- </extension>
-<!--#endif-->
-
-<!--#ifdef ex6-->
-<!--#else-->
- <extension
- point="org.eclipse.debug.core.logicalStructureTypes">
- <logicalStructureType
- class="org.eclipse.debug.examples.core.pda.model.WordStructureDelegate"
- description="Words"
- id="pda.wordStructure"
- modelIdentifier="pda.debugModel"/>
- </extension>
-<!--#endif-->
-</plugin>
diff --git a/org.eclipse.debug.examples.core/readme.html b/org.eclipse.debug.examples.core/readme.html
deleted file mode 100644
index 2a7cb9df3..000000000
--- a/org.eclipse.debug.examples.core/readme.html
+++ /dev/null
@@ -1,11 +0,0 @@
-<h1>Debug Examples ReadMe Notes</h1>
-<h2>PDA Debugger Example</h2>
-<p>In order to actually run the PDA debugger example, you will need a Perl interpreter.
- Linux&reg;&#8482; comes with Perl. For Microsoft&reg; Windows&reg;, we use either
- ActivePerl (<a href="http://www.activeperl.com/">http://www.activeperl.com/</a>) or Indigo Perl
- (<a href="http://www.indigostar.com/">http://www.indigostar.com/</a>). You also
- have to set the string substitution variable named &#8220;perlExecutable&#8221;
- to the complete path to your Perl interpreter. (For example, ours was C:\perl\bin\perl.exe)
- To set a string substitution variable, use the Windows &gt; Preferences &gt;
- Run/Debug &gt; String Substitution preferences page.<br>
-</p>
diff --git a/org.eclipse.debug.examples.core/samples/counter.pda b/org.eclipse.debug.examples.core/samples/counter.pda
deleted file mode 100644
index 9b2b73100..000000000
--- a/org.eclipse.debug.examples.core/samples/counter.pda
+++ /dev/null
@@ -1,11 +0,0 @@
-push 0
-:main
-var n
-pop $n
-push $n
-push 1
-add
-dup
-push $n
-output
-branch_not_zero main \ No newline at end of file
diff --git a/org.eclipse.debug.examples.core/samples/drop.pda b/org.eclipse.debug.examples.core/samples/drop.pda
deleted file mode 100644
index 84f60fee0..000000000
--- a/org.eclipse.debug.examples.core/samples/drop.pda
+++ /dev/null
@@ -1,12 +0,0 @@
-call one
-:one
-call two
-:two
-call three
-:three
-call four
-:four
-push DONE
-output
-
-
diff --git a/org.eclipse.debug.examples.core/samples/example.pda b/org.eclipse.debug.examples.core/samples/example.pda
deleted file mode 100644
index a95886358..000000000
--- a/org.eclipse.debug.examples.core/samples/example.pda
+++ /dev/null
@@ -1,35 +0,0 @@
-push "hello"
-output
-call foobar
-push 3
-:label
-dup
-push 4
-push 5
-add
-add
-output
-dec
-dup
-branch_not_zero label
-call foobar
-push "end"
-output
-halt
-:foobar
-var a
-var b
-call barfoo
-push "first"
-push "second"
-pop $a
-pop $b
-push $a
-push $b
-output
-output
-return
-:barfoo
-push "barfoo"
-output
-return
diff --git a/org.eclipse.debug.examples.core/samples/fibonacci.pda b/org.eclipse.debug.examples.core/samples/fibonacci.pda
deleted file mode 100644
index e39595a98..000000000
--- a/org.eclipse.debug.examples.core/samples/fibonacci.pda
+++ /dev/null
@@ -1,32 +0,0 @@
-push 6
-call fibonacci
-output
-halt
-#
-# f(n) = f(n-1) + f(n-2)
-# f(0) = 1
-# f(1) = 1
-#
-:fibonacci
-var n
-pop $n
-push $n
-branch_not_zero gt0
-push 1
-return
-:gt0
-push $n
-dec
-branch_not_zero gt1
-push 1
-return
-:gt1
-push $n
-dec
-call fibonacci
-push $n
-dec
-dec
-call fibonacci
-add
-return
diff --git a/org.eclipse.debug.examples.core/samples/registers.pda b/org.eclipse.debug.examples.core/samples/registers.pda
deleted file mode 100644
index 97fd8d409..000000000
--- a/org.eclipse.debug.examples.core/samples/registers.pda
+++ /dev/null
@@ -1,72 +0,0 @@
-def register $pc General true
-def register $sp General true
-def register $status General true
-def bitfield $status.BITS_00_07 0 8
-def bitfield $status.BITS_08_15 8 8
-def bitfield $status.BITS_16_23 16 8
-def bitfield $status.BITS_24_31 24 8
-def mnemonic $status.BITS_24_31 three 3
-def mnemonic $status.BITS_24_31 twelve 12
-def mnemonic $status.BITS_24_31 fourty_eight 48
-def mnemonic $status.BITS_24_31 one_nighty_two 192
-def register $stackdepth General true
-def register $stack[0] General true
-def register $stack[1] General true
-def register $stack[2] General true
-def register $stack[3] General true
-def register $stack[4] General true
-push 103
-pop $$pc
-push 306
-push 2
-pop $$sp
-push 400
-pop $$status
-push 5
-pop $$stackdepth
-push 12
-pop $$stack[0]
-push 45
-pop $$stack[1]
-push 146
-pop $$stack[2]
-push 215
-pop $$stack[3]
-push 251
-pop $$stack[4]
-push 306
-pop $$stack[5]
-def register $total-instructions Analysis false
-def register $add-instructions Analysis false
-def register $call-instructions Analysis false
-def register $dec-instructions Analysis false
-def register $dup-instructions Analysis false
-def register $halt-instructions Analysis false
-def register $output-instructions Analysis false
-def register $pop-instructions Analysis false
-def register $push-instructions Analysis false
-def register $return-instructions Analysis false
-def register $var-instructions Analysis false
-push 1046
-pop $$total-instructions
-push 12
-pop $$add-instructions
-push 24
-pop $$call-instructions
-push 36
-pop $$dec-instructions
-push 50
-pop $$dup-instructions
-push 62
-pop $$halt-instructions
-push 74
-pop $$output-instructions
-push 106
-pop $$pop-instructions
-push 120
-pop $$push-instructions
-push 132
-pop $$return-instructions
-push 144
-pop $$var-instructions
-halt \ No newline at end of file
diff --git a/org.eclipse.debug.examples.core/samples/stack.pda b/org.eclipse.debug.examples.core/samples/stack.pda
deleted file mode 100644
index c7fa1628b..000000000
--- a/org.eclipse.debug.examples.core/samples/stack.pda
+++ /dev/null
@@ -1,21 +0,0 @@
-push 5
-:thread_create
-exec stack
-dec
-dup
-branch_not_zero thread_create
-push finished
-output
-halt
-:stack
-push 100
-:inner
-dup
-output
-dup
-branch_not_zero descend
-return
-:descend
-dec
-call inner
-return \ No newline at end of file
diff --git a/org.eclipse.debug.examples.core/samples/structures.pda b/org.eclipse.debug.examples.core/samples/structures.pda
deleted file mode 100644
index 4cc881728..000000000
--- a/org.eclipse.debug.examples.core/samples/structures.pda
+++ /dev/null
@@ -1,29 +0,0 @@
-push a
-push b
-push c
-push x
-push y
-push z
-push one two three
-push 1 2 3
-push I II III
-var x
-var x.a
-var x.b
-var y
-var y.c
-var y.d
-var y.d.1
-var y.d.2
-var y.d.3
-pop $x
-pop $x.a
-pop $x.b
-pop $y
-pop $y.c
-pop $y.d
-pop $y.d.1
-pop $y.d.2
-pop $y.d.3
-push Done
-output \ No newline at end of file
diff --git a/org.eclipse.debug.examples.core/scripts/build.xml b/org.eclipse.debug.examples.core/scripts/build.xml
deleted file mode 100644
index df434e655..000000000
--- a/org.eclipse.debug.examples.core/scripts/build.xml
+++ /dev/null
@@ -1,66 +0,0 @@
-<?xml version="1.0"?>
-<!-- ======================================================================
- Copyright (c) 2005, 2008 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
-
- EclipseCon
- Debug Tutorial Exercises
- ====================================================================== -->
-<project name="EclipseCon" default="generateAll">
- <description>
- Debug Tutorial Exercises
- </description>
-
- <taskdef name="preprocess" classname="org.eclipse.debug.examples.ant.tasks.PreProcessor" classpath="../bin" />
- <property name="destBase" location="c:\temp\example" />
- <property name="workspace" location="c:\eclipse-dev\dev-3.4" />
- <property name="coreSource" location="${workspace}\org.eclipse.debug.examples.core" />
- <property name="uiSource" location="${workspace}\org.eclipse.debug.examples.ui" />
-
- <!-- =================================
- target: generateAll
- ================================= -->
- <target name="generateAll" description="--> Debug Tutorial Exercises">
-
- <!-- = = = = = = = = = = = = = = = = =
- macrodef: process
- = = = = = = = = = = = = = = = = = -->
- <macrodef name="process">
- <attribute name="destdir"/>
- <attribute name="symbols"/>
- <sequential>
- <delete dir="@{destdir}"/>
- <mkdir dir="@{destdir}\org.eclipse.debug.examples.core"/>
- <mkdir dir="@{destdir}\org.eclipse.debug.examples.ui"/>
- <preprocess destdir="@{destdir}\org.eclipse.debug.examples.core" symbols="@{symbols}">
- <fileset dir="${coreSource}">
- <exclude name="**/*.class"/>
- <exclude name="**/PreProcessor.java"/>
- </fileset>
- </preprocess>
- <preprocess destdir="@{destdir}\org.eclipse.debug.examples.ui" symbols="@{symbols}">
- <fileset dir="${uiSource}">
- <exclude name="**/*.class"/>
- </fileset>
- </preprocess>
- </sequential>
- </macrodef>
-
- <process destdir="${destBase}\exercise1.1" symbols="ex1"/>
- <process destdir="${destBase}\exercise2.1" symbols="ex2"/>
- <process destdir="${destBase}\exercise3.1" symbols="ex3"/>
- <process destdir="${destBase}\exercise4.1" symbols="ex4"/>
- <process destdir="${destBase}\exercise5.1" symbols="ex5"/>
- <process destdir="${destBase}\exercise6.1" symbols="ex6"/>
- <process destdir="${destBase}\exercise7.1" symbols="ex7"/>
- <process destdir="${destBase}\answer" symbols="answer"/>
- </target>
-
-</project>
-
diff --git a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/midi/launcher/ClockControl.java b/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/midi/launcher/ClockControl.java
deleted file mode 100644
index 639f1acf5..000000000
--- a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/midi/launcher/ClockControl.java
+++ /dev/null
@@ -1,93 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 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
- *******************************************************************************/
-package org.eclipse.debug.examples.core.midi.launcher;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.debug.core.DebugEvent;
-import org.eclipse.debug.examples.core.pda.DebugCorePlugin;
-
-/**
- * Controls the location of the sequencer in microseconds.
- *
- * @since 1.0
- */
-public class ClockControl extends TimeControl {
-
- /**
- * @param launch
- */
- public ClockControl(MidiLaunch launch) {
- super("Time" , launch);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.examples.core.midi.launcher.TimeControl#getTimeValue()
- */
- protected long getTimeValue() {
- return getSequencer().getMicrosecondPosition();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.examples.core.midi.launcher.SequencerControl#isEditable()
- */
- public boolean isEditable() {
- return true;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.examples.core.midi.launcher.SequencerControl#setValue(java.lang.String)
- */
- public IStatus setValue(String newValue) {
- try {
- long value = getLong(newValue);
- getSequencer().setMicrosecondPosition(value);
- fireEvent(new DebugEvent(this, DebugEvent.CHANGE));
- return Status.OK_STATUS;
- } catch (CoreException e) {
- return e.getStatus();
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.examples.core.midi.launcher.SequencerControl#validateValue(java.lang.String)
- */
- public IStatus validateValue(String value) {
- try {
- getLong(value);
- return Status.OK_STATUS;
- } catch (CoreException e) {
- return e.getStatus();
- }
- }
-
- /**
- * Returns a float for the string.
- *
- * @param value string
- * @return float
- * @throws CoreException if not a valid value
- */
- protected long getLong(String value) throws CoreException {
- try {
- if (value.indexOf(':') == -1) {
- long secs = Long.parseLong(value);
- return secs * 1000000;
- }
- } catch (NumberFormatException e) {
- throw new CoreException(new Status(IStatus.ERROR, DebugCorePlugin.PLUGIN_ID, "Time must be an integer (seconds) or 00:00 (minutes:seconds) format", e));
- }
- return 0L;
- }
-
-
-}
diff --git a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/midi/launcher/LengthControl.java b/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/midi/launcher/LengthControl.java
deleted file mode 100644
index 3a754c91a..000000000
--- a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/midi/launcher/LengthControl.java
+++ /dev/null
@@ -1,36 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 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
- *******************************************************************************/
-package org.eclipse.debug.examples.core.midi.launcher;
-
-
-/**
- * Describes the length of the sequence in microseconds.
- *
- * @since 1.0
- */
-public class LengthControl extends TimeControl {
-
- /**
- * @param launch
- */
- public LengthControl(MidiLaunch launch) {
- super("Duration" , launch);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.examples.core.midi.launcher.TimeControl#getTimeValue()
- */
- protected long getTimeValue() {
- return getSequencer().getMicrosecondLength();
- }
-
-
-}
diff --git a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/midi/launcher/MidiLaunch.java b/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/midi/launcher/MidiLaunch.java
deleted file mode 100644
index 75801ecea..000000000
--- a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/midi/launcher/MidiLaunch.java
+++ /dev/null
@@ -1,165 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 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
- *******************************************************************************/
-package org.eclipse.debug.examples.core.midi.launcher;
-
-import javax.sound.midi.MidiFileFormat;
-import javax.sound.midi.Sequencer;
-
-import org.eclipse.debug.core.DebugEvent;
-import org.eclipse.debug.core.DebugException;
-import org.eclipse.debug.core.DebugPlugin;
-import org.eclipse.debug.core.ILaunchConfiguration;
-import org.eclipse.debug.core.Launch;
-import org.eclipse.debug.core.model.ISuspendResume;
-
-/**
- * A launch containing a MIDI sequencer.
- *
- * @since 1.0
- */
-public class MidiLaunch extends Launch implements ISuspendResume {
-
- /**
- * MIDI Sequencer
- */
- private Sequencer fSequencer;
-
- /**
- * MIDI file format
- */
- private MidiFileFormat fFormat;
-
- /**
- * Constructs a new MIDI launch.
- *
- * @param launchConfiguration configuration to play
- * @param mode mode to play in
- */
- public MidiLaunch(ILaunchConfiguration launchConfiguration, String mode) {
- super(launchConfiguration, mode, null);
- }
-
- /**
- * Sets the sequencer used to play MIDI files.
- *
- * @param sequencer
- */
- public void setSequencer(Sequencer sequencer) {
- fSequencer = sequencer;
- fireChanged();
- }
-
- /**
- * Sets the format of the sequence
- * @param format
- */
- public void setFormat(MidiFileFormat format) {
- fFormat = format;
- }
-
- /**
- * Returns the file format of the sequence.
- *
- * @return file format
- */
- public MidiFileFormat getFormat() {
- return fFormat;
- }
- /**
- * Returns the sequencer used to play MIDI files.
- *
- * @return the sequencer used to play MIDI files
- */
- public Sequencer getSequencer() {
- return fSequencer;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.core.Launch#canTerminate()
- */
- public boolean canTerminate() {
- return getSequencer().isOpen();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.core.Launch#isTerminated()
- */
- public boolean isTerminated() {
- if (fSequencer != null) {
- return !fSequencer.isOpen();
- }
- return false;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.core.Launch#terminate()
- */
- public void terminate() throws DebugException {
- getSequencer().stop();
- getSequencer().close();
- fireTerminate();
- DebugPlugin.getDefault().fireDebugEventSet(new DebugEvent[]{new DebugEvent(getSequencer(), DebugEvent.TERMINATE)});
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.core.model.ISuspendResume#canResume()
- */
- public boolean canResume() {
- return isSuspended();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.core.model.ISuspendResume#canSuspend()
- */
- public boolean canSuspend() {
- if (fSequencer != null) {
- return fSequencer.isRunning();
- }
- return false;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.core.model.ISuspendResume#isSuspended()
- */
- public boolean isSuspended() {
- if (fSequencer != null) {
- return fSequencer.isOpen() & !fSequencer.isRunning();
- }
- return false;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.core.model.ISuspendResume#resume()
- */
- public void resume() throws DebugException {
- getSequencer().start();
- fireChanged();
- fireEvent(new DebugEvent(getSequencer(), DebugEvent.RESUME, DebugEvent.CLIENT_REQUEST));
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.core.model.ISuspendResume#suspend()
- */
- public void suspend() throws DebugException {
- getSequencer().stop();
- fireChanged();
- fireEvent(new DebugEvent(getSequencer(), DebugEvent.SUSPEND, DebugEvent.CLIENT_REQUEST));
- }
-
- /**
- * Fires a debug event.
- *
- * @param event debug event to fire
- */
- protected void fireEvent(DebugEvent event) {
- DebugPlugin.getDefault().fireDebugEventSet(new DebugEvent[] {event});
- }
-}
diff --git a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/midi/launcher/MidiLaunchDelegate.java b/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/midi/launcher/MidiLaunchDelegate.java
deleted file mode 100644
index b5538a787..000000000
--- a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/midi/launcher/MidiLaunchDelegate.java
+++ /dev/null
@@ -1,126 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 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
- *******************************************************************************/
-package org.eclipse.debug.examples.core.midi.launcher;
-
-import java.io.BufferedInputStream;
-import java.io.IOException;
-
-import javax.sound.midi.InvalidMidiDataException;
-import javax.sound.midi.MidiFileFormat;
-import javax.sound.midi.MidiSystem;
-import javax.sound.midi.MidiUnavailableException;
-import javax.sound.midi.Sequencer;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IWorkspaceRoot;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.debug.core.ILaunch;
-import org.eclipse.debug.core.ILaunchConfiguration;
-import org.eclipse.debug.core.model.LaunchConfigurationDelegate;
-import org.eclipse.debug.examples.core.pda.DebugCorePlugin;
-
-/**
- * Creates and starts a MIDI sequencer.
- *
- * @since 1.0
- */
-public class MidiLaunchDelegate extends LaunchConfigurationDelegate {
-
- /**
- * Identifier for the MIDI launch configuration type
- * (value <code>midi.launchType</code>)
- */
- public static final String ID_MIDI_LAUNCH_CONFIGURATION_TYPE = "midi.launchType";
-
- /**
- * Launch configuration attribute for the MIDI file to play
- * (value <code>midi.file</code>)
- */
- public static final String ATTR_MIDI_FILE = "midi.file";
-
- /* (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)
- */
- public void launch(ILaunchConfiguration configuration, String mode, ILaunch launch, IProgressMonitor monitor) throws CoreException {
- String fileName = configuration.getAttribute(ATTR_MIDI_FILE, (String)null);
- if (fileName == null) {
- abort("MIDI file not specified.", null);
- }
- IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot();
- IFile file = root.getFile(new Path(fileName));
- if (!file.exists()) {
- abort("MIDI file does not exist.", null);
- }
- Sequencer sequencer = null;
- MidiFileFormat fileFormat = null;
- try {
- sequencer = MidiSystem.getSequencer();
- sequencer.open();
- IPath location = file.getLocation();
- if (location != null) {
- fileFormat = MidiSystem.getMidiFileFormat(location.toFile());
- }
- } catch (MidiUnavailableException e) {
- abort("Cannot initialize sequencer.", e);
- } catch (InvalidMidiDataException e) {
- abort("Invalid MIDI file.", e);
- } catch (IOException e) {
- abort("Error reading MIDI file.", e);
- }
- BufferedInputStream stream = new BufferedInputStream(file.getContents());
- try {
- sequencer.setSequence(stream);
- } catch (IOException e) {
- abort("Error reading MIDI file", e);
- } catch (InvalidMidiDataException e) {
- abort("Inavlid MIDI file.", e);
- }
- MidiLaunch midiLaunch = (MidiLaunch)launch;
- midiLaunch.setSequencer(sequencer);
- midiLaunch.setFormat(fileFormat);
- sequencer.start();
- }
-
- /**
- * Throws an exception with a new status containing the given
- * message and optional exception.
- *
- * @param message error message
- * @param e underlying exception
- * @throws CoreException
- */
- private void abort(String message, Throwable e) throws CoreException {
- throw new CoreException(new Status(IStatus.ERROR, DebugCorePlugin.PLUGIN_ID, 0, message, e));
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.core.model.ILaunchConfigurationDelegate2#getLaunch(org.eclipse.debug.core.ILaunchConfiguration, java.lang.String)
- */
- public ILaunch getLaunch(ILaunchConfiguration configuration, String mode) throws CoreException {
- return new MidiLaunch(configuration, mode);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.core.model.LaunchConfigurationDelegate#buildForLaunch(org.eclipse.debug.core.ILaunchConfiguration, java.lang.String, org.eclipse.core.runtime.IProgressMonitor)
- */
- public boolean buildForLaunch(ILaunchConfiguration configuration, String mode, IProgressMonitor monitor) throws CoreException {
- return false;
- }
-
-
-
-}
diff --git a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/midi/launcher/SequencerControl.java b/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/midi/launcher/SequencerControl.java
deleted file mode 100644
index 3274582cc..000000000
--- a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/midi/launcher/SequencerControl.java
+++ /dev/null
@@ -1,132 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 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
- *******************************************************************************/
-package org.eclipse.debug.examples.core.midi.launcher;
-
-import javax.sound.midi.Sequencer;
-
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.debug.core.DebugEvent;
-import org.eclipse.debug.core.DebugPlugin;
-
-/**
- * Controls some aspect of a MIDI sequencer.
- *
- * @since 1.0
- */
-public abstract class SequencerControl {
-
- /**
- * The launch
- */
- private MidiLaunch fLaunch;
-
- /**
- * Control name
- */
- private String fName;
-
- /**
- * Constructs a control with the given name.
- */
- public SequencerControl(String name, MidiLaunch launch) {
- fName = name;
- fLaunch = launch;
- }
-
- /**
- * Returns the launch this control is associated with.
- *
- * @return MIDI launch
- */
- public MidiLaunch getLaunch() {
- return fLaunch;
- }
-
- /**
- * Returns the sequencer associated with this control.
- *
- * @return associated sequencer
- */
- public Sequencer getSequencer() {
- return fLaunch.getSequencer();
- }
-
- /**
- * Returns the name of this control.
- *
- * @return control name
- */
- public String getName() {
- return fName;
- }
-
- /**
- * Returns this controls current value.
- *
- * @return current value
- */
- public abstract String getValue();
-
- /**
- * Whether this contol's value can be modified.
- *
- * @return Whether this contol's value can be modified
- */
- public abstract boolean isEditable();
-
- /**
- * Returns a status indicating if the given value is
- * a valid value for this control to accept.
- *
- * @param value new value
- * @return whether the value is valid
- */
- public abstract IStatus validateValue(String value);
-
- /**
- * Sets the value of this control to the given value
- * and returns a status indicating if the value was
- * successfully set.
- *
- * @param newValue value
- * @return whether successful
- */
- public abstract IStatus setValue(String newValue);
-
- /**
- * Fires a debug event.
- *
- * @param event debug event to fire
- */
- public void fireEvent(DebugEvent event) {
- DebugPlugin.getDefault().fireDebugEventSet(new DebugEvent[] {event});
- }
-
- /* (non-Javadoc)
- * @see java.lang.Object#equals(java.lang.Object)
- */
- public boolean equals(Object obj) {
- if (obj != null) {
- if (getClass().equals(obj.getClass())) {
- return ((SequencerControl)obj).getSequencer().equals(getSequencer());
-
- }
- }
- return false;
- }
-
- /* (non-Javadoc)
- * @see java.lang.Object#hashCode()
- */
- public int hashCode() {
- return getSequencer().hashCode() + getClass().hashCode();
- }
-}
diff --git a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/midi/launcher/TempoControl.java b/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/midi/launcher/TempoControl.java
deleted file mode 100644
index feb3b32e4..000000000
--- a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/midi/launcher/TempoControl.java
+++ /dev/null
@@ -1,89 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 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
- *******************************************************************************/
-package org.eclipse.debug.examples.core.midi.launcher;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.debug.core.DebugEvent;
-import org.eclipse.debug.examples.core.pda.DebugCorePlugin;
-
-/**
- * Controls the tempo of a sequencer.
- *
- * @since 1.0
- */
-public class TempoControl extends SequencerControl {
-
- /**
- * Constructs a tempo control for the given launch.
- */
- public TempoControl(MidiLaunch launch) {
- super("Tempo (BPM)", launch);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.examples.core.midi.launcher.SequencerControl#getValue()
- */
- public String getValue() {
- float bpm = getSequencer().getTempoInBPM();
- return Float.toString(bpm);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.examples.core.midi.launcher.SequencerControl#isEditable()
- */
- public boolean isEditable() {
- return getSequencer().isOpen();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.examples.core.midi.launcher.SequencerControl#setValue(java.lang.String)
- */
- public IStatus setValue(String newValue) {
- try {
- float value = getFloat(newValue);
- getSequencer().setTempoInBPM(value);
- fireEvent(new DebugEvent(this, DebugEvent.CHANGE));
- return Status.OK_STATUS;
- } catch (CoreException e) {
- return e.getStatus();
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.examples.core.midi.launcher.SequencerControl#validateValue(java.lang.String)
- */
- public IStatus validateValue(String value) {
- try {
- getFloat(value);
- return Status.OK_STATUS;
- } catch (CoreException e) {
- return e.getStatus();
- }
- }
-
- /**
- * Returns a float for the string.
- *
- * @param value string
- * @return float
- * @throws CoreException if not a valid value
- */
- protected float getFloat(String value) throws CoreException {
- try {
- return Float.parseFloat(value);
- } catch (NumberFormatException e) {
- throw new CoreException(new Status(IStatus.ERROR, DebugCorePlugin.PLUGIN_ID, "Tempo must be a number", e));
- }
- }
-
-}
diff --git a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/midi/launcher/TimeControl.java b/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/midi/launcher/TimeControl.java
deleted file mode 100644
index 93aa54df4..000000000
--- a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/midi/launcher/TimeControl.java
+++ /dev/null
@@ -1,88 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 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
- *******************************************************************************/
-package org.eclipse.debug.examples.core.midi.launcher;
-
-import org.eclipse.core.runtime.IStatus;
-
-/**
- * Displays a time value based on underlying microsecond value
- *
- * @since 1.0
- */
-public abstract class TimeControl extends SequencerControl {
-
- /**
- * Constructs a time control with the given name for the
- * given launch.
- *
- * @param name
- * @param launch
- */
- public TimeControl(String name, MidiLaunch launch) {
- super(name, launch);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.examples.core.midi.launcher.SequencerControl#getValue()
- */
- public String getValue() {
- long position = getTimeValue();
- int milli = (int) (position & 0x3F);
- int sec = (int) (position / 1000000);
- int min = sec / 60;
- sec = sec % 60;
- StringBuffer clock = new StringBuffer();
- clock.append(min);
- while (clock.length() < 2) {
- clock.insert(0, 0);
- }
- clock.append(':');
- clock.append(sec);
- while (clock.length() < 5) {
- clock.insert(3, 0);
- }
- clock.append(':');
- clock.append(milli);
- while (clock.length() < 8) {
- clock.insert(6, 0);
- }
- return clock.toString();
- }
-
- /**
- * Provided by subclasses for the control.
- *
- * @return time in microseconds
- */
- protected abstract long getTimeValue();
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.examples.core.midi.launcher.SequencerControl#isEditable()
- */
- public boolean isEditable() {
- return false;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.examples.core.midi.launcher.SequencerControl#setValue(java.lang.String)
- */
- public IStatus setValue(String newValue) {
- return null;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.examples.core.midi.launcher.SequencerControl#validateValue(java.lang.String)
- */
- public IStatus validateValue(String value) {
- return null;
- }
-
-}
diff --git a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/DebugCorePlugin.java b/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/DebugCorePlugin.java
deleted file mode 100644
index be74eb78a..000000000
--- a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/DebugCorePlugin.java
+++ /dev/null
@@ -1,133 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2008 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
- * Bjorn Freeman-Benson - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.examples.core.pda;
-
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.core.runtime.Plugin;
-import org.osgi.framework.BundleContext;
-
-import java.io.File;
-import java.io.IOException;
-import java.net.URL;
-import java.util.*;
-
-/**
- * The main plugin class to be used in the desktop.
- */
-public class DebugCorePlugin extends Plugin {
- //The shared instance.
- private static DebugCorePlugin plugin;
- //Resource bundle.
- private ResourceBundle resourceBundle;
-
- /**
- * Unique identifier for the PDA debug model (value
- * <code>pda.debugModel</code>).
- */
- public static final String ID_PDA_DEBUG_MODEL = "pda.debugModel";
-
- /**
- * Name of the string substitution variable that resolves to the
- * location of a local Perl executable (value <code>perlExecutable</code>).
- */
- public static final String VARIALBE_PERL_EXECUTABLE = "perlExecutable";
- /**
- * Launch configuration attribute key. Value is a path to a perl
- * program. The path is a string representing a full path
- * to a perl program in the workspace.
- */
- public static final String ATTR_PDA_PROGRAM = ID_PDA_DEBUG_MODEL + ".ATTR_PDA_PROGRAM";
-
- /**
- * Identifier for the PDA launch configuration type
- * (value <code>pda.launchType</code>)
- */
- public static final String ID_PDA_LAUNCH_CONFIGURATION_TYPE = "pda.launchType";
-
- /**
- * Plug-in identifier.
- */
- public static final String PLUGIN_ID = "org.eclipse.debug.examples.core";
-
- /**
- * The constructor.
- */
- public DebugCorePlugin() {
- super();
- plugin = this;
- }
-
- /**
- * This method is called upon plug-in activation
- */
- public void start(BundleContext context) throws Exception {
- super.start(context);
- }
-
- /**
- * This method is called when the plug-in is stopped
- */
- public void stop(BundleContext context) throws Exception {
- super.stop(context);
- plugin = null;
- resourceBundle = null;
- }
-
- /**
- * Returns the shared instance.
- */
- public static DebugCorePlugin getDefault() {
- return plugin;
- }
-
- /**
- * Returns the string from the plugin's resource bundle,
- * or 'key' if not found.
- */
- public static String getResourceString(String key) {
- ResourceBundle bundle = DebugCorePlugin.getDefault().getResourceBundle();
- try {
- return (bundle != null) ? bundle.getString(key) : key;
- } catch (MissingResourceException e) {
- return key;
- }
- }
-
- /**
- * Returns the plugin's resource bundle,
- */
- public ResourceBundle getResourceBundle() {
- try {
- if (resourceBundle == null)
- resourceBundle = ResourceBundle.getBundle("org.eclipse.debug.examples.core.pda.DebugCorePluginResources");
- } catch (MissingResourceException x) {
- resourceBundle = null;
- }
- return resourceBundle;
- }
-
- /**
- * Return a <code>java.io.File</code> object that corresponds to the specified
- * <code>IPath</code> in the plugin directory, or <code>null</code> if none.
- */
- public static File getFileInPlugin(IPath path) {
- try {
- URL installURL =
- new URL(getDefault().getDescriptor().getInstallURL(), path.toString());
- URL localURL = Platform.asLocalURL(installURL);
- return new File(localURL.getFile());
- } catch (IOException ioe) {
- return null;
- }
- }
-}
diff --git a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/breakpoints/PDALineBreakpoint.java b/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/breakpoints/PDALineBreakpoint.java
deleted file mode 100644
index 45f2a06b4..000000000
--- a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/breakpoints/PDALineBreakpoint.java
+++ /dev/null
@@ -1,206 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 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
- * Bjorn Freeman-Benson - initial API and implementation
- * Pawel Piech (Wind River) - ported PDA Virtual Machine to Java (Bug 261400)
- *******************************************************************************/
-package org.eclipse.debug.examples.core.pda.breakpoints;
-
-import org.eclipse.core.resources.IMarker;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.resources.IWorkspaceRunnable;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.debug.core.model.IBreakpoint;
-import org.eclipse.debug.core.model.LineBreakpoint;
-import org.eclipse.debug.examples.core.pda.DebugCorePlugin;
-import org.eclipse.debug.examples.core.pda.model.IPDAEventListener;
-import org.eclipse.debug.examples.core.pda.model.PDADebugTarget;
-import org.eclipse.debug.examples.core.pda.model.PDAThread;
-import org.eclipse.debug.examples.core.pda.protocol.PDAClearBreakpointCommand;
-import org.eclipse.debug.examples.core.pda.protocol.PDAEvent;
-import org.eclipse.debug.examples.core.pda.protocol.PDARunControlEvent;
-import org.eclipse.debug.examples.core.pda.protocol.PDASetBreakpointCommand;
-import org.eclipse.debug.examples.core.pda.protocol.PDASuspendedEvent;
-import org.eclipse.debug.examples.core.pda.protocol.PDAVMSuspendedEvent;
-
-
-/**
- * PDA line breakpoint
- */
-public class PDALineBreakpoint extends LineBreakpoint implements IPDAEventListener {
-
- // target currently installed in
- private PDADebugTarget fTarget;
-
- /**
- * Default constructor is required for the breakpoint manager
- * to re-create persisted breakpoints. After instantiating a breakpoint,
- * the <code>setMarker(...)</code> method is called to restore
- * this breakpoint's attributes.
- */
- public PDALineBreakpoint() {
- }
-
- /**
- * Constructs a line breakpoint on the given resource at the given
- * line number. The line number is 1-based (i.e. the first line of a
- * file is line number 1). The PDA VM uses 0-based line numbers,
- * so this line number translation is done at breakpoint install time.
- *
- * @param resource file on which to set the breakpoint
- * @param lineNumber 1-based line number of the breakpoint
- * @throws CoreException if unable to create the breakpoint
- */
- public PDALineBreakpoint(final IResource resource, final int lineNumber) throws CoreException {
- IWorkspaceRunnable runnable = new IWorkspaceRunnable() {
- public void run(IProgressMonitor monitor) throws CoreException {
- IMarker marker = resource.createMarker("org.eclipse.debug.examples.core.pda.markerType.lineBreakpoint");
- setMarker(marker);
- marker.setAttribute(IBreakpoint.ENABLED, Boolean.TRUE);
- marker.setAttribute(IMarker.LINE_NUMBER, lineNumber);
- marker.setAttribute(IBreakpoint.ID, getModelIdentifier());
- marker.setAttribute(IMarker.MESSAGE, "Line Breakpoint: " + resource.getName() + " [line: " + lineNumber + "]");
- }
- };
- run(getMarkerRule(resource), runnable);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.core.model.IBreakpoint#getModelIdentifier()
- */
- public String getModelIdentifier() {
- return DebugCorePlugin.ID_PDA_DEBUG_MODEL;
- }
-
- /**
- * Returns whether this breakpoint is a run-to-line breakpoint
- *
- * @return whether this breakpoint is a run-to-line breakpoint
- */
- public boolean isRunToLineBreakpoint() {
- return false;
- }
-
- /**
- * Installs this breakpoint in the given interprettor.
- * Registeres this breakpoint as an event listener in the
- * given target and creates the breakpoint specific request.
- *
- * @param target PDA interprettor
- * @throws CoreException if installation fails
- */
- public void install(PDADebugTarget target) throws CoreException {
- fTarget = target;
- target.addEventListener(this);
- createRequest(target);
- }
-
- /**
- * Create the breakpoint specific request in the target. Subclasses
- * should override.
- *
- * @param target PDA interprettor
- * @throws CoreException if request creation fails
- */
- protected void createRequest(PDADebugTarget target) throws CoreException {
- //#ifdef ex3
-//# // TODO: Exercise 3 - create breakpoint request in interpreter
- //#else
- target.sendCommand(new PDASetBreakpointCommand((getLineNumber() - 1), false));
- //#endif
- }
-
- /**
- * Removes this breakpoint's event request from the target. Subclasses
- * should override.
- *
- * @param target PDA interprettor
- * @throws CoreException if clearing the request fails
- */
- protected void clearRequest(PDADebugTarget target) throws CoreException {
- //#ifdef ex3
-//# // TODO: Exercise 3 - clear breakpoint request in interpreter
- //#else
- target.sendCommand(new PDAClearBreakpointCommand((getLineNumber() - 1)));
- //#endif
- }
-
- /**
- * Removes this breakpoint from the given interprettor.
- * Removes this breakpoint as an event listener and clears
- * the request for the interprettor.
- *
- * @param target PDA interprettor
- * @throws CoreException if removal fails
- */
- public void remove(PDADebugTarget target) throws CoreException {
- target.removeEventListener(this);
- clearRequest(target);
- fTarget = null;
-
- }
-
- /**
- * Returns the target this breakpoint is installed in or <code>null</code>.
- *
- * @return the target this breakpoint is installed in or <code>null</code>
- */
- protected PDADebugTarget getDebugTarget() {
- return fTarget;
- }
-
- /**
- * Notify's the PDA interprettor that this breakpoint has been hit.
- */
- protected void notifyThread(int threadId) {
- if (fTarget != null) {
- PDAThread thread = fTarget.getThread(threadId);
- if (thread != null) {
- thread.suspendedBy(this);
- }
- }
- }
-
- /* (non-Javadoc)
- *
- * Subclasses should override to handle their breakpoint specific event.
- *
- * @see org.eclipse.debug.examples.core.pda.model.IPDAEventListener#handleEvent(java.lang.String)
- */
- public void handleEvent(PDAEvent event) {
- if (event instanceof PDASuspendedEvent || event instanceof PDAVMSuspendedEvent) {
- PDARunControlEvent rcEvent = (PDARunControlEvent)event;
- if (rcEvent.fReason.equals("breakpoint")) {
- handleHit(rcEvent);
- }
- }
- }
-
- /**
- * Determines if this breakpoint was hit and notifies the thread.
- *
- * @param event breakpoint event
- */
- private void handleHit(PDARunControlEvent event) {
- int lastSpace = event.fMessage.lastIndexOf(' ');
- if (lastSpace > 0) {
- String line = event.fMessage.substring(lastSpace + 1);
- int lineNumber = Integer.parseInt(line);
- // breakpoints event line numbers are 0 based, model objects are 1 based
- lineNumber++;
- try {
- if (getLineNumber() == lineNumber) {
- notifyThread(event.fThreadId);
- }
- } catch (CoreException e) {
- }
- }
- }
-}
diff --git a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/breakpoints/PDARunToLineBreakpoint.java b/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/breakpoints/PDARunToLineBreakpoint.java
deleted file mode 100644
index b861fff20..000000000
--- a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/breakpoints/PDARunToLineBreakpoint.java
+++ /dev/null
@@ -1,70 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2007 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
- * Bjorn Freeman-Benson - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.examples.core.pda.breakpoints;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IMarker;
-import org.eclipse.core.resources.IWorkspaceRunnable;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.debug.core.DebugException;
-import org.eclipse.debug.core.model.IBreakpoint;
-
-/**
- * A run to line breakpoint.
- */
-public class PDARunToLineBreakpoint extends PDALineBreakpoint {
-
- private IFile fSourceFile;
-
- /**
- * Constructs a run-to-line breakpoint in the given PDA program.
- *
- * @param resource PDA source file
- * @param lineNumber line to run to
- * @exception DebugException if unable to create the breakpoint
- */
- public PDARunToLineBreakpoint(final IFile resource, final int lineNumber) throws DebugException {
- IWorkspaceRunnable runnable = new IWorkspaceRunnable() {
- public void run(IProgressMonitor monitor) throws CoreException {
- // associate with workspace root to avoid drawing in editor ruler
- IMarker marker = ResourcesPlugin.getWorkspace().getRoot().createMarker("org.eclipse.debug.examples.core.pda.markerType.lineBreakpoint");
- setMarker(marker);
- marker.setAttribute(IBreakpoint.ENABLED, Boolean.TRUE);
- marker.setAttribute(IMarker.LINE_NUMBER, lineNumber);
- marker.setAttribute(IBreakpoint.ID, getModelIdentifier());
- setRegistered(false);
- fSourceFile = resource;
- }
- };
- run(getMarkerRule(resource), runnable);
- }
-
- /**
- * Returns whether this breakpoint is a run-to-line breakpoint
- *
- * @return whether this breakpoint is a run-to-line breakpoint
- */
- public boolean isRunToLineBreakpoint() {
- return true;
- }
-
- /**
- * Returns the source file this breakpoint is contained in.
- *
- * @return the source file this breakpoint is contained in
- */
- public IFile getSourceFile() {
- return fSourceFile;
- }
-}
diff --git a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/breakpoints/PDAWatchpoint.java b/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/breakpoints/PDAWatchpoint.java
deleted file mode 100644
index f013f8327..000000000
--- a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/breakpoints/PDAWatchpoint.java
+++ /dev/null
@@ -1,231 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 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
- * Bjorn Freeman-Benson - initial API and implementation
- * Pawel Piech (Wind River) - ported PDA Virtual Machine to Java (Bug 261400)
- *******************************************************************************/
-package org.eclipse.debug.examples.core.pda.breakpoints;
-
-import org.eclipse.core.resources.IMarker;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.resources.IWorkspaceRunnable;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.debug.core.model.IBreakpoint;
-import org.eclipse.debug.core.model.IWatchpoint;
-import org.eclipse.debug.examples.core.pda.model.PDADebugTarget;
-import org.eclipse.debug.examples.core.pda.protocol.PDAEvent;
-import org.eclipse.debug.examples.core.pda.protocol.PDARunControlEvent;
-import org.eclipse.debug.examples.core.pda.protocol.PDASuspendedEvent;
-import org.eclipse.debug.examples.core.pda.protocol.PDAVMSuspendedEvent;
-import org.eclipse.debug.examples.core.pda.protocol.PDAWatchCommand;
-
-
-/**
- * A watchpoint.
- */
-public class PDAWatchpoint extends PDALineBreakpoint implements IWatchpoint {
-
- // 'read' or 'write' depending on what caused the last suspend for this watchpoint
- private String fLastSuspendType;
-
- // marker attributes
- public static final String ACCESS = "ACCESS";
- public static final String MODIFICATION = "MODIFICATION";
- public static final String FUNCTION_NAME = "FUNCTION_NAME";
- public static final String VAR_NAME = "VAR_NAME";
-
- /**
- * Default constructor is required for the breakpoint manager
- * to re-create persisted breakpoints. After instantiating a breakpoint,
- * the <code>setMarker(...)</code> method is called to restore
- * this breakpoint's attributes.
- */
- public PDAWatchpoint() {
- }
- /**
- * Constructs a line breakpoint on the given resource at the given
- * line number. The line number is 1-based (i.e. the first line of a
- * file is line number 1). The PDA VM uses 0-based line numbers,
- * so this line number translation is done at breakpoint install time.
- *
- * @param resource file on which to set the breakpoint
- * @param lineNumber 1-based line number of the breakpoint
- * @param functionName function name the variable is defined in
- * @param varName variable name that watchpoint is set on
- * @param access whether this is an access watchpoint
- * @param modification whether this in a modification watchpoint
- * @throws CoreException if unable to create the watchpoint
- */
- public PDAWatchpoint(final IResource resource, final int lineNumber, final String functionName, final String varName, final boolean access, final boolean modification) throws CoreException {
- IWorkspaceRunnable runnable = new IWorkspaceRunnable() {
- public void run(IProgressMonitor monitor) throws CoreException {
- IMarker marker = resource.createMarker("org.eclipse.debug.examples.core.pda.markerType.watchpoint");
- setMarker(marker);
- setEnabled(true);
- ensureMarker().setAttribute(IMarker.LINE_NUMBER, lineNumber);
- ensureMarker().setAttribute(IBreakpoint.ID, getModelIdentifier());
- setAccess(access);
- setModification(modification);
- setVariable(functionName, varName);
- marker.setAttribute(IMarker.MESSAGE, "Watchpoint: " + resource.getName() + " [line: " + lineNumber + "]");
- }
- };
- run(getMarkerRule(resource), runnable);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.core.model.IWatchpoint#isAccess()
- */
- public boolean isAccess() throws CoreException {
- return getMarker().getAttribute(ACCESS, true);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.core.model.IWatchpoint#setAccess(boolean)
- */
- public void setAccess(boolean access) throws CoreException {
- setAttribute(ACCESS, access);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.core.model.IWatchpoint#isModification()
- */
- public boolean isModification() throws CoreException {
- return getMarker().getAttribute(MODIFICATION, true);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.core.model.IWatchpoint#setModification(boolean)
- */
- public void setModification(boolean modification) throws CoreException {
- setAttribute(MODIFICATION, modification);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.core.model.IWatchpoint#supportsAccess()
- */
- public boolean supportsAccess() {
- return true;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.core.model.IWatchpoint#supportsModification()
- */
- public boolean supportsModification() {
- return true;
- }
-
- /**
- * Sets the variable and function names the watchpoint is set on.
- *
- * @param functionName function name
- * @param variableName variable name
- * @throws CoreException if an exception occurrs setting marker attribtues
- */
- protected void setVariable(String functionName, String variableName) throws CoreException {
- setAttribute(VAR_NAME, variableName);
- setAttribute(FUNCTION_NAME, functionName);
- }
-
- /**
- * Returns the name of the variable this watchpoint is set on.
- *
- * @return the name of the variable this watchpoint is set on
- * @throws CoreException if unable to access the attribute
- */
- public String getVariableName() throws CoreException {
- return getMarker().getAttribute(VAR_NAME, (String)null);
- }
-
- /**
- * Returns the name of the function the variable associted with this watchpoint is defined in.
- *
- * @return the name of the function the variable associted with this watchpoint is defined in
- * @throws CoreException if unable to access the attribute
- */
- public String getFunctionName() throws CoreException {
- return getMarker().getAttribute(FUNCTION_NAME, (String)null);
- }
-
- /**
- * Sets the type of event that causes the last suspend event.
- *
- * @param description one of 'read' or 'write'
- */
- public void setSuspendType(String description) {
- fLastSuspendType = description;
- }
-
- /**
- * Returns the type of event that caused the last suspend.
- *
- * @return 'read', 'write', or <code>null</code> if undefined
- */
- public String getSuspendType() {
- return fLastSuspendType;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.examples.core.pda.breakpoints.PDALineBreakpoint#createRequest(org.eclipse.debug.examples.core.pda.model.PDADebugTarget)
- */
- protected void createRequest(PDADebugTarget target) throws CoreException {
- int flag = 0;
- if (isAccess()) {
- flag = flag | 1;
- }
- if (isModification()) {
- flag = flag | 2;
- }
- target.sendCommand(new PDAWatchCommand(getFunctionName(), getVariableName(), flag));
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.examples.core.pda.breakpoints.PDALineBreakpoint#clearRequest(org.eclipse.debug.examples.core.pda.model.PDADebugTarget)
- */
- protected void clearRequest(PDADebugTarget target) throws CoreException {
- target.sendCommand(new PDAWatchCommand(getFunctionName(), getVariableName(), 0));
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.examples.core.pda.model.IPDAEventListener#handleEvent(java.lang.String)
- */
- public void handleEvent(PDAEvent event) {
- if (event instanceof PDASuspendedEvent || event instanceof PDAVMSuspendedEvent) {
- PDARunControlEvent rcEvent = (PDARunControlEvent)event;
- if (rcEvent.fReason.equals("watch")) {
- handleHit(rcEvent);
- }
- }
- }
-
- /**
- * Determines if this breakpoint was hit and notifies the thread.
- *
- * @param event breakpoint event
- */
- private void handleHit(PDARunControlEvent event) {
- String[] strings = event.fMessage.split(" ");
- if (strings.length == 4) {
- String fv = strings[3];
- int j = fv.indexOf("::");
- if (j > 0) {
- String fcn = fv.substring(0, j);
- String var = fv.substring(j + 2);
- try {
- if (getVariableName().equals(var) && getFunctionName().equals(fcn)) {
- setSuspendType(strings[2]);
- notifyThread(event.fThreadId);
- }
- } catch (CoreException e) {
- }
- }
- }
- }
-}
diff --git a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/launcher/PDALaunchDelegate.java b/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/launcher/PDALaunchDelegate.java
deleted file mode 100644
index cebc2091f..000000000
--- a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/launcher/PDALaunchDelegate.java
+++ /dev/null
@@ -1,152 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 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
- * Bjorn Freeman-Benson - initial API and implementation
- * Pawel Piech (Wind River) - ported PDA Virtual Machine to Java (Bug 261400)
- *******************************************************************************/
-package org.eclipse.debug.examples.core.pda.launcher;
-
-import java.io.File;
-import java.io.IOException;
-import java.net.ServerSocket;
-import java.text.MessageFormat;
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.debug.core.DebugPlugin;
-import org.eclipse.debug.core.ILaunch;
-import org.eclipse.debug.core.ILaunchConfiguration;
-import org.eclipse.debug.core.ILaunchManager;
-import org.eclipse.debug.core.model.IDebugTarget;
-import org.eclipse.debug.core.model.IProcess;
-import org.eclipse.debug.core.model.LaunchConfigurationDelegate;
-import org.eclipse.debug.examples.core.pda.DebugCorePlugin;
-import org.eclipse.debug.examples.core.pda.model.PDADebugTarget;
-
-
-/**
- * Launches PDA program on a PDA interpretter written in Perl
- */
-public class PDALaunchDelegate extends LaunchConfigurationDelegate {
- /* (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)
- */
- public void launch(ILaunchConfiguration configuration, String mode, ILaunch launch, IProgressMonitor monitor) throws CoreException {
- //#ifdef ex1
-//# // TODO: Exercise 1 - Launch a command shell as a system process to echo "foo"
- //#elseif ex1_answer
-//# Process process = DebugPlugin.exec(new String[]{"cmd", "/C", "\"echo foo\""}, null);
-//# new RuntimeProcess(launch, process, "Hello", null);
- //#else
-
- List commandList = new ArrayList();
-
- // Get Java VM path
- String javaVMHome = System.getProperty("java.home");
- String javaVMExec = javaVMHome + File.separatorChar + "bin" + File.separatorChar + "java";
- if (File.separatorChar == '\\') {
- javaVMExec += ".exe";
- }
- File exe = new File(javaVMExec);
- if (!exe.exists()) {
- abort(MessageFormat.format("Specified java VM executable {0} does not exist.", new Object[]{javaVMExec}), null);
- }
- commandList.add(javaVMExec);
-
- commandList.add("-cp");
- commandList.add(File.pathSeparator + DebugCorePlugin.getFileInPlugin(new Path("bin")));
-
- commandList.add("org.eclipse.debug.examples.pdavm.PDAVirtualMachine");
-
- // program name
- String program = configuration.getAttribute(DebugCorePlugin.ATTR_PDA_PROGRAM, (String)null);
- if (program == null) {
- abort("Perl program unspecified.", null);
- }
-
- IFile file = ResourcesPlugin.getWorkspace().getRoot().getFile(new Path(program));
- if (!file.exists()) {
- abort(MessageFormat.format("Perl program {0} does not exist.", new String[] {file.getFullPath().toString()}), null);
- }
-
- commandList.add(file.getLocation().toOSString());
-
- // if in debug mode, add debug arguments - i.e. '-debug requestPort eventPort'
- int requestPort = -1;
- int eventPort = -1;
- if (mode.equals(ILaunchManager.DEBUG_MODE)) {
- requestPort = findFreePort();
- eventPort = findFreePort();
- if (requestPort == -1 || eventPort == -1) {
- abort("Unable to find free port", null);
- }
- commandList.add("-debug");
- commandList.add("" + requestPort);
- commandList.add("" + eventPort);
- }
-
- String[] commandLine = (String[]) commandList.toArray(new String[commandList.size()]);
- Process process = DebugPlugin.exec(commandLine, null);
- IProcess p = DebugPlugin.newProcess(launch, process, javaVMExec);
- // if in debug mode, create a debug target
- if (mode.equals(ILaunchManager.DEBUG_MODE)) {
- IDebugTarget target = new PDADebugTarget(launch, p, requestPort, eventPort);
- launch.addDebugTarget(target);
- }
- //#endif
- }
-
- /**
- * Throws an exception with a new status containing the given
- * message and optional exception.
- *
- * @param message error message
- * @param e underlying exception
- * @throws CoreException
- */
- private void abort(String message, Throwable e) throws CoreException {
- throw new CoreException(new Status(IStatus.ERROR, DebugCorePlugin.getDefault().getDescriptor().getUniqueIdentifier(), 0, message, e));
- }
-
- /**
- * Returns a free port number on localhost, or -1 if unable to find a free port.
- *
- * @return a free port number on localhost, or -1 if unable to find a free port
- */
- public static int findFreePort() {
- ServerSocket socket= null;
- try {
- socket= new ServerSocket(0);
- return socket.getLocalPort();
- } catch (IOException e) {
- } finally {
- if (socket != null) {
- try {
- socket.close();
- } catch (IOException e) {
- }
- }
- }
- return -1;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.core.model.LaunchConfigurationDelegate#buildForLaunch(org.eclipse.debug.core.ILaunchConfiguration, java.lang.String, org.eclipse.core.runtime.IProgressMonitor)
- */
- public boolean buildForLaunch(ILaunchConfiguration configuration, String mode, IProgressMonitor monitor) throws CoreException {
- return false;
- }
-}
diff --git a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/model/IPDAEventListener.java b/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/model/IPDAEventListener.java
deleted file mode 100644
index 257c4185e..000000000
--- a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/model/IPDAEventListener.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 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
- * Bjorn Freeman-Benson - initial API and implementation
- * Pawel Piech (Wind River) - ported PDA Virtual Machine to Java (Bug 261400)
- *******************************************************************************/
-package org.eclipse.debug.examples.core.pda.model;
-
-import org.eclipse.debug.examples.core.pda.protocol.PDAEvent;
-
-/**
- * Listeners are notified of events occurring in a PDA program
- * being interpreted.
- *
- * @see org.eclipse.debug.examples.core.protocol.PDAVMStarted
- * @see org.eclipse.debug.examples.core.protocol.PDAVMTerminated
- * @see org.eclipse.debug.examples.core.protocol.PDAVMSuspneded
- * @see org.eclipse.debug.examples.core.protocol.PDAVMResumed
- * @see org.eclipse.debug.examples.core.protocol.PDAStarted
- * @see org.eclipse.debug.examples.core.protocol.PDAExited
- * @see org.eclipse.debug.examples.core.protocol.PDASuspended
- * @see org.eclipse.debug.examples.core.protocol.PDAResumed
- * @see org.eclipse.debug.examples.core.pda.protocol.PDAUnimplementedInstructionEvent
- * @see org.eclipse.debug.examples.core.pda.protocol.PDARegisterData
- * @see org.eclipse.debug.examples.core.pda.protocol.PDANoSuchLabelEvent
- * @see org.eclipse.debug.examples.core.pda.protocol.PDAEvalResultEvent
- */
-public interface IPDAEventListener {
-
- /**
- * Notification the given event occurred in the target program
- * being interpreted.
- *
- * @param event the event
- */
- public void handleEvent(PDAEvent event);
-
-}
diff --git a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/model/PDAArray.java b/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/model/PDAArray.java
deleted file mode 100644
index bcc07ba35..000000000
--- a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/model/PDAArray.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 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
- * Bjorn Freeman-Benson - initial API and implementation
- * Pawel Piech (Wind River) - ported PDA Virtual Machine to Java (Bug 261400)
- *******************************************************************************/
-package org.eclipse.debug.examples.core.pda.model;
-
-import org.eclipse.debug.core.DebugException;
-import org.eclipse.debug.core.model.IVariable;
-
-public class PDAArray extends PDAValue {
-
- /**
- * An array splits a value into its words
- *
- * @param value existing value
- * @throws DebugException
- */
- public PDAArray(PDAValue value) throws DebugException {
- super(value.getVariable(), value.getValueString());
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.core.model.IValue#hasVariables()
- */
- public boolean hasVariables() throws DebugException {
- return true;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.core.model.IValue#getVariables()
- */
- public IVariable[] getVariables() throws DebugException {
- String string = getValueString();
- String[] words = string.split("\\W+");
- IVariable[] variables = new IVariable[words.length];
- for (int i = 0; i < words.length; i++) {
- String word = words[i];
- variables[i] = new PDAArrayEntry(getPDADebugTarget(), i, new PDAValue(getVariable(), word));
- }
- return variables;
- }
-
-}
diff --git a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/model/PDAArrayEntry.java b/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/model/PDAArrayEntry.java
deleted file mode 100644
index 9ff3ca74e..000000000
--- a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/model/PDAArrayEntry.java
+++ /dev/null
@@ -1,98 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2007 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
- * Bjorn Freeman-Benson - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.examples.core.pda.model;
-
-import org.eclipse.debug.core.DebugException;
-import org.eclipse.debug.core.model.IDebugTarget;
-import org.eclipse.debug.core.model.IValue;
-import org.eclipse.debug.core.model.IVariable;
-
-public class PDAArrayEntry extends PDADebugElement implements IVariable {
-
- private IValue fValue;
- private int fIndex;
-
- /**
- * Constructs a new array entry
- *
- * @param target debug target
- * @param index index in the array
- * @param value value of the entry
- */
- public PDAArrayEntry(IDebugTarget target, int index, IValue value) {
- super(target);
- fValue = value;
- fIndex = index;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.core.model.IVariable#getValue()
- */
- public IValue getValue() throws DebugException {
- return fValue;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.core.model.IVariable#getName()
- */
- public String getName() throws DebugException {
- return "[" + fIndex + "]";
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.core.model.IVariable#getReferenceTypeName()
- */
- public String getReferenceTypeName() throws DebugException {
- return "String";
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.core.model.IVariable#hasValueChanged()
- */
- public boolean hasValueChanged() throws DebugException {
- return false;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.core.model.IValueModification#setValue(java.lang.String)
- */
- public void setValue(String expression) throws DebugException {
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.core.model.IValueModification#setValue(org.eclipse.debug.core.model.IValue)
- */
- public void setValue(IValue value) throws DebugException {
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.core.model.IValueModification#supportsValueModification()
- */
- public boolean supportsValueModification() {
- return false;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.core.model.IValueModification#verifyValue(java.lang.String)
- */
- public boolean verifyValue(String expression) throws DebugException {
- return false;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.core.model.IValueModification#verifyValue(org.eclipse.debug.core.model.IValue)
- */
- public boolean verifyValue(IValue value) throws DebugException {
- return false;
- }
-
-}
diff --git a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/model/PDADebugElement.java b/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/model/PDADebugElement.java
deleted file mode 100644
index fb854ba15..000000000
--- a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/model/PDADebugElement.java
+++ /dev/null
@@ -1,109 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 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
- * Bjorn Freeman-Benson - initial API and implementation
- * Pawel Piech (Wind River) - ported PDA Virtual Machine to Java (Bug 261400)
- *******************************************************************************/
-package org.eclipse.debug.examples.core.pda.model;
-
-import org.eclipse.debug.core.DebugException;
-import org.eclipse.debug.core.DebugPlugin;
-import org.eclipse.debug.core.IBreakpointManager;
-import org.eclipse.debug.core.model.DebugElement;
-import org.eclipse.debug.core.model.IDebugTarget;
-import org.eclipse.debug.examples.core.pda.DebugCorePlugin;
-import org.eclipse.debug.examples.core.pda.protocol.PDACommand;
-import org.eclipse.debug.examples.core.pda.protocol.PDACommandResult;
-
-
-/**
- * Common function for PDA debug elements.
- */
-public class PDADebugElement extends DebugElement {
-
- /**
- * Constructs a new debug element in the given target.
- *
- * @param target debug target
- */
- public PDADebugElement(IDebugTarget target) {
- super(target);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.core.model.IDebugElement#getModelIdentifier()
- */
- public String getModelIdentifier() {
- return DebugCorePlugin.ID_PDA_DEBUG_MODEL;
- }
-
- /**
- * Sends a request to the PDA interpreter, waits for and returns the reply.
- *
- * @param request command
- * @return reply
- * @throws DebugException if the request fails
- *
- * @see org.eclipse.debug.examples.core.pda.protocol.PDATerminateCommand
- * @see org.eclipse.debug.examples.core.pda.protocol.PDAVMSuspendCommand
- * @see org.eclipse.debug.examples.core.pda.protocol.PDAVMResumeCommand
- *
- * @see org.eclipse.debug.examples.core.pda.protocol.PDASuspendCommand
- * @see org.eclipse.debug.examples.core.pda.protocol.PDAResumeCommand
- * @see org.eclipse.debug.examples.core.pda.protocol.PDAStepCommand
- * @see org.eclipse.debug.examples.core.pda.protocol.PDADropFrameCommand
- *
- * @see org.eclipse.debug.examples.core.pda.protocol.PDASetBreakpointCommand
- * @see org.eclipse.debug.examples.core.pda.protocol.PDAClearBreakpointCommand
- * @see org.eclipse.debug.examples.core.pda.protocol.PDAWatchCommand
- *
- * @see org.eclipse.debug.examples.core.pda.protocol.PDADataCommand
- * @see org.eclipse.debug.examples.core.pda.protocol.PDASetDataCommand
- * @see org.eclipse.debug.examples.core.pda.protocol.PDAPopDataCommand
- * @see org.eclipse.debug.examples.core.pda.protocol.PDAPushDataCommand
- *
- * @see org.eclipse.debug.examples.core.pda.protocol.PDAEvalCommand
- *
- * @see org.eclipse.debug.examples.core.pda.protocol.PDAEventStopCommand
- *
- * @see org.eclipse.debug.examples.core.pda.protocol.PDAStackCommand
- * @see org.eclipse.debug.examples.core.pda.protocol.PDAStackDepthCommand
- * @see org.eclipse.debug.examples.core.pda.protocol.PDAFrameCommand
- *
- * @see org.eclipse.debug.examples.core.pda.protocol.PDASetVarCommand
- * @see org.eclipse.debug.examples.core.pda.protocol.PDAVarCommand
- * @see org.eclipse.debug.examples.core.pda.protocol.PDAChildrenCommand
- *
- * @see org.eclipse.debug.examples.core.pda.protocol.PDAGroupsCommand
- * @see org.eclipse.debug.examples.core.pda.protocol.PDARegistersCommand
- *
- * @since 3.5
- */
- public PDACommandResult sendCommand(PDACommand command) throws DebugException {
- return getPDADebugTarget().sendCommand(command);
- }
-
- /**
- * Returns the debug target as a PDA target.
- *
- * @return PDA debug target
- */
- protected PDADebugTarget getPDADebugTarget() {
- return (PDADebugTarget) getDebugTarget();
- }
-
- /**
- * Returns the breakpoint manager
- *
- * @return the breakpoint manager
- */
- protected IBreakpointManager getBreakpointManager() {
- return DebugPlugin.getDefault().getBreakpointManager();
- }
-}
diff --git a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/model/PDADebugTarget.java b/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/model/PDADebugTarget.java
deleted file mode 100644
index 92a5a9955..000000000
--- a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/model/PDADebugTarget.java
+++ /dev/null
@@ -1,582 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 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
- * Bjorn Freeman-Benson - initial API and implementation
- * Pawel Piech (Wind River) - ported PDA Virtual Machine to Java (Bug 261400)
- *******************************************************************************/
-package org.eclipse.debug.examples.core.pda.model;
-
-import java.io.BufferedReader;
-import java.io.IOException;
-import java.io.InputStreamReader;
-import java.io.PrintWriter;
-import java.net.Socket;
-import java.net.UnknownHostException;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.LinkedHashMap;
-import java.util.List;
-import java.util.Map;
-
-import org.eclipse.core.resources.IMarker;
-import org.eclipse.core.resources.IMarkerDelta;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.core.runtime.jobs.Job;
-import org.eclipse.debug.core.DebugEvent;
-import org.eclipse.debug.core.DebugException;
-import org.eclipse.debug.core.IBreakpointManager;
-import org.eclipse.debug.core.IBreakpointManagerListener;
-import org.eclipse.debug.core.ILaunch;
-import org.eclipse.debug.core.model.IBreakpoint;
-import org.eclipse.debug.core.model.IDebugTarget;
-import org.eclipse.debug.core.model.IMemoryBlock;
-import org.eclipse.debug.core.model.IProcess;
-import org.eclipse.debug.core.model.IThread;
-import org.eclipse.debug.examples.core.pda.DebugCorePlugin;
-import org.eclipse.debug.examples.core.pda.breakpoints.PDALineBreakpoint;
-import org.eclipse.debug.examples.core.pda.breakpoints.PDARunToLineBreakpoint;
-import org.eclipse.debug.examples.core.pda.protocol.PDACommand;
-import org.eclipse.debug.examples.core.pda.protocol.PDACommandResult;
-import org.eclipse.debug.examples.core.pda.protocol.PDAEvent;
-import org.eclipse.debug.examples.core.pda.protocol.PDAEventStopCommand;
-import org.eclipse.debug.examples.core.pda.protocol.PDAExitedEvent;
-import org.eclipse.debug.examples.core.pda.protocol.PDARestartCommand;
-import org.eclipse.debug.examples.core.pda.protocol.PDAStartedEvent;
-import org.eclipse.debug.examples.core.pda.protocol.PDATerminateCommand;
-import org.eclipse.debug.examples.core.pda.protocol.PDAVMResumeCommand;
-import org.eclipse.debug.examples.core.pda.protocol.PDAVMResumedEvent;
-import org.eclipse.debug.examples.core.pda.protocol.PDAVMStartedEvent;
-import org.eclipse.debug.examples.core.pda.protocol.PDAVMSuspendCommand;
-import org.eclipse.debug.examples.core.pda.protocol.PDAVMSuspendedEvent;
-import org.eclipse.debug.examples.core.pda.protocol.PDAVMTerminatedEvent;
-
-
-/**
- * PDA Debug Target
- */
-public class PDADebugTarget extends PDADebugElement implements IDebugTarget, IBreakpointManagerListener, IPDAEventListener {
-
- // associated system process (VM)
- private IProcess fProcess;
-
- // containing launch object
- private ILaunch fLaunch;
-
- // sockets to communicate with VM
- private Socket fRequestSocket;
- private PrintWriter fRequestWriter;
- private BufferedReader fRequestReader;
- private Socket fEventSocket;
- private BufferedReader fEventReader;
-
- // suspended state
- private boolean fVMSuspended = false;
-
- // terminated state
- private boolean fTerminated = false;
-
- // threads
- private Map fThreads = Collections.synchronizedMap(new LinkedHashMap());
-
- // event dispatch job
- private EventDispatchJob fEventDispatch;
-
- // event listeners
- private List fEventListeners = Collections.synchronizedList(new ArrayList());
-
- /**
- * Listens to events from the PDA VM and fires corresponding
- * debug events.
- */
- class EventDispatchJob extends Job {
-
- public EventDispatchJob() {
- super("PDA Event Dispatch");
- setSystem(true);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.core.runtime.jobs.Job#run(org.eclipse.core.runtime.IProgressMonitor)
- */
- protected IStatus run(IProgressMonitor monitor) {
- String message = "";
- while (!isTerminated() && message != null) {
- try {
- message = fEventReader.readLine();
- if (message != null) {
- PDAEvent event = null;
- try {
- event = PDAEvent.parseEvent(message);
- }
- catch (IllegalArgumentException e) {
- DebugCorePlugin.getDefault().getLog().log(
- new Status (IStatus.ERROR, "org.eclipse.debug.examples.core", "Error parsing PDA event", e));
- continue;
- }
- Object[] listeners = fEventListeners.toArray();
- for (int i = 0; i < listeners.length; i++) {
- ((IPDAEventListener)listeners[i]).handleEvent(event);
- }
- }
- } catch (IOException e) {
- vmTerminated();
- }
- }
- return Status.OK_STATUS;
- }
-
- }
-
- /**
- * Registers the given event listener. The listener will be notified of
- * events in the program being interpretted. Has no effect if the listener
- * is already registered.
- *
- * @param listener event listener
- */
- public void addEventListener(IPDAEventListener listener) {
- synchronized(fEventListeners) {
- if (!fEventListeners.contains(listener)) {
- fEventListeners.add(listener);
- }
- }
- }
-
- /**
- * Deregisters the given event listener. Has no effect if the listener is
- * not currently registered.
- *
- * @param listener event listener
- */
- public void removeEventListener(IPDAEventListener listener) {
- fEventListeners.remove(listener);
- }
-
- /**
- * Constructs a new debug target in the given launch for the
- * associated PDA VM process.
- *
- * @param launch containing launch
- * @param process PDA VM
- * @param requestPort port to send requests to the VM
- * @param eventPort port to read events from
- * @exception CoreException if unable to connect to host
- */
- public PDADebugTarget(ILaunch launch, IProcess process, int requestPort, int eventPort) throws CoreException {
- super(null);
- fLaunch = launch;
- fProcess = process;
- addEventListener(this);
- try {
- // give interpreter a chance to start
- try {
- Thread.sleep(1000);
- } catch (InterruptedException e) {
- }
- fRequestSocket = new Socket("localhost", requestPort);
- fRequestWriter = new PrintWriter(fRequestSocket.getOutputStream());
- fRequestReader = new BufferedReader(new InputStreamReader(fRequestSocket.getInputStream()));
- // give interpreter a chance to open next socket
- try {
- Thread.sleep(1000);
- } catch (InterruptedException e) {
- }
- fEventSocket = new Socket("localhost", eventPort);
- fEventReader = new BufferedReader(new InputStreamReader(fEventSocket.getInputStream()));
- } catch (UnknownHostException e) {
- requestFailed("Unable to connect to PDA VM", e);
- } catch (IOException e) {
- requestFailed("Unable to connect to PDA VM", e);
- }
- fEventDispatch = new EventDispatchJob();
- fEventDispatch.schedule();
- IBreakpointManager breakpointManager = getBreakpointManager();
- breakpointManager.addBreakpointListener(this);
- breakpointManager.addBreakpointManagerListener(this);
- // initialize error hanlding to suspend on 'unimplemented instructions'
- // and 'no such label' errors
- sendCommand(new PDAEventStopCommand(PDAEventStopCommand.UNIMPINSTR, true));
- sendCommand(new PDAEventStopCommand(PDAEventStopCommand.NOSUCHLABEL, true));
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.core.model.IDebugTarget#getProcess()
- */
- public IProcess getProcess() {
- return fProcess;
- }
- /* (non-Javadoc)
- * @see org.eclipse.debug.core.model.IDebugTarget#getThreads()
- */
- public IThread[] getThreads() throws DebugException {
- synchronized (fThreads) {
- return (IThread[])fThreads.values().toArray(new IThread[fThreads.size()]);
- }
- }
- /* (non-Javadoc)
- * @see org.eclipse.debug.core.model.IDebugTarget#hasThreads()
- */
- public boolean hasThreads() throws DebugException {
- return fThreads.size() > 0;
- }
- /* (non-Javadoc)
- * @see org.eclipse.debug.core.model.IDebugTarget#getName()
- */
- public String getName() throws DebugException {
- return "PDA";
- }
- /* (non-Javadoc)
- * @see org.eclipse.debug.core.model.IDebugTarget#supportsBreakpoint(org.eclipse.debug.core.model.IBreakpoint)
- */
- public boolean supportsBreakpoint(IBreakpoint breakpoint) {
- if (!isTerminated() && breakpoint.getModelIdentifier().equals(getModelIdentifier())) {
- try {
- String program = getLaunch().getLaunchConfiguration().getAttribute(DebugCorePlugin.ATTR_PDA_PROGRAM, (String)null);
- if (program != null) {
- IResource resource = null;
- if (breakpoint instanceof PDARunToLineBreakpoint) {
- PDARunToLineBreakpoint rtl = (PDARunToLineBreakpoint) breakpoint;
- resource = rtl.getSourceFile();
- } else {
- IMarker marker = breakpoint.getMarker();
- if (marker != null) {
- resource = marker.getResource();
- }
- }
- if (resource != null) {
- IPath p = new Path(program);
- return resource.getFullPath().equals(p);
- }
- }
- } catch (CoreException e) {
- }
- }
- return false;
- }
- /* (non-Javadoc)
- * @see org.eclipse.debug.core.model.IDebugElement#getDebugTarget()
- */
- public IDebugTarget getDebugTarget() {
- return this;
- }
- /* (non-Javadoc)
- * @see org.eclipse.debug.core.model.IDebugElement#getLaunch()
- */
- public ILaunch getLaunch() {
- return fLaunch;
- }
- /* (non-Javadoc)
- * @see org.eclipse.debug.core.model.ITerminate#canTerminate()
- */
- public boolean canTerminate() {
- return getProcess().canTerminate();
- }
- /* (non-Javadoc)
- * @see org.eclipse.debug.core.model.ITerminate#isTerminated()
- */
- public synchronized boolean isTerminated() {
- return fTerminated || getProcess().isTerminated();
- }
- /* (non-Javadoc)
- * @see org.eclipse.debug.core.model.ITerminate#terminate()
- */
- public void terminate() throws DebugException {
-//#ifdef ex2
-//# // TODO: Exercise 2 - send termination request to interpreter
-//#else
- sendCommand(new PDATerminateCommand());
-//#endif
- }
- /* (non-Javadoc)
- * @see org.eclipse.debug.core.model.ISuspendResume#canResume()
- */
- public boolean canResume() {
- return !isTerminated() && isSuspended();
- }
- /* (non-Javadoc)
- * @see org.eclipse.debug.core.model.ISuspendResume#canSuspend()
- */
- public boolean canSuspend() {
- return !isTerminated() && !isSuspended();
- }
- /* (non-Javadoc)
- * @see org.eclipse.debug.core.model.ISuspendResume#isSuspended()
- */
- public synchronized boolean isSuspended() {
- return !isTerminated() && fVMSuspended;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.core.model.ISuspendResume#resume()
- */
- public void resume() throws DebugException {
- sendCommand(new PDAVMResumeCommand());
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.core.model.ISuspendResume#suspend()
- */
- public void suspend() throws DebugException {
- sendCommand(new PDAVMSuspendCommand());
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.core.IBreakpointListener#breakpointAdded(org.eclipse.debug.core.model.IBreakpoint)
- */
- public void breakpointAdded(IBreakpoint breakpoint) {
- if (supportsBreakpoint(breakpoint)) {
- try {
- if ((breakpoint.isEnabled() && getBreakpointManager().isEnabled()) || !breakpoint.isRegistered()) {
- PDALineBreakpoint pdaBreakpoint = (PDALineBreakpoint)breakpoint;
- pdaBreakpoint.install(this);
- }
- } catch (CoreException e) {
- }
- }
- }
- /* (non-Javadoc)
- * @see org.eclipse.debug.core.IBreakpointListener#breakpointRemoved(org.eclipse.debug.core.model.IBreakpoint, org.eclipse.core.resources.IMarkerDelta)
- */
- public void breakpointRemoved(IBreakpoint breakpoint, IMarkerDelta delta) {
- if (supportsBreakpoint(breakpoint)) {
- try {
- PDALineBreakpoint pdaBreakpoint = (PDALineBreakpoint)breakpoint;
- pdaBreakpoint.remove(this);
- } catch (CoreException e) {
- }
- }
- }
- /* (non-Javadoc)
- * @see org.eclipse.debug.core.IBreakpointListener#breakpointChanged(org.eclipse.debug.core.model.IBreakpoint, org.eclipse.core.resources.IMarkerDelta)
- */
- public void breakpointChanged(IBreakpoint breakpoint, IMarkerDelta delta) {
- if (supportsBreakpoint(breakpoint)) {
- try {
- if (breakpoint.isEnabled() && getBreakpointManager().isEnabled()) {
- breakpointAdded(breakpoint);
- } else {
- breakpointRemoved(breakpoint, null);
- }
- } catch (CoreException e) {
- }
- }
- }
- /* (non-Javadoc)
- * @see org.eclipse.debug.core.model.IDisconnect#canDisconnect()
- */
- public boolean canDisconnect() {
- return false;
- }
- /* (non-Javadoc)
- * @see org.eclipse.debug.core.model.IDisconnect#disconnect()
- */
- public void disconnect() throws DebugException {
- }
- /* (non-Javadoc)
- * @see org.eclipse.debug.core.model.IDisconnect#isDisconnected()
- */
- public boolean isDisconnected() {
- return false;
- }
- /* (non-Javadoc)
- * @see org.eclipse.debug.core.model.IMemoryBlockRetrieval#supportsStorageRetrieval()
- */
- public boolean supportsStorageRetrieval() {
- return false;
- }
- /* (non-Javadoc)
- * @see org.eclipse.debug.core.model.IMemoryBlockRetrieval#getMemoryBlock(long, long)
- */
- public IMemoryBlock getMemoryBlock(long startAddress, long length) throws DebugException {
- return null;
- }
-
- /**
- * Notification we have connected to the VM and it has started.
- * Resume the VM.
- */
- private void vmStarted(PDAVMStartedEvent event) {
- fireCreationEvent();
- installDeferredBreakpoints();
- try {
- resume();
- } catch (DebugException e) {
- }
- }
-
- /**
- * Install breakpoints that are already registered with the breakpoint
- * manager.
- */
- private void installDeferredBreakpoints() {
- IBreakpoint[] breakpoints = getBreakpointManager().getBreakpoints(getModelIdentifier());
- for (int i = 0; i < breakpoints.length; i++) {
- breakpointAdded(breakpoints[i]);
- }
- }
-
- /**
- * Called when this debug target terminates.
- */
- private void vmTerminated() {
- setTerminated(true);
- fThreads.clear();
- IBreakpointManager breakpointManager = getBreakpointManager();
- breakpointManager.removeBreakpointListener(this);
- breakpointManager.removeBreakpointManagerListener(this);
- fireTerminateEvent();
- removeEventListener(this);
- }
-
- private void vmResumed(PDAVMResumedEvent event) {
- setVMSuspended(false);
- fireResumeEvent(calcDetail(event.fReason));
- }
-
- private void vmSuspended(PDAVMSuspendedEvent event) {
- setVMSuspended(true);
- fireSuspendEvent(calcDetail(event.fReason));
- }
-
- private int calcDetail(String reason) {
- if (reason.equals("breakpoint") || reason.equals("watch")) {
- return DebugEvent.BREAKPOINT;
- } else if (reason.equals("step")) {
- return DebugEvent.STEP_OVER;
- } else if (reason.equals("drop")) {
- return DebugEvent.STEP_RETURN;
- } else if (reason.equals("client")) {
- return DebugEvent.CLIENT_REQUEST;
- } else if (reason.equals("event")) {
- return DebugEvent.BREAKPOINT;
- } else {
- return DebugEvent.UNSPECIFIED;
- }
- }
-
- private void started(PDAStartedEvent event) {
- PDAThread newThread = new PDAThread(this, event.fThreadId);
- fThreads.put(new Integer(event.fThreadId), newThread);
- newThread.start();
- }
-
- private void exited(PDAExitedEvent event) {
- PDAThread thread = (PDAThread)fThreads.remove(new Integer(event.fThreadId));
- if (thread != null) {
- thread.exit();
- }
- }
-
- private synchronized void setVMSuspended(boolean suspended) {
- fVMSuspended = suspended;
- }
-
- private synchronized void setTerminated(boolean terminated) {
- fTerminated = terminated;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.examples.core.pda.model.PDADebugElement#sendRequest(java.lang.String)
- */
- private String sendRequest(String request) throws DebugException {
- synchronized (fRequestSocket) {
- fRequestWriter.println(request);
- fRequestWriter.flush();
- try {
- // wait for reply
- String retVal = fRequestReader.readLine();
- if (retVal == null) {
- requestFailed("Request failed: " + request + ". Debugger connection closed.", null);
- }
- return retVal;
- } catch (IOException e) {
- requestFailed("Request failed: " + request, e);
- }
- }
- // Should never reach this satement.
- return null;
- }
-
- public PDACommandResult sendCommand(PDACommand command) throws DebugException {
- String response = sendRequest(command.getRequest());
- return command.createResult(response);
- }
-
- /**
- * When the breakpoint manager disables, remove all registered breakpoints
- * requests from the VM. When it enables, reinstall them.
- */
- public void breakpointManagerEnablementChanged(boolean enabled) {
- IBreakpoint[] breakpoints = getBreakpointManager().getBreakpoints(getModelIdentifier());
- for (int i = 0; i < breakpoints.length; i++) {
- if (enabled) {
- breakpointAdded(breakpoints[i]);
- } else {
- breakpointRemoved(breakpoints[i], null);
- }
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.examples.core.pda.model.IPDAEventListener#handleEvent(java.lang.String)
- */
- public void handleEvent(PDAEvent event) {
- if (event instanceof PDAStartedEvent) {
- started((PDAStartedEvent)event);
- } else if (event instanceof PDAExitedEvent) {
- exited((PDAExitedEvent)event);
- } else if (event instanceof PDAVMStartedEvent) {
- vmStarted((PDAVMStartedEvent)event);
- } else if (event instanceof PDAVMTerminatedEvent) {
- vmTerminated();
- } else if (event instanceof PDAVMSuspendedEvent) {
- vmSuspended((PDAVMSuspendedEvent)event);
- } else if (event instanceof PDAVMResumedEvent) {
- vmResumed((PDAVMResumedEvent)event);
- }
- }
-
- /**
- * Returns this debug target's single thread, or <code>null</code>
- * if terminated.
- *
- * @param threadId ID of the thread to return, or <code>0</code>
- * to return the first available thread
- * @return this debug target's single thread, or <code>null</code>
- * if terminated
- */
- public PDAThread getThread(int threadId) {
- if (threadId > 0) {
- return (PDAThread)fThreads.get(new Integer(threadId));
- } else {
- synchronized(fThreads) {
- if (fThreads.size() > 0) {
- return (PDAThread)fThreads.values().iterator().next();
- }
- }
- }
- return null;
- }
-
- /**
- * Restarts the current debug session
- *
- * @throws DebugException
- */
- public void restart() throws DebugException {
- sendCommand(new PDARestartCommand());
- }
-
-}
diff --git a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/model/PDAStackFrame.java b/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/model/PDAStackFrame.java
deleted file mode 100644
index b235690f3..000000000
--- a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/model/PDAStackFrame.java
+++ /dev/null
@@ -1,260 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 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
- * Bjorn Freeman-Benson - initial API and implementation
- * Pawel Piech (Wind River) - ported PDA Virtual Machine to Java (Bug 261400)
- *******************************************************************************/
-package org.eclipse.debug.examples.core.pda.model;
-
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.debug.core.DebugException;
-import org.eclipse.debug.core.model.IRegisterGroup;
-import org.eclipse.debug.core.model.IStackFrame;
-import org.eclipse.debug.core.model.IThread;
-import org.eclipse.debug.core.model.IVariable;
-import org.eclipse.debug.examples.core.pda.protocol.PDAFrameData;
-
-/**
- * PDA stack frame.
- */
-public class PDAStackFrame extends PDADebugElement implements IStackFrame {
-
- private PDAThread fThread;
- private String fName;
- private int fPC;
- private IPath fFilePath;
- private int fId;
-
- /**
- * Constructs a stack frame in the given thread with the given
- * frame data.
- *
- * @param thread
- * @param data frame data
- * @param id stack frame id (0 is the bottom of the stack)
- */
- public PDAStackFrame(PDAThread thread, PDAFrameData data, int id) {
- super(thread.getPDADebugTarget());
- fId = id;
- fThread = thread;
- init(data);
- }
-
- /**
- * Initializes this frame based on its data
- *
- * @param data
- */
- private void init(PDAFrameData data) {
- fFilePath = data.fFilePath;
- fPC = data.fPC + 1;
- fName = data.fFunction;
- IVariable[] vars = new IVariable[data.fVariables.length];
- for (int i = 0; i < data.fVariables.length; i++) {
- vars[i] = new PDAVariable(this, data.fVariables[i]);
- }
- fThread.setVariables(this, vars);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.core.model.IStackFrame#getThread()
- */
- public IThread getThread() {
- return fThread;
- }
- /* (non-Javadoc)
- * @see org.eclipse.debug.core.model.IStackFrame#getVariables()
- */
- public IVariable[] getVariables() throws DebugException {
- return fThread.getVariables(this);
- }
- /* (non-Javadoc)
- * @see org.eclipse.debug.core.model.IStackFrame#hasVariables()
- */
- public boolean hasVariables() throws DebugException {
- return getVariables().length > 0;
- }
- /* (non-Javadoc)
- * @see org.eclipse.debug.core.model.IStackFrame#getLineNumber()
- */
- public int getLineNumber() throws DebugException {
- return fPC;
- }
- /* (non-Javadoc)
- * @see org.eclipse.debug.core.model.IStackFrame#getCharStart()
- */
- public int getCharStart() throws DebugException {
- return -1;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.core.model.IStackFrame#getCharEnd()
- */
- public int getCharEnd() throws DebugException {
- return -1;
- }
- /* (non-Javadoc)
- * @see org.eclipse.debug.core.model.IStackFrame#getName()
- */
- public String getName() throws DebugException {
- return fName;
- }
- /* (non-Javadoc)
- * @see org.eclipse.debug.core.model.IStackFrame#getRegisterGroups()
- */
- public IRegisterGroup[] getRegisterGroups() throws DebugException {
- return null;
- }
- /* (non-Javadoc)
- * @see org.eclipse.debug.core.model.IStackFrame#hasRegisterGroups()
- */
- public boolean hasRegisterGroups() throws DebugException {
- return false;
- }
- /* (non-Javadoc)
- * @see org.eclipse.debug.core.model.IStep#canStepInto()
- */
- public boolean canStepInto() {
- return getThread().canStepInto();
- }
- /* (non-Javadoc)
- * @see org.eclipse.debug.core.model.IStep#canStepOver()
- */
- public boolean canStepOver() {
- return getThread().canStepOver();
- }
- /* (non-Javadoc)
- * @see org.eclipse.debug.core.model.IStep#canStepReturn()
- */
- public boolean canStepReturn() {
- return getThread().canStepReturn();
- }
- /* (non-Javadoc)
- * @see org.eclipse.debug.core.model.IStep#isStepping()
- */
- public boolean isStepping() {
- return getThread().isStepping();
- }
- /* (non-Javadoc)
- * @see org.eclipse.debug.core.model.IStep#stepInto()
- */
- public void stepInto() throws DebugException {
- getThread().stepInto();
- }
- /* (non-Javadoc)
- * @see org.eclipse.debug.core.model.IStep#stepOver()
- */
- public void stepOver() throws DebugException {
- getThread().stepOver();
- }
- /* (non-Javadoc)
- * @see org.eclipse.debug.core.model.IStep#stepReturn()
- */
- public void stepReturn() throws DebugException {
- getThread().stepReturn();
- }
- /* (non-Javadoc)
- * @see org.eclipse.debug.core.model.ISuspendResume#canResume()
- */
- public boolean canResume() {
- return getThread().canResume();
- }
- /* (non-Javadoc)
- * @see org.eclipse.debug.core.model.ISuspendResume#canSuspend()
- */
- public boolean canSuspend() {
- return getThread().canSuspend();
- }
- /* (non-Javadoc)
- * @see org.eclipse.debug.core.model.ISuspendResume#isSuspended()
- */
- public boolean isSuspended() {
- return getThread().isSuspended();
- }
- /* (non-Javadoc)
- * @see org.eclipse.debug.core.model.ISuspendResume#resume()
- */
- public void resume() throws DebugException {
- getThread().resume();
- }
- /* (non-Javadoc)
- * @see org.eclipse.debug.core.model.ISuspendResume#suspend()
- */
- public void suspend() throws DebugException {
- getThread().suspend();
- }
- /* (non-Javadoc)
- * @see org.eclipse.debug.core.model.ITerminate#canTerminate()
- */
- public boolean canTerminate() {
- return getThread().canTerminate();
- }
- /* (non-Javadoc)
- * @see org.eclipse.debug.core.model.ITerminate#isTerminated()
- */
- public boolean isTerminated() {
- return getThread().isTerminated();
- }
- /* (non-Javadoc)
- * @see org.eclipse.debug.core.model.ITerminate#terminate()
- */
- public void terminate() throws DebugException {
- getThread().terminate();
- }
-
- /**
- * Returns the name of the source file this stack frame is associated
- * with.
- *
- * @return the name of the source file this stack frame is associated
- * with
- */
- public String getSourceName() {
- return fFilePath.lastSegment();
- }
- /* (non-Javadoc)
- * @see java.lang.Object#equals(java.lang.Object)
- */
- public boolean equals(Object obj) {
- if (obj instanceof PDAStackFrame) {
- PDAStackFrame sf = (PDAStackFrame)obj;
- return sf.getThread().equals(getThread()) &&
- sf.getSourceName().equals(getSourceName()) &&
- sf.fId == fId;
- }
- return false;
- }
- /* (non-Javadoc)
- * @see java.lang.Object#hashCode()
- */
- public int hashCode() {
- return getSourceName().hashCode() + fId;
- }
-
- /**
- * Returns this stack frame's unique identifier within its thread
- *
- * @return this stack frame's unique identifier within its thread
- */
- protected int getIdentifier() {
- return fId;
- }
-
- /**
- * Returns the stack frame's thread's unique identifier
- *
- * @return this stack frame's thread's unique identifier
- *
- * @since 3.5
- */
- protected int getThreadIdentifier() {
- return fThread.getIdentifier();
- }
-
-}
diff --git a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/model/PDAStackValue.java b/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/model/PDAStackValue.java
deleted file mode 100644
index a7909d485..000000000
--- a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/model/PDAStackValue.java
+++ /dev/null
@@ -1,92 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 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
- * Bjorn Freeman-Benson - initial API and implementation
- * Pawel Piech (Wind River) - ported PDA Virtual Machine to Java (Bug 261400)
- *******************************************************************************/
-package org.eclipse.debug.examples.core.pda.model;
-
-import org.eclipse.debug.core.DebugException;
-import org.eclipse.debug.core.model.IValue;
-import org.eclipse.debug.core.model.IVariable;
-
-/**
- * A value on the data stack
- */
-public class PDAStackValue extends PDADebugElement implements IValue {
-
- final private PDAThread fThread;
- final private String fValue;
- final private int fIndex;
-
- /**
- * Constructs a value that appears on the data stack
- *
- * @param target debug target
- * @param value value on the stack
- * @param index index on the stack
- */
- public PDAStackValue(PDAThread thread, String value, int index) {
- super(thread.getDebugTarget());
- fThread = thread;
- fValue = value;
- fIndex = index;
- }
-
- public PDAThread getThread() {
- return fThread;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.core.model.IValue#getValueString()
- */
- public String getValueString() throws DebugException {
- return fValue;
- }
- /* (non-Javadoc)
- * @see org.eclipse.debug.core.model.IValue#isAllocated()
- */
- public boolean isAllocated() throws DebugException {
- return true;
- }
- /* (non-Javadoc)
- * @see org.eclipse.debug.core.model.IValue#getVariables()
- */
- public IVariable[] getVariables() throws DebugException {
- return new IVariable[0];
- }
- /* (non-Javadoc)
- * @see org.eclipse.debug.core.model.IValue#hasVariables()
- */
- public boolean hasVariables() throws DebugException {
- return false;
- }
- /* (non-Javadoc)
- * @see org.eclipse.debug.core.model.IValue#getReferenceTypeName()
- */
- public String getReferenceTypeName() throws DebugException {
- return null;
- }
- /*
- * (non-Javadoc)
- * @see java.lang.Object#equals(java.lang.Object)
- */
- public boolean equals(Object obj) {
- return obj instanceof PDAStackValue &&
- ((PDAStackValue)obj).fValue.equals(fValue) &&
- ((PDAStackValue)obj).fIndex == fIndex;
- }
- /*
- * (non-Javadoc)
- * @see java.lang.Object#hashCode()
- */
- public int hashCode() {
- return super.hashCode() + fIndex;
- }
-}
diff --git a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/model/PDAThread.java b/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/model/PDAThread.java
deleted file mode 100644
index 8d92f129c..000000000
--- a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/model/PDAThread.java
+++ /dev/null
@@ -1,563 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 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
- * Bjorn Freeman-Benson - initial API and implementation
- * Pawel Piech (Wind River) - ported PDA Virtual Machine to Java (Bug 261400)
- *******************************************************************************/
-package org.eclipse.debug.examples.core.pda.model;
-
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.Map;
-
-import org.eclipse.debug.core.DebugEvent;
-import org.eclipse.debug.core.DebugException;
-import org.eclipse.debug.core.model.IBreakpoint;
-import org.eclipse.debug.core.model.IStackFrame;
-import org.eclipse.debug.core.model.IThread;
-import org.eclipse.debug.core.model.IValue;
-import org.eclipse.debug.core.model.IVariable;
-import org.eclipse.debug.examples.core.pda.protocol.PDADataCommand;
-import org.eclipse.debug.examples.core.pda.protocol.PDADropFrameCommand;
-import org.eclipse.debug.examples.core.pda.protocol.PDAEvent;
-import org.eclipse.debug.examples.core.pda.protocol.PDAListResult;
-import org.eclipse.debug.examples.core.pda.protocol.PDANoSuchLabelEvent;
-import org.eclipse.debug.examples.core.pda.protocol.PDAPopDataCommand;
-import org.eclipse.debug.examples.core.pda.protocol.PDAPushDataCommand;
-import org.eclipse.debug.examples.core.pda.protocol.PDAResumeCommand;
-import org.eclipse.debug.examples.core.pda.protocol.PDAResumedEvent;
-import org.eclipse.debug.examples.core.pda.protocol.PDARunControlEvent;
-import org.eclipse.debug.examples.core.pda.protocol.PDAStackCommand;
-import org.eclipse.debug.examples.core.pda.protocol.PDAStackCommandResult;
-import org.eclipse.debug.examples.core.pda.protocol.PDAStepCommand;
-import org.eclipse.debug.examples.core.pda.protocol.PDASuspendCommand;
-import org.eclipse.debug.examples.core.pda.protocol.PDASuspendedEvent;
-import org.eclipse.debug.examples.core.pda.protocol.PDAUnimplementedInstructionEvent;
-import org.eclipse.debug.examples.core.pda.protocol.PDAVMResumedEvent;
-import org.eclipse.debug.examples.core.pda.protocol.PDAVMSuspendedEvent;
-
-/**
- * A PDA thread. A PDA VM is single threaded.
- */
-public class PDAThread extends PDADebugElement implements IThread, IPDAEventListener {
-
- /**
- * ID of this thread as reported by PDA.
- */
- private final int fThreadId;
-
- /**
- * Breakpoint this thread is suspended at or <code>null</code>
- * if none.
- */
- private IBreakpoint fBreakpoint;
-
- /**
- * Whether this thread is stepping
- */
- private boolean fStepping = false;
-
- /**
- * Whether this thread is suspended
- */
- private boolean fSuspended = false;
-
- /**
- * Most recent error event or <code>null</code>
- */
- private String fErrorEvent;
-
- /**
- * Table mapping stack frames to current variables
- */
- private Map fVariables = Collections.synchronizedMap(new HashMap());
-
- /**
- * Constructs a new thread for the given target
- *
- * @param target VM
- */
- public PDAThread(PDADebugTarget target, int threadId) {
- super(target);
- fThreadId = threadId;
- }
-
- /**
- * Called by the debug target after the thread is created.
- *
- * @since 3.5
- */
- void start() {
- fireCreationEvent();
- getPDADebugTarget().addEventListener(this);
- }
-
- /**
- * Called by the debug target before the thread is removed.
- *
- * @since 3.5
- */
- void exit() {
- getPDADebugTarget().removeEventListener(this);
- fireTerminateEvent();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.core.model.IThread#getStackFrames()
- */
- public IStackFrame[] getStackFrames() throws DebugException {
- if (isSuspended()) {
- PDAStackCommandResult result = (PDAStackCommandResult)sendCommand(new PDAStackCommand(fThreadId));
- IStackFrame[] frames = new IStackFrame[result.fFrames.length];
- for (int i = 0; i < result.fFrames.length; i++) {
- frames[frames.length - i - 1] = new PDAStackFrame(this, result.fFrames[i], i);
- }
- return frames;
- }
- return new IStackFrame[0];
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.core.model.IThread#hasStackFrames()
- */
- public boolean hasStackFrames() throws DebugException {
- return isSuspended();
- }
- /* (non-Javadoc)
- * @see org.eclipse.debug.core.model.IThread#getPriority()
- */
- public int getPriority() throws DebugException {
- return 0;
- }
- /* (non-Javadoc)
- * @see org.eclipse.debug.core.model.IThread#getTopStackFrame()
- */
- public IStackFrame getTopStackFrame() throws DebugException {
- IStackFrame[] frames = getStackFrames();
- if (frames.length > 0) {
- return frames[0];
- }
- return null;
- }
- /* (non-Javadoc)
- * @see org.eclipse.debug.core.model.IThread#getName()
- */
- public String getName() {
- return "Main thread";
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.core.model.IThread#getBreakpoints()
- */
- public synchronized IBreakpoint[] getBreakpoints() {
- if (fBreakpoint == null) {
- return new IBreakpoint[0];
- }
- return new IBreakpoint[]{fBreakpoint};
- }
-
- /**
- * Notifies this thread it has been suspended by the given breakpoint.
- *
- * @param breakpoint breakpoint
- */
- public synchronized void suspendedBy(IBreakpoint breakpoint) {
- fBreakpoint = breakpoint;
- suspended(DebugEvent.BREAKPOINT);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.core.model.ISuspendResume#canResume()
- */
- public boolean canResume() {
- return isSuspended() && !getDebugTarget().isSuspended();
- }
- /* (non-Javadoc)
- * @see org.eclipse.debug.core.model.ISuspendResume#canSuspend()
- */
- public boolean canSuspend() {
- return !isSuspended();
- }
- /* (non-Javadoc)
- * @see org.eclipse.debug.core.model.ISuspendResume#isSuspended()
- */
- public boolean isSuspended() {
- if (getDebugTarget().isTerminated()) {
- return false;
- }
- if (getDebugTarget().isSuspended()) {
- return true;
- }
- synchronized (this) {
- return fSuspended;
- }
- }
- /* (non-Javadoc)
- * @see org.eclipse.debug.core.model.ISuspendResume#resume()
- */
- public void resume() throws DebugException {
- //#ifdef ex2
-//# // TODO: Exercise 2 - send resume request to interpreter
- //#else
- sendCommand(new PDAResumeCommand(fThreadId));
- //#endif
- }
- /* (non-Javadoc)
- * @see org.eclipse.debug.core.model.ISuspendResume#suspend()
- */
- public void suspend() throws DebugException {
- //#ifdef ex2
-//# // TODO: Exercise 2 - send suspend request to interpreter
- //#else
- sendCommand(new PDASuspendCommand(fThreadId));
- //#endif
- }
- /* (non-Javadoc)
- * @see org.eclipse.debug.core.model.IStep#canStepInto()
- */
- public boolean canStepInto() {
- return false;
- }
- /* (non-Javadoc)
- * @see org.eclipse.debug.core.model.IStep#canStepOver()
- */
- public boolean canStepOver() {
- return isSuspended();
- }
- /* (non-Javadoc)
- * @see org.eclipse.debug.core.model.IStep#canStepReturn()
- */
- public boolean canStepReturn() {
- return false;
- }
- /* (non-Javadoc)
- * @see org.eclipse.debug.core.model.IStep#isStepping()
- */
- public boolean isStepping() {
- return fStepping;
- }
- /* (non-Javadoc)
- * @see org.eclipse.debug.core.model.IStep#stepInto()
- */
- public void stepInto() throws DebugException {
- }
- /* (non-Javadoc)
- * @see org.eclipse.debug.core.model.IStep#stepOver()
- */
- public void stepOver() throws DebugException {
- sendCommand(new PDAStepCommand(fThreadId));
- }
- /* (non-Javadoc)
- * @see org.eclipse.debug.core.model.IStep#stepReturn()
- */
- public void stepReturn() throws DebugException {
- }
- /* (non-Javadoc)
- * @see org.eclipse.debug.core.model.ITerminate#canTerminate()
- */
- public boolean canTerminate() {
- return !isTerminated();
- }
- /* (non-Javadoc)
- * @see org.eclipse.debug.core.model.ITerminate#isTerminated()
- */
- public boolean isTerminated() {
- return getDebugTarget().isTerminated();
- }
- /* (non-Javadoc)
- * @see org.eclipse.debug.core.model.ITerminate#terminate()
- */
- public void terminate() throws DebugException {
- getDebugTarget().terminate();
- }
-
- /**
- * Sets whether this thread is stepping
- *
- * @param stepping whether stepping
- */
- private synchronized void setStepping(boolean stepping) {
- fStepping = stepping;
- }
-
- /**
- * Sets whether this thread is suspended
- *
- * @param suspended whether suspended
- */
- private synchronized void setSuspended(boolean suspended) {
- fSuspended = suspended;
- }
-
- /**
- * Sets the most recent error event encountered, or <code>null</code>
- * to clear the most recent error
- *
- * @param event one of 'unimpinstr' or 'nosuchlabel' or <code>null</code>
- */
- private synchronized void setError(String event) {
- fErrorEvent = event;
- }
-
- /**
- * Returns the most recent error event encountered since the last
- * suspend, or <code>null</code> if none.
- *
- * @return the most recent error event encountered since the last
- * suspend, or <code>null</code> if none
- */
- public Object getError() {
- return fErrorEvent;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.examples.core.pda.model.IPDAEventListener#handleEvent(java.lang.String)
- */
- public void handleEvent(PDAEvent _event) {
- if (_event instanceof PDARunControlEvent && fThreadId == ((PDARunControlEvent)_event).fThreadId) {
- PDARunControlEvent event = (PDARunControlEvent)_event;
- // clear previous state
- fBreakpoint = null;
- setStepping(false);
-
- // handle events
- if (event instanceof PDAResumedEvent || event instanceof PDAVMResumedEvent) {
- setSuspended(false);
- if ("step".equals(event.fReason)) {
- setStepping(true);
- resumed(DebugEvent.STEP_OVER);
- //#ifdef ex2
- //# }
- //# // TODO: Exercise 2 - handle/fire "client" resume event
- //#else
- } else if ("client".equals(event.fReason)) {
- resumed(DebugEvent.CLIENT_REQUEST);
- }
- //#endif
- //#ifdef ex5
- //# // TODO: Exercise 5 - handle start of drop event
- //#else
- else if ("drop".equals(event.fReason)) {
- resumed(DebugEvent.STEP_RETURN);
- }
- //#endif
- } else if (event instanceof PDASuspendedEvent || event instanceof PDAVMSuspendedEvent) {
- setSuspended(true);
- //#ifdef ex2
- //# // TODO: Exercise 2 - handle/fire "client" suspend event
- //# if (event.endsWith("step")) {
- //# suspended(DebugEvent.STEP_END);
- //# } else if (event.startsWith("suspended event") && getError() != null) {
- //# exceptionHit();
- //# }
- //#else
- if ("client".equals(event.fReason)) {
- suspended(DebugEvent.CLIENT_REQUEST);
- } else if ("step".equals(event.fReason)) {
- suspended(DebugEvent.STEP_END);
- } else if ("event".equals(event.fReason) && getError() != null) {
- exceptionHit();
- }
- //#endif
- //#ifdef ex5
- //# // TODO: Exercise 5 - handle end of drop event
- //#else
- else if ("drop".equals(event.fReason)) {
- suspended(DebugEvent.STEP_END);
- }
- //#endif
- } else if (_event instanceof PDANoSuchLabelEvent ||
- _event instanceof PDAUnimplementedInstructionEvent)
- {
- setError(event.fMessage);
- }
- }
- }
-
- /**
- * Notification the target has resumed for the given reason.
- * Clears any error condition that was last encountered and
- * fires a resume event, and clears all cached variables
- * for stack frames.
- *
- * @param detail reason for the resume
- */
- private void resumed(int detail) {
- setError(null);
- fVariables.clear();
- fireResumeEvent(detail);
- }
-
- /**
- * Notification the target has suspended for the given reason
- *
- * @param detail reason for the suspend
- */
- private void suspended(int detail) {
- fireSuspendEvent(detail);
- }
-
- /**
- * Notification an error was encountered. Fires a breakpoint
- * suspend event.
- */
- private void exceptionHit() {
- suspended(DebugEvent.BREAKPOINT);
- }
-
- /**
- * Sets the current variables for the given stack frame. Called
- * by PDA stack frame when it is created.
- *
- * @param frame
- * @param variables
- */
- protected void setVariables(IStackFrame frame, IVariable[] variables) {
- synchronized (fVariables) {
- fVariables.put(frame, variables);
- }
- }
-
- /**
- * Returns the current variables for the given stack frame, or
- * <code>null</code> if none.
- *
- * @param frame stack frame
- * @return variables or <code>null</code>
- */
- protected IVariable[] getVariables(IStackFrame frame) {
- synchronized (fVariables) {
- IVariable[] variables = (IVariable[]) fVariables.get(frame);
- if (variables == null) {
- return new IVariable[0];
- }
- return variables;
- }
- }
-
- /**
- * Pops the top frame off the callstack.
- *
- * @throws DebugException
- *
- * @since 3.5
- */
- public void popFrame() throws DebugException {
- //#ifdef ex5
-//# // TODO: Exercise 5 - send drop request
- //#else
- sendCommand(new PDADropFrameCommand(fThreadId));
- //#endif
- }
-
- /**
- * Returns whether this thread can pop the top stack frame.
- *
- * @return whether this thread can pop the top stack frame
- *
- * @since 3.5
- */
- public boolean canPopFrame() {
- //#ifdef ex5
-//# // TODO: Exercise 5 - allow pop if there is more than 1 frame on the stack
- //#else
- try {
- return getStackFrames().length > 1;
- } catch (DebugException e) {
- }
- //#endif
- return false;
- }
-
- /**
- * Returns the values on the data stack (top down)
- *
- * @return the values on the data stack (top down)
- *
- * @since 3.5
- */
- public IValue[] getDataStack() throws DebugException {
- PDAListResult result = (PDAListResult)sendCommand(new PDADataCommand(fThreadId));
- if (result.fValues.length > 0) {
- IValue[] values = new IValue[result.fValues.length];
- for (int i = 0; i < result.fValues.length; i++) {
- values[values.length - i - 1] = new PDAStackValue(this, result.fValues[i], i);
- }
- return values;
- }
- return new IValue[0];
- }
-
- /**
- * Returns whether popping the data stack is currently permitted
- *
- * @return whether popping the data stack is currently permitted
- *
- * @since 3.5
- */
- public boolean canPopData() {
- try {
- return !isTerminated() && isSuspended() && getDataStack().length > 0;
- } catch (DebugException e) {
- }
- return false;
- }
-
- /**
- * Pops and returns the top of the data stack
- *
- * @return the top value on the stack
- * @throws DebugException if the stack is empty or the request fails
- *
- * @since 3.5
- */
- public IValue popData() throws DebugException {
- IValue[] dataStack = getDataStack();
- if (dataStack.length > 0) {
- sendCommand(new PDAPopDataCommand(fThreadId));
- return dataStack[0];
- }
- requestFailed("Empty stack", null);
- return null;
- }
-
- /**
- * Returns whether pushing a value is currently supported.
- *
- * @return whether pushing a value is currently supported
- *
- * @since 3.5
- */
- public boolean canPushData() {
- return !isTerminated() && isSuspended();
- }
-
- /**
- * Pushes a value onto the stack.
- *
- * @param value value to push
- * @throws DebugException on failure
- *
- * @since 3.5
- */
- public void pushData(String value) throws DebugException {
- sendCommand(new PDAPushDataCommand(fThreadId, value));
- }
-
- /**
- * Returns this thread's unique identifier
- *
- * @return this thread's unique identifier
- *
- * @since 3.5
- */
- public int getIdentifier() {
- return fThreadId;
- }
-}
diff --git a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/model/PDAValue.java b/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/model/PDAValue.java
deleted file mode 100644
index a4c6cc7e2..000000000
--- a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/model/PDAValue.java
+++ /dev/null
@@ -1,109 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 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
- * Bjorn Freeman-Benson - initial API and implementation
- * Pawel Piech (Wind River) - ported PDA Virtual Machine to Java (Bug 261400)
- *******************************************************************************/
-package org.eclipse.debug.examples.core.pda.model;
-
-import org.eclipse.debug.core.DebugException;
-import org.eclipse.debug.core.model.IValue;
-import org.eclipse.debug.core.model.IVariable;
-import org.eclipse.debug.examples.core.pda.protocol.PDAChildrenCommand;
-import org.eclipse.debug.examples.core.pda.protocol.PDAListResult;
-
-/**
- * Value of a PDA variable.
- */
-public class PDAValue extends PDADebugElement implements IValue {
-
- final private PDAVariable fVariable;
- final private String fValue;
-
- public PDAValue(PDAVariable variable, String value) {
- super(variable.getStackFrame().getPDADebugTarget());
- fVariable = variable;
- fValue = value;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.core.model.IValue#getReferenceTypeName()
- */
- public String getReferenceTypeName() throws DebugException {
- try {
- Integer.parseInt(fValue);
- } catch (NumberFormatException e) {
- return "text";
- }
- return "integer";
- }
- /* (non-Javadoc)
- * @see org.eclipse.debug.core.model.IValue#getValueString()
- */
- public String getValueString() throws DebugException {
- return fValue;
- }
- /* (non-Javadoc)
- * @see org.eclipse.debug.core.model.IValue#isAllocated()
- */
- public boolean isAllocated() throws DebugException {
- return true;
- }
- /* (non-Javadoc)
- * @see org.eclipse.debug.core.model.IValue#getVariables()
- */
- public IVariable[] getVariables() throws DebugException {
- PDAStackFrame frame = fVariable.getStackFrame();
- PDAListResult result = (PDAListResult) sendCommand(
- new PDAChildrenCommand(frame.getThreadIdentifier(), frame.getIdentifier(), fVariable.getName()) );
-
- IVariable[] children = new IVariable[result.fValues.length];
- for(int i = 0; i < result.fValues.length; i++) {
- children[i] = new PDAVariable(frame, result.fValues[i]);
- }
- return children;
- }
- /* (non-Javadoc)
- * @see org.eclipse.debug.core.model.IValue#hasVariables()
- */
- public boolean hasVariables() throws DebugException {
- if (getVariables().length != 0) {
- return true;
- }
- // Value with multiple words can be show as an array using logical
- // structures. If the value has multiple words, it needs to indicate
- // that it has children even if logical structures are not turned on.
- return fValue.split("\\W+").length > 1;
- }
- /*
- * (non-Javadoc)
- * @see java.lang.Object#equals(java.lang.Object)
- */
- public boolean equals(Object obj) {
- return obj instanceof PDAValue && ((PDAValue)obj).fValue.equals(fValue);
- }
- /*
- * (non-Javadoc)
- * @see java.lang.Object#hashCode()
- */
- public int hashCode() {
- return fValue.hashCode();
- }
-
- /**
- * Returns the variable that this value was created for.
- *
- * @return The variable that this value was created for.
- *
- * @since 3.5
- */
- public PDAVariable getVariable() {
- return fVariable;
- }
-}
diff --git a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/model/PDAVariable.java b/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/model/PDAVariable.java
deleted file mode 100644
index 2329b584d..000000000
--- a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/model/PDAVariable.java
+++ /dev/null
@@ -1,114 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 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
- * Bjorn Freeman-Benson - initial API and implementation
- * Wind River Systems - added support for IToggleBreakpointsTargetFactory
- * Pawel Piech (Wind River) - ported PDA Virtual Machine to Java (Bug 261400)
- *******************************************************************************/
-package org.eclipse.debug.examples.core.pda.model;
-
-import org.eclipse.debug.core.DebugEvent;
-import org.eclipse.debug.core.DebugException;
-import org.eclipse.debug.core.model.IValue;
-import org.eclipse.debug.core.model.IVariable;
-import org.eclipse.debug.examples.core.pda.protocol.PDACommandResult;
-import org.eclipse.debug.examples.core.pda.protocol.PDASetVarCommand;
-import org.eclipse.debug.examples.core.pda.protocol.PDAVarCommand;
-
-/**
- * A variable in a PDA stack frame
- */
-public class PDAVariable extends PDADebugElement implements IVariable {
-
- // name & stack frmae
- private String fName;
- private PDAStackFrame fFrame;
-
- /**
- * Constructs a variable contained in the given stack frame
- * with the given name.
- *
- * @param frame owning stack frame
- * @param name variable name
- */
- public PDAVariable(PDAStackFrame frame, String name) {
- super(frame.getPDADebugTarget());
- fFrame = frame;
- fName = name;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.core.model.IVariable#getValue()
- */
- public IValue getValue() throws DebugException {
- PDACommandResult result = sendCommand(new PDAVarCommand(
- fFrame.getThreadIdentifier(), getStackFrame().getIdentifier(), getName()));
- return new PDAValue(this, result.fResponseText);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.core.model.IVariable#getName()
- */
- public String getName() throws DebugException {
- return fName;
- }
- /* (non-Javadoc)
- * @see org.eclipse.debug.core.model.IVariable#getReferenceTypeName()
- */
- public String getReferenceTypeName() throws DebugException {
- return "Thing";
- }
- /* (non-Javadoc)
- * @see org.eclipse.debug.core.model.IVariable#hasValueChanged()
- */
- public boolean hasValueChanged() throws DebugException {
- return false;
- }
- /* (non-Javadoc)
- * @see org.eclipse.debug.core.model.IValueModification#setValue(java.lang.String)
- */
- public void setValue(String expression) throws DebugException {
- sendCommand(new PDASetVarCommand(
- fFrame.getThreadIdentifier(), getStackFrame().getIdentifier(), getName(), expression));
- fireChangeEvent(DebugEvent.CONTENT);
- }
- /* (non-Javadoc)
- * @see org.eclipse.debug.core.model.IValueModification#setValue(org.eclipse.debug.core.model.IValue)
- */
- public void setValue(IValue value) throws DebugException {
- }
- /* (non-Javadoc)
- * @see org.eclipse.debug.core.model.IValueModification#supportsValueModification()
- */
- public boolean supportsValueModification() {
- return true;
- }
- /* (non-Javadoc)
- * @see org.eclipse.debug.core.model.IValueModification#verifyValue(java.lang.String)
- */
- public boolean verifyValue(String expression) throws DebugException {
- return true;
- }
- /* (non-Javadoc)
- * @see org.eclipse.debug.core.model.IValueModification#verifyValue(org.eclipse.debug.core.model.IValue)
- */
- public boolean verifyValue(IValue value) throws DebugException {
- return false;
- }
-
- /**
- * Returns the stack frame owning this variable.
- *
- * @return the stack frame owning this variable
- */
- public PDAStackFrame getStackFrame() {
- return fFrame;
- }
-
-}
diff --git a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/model/WordStructureDelegate.java b/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/model/WordStructureDelegate.java
deleted file mode 100644
index dbb06cb22..000000000
--- a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/model/WordStructureDelegate.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2007 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
- * Bjorn Freeman-Benson - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.examples.core.pda.model;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.debug.core.DebugException;
-import org.eclipse.debug.core.model.ILogicalStructureTypeDelegate;
-import org.eclipse.debug.core.model.IValue;
-
-/**
- * Logical stucture to translate a string into its words.
- */
-public class WordStructureDelegate implements ILogicalStructureTypeDelegate {
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.core.model.ILogicalStructureTypeDelegate#providesLogicalStructure(org.eclipse.debug.core.model.IValue)
- */
- public boolean providesLogicalStructure(IValue value) {
- //#ifdef ex6
-//# // TODO: Exercise 6 - provide logical structures if the value has multiple words
- //#else
- try {
- String string = value.getValueString();
- String[] words = string.split("\\W+");
- return words.length > 1;
- } catch (DebugException e) {
- }
- //#endif
- return false;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.core.model.ILogicalStructureTypeDelegate#getLogicalStructure(org.eclipse.debug.core.model.IValue)
- */
- public IValue getLogicalStructure(IValue value) throws CoreException {
- //#ifdef ex6
-//# // TODO: Exercise 6 - create an array from the given value
-//# return null;
- //#else
- return new PDAArray((PDAValue)value);
- //#endif
- }
-
-}
diff --git a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDABitFieldData.java b/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDABitFieldData.java
deleted file mode 100644
index a1cf5e3de..000000000
--- a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDABitFieldData.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2009 Wind River Systems 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:
- * Wind River Systems - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.examples.core.pda.protocol;
-
-import java.util.LinkedHashMap;
-import java.util.Map;
-import java.util.StringTokenizer;
-
-/**
- * Object representing a bit field in the stack command results.
- *
- * @see PDARegistersCommand
- */
-public class PDABitFieldData {
-
- final public String fName;
- final public int fOffset;
- final public int fCount;
- final public Map fMnemonics;
-
- PDABitFieldData(String bitFieldString) {
- StringTokenizer st = new StringTokenizer(bitFieldString, " ");
-
- fName = st.nextToken();
- fOffset = Integer.parseInt(st.nextToken());
- fCount = Integer.parseInt(st.nextToken());
-
- fMnemonics = new LinkedHashMap(0);
- while (st.hasMoreTokens()) {
- fMnemonics.put(st.nextToken(), st.nextToken());
- }
- }
-} \ No newline at end of file
diff --git a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAChildrenCommand.java b/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAChildrenCommand.java
deleted file mode 100644
index f9a3f001e..000000000
--- a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAChildrenCommand.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2009 Wind River Systems 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:
- * Wind River Systems - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.examples.core.pda.protocol;
-
-
-/**
- * Retrieves data stack information
- *
- * <pre>
- * C: children {thread_id} {frame_id} {variable_name}
- * R: {child variable 1}|{child variable 2}|{child variable 3}|...|
- *
- * Errors:
- * error: invalid thread
- * </pre>
- */
-public class PDAChildrenCommand extends PDACommand {
-
- public PDAChildrenCommand(int threadId, int frameId, String name ) {
- super("children " + threadId + " " + frameId + " " + name);
- }
-
- public PDACommandResult createResult(String resultText) {
- return new PDAListResult(resultText);
- }
-}
diff --git a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAClearBreakpointCommand.java b/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAClearBreakpointCommand.java
deleted file mode 100644
index 07dba5b96..000000000
--- a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAClearBreakpointCommand.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2009 Wind River Systems 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:
- * Wind River Systems - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.examples.core.pda.protocol;
-
-
-/**
- * Clears any breakpoint set on given line
- *
- * <pre>
- * C: clear {line}
- * R: ok
- * </pre>
- */
-public class PDAClearBreakpointCommand extends PDACommand {
-
- public PDAClearBreakpointCommand(int line) {
- super("clear " + line);
- }
-
- public PDACommandResult createResult(String resultText) {
- return new PDACommandResult(resultText);
- }
-}
diff --git a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDACommand.java b/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDACommand.java
deleted file mode 100644
index 9aa2bfb15..000000000
--- a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDACommand.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2009 Wind River Systems 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:
- * Wind River Systems - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.examples.core.pda.protocol;
-
-
-/**
- * Base class for PDA commands. Sub-classes should format the request string
- * and implement the method to create the proper result object.
- */
-abstract public class PDACommand {
-
- final private String fRequest;
-
- public PDACommand(String request) {
- fRequest = request;
- }
-
- /**
- * Returns the request to be sent to PDA.
- */
- public String getRequest() {
- return fRequest;
- }
-
- /**
- * Returns the command result based on the given PDA response. This command
- * uses the class type parameter as the return type to allow the compiler to
- * enforce the correct command result. This class must be implemented by
- * each command to create the concrete result type.
- */
- abstract public PDACommandResult createResult(String resultText);
-}
diff --git a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDACommandResult.java b/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDACommandResult.java
deleted file mode 100644
index 9991b0115..000000000
--- a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDACommandResult.java
+++ /dev/null
@@ -1,27 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2009 Wind River Systems 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:
- * Wind River Systems - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.examples.core.pda.protocol;
-
-
-
-/**
- * Basic command result object. This command result simply allows access to the
- * PDA response. Sub-classes may override to optionally parse the response text
- * and return higher-level objects.
- */
-public class PDACommandResult {
-
- final public String fResponseText;
-
- public PDACommandResult(String response) {
- fResponseText = response;
- }
-}
diff --git a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDADataCommand.java b/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDADataCommand.java
deleted file mode 100644
index 66ba35a35..000000000
--- a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDADataCommand.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2009 Wind River Systems 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:
- * Wind River Systems - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.examples.core.pda.protocol;
-
-
-/**
- * Return the contents of the data stack; reply is the data from oldest to newest
- * as a single string
- *
- * <pre>
- * C: data {thread_id}
- * R: {value 1}|{value 2}|{value 3}|...|
- *
- * Errors:
- * error: invalid thread
- * </pre>
- */
-public class PDADataCommand extends PDACommand {
-
- public PDADataCommand(int threadId) {
- super("data " + threadId);
- }
-
- public PDACommandResult createResult(String resultText) {
- return new PDAListResult(resultText);
- }
-}
diff --git a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDADropFrameCommand.java b/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDADropFrameCommand.java
deleted file mode 100644
index 2204fa177..000000000
--- a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDADropFrameCommand.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2009 Wind River Systems 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:
- * Wind River Systems - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.examples.core.pda.protocol;
-
-
-/**
- * Pops the top stack frame off the call stack setting the instruction pointer to
- * the calling statement in the calling frame
- *
- * <pre>
- * If VM running:
- * C: drop {thread_id}
- * R: ok
- * E: resumed {thread_id} drop
- * E: suspended {thread_id} drop
- *
- * If VM suspended:
- * C: drop {thread_id}
- * R: ok
- * E: vmresumed drop
- * E: vmsuspended {thread_id} drop
- *
- * Errors:
- * error: invalid thread
- * </pre>
- */
-public class PDADropFrameCommand extends PDACommand {
-
- public PDADropFrameCommand(int threadId) {
- super("drop " + threadId);
- }
-
- public PDACommandResult createResult(String resultText) {
- return new PDACommandResult(resultText);
- }
-}
diff --git a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAEvalCommand.java b/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAEvalCommand.java
deleted file mode 100644
index bb0bdc6b9..000000000
--- a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAEvalCommand.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2009 Wind River Systems 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:
- * Wind River Systems - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.examples.core.pda.protocol;
-
-
-/**
- * Causes the interperter to execute the given set of instructions. At the end
- * of the evaluation the top value is poped off the stack and returned in the
- * evaluation result.
- *
- * <pre>
- * C: eval {thread_id} {instruction}%20{parameter}|{instruction}%20{parameter}|...
- * R: ok
- * E: resumed {thread_id} client
- * E: evalresult result
- * E: suspended {thread_id} eval
- *
- * Errors:
- * error: invalid thread
- * error: cannot evaluate while vm is suspended
- * error: thread running
- * </pre>
- *
- * Where event_name could be <code>unimpinstr</code> or <code>nosuchlabel</code>.
- */
-public class PDAEvalCommand extends PDACommand {
-
- public PDAEvalCommand(int threadId, String operation) {
- super("eval " + threadId + " " + operation);
- }
-
- public PDACommandResult createResult(String resultText) {
- return new PDACommandResult(resultText);
- }
-}
diff --git a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAEvalResultEvent.java b/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAEvalResultEvent.java
deleted file mode 100644
index 720147697..000000000
--- a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAEvalResultEvent.java
+++ /dev/null
@@ -1,32 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009 Wind River Systems 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:
- * Wind River Systems - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.examples.core.pda.protocol;
-
-/**
- * Eval result event generated when an evaluation has completed.
- *
- * <pre>
- * E: evalresult {result}
- * </pre>
- */
-public class PDAEvalResultEvent extends PDAEvent {
-
- public final String fResult;
-
- public PDAEvalResultEvent(String message) {
- super(message);
- fResult = message.substring(getName(message).length() + 1);
- }
-
- public static boolean isEventMessage(String message) {
- return message.startsWith("evalresult");
- }
-}
diff --git a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAEvent.java b/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAEvent.java
deleted file mode 100644
index ab841bf13..000000000
--- a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAEvent.java
+++ /dev/null
@@ -1,75 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009 Wind River Systems 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:
- * Wind River Systems - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.examples.core.pda.protocol;
-
-/**
- * Base class for PDA events.
- */
-public class PDAEvent {
- public final String fMessage;
- public final String fName;
-
- public PDAEvent(String message) {
- fMessage = message;
- fName = getName(message);
- }
-
- protected String getName(String message) {
- int nameEnd = message.indexOf(' ');
- nameEnd = nameEnd == -1 ? message.length() : nameEnd;
- return message.substring(0, nameEnd);
- }
-
- public static PDAEvent parseEvent(String message) {
- if (PDAEvalResultEvent.isEventMessage(message)) {
- return new PDAEvalResultEvent(message);
- }
- else if (PDAExitedEvent.isEventMessage(message)) {
- return new PDAExitedEvent(message);
- }
- else if (PDANoSuchLabelEvent.isEventMessage(message)) {
- return new PDANoSuchLabelEvent(message);
- }
- else if (PDARegistersEvent.isEventMessage(message)) {
- return new PDARegistersEvent(message);
- }
- else if (PDAResumedEvent.isEventMessage(message)) {
- return new PDAResumedEvent(message);
- }
- else if (PDAStartedEvent.isEventMessage(message)) {
- return new PDAStartedEvent(message);
- }
- else if (PDASuspendedEvent.isEventMessage(message)) {
- return new PDASuspendedEvent(message);
- }
- else if (PDATerminatedEvent.isEventMessage(message)) {
- return new PDATerminatedEvent(message);
- }
- else if (PDAUnimplementedInstructionEvent.isEventMessage(message)) {
- return new PDAUnimplementedInstructionEvent(message);
- }
- else if (PDAVMResumedEvent.isEventMessage(message)) {
- return new PDAVMResumedEvent(message);
- }
- else if (PDAVMStartedEvent.isEventMessage(message)) {
- return new PDAVMStartedEvent(message);
- }
- else if (PDAVMSuspendedEvent.isEventMessage(message)) {
- return new PDAVMSuspendedEvent(message);
- }
- else if (PDAExitedEvent.isEventMessage(message)) {
- return new PDAExitedEvent(message);
- }
- else {
- return new PDAEvent(message);
- }
- }
-}
diff --git a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAEventStopCommand.java b/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAEventStopCommand.java
deleted file mode 100644
index f538c0d65..000000000
--- a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAEventStopCommand.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2009 Wind River Systems 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:
- * Wind River Systems - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.examples.core.pda.protocol;
-
-
-/**
- * Optionally stop the interpreter when an error event <code>event_name</code>
- * is encountered; <code>{0|1}</code> specifies stop (<code>1</code>) or
- * continue (<code>0</code>). The possible events are <code>unimpinstr</code> and
- * <code>nosuchlabel</code>. Reply is <code>ok</code>. When an event is encountered,
- * the interpreter sends the error event (for example <code>unimlpemented instruction
- * foo</code>) and corresponding suspend event (for example <code>suspended event
- * unimpinstr</code>).
- *
- * <pre>
- * C: eventstop {event_name} {0|1}
- * R: ok
- * ...
- * E: suspended event {event_name}
- * </pre>
- *
- * Where event_name could be <code>unimpinstr</code> or <code>nosuchlabel</code>.
- */
-
-public class PDAEventStopCommand extends PDACommand {
-
- public static final int UNIMPINSTR = 0;
- public static final int NOSUCHLABEL = 1;
-
- public PDAEventStopCommand(int event, boolean enable) {
- super("eventstop " +
- (event == UNIMPINSTR ? "unimpinstr " : "nosuchlabel ") +
- (enable ? "1" : "0"));
- }
-
-
- public PDACommandResult createResult(String resultText) {
- return new PDACommandResult(resultText);
- }
-}
diff --git a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAExitedEvent.java b/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAExitedEvent.java
deleted file mode 100644
index f452e8138..000000000
--- a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAExitedEvent.java
+++ /dev/null
@@ -1,29 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009 Wind River Systems 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:
- * Wind River Systems - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.examples.core.pda.protocol;
-
-/**
- * Exited event generated when a thread has exited.
- *
- * <pre>
- * E: started {thread_id}
- * </pre>
- */
-public class PDAExitedEvent extends PDARunControlEvent {
-
- public PDAExitedEvent(String message) {
- super(message);
- }
-
- public static boolean isEventMessage(String message) {
- return message.startsWith("exited");
- }
-}
diff --git a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAFrameCommand.java b/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAFrameCommand.java
deleted file mode 100644
index c2a83af3c..000000000
--- a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAFrameCommand.java
+++ /dev/null
@@ -1,36 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2009 Wind River Systems 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:
- * Wind River Systems - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.examples.core.pda.protocol;
-
-
-/**
- * Retrieves command stack frame information for frame <code>frame_number</code>
- * (stack frames are indexed from 0, 0 being the oldest).
- *
- * <pre>
- * C: stack {thread_id} {frame_number}
- * R: {file}|{line}|{function}|{var_1}|{var_2}|...
- *
- * Errors:
- * error: invalid thread
- * </pre>
- */
-public class PDAFrameCommand extends PDACommand {
-
- public PDAFrameCommand(int threadId, int frameNum) {
- super("frame " + threadId + " " + frameNum);
- }
-
-
- public PDACommandResult createResult(String resultText) {
- return new PDAFrameCommandResult(resultText);
- }
-}
diff --git a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAFrameCommandResult.java b/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAFrameCommandResult.java
deleted file mode 100644
index f52af48c0..000000000
--- a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAFrameCommandResult.java
+++ /dev/null
@@ -1,30 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2009 Wind River Systems 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:
- * Wind River Systems - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.examples.core.pda.protocol;
-
-
-
-/**
- * @see PDAFrameCommand
- */
-
-public class PDAFrameCommandResult extends PDACommandResult {
-
- /**
- * Frame data return by the frame command.
- */
- final public PDAFrameData fFrame;
-
- PDAFrameCommandResult(String response) {
- super(response);
- fFrame = new PDAFrameData(response);
- }
-}
diff --git a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAFrameData.java b/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAFrameData.java
deleted file mode 100644
index d3f9bbc9e..000000000
--- a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAFrameData.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Wind River Systems 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:
- * Wind River Systems - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.examples.core.pda.protocol;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.StringTokenizer;
-
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.Path;
-
-/**
- * Object representing a frame in the stack command results.
- *
- * @see PDAStackCommand
- */
-
-public class PDAFrameData {
-
- final public IPath fFilePath;
- final public int fPC;
- final public String fFunction;
- final public String[] fVariables;
-
- PDAFrameData(String frameString) {
- StringTokenizer st = new StringTokenizer(frameString, "|");
-
- fFilePath = new Path(st.nextToken());
- fPC = Integer.parseInt(st.nextToken());
- fFunction = st.nextToken();
-
- List variablesList = new ArrayList();
- while (st.hasMoreTokens()) {
- variablesList.add(st.nextToken());
- }
- fVariables = (String[])variablesList.toArray(new String[variablesList.size()]);
- }
-} \ No newline at end of file
diff --git a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAGroupsCommand.java b/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAGroupsCommand.java
deleted file mode 100644
index 4e6f1eb5b..000000000
--- a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAGroupsCommand.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2009 Wind River Systems 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:
- * Wind River Systems - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.examples.core.pda.protocol;
-
-
-/**
- * Retrieves register groups information
- *
- * <pre>
- * C: groups
- * R: {group 1}|{group 2}|{group 3}|...|
- * </pre>
- */
-
-public class PDAGroupsCommand extends PDACommand {
-
- public PDAGroupsCommand() {
- super("groups");
- }
-
-
- public PDACommandResult createResult(String resultText) {
- return new PDAListResult(resultText);
- }
-}
diff --git a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAListResult.java b/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAListResult.java
deleted file mode 100644
index 4abab970a..000000000
--- a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAListResult.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Wind River Systems 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:
- * Wind River Systems - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.examples.core.pda.protocol;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.StringTokenizer;
-
-
-/**
- * @see PDADataCommand
- */
-
-public class PDAListResult extends PDACommandResult {
-
- final public String[] fValues;
-
- PDAListResult(String response) {
- super(response);
- StringTokenizer st = new StringTokenizer(response, "|");
- List valuesList = new ArrayList();
-
- while (st.hasMoreTokens()) {
- String token = st.nextToken();
- if (token.length() != 0) {
- valuesList.add(token);
- }
- }
-
- fValues = new String[valuesList.size()];
- for (int i = 0; i < valuesList.size(); i++) {
- fValues[i] = (String)valuesList.get(i);
- }
- }
-}
diff --git a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDANoSuchLabelEvent.java b/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDANoSuchLabelEvent.java
deleted file mode 100644
index b85ca868e..000000000
--- a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDANoSuchLabelEvent.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009 Wind River Systems 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:
- * Wind River Systems - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.examples.core.pda.protocol;
-
-/**
- * No Such Label event generated when the PDA program encounters an call to a
- * non-existant label in a PDA program.
- *
- * <pre>
- * E: no such label {label}
- * </pre>
- */
-public class PDANoSuchLabelEvent extends PDAEvent {
-
- public final String fLabel;
-
- public PDANoSuchLabelEvent(String message) {
- super(message);
- fLabel = message.substring(getName(message).length() + 1);
- }
-
- public static boolean isEventMessage(String message) {
- return message.startsWith("no such label");
- }
-
- protected String getName(String message) {
- if (isEventMessage(message)) {
- return "no such label";
- }
- throw new IllegalArgumentException("Invalid event: " + message);
- }
-}
diff --git a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAPopDataCommand.java b/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAPopDataCommand.java
deleted file mode 100644
index be04801e2..000000000
--- a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAPopDataCommand.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2009 Wind River Systems 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:
- * Wind River Systems - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.examples.core.pda.protocol;
-
-
-/**
- * Pops the top value from the data stack
- *
- * <pre>
- * C: popdata {thread_id}
- * R: ok
- *
- * Errors:
- * error: invalid thread
- * </pre>
- */
-public class PDAPopDataCommand extends PDACommand {
-
- public PDAPopDataCommand(int threadId) {
- super("popdata " + threadId);
- }
-
- public PDACommandResult createResult(String resultText) {
- return new PDACommandResult(resultText);
- }
-}
diff --git a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAPushDataCommand.java b/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAPushDataCommand.java
deleted file mode 100644
index 10837ea16..000000000
--- a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAPushDataCommand.java
+++ /dev/null
@@ -1,36 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2009 Wind River Systems 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:
- * Wind River Systems - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.examples.core.pda.protocol;
-
-
-/**
- * Pushes the given value on top of the data stack.
- *
- * <pre>
- * C: pushdata {thread_id} {value}
- * R: ok
- *
- * Errors:
- * error: invalid thread
- * </pre>
- */
-
-public class PDAPushDataCommand extends PDACommand {
-
- public PDAPushDataCommand(int threadId, String value) {
- super("pushdata " + threadId + " " + value);
- }
-
-
- public PDACommandResult createResult(String resultText) {
- return new PDACommandResult(resultText);
- }
-}
diff --git a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDARegisterData.java b/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDARegisterData.java
deleted file mode 100644
index 81be71016..000000000
--- a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDARegisterData.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Wind River Systems 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:
- * Wind River Systems - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.examples.core.pda.protocol;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.StringTokenizer;
-
-/**
- * Object representing a register in the registers command results.
- *
- * @see PDARCommand
- */
-
-public class PDARegisterData {
-
- final public String fName;
- final public boolean fWritable;
- final public PDABitFieldData[] fBitFields;
-
- PDARegisterData(String regString) {
- StringTokenizer st = new StringTokenizer(regString, "|");
-
- String regInfo = st.nextToken();
- StringTokenizer regSt = new StringTokenizer(regInfo, " ");
- fName = regSt.nextToken();
- fWritable = Boolean.getBoolean(regSt.nextToken());
-
- List bitFieldsList = new ArrayList();
- while (st.hasMoreTokens()) {
- bitFieldsList.add(new PDABitFieldData(st.nextToken()));
- }
- fBitFields = (PDABitFieldData[])bitFieldsList.toArray(new PDABitFieldData[bitFieldsList.size()]);
- }
-} \ No newline at end of file
diff --git a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDARegistersCommand.java b/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDARegistersCommand.java
deleted file mode 100644
index 2e766ca1d..000000000
--- a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDARegistersCommand.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2009 Wind River Systems 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:
- * Wind River Systems - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.examples.core.pda.protocol;
-
-
-/**
- * Retrieves registers definition information
- *
- * <pre>
- * C: registers {group name}
- * R: {register name} {true|false}|{bit field name} {start bit} {bit count} {mnemonic 1} {mnemonic 2} ...#{register name} ...
- * </pre>
- */
-
-public class PDARegistersCommand extends PDACommand {
-
- public PDARegistersCommand(String group) {
- super("registers " + group);
- }
-
-
- public PDACommandResult createResult(String resultText) {
- return new PDARegistersCommandResult(resultText);
- }
-}
diff --git a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDARegistersCommandResult.java b/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDARegistersCommandResult.java
deleted file mode 100644
index f5d4cd983..000000000
--- a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDARegistersCommandResult.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2009 Wind River Systems 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:
- * Wind River Systems - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.examples.core.pda.protocol;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.StringTokenizer;
-
-
-/**
- * @see PDARegistersCommand
- */
-
-public class PDARegistersCommandResult extends PDACommandResult {
-
- /**
- * Array of registers returned by the registers commands.
- */
- final public PDARegisterData[] fRegisters;
-
- PDARegistersCommandResult(String response) {
- super(response);
- StringTokenizer st = new StringTokenizer(response, "#");
- List regList = new ArrayList();
-
- while (st.hasMoreTokens()) {
- regList.add(new PDARegisterData(st.nextToken()));
- }
- fRegisters = (PDARegisterData[])regList.toArray(new PDARegisterData[regList.size()]);
- }
-}
diff --git a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDARegistersEvent.java b/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDARegistersEvent.java
deleted file mode 100644
index 9212273b5..000000000
--- a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDARegistersEvent.java
+++ /dev/null
@@ -1,30 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009 Wind River Systems 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:
- * Wind River Systems - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.examples.core.pda.protocol;
-
-/**
- * Registers event generated when the registers' definitions are changed in a
- * program.
- *
- * <pre>
- * E: registers
- * </pre>
- */
-public class PDARegistersEvent extends PDAEvent {
-
- public PDARegistersEvent(String message) {
- super(message);
- }
-
- public static boolean isEventMessage(String message) {
- return message.startsWith("registers");
- }
-}
diff --git a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDARestartCommand.java b/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDARestartCommand.java
deleted file mode 100644
index 21e58c430..000000000
--- a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDARestartCommand.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2009 Wind River Systems 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:
- * Wind River Systems - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.examples.core.pda.protocol;
-
-
-/**
- * Restarts the debug session. All threads exit and the main threads starts
- *
- * <pre>
- * C: restart
- * E: exited 0
- * E: started 1
- * R: ok
- * </pre>
- */
-
-public class PDARestartCommand extends PDACommand {
-
- public PDARestartCommand() {
- super("restart");
- }
-
-
- public PDACommandResult createResult(String resultText) {
- return new PDACommandResult(resultText);
- }
-}
diff --git a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAResumeCommand.java b/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAResumeCommand.java
deleted file mode 100644
index bf65d40e5..000000000
--- a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAResumeCommand.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2009 Wind River Systems 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:
- * Wind River Systems - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.examples.core.pda.protocol;
-
-
-/**
- * Resumes the execution of a single thread. Can be issued only if the virtual
- * machine is running.
- *
- * <pre>
- * C: resume {thread_id}
- * R: ok
- * E: resumed {thread_id} client
- *
- * Errors:
- * error: invalid thread
- * error: cannot resume thread when vm is suspended
- * error: thread already running
- * </pre>
- */
-
-public class PDAResumeCommand extends PDACommand {
-
- public PDAResumeCommand(int threadId) {
- super("resume " + threadId);
- }
-
-
- public PDACommandResult createResult(String resultText) {
- return new PDACommandResult(resultText);
- }
-}
diff --git a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAResumedEvent.java b/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAResumedEvent.java
deleted file mode 100644
index 36f89ed0d..000000000
--- a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAResumedEvent.java
+++ /dev/null
@@ -1,29 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009 Wind River Systems 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:
- * Wind River Systems - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.examples.core.pda.protocol;
-
-/**
- * Resumed event generated when a thread is resumed.
- *
- * <pre>
- * E: resumed {thread_id} [reason]
- * </pre>
- */
-public class PDAResumedEvent extends PDARunControlEvent {
-
- public PDAResumedEvent(String message) {
- super(message);
- }
-
- public static boolean isEventMessage(String message) {
- return message.startsWith("resumed");
- }
-}
diff --git a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDARunControlEvent.java b/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDARunControlEvent.java
deleted file mode 100644
index e3af4eb5e..000000000
--- a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDARunControlEvent.java
+++ /dev/null
@@ -1,69 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009 Wind River Systems 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:
- * Wind River Systems - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.examples.core.pda.protocol;
-
-
-/**
- * Base class for run-control events.
- */
-public class PDARunControlEvent extends PDAEvent {
-
- public final int fThreadId;
- public final String fReason;
-
- public PDARunControlEvent(String message) {
- super(message);
- fThreadId = getThreadId(message);
- fReason = getStateChangeReason(message);
- }
-
- protected int getThreadId(String message) {
- int nameEnd = getName(message).length();
- if ( Character.isDigit(message.charAt(nameEnd + 1)) ) {
- int threadIdEnd = message.indexOf(' ', nameEnd + 1);
- threadIdEnd = threadIdEnd == -1 ? message.length() : threadIdEnd;
- try {
- return Integer.parseInt(message.substring(nameEnd + 1, threadIdEnd));
- } catch (NumberFormatException e) {
- throw new IllegalArgumentException("Invalid event: " + message);
- }
- } else {
- return -1;
- }
- }
-
- protected String getStateChangeReason(String message) {
- int idx = getName(message).length();
- if ( Character.isDigit(message.charAt(idx + 1)) ) {
- idx = message.indexOf(' ', idx + 1);
- idx = idx == -1 ? message.length() : idx + 1;
- } else {
- idx++;
- }
- if (idx >= message.length()) {
- return "";
- }
-
- int endIdx = message.indexOf(' ', idx);
- endIdx = endIdx == -1 ? message.length() : endIdx;
- return message.substring(idx, endIdx);
- }
-
- protected String getName(String message) {
- int nameEnd = message.indexOf(' ');
- nameEnd = nameEnd == -1 ? message.length() : nameEnd;
- return message.substring(0, nameEnd);
- }
-
- public static boolean isEventMessage(String message) {
- return message.startsWith("started");
- }
-}
diff --git a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDASetBreakpointCommand.java b/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDASetBreakpointCommand.java
deleted file mode 100644
index 1abb7fa8c..000000000
--- a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDASetBreakpointCommand.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2009 Wind River Systems 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:
- * Wind River Systems - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.examples.core.pda.protocol;
-
-
-/**
- * Sets a breakpoint at given line
- *
- * <pre>
- * Suspend a single thread:
- * C: set {line_number} 0
- * R: ok
- * C: resume {thread_id}
- * E: resumed {thread_id} client
- * E: suspended {thread_id} breakpoint line_number
- *
- * Suspend the VM:
- * C: set {line_number} 1
- * R: ok
- * C: vmresume
- * E: vmresumed client
- * E: vmsuspended {thread_id} breakpoint line_number
- * </pre>
- */
-
-public class PDASetBreakpointCommand extends PDACommand {
-
- public PDASetBreakpointCommand(int line, boolean stopVM) {
- super("set " +
- line + " " +
- (stopVM ? "1" : "0"));
- }
-
-
- public PDACommandResult createResult(String resultText) {
- return new PDACommandResult(resultText);
- }
-}
diff --git a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDASetDataCommand.java b/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDASetDataCommand.java
deleted file mode 100644
index e0c22db45..000000000
--- a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDASetDataCommand.java
+++ /dev/null
@@ -1,36 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2009 Wind River Systems 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:
- * Wind River Systems - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.examples.core.pda.protocol;
-
-
-/**
- * Sets a data value in the data stack at the given location (the data stack is
- * indexed from 0, 0 being the oldest).
- *
- * <pre>
- * C: setdata {thread_id} {index} {value}
- * R: ok
- *
- * Errors:
- * error: invalid thread
- * </pre>
- */
-public class PDASetDataCommand extends PDACommand {
-
- public PDASetDataCommand(int threadId, int index, String value) {
- super("setdata " + threadId + " " + index + " " + value);
- }
-
-
- public PDACommandResult createResult(String resultText) {
- return new PDACommandResult(resultText);
- }
-}
diff --git a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDASetVarCommand.java b/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDASetVarCommand.java
deleted file mode 100644
index c5f6b090f..000000000
--- a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDASetVarCommand.java
+++ /dev/null
@@ -1,38 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2009 Wind River Systems 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:
- * Wind River Systems - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.examples.core.pda.protocol;
-
-
-/**
- * Set the contents of variable <code>variable</code> from the control stack
- * <code>frame_number</code> to value <code>value</code> (the control stack is
- * indexed from 0, 0 being the oldest).
- *
- * <pre>
- * C: setvar {thread_id} {frame_number} {variable} {value}
- * R: ok
- *
- * Errors:
- * error: invalid thread
- * </pre>
- */
-
-public class PDASetVarCommand extends PDACommand {
-
- public PDASetVarCommand(int threadId, int frame, String variable, String value) {
- super("setvar " + threadId + " " + frame + " " + variable + " " + value);
- }
-
-
- public PDACommandResult createResult(String resultText) {
- return new PDACommandResult(resultText);
- }
-}
diff --git a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAStackCommand.java b/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAStackCommand.java
deleted file mode 100644
index 84545feb1..000000000
--- a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAStackCommand.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2009 Wind River Systems 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:
- * Wind River Systems - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.examples.core.pda.protocol;
-
-
-/**
- * Return the contents of the control stack (program counters, function and
- * variable names). The reply is control stack from oldest to newest as a single string
- * <code>frame#frame#frame...#frame</code>, where each frame is a string
- * <code>"filename|pc|function name|variable name|variable name|...|variable name"</code></li>.
- *
- * <pre>
- * C: stack {thread_id}
- * R: {file}|{line}|{function}|{var_1}|{var_2}|...#{file}|{line}|{function}|{var_1}|{var_2}|...#...
- *
- * Errors:
- * error: invalid thread
- * </pre>
- */
-
-public class PDAStackCommand extends PDACommand {
-
- public PDAStackCommand(int threadId) {
- super("stack " + threadId);
- }
-
-
- public PDACommandResult createResult(String resultText) {
- return new PDAStackCommandResult(resultText);
- }
-}
diff --git a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAStackCommandResult.java b/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAStackCommandResult.java
deleted file mode 100644
index e22aa12b0..000000000
--- a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAStackCommandResult.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2009 Wind River Systems 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:
- * Wind River Systems - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.examples.core.pda.protocol;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.StringTokenizer;
-
-
-/**
- * @see PDAStackCommand
- */
-
-public class PDAStackCommandResult extends PDACommandResult {
-
- /**
- * Array of frames return by the stack commands. The frames are ordered
- * with the highest-level frame first.
- */
- final public PDAFrameData[] fFrames;
-
- PDAStackCommandResult(String response) {
- super(response);
- StringTokenizer st = new StringTokenizer(response, "#");
- List framesList = new ArrayList();
-
- while (st.hasMoreTokens()) {
- framesList.add(new PDAFrameData(st.nextToken()));
- }
- fFrames = (PDAFrameData[])framesList.toArray(new PDAFrameData[framesList.size()]);
- }
-}
diff --git a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAStackDepthCommand.java b/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAStackDepthCommand.java
deleted file mode 100644
index 6c04530c2..000000000
--- a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAStackDepthCommand.java
+++ /dev/null
@@ -1,36 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2009 Wind River Systems 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:
- * Wind River Systems - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.examples.core.pda.protocol;
-
-
-/**
- * Retrieves command stack depth
- *
- * <pre>
- * C: stackdepth {thread_id}
- * R: {depth}
- *
- * Errors:
- * error: invalid thread
- * </pre>
- */
-
-public class PDAStackDepthCommand extends PDACommand {
-
- public PDAStackDepthCommand(int threadId) {
- super("stackdepth " + threadId);
- }
-
-
- public PDACommandResult createResult(String resultText) {
- return new PDAStackDepthCommandResult(resultText);
- }
-}
diff --git a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAStackDepthCommandResult.java b/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAStackDepthCommandResult.java
deleted file mode 100644
index e5ca2b969..000000000
--- a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAStackDepthCommandResult.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2009 Wind River Systems 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:
- * Wind River Systems - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.examples.core.pda.protocol;
-
-
-
-/**
- * @see PDADataCommand
- */
-
-public class PDAStackDepthCommandResult extends PDACommandResult {
-
- final public int fDepth;
-
- PDAStackDepthCommandResult(String response) {
- super(response);
- int depth = 1; // default to something that won't cause NPEs
- try {
- depth = Integer.parseInt(response);
- } catch (NumberFormatException e) {}
- fDepth = depth;
- }
-}
diff --git a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAStartedEvent.java b/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAStartedEvent.java
deleted file mode 100644
index 6b980e105..000000000
--- a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAStartedEvent.java
+++ /dev/null
@@ -1,30 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009 Wind River Systems 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:
- * Wind River Systems - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.examples.core.pda.protocol;
-
-/**
- * Started event generated when a new thread is started. A started event
- * is always sent for the first thread when a PDA program is started.
- *
- * <pre>
- * E: started {thread_id}
- * </pre>
- */
-public class PDAStartedEvent extends PDARunControlEvent {
-
- public PDAStartedEvent(String message) {
- super(message);
- }
-
- public static boolean isEventMessage(String message) {
- return message.startsWith("started");
- }
-}
diff --git a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAStepCommand.java b/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAStepCommand.java
deleted file mode 100644
index 3a21492ad..000000000
--- a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAStepCommand.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2009 Wind River Systems 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:
- * Wind River Systems - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.examples.core.pda.protocol;
-
-
-/**
- * Executes next instruction
- *
- * <pre>
- * If VM running:
- * C: step {thread_id}
- * R: ok
- * E: resumed {thread_id} step
- * E: suspended {thread_id} step
- *
- * If VM suspended:
- * C: step {thread_id}
- * R: ok
- * E: vmresumed step
- * E: vmsuspended {thread_id} step
- *
- * Errors:
- * error: invalid thread
- * </pre>
- */
-
-public class PDAStepCommand extends PDACommand {
-
- public PDAStepCommand(int threadId) {
- super("step " + threadId);
- }
-
-
- public PDACommandResult createResult(String resultText) {
- return new PDACommandResult(resultText);
- }
-}
diff --git a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAStepReturnCommand.java b/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAStepReturnCommand.java
deleted file mode 100644
index 2a7fd9505..000000000
--- a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAStepReturnCommand.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2009 Wind River Systems 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:
- * Wind River Systems - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.examples.core.pda.protocol;
-
-
-/**
- * Single step forward until the next <code>return</code> op code. Stop before
- * executing the <code>return</code> .
- *
- * <pre>
- * If VM running:
- * C: stepreturn {thread_id}
- * R: ok
- * E: resumed {thread_id} client
- * E: suspended {thread_id} step
- *
- * If VM suspended:
- * C: stepreturn {thread_id}
- * R: ok
- * E: vmresumed client
- * E: vmsuspended {thread_id} step
- *
- * Errors:
- * error: invalid thread
- * </pre>
- */
-
-public class PDAStepReturnCommand extends PDACommand {
-
- public PDAStepReturnCommand(int threadId) {
- super("stepreturn " + threadId);
- }
-
-
- public PDACommandResult createResult(String resultText) {
- return new PDACommandResult(resultText);
- }
-}
diff --git a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDASuspendCommand.java b/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDASuspendCommand.java
deleted file mode 100644
index fb124d3e0..000000000
--- a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDASuspendCommand.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2009 Wind River Systems 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:
- * Wind River Systems - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.examples.core.pda.protocol;
-
-
-/**
- * Suspends execution of a single thread. Can be issued only if the virtual
- * machine is running.
- *
- * <pre>
- * C: suspend {thread_id}
- * R: ok
- * E: suspended {thread_id} client
- *
- * Errors:
- * error: invalid thread
- error: vm already suspended
- * error: thread already suspended
- * </pre>
- */
-
-public class PDASuspendCommand extends PDACommand {
-
- public PDASuspendCommand(int threadId) {
- super("suspend " + threadId);
- }
-
-
- public PDACommandResult createResult(String resultText) {
- return new PDACommandResult(resultText);
- }
-}
diff --git a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDASuspendedEvent.java b/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDASuspendedEvent.java
deleted file mode 100644
index b226347c3..000000000
--- a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDASuspendedEvent.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009 Wind River Systems 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:
- * Wind River Systems - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.examples.core.pda.protocol;
-
-/**
- * Suspended event generated when a thread is suspended.
- *
- * <pre>
- * E: suspended {thread_id} [reason]
- * </pre>
- *
- * <code>[reason]</code> is the cause of the suspension and it's optional:
- * <ul>
- * <li><code>breakpoint N</code> - a breakpoint at line <code>N</code> was hit</li>
- * <li><code>client</code> - a client request to suspend has completed</li>
- * <li><code>drop</code> - a client request to drop a frame has completed</li>
- * <li><code>event E</code> - an error was encountered, where <code>E</code> is one
- * of <code>unimpinstr</code> or <code>nosuchlabel</code></li>
- * <li><code>step</code> - a step request has completed</li>
- * <li><code>watch A F::V</code> - a watchpoint was hit for reason <code>A</code>
- * (<code>read</code> or <code>write</code>), on variable <code>V</code> in
- * function <code>F</code></li>
- * </ul>
-
- */
-public class PDASuspendedEvent extends PDARunControlEvent {
-
- public PDASuspendedEvent(String message) {
- super(message);
- }
-
- public static boolean isEventMessage(String message) {
- return message.startsWith("suspended");
- }
-}
diff --git a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDATerminateCommand.java b/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDATerminateCommand.java
deleted file mode 100644
index 3e91596f1..000000000
--- a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDATerminateCommand.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2009 Wind River Systems 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:
- * Wind River Systems - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.examples.core.pda.protocol;
-
-
-/**
- * Instructs the debugger to terminate.
- *
- * <pre>
- * C: terminate
- * R: ok
- * E: vmterminated
- * </pre>
- */
-
-public class PDATerminateCommand extends PDACommand {
-
- public PDATerminateCommand() {
- super("terminate");
- }
-
-
- public PDACommandResult createResult(String resultText) {
- return new PDACommandResult(resultText);
- }
-}
diff --git a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDATerminatedEvent.java b/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDATerminatedEvent.java
deleted file mode 100644
index 648e838ab..000000000
--- a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDATerminatedEvent.java
+++ /dev/null
@@ -1,29 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009 Wind River Systems 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:
- * Wind River Systems - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.examples.core.pda.protocol;
-
-/**
- * Terminated event generated when the PDA program has ended execution.
- *
- * <pre>
- * E: termianted
- * </pre>
- */
-public class PDATerminatedEvent extends PDAEvent {
-
- public PDATerminatedEvent(String message) {
- super(message);
- }
-
- public static boolean isEventMessage(String message) {
- return message.startsWith("terminated");
- }
-}
diff --git a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAUnimplementedInstructionEvent.java b/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAUnimplementedInstructionEvent.java
deleted file mode 100644
index 7a0ce54ba..000000000
--- a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAUnimplementedInstructionEvent.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2009 Wind River Systems 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:
- * Wind River Systems - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.examples.core.pda.protocol;
-
-/**
- * Unimplemented Instruction event generated when the PDA program encounters
- * an instruction that it does not recognize. This event is usually followed
- * by a VM Suspended event.
- *
- * <pre>
- * E: unimplemented instruction {label}
- * </pre>
- */
-public class PDAUnimplementedInstructionEvent extends PDAEvent {
-
- public final String fOperation;
-
- public PDAUnimplementedInstructionEvent(String message) {
- super(message);
- fOperation = message.substring(getName(message).length() + 1);
- }
-
- public static boolean isEventMessage(String message) {
- return message.startsWith("unimplemented instruction");
- }
-
- protected String getName(String message) {
- if (isEventMessage(message)) {
- return "unimplemented instruction";
- }
- throw new IllegalArgumentException("Invalid event: " + message);
- }
-}
diff --git a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAVMResumeCommand.java b/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAVMResumeCommand.java
deleted file mode 100644
index 85ca473ab..000000000
--- a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAVMResumeCommand.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2009 Wind River Systems 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:
- * Wind River Systems - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.examples.core.pda.protocol;
-
-
-/**
- * Resumes the execution of the whole virtual machine
- *
- * <pre>
- * C: vmresume
- * R: ok
- * E: vmresumed client
- *
- * Errors:
- * error: vm already running
- * </pre>
- */
-
-public class PDAVMResumeCommand extends PDACommand {
-
- public PDAVMResumeCommand() {
- super("vmresume");
- }
-
-
- public PDACommandResult createResult(String resultText) {
- return new PDACommandResult(resultText);
- }
-}
diff --git a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAVMResumedEvent.java b/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAVMResumedEvent.java
deleted file mode 100644
index 74801c6c5..000000000
--- a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAVMResumedEvent.java
+++ /dev/null
@@ -1,36 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009 Wind River Systems 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:
- * Wind River Systems - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.examples.core.pda.protocol;
-
-/**
- * VM Resumed event generated when the whole virtual machine is resumed. When
- * the VM is resumed all previously suspended threads are resumed as well.
- *
- * <pre>
- * E: vmresumed [reason]
- * </pre>
- *
- * <code>[reason]</code> is the cause of the resume: and it's optional:
- * <ul>
- * <li><code>step</code> - a step request has been initiated</li>
- * <li><code>client</code> - a client request to resume has been initiated</li>
- * </ul>
- */
-public class PDAVMResumedEvent extends PDARunControlEvent {
-
- public PDAVMResumedEvent(String message) {
- super(message);
- }
-
- public static boolean isEventMessage(String message) {
- return message.startsWith("vmresumed");
- }
-}
diff --git a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAVMStartedEvent.java b/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAVMStartedEvent.java
deleted file mode 100644
index ff5f1dc0f..000000000
--- a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAVMStartedEvent.java
+++ /dev/null
@@ -1,30 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009 Wind River Systems 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:
- * Wind River Systems - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.examples.core.pda.protocol;
-
-/**
- * VM started event generated when the the interpreter has started (guaranteed
- * to be the first event sent)
- *
- * <pre>
- * E: vmstarted
- * </pre>
- */
-public class PDAVMStartedEvent extends PDAEvent {
-
- public PDAVMStartedEvent(String message) {
- super(message);
- }
-
- public static boolean isEventMessage(String message) {
- return message.startsWith("vmstarted");
- }
-}
diff --git a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAVMSuspendCommand.java b/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAVMSuspendCommand.java
deleted file mode 100644
index ad62d3321..000000000
--- a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAVMSuspendCommand.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2009 Wind River Systems 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:
- * Wind River Systems - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.examples.core.pda.protocol;
-
-
-/**
- * Suspends the execution of the whole virtual machine
- *
- * <pre>
- * C: vmsuspend
- * R: ok
- * E: vmsuspended client
- *
- * Errors:
- * error: thread already suspended
- * </pre>
- */
-
-public class PDAVMSuspendCommand extends PDACommand {
-
- public PDAVMSuspendCommand() {
- super("vmsuspend");
- }
-
-
- public PDACommandResult createResult(String resultText) {
- return new PDACommandResult(resultText);
- }
-}
diff --git a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAVMSuspendedEvent.java b/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAVMSuspendedEvent.java
deleted file mode 100644
index 0e36297ec..000000000
--- a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAVMSuspendedEvent.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009 Wind River Systems 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:
- * Wind River Systems - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.examples.core.pda.protocol;
-
-/**
- * VM Suspended event generated when the virtual machine is suspended. If the VM
- * is suspended as a result of a thread event (e.g. thread hitting a breakpoint),
- * then the thread_id is included in the event.
- *
- * <pre>
- * E: vmsuspended [thread_id] {reason}
- * </pre>
- *
- * <code>{reason}</code> is the cause of the suspension:
- * <ul>
- * <li><code>breakpoint N</code> - a breakpoint at line <code>N</code> was hit</li>
- * <li><code>client</code> - a client request to suspend has completed</li>
- * <li><code>drop</code> - a client request to drop a frame has completed</li>
- * <li><code>event E</code> - an error was encountered, where <code>E</code> is one
- * of <code>unimpinstr</code> or <code>nosuchlabel</code></li>
- * <li><code>step</code> - a step request has completed</li>
- * <li><code>watch A F::V</code> - a watchpoint was hit for reason <code>A</code>
- * (<code>read</code> or <code>write</code>), on variable <code>V</code> in
- * function <code>F</code></li>
- * </ul>
- */
-public class PDAVMSuspendedEvent extends PDARunControlEvent {
-
- public PDAVMSuspendedEvent(String message) {
- super(message);
- }
-
- public static boolean isEventMessage(String message) {
- return message.startsWith("vmsuspended");
- }
-}
diff --git a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAVMTerminatedEvent.java b/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAVMTerminatedEvent.java
deleted file mode 100644
index 348778625..000000000
--- a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAVMTerminatedEvent.java
+++ /dev/null
@@ -1,29 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009 Wind River Systems 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:
- * Wind River Systems - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.examples.core.pda.protocol;
-
-/**
- * Terminated event generated when the PDA program has ended execution.
- *
- * <pre>
- * E: termianted
- * </pre>
- */
-public class PDAVMTerminatedEvent extends PDAEvent {
-
- public PDAVMTerminatedEvent(String message) {
- super(message);
- }
-
- public static boolean isEventMessage(String message) {
- return message.startsWith("vmterminated");
- }
-}
diff --git a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAVarCommand.java b/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAVarCommand.java
deleted file mode 100644
index 5e2f34c03..000000000
--- a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAVarCommand.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2009 Wind River Systems 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:
- * Wind River Systems - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.examples.core.pda.protocol;
-
-
-/**
- * Return the contents of variable <code>variable_name</code> in the control
- * stack frame <code>frame_number</code> (stack frames are indexed from 0, 0
- * being the oldest).
- *
- * <pre>
- * C: var {thread_id} {frame_number} {variable_name}
- * R: {variable_value}
- *
- * Errors:
- * error: invalid thread
- * error: variable undefined
- * </pre>
- */
-
-public class PDAVarCommand extends PDACommand {
-
- public PDAVarCommand(int threadId, int frameId, String name) {
- super("var " + threadId + " " + frameId + " " + name);
- }
-
-
- public PDACommandResult createResult(String resultText) {
- return new PDACommandResult(resultText);
- }
-}
diff --git a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAWatchCommand.java b/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAWatchCommand.java
deleted file mode 100644
index 4bd8af72c..000000000
--- a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAWatchCommand.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2009 Wind River Systems 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:
- * Wind River Systems - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.examples.core.pda.protocol;
-
-
-/**
- * Set a watchpoint on variable <code>variable_name</code> in function
- * <code>function</code> to magic value <code>watch_operation</code>. The magic
- * value is a bit flag corresponding to read access (1), write access (2), or
- * both (3); the magic value 0 clears the watchpoint.
- *
- * <pre>
- * C: watch {function}::{variable_name} {watch_operation}
- * R: ok
- * C: vmresume
- * R: vmresumed client
- * E: vmsuspended {thread_id} watch {watch_operation} {function}::{variable_name}
- * </pre>
- */
-public class PDAWatchCommand extends PDACommand {
-
- public static final int READ = 1;
- public static final int WRITE = 2;
- public static final int BOTH = READ | WRITE;
- public static final int NONE = 0;
-
- public PDAWatchCommand(String function, String variable, int operation) {
- super("watch " + function+ "::" + variable + " " + operation);
- }
-
-
- public PDACommandResult createResult(String resultText) {
- return new PDACommandResult(resultText);
- }
-}
diff --git a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/package.html b/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/package.html
deleted file mode 100644
index 90bdaae51..000000000
--- a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/package.html
+++ /dev/null
@@ -1,99 +0,0 @@
-<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
-<html>
-
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
-<title>PDA Interpreter Debug Protocol</title>
-</head>
-
-<body bgcolor="#FFFFFF">
-
-<p>Provides classes representing PDA protocol commands, command results and events</p>
-
-<h2>Package Specification</h2>
-
-<h3>Virtual Machine execution control</h3>
-<h4>Commands</h4>
-<ul>
-<li>{@link PDATerminateCommand}</li>
-<li>{@link PDAVMSuspendCommand}</li>
-<li>{@link PDAVMResumeCommand}</li>
-<li>{@link PDAEventStopCommand}</li>
-</ul>
-<h4>Events</h4>
-<ul>
-<li>{@link PDAVMStarted}</li>
-<li>{@link PDAVMTerminated}</li>
-<li>{@link PDAVMSuspneded}</li>
-<li>{@link PDAVMResumed}</li>
-<li>{@link PDAUnimplementedInstructionEvent}</li>
-<li>{@link PDANoSuchLabelEvent}</li>
-</ul>
-
-<h3>Thread execution control</h3>
-<h4>Commands</h4>
-<ul>
-<li>{@link PDASuspendCommand}</li>
-<li>{@link PDAResumeCommand}</li>
-<li>{@link PDAStepCommand}</li>
-<li>{@link PDADropFrameCommand}</li>
-</ul>
-<h4>Events</h4>
-<ul>
-<li>{@link PDAStarted}</li>
-<li>{@link PDAExited}</li>
-<li>{@link PDASuspended}</li>
-<li>{@link PDAResumed}</li>
-</ul>
-
-<h3>Breakpoints</h3>
-<h4>Commands</h4>
-<ul>
-<li>{@link PDASetBreakpointCommand}</li>
-<li>{@link PDAClearBreakpointCommand}</li>
-<li>{@link PDAWatchCommand}</li>
-</ul>
-
-<h3>Data stack</h3>
-<h4>Commands</h4>
-<ul>
-<li>{@link PDADataCommand}</li>
-<li>{@link PDASetDataCommand}</li>
-<li>{@link PDAPopDataCommand}</li>
-<li>{@link PDAPushDataCommand}</li>
-</ul>
-
-<h3>Expression evaluation</h3>
-<h4>Commands</h4>
-<ul>
-<li>{@link PDAEvalCommand}</li>
-</ul>
-<h4>Events</h4>
-<ul>
-<li>{@link PDAEvalResultEvent}</li>
-</ul>
-
-<h3>Execution control stack</h3>
-<h4>Commands</h4>
-<ul>
-<li>{@link PDAStackCommand}</li>
-<li>{@link PDAStackDepthCommand}</li>
-<li>{@link PDAFrameCommand}</li>
-<li>{@link PDAVarCommand}</li>
-<li>{@link PDASetVarCommand}</li>
-<li>{@link PDAChildrenCommand}</li>
-</ul>
-
-<h3>Registers</h3>
-<h4>Commands</h4>
-<ul>
-<li>{@link PDAGroupsCommand}</li>
-<li>{@link PDARegistersCommand}</li>
-</ul>
-<h4>Events</h4>
-<ul>
-<li>{@link PDARegistersEvent}</li>
-</ul>
-
-</body>
-</html>
diff --git a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/sourcelookup/PDASourceLookupDirector.java b/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/sourcelookup/PDASourceLookupDirector.java
deleted file mode 100644
index f975cf7c3..000000000
--- a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/sourcelookup/PDASourceLookupDirector.java
+++ /dev/null
@@ -1,32 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2007 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
- * Bjorn Freeman-Benson - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.examples.core.pda.sourcelookup;
-
-import org.eclipse.debug.core.sourcelookup.AbstractSourceLookupDirector;
-import org.eclipse.debug.core.sourcelookup.ISourceLookupParticipant;
-
-/**
- * PDA source lookup director. For PDA source lookup there is one source
- * lookup participant.
- */
-public class PDASourceLookupDirector extends AbstractSourceLookupDirector {
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.core.sourcelookup.ISourceLookupDirector#initializeParticipants()
- */
- public void initializeParticipants() {
- //#ifdef ex4
-//# // TODO: Exercise 4 - add our participant to this director
- //#else
- addParticipants(new ISourceLookupParticipant[]{new PDASourceLookupParticipant()});
- //#endif
- }
-}
diff --git a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/sourcelookup/PDASourceLookupParticipant.java b/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/sourcelookup/PDASourceLookupParticipant.java
deleted file mode 100644
index 0d07ce78d..000000000
--- a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/sourcelookup/PDASourceLookupParticipant.java
+++ /dev/null
@@ -1,38 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2007 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
- * Bjorn Freeman-Benson - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.examples.core.pda.sourcelookup;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.debug.core.sourcelookup.AbstractSourceLookupParticipant;
-import org.eclipse.debug.examples.core.pda.model.PDAStackFrame;
-
-
-/**
- * The PDA source lookup participant knows how to translate a
- * PDA stack frame into a source file name
- */
-public class PDASourceLookupParticipant extends AbstractSourceLookupParticipant {
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.core.sourcelookup.ISourceLookupParticipant#getSourceName(java.lang.Object)
- */
- public String getSourceName(Object object) throws CoreException {
- //#ifdef ex4
-//# // TODO: Exercise 4 - return the name of the source file for the given stack frame
-//# return null;
- //#else
- if (object instanceof PDAStackFrame) {
- return ((PDAStackFrame)object).getSourceName();
- }
- return null;
- //#endif
- }
-}
diff --git a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/sourcelookup/PDASourcePathComputerDelegate.java b/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/sourcelookup/PDASourcePathComputerDelegate.java
deleted file mode 100644
index d91b3f245..000000000
--- a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/sourcelookup/PDASourcePathComputerDelegate.java
+++ /dev/null
@@ -1,65 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2007 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
- * Bjorn Freeman-Benson - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.examples.core.pda.sourcelookup;
-
-import org.eclipse.core.resources.IContainer;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.debug.core.ILaunchConfiguration;
-import org.eclipse.debug.core.sourcelookup.ISourceContainer;
-import org.eclipse.debug.core.sourcelookup.ISourcePathComputerDelegate;
-import org.eclipse.debug.core.sourcelookup.containers.FolderSourceContainer;
-import org.eclipse.debug.core.sourcelookup.containers.ProjectSourceContainer;
-import org.eclipse.debug.core.sourcelookup.containers.WorkspaceSourceContainer;
-import org.eclipse.debug.examples.core.pda.DebugCorePlugin;
-
-
-/**
- * Computes the default source lookup path for a PDA launch configuration.
- * The default source lookup path is the folder or project containing
- * the PDA program being launched. If the program is not specified, the workspace
- * is searched by default.
- */
-public class PDASourcePathComputerDelegate implements ISourcePathComputerDelegate {
-
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.core.sourcelookup.ISourcePathComputerDelegate#computeSourceContainers(org.eclipse.debug.core.ILaunchConfiguration, org.eclipse.core.runtime.IProgressMonitor)
- */
- public ISourceContainer[] computeSourceContainers(ILaunchConfiguration configuration, IProgressMonitor monitor) throws CoreException {
- String path = configuration.getAttribute(DebugCorePlugin.ATTR_PDA_PROGRAM, (String)null);
- ISourceContainer sourceContainer = null;
- if (path != null) {
- IResource resource = ResourcesPlugin.getWorkspace().getRoot().findMember(new Path(path));
- if (resource != null) {
- //#ifdef ex4
-//# // TODO: Exercise 4 - seed the source lookup path
- //#else
- IContainer container = resource.getParent();
- if (container.getType() == IResource.PROJECT) {
- sourceContainer = new ProjectSourceContainer((IProject)container, false);
- } else if (container.getType() == IResource.FOLDER) {
- sourceContainer = new FolderSourceContainer(container, false);
- }
- //#endif
- }
- }
- if (sourceContainer == null) {
- sourceContainer = new WorkspaceSourceContainer();
- }
- return new ISourceContainer[]{sourceContainer};
- }
-}
diff --git a/org.eclipse.debug.examples.core/src_ant/org/eclipse/debug/examples/ant/tasks/PreProcessor.java b/org.eclipse.debug.examples.core/src_ant/org/eclipse/debug/examples/ant/tasks/PreProcessor.java
deleted file mode 100644
index 59baccb85..000000000
--- a/org.eclipse.debug.examples.core/src_ant/org/eclipse/debug/examples/ant/tasks/PreProcessor.java
+++ /dev/null
@@ -1,295 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2008 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
- * Bjorn Freeman-Benson - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.examples.ant.tasks;
-
-import java.io.BufferedReader;
-import java.io.File;
-import java.io.FileReader;
-import java.io.FileWriter;
-import java.io.IOException;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.Set;
-import java.util.Vector;
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
-
-import org.apache.tools.ant.BuildException;
-import org.apache.tools.ant.DirectoryScanner;
-import org.apache.tools.ant.Task;
-import org.apache.tools.ant.types.FileSet;
-import org.apache.tools.ant.util.FileUtils;
-
-/**
- * Java preprocessor for code examples. Used to export source code for
- * example plug-ins with parts of code missing/inserted etc., for
- * various exercises.
- * <p>
- * The preprocessor looks for #ifdef statements in java comments, and is
- * run with a set of symbols. For example:
- * <pre>
- * //#ifdef ex1
- * ... code to insert when 'ex1' symbol is on
- * //#else
- * ... code to insert when not 'ex1'
- * //#endif
- * </pre>
- * </p>
- */
-public class PreProcessor extends Task {
-
- private Vector fFileSets = new Vector();
- private File fDestDir = null;
- private Set fSymbols = new HashSet();
- private FileUtils fUtils = FileUtils.getFileUtils();
-
- // possible states
- private static final int STATE_OUTSIDE_CONDITION = 0;
- private static final int STATE_TRUE_CONDITION = 1;
- private static final int STATE_FALSE_CONDITION = 2;
- private static final int STATE_POST_TRUE_CONDITION = 3;
-
- // matchers
- private Matcher IF_DEF_MATCHER = Pattern.compile("#ifdef\\s+\\w+").matcher("");
- private Matcher ELSE_IF_MATCHER = Pattern.compile("#elseif\\s+\\w+").matcher("");
- private Matcher ELSE_MATCHER = Pattern.compile("#else$|#else\\W+").matcher("");
- private Matcher END_MATCHER = Pattern.compile("#endif").matcher("");
-
-
- /**
- * Constructs a new preprocessor task
- */
- public PreProcessor() {
- }
-
- /**
- * Adds a set of files to process.
- *
- * @param set a set of files to process
- */
- public void addFileset(FileSet set) {
- fFileSets.addElement(set);
- }
-
- /**
- * Sets the destination directory for processed files.
- *
- * @param destDir destination directory for processed files
- */
- public void setDestdir(File destDir) {
- fDestDir = destDir;
- }
-
- /**
- * Sets the symbols that are "on" for the preprocessing.
- *
- * @param symbols symbols that are "on" for the preprocessing
- */
- public void setSymbols(String symbols) {
- String[] strings = symbols.split(",");
- for (int i = 0; i < strings.length; i++) {
- String string = strings[i].trim();
- if (string.length() > 0) {
- fSymbols.add(string);
- }
- }
- }
-
- public void execute() throws BuildException {
- if (fSymbols.size() == 0) {
- throw new BuildException("No symbols specified for preprocessor");
- }
- if (fFileSets.isEmpty()) {
- throw new BuildException("No filesets specified for processing");
- }
- if (!fDestDir.exists()) {
- throw new BuildException("destdir does not exist: " + fDestDir.getAbsolutePath());
- }
- StringBuffer buf = new StringBuffer("Symbols: ");
- String[] symbols = (String[]) fSymbols.toArray(new String[fSymbols.size()]);
- for (int i = 0; i < symbols.length; i++) {
- String symbol = symbols[i];
- buf.append(symbol);
- if(i < (symbols.length -1)) {
- buf.append(", ");
- }
- }
- log(buf.toString());
-
- Iterator fileSets = fFileSets.iterator();
- while (fileSets.hasNext()) {
- FileSet fileSet = (FileSet) fileSets.next();
- DirectoryScanner scanner = fileSet.getDirectoryScanner(getProject());
- String[] includedFiles = scanner.getIncludedFiles();
- File baseDir = fileSet.getDir(getProject());
- for (int i = 0; i < includedFiles.length; i++) {
- String fileName = includedFiles[i];
- processFile(baseDir, fileName, fDestDir);
- }
- }
-
- }
-
- /**
- * Process the file
- * @param baseDir base directory source file is relative to
- * @param fileName source file name
- * @param destDir root destination directory
- */
- private void processFile(File baseDir, String fileName, File destDir) throws BuildException {
- File destFile = new File(destDir, fileName);
- File srcFile = new File(baseDir, fileName);
- File dir = destFile.getParentFile();
- if (!dir.exists()) {
- dir.mkdirs();
- }
- String contents = null;
- if (fileName.endsWith(".java")) {
- contents = preProcessFile(srcFile, "//#");
- } else if (fileName.equals("plugin.xml")) {
- contents = preProcessFile(srcFile, null);
- }
- if (contents == null) {
- // no change, just copy file
- try {
- fUtils.copyFile(srcFile, destFile);
- } catch (IOException e) {
- throw new BuildException(e);
- }
- } else {
- // write new file
- FileWriter writer;
- try {
- writer = new FileWriter(destFile);
- writer.write(contents);
- writer.close();
- } catch (IOException e) {
- throw new BuildException(e);
- }
-
- }
- }
-
- /**
- * Preprocesses a file
- *
- * @param srcFile the file to process
- * @param strip chars to stip off lines in a true condition, or <code>null</code>
- * @return
- */
- public String preProcessFile(File srcFile, String strip) {
- try {
- FileReader fileReader = new FileReader(srcFile);
- BufferedReader reader = new BufferedReader(fileReader);
- StringBuffer buffer = new StringBuffer();
- String line = reader.readLine();
- String activeSymbol = null;
- int state = STATE_OUTSIDE_CONDITION;
- boolean changed = false;
- while (line != null) {
- boolean ifdef = IF_DEF_MATCHER.reset(line).find();
- boolean elseif = ELSE_IF_MATCHER.reset(line).find();
- boolean elze = ELSE_MATCHER.reset(line).find();
- boolean endif = END_MATCHER.reset(line).find();
- boolean commandLine = ifdef || elseif || elze || endif;
- boolean written = false;
- switch (state) {
- case STATE_OUTSIDE_CONDITION:
- if (ifdef) {
- String condition = line.substring(IF_DEF_MATCHER.start(), IF_DEF_MATCHER.end());
- String[] strings = condition.split("\\s+");
- activeSymbol = strings[1].trim();
- if (fSymbols.contains(activeSymbol)) {
- state = STATE_TRUE_CONDITION;
- } else {
- state = STATE_FALSE_CONDITION;
- }
- } else if (elseif) {
- throw new BuildException("#elseif encountered without corresponding #ifdef");
- } else if (elze) {
- throw new BuildException("#else encountered without corresponding #ifdef (" + srcFile.getPath() + ")");
- } else if (endif) {
- throw new BuildException("#endif encountered without corresponding #ifdef");
- }
- break;
- case STATE_TRUE_CONDITION:
- if (elze || elseif) {
- state = STATE_POST_TRUE_CONDITION;
- break;
- } else if (endif) {
- state = STATE_OUTSIDE_CONDITION;
- break;
- } else if (ifdef) {
- throw new BuildException("illegal nested #ifdef");
- }
- break;
- case STATE_FALSE_CONDITION:
- if (elseif) {
- String condition = line.substring(ELSE_IF_MATCHER.start(), ELSE_IF_MATCHER.end());
- String[] strings = condition.split("\\s+");
- activeSymbol = strings[1].trim();
- if (fSymbols.contains(activeSymbol)) {
- state = STATE_TRUE_CONDITION;
- } else {
- state = STATE_FALSE_CONDITION;
- }
- } else if (elze) {
- state = STATE_TRUE_CONDITION;
- break;
- } else if (endif) {
- state = STATE_OUTSIDE_CONDITION;
- break;
- } else if (ifdef) {
- throw new BuildException("illegal nested #ifdef");
- }
- break;
- case STATE_POST_TRUE_CONDITION:
- if (endif) {
- state = STATE_OUTSIDE_CONDITION;
- break;
- } else if (ifdef) {
- throw new BuildException("illegal nested #ifdef");
- }
- break;
- }
- if (!commandLine) {
- if (state == STATE_OUTSIDE_CONDITION || state == STATE_TRUE_CONDITION) {
- if (state == STATE_TRUE_CONDITION && strip != null) {
- if (line.startsWith(strip)) {
- line = line.substring(strip.length());
- }
- }
- buffer.append(line);
- buffer.append("\n");
- written = true;
- }
- }
- changed = changed || !written;
- line = reader.readLine();
- }
- if (!changed) {
- return null;
- }
- return buffer.toString();
- } catch (IOException e) {
- throw new BuildException(e);
- }
- }
-
- public static void main(String[] args) {
- PreProcessor processor = new PreProcessor();
- processor.setSymbols("ex2");
- String string = processor.preProcessFile(new File("c:\\eclipse3.1\\dev\\example.debug.core\\src\\example\\debug\\core\\launcher\\PDALaunchDelegate.java"), "//#");
- //String string = processor.preProcessFile(new File("c:\\eclipse3.1\\dev\\example.debug.core\\plugin.xml"), null);
- System.out.println(string);
- }
-}

Back to the top