Package com.sun.jdi

Examples of com.sun.jdi.AbsentInformationException


   * @return Returns an identifying name for the source corresponding to the
   *         declaration of this type.
   */
  @Override
  public String sourceName() throws AbsentInformationException {
    throw new AbsentInformationException(
        JDIMessages.ArrayTypeImpl_No_source_name_for_Arrays_1);
  }
View Full Code Here


    if (isObsolete()) {
      return;
    }
    if (fCodeIndexToLine != null) {
      if (fCodeIndexToLine.isEmpty()) {
        throw new AbsentInformationException(
            JDIMessages.MethodImpl_Got_empty_line_number_table_for_this_method_1);
      }
      return;
    }

    initJdwpRequest();
    try {
      ByteArrayOutputStream outBytes = new ByteArrayOutputStream();
      DataOutputStream outData = new DataOutputStream(outBytes);
      writeWithReferenceType(this, outData);

      JdwpReplyPacket replyPacket = requestVM(
          JdwpCommandPacket.M_LINE_TABLE, outBytes);
      switch (replyPacket.errorCode()) {
      case JdwpReplyPacket.ABSENT_INFORMATION:
        throw new AbsentInformationException(
            JDIMessages.MethodImpl_No_line_number_information_available_2);
      case JdwpReplyPacket.NATIVE_METHOD:
        throw new AbsentInformationException(
            JDIMessages.MethodImpl_No_line_number_information_available_2);
      }
      defaultReplyErrorHandler(replyPacket.errorCode());

      DataInputStream replyData = replyPacket.dataInStream();
      fLowestValidCodeIndex = readLong("lowest index", replyData); //$NON-NLS-1$
      fHighestValidCodeIndex = readLong("highest index", replyData); //$NON-NLS-1$
      int nrOfElements = readInt("elements", replyData); //$NON-NLS-1$
      fCodeIndexToLine = new HashMap<Long, Integer>();
      fLineToCodeIndexes = new HashMap<Integer, List<Long>>();
      if (nrOfElements == 0) {
        throw new AbsentInformationException(
            JDIMessages.MethodImpl_Got_empty_line_number_table_for_this_method_3);
      }
      fCodeIndexTable = new long[nrOfElements];
      fJavaStratumLineNumberTable = new int[nrOfElements];
      for (int i = 0; i < nrOfElements; i++) {
View Full Code Here

    if (isAbstract() || isNative() || isObsolete()) {
      return -1;
    }
    getLineTable();
    if (lineCodeIndex > fHighestValidCodeIndex) {
      throw new AbsentInformationException(JDIMessages.MethodImpl_Invalid_code_index_of_a_location_given_4);
    }

    Long lineCodeIndexObj;
    Integer lineNrObj;
    long index = lineCodeIndex;
    // Search for the line where this code index is located.
    do {
      lineCodeIndexObj = new Long(index);
      lineNrObj = javaStratumCodeIndexToLine().get(lineCodeIndexObj);
    } while (lineNrObj == null && --index >= fLowestValidCodeIndex);
    if (lineNrObj == null) {
      if (lineCodeIndex >= fLowestValidCodeIndex) {
        index = lineCodeIndex;
        do {
          lineCodeIndexObj = new Long(index);
          lineNrObj = javaStratumCodeIndexToLine().get(lineCodeIndexObj);
        } while (lineNrObj == null && ++index <= fHighestValidCodeIndex);
        if (lineNrObj != null) {
          return lineNrObj.intValue();
        }
      }
      throw new AbsentInformationException(JDIMessages.MethodImpl_Invalid_code_index_of_a_location_given_4);
    }
    return lineNrObj.intValue();
  }
View Full Code Here

  /* (non-Javadoc)
   * @see com.sun.jdi.Method#arguments()
   */
  public List<LocalVariable> arguments() throws AbsentInformationException {
    if (isNative() || isAbstract()) {
      throw new AbsentInformationException(JDIMessages.MethodImpl_No_local_variable_information_available_9);
    }
    if (fArguments != null) {
      return fArguments;
    }

View Full Code Here

      return null;
    }
    try {
      Integer lineNrInt = javaStratumCodeIndexToLine().get(new Long(index));
      if (lineNrInt == null) {
        throw new AbsentInformationException(MessageFormat.format(JDIMessages.MethodImpl_No_valid_location_at_the_specified_code_index__0__2, new Object[] { Long.toString(index) }));
      }
    } catch (AbsentInformationException e) {
    }
    return new LocationImpl(virtualMachineImpl(), this, index);
  }
View Full Code Here

  /* (non-Javadoc)
   * @see com.sun.jdi.Method#variables()
   */
  public List<LocalVariable> variables() throws AbsentInformationException {
    if (isNative() || isAbstract()) {
      throw new AbsentInformationException(JDIMessages.MethodImpl_No_local_variable_information_available_9);
    }
    if (fVariables != null) {
      return fVariables;
    }
    initJdwpRequest();
View Full Code Here

        fVariables.add(localVar);
        slot++;
      }
      return fVariables;
    }
    throw new AbsentInformationException(
        JDIMessages.MethodImpl_No_local_variable_information_available_9);

  }
View Full Code Here

    Stratum stratum = getStratum(stratumId);
    if (stratum != null) {
      // return the source names defined for this stratum in the SMAP.
      List<FileInfo> fileInfos = stratum.fFileInfos;
      if (fileInfos.isEmpty()) {
        throw new AbsentInformationException(
            JDIMessages.ReferenceTypeImpl_30);
      }
      for (Iterator<FileInfo> iter = stratum.fFileInfos.iterator(); iter.hasNext();) {
        list.add(iter.next().fFileName);
      }
View Full Code Here

      return fSmap;
    }
    if (!virtualMachine().canGetSourceDebugExtension()) {
      throw new UnsupportedOperationException();
    }
    throw new AbsentInformationException();
  }
View Full Code Here

   */
  public List<Location> locationsOfLine(String stratum, String sourceName, int lineNumber) throws AbsentInformationException {
    Iterator<Method> allMethods = methods().iterator();
    List<Location> locations = new ArrayList<Location>();
    boolean hasLineInformation = false;
    AbsentInformationException exception = null;
    while (allMethods.hasNext()) {
      MethodImpl method = (MethodImpl) allMethods.next();
      if (method.isAbstract() || method.isNative()) {
        continue;
      }
View Full Code Here

TOP

Related Classes of com.sun.jdi.AbsentInformationException

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.