I'm looking for an extension for Visual Studio where in debug mode it's possible to single step through the intermediate language beside C#.
I'm not looking for a solution to debug managed and unmanaged code.
I'm looking for an extension for Visual Studio where in debug mode it's possible to single step through the intermediate language beside C#.
I'm not looking for a solution to debug managed and unmanaged code.
What is your purpose? Is your IL generated by C# compiler or dynamically produced at run time? If the former one, you can use a trick of re-compiling your binary through ilasm
.
re-compile the .il file to get a new binary (and a new symbols)
ilasm .il [/exe|/dll] /debug
Now when debugging that specific assembly you will see IL code rather than C# code. You will also see a matching lines from original C# file if you select appropriate option in step 2.
For the case of dynamically generated IL, I would simply use WinDbg with SOS extension. It can dump IL and step through it, but it takes a bit to get used to.
link.exe /LTCG
option. I got this working great with the latest Roslyn and ILAsm (no ILDasm roundtrip required). What would be nice now would be a debugger plug-in that displays (a simulation of) the CIL execution stack as you step through the IL. Anyone know if there is such a thing? –
Percussive Although not strictly a Visual Studio extension as the OP requested, there's now a maybe even better way to do this using dnSpy, a comprehensive, standalone, open-source .NET debugging tool. The tool actually does much more than just debugging; for example it allows direct editing of .NET and native (PEFile) assemblies, de-obfuscating them, browsing and modifying the raw managed and native headers, content, resources, BAML, and metadata, and more that I probably haven't discovered.
For the purposes of the discussion on this page, be sure to check out the IL interpreter section of the dnSpy project. Exactly as requested by the OP, this is the library that implements an IL interpreter for simulating the (pretend) execution of the IL code in parallel with the debugger's (actual) native instruction single-stepping, for the purposes of displaying the state of the (logical) IL execution stack. I believe there's some excellent x86/x64 disassembly rendering built-in to the debugger as well, if needed. Kudos to the developer of this tour-de-force app.
I don't think that an external disassembler is necessary here. When you're debugging in VS 2010 (though not Express) you can right-click on the code window and select "Go To Disassembly" to step through the IL code. Could that be what you're looking for? Read more here
© 2022 - 2024 — McMap. All rights reserved.