-
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
Feature exception handling #56
base: master
Are you sure you want to change the base?
Changes from all commits
7b10337
ecc06dd
acb8440
9abd847
9af7d51
630bcce
439b2e9
4f89516
f4d3071
cce95a8
bdffdc4
516adde
12c6ed7
d01faa0
bb37a2f
0f26406
e8355f5
351a95a
d7e3d92
4e37beb
f62fa73
7397370
297304e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
[![Build Status](https://travis-ci.org/rarworld/daikon.svg?branch=FeatureExceptionHandling)](https://travis-ci.org/rarworld/daikon) | ||
|
||
This is the distribution of a fork of the Daikon invariant detector, | ||
based on Daikon version 5.3.3, released May 2, 2016. | ||
Daikon version 5.3.3.1_rar, released Mai 24, 2016 | ||
|
||
If you are working with a Daikon distribution downloaded from the Daikon | ||
website, then most everything is setup and ready to go. See the 'doc' | ||
subdirectory for additional information, including installation instructions. | ||
You should start out with the file: | ||
doc/index.html | ||
The documentation also appears on the Daikon homepage: | ||
http://plse.cs.washington.edu/daikon/ | ||
|
||
If you are working with source cloned from the source code repository | ||
https://github.com/codespecs/daikon, then please review the file | ||
README.source. |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -114,7 +114,8 @@ public static void main(String[] args) throws IOException { | |
// static method can be identified because it will not have the OBJECT | ||
// point as a parent. | ||
for (PptTopLevel ppt : ppts.pptIterable()) { | ||
if (!ppt.is_combined_exit() || !is_static_method(ppt)) continue; | ||
if (!ppt.is_combined_exit() || !ppt.is_combined_exception() || !is_static_method(ppt)) | ||
continue; | ||
|
||
String name = ppt.name().replaceFirst("[(].*$", ""); | ||
int lastdot = name.lastIndexOf('.'); | ||
|
@@ -424,6 +425,14 @@ public static String jvm_signature(PptTopLevel ppt) { | |
"signature") // application invariant: returnVar.type.toString() is a binary name (if returnVar is non-null), because we are processing a Java program | ||
String returnType = | ||
returnVar == null ? "V" : UtilMDE.binaryNameToFieldDescriptor(returnVar.type.toString()); | ||
// Or an throw point | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Nit: "an throw" should be "a throw". |
||
if (returnVar == null) { | ||
returnVar = ppt.find_var_by_name("exception"); | ||
returnType = | ||
returnVar == null | ||
? "V" | ||
: "V throws " + UtilMDE.binaryNameToFieldDescriptor(returnVar.type.toString()); | ||
} | ||
|
||
return method + UtilMDE.arglistToJvm(java_args) + returnType; | ||
} | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -113,6 +113,12 @@ public class Chicory { | |
@Option("Number of calls after which sampling will begin") | ||
public static int sample_start = 0; | ||
|
||
@Option("Should Exception Handling be taken care of?") | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please make the documentation of this option more explicit. "taken care of" won't be clear to readers. |
||
public static boolean exception_handling = false; | ||
|
||
@Option("Enable remote debug") | ||
public static boolean remote_debug = false; | ||
|
||
/** | ||
* Daikon port number. Daikon writes this to stdout when it is started | ||
* in online mode. | ||
|
@@ -138,8 +144,6 @@ public class Chicory { | |
/** flag to use if we want to turn on the static initialization checks **/ | ||
public static final boolean checkStaticInit = true; | ||
|
||
private static final boolean RemoteDebug = false; | ||
|
||
/** Flag to initiate a purity analysis and use results to create add vars **/ | ||
private static boolean purityAnalysis = false; | ||
|
||
|
@@ -338,9 +342,10 @@ void start_target(String premain_args, String[] target_args) { | |
List<String> cmdlist = new ArrayList<String>(); | ||
cmdlist.add("java"); | ||
|
||
if (RemoteDebug) { | ||
if (remote_debug) { | ||
//-Xdebug -Xrunjdwp:server=y,transport=dt_socket,address=4142,suspend=n | ||
cmdlist.add("-Xdebug -Xrunjdwp:server=n,transport=dt_socket,address=8000,suspend=y"); | ||
cmdlist.add("-agentlib:jdwp=transport=dt_socket,server=y,address=8000,suspend=y"); | ||
//cmdlist.add("-Xdebug -Xrunjdwp:server=n,transport=dt_socket,address=8000,suspend=y"); | ||
//cmdlist.add("-Xdebug -Xnoagent -Xrunjdwp:transport=dt_socket,server=n,suspend=n,address=8000 -Djava.compiler=NONE"); | ||
} | ||
|
||
|
@@ -465,6 +470,11 @@ public void runDaikon() { | |
dtrace_file); | ||
} | ||
|
||
if (remote_debug) { | ||
cmdstr = | ||
cmdstr.replace( | ||
"java", "java -agentlib:jdwp=transport=dt_socket,server=y,address=8001,suspend=y"); | ||
} | ||
//System.out.println("daikon command is " + daikon_cmd); | ||
//System.out.println("daikon command cmdstr " + cmdstr); | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -48,8 +48,12 @@ private FileIO() { | |
// a number may follow it. | ||
public static final String exit_suffix = "EXIT"; | ||
public static final String exit_tag = ppt_tag_separator + exit_suffix; | ||
public static final String throw_suffix = "THROW"; | ||
public static final String throw_tag = ppt_tag_separator + throw_suffix; | ||
public static final String throws_suffix = "THROWS"; | ||
public static final String throws_tag = ppt_tag_separator + throws_suffix; | ||
public static final String exception_suffix = "THROWSCOMBINED"; | ||
public static final String exception_tag = ppt_tag_separator + exception_suffix; | ||
public static final String object_suffix = "OBJECT"; | ||
public static final String object_tag = ppt_tag_separator + object_suffix; | ||
public static final String class_static_suffix = "CLASS"; | ||
|
@@ -1041,8 +1045,8 @@ private static void warn_if_hierarchy_mismatch(PptMap all_ppts) { | |
for (PptTopLevel ppt_top_level : all_ppts.ppt_all_iterable()) { | ||
boolean is_program_point = | ||
(ppt_top_level.ppt_name.isExitPoint() | ||
|| ppt_top_level.ppt_name.isExceptionPoint() | ||
|| ppt_top_level.ppt_name.isEnterPoint() | ||
|| ppt_top_level.ppt_name.isThrowsPoint() | ||
|| ppt_top_level.ppt_name.isObjectInstanceSynthetic() | ||
|| ppt_top_level.ppt_name.isClassStaticSynthetic() | ||
|| ppt_top_level.ppt_name.isGlobalPoint()); | ||
|
@@ -1773,9 +1777,9 @@ public static void process_sample( | |
// and :::CLASS program points. This scheme ensures that arbitrarly | ||
// named program points such as :::POINT (used by convertcsv.pl) | ||
// will be treated as leaves. | ||
// Throws is a LEAF now, like Exit_nn | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. "now" isn't necessary. Why is "LEAF" capitalized? |
||
|
||
if (ppt.ppt_name.isEnterPoint() | ||
|| ppt.ppt_name.isThrowsPoint() | ||
|| ppt.ppt_name.isObjectInstanceSynthetic() | ||
|| ppt.ppt_name.isClassStaticSynthetic() | ||
|| ppt.ppt_name.isGlobalPoint()) { | ||
|
@@ -1787,6 +1791,12 @@ public static void process_sample( | |
throw new RuntimeException( | ||
"Bad program point name " + ppt.name + " is a combined exit point name"); | ||
} | ||
|
||
if (ppt.ppt_name.isExceptionPoint() && ppt.ppt_name.isCombinedThrowPoint()) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The lack of parallelism between the names "isExceptionPoint()" and "isCombinedThrowPoint()" is confusing. Please use the same term, either "Exception" or "Throw", in both. |
||
// not Daikon.TerminationMessage; caller has more info (e.g., filename) | ||
throw new RuntimeException( | ||
"Bad program point name " + ppt.name + " is a combined exception point name"); | ||
} | ||
} | ||
|
||
// Add derived variables | ||
|
@@ -2224,7 +2234,7 @@ public static boolean compute_orig_variables( | |
return false; | ||
} | ||
|
||
if (ppt.ppt_name.isExitPoint() || ppt.ppt_name.isThrowsPoint()) { | ||
if (ppt.ppt_name.isExitPoint() || ppt.ppt_name.isExceptionPoint()) { | ||
Invocation invoc; | ||
// Set invoc | ||
{ | ||
|
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.
Request: please do not re-fill paragraphs. When you refill a paragraph, it changes many lines in the diff, making it hard to determine what real changes you made. It doesn't matter if the .texinfo file (which will be processed by Texinfo to make the manual) doesn't have perfectly filled paragraphs, because only developers will read it -- and those developers will care more that the diffs are small and easy to read.
Could you please un-fill the paragraphs that you reformatted?