Package com.sun.jdi

Examples of com.sun.jdi.ReferenceType


            }

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


        Iterator<ReferenceType> handleriter = getVM().classesByName( "org.drools.core.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<IntegerValue> args = new ArrayList<IntegerValue>();
        IntegerValue lineVal = getVM().mirrorOf( line );
        //ObjectReference realVal = val.getUnderlyingObject();
        args.add( lineVal );
View Full Code Here

            logError( e2 );
            return; // No need to install breakpoints that are this much broken
        }

        Iterator<ReferenceType> handleriter = getVM().classesByName( "org.drools.core.base.mvel.MVELDebugHandler" ).iterator();
        ReferenceType debugHandlerClass = handleriter.next();

        int line;
        String sourceName;

        try {
            line = d.getLineNumber();
            sourceName = d.getTypeName();
        } catch ( CoreException e1 ) {
            logError( e1 );
            return;
        }

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

    }

    private void removeRemoteBreakpoint(DroolsLineBreakpoint d,
                                        IMarkerDelta delta) {
        Iterator<ReferenceType> handleriter = getVM().classesByName( "org.drools.core.base.mvel.MVELDebugHandler" ).iterator();
        ReferenceType debugHandlerClass = handleriter.next();

        int line;
        String sourceName;

        try {
            line = d.getLineNumber();
            sourceName = d.getTypeName();
        } catch ( CoreException e1 ) {
            logError( e1 );
            return;
        }

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

  }

  private void installHaltPoint(VirtualMachine vm) {
    List<ReferenceType> targetClasses = vm
        .classesByName(VMLocalTarget.class.getName());
    ReferenceType classRef = targetClasses.get(0);
    Method meth = classRef.methodsByName("haltPoint").get(0);
    BreakpointRequest req = vm.eventRequestManager()
        .createBreakpointRequest(meth.location());
    req.setSuspendPolicy(BreakpointRequest.SUSPEND_EVENT_THREAD);
    req.enable();
  }
View Full Code Here

  }

  protected Method getMethod(Class<?> class1, String methodName) {
    List<ReferenceType> targetClasses = vm()
        .classesByName(class1.getName());
    ReferenceType classRef = targetClasses.get(0);
    return classRef.methodsByName(methodName).get(0);
  }
View Full Code Here

      }
    }).start();
  }

  private void trapExceptions() {
    ReferenceType referenceType = vm.classesByName("java.lang.Throwable").get(0);
    vm.eventRequestManager().createExceptionRequest(referenceType, true, true).enable();
  }
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

        // if the class isn't loaded on the VM, can't do the replace.
        if (classes == null || classes.size() == 0)
            return;

        // for now, just grab the first ref.
        ReferenceType refType = classes.get(0);
        HashMap<ReferenceType, byte[]> map = new HashMap<ReferenceType, byte[]>();
        map.put(refType, classBytes);
        vm.redefineClasses(map);
//      System.err.println("class replaced!");
    }
View Full Code Here

            }
           
            else if(event instanceof ClassPrepareEvent)
              {
              ClassPrepareEvent cpe=(ClassPrepareEvent) event;
                  ReferenceType rt = cpe.referenceType();
                 
                  //inspeccionar metodos
                  if(traceFilter.isTraceMethods())
                    {
                    for(Method method : rt.methods())
                       {
                      if(method.location()!=null)
                        {
                        BreakpointRequest br = vm.eventRequestManager().createBreakpointRequest(method.location());
                        br.setSuspendPolicy(EventRequest.SUSPEND_EVENT_THREAD);
                        br.setEnabled(true);
                        }
                       }
                    }
               
                  //inspeccion de acceso y modificacionde atributos
                  if(traceFilter.isTraceFields())
                    {
                    for(Field field : rt.fields())
                      {
                      AccessWatchpointRequest awr = vm.eventRequestManager().createAccessWatchpointRequest(field);
                      awr.setSuspendPolicy(EventRequest.SUSPEND_EVENT_THREAD);
                      awr.setEnabled(true);
                     
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.