This is the mail archive of the java-patches@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[RFA] Merge upstream classpath JDWP


Hi,

Since Kyle and I have been making numerous tweaks and additions to the upstream classpath JDWP (and much of that seems to be "finished" for now), I'd like to merge that work into gcj so that we can start using it.

I've completed the merge, updated files, etc. It goes without saying that the changes are substantially long (and mostly redundant). So I don't think I'm going to show any patch (if you want it, just ask). I have, however, attached a patch for the non-classpath updates that were needed. Most of these are simple enough.

I've simply used the standard merge changelog entry for classpath/ChangeLog. Perhaps I should just merge the ChangeLog entries in place?

There is also a small tweak or two to natVMVirtualMachine.cc. Explained in ChangeLog, patch is attached.

Keith

ChangeLog
2007-03-20  Keith Seitz  <keiths@redhat.com>

        * gnu/classpath/jdwp/VMFrame.java: Update from upstream
        classpath.
        * gnu/classpath/jdwp/natVMFrame.cc: Likewise.
        * gnu/classpath/jdwp/VMVirtualMachine.java: Likewise.
        * gnu/classpath/jdwp/natVMVirtualMachine.cc: Likewise.
        (initialize): Fix compiler type-punning warning.
        (getAllLoadedClasses): Return empty list instead of NULL.
        (getLoadRequests): Likewise.
        * gnu/classpath/jdwp/exception/InvalidTagException.h: New file.
        * gnu/classpath/jdwp/exception/InvalidSlotException.h: New file.
        * gnu/classpath/jdwp/exception/TypeMismatchException.h: New file.
        * gnu/classpath/jdwp/VMVirtualMachine.h: Rebuilt.
        * gnu/classpath/jdwp/value/CharValue.h: New file.
        * gnu/classpath/jdwp/value/LongValue.h: New file.
        * gnu/classpath/jdwp/value/ShortValue.h: New file.
        * gnu/classpath/jdwp/value/Value.h: New file.
        * gnu/classpath/jdwp/value/BooleanValue.h: New file.
        * gnu/classpath/jdwp/value/VoidValue.h: New file.
        * gnu/classpath/jdwp/value/ByteValue.h: New file.
        * gnu/classpath/jdwp/value/FloatValue.h: New file.
        * gnu/classpath/jdwp/value/ObjectValue.h: New file.
        * gnu/classpath/jdwp/value/StringValue.h: New file.
        * gnu/classpath/jdwp/value/ValueFactory.h: New file.
        * gnu/classpath/jdwp/value/IntValue.h: New file.
        * gnu/classpath/jdwp/value/DoubleValue.h: New file.
        * gnu/classpath/jdwp/VMFrame.h: Rebuilt.
        * gnu/classpath/jdwp/id/NullObjectId.h: New file.
        * gnu/classpath/jdwp/util/MethodResult.h: Rebuilt.
        * gnu/classpath/jdwp/util/NullObject.h: New file.
        * gnu/classpath/jdwp/util/MonitorInfo.h: New file.
        * Makefile.in: Rebuilt.
        * sources.am: Rebuilt.


