Пример #1
0
 internal JvmFieldRemoteHandle(JvmClassRemoteHandle @class, jfieldID field)
 {
     Class = @class;
     Handle = field.Handle.ToInt64();
 }
Пример #2
0
 public jvmtiError GetMethodDeclaringClass(JvmVirtualMachineRemoteHandle virtualMachine, JvmMethodRemoteHandle method, out JvmClassRemoteHandle declaringClass)
 {
     throw new NotImplementedException();
 }
Пример #3
0
 internal JvmFieldRemoteHandle(JvmClassRemoteHandle @class, jfieldID field)
 {
     Class  = @class;
     Handle = field.Handle.ToInt64();
 }
Пример #4
0
 public jvmtiError GetClassLoader(JvmVirtualMachineRemoteHandle virtualMachine, JvmClassRemoteHandle @class, out JvmObjectRemoteHandle classLoader)
 {
     throw new NotImplementedException();
 }
Пример #5
0
 public jvmtiError GetSourceDebugExtension(JvmVirtualMachineRemoteHandle virtualMachine, JvmClassRemoteHandle @class, out string sourceDebugExtension)
 {
     throw new NotImplementedException();
 }
Пример #6
0
 public jvmtiError IsInterface(JvmVirtualMachineRemoteHandle virtualMachine, JvmClassRemoteHandle @class, out bool isInterface)
 {
     throw new NotImplementedException();
 }
Пример #7
0
 public jvmtiError IsModifiableClass(JvmVirtualMachineRemoteHandle virtualMachine, JvmClassRemoteHandle @class, out bool isModifiableClass)
 {
     throw new NotImplementedException();
 }
Пример #8
0
 public jvmtiError GetClassVersionNumbers(JvmVirtualMachineRemoteHandle virtualMachine, JvmClassRemoteHandle @class, out int minorVersion, out int majorVersion)
 {
     throw new NotImplementedException();
 }
Пример #9
0
 public jvmtiError GetConstantPool(JvmVirtualMachineRemoteHandle virtualMachine, JvmClassRemoteHandle @class, out byte[] constantPool)
 {
     throw new NotImplementedException();
 }
Пример #10
0
 public jvmtiError GetClassFields(JvmVirtualMachineRemoteHandle virtualMachine, JvmClassRemoteHandle @class, out JvmFieldRemoteHandle[] fields)
 {
     throw new NotImplementedException();
 }
Пример #11
0
 public jvmtiError GetImplementedInterfaces(JvmVirtualMachineRemoteHandle virtualMachine, JvmClassRemoteHandle @class, out JvmClassRemoteHandle[] interfaces)
 {
     throw new NotImplementedException();
 }
Пример #12
0
        public jvmtiError GetClassMethods(JvmVirtualMachineRemoteHandle virtualMachine, JvmClassRemoteHandle @class, out JvmMethodRemoteHandle[] methods)
        {
            JavaVM machine = JavaVM.GetInstance(virtualMachine);

            List <JvmMethodRemoteHandle> methodsList = new List <JvmMethodRemoteHandle>();
            jvmtiError result = jvmtiError.Internal;

            machine.InvokeOnJvmThread(
                (environment) =>
            {
                jvmtiInterface rawInterface = environment.RawInterface;

                IntPtr methodsPtr = IntPtr.Zero;
                try
                {
                    int methodCount;
                    result = rawInterface.GetClassMethods(environment.Handle, @class, out methodCount, out methodsPtr);

                    unsafe
                    {
                        jmethodID *rawMethods = (jmethodID *)methodsPtr;
                        for (int i = 0; i < methodCount; i++)
                        {
                            methodsList.Add(new JvmMethodRemoteHandle(rawMethods[i]));
                        }
                    }
                }
                finally
                {
                    rawInterface.Deallocate(environment.Handle, methodsPtr);
                }
            });

            methods = methodsList.ToArray();
            return(result);
        }
Пример #13
0
 public jvmtiError GetClassModifiers(JvmVirtualMachineRemoteHandle virtualMachine, JvmClassRemoteHandle @class, out JvmAccessModifiers modifiers)
 {
     throw new NotImplementedException();
 }
Пример #14
0
        public jvmtiError GetSourceFileName(JvmVirtualMachineRemoteHandle virtualMachine, JvmClassRemoteHandle @class, out string sourceName)
        {
            JavaVM machine = JavaVM.GetInstance(virtualMachine);

            string     sourceNameResult = null;
            jvmtiError result           = jvmtiError.Internal;

            machine.InvokeOnJvmThread(
                (environment) =>
            {
                jvmtiInterface rawInterface = environment.RawInterface;

                IntPtr sourceNamePtr = IntPtr.Zero;
                try
                {
                    result = rawInterface.GetSourceFileName(environment.Handle, @class, out sourceNamePtr);

                    unsafe
                    {
                        if (sourceNamePtr != IntPtr.Zero)
                        {
                            sourceNameResult = ModifiedUTF8Encoding.GetString((byte *)sourceNamePtr);
                        }
                    }
                }
                finally
                {
                    rawInterface.Deallocate(environment.Handle, sourceNamePtr);
                }
            });

            sourceName = sourceNameResult;
            return(result);
        }
Пример #15
0
 public jvmtiError GetClassStatus(JvmVirtualMachineRemoteHandle virtualMachine, JvmClassRemoteHandle @class, out jvmtiClassStatus status)
 {
     throw new NotImplementedException();
 }
Пример #16
0
        public jvmtiError GetClassSignature(JvmVirtualMachineRemoteHandle virtualMachine, JvmClassRemoteHandle @class, out string signature, out string generic)
        {
            JavaVM machine = JavaVM.GetInstance(virtualMachine);

            string     signatureResult = null;
            string     genericResult   = null;
            jvmtiError result          = jvmtiError.Internal;

            machine.InvokeOnJvmThread(
                (environment) =>
            {
                jvmtiInterface rawInterface = environment.RawInterface;

                IntPtr signaturePtr = IntPtr.Zero;
                IntPtr genericPtr   = IntPtr.Zero;
                try
                {
                    result = rawInterface.GetClassSignature(environment.Handle, @class, out signaturePtr, out genericPtr);

                    unsafe
                    {
                        if (signaturePtr != IntPtr.Zero)
                        {
                            signatureResult = ModifiedUTF8Encoding.GetString((byte *)signaturePtr);
                        }
                        if (genericPtr != IntPtr.Zero)
                        {
                            genericResult = ModifiedUTF8Encoding.GetString((byte *)genericPtr);
                        }
                    }
                }
                finally
                {
                    rawInterface.Deallocate(environment.Handle, signaturePtr);
                    rawInterface.Deallocate(environment.Handle, genericPtr);
                }
            });

            signature = signatureResult;
            generic   = genericResult;
            return(result);
        }