/// <summary> /// Loads symbol provider module from the specified module. /// </summary> /// <param name="module">The module.</param> /// <returns>Interface for symbol provider module</returns> public override ISymbolProviderModule LoadModule(Module module) { // Try to load PDB file into our own DIA session string location = File.Exists(module.MappedImageName) ? module.MappedImageName : module.ImageName; if (File.Exists(location)) { try { IDwarfImage image = LoadImage(location, module.LoadOffset); var compilationUnits = ParseCompilationUnits(image.DebugData, image.DebugDataDescription, image.DebugDataStrings, image.NormalizeAddress); var lineNumberPrograms = ParseLineNumberPrograms(image.DebugLine, image.NormalizeAddress); var commonInformationEntries = ParseCommonInformationEntries(image.DebugFrame, image.EhFrame, new DwarfExceptionHandlingFrameParsingInput(image)); if (compilationUnits.Length != 0 || lineNumberPrograms.Length != 0 || commonInformationEntries.Length != 0) { return(new DwarfSymbolProviderModule(module, compilationUnits, lineNumberPrograms, commonInformationEntries, image.PublicSymbols, image.CodeSegmentOffset, image.Is64bit)); } } catch { } } return(null); }
/// <summary> /// Initializes a new instance of the <see cref="DwarfExceptionHandlingFrameParsingInput"/> class. /// </summary> /// <param name="image">The dwarf image used to initialize input data.</param> public DwarfExceptionHandlingFrameParsingInput(IDwarfImage image) : this() { DefaultAddressSize = (byte)(image.Is64bit ? 8 : 4); PcRelativeAddress = image.EhFrameAddress; TextAddress = image.TextSectionAddress; DataAddress = image.DataSectionAddress; }