本文整理汇总了C#中Mono.CompilerServices.SymbolWriter.SourceFileEntry类的典型用法代码示例。如果您正苦于以下问题:C# SourceFileEntry类的具体用法?C# SourceFileEntry怎么用?C# SourceFileEntry使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
SourceFileEntry类属于Mono.CompilerServices.SymbolWriter命名空间,在下文中一共展示了SourceFileEntry类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: MarkSequencePoint
public void MarkSequencePoint (int offset, SourceFileEntry file, int line, int column, bool is_hidden)
{
int file_idx = file != null ? file.Index : 0;
var lne = new LineNumberEntry (file_idx, line, column, offset, is_hidden);
if (method_lines.Count > 0) {
var prev = method_lines[method_lines.Count - 1];
//
// Same offset cannot be used for multiple lines
//
if (prev.Offset == offset) {
//
// Use the new location because debugger will adjust
// the breakpoint to next line with sequence point
//
if (LineNumberEntry.LocationComparer.Default.Compare (lne, prev) > 0)
method_lines[method_lines.Count - 1] = lne;
return;
}
}
method_lines.Add (lne);
}
示例2: CompileUnitEntry
public CompileUnitEntry(MonoSymbolFile file, SourceFileEntry source)
{
this.file = file;
this.source = source;
this.Index = file.AddCompileUnit(this);
this.creating = true;
this.namespaces = new List<NamespaceEntry>();
}
示例3: AddFile
public void AddFile(SourceFileEntry file)
{
if (!this.creating)
{
throw new InvalidOperationException();
}
if (this.include_files == null)
{
this.include_files = new List<SourceFileEntry>();
}
this.include_files.Add(file);
}
示例4: GetDocument
private Document GetDocument(SourceFileEntry file)
{
string file_name = file.FileName;
Document document;
Document result;
if (this.documents.TryGetValue(file_name, out document))
{
result = document;
}
else
{
document = new Document(file_name);
this.documents.Add(file_name, document);
result = document;
}
return result;
}
示例5: ReadData
private void ReadData()
{
if (this.creating)
{
throw new InvalidOperationException();
}
lock (this.file)
{
if (this.namespaces == null)
{
MyBinaryReader reader = this.file.BinaryReader;
int old_pos = (int)reader.BaseStream.Position;
reader.BaseStream.Position = (long)this.DataOffset;
int source_idx = reader.ReadLeb128();
this.source = this.file.GetSourceFile(source_idx);
int count_includes = reader.ReadLeb128();
if (count_includes > 0)
{
this.include_files = new List<SourceFileEntry>();
for (int i = 0; i < count_includes; i++)
{
this.include_files.Add(this.file.GetSourceFile(reader.ReadLeb128()));
}
}
int count_ns = reader.ReadLeb128();
this.namespaces = new List<NamespaceEntry>();
for (int i = 0; i < count_ns; i++)
{
this.namespaces.Add(new NamespaceEntry(this.file, reader));
}
reader.BaseStream.Position = (long)old_pos;
}
}
}
示例6: GetDocument
Document GetDocument (SourceFileEntry file)
{
Document doc = m_documents [file.FileName] as Document;
if (doc != null)
return doc;
doc = new Document (file.FileName);
m_documents [file.FileName] = doc;
return doc;
}
示例7: GetSourceFile
public SourceFileEntry GetSourceFile (int index)
{
if ((index < 1) || (index > ot.SourceCount))
throw new ArgumentException ();
if (reader == null)
throw new InvalidOperationException ();
lock (this) {
SourceFileEntry source;
if (source_file_hash.TryGetValue (index, out source))
return source;
long old_pos = reader.BaseStream.Position;
reader.BaseStream.Position = ot.SourceTableOffset +
SourceFileEntry.Size * (index - 1);
source = new SourceFileEntry (this, reader);
source_file_hash.Add (index, source);
reader.BaseStream.Position = old_pos;
return source;
}
}
示例8: MarkSequencePoint
public void MarkSequencePoint (int offset, SourceFileEntry file, int line, int column,
bool is_hidden)
{
if (current_method == null)
return;
current_method.MarkSequencePoint (offset, file, line, column, is_hidden);
}
示例9: GetSourceFile
public SourceFileEntry GetSourceFile(int index)
{
if (index < 1 || index > this.ot.SourceCount)
{
throw new ArgumentException();
}
if (this.reader == null)
{
throw new InvalidOperationException();
}
SourceFileEntry result;
SourceFileEntry source;
if (this.source_file_hash.TryGetValue(index, out source))
{
result = source;
}
else
{
long old_pos = this.reader.BaseStream.Position;
this.reader.BaseStream.Position = (long)(this.ot.SourceTableOffset + SourceFileEntry.Size * (index - 1));
source = new SourceFileEntry(this, this.reader);
this.source_file_hash.Add(index, source);
this.reader.BaseStream.Position = old_pos;
result = source;
}
return result;
}
示例10: MarkSequencePoint
public void MarkSequencePoint(int offset, SourceFileEntry file, int start_line, int end_line,
int start_col, int end_col)
{
if (method_lines_pos == method_lines.Length) {
LineNumberEntry [] tmp = method_lines;
method_lines = new LineNumberEntry [method_lines.Length * 2];
Array.Copy (tmp, method_lines, method_lines_pos);
}
int file_idx = file != null ? file.Index : 0;
method_lines [method_lines_pos++] = new LineNumberEntry (
file_idx, offset, start_line, end_line, start_col, end_col);
}
示例11: MonoSourceFile
public MonoSourceFile(DebuggerSession session, Module module,
C.SourceFileEntry file, string path)
: base(session, module, path)
{
this.file = file;
}
示例12: MarkSequencePoint
public void MarkSequencePoint (int offset, SourceFileEntry file, int line, int column, bool is_hidden)
{
MarkSequencePoint (offset, file, line, column, -1, -1, is_hidden);
}
示例13: AddFile
public void AddFile (SourceFileEntry file)
{
if (!creating)
throw new InvalidOperationException ();
if (include_files == null)
include_files = new ArrayList ();
include_files.Add (file);
}
示例14: DefineDocument
public SourceFileEntry DefineDocument (string url)
{
SourceFileEntry entry = new SourceFileEntry (file, url);
sources.Add (entry);
return entry;
}
示例15: AddSource
internal int AddSource (SourceFileEntry source)
{
sources.Add (source);
return sources.Count;
}