Package com.sun.jdi

Examples of com.sun.jdi.ReferenceType


                           
              //deshabilitar evento
              /*event.request().disable();
                  vm.eventRequestManager().deleteEventRequest(event.request());
                  */
                  ReferenceType rt = cpe.referenceType();
                 
                  //inspeccion method entry y method exit
                  //primero se ejecuta el breakpoint
                  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.putProperty("START", true);
                        br.setEnabled(true);
                        }
                      /*
                      for(int i=1; i<method.allLineLocations().size(); i++)
                        {
                        br = vm.eventRequestManager().createBreakpointRequest(method.allLineLocations().get(i));
                        br.setSuspendPolicy(EventRequest.SUSPEND_EVENT_THREAD);
                        br.putProperty("START", false);
                        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


        break;
      }
    }
    if (correctRef == null) return "no suspend thread";
    SuspendThreadStack threadStack = SuspendThreadStack.getInstance();
    ReferenceType refType;
    try {
      Location loc = correctRef.frame(0).location();
      refType = loc.declaringType();
      threadStack.setCurRefType(refType);
      threadStack.setCurThreadRef(correctRef);
View Full Code Here

    if (threadRef == null ) {
      return "no suspended thread";
    }
    try {
      Location loc = threadRef.frame(frameNum).location();
      ReferenceType refType= loc.declaringType();
      threadStack.setCurRefType(refType);
      threadStack.setCurFrame(frameNum);
      changeVimEditSourceLocaton(loc);
      return "success";
    } catch (IncompatibleThreadStateException e) {
View Full Code Here

      return "error" + e.getMessage();
    }
  }
 
  private void changeVimEditSourceLocaton(Location loc) {
    ReferenceType refType = loc.declaringType();
    String className = refType.name();
    int lineNum = loc.lineNumber();
    String abPath = "None";
    try {
      abPath = compilerContext.findSourceFile(loc.sourcePath());
    } catch (Throwable e) {
View Full Code Here

    List<ReferenceType> refTypes = vm.classesByName(className);
    if (refTypes == null)
      return;

    for (int i = 0; i < refTypes.size(); i++) {
      ReferenceType rt = refTypes.get(i);
      if (!rt.isPrepared()) {
        continue;
      }
      List<Location> lines;

      try {
        lines = rt.locationsOfLine(lineNum);
        if (lines.size() == 0) {
          continue;
        }
        Location loc = lines.get(0);
        BreakpointRequest request = vm.eventRequestManager().createBreakpointRequest(loc);
View Full Code Here

      } else {
        ObjectReference thisObj = stackFrame.thisObject();
        if (thisObj == null) {
          return "can't find field or variable with name '"+name+"'";
        }
        ReferenceType refType = thisObj.referenceType();
        Field field = refType.fieldByName(name);
        thisObj.setValue(field, value);
      }
    } catch (Throwable e) {
      return e.getMessage();
    }
View Full Code Here

    try {
      thisObj = (ObjectReference)evalTreeNode(objNode);
      Value value = findValueInFrame(threadRef, memberName, thisObj);
      return value;
    } catch (VariableOrFieldNotFoundException e) {
      ReferenceType refType = getClassType(objNode.getText());
      Field field = refType.fieldByName(memberName);
      Value value = refType.getValue(field);
      return value;
    }
   
  }
View Full Code Here

      localVariable = stackFrame.visibleVariableByName(name);
      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 VariableOrFieldNotFoundException("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

    handleSuspendLocatableEvent(event);
  }
 
  private void handleBreakpointEvent(BreakpointEvent event) {
    ThreadReference threadRef = event.thread();
    ReferenceType refType = event.location().declaringType();
    SuspendThreadStack threadStack = SuspendThreadStack.getInstance();
    threadStack.setCurRefType(refType);
    threadStack.setCurThreadRef(threadRef);
   
    BreakpointManager bpm = BreakpointManager.getInstance();
View Full Code Here

    handleSuspendLocatableEvent(event);
  }
 
  private void handleSuspendLocatableEvent(LocatableEvent event) {
    ThreadReference threadRef = event.thread();
    ReferenceType refType = event.location().declaringType();
    SuspendThreadStack threadStack = SuspendThreadStack.getInstance();
    threadStack.setCurRefType(refType);
    threadStack.setCurThreadRef(threadRef);
   
    Location loc = event.location();
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.