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:
- Get all objects of the current stackframe when the debugger is in break mode.
- Get all objects referenced by a given object (i.e. its fields).
- 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.
- 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.
精彩评论