harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ge...@apache.org
Subject svn commit: r480141 [6/38] - in /harmony/enhanced/jdktools/trunk/modules/jpda: ./ doc/ doc/images/ make/ src/ src/common/ src/common/other/ src/common/other/jpda/ src/common/other/jpda/jdwp/ src/common/other/jpda/jdwp/agent/ src/common/other/jpda/jdwp/...
Date Tue, 28 Nov 2006 17:49:31 GMT
Added: harmony/enhanced/jdktools/trunk/modules/jpda/src/common/other/jpda/jdwp/agent/commands/ReferenceType.h
URL: http://svn.apache.org/viewvc/harmony/enhanced/jdktools/trunk/modules/jpda/src/common/other/jpda/jdwp/agent/commands/ReferenceType.h?view=auto&rev=480141
==============================================================================
--- harmony/enhanced/jdktools/trunk/modules/jpda/src/common/other/jpda/jdwp/agent/commands/ReferenceType.h (added)
+++ harmony/enhanced/jdktools/trunk/modules/jpda/src/common/other/jpda/jdwp/agent/commands/ReferenceType.h Tue Nov 28 09:49:08 2006
@@ -0,0 +1,355 @@
+/*
+ * Copyright 2005-2006 The Apache Software Foundation or its licensors, 
+ * as applicable.
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+
+/**
+ * @author Anatoly F. Bondarenko
+ * @version $Revision: 1.5.2.1 $
+ */
+
+/**
+ * @file
+ * ReferenceType.h
+ *
+ */
+
+#ifndef _REFERENCE_TYPE_H_
+#define _REFERENCE_TYPE_H_
+
+#include "AgentException.h"
+#include "CommandHandler.h"
+
+namespace jdwp {
+
+    /**
+     * The namespace includes declaration of the classes implementing commands
+     * from the <code>ReferenceType</code> command set.
+     */
+    namespace ReferenceType {
+        
+    // =========================================================================
+        /**
+         * The class implements the <code>Signature (1)</code> command and 
+         * it is the base class for the <code>SignatureWithGeneric (13)</code>
+         * command, both from the <code>ReferenceType</code> command set.
+         */
+        class SignatureHandler : public SyncCommandHandler {
+        public:
+
+            /**
+             * A constructor.
+             */
+            SignatureHandler() { m_withGeneric = false; }
+
+        protected:
+
+            /**
+             * Executes the <code>Signature</code> JDWP command for the
+             * <code>ReferenceType</code> command set.
+             *
+             * @param jni - the JNI interface pointer
+             */
+            virtual void Execute(JNIEnv *jni) throw(AgentException);
+
+        protected:
+
+            /**
+             * The field defines if it is  the <code>Signature (1)</code> command or 
+             * the <code>SignatureWithGeneric (13)</code> command.
+             */
+            bool m_withGeneric;
+
+        }; // SignatureHandler class
+
+    // =========================================================================
+        /**
+         * The class implements the <code>ClassLoader (2)</code>
+         * command from the <code>ReferenceType</code> command set.
+         */
+        class ClassLoaderHandler : public SyncCommandHandler {
+        protected:
+
+            /**
+             * Executes the <code>ClassLoader</code> JDWP command for the
+             * <code>ReferenceType</code> command set.
+             *
+             * @param jni - the JNI interface pointer
+             */
+            virtual void Execute(JNIEnv *jni) throw(AgentException);
+
+        }; // ClassLoaderHandler class
+
+    // =========================================================================
+        /**
+         * The class implements the <code>Modifiers (3)</code>
+         * command from the <code>ReferenceType</code> command set.
+         */
+        class ModifiersHandler : public SyncCommandHandler {
+        protected:
+
+            /**
+             * Executes the <code>Modifiers</code> JDWP command for the
+             * <code>ReferenceType</code> command set.
+             *
+             * @param jni - the JNI interface pointer.
+             */
+            virtual void Execute(JNIEnv *jni) throw(AgentException);
+
+        }; // ModifiersHandler class
+
+    // =========================================================================
+        /**
+         * The class implements the <code>Fields (4)</code> command and 
+         * it is the base class for the <code>FieldsWithGeneric (14)</code>
+         * command, both from the <code>ReferenceType</code> command set.
+         */
+        class FieldsHandler : public SyncCommandHandler {
+        public:
+
+            /**
+             * A constructor.
+             */
+            FieldsHandler() { m_withGeneric = false; }
+
+        protected:
+
+            /**
+             * Executes the <code>Fields</code> JDWP command for the
+             * <code>ReferenceType</code> command set.
+             *
+             * @param jni - the JNI interface pointer
+             */
+            virtual void Execute(JNIEnv *jni) throw(AgentException);
+
+        protected:
+        /**
+         * The field defines if it is  the <code>Fields (4)</code> command or 
+         * the <code>FieldsWithGeneric (14)</code> command.
+         */
+            bool m_withGeneric;
+        }; // FieldsHandler class
+
+    // =========================================================================
+        /**
+         * The class implements the <code>Methods (5)</code> command and 
+         * it is the base class for the <code>MethodsWithGeneric (15)</code>
+         * command, both from the <code>ReferenceType</code> command set.
+         */
+        class MethodsHandler : public SyncCommandHandler {
+        public:
+
+            /**
+             * A constructor.
+             */
+            MethodsHandler() { m_withGeneric = false; }
+
+        protected:
+
+            /**
+             * Executes the <code>Methods</code> JDWP command for the
+             * <code>ReferenceType</code> command set.
+             *
+             * @param jni - the JNI interface pointer.
+             */
+            virtual void Execute(JNIEnv *jni) throw(AgentException);
+
+        protected:
+        /**
+         * The field defines if it is  the <code>Methods (5)</code> command or 
+         * the <code>MethodsWithGeneric (15)</code> command.
+         */
+            bool m_withGeneric;
+        }; // MethodsHandler class
+
+    // =========================================================================
+        /**
+         * The class implements the <code>GetValues (6)</code>
+         * command from the <code>ReferenceType</code> command set.
+         */
+        class GetValuesHandler : public SyncCommandHandler {
+        protected:
+
+            /**
+             * Executes the <code>GetValues</code> JDWP command for the
+             * <code>ReferenceType</code> command set.
+             *
+             * @param jni - the JNI interface pointer
+             */
+            virtual void Execute(JNIEnv *jni) throw(AgentException);
+
+        }; // GetValuesHandler class
+
+    // =========================================================================
+        /**
+         * The class implements the <code>SourceFile (7)</code>
+         * command from the <code>ReferenceType</code> command set.
+         */
+        class SourceFileHandler : public SyncCommandHandler {
+        protected:
+
+            /**
+             * Executes the <code>SourceFile</code> JDWP command for the
+             * <code>ReferenceType</code> command set.
+             *
+             * @param jni - the JNI interface pointer.
+             */
+            virtual void Execute(JNIEnv *jni) throw(AgentException);
+
+        }; // SourceFileHandler class
+
+    // =========================================================================
+        /**
+         * The class implements the <code>NestedTypes (8)</code>
+         * command from the <code>ReferenceType</code> command set.
+         */
+        class NestedTypesHandler : public SyncCommandHandler {
+        protected:
+
+            /**
+             * Executes the <code>NestedTypes</code> JDWP command for the
+             * <code>ReferenceType</code> command set.
+             *
+             * @param jni - the JNI interface pointer
+             */
+            virtual void Execute(JNIEnv *jni) throw(AgentException);
+
+        }; // NestedTypesHandler class
+
+    // =========================================================================
+        /**
+         * The class implements the <code>Status (9)</code> command from the
+         * <code>ReferenceType</code> command set.
+         */
+        class StatusHandler : public SyncCommandHandler {
+        protected:
+
+            /**
+             * Executes the <code>Status</code> JDWP command for the
+             * <code>ReferenceType</code> command set.
+             *
+             * @param jni - the JNI interface pointer
+             */
+            virtual void Execute(JNIEnv *jni) throw(AgentException);
+
+        }; // StatusHandler class
+
+    // =========================================================================
+        /**
+         * The class implements the <code>Interfaces (10)</code>
+         * command from the <code>ReferenceType</code> command set.
+         */
+        class InterfacesHandler : public SyncCommandHandler {
+        protected:
+
+            /**
+             * Executes the <code>Interfaces</code> JDWP command for the
+             * <code>ReferenceType</code> command set.
+             *
+             * @param jni - the JNI interface pointer
+             */
+            virtual void Execute(JNIEnv *jni) throw(AgentException);
+
+        }; // InterfacesHandler class
+
+    // =========================================================================
+        /**
+         * The class implements the <code>ClassObject (11)</code>
+         * command from the <code>ReferenceType</code> command set.
+         */
+        class ClassObjectHandler : public SyncCommandHandler {
+        protected:
+
+            /**
+             * Executes the <code>ClassObject</code> JDWP command for the
+             * <code>ReferenceType</code> command set.
+             *
+             * @param jni - the JNI interface pointer.
+             */
+            virtual void Execute(JNIEnv *jni) throw(AgentException);
+
+        }; // ClassObjectHandler class
+
+    // =========================================================================
+        /**
+         * The class implements the <code>SourceDebugExtension (12) </code>
+         * command from the <code>ReferenceType</code> command set.
+         */
+        class SourceDebugExtensionHandler : public SyncCommandHandler {
+        protected:
+
+            /**
+             * Executes the <code>SourceDebugExtension</code> JDWP command for the
+             * <code>ReferenceType</code> command set.
+             *
+             * @param jni - the JNI interface pointer
+             */
+            virtual void Execute(JNIEnv *jni) throw(AgentException);
+
+        }; // SourceDebugExtensionHandler class
+
+    // =========================================================================
+        /**
+         * The class implements the <code>SignatureWithGeneric (13)</code>
+         * command from the <code>ReferenceType</code> command set.
+         */
+        class SignatureWithGenericHandler : public SignatureHandler {
+        public:
+
+            /**
+             * A constructor.
+             */
+            SignatureWithGenericHandler() { m_withGeneric = true; }
+
+        }; // SignatureWithGenericHandler class
+
+    // =========================================================================
+        /**
+         * The class implements the <code>FieldsWithGeneric (14)</code>
+         * command from the <code>ReferenceType</code> command set.
+         */
+        class FieldsWithGenericHandler : public FieldsHandler {
+        public:
+
+            /**
+             * A constructor.
+             */
+            FieldsWithGenericHandler() { m_withGeneric = true; }
+
+        }; // FieldsWithGenericHandler class
+
+    // =========================================================================
+        /**
+         * The class implements the <code>MethodsWithGeneric (15)</code>
+         * command from the <code>ReferenceType</code> command set.
+         */
+        class MethodsWithGenericHandler : public MethodsHandler {
+        public:
+
+            /**
+             * A constructor.
+             */
+            MethodsWithGenericHandler() { m_withGeneric = true; }
+
+        }; // MethodsWithGenericHandler class
+
+    // =========================================================================
+
+    } // ReferenceType namespace
+
+} // jdwp namesoace
+
+#endif //_REFERENCE_TYPE_H_

