Package com.sun.jdi

Examples of com.sun.jdi.ClassType


         * @param target the target in which the thread died
         * @return <code>true</code> - the thread should be resumed
         */
        public boolean handleEvent(Event event,
                                   JDIDebugTarget target) {
            ClassType classType = ( ClassType ) ((ClassPrepareEvent) event).referenceType();
            String name = classType.name();

            // change this to create a breakpoint, as the method enter was too slow
            BreakpointRequest req = null;
            List list = classType.methodsByName( "onBreak" );
            if list.size() == 0 ) {
                throw new IllegalStateException( "MVELDebugHandler.onBreak cannot be found by JDI" );
            }
           
            Method method = ( Method ) list.get( 0 );
View Full Code Here


         * @param target the target in which the thread died
         * @return <code>true</code> - the thread should be resumed
         */
        public boolean handleEvent(Event event,
                                   JDIDebugTarget target) {
            ClassType classType = ( ClassType ) ((ClassPrepareEvent) event).referenceType();
            String name = classType.name();

            // change this to create a breakpoint, as the method enter was too slow
            BreakpointRequest req = null;
            List list = classType.methodsByName( "onBreak" );
            if list.size() == 0 ) {
                throw new IllegalStateException( "MVELDebugHandler.onBreak cannot be found by JDI" );
            }
           
            Method method = ( Method ) list.get( 0 );
View Full Code Here

        ObjectReference realVal = val.getUnderlyingObject();
        args.add( nameVal );
        args.add( lineVal );

        try {
            ClassType tt = (ClassType) debugHandlerClass;
            IThread[] tharr = getThreads();
            ThreadReference t = null;
            DroolsThread t2 = null;

            for ( int i = 0; i < tharr.length; i++ ) {
                IThread th2 = tharr[i];
                ThreadReference th2real = ((DroolsThread) tharr[i]).getUnderlyingThread();

                if ( th2real.suspendCount() == 1 && th2.getName().equals( "main" ) ) {
                    t = th2real;
                    t2 = (DroolsThread) th2;
                }
            }

            tt.invokeMethod( t,
                             m,
                             args,
                             ObjectReference.INVOKE_SINGLE_THREADED );
            //t2.computeNewStackFrames();
View Full Code Here

        ObjectReference realVal = val.getUnderlyingObject();
        args.add( nameVal );
        args.add( lineVal );

        try {
            ClassType tt = (ClassType) debugHandlerClass;
            IThread[] tharr = getThreads();
            ThreadReference t = null;
            DroolsThread t2 = null;

            for ( int i = 0; i < tharr.length; i++ ) {
                IThread th2 = tharr[i];
                ThreadReference th2real = ((DroolsThread) tharr[i]).getUnderlyingThread();

                if ( th2real.suspendCount() == 1 && th2.getName().equals( "main" ) ) {
                    t = th2real;
                    t2 = (DroolsThread) th2;
                }
            }

            tt.invokeMethod( t,
                             m,
                             args,
                             ObjectReference.INVOKE_SINGLE_THREADED );

        } catch ( Exception e ) {
View Full Code Here

            Object o = getRemoteVar( "label" );
            if ( o == null ) {
                return -1;
            }
            ObjectReference obj = (ObjectReference) o;
            ClassType frameType = (ClassType) obj.type();
            Field field = frameType.fieldByName( "lineNumber" );
            o = obj.getValue( field );
            if ( o == null ) {
                return -1;
            }
            IntegerValue val = (IntegerValue) o;
View Full Code Here

                Object rem = getRemoteVar( "label" );
                if ( rem == null ) {
                    return null;
                }
                ObjectReference obj = (ObjectReference) rem;
                ClassType frameType = (ClassType) obj.type();
                Field field = frameType.fieldByName( "sourceFile" );
                rem = obj.getValue( field );
                if ( rem == null ) {
                    return null;
                }
                StringReference res = (StringReference) rem;
View Full Code Here

        Method method = getUnderlyingMethod(); // onBreak
        //ReferenceType declaringType = method.declaringType(); // org.drools.core.base.mvel.MVELDebugHandler

        LocalVariable var = (LocalVariable) method.variables().get( 0 );//frame

        ClassType frameType = (ClassType) var.type();

        StackFrame frame = getUnderlyingStackFrame();
        Value value = frame.getValue( var );
        //getThread().getTopStackFrame().get

        //IValue value = jdivar.getValue();
        ObjectReferenceImpl o = (ObjectReferenceImpl) value;

        //if ( value instanceof JDINullValue ) {
        // return null;
        // }

        //ObjectReference o = (ObjectReference) ((JDIObjectValue) value).getUnderlyingObject();
        if ( o == null ) {
            return null;
        }

        Field field = frameType.fieldByName( methodName );
        Value val = o.getValue( field );
        return val;
    }
View Full Code Here

        IntegerValue lineVal = getVM().mirrorOf( line );
        //ObjectReference realVal = val.getUnderlyingObject();
        args.add( lineVal );

        try {
            ClassType tt = (ClassType) debugHandlerClass;
            tt.invokeMethod( getUnderlyingThread(),
                             m,
                             args,
                             ObjectReference.INVOKE_SINGLE_THREADED );

        } catch ( Exception e ) {
View Full Code Here

    this._Class = (ClassType) virtualMachine.classesByName("java.lang.Class").get(0);

    // load more types via reflection
    this._Array = loadClass("java.lang.reflect.Array");
    this._URLClassLoader = loadClass("java.net.URLClassLoader");
    final ClassType _Byte = loadClass("java.lang.Byte");
    this._byte = (ClassType) ((ClassObjectReference) _Byte.getValue(_Byte.fieldByName("TYPE"))).reflectedType();

    // get an empty URL[] and use it to create an URLClassLoader
    final ArrayReference urls = buildArray(loadClass("java.net.URL"), 0);
    myClassLoader = newInstance(_URLClassLoader, "([Ljava/net/URL;)V", new Value[] { urls });
  }
View Full Code Here

    }
    array.setValues(Arrays.asList(byteValues));

    // load the class with the class loader
    final ObjectReference loadedClazz = (ObjectReference) invokeMethod(myClassLoader, _URLClassLoader, "defineClass", "([BII)Ljava/lang/Class;", new Value[] { array, virtualMachine.mirrorOf(0), virtualMachine.mirrorOf(clazz.length) });
    final ClassType _clazz = (ClassType) ((ClassObjectReference) loadedClazz).reflectedType();

    if (argsForInstantiate != null) {
      // prepare the class
      invokeMethod(myClassLoader, _URLClassLoader, "resolveClass", "(Ljava/lang/Class;)V", new Value[] { loadedClazz });
      invokeMethod(loadedClazz, _Class, "getMethods", "()[Ljava/lang/reflect/Method;", new Value[0]);
View Full Code Here

TOP

Related Classes of com.sun.jdi.ClassType

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.