Package com.sun.jdi

Examples of com.sun.jdi.ThreadReference.frame()


                  event = new net.sf.rej.gui.event.Event(EventType.DEBUG_THREAD_CHANGE_REQUESTED);
                  event.setThread(new ThreadReferenceWrapper(thread));
                  dispatcher.notifyObservers(event);
                  event = new net.sf.rej.gui.event.Event(EventType.DEBUG_STACK_FRAME_CHANGE_REQUESTED);
                  try {
                    event.setStackFrame(new StackFrameWrapper(thread.frame(0)));
                  } catch (IncompatibleThreadStateException e) {
                    e.printStackTrace();
                  }
                  dispatcher.notifyObservers(event);
                }
View Full Code Here


    }
    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);
      changeVimEditSourceLocaton(loc);
      return "success";
View Full Code Here

    ThreadReference threadRef = threadStack.getCurThreadRef();
    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";
View Full Code Here

        value = vm.mirrorOf((String)obj);
      } else {
        value = (Value)obj;
      }
     
      StackFrame stackFrame = threadRef.frame(threadStack.getCurFrame());
      LocalVariable localVariable;
      localVariable = stackFrame.visibleVariableByName(name);
      if (localVariable != null) {
        stackFrame.setValue(localVariable, value);
      } else {
View Full Code Here

  public static String fields() {
    ThreadReference threadRef = checkAndGetCurrentThread();
    SuspendThreadStack threadStack = SuspendThreadStack.getInstance();
    StringBuilder sb = new StringBuilder();
    try {
      StackFrame stackFrame = threadRef.frame(threadStack.getCurFrame());
      ObjectReference thisObj = stackFrame.thisObject();
      Map<Field, Value> values = thisObj.getValues(thisObj.referenceType().visibleFields());
      List<String> fieldNames = new ArrayList<String>();
      for (Field field : values.keySet()) {
        fieldNames.add(field.name());
View Full Code Here

    SuspendThreadStack threadStack = SuspendThreadStack.getInstance();
    int curFrame = threadStack.getCurFrame();
    StringBuilder sb = new StringBuilder();
    try {
      List<String> varNames = new ArrayList<String>();
      for (LocalVariable var : threadRef.frame(curFrame).visibleVariables()) {
        varNames.add(var.name());
      }
      int maxLen = getMaxLength(varNames)+2;
      for (LocalVariable var : threadRef.frame(curFrame).visibleVariables()) {
        Value value = threadRef.frame(curFrame).getValue(var);
View Full Code Here

      List<String> varNames = new ArrayList<String>();
      for (LocalVariable var : threadRef.frame(curFrame).visibleVariables()) {
        varNames.add(var.name());
      }
      int maxLen = getMaxLength(varNames)+2;
      for (LocalVariable var : threadRef.frame(curFrame).visibleVariables()) {
        Value value = threadRef.frame(curFrame).getValue(var);
        sb.append(padStr(maxLen,var.name())).append(":");
        sb.append(getPrettyPrintStr(value));
        sb.append("\n");
      }
View Full Code Here

      for (LocalVariable var : threadRef.frame(curFrame).visibleVariables()) {
        varNames.add(var.name());
      }
      int maxLen = getMaxLength(varNames)+2;
      for (LocalVariable var : threadRef.frame(curFrame).visibleVariables()) {
        Value value = threadRef.frame(curFrame).getValue(var);
        sb.append(padStr(maxLen,var.name())).append(":");
        sb.append(getPrettyPrintStr(value));
        sb.append("\n");
      }
    } catch (AbsentInformationException e) {
View Full Code Here

 
  private static Value evalJdiVar(String name) {
    ThreadReference threadRef = checkAndGetCurrentThread();
    try {
      SuspendThreadStack threadStack = SuspendThreadStack.getInstance();
      StackFrame stackFrame = threadRef.frame(threadStack.getCurFrame());
      ObjectReference thisObj = stackFrame.thisObject();
      Value value = findValueInFrame(threadRef, name, thisObj);
      return value;
    } catch (IncompatibleThreadStateException e) {
      throw new ExpressionEvalException("eval expression error, caused by : " + e.getMessage());
View Full Code Here

   
    try {
      ThreadReference threadRef = checkAndGetCurrentThread();
      Debugger debugger = Debugger.getInstance();
      SuspendThreadStack threadStack = SuspendThreadStack.getInstance();
      StackFrame stackFrame = threadRef.frame(threadStack.getCurFrame());
      CompilerContext ctx = debugger.getCompilerContext();
      VirtualMachine vm = debugger.getVm();
      List<ReferenceType> refTypes = vm.classesByName("java.lang."+className);
      if (refTypes !=null && refTypes.size() >0 ) {
        return refTypes.get(0);
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.