Propchange: harmony/enhanced/jdktools/trunk/modules/jpda/src/common/other/jpda/jdwp/agent/commands/ReferenceType.h
------------------------------------------------------------------------------
    svn:eol-style = native

Added: harmony/enhanced/jdktools/trunk/modules/jpda/src/common/other/jpda/jdwp/agent/commands/StackFrame.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/jdktools/trunk/modules/jpda/src/common/other/jpda/jdwp/agent/commands/StackFrame.cpp?view=auto&rev=480141
==============================================================================
--- harmony/enhanced/jdktools/trunk/modules/jpda/src/common/other/jpda/jdwp/agent/commands/StackFrame.cpp (added)
+++ harmony/enhanced/jdktools/trunk/modules/jpda/src/common/other/jpda/jdwp/agent/commands/StackFrame.cpp Tue Nov 28 09:49:08 2006
@@ -0,0 +1,395 @@
+/*
+ * Copyright 2005-2006 The Apache Software Foundation or its licensors, as applicable.
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+
+/**
+ * @author Viacheslav G. Rybalov
+ * @version $Revision: 1.15.2.2 $
+ */
+#include "StackFrame.h"
+#include "PacketParser.h"
+#include "ClassManager.h"
+#include "ThreadManager.h"
+
+using namespace jdwp;
+using namespace StackFrame;
+
+void
+StackFrame::GetValuesHandler::Execute(JNIEnv *jni) throw(AgentException)
+{
+    jthread thread = m_cmdParser->command.ReadThreadID(jni);
+    jint frame = m_cmdParser->command.ReadFrameID(jni);
+    jint slots = m_cmdParser->command.ReadInt();
+
+    JDWP_TRACE_DATA("GetValues: received: frameID=" << frame
+        << ", threadID=" << thread 
+        << ", slots=" << slots);
+
+    if (thread == 0) {
+        throw AgentException(JDWP_ERROR_INVALID_THREAD);
+    }
+    if (slots < 0) {
+        throw AgentException(JDWP_ERROR_ILLEGAL_ARGUMENT);
+    }
+
+    m_cmdParser->reply.WriteInt(slots);
+    for (int i = 0; i < slots; i++) {
+        jint slot = m_cmdParser->command.ReadInt();
+        jdwpTag sigbyte = static_cast<jdwpTag>(m_cmdParser->command.ReadByte());
+        jvmtiError err = JVMTI_ERROR_NONE;
+        jvalue resValue;
+        switch (sigbyte) {
+            case JDWP_TAG_BOOLEAN:
+            case JDWP_TAG_BYTE:
+            case JDWP_TAG_CHAR:
+            case JDWP_TAG_SHORT:
+            case JDWP_TAG_INT:
+                jint ivalue;
+                JVMTI_TRACE(err, GetJvmtiEnv()->GetLocalInt(thread, frame, slot, &ivalue));
+                if (err != JVMTI_ERROR_NONE) {
+                    break;
+                }
+                switch (sigbyte) {
+                    case JDWP_TAG_BOOLEAN:
+                        resValue.z = static_cast<jboolean>(ivalue);
+                        JDWP_TRACE_DATA("GetValues: slot#=" << i 
+                            << ", value=(boolean)" << resValue.z);
+                        break;
+                    case JDWP_TAG_BYTE:
+                        resValue.b = static_cast<jbyte>(ivalue);
+                        JDWP_TRACE_DATA("GetValues: slot#=" << i 
+                            << ", value=(byte)" << resValue.b);
+                        break;
+                    case JDWP_TAG_CHAR:
+                        resValue.c = static_cast<jchar>(ivalue);
+                        JDWP_TRACE_DATA("GetValues: slot#=" << i 
+                            << ", value=(char)" << resValue.c);
+                        break;
+                    case JDWP_TAG_SHORT:
+                        resValue.s = static_cast<jshort>(ivalue);
+                        JDWP_TRACE_DATA("GetValues: slot#=" << i 
+                            << ", value=(short)" << resValue.s);
+                        break;
+                    case JDWP_TAG_INT:
+                        resValue.i = ivalue;
+                        JDWP_TRACE_DATA("GetValues: slot#=" << i 
+                            << ", value=(int)" << resValue.i);
+                        break;
+                }
+                m_cmdParser->reply.WriteValue(jni, sigbyte, resValue);
+                break;
+            case JDWP_TAG_LONG:
+                jlong lvalue;
+                JVMTI_TRACE(err, GetJvmtiEnv()->GetLocalLong(thread, frame, slot, &lvalue));
+                if (err != JVMTI_ERROR_NONE) {
+                    break;
+                }
+                resValue.j = lvalue;
+                JDWP_TRACE_DATA("GetValues: slot#=" << i 
+                    << ", value=(long)" << resValue.j);
+                m_cmdParser->reply.WriteValue(jni, sigbyte, resValue);
+                break;
+            case JDWP_TAG_FLOAT:
+                jfloat fvalue;
+                JVMTI_TRACE(err, GetJvmtiEnv()->GetLocalFloat(thread, frame, slot, &fvalue));
+                if (err != JVMTI_ERROR_NONE) {
+                    break;
+                }
+                resValue.f = fvalue;
+                JDWP_TRACE_DATA("GetValues: slot#=" << i 
+                    << ", value=(float)" << resValue.f);
+                m_cmdParser->reply.WriteValue(jni, sigbyte, resValue);
+                break;
+            case JDWP_TAG_DOUBLE:
+                jdouble dvalue;
+                JVMTI_TRACE(err, GetJvmtiEnv()->GetLocalDouble(thread, frame, slot, &dvalue));
+                if (err != JVMTI_ERROR_NONE) {
+                    break;
+                }
+                resValue.d = dvalue;
+                JDWP_TRACE_DATA("GetValues: slot#=" << i 
+                    << ", value=(double)" << resValue.d);
+                m_cmdParser->reply.WriteValue(jni, sigbyte, resValue);
+                break;
+            case JDWP_TAG_OBJECT:
+            case JDWP_TAG_ARRAY:
+            case JDWP_TAG_STRING:
+            case JDWP_TAG_THREAD:
+            case JDWP_TAG_THREAD_GROUP:
+            case JDWP_TAG_CLASS_LOADER:
+            case JDWP_TAG_CLASS_OBJECT: {
+                jobject ovalue;
+                JVMTI_TRACE(err, GetJvmtiEnv()->GetLocalObject(thread, frame, slot, &ovalue));
+                if (err != JVMTI_ERROR_NONE) {
+                    break;
+                }
+                jdwpTag tag = GetClassManager().GetJdwpTag(jni, ovalue);
+                if ((sigbyte != JDWP_TAG_OBJECT) && (sigbyte != tag)) {
+                    throw AgentException(JDWP_ERROR_INVALID_TAG);
+                }
+                resValue.l = ovalue;
+                JDWP_TRACE_DATA("GetValues: slot#=" << i 
+                    << ", tag=" << tag
+                    << ", value=(object)" << resValue.l);
+                m_cmdParser->reply.WriteValue(jni, tag, resValue);
+                break;
+            }
+            default:
+                JDWP_TRACE_DATA("GetValues: bad slot tag: slot#=" << i 
+                    << ", tag=" << sigbyte);
+                throw AgentException(JDWP_ERROR_INVALID_TAG);
+        }
+        if (err != JVMTI_ERROR_NONE) {
+            jdwpError error;
+            if (err == JVMTI_ERROR_TYPE_MISMATCH) {
+                error = JDWP_ERROR_INVALID_TAG;
+            } else if (err == JVMTI_ERROR_OPAQUE_FRAME) {
+                error = JDWP_ERROR_INVALID_FRAMEID;
+            } else if (err == JVMTI_ERROR_THREAD_NOT_ALIVE) {
+                error = JDWP_ERROR_INVALID_THREAD;
+            } else if (err == JVMTI_ERROR_ILLEGAL_ARGUMENT) {
+                error = JDWP_ERROR_INVALID_FRAMEID;
+            } else if (err == JVMTI_ERROR_NO_MORE_FRAMES) {
+                error = JDWP_ERROR_INVALID_FRAMEID;
+            } else {
+                error = (jdwpError)err;
+            }
+            throw AgentException(error);
+        }
+    }
+}
+
+void
+StackFrame::SetValuesHandler::Execute(JNIEnv *jni) throw(AgentException)
+{
+    jthread thread = m_cmdParser->command.ReadThreadID(jni);
+    jint frame = m_cmdParser->command.ReadFrameID(jni);
+    jint slotValues = m_cmdParser->command.ReadInt();
+
+    JDWP_TRACE_DATA("SetValues: received: frameID=" << frame
+        << ", threadID=" << thread 
+        << ", slots=" << slotValues);
+
+    if (thread == 0) {
+        throw AgentException(JDWP_ERROR_INVALID_THREAD);
+    }
+    if (slotValues < 0) {
+        throw AgentException(JDWP_ERROR_ILLEGAL_ARGUMENT);
+    }
+
+    for (int i = 0; i < slotValues; i++) {
+        jint slot = m_cmdParser->command.ReadInt();
+        jdwpTaggedValue taggedValue = m_cmdParser->command.ReadValue(jni);
+        JDWP_TRACE_DATA("SetValues: slot#" << i << ": taggedValue=" << taggedValue.tag);
+//        jdwpTag sigbyte = taggedValue.tag;
+        jvmtiError err = JVMTI_ERROR_NONE;
+        switch (taggedValue.tag) {
+            case JDWP_TAG_BOOLEAN:
+            case JDWP_TAG_BYTE:
+            case JDWP_TAG_CHAR:
+            case JDWP_TAG_SHORT:
+            case JDWP_TAG_INT:
+                jint ivalue;
+                switch (taggedValue.tag) {
+                    case JDWP_TAG_BOOLEAN:
+                        ivalue = static_cast<jint>(taggedValue.value.z);
+                        JDWP_TRACE_DATA("SetValues: slot#=" << i 
+                            << ", value=(boolean)" << taggedValue.value.z);
+                        break;
+                    case JDWP_TAG_BYTE:
+                        ivalue = static_cast<jint>(taggedValue.value.b);
+                        JDWP_TRACE_DATA("SetValues: slot#=" << i 
+                            << ", value=(byte)" << taggedValue.value.b);
+                        break;
+                    case JDWP_TAG_CHAR:
+                        ivalue = static_cast<jint>(taggedValue.value.c);
+                        JDWP_TRACE_DATA("SetValues: slot#=" << i 
+                            << ", value=(char)" << taggedValue.value.c);
+                        break;
+                    case JDWP_TAG_SHORT:
+                        ivalue = static_cast<jint>(taggedValue.value.s);
+                        JDWP_TRACE_DATA("SetValues: slot#=" << i 
+                            << ", value=(short)" << taggedValue.value.s);
+                        break;
+                    case JDWP_TAG_INT:
+                        ivalue = taggedValue.value.i;
+                        JDWP_TRACE_DATA("SetValues: slot#=" << i 
+                            << ", value=(int)" << taggedValue.value.i);
+                        break;
+                }
+                JVMTI_TRACE(err, GetJvmtiEnv()->SetLocalInt(thread, frame, slot, ivalue));
+                break;
+            case JDWP_TAG_LONG: {
+                jlong lvalue = taggedValue.value.j;
+                JDWP_TRACE_DATA("SetValues: slot#=" << i 
+                    << ", value=(long)" << taggedValue.value.j);
+                JVMTI_TRACE(err, GetJvmtiEnv()->SetLocalLong(thread, frame, slot, lvalue));
+                break;
+            }
+            case JDWP_TAG_FLOAT: {
+                jfloat fvalue = taggedValue.value.f;
+                JDWP_TRACE_DATA("SetValues: slot#=" << i 
+                    << ", value=(float)" << taggedValue.value.f);
+                JVMTI_TRACE(err, GetJvmtiEnv()->SetLocalFloat(thread, frame, slot, fvalue));
+                break;
+            }
+            case JDWP_TAG_DOUBLE: {
+                jdouble dvalue = taggedValue.value.d;
+                JDWP_TRACE_DATA("SetValues: slot#=" << i 
+                    << ", value=(double)" << taggedValue.value.d);
+                JVMTI_TRACE(err, GetJvmtiEnv()->SetLocalDouble(thread, frame, slot, dvalue));
+                break;
+            }
+            case JDWP_TAG_OBJECT:
+            case JDWP_TAG_ARRAY:
+            case JDWP_TAG_STRING:
+            case JDWP_TAG_THREAD:
+            case JDWP_TAG_THREAD_GROUP:
+            case JDWP_TAG_CLASS_LOADER:
+            case JDWP_TAG_CLASS_OBJECT: {
+                jobject ovalue = taggedValue.value.l;
+                JDWP_TRACE_DATA("SetValues: slot#=" << i 
+                    << ", value=(object)" << taggedValue.value.l);
+                JVMTI_TRACE(err, GetJvmtiEnv()->SetLocalObject(thread, frame, slot, ovalue));
+                break;
+            }
+            default:
+                JDWP_TRACE_DATA("SetValues: bad value tag: slot#=" << i 
+                    << ", tag=" << taggedValue.tag);
+                throw AgentException(JDWP_ERROR_INVALID_TAG);
+        }
+        if (err != JVMTI_ERROR_NONE) {
+            jdwpError error;
+            if (err == JVMTI_ERROR_TYPE_MISMATCH) {
+                error = JDWP_ERROR_INVALID_TAG;
+            } else if (err == JVMTI_ERROR_OPAQUE_FRAME) {
+                error = JDWP_ERROR_INVALID_FRAMEID;
+            } else if (err == JVMTI_ERROR_THREAD_NOT_ALIVE) {
+                error = JDWP_ERROR_INVALID_THREAD;
+            } else if (err == JVMTI_ERROR_ILLEGAL_ARGUMENT) {
+                error = JDWP_ERROR_INVALID_FRAMEID;
+            } else if (err == JVMTI_ERROR_NO_MORE_FRAMES) {
+                error = JDWP_ERROR_INVALID_FRAMEID;
+            } else {
+                error = (jdwpError)err;
+            }
+            throw AgentException(error);
+        }
+    }
+}
+
+void 
+StackFrame::ThisObjectHandler::CheckErr(jvmtiError err) throw(AgentException)
+{
+    if (err != JVMTI_ERROR_NONE) {
+        jdwpError error;
+        if (err == JVMTI_ERROR_OPAQUE_FRAME) {
+            error = JDWP_ERROR_INVALID_FRAMEID;
+        } else if (err == JVMTI_ERROR_THREAD_NOT_ALIVE) {
+            error = JDWP_ERROR_INVALID_THREAD;
+        } else if (err == JVMTI_ERROR_ILLEGAL_ARGUMENT) {
+            error = JDWP_ERROR_INVALID_FRAMEID;
+        } else if (err == JVMTI_ERROR_NO_MORE_FRAMES) {
+            error = JDWP_ERROR_INVALID_FRAMEID;
+        } else {
+            error = (jdwpError)err;
+        }
+        throw AgentException(error);
+    }
+}
+
+void
+StackFrame::ThisObjectHandler::Execute(JNIEnv *jni) throw(AgentException)
+{
+    jthread thread = m_cmdParser->command.ReadThreadID(jni);
+    
+    if (thread == 0) {
+        throw AgentException(JDWP_ERROR_INVALID_THREAD);
+    }
+    if (!GetThreadManager().IsSuspended(thread))
+        throw AgentException(JVMTI_ERROR_THREAD_NOT_SUSPENDED);
+
+    jint frame = m_cmdParser->command.ReadFrameID(jni); // frame == depth
+    JDWP_TRACE_DATA("ThisObject: received: threadID=" << thread 
+        << ", frameID=" << frame);
+
+    jvmtiError err;
+    jint allCount;
+    JVMTI_TRACE(err, GetJvmtiEnv()->GetFrameCount(thread, &allCount));
+    CheckErr(err);
+    JDWP_ASSERT(allCount > 0);
+
+    jvmtiFrameInfo* frames = static_cast<jvmtiFrameInfo*>
+        (GetMemoryManager().Allocate(allCount * sizeof(jvmtiFrameInfo) JDWP_FILE_LINE));
+    AgentAutoFree af(frames JDWP_FILE_LINE);
+
+    jint count;
+    JVMTI_TRACE(err, GetJvmtiEnv()->GetStackTrace(thread, 0, allCount, frames, &count));
+    CheckErr(err);
+    JDWP_ASSERT(count <= allCount);
+    JDWP_ASSERT(frame <= count);
+
+    jvmtiFrameInfo& frameInfo = frames[frame];
+
+    jint modifiers;
+    JVMTI_TRACE(err, GetJvmtiEnv()->GetMethodModifiers(frameInfo.method, &modifiers));
+    CheckErr(err);
+
+    jvalue resValue;
+    if ((modifiers & (ACC_STATIC | ACC_NATIVE)) != 0) {
+        JDWP_TRACE_DATA("ThisObject: null this for method: "
+            << "modifiers=" << hex << modifiers
+            << ", static=" << hex << (modifiers & ACC_STATIC)
+            << ", native=" << hex << (modifiers & ACC_NATIVE));
+        resValue.l = 0;
+        m_cmdParser->reply.WriteValue(jni, JDWP_TAG_OBJECT, resValue);
+        return;
+    }
+
+    jobject ovalue = 0;
+    JVMTI_TRACE(err, GetJvmtiEnv()->GetLocalObject(thread, frame, 0, &ovalue));
+    CheckErr(err);
+    JDWP_ASSERT(ovalue != 0);
+
+    jdwpTag tag = GetClassManager().GetJdwpTag(jni, ovalue);
+    resValue.l = ovalue;
+
+    JDWP_TRACE_DATA("ThisObject: send: tag=" << tag 
+        << ", object=" << resValue.l);
+    m_cmdParser->reply.WriteValue(jni, tag, resValue);
+}
+
+void
+StackFrame::PopFramesHandler::Execute(JNIEnv *jni) throw(AgentException)
+{
+    jdwpCapabilities caps = GetCapabilities();
+    if (caps.canPopFrames != 1) {
+        throw AgentException(JDWP_ERROR_NOT_IMPLEMENTED);
+    }
+
+    jthread thread = m_cmdParser->command.ReadThreadID(jni);
+    if (thread == 0) {
+        throw AgentException(JDWP_ERROR_INVALID_THREAD);
+    }
+
+    jint frame = m_cmdParser->command.ReadFrameID(jni);
+    jint framesToPop = frame + 1;
+
+    JDWP_TRACE_DATA("PopFrames: received: threadID=" << thread 
+        << ", framesToPop=" << framesToPop);
+
+    GetThreadManager().PerformPopFrames(jni, framesToPop, thread);
+}

