Michael Silk

i'm trying to get my head around using mdbg vs a profiler written in c++ for a project i'm working on.

i've read this link (http://blogs.msdn.com/jmstall/archive/2004/10/22/246151.aspx) by mike stall which briefly compares them, and i think the debugger is preferable for various reasons (least of which because i can do it all in c#).

what i'm trying to figure out, however, is if it's possible to track method calls (and constructors, property accessors, etc) with it. the few examples i can find don't show it; they just show breakpoints and module loading.

can anyone point me in the direction of some documention mdbg comes with something, but it's basically just api documentation (not samples, etc).

i want to track method enter/exit calls, and get the current stack, etc.

before looking at the debugging api's i was having a play with AOP; but unfortunately that doesn't get stack information.

Re: Building Development and Diagnostic Tools for .Net debugger (mdbg lib) vs profiler ...

Michael Silk

after some reading i think i'm going to be stuck with implementing my own profiler. i am not sure if that is going to have all the required stack information...

Re: Building Development and Diagnostic Tools for .Net debugger (mdbg lib) vs profiler ...

Jon Langdon - MSFT

Before you write your own profiler, I'd suggest looking at existing tools. You might save yourself quite a bit of time. A web search for ".net" and "profiler" (or similar searches) yield quite a few tools, ranging from freeware to those requiring enterprise licenses.

If you don't find anything which meets your requirements, this forum is the right place to ask questions. Regarding your particular question about getting stacks, take a look at the ICorProfiler2:: DoStackSnapshot API. Additionally, I'd suggest reading Dave Broman's blog entries. You'll find helpful information there. In fact, I believe there are a few entries dedicated to DoStackSnapshot.