-
Notifications
You must be signed in to change notification settings - Fork 54
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Exception exit support #91
base: master
Are you sure you want to change the base?
Conversation
Should have mentioned that this subsumes #56. That pull request will be deleted/closed as part of this work. |
…nto exception-exit-support
Still need upstream merge and doc changes.
still need to update doc files |
fix another blank at end of line in txt-jaif output
As we discussed, I have completed this work and it is ready for review. |
A few high-level questions:
Are these normal preconditions or overall preconditions? Is there a way to determine exceptional preconditions for a given :::EXCEPTION program point? The Daikon manual (section 5.2) doesn't mention EXCEPTIONUNCAUGHT program points, but it should. |
points. Typically, @code{orig()} variables do not appear in the trace, | ||
but are automatically created by Daikon when it matches up | ||
@code{:::ENTER} and @code{:::EXIT@var{nn}} program points. | ||
of @code{x}). These variables appear only at @code{:::EXIT} and |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please don't refill paragraphs (that is, don't remove line breaks). It makes the diffs bigger and harder to read.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here are some initial comments. Could you address these, and then I will do another round of code review?
One comment is that there seem to be some changes that are not directly related to handling exceptional exits. It would be nice to separate those into a second pull request, so that I can review the two pull requests separately.
Thanks!
* @return the exception name suffix for Daikon | ||
*/ | ||
private static String exceptionSuffix(int lineNum) { | ||
return lineNum < 0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could this be lineNum == -1
? That seems clearer to me.
java/daikon/PptTopLevel.java
Outdated
@@ -4405,6 +4405,19 @@ public boolean is_exit() { | |||
} | |||
} | |||
|
|||
// UNDONE: this doesn't look right |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does "UNDONE" mean "TODO"? I think the "UNDONE" comments should be clarified or removed, throughout.
java/daikon/chicory/Instrument.java
Outdated
@@ -388,7 +407,7 @@ private InstructionList call_initNotify( | |||
* Instrument all the methods in a class. For each method, add instrumentation code at the entry | |||
* and at each return from the method. In addition, changes each return statement to first place | |||
* the value being returned into a local and then return. This allows us to work around the JDI | |||
* deficiency of not being able to query return values. | |||
* deficiency of not being able to query return values. (We now instrument throws as well.) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please don't write comments like this. Years from now, people won't know when this comment was written or why it is relevant. Please describe the code, not the code's history.
java/daikon/chicory/Instrument.java
Outdated
* (return__$trace2_val) and then do the return. Also, calls Runtime.exit() immediately before the | ||
* return. | ||
* If this is a return instruction, generate new il to assign the result to a local variable | ||
* (return__$trace2_val) and then call Runtime.exit(). This il wil be inserted immediately before |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is confusing. It's not java.lang.Runtime.exit()
, nor daikon.Runtime
. I think it's what is in runtime_classname
. Clarifying that would be helpful.
@@ -130,6 +130,9 @@ | |||
@Option("Number of calls after which sampling will begin") | |||
public static int sample_start = 0; | |||
|
|||
@Option("Enable remote debug") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add a Javadoc comment, explaining what this does or how to use it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was added and used by Philipp Hirch. I do not know how to use it. Should I comment out or just delete?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not a new change -- it already existed, and he just moved it to be a command-line option.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see that now and presumably his changes made it work (better?). I get the jist of what this does and I think all the debug arguments are just magic. I will write up something.
java/daikon/VarInfo.java
Outdated
if (!name().contains("exception")) { | ||
return ("\\result"); | ||
} else { | ||
return ("Exception"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't use unnecessary parentheses around return statement values.
@@ -1,3 +1,5 @@ | |||
This directory tests Chicory command-line options. | |||
Each test runs Chicory and Daikon on the StackAr program, but each test | |||
uses a different set of command-line options. | |||
|
|||
The test suite has been augmented to cover the addition of exception exit ppts. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Delete this. It isn't helpful in the code -- it's just a code review comment, and as such it doesn't belong in the code.
/*@ requires \typeof(x) == \type(DataStructures.MyInteger); */ | ||
/*@ modifies this.root; */ | ||
/*@ ensures this.root != null; */ | ||
/*@ ensures \old(x) != null; */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is an odd change. I find the original line clearer and more intuitive than the new one.
Do you understand the cause of this change in output? What would it take to restore the behavior?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, I do not understand the cause of this change.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK, we need to understand this before we merge the change.
@@ -3,10 +3,10 @@ misc.Purity:::OBJECT | |||
Variables: this this.value this.shift this.heavy this.list1 this.list1[] this.list1[].getClass().getName() this.list2 this.list2[] this.list2[].getClass().getName() this.list2.getClass().getName() this.getValue() this.getShift() this.isHeavy() this.getNum() this.getNum().getClass().getName() this.getJWrap() this.scale(this.value) this.scale(this.shift) this.scale(this.getValue()) this.scale(this.getShift()) this.sum(this.getNum()) this.sum(this.getJWrap()) this.retrieve(this.list1) this.retrieve(this.list2) size(this.list1[]) size(this.list1[])-1 size(this.list2[]) size(this.list2[])-1 this.list1[this.value] this.list1[this.value-1] this.list1[this.value..] this.list1[this.value+1..] this.list1[0..this.value] this.list1[0..this.value-1] this.list2[this.value] this.list2[this.value-1] this.list2[this.value..] this.list2[this.value+1..] this.list2[0..this.value] this.list2[0..this.value-1] this.list1[this.shift] this.list1[this.shift-1] this.list1[this.shift..] this.list1[this.shift+1..] this.list1[0..this.shift] this.list1[0..this.shift-1] this.list2[this.shift] this.list2[this.shift-1] this.list2[this.shift..] this.list2[this.shift+1..] this.list2[0..this.shift] this.list2[0..this.shift-1] this.list1[this.getValue()] this.list1[this.getValue()-1] this.list1[this.getValue()..] this.list1[this.getValue()+1..] this.list1[0..this.getValue()] this.list1[0..this.getValue()-1] this.list1[this.getShift()] this.list1[this.getShift()-1] this.list1[this.getShift()..] this.list1[this.getShift()+1..] this.list1[0..this.getShift()] this.list1[0..this.getShift()-1] this.list1[this.scale(this.value)] this.list1[this.scale(this.value)-1] this.list1[this.scale(this.value)..] this.list1[this.scale(this.value)+1..] this.list1[0..this.scale(this.value)] this.list1[0..this.scale(this.value)-1] this.list1[this.scale(this.shift)] this.list1[this.scale(this.shift)-1] this.list1[this.scale(this.shift)..] this.list1[this.scale(this.shift)+1..] this.list1[0..this.scale(this.shift)] this.list1[0..this.scale(this.shift)-1] this.list1[this.scale(this.getValue())] this.list1[this.scale(this.getValue())-1] this.list1[this.scale(this.getValue())..] this.list1[this.scale(this.getValue())+1..] this.list1[0..this.scale(this.getValue())] this.list1[0..this.scale(this.getValue())-1] this.list1[this.scale(this.getShift())] this.list1[this.scale(this.getShift())-1] this.list1[this.scale(this.getShift())..] this.list1[this.scale(this.getShift())+1..] this.list1[0..this.scale(this.getShift())] this.list1[0..this.scale(this.getShift())-1] this.list1[this.sum(this.getNum())] this.list1[this.sum(this.getNum())-1] this.list1[this.sum(this.getNum())..] this.list1[this.sum(this.getNum())+1..] this.list1[0..this.sum(this.getNum())] this.list1[0..this.sum(this.getNum())-1] this.list1[this.sum(this.getJWrap())] this.list1[this.sum(this.getJWrap())-1] this.list1[this.sum(this.getJWrap())..] this.list1[this.sum(this.getJWrap())+1..] this.list1[0..this.sum(this.getJWrap())] this.list1[0..this.sum(this.getJWrap())-1] this.list1[this.retrieve(this.list1)] this.list1[this.retrieve(this.list1)-1] this.list1[this.retrieve(this.list1)..] this.list1[this.retrieve(this.list1)+1..] this.list1[0..this.retrieve(this.list1)] this.list1[0..this.retrieve(this.list1)-1] this.list1[this.retrieve(this.list2)] this.list1[this.retrieve(this.list2)-1] this.list1[this.retrieve(this.list2)..] this.list1[this.retrieve(this.list2)+1..] this.list1[0..this.retrieve(this.list2)] this.list1[0..this.retrieve(this.list2)-1] this.list2[this.getValue()] this.list2[this.getValue()-1] this.list2[this.getValue()..] this.list2[this.getValue()+1..] this.list2[0..this.getValue()] this.list2[0..this.getValue()-1] this.list2[this.getShift()] this.list2[this.getShift()-1] this.list2[this.getShift()..] this.list2[this.getShift()+1..] this.list2[0..this.getShift()] this.list2[0..this.getShift()-1] this.list2[this.scale(this.value)] this.list2[this.scale(this.value)-1] this.list2[this.scale(this.value)..] this.list2[this.scale(this.value)+1..] this.list2[0..this.scale(this.value)] this.list2[0..this.scale(this.value)-1] this.list2[this.scale(this.shift)] this.list2[this.scale(this.shift)-1] this.list2[this.scale(this.shift)..] this.list2[this.scale(this.shift)+1..] this.list2[0..this.scale(this.shift)] this.list2[0..this.scale(this.shift)-1] this.list2[this.scale(this.getValue())] this.list2[this.scale(this.getValue())-1] this.list2[this.scale(this.getValue())..] this.list2[this.scale(this.getValue())+1..] this.list2[0..this.scale(this.getValue())] this.list2[0..this.scale(this.getValue())-1] this.list2[this.scale(this.getShift())] this.list2[this.scale(this.getShift())-1] this.list2[this.scale(this.getShift())..] this.list2[this.scale(this.getShift())+1..] this.list2[0..this.scale(this.getShift())] this.list2[0..this.scale(this.getShift())-1] this.list2[this.sum(this.getNum())] this.list2[this.sum(this.getNum())-1] this.list2[this.sum(this.getNum())..] this.list2[this.sum(this.getNum())+1..] this.list2[0..this.sum(this.getNum())] this.list2[0..this.sum(this.getNum())-1] this.list2[this.sum(this.getJWrap())] this.list2[this.sum(this.getJWrap())-1] this.list2[this.sum(this.getJWrap())..] this.list2[this.sum(this.getJWrap())+1..] this.list2[0..this.sum(this.getJWrap())] this.list2[0..this.sum(this.getJWrap())-1] this.list2[this.retrieve(this.list1)] this.list2[this.retrieve(this.list1)-1] this.list2[this.retrieve(this.list1)..] this.list2[this.retrieve(this.list1)+1..] this.list2[0..this.retrieve(this.list1)] this.list2[0..this.retrieve(this.list1)-1] this.list2[this.retrieve(this.list2)] this.list2[this.retrieve(this.list2)-1] this.list2[this.retrieve(this.list2)..] this.list2[this.retrieve(this.list2)+1..] this.list2[0..this.retrieve(this.list2)] this.list2[0..this.retrieve(this.list2)-1] | |||
this.value == this.getValue() | |||
this.shift == this.getShift() | |||
this.shift == this.retrieve() | |||
this.shift == this.retrieve() | |||
this.shift == this.retrieve(this.list1) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What caused this change? If it's correct, was this a bug fix unrelated to the exceptional exit support, but in the same pull request? Or was it caused by a previously-committed change, but the goal files were not regenerated since then?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking at the history of this goal file, it appears this is a new change. I do not know what caused it.
tests/daikon-tests/Makefile
Outdated
@@ -41,12 +41,12 @@ everything-%: quick-% nonquick-% | |||
@echo ${HR} | |||
quick-%: SQD-% polycalc-% special-cases-% siemens-% | |||
@echo ${HR} | |||
nonquick-%: dsaa-% mapquick-% javautil-% 6170-% large-% new-% | |||
nonquick-%: dsaa-% mapquick-% javautil-% 6170-% large-% new-% newRar-% |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this name from the username of the author of the commit? Please use a better name, or eliminate it (and update line 69 below).
The build is failing, which indicates I broke something. Sorry about that. I'll look into it this evening. |
…nto exception-exit-support
I have completed an upstream merge of Philipp Hirch's changes to add exception exit ppts to chicory output files. I think there might be a little more common code in chicory/Instrument and dcomp/DCIstrument that can be merged, but that can wait until latter.