Propchange: harmony/enhanced/jdktools/trunk/modules/jpda/src/common/other/jpda/jdwp/agent/commands/StackFrame.cpp
------------------------------------------------------------------------------
    svn:eol-style = native

Added: harmony/enhanced/jdktools/trunk/modules/jpda/src/common/other/jpda/jdwp/agent/commands/StackFrame.h
URL: http://svn.apache.org/viewvc/harmony/enhanced/jdktools/trunk/modules/jpda/src/common/other/jpda/jdwp/agent/commands/StackFrame.h?view=auto&rev=480141
==============================================================================
--- harmony/enhanced/jdktools/trunk/modules/jpda/src/common/other/jpda/jdwp/agent/commands/StackFrame.h (added)
+++ harmony/enhanced/jdktools/trunk/modules/jpda/src/common/other/jpda/jdwp/agent/commands/StackFrame.h Tue Nov 28 09:49:08 2006
@@ -0,0 +1,118 @@
+/*
+ * Copyright 2005-2006 The Apache Software Foundation or its licensors, 
+ * as applicable.
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+
+/**
+ * @author Viacheslav G. Rybalov
+ * @version $Revision: 1.4.2.1 $
+ */
+
+/**
+ * @file
+ * StackFrame.h
+ *
+ */
+
+#ifndef _STACKFRAME_H_
+#define _STACKFRAME_H_
+
+#include "AgentException.h"
+#include "CommandHandler.h"
+
+namespace jdwp {
+
+    /**
+     * The namespace includes declaration of the classes implementing commands
+     * from the StackFrame command set.
+     */
+    namespace StackFrame {
+
+        /**
+         * The class implements the <code>GetValues</code> command from the
+         * StackFrame command set.
+         */
+        class GetValuesHandler : public SyncCommandHandler {
+        protected:
+
+            /**
+             * Executes the <code>GetValues</code> JDWP command for the
+             * StackFrame command set.
+             *
+             * @param jni - the JNI interface pointer
+             */
+            virtual void Execute(JNIEnv *jni) throw(AgentException);
+
+        };//GetValuesHandler
+
+        /**
+         * The class implements the <code>SetValues</code> command from the
+         * StackFrame command set.
+         */
+        class SetValuesHandler : public SyncCommandHandler {
+        protected:
+
+            /**
+             * Executes the <code>SetValues</code> JDWP command for the
+             * StackFrame command set.
+             *
+             * @param jni - the JNI interface pointer
+             */
+            virtual void Execute(JNIEnv *jni) throw(AgentException);
+
+        };//SetValuesHandler
+
+        /**
+         * The class implements the <code>ThisObject</code> command from the
+         * StackFrame command set.
+         */
+        class ThisObjectHandler : public SyncCommandHandler {
+        protected:
+
+            /**
+             * Executes the <code>ThisObject</code> JDWP command for the
+             * StackFrame command set.
+             *
+             * @param jni - the JNI interface pointer
+             */
+            virtual void Execute(JNIEnv *jni) throw(AgentException);
+
+        private:
+            void CheckErr(jvmtiError err) throw(AgentException);
+        };//ThisObjectHandler
+
+        /**
+         * The class implements the <code>PopFrames</code> command from the
+         * StackFrame command set.
+         */
+        class PopFramesHandler : public SyncCommandHandler {
+        protected:
+
+            /**
+             * Executes the <code>PopFrames</code> JDWP command for the
+             * StackFrame command set.
+             *
+             * @param jni - the JNI interface pointer
+             */
+            virtual void Execute(JNIEnv *jni) throw(AgentException);
+
+        };//PopFramesHandler
+
+    } // StackFrame
+
+} //jdwp
+
+#endif //_STACKFRAME_H_

