本文整理汇总了Java中gov.nasa.jpf.vm.Step类的典型用法代码示例。如果您正苦于以下问题:Java Step类的具体用法?Java Step怎么用?Java Step使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
Step类属于gov.nasa.jpf.vm包,在下文中一共展示了Step类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: setComment
import gov.nasa.jpf.vm.Step; //导入依赖的package包/类
private final void setComment(VM vm, ThreadInfo ti, String name, String operator, String value, boolean pending) {
Step step;
String comment;
if (name == null)
return;
if (value == null)
return;
comment = name + operator + value;
if (pending) {
pendingComment.put(ti, comment);
} else {
step = vm.getLastStep();
step.setComment(name + operator + value);
}
}
示例2: makeGdfLabel
import gov.nasa.jpf.vm.Step; //导入依赖的package包/类
/**
* Return the string that will be used to label this state in the GDF graph.
*/
private String makeGdfLabel(Search state, int my_id) {
Transition trans = state.getTransition();
if (trans == null) {
return "-init-";
}
StringBuilder result = new StringBuilder();
if (transition_numbers) {
result.append(my_id);
result.append(':');
}
Step last_trans_step = trans.getLastStep();
result.append(last_trans_step.toString());
if (show_source) {
String source_line=last_trans_step.getLineString();
if ((source_line != null) && !source_line.equals("")) {
// We need to deal with gdf-specific special characters which couls appear
// in the Java source line, such as '"'.
result.append(source_line);
convertGdfSpecial(result);
}
}
return result.toString();
}
示例3: publishTrace
import gov.nasa.jpf.vm.Step; //导入依赖的package包/类
@Override
protected void publishTrace() {
Path path = reporter.getPath();
int i=0;
if (path.size() == 0) {
return; // nothing to publish
}
out.println(" <trace>");
for (Transition t : path) {
ChoiceGenerator<?> cg = t.getChoiceGenerator();
out.println(" <transition id=\"" + i++ + "\" thread=\"" + t.getThreadIndex() + "\">");
out.println(" <cg class=\""+cg.getClass().getName() + "\" choice=\"" +
cg.getProcessedNumberOfChoices() + "\"/>");
for (Step s : t) {
out.print(" <insn src=\"" + s.getLocationString() + "\">");
String insn = s.getInstruction().toString();
if (insn.indexOf('<') >= 0) { // <init> and <clinit> clash with XML
insn = insn.replaceAll("<", "<");
insn = insn.replaceAll(">", ">");
}
out.print(insn);
out.println("</insn>");
}
out.println(" </transition>");
}
out.println(" </trace>");
}
示例4: makeDotLabel
import gov.nasa.jpf.vm.Step; //导入依赖的package包/类
/**
* Return the string that will be used to label this state for the user.
*/
private String makeDotLabel(Search state, int my_id) {
Transition trans = state.getTransition();
if (trans == null) {
return "-init-";
}
Step last_trans_step = trans.getLastStep();
if (last_trans_step == null) {
return "?";
}
StringBuilder result = new StringBuilder();
if (transition_numbers) {
result.append(my_id);
result.append("\\n");
}
int thread = trans.getThreadIndex();
result.append("Thd");
result.append(thread);
result.append(':');
result.append(last_trans_step.toString());
if (show_source) {
String source_line=last_trans_step.getLineString();
if ((source_line != null) && !source_line.equals("")) {
result.append("\\n");
StringBuilder sb=new StringBuilder(source_line);
// We need to precede the dot-specific special characters which appear
// in the Java source line, such as ']' and '"', with the '\' escape
// characters and also to remove any new lines.
replaceString(sb, "\n", "");
replaceString(sb, "]", "\\]");
replaceString(sb, "\"", "\\\"");
result.append(sb.toString());
}
}
return result.toString();
}
示例5: publishTrace
import gov.nasa.jpf.vm.Step; //导入依赖的package包/类
/**
* this is done as part of the property violation reporting, i.e.
* we have an error
*/
@Override
protected void publishTrace() {
Path path = reporter.getPath();
int i=0;
if (path.size() == 0) {
return; // nothing to publish
}
publishTopicStart("trace " + reporter.getCurrentErrorId());
for (Transition t : path) {
out.print("------------------------------------------------------ ");
out.println("transition #" + i++ + " thread: " + t.getThreadIndex());
if (showCG){
out.println(t.getChoiceGenerator());
}
if (showSteps) {
String lastLine = null;
MethodInfo lastMi = null;
int nNoSrc=0;
for (Step s : t) {
if (showSource) {
String line = s.getLineString();
if (line != null) {
if (!line.equals(lastLine)) {
if (nNoSrc > 0){
out.println(" [" + nNoSrc + " insn w/o sources]");
}
out.print(" ");
if (showLocation) {
out.print(Left.format(s.getLocationString(),30));
out.print(" : ");
}
out.println(line.trim());
nNoSrc = 0;
}
} else { // no source
nNoSrc++;
}
lastLine = line;
}
if (showCode) {
Instruction insn = s.getInstruction();
if (showMethod){
MethodInfo mi = insn.getMethodInfo();
if (mi != lastMi) {
ClassInfo mci = mi.getClassInfo();
out.print(" ");
if (mci != null) {
out.print(mci.getName());
out.print(".");
}
out.println(mi.getUniqueName());
lastMi = mi;
}
}
out.print(" ");
out.println(insn);
}
}
if (showSource && !showCode && (nNoSrc > 0)) {
out.println(" [" + nNoSrc + " insn w/o sources]");
}
}
}
}