{
MonoDebugLineNumberEntry lne;
- lne.address = address;
- lne.offset = offset;
+ lne.native_offset = address;
+ lne.il_offset = offset;
g_array_append_val (jit->line_numbers, lne);
}
if ((method->iflags & METHOD_IMPL_ATTRIBUTE_INTERNAL_CALL) ||
(method->iflags & METHOD_IMPL_ATTRIBUTE_RUNTIME) ||
(method->flags & METHOD_ATTRIBUTE_PINVOKE_IMPL) ||
- (method->flags & METHOD_ATTRIBUTE_ABSTRACT) ||
- (method->wrapper_type != MONO_WRAPPER_NONE))
+ (method->flags & METHOD_ATTRIBUTE_ABSTRACT))
+ return;
+ if ((method->wrapper_type != MONO_WRAPPER_NONE) &&
+ (method->wrapper_type != MONO_WRAPPER_MANAGED_TO_NATIVE))
return;
info = g_new0 (MiniDebugMethodInfo, 1);
mono_class_init (cfg->method->klass);
- g_assert (((MonoMethodNormal*)cfg->method)->header);
- header = ((MonoMethodNormal*)cfg->method)->header;
-
+ header = mono_method_get_header (cfg->method);
+ g_assert (header);
+
info->jit = jit = g_new0 (MonoDebugMethodJitInfo, 1);
jit->line_numbers = g_array_new (FALSE, TRUE, sizeof (MonoDebugLineNumberEntry));
jit->num_locals = header->num_locals;
if (!RUNNING_ON_VALGRIND)
return;
- header = ((MonoMethodNormal*)method)->header;
+ header = mono_method_get_header (method);
full_name = mono_method_full_name (method, TRUE);
MiniDebugMethodInfo *info;
MonoDebugMethodJitInfo *jit;
MonoMethodHeader *header;
+ MonoMethodSignature *sig;
MonoMethod *method;
int i;
info = (MiniDebugMethodInfo *) cfg->debug_info;
- if (!info || !info->jit)
+ if (!info || !info->jit) {
+ if (info)
+ g_free (info);
return;
+ }
method = cfg->method;
- header = ((MonoMethodNormal*)method)->header;
+ header = mono_method_get_header (method);
+ sig = mono_method_signature (method);
jit = info->jit;
jit->code_start = cfg->native_code;
record_line_number (jit, jit->epilogue_begin, header->code_size);
- jit->num_params = method->signature->param_count;
+ jit->num_params = sig->param_count;
jit->params = g_new0 (MonoDebugVarInfo, jit->num_params);
for (i = 0; i < jit->num_locals; i++)
write_variable (cfg->varinfo [cfg->locals_start + i], &jit->locals [i]);
- if (method->signature->hasthis) {
+ if (sig->hasthis) {
jit->this_var = g_new0 (MonoDebugVarInfo, 1);
write_variable (cfg->varinfo [0], jit->this_var);
}
for (i = 0; i < jit->num_params; i++)
- write_variable (cfg->varinfo [i + method->signature->hasthis], &jit->params [i]);
+ write_variable (cfg->varinfo [i + sig->hasthis], &jit->params [i]);
mono_debug_add_method (method, jit, cfg->domain);
if (info->breakpoint_id)
mono_debugger_breakpoint_callback (method, info->breakpoint_id);
+
+ g_free (info);
}
void
if (!info || !info->jit || !ins->cil_code)
return;
- g_assert (((MonoMethodNormal*)cfg->method)->header);
- header = ((MonoMethodNormal*)cfg->method)->header;
+ header = mono_method_get_header (cfg->method);
+ g_assert (header);
if ((ins->cil_code < header->code) ||
(ins->cil_code > header->code + header->code_size))
*/
if ((value >= 0) && (value <= 127))
*p++ = value;
- else if ((value >= 0) && (value <= 16384)) {
+ else if ((value >= 0) && (value <= 16383)) {
p [0] = 0x80 | (value >> 8);
p [1] = value & 0xff;
p += 2;
for (i = 0; i < jit->num_params; ++i)
serialize_variable (&jit->params [i], p, &p);
- if (cfg->method->signature->hasthis)
+ if (mono_method_signature (cfg->method)->hasthis)
serialize_variable (jit->this_var, p, &p);
for (i = 0; i < jit->num_locals; i++)
MonoDebugLineNumberEntry *lne = &g_array_index (jit->line_numbers,
MonoDebugLineNumberEntry,
i);
- encode_value (lne->offset - prev_offset, p, &p);
- encode_value (lne->address - prev_native_offset, p, &p);
- prev_offset = lne->offset;
- prev_native_offset = lne->address;
+ encode_value (lne->il_offset - prev_offset, p, &p);
+ encode_value (lne->native_offset - prev_native_offset, p, &p);
+ prev_offset = lne->il_offset;
+ prev_native_offset = lne->native_offset;
}
g_assert (p - buf < size);
char *p;
int i;
- g_assert (((MonoMethodNormal*)method)->header);
- header = ((MonoMethodNormal*)method)->header;
+ header = mono_method_get_header (method);
+ g_assert (header);
jit = g_new0 (MonoDebugMethodJitInfo, 1);
jit->code_start = code_start;
jit->line_numbers = g_array_new (FALSE, TRUE, sizeof (MonoDebugLineNumberEntry));
jit->num_locals = header->num_locals;
jit->locals = g_new0 (MonoDebugVarInfo, jit->num_locals);
- jit->num_params = method->signature->param_count;
+ jit->num_params = mono_method_signature (method)->param_count;
jit->params = g_new0 (MonoDebugVarInfo, jit->num_params);
p = buf;
for (i = 0; i < jit->num_params; ++i)
deserialize_variable (&jit->params [i], p, &p);
- if (method->signature->hasthis) {
+ if (mono_method_signature (method)->hasthis) {
jit->this_var = g_new0 (MonoDebugVarInfo, 1);
deserialize_variable (jit->this_var, p, &p);
}
return domain;
}
+
+void
+mono_debug_add_icall_wrapper (MonoMethod *method, MonoJitICallInfo* callinfo)
+{
+ if (mono_debug_format == MONO_DEBUG_FORMAT_NONE)
+ return;
+
+ mono_debug_add_wrapper (method, callinfo->func, mono_get_root_domain ());
+}