Propchange: harmony/enhanced/jdktools/trunk/modules/jpda/src/common/other/jpda/jdwp/agent/commands/StackFrame.h
------------------------------------------------------------------------------
    svn:eol-style = native

Added: harmony/enhanced/jdktools/trunk/modules/jpda/src/common/other/jpda/jdwp/agent/commands/StringReference.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/jdktools/trunk/modules/jpda/src/common/other/jpda/jdwp/agent/commands/StringReference.cpp?view=auto&rev=480141
==============================================================================
--- harmony/enhanced/jdktools/trunk/modules/jpda/src/common/other/jpda/jdwp/agent/commands/StringReference.cpp (added)
+++ harmony/enhanced/jdktools/trunk/modules/jpda/src/common/other/jpda/jdwp/agent/commands/StringReference.cpp Tue Nov 28 09:49:08 2006
@@ -0,0 +1,58 @@
+/*
+ * Copyright 2005-2006 The Apache Software Foundation or its licensors, as applicable.
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+
+/**
+ * @author Anton V. Karnachuk
+ * @version $Revision: 1.9 $
+ */
+#include "StringReference.h"
+#include "PacketParser.h"
+#include "ClassManager.h"
+
+using namespace jdwp;
+using namespace StringReference;
+
+//-----------------------------------------------------------------------------
+// StringReference -----------------------------------------------------------------
+
+void 
+StringReference::ValueHandler::Execute(JNIEnv *jni) throw(AgentException) 
+{
+
+    //INVALID_OBJECT can be thrown below
+    jstring stringObject = m_cmdParser->command.ReadStringID(jni);
+    JDWP_TRACE_DATA("Value: received: stringID=" << stringObject);
+
+    // get length of the string
+    jsize len = jni->GetStringLength(stringObject);
+    jsize utfLen = jni->GetStringUTFLength(stringObject);
+
+    // allocate memory for getting string value
+    char* p_string = reinterpret_cast<char*>(GetMemoryManager().Allocate(utfLen + 1 JDWP_FILE_LINE));
+    // create auto-free pointer for p_string
+    AgentAutoFree autoFree_p_string(p_string JDWP_FILE_LINE);
+
+    // obtain the string's value
+    jni->GetStringUTFRegion(stringObject, 0, len, p_string);
+    AgentBase::GetClassManager().CheckOnException(jni);
+
+    JDWP_TRACE_DATA("Value: send: utfLen=" << utfLen
+        << ", string=" << JDWP_CHECK_NULL(p_string));
+
+    // write string to the reply
+    m_cmdParser->reply.WriteString(p_string, utfLen);
+}

Propchange: harmony/enhanced/jdktools/trunk/modules/jpda/src/common/other/jpda/jdwp/agent/commands/StringReference.cpp
------------------------------------------------------------------------------
    svn:eol-style = native

