.NET Framework Bookmark and Share   
 index > Building Development and Diagnostic Tools for .Net > Adding brekpoints to Reflection Emit Generated Files
 

Adding brekpoints to Reflection Emit Generated Files

Hi there I am Dylan Borg from Malta. I am building a compiler for the dylan.NET language and managed to make my generated code debuggable. The pdb files are also made. But how fo I put breakpoints etc. In mdbg you cannot step into a p[rocess that has finished executing. If there is no exception thrown the debugger does not stop the process. Is there a way in mdbg or in reflection emit to make the program stop at a specific line.
Borgdylan
If you want to "emit" a breakpoint as part of your reflection emit you can generate a call to System.Diagnostics.Debugger.Break.

If you want to just stop at a specific location attach the debugger when the process starts (or start the process under the debugger directly), set the breakpoint at the desired location and if the debug symbols are properly mapped it should stop.
  • Marked As Answer byBorgdylan Friday, September 11, 2009 6:02 PM
  •  

All Replies

  • Friday, September 11, 2009 5:46 PMp.b.a Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     Answer
    If you want to "emit" a breakpoint as part of your reflection emit you can generate a call to System.Diagnostics.Debugger.Break.

    If you want to just stop at a specific location attach the debugger when the process starts (or start the process under the debugger directly), set the breakpoint at the desired location and if the debug symbols are properly mapped it should stop.
    • Marked As Answer byBorgdylan Friday, September 11, 2009 6:02 PM
    •  
  • Friday, September 11, 2009 6:04 PMBorgdylan Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    Thanks for your help. I have managed to make correct pdb files and also to step into teh process, put breakpoints etc. by using the DbgCLr.exe debugger provided with the .NET SDK. Debug support is really important for a compiler still under devlopment plus this makes the language mnre valuable.
p.b.a

You can use google to search for other answers

Custom Search

More Threads

• .pdb/VS debugger issue
• Question about TextWriterTraceListener
• Signing an assembly in C#
• deployment from octopus tool
• Using perfmon to remotely monitor asp.net app counters
• can't find corapi2?
• monitor an unmanaged .dll in .net
• ILAsm syntax
• Not able to attach my code to .NET Process
• converting .net files to xml