/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
implements StackFrame, ThreadListener
{
/* Once false, frame should not be used.
* access synchronized on (vm.state())
*/
private boolean isValid = true;
private final long id;
super(vm);
thread.addListener(this);
}
/*
* ThreadListener implementation
* Must be synchronized since we must protect against
* sending defunct (isValid == false) stack ids to the back-end.
*/
if (isValid) {
isValid = false;
return false; /* remove this stack frame as a listener */
} else {
throw new InternalException(
"Invalid stack frame thread listener");
}
}
}
void validateStackFrame() {
if (!isValid) {
throw new InvalidStackFrameException("Thread has been resumed");
}
}
/**
* Return the frame location.
* Need not be synchronized since it cannot be provably stale.
*/
return location;
}
/**
* Return the thread holding the frame.
* Need not be synchronized since it cannot be provably stale.
*/
return thread;
}
} else {
return false;
}
}
public int hashCode() {
}
return null;
} else {
if (thisObject == null) {
/* protect against defunct frame id */
}
/* actually get it, now that order is guaranteed */
try {
} catch (JDWPException exc) {
throw new InvalidStackFrameException();
default:
throw exc.toJDIException();
}
}
}
}
return thisObject;
}
/**
* Build the visible variable map.
* Need not be synchronized since it cannot be provably stale.
*/
if (visibleVariables == null) {
}
}
}
}
}
/**
* Return the list of visible variable in the frame.
* Need not be synchronized since it cannot be provably stale.
*/
return mapAsList;
}
/**
* Return a particular variable in the frame.
* Need not be synchronized since it cannot be provably stale.
*/
}
}
for (int i=0; i<count; ++i) {
" is not valid at this frame location");
}
}
/* protect against defunct frame id */
}
/* actually get it, now that order is guaranteed */
try {
} catch (JDWPException exc) {
throw new InvalidStackFrameException();
default:
throw exc.toJDIException();
}
}
throw new InternalException(
"Wrong number of values returned from target VM");
}
for (int i=0; i<count; ++i) {
}
return map;
}
throws InvalidTypeException, ClassNotLoadedException {
" is not valid at this frame location");
}
try {
// Validate and convert value if necessary
/* protect against defunct frame id */
}
/* actually set it, now that order is guaranteed */
try {
} catch (JDWPException exc) {
throw new InvalidStackFrameException();
default:
throw exc.toJDIException();
}
}
} catch (ClassNotLoadedException e) {
/*
* Since we got this exception,
* the variable type must be a reference type. The value
* we're trying to set is null, but if the variable's
* class has not yet been loaded through the enclosing
* class loader, then setting to null is essentially a
* no-op, and we should allow it without an exception.
*/
throw e;
}
}
}
int slot;
slot = 0;
} else {
slot = 1;
}
slot++;
}
}
/* protect against defunct frame id */
}
try {
} catch (JDWPException exc) {
throw new InvalidStackFrameException();
default:
throw exc.toJDIException();
}
}
throw new InternalException(
"Wrong number of values returned from target VM");
}
}
// flush caches and disable caching until command completion
new CommandSender() {
public PacketStream send() {
}
};
try {
} catch (JDWPException exc) {
throw new IncompatibleThreadStateException(
"Thread not current or suspended");
throw new IncompatibleThreadStateException("zombie");
throw new InvalidStackFrameException(
"No more frames on the stack");
default:
throw exc.toJDIException();
}
}
// enable caching - suspended again
}
}
}