<p>Is there any IL level debugger in form of a VS plugin or standalone application?</p>

<p>Visual studio’s debugger is great, but it allows you to debug on either HLL code level or assembly language, you can’t debug IL.
It seems that in some situations it would be useful to have an opportunity to debug at IL level. </p>

<p>In particular it might be helpful when debugging a problem in the code that you don't have the source of.</p>

<p>It is arguable if it is actually useful to debug IL when you don't have the source, but anyway.</p>

[{'answer_id': 9210, 'author': 'Chris Smith', 'author_id': 322, 'author_profile': 'https://Stackoverflow.com/users/322', 'pm_score': 5, 'selected': False, 'text': '<p>The best way to do this is to use ILDASM to disassemble the managed binary, which will generate the IL instructions. Then recompile that IL source code in debug mode using ILASM, when you fire up the Visual Studio debugger you will be able to step through the raw IL.</p>\n\n<ol>\n<li><code>ildasm foo.exe /OUT=foo.exe.il /SOURCE</code></li>\n<li><code>ilasm foo.exe.il /DEBUG</code></li>\n</ol>\n\n<p>I\'ve written a blog post about this topic at:\n<a href="http://blogs.msdn.com/chrsmith/archive/2008/03/13/how-to-debug-compiler-generated-code.aspx" rel="noreferrer">How to debug Compiler Generated code</a>.</p>\n'}, {'answer_id': 9216, 'author': 'Will Dean', 'author_id': 987, 'author_profile': 'https://Stackoverflow.com/users/987', 'pm_score': 0, 'selected': False, 'text': '<p>ISTR there\'s a debugger plug-in for Reflector.  </p>\n\n<p>Not used it myself, though I have used TestDriven.net to debug a 3rd-party assembly with the aid of Reflector:</p>\n\n<p><a href="http://weblogs.asp.net/nunitaddin/archive/2006/11/05/Debug-With-Reflector.aspx" rel="nofollow noreferrer">weblogs.asp.net/nunitaddin</a></p>\n'}, {'answer_id': 9219, 'author': 'bruceatk', 'author_id': 791, 'author_profile': 'https://Stackoverflow.com/users/791', 'pm_score': 0, 'selected': False, 'text': '<p>Here is an <a href="http://blogs.msdn.com/jmstall/archive/2004/10/03/237137.aspx" rel="nofollow noreferrer">article</a> about IL debugging. It says you can\'t do it and then talks about ways to do it.  There is also some info in the comments about doing it also.</p>\n'}, {'answer_id': 16990, 'author': 'axk', 'author_id': 578, 'author_profile': 'https://Stackoverflow.com/users/578', 'pm_score': 1, 'selected': False, 'text': "<p>Debug Companion VS plugin seem to be exactly what I was looking for, except that it won't see library project in my solution. Only when I added a console win application to the solution did something appear in that list of projects.</p>\n\n<p>The problem with the decompile/compile approach for me was that the code I was debugging wasn't my code. I could have decompiled it anyway but I think there's no way to sign that recompiled assembly so that it gets loaded instead of the original one.</p>\n\n<p>With the particular problem I had it turned out that it was enough to just debug it on the assembly language level and get the call stack of the method which was throwing the exception and the parameters with which the method was called.</p>\n"}, {'answer_id': 29853999, 'author': 'BSalita', 'author_id': 317797, 'author_profile': 'https://Stackoverflow.com/users/317797', 'pm_score': 2, 'selected': False, 'text': '<p>Here\'s the .BAT file that I use to debug IL assembler in Visual Studio. The created .IL.IL file contains the original source code lines and your generated IL assembler lines but does not show jitted machine code. I named the batch file ILDEB.BAT and is invoked as "ILDEB mypgm". I use the IL assembler directive "break" to force Visual Studio debugger to breakpoint when hit.</p>\n\n<pre><code>for /f "tokens=1 delims=." %%1 in ("%1") do set NAME_ONLY=%%1\n@erase/q %NAME_ONLY%.il.il\n@if not exist %NAME_ONLY%.dll goto quit\nildasm /out:%NAME_ONLY%.il.il /source /nobar %NAME_ONLY%.dll\n@if not exist %NAME_ONLY%.il.il goto quit\nilasm /dll /debug /out=%NAME_ONLY%.dll %NAME_ONLY%.il.il\n@if not exist %NAME_ONLY%.dll goto quit\npeverify %NAME_ONLY%.dll\n:quit\n</code></pre>\n'}]
['https://Stackoverflow.com/questions/9204', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/578/']