From: pcm <pcm...@us...> - 2005-06-09 19:55:10
|
Update of /cvsroot/javapathfinder/javapathfinder/src/gov/nasa/jpf/jvm In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14410/src/gov/nasa/jpf/jvm Modified Files: Step.java Log Message: trying a bit harder in case we don't have sources. It now prints out at least what sources are missing. Note that there is still the vm.report.show_missing_lines, which goes beyond that by printing executed insns (too many options, <sigh>) Index: Step.java =================================================================== RCS file: /cvsroot/javapathfinder/javapathfinder/src/gov/nasa/jpf/jvm/Step.java,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -d -r1.1.1.1 -r1.2 --- Step.java 26 Apr 2005 19:44:05 -0000 1.1.1.1 +++ Step.java 9 Jun 2005 19:54:54 -0000 1.2 @@ -88,24 +88,27 @@ public String getComment () { return comment; } - + public void printStepOn (PrintWriter pw, SourceRef lastPrinted, String prefix) { Source source = Source.getSource(fileName); boolean isLineMissing = source.isLineMissing(line); if (!this.equals(lastPrinted)) { if (!isLineMissing) { - lastPrinted.set(this); - - if (prefix != null) { - pw.print( prefix); - } else { - pw.print(" "); - } + pw.print( (prefix != null) ? prefix : " "); pw.print(Left.format(fileName + ":" + line, 20)); pw.print(' '); - pw.println(source.getLine(line)); + pw.println(source.getLine(line)); + } else { + if (!fileName.equals(lastPrinted.getFileName()) && !showMissingLines) { + pw.print( (prefix != null) ? prefix : " "); + pw.print("[no source for: "); + pw.print(fileName); + pw.println(']'); + } } + + lastPrinted.set(this); } if (showBytecode || (showMissingLines && isLineMissing) ) { @@ -117,11 +120,11 @@ pw.println(insn); } } - + if (comment != null) { pw.print(" // "); pw.println(comment); - } + } } public void toXML (PrintWriter pw) { |