Search The Blog
About this site

@RoyOsherove

Subscribe!

This site aims to connect all the dots of my online activities - from tools, books blogs and twitter accounts, to upcoming conferences, engagements and user group talks.

from 5whys.com
Twitter: @RoyOsherove
My Book: The Art of Unit Testing
Latest Posts
« Fix: PowerPoint 2007 Very Slow Text Editing | Main | VS2008 VPCs Expiring November 1st - Have a nice day! »
Friday
Nov022007

Debugger Visualizers for MethodInfo, DynamicMethod, and MethodBase

Oren's post about DynamicMethods in Reflection is a great "advanced" intro to the idea of DyamicMethod (a method you can create on the fly and then cache to execute many times - great of optimization scenarios over multiple objects).

My last talk at TechEd Europe this year will be about "Deep Reflection". It is a variant of a session I did at TechEd Israel and one of the topics I cover there is the use of DyanmicMethods.

One of the things that I also show there is how you may be able to create a DyamicMethod and MethodInfo Visualizer, that shows you the IL produced in the method as you create it. Very powerful if you want to debug code generated at runtime.

Here's a screenshot of the visualizer at work over a MethodInfo object. It will work just as well on a DynamicMethod object:

image

You can download the visualizers for these here:

 

* possible cool thing you can do: Use RunSharp when generating the IL inside a DynamicMethod. I'm not sure it's possible but I'll check and maybe present this.

PrintView Printer Friendly Version

Reader Comments

There are no comments for this journal entry. To create a new comment, use the form below.

PostPost a New Comment

Enter your information below to add a new comment.

My response is on my own website »
Author Email (optional):
Author URL (optional):
Post:
 
Some HTML allowed: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <code> <em> <i> <strike> <strong>