classpath/ChangeLog 2007-03-20 Keith Seitz <keiths@redhat.com>

        Merged from upstream:
        2007-03-09  Kyle Galloway  <kgallowa@redhat.com>
        * gnu/classpath/jdwp/exception/InvalidTagException.java: New file.
        * gnu/classpath/jdwp/processor/ArrayReferenceCommandSet.java
        (executeGetValues): Use Value type.
        (exectureSetValues): Ditto.
        * gnu/classpath/jdwp/processor/ClassTypeCommandSet.java
        (executeGetValues): Use Value type.
        (executeSetValues): Ditto.
        (invokeMethod): Record method return type.
        * gnu/classpath/jdwp/processor/ObjectReferenceCommandSet.java
        (executeGetValues): Use Value type.
        (executeSetValues): Ditto.
        * gnu/classpath/jdwp/processor/ReferenceTypeCommandSet.java
        (executeGetValues): Use Value type.
        * gnu/classpath/jdwp/processor/StackFrameCommandSet.java
        (executeGetValues): Use Value type.
        (executeSetValues): Ditto.
        * gnu/classpath/jdwp/util/MethodResult.java: Add resType to store
        return type.
        (getResultType): New Method.
        (setResultType): Ditto.
        * gnu/classpath/jdwp/util/Value.java: Remove.
        * gnu/classpath/jdwp/value: New Package.
        * gnu/classpath/jdwp/value/Value.java: New file.
        * gnu/classpath/jdwp/value/BooleanValue.java: New file.
        * gnu/classpath/jdwp/value/ByteValue.java: New file.
        * gnu/classpath/jdwp/value/CharValue.java: New file.
        * gnu/classpath/jdwp/value/DoubleValue.java: New file.
        * gnu/classpath/jdwp/value/FloatValue.java: New file.
        * gnu/classpath/jdwp/value/IntValue.java: New file.
        * gnu/classpath/jdwp/value/LongValue.java: New file.
        * gnu/classpath/jdwp/value/ObjectValue.java: New file.
        * gnu/classpath/jdwp/value/ShortValue.java: New file.
        * gnu/classpath/jdwp/value/StringValue.java: New file.
        * gnu/classpath/jdwp/value/ValueFactory.java: New file.
        * gnu/classpath/jdwp/value/VoidValue.java: New file.

        2007-02-28  Keith Seitz  <keiths@redhat.com>
        * gnu/classpath/jdwp/processor/EventRequestCommandSet.java
        (executeSet): Check if VM has capability for field access
        or modification events.
        * gnu/classpath/jdwp/processor/MethodCommandSet.java
        (executeByteCodes): Check if VM has capability and
        implement.
        * gnu/classpath/jdwp/processor/ObjectReferenceCommandSet.java
        (executeMonitorInfo): Likewise.
        * gnu/classpath/jdwp/processor/ReferenceTypeCommandSet.java
        (executeSourceDebugExtension): Likewise.
        * gnu/classpath/jdwp/processor/StackFrameCommandSet.java
        (executePopFrames): Likewise.
        * gnu/classpath/jdwp/processor/ThreadReferenceCommandSet.java
        (executeOwnedMonitors): Likewise.
        (executeCurrentContendedMonitor): Likewise.
        * gnu/classpath/jdwp/processor/VirtualMachineCommandSet.java
        (executeCapabilities): Rewrite using new VMVirtualMachine
        capabilities.
        (executeRedefineClasses): Check if VM has capability and
        implement.
        (executeSetDefaultStratum): Likewise.
        * gnu/classpath/jdwp/util/MonitorInfo.java; New file.
        * vm/reference/gnu/classpath/jdwp/VMVirtualMachine.java
        (canWatchFieldModification): New class constant.
        (canWatchFieldAccess): Likewise.
        (canGetBytecodes): Likewise.
        (canGetSyntheticAttribute): Likewise.
        (canGetOwnedMonitorInfo): Likewise.
        (canGetCurrentContendedMonitor): Likewise.
        (canGetMonitorInfo): Likewise.
        (canRedefineClasses): Likewise.
        (canAddMethod): Likewise.
        (canUnrestrictedlyRedefineClasses): Likewise.
        (canPopFrames): Likewise.
        (canUseInstanceFilters): Likewise.
        (canGetSourceDebugExtension): Likewise.
        (canRequestVMDeathEvent): Likewise.
        (canSetDefaultStratum): Likewise.
        (redefineClasses): New method.
        (setDefaultStratum): Likewise.
        (getSourceDebugExtension): Likewise.
        (getBytecodes): Likewise.
        (getMonitorInfo): Likewise.
        (getOwnedMonitors): Likewise.
        (getCurrentContendedMonitor): Likewise.
        (popFrames): Likewise.

        2007-02-28  Keith Seitz  <keiths@redhat.com>
        * gnu/classpath/jdwp/processor/MethodCommandSet.java
        (executeLineTable): Use ReferenceTypeId instead of
        ClassReferenceTypeId.
        (executeVariableTable): Likewise.
        (executeVariableTableWithGeneric): Fix error message.
        * gnu/classpath/jdwp/processor/ReferenceTypeCommandSet.java
        (executeSignatureWithGeneric): Fix error message.
        (executeFieldWithGeneric): Likewise.
        (executeMethodsWithGeneric): Likewise.
        * gnu/classpath/jdwp/processor/StackFrameCommandSet.java
        (executeGetValues): Use ThreadId instead of ObjectId.
        (executeSetValues): Likewise.
        (executeThisObject): Likewise.

        2007-02-28  Kyle Galloway  <kgallowa@redhat.com>
        * gnu/classpath/jdwp/id/NullObjectId.java: New class.
        * gnu/classpath/jdwp/util/NullObject.java: New class.
        * vm/reference/gnu/classpath/jdwp/VMIdManager.java
        (getObjectId): Handle null object.
        (get): Handle objectId of 0.

        2007-02-22  Keith Seitz  <keiths@redhat.ecom>
        * vm/reference/gnu/classpath/jdwp/VMVirtualMachine.java
        (getAllLoadedClassesCount): Remove.
        (getAllLoadedClasses): Return a Collection.
        * gnu/classpath/jdwp/processor/VirtualMachineCommandSet.java
        (executeClassesBySignature): VMVirtualMachine.getAllLoadedClasses
        now returns Collection.
        (executeAllClasses): Likewise.
        Get size of return from Colleciton instead of calling
        getAllLoadedClassesCount.

        2007-02-22  Kyle Galloway  <kgallowa@redhat.com>
        * gnu/classpath/jdwp/processor/StackFrameCommandSet.java
        (executeGetValues): Pass a signature byte to VMFrame.getValue.
        * vm/reference/gnu/classpath/jdwp/VMFrame.java (getValue): Add
        signature parameter.

