本文整理汇总了C#中Mono.CompilerServices.SymbolWriter.MonoSymbolFile类的典型用法代码示例。如果您正苦于以下问题:C# MonoSymbolFile类的具体用法?C# MonoSymbolFile怎么用?C# MonoSymbolFile使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
MonoSymbolFile类属于Mono.CompilerServices.SymbolWriter命名空间,在下文中一共展示了MonoSymbolFile类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: LineNumberTable
protected LineNumberTable(MonoSymbolFile file)
{
this.LineBase = file.OffsetTable.LineNumberTable_LineBase;
this.LineRange = file.OffsetTable.LineNumberTable_LineRange;
this.OpcodeBase = (byte)file.OffsetTable.LineNumberTable_OpcodeBase;
this.MaxAddressIncrement = (int)(255 - this.OpcodeBase) / this.LineRange;
}
示例2: SourceFileEntry
public SourceFileEntry(MonoSymbolFile file, string file_name)
{
this.file = file;
this.file_name = file_name;
this.Index = file.AddSource(this);
this.creating = true;
}
示例3: MonoSymbolWriter
public MonoSymbolWriter (Stream stream)
{
this.stream = stream;
this.methods = new List<SourceMethodBuilder> ();
this.sources = new List<SourceFileEntry> ();
this.comp_units = new List<CompileUnitEntry> ();
this.file = new MonoSymbolFile ();
}
示例4: 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>();
}
示例5: MonoSymbolWriter
public MonoSymbolWriter (string filename)
{
this.methods = new List<SourceMethodBuilder> ();
this.sources = new List<SourceFileEntry> ();
this.comp_units = new List<CompileUnitEntry> ();
this.file = new MonoSymbolFile ();
this.filename = filename + ".mdb";
}
示例6: MonoSymbolWriter
public MonoSymbolWriter (string filename)
{
this.methods = new ArrayList ();
this.sources = new ArrayList ();
this.comp_units = new ArrayList ();
this.current_method_stack = new Stack ();
this.file = new MonoSymbolFile ();
this.filename = filename + ".mdb";
}
示例7: NamespaceEntry
internal NamespaceEntry(MonoSymbolFile file, MyBinaryReader reader)
{
this.Name = reader.ReadString();
this.Index = reader.ReadLeb128();
this.Parent = reader.ReadLeb128();
int count = reader.ReadLeb128();
this.UsingClauses = new string[count];
for (int i = 0; i < count; i++)
{
this.UsingClauses[i] = reader.ReadString();
}
}
示例8: MethodEntry
internal MethodEntry(MonoSymbolFile file, CompileUnitEntry comp_unit, int token, ScopeVariable[] scope_vars, LocalVariableEntry[] locals, LineNumberEntry[] lines, CodeBlockEntry[] code_blocks, string real_name, MethodEntry.Flags flags, int namespace_id)
{
this.SymbolFile = file;
this.real_name = real_name;
this.locals = locals;
this.code_blocks = code_blocks;
this.scope_vars = scope_vars;
this.flags = flags;
this.index = -1;
this.Token = token;
this.CompileUnitIndex = comp_unit.Index;
this.CompileUnit = comp_unit;
this.NamespaceID = namespace_id;
this.CheckLineNumberTable(lines);
this.lnt = new LineNumberTable(file, lines);
file.NumLineNumbers += lines.Length;
int num_locals = (locals != null) ? locals.Length : 0;
if (num_locals <= 32)
{
for (int i = 0; i < num_locals; i++)
{
string nm = locals[i].Name;
for (int j = i + 1; j < num_locals; j++)
{
if (locals[j].Name == nm)
{
flags |= MethodEntry.Flags.LocalNamesAmbiguous;
goto IL_108;
}
}
}
IL_108:;
}
else
{
Dictionary<string, LocalVariableEntry> local_names = new Dictionary<string, LocalVariableEntry>();
for (int k = 0; k < locals.Length; k++)
{
LocalVariableEntry local = locals[k];
if (local_names.ContainsKey(local.Name))
{
flags |= MethodEntry.Flags.LocalNamesAmbiguous;
break;
}
local_names.Add(local.Name, local);
}
}
}
示例9: RewriteMdbFile
public void RewriteMdbFile (string inputFile)
{
if (!settings.Quiet)
Console.WriteLine ("Processing {0}", inputFile);
var input = MonoSymbolFile.ReadSymbolFile (inputFile);
var output = new MonoSymbolFile ();
foreach (var s in input.Sources) {
var newFileName = settings.FileNamesOnly
? Path.Combine (Path.GetDirectoryName (s.FileName), settings.Replace (Path.GetFileName (s.FileName)))
: settings.Replace (s.FileName);
if (settings.Verbose)
Console.WriteLine ("{0} -> {1}", s.FileName, newFileName);
s.FileName = newFileName;
output.AddSource (s);
}
foreach (var cu in input.CompileUnits) {
cu.ReadAll ();
output.AddCompileUnit (cu);
}
foreach (var m in input.Methods) {
m.ReadAll ();
output.AddMethod (m);
}
var mdbName = new FileInfo (inputFile).Name;
var tmpMdb = Path.GetTempFileName ();
var finalMdb = inputFile;
if (settings.OutputDirectory != null)
finalMdb = Path.Combine (settings.OutputDirectory, mdbName);
using (var stream = new FileStream (tmpMdb, FileMode.Create)) {
output.CreateSymbolFile (input.Guid, stream);
}
input.Dispose ();
File.Delete (finalMdb);
File.Move (tmpMdb, finalMdb);
}
示例10: MdbRebase
static void MdbRebase(string mdbFile, string toRemove)
{
#if WINDOWS_BUILD
Console.Error.WriteLine ("Warning: skipping MDB rebasing of {0} (not supported on Windows)", mdbFile);
#else
using (var input = MonoSymbolFile.ReadSymbolFile (mdbFile)) {
var output = new MonoSymbolFile ();
foreach (var source in input.Sources) {
source.FileName = Path.Combine (
Path.GetDirectoryName (source.FileName),
Path.GetFileName (source.FileName).Replace (toRemove, String.Empty)
);
output.AddSource (source);
}
foreach (var compileUnit in input.CompileUnits) {
compileUnit.ReadAll ();
output.AddCompileUnit (compileUnit);
}
foreach (var method in input.Methods) {
method.ReadAll ();
output.AddMethod (method);
}
var tmpMdb = Path.GetTempFileName ();
using (var stream = new FileStream (tmpMdb, FileMode.Create))
output.CreateSymbolFile (input.Guid, stream);
File.Delete (mdbFile);
File.Move (tmpMdb, mdbFile);
}
#endif
}
示例11: CreateUnitSymbolInfo
//
// Creates symbol file index in debug symbol file
//
void CreateUnitSymbolInfo(MonoSymbolFile symwriter)
{
var si = file.CreateSymbolInfo (symwriter);
comp_unit = new CompileUnitEntry (symwriter, si);
if (include_files != null) {
foreach (SourceFile include in include_files.Values) {
si = include.CreateSymbolInfo (symwriter);
comp_unit.AddFile (si);
}
}
}
示例12: MdbReader
public MdbReader (MonoSymbolFile symFile)
{
symbol_file = symFile;
documents = new Dictionary<string, Document> ();
}
示例13: WriteDebugSymbol
public virtual void WriteDebugSymbol (MonoSymbolFile file)
{
}
示例14: WriteDebugSymbol
public override void WriteDebugSymbol (MonoSymbolFile file)
{
if (debug_builder == null)
return;
var token = ConstructorBuilder.GetToken ();
int t = token.Token;
#if STATIC
if (token.IsPseudoToken)
t = Module.Builder.ResolvePseudoToken (t);
#endif
debug_builder.DefineMethod (file, t);
}
示例15: DefineMethod
public void DefineMethod (MonoSymbolFile file, int token)
{
MethodEntry entry = new MethodEntry (
file, _comp_unit.Entry, token, ScopeVariables,
Locals, method_lines.ToArray (), Blocks, null, MethodEntry.Flags.ColumnsInfoIncluded, ns_id);
file.AddMethod (entry);
}