Package com.sun.jdi

Examples of com.sun.jdi.Method


  protected EventRequest[] newRequests(JDIDebugTarget target,
      ReferenceType type) throws CoreException {
    try {
      if (type instanceof ClassType) {
        ClassType clazz = (ClassType) type;
        Method method = clazz.concreteMethodByName(getMethodName(),
            getMethodSignature());
        if (method == null) {
          return null;
        }
        Location location = method.location();
        if (location == null || location.codeIndex() == -1) {
          return null;
        }
        BreakpointRequest req = type.virtualMachine()
            .eventRequestManager()
View Full Code Here


    // method, since this checks the code index within the method. Even if
    // the
    // code indices are different, the line numbers may be the same, in
    // which case
    // we need to do the extra step into.
    Method origMethod = origLocation.method();
    Method currMethod = location.method();
    if (!origMethod.equals(currMethod)) {
      return false;
    }
    if (origLocation.lineNumber() != location.lineNumber()) {
      return false;
View Full Code Here

      throw new ClassCastException(
          JDIMessages.MethodImpl_Can__t_compare_method_to_given_object_6);

    // See if declaring types are the same, if not return comparison between
    // declaring types.
    Method type2 = method;
    if (!declaringType().equals(type2.declaringType()))
      return declaringType().compareTo(type2.declaringType());

    // Return comparison of position within declaring type.
    int index1 = declaringType().methods().indexOf(this);
    int index2 = type2.declaringType().methods().indexOf(type2);
    if (index1 < index2) {
      return -1;
    } else if (index1 > index2) {
      return 1;
    } else {
View Full Code Here

    if (ID.isNull()) {
      return null;
    }

    // The method must be part of a known reference type.
    Method method = referenceType.findMethod(ID);
    if (method == null) {
      throw new InternalError(
          JDIMessages.MethodImpl_Got_MethodID_of_ReferenceType_that_is_not_a_member_of_the_ReferenceType_10);
    }
    return (MethodImpl) method;
View Full Code Here

        fDepth = -1;
        fStackFrame = null;
        return null;
      } else if (fDepth == depth) {
        Location location = frame.location();
        Method method = location.method();
        if (method.equals(fLocation.method())) {
          try {
            if (method.declaringType().defaultStratum()
                .equals("Java") || //$NON-NLS-1$
                equals(getSourceName(location),
                    getSourceName(fLocation))) {
              // TODO: what about receiving type being the same?
              fStackFrame = frame;
View Full Code Here

          requestFailed(
              JDIDebugModelMessages.JDIStackFrame_Variable_information_unavailable_for_native_methods,
              null);
        }

        Method method = getUnderlyingMethod();
        fVariables = new ArrayList<IJavaVariable>();
        // #isStatic() does not claim to throw any exceptions - so it is
        // not try/catch coded
        if (method.isStatic()) {
          // add statics
          List<Field> allFields = null;
          ReferenceType declaringType = method.declaringType();
          try {
            allFields = declaringType.allFields();
          } catch (RuntimeException e) {
            targetRequestFailed(
                MessageFormat.format(
View Full Code Here

  /**
   * @see IJavaStackFrame#getArgumentTypeNames()
   */
  public List<String> getArgumentTypeNames() throws DebugException {
    try {
      Method underlyingMethod = getUnderlyingMethod();
      String genericSignature = underlyingMethod.genericSignature();
      if (genericSignature == null) {
        // no generic signature
        return underlyingMethod.argumentTypeNames();
      }
      // generic signature
      String[] parameterTypes = Signature
          .getParameterTypes(genericSignature);
      List<String> argumentTypeNames = new ArrayList<String>();
View Full Code Here

  protected void updateVariables() throws DebugException {
    if (fVariables == null) {
      return;
    }

    Method method = getUnderlyingMethod();
    int index = 0;
    if (!method.isStatic()) {
      // update "this"
      ObjectReference thisObject;
      thisObject = getUnderlyingThisObject();
      JDIThisVariable oldThisObject = null;
      if (!fVariables.isEmpty()
View Full Code Here

  /**
   * @see IJavaStackFrame#getDeclaringType()
   */
  public IJavaClassType getDeclaringType() throws DebugException {
    Method method = getUnderlyingMethod();
    try {
      Type type = method.declaringType();
      if (type instanceof ClassType) {
        return (IJavaClassType) JDIType.createType(
            (JDIDebugTarget) getDebugTarget(), type);
      }
      targetRequestFailed(JDIDebugModelMessages.JDIStackFrame_0, null);
View Full Code Here

   * (non-Javadoc)
   *
   * @see org.eclipse.jdt.debug.core.IJavaStackFrame#getReferenceType()
   */
  public IJavaReferenceType getReferenceType() throws DebugException {
    Method method = getUnderlyingMethod();
    try {
      Type type = method.declaringType();
      return (IJavaReferenceType) JDIType.createType(
          (JDIDebugTarget) getDebugTarget(), type);
    } catch (RuntimeException e) {
      targetRequestFailed(
          MessageFormat.format(
View Full Code Here

TOP

Related Classes of com.sun.jdi.Method

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.