Package org.eclipse.jdt.debug.core

Examples of org.eclipse.jdt.debug.core.IJavaValue


        if (objects instanceof IJavaArray) {
            IJavaArray array = (IJavaArray) objects;
            List result = new ArrayList();
            IJavaValue[] javaVals = array.getValues();
            for ( int i = 0; i < javaVals.length; i++ ) {
                IJavaValue mapEntry = javaVals[i];
                String key = null;
                IJavaValue value = null;
               
                IVariable[] vars = mapEntry.getVariables();
                for ( int j = 0; j < vars.length; j++ ) {
                    IVariable var = vars[j];
                    if ("key".equals(var.getName())) {
View Full Code Here


        }
        if (agendaGroupObjects instanceof IJavaArray) {
            IJavaArray agendaGroupArray = (IJavaArray) agendaGroupObjects;
            IJavaValue[] agendaGroupValueArray = agendaGroupArray.getValues();
            for (int i = 0; i < agendaGroupValueArray.length; i++) {
                IJavaValue agendaGroup = agendaGroupValueArray[i];
                String name = "";
                List<VariableWrapper> activationsResult = new ArrayList<VariableWrapper>();
                IVariable[] agendaGroupVarArray = agendaGroup.getVariables();
                for (int j = 0; j < agendaGroupVarArray.length; j++) {
                    IVariable agendaGroupVar = agendaGroupVarArray[j];
                    if ("name".equals(agendaGroupVar.getName())) {
                        name = agendaGroupVar.getValue().getValueString();
                        break;
                    }
                }
                IJavaArray activations = (IJavaArray) DebugUtil.getValueByExpression("return getActivations();", agendaGroup);
                IJavaValue[] activationArray = activations.getValues();
                for (int l = 0; l < activationArray.length; l++) {
                    IJavaValue activation = activationArray[l];
                    if (activation.getJavaType() != null) {
                        activationsResult.add(new VariableWrapper("[" + l + "]",
                            new LazyActivationWrapper(activations, activation, workingMemoryImpl)));
                    }
                }
View Full Code Here

        }
       
        private void addVariablesFromArray(List<VariableWrapper> variables, IJavaArray array) throws Exception {
            IJavaValue[] javaVals = array.getValues();
            for ( int k = 0; k < javaVals.length; k++ ) {
                IJavaValue mapEntry = javaVals[k];
                IJavaObject key = null;
                IJavaValue value = null;

                IVariable[] vars = mapEntry.getVariables();
                for ( int j = 0; j < vars.length; j++ ) {
                    IVariable var = vars[j];
                    if ("key".equals(var.getName())) {
View Full Code Here

    for (int i = fArgCount - 1; i >= 0; i--) {
      args[i] = popValue();
    }

    IJavaType receiver = getType(fTypeName);
    IJavaValue result;
    if (receiver instanceof IJavaClassType) {
      result = ((IJavaClassType) receiver).sendMessage(fSelector,
          fSignature, args, getContext().getThread());
    } else {
      throw new CoreException(
View Full Code Here

  /*
   * @see Instruction#execute()
   */
  @Override
  public void execute() throws CoreException {
    IJavaValue value = popValue();

    if (value instanceof IJavaPrimitiveValue) {
      IJavaPrimitiveValue primitiveValue = (IJavaPrimitiveValue) value;
      switch (fTypeTypeId) {
      case T_double:
        push(newValue(primitiveValue.getDoubleValue()));
        break;
      case T_float:
        push(newValue(primitiveValue.getFloatValue()));
        break;
      case T_long:
        push(newValue(primitiveValue.getLongValue()));
        break;
      case T_int:
        push(newValue(primitiveValue.getIntValue()));
        break;
      case T_short:
        push(newValue(primitiveValue.getShortValue()));
        break;
      case T_byte:
        push(newValue(primitiveValue.getByteValue()));
        break;
      case T_char:
        push(newValue(primitiveValue.getCharValue()));
        break;
      }

    } else if (value instanceof JDINullValue) {
      // null value can be cast to all non-primitive types (bug 31637).
      push(value);
    } else {
      IJavaObject classObject;
      if (fDimension == 0) {
        classObject = getClassObject(getType(fBaseTypeName));
      } else {
        classObject = getClassObject(getArrayType(
            Signature.createTypeSignature(fBaseTypeName, true),
            fDimension));
      }
      if (classObject == null) {
        throw new CoreException(
            new Status(
                IStatus.ERROR,
                JDIDebugPlugin.getUniqueIdentifier(),
                IStatus.OK,
                NLS.bind(InstructionsEvaluationMessages.Cast_No_class_object,
                        new String[] { typeName() }),
                null));
      }
      IJavaPrimitiveValue resultValue = (IJavaPrimitiveValue) classObject
          .sendMessage(IS_INSTANCE, IS_INSTANCE_SIGNATURE,
              new IJavaValue[] { value }, getContext()
                  .getThread(), false);
      if (!resultValue.getBooleanValue()) {
        throw new CoreException(
            new Status(
                IStatus.ERROR,
                JDIDebugPlugin.getUniqueIdentifier(),
                IStatus.OK,
                NLS.bind(InstructionsEvaluationMessages.Cast_ClassCastException__Cannot_cast__0__as__1___1,
                        new String[] {
                            value.toString(),
                            typeName() }), null));
      }

      push(value);
    }
View Full Code Here

    // args are in reverse order
    for (int i = fArgCount - 1; i >= 0; i--) {
      args[i] = popValue();
    }
    Object receiver = pop();
    IJavaValue result = null;

    if (receiver instanceof IJavaVariable) {
      receiver = ((IJavaVariable) receiver).getValue();
    }
View Full Code Here

  /*
   * @see Instruction#execute()
   */
  @Override
  public void execute() throws CoreException {
    IJavaValue value = popValue();
    IJavaVariable variable = (IJavaVariable) pop();

    if (value instanceof IJavaPrimitiveValue) {
      IJavaPrimitiveValue primitiveValue = (IJavaPrimitiveValue) value;
      switch (fVariableTypeId) {
View Full Code Here

        if (isCompatibleLoader(loader, cloader)) {
          return type.getClassObject();
        }
      }
    }
    IJavaValue loaderArg = loader;
    if (loader == null) {
      loaderArg = getVM().nullValue();
    }
    // prevent the name string from being collected during the class lookup
    // call
    // https://bugs.eclipse.org/bugs/show_bug.cgi?id=301412
    final IJavaValue name = getVM().newValue(qualifiedName);
    ((IJavaObject) name).disableCollection();
    IJavaValue[] args = new IJavaValue[] { name, getVM().newValue(true),
        loaderArg };
    try {
      return (IJavaClassObject) getJavaLangClass().sendMessage(FOR_NAME,
View Full Code Here

  private IJavaObject getParentLoader(IJavaObject loader)
      throws CoreException {
    // to avoid message send, first check for 'parent' field
    IJavaFieldVariable field = loader.getField("parent", false); //$NON-NLS-1$
    if (field != null) {
      IJavaValue value = (IJavaValue) field.getValue();
      if (value.isNull()) {
        return null;
      }
      return (IJavaObject) value;
    }
    IJavaValue result = loader
        .sendMessage(
            "getParent", "()Ljava/lang/ClassLoader;", null, getThread(), false); //$NON-NLS-1$ //$NON-NLS-2$
    if (result.isNull()) {
      return null;
    }
    return (IJavaObject) result;
  }
View Full Code Here

      } catch (DebugException e) {
        exception = e;
      }
      long end = System.currentTimeMillis();

      IJavaValue value = interpreter.getResult();

      if (exception == null) {
        exception = er.getException();
      }
View Full Code Here

TOP

Related Classes of org.eclipse.jdt.debug.core.IJavaValue

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.