static MonoTraceSpec trace_spec;
+gboolean
+mono_trace_eval_exception (MonoClass *klass)
+{
+ int include = 0;
+ int i;
+
+ if (!klass)
+ return FALSE;
+
+ for (i = 0; i < trace_spec.len; i++) {
+ MonoTraceOperation *op = &trace_spec.ops [i];
+ int inc = 0;
+
+ switch (op->op){
+ case MONO_TRACEOP_EXCEPTION:
+ if (strcmp ("", op->data) == 0 && strcmp ("all", op->data2) == 0)
+ inc = 1;
+ else if (strcmp ("", op->data) == 0 || strcmp (klass->name_space, op->data) == 0)
+ if (strcmp (klass->name, op->data2) == 0)
+ inc = 1;
+ break;
+ default:
+ break;
+ }
+ if (op->exclude){
+ if (inc)
+ include = 0;
+ } else if (inc)
+ include = 1;
+ }
+
+ return include;
+}
+
gboolean
mono_trace_eval (MonoMethod *method)
{
case MONO_TRACEOP_NAMESPACE:
if (strcmp (method->klass->name_space, op->data) == 0)
inc = 1;
+ case MONO_TRACEOP_EXCEPTION:
+ break;
}
if (op->exclude){
if (inc)
TOKEN_CLASS,
TOKEN_ALL,
TOKEN_PROGRAM,
+ TOKEN_EXCEPTION,
TOKEN_NAMESPACE,
TOKEN_STRING,
TOKEN_EXCLUDE,
get_string ();
return TOKEN_CLASS;
}
+ if (input [0] == 'E' && input [1] == ':'){
+ input += 2;
+ get_string ();
+ return TOKEN_EXCEPTION;
+ }
if (*input == '-'){
input++;
return TOKEN_EXCLUDE;
else if (token == TOKEN_NAMESPACE){
trace_spec.ops [*last].op = MONO_TRACEOP_NAMESPACE;
trace_spec.ops [*last].data = g_strdup (value);
- } else if (token == TOKEN_CLASS){
+ } else if (token == TOKEN_CLASS || token == TOKEN_EXCEPTION){
char *p = strrchr (value, '.');
if (p) {
*p++ = 0;
trace_spec.ops [*last].data = g_strdup ("");
trace_spec.ops [*last].data2 = g_strdup (value);
}
- trace_spec.ops [*last].op = MONO_TRACEOP_CLASS;
+ trace_spec.ops [*last].op = token == TOKEN_CLASS ? MONO_TRACEOP_CLASS : MONO_TRACEOP_EXCEPTION;
} else if (token == TOKEN_STRING){
trace_spec.ops [*last].op = MONO_TRACEOP_ASSEMBLY;
trace_spec.ops [*last].data = g_strdup (value);
{
return trace_spec.enabled;
}
-