Package javax.tools.diagnostics.runtime.java

Examples of javax.tools.diagnostics.runtime.java.JavaLocation


 
  private void printJavaStackFrameInfo(JavaThread jt, Output out)
  {
    Iterator itStackFrame;
    JavaStackFrame jsf;
    JavaLocation jl;

    itStackFrame = jt.getStackFrames().iterator();
    if (!itStackFrame.hasNext()) {
      out.print("<no frames to print>\n");
      return;
    } else {
      out.print("\n");
    }
    while (itStackFrame.hasNext()) {
      // this iterator can contain JavaStackFrame or CorruptData objects
      Object next = itStackFrame.next();
      if (next instanceof CorruptData) {
        out.print("\t     " + Exceptions.getCorruptDataExceptionString() + "\n");
        return;
      } else {
          jsf = (JavaStackFrame)next;
      }
      try {
        jl = jsf.getLocation();
      } catch (CorruptDataException e) {
        out.print("\t     " + Exceptions.getCorruptDataExceptionString()+ "\n");
        return;
      }
     
      out.print("\t     bp: ");
      try {
        out.print(toAdjustedHex(jsf.getBasePointer().getAddress()));
      } catch (CorruptDataException e) {
        out.print(Exceptions.getCorruptDataExceptionString());
      }
     
      out.print("    method: ");
      try {
        String signature = jl.getMethod().getSignature();
        out.print(Utils.getReturnValueName(signature) + " " +
            jl.getMethod().getDeclaringClass().getName() + "." +
            jl.getMethod().getName() +
            Utils.getMethodSignatureName(signature)
            );
      } catch (CorruptDataException e) {
        out.print(Exceptions.getCorruptDataExceptionString());
      } catch (DataUnavailable e) {
        out.print(Exceptions.getDataUnavailableString());
      }

      out.print("    filename:line: ");
      try {
        out.print(jl.getFilename());
      } catch (DataUnavailable d) {
        out.print(Exceptions.getDataUnavailableString());
      } catch (CorruptDataException e) {
        out.print(Exceptions.getCorruptDataExceptionString());
      }
      out.print(":");
      try {
        out.print(Integer.toString(jl.getLineNumber()));
      } catch (DataUnavailable d) {
        out.print(Exceptions.getDataUnavailableString());
      } catch (CorruptDataException e) {
        out.print(Exceptions.getCorruptDataExceptionString());
      }
View Full Code Here


          continue;
        }
       
        JavaStackFrame frame = (JavaStackFrame) nextFrame;
       
        JavaLocation location;
        try {
          location = frame.getLocation();
        } catch (CorruptDataException e) {
          continue FRAMES;
        }
       
        if (location != null) {
          try {
            JavaMethod method = location.getMethod();
            if (clazz.equals(method.getDeclaringClass())) {
              list.add(thread);
              break FRAMES;
            }
          } catch (CorruptDataException e) {
View Full Code Here

          for (Object nextFrame : thread.getStackFrames()) {
            if (nextFrame instanceof CorruptData) {
              continue;
            }
           
            JavaLocation location = ((JavaStackFrame) nextFrame).getLocation();
           
            if (location != null) {
              out.println("\t"+location);
            }
          }
View Full Code Here

TOP

Related Classes of javax.tools.diagnostics.runtime.java.JavaLocation

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.