开发者

Is there any way to access the managed debugger in a Visual Studio package

I'm trying to write a Visual Studio package that shows a live object graph during debugging.

Is there any way to access the data of the managed debugger from within a VS 2010 package? I am aware of the EnvDTE.Debugger API, but this does not provide enough data for my use cases.

I do know开发者_开发技巧 it is possible using WinDbg/SOS, but this is not an option for me as I want to be able to use it nicely integrated.

I really appreciate any information!

Edit:

My requirements basically are those:

  1. Get all objects of the current stackframe when the debugger is in break mode.
  2. Get all objects referenced by a given object (i.e. its fields).
  3. Uniquely identify an object so that when several objects reference the same object there is a way to detect that its just one object that is referenced.
  4. Do all this while the VS debugger is attached, that effectively kills using another debugger...

What I found out so far:

  • EnvDTE.Debugger does not fulfill requirement 2 and 3
  • A debugger visualizer does not work because it does oly work on serializable objects
  • WinDbg does not work as it needs to be exclusively attached to the process.


Not that I know of... If I understand your requirements correctly this is a tough call - you will have to somehow combine EnvDTE.Debugger with Debugger5 and CLR Profiler (which comes with source code!):

  • David Broman's CLR Profiling API Blog: CLRProfiler V4 Released
  • CLR Inside Out - Profiling the .NET Garbage-Collected Heap
  • CLR Profiler for .NET Framework 4 is now available


As suggested in Simon Mouriers comment, I will go for the manually serialized Debugger Visualizer approach.

This is the only reasonable way to do what I want to do, although I did not fully verify it yet.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