harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From odea...@apache.org
Subject svn commit: r794726 [12/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/nativ...
Date Thu, 16 Jul 2009 15:57:41 GMT
Modified: harmony/enhanced/jdktools/branches/java6/modules/jpda/src/main/native/jdwp/common/agent/core/RequestManager.h
URL: http://svn.apache.org/viewvc/harmony/enhanced/jdktools/branches/java6/modules/jpda/src/main/native/jdwp/common/agent/core/RequestManager.h?rev=794726&r1=794725&r2=794726&view=diff
==============================================================================
--- harmony/enhanced/jdktools/branches/java6/modules/jpda/src/main/native/jdwp/common/agent/core/RequestManager.h
(original)
+++ harmony/enhanced/jdktools/branches/java6/modules/jpda/src/main/native/jdwp/common/agent/core/RequestManager.h
Thu Jul 16 15:57:37 2009
@@ -15,12 +15,6 @@
  *  See the License for the specific language governing permissions and
  *  limitations under the License.
  */
-
-/**
- * @author Pavel N. Vyssotski
- * @version $Revision: 1.12.2.1 $
- */
-
 /**
  * @file
  * RequestManager.h
@@ -32,19 +26,17 @@
 #ifndef _REQUEST_MANAGER_H_
 #define _REQUEST_MANAGER_H_
 
-#include <vector>
+#include "Util.h"
 
 #include "AgentBase.h"
 #include "AgentMonitor.h"
-#include "AgentAllocator.h"
 #include "AgentEventRequest.h"
 #include "PacketParser.h"
 
 namespace jdwp {
 
     /** Type for list of event requests. */
-    typedef vector<AgentEventRequest*,
-        AgentAllocator<AgentEventRequest*> > RequestList;
+    typedef JDWPVector<AgentEventRequest> RequestList;
 
     /** Type for list iterator for event requests. */
     typedef RequestList::iterator RequestListIterator;
@@ -81,43 +73,43 @@
         /**
          * A constructor.
          */
-        CombinedEventsInfo() throw ();
+        CombinedEventsInfo();
 
         /**
          * A destructor.
          */
-        ~CombinedEventsInfo() throw ();
+        ~CombinedEventsInfo();
         
         /**
          * Stores information about location of initial combined event.
          */
-        void Init(JNIEnv *jni, EventInfo &eInfo) throw (OutOfMemoryException);
+        int Init(JNIEnv *jni, EventInfo &eInfo);
 
         /**
          * Clears information about stored events.
          */
-        void Clean(JNIEnv *jni) throw ();
+        void Clean(JNIEnv *jni);
 
         /**
          * Returns number of all combined events.
          */
-        int GetEventsCount() const throw ();
+        int GetEventsCount() const;
 
         /**
          * Returns number of all ignored callbacks.
          */
-        int GetIgnoredCallbacksCount() const throw ();
+        int GetIgnoredCallbacksCount() const;
 
         /**
          * Counts occured event callback and decreaces number of ignored callbacks
          * for this kind of combined event.
          */
-        void CountOccuredCallback(CombinedEventsKind combinedKind) throw ();
+        void CountOccuredCallback(CombinedEventsKind combinedKind);
 
     }; //CombinedEventsInfo
 
     /** Type for list of stored combined events info in all threads. */
-    typedef vector<CombinedEventsInfo*, AgentAllocator<CombinedEventsInfo*> >
CombinedEventsInfoList;
+    typedef JDWPVector<CombinedEventsInfo> CombinedEventsInfoList;
 
     /**
      * The class manages events generated by the target VM and passes them to
@@ -130,12 +122,12 @@
         /**
          * A constructor.
          */
-        RequestManager() throw();
+        RequestManager();
 
         /**
          * A destructor.
          */
-        ~RequestManager() throw();
+        ~RequestManager();
 
         /**
          * Initializes the instance of <code>RequestManager</code>.
@@ -144,7 +136,7 @@
          *
          * @throws AgentException.
          */
-        void Init(JNIEnv* jni) throw(AgentException);
+        void Init(JNIEnv* jni);
 
         /**
          * Cleanups the instance of <code>RequestManager</code>.
@@ -153,7 +145,7 @@
          *
          * @throws AgentException.
          */
-        void Clean(JNIEnv* jni) throw(AgentException);
+        void Clean(JNIEnv* jni);
 
         /**
          * Resets the instance of <code>RequestManager</code>.
@@ -162,7 +154,7 @@
          *
          * @throws AgentException.
          */
-        void Reset(JNIEnv* jni) throw(AgentException);
+        void Reset(JNIEnv* jni);
 
         /**
          * Adds the given internal request to the list of requests of corresponding types.
@@ -172,8 +164,7 @@
          *
          * @throws AgentException.
          */
-        void AddInternalRequest(JNIEnv* jni, AgentEventRequest* request)
-            throw(AgentException);
+        int AddInternalRequest(JNIEnv* jni, AgentEventRequest* request);
 
         /**
          * Adds the given request to the list of requests of corresponding types 
@@ -184,8 +175,7 @@
          *
          * @throws AgentException.
          */
-        RequestID AddRequest(JNIEnv* jni, AgentEventRequest* request)
-            throw(AgentException);
+        RequestID AddRequest(JNIEnv* jni, AgentEventRequest* request);
 
         /**
          * Removes a request of the given kind with the given request ID.
@@ -196,8 +186,7 @@
          *
          * @throws AgentException.
          */
-        void DeleteRequest(JNIEnv* jni, jdwpEventKind kind, RequestID id)
-            throw(AgentException);
+        int DeleteRequest(JNIEnv* jni, jdwpEventKind kind, RequestID id);
 
         /**
          * Removes the given request from the corresponding request list.
@@ -207,8 +196,7 @@
          *
          * @throws AgentException.
          */
-        void DeleteRequest(JNIEnv* jni, AgentEventRequest* request)
-            throw(AgentException);
+        int DeleteRequest(JNIEnv* jni, AgentEventRequest* request);
 
         /**
          * Removes all requests with the given kind from the corresponding request list.
@@ -218,8 +206,7 @@
          *
          * @throws AgentException.
          */
-        void DeleteAllRequests(JNIEnv* jni, jdwpEventKind eventKind)
-            throw(AgentException);
+        void DeleteAllRequests(JNIEnv* jni, jdwpEventKind eventKind);
 
         /**
          * Removes all requests with <code>JDWP_EVENT_BREAKPOINT</code> 
@@ -229,14 +216,14 @@
          *
          * @throws AgentException.
          */
-        void DeleteAllBreakpoints(JNIEnv* jni) throw(AgentException);
+        void DeleteAllBreakpoints(JNIEnv* jni);
 
         /**
          * Returns the name of the given JDWP event kind.
          *
          * @param kind - the JDWP event kind
          */
-        const char* GetEventKindName(jdwpEventKind kind) const throw();
+        const char* GetEventKindName(jdwpEventKind kind) const;
 
         /**
          * Enables an internal step request for the <code>PopFrame</code> command.
@@ -246,7 +233,7 @@
          *
          * @exception <code>AgentException</code> is thrown, if any error occurs.
          */
-        void EnableInternalStepRequest(JNIEnv* jni, jthread thread) throw(AgentException);
+        int EnableInternalStepRequest(JNIEnv* jni, jthread thread);
 
         /**
          * Disables an internal step request after the <code>PopFrame</code>
command.
@@ -256,7 +243,13 @@
          *
          * @exception <code>AgentException</code> is thrown, if any error occurs.
          */
-        void DisableInternalStepRequest(JNIEnv* jni, jthread thread) throw(AgentException);
+        int DisableInternalStepRequest(JNIEnv* jni, jthread thread);
+
+		 /**
+         * Returns the monitor for exception handling.
+         *
+         */
+		AgentMonitor* GetExceptionMonitor();
 
         // event callbacks
 
@@ -506,14 +499,14 @@
         /**
          * Enables/disables all appropriate events for given Breakpoint event request. 
          */
-        void ControlBreakpoint(JNIEnv* jni, AgentEventRequest* request,
-            bool enable) throw(AgentException);
+        int ControlBreakpoint(JNIEnv* jni, AgentEventRequest* request,
+            bool enable);
 
         /**
          * Enables/disables all appropriate events for given Watchpoint event request. 
          */
-        void ControlWatchpoint(JNIEnv* jni, AgentEventRequest* request,
-            bool enable) throw(AgentException);
+        int ControlWatchpoint(JNIEnv* jni, AgentEventRequest* request,
+            bool enable);
 
         /**
          * Enables/disables all appropriate events for given ClassUnload event request.
@@ -521,84 +514,80 @@
          * @return index of corresponding JVMTI extension event or 0 if not supported
          */
         jint ControlClassUnload(JNIEnv* jni, AgentEventRequest* request, 
-            bool enable) throw(AgentException);
+            bool enable);
 
         /**
          * Enables/disables all appropriate events for given event request. 
          */
-        void ControlEvent(JNIEnv* jni, AgentEventRequest* request, bool enable)
-            throw(AgentException);
+        int ControlEvent(JNIEnv* jni, AgentEventRequest* request, bool enable);
 
         /**
          * Returns all registered event requests for given event kind. 
          */
-        RequestList& GetRequestList(jdwpEventKind kind)
-            throw(AgentException);
+        RequestList& GetRequestList(jdwpEventKind kind);
 
         /**
          * Deletes step request for given thread if any. 
          */
-        void DeleteStepRequest(JNIEnv* jni, jthread thread)
-            throw(AgentException);
+        void DeleteStepRequest(JNIEnv* jni, jthread thread);
 
         /**
          * Finds step request for given thread if any. 
          */
-        StepRequest* FindStepRequest(JNIEnv* jni, jthread thread)
-            throw(AgentException);
+        StepRequest* FindStepRequest(JNIEnv* jni, jthread thread);
 
         /**
          * Write data for all combined events to event packet. 
          */
-        EventComposer* CombineEvents(JNIEnv* jni, CombinedEventsInfo* combEventsInfo, jdwpSuspendPolicy
sp) 
-            throw(AgentException);
+        EventComposer* CombineEvents(JNIEnv* jni, CombinedEventsInfo* combEventsInfo, jdwpSuspendPolicy
sp);
 
         /**
          * Find existing info about combined events for given thread. 
          */
-        CombinedEventsInfoList::iterator FindCombinedEventsInfo(JNIEnv *jni, jthread thread)
throw(AgentException);
+        CombinedEventsInfoList::iterator FindCombinedEventsInfo(JNIEnv *jni, jthread thread);
 
         /**
          * Strore new info about combined events.
          */
-        void AddCombinedEventsInfo(JNIEnv *jni, CombinedEventsInfo* info) throw(AgentException);
+        void AddCombinedEventsInfo(JNIEnv *jni, CombinedEventsInfo* info);
 
         /**
          * Remove given info about combined events. 
          */
-        void DeleteCombinedEventsInfo(JNIEnv *jni, CombinedEventsInfoList::iterator p) throw(AgentException);
+        void DeleteCombinedEventsInfo(JNIEnv *jni, CombinedEventsInfoList::iterator p);
 
         /**
          * Checks if this combined event was predicted and should be ignored.
          * It also removes combined events info after all predicted events occured.
          */
         bool IsPredictedCombinedEvent(JNIEnv *jni, EventInfo& eInfo, 
-                    CombinedEventsInfo::CombinedEventsKind combinedKind) throw(AgentException);
+                    CombinedEventsInfo::CombinedEventsKind combinedKind);
 
         /**
          * Cleans all stored info about combined events.
          */
-        void DeleteAllCombinedEventsInfo(JNIEnv *jni) throw(AgentException);
+        void DeleteAllCombinedEventsInfo(JNIEnv *jni);
 
         /**
          * Checks if given location is first location of a method.
          */
-        bool IsMethodEntryLocation(JNIEnv* jni, EventInfo& eInfo) throw(AgentException);
+        //bool IsMethodEntryLocation(JNIEnv* jni, EventInfo& eInfo);
 
         /**
          * Checks if given location is last location of a method.
          */
-        bool IsMethodExitLocation(JNIEnv* jni, EventInfo& eInfo) throw(AgentException);
+        bool IsMethodExitLocation(JNIEnv* jni, EventInfo& eInfo);
 
         /**
          * Creates list of event request IDs matched to fired event.
          */
         void GenerateEvents(JNIEnv* jni, EventInfo &event, jint &eventCount, 
-                    RequestID* &eventList, jdwpSuspendPolicy &sp) throw(AgentException);
+                    RequestID* &eventList, jdwpSuspendPolicy &sp);
 
         RequestID m_requestIdCount;
         AgentMonitor* m_requestMonitor;
         AgentMonitor* m_combinedEventsMonitor;
+		AgentMonitor* m_exceptionMonitor;
 
         RequestList m_singleStepRequests;
         RequestList m_breakpointRequests;
@@ -616,6 +605,7 @@
         RequestList m_methodEntryRequests;
         RequestList m_methodExitRequests;
         RequestList m_vmDeathRequests;
+		RequestList m_vmStartRequests;
         // New list of event request IDs for Java 6
         RequestList m_methodExitWithReturnValueRequests;
         RequestList m_monitorContendedEnterRequests;

Modified: harmony/enhanced/jdktools/branches/java6/modules/jpda/src/main/native/jdwp/common/agent/core/RequestModifier.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/jdktools/branches/java6/modules/jpda/src/main/native/jdwp/common/agent/core/RequestModifier.cpp?rev=794726&r1=794725&r2=794726&view=diff
==============================================================================
--- harmony/enhanced/jdktools/branches/java6/modules/jpda/src/main/native/jdwp/common/agent/core/RequestModifier.cpp
(original)
+++ harmony/enhanced/jdktools/branches/java6/modules/jpda/src/main/native/jdwp/common/agent/core/RequestModifier.cpp
Thu Jul 16 15:57:37 2009
@@ -15,22 +15,15 @@
  *  See the License for the specific language governing permissions and
  *  limitations under the License.
  */
-
-/**
- * @author Pavel N. Vyssotski
- * @version $Revision: 1.3 $
- */
-// RequestModifier.cpp
+#include "RequestModifier.h"
 
 #include <string.h>
 
-#include "RequestModifier.h"
-
 using namespace jdwp;
 
 // match signature with pattern omitting first 'L' and last ";"
 bool RequestModifier::MatchPattern(const char *signature, const char *pattern)
-    const throw()
+    const
 {
     if (signature == 0) {
         return false;
@@ -54,55 +47,118 @@
     }
 }
 
-bool SourceNameMatchModifier::Apply(JNIEnv* jni, EventInfo &eInfo) throw()
+bool SourceNameMatchModifier::Apply(JNIEnv* jni, EventInfo &eInfo)
 {
     JDWP_ASSERT(eInfo.cls != 0);
     jclass jvmClass = eInfo.cls;
-    try {
-        char* sourceDebugExtension = 0;
-        char* sourceFileName = 0;
-        jvmtiError err;
-        // Get source name determined by SourceDebugExtension
-        JVMTI_TRACE(err, GetJvmtiEnv()->GetSourceDebugExtension(jvmClass,
-            &sourceDebugExtension));
-
-        if (err != JVMTI_ERROR_NONE) {
-            // Can be: JVMTI_ERROR_MUST_POSSESS_CAPABILITY,JVMTI_ERROR_ABSENT_INFORMATION,
-            // JVMTI_ERROR_INVALID_CLASS, JVMTI_ERROR_NULL_POINTER
-            if(err == JVMTI_ERROR_ABSENT_INFORMATION) {                   
-                // SourceDebugExtension is absent, get source name from SourceFile
-                JVMTI_TRACE(err, GetJvmtiEnv()->GetSourceFileName(jvmClass,
-                    &sourceFileName));
-
-                if (err != JVMTI_ERROR_NONE) {
-                    // Can be: JVMTI_ERROR_MUST_POSSESS_CAPABILITY, JVMTI_ERROR_ABSENT_INFORMATION,
-                    // JVMTI_ERROR_INVALID_CLASS, JVMTI_ERROR_NULL_POINTER
-                    throw AgentException(err);
-                 }
-                 JvmtiAutoFree autoFreeFieldName(sourceFileName);
-                 return MatchPatternSourceName(sourceFileName, m_pattern);
-                 } else { 
-                    throw AgentException(err);
-                 }
+
+    char* sourceDebugExtension = 0;
+    char* sourceFileName = 0;
+    jvmtiError err;
+    // Get source name determined by SourceDebugExtension
+    JVMTI_TRACE(LOG_DEBUG, err, GetJvmtiEnv()->GetSourceDebugExtension(jvmClass,
+        &sourceDebugExtension));
+
+    if (err != JVMTI_ERROR_NONE) {
+        // Can be: JVMTI_ERROR_MUST_POSSESS_CAPABILITY,JVMTI_ERROR_ABSENT_INFORMATION,
+        // JVMTI_ERROR_INVALID_CLASS, JVMTI_ERROR_NULL_POINTER
+        if(err == JVMTI_ERROR_ABSENT_INFORMATION) {                   
+            // SourceDebugExtension is absent, get source name from SourceFile
+            JVMTI_TRACE(LOG_DEBUG, err, GetJvmtiEnv()->GetSourceFileName(jvmClass,
+                &sourceFileName));
+
+            if (err != JVMTI_ERROR_NONE) {
+                // Can be: JVMTI_ERROR_MUST_POSSESS_CAPABILITY, JVMTI_ERROR_ABSENT_INFORMATION,
+                // JVMTI_ERROR_INVALID_CLASS, JVMTI_ERROR_NULL_POINTER
+                JDWP_TRACE(LOG_RELEASE, (LOG_DATA_FL, "JDWP error in SourceNameMatchModifier.Apply
calling GetSourceFileName: %d", err));
+                return false;
             }
-            JvmtiAutoFree autoFreeDebugExtension(sourceDebugExtension);            
-          
-            string str(sourceDebugExtension);
-            JDWP_TRACE_DATA("JDWP sourceDebugExtension: " << str);
-            vector<string> tokens;
-            ParseSourceDebugExtension(str, tokens, "\n");
-            return MatchPatternSourceName(tokens[1].c_str(), m_pattern);
-    } catch (AgentException& e) {
-        JDWP_TRACE_DATA("JDWP error in SourceNameMatchModifier.Apply: " << e.what()
<< " [" << e.ErrCode() << "]");
-        return false;
+            JvmtiAutoFree autoFreeFieldName(sourceFileName);
+            bool result =  MatchPatternSourceName(sourceFileName, m_pattern);
+
+            if(!result) {
+                // replace '.' with '/' to be matched with signature
+                for (char* p = m_pattern; *p != '\0'; p++) {
+                    if (*p == '.') {
+                        *p = '/';
+                    }
+                }
+                JDWP_ASSERT(eInfo.signature != 0);
+                return MatchPattern(eInfo.signature, m_pattern);
+            } else {
+                return true;
+            }
+         } else { 
+             JDWP_TRACE(LOG_RELEASE, (LOG_DATA_FL, "JDWP error in SourceNameMatchModifier.Apply
calling GetSourceDebugExtension: %d", err));
+             return false;
+         }
+    }
+    JvmtiAutoFree autoFreeDebugExtension(sourceDebugExtension);            
+      
+    JDWP_TRACE(LOG_RELEASE, (LOG_DATA_FL, "JDWP sourceDebugExtension: %s", sourceDebugExtension));
+
+    // We want to get the 2nd token here, split by '\n'
+    char *tok = NULL;
+    tok = strtok(sourceDebugExtension, "\n"); // 1st token
+    if (tok == NULL) return false;
+    tok = strtok(NULL, "\n");
+    if (tok == NULL) return false;
+    if (MatchPatternSourceName(tok, m_pattern)) return true;
+    while(tok = strtok(NULL, "\n")) {
+        if (strlen(tok) >= 2) {
+            if (tok[0] == '*' && tok[1] == 'F' && tok[2] == '\0') {
+                tok = strtok(NULL, "\n");
+                if (tok == NULL) return false;
+                while (tok[0] != '*') {
+                    if (tok[0] == '+') {
+                        //format: + 1 HelloWorld.java\npath/HelloWorld.java
+                        // skip plus
+                        tok++;
+                        // skip spaces
+                        while (tok[0] == ' ' && tok[0] != 0) tok++;
+                        // skip int
+                        while (tok[0] >= '0' && tok[0] <= '9'
+                               && tok[0] != 0) tok++;
+                        // skip spaces
+                        while (tok[0] == ' ' && tok[0] != 0) tok++;
+                        if (tok[0] == 0) break;
+                        //printf("plus name = '%s'\n", tok);
+                        if (MatchPatternSourceName(tok, m_pattern)) {
+                            return true;
+                        }
+                        tok = strtok(NULL, "\n");
+                        if (tok == NULL) return false;
+                        //printf("full name = '%s'\n", tok);
+                        if (MatchPatternSourceName(tok, m_pattern)) {
+                            return true;
+                        }
+                    } else if (tok[0] >= '0' && tok[0] <= '9') {
+                        // format: 1 HelloWorld.java
+                        // skip the int
+                        while (tok[0] >= '0' && tok[0] <= '9'
+                               && tok[0] != 0) tok++;
+                        // skip spaces
+                        while (tok[0] == ' ' && tok[0] != 0) tok++;
+                        if (tok[0] == 0) break;
+                        //printf("file name = '%s'\n", tok);
+                        if (MatchPatternSourceName(tok, m_pattern)) {
+                            return true;
+                        }
+                    }
+                    tok = strtok(NULL, "\n");
+                    if (tok == NULL) return false;
+                }
+            }
+        }
     }
+    return false;
 }
 
 // match source name with pattern
 bool SourceNameMatchModifier::MatchPatternSourceName(const char *sourcename, const char *pattern)
     const 
 {
-    JDWP_TRACE_DATA("JDWP in SourceNameMatchModifier::MatchPatternSourceName");
+    JDWP_TRACE(LOG_RELEASE, (LOG_DATA_FL, "JDWP in SourceNameMatchModifier::MatchPatternSourceName(%s,
%s)", sourcename, pattern));
    if(sourcename == 0) {
         return false;
     }
@@ -123,14 +179,4 @@
     }
 }
 
-// parse SourceDebugExtension by "\n" delimiter
-void SourceNameMatchModifier::ParseSourceDebugExtension(const string& str, vector<string>&
tokens, const string& delimiters)
-{
-    string::size_type lastPos = str.find_first_not_of(delimiters, 0);
-    string::size_type pos = str.find_first_of(delimiters, lastPos);
-    while (string::npos != pos || string::npos != lastPos) {
-        tokens.push_back(str.substr(lastPos, pos - lastPos));
-        lastPos = str.find_first_not_of(delimiters, pos);
-        pos = str.find_first_of(delimiters, lastPos);
-    }
-}
+

Modified: harmony/enhanced/jdktools/branches/java6/modules/jpda/src/main/native/jdwp/common/agent/core/RequestModifier.h
URL: http://svn.apache.org/viewvc/harmony/enhanced/jdktools/branches/java6/modules/jpda/src/main/native/jdwp/common/agent/core/RequestModifier.h?rev=794726&r1=794725&r2=794726&view=diff
==============================================================================
--- harmony/enhanced/jdktools/branches/java6/modules/jpda/src/main/native/jdwp/common/agent/core/RequestModifier.h
(original)
+++ harmony/enhanced/jdktools/branches/java6/modules/jpda/src/main/native/jdwp/common/agent/core/RequestModifier.h
Thu Jul 16 15:57:37 2009
@@ -15,12 +15,6 @@
  *  See the License for the specific language governing permissions and
  *  limitations under the License.
  */
-
-/**
- * @author Pavel N. Vyssotski
- * @version $Revision: 1.10.2.1 $
- */
-
 /**
  * @file
  * RequestModifier.h
@@ -31,7 +25,7 @@
 #define _REQUEST_MODIFIER_H_
 
 #include "AgentBase.h"
-#include <vector>
+#include "ExceptionManager.h"
 
 namespace jdwp {
 
@@ -126,8 +120,8 @@
          *
          * @return <code>TRUE</code>.
          */
-        virtual bool Apply(JNIEnv* jni, EventInfo &eInfo) throw() {
-            JDWP_TRACE_DATA("RequestModifier.Apply is invoked.");
+        virtual bool Apply(JNIEnv* jni, EventInfo &eInfo) {
+            JDWP_TRACE(LOG_RELEASE, (LOG_DATA_FL, "RequestModifier.Apply is invoked."));
             return true;
         }
 
@@ -136,12 +130,12 @@
          *
          * @return The JDWP request modifier kind.
          */
-        jdwpRequestModifier GetKind() const throw() { return m_kind; }
+        jdwpRequestModifier GetKind() const { return m_kind; }
 
     protected:
 
         bool MatchPattern(const char *signature, const char *pattern)
-            const throw();
+            const;
         
 
         jdwpRequestModifier m_kind;
@@ -172,7 +166,7 @@
          *
          * @return The current value of the event counter.
          */
-        jint GetCount() const throw() { return m_count; }
+        jint GetCount() const { return m_count; }
 
         /**
          * Applies count filtering for the given event.
@@ -183,7 +177,7 @@
          * @return Returns <code>TRUE</code> if count is zero, otherwise 
          * <code>FALSE</code>.
          */
-        bool Apply(JNIEnv* jni, EventInfo &eInfo) throw()
+        bool Apply(JNIEnv* jni, EventInfo &eInfo)
         {
             if (m_count > 0) {
                 m_count--;
@@ -224,7 +218,7 @@
          *
          * @return The expression ID.
          */
-        jint GetExprID() const throw() { return m_exprID; }
+        jint GetExprID() const { return m_exprID; }
 
         /**
          * Applies filtering by the expression result for the given event.
@@ -234,7 +228,7 @@
          *
          * @return <code>TRUE</code> (not implemented).
          */
-        bool Apply(JNIEnv* jni, EventInfo &eInfo) throw() {
+        bool Apply(JNIEnv* jni, EventInfo &eInfo) {
             return true;
         }
 
@@ -260,12 +254,12 @@
          *
          * @throws OutOfMemoryException.
          */
-        ThreadOnlyModifier(JNIEnv *jni, jthread thread) throw(AgentException) :
+        ThreadOnlyModifier(JNIEnv *jni, jthread thread) :
             RequestModifier(JDWP_MODIFIER_THREAD_ONLY)
         {
             m_thread = jni->NewGlobalRef(thread);
             if (m_thread == 0) {
-                throw OutOfMemoryException();
+                JDWP_TRACE(LOG_RELEASE, (LOG_DATA_FL, "Error in ThreadOnlyModifier constructor
- out of memory"));
             }
         }
 
@@ -281,7 +275,7 @@
          *
          * @return The Java thread.
          */
-        jthread GetThread() const throw() {
+        jthread GetThread() const {
             return m_thread;
         }
 
@@ -294,7 +288,7 @@
          * @return Returns <code>TRUE</code>, if the event occurs in the 
          *         thread of interest.
          */
-        bool Apply(JNIEnv* jni, EventInfo &eInfo) throw() 
+        bool Apply(JNIEnv* jni, EventInfo &eInfo) 
         {
             JDWP_ASSERT(eInfo.thread != 0);
             return (JNI_TRUE == jni->IsSameObject(eInfo.thread, m_thread));
@@ -322,12 +316,12 @@
          *
          * @throws OutOfMemoryException.
          */
-        ClassOnlyModifier(JNIEnv *jni, jclass cls) throw(AgentException) :
+        ClassOnlyModifier(JNIEnv *jni, jclass cls) :
             RequestModifier(JDWP_MODIFIER_CLASS_ONLY)
         {
             m_class = static_cast<jclass>(jni->NewGlobalRef(cls));
             if (m_class == 0) {
-                throw OutOfMemoryException();
+                JDWP_TRACE(LOG_RELEASE, (LOG_DATA_FL, "Error in ClassOnlyModifier constructor
- out of memory"));
             }
         }
 
@@ -343,7 +337,7 @@
          *
          * @return The Java class.
          */
-        jclass GetClass() const throw() {
+        jclass GetClass() const {
             return m_class;
         }
 
@@ -355,9 +349,10 @@
          *
          * @return Returns <code>TRUE</code>, if event occurs in the class of
interest.
          */
-        bool Apply(JNIEnv* jni, EventInfo &eInfo) throw()
+        bool Apply(JNIEnv* jni, EventInfo &eInfo)
         {
             JDWP_ASSERT(eInfo.cls != 0);
+            JDWP_TRACE(LOG_RELEASE, (LOG_EVENT_FL, "ClassOnlyModifier#Apply: eInfo.cls=%p,
m_class=%p", eInfo.cls,  m_class));
             return (JNI_TRUE == jni->IsAssignableFrom(eInfo.cls, m_class));
         }
 
@@ -398,7 +393,7 @@
          *
          * @return Zero-terminated string.
          */
-        const char* GetPattern() const throw() {
+        const char* GetPattern() const {
             return m_pattern;
         }
 
@@ -410,7 +405,7 @@
          *
          * @return Returns <code>TRUE</code>, if the class signature matches
the given pattern.
          */
-        bool Apply(JNIEnv* jni, EventInfo &eInfo) throw()
+        bool Apply(JNIEnv* jni, EventInfo &eInfo)
         {
             JDWP_ASSERT(eInfo.signature != 0);
             return (MatchPattern(eInfo.signature, m_pattern));
@@ -453,7 +448,7 @@
          *
          * @return Zero-terminated string.
          */
-        const char* GetPattern() const throw() {
+        const char* GetPattern() const {
             return m_pattern;
         }
 
@@ -466,7 +461,7 @@
          * @return Returns <code>TRUE</code>, if the class signature does not
match 
          * the given pattern.
          */
-        bool Apply(JNIEnv* jni, EventInfo &eInfo) throw()
+        bool Apply(JNIEnv* jni, EventInfo &eInfo)
         {
             JDWP_ASSERT(eInfo.signature != 0);
             return (!MatchPattern(eInfo.signature, m_pattern));
@@ -497,14 +492,14 @@
          * @throws OutOfMemoryException.
          */
         LocationOnlyModifier(JNIEnv *jni, jclass cls, jmethodID method,
-                jlocation loc) throw(AgentException) :
+                jlocation loc) :
             RequestModifier(JDWP_MODIFIER_LOCATION_ONLY),
             m_method(method),
             m_location(loc)
         {
             m_class = static_cast<jclass>(jni->NewGlobalRef(cls));
             if (m_class == 0) {
-                throw OutOfMemoryException();
+                JDWP_TRACE(LOG_RELEASE, (LOG_DATA_FL, "Error in LocationOnlyModifier constructor
- out of memory"));
             }
         }
 
@@ -520,7 +515,7 @@
          *
          * @return The Java class.
          */
-        jclass GetClass() const throw() {
+        jclass GetClass() const {
             return m_class;
         }
 
@@ -529,7 +524,7 @@
          *
          * @return The method ID.
          */
-        jmethodID GetMethod() const throw() { 
+        jmethodID GetMethod() const { 
             return m_method;
         }
 
@@ -538,7 +533,7 @@
          *
          * @return The Java location.
          */
-        jlocation GetLocation() const throw() {
+        jlocation GetLocation() const {
             return m_location;
         }
 
@@ -550,7 +545,7 @@
          *
          * @return Returns <code>TRUE</code>, if event location is equal to the
given one.
          */
-        bool Apply(JNIEnv* jni, EventInfo &eInfo) throw()
+        bool Apply(JNIEnv* jni, EventInfo &eInfo)
         {
             JDWP_ASSERT(eInfo.cls != 0);
             return (eInfo.method == m_method && eInfo.location == m_location &&
@@ -585,7 +580,7 @@
          * @throws <code>OutOfMemoryException</code>.
          */
         ExceptionOnlyModifier(JNIEnv *jni, jclass cls, bool caught,
-                bool uncaught) throw(AgentException) :
+                bool uncaught) :
             RequestModifier(JDWP_MODIFIER_EXCEPTION_ONLY),
             m_caught(caught),
             m_uncaught(uncaught)
@@ -595,7 +590,7 @@
             } else {
                 m_class = static_cast<jclass>(jni->NewGlobalRef(cls));
                 if (m_class == 0) {
-                    throw OutOfMemoryException();
+                    JDWP_TRACE(LOG_RELEASE, (LOG_DATA_FL, "Error in ExceptionOnlyModifier
constructor - out of memory"));
                 }
             }
         }
@@ -612,7 +607,7 @@
          *
          * @return The Java class.
          */
-        jclass GetClass() const throw() {
+        jclass GetClass() const {
             return m_class;
         }
 
@@ -621,7 +616,7 @@
          *
          * @return Boolean.
          */
-        bool IsCaught() const throw() {
+        bool IsCaught() const {
             return m_caught;
         }
 
@@ -630,7 +625,7 @@
          *
          * @return Boolean.
          */
-        bool IsUncaught() const throw() {
+        bool IsUncaught() const {
             return m_uncaught;
         }
 
@@ -642,7 +637,7 @@
          *
          * @return Returns <code>TRUE</code>, if the event location is equal
to the given one.
          */
-        bool Apply(JNIEnv* jni, EventInfo &eInfo) throw()
+        bool Apply(JNIEnv* jni, EventInfo &eInfo)
         {
             return ((eInfo.caught ? m_caught : m_uncaught) &&
                 (m_class == 0 || (eInfo.cls != 0 &&
@@ -676,13 +671,13 @@
          * @throws <code>OutOfMemoryException</code>.
          */
         FieldOnlyModifier(JNIEnv *jni, jclass cls,
-                jfieldID field) throw(AgentException) :
+                jfieldID field) :
             RequestModifier(JDWP_MODIFIER_FIELD_ONLY),
             m_field(field)
         {
             m_class = static_cast<jclass>(jni->NewGlobalRef(cls));
             if (m_class == 0) {
-                throw OutOfMemoryException();
+                JDWP_TRACE(LOG_RELEASE, (LOG_DATA_FL, "Error in FieldOnlyModifier constructor
- out of memory"));
             }
         }
 
@@ -698,7 +693,7 @@
          *
          * @return The Java class.
          */
-        jclass GetClass() const throw() {
+        jclass GetClass() const {
             return m_class;
         }
 
@@ -707,7 +702,7 @@
          *
          * @return The field ID.
          */
-        jfieldID GetField() const throw() {
+        jfieldID GetField() const {
             return m_field;
         }
 
@@ -719,7 +714,7 @@
          *
          * @return Returns <code>TRUE</code>, if the event field is equal to
the given one.
          */
-        bool Apply(JNIEnv* jni, EventInfo &eInfo) throw()
+        bool Apply(JNIEnv* jni, EventInfo &eInfo)
         {
             JDWP_ASSERT(eInfo.cls != 0);
             return (eInfo.field == m_field &&
@@ -753,14 +748,14 @@
          * @throws OutOfMemoryException.
          */
         StepModifier(JNIEnv *jni, jthread thread, jint size,
-                jint depth) throw(AgentException) :
+                jint depth) :
             RequestModifier(JDWP_MODIFIER_STEP),
             m_size(size),
             m_depth(depth)
         {
             m_thread = jni->NewGlobalRef(thread);
             if (m_thread == 0) {
-                throw OutOfMemoryException();
+                JDWP_TRACE(LOG_RELEASE, (LOG_DATA_FL, "Error in StepModifier constructor
- out of memory"));
             }
         }
 
@@ -776,7 +771,7 @@
          *
          * @return The Java thread.
          */
-        jthread GetThread() const throw() {
+        jthread GetThread() const {
             return m_thread;
         }
 
@@ -785,7 +780,7 @@
          *
          * @return The int step size.
          */
-        jint GetSize() const throw() {
+        jint GetSize() const {
             return m_size;
         }
 
@@ -794,7 +789,7 @@
          *
          * @return The int step depth.
          */
-        jint GetDepth() const throw() {
+        jint GetDepth() const {
             return m_depth;
         }
 
@@ -807,7 +802,7 @@
          *
          * @return <code>TRUE</code>.
          */
-        bool Apply(JNIEnv* jni, EventInfo &eInfo) throw() {
+        bool Apply(JNIEnv* jni, EventInfo &eInfo) {
             return true;
         }
 
@@ -835,7 +830,7 @@
          *
          * @throws OutOfMemoryException.
          */
-        InstanceOnlyModifier(JNIEnv *jni, jobject obj) throw(AgentException) :
+        InstanceOnlyModifier(JNIEnv *jni, jobject obj) :
             RequestModifier(JDWP_MODIFIER_INSTANCE_ONLY)
         {
             if (obj == 0) {
@@ -843,7 +838,7 @@
             } else {
                 m_instance = jni->NewGlobalRef(obj);
                 if (m_instance == 0) {
-                    throw OutOfMemoryException();
+                    JDWP_TRACE(LOG_RELEASE, (LOG_DATA_FL, "Error in InstanceOnlyModifier
constructor - out of memory"));
                 }
             }
         }
@@ -860,7 +855,7 @@
          *
          * @return The Java object.
          */
-        jobject GetInstance() const throw() {
+        jobject GetInstance() const {
             return m_instance;
         }
 
@@ -873,25 +868,28 @@
          *
          * @return <code>TRUE</code>.
          */
-        bool Apply(JNIEnv* jni, EventInfo &eInfo) throw()
+        bool Apply(JNIEnv* jni, EventInfo &eInfo)
         {
             if (eInfo.instance == 0 &&
                 (eInfo.kind == JDWP_EVENT_SINGLE_STEP  ||
                  eInfo.kind == JDWP_EVENT_BREAKPOINT   ||
                  eInfo.kind == JDWP_EVENT_EXCEPTION    ||
                  eInfo.kind == JDWP_EVENT_METHOD_ENTRY ||
-                 eInfo.kind == JDWP_EVENT_METHOD_EXIT))
+                 eInfo.kind == JDWP_EVENT_METHOD_EXIT  ||
+                 eInfo.kind == JDWP_EVENT_METHOD_EXIT_WITH_RETURN_VALUE ))
             {
                 jint modifiers;
                 jvmtiError err;
-                JVMTI_TRACE(err, GetJvmtiEnv()->GetMethodModifiers(
+                JVMTI_TRACE(LOG_DEBUG, err, GetJvmtiEnv()->GetMethodModifiers(
                     eInfo.method, &modifiers));
                 if (err == JVMTI_ERROR_NONE && (modifiers & ACC_STATIC) == 0)
{
                     // get "this" object from slot 0 (stated in JVM spec)
-                    JVMTI_TRACE(err, GetJvmtiEnv()->GetLocalObject(
+                    JVMTI_TRACE(LOG_DEBUG, err, GetJvmtiEnv()->GetLocalObject(
                         eInfo.thread, 0, 0, &eInfo.instance));
                 }
             }
+            JDWP_TRACE(LOG_RELEASE, (LOG_EVENT_FL, "InstanceOnlyModifier#Apply: m_instance=%p,
eInfo.instance=%p," ,
+                    m_instance, eInfo.instance));
             return ((eInfo.instance == 0 && m_instance == 0) ||
                 ((eInfo.instance != 0 && m_instance != 0) &&
                  JNI_TRUE == jni->IsSameObject(eInfo.instance, m_instance)));
@@ -935,7 +933,7 @@
          *
          * @return Zero-terminated string.
          */
-        const char* GetPattern() const throw() {
+        const char* GetPattern() const {
             return m_pattern;
         }
 
@@ -947,13 +945,12 @@
          *
          * @return Returns <code>TRUE</code>, if the source name matches the
given pattern.
          */
-        bool Apply(JNIEnv* jni, EventInfo &eInfo) throw();
+        bool Apply(JNIEnv* jni, EventInfo &eInfo);
       
 
     private:
         bool MatchPatternSourceName(const char *sourcename, const char *pattern)
             const ;
-        void ParseSourceDebugExtension(const string& str, vector<string>& tokens,
const string& delimiters);
 
         char* m_pattern;
 



Mime
View raw message