Package com.sun.jdi

Examples of com.sun.jdi.Method


 
  public static Value invoke(Object invoker, String methodName, List args) {
    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;
View Full Code Here


 
  public static Value invoke(Object invoker, String methodName, List args) {
    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;
View Full Code Here

                return cache;
            }

            List<IVariable> result = new ArrayList<IVariable>( 0 );

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

            try {
                Object var = method.variables().get( 0 );
                LocalVariable v2 = (LocalVariable) var;
                JDILocalVariable frameLocal = new JDILocalVariable( this,
                                                                    v2 );

                IValue knownVars = DebugUtil.getValueByExpression( "return getFactory().getKnownVariables().toArray(new String[0]);",
View Full Code Here

                                                  InvalidTypeException,
                                                  IncompatibleThreadStateException,
                                                  InvocationException {

        //frame arg
        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 );
View Full Code Here

        Object debugHandlerClass = handleriter.next();

        int line = step_over;

        ReferenceType refType = (ReferenceType) debugHandlerClass;
        Method m = (Method) refType.methodsByName( "setOnBreakReturn" ).iterator().next();
        List args = new ArrayList();
        IntegerValue lineVal = getVM().mirrorOf( line );
        //ObjectReference realVal = val.getUnderlyingObject();
        args.add( lineVal );
View Full Code Here

            logError( e1 );
            return;
        }

        ReferenceType refType = (ReferenceType) debugHandlerClass;
        Method m = (Method) refType.methodsByName( "registerBreakpoint" ).iterator().next();
        List args = new ArrayList();
        IntegerValue lineVal = getVM().mirrorOf( line );
        StringReference nameVal = getVM().mirrorOf( sourceName );
        JDIObjectValue val = (JDIObjectValue) newValue( sourceName );
        ObjectReference realVal = val.getUnderlyingObject();
View Full Code Here

            logError( e1 );
            return;
        }

        ReferenceType refType = (ReferenceType) debugHandlerClass;
        Method m = (Method) refType.methodsByName( "removeBreakpoint" ).iterator().next();
        List args = new ArrayList();
        IntegerValue lineVal = getVM().mirrorOf( line );
        StringReference nameVal = getVM().mirrorOf( sourceName );
        JDIObjectValue val = (JDIObjectValue) newValue( sourceName );
        ObjectReference realVal = val.getUnderlyingObject();
View Full Code Here

            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 );
            if (method != null && !method.isNative()) {
                Location location = method.location();
                if (location != null && location.codeIndex() != -1) {
                    req = getEventRequestManager().createBreakpointRequest(location);
                    req.addThreadFilter( ((ClassPrepareEvent) event).thread() );
                    req.setSuspendPolicy( EventRequest.SUSPEND_ALL  );
                } else {
View Full Code Here

      if(methods.size()<=0) {
        throw new NoSuchMethodException("No '"+method+"' method on remote class '"+ort.name()+"'");
        //logClazz.warn("No '"+method+"' method on remote class '"+ort.name()+"'");
        //return null;
      }
      Method remoteMethod = methods.get(0);
    return or.invokeMethod(thr, remoteMethod, new ArrayList<Value>(), 0);
    }
View Full Code Here

                    } else {
                        argTypeNames = new String[0];
                    }
                    // Get all methods of the class
                    List<Method> methodList = classType.methodsByName(params[0]);
                    Method matchedMethod = null;
                    /*
                     * As the jdb command argument doesn't supply the result
                     * value type, it's impossible to generate a jni signature
                     * for the specified method. I just have to search...
                     */
                    for (Method m : methodList) {
                        List<String> types = m.argumentTypeNames();
                        if (types.size() != argTypeNames.length) {
                            continue;
                        } else {
                            boolean matched = true;
                            for (int i = 0; i < argTypeNames.length; i++) {
                                if (!types.get(i).equals(argTypeNames[i])) {
                                    matched = false;
                                    break;
                                }
                            }
                            if (matched) {
                                matchedMethod = m;
                                break;
                            }
                        }
                    }
                    if (null != matchedMethod) {
                        Location loc = matchedMethod.location();
                        if (null != loc) {
                            BreakpointRequest breakpointRequest =
                                jdb.eventRequestManager.
                                createBreakpointRequest(loc);
                            breakpointRequest.setSuspendPolicy(
View Full Code Here

TOP

Related Classes of com.sun.jdi.Method

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.