Exemplo n.º 1
0
 internal CallStack(ModuleFileInfo currentFile, int currentLine, int currentCol, List <CallFrame> frames)
 {
     File        = currentFile;
     Line        = currentLine;
     Column      = currentCol;
     this.frames = frames;
 }
Exemplo n.º 2
0
 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;
 }
Exemplo n.º 3
0
        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);
        }
Exemplo n.º 4
0
 public ObjectFileWriter(ModuleFileInfo file) : base(file)
 {
 }
Exemplo n.º 5
0
 public ElaLinker(LinkerOptions linkerOptions, CompilerOptions compOptions, ModuleFileInfo rootFile) :
     base(linkerOptions, compOptions, rootFile)
 {
 }
Exemplo n.º 6
0
 public static FileInfo ToFileInfo(this ModuleFileInfo self)
 {
     return(self != null ? new FileInfo(self.FullName) : null);
 }
Exemplo n.º 7
0
 public ParserResult Parse(ModuleFileInfo file)
 {
     return(Parse(new FileInfo(file.FullName)));
 }
Exemplo n.º 8
0
        internal int AddModule(ModuleFileInfo fi, CodeFrame module, bool qual, int logicHandle)
        {
            var name = ObtainModuleName(fi);

            return(AddModule(name, module, qual, logicHandle));
        }
Exemplo n.º 9
0
        internal CodeFrame GetModule(ModuleFileInfo fi, out int hdl)
        {
            var name = ObtainModuleName(fi);

            return(GetModule(name, out hdl));
        }
Exemplo n.º 10
0
 private string ObtainModuleName(ModuleFileInfo fi)
 {
     return(!String.IsNullOrEmpty(fi.Extension) && !fi.Extension.Contains("#") ?
            fi.FullName.Replace(fi.Extension, String.Empty).ToUpper() :
            fi.FullName.ToUpper());
 }
Exemplo n.º 11
0
 protected ObjectFile(ModuleFileInfo file)
 {
     File = file;
 }
Exemplo n.º 12
0
 public ObjectFileReader(ModuleFileInfo file) : base(file)
 {
 }
Exemplo n.º 13
0
 public ElaIncrementalLinker(LinkerOptions linkerOptions, CompilerOptions compOptions, ModuleFileInfo file) :
     base(linkerOptions, compOptions, file)
 {
 }