I'm afraid we simply don't have that information available at the dll/pdb level. You do have to parse the sources (NRefactory or Roslyn work great!)
On Thu, May 8, 2014 at 2:13 PM, graham walsh <[email protected]> wrote: > Hi again, > > I appreciate this input. > > I seem to be cornered here. What I'm looking for is filenames/line numbers > for all class type declarations, filenames/line numbers for all methods > along with their signatures. > > In essence, I need the files and line numbers for classes/interfacs and > methods. Anywhere there is a type or a function, I need the file and line > info. > > What, in your experience is the best way to go about this (without source > code parsers). Am I always going to come up against issues or are there > toolkits out there that can extract that from a dll/pdb file? > > thanks again for your help. I'm tearing my hair out here (I switched over > from DIA SDK due to issues with it). > > cheers > > g > > On Wednesday, May 7, 2014 10:10:36 PM UTC+2, graham walsh wrote: >> >> Hi, >> >> I've successfully read a pdb file and read the pdb symbols. >> >> var readerParameters = new ReaderParameters { ReadSymbols = >> true }; >> PdbReaderProvider provider = new PdbReaderProvider(); >> ModuleDefinition module = >> ModuleDefinition.ReadModule("MyCompany.Visitors.Data.dll"); >> >> Mono.Cecil.Pdb.PdbReader reader = ( Mono.Cecil.Pdb.PdbReader) >> provider.GetSymbolReader(module, module.FullyQualifiedName); >> module.ReadSymbols(reader) >> >> In the visual studio debugger, I can see the Mono.Cecil.Pdb.PdbReader >> reader instance and can see all the functions it contains. Now I want to >> get my hands on these functions however I'm not sure what interface/routine >> to use. The functions (see below) are all private. >> >> I want to iterate over the functions and documents readonly private >> attributes below. Can anybody tell me how to do this? >> >> public class PdbReader : ISymbolReader, IDisposable >> { >> private int age; >> private readonly Dictionary<string, Document> documents = new >> Dictionary<string, Document>(); >> private readonly Dictionary<uint, PdbFunction> functions = new >> Dictionary<uint, PdbFunction>(); >> private Guid guid; >> private readonly Stream pdb_file; >> >> internal PdbReader(Stream file) >> { >> this.pdb_file = file; >> } >> >> ...... >> } >> >> >> thanks >> >> G > > -- > -- > -- > mono-cecil > --- > You received this message because you are subscribed to the Google Groups > "mono-cecil" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > For more options, visit https://groups.google.com/d/optout. -- -- -- mono-cecil --- You received this message because you are subscribed to the Google Groups "mono-cecil" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.
