internal CallStack(ModuleFileInfo currentFile, int currentLine, int currentCol, List <CallFrame> frames) { File = currentFile; Line = currentLine; Column = currentCol; this.frames = frames; }
internal ElaCodeException(string message, ElaRuntimeError error, ModuleFileInfo file, int line, int col, IEnumerable <CallFrame> callStack, ElaError errObj, Exception innerException) : base(message, innerException) { Error = new ElaMessage(message, MessageType.Error, (Int32)error, line, col); Error.File = file; CallStack = callStack; ErrorObject = errObj; }
public CallStack BuildCallStack(int currentOffset, CodeFrame errModule, ModuleFileInfo moduleFile, Stack <StackPoint> callChain) { var syms = new DebugReader(errModule.Symbols); var frames = new List <CallFrame>(); var lp = syms.FindLineSym(currentOffset - 1); var retval = new CallStack( moduleFile, lp != null ? lp.Line : 0, lp != null ? lp.Column : 0, frames ); if (callChain == null || callChain.Count == 0) { return(retval); } var mem = default(StackPoint); var first = true; var offset = 0; do { mem = callChain.Pop(); var mod = Assembly.GetModuleName(mem.ModuleHandle); syms = new DebugReader(Assembly.GetModule(mem.ModuleHandle).Symbols); offset = first ? currentOffset - 1 : mem.BreakAddress - 1; var glob = callChain.Count == 0 || offset < 0; var funSym = !glob?syms.FindFunSym(offset) : null; var line = syms != null && offset > 0 ? syms.FindLineSym(offset) : null; frames.Add(new CallFrame(glob, mod, funSym != null ? funSym.Name != null ? funSym.Name : String.Format(FUNC_PARS, funSym.Parameters) : glob ? null : FUNC, offset, line)); first = false; }while (callChain.Count > 0 && offset > 0); return(retval); }
public ObjectFileWriter(ModuleFileInfo file) : base(file) { }
public ElaLinker(LinkerOptions linkerOptions, CompilerOptions compOptions, ModuleFileInfo rootFile) : base(linkerOptions, compOptions, rootFile) { }
public static FileInfo ToFileInfo(this ModuleFileInfo self) { return(self != null ? new FileInfo(self.FullName) : null); }
public ParserResult Parse(ModuleFileInfo file) { return(Parse(new FileInfo(file.FullName))); }
internal int AddModule(ModuleFileInfo fi, CodeFrame module, bool qual, int logicHandle) { var name = ObtainModuleName(fi); return(AddModule(name, module, qual, logicHandle)); }
internal CodeFrame GetModule(ModuleFileInfo fi, out int hdl) { var name = ObtainModuleName(fi); return(GetModule(name, out hdl)); }
private string ObtainModuleName(ModuleFileInfo fi) { return(!String.IsNullOrEmpty(fi.Extension) && !fi.Extension.Contains("#") ? fi.FullName.Replace(fi.Extension, String.Empty).ToUpper() : fi.FullName.ToUpper()); }
protected ObjectFile(ModuleFileInfo file) { File = file; }
public ObjectFileReader(ModuleFileInfo file) : base(file) { }
public ElaIncrementalLinker(LinkerOptions linkerOptions, CompilerOptions compOptions, ModuleFileInfo file) : base(linkerOptions, compOptions, file) { }