void mono_merp_invoke (const intptr_t crashed_pid, const char *signal, const char *dump_file, MonoStackHash *hashes, char *version) { MERPStruct merp; memset (&merp, 0, sizeof (merp)); mono_init_merp (crashed_pid, signal, hashes, &merp, version); GString *output = g_string_new (""); mono_encode_merp (output, &merp); mono_merp_send (output->str, dump_file); g_string_free (output, TRUE); }
// Returns success gboolean mono_merp_invoke (const intptr_t crashed_pid, const char *signal, const char *non_param_data, MonoStackHash *hashes) { MonoStateMem mem; int merp_tmp_file_tag = 2; gboolean alloc_success = mono_state_alloc_mem (&mem, merp_tmp_file_tag, sizeof (MERPStruct)); if (!alloc_success) return FALSE; MERPStruct *merp = (MERPStruct *) mem.mem; memset (merp, 0, sizeof (*merp)); mono_summarize_timeline_phase_log (MonoSummaryMerpWriter); mono_init_merp (crashed_pid, signal, hashes, merp); if (!mono_merp_write_params (merp)) return FALSE; if (!mono_merp_write_fingerprint_payload (non_param_data, merp)) return FALSE; if (!mono_write_wer_template (merp)) return FALSE; // Start program mono_summarize_timeline_phase_log (MonoSummaryMerpInvoke); gboolean success = mono_merp_send (merp); if (success) mono_summarize_timeline_phase_log (MonoSummaryCleanup); mono_state_free_mem (&mem); return success; }