harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hinde...@apache.org
Subject svn commit: r813329 - in /harmony/enhanced/jdktools/branches/java6/modules/jpda/src/main/native/jdwp/common/agent: commands/ObjectReference.cpp core/ExceptionManager.cpp core/ExceptionManager.h
Date Thu, 10 Sep 2009 09:39:14 GMT
Author: hindessm
Date: Thu Sep 10 09:39:14 2009
New Revision: 813329

URL: http://svn.apache.org/viewvc?rev=813329&view=rev
Log:
Fix for "[#HARMONY-6306] [jdktools][jdwp] SetValues002Test.testSetValues002
does not receive expected error in Java 6 jdktools branch".

Modified:
    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/core/ExceptionManager.cpp
    harmony/enhanced/jdktools/branches/java6/modules/jpda/src/main/native/jdwp/common/agent/core/ExceptionManager.h

Modified: harmony/enhanced/jdktools/branches/java6/modules/jpda/src/main/native/jdwp/common/agent/commands/ObjectReference.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/jdktools/branches/java6/modules/jpda/src/main/native/jdwp/common/agent/commands/ObjectReference.cpp?rev=813329&r1=813328&r2=813329&view=diff
==============================================================================
--- harmony/enhanced/jdktools/branches/java6/modules/jpda/src/main/native/jdwp/common/agent/commands/ObjectReference.cpp
(original)
+++ harmony/enhanced/jdktools/branches/java6/modules/jpda/src/main/native/jdwp/common/agent/commands/ObjectReference.cpp
Thu Sep 10 09:39:14 2009
@@ -298,6 +298,7 @@
 int
 ObjectReference::SetValuesHandler::Execute(JNIEnv *jni) 
 {
+    jdwpError jdwpErr;
     jobject jvmObject = m_cmdParser->command.ReadObjectID(jni);
     // Can be: InternalErrorException, OutOfMemoryException,
     // JDWP_ERROR_INVALID_OBJECT
@@ -382,6 +383,7 @@
             = m_cmdParser->command.ReadUntaggedValue(jni, fieldValueTag);
         // Can be: InternalErrorException, OutOfMemoryException,
         // JDWP_ERROR_INVALID_OBJECT
+        JDWP_CHECK_ERROR_CODE(jdwpErr);
 
         switch ( fieldValueTag ) {
         case JDWP_TAG_BOOLEAN:

Modified: harmony/enhanced/jdktools/branches/java6/modules/jpda/src/main/native/jdwp/common/agent/core/ExceptionManager.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/jdktools/branches/java6/modules/jpda/src/main/native/jdwp/common/agent/core/ExceptionManager.cpp?rev=813329&r1=813328&r2=813329&view=diff
==============================================================================
--- harmony/enhanced/jdktools/branches/java6/modules/jpda/src/main/native/jdwp/common/agent/core/ExceptionManager.cpp
(original)
+++ harmony/enhanced/jdktools/branches/java6/modules/jpda/src/main/native/jdwp/common/agent/core/ExceptionManager.cpp
Thu Sep 10 09:39:14 2009
@@ -137,3 +137,10 @@
     return *aex;
 }
 
+jdwpError ExceptionManager::ReadLastErrorCode() {
+    ThreadId_t tid = _GetCurrentThreadId(m_jvm);
+    MonitorAutoLock lock(m_monitor JDWP_FILE_LINE);
+    exception_context* context = GetCurrentContext(tid);
+    return (context == 0 || context->lastException == 0) ?
+        JDWP_ERROR_NONE : context->lastException->ErrCode();
+}

Modified: harmony/enhanced/jdktools/branches/java6/modules/jpda/src/main/native/jdwp/common/agent/core/ExceptionManager.h
URL: http://svn.apache.org/viewvc/harmony/enhanced/jdktools/branches/java6/modules/jpda/src/main/native/jdwp/common/agent/core/ExceptionManager.h?rev=813329&r1=813328&r2=813329&view=diff
==============================================================================
--- harmony/enhanced/jdktools/branches/java6/modules/jpda/src/main/native/jdwp/common/agent/core/ExceptionManager.h
(original)
+++ harmony/enhanced/jdktools/branches/java6/modules/jpda/src/main/native/jdwp/common/agent/core/ExceptionManager.h
Thu Sep 10 09:39:14 2009
@@ -34,6 +34,16 @@
 
 #define JDWP_SET_EXCEPTION(ex) AgentBase::GetExceptionManager().SetException(ex)
 
+#define JDWP_LAST_ERROR_CODE \
+  AgentBase::GetExceptionManager().ReadLastErrorCode()
+
+#define JDWP_CHECK_ERROR_CODE(var) var = JDWP_LAST_ERROR_CODE; \
+                                   if (var != JDWP_ERROR_NONE) { \
+                                     return var; \
+                                   }
+
+#define JDWP_HAS_EXCEPTION (JDWP_LAST_ERROR_CODE != JDWP_ERROR_NONE)
+
 #define JDWP_CHECK_RETURN(value) if (value != JDWP_ERROR_NONE) { \
                                     return value; \
                                  }
@@ -66,6 +76,7 @@
 
         void SetException(AgentException& ex);
         AgentException GetLastException();
+        jdwpError ReadLastErrorCode();
 
         inline void* operator new(size_t size) {
             return malloc(size);



Mime
View raw message