Package com.sun.jdi

Examples of com.sun.jdi.ReferenceType


    if (classes == null || classes.size() == 0)
      return;

    for (int i = 0; i < classes.size(); i++) {
      ReferenceType refType = (ReferenceType) classes.get(i);
      HashMap map = new HashMap();
      map.put(refType, classBytes);
      vm.redefineClasses(map);
    }
  }
View Full Code Here


        if (localVariable != null) {
          return stackFrame.getValue(localVariable);
        }
      }
     
      ReferenceType refType = stackFrame.location().declaringType();
      if (thisObj != null ) {
        refType = thisObj.referenceType();
      }
      Field field = refType.fieldByName(name);
      if (field == null ) {
        throw new ExpressionEvalException("eval expression error, field '" + name +"' can't be found.");
      }
      if (thisObj != null) {
        value = thisObj.getValue(field);
      } else {
        value = refType.getValue(field);
      }
    } catch (IncompatibleThreadStateException e) {
      throw new ExpressionEvalException("eval expression error, caused by:" + e.getMessage());
    } catch (AbsentInformationException e) {
      throw new ExpressionEvalException("eval expression error, caused by:" + e.getMessage());
View Full Code Here

            }

            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,
View Full Code Here

        Iterator handleriter = getVM().classesByName( "org.drools.base.mvel.MVELDebugHandler" ).iterator();
        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

        } catch ( CoreException e1 ) {
            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

        } catch ( CoreException e1 ) {
            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

                //int resumeVMtimes = 0;
                for(EventIterator i = eventSet.eventIterator(); i.hasNext(); ) {
                    Event evt = i.nextEvent();
                    if(evt instanceof ClassPrepareEvent) {
                        ClassPrepareEvent cpe = (ClassPrepareEvent) evt;
                        ReferenceType refType = cpe.referenceType();
                        logClazz.debug("Loading: " + refType.name() + " [cl:" + refType.classLoader()+"]");
                        loadClassDebug(refType, cpe.thread());
                    } else if(evt instanceof ClassUnloadEvent) {
                      ClassUnloadEvent cue = (ClassUnloadEvent) evt;
                      logClazz.debug("Unloading: " + cue.className());
                    } else if(evt instanceof ThreadStartEvent) {
View Full Code Here

    }
  }
 
  void exceptionEventDebug(ExceptionEvent exc) {
    try {
      ReferenceType rt = exc.exception().referenceType();
      Field field = rt.fieldByName("detailMessage");
      //detailMessage
      Value v = exc.exception().getValue(field);
      if(exc.catchLocation()!=null) {
        logException.debug("CaughtEx: [" + exc.location() + " | catchLoc: " + exc.catchLocation() + "] "+exc.exception().referenceType().name()+": "+v.toString());
      }
View Full Code Here

    }
  }
 
  //XXX: cache of Method by RT+methodNameString 
  Value simpleInvokeVMMethod(ThreadReference thr, ObjectReference or, String method) throws InvalidTypeException, ClassNotLoadedException, IncompatibleThreadStateException, InvocationException, NoSuchMethodException {
    ReferenceType ort = or.referenceType();
      List<Method> methods = ort.methodsByName(method);
      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

  @Override
  public SourcePosition getSourcePosition(@Nullable Location location) throws NoDataException {
    if (true) throw new NoDataException();
    if (location == null) throw new NoDataException();

    final ReferenceType refType = location.declaringType();
    if (refType == null) throw new NoDataException();

    int dollar = refType.name().indexOf("$");
    String qname = dollar == -1? refType.name() : refType.name().substring(0, dollar);

    final String name = location.method().name();
    int lineNumber = location.lineNumber() - 1;

    for (PsiFile file : myGrammars.get(qname)) {
View Full Code Here

TOP

Related Classes of com.sun.jdi.ReferenceType

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.