本文整理汇总了Java中com.sun.squawk.DebuggerSupport.getDefiningClass方法的典型用法代码示例。如果您正苦于以下问题:Java DebuggerSupport.getDefiningClass方法的具体用法?Java DebuggerSupport.getDefiningClass怎么用?Java DebuggerSupport.getDefiningClass使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.sun.squawk.DebuggerSupport
的用法示例。
在下文中一共展示了DebuggerSupport.getDefiningClass方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: frames0
import com.sun.squawk.DebuggerSupport; //导入方法依赖的package包/类
private void frames0() throws SDWPException, IOException {
final int startFrame = in.readInt("startFrame");
final int length = in.readInt("length");
final int totalFrames = DebuggerSupport.countStackFrames(thread, from);
final int availFrames = totalFrames - startFrame;
final int endFrame = (length == -1) ? availFrames : startFrame + length;
if (startFrame < 0 || endFrame <= startFrame || endFrame > totalFrames) {
throw new SDWPException(JDWP.Error_INVALID_THREAD, "'startFrame' or 'length' value is invalid. startFrame: " + startFrame + " endFrame: " + endFrame);
}
out.writeInt(endFrame - startFrame, "frames");
DebuggerSupport.StackInspector inspector = new DebuggerSupport.StackInspector(thread, false) {
private Exception exception;
public void inspectFrame(Object mp, Offset bciWord, int frame, Offset fpOffset) {
if (exception == null && startFrame <= frame && frame < endFrame) {
int bci = bciWord.toInt();
if (frame != 0 || DebuggerSupport.isAtExceptionBreakpoint(vmThread)) {
// if we're at an exception or in any frame but the inner most, ip is
// one after the currently executing instruction in the frame
bci--;
}
Klass definingClass = DebuggerSupport.getDefiningClass(mp);
MethodID methodID = DebuggerSupport.getIDForMethodBody(definingClass, mp);
ReferenceTypeID definingClassID = sda.getIDForClass(definingClass);
Location location = new Location(JDWP.getTypeTag(definingClass), definingClassID, methodID, bci);
Assert.that(DebuggerSupport.getMethodBody(definingClass, methodID.getOffset(), methodID.isStatic()) == mp, "bad method lookup");
if (Log.DEBUG_ENABLED && Log.debug()) {
Log.log(" " + definingClass + "[mid=" + methodID + "]@" + bci);
}
try {
out.writeFrameID(new FrameID(sda.getObjectManager().getIDForObject(vmThread), frame), "frameID");
out.writeLocation(location, "location");
} catch (IOException e) {
exception = e;
}
}
}
public Object getResult() {
return exception;
}
};
DebuggerSupport.inspectStack(inspector, from, -1);
Object result = inspector.getResult();
if (result instanceof IOException) {
throw (IOException)result;
} else if (result instanceof SDWPException) {
throw (SDWPException)result;
} else {
Assert.that(result == null);
}
}