#include "mini.h"
#include "trace.h"
#include "debugger-agent.h"
+#include "seq-points.h"
#ifndef MONO_ARCH_CONTEXT_DEF
#define MONO_ARCH_CONTEXT_DEF
* 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) {
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;