IL Debug Visualizer for Compiled Lambda Expressions, MethodBase and DynamicMethod

Mark Watts just emailed me with cool news. He took the Dynamic Method visualizers I worked on and created a version of them that will also work and show the IL on Lambda Expressions. here's the full list of changes he did to the source code:

1) Solution and projects all coverted over to VS2008

2) References to Microsoft.VisualStudio.DebuggerVisualizers updated to version 9

3) M3 and M4 methods added in the test project to demonstrate how to use the new functionality

4) MethodBodyVisualizer added DebuggerVisualizer attribute to target Delegates - not 100% certain this is safe but there is a lot of spelunking around where the brave fear to tread in this project. :)

5) ILReader project

    * Updated ILReaderFactory.GetReader to attempt to recognize when the target is a lamda expression and retrieve the correct MethodBase for it.

    * Updated DynamicScopeTokenResolver to handle GenericFieldInfo - Compiled Expressions store strings and the like in a global generic field array that is part of the delegate and is of type GenericFieldInfo.

 

* Download available here -

 

Install:

- take the dlls from the bin directory

- put them under my documents\visual studio\visualizers.

- if the directory does not exist, create it.

Published Thursday, November 29, 2007 4:07 AM by RoyOsherove
Filed under: , ,

Comments

Thursday, November 29, 2007 1:55 PM by Richard

# re: IL Debug Visualizer for Compiled Lambda Expressions, MethodBase and DynamicMethod

This produces three "Method IL Visualizer" entries in the visualizer menu for each dynamic method, and two for each MethodInfo.

To resolve the problem, you need to remove the DebuggerVisualizer attributes which reference DynamicMethod and MethodInfo.

Thursday, November 29, 2007 1:58 PM by RichardD

# re: IL Debug Visualizer for Compiled Lambda Expressions, MethodBase and DynamicMethod

This results in three "Method IL Visualizer" entries in the visualizer menu for each DynamicMethod, and two for each MethodInfo.

To resolve the problem, you need to remove the DebuggerVisualizer attributes which reference DynamicMethod and MethodInfo. Both of these inherit from MethodBase, which is already covered by the third DebuggerVisualizer attribute.

Saturday, December 01, 2007 3:42 AM by NyaRuRu

# re: IL Debug Visualizer for Compiled Lambda Expressions, MethodBase and DynamicMethod

I'm sorry.

I have mistook Oren to be the creator of the original version.

The original version, which I have checked, is Haibo Luo's debugger visualizer.

blogs.msdn.com/.../484861.aspx

Tuesday, December 11, 2007 8:58 AM by DevTopics | Best C# Blogs

# DevTopics | Best C# Blogs

Pingback from  DevTopics | Best C# Blogs

Tuesday, February 19, 2008 12:47 PM by cnblogs.com

# 给热爱学习的同学们推荐一些顶级的c# Blogs链接

在IT行业,中文的资料永远都比英文的慢几个月,而且原创性的也少得可怜,有空时,不妨去这些英文技术BLOG溜达溜达,也许会有意外的惊喜。 好的C#博客应该符合这些条件: 有用的新闻、信息、技巧和代码例子

# ???????????? C# ?????????? ?? ???? ????????????… « ???????? ???????????? ??????????????

Pingback from  ???????????? C# ?????????? ?? ???? ????????????… « ???????? ???????????? ??????????????