Hi,

I've committed the attached patch which addresses one bug and something that has just been plain irritating me:

1) The bug: gnu.classpath.jdwp.event.ThreadStartEvent was mistakenly using THREAD_END for event notifications. This really confuses Eclipse. :-) Thanks to Kyle Galloway for catching that.

2) I've made the address handling of gnu.classpath.jdwp.transport.SocketTransport a little more robust. Previously, we were really only handling "server=n" cases. I've now added handling for address specifications of ":port" and "port" (in addition to "host:port", which we already support). Now someone can say something like "transport=dt_socket,address=12345" and it will assume "localhost".

[Whoops. And I foobar'd the checkin by checking in the wrong SocketTransport patch... Grr. Multiple repositories... I've attached
the diff with the final/real version.]

Keith

ChangeLog
2007-03-29  Keith Seitz  <[EMAIL PROTECTED]>

        * 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;
   }
 

Reply via email to