有没有办法访问 Visual Studio 包中的托管调试器
我正在尝试编写一个 Visual Studio 包,在调试期间显示实时对象图。
有没有办法从 VS 2010 包中访问托管调试器的数据?我知道 EnvDTE.Debugger API,但这没有为我的用例提供足够的数据。
我确实知道可以使用 WinDbg/SOS,但这对我来说不是一个选择,因为我希望能够很好地集成使用它。
我真的很感激任何信息!
编辑:
我的要求基本上是:
- 当调试器处于中断模式时获取当前堆栈帧的所有对象。
- 获取给定对象(即其字段)引用的所有对象。
- 唯一地标识一个对象,以便当多个对象引用同一对象时,有一种方法可以检测到仅引用了一个对象。
- 在附加 VS 调试器时执行所有这些操作,这实际上会杀死使用另一个调试器...
到目前为止我发现:
- EnvDTE.Debugger 不满足要求 2 和 3
- 调试器可视化工具不起作用,因为它只对可序列化对象起作用
- WinDbg 不起作用,因为它需要专门附加到进程。
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.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
据我所知,如果我正确理解您的要求,这是一个艰难的选择 - 您必须以某种方式将
EnvDTE.Debugger
与Debugger5
和 CLR Profiler(附带源代码!):Not that I know of... If I understand your requirements correctly this is a tough call - you will have to somehow combine
EnvDTE.Debugger
withDebugger5
and CLR Profiler (which comes with source code!):正如 Simon Mouriers 评论中所建议的,我将选择 手动序列化调试器可视化工具方法。
这是做我想做的事情的唯一合理的方法,尽管我还没有完全验证它。
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.