Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 0 additions & 7 deletions mono/metadata/unity-utils.c
Original file line number Diff line number Diff line change
Expand Up @@ -1098,13 +1098,6 @@ mono_unity_domain_set_config (MonoDomain *domain, const char *base_dir, const ch
mono_domain_set_config (domain, base_dir, config_file_name);
}

// only needed on OSX
MONO_API int
mono_unity_backtrace_from_context (void* context, void* array[], int count)
{
return 0;
}

MONO_API MonoException*
mono_unity_loader_get_last_error_and_error_prepare_exception ()
{
Expand Down
27 changes: 27 additions & 0 deletions mono/mini/mini-exceptions.c
Original file line number Diff line number Diff line change
Expand Up @@ -2712,6 +2712,33 @@ static void print_process_map (void)

static gboolean handle_crash_loop = FALSE;

MONO_API int
mono_unity_backtrace_from_context (void* context, void* array[], int count)
{
#ifdef MONO_ARCH_HAVE_SIGCTX_TO_MONOCTX
MonoContext mctx;
void* ip = 0;
void** bp = 0;
int idx = 0;

mono_sigctx_to_monoctx(context, &mctx);

ip = (void*)MONO_CONTEXT_GET_IP(&mctx);
bp = (void**)MONO_CONTEXT_GET_BP(&mctx);

while(ip && bp && count-- > 0)
{
array[idx++] = ip;

ip = bp[1];
bp = (void**)bp[0];
}

return idx;
#else
return 0;
#endif
}
/*
* mono_handle_native_crash:
*
Expand Down