protected CoreFile(ThreadManager manager, ProcessStart start) : base(manager, start) { info = Inferior.GetTargetMemoryInfo(manager.AddressDomain); bfd = (Bfd)NativeLanguage.OperatingSystem.LoadExecutable( info, start.TargetApplication, true); core_file = start.CoreFile; core_bfd = bfd.OpenCoreFile(core_file); #if FIXME string crash_program = core_bfd.CrashProgram; string[] crash_program_args = crash_program.Split(' '); if (crash_program_args [0] != application) { throw new TargetException( TargetError.CannotStartTarget, "Core file (generated from {0}) doesn't match executable {1}.", crash_program, application); } bool ok; try { DateTime core_date = Directory.GetLastWriteTime(core_file); DateTime app_date = Directory.GetLastWriteTime(application); ok = app_date < core_date; } catch { ok = false; } if (!ok) { throw new TargetException( TargetError.CannotStartTarget, "Executable {0} is more recent than core file {1}.", application, core_file); } #endif read_note_section(); main_thread = (CoreFileThread)threads [0]; TargetMemoryAccess target_access = ((CoreFileThread)threads [0]).TargetAccess; // bfd.UpdateSharedLibraryInfo (null, target_access); TargetAddress mdb_debug_info = bfd.GetSectionAddress(".mdb_debug_info"); if (!mdb_debug_info.IsNull) { mdb_debug_info = main_thread.ReadAddress(mdb_debug_info); debugger_info = MonoDebuggerInfo.Create(target_access, mdb_debug_info); read_thread_table(); CreateMonoLanguage(debugger_info); mono_language.InitializeCoreFile(target_access); mono_language.Update(target_access); } }
internal MonoLanguageBackend CreateMonoLanguage(MonoDebuggerInfo info) { mono_language = new MonoLanguageBackend(this, info); return(mono_language); }