Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / CLR / August 2007

Tip: Looking for answers? Try searching our database.

source file and line numbers for mdMethodDef

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
jyoti.swarup@gmail.com - 08 Aug 2007 13:37 GMT
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

Rate this thread:







Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.