Skip to content

Commit 6b334aa

Browse files
committed
Merge pull request processing#1636 from Manindra29/jdiMod
Moving on to eclipse jdi, getting rid of tools.jar dependency
2 parents 0650738 + 4dfc525 commit 6b334aa

File tree

14 files changed

+47
-19
lines changed

14 files changed

+47
-19
lines changed

app/.classpath

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,5 +21,9 @@
2121
<classpathentry kind="lib" path="lib/apple.jar"/>
2222
<classpathentry kind="lib" path="test/lib/junit-4.8.1.jar"/>
2323
<classpathentry kind="lib" path="lib/org-netbeans-swing-outline.jar"/>
24+
<classpathentry kind="lib" path="lib/com.ibm.icu_4.4.2.v20110823.jar"/>
25+
<classpathentry kind="lib" path="lib/jdi.jar"/>
26+
<classpathentry kind="lib" path="lib/jdimodel.jar"/>
27+
<classpathentry kind="lib" path="lib/org.eclipse.osgi_3.8.1.v20120830-144521.jar"/>
2428
<classpathentry kind="output" path="bin"/>
2529
</classpath>

app/build.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@
116116
excludes="**/tools/format/**"
117117
encoding="UTF-8"
118118
includeAntRuntime="false"
119-
classpath="../core/library/core.jar; ${env.JAVA_HOME}/lib/tools.jar; lib/ant.jar; lib/ant-launcher.jar; lib/antlr.jar; lib/apple.jar; lib/jdt-core.jar; lib/jna.jar; lib/org-netbeans-swing-outline.jar"
119+
classpath="../core/library/core.jar; lib/ant.jar; lib/ant-launcher.jar; lib/antlr.jar; lib/apple.jar; lib/jdt-core.jar; lib/jna.jar; lib/org-netbeans-swing-outline.jar;lib/com.ibm.icu_4.4.2.v20110823.jar;lib/jdi.jar;lib/jdimodel.jar;lib/org.eclipse.osgi_3.8.1.v20120830-144521.jar"
120120
debug="on">
121121
<src path="src" />
122122
<src path="generated" />
6.39 MB
Binary file not shown.

app/lib/jdi.jar

69.3 KB
Binary file not shown.

app/lib/jdimodel.jar

842 KB
Binary file not shown.
1.33 MB
Binary file not shown.

app/src/processing/mode/java/runner/EventThread.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -363,7 +363,9 @@ private void exceptionEvent(ExceptionEvent event) {
363363
// com.sun.jdi.ObjectReference or = event.exception();
364364
// System.out.println("exceptionEvent() fired " + or);
365365
// System.out.println("catch location " + event.catchLocation());
366-
366+
for (ThreadReference thread : vm.allThreads()) {
367+
thread.suspend();
368+
}
367369
parent.exception(event);
368370

369371
/*

app/src/processing/mode/java/runner/Runner.java

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -290,8 +290,7 @@ protected String[] getSketchParams() {
290290
}
291291

292292
params.add(PApplet.ARGS_DISPLAY + "=" + runDisplay);
293-
params.add(PApplet.ARGS_SKETCH_FOLDER + "=" +
294-
build.getSketchPath());
293+
295294

296295
if (presenting) {
297296
params.add(PApplet.ARGS_FULL_SCREEN);
@@ -305,6 +304,10 @@ protected String[] getSketchParams() {
305304
}
306305

307306
params.add(build.getSketchClassName());
307+
params.add(PApplet.ARGS_SKETCH_FOLDER + "=" +
308+
build.getSketchPath());
309+
// Adding sketch path in the end coz it's likely to
310+
// contain spaces and things go wrong on UNIX systems.
308311
}
309312

310313
// String outgoing[] = new String[params.size()];
@@ -329,16 +332,13 @@ protected VirtualMachine launchVirtualMachine(String[] vmParams,
329332
// Using localhost instead of 127.0.0.1 sometimes causes a
330333
// "Transport Error 202" error message when trying to run.
331334
// http://dev.processing.org/bugs/show_bug.cgi?id=895
332-
String addr = "127.0.0.1:" + (8000 + (int) (Math.random() * 1000));
335+
// String addr = "127.0.0.1:" + (8000 + (int) (Math.random() * 1000));
333336
//String addr = "localhost:" + (8000 + (int) (Math.random() * 1000));
334-
//String addr = "" + (8000 + (int) (Math.random() * 1000));
337+
String addr = "" + (8000 + (int) (Math.random() * 1000));
335338

336339
String commandArgs =
337340
"java -Xrunjdwp:transport=dt_socket,address=" + addr + ",suspend=y ";
338-
if (Base.isWindows()) {
339-
commandArgs =
340-
"java -Xrunjdwp:transport=dt_shmem,address=" + addr + ",suspend=y ";
341-
} else if (Base.isMacOS()) {
341+
if (Base.isMacOS()) {
342342
// Decided to just set this to 1.6 only, because otherwise it's gonna
343343
// be a shitshow if folks are getting Apple's 1.6 with 32-bit and
344344
// Oracle's 1.7 when run in 64-bit mode. ("Why does my sketch suck in
@@ -484,7 +484,7 @@ protected void generateTrace(PrintWriter writer) {
484484
//if (writer != null) {
485485
eventThread = new EventThread(this, vm, excludes, writer);
486486
eventThread.start();
487-
eventThread.setEventRequests(watchFields);
487+
//eventThread.setEventRequests(watchFields); //redundant?
488488
//}
489489

490490
//redirectOutput();
@@ -538,9 +538,9 @@ protected void generateTrace(PrintWriter writer) {
538538

539539

540540
protected Connector findConnector(String connectorName) {
541-
List connectors = Bootstrap.virtualMachineManager().allConnectors();
542-
// List connectors =
543-
// org.eclipse.jdi.Bootstrap.virtualMachineManager().allConnectors();
541+
// List connectors = Bootstrap.virtualMachineManager().allConnectors();
542+
List connectors =
543+
org.eclipse.jdi.Bootstrap.virtualMachineManager().allConnectors();
544544

545545
// debug: code to list available connectors
546546
// Iterator iter2 = connectors.iterator();

build/build.xml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,10 @@
7575
<include name="app/lib/ant.jar" />
7676
<include name="app/lib/ant-launcher.jar" />
7777
<include name="app/lib/org-netbeans-swing-outline.jar" />
78+
<include name="app/lib/jdi.jar" />
79+
<include name="app/lib/jdimodel.jar" />
80+
<include name="app/lib/org.eclipse.osgi_3.8.1.v20120830-144521.jar" />
81+
<include name="app/lib/com.ibm.icu_4.4.2.v20110823.jar" />
7882
</fileset>
7983

8084
<target name="build" description="Build Processing.">

build/linux/processing

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717

1818

1919
# JARs required from JDK (anywhere in/below the JDK home directory)
20-
JDKLIBS="rt.jar tools.jar"
20+
JDKLIBS="rt.jar"
2121

2222
# Set this to non-zero for logging
2323
LOGGING=0

0 commit comments

Comments
 (0)