void report_distribution(unsigned int count, const char *name) { append_report(&distribution.remarks[TOP][count-1], "%s's votes distributed. ", name); append_report(&counting.count_descrip[BOTTOM][count-1], "NAC after %s", name); }
/* What previous count did these papers come from? */ void report_distrib_from_count(unsigned int count, unsigned int prev_count) { if (counting.count_descrip[TOP][count-1] == NULL) append_report(&counting.count_descrip[TOP][count-1], "On Papers at Count %u", prev_count); else append_report(&counting.count_descrip[TOP][count-1], ",%u", prev_count); }
static inline gchar *build_hint (SavedString *head) { SavedString *current; gchar *tmp; GString *hint = NULL; current = head; while (current) { tmp = build_hint_from_stack (current->domain, current->stack, current->stack_entries); current = current->next; if (!tmp) continue; append_report (&hint, tmp); } if (hint) { if (hint->len) return g_string_free (hint, FALSE); else { g_string_free (hint, FALSE); return NULL; } } return NULL; }
void report_majority(unsigned int count, unsigned int majority) { if (previous_count != count || previous_majority != majority) append_report(&distribution.remarks[BOTTOM][count-1], "Majority %u. ", majority); previous_count = count; previous_majority = majority; }
static inline gchar *build_hint_from_stack (MonoDomain *domain, void **stack, gint stack_entries) { gchar *hint; MonoMethod *method, *selectedMethod; MonoAssembly *assembly; MonoImage *image; MonoDebugSourceLocation *location; MonoStackBacktraceInfo *info; gboolean use_full_trace; char *methodName; gint i, native_offset, firstAvailable; selectedMethod = NULL; firstAvailable = -1; use_full_trace = FALSE; native_offset = -1; for (i = 0; i < stack_entries; i++) { info = (MonoStackBacktraceInfo*) stack [i]; method = info ? info->method : NULL; if (!method || method->wrapper_type != MONO_WRAPPER_NONE) continue; if (firstAvailable == -1) firstAvailable = i; image = method->klass->image; assembly = image->assembly; if ((assembly && assembly->in_gac) || ignore_frame (method)) continue; selectedMethod = method; native_offset = info->native_offset; break; } if (!selectedMethod) { /* All the frames were from assemblies installed in GAC. Find first frame that is * not in the ignore list */ for (i = 0; i < stack_entries; i++) { info = (MonoStackBacktraceInfo*) stack [i]; method = info ? info->method : NULL; if (!method || ignore_frame (method)) continue; selectedMethod = method; native_offset = info->native_offset; break; } if (!selectedMethod) use_full_trace = TRUE; } hint = NULL; if (use_full_trace) { GString *trace = g_string_new ("Full trace:\n"); for (i = firstAvailable; i < stack_entries; i++) { info = (MonoStackBacktraceInfo*) stack [i]; method = info ? info->method : NULL; if (!method || method->wrapper_type != MONO_WRAPPER_NONE) continue; location = mono_debug_lookup_source_location (method, info->native_offset, domain); methodName = mono_method_full_name (method, TRUE); if (location) { append_report (&trace, LOCATION_INDENT "%s in %s:%u\n", methodName, location->source_file, location->row); mono_debug_free_source_location (location); } else append_report (&trace, LOCATION_INDENT "%s\n", methodName); g_free (methodName); } if (trace) { if (trace->len) hint = g_string_free (trace, FALSE); else g_string_free (trace, TRUE); } } else { location = mono_debug_lookup_source_location (selectedMethod, native_offset, domain); methodName = mono_method_full_name (selectedMethod, TRUE); if (location) { hint = g_strdup_printf (LOCATION_INDENT "%s in %s:%u\n", methodName, location->source_file, location->row); mono_debug_free_source_location (location); } else hint = g_strdup_printf (LOCATION_INDENT "%s\n", methodName); g_free (methodName); } return hint; }
void report_fully_excluded(unsigned int count, const char *name) { append_report(&distribution.remarks[BOTTOM][count-1], "%s fully excluded. ", name); }
void report_tiebreak(unsigned int count, const char *reason, const char *name) { append_report(&distribution.remarks[BOTTOM][count-1], "%s chosen for %s tiebreak. ", name, reason); }
void report_pending(unsigned int count, const char *name) { append_report(&distribution.remarks[BOTTOM][count-1], " %s elected %u. ", name, get_order_elected()); }