This is the mail archive of the
java-patches@gcc.gnu.org
mailing list for the Java project.
[RFA] JDWP SocketTransport tweak and ThreadStartEvent typo
- From: Keith Seitz <keiths at redhat dot com>
- To: Java Patch List <java-patches at gcc dot gnu dot org>
- Date: Thu, 29 Mar 2007 17:16:29 -0800
- Subject: [RFA] JDWP SocketTransport tweak and ThreadStartEvent typo
Hi,
I just committed these two patches upstream. One fixes a (not so small)
typo in ThreadStartEvent which caused it to be reported to debuggers as
a ThreadEndEvent (which really confuses eclipse); the other is adds
support for specifying the "address=" part of "-Xrunjdwp" as
"portNumber" or ":portNumber" (in addition to the already supported
"host:portNumber").
Ok?
Keith
classpath/ChangeLog
2007-03-29 Keith Seitz <keiths@redhat.com>
* gnu/classpath/jdwp/event/ThreadStartEvent.java (Event):
Event type is "THREAD_START" not "THERAD_END".
* gnu/classpath/jdwp/transport/SocketTransport.java (ITransport):
Handle configure strings ":port" and "port".
Index: gnu/classpath/jdwp/transport/SocketTransport.java
===================================================================
RCS file: /sources/classpath/classpath/gnu/classpath/jdwp/transport/SocketTransport.java,v
retrieving revision 1.3
retrieving revision 1.5
diff -u -p -r1.3 -r1.5
--- gnu/classpath/jdwp/transport/SocketTransport.java 3 Sep 2005 00:22:30 -0000 1.3
+++ gnu/classpath/jdwp/transport/SocketTransport.java 30 Mar 2007 00:05:24 -0000 1.5
@@ -1,5 +1,5 @@
/* SocketTransport.java -- a socket transport
- Copyright (C) 2005 Free Software Foundation
+ Copyright (C) 2005, 2007 Free Software Foundation
This file is part of GNU Classpath.
@@ -89,27 +89,36 @@ class SocketTransport
* @param properties the properties of the JDWP session
* @throws TransportException for any configury errors
*/
- public void configure (HashMap properties)
+ public void configure(HashMap properties)
throws TransportException
{
- // Get address [form: "hostname:port"]
- String p = (String) properties.get (_PROPERTY_ADDRESS);
+ // Get server [form: "y" or "n"]
+ String p = (String) properties.get(_PROPERTY_SERVER);
if (p != null)
{
- String[] s = p.split (":");
- if (s.length == 2)
- {
- _host = s[0];
- _port = Integer.parseInt (s[1]);
- }
+ if (p.toLowerCase().equals("y"))
+ _server = true;
}
- // Get server [form: "y" or "n"]
- p = (String) properties.get (_PROPERTY_SERVER);
+ // Get address [form: "hostname:port"]
+ p = (String) properties.get(_PROPERTY_ADDRESS);
if (p != null)
{
- if (p.toLowerCase().equals ("y"))
- _server = true;
+ String[] s = p.split(":");
+ if (s.length == 1)
+ {
+ // Port number only. Assume "localhost"
+ _port = Integer.parseInt(s[0]);
+ _host = "localhost";
+ }
+ else
+ {
+ if (s[0].length() == 0)
+ _host = "localhost";
+ else
+ _host = s[0];
+ _port = Integer.parseInt(s[1]);
+ }
}
}
Index: gnu/classpath/jdwp/event/ThreadStartEvent.java
===================================================================
RCS file: /sources/classpath/classpath/gnu/classpath/jdwp/event/ThreadStartEvent.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -p -r1.3 -r1.4
--- gnu/classpath/jdwp/event/ThreadStartEvent.java 12 Jun 2006 19:43:26 -0000 1.3
+++ gnu/classpath/jdwp/event/ThreadStartEvent.java 29 Mar 2007 23:49:49 -0000 1.4
@@ -1,6 +1,6 @@
/* ThreadStartEvent.java -- An event specifying that a new thread
has started in the virtual machine
- Copyright (C) 2005 Free Software Foundation
+ Copyright (C) 2005, 2007 Free Software Foundation
This file is part of GNU Classpath.
@@ -75,7 +75,7 @@ public class ThreadStartEvent
* @param thread the thread ID in which event occurred
*/
public ThreadStartEvent (Thread thread) {
- super (JdwpConstants.EventKind.THREAD_END);
+ super (JdwpConstants.EventKind.THREAD_START);
_thread = thread;
}