* and that addresses outside the heap or not pointing to an object start
* throw the expected exceptions.
*/
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;
long heapEndAddress = 0;
Object nextElement = null;
ImageSection currentSection = null;
long sectionStart = 0;
while (heapSections.hasNext()) {
nextElement = heapSections.next();
if (nextElement instanceof ImageSection) {
currentSection = (ImageSection) nextElement;
sectionStart = currentSection.getBaseAddress().getAddress();
if (sectionStart < heapStartAddress) {
heapStartAddress = sectionStart;
}
if (sectionStart + currentSection.getSize() > heapEndAddress) {
heapEndAddress = sectionStart + currentSection.getSize();
}
}
}
//check that every object in the heap can be retrieved by address
boolean exception=false;
for (Iterator objects = heap.getObjects().iterator();objects.hasNext();) {
Object potentialObject = objects.next();
JavaObject object = null;
if (potentialObject instanceof JavaObject) {
object = (JavaObject)potentialObject;
} else {