Examples of SuspendThreadStack


Examples of com.google.code.vimsztool.debug.SuspendThreadStack

   
  }
 
  public static String setFieldValue(String name, String exp) {
    ThreadReference threadRef = checkAndGetCurrentThread();
    SuspendThreadStack threadStack = SuspendThreadStack.getInstance();
    Debugger debugger = Debugger.getInstance();
    VirtualMachine vm = debugger.getVm();
   
    try {
     
      ParseResult result = AstTreeFactory.getExpressionAst(exp);
      if (result.hasError()) {
        return result.getErrorMsg();
      }
      Object obj = evalTreeNode(result.getTree());
      Value value = null;
      if (obj instanceof Integer) {
        value = vm.mirrorOf(((Integer)obj).intValue());
      } else if (obj instanceof Boolean) {
        value = vm.mirrorOf(((Boolean)obj).booleanValue());
      } else if (obj instanceof String) {
        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

Examples of com.google.code.vimsztool.debug.SuspendThreadStack

    }
  }
 
  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.google.code.vimsztool.debug.SuspendThreadStack

  }

 
  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());
View Full Code Here

Examples of com.google.code.vimsztool.debug.SuspendThreadStack

  }
 
  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

Examples of com.google.code.vimsztool.debug.SuspendThreadStack

    Debugger debugger = Debugger.getInstance();
    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.google.code.vimsztool.debug.SuspendThreadStack

  public static Value findValueInFrame(ThreadReference threadRef, String name,
      ObjectReference thisObj)  {
   
    Value value = null;
    try {
      SuspendThreadStack threadStack = SuspendThreadStack.getInstance();
      StackFrame stackFrame = threadRef.frame(threadStack.getCurFrame());
     
      LocalVariable localVariable;
      localVariable = stackFrame.visibleVariableByName(name);
      if (localVariable != null) {
        return stackFrame.getValue(localVariable);
View Full Code Here

Examples of com.google.code.vimsztool.debug.SuspendThreadStack

    }
    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.google.code.vimsztool.debug.SuspendThreadStack

    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
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.