bool EmitDebugInfo(Node startNode, Node endNode)
{
LexicalInfo start = startNode.LexicalInfo;
if (!start.IsValid) return false;
ISymbolDocumentWriter writer = GetDocumentWriter(start.FullPath);
if (null == writer) return false;
// ensure there is no duplicate emitted
if (_dbgSymbols.Contains(start)) {
Context.TraceInfo("duplicate symbol emit attempt for '{0}' : '{1}'.", start, startNode);
return false;
}
if (_dbgSymbols.Count >= _DBG_SYMBOLS_QUEUE_CAPACITY) _dbgSymbols.Dequeue();
_dbgSymbols.Enqueue(start);
try
{
_il.MarkSequencePoint(writer, start.Line, 0, start.Line+1, 0);
}
catch (Exception x)
{
Error(CompilerErrorFactory.InternalError(startNode, x));
return false;
}
return true;
}