harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From odea...@apache.org
Subject svn commit: r794726 [1/15] - in /harmony/enhanced/jdktools/branches/java6/modules/jpda: ./ src/main/native/include/ src/main/native/jdwp/common/agent/commands/ src/main/native/jdwp/common/agent/core/ src/main/native/jdwp/common/generic/ src/main/native...
Date Thu, 16 Jul 2009 15:57:41 GMT
Author: odeakin
Date: Thu Jul 16 15:57:37 2009
New Revision: 794726

URL: http://svn.apache.org/viewvc?rev=794726&view=rev
Log:
CommitCommit jdktools patch for JDWP contribution in HARMONY-6187 ([jdktools][jdwp] Contribution of updated JDWP agent and socket transport layer for Java 6)

Added:
    harmony/enhanced/jdktools/branches/java6/modules/jpda/src/main/native/jdwp/common/agent/core/ExceptionManager.cpp   (with props)
    harmony/enhanced/jdktools/branches/java6/modules/jpda/src/main/native/jdwp/common/agent/core/ExceptionManager.h   (with props)
    harmony/enhanced/jdktools/branches/java6/modules/jpda/src/main/native/jdwp/common/agent/core/Util.h   (with props)
    harmony/enhanced/jdktools/branches/java6/modules/jpda/src/main/native/jdwp/windows/agent/jdwp.rc
    harmony/enhanced/jdktools/branches/java6/modules/jpda/src/main/native/jdwp/windows/transport/dt_socket/dt_socket.rc
Removed:
    harmony/enhanced/jdktools/branches/java6/modules/jpda/src/main/native/jdwp/unix/transport/common/
    harmony/enhanced/jdktools/branches/java6/modules/jpda/src/main/native/jdwp/windows/transport/common/
Modified:
    harmony/enhanced/jdktools/branches/java6/modules/jpda/build.xml
    harmony/enhanced/jdktools/branches/java6/modules/jpda/src/main/native/include/jvmti_types.h
    harmony/enhanced/jdktools/branches/java6/modules/jpda/src/main/native/jdwp/common/agent/commands/ArrayReference.cpp
    harmony/enhanced/jdktools/branches/java6/modules/jpda/src/main/native/jdwp/common/agent/commands/ArrayReference.h
    harmony/enhanced/jdktools/branches/java6/modules/jpda/src/main/native/jdwp/common/agent/commands/ArrayType.cpp
    harmony/enhanced/jdktools/branches/java6/modules/jpda/src/main/native/jdwp/common/agent/commands/ArrayType.h
    harmony/enhanced/jdktools/branches/java6/modules/jpda/src/main/native/jdwp/common/agent/commands/ClassLoaderReference.cpp
    harmony/enhanced/jdktools/branches/java6/modules/jpda/src/main/native/jdwp/common/agent/commands/ClassLoaderReference.h
    harmony/enhanced/jdktools/branches/java6/modules/jpda/src/main/native/jdwp/common/agent/commands/ClassObjectReference.cpp
    harmony/enhanced/jdktools/branches/java6/modules/jpda/src/main/native/jdwp/common/agent/commands/ClassObjectReference.h
    harmony/enhanced/jdktools/branches/java6/modules/jpda/src/main/native/jdwp/common/agent/commands/ClassType.cpp
    harmony/enhanced/jdktools/branches/java6/modules/jpda/src/main/native/jdwp/common/agent/commands/ClassType.h
    harmony/enhanced/jdktools/branches/java6/modules/jpda/src/main/native/jdwp/common/agent/commands/EventRequest.cpp
    harmony/enhanced/jdktools/branches/java6/modules/jpda/src/main/native/jdwp/common/agent/commands/EventRequest.h
    harmony/enhanced/jdktools/branches/java6/modules/jpda/src/main/native/jdwp/common/agent/commands/Method.cpp
    harmony/enhanced/jdktools/branches/java6/modules/jpda/src/main/native/jdwp/common/agent/commands/Method.h
    harmony/enhanced/jdktools/branches/java6/modules/jpda/src/main/native/jdwp/common/agent/commands/ObjectReference.cpp
    harmony/enhanced/jdktools/branches/java6/modules/jpda/src/main/native/jdwp/common/agent/commands/ObjectReference.h
    harmony/enhanced/jdktools/branches/java6/modules/jpda/src/main/native/jdwp/common/agent/commands/ReferenceType.cpp
    harmony/enhanced/jdktools/branches/java6/modules/jpda/src/main/native/jdwp/common/agent/commands/ReferenceType.h
    harmony/enhanced/jdktools/branches/java6/modules/jpda/src/main/native/jdwp/common/agent/commands/StackFrame.cpp
    harmony/enhanced/jdktools/branches/java6/modules/jpda/src/main/native/jdwp/common/agent/commands/StackFrame.h
    harmony/enhanced/jdktools/branches/java6/modules/jpda/src/main/native/jdwp/common/agent/commands/StringReference.cpp
    harmony/enhanced/jdktools/branches/java6/modules/jpda/src/main/native/jdwp/common/agent/commands/StringReference.h
    harmony/enhanced/jdktools/branches/java6/modules/jpda/src/main/native/jdwp/common/agent/commands/ThreadGroupReference.cpp
    harmony/enhanced/jdktools/branches/java6/modules/jpda/src/main/native/jdwp/common/agent/commands/ThreadGroupReference.h
    harmony/enhanced/jdktools/branches/java6/modules/jpda/src/main/native/jdwp/common/agent/commands/ThreadReference.cpp
    harmony/enhanced/jdktools/branches/java6/modules/jpda/src/main/native/jdwp/common/agent/commands/ThreadReference.h
    harmony/enhanced/jdktools/branches/java6/modules/jpda/src/main/native/jdwp/common/agent/commands/VirtualMachine.cpp
    harmony/enhanced/jdktools/branches/java6/modules/jpda/src/main/native/jdwp/common/agent/commands/VirtualMachine.h
    harmony/enhanced/jdktools/branches/java6/modules/jpda/src/main/native/jdwp/common/agent/core/Agent.cpp
    harmony/enhanced/jdktools/branches/java6/modules/jpda/src/main/native/jdwp/common/agent/core/AgentAllocator.h
    harmony/enhanced/jdktools/branches/java6/modules/jpda/src/main/native/jdwp/common/agent/core/AgentBase.h
    harmony/enhanced/jdktools/branches/java6/modules/jpda/src/main/native/jdwp/common/agent/core/AgentEnv.h
    harmony/enhanced/jdktools/branches/java6/modules/jpda/src/main/native/jdwp/common/agent/core/AgentEventRequest.cpp
    harmony/enhanced/jdktools/branches/java6/modules/jpda/src/main/native/jdwp/common/agent/core/AgentEventRequest.h
    harmony/enhanced/jdktools/branches/java6/modules/jpda/src/main/native/jdwp/common/agent/core/AgentException.h
    harmony/enhanced/jdktools/branches/java6/modules/jpda/src/main/native/jdwp/common/agent/core/AgentManager.cpp
    harmony/enhanced/jdktools/branches/java6/modules/jpda/src/main/native/jdwp/common/agent/core/AgentManager.h
    harmony/enhanced/jdktools/branches/java6/modules/jpda/src/main/native/jdwp/common/agent/core/AgentMonitor.cpp
    harmony/enhanced/jdktools/branches/java6/modules/jpda/src/main/native/jdwp/common/agent/core/AgentMonitor.h
    harmony/enhanced/jdktools/branches/java6/modules/jpda/src/main/native/jdwp/common/agent/core/CallBacks.cpp
    harmony/enhanced/jdktools/branches/java6/modules/jpda/src/main/native/jdwp/common/agent/core/CallBacks.h
    harmony/enhanced/jdktools/branches/java6/modules/jpda/src/main/native/jdwp/common/agent/core/ClassManager.cpp
    harmony/enhanced/jdktools/branches/java6/modules/jpda/src/main/native/jdwp/common/agent/core/ClassManager.h
    harmony/enhanced/jdktools/branches/java6/modules/jpda/src/main/native/jdwp/common/agent/core/CommandDispatcher.cpp
    harmony/enhanced/jdktools/branches/java6/modules/jpda/src/main/native/jdwp/common/agent/core/CommandDispatcher.h
    harmony/enhanced/jdktools/branches/java6/modules/jpda/src/main/native/jdwp/common/agent/core/CommandHandler.cpp
    harmony/enhanced/jdktools/branches/java6/modules/jpda/src/main/native/jdwp/common/agent/core/CommandHandler.h
    harmony/enhanced/jdktools/branches/java6/modules/jpda/src/main/native/jdwp/common/agent/core/EventDispatcher.cpp
    harmony/enhanced/jdktools/branches/java6/modules/jpda/src/main/native/jdwp/common/agent/core/EventDispatcher.h
    harmony/enhanced/jdktools/branches/java6/modules/jpda/src/main/native/jdwp/common/agent/core/Log.h
    harmony/enhanced/jdktools/branches/java6/modules/jpda/src/main/native/jdwp/common/agent/core/LogManager.cpp
    harmony/enhanced/jdktools/branches/java6/modules/jpda/src/main/native/jdwp/common/agent/core/LogManager.h
    harmony/enhanced/jdktools/branches/java6/modules/jpda/src/main/native/jdwp/common/agent/core/MemoryManager.cpp
    harmony/enhanced/jdktools/branches/java6/modules/jpda/src/main/native/jdwp/common/agent/core/MemoryManager.h
    harmony/enhanced/jdktools/branches/java6/modules/jpda/src/main/native/jdwp/common/agent/core/ObjectManager.cpp
    harmony/enhanced/jdktools/branches/java6/modules/jpda/src/main/native/jdwp/common/agent/core/ObjectManager.h
    harmony/enhanced/jdktools/branches/java6/modules/jpda/src/main/native/jdwp/common/agent/core/OptionParser.cpp
    harmony/enhanced/jdktools/branches/java6/modules/jpda/src/main/native/jdwp/common/agent/core/OptionParser.h
    harmony/enhanced/jdktools/branches/java6/modules/jpda/src/main/native/jdwp/common/agent/core/PacketDispatcher.cpp
    harmony/enhanced/jdktools/branches/java6/modules/jpda/src/main/native/jdwp/common/agent/core/PacketDispatcher.h
    harmony/enhanced/jdktools/branches/java6/modules/jpda/src/main/native/jdwp/common/agent/core/PacketParser.cpp
    harmony/enhanced/jdktools/branches/java6/modules/jpda/src/main/native/jdwp/common/agent/core/PacketParser.h
    harmony/enhanced/jdktools/branches/java6/modules/jpda/src/main/native/jdwp/common/agent/core/RequestManager.cpp
    harmony/enhanced/jdktools/branches/java6/modules/jpda/src/main/native/jdwp/common/agent/core/RequestManager.h
    harmony/enhanced/jdktools/branches/java6/modules/jpda/src/main/native/jdwp/common/agent/core/RequestModifier.cpp
    harmony/enhanced/jdktools/branches/java6/modules/jpda/src/main/native/jdwp/common/agent/core/RequestModifier.h
    harmony/enhanced/jdktools/branches/java6/modules/jpda/src/main/native/jdwp/common/agent/core/ThreadManager.cpp
    harmony/enhanced/jdktools/branches/java6/modules/jpda/src/main/native/jdwp/common/agent/core/ThreadManager.h
    harmony/enhanced/jdktools/branches/java6/modules/jpda/src/main/native/jdwp/common/agent/core/TransportManager.cpp
    harmony/enhanced/jdktools/branches/java6/modules/jpda/src/main/native/jdwp/common/agent/core/TransportManager.h
    harmony/enhanced/jdktools/branches/java6/modules/jpda/src/main/native/jdwp/common/agent/core/jdwpTypes.h
    harmony/enhanced/jdktools/branches/java6/modules/jpda/src/main/native/jdwp/common/generic/jdwp.h
    harmony/enhanced/jdktools/branches/java6/modules/jpda/src/main/native/jdwp/common/transport/common/LastTransportError.cpp
    harmony/enhanced/jdktools/branches/java6/modules/jpda/src/main/native/jdwp/common/transport/common/LastTransportError.h
    harmony/enhanced/jdktools/branches/java6/modules/jpda/src/main/native/jdwp/common/transport/dt_socket/SocketTransport.cpp
    harmony/enhanced/jdktools/branches/java6/modules/jpda/src/main/native/jdwp/common/transport/dt_socket/SocketTransport.h
    harmony/enhanced/jdktools/branches/java6/modules/jpda/src/main/native/jdwp/unix/agent/core/TransportManager_pd.cpp
    harmony/enhanced/jdktools/branches/java6/modules/jpda/src/main/native/jdwp/unix/agent/core/TransportManager_pd.h
    harmony/enhanced/jdktools/branches/java6/modules/jpda/src/main/native/jdwp/unix/agent/makefile
    harmony/enhanced/jdktools/branches/java6/modules/jpda/src/main/native/jdwp/unix/transport/dt_socket/SocketTransport_pd.h
    harmony/enhanced/jdktools/branches/java6/modules/jpda/src/main/native/jdwp/unix/transport/dt_socket/makefile
    harmony/enhanced/jdktools/branches/java6/modules/jpda/src/main/native/jdwp/windows/agent/core/TransportManager_pd.cpp
    harmony/enhanced/jdktools/branches/java6/modules/jpda/src/main/native/jdwp/windows/agent/core/TransportManager_pd.h
    harmony/enhanced/jdktools/branches/java6/modules/jpda/src/main/native/jdwp/windows/agent/makefile
    harmony/enhanced/jdktools/branches/java6/modules/jpda/src/main/native/jdwp/windows/transport/dt_shmem/SharedMemTransport.cpp
    harmony/enhanced/jdktools/branches/java6/modules/jpda/src/main/native/jdwp/windows/transport/dt_shmem/makefile
    harmony/enhanced/jdktools/branches/java6/modules/jpda/src/main/native/jdwp/windows/transport/dt_socket/SocketTransport_pd.h
    harmony/enhanced/jdktools/branches/java6/modules/jpda/src/main/native/jdwp/windows/transport/dt_socket/makefile