2007-02-02 Kyle Galloway <kgallowa@redhat.com>
* gnu/classpath/jdwp/processor/StackFrameCommandSet.java
(executeGetValues): Changed getFrame to use a jlong to pass frameID.
(executeSetValues): Ditto.
(executeThisObject): Ditto.
* vm/reference/gnu/classpath/jdwp/VMFrame.java: Added thread field
and a constructor used to create VMFrames.
(getThread): New method.
* vm/reference/gnu/classpath/jdwp/VMVirtualMachine.java(getFrame):
Changed to take a long instead of a ByteBuffer to pass the frameID.


        2007-01-15  Kyle Galloway  <kgallowa@redhat.com>
        * gnu/classpath/jdwp/exception/InvalidSlotException.java: New file.

Index: gnu/classpath/jdwp/natVMFrame.cc
===================================================================
--- gnu/classpath/jdwp/natVMFrame.cc	(revision 123069)
+++ gnu/classpath/jdwp/natVMFrame.cc	(working copy)
@@ -12,17 +12,19 @@
 #include <jvm.h>
 
 #include <gnu/classpath/jdwp/VMFrame.h>
+#include <gnu/classpath/jdwp/value/Value.h>
 
 using namespace java::lang;
 
-Object*
-gnu::classpath::jdwp::VMFrame::getValue (MAYBE_UNUSED jint slot)
+gnu::classpath::jdwp::value::Value *
+gnu::classpath::jdwp::VMFrame::getValue (MAYBE_UNUSED jint slot,
+					 MAYBE_UNUSED jbyte tag)
 {
   return 0;
 }
 
 void
 gnu::classpath::jdwp::VMFrame::setValue (MAYBE_UNUSED jint slot,
-					 MAYBE_UNUSED Object* value)
+					 MAYBE_UNUSED gnu::classpath::jdwp::value::Value *value)
 {
 }
