From: Marcos Henrich Date: Thu, 30 Oct 2014 22:34:44 +0000 (+0000) Subject: Changed mini-exceptions functions to get IL offsets from seq point. X-Git-Url: http://wien.tomnetworks.com/gitweb/?a=commitdiff_plain;h=6dea3629f74d3d6b8109122270b55cc1c84db908;p=mono.git Changed mini-exceptions functions to get IL offsets from seq point. mono_walk_stack_full and ves_icall_get_trace are now using find_prev_seq_point_for_native_offset to retrieve IL offsets. --- diff --git a/mono/mini/mini-exceptions.c b/mono/mini/mini-exceptions.c index 8c62bb704f9..02238647e9a 100644 --- a/mono/mini/mini-exceptions.c +++ b/mono/mini/mini-exceptions.c @@ -52,6 +52,7 @@ #include "mini.h" #include "trace.h" #include "debugger-agent.h" +#include "seq-points.h" #ifndef MONO_ARCH_CONTEXT_DEF #define MONO_ARCH_CONTEXT_DEF @@ -699,10 +700,15 @@ ves_icall_get_trace (MonoException *exc, gint32 skip, MonoBoolean need_file_info * operation, so we shouldn't call this method twice. */ location = mono_debug_lookup_source_location (jinfo_get_method (ji), sf->native_offset, domain); - if (location) + if (location) { sf->il_offset = location->il_offset; - else - sf->il_offset = 0; + } else { + SeqPoint sp; + if (find_prev_seq_point_for_native_offset (domain, jinfo_get_method (ji), sf->native_offset, NULL, &sp)) + sf->il_offset = sp.il_offset; + else + sf->il_offset = 0; + } if (need_file_info) { if (location && location->source_file) { @@ -853,7 +859,13 @@ mono_walk_stack_full (MonoJitStackWalk func, MonoContext *start_ctx, MonoDomain MonoDebugSourceLocation *source; source = mono_debug_lookup_source_location (jinfo_get_method (frame.ji), frame.native_offset, domain); - il_offset = source ? source->il_offset : -1; + if (source) { + il_offset = source->il_offset; + } else { + SeqPoint sp; + if (find_prev_seq_point_for_native_offset (domain, jinfo_get_method (frame.ji), frame.native_offset, NULL, &sp)) + il_offset = sp.il_offset; + } mono_debug_free_source_location (source); } else il_offset = -1;