Examples of ThreadReference


Examples of com.sun.jdi.ThreadReference

    if (debugger.getVm() == null ) {
      throw new ExpressionEvalException("no virtual machine connected.");
    }
   
    SuspendThreadStack threadStack = SuspendThreadStack.getInstance();
    ThreadReference threadRef = threadStack.getCurThreadRef();
    if (threadRef == null ) {
      throw new ExpressionEvalException("no suspend thread.");
    }
    return threadRef;
  }
View Full Code Here

Examples of com.sun.jdi.ThreadReference

    return value;
  }
 
  public static Value invoke(Object invoker, String methodName, List args) {
    SuspendThreadStack threadStack = SuspendThreadStack.getInstance();
    ThreadReference threadRef = threadStack.getCurThreadRef();
    Value value = null;
    Method matchedMethod = null;
    List<Method> methods = null;
    ClassType refType = null;
    ObjectReference obj  = null;
View Full Code Here

Examples of com.sun.jdi.ThreadReference

 
    private static ReferenceType getClassType(String className) {
   
    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

Examples of com.sun.jdi.ThreadReference

  private void handleExceptionEvent(ExceptionEvent event) {
    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);
   
View Full Code Here

Examples of com.sun.jdi.ThreadReference

  private void handleStepEvent(StepEvent event) {
    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);
   
View Full Code Here

Examples of com.sun.jdi.ThreadReference

    if (debugger.getVm() == null ) {
      throw new ExpressionEvalException("no virtual machine connected.");
    }
   
    SuspendThreadStack threadStack = SuspendThreadStack.getInstance();
    ThreadReference threadRef = threadStack.getCurThreadRef();
    if (threadRef == null ) {
      throw new ExpressionEvalException("no suspend thread.");
    }
    return threadRef;
  }
View Full Code Here

Examples of com.sun.jdi.ThreadReference

    }
    return origStr;
  }
 
  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

Examples of com.sun.jdi.ThreadReference

    return sb.toString();
  }

  public static String variables() {
    ThreadReference threadRef = checkAndGetCurrentThread();
    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);
        sb.append(padStr(maxLen,var.name())).append(":");
        sb.append(getPrettyPrintStr(value));
        sb.append("\n");
      }
    } catch (AbsentInformationException e) {
View Full Code Here

Examples of com.sun.jdi.ThreadReference

    List<Expression> exps = Expression.parseExpXmlStr(expXmlStr);
    return eval(exps);
  }
 
  public static Value getJdiValue(Expression exp) {
    ThreadReference threadRef = checkAndGetCurrentThread();
    try {
      SuspendThreadStack threadStack = SuspendThreadStack.getInstance();
      StackFrame stackFrame = threadRef.frame(threadStack.getCurFrame());
      ObjectReference thisObj = stackFrame.thisObject();
      Value value = eval(threadRef, exp, thisObj,false);
      return value;
    } catch (IncompatibleThreadStateException e) {
      throw new ExpressionEvalException("eval expression error, caused by : " + e.getMessage());
View Full Code Here

Examples of com.sun.jdi.ThreadReference

    }
  }
 
  public static Value invoke(Object invoker, String methodName, List args) {
    SuspendThreadStack threadStack = SuspendThreadStack.getInstance();
    ThreadReference threadRef = threadStack.getCurThreadRef();
    Value value = null;
    Method matchedMethod = null;
    List<Method> methods = null;
    ClassType refType = null;
    ObjectReference obj  = null;
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.