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


Java VM.printAddress方法代码示例

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


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

示例1: getFunction0

import com.sun.squawk.VM; //导入方法依赖的package包/类
/**
 * Dynamically look up a native function address by name.
 * Look up the symbol in the specified library
 *
 * @param funcName
 * @return address of the function
 * @throws RuntimeException if there is no function by that name.
 */
private Address getFunction0(String funcName) {
    Address result = getSymbolAddress(funcName);
    if (DEBUG) {
        VM.print("Function Lookup for ");
        VM.print(funcName);
        VM.print(" = ");
        VM.printAddress(result);
        VM.println();
    }
    if (result.isZero()) {
        if (Platform.getPlatform().isWindows()) {
            if (funcName.charAt(funcName.length() - 1) != 'A') {
                return getFunction0(funcName + 'A');
            }
        } else if (funcName.charAt(0) != '_') {
            return getFunction0("_" + funcName);
        }
        throw new RuntimeException("Can't find native symbol " + funcName + ". OS Error: " + errorStr());
    }
    return result;
}
 
开发者ID:tomatsu,项目名称:squawk,代码行数:30,代码来源:NativeLibrary.java

示例2: getGlobalVariableAddress

import com.sun.squawk.VM; //导入方法依赖的package包/类
/**
 * Dynamically look up a native variable by name.
 * 
 * Look up the symbol in the default list of loaded libraries.
 * 
 * @param varName 
 * @param size the size of the variable in bytes
 * @return a Pointer that can be used to get/set the variable
 * @throws RuntimeException if there is no function by that name.
 */
public VarPointer getGlobalVariableAddress(String varName, int size) {
    Address result = getSymbolAddress(varName);
    if (DEBUG) {
        VM.print("Var Lookup for ");
        VM.print(varName);
        VM.print(", size: ");
        VM.print(size);
        VM.print(" returned ");
        VM.printAddress(result);
        VM.println();
    }
    if (result.isZero()) {
        if (varName.charAt(0) != '_') {
            return getGlobalVariableAddress("_" + varName, size);
        }
        throw new RuntimeException("Can't find native symbol " + varName + ". OS Error: " + errorStr());
    }
    return new VarPointer(varName, result, size);
}
 
开发者ID:tomatsu,项目名称:squawk,代码行数:30,代码来源:NativeLibrary.java

示例3: VMprintStruct

import com.sun.squawk.VM; //导入方法依赖的package包/类
/** Debug utility */
private void VMprintStruct() {
    VM.print("Structure(");
    VM.print(Klass.asKlass(getClass()).getInternalName());
    VM.print(" size: ");
    VM.print(size());
    if (backingNativeMemory == null) {
        VM.println(" memory never allocated)");
    } else {
        VM.print(" Pointer(");
        VM.printAddress(getPointer().address());
        VM.println("))");
    }
}
 
开发者ID:tomatsu,项目名称:squawk,代码行数:15,代码来源:Structure.java


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