Package com.sun.jdi

Examples of com.sun.jdi.Method


            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


            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

                return cache;
            }

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

            Method method = getUnderlyingMethod(); // onBreak
            ReferenceType declaringType = method.declaringType(); // org.drools.core.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.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 );
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

   * @param parameters
   *            Parameters to use
   * @return The return value
   */
  private Value invokeMethod(ObjectReference object, ClassType _class, String name, String signature, Value[] parameters) throws Exception {
    final Method method = _class.concreteMethodByName(name, signature);
    if (method == null) {
      throw new IllegalArgumentException("Method not found: " + name + " " + signature);
    }
    return object.invokeMethod(thread, method, Arrays.asList(parameters), 0);
  }
View Full Code Here

     * Recursion is used to find the method: The methods of its own (own
     * methods() command); The methods of it's superclass.
     */

    Iterator<Method> methods = methods().iterator();
    Method method;
    while (methods.hasNext()) {
      method = methods.next();
      if (method.name().equals(name) && method.signature().equals(signature)) {
        if (method.isAbstract()) {
          return null;
        }
        return method;
      }
    }
View Full Code Here

              && getMethodSignature() != null) {
            // use a line breakpoint if possible for better performance
            ClassType clazz = (ClassType) classFilter;
            if (clazz.name().equals(getTypeName())) {
              // only use line breakpoint when there is an exact match
              Method method = clazz.concreteMethodByName(
                  getMethodName(), getMethodSignature());
              if (method != null && !method.isNative()) {
                Location location = method.location();
                if (location != null && location.codeIndex() != -1) {
                  request = manager
                      .createBreakpointRequest(location);
                }
              }
View Full Code Here

      }
    }

    List<Method> methods = referenceType.methods();
    for (Iterator<Method> iterator = methods.iterator(); iterator.hasNext();) {
      Method method = iterator.next();
      if (!method.isConstructor() && !method.isStaticInitializer()
          && !method.isBridge()) {
        source.append(buildMethodDeclaration(method));
      }
    }

    List<ReferenceType> nestedTypes = referenceType.nestedTypes();
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.