Package com.sun.jdi

Examples of com.sun.jdi.ClassType


    SuspendThreadStack threadStack = SuspendThreadStack.getInstance();
    ThreadReference threadRef = threadStack.getCurThreadRef();
    Value value = null;
    Method matchedMethod = null;
    List<Method> methods = null;
    ClassType refType = null;
    ObjectReference obj  = null;
    if (invoker instanceof ClassType) {
      refType = (ClassType)invoker;
        methods = refType.methodsByName(methodName);
    } else {
       obj = (ObjectReference)invoker;
       methods = obj.referenceType().methodsByName(methodName);
    }
    if (methods == null || methods.size() == 0) {
      throw new ExpressionEvalException("eval expression error, method '" + methodName + "' can't be found");
    }
    if (methods.size() == 1) {
      matchedMethod = methods.get(0);
    } else {
      matchedMethod = findMatchedMethod(methods, args);
    }
    try {
        if (invoker instanceof ClassType) {
         ClassType clazz = (ClassType)refType;
         value = clazz.invokeMethod(threadRef, matchedMethod, args,
          ObjectReference.INVOKE_SINGLE_THREADED);
        } else {
          value = obj.invokeMethod(threadRef, matchedMethod, args,
            ObjectReference.INVOKE_SINGLE_THREADED);
        }
View Full Code Here


    if (fromType instanceof ArrayType) {
      return isArrayAssignableTo((ArrayType) fromType, toType);
    }
    List interfaces = null;;
    if (fromType instanceof ClassType) {
      ClassType superclazz = ((ClassType) fromType).superclass();
      if ((superclazz != null) && isAssignableTo(superclazz, toType)) {
        return true;
      }
      interfaces = ((ClassType) fromType).interfaces();
    } else if (fromType instanceof InterfaceType) {
View Full Code Here

    SuspendThreadStack threadStack = SuspendThreadStack.getInstance();
    ThreadReference threadRef = threadStack.getCurThreadRef();
    Value value = null;
    Method matchedMethod = null;
    List<Method> methods = null;
    ClassType refType = null;
    ObjectReference obj  = null;
    if (invoker instanceof ClassType) {
      refType = (ClassType)invoker;
        methods = refType.methodsByName(methodName);
    } else {
       obj = (ObjectReference)invoker;
       methods = obj.referenceType().methodsByName(methodName);
    }
    if (methods == null || methods.size() == 0) {
      throw new ExpressionEvalException("eval expression error, method '" + methodName + "' can't be found");
    }
    if (methods.size() == 1) {
      matchedMethod = methods.get(0);
    } else {
      matchedMethod = findMatchedMethod(methods, args);
    }
    try {
        if (invoker instanceof ClassType) {
         ClassType clazz = (ClassType)refType;
         value = clazz.invokeMethod(threadRef, matchedMethod, args,
          ObjectReference.INVOKE_SINGLE_THREADED);
        } else {
          value = obj.invokeMethod(threadRef, matchedMethod, args,
            ObjectReference.INVOKE_SINGLE_THREADED);
        }
View Full Code Here

    if (fromType instanceof ArrayType) {
      return isArrayAssignableTo((ArrayType) fromType, toType);
    }
    List interfaces;
    if (fromType instanceof ClassType) {
      ClassType superclazz = ((ClassType) fromType).superclass();
      if ((superclazz != null) && isAssignableTo(superclazz, toType)) {
        return true;
      }
      interfaces = ((ClassType) fromType).interfaces();
    } else {
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.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

        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

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.