Index: gnu/classpath/jdwp/natVMVirtualMachine.cc
===================================================================
--- gnu/classpath/jdwp/natVMVirtualMachine.cc	(revision 123069)
+++ gnu/classpath/jdwp/natVMVirtualMachine.cc	(working copy)
@@ -111,7 +111,13 @@
   _stepping_threads = new ::java::util::Hashtable ();
 
   JavaVM *vm = _Jv_GetJavaVM ();
-  vm->GetEnv (reinterpret_cast<void **> (&_jdwp_jvmtiEnv), JVMTI_VERSION_1_0);
+  union
+  {
+    void *ptr;
+    jvmtiEnv *env;
+  } foo;
+  vm->GetEnv (&(foo.ptr), JVMTI_VERSION_1_0);
+  _jdwp_jvmtiEnv = foo.env;
 
   // Wait for VM_INIT to do more initialization
   jvmtiEventCallbacks callbacks;
@@ -439,16 +445,11 @@
 {
 }
 
-jint
-gnu::classpath::jdwp::VMVirtualMachine::getAllLoadedClassesCount (void)
-{
-  return 0;
-}
-
-java::util::Iterator *
+java::util::Collection *
 gnu::classpath::jdwp::VMVirtualMachine::getAllLoadedClasses (void)
 {
-  return NULL;
+  using namespace ::java::util;
+  return (Collection *) new ArrayList ();
 }
 
 jint
@@ -629,7 +630,7 @@
 gnu::classpath::jdwp::VMVirtualMachine::
 getLoadRequests (MAYBE_UNUSED ClassLoader *cl)
 {
-  return NULL;
+  return new ::java::util::ArrayList ();
 }
 
 MethodResult *
@@ -649,6 +650,61 @@
   return _Jv_GetInterpClassSourceFile (clazz);
 }
 
+void
+gnu::classpath::jdwp::VMVirtualMachine::
+redefineClasses (MAYBE_UNUSED JArray<jclass> *types,
+		 MAYBE_UNUSED JArray<jbyteArray> *bytecodes)
+{
+}
+
+void
+gnu::classpath::jdwp::VMVirtualMachine::
+setDefaultStratum (MAYBE_UNUSED jstring stratum)
+{
+}
+
+jstring
+gnu::classpath::jdwp::VMVirtualMachine::
+getSourceDebugExtension (MAYBE_UNUSED jclass klass)
+{
+  return NULL;
+}
+
+jbyteArray
+gnu::classpath::jdwp::VMVirtualMachine::
+getBytecodes (MAYBE_UNUSED gnu::classpath::jdwp::VMMethod *method)
+{
+  return NULL;
+}
+
+gnu::classpath::jdwp::util::MonitorInfo *
+gnu::classpath::jdwp::VMVirtualMachine::
+getMonitorInfo (MAYBE_UNUSED jobject obj)
+{
+  return NULL;
+}
+
+jobjectArray
+gnu::classpath::jdwp::VMVirtualMachine::
+getOwnedMonitors (MAYBE_UNUSED ::java::lang::Thread *thread)
+{
+  return NULL;
+}
+
+jobject
+gnu::classpath::jdwp::VMVirtualMachine::
+getCurrentContendedMonitor (MAYBE_UNUSED ::java::lang::Thread *thread)
+{
+  return NULL;
+}
+
+void
+gnu::classpath::jdwp::VMVirtualMachine::
+popFrames (MAYBE_UNUSED ::java::lang::Thread *thread,
+	   MAYBE_UNUSED jlong frameId)
+{
+}
+
 // A simple caching function used while single-stepping
 static jvmtiError
 get_linetable (jvmtiEnv *env, jmethodID method, jint *count_ptr,

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]