agent/src/share/classes/sun/jvm/hotspot/runtime/VirtualConstructor.java
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File
*** old/agent/src/share/classes/sun/jvm/hotspot/runtime/VirtualConstructor.java	Fri Sep  9 14:16:00 2011
--- new/agent/src/share/classes/sun/jvm/hotspot/runtime/VirtualConstructor.java	Fri Sep  9 14:15:59 2011

*** 1,7 **** --- 1,7 ---- /* ! * Copyright (c) 2000, 2005, Oracle and/or its affiliates. All rights reserved. ! * Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation.
*** 24,34 **** --- 24,33 ---- package sun.jvm.hotspot.runtime; import java.util.*; import sun.jvm.hotspot.debugger.*; import sun.jvm.hotspot.debugger.cdbg.*; import sun.jvm.hotspot.types.*; /** This class provides generalized "virtual constructor" functionality for VMObjects. In simple terms, it creates correctly-typed Java wrapper objects for underlying Addresses,
*** 37,47 **** --- 36,46 ---- created for it will be of type sun.jvm.hotspot.memory.DefNewGeneration, assuming the mapping from type "DefNewGeneration" to class sun.jvm.hotspot.memory.DefNewGeneration has been set up. */ ! public class VirtualConstructor extends InstanceConstructor<VMObject> { private TypeDataBase db; private Map map; // Map<String, Class> public VirtualConstructor(TypeDataBase db) { this.db = db;
*** 76,97 **** --- 75,82 ---- if (db.addressTypeIsEqualToType(addr, db.lookupType(typeName))) { return (VMObject) VMObjectFactory.newObject((Class) map.get(typeName), addr); } } ! String message = "No suitable match for type of address " + addr; CDebugger cdbg = VM.getVM().getDebugger().getCDebugger(); if (cdbg != null) { // Most common case: V-table pointer is the first field Address vtblPtr = addr.getAddressAt(0); LoadObject lo = cdbg.loadObjectContainingPC(vtblPtr); if (lo != null) { ClosestSymbol symbol = lo.closestSymbolToPC(vtblPtr); if (symbol != null) { message += " (nearest symbol is " + symbol.getName() + ")"; ! throw newWrongTypeException(addr); } } } throw new WrongTypeException(message); } }

agent/src/share/classes/sun/jvm/hotspot/runtime/VirtualConstructor.java
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File