Package javax.tools.diagnostics.image

Examples of javax.tools.diagnostics.image.ImagePointer


  public void testGetObjectAtAddress()
  {
    JavaHeap heap = defaultJavaHeap();
    JavaRuntime runtime = defaultJavaRuntime();
    ImageAddressSpace addressSpace = defaultAddressSpace();
    ImagePointer address=null;
    ImagePointer unalignedAddress=null;
    Iterator heapSections = heap.getSections().iterator();


    //determine the heap start and end address
    long heapStartAddress = Long.MAX_VALUE;
View Full Code Here


 
  JavaRuntime runtime=getJavaRuntime();
 
 
  try {
    ImagePointer data = runtime.getJavaVM();
    assertNotNull(data);
  } catch (CorruptDataException e) {
    // allowed under spec
  }
 
View Full Code Here

      } catch (DataUnavailable e) {
        // allowed
      }
   
      try {
        ImagePointer p=t.getJNIEnv();
        assertNotNull("Entry "+counter+":JNIEnv is null - DataUnavailable should have been thrown instead",p);
      } catch (CorruptDataException e) {
        // allowed
      }
     
View Full Code Here

   * Ensures that the pointer is non-null and that the underlying address is non-zero
   */
  public void testGetID()
  {
    try {
      ImagePointer id = _testClass.getID();
      assertNotNull(id);
      assertTrue(0 != id.getAddress());
    } catch (Exception e) {
      //if we caught anything else, this is an error
      fail();
    }
  }
View Full Code Here

       
        assertNotNull("Entry "+counter+"/"+objcounter+" is null",object);
       
        // test id
       
        ImagePointer p = subTestID(counter, objcounter, object);
       
        // test getSize
       
        subTestGetSize(counter, objcounter, object);
       
View Full Code Here

    }
  }

  private ImagePointer subTestID(int counter, int objcounter,
      JavaObject object) {
    ImagePointer p=object.getID();
    assertNotNull("Entry "+counter+"/"+objcounter+" getID is null",p);
    return p;
  }
View Full Code Here

   *
   * Ensures that adding an offset yields a pointer at the expected address
   */
  public void testAdd()
  {
    ImagePointer newPointer = _testPointer.add(OFFSET);
    assertTrue(newPointer.getAddress() == (_testPointer.getAddress() + OFFSET));
  }
View Full Code Here

      out.print(": ");
     
      while (itImageAddressSpace.hasNext() && !found)
      {
        ImageAddressSpace ias = (ImageAddressSpace)itImageAddressSpace.next();
        ImagePointer ip = ias.getPointer(currAddr);
       
        byte b = 0;
        short s = 0;
        int i = 0;
        long l = 0;
        try {
          switch (unitSize)
          {
          case 1:
            b = ip.getByteAt(0);
            break;
          case 2:
            s = ip.getShortAt(0);
            break;
          case 4:
            i = ip.getIntAt(0);
            break;
          case 8:
            l = ip.getLongAt(0);
            break;
          }
         
          found = true;
        } catch (CorruptDataException e) {
View Full Code Here

   
    for (int index = 0; index < numUnits; index++)
    {
      boolean found = false;
      long currAddr = address.longValue() + (index * unitSize);
      ImagePointer ip = ias.getPointer(currAddr);
     
      out.print("\t");
      out.print(Utils.toHex(currAddr));
      out.print("   ");

      long l = 0;
      try {
        l = ip.getPointerAt(0).getAddress();
        found = true;
      } catch (CorruptDataException e) {
        found = false;
      } catch (MemoryAccessException e) {
        found = false;
View Full Code Here

      out.print(": ");
     
      while (itImageAddressSpace.hasNext() && !found)
      {
        ImageAddressSpace ias = (ImageAddressSpace)itImageAddressSpace.next();
        ImagePointer ip = ias.getPointer(currAddr);
       
        byte b = 0;
        short s = 0;
        int i = 0;
        long l = 0;
        try {
          switch (unitSize)
          {
          case 1:
            b = ip.getByteAt(0);
            break;
          case 2:
            s = ip.getShortAt(0);
            break;
          case 4:
            i = ip.getIntAt(0);
            break;
          case 8:
            l = ip.getLongAt(0);
            break;
          }
         
          found = true;
        } catch (CorruptDataException e) {
View Full Code Here

TOP

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

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.