diff options
author | Zoltan Varga <vargaz@gmail.com> | 2013-03-27 05:00:11 +0400 |
---|---|---|
committer | Zoltan Varga <vargaz@gmail.com> | 2013-03-27 05:00:44 +0400 |
commit | 3a29f718c59111144f11a24307d80f25594b7355 (patch) | |
tree | 6aa1d97e67e4be889cd5932eece6526ee3d199c6 | |
parent | f3b1d7e5eba21eca5b6a2f857f3405ab2182015a (diff) |
Fix sdb asserts when seq-points are not found for a method because its assembly was AOTed without the 'soft-debug' option. Fixes #11435.
-rw-r--r-- | mono/mini/debugger-agent.c | 35 |
1 files changed, 23 insertions, 12 deletions
diff --git a/mono/mini/debugger-agent.c b/mono/mini/debugger-agent.c index 27ecadba8b9..0d6b237be03 100644 --- a/mono/mini/debugger-agent.c +++ b/mono/mini/debugger-agent.c @@ -2939,16 +2939,13 @@ get_seq_points (MonoDomain *domain, MonoMethod *method) return seq_points; } -static MonoSeqPointInfo* -find_seq_points (MonoDomain *domain, MonoMethod *method) +static void +no_seq_points_found (MonoMethod *method) { - MonoSeqPointInfo *seq_points = get_seq_points (domain, method); - - if (!seq_points) - printf ("Unable to find seq points for method '%s'.\n", mono_method_full_name (method, TRUE)); - g_assert (seq_points); - - return seq_points; + /* + * This can happen in full-aot mode with assemblies AOTed without the 'soft-debug' option to save space. + */ + printf ("Unable to find seq points for method '%s'.\n", mono_method_full_name (method, TRUE)); } /* @@ -2962,7 +2959,12 @@ find_next_seq_point_for_native_offset (MonoDomain *domain, MonoMethod *method, g MonoSeqPointInfo *seq_points; int i; - seq_points = find_seq_points (domain, method); + seq_points = get_seq_points (domain, method); + if (!seq_points) { + if (info) + *info = NULL; + return NULL; + } g_assert (seq_points); if (info) *info = seq_points; @@ -4406,6 +4408,8 @@ process_breakpoint_inner (DebuggerTlsData *tls) * the offset recorded in the seq point map, so find the prev seq point before ip. */ sp = find_prev_seq_point_for_native_offset (mono_domain_get (), ji->method, native_offset, &info); + if (!sp) + no_seq_points_found (ji->method); g_assert (sp); DEBUG(1, fprintf (log_file, "[%p] Breakpoint hit, method=%s, ip=%p, offset=0x%x, sp il offset=0x%x.\n", (gpointer)GetCurrentThreadId (), ji->method->name, ip, native_offset, sp ? sp->il_offset : -1)); @@ -4936,13 +4940,16 @@ ss_start (SingleStepReq *ss_req, MonoMethod *method, SeqPoint *sp, MonoSeqPointI // There could be method calls before the next seq point in the caller when using nested calls //enable_global = TRUE; } else { - while (sp && sp->next_len == 0) { + if (sp && sp->next_len == 0) { sp = NULL; - if (frame_index < tls->frame_count) { + while (frame_index < tls->frame_count) { StackFrame *frame = tls->frames [frame_index]; method = frame->method; sp = find_prev_seq_point_for_native_offset (frame->domain, frame->method, frame->native_offset, &info); + if (sp && sp->next_len != 0) + break; + sp = NULL; frame_index ++; } } @@ -5064,6 +5071,8 @@ ss_create (MonoInternalThread *thread, StepSize size, StepDepth depth, EventRequ * point after ip. */ sp = find_next_seq_point_for_native_offset (frame.domain, frame.method, frame.native_offset, &info); + if (!sp) + no_seq_points_found (frame.method); g_assert (sp); method = frame.method; @@ -5108,6 +5117,8 @@ ss_create (MonoInternalThread *thread, StepSize size, StepDepth depth, EventRequ if (!method && frame->il_offset != -1) { /* FIXME: Sort the table and use a binary search */ sp = find_prev_seq_point_for_native_offset (frame->domain, frame->method, frame->native_offset, &info); + if (!sp) + no_seq_points_found (frame->method); g_assert (sp); method = frame->method; } |