void check_for_mono_runtime(Inferior inferior, Bfd bfd)
{
TargetAddress info = bfd.GetSectionAddress (".mdb_debug_info");
if (info.IsNull)
return;
TargetAddress data = inferior.ReadAddress (info);
if (data.IsNull) {
//
// See CheckForPendingMonoInit() below - this should only happen when
// the Mono runtime is embedded - for instance Moonlight inside Firefox.
//
// Note that we have to do a symbol lookup for it because we do not know
// whether the mono runtime is recent enough to have this variable.
//
data = bfd.LookupSymbol ("MONO_DEBUGGER__using_debugger");
if (data.IsNull) {
Report.Error ("Failed to initialize the Mono runtime!");
return;
}
inferior.WriteInteger (data, 1);
pending_mono_init = info;
return;
}
Process.InitializeMono (inferior, data);
}