Modified: harmony/enhanced/jdktools/branches/java6/modules/jpda/build.xml
URL: http://svn.apache.org/viewvc/harmony/enhanced/jdktools/branches/java6/modules/jpda/build.xml?rev=794726&r1=794725&r2=794726&view=diff
==============================================================================
--- harmony/enhanced/jdktools/branches/java6/modules/jpda/build.xml (original)
+++ harmony/enhanced/jdktools/branches/java6/modules/jpda/build.xml Thu Jul 16 15:57:37 2009
@@ -135,7 +135,13 @@
 
     <!-- Build native code -->
     <target name="build-native">
-        
+        <!-- create jdwpcfg.h to record the build level -->
+        <tstamp>
+            <format property="BUILD_LEVEL" pattern="dd-MM-yyyy"/>
+        </tstamp>
+        <echo message="#define BUILD_LEVEL &quot;${BUILD_LEVEL}&quot;${line.separator}"
+                file="${hy.jpda.src.main.native}/include/jdwpcfg.h"/>
+
         <echo message="Compiling JPDA natives" />
 
         <!-- Build agent shared lib -->

Modified: harmony/enhanced/jdktools/branches/java6/modules/jpda/src/main/native/include/jvmti_types.h
URL: http://svn.apache.org/viewvc/harmony/enhanced/jdktools/branches/java6/modules/jpda/src/main/native/include/jvmti_types.h?rev=794726&r1=794725&r2=794726&view=diff
==============================================================================
--- harmony/enhanced/jdktools/branches/java6/modules/jpda/src/main/native/include/jvmti_types.h (original)
+++ harmony/enhanced/jdktools/branches/java6/modules/jpda/src/main/native/include/jvmti_types.h Thu Jul 16 15:57:37 2009
@@ -43,7 +43,8 @@
     typedef jobject jthread;
     typedef jlong jlocation;
     typedef jobject jthreadGroup;
-    typedef int jrawMonitorID;
+    struct _jrawMonitorID;
+    typedef struct _jrawMonitorID *jrawMonitorID;
     typedef struct JNINativeInterface_ jniNativeInterface;
 
 

Modified: harmony/enhanced/jdktools/branches/java6/modules/jpda/src/main/native/jdwp/common/agent/commands/ArrayReference.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/jdktools/branches/java6/modules/jpda/src/main/native/jdwp/common/agent/commands/ArrayReference.cpp?rev=794726&r1=794725&r2=794726&view=diff
==============================================================================
--- harmony/enhanced/jdktools/branches/java6/modules/jpda/src/main/native/jdwp/common/agent/commands/ArrayReference.cpp (original)
+++ harmony/enhanced/jdktools/branches/java6/modules/jpda/src/main/native/jdwp/common/agent/commands/ArrayReference.cpp Thu Jul 16 15:57:37 2009
@@ -15,93 +15,102 @@
  *  See the License for the specific language governing permissions and
  *  limitations under the License.
  */
-
-/**
- * @author Viacheslav G. Rybalov
- * @version $Revision: 1.12 $
- */
-#include <string.h>
 #include "ArrayReference.h"
 #include "PacketParser.h"
 #include "ClassManager.h"
+#include "ExceptionManager.h"
+
+
+#include <string.h>
 
 using namespace jdwp;
 using namespace ArrayReference;
 
-void
-ArrayReference::LengthHandler::Execute(JNIEnv *jni) throw(AgentException)
+int
+ArrayReference::LengthHandler::Execute(JNIEnv *jni) 
 {
     jarray arrayObject = (jarray)m_cmdParser->command.ReadArrayID(jni);
     if (arrayObject == 0) {
-        JDWP_TRACE_DATA("Length: null array: arrayID=" << arrayObject);
-        throw AgentException(JDWP_ERROR_INVALID_OBJECT);
+        JDWP_TRACE(LOG_RELEASE, (LOG_DATA_FL, "Length: null array: arrayID=%p", arrayObject));
+        AgentException e(JDWP_ERROR_INVALID_OBJECT);
+		JDWP_SET_EXCEPTION(e);
+        return JDWP_ERROR_INVALID_OBJECT;
     }
     jclass arrObjClass = jni->GetObjectClass(arrayObject);
 #ifndef NDEBUG 
     if (JDWP_TRACE_ENABLED(LOG_KIND_DATA)) {
         jvmtiError err;
         char* signature = 0;
-        JVMTI_TRACE(err, GetJvmtiEnv()->GetClassSignature(arrObjClass, &signature, 0));
+        JVMTI_TRACE(LOG_DEBUG, err, GetJvmtiEnv()->GetClassSignature(arrObjClass, &signature, 0));
         JvmtiAutoFree afs(signature);
-        JDWP_TRACE_DATA("Length: arrayID=" << arrayObject
-            << ", classSignature=" << JDWP_CHECK_NULL(signature));
+        JDWP_TRACE(LOG_RELEASE, (LOG_DATA_FL, "Length: arrayID=%p, classSignature=%s", arrayObject, JDWP_CHECK_NULL(signature)));
     }
 #endif
     JDWP_ASSERT(arrObjClass != 0);
     jboolean is_array_class;
     jvmtiError err;
-    JVMTI_TRACE(err, GetJvmtiEnv()->IsArrayClass(arrObjClass, &is_array_class));
+    JVMTI_TRACE(LOG_DEBUG, err, GetJvmtiEnv()->IsArrayClass(arrObjClass, &is_array_class));
     if (err != JVMTI_ERROR_NONE) {
-        throw AgentException(err);
+        AgentException e(err);
+		JDWP_SET_EXCEPTION(e);
+        return err;
     }
     if (is_array_class != JNI_TRUE) {
-        throw AgentException(JDWP_ERROR_INVALID_ARRAY);
+        AgentException e(JDWP_ERROR_INVALID_ARRAY);
+		JDWP_SET_EXCEPTION(e);
+        return JDWP_ERROR_INVALID_ARRAY;
     }
 
     jsize length = jni->GetArrayLength(arrayObject);
-    JDWP_TRACE_DATA("Length: send: length=" << length);
+    JDWP_TRACE(LOG_RELEASE, (LOG_DATA_FL, "Length: send: length=%d", length));
     m_cmdParser->reply.WriteInt(length);
-    
+
+    return JDWP_ERROR_NONE;
 }
 
-void
-ArrayReference::GetValuesHandler::Execute(JNIEnv *jni) throw(AgentException)
+int
+ArrayReference::GetValuesHandler::Execute(JNIEnv *jni) 
 {
     jarray arrayObject = m_cmdParser->command.ReadArrayID(jni);
     jint firstIndex = m_cmdParser->command.ReadInt();
     jint length = m_cmdParser->command.ReadInt();
 
-    JDWP_TRACE_DATA("GetValues: received: arrayID=" << arrayObject
-        << ", firstIndex=" << firstIndex 
-        << ", length=" << length)
+    JDWP_TRACE(LOG_RELEASE, (LOG_DATA_FL, "GetValues: received: arrayID=%p, firstIndex=%d, length=%d", arrayObject, firstIndex, length));
 
     jclass arrObjClass = jni->GetObjectClass(arrayObject);
     JDWP_ASSERT(arrObjClass != 0);
 
     char* signature = 0;
     jvmtiError err;
-    JVMTI_TRACE(err, GetJvmtiEnv()->GetClassSignature(arrObjClass,
+    JVMTI_TRACE(LOG_DEBUG, err, GetJvmtiEnv()->GetClassSignature(arrObjClass,
         &signature, 0));
     if (err != JVMTI_ERROR_NONE) {
-        throw AgentException(err);
+        AgentException e(err);
+		JDWP_SET_EXCEPTION(e);
+        return err;
     }
     JvmtiAutoFree afv1(signature);
     if(signature[0] != '[') {
-        throw AgentException(JDWP_ERROR_INVALID_ARRAY);
+        AgentException e(JDWP_ERROR_INVALID_ARRAY);
+		JDWP_SET_EXCEPTION(e);
+        return JDWP_ERROR_INVALID_ARRAY;
     }
     jsize arrLength = jni->GetArrayLength(arrayObject);
     JDWP_ASSERT(arrLength >= 0);
     if ( (firstIndex < 0) || (firstIndex >= arrLength) ) {
-        throw AgentException(JDWP_ERROR_INVALID_INDEX);
+        AgentException e(JDWP_ERROR_INVALID_INDEX);
+		JDWP_SET_EXCEPTION(e);
+        return JDWP_ERROR_INVALID_INDEX;
     }
     if ( length == -1 ) {
         length = arrLength - firstIndex;
     }
     if ( (length < 0 ) || (firstIndex + length > arrLength) ) {
-        throw AgentException(JDWP_ERROR_INVALID_LENGTH);
+        AgentException e(JDWP_ERROR_INVALID_LENGTH);
+		JDWP_SET_EXCEPTION(e);
+        return JDWP_ERROR_INVALID_LENGTH;
     }
-    JDWP_TRACE_DATA("GetValues: values=" << length 
-        << ", signature=" << JDWP_CHECK_NULL(signature));
+    JDWP_TRACE(LOG_RELEASE, (LOG_DATA_FL, "GetValues: values=%d, signature=%s", length, JDWP_CHECK_NULL(signature)));
     jvalue value;
     ClassManager& classManager = AgentBase::GetClassManager();
     switch (signature[1]) {
@@ -109,7 +118,7 @@
             m_cmdParser->reply.WriteByte(JDWP_TAG_BOOLEAN);
             m_cmdParser->reply.WriteInt(length);
             if ( length == 0 ) {
-                return;
+                return JDWP_ERROR_NONE;
             }
             jboolean* bufferArray = reinterpret_cast<jboolean*>(AgentBase::GetMemoryManager()
                     .Allocate(sizeof(jboolean)*length JDWP_FILE_LINE));
@@ -119,17 +128,16 @@
                         
             for (int i = 0; i < length; i++) {
                 value.z = bufferArray[i];
-                JDWP_TRACE_DATA("GetValues: send: index=" << i
-                    << ", value=(boolean)" << value.z);
+                JDWP_TRACE(LOG_RELEASE, (LOG_DATA_FL, "GetValues: send: index=%d, value=(boolean)%d", i, value.z));
                 m_cmdParser->reply.WriteUntaggedValue(jni, JDWP_TAG_BOOLEAN, value);
             }
-            return;
+            return JDWP_ERROR_NONE;
         }
         case 'B': {
             m_cmdParser->reply.WriteByte(JDWP_TAG_BYTE);
             m_cmdParser->reply.WriteInt(length);
             if ( length == 0 ) {
-                return;
+                return JDWP_ERROR_NONE;
             }
             jbyte* bufferArray = reinterpret_cast<jbyte*>(AgentBase::GetMemoryManager()
                     .Allocate(sizeof(jbyte)*length JDWP_FILE_LINE));
@@ -139,17 +147,16 @@
                         
             for (int i = 0; i < length; i++) {
                 value.b = bufferArray[i];
-                JDWP_TRACE_DATA("GetValues: send: index=" << i
-                    << ", value=(byte)" << value.b);
+                JDWP_TRACE(LOG_RELEASE, (LOG_DATA_FL, "GetValues: send: index=%d, value=(byte)%d", i, value.b));
                 m_cmdParser->reply.WriteUntaggedValue(jni, JDWP_TAG_BYTE, value);
             }
-            return;
+            return JDWP_ERROR_NONE;
         }
         case 'C': {
             m_cmdParser->reply.WriteByte(JDWP_TAG_CHAR);
             m_cmdParser->reply.WriteInt(length);
             if ( length == 0 ) {
-                return;
+                return JDWP_ERROR_NONE;
             }
             jchar* bufferArray = reinterpret_cast<jchar*>(AgentBase::GetMemoryManager()
                     .Allocate(sizeof(jchar)*length JDWP_FILE_LINE));
@@ -159,17 +166,16 @@
                         
             for (int i = 0; i < length; i++) {
                 value.c = bufferArray[i];
-                JDWP_TRACE_DATA("GetValues: send: index=" << i
-                    << ", value=(char)" << value.c);
+                JDWP_TRACE(LOG_RELEASE, (LOG_DATA_FL, "GetValues: send: index=%d, value=(char)%d", i, value.c));
                 m_cmdParser->reply.WriteUntaggedValue(jni, JDWP_TAG_CHAR, value);
             }
-            return;
+            return JDWP_ERROR_NONE;
         }
         case 'S': {
             m_cmdParser->reply.WriteByte(JDWP_TAG_SHORT);
             m_cmdParser->reply.WriteInt(length);
             if ( length == 0 ) {
-                return;
+                return JDWP_ERROR_NONE;
             }
             jshort* bufferArray = reinterpret_cast<jshort*>(AgentBase::GetMemoryManager()
                     .Allocate(sizeof(jshort)*length JDWP_FILE_LINE));
@@ -179,17 +185,16 @@
                         
             for (int i = 0; i < length; i++) {
                 value.s = bufferArray[i];
-                JDWP_TRACE_DATA("GetValues: send: index=" << i
-                    << ", value=(short)" << value.s);
+                JDWP_TRACE(LOG_RELEASE, (LOG_DATA_FL, "GetValues: send: index=%d, value=(short)%d", i, value.s));
                 m_cmdParser->reply.WriteUntaggedValue(jni, JDWP_TAG_SHORT, value);
             }
-            return;
+            return JDWP_ERROR_NONE;
         }
         case 'I': {
             m_cmdParser->reply.WriteByte(JDWP_TAG_INT);
             m_cmdParser->reply.WriteInt(length);
             if ( length == 0 ) {
-                return;
+                return JDWP_ERROR_NONE;
             }
             jint* bufferArray = reinterpret_cast<jint*>(AgentBase::GetMemoryManager()
                     .Allocate(sizeof(jint)*length JDWP_FILE_LINE));
@@ -199,17 +204,16 @@
                         
             for (int i = 0; i < length; i++) {
                 value.i = bufferArray[i];
-                JDWP_TRACE_DATA("GetValues: send: index=" << i
-                    << ", value=(int)" << value.i);
+                JDWP_TRACE(LOG_RELEASE, (LOG_DATA_FL, "GetValues: send: index=%d, value=(int)%d", i, value.i));
                 m_cmdParser->reply.WriteUntaggedValue(jni, JDWP_TAG_INT, value);
             }
-            return;
+            return JDWP_ERROR_NONE;
         }
         case 'J': {
             m_cmdParser->reply.WriteByte(JDWP_TAG_LONG);
             m_cmdParser->reply.WriteInt(length);
             if ( length == 0 ) {
-                return;
+                return JDWP_ERROR_NONE;
             }
             jlong* bufferArray = reinterpret_cast<jlong*>(AgentBase::GetMemoryManager()
                     .Allocate(sizeof(jlong)*length JDWP_FILE_LINE));
@@ -219,17 +223,16 @@
                        
             for (int i = 0; i < length; i++) {
                 value.j = bufferArray[i];
-                JDWP_TRACE_DATA("GetValues: send: index=" << i
-                    << ", value=(long)" << value.j);
+                JDWP_TRACE(LOG_RELEASE, (LOG_DATA_FL, "GetValues: send: index=%d, value=(long)%lld", i, value.j));
                 m_cmdParser->reply.WriteUntaggedValue(jni, JDWP_TAG_LONG, value);
             }
-            return;
+            return JDWP_ERROR_NONE;
         }
         case 'F': {
             m_cmdParser->reply.WriteByte(JDWP_TAG_FLOAT);
             m_cmdParser->reply.WriteInt(length);
             if ( length == 0 ) {
-                return;
+                return JDWP_ERROR_NONE;
             }
             jfloat* bufferArray = reinterpret_cast<jfloat*>(AgentBase::GetMemoryManager()
                     .Allocate(sizeof(jfloat)*length JDWP_FILE_LINE));
@@ -239,17 +242,16 @@
                         
             for (int i = 0; i < length; i++) {
                 value.f = bufferArray[i];
-                JDWP_TRACE_DATA("GetValues: send: index=" << i
-                    << ", value=(float)" << value.f);
+                JDWP_TRACE(LOG_RELEASE, (LOG_DATA_FL, "GetValues: send: index=%d, value=(float)%f", i, value.f));
                 m_cmdParser->reply.WriteUntaggedValue(jni, JDWP_TAG_FLOAT, value);
             }
-            return;
+            return JDWP_ERROR_NONE;
         }
         case 'D': {
             m_cmdParser->reply.WriteByte(JDWP_TAG_DOUBLE);
             m_cmdParser->reply.WriteInt(length);
             if ( length == 0 ) {
-                return;
+                return JDWP_ERROR_NONE;
             }
             jdouble* bufferArray = reinterpret_cast<jdouble*>(AgentBase::GetMemoryManager()
                     .Allocate(sizeof(jdouble)*length JDWP_FILE_LINE));
@@ -259,11 +261,10 @@
                         
             for (int i = 0; i < length; i++) {
                 value.d = bufferArray[i];
-                JDWP_TRACE_DATA("GetValues: send: index=" << i
-                    << ", value=(double)" << value.d);
+                JDWP_TRACE(LOG_RELEASE, (LOG_DATA_FL, "GetValues: send: index=%d, value=(double)%Lf", i, value.d));
                 m_cmdParser->reply.WriteUntaggedValue(jni, JDWP_TAG_DOUBLE, value);
             }
-            return;
+            return JDWP_ERROR_NONE;
         }
         case '[':
             m_cmdParser->reply.WriteByte(JDWP_TAG_ARRAY);
@@ -272,71 +273,81 @@
             m_cmdParser->reply.WriteByte(JDWP_TAG_OBJECT);
             break;
         default:
-            JDWP_TRACE_DATA("GetValues: bad type signature: " << JDWP_CHECK_NULL(signature));
-            throw AgentException(JDWP_ERROR_INVALID_ARRAY);
+            JDWP_TRACE(LOG_RELEASE, (LOG_DATA_FL, "GetValues: bad type signature: %s", JDWP_CHECK_NULL(signature)));
+            AgentException e(JDWP_ERROR_INVALID_ARRAY);
+			JDWP_SET_EXCEPTION(e);
+            return JDWP_ERROR_INVALID_ARRAY;
     }
     m_cmdParser->reply.WriteInt(length);
 
-    JDWP_TRACE_DATA("GetValues: send: length=" << length);
+    JDWP_TRACE(LOG_RELEASE, (LOG_DATA_FL, "GetValues: send: length=%d", length));
     for (int i = 0; i < length; i++) {
         jobject objArrayElement = jni->GetObjectArrayElement(static_cast<jobjectArray>(arrayObject), firstIndex + i);
         classManager.CheckOnException(jni);
 
         jdwpTag tag = classManager.GetJdwpTag(jni, objArrayElement);
 
-        JDWP_TRACE_DATA("GetValues: send: index=" << i 
-            << ", tag=" << tag 
-            << ", value=(object)" << objArrayElement);
+        JDWP_TRACE(LOG_RELEASE, (LOG_DATA_FL, "GetValues: send: index=%d, tag=%d, value=(object)%p", i, tag, objArrayElement));
 
-        m_cmdParser->reply.WriteByte(tag);
+        m_cmdParser->reply.WriteByte((jbyte)tag);
         m_cmdParser->reply.WriteObjectID(jni, objArrayElement);
     }
 
+    return JDWP_ERROR_NONE;
 }
 
-void
-ArrayReference::SetValuesHandler::Execute(JNIEnv *jni) throw(AgentException)
+int
+ArrayReference::SetValuesHandler::Execute(JNIEnv *jni) 
 {
     jarray arrayObject = m_cmdParser->command.ReadArrayID(jni);
     jint firstIndex = m_cmdParser->command.ReadInt();
     jint values = m_cmdParser->command.ReadInt();
 
-    JDWP_TRACE_DATA("GetValues: received: arrayID=" << arrayObject
-        << ", firstIndex=" << firstIndex 
-        << ", values=" << values)
+    JDWP_TRACE(LOG_RELEASE, (LOG_DATA_FL, "GetValues: received: arrayID=%p, firstIndex=%d, values=%d", arrayObject, firstIndex, values));
 
     if (arrayObject == 0) {
-        throw AgentException(JDWP_ERROR_INVALID_OBJECT);
+        AgentException e(JDWP_ERROR_INVALID_OBJECT);
+		JDWP_SET_EXCEPTION(e);
+        return JDWP_ERROR_INVALID_OBJECT;
     }
     if ((firstIndex < 0) || (values < 0)) {
-        throw AgentException(JDWP_ERROR_ILLEGAL_ARGUMENT);
+        AgentException e(JDWP_ERROR_ILLEGAL_ARGUMENT);
+		JDWP_SET_EXCEPTION(e);
+        return JDWP_ERROR_ILLEGAL_ARGUMENT;
     }
     jclass arrObjClass = jni->GetObjectClass(arrayObject);
     JDWP_ASSERT(arrObjClass != 0);
     char* signature = 0;
     char* generic = 0;
     jvmtiError err;
-    JVMTI_TRACE(err, GetJvmtiEnv()->GetClassSignature(arrObjClass,
+    JVMTI_TRACE(LOG_DEBUG, err, GetJvmtiEnv()->GetClassSignature(arrObjClass,
         &signature, &generic));
     JvmtiAutoFree afv1(signature);
     JvmtiAutoFree afv2(generic);
     if (err != JVMTI_ERROR_NONE) {
-        throw AgentException(err);
+        AgentException e(err);
+		JDWP_SET_EXCEPTION(e);
+        return err;
     }
     if ((signature == 0) || (strlen(signature) < 2)) {
-        throw AgentException(JDWP_ERROR_INVALID_OBJECT);
+        AgentException e(JDWP_ERROR_INVALID_OBJECT);
+		JDWP_SET_EXCEPTION(e);
+        return JDWP_ERROR_INVALID_OBJECT;
     }
     if(signature[0] != '[') {
-        throw AgentException(JDWP_ERROR_INVALID_ARRAY);
+        AgentException e(JDWP_ERROR_INVALID_ARRAY);
+		JDWP_SET_EXCEPTION(e);
+        return JDWP_ERROR_INVALID_ARRAY;
     }
     jsize arrLength = jni->GetArrayLength(arrayObject);
     JDWP_ASSERT(arrLength >= 0);
     if (firstIndex + values > arrLength) {
-        throw AgentException(JDWP_ERROR_INVALID_LENGTH);
+        AgentException e(JDWP_ERROR_INVALID_LENGTH);
+		JDWP_SET_EXCEPTION(e);
+        return JDWP_ERROR_INVALID_LENGTH;
     }
 
-    JDWP_TRACE_DATA("SetValues: values=" << values << ", signature=" 
-        << JDWP_CHECK_NULL(signature) << ", generic=" << JDWP_CHECK_NULL(generic));
+    JDWP_TRACE(LOG_RELEASE, (LOG_DATA_FL, "SetValues: values=%d, signature=%s, generic=%s", values, JDWP_CHECK_NULL(signature), JDWP_CHECK_NULL(generic)));
 
     jvalue value;
     switch (signature[1]) {
@@ -346,8 +357,7 @@
             AgentAutoFree scavenger(bufferArray JDWP_FILE_LINE);
             for (int i = 0; i < values; i++) {
                 value = m_cmdParser->command.ReadUntaggedValue(jni, JDWP_TAG_BOOLEAN);
-                JDWP_TRACE_DATA("SetValues: set: index=" << i
-                    << ", value=(boolean)" << value.z);
+                JDWP_TRACE(LOG_RELEASE, (LOG_DATA_FL, "SetValues: set: index=%d, value=(boolean)%d", i, value.z));
                 bufferArray[i] = value.z;
             }
             jni->SetBooleanArrayRegion(static_cast<jbooleanArray>(arrayObject), firstIndex, values, bufferArray);
@@ -360,8 +370,7 @@
                         
             for (int i = 0; i < values; i++) {
                 value = m_cmdParser->command.ReadUntaggedValue(jni, JDWP_TAG_BYTE);
-                JDWP_TRACE_DATA("SetValues: set: index=" << i
-                    << ", value=(byte)" << value.b);
+                JDWP_TRACE(LOG_RELEASE, (LOG_DATA_FL, "SetValues: set: index=%d, value=(byte)%d", i, value.b));
                 bufferArray[i] = value.b;
             }
             jni->SetByteArrayRegion(static_cast<jbyteArray>(arrayObject), firstIndex, values, bufferArray);
@@ -374,8 +383,7 @@
                         
             for (int i = 0; i < values; i++) {
                 value = m_cmdParser->command.ReadUntaggedValue(jni, JDWP_TAG_CHAR);
-                JDWP_TRACE_DATA("SetValues: set: index=" << i
-                    << ", value=(char)" << value.c);
+                JDWP_TRACE(LOG_RELEASE, (LOG_DATA_FL, "SetValues: set: index=%d, value=(char)%d", i, value.c));
                 bufferArray[i] = value.c;
             }
             jni->SetCharArrayRegion(static_cast<jcharArray>(arrayObject), firstIndex, values, bufferArray);
@@ -388,8 +396,7 @@
             
             for (int i = 0; i < values; i++) {
                 value = m_cmdParser->command.ReadUntaggedValue(jni, JDWP_TAG_SHORT);
-                JDWP_TRACE_DATA("SetValues: set: index=" << i
-                    << ", value=(short)" << value.s);
+                JDWP_TRACE(LOG_RELEASE, (LOG_DATA_FL, "SetValues: set: index=%d, value=(short)%d", i, value.s));
                 bufferArray[i] = value.s;
             }
             jni->SetShortArrayRegion(static_cast<jshortArray>(arrayObject), firstIndex, values, bufferArray);
@@ -402,8 +409,7 @@
             
             for (int i = 0; i < values; i++) {
                 value = m_cmdParser->command.ReadUntaggedValue(jni, JDWP_TAG_INT);
-                JDWP_TRACE_DATA("SetValues: set: index=" << i
-                    << ", value=(int)" << value.i);
+                JDWP_TRACE(LOG_RELEASE, (LOG_DATA_FL, "SetValues: set: index=%d, value=(int)%d", i, value.i));
                 bufferArray[i] = value.i;
             }
             jni->SetIntArrayRegion(static_cast<jintArray>(arrayObject), firstIndex, values, bufferArray);
@@ -416,8 +422,7 @@
             
             for (int i = 0; i < values; i++) {
                 value = m_cmdParser->command.ReadUntaggedValue(jni, JDWP_TAG_LONG);
-                JDWP_TRACE_DATA("SetValues: set: index=" << i
-                    << ", value=(long)" << value.j);
+                JDWP_TRACE(LOG_RELEASE, (LOG_DATA_FL, "SetValues: set: index=%d, value=(long)%lld", i, value.j));
                 bufferArray[i] = value.j;
             }
             jni->SetLongArrayRegion(static_cast<jlongArray>(arrayObject), firstIndex, values, bufferArray);
@@ -430,8 +435,7 @@
             
             for (int i = 0; i < values; i++) {
                 value = m_cmdParser->command.ReadUntaggedValue(jni, JDWP_TAG_FLOAT);
-                JDWP_TRACE_DATA("SetValues: set: index=" << i
-                    << ", value=(float)" << value.f);
+                JDWP_TRACE(LOG_RELEASE, (LOG_DATA_FL, "SetValues: set: index=%d, value=(float)%f", i, value.f));
                 bufferArray[i] = value.f;
             }
             jni->SetFloatArrayRegion(static_cast<jfloatArray>(arrayObject), firstIndex, values, bufferArray);
@@ -444,8 +448,7 @@
             
             for (int i = 0; i < values; i++) {
                 value = m_cmdParser->command.ReadUntaggedValue(jni, JDWP_TAG_DOUBLE);
-                JDWP_TRACE_DATA("SetValues: set: index=" << i
-                    << ", value=(double)" << value.d);
+                JDWP_TRACE(LOG_RELEASE, (LOG_DATA_FL, "SetValues: set: index=%d, value=(dounle)%Lf", i, value.d));
                 bufferArray[i] = value.d;
             }
             jni->SetDoubleArrayRegion(static_cast<jdoubleArray>(arrayObject), firstIndex, values, bufferArray);
@@ -457,8 +460,7 @@
                 value = m_cmdParser->command.ReadUntaggedValue(jni, JDWP_TAG_OBJECT);
                 jobject objArrayElement = value.l;
 
-                JDWP_TRACE_DATA("SetValues: set: index=" << i
-                    << ", value=(object)" << value.l);
+                JDWP_TRACE(LOG_RELEASE, (LOG_DATA_FL, "SetValues: set: index=%d, value=(object)%p", i, value.l));
                 
                 jni->SetObjectArrayElement(static_cast<jobjectArray>(arrayObject), firstIndex + i, objArrayElement);
                 jthrowable ex = jni->ExceptionOccurred();
@@ -476,14 +478,18 @@
                 // indicate error if any exception occured
                 if (ex != 0) {
                     jni->ExceptionClear();
-                    throw AgentException(JDWP_ERROR_INVALID_ARRAY);
+                    AgentException e(JDWP_ERROR_INVALID_ARRAY);
+					JDWP_SET_EXCEPTION(e);
+                    return JDWP_ERROR_INVALID_ARRAY;
                 }
             }
             break;
         }
         default:
-            JDWP_TRACE_DATA("SetValues: bad type signature: " << JDWP_CHECK_NULL(signature));
-            throw AgentException(JDWP_ERROR_INVALID_ARRAY);
+            JDWP_TRACE(LOG_RELEASE, (LOG_DATA_FL, "SetValues: bad type signature: %s", JDWP_CHECK_NULL(signature)));
+            AgentException e(JDWP_ERROR_INVALID_ARRAY);
+			JDWP_SET_EXCEPTION(e);
+            return JDWP_ERROR_INVALID_ARRAY;
     }           
 
     // check if exception occured
@@ -493,7 +499,11 @@
         // indicate error if any exception occured
         if (ex != 0) {
             jni->ExceptionClear();
-            throw AgentException(JDWP_ERROR_INVALID_ARRAY);
+            AgentException e(JDWP_ERROR_INVALID_ARRAY);
+			JDWP_SET_EXCEPTION(e);
+            return JDWP_ERROR_INVALID_ARRAY;
         }
     }
+
+    return JDWP_ERROR_NONE;
 }

Modified: harmony/enhanced/jdktools/branches/java6/modules/jpda/src/main/native/jdwp/common/agent/commands/ArrayReference.h
URL: http://svn.apache.org/viewvc/harmony/enhanced/jdktools/branches/java6/modules/jpda/src/main/native/jdwp/common/agent/commands/ArrayReference.h?rev=794726&r1=794725&r2=794726&view=diff
==============================================================================
--- harmony/enhanced/jdktools/branches/java6/modules/jpda/src/main/native/jdwp/common/agent/commands/ArrayReference.h (original)
+++ harmony/enhanced/jdktools/branches/java6/modules/jpda/src/main/native/jdwp/common/agent/commands/ArrayReference.h Thu Jul 16 15:57:37 2009
@@ -17,11 +17,6 @@
  */
 
 /**
- * @author Viacheslav G. Rybalov
- * @version $Revision: 1.4.2.1 $
- */
-
-/**
  * @file
  * ArrayReference.h
  *
@@ -54,7 +49,7 @@
              *
              * @param jni - the JNI interface pointer
              */
-            virtual void Execute(JNIEnv *jni) throw(AgentException);
+            virtual int Execute(JNIEnv *jni);
 
         };//LengthHandler
 
@@ -71,7 +66,7 @@
              *
              * @param jni - the JNI interface pointer
              */
-            virtual void Execute(JNIEnv *jni) throw(AgentException);
+            virtual int Execute(JNIEnv *jni);
 
         };//GetValuesHandler
 
@@ -88,7 +83,7 @@
              *
              * @param jni - the JNI interface pointer
              */
-            virtual void Execute(JNIEnv *jni) throw(AgentException);
+            virtual int Execute(JNIEnv *jni);
 
         };//SetValuesHandler
 

Modified: harmony/enhanced/jdktools/branches/java6/modules/jpda/src/main/native/jdwp/common/agent/commands/ArrayType.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/jdktools/branches/java6/modules/jpda/src/main/native/jdwp/common/agent/commands/ArrayType.cpp?rev=794726&r1=794725&r2=794726&view=diff
==============================================================================
--- harmony/enhanced/jdktools/branches/java6/modules/jpda/src/main/native/jdwp/common/agent/commands/ArrayType.cpp (original)
+++ harmony/enhanced/jdktools/branches/java6/modules/jpda/src/main/native/jdwp/common/agent/commands/ArrayType.cpp Thu Jul 16 15:57:37 2009
@@ -15,21 +15,19 @@
  *  See the License for the specific language governing permissions and
  *  limitations under the License.
  */
-
-/**
- * @author Viacheslav G. Rybalov
- * @version $Revision: 1.8 $
- */
-#include <string.h>
 #include "ArrayType.h"
 #include "PacketParser.h"
 #include "ClassManager.h"
+#include "ExceptionManager.h"
+
+
+#include <string.h>
 
 using namespace jdwp;
 using namespace ArrayType;
 
-void
-ArrayType::NewInstanceHandler::Execute(JNIEnv *jni) throw(AgentException)
+int
+ArrayType::NewInstanceHandler::Execute(JNIEnv *jni) 
 {
     jclass cls = m_cmdParser->command.ReadReferenceTypeID(jni);
     jint length = m_cmdParser->command.ReadInt();
@@ -37,62 +35,67 @@
     JDWP_ASSERT(cls != 0);
     char* signature = 0;
     jvmtiError err;
-    JVMTI_TRACE(err, GetJvmtiEnv()->GetClassSignature(cls, &signature, 0));
+    JVMTI_TRACE(LOG_DEBUG, err, GetJvmtiEnv()->GetClassSignature(cls, &signature, 0));
     JvmtiAutoFree afv1(signature);
     if (err != JVMTI_ERROR_NONE) {
-        throw AgentException(err);
+        AgentException e(err);
+		JDWP_SET_EXCEPTION(e);
+        return err;
     }
 
-    JDWP_TRACE_DATA("NewInstance: received: refTypeID=" << cls
-        << ", length=" << length
-        << ", signature=" << JDWP_CHECK_NULL(signature));
+    JDWP_TRACE(LOG_RELEASE, (LOG_DATA_FL, "NewInstance: received: refTypeID=%p, length=%d, signature=%s",
+                    cls,  length, JDWP_CHECK_NULL(signature)));
 
     if ((signature == 0) || (strlen(signature) < 2)) {
-        throw AgentException(JDWP_ERROR_INVALID_OBJECT);
+        AgentException e(JDWP_ERROR_INVALID_OBJECT);
+		JDWP_SET_EXCEPTION(e);
+        return JDWP_ERROR_INVALID_OBJECT;
     }
     if(signature[0] != '[') {
-        throw AgentException(JDWP_ERROR_INVALID_ARRAY);
+        AgentException e(JDWP_ERROR_INVALID_ARRAY);
+		JDWP_SET_EXCEPTION(e);
+        return JDWP_ERROR_INVALID_ARRAY;
     }
 
     jarray arr = 0;
     switch (signature[1]) {
         case 'Z': {
-            JDWP_TRACE_DATA("NewInstance: new boolean array");
+            JDWP_TRACE(LOG_RELEASE, (LOG_DATA_FL, "NewInstance: new boolean array"));
             arr = jni->NewBooleanArray(length);
             break;
         }
         case 'B': {
-            JDWP_TRACE_DATA("NewInstance: new byte array");
+            JDWP_TRACE(LOG_RELEASE, (LOG_DATA_FL, "NewInstance: new byte array"));
             arr = jni->NewByteArray(length);
             break;
         }
         case 'C': {
-            JDWP_TRACE_DATA("NewInstance: new char array");
+            JDWP_TRACE(LOG_RELEASE, (LOG_DATA_FL, "NewInstance: new char array"));
             arr = jni->NewCharArray(length);
             break;
         }
         case 'S': {
-            JDWP_TRACE_DATA("NewInstance: new short array");
+            JDWP_TRACE(LOG_RELEASE, (LOG_DATA_FL, "NewInstance: new short array"));
             arr = jni->NewShortArray(length);
             break;
         }
         case 'I': {
-            JDWP_TRACE_DATA("NewInstance: new int array");
+            JDWP_TRACE(LOG_RELEASE, (LOG_DATA_FL, "NewInstance: new int array"));
             arr = jni->NewIntArray(length);
             break;
         }
         case 'J': {
-            JDWP_TRACE_DATA("NewInstance: new long array");
+            JDWP_TRACE(LOG_RELEASE, (LOG_DATA_FL, "NewInstance: new long array"));
             arr = jni->NewLongArray(length);
             break;
         }
         case 'F': {
             arr = jni->NewFloatArray(length);
-            JDWP_TRACE_DATA("NewInstance: new float array");
+            JDWP_TRACE(LOG_RELEASE, (LOG_DATA_FL, "NewInstance: new float array"));
             break;
         }
         case 'D': {
-            JDWP_TRACE_DATA("NewInstance: new double array");
+            JDWP_TRACE(LOG_RELEASE, (LOG_DATA_FL, "NewInstance: new double array"));
             arr = jni->NewDoubleArray(length);
             break;
         }
@@ -101,29 +104,39 @@
             char* name = GetClassManager().GetClassName(&signature[1]);
             JvmtiAutoFree jafn(name);
             jobject loader;
-            JVMTI_TRACE(err, GetJvmtiEnv()->GetClassLoader(cls, &loader));
+            JVMTI_TRACE(LOG_DEBUG, err, GetJvmtiEnv()->GetClassLoader(cls, &loader));
             if (err != JVMTI_ERROR_NONE) {
-                throw AgentException(err);
+                AgentException e(err);
+		        JDWP_SET_EXCEPTION(e);
+                return err;
             }
             jclass elementClass =
                 GetClassManager().GetClassForName(jni, name, loader);
-            JDWP_TRACE_DATA("NewInstance: new object array: "
-                "class=" << JDWP_CHECK_NULL(name));
+            if (elementClass == 0) {
+                AgentException ex(JDWP_ERROR_INTERNAL);
+                JDWP_SET_EXCEPTION(ex);
+                return JDWP_ERROR_INTERNAL;
+            }
+            JDWP_TRACE(LOG_RELEASE, (LOG_DATA_FL, "NewInstance: new object array: %s", JDWP_CHECK_NULL(name)));
             arr = jni->NewObjectArray(length, elementClass, 0);
             break;
         }
         default:
-            JDWP_TRACE_DATA("NewInstance: bad type signature: "
-                << JDWP_CHECK_NULL(signature));
-            throw AgentException(JDWP_ERROR_INVALID_ARRAY);
+            JDWP_TRACE(LOG_RELEASE, (LOG_DATA_FL, "NewInstance: bad type signature: %s", JDWP_CHECK_NULL(signature)));
+            AgentException e(JDWP_ERROR_INVALID_ARRAY);
+			JDWP_SET_EXCEPTION(e);
+            return JDWP_ERROR_INVALID_ARRAY;
     }
     GetClassManager().CheckOnException(jni);
     if (arr == 0) {
-        throw AgentException(JDWP_ERROR_OUT_OF_MEMORY);
+        AgentException e(JDWP_ERROR_OUT_OF_MEMORY);
+		JDWP_SET_EXCEPTION(e);
+        return JDWP_ERROR_OUT_OF_MEMORY;
     }
 
-    JDWP_TRACE_DATA("NewInstance: send: tag=" << JDWP_TAG_ARRAY
-                << ", newArray=" << arr);
+    JDWP_TRACE(LOG_RELEASE, (LOG_DATA_FL, "NewInstance: send: tag=%s, newArray=%p", JDWP_TAG_ARRAY, arr));
     m_cmdParser->reply.WriteByte(JDWP_TAG_ARRAY);
     m_cmdParser->reply.WriteArrayID(jni, arr);
+
+    return JDWP_ERROR_NONE;
 }

Modified: harmony/enhanced/jdktools/branches/java6/modules/jpda/src/main/native/jdwp/common/agent/commands/ArrayType.h
URL: http://svn.apache.org/viewvc/harmony/enhanced/jdktools/branches/java6/modules/jpda/src/main/native/jdwp/common/agent/commands/ArrayType.h?rev=794726&r1=794725&r2=794726&view=diff
==============================================================================
--- harmony/enhanced/jdktools/branches/java6/modules/jpda/src/main/native/jdwp/common/agent/commands/ArrayType.h (original)
+++ harmony/enhanced/jdktools/branches/java6/modules/jpda/src/main/native/jdwp/common/agent/commands/ArrayType.h Thu Jul 16 15:57:37 2009
@@ -17,11 +17,6 @@
  */
 
 /**
- * @author Viacheslav G. Rybalov
- * @version $Revision: 1.5.2.1 $
- */
-
-/**
  * @file
  * ArrayType.h
  *
@@ -54,7 +49,7 @@
              *
              * @param jni - the JNI interface pointer
              */
-            virtual void Execute(JNIEnv *jni) throw(AgentException);
+            virtual int Execute(JNIEnv *jni);
 
         };//NewInstanceHandler
 

Modified: harmony/enhanced/jdktools/branches/java6/modules/jpda/src/main/native/jdwp/common/agent/commands/ClassLoaderReference.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/jdktools/branches/java6/modules/jpda/src/main/native/jdwp/common/agent/commands/ClassLoaderReference.cpp?rev=794726&r1=794725&r2=794726&view=diff
==============================================================================
--- harmony/enhanced/jdktools/branches/java6/modules/jpda/src/main/native/jdwp/common/agent/commands/ClassLoaderReference.cpp (original)
+++ harmony/enhanced/jdktools/branches/java6/modules/jpda/src/main/native/jdwp/common/agent/commands/ClassLoaderReference.cpp Thu Jul 16 15:57:37 2009
@@ -15,37 +15,36 @@
  *  See the License for the specific language governing permissions and
  *  limitations under the License.
  */
-
-/**
- * @author Viacheslav G. Rybalov
- * @version $Revision: 1.10 $
- */
 #include "ClassLoaderReference.h"
 #include "PacketParser.h"
 #include "ClassManager.h"
+#include "ExceptionManager.h"
+
 
 using namespace jdwp;
 using namespace ClassLoaderReference;
 
-void
-ClassLoaderReference::VisibleClassesHandler::Execute(JNIEnv *jni) throw(AgentException)
+int
+ClassLoaderReference::VisibleClassesHandler::Execute(JNIEnv *jni) 
 {
     jobject initiating_loader = m_cmdParser->command.ReadObjectIDOrNull(jni);
-    JDWP_TRACE_DATA("VisibleClasses: received: classLoaderObject=" << initiating_loader);
+    JDWP_TRACE(LOG_RELEASE, (LOG_DATA_FL, "VisibleClasses: received: classLoaderObject=%p", initiating_loader));
 
     jint class_count = 0;
     jclass* classes = 0;
 
     jvmtiError err;
-    JVMTI_TRACE(err, GetJvmtiEnv()->GetClassLoaderClasses(initiating_loader,
+    JVMTI_TRACE(LOG_DEBUG, err, GetJvmtiEnv()->GetClassLoaderClasses(initiating_loader,
         &class_count, &classes));
     JvmtiAutoFree afv(classes);
     if (err != JVMTI_ERROR_NONE) {
-        throw AgentException(err);
+        AgentException e(err);
+		JDWP_SET_EXCEPTION(e);
+        return err;
     }
     JDWP_ASSERT(classes != 0);
     
-    JDWP_TRACE_DATA("VisibleClasses: classes=" << class_count);
+    JDWP_TRACE(LOG_RELEASE, (LOG_DATA_FL, "VisibleClasses: classes=%d", class_count));
     m_cmdParser->reply.WriteInt(class_count);
 
     for (int i = 0; i < class_count; i++) {
@@ -55,17 +54,17 @@
         if (JDWP_TRACE_ENABLED(LOG_KIND_DATA)) {
             jvmtiError err;
             char* signature = 0;
-            JVMTI_TRACE(err, GetJvmtiEnv()->GetClassSignature(classes[i], &signature, 0));
+            JVMTI_TRACE(LOG_DEBUG, err, GetJvmtiEnv()->GetClassSignature(classes[i], &signature, 0));
             JvmtiAutoFree afs(signature);
 
-            JDWP_TRACE_DATA("VisibleClasses: send: class#=" << i
-                << ", typeTag=" << typeTag 
-                << ", typeID=" << classes[i] 
-                << ", signature=" << JDWP_CHECK_NULL(signature));
+            JDWP_TRACE(LOG_RELEASE, (LOG_DATA_FL, "VisibleClasses: send: class#=%d, typeTag=%d, typeID=%d, signature=%s", 
+                            i, typeTag, classes[i], JDWP_CHECK_NULL(signature)));
         }
 #endif
 
-        m_cmdParser->reply.WriteByte(typeTag);
+        m_cmdParser->reply.WriteByte((jbyte)typeTag);
         m_cmdParser->reply.WriteReferenceTypeID(jni, classes[i]);
     }
+
+    return JDWP_ERROR_NONE;
 }

Modified: harmony/enhanced/jdktools/branches/java6/modules/jpda/src/main/native/jdwp/common/agent/commands/ClassLoaderReference.h
URL: http://svn.apache.org/viewvc/harmony/enhanced/jdktools/branches/java6/modules/jpda/src/main/native/jdwp/common/agent/commands/ClassLoaderReference.h?rev=794726&r1=794725&r2=794726&view=diff
==============================================================================
--- harmony/enhanced/jdktools/branches/java6/modules/jpda/src/main/native/jdwp/common/agent/commands/ClassLoaderReference.h (original)
+++ harmony/enhanced/jdktools/branches/java6/modules/jpda/src/main/native/jdwp/common/agent/commands/ClassLoaderReference.h Thu Jul 16 15:57:37 2009
@@ -17,11 +17,6 @@
  */
 
 /**
- * @author Viacheslav G. Rybalov
- * @version $Revision: 1.4.2.1 $
- */
-
-/**
  * @file
  * ClassLoaderReference.h
  *
@@ -54,7 +49,7 @@
              *
              * @param jni - the JNI interface pointer
              */
-            virtual void Execute(JNIEnv *jni) throw(AgentException);
+            virtual int Execute(JNIEnv *jni);
 
         };//VisibleClassesHandler
 

Modified: harmony/enhanced/jdktools/branches/java6/modules/jpda/src/main/native/jdwp/common/agent/commands/ClassObjectReference.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/jdktools/branches/java6/modules/jpda/src/main/native/jdwp/common/agent/commands/ClassObjectReference.cpp?rev=794726&r1=794725&r2=794726&view=diff
==============================================================================
--- harmony/enhanced/jdktools/branches/java6/modules/jpda/src/main/native/jdwp/common/agent/commands/ClassObjectReference.cpp (original)
+++ harmony/enhanced/jdktools/branches/java6/modules/jpda/src/main/native/jdwp/common/agent/commands/ClassObjectReference.cpp Thu Jul 16 15:57:37 2009
@@ -15,23 +15,20 @@
  *  See the License for the specific language governing permissions and
  *  limitations under the License.
  */
-
-/**
- * @author Viacheslav G. Rybalov
- * @version $Revision: 1.9 $
- */
 #include "ClassObjectReference.h"
 #include "PacketParser.h"
 #include "ClassManager.h"
+#include "ExceptionManager.h"
+
 
 using namespace jdwp;
 using namespace ClassObjectReference;
 
-void
-ClassObjectReference::ReflectedTypeHandler::Execute(JNIEnv *jni) throw(AgentException)
+int
+ClassObjectReference::ReflectedTypeHandler::Execute(JNIEnv *jni)
 {
     jclass classObject = static_cast<jclass>(m_cmdParser->command.ReadObjectID(jni));
-    JDWP_TRACE_DATA("ReflectedType: received: classObject=" << classObject);
+    JDWP_TRACE(LOG_RELEASE, (LOG_DATA_FL, "ReflectedType: received: classObject=%p", classObject));
 
     jdwpTypeTag typeTag = AgentBase::GetClassManager().GetJdwpTypeTag(classObject); 
 
@@ -39,14 +36,14 @@
     if (JDWP_TRACE_ENABLED(LOG_KIND_DATA)) {
         jvmtiError err;
         char* signature = 0;
-        JVMTI_TRACE(err, GetJvmtiEnv()->GetClassSignature(classObject, &signature, 0));
+        JVMTI_TRACE(LOG_DEBUG, err, GetJvmtiEnv()->GetClassSignature(classObject, &signature, 0));
         JvmtiAutoFree afs(signature);
-        JDWP_TRACE_DATA("ReflectedType: send: typeTag=" << typeTag
-            << ", typeID=" << classObject
-            << ", signature=" << JDWP_CHECK_NULL(signature));
+        JDWP_TRACE(LOG_RELEASE, (LOG_DATA_FL, "ReflectedType: send: typeTag=%d, typeID=%d, signature=%s", typeTag, classObject, JDWP_CHECK_NULL(signature)));
     }
 #endif
 
-    m_cmdParser->reply.WriteByte(typeTag);
+    m_cmdParser->reply.WriteByte((jbyte)typeTag);
     m_cmdParser->reply.WriteReferenceTypeID(jni, classObject);
+
+    return JDWP_ERROR_NONE;
 }

Modified: harmony/enhanced/jdktools/branches/java6/modules/jpda/src/main/native/jdwp/common/agent/commands/ClassObjectReference.h
URL: http://svn.apache.org/viewvc/harmony/enhanced/jdktools/branches/java6/modules/jpda/src/main/native/jdwp/common/agent/commands/ClassObjectReference.h?rev=794726&r1=794725&r2=794726&view=diff
==============================================================================
--- harmony/enhanced/jdktools/branches/java6/modules/jpda/src/main/native/jdwp/common/agent/commands/ClassObjectReference.h (original)
+++ harmony/enhanced/jdktools/branches/java6/modules/jpda/src/main/native/jdwp/common/agent/commands/ClassObjectReference.h Thu Jul 16 15:57:37 2009
@@ -17,11 +17,6 @@
  */
 
 /**
- * @author Viacheslav G. Rybalov
- * @version $Revision: 1.4.2.1 $
- */
-
-/**
  * @file
  * ClassObjectReference.h
  *
@@ -54,7 +49,7 @@
              *
              * @param jni - the JNI interface pointer
              */
-            virtual void Execute(JNIEnv *jni) throw(AgentException);
+            virtual int Execute(JNIEnv *jni);
 
         };//ReflectedTypeHandler
 

Modified: harmony/enhanced/jdktools/branches/java6/modules/jpda/src/main/native/jdwp/common/agent/commands/ClassType.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/jdktools/branches/java6/modules/jpda/src/main/native/jdwp/common/agent/commands/ClassType.cpp?rev=794726&r1=794725&r2=794726&view=diff
==============================================================================
--- harmony/enhanced/jdktools/branches/java6/modules/jpda/src/main/native/jdwp/common/agent/commands/ClassType.cpp (original)
+++ harmony/enhanced/jdktools/branches/java6/modules/jpda/src/main/native/jdwp/common/agent/commands/ClassType.cpp Thu Jul 16 15:57:37 2009
@@ -15,18 +15,14 @@
  *  See the License for the specific language governing permissions and
  *  limitations under the License.
  */
-
-/**
- * @author Viacheslav G. Rybalov, Anton V. Karnachuk
- * @version $Revision: 1.25 $
- */
-#include <string.h>
-
 #include "ClassType.h"
 
 #include "PacketParser.h"
 #include "ClassManager.h"
 #include "ThreadManager.h"
+#include "ExceptionManager.h"
+
+#include <string.h>
 
 using namespace jdwp;
 using namespace ClassType;
@@ -34,12 +30,12 @@
 //-----------------------------------------------------------------------------
 // SuperClass -----------------------------------------------------------------
 
-void 
-ClassType::SuperClassHandler::Execute(JNIEnv *jni) throw(AgentException) 
+int 
+ClassType::SuperClassHandler::Execute(JNIEnv *jni)
 {
     //INVALID_OBJECT can be thrown below
     jclass clazz = m_cmdParser->command.ReadReferenceTypeID(jni);
-    JDWP_TRACE_DATA("SuperClass: received: classID=" << clazz);
+    JDWP_TRACE(LOG_RELEASE, (LOG_DATA_FL, "SuperClass: received: classID=%p", clazz));
 
     // get superclass
     jclass superClazz = jni->GetSuperclass(clazz);
@@ -50,43 +46,47 @@
     if (JDWP_TRACE_ENABLED(LOG_KIND_DATA)) {
         jvmtiError err;
         char* signature = 0;
-        JVMTI_TRACE(err, GetJvmtiEnv()->GetClassSignature(superClazz, &signature, 0));
+        JVMTI_TRACE(LOG_DEBUG, err, GetJvmtiEnv()->GetClassSignature(superClazz, &signature, 0));
         JvmtiAutoFree afs(signature);
-        JDWP_TRACE_DATA("SuperClass: send: superClassID=" << superClazz
-            << ", classSignature=" << JDWP_CHECK_NULL(signature));
+        JDWP_TRACE(LOG_RELEASE, (LOG_DATA_FL, "SuperClass: send: superClassID=%p, classSignature=%s", superClazz, JDWP_CHECK_NULL(signature)));
     }
 #endif
 
     // write super class to the reply
     m_cmdParser->reply.WriteReferenceTypeID(jni, superClazz);
+
+    return JDWP_ERROR_NONE;
 }
 
 //-----------------------------------------------------------------------------
 // SetValues -----------------------------------------------------------------
 
-void 
-ClassType::SetValuesHandler::Execute(JNIEnv *jni) throw(AgentException) 
+int 
+ClassType::SetValuesHandler::Execute(JNIEnv *jni) 
 {
     //INVALID_CLASS or INVALID_OBJECT can be thrown below
     jclass clazz = m_cmdParser->command.ReadReferenceTypeID(jni);
     jint values = m_cmdParser->command.ReadInt();
-    JDWP_TRACE_DATA("SetValues: received: classID=" << clazz 
-        << ", values=" << values);
+    JDWP_TRACE(LOG_RELEASE, (LOG_DATA_FL, "SetValues: received: classID=%p, values=%d", clazz, values));
 
     jvmtiEnv* jvmti = AgentBase::GetJvmtiEnv();
 
     // check for CLASS_NOT_PREPARED
     jint status;
     jvmtiError err;
-    JVMTI_TRACE(err, jvmti->GetClassStatus(clazz, &status));
+    JVMTI_TRACE(LOG_DEBUG, err, jvmti->GetClassStatus(clazz, &status));
 
     if (err != JVMTI_ERROR_NONE) {
         // Can be: JVMTI_ERROR_INVALID_CLASS, JVMTI_ERROR_NULL_POINTER
-        throw AgentException(err);
-    }
-    jint const JVMTI_CLASS_STATUS_PREPARED = 0x2;
-    if ( (status & JVMTI_CLASS_STATUS_PREPARED) == 0 ) {
-        throw AgentException(JDWP_ERROR_CLASS_NOT_PREPARED);
+        AgentException e(err);
+		JDWP_SET_EXCEPTION(e);
+        return err;
+    }
+    // jint const JVMTI_CLASS_STATUS_PREPARED = 0x2 ;
+    if ( (status & 0x2) == 0 ) {
+        AgentException e(JDWP_ERROR_CLASS_NOT_PREPARED);
+		JDWP_SET_EXCEPTION(e);
+        return JDWP_ERROR_CLASS_NOT_PREPARED;
     }
 
     //Repeats values times:
@@ -97,32 +97,40 @@
         // taking into account inheritance
         jvmtiError err;
         jclass declaringClass;
-        JVMTI_TRACE(err, jvmti->GetFieldDeclaringClass(clazz, fieldID,
+        JVMTI_TRACE(LOG_DEBUG, err, jvmti->GetFieldDeclaringClass(clazz, fieldID,
             &declaringClass));
 
         if (err != JVMTI_ERROR_NONE) {
-            throw AgentException(err);
+            AgentException e(err);
+			JDWP_SET_EXCEPTION(e);
+            return err;
         }
 
         if ( jni->IsAssignableFrom(clazz, declaringClass) == JNI_FALSE ) {
             // given field does not belong to passed jvmClass
-            throw AgentException(JDWP_ERROR_INVALID_FIELDID);
+            AgentException e(JDWP_ERROR_INVALID_FIELDID);
+			JDWP_SET_EXCEPTION(e);
+            return JDWP_ERROR_INVALID_FIELDID;
         }
 
         // Check non-static field
         jint fieldModifiers;
-        JVMTI_TRACE(err, jvmti->GetFieldModifiers(clazz, fieldID,
+        JVMTI_TRACE(LOG_DEBUG, err, jvmti->GetFieldModifiers(clazz, fieldID,
             &fieldModifiers));
 
         if (err != JVMTI_ERROR_NONE) {
             // Can be: JVMTI_ERROR_INVALID_CLASS, JVMTI_ERROR_INVALID_FIELDID,
             // JVMTI_ERROR_NULL_POINTER
-            throw AgentException(err);
+            AgentException e(err);
+			JDWP_SET_EXCEPTION(e);
+            return err;
         }
 
         if ( (fieldModifiers & 0x0008) == 0 ) { // ACC_STATIC_FLAG = 0x0008;
             // given field is not static
-            throw AgentException(JDWP_ERROR_INVALID_FIELDID);
+            AgentException e(JDWP_ERROR_INVALID_FIELDID);
+			JDWP_SET_EXCEPTION(e);
+            return JDWP_ERROR_INVALID_FIELDID;
         }
 
         //Do not check field for final - for compatibility with jdwp
@@ -133,7 +141,7 @@
         char* p_signature = 0;
 
         // try to obtain the field's name and signature
-        JVMTI_TRACE(err, jvmti->GetFieldName(clazz, fieldID,
+        JVMTI_TRACE(LOG_DEBUG, err, jvmti->GetFieldName(clazz, fieldID,
             &p_name, &p_signature, 0));
 
         // create auto-free pointers for the following objects
@@ -143,25 +151,24 @@
         if (err != JVMTI_ERROR_NONE) {
             // can be one of jvmti universal errors or
             // JVMTI_ERROR_INVALID_CLASS or JVMTI_ERROR_INVALID_FIELDID
-            throw AgentException(err);
+            AgentException e(err);
+			JDWP_SET_EXCEPTION(e);
+            return err;
         }
 
         jdwpTag tag = GetClassManager().GetJdwpTagFromSignature(p_signature);
         if (tag == JDWP_TAG_NONE) {
-            JDWP_TRACE_DATA("SetValues: unknown field signature: " 
-                << JDWP_CHECK_NULL(p_signature));
-            throw InternalErrorException();
+            JDWP_TRACE(LOG_RELEASE, (LOG_DATA_FL, "SetValues: unknown field signature: %s", JDWP_CHECK_NULL(p_signature)));
+            AgentException e(JDWP_ERROR_INTERNAL);
+			JDWP_SET_EXCEPTION(e);
+            return JDWP_ERROR_INTERNAL;
         }
 
         jvalue value = m_cmdParser->command.ReadUntaggedValue(jni, tag);
         // Can be: InternalErrorException, OutOfMemoryException,
         // JDWP_ERROR_INVALID_OBJECT
-        JDWP_TRACE_DATA("SetValues: set: value#="<< i 
-            << ", fieldID=" << fieldID 
-            << ", fieldModifiers=" << fieldModifiers 
-            << ", fieldName=" << JDWP_CHECK_NULL(p_name) 
-            << ", fieldSignature=" << JDWP_CHECK_NULL(p_signature) 
-            << ", tag=" << tag);
+        JDWP_TRACE(LOG_RELEASE, (LOG_DATA_FL, "SetValues: set: value#=%d, fieldID=%p, fieldModifiers=%d, fieldName=%s, fieldSignature=%s, tag=%d",
+                        i, fieldID, fieldModifiers, JDWP_CHECK_NULL(p_name), JDWP_CHECK_NULL(p_signature), tag));
         
         switch (tag) {
         case JDWP_TAG_BOOLEAN:
@@ -192,7 +199,9 @@
         case JDWP_TAG_ARRAY:
             if (!GetClassManager().IsObjectValueFitsFieldType(
                     jni, value.l, p_signature) ) {
-                throw AgentException(JDWP_ERROR_INVALID_OBJECT);
+                AgentException e(JDWP_ERROR_INVALID_OBJECT);
+				JDWP_SET_EXCEPTION(e);
+                return JDWP_ERROR_INVALID_OBJECT;
             }
             jni->SetStaticObjectField(clazz, fieldID, value.l);
             break;
@@ -203,6 +212,7 @@
 
     }
 
+    return JDWP_ERROR_NONE;
 }
 
 //-----------------------------------------------------------------------------
@@ -212,21 +222,21 @@
     return "_jdwp_ClassType_InvokeMethod";
 }
 
-void 
-ClassType::InvokeMethodHandler::Execute(JNIEnv *jni) throw(AgentException) 
+int 
+ClassType::InvokeMethodHandler::Execute(JNIEnv *jni)
 {
     m_clazz = m_cmdParser->command.ReadReferenceTypeID(jni);
     m_thread = m_cmdParser->command.ReadThreadID(jni);
     m_methodID = m_cmdParser->command.ReadMethodID(jni);
     jint arguments = m_cmdParser->command.ReadInt();
 
-    JDWP_TRACE_DATA("InvokeMethod: received: refTypeID=" << m_clazz 
-        << ", threadID=" << m_thread 
-        << ", methodID=" << m_methodID
-        << ", arguments=" << arguments);
+    JDWP_TRACE(LOG_RELEASE, (LOG_DATA_FL, "InvokeMethod: received: refTypeID=%p, threadID=%p, methodID=%p, arguments=%d", 
+                    m_clazz, m_thread, m_methodID, arguments));
 
     if (AgentBase::GetClassManager().IsClass(jni, m_clazz) != JNI_TRUE) {
-        throw AgentException(JDWP_ERROR_INVALID_CLASS);
+        AgentException e(JDWP_ERROR_INVALID_CLASS);
+		JDWP_SET_EXCEPTION(e);
+        return JDWP_ERROR_INVALID_CLASS;
     }
 
     jvmtiEnv* jvmti = AgentBase::GetJvmtiEnv();
@@ -235,37 +245,47 @@
     // check that given method belongs to passed class
     // taking into account inheritance
     jclass declaringClass;
-    JVMTI_TRACE(err, jvmti->GetMethodDeclaringClass(m_methodID, &declaringClass));
+    JVMTI_TRACE(LOG_DEBUG, err, jvmti->GetMethodDeclaringClass(m_methodID, &declaringClass));
 
     if (err != JVMTI_ERROR_NONE) {
-        throw AgentException(err);
+        AgentException e(err);
+		JDWP_SET_EXCEPTION(e);
+        return err;
     }
 
     if ( jni->IsAssignableFrom(m_clazz, declaringClass) == JNI_FALSE ) {
         // given method does not belong to passed class
-        JDWP_TRACE_DATA("InvokeMethod: given method does not belong to passed class");
-        throw AgentException(JDWP_ERROR_INVALID_METHODID);
+        JDWP_TRACE(LOG_RELEASE, (LOG_DATA_FL, "InvokeMethod: given method does not belong to passed class"));
+        AgentException e(JDWP_ERROR_INVALID_METHODID);
+		JDWP_SET_EXCEPTION(e);
+        return JDWP_ERROR_INVALID_METHODID;
     }
 
     // check that given method is stsic method
     jint methodModifiers;
-    JVMTI_TRACE(err, jvmti->GetMethodModifiers(m_methodID, &methodModifiers));
+    JVMTI_TRACE(LOG_DEBUG, err, jvmti->GetMethodModifiers(m_methodID, &methodModifiers));
     if (err != JVMTI_ERROR_NONE) {
-        throw AgentException(err);
+        AgentException e(err);
+		JDWP_SET_EXCEPTION(e);
+        return err;
     }
 
     if ( (methodModifiers & 0x0008) == 0 ) { // ACC_STATIC_FLAG = 0x0008;
         // given method is not static
-        JDWP_TRACE_DATA("InvokeMethod: given method is not static");
-        throw AgentException(JDWP_ERROR_INVALID_METHODID);
+        JDWP_TRACE(LOG_RELEASE, (LOG_DATA_FL, "InvokeMethod: given method is not static"));
+        AgentException e(JDWP_ERROR_INVALID_METHODID);
+		JDWP_SET_EXCEPTION(e);
+        return JDWP_ERROR_INVALID_METHODID;
     }
 
     char* signature = 0;
     char* name = 0;
-    JVMTI_TRACE(err, jvmti->GetMethodName(m_methodID,
+    JVMTI_TRACE(LOG_DEBUG, err, jvmti->GetMethodName(m_methodID,
         &name, &signature, 0 /*&generic signature*/));
     if (err != JVMTI_ERROR_NONE) {
-        throw AgentException(err);
+        AgentException e(err);
+		JDWP_SET_EXCEPTION(e);
+        return err;
     }
     
     JvmtiAutoFree afv2(signature);
@@ -275,12 +295,10 @@
     if (JDWP_TRACE_ENABLED(LOG_KIND_DATA)) {
         jvmtiError err;
         char* classSignature = 0;
-        JVMTI_TRACE(err, GetJvmtiEnv()->GetClassSignature(m_clazz, &classSignature, 0));
+        JVMTI_TRACE(LOG_DEBUG, err, GetJvmtiEnv()->GetClassSignature(m_clazz, &classSignature, 0));
         JvmtiAutoFree afs(classSignature);
-        JDWP_TRACE_DATA("InvokeMethod: call: method=" << JDWP_CHECK_NULL(name) 
-            << ", sig=" << JDWP_CHECK_NULL(signature)
-            << ", class=" << JDWP_CHECK_NULL(classSignature)
-            << ", thread=" << m_thread);
+        JDWP_TRACE(LOG_RELEASE, (LOG_DATA_FL, "InvokeMethod: call: method=%s, sig=%s, class=%s, thread=%p", 
+                        JDWP_CHECK_NULL(name), JDWP_CHECK_NULL(signature), JDWP_CHECK_NULL(classSignature), m_thread));
     }
 #endif
 
@@ -291,8 +309,10 @@
     int methodArguments = getArgsNumber(signature);
 
     if (arguments != methodArguments) {
-        JDWP_TRACE_DATA("InvokeMethod: arguments != methodArguments");
-        throw AgentException(JDWP_ERROR_ILLEGAL_ARGUMENT);
+        JDWP_TRACE(LOG_RELEASE, (LOG_DATA_FL, "InvokeMethod: arguments != methodArguments"));
+        AgentException e(JDWP_ERROR_ILLEGAL_ARGUMENT);
+		JDWP_SET_EXCEPTION(e);
+        return JDWP_ERROR_ILLEGAL_ARGUMENT;
     }
     if (arguments != 0) {
         m_methodValues = 
@@ -305,9 +325,11 @@
     m_returnValue.tag = static_cast<jdwpTag>(*(strchr(signature, ')') + 1));
     for (jint i = 0; i < arguments; i++) {
         jdwpTaggedValue tValue = m_cmdParser->command.ReadValue(jni);
-        if (IsArgValid(jni, i, tValue, signature) != JNI_TRUE) {
-            JDWP_TRACE_DATA("InvokeMethod: bad argument " << i << ": sig=" << signature);
-            throw AgentException(JDWP_ERROR_TYPE_MISMATCH);
+        if (IsArgValid(jni, m_clazz, i, tValue, signature) != JNI_TRUE) {
+            JDWP_TRACE(LOG_RELEASE, (LOG_DATA_FL, "InvokeMethod: bad argument %d: sig=%s", i, signature));
+            AgentException e(JDWP_ERROR_TYPE_MISMATCH);
+			JDWP_SET_EXCEPTION(e);
+            return JDWP_ERROR_TYPE_MISMATCH;
         }
         m_methodValues[i] = tValue.value;
     }
@@ -316,7 +338,8 @@
     m_returnError = JDWP_ERROR_NONE;
     m_returnException = 0;
 
-    WaitDeferredInvocation(jni);
+    int ret = WaitDeferredInvocation(jni);
+    JDWP_CHECK_RETURN(ret);
 
     if (m_returnError == JDWP_ERROR_NONE) {
         m_cmdParser->reply.WriteValue(jni, m_returnValue.tag, m_returnValue.value);
@@ -343,24 +366,23 @@
     }
 
     if (m_returnError != JDWP_ERROR_NONE) {
-        throw AgentException(m_returnError);
+        AgentException e(m_returnError);
+		JDWP_SET_EXCEPTION(e);
+        return m_returnError;
     }
 
 #ifndef NDEBUG
     if (JDWP_TRACE_ENABLED(LOG_KIND_DATA)) {
         jvmtiError err;
         char* classSignature = 0;
-        JVMTI_TRACE(err, GetJvmtiEnv()->GetClassSignature(m_clazz, &classSignature, 0));
+        JVMTI_TRACE(LOG_DEBUG, err, GetJvmtiEnv()->GetClassSignature(m_clazz, &classSignature, 0));
         JvmtiAutoFree afs(classSignature);
-        JDWP_LOG("InvokeMethod: return: method=" << JDWP_CHECK_NULL(name)
-            << ", sig=" << JDWP_CHECK_NULL(signature)
-            << ", class=" << JDWP_CHECK_NULL(classSignature)
-            << ", thread=" << m_thread
-            << ", returnValueTag=" << m_returnValue.tag
-            << ", returnException=" << m_returnException);
+        JDWP_TRACE(LOG_RELEASE, (LOG_LOG_FL, "InvokeMethod: return: method=%s, sig=%s, class=%s, thread=%p, returnValueTag=%d, returnException=%p", 
+                 JDWP_CHECK_NULL(name), JDWP_CHECK_NULL(signature), JDWP_CHECK_NULL(classSignature), m_thread, m_returnValue.tag, m_returnException));
     }
 #endif
 
+    return JDWP_ERROR_NONE;
 }
 
 void 
@@ -398,6 +420,7 @@
     case JDWP_TAG_VOID:
         jni->CallStaticVoidMethodA(m_clazz, m_methodID, m_methodValues);
         break;
+    case JDWP_TAG_ARRAY:
     case JDWP_TAG_OBJECT: {
         m_returnValue.value.l =
             jni->CallStaticObjectMethodA(m_clazz, m_methodID, m_methodValues);
@@ -432,31 +455,33 @@
     return "_jdwp_ClassType_NewInstanceHandler";
 }
 
-void 
-ClassType::NewInstanceHandler::Execute(JNIEnv *jni) throw(AgentException) 
+int 
+ClassType::NewInstanceHandler::Execute(JNIEnv *jni) 
 {
     m_clazz = m_cmdParser->command.ReadReferenceTypeID(jni);
     if (AgentBase::GetClassManager().IsClass(jni, m_clazz) != JNI_TRUE) {
-        JDWP_TRACE_DATA("NewInstance: not a class: refTypeID=" << m_clazz);
-        throw AgentException(JDWP_ERROR_INVALID_CLASS);
+        JDWP_TRACE(LOG_RELEASE, (LOG_DATA_FL, "NewInstance: not a class: refTypeID=%p", m_clazz));
+        AgentException e(JDWP_ERROR_INVALID_CLASS);
+		JDWP_SET_EXCEPTION(e);
+        return JDWP_ERROR_INVALID_CLASS;
     }
 
     m_thread = m_cmdParser->command.ReadThreadID(jni);
     m_methodID = m_cmdParser->command.ReadMethodID(jni);
     int passedArguments = m_cmdParser->command.ReadInt();
 
-    JDWP_TRACE_DATA("NewInstance: received: refTypeID=" << m_clazz 
-        << ", threadID=" << m_thread 
-        << ", methodID=" << m_methodID
-        << ", arguments=" << passedArguments);
+    JDWP_TRACE(LOG_RELEASE, (LOG_DATA_FL, "NewInstance: received: refTypeID=%p, threadID=%p, methodID=%p, arguments=%d", 
+                    m_clazz, m_thread, m_methodID, passedArguments));
 
     char* signature = 0;
     char* name = 0;
     jvmtiError err;
-    JVMTI_TRACE(err, GetJvmtiEnv()->GetMethodName(m_methodID,
+    JVMTI_TRACE(LOG_DEBUG, err, GetJvmtiEnv()->GetMethodName(m_methodID,
         &name, &signature, 0 /*&generic signature*/));
     if (err != JVMTI_ERROR_NONE) {
-        throw AgentException(err);
+        AgentException e(err);
+		JDWP_SET_EXCEPTION(e);
+        return err;
     }
     
     JvmtiAutoFree afv2(signature);
@@ -466,12 +491,10 @@
     if (JDWP_TRACE_ENABLED(LOG_KIND_DATA)) {
         jvmtiError err;
         char* classSignature = 0;
-        JVMTI_TRACE(err, GetJvmtiEnv()->GetClassSignature(m_clazz, &classSignature, 0));
+        JVMTI_TRACE(LOG_DEBUG, err, GetJvmtiEnv()->GetClassSignature(m_clazz, &classSignature, 0));
         JvmtiAutoFree afs(classSignature);
-        JDWP_TRACE_DATA("NewInstance: call method=" << JDWP_CHECK_NULL(name) 
-            << ", sig=" << JDWP_CHECK_NULL(signature)
-            << ", class=" << JDWP_CHECK_NULL(classSignature)
-            << ", thread=" << m_thread);
+        JDWP_TRACE(LOG_RELEASE, (LOG_DATA_FL, "NewInstance: call method=%s, sig=%s, class=%s, thread=%p",
+                        JDWP_CHECK_NULL(name), JDWP_CHECK_NULL(signature), JDWP_CHECK_NULL(classSignature), m_thread));
     }
 #endif
 
@@ -482,8 +505,10 @@
     int methodArguments = getArgsNumber(signature);
 
     if (passedArguments != methodArguments) {
-        JDWP_TRACE_DATA("NewInstance: passedArguments != methodArguments");
-        throw AgentException(JDWP_ERROR_ILLEGAL_ARGUMENT);
+        JDWP_TRACE(LOG_RELEASE, (LOG_DATA_FL, "NewInstance: passedArguments != methodArguments"));
+        AgentException e(JDWP_ERROR_ILLEGAL_ARGUMENT);
+		JDWP_SET_EXCEPTION(e);
+        return JDWP_ERROR_ILLEGAL_ARGUMENT;
     }
     if (passedArguments != 0) {
         m_methodValues = 
@@ -495,9 +520,11 @@
 
     for (int i = 0; i < passedArguments; i++) {
         jdwpTaggedValue tValue = m_cmdParser->command.ReadValue(jni);
-        if (IsArgValid(jni, i, tValue, signature) != JNI_TRUE) {
-            JDWP_TRACE_DATA("NewInstance: bad argument " << i << ": sig=" << signature);
-            throw AgentException(JDWP_ERROR_TYPE_MISMATCH);
+        if (IsArgValid(jni, m_clazz, i, tValue, signature) != JNI_TRUE) {
+            JDWP_TRACE(LOG_RELEASE, (LOG_DATA_FL, "NewInstance: bad argument %d: sig=%s", i, signature));
+            AgentException e(JDWP_ERROR_TYPE_MISMATCH);
+			JDWP_SET_EXCEPTION(e);
+            return JDWP_ERROR_TYPE_MISMATCH;
         }
         m_methodValues[i] = tValue.value;
     }
@@ -507,7 +534,8 @@
     m_returnException = 0;
     m_returnValue = 0;
 
-    WaitDeferredInvocation(jni);
+    int ret = WaitDeferredInvocation(jni);
+    JDWP_CHECK_RETURN(ret);
 
     if (m_returnError == JDWP_ERROR_NONE) {
         m_cmdParser->reply.WriteTaggedObjectID(jni, m_returnValue);
@@ -522,24 +550,23 @@
     }
 
     if (m_returnError != JDWP_ERROR_NONE) {
-        throw AgentException(m_returnError);
+        AgentException e(m_returnError);
+		JDWP_SET_EXCEPTION(e);
+        return m_returnError;
     }
 
 #ifndef NDEBUG
     if (JDWP_TRACE_ENABLED(LOG_KIND_DATA)) {
         jvmtiError err;
         char* classSignature = 0;
-        JVMTI_TRACE(err, GetJvmtiEnv()->GetClassSignature(m_clazz, &classSignature, 0));
+        JVMTI_TRACE(LOG_DEBUG, err, GetJvmtiEnv()->GetClassSignature(m_clazz, &classSignature, 0));
         JvmtiAutoFree afs(classSignature);
-        JDWP_LOG("NewInstance: return: methodName=" << JDWP_CHECK_NULL(name)
-            << ", sig=" << JDWP_CHECK_NULL(signature)
-            << ", class=" << JDWP_CHECK_NULL(classSignature)
-            << ", thread=" << m_thread
-            << ", returnObject=" << m_returnValue
-            << ", returnException=" << m_returnException);
+        JDWP_TRACE(LOG_RELEASE, (LOG_LOG_FL, "NewInstance: return: methodName=%s, sig=%s, class=%s, thread=%p, returnObject=%d, returnException=%p",
+                 JDWP_CHECK_NULL(name), JDWP_CHECK_NULL(signature), JDWP_CHECK_NULL(classSignature), m_thread, m_returnValue, m_returnException));
     }
 #endif
 
+    return JDWP_ERROR_NONE;
 }
 
 void 

Modified: harmony/enhanced/jdktools/branches/java6/modules/jpda/src/main/native/jdwp/common/agent/commands/ClassType.h
URL: http://svn.apache.org/viewvc/harmony/enhanced/jdktools/branches/java6/modules/jpda/src/main/native/jdwp/common/agent/commands/ClassType.h?rev=794726&r1=794725&r2=794726&view=diff
==============================================================================
--- harmony/enhanced/jdktools/branches/java6/modules/jpda/src/main/native/jdwp/common/agent/commands/ClassType.h (original)
+++ harmony/enhanced/jdktools/branches/java6/modules/jpda/src/main/native/jdwp/common/agent/commands/ClassType.h Thu Jul 16 15:57:37 2009
@@ -17,11 +17,6 @@
  */
 
 /**
- * @author Viacheslav G. Rybalov, Anton V. Karnachuk
- * @version $Revision: 1.7.2.1 $
- */
-
-/**
  * @file
  * ClassType.h
  *
@@ -63,7 +58,7 @@
              *                      interface may throw <code>AgentException</code>:
              *                      INVALID_CLASS, INVALID_OBJECT, VM_DEAD
              */
-            virtual void Execute(JNIEnv *jni) throw(AgentException);
+            virtual int Execute(JNIEnv *jni) ;
 
         }; //SuperClassHandler
 
@@ -90,7 +85,7 @@
              *                      CLASS_NOT_PREPARED,INVALID_OBJECT, INVALID_FIELDID, 
              *                      VM_DEAD.
              */
-            virtual void Execute(JNIEnv *jni) throw(AgentException);
+            virtual int Execute(JNIEnv *jni) ;
 
         }; //SetValuesHandler
 
@@ -123,7 +118,7 @@
              *
              * @param jni - the JNI interface pointer
              */
-            virtual void Execute(JNIEnv *jni) throw(AgentException);
+            virtual int Execute(JNIEnv *jni) ;
 
         private:
             jclass m_clazz;
@@ -164,7 +159,7 @@
              *
              * @param jni - the JNI interface pointer
              */
-            virtual void Execute(JNIEnv *jni) throw(AgentException);
+            virtual int Execute(JNIEnv *jni) ;
 
         private:
             jclass m_clazz;



Mime
View raw message