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


Java DebuggerSupport.setStaticLong方法代码示例

本文整理汇总了Java中com.sun.squawk.DebuggerSupport.setStaticLong方法的典型用法代码示例。如果您正苦于以下问题:Java DebuggerSupport.setStaticLong方法的具体用法?Java DebuggerSupport.setStaticLong怎么用?Java DebuggerSupport.setStaticLong使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.sun.squawk.DebuggerSupport的用法示例。


在下文中一共展示了DebuggerSupport.setStaticLong方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: SetValues

import com.sun.squawk.DebuggerSupport; //导入方法依赖的package包/类
/**
 * Implements <a href="http://java.sun.com/j2se/1.5.0/docs/guide/jpda/jdwp/jdwp-protocol.html#JDWP_ClassType_SetValues">SetValues</a>
 * Proxy adds fields types so we can do type checking of reference fields....
 */
private void SetValues(Klass klass) throws SDWPException, IOException {
    Isolate isolate = sda.getDebuggeeIsolate();
    int count = in.readInt("values");

    for (int i = 0; i < count; i++) {
        FieldID fieldID = in.readFieldID("fieldID");
        accessCheck(klass, fieldID, true);
        Klass definingClass = sda.getClassForID(fieldID.definingClass, JDWP.Error_INVALID_CLASS);
        int offset = fieldID.getOffset();
        byte tag = fieldID.getTag();

        if (Log.verbose()) {
            Log.log("    static field in " + klass + " of type " + (char) tag + " at offset " + offset);
        }
        // This should only occur if the proxy did not intercept a constant field or
        // it did not mask a global field from the debugger
        Assert.that(offset < definingClass.getStaticFieldsSize(), "field offset is out of range");

        ReferenceTypeID fieldTypeID = in.readReferenceTypeID("fieldType");
        Klass fieldTypeKlass = sda.getClassForID(fieldTypeID, JDWP.Error_INVALID_CLASS);
    
        switch (tag) {
            case JDWP.Tag_BYTE:
            case JDWP.Tag_BOOLEAN:
                DebuggerSupport.setStaticInt(isolate,  definingClass, offset, in.readByte("untagged value"));
                break;
            case JDWP.Tag_CHAR:
            case JDWP.Tag_SHORT:
                DebuggerSupport.setStaticInt(isolate,  definingClass, offset, in.readShort("untagged value"));
                break;
            case JDWP.Tag_INT:
            case JDWP.Tag_FLOAT:
                DebuggerSupport.setStaticInt(isolate,  definingClass, offset, in.readInt("untagged value"));
                break;
            case JDWP.Tag_LONG:
            case JDWP.Tag_DOUBLE:
                DebuggerSupport.setStaticLong(isolate, definingClass, offset, in.readLong("untagged value"));
                break;
            case JDWP.Tag_OBJECT:
            case JDWP.Tag_STRING:
            case JDWP.Tag_THREAD:
            case JDWP.Tag_CLASS_OBJECT:
            case JDWP.Tag_ARRAY: {
                ObjectID valueID = in.readObjectID("untagged value");
                Object value = sda.getObjectManager().getObjectForID(valueID);
                typeCheck(value, fieldTypeKlass);
                DebuggerSupport.setStaticOop(isolate, definingClass, offset, value);
                break;
            }
            default:
                Assert.shouldNotReachHere();
        }
    }
    
}
 
开发者ID:tomatsu,项目名称:squawk,代码行数:60,代码来源:SDPListener.java


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