Expression Evaluator vs Visualizer vs ...
-
Sunday, September 16, 2012 7:53 AM
Hi all,
I am new to VS debugger extensibility. I've read Roadmap for Extending the Debugger article but I am still trying to understand the big picture. I would like get more understanding before I start.
Here is my scenario. I work on a contract library and I want to add support for it in the Visual Studio 2012 debugger. Consider the following example:
class Foo { [IsInRange(10, 20)] public int Bar { get; set; } public int Baz([IsInRange(100, 200)] int baz) { ... } }When one hits a breakpoint in method Baz I want to extend VS 2012 debugger so that in the Watch window it shows baz parameter in a different color according its value. For example when baz<10 the color should be blue, when 100<=baz<200 the color should be green and when 200<=baz the color should be red.
My library also provides attributes that can be applied on a type. For example:
[Composable] class Foo {...} [Composable] class Bar {...}I would like to build a VS 2012 debugger visualizer for all variables of types with Composable attribute applied on.
As far as I understand it, I have to build both an expression evaluator and a visualizer. Is that correct? Also, I read that visualizers are targeted to a specific type. Is there a workaround or are there any other alternatives?
TIA,
Mihail
All Replies
-
Tuesday, September 18, 2012 6:33 AMModerator
Hi Mihail,
Thank you for posting in the MSDN forum.
I am trying to involve someone familiar with this topic to further look at this issue. There might be some time delay. Appreciate your patience.
Best Regards,
Jack Zhai [MSFT]
MSDN Community Support | Feedback to us
-
Saturday, September 22, 2012 12:23 AMModerator
Hi Mihail,
You only need an Expression Evaluator when you are working with a custom language. The EE is what's responsible for parsing expressions in the watch windows. If you aren't implementing a custom language, you don't need to go down that road.
With respect to your visualizer inquiry, I recall asking about something similar to this for VS 2010, but it wasn't possible to implement a generic visualizer that would cover something like System.Object, which is what you would need in this instance. I'll check with the dev team and see if that's still the case for VS 2012, and post back on this thread as soon as I hear back.
Thanks,
Ed Dore
- Marked As Answer by M.Slav Sunday, September 23, 2012 11:59 AM
-
Sunday, September 23, 2012 11:58 AM
Hi Ed,
Thank you for the answer. Your answer is helpful, I am going to mark it.
As for the visualizer, it seems that my scenario is reasonable though it is very specific and rare. I start to think that the lack for such customization is a good thing. I am going to rethink how to implement it with more standard means.
Thanks,
Mihail

