Package com.google.code.vimsztool.exception

Examples of com.google.code.vimsztool.exception.ExpressionEvalException


      return Boolean.TRUE;
    case JavaParser.NULL :
      return null;
     
    default:
      throw new ExpressionEvalException("parse expression error.");
    }
  }
View Full Code Here


      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

      return  array.getValue(idx);
    } else if (arrayIdxValue instanceof Integer) {
      int idx = ((Integer)arrayIdxValue).intValue();
      return  array.getValue(idx);
    else {
      throw new ExpressionEvalException("eval expression error, array index is not int type.");
    }
  }
View Full Code Here

    }
  }
  private static ThreadReference checkAndGetCurrentThread() {
    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

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

    } else {
       obj = (ObjectReference)invoker;
       methods = obj.referenceType().methodsByName(methodName);
    }
    if (methods == null || methods.size() == 0) {
      throw new ExpressionEvalException("eval expression error, method '" + methodName + "' can't be found");
    }
    if (methods.size() == 1) {
      matchedMethod = methods.get(0);
    } else {
      matchedMethod = findMatchedMethod(methods, args);
    }
    try {
        if (invoker instanceof ClassType) {
         ClassType clazz = (ClassType)refType;
         value = clazz.invokeMethod(threadRef, matchedMethod, args,
          ObjectReference.INVOKE_SINGLE_THREADED);
        } else {
          value = obj.invokeMethod(threadRef, matchedMethod, args,
            ObjectReference.INVOKE_SINGLE_THREADED);
        }
    } catch (InvalidTypeException e) {
      e.printStackTrace();
      throw new ExpressionEvalException("eval expression error, caused by :" + e.getMessage());
    } catch (ClassNotLoadedException e) {
      e.printStackTrace();
      throw new ExpressionEvalException("eval expression error, caused by :" + e.getMessage());
    } catch (IncompatibleThreadStateException e) {
      e.printStackTrace();
      throw new ExpressionEvalException("eval expression error, caused by :" + e.getMessage());
    } catch (InvocationException e) {
      e.printStackTrace();
      throw new ExpressionEvalException("eval expression error, caused by :" + e.getMessage());
    }
    return value;
  }
View Full Code Here

 
 
  private static ThreadReference checkAndGetCurrentThread() {
    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

      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

        Value arrayIdxValue = eval(threadRef, exp.getArrayIdxExp(), thisObj,false);
        if (arrayIdxValue instanceof IntegerValue ) {
          int idx = ((IntegerValue)arrayIdxValue).value();
          basicExpValue = array.getValue(idx);
        else {
          throw new ExpressionEvalException("eval expression error, array index is not int type.");
        }
      }
    }

    List<Expression> members = exp.getMembers();
    if (members.size() == 0)
      return basicExpValue;
    if (exp.isStaticMember()) {
      Expression memberExp = members.get(0);
      List<Expression> params = memberExp.getParams();
      List<Value> arguments = new ArrayList<Value>();
      if (params.size() != 0) {
        for (Expression param : params) {
          Value paramValue = eval(threadRef, param, thisObj,false);
          arguments.add(paramValue);
        }
      }
      List<ReferenceType> refTypes = vm.classesByName(exp.getName());
      if (refTypes == null || refTypes.size() == 0) {
        throw new ExpressionEvalException("eval expression error, type '" + exp.getName() + "' can't be found ");
      }
       
      basicExpValue = invoke(refTypes.get(0), memberExp.getName(), arguments);
      if (members.size() > 1) {
        for (int i = 1; i < members.size(); i++) {
View Full Code Here

      if (thisObj != null ) {
        refType = thisObj.referenceType();
      }
      Field field = refType.fieldByName(name);
      if (field == null ) {
        throw new ExpressionEvalException("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());
    }
    return value;
  }
View Full Code Here

TOP

Related Classes of com.google.code.vimsztool.exception.ExpressionEvalException

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.