Package javax.tools.diagnostics.image

Examples of javax.tools.diagnostics.image.ImageSection


          Object nextStackSection = itStackSection.next();
          if (nextStackSection instanceof CorruptData) {
            out.print("\t    " + Exceptions.getCorruptDataExceptionString() + "\n");
            continue;
          }
          ImageSection is = (ImageSection)nextStackSection;
          printStackSection(is);
        }
        printStackFrameInfo(it, out);
               
        out.print("\t   properties:");
View Full Code Here


              if (jm.getCompiledSections().isEmpty()==false)
              {
                Iterator itImageSection = jm.getCompiledSections().iterator();
                while (itImageSection.hasNext())
                {
                  ImageSection is = (ImageSection)itImageSection.next();
                  long startAddr = is.getBaseAddress().getAddress();
                  long size = is.getSize();
                  long endAddr = startAddr + size;
                 
                  out.print("\n\t" + "start=" + Utils.toHex(startAddr) +
                      "  " + "end=" + Utils.toHex(endAddr) +
                      "   " + jcName + "::" + name + sig);
View Full Code Here

         
            // iterate through the library sections
            while (itSection.hasNext()) {
              next = itSection.next();
              if (next instanceof ImageSection) {
                ImageSection is = (ImageSection)next;
                out.print("\t   0x" +
                  Long.toHexString(is.getBaseAddress().getAddress()) + " - 0x" +
                  Long.toHexString(is.getBaseAddress().getAddress() + is.getSize()));
                out.print(", name: \"");
                out.print(is.getName());
                out.print("\", size: 0x");
                out.print(Long.toHexString(is.getSize()));
                out.print("\n")
              } else if (next instanceof CorruptData) {
                // warn the user that this image section is corrupt
                out.print("\t   <corrupt section encountered>\n");
              } else {
View Full Code Here

      }
      while (null != itModule && itModule.hasNext()) {
        ImageModule im = (ImageModule)itModule.next();
        Iterator itImageSection = im.getSections().iterator();
        while (itImageSection.hasNext()) {
          ImageSection is = (ImageSection)itImageSection.next();
          long startAddr = is.getBaseAddress().getAddress();
          long endAddr = startAddr + is.getSize();
         
          if (pointer >= startAddr && pointer < endAddr) {
            /* can we find a matching symbol? */
            long maxDifference = pointer - startAddr;
            ImageSymbol bestSymbol = null;
            for (Iterator iter = im.getSymbols().iterator(); iter.hasNext();) {
              Object next = iter.next();
              if (next instanceof CorruptData)
                continue;
              ImageSymbol symbol = (ImageSymbol) next;
              long symbolAddress = symbol.getAddress().getAddress();
              if (symbolAddress <= pointer && pointer - symbolAddress < maxDifference) {
                maxDifference = pointer - symbolAddress;
                bestSymbol = symbol;
              }
            }

            try {
              out.print(im.getName());
            } catch (CorruptDataException e) {
              out.print(Exceptions.getCorruptDataExceptionString());
            }
            out.print("::");
            if (bestSymbol == null) {
              out.print(is.getName());
            } else {
              out.print(bestSymbol.getName());
            }
            out.print("+");
            out.print(Long.toString(maxDifference));
View Full Code Here

    if (!parseParams(args, params)) return;
    Iterator imageSections = Utils.getAddressSapceSectionInfo(loadedImage);
   
    while(imageSections.hasNext()){
      if (matches.size() > findAtt.numMatchesToDisplay) break;
      ImageSection imageSection = (ImageSection)imageSections.next();       
      if (scanImageSection(imageSection)) break;
    }
    if (matches.size() > 0)
      findAtt.lastMatch = ((Long)matches.get(matches.size()-1)).longValue();
    properties.put(Utils.FIND_ATTRIBUTES, findAtt);
View Full Code Here

 
  private boolean isWithinImageSections(Iterator heapImageSections, Object memType,
    boolean isMethodCompiled, long address)
  {
    while (heapImageSections.hasNext()){
      ImageSection imageSection = (ImageSection)heapImageSections.next();
      long baseAddress = imageSection.getBaseAddress().getAddress();
      long size = imageSection.getSize();
      long endAddress = baseAddress + size;
     
      if (address <= endAddress  && address >= baseAddress) {
        if (null == memType) {
          out.print("\t\t0x" + Long.toHexString(address) + " is within heap segment: "
View Full Code Here

      try{
        out.print("Bytecode range(s): ");
        Iterator imageSections = jMethod.getBytecodeSections().iterator();
        boolean firstSectionPassed = false;
        while (imageSections.hasNext()){
          ImageSection is = (ImageSection)imageSections.next();
          long baseAddress = is.getBaseAddress().getAddress();
          long endAddress = baseAddress + is.getSize();
          if (firstSectionPassed) {
            out.print(", ");
          }
          out.print(Long.toHexString(baseAddress) + " -- " +
              Long.toHexString(endAddress));
View Full Code Here

  }
 
  public void doCommand(Stack args, Image loadedImage, HashMap properties){
    Iterator imageSections = Utils.getAddressSapceSectionInfo(loadedImage);
    while(imageSections.hasNext()){
      ImageSection imageSection = (ImageSection)imageSections.next();
      long startAddress = imageSection.getBaseAddress().getAddress();
      long size = imageSection.getSize();
      out.println("Address: 0x" + Long.toHexString(startAddress) + "   size: 0x" +
          Long.toHexString(size) + " (" + size + ")");
    }
  }
View Full Code Here

    Iterator itSections = theHeap.getSections().iterator();
    int countSections = 1;
   
    while (itSections.hasNext()){
     
      ImageSection theSection = (ImageSection)itSections.next();
      out.print("\t  Section #"+ countSections + ":  " + theSection.getName() + "\n");
      out.print("\t   Size:        " + theSection.getSize() + " bytes\n");
      try
      {
        out.print("\t   Shared:      " + theSection.isShared() + "\n");
        out.print("\t   Executable:  " + theSection.isExecutable() +"\n");
        out.print("\t   Read Only:   " + theSection.isReadOnly() + "\n");
      }
      catch(DataUnavailable e){
        out.print("\t   Shared:      <unknown>\n");
        out.print("\t   Executable:  <unknown>\n");
        out.print("\t   Read Only:   <unknown>\n");
View Full Code Here

    long size = 0;
    long totalObjectSize = 0;
   
    Iterator itSections = theHeap.getSections().iterator();
    while (itSections.hasNext()){
      ImageSection theSection = (ImageSection)itSections.next();
      size = size + theSection.getSize();
    }
    out.print("\t  Size of heap: "+ size + " bytes\n");
   
    Iterator itObjects = theHeap.getObjects().iterator();
    try{
View Full Code Here

TOP

Related Classes of javax.tools.diagnostics.image.ImageSection

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.