Feature Request: Runtime source position (line, column) tracking

Jan 12, 2009 at 5:44 PM
Edited Jan 12, 2009 at 8:04 PM
I'm working on implementing a language using the DLR, and I was a little surprised to discover that it doesn't have any built-in capabilities for keeping track of the source position of executing code.  This would be really useful for reporting runtime errors/exceptions.  I know that IronPython uses a hidden $lineNo variable that it has the runtime update during execution.  But it seems if the language implementation does provide a SourceSpan while it's building the DLR tree, the runtime could keep track of, and provide, that information back to the language implementation at execution time.

For now, I'm going to mimic what IronPython does. 

Jan 13, 2009 at 8:05 PM
We're looking at ways to make it better, but for now that's the right approach.

(The issue is that in some situations--when compiling DynamicMethods or when running in partial trust--the CLR won't allow us to emit or won't use the debugging information that the expression tree contains. Until we can get a fix for it at the underlying level, some level of workarounds will be required.)