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
Günter Prossliner - 08 Aug 2007 15:59 GMT
Hello!
> How do I find the source-file and line number that this method is
> defined,?
> I do have the pdb files.
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
Ben Voigt [C++ MVP] - 08 Aug 2007 22:18 GMT
> Hello!
>
[quoted text clipped - 5 lines]
> .pdb Files, not the Assembly itself. I do not know any managed compiler
> which compiles this information into the image itself.
None of this applies to the OP, who *does* have the .pdb files.
> GP
Günter Prossliner - 09 Aug 2007 08:01 GMT
Hello!
>>> I do have the pdb files.
>>
> ....
>
> None of this applies to the OP, who *does* have the .pdb files.
:-D
I've read: "I do _not_ have the pdb files."
Sorry.
GP
Günter Prossliner - 09 Aug 2007 08:30 GMT
Hello!
> 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 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