Added: harmony/enhanced/jdktools/trunk/modules/jpda/src/common/other/jpda/jdwp/agent/commands/StringReference.h
URL: http://svn.apache.org/viewvc/harmony/enhanced/jdktools/trunk/modules/jpda/src/common/other/jpda/jdwp/agent/commands/StringReference.h?view=auto&rev=480141
==============================================================================
--- harmony/enhanced/jdktools/trunk/modules/jpda/src/common/other/jpda/jdwp/agent/commands/StringReference.h (added)
+++ harmony/enhanced/jdktools/trunk/modules/jpda/src/common/other/jpda/jdwp/agent/commands/StringReference.h Tue Nov 28 09:49:08 2006
@@ -0,0 +1,75 @@
+/*
+ * Copyright 2005-2006 The Apache Software Foundation or its licensors, 
+ * as applicable.
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+
+/**
+ * @author Anton V. Karnachuk
+ * @version $Revision: 1.5.2.1 $
+ */
+
+/**
+ * @file
+ * StringReference.h
+ *
+ */
+
+#ifndef _STRING_REFERENCE_H_
+#define _STRING_REFERENCE_H_
+
+#include "AgentException.h"
+#include "CommandHandler.h"
+
+namespace jdwp {
+
+    /**
+     * The namespace includes declaration of the classes implementing commands
+     * from the StringReference command set.
+     */
+    namespace StringReference {
+
+        /**
+         * The class implements the <code>Superclass</code> command from the
+         * StringReference command set.
+         */
+        class ValueHandler : public SyncCommandHandler {
+        protected:
+
+            /**
+             * Executes the <code>Value</code> JDWP command for the
+             * StringReference command set.
+             *
+             * @param jni - the JNI interface pointer
+             *
+             * @exception If packet data integrity gets broken,
+             *            <code>InternalErrorException</code> is thrown.
+             * @exception If the system runs out of memory,
+             *            <code>OutOfMemoryException</code> is thrown.
+             *
+             * following @exception The following implementations of the given interface
+             *                      may throw <code>AgentException</code>: 
+             *                      <code>INVALID_STRING</code>, 
+             *                      <code>INVALID_OBJECT</code>, <code>VM_DEAD</code>.
+             */
+            virtual void Execute(JNIEnv *jni) throw(AgentException);
+
+        }; //ValueHandler
+
+    }; // StringReference
+
+} //jdwp
+
+#endif //_STRING_REFERENCE_H_

Propchange: harmony/enhanced/jdktools/trunk/modules/jpda/src/common/other/jpda/jdwp/agent/commands/StringReference.h
------------------------------------------------------------------------------
    svn:eol-style = native

Added: harmony/enhanced/jdktools/trunk/modules/jpda/src/common/other/jpda/jdwp/agent/commands/ThreadGroupReference.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/jdktools/trunk/modules/jpda/src/common/other/jpda/jdwp/agent/commands/ThreadGroupReference.cpp?view=auto&rev=480141
==============================================================================
--- harmony/enhanced/jdktools/trunk/modules/jpda/src/common/other/jpda/jdwp/agent/commands/ThreadGroupReference.cpp (added)
+++ harmony/enhanced/jdktools/trunk/modules/jpda/src/common/other/jpda/jdwp/agent/commands/ThreadGroupReference.cpp Tue Nov 28 09:49:08 2006
@@ -0,0 +1,180 @@
+/*
+ * Copyright 2005-2006 The Apache Software Foundation or its licensors, as applicable.
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+
+/**
+ * @author Vitaly A. Provodin
+ * @version $Revision: 1.11 $
+ */
+#include "ThreadGroupReference.h"
+#include "VirtualMachine.h"
+
+#include "PacketParser.h"
+#include "ThreadManager.h"
+#include "Log.h"
+
+using namespace jdwp;
+using namespace ThreadGroupReference;
+
+//-----------------------------------------------------------------------------
+//NameHandler------------------------------------------------------------------
+
+void
+ThreadGroupReference::NameHandler::Execute(JNIEnv *jni) throw (AgentException)
+{
+    jvmtiThreadGroupInfo info;
+    info.name = 0;
+
+    jthreadGroup threadGroupID = m_cmdParser->command.ReadThreadGroupID(jni);
+    JDWP_TRACE_DATA("Name: received: threadGroupID=" << threadGroupID);
+
+    jvmtiError err;
+    JVMTI_TRACE(err, GetJvmtiEnv()->GetThreadGroupInfo(threadGroupID, &info));
+
+    JvmtiAutoFree dobj(info.name);
+
+    JDWP_ASSERT(err != JVMTI_ERROR_NULL_POINTER);
+
+    if (err != JVMTI_ERROR_NONE)
+        throw AgentException(err);
+
+    JDWP_TRACE_DATA("Name: send: name=" << info.name);
+    m_cmdParser->reply.WriteString(info.name);
+}
+
+//-----------------------------------------------------------------------------
+//ParentHandler----------------------------------------------------------------
+
+void
+ThreadGroupReference::ParentHandler::Execute(JNIEnv *jni) throw(AgentException)
+{
+    jvmtiThreadGroupInfo info;
+    info.name = 0;
+
+    jthreadGroup threadGroupID = m_cmdParser->command.ReadThreadGroupID(jni);
+    JDWP_TRACE_DATA("Parent: received: threadGroupID=" << threadGroupID);
+
+    jvmtiError err;
+    JVMTI_TRACE(err, GetJvmtiEnv()->GetThreadGroupInfo(threadGroupID, &info));
+
+    JvmtiAutoFree dobj(info.name);
+
+    JDWP_ASSERT(err != JVMTI_ERROR_NULL_POINTER);
+
+    if (err != JVMTI_ERROR_NONE)
+        throw AgentException(err);
+
+    JDWP_TRACE_DATA("Parent: send: name=" << info.name << ", parent=" << info.parent);
+    m_cmdParser->reply.WriteThreadGroupID(jni, info.parent);
+}
+
+//-----------------------------------------------------------------------------
+//ChildrenHandler--------------------------------------------------------------
+
+void
+ThreadGroupReference::ChildrenHandler::Execute(JNIEnv *jni) throw(AgentException)
+{
+    jint totalThreadCount, threadCount = 0;
+    jint groupCount;
+    jthread* threads = 0;
+    jthreadGroup* groups = 0;
+
+    jthreadGroup threadGroupID = m_cmdParser->command.ReadThreadGroupID(jni);
+    JDWP_TRACE_DATA("Children: received: threadGroupID=" << threadGroupID); 
+
+    jvmtiError err;
+    JVMTI_TRACE(err, GetJvmtiEnv()->GetThreadGroupChildren(threadGroupID,
+        &totalThreadCount, &threads, &groupCount, &groups));
+
+    JvmtiAutoFree dobjt(threads);
+    JvmtiAutoFree dobjg(groups);
+
+    JDWP_ASSERT(err != JVMTI_ERROR_NULL_POINTER);
+
+    if (err != JVMTI_ERROR_NONE)
+        throw AgentException(err);
+
+    ThreadManager& thrdMgr = GetThreadManager();
+
+    JDWP_TRACE_DATA("Children: threadGroupID=" << threadGroupID 
+        << ", totalThreadCount=" << totalThreadCount 
+        << ", threads=" << threads 
+        << ", groupCount=" << groupCount 
+        << ", groups=" << groups);
+
+    int i;
+
+    // filter out agent threads
+    for (i = 0; i < totalThreadCount; i++) {
+#ifndef NDEBUG
+        if (JDWP_TRACE_ENABLED(LOG_KIND_DATA)) {
+            jvmtiThreadInfo info;
+            info.name = 0;
+            JVMTI_TRACE(err, GetJvmtiEnv()->GetThreadInfo(threads[i], &info));
+            JvmtiAutoFree jafInfoName(info.name);
+            JDWP_TRACE_DATA("Children: thread#=" << i
+                << ", name= " << JDWP_CHECK_NULL(info.name)
+                << ", isAgent=" << (thrdMgr.IsAgentThread(jni, threads[i])));
+        }
+#endif
+        if (!thrdMgr.IsAgentThread(jni, threads[i])) {
+            threads[threadCount] = threads[i];
+            threadCount++;
+        }
+    }
+
+    m_cmdParser->reply.WriteInt(threadCount);
+    for (i = 0; i < threadCount; i++) {
+        m_cmdParser->reply.WriteThreadID(jni, threads[i]);
+    }
+
+    m_cmdParser->reply.WriteInt(groupCount);
+    for (i = 0; i < groupCount; i++) {
+        m_cmdParser->reply.WriteThreadGroupID(jni, groups[i]);
+    }
+
+#ifndef NDEBUG    
+    if (JDWP_TRACE_ENABLED(LOG_KIND_DATA)) {
+        int i;
+        JDWP_TRACE_DATA("Clildren: send: threadCount=" << threadCount 
+            << ", groupCount=" << groupCount);
+
+        for (i = 0; i < threadCount; i++) {
+            jvmtiThreadInfo info;
+            info.name = 0;
+            JVMTI_TRACE(err, GetJvmtiEnv()->GetThreadInfo(threads[i], &info));
+            JvmtiAutoFree jafInfoName(info.name);
+
+            JDWP_TRACE_DATA("Clildren: send: thread#=" << i
+            << ", threadID=" << threads[i]
+            << ", name=" << JDWP_CHECK_NULL(info.name));
+        }
+
+        for (i = 0; i < groupCount; i++) {
+            jvmtiThreadGroupInfo info;
+            info.name = 0;
+            JVMTI_TRACE(err, GetJvmtiEnv()->GetThreadGroupInfo(groups[i], &info));
+            JvmtiAutoFree jafInfoName(info.name);
+
+            JDWP_TRACE_DATA("Clildren: send: group#" << i 
+            << ", groupID=" << groups[i]
+            << ", name=" << JDWP_CHECK_NULL(info.name));
+        }
+    }
+#endif
+}
+
+//-----------------------------------------------------------------------------

Propchange: harmony/enhanced/jdktools/trunk/modules/jpda/src/common/other/jpda/jdwp/agent/commands/ThreadGroupReference.cpp
------------------------------------------------------------------------------
    svn:eol-style = native

Added: harmony/enhanced/jdktools/trunk/modules/jpda/src/common/other/jpda/jdwp/agent/commands/ThreadGroupReference.h
URL: http://svn.apache.org/viewvc/harmony/enhanced/jdktools/trunk/modules/jpda/src/common/other/jpda/jdwp/agent/commands/ThreadGroupReference.h?view=auto&rev=480141
==============================================================================
--- harmony/enhanced/jdktools/trunk/modules/jpda/src/common/other/jpda/jdwp/agent/commands/ThreadGroupReference.h (added)
+++ harmony/enhanced/jdktools/trunk/modules/jpda/src/common/other/jpda/jdwp/agent/commands/ThreadGroupReference.h Tue Nov 28 09:49:08 2006
@@ -0,0 +1,100 @@
+/*
+ * Copyright 2005-2006 The Apache Software Foundation or its licensors, 
+ * as applicable.
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+
+/**
+ * @author Vitaly A. Provodin
+ * @version $Revision: 1.4.2.1 $
+ */
+
+/**
+ * @file
+ * ThreadGroupReference.h
+ *
+ */
+
+#ifndef _THREAD_GROUP_REFERENCE_H_
+#define _THREAD_GROUP_REFERENCE_H_
+
+#include "AgentException.h"
+#include "CommandHandler.h"
+
+namespace jdwp {
+
+    /**
+     * The namespace includes the declaration of the classes implementing 
+     * commands from the ThreadGroupReference command set.
+     */
+    namespace ThreadGroupReference {
+        
+        /**
+         * The class implements the <code>Name</code> command from the
+         * ThreadGroupReference command set.
+         */
+        class NameHandler : public SyncCommandHandler {
+        protected:
+
+            /**
+             * Executes the <code>Name</code> JDWP command for the
+             * ThreadGroupReference command set.
+             *
+             * @param jni - the JNI interface pointer
+             */
+            virtual void Execute(JNIEnv *jni) throw(AgentException);
+
+        };//NameHandler
+
+        /**
+         * The class implements the <code>Parent</code> command from the
+         * ThreadGroupReference command set.
+         */
+        class ParentHandler : public SyncCommandHandler {
+        protected:
+
+            /**
+             * Executes the <code>Parent</code> JDWP command for the
+             * ThreadGroupReference command set.
+             *
+             * @param jni - the JNI interface pointer
+             */
+            virtual void Execute(JNIEnv *jni) throw(AgentException);
+
+        };//ParentHandler
+
+        /**
+         * The class implements the <code>Children</code> command from the
+         * ThreadGroupReference command set.
+         */
+        class ChildrenHandler : public SyncCommandHandler {
+        protected:
+
+            /**
+             * Executes the <code>Children</code> JDWP command for the
+             * ThreadGroupReference command set.
+             *
+             * @param jni - the JNI interface pointer
+             */
+            virtual void Execute(JNIEnv *jni) throw(AgentException);
+
+        };//ChildrenHandler
+
+    }//ThreadGroupReference
+
+}//jdwp
+
+#endif //_THREAD_GROUP_REFERENCE_H_
+

Propchange: harmony/enhanced/jdktools/trunk/modules/jpda/src/common/other/jpda/jdwp/agent/commands/ThreadGroupReference.h
------------------------------------------------------------------------------
    svn:eol-style = native

Added: harmony/enhanced/jdktools/trunk/modules/jpda/src/common/other/jpda/jdwp/agent/commands/ThreadReference.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/jdktools/trunk/modules/jpda/src/common/other/jpda/jdwp/agent/commands/ThreadReference.cpp?view=auto&rev=480141
==============================================================================
--- harmony/enhanced/jdktools/trunk/modules/jpda/src/common/other/jpda/jdwp/agent/commands/ThreadReference.cpp (added)
+++ harmony/enhanced/jdktools/trunk/modules/jpda/src/common/other/jpda/jdwp/agent/commands/ThreadReference.cpp Tue Nov 28 09:49:08 2006
@@ -0,0 +1,373 @@
+/*
+ * Copyright 2005-2006 The Apache Software Foundation or its licensors, as applicable.
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+
+/**
+ * @author Vitaly A. Provodin
+ * @version $Revision: 1.16.2.2 $
+ */
+#include "ThreadReference.h"
+#include "PacketParser.h"
+#include "ThreadManager.h"
+#include "VirtualMachine.h"
+#include "MemoryManager.h"
+#include "ClassManager.h"
+
+using namespace jdwp;
+using namespace ThreadReference;
+
+//-----------------------------------------------------------------------------
+//NameHandler------------------------------------------------------------------
+
+void
+ThreadReference::NameHandler::Execute(JNIEnv *jni) throw (AgentException)
+{
+    jvmtiThreadInfo info;
+    info.name = 0;
+    jthread thrd = m_cmdParser->command.ReadThreadID(jni);
+    JDWP_TRACE_DATA("Name: received: threadID=" << thrd);
+
+    jvmtiError err;
+    JVMTI_TRACE(err, GetJvmtiEnv()->GetThreadInfo(thrd, &info));
+    JvmtiAutoFree destroyer(info.name);
+
+    if (err != JVMTI_ERROR_NONE)
+        throw AgentException(err);
+
+    JDWP_TRACE_DATA("Name: send: name=" << JDWP_CHECK_NULL(info.name));
+    m_cmdParser->reply.WriteString(info.name);
+}
+
+//-----------------------------------------------------------------------------
+//SuspendHandler----------------------------------------------------------------
+
+void
+ThreadReference::SuspendHandler::Execute(JNIEnv *jni) throw(AgentException)
+{
+    jthread thrd = m_cmdParser->command.ReadThreadID(jni);
+
+    JDWP_TRACE_DATA("Suspend: suspend: threadID=" << thrd);
+    GetThreadManager().Suspend(jni, thrd);
+}
+
+//-----------------------------------------------------------------------------
+//ResumeHandler----------------------------------------------------------------
+
+void
+ThreadReference::ResumeHandler::Execute(JNIEnv *jni) throw(AgentException)
+{
+    jthread thrd = m_cmdParser->command.ReadThreadID(jni);
+
+    JDWP_TRACE_DATA("Resume: resume: threadID=" << thrd);
+    GetThreadManager().Resume(jni, thrd);
+}
+
+//-----------------------------------------------------------------------------
+//StatusHandler----------------------------------------------------------------
+
+void
+ThreadReference::StatusHandler::Execute(JNIEnv *jni) throw (AgentException)
+{
+    jint thread_state;
+
+    jthread thrd = m_cmdParser->command.ReadThreadID(jni);
+    JDWP_TRACE_DATA("Status: received: threadID=" << thrd);
+
+    jvmtiError err;
+    JVMTI_TRACE(err, GetJvmtiEnv()->GetThreadState(thrd, &thread_state));
+    JDWP_TRACE_DATA("Status: threadState=" << hex << thread_state);
+
+    if (err != JVMTI_ERROR_NONE)
+        throw AgentException(err);
+
+    jint ret_value;
+    jint const THREAD_STATE_SLEEPING =
+        JVMTI_THREAD_STATE_SLEEPING | JVMTI_THREAD_STATE_ALIVE;
+
+    if ( (thread_state & THREAD_STATE_SLEEPING) == THREAD_STATE_SLEEPING ) {
+        ret_value = JDWP_THREAD_STATUS_SLEEPING;
+    } else {
+        switch (thread_state & JVMTI_JAVA_LANG_THREAD_STATE_MASK)
+        {
+        case JVMTI_JAVA_LANG_THREAD_STATE_TERMINATED:
+            ret_value = JDWP_THREAD_STATUS_ZOMBIE;
+            break;
+        case JVMTI_JAVA_LANG_THREAD_STATE_RUNNABLE:
+            ret_value = JDWP_THREAD_STATUS_RUNNING;
+            break;
+        case JVMTI_JAVA_LANG_THREAD_STATE_BLOCKED:
+            ret_value = JDWP_THREAD_STATUS_MONITOR;
+            break;
+        case JVMTI_JAVA_LANG_THREAD_STATE_WAITING:
+        case JVMTI_JAVA_LANG_THREAD_STATE_TIMED_WAITING:
+            ret_value = JDWP_THREAD_STATUS_WAIT;
+            break;
+        default:
+            JDWP_TRACE_DATA("Status: bad Java thread state: " 
+                << hex << thread_state);
+            throw InternalErrorException();
+        }
+    }
+    m_cmdParser->reply.WriteInt(ret_value);
+    if (thread_state & JVMTI_THREAD_STATE_SUSPENDED)
+        m_cmdParser->reply.WriteInt(JDWP_SUSPEND_STATUS_SUSPENDED);
+    else
+        m_cmdParser->reply.WriteInt(0);
+    JDWP_TRACE_DATA("Status: send: status=" << ret_value);
+}
+
+//-----------------------------------------------------------------------------
+//ThreadGroupHandler-----------------------------------------------------------
+
+void 
+ThreadReference::ThreadGroupHandler::Execute(JNIEnv *jni) throw(AgentException)
+{
+    jvmtiThreadInfo info;
+    info.name = 0;
+
+    jthread thrd = m_cmdParser->command.ReadThreadID(jni);
+    JDWP_TRACE_DATA("ThreadGroup: received: threadID=" << thrd);
+
+    jvmtiError err;
+    JVMTI_TRACE(err, GetJvmtiEnv()->GetThreadInfo(thrd, &info));
+    JvmtiAutoFree destroyer(info.name);
+
+    if (err != JVMTI_ERROR_NONE)
+        throw AgentException(err);
+
+    JDWP_TRACE_DATA("ThreadGroup: send: threadGroupID=" << info.thread_group);
+    m_cmdParser->reply.WriteThreadGroupID(jni, info.thread_group);
+}
+
+//-----------------------------------------------------------------------------
+//FramesHandler----------------------------------------------------------------
+
+void
+ThreadReference::FramesHandler::Execute(JNIEnv *jni) throw(AgentException)
+{
+    jvmtiEnv *jvmti = GetJvmtiEnv();
+
+    jthread thrd = m_cmdParser->command.ReadThreadID(jni);
+    
+    if (!GetThreadManager().IsSuspended(thrd))
+        throw AgentException(JVMTI_ERROR_THREAD_NOT_SUSPENDED);
+    
+    jint startFrame = m_cmdParser->command.ReadInt();
+    jint length = m_cmdParser->command.ReadInt();
+    JDWP_TRACE_DATA("Frames: received: threadID=" << thrd 
+        << ", startFrame=" << startFrame 
+        << ", length=" << length);
+
+    jint frameCount;
+    jvmtiError err;
+    JVMTI_TRACE(err, jvmti->GetFrameCount(thrd, &frameCount));
+
+
+    if (err != JVMTI_ERROR_NONE)
+        throw AgentException(err);
+
+    if (length == -1) {
+        length = frameCount - startFrame;
+    }
+
+    if (length == 0) {
+        JDWP_TRACE_DATA("Frames: frameCount=" << frameCount 
+            << ", startFrame=" << startFrame 
+            << ", length=" << length);
+        m_cmdParser->reply.WriteInt(0);
+        return;
+    }
+
+    if (startFrame >= frameCount || startFrame < 0)
+        throw AgentException(JDWP_ERROR_INVALID_INDEX);
+
+    jint maxFrame = startFrame + length;
+    if ( (length < 0) || (maxFrame > frameCount) ) {
+        throw AgentException(JDWP_ERROR_INVALID_LENGTH);
+    }
+
+    jvmtiFrameInfo *frame_buffer = 
+        reinterpret_cast<jvmtiFrameInfo*>(GetMemoryManager().Allocate(
+                        sizeof(jvmtiFrameInfo)*frameCount JDWP_FILE_LINE));
+    AgentAutoFree destroyer(frame_buffer JDWP_FILE_LINE);
+
+    jint count;
+    JVMTI_TRACE(err, jvmti->GetStackTrace(thrd, 0, frameCount, 
+                                                 frame_buffer, &count));
+    if (err != JVMTI_ERROR_NONE) {
+        throw AgentException(err);
+    }
+    JDWP_ASSERT(count == frameCount);
+
+    m_cmdParser->reply.WriteInt(length);
+
+    JDWP_TRACE_DATA("Frames: frameCount=" << frameCount 
+        << ", startFrame=" << startFrame 
+        << ", length=" << length 
+        << ", maxFrame=" << maxFrame);
+
+    jclass declaring_class;
+    jdwpTypeTag typeTag;
+
+    for (jint j = startFrame; j < maxFrame; j++) {
+        m_cmdParser->reply.WriteFrameID(jni, thrd, j, frameCount);
+
+        JVMTI_TRACE(err, jvmti->GetMethodDeclaringClass(frame_buffer[j].method,
+            &declaring_class));
+        if (err != JVMTI_ERROR_NONE) {
+            throw AgentException(err);
+        }
+
+        typeTag = GetClassManager().GetJdwpTypeTag(declaring_class);
+
+#ifndef NDEBUG
+        if (JDWP_TRACE_ENABLED(LOG_KIND_DATA)) {
+            jvmtiThreadInfo info;
+            JVMTI_TRACE(err, GetJvmtiEnv()->GetThreadInfo(thrd, &info));
+            JDWP_TRACE_DATA("Frames: send: frame#=" << j 
+                << ", threadName=" << info.name 
+                << ", loc=" << frame_buffer[j].location 
+                << ", methodID=" << frame_buffer[j].method 
+                << ", classID=" << declaring_class
+                << ", typeTag=" << typeTag);
+        }
+#endif
+
+        m_cmdParser->reply.WriteLocation(jni, typeTag,
+                        declaring_class, frame_buffer[j].method,
+                        frame_buffer[j].location);
+    }
+}
+
+//-----------------------------------------------------------------------------
+//FrameCountHandler------------------------------------------------------------
+
+void
+ThreadReference::FrameCountHandler::Execute(JNIEnv *jni) throw (AgentException)
+{
+    jint count;
+
+    jthread thrd = m_cmdParser->command.ReadThreadID(jni);
+    JDWP_TRACE_DATA("FrameCount: received: threadID=" << thrd);
+
+    if (!GetThreadManager().IsSuspended(thrd))
+        throw AgentException(JVMTI_ERROR_THREAD_NOT_SUSPENDED);
+
+    jvmtiError err;
+    JVMTI_TRACE(err, GetJvmtiEnv()->GetFrameCount(thrd, &count));
+
+    if (err != JVMTI_ERROR_NONE)
+        throw AgentException(err);
+
+    m_cmdParser->reply.WriteInt(count);
+    JDWP_TRACE_DATA("FrameCount: send: count=" << count);
+}
+
+//-----------------------------------------------------------------------------
+//OwnedMonitorsHandler---------------------------------------------------------
+
+void
+ThreadReference::OwnedMonitorsHandler::Execute(JNIEnv *jni) throw(AgentException)
+{
+    jint count;
+    jobject* owned_monitors = 0;
+    jthread thrd = m_cmdParser->command.ReadThreadID(jni);
+    JDWP_TRACE_DATA("OwnedMonitors: received: threadID=" << thrd);
+
+    jvmtiError err;
+    JVMTI_TRACE(err, GetJvmtiEnv()->GetOwnedMonitorInfo(thrd, &count,
+        &owned_monitors));
+    JvmtiAutoFree destroyer(owned_monitors);
+
+    JDWP_ASSERT(err != JVMTI_ERROR_NULL_POINTER);
+
+    if (err != JVMTI_ERROR_NONE)
+        throw AgentException(err);
+
+    JDWP_TRACE_DATA("OwnedMonitors: send: monitors=" << count);
+    m_cmdParser->reply.WriteInt(count);
+    for (int i = 0; i < count; i++)
+    {
+        JDWP_TRACE_DATA("OwnedMonitors: send: monitor#=" << i
+            << ", objectID=" << owned_monitors[i]);
+        m_cmdParser->reply.WriteTaggedObjectID(jni, owned_monitors[i]);
+    }
+}
+
+//-----------------------------------------------------------------------------
+//OwnedMonitorsHandler---------------------------------------------------------
+
+void
+ThreadReference::CurrentContendedMonitorHandler::Execute(JNIEnv *jni) throw(AgentException)
+{
+    jobject monitor;
+    jthread thrd = m_cmdParser->command.ReadThreadID(jni);\
+    JDWP_TRACE_DATA("CurrentContendedMonitor: received: threadID=" << thrd);
+                                                                           
+    jvmtiError err;
+    JVMTI_TRACE(err, GetJvmtiEnv()->GetCurrentContendedMonitor(thrd, &monitor));
+
+    JDWP_ASSERT(err != JVMTI_ERROR_NULL_POINTER);
+
+    if (err != JVMTI_ERROR_NONE)
+        throw AgentException(err);
+
+    JDWP_TRACE_DATA("CurrentContendedMonitor: send: monitor=" << monitor);
+    m_cmdParser->reply.WriteTaggedObjectID(jni, monitor);
+}
+
+//-----------------------------------------------------------------------------
+//StopHandler------------------------------------------------------------------
+
+void
+ThreadReference::StopHandler::Execute(JNIEnv *jni) throw(AgentException)
+{
+    jthread thrd = m_cmdParser->command.ReadThreadID(jni);
+    jobject excp = m_cmdParser->command.ReadObjectID(jni);
+
+    JDWP_TRACE_DATA("Stop: stop: threadID=" << thrd 
+        << ", throwableID=" << excp);
+    GetThreadManager().Stop(jni, thrd, excp);
+}
+
+//-----------------------------------------------------------------------------
+//InterruptHandler-------------------------------------------------------------
+
+void
+ThreadReference::InterruptHandler::Execute(JNIEnv *jni) throw(AgentException)
+{
+    jthread thrd = m_cmdParser->command.ReadThreadID(jni);
+
+    JDWP_TRACE_DATA("Interrupt: interrupt: threadID=" << thrd);
+    GetThreadManager().Interrupt(jni, thrd);
+}
+
+//-----------------------------------------------------------------------------
+//SuspendCountHandler----------------------------------------------------------
+
+void
+ThreadReference::SuspendCountHandler::Execute(JNIEnv *jni)
+    throw (AgentException)
+{
+    jthread thrd = m_cmdParser->command.ReadThreadID(jni);
+    JDWP_TRACE_DATA("SuspendCount: received: threadID=" << thrd);
+    jint count = GetThreadManager().GetSuspendCount(jni, thrd);
+
+    JDWP_TRACE_DATA("SuspendCount: send: count=" << count);
+    m_cmdParser->reply.WriteInt(count);
+}
+
+//-----------------------------------------------------------------------------

Propchange: harmony/enhanced/jdktools/trunk/modules/jpda/src/common/other/jpda/jdwp/agent/commands/ThreadReference.cpp
------------------------------------------------------------------------------
    svn:eol-style = native

Added: harmony/enhanced/jdktools/trunk/modules/jpda/src/common/other/jpda/jdwp/agent/commands/ThreadReference.h
URL: http://svn.apache.org/viewvc/harmony/enhanced/jdktools/trunk/modules/jpda/src/common/other/jpda/jdwp/agent/commands/ThreadReference.h?view=auto&rev=480141
==============================================================================
--- harmony/enhanced/jdktools/trunk/modules/jpda/src/common/other/jpda/jdwp/agent/commands/ThreadReference.h (added)
+++ harmony/enhanced/jdktools/trunk/modules/jpda/src/common/other/jpda/jdwp/agent/commands/ThreadReference.h Tue Nov 28 09:49:08 2006
@@ -0,0 +1,252 @@
+/*
+ * Copyright 2005-2006 The Apache Software Foundation or its licensors, 
+ * as applicable.
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+
+/**
+ * @author Vitaly A. Provodin
+ * @version $Revision: 1.4.2.1 $
+ */
+
+/**
+ * @file
+ * ThreadReference.h
+ *
+ */
+
+#ifndef _THREAD_REFERENCE_H_
+#define _THREAD_REFERENCE_H_
+
+#include "AgentException.h"
+#include "CommandHandler.h"
+
+namespace jdwp {
+
+    /**
+     * The namespace includes declaration of the classes implementing commands
+     * from the ThreadReference command set.
+     */
+    namespace ThreadReference {
+        
+        /**
+         * The class implements the <code>Name</code> command from the
+         * ThreadReference command set.
+         */
+        class NameHandler : public SyncCommandHandler {
+        protected:
+
+            /**
+             * Executes the <code>Name</code> JDWP command for the
+             * ThreadReference command set.
+             *
+             * @param jni - the JNI interface pointer
+             */
+            virtual void Execute(JNIEnv *jni) throw(AgentException);
+
+        };//NameHandler
+
+        /**
+         * The class implements the <code>Suspend</code> command from the
+         * ThreadReference command set.
+         */
+        class SuspendHandler : public SyncCommandHandler {
+        protected:
+
+            /**
+             * Executes the <code>Suspend</code> JDWP command for the
+             * ThreadReference command set.
+             *
+             * @param jni - the JNI interface pointer
+             */
+            virtual void Execute(JNIEnv *jni) throw(AgentException);
+
+        };//SuspendHandler
+
+        /**
+         * The class implements the <code>Resume</code> command from the
+         * ThreadReference command set.
+         */
+        class ResumeHandler : public SyncCommandHandler {
+        protected:
+
+            /**
+             * Executes the <code>Resume</code> JDWP command for the
+             * ThreadReference command set.
+             *
+             * @param jni - the JNI interface pointer
+             */
+            virtual void Execute(JNIEnv *jni) throw(AgentException);
+
+        };//ResumeHandler
+
+        /**
+         * The class implements the <code>Status</code> command from the
+         * ThreadReference command set.
+         */
+        class StatusHandler : public SyncCommandHandler {
+        protected:
+
+            /**
+             * Executes the <code>Status</code> JDWP command for the
+             * ThreadReference command set.
+             *
+             * @param jni - the JNI interface pointer
+             */
+            virtual void Execute(JNIEnv *jni) throw(AgentException);
+
+        };//StatusHandler
+
+        /**
+         * The class implements the <code>ThreadGroup</code> command from the
+         * ThreadReference command set.
+         */
+        class ThreadGroupHandler : public SyncCommandHandler {
+        protected:
+
+            /**
+             * Executes the <code>ThreadGroup</code> JDWP command for the
+             * ThreadReference command set.
+             *
+             * @param jni - the JNI interface pointer
+             */
+            virtual void Execute(JNIEnv *jni) throw(AgentException);
+
+        };//ThreadGroupHandler
+
+        /**
+         * The class implements the <code>Frames</code> command from the
+         * ThreadReference command set.
+         */
+        class FramesHandler : public SyncCommandHandler {
+        protected:
+
+            /**
+             * Executes the <code>Frames</code> JDWP command for the
+             * ThreadReference command set.
+             *
+             * @param jni - the JNI interface pointer
+             */
+            virtual void Execute(JNIEnv *jni) throw(AgentException);
+
+        };//FramesHandler
+
+        /**
+         * The class implements the <code>FrameCount</code> command from the
+         * ThreadReference command set.
+         */
+        class FrameCountHandler : public SyncCommandHandler {
+        protected:
+
+            /**
+             * Executes the <code>FrameCount</code> JDWP command for the
+             * ThreadReference command set.
+             *
+             * @param jni - the JNI interface pointer
+             */
+            virtual void Execute(JNIEnv *jni) throw(AgentException);
+
+        };//FrameCountHandler
+
+        /**
+         * The class implements the <code>OwnedMonitors</code> command from the
+         * ThreadReference command set.
+         */
+        class OwnedMonitorsHandler : public SyncCommandHandler {
+        protected:
+
+            /**
+             * Executes the <code>OwnedMonitors</code> JDWP command for the
+             * ThreadReference command set.
+             *
+             * @param jni - the JNI interface pointer
+             */
+            virtual void Execute(JNIEnv *jni) throw(AgentException);
+
+        };//OwnedMonitorsHandler
+
+        /**
+         * The class implements the <code>CurrentContendedMonitor</code> command from the
+         * ThreadReference command set.
+         */
+        class CurrentContendedMonitorHandler : public SyncCommandHandler {
+        protected:
+
+            /**
+             * Executes the <code>CurrentContendedMonitor</code> JDWP command for the
+             * ThreadReference command set.
+             *
+             * @param jni - the JNI interface pointer
+             */
+            virtual void Execute(JNIEnv *jni) throw(AgentException);
+
+        };//CurrentContendedMonitorHandler
+
+        /**
+         * The class implements the <code>Stop</code> command from the
+         * ThreadReference command set.
+         */
+        class StopHandler : public SyncCommandHandler {
+        protected:
+
+            /**
+             * Executes the <code>Stop</code> JDWP command for the
+             * ThreadReference command set.
+             *
+             * @param jni - the JNI interface pointer
+             */
+            virtual void Execute(JNIEnv *jni) throw(AgentException);
+
+        };//StopHandler
+
+        /**
+         * The class implements the <code>Interrupt</code> command from the
+         * ThreadReference command set.
+         */
+        class InterruptHandler : public SyncCommandHandler {
+        protected:
+
+            /**
+             * Executes the <code>Interrupt</code> JDWP command for the
+             * ThreadReference command set.
+             *
+             * @param jni - the JNI interface pointer
+             */
+            virtual void Execute(JNIEnv *jni) throw(AgentException);
+
+        };//InterruptHandler
+
+        /**
+         * The class implements the <code>SuspendCount</code> command from the
+         * ThreadReference command set.
+         */
+        class SuspendCountHandler : public SyncCommandHandler {
+        protected:
+
+            /**
+             * Executes the <code>SuspendCount</code> JDWP command for the
+             * ThreadReference command set.
+             *
+             * @param jni - the JNI interface pointer
+             */
+            virtual void Execute(JNIEnv *jni) throw(AgentException);
+
+        };//SuspendCountHandler
+
+    }//ThreadReference
+
+}//jdwp
+
+#endif //_THREAD_REFERENCE_H_

Propchange: harmony/enhanced/jdktools/trunk/modules/jpda/src/common/other/jpda/jdwp/agent/commands/ThreadReference.h
------------------------------------------------------------------------------
    svn:eol-style = native



Mime
View raw message