示例#1
0
        public string GetSymbolFileName()
        {
            if (InitializeValue(Flags.InitializeSymbolFileName))
            {
                if (Target.OperatingSystem == OSPlatform.Linux)
                {
                    try
                    {
                        Stream stream  = ModuleService.RawMemoryService.CreateMemoryStream();
                        var    elfFile = new ELFFile(new StreamAddressSpace(stream), ImageBase, true);
                        if (elfFile.IsValid())
                        {
                            ELFSection section = elfFile.FindSectionByName(".gnu_debuglink");
                            if (section != null)
                            {
                                _symbolFileName = section.Contents.Read <string>(0);
                            }
                        }
                    }
                    catch (Exception ex) when
                        (ex is InvalidVirtualAddressException ||
                        ex is ArgumentOutOfRangeException ||
                        ex is IndexOutOfRangeException ||
                        ex is BadInputFormatException)

                    {
                        Trace.TraceWarning("ELF .gnu_debuglink section in {0}: {1}", this, ex.Message);
                    }
                }
            }
            return(_symbolFileName);
        }
示例#2
0
 private string GetSymbolFileName()
 {
     try
     {
         ELFSection section = _elfFile.FindSectionByName(".gnu_debuglink");
         if (section != null)
         {
             return(section.Contents.Read <string>(0));
         }
     }
     catch (Exception ex) when(ex is InvalidVirtualAddressException || ex is BadInputFormatException)
     {
         Tracer.Verbose("ELF .gnu_debuglink section in {0}: {1}", _path, ex.Message);
     }
     return(null);
 }