|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
ObjectDebug
public class Debug
Debug class used with the logger to create standardized output. It can be setup to track combinations of classes, program points, and variables. The most common class to track is an invariant, but any class can be used. This allows detailed information about a particular class/ppt/variable combination to be printed without getting lost in a mass of other information (which is a particular problem in Daikon due to the volume of data considered). Note that each of the three items (class, ppt, variable) must match in order for a print to occur.
| Field Summary | |
|---|---|
Class<?> |
cache_class
cached class |
boolean |
cache_match
True if the cached variables are printable. |
Ppt |
cache_ppt
cached ppt |
VarInfo[] |
cache_vis
cached variables |
static Logger |
debugTrack
Debug Logger. |
static String[] |
debugTrackClass
List of classes for logging. |
static String[] |
debugTrackPpt
List of Ppts for logging. |
static String[][] |
debugTrackVars
List of variable names for logging. |
static boolean |
dkconfig_logDetail
Determines whether or not detailed info (such as from add_modified) is printed. |
static boolean |
dkconfig_showTraceback
Determines whether or not traceback information is printed for each call to log. |
static String |
function_binary_method
Restrict function binary prints to the specified method. |
| Constructor Summary | |
|---|---|
Debug(Class<?> c,
Ppt ppt,
List<VarInfo> vis)
Sets up the cache for c, ppt, and whatever variable (if any) from vis that is on the debugTrackVar list. |
|
Debug(Class<?> c,
Ppt ppt,
VarInfo[] vis)
Sets the cache for class, ppt, and vis so that future calls to log don't have to set them. |
|
| Method Summary | |
|---|---|
static String |
add_track(String def)
Parses the specified argument to --track and sets up the track arrays accordingly. |
static void |
check(PptMap all_ppts,
String msg)
Looks through entire ppt tree and checks for any items we are interested in. |
static boolean |
class_match(Class<?> inv_class)
Returns whether or not the specified class matches the classes being tracked |
static String |
int_vars(PptTopLevel ppt,
ValueTuple vt)
Returns a string containing the integer variables and their values |
static boolean |
log(Class<?> inv_class,
Ppt ppt,
String msg)
Logs a description of the class, ppt, ppt variables and the specified msg via the logger as described in log(Logger, Class, Ppt, VarInfo[], String). |
static boolean |
log(Class<?> inv_class,
Ppt ppt,
VarInfo[] vis,
String msg)
Logs a description of the class, ppt, variables and the specified msg via the logger as described in log(Logger,
Class, Ppt, String). |
static void |
log(Logger debug,
Class<?> inv_class,
Ppt ppt,
String msg)
Logs a description of the class, ppt, ppt variables and the specified msg via the logger as described in log(Logger, Class, Ppt, VarInfo[], String). |
static void |
log(Logger debug,
Class<?> inv_class,
Ppt ppt,
VarInfo[] vis,
String msg)
Logs a description of the class, ppt, variables and the specified msg via the logger. |
void |
log(Logger debug,
String msg)
Logs the cached class, cached ppt, cached variables and the specified msg via the logger as described in log(Logger, Class, Ppt, VarInfo[], String). |
boolean |
log(String msg)
Logs a description of the cached class, ppt, and variables and the specified msg via the logger as described in log(Logger, Class, Ppt, VarInfo[], String) |
static boolean |
logDetail()
Returns whether or not detailed logging is on. |
static boolean |
logOn()
Returns whether or not logging is on. |
static Debug |
newDebug(Class<?> c,
Ppt ppt,
VarInfo[] vis)
Returns a Debug object if the specified class, ppt, and vis match what is being tracked. |
static boolean |
ppt_match(Ppt ppt)
Returns whether onot the specified ppt matches the ppts being tracked |
static String |
related_vars(PptTopLevel ppt,
ValueTuple vt)
Returns a string containing the variable values for any variables that are currently being tracked in ppt. |
static String |
toString(Object val)
|
static String |
toString(VarInfo[] vis)
|
static String |
toString(VarInfo[] vis,
ValueTuple vt)
Returns a string containing each variable and its value The string is of the form v1 = val1: v2 = val2, etc. |
static boolean |
var_match(VarInfo[] vis)
Returns whether or not the specified vars match the ones being tracked. |
static VarInfo[] |
vis(VarInfo v1)
|
static VarInfo[] |
vis(VarInfo v1,
VarInfo v2)
|
static VarInfo[] |
vis(VarInfo v1,
VarInfo v2,
VarInfo v3)
|
VarInfo |
visTracked(List<VarInfo> vis)
Looks for each of the variables in vis in the DebugTrackVar list. |
| Methods inherited from class Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final Logger debugTrack
public static String[] debugTrackClass
log(Logger, Class, Ppt, String)public static String function_binary_method
public static String[] debugTrackPpt
log(Logger, Class, Ppt, String)public static String[][] debugTrackVars
log(Logger, Class, Ppt, String)public boolean cache_match
public Class<?> cache_class
public Ppt cache_ppt
public VarInfo[] cache_vis
public static boolean dkconfig_showTraceback
log(Logger, Class, Ppt, String)public static boolean dkconfig_logDetail
add_modified) is printed.
log(Logger, Class, Ppt, String),
logDetail()| Constructor Detail |
|---|
public Debug(Class<?> c,
Ppt ppt,
VarInfo[] vis)
public Debug(Class<?> c,
Ppt ppt,
List<VarInfo> vis)
| Method Detail |
|---|
public static Debug newDebug(Class<?> c,
Ppt ppt,
VarInfo[] vis)
public VarInfo visTracked(List<VarInfo> vis)
public static VarInfo[] vis(VarInfo v1)
public static VarInfo[] vis(VarInfo v1,
VarInfo v2)
public static VarInfo[] vis(VarInfo v1,
VarInfo v2,
VarInfo v3)
public static final boolean logDetail()
log(Logger, Class, Ppt, String),
logOn()public static final boolean logOn()
log(Logger, Class, Ppt, String)
public void log(Logger debug,
String msg)
log(Logger, Class, Ppt, VarInfo[], String).
public static void log(Logger debug,
Class<?> inv_class,
Ppt ppt,
String msg)
log(Logger, Class, Ppt, VarInfo[], String).
public static void log(Logger debug,
Class<?> inv_class,
Ppt ppt,
VarInfo[] vis,
String msg)
debugTrackClass,
debugTrackPpt, and debugTrackVars. Only
those that match are printed. Variables will match if they are
in the same equality set. The information is written as:
class: ppt : var1 : var2 : var3 : msg
Note that if debugTrack is not enabled then
nothing is printed. It is somewhat faster to check logOn()
directly rather than relying on the check here.
Other versions of this method (noted below) work without the Logger parameter and take class, ppt, and vis from the cached values
debug - A second Logger to query if debug tracking is turned
off or does not match. If this logger is
enabled, the same information will be written
to it. Note that the information is never
written to both loggers.inv_class - The class. Can be obtained in a static context
by ClassName.classppt - Program pointvis - Variables at the program point. These are sometimes
different from the ones in the ppt itself.msg - String message to loglogOn(),
logDetail(),
log(Class, Ppt, VarInfo[], String),
log(Class, Ppt, String),
log(Logger, String),
log(String)public boolean log(String msg)
log(Logger, Class, Ppt, VarInfo[], String)
public static boolean log(Class<?> inv_class,
Ppt ppt,
String msg)
log(Logger, Class, Ppt, VarInfo[], String).
public static boolean log(Class<?> inv_class,
Ppt ppt,
VarInfo[] vis,
String msg)
log(Logger,
Class, Ppt, String). Accepts vis because sometimes the
variables are different from those in the ppt.
public static boolean class_match(Class<?> inv_class)
public static boolean ppt_match(Ppt ppt)
public static boolean var_match(VarInfo[] vis)
public static void check(PptMap all_ppts,
String msg)
public static String int_vars(PptTopLevel ppt,
ValueTuple vt)
public static String related_vars(PptTopLevel ppt,
ValueTuple vt)
public static String toString(Object val)
public static String toString(VarInfo[] vis)
public static String toString(VarInfo[] vis,
ValueTuple vt)
public static String add_track(String def)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||