Possible Duplicate:
What is a good approach to building a debugger for a .NET language?
I have a Lisp-style language that I want to build a debugger for. My language is here - https://github.com/bryanedds/aml .
I am likely going to compile it down to IL. If it's helpful for writing the debugger, I'll write the compiler first. However, I am wondering what are some approaches for building the debugger. I looked at building it for Visual Studio, but that's difficult as it seems to require me to interface with VS via COM, meaning I need to write the debugger in C or C++ (UGH!). I'm hoping that Visual Studio Debugger development has a better story that I'm not aware of.
Looking at other threads on .NET debugging on SO, I see that IL includes source file coordinates, so I wonder if that means that I don't need to write as much COM code as one would initially suspect (EG - step debugging works out of the box without any COM code so long as the compiled IL has source file coordinates).
Alternatively, I could look at using another IDE that maybe has a happier path for .NET language debugging. There is Eclipse, but it doesn't seem to have any particular support for .NET language debugging.
Perhaps the IDE with the best debugger building story might be MonoDevelop. Of course, I'd need it to work with MS .NET instead of just Mono. However, it's documentation is rather bare. Anyone have experience building a debugger there?
So, as you can see, I'm rather lost in all this. I just need some ways to build a simple debugger with breakpoints and step debugging with variable inspection for my .NET language. I'd prefer to write most of the code in F# as that's what my language is written in.
If you're going to use System.Reflection.Emit
to compile your language to IL, then it should be quite easy to also generate debug information with your code (pdb
file) and Visual Studio will pick that up automatically (so you do not have to write a debugger).
Emitting Symbolic Information with Reflection Emit on MSDN has some information on this.
You can also take a look at TickSpec source code, which is written in F# and uses this to enable debugging in files that describe the testing scenario (if you look at the video, on the home page, you can see that he can place breakpoints in the text file).
I don't think that writing a debugger for a .NET language is what you need - there is already a pretty good debugger in Visual Studio, so you just need to enable your language to use it.