I have been building applications on .Net platforms for about 5 years now and dint understand how it actually happens underneath in the CLR, curse Microsoft for making it so trivial 🙂
I happened to stumble upon this great article which gives a clear look at the CLR machinery
Some of the topics covered in this article are
- App Domain – Default domains, system domains
- Type Fundamentals
- ObjectInstance – Memory layout of an object instantiated
- MethodTable – how methods are resolved and called
- Base Instance Size
- Method Slot Table
- Interface Vtable Map and Interface Map
- Virtual Dispatch
- Static Variables
This article also throws some light on a hidden beauty that is shipped with visual studio. “Son of Strike” , yes the name seems to be some video game but it is a real gem to see what is happening within the CLR.
Follow the steps to use the power of SOS
build your project with “Enable unmanaged Code debugging” option in the project properties window.
Debug the application.
In the immediate window type “!load sos” you are ready to go.
Functions are listed by category. Shortcut names for popular functions are listed in parenthesis.
I would recommend every .Net developer to read the article