all groups > dotnet clr > august 2007 >
You're in the

dotnet clr

group:

source file and line numbers for mdMethodDef


source file and line numbers for mdMethodDef
8/8/2007 5:37:54 AM
dotnet clr:
Hi,

I have mdMethodDef and IMetaDataImport. I can use to to figure out
the name and class of the
method using GetMethodProps.
How do I find the source-file and line number that this method is
defined,?
I do have the pdb files.

Thanks,
~jyoti
Re: source file and line numbers for mdMethodDef Ben Voigt [C++ MVP]
8/8/2007 4:18:47 PM

[quoted text, click to view]

None of this applies to the OP, who *does* have the .pdb files.

[quoted text, click to view]

Re: source file and line numbers for mdMethodDef Günter Prossliner
8/8/2007 4:59:37 PM
Hello!

[quoted text, click to view]

Without .pdb you are out of luck. This information is stored within the .pdb
Files, not the Assembly itself. I do not know any managed compiler which
compiles this information into the image itself.



GP

Re: source file and line numbers for mdMethodDef Günter Prossliner
8/9/2007 12:00:00 AM
Hello!

[quoted text, click to view]

:-D

I've read: "I do _not_ have the pdb files."

Sorry.


GP

Re: source file and line numbers for mdMethodDef Günter Prossliner
8/9/2007 12:00:00 AM
Hello!

[quoted text, click to view]

I do not see any way to get this information directly (the
System.Runtime.Remoting.MethodInfo also doesn't expose this).

But you can try to get the RVA by using the

IMetaDataImport::GetMethodProps(..... [out] ULONG *pulCodeRVA ...);

Maybe you can get the Linenumber / Filename by using the DbgHelp Library.

[Retrieving Symbol Information by Address]
http://msdn2.microsoft.com/en-us/library/ms680578.aspx




GP

AddThis Social Bookmark Button