From: Thays Grazia Date: Sun, 22 Sep 2019 19:12:10 +0000 (-0300) Subject: [debugger] Crash when debugging iOS application that throws (mono/mono#16958) X-Git-Tag: submit/tizen/20210909.063632~10331^2~5^2~462 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=c6265beb579ce254c4f1219cd5b6126dcd9c4b3d;p=platform%2Fupstream%2Fdotnet%2Fruntime.git [debugger] Crash when debugging iOS application that throws (mono/mono#16958) * Doing the same fix from Android to IOS. * On mini-exceptions.c check if there is no ji we can continue and generate the exception without checking wrapper_type. Fixes mono/mono#16824 Commit migrated from https://github.com/mono/mono/commit/1a277c31a095a1b5b8212ed6c0425fad7bb4a42b --- diff --git a/src/mono/mono/mini/debugger-engine.c b/src/mono/mono/mini/debugger-engine.c index 41bc23c..fc5624c 100644 --- a/src/mono/mono/mini/debugger-engine.c +++ b/src/mono/mono/mini/debugger-engine.c @@ -1277,11 +1277,9 @@ mono_de_ss_start (SingleStepReq *ss_req, SingleStepArgs *ss_args) int nframes = ss_args->nframes; SeqPoint *sp = &ss_args->sp; -#if defined(HOST_ANDROID) || defined(TARGET_ANDROID) - /* this can happen on a single step in a exception on android (Mono_UnhandledException_internal) */ + /* this can happen on a single step in a exception on android (Mono_UnhandledException_internal) and on IOS */ if (!method) return; -#endif /* * Implement single stepping using breakpoints if possible. diff --git a/src/mono/mono/mini/mini-exceptions.c b/src/mono/mono/mini/mini-exceptions.c index 1166cc2..512c039 100644 --- a/src/mono/mono/mini/mini-exceptions.c +++ b/src/mono/mono/mini/mini-exceptions.c @@ -2688,7 +2688,7 @@ mono_handle_exception_internal (MonoContext *ctx, MonoObject *obj, gboolean resu if (unhandled) mini_get_dbg_callbacks ()->handle_exception ((MonoException *)obj, ctx, NULL, NULL); - else if (jinfo_get_method (ji)->wrapper_type == MONO_WRAPPER_RUNTIME_INVOKE) { + else if (!ji || (jinfo_get_method (ji)->wrapper_type == MONO_WRAPPER_RUNTIME_INVOKE)) { mini_get_dbg_callbacks ()->handle_exception ((MonoException *)obj, ctx, NULL, NULL); mini_get_dbg_callbacks ()->handle_exception ((MonoException *)obj, ctx, &ctx_cp, &catch_frame); }