本文整理汇总了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;
}
示例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);
}
示例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("))");
}
}