当前位置: 首页>>代码示例>>Java>>正文


Java DebuggerSupport.getDefiningClass方法代码示例

本文整理汇总了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);
    }
}
 
开发者ID:tomatsu,项目名称:squawk,代码行数:59,代码来源:SDPListener.java



注:本文中的com.sun.squawk.DebuggerSupport.getDefiningClass方法示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。