Beispiel #1
0
 public void AddChild(SquirrelDebugObject child)
 {
     if (children == null)
     {
         children = new List <SquirrelDebugObject>();
     }
     children.Add(child);
 }
 public AD7Expression(SquirrelDebugObject var)
 {
     this.var = var;
 }
 bool EvaluateSquirrelObject(List <SquirrelDebugObject> children, string[] names, int depth, out SquirrelDebugObject val)
 {
     foreach (SquirrelDebugObject currVariable in children)
     {
         if (String.CompareOrdinal(currVariable.Name, names[depth]) == 0)
         {
             if (names.Length - 1 > depth)
             {
                 if (currVariable.Value.Children != null)
                 {
                     return(EvaluateSquirrelObject(currVariable.Value.Children, names, depth + 1, out val));
                 }
                 else
                 {
                     val = null;
                     return(false);
                 }
             }
             else
             {
                 val = currVariable;
                 return(true);
             }
         }
     }
     val = null;
     return(false);
 }
Beispiel #4
0
        void BuildStackFrames(XmlNodeList xcalls, SquirrelDebugValue[] objstable, List <SquirrelStackFrame> frames)
        {
            int nframe = 0;

            foreach (XmlElement call in xcalls)
            {
                SquirrelStackFrame frame = new SquirrelStackFrame();
                frame.Address  = (ulong)nframe++;
                frame.Function = call.GetAttribute("fnc") + "()";
                frame.Source   = UnFixupPath(call.GetAttribute("src"));
                frame.Line     = Convert.ToInt32(call.GetAttribute("line"));
                if (frame.Source != "NATIVE")
                {
                    foreach (XmlNode n in call.ChildNodes)
                    {
                        if (n.Name == "w")
                        {
                            SquirrelDebugObject watch = new SquirrelDebugObject();
                            XmlElement          loc   = (XmlElement)n;
                            watch.id   = Convert.ToUInt32(loc.GetAttribute("id"));
                            watch.Name = loc.GetAttribute("exp");
                            String             status = loc.GetAttribute("status");
                            SquirrelDebugValue theval;
                            if (status == "ok")
                            {
                                //String _typeof = loc.GetAttribute("typeof");
                                String type = loc.GetAttribute("type");
                                String val  = loc.GetAttribute("val");


                                if (type == "t" || type == "a" || type == "x" || type == "y")
                                {
                                    theval = objstable[Convert.ToInt32(val)];
                                }
                                else
                                {
                                    theval = new SquirrelDebugValue(val, UnpackType(type));
                                }
                                watch.Value = theval;
                                frame.Watches.Add(watch.Name, watch);
                            }

                            /*else
                             * {
                             *  theval = new SquirrelDebugValue("<cannot evaluate>", "<cannot evaluate>");
                             * }*/
                        }
                        if (n.Name == "l")
                        {
                            SquirrelDebugObject lvar = new SquirrelDebugObject();
                            XmlElement          loc  = (XmlElement)n;
                            lvar.Name = loc.GetAttribute("name");
                            String             type = loc.GetAttribute("type");
                            String             val  = loc.GetAttribute("val");
                            SquirrelDebugValue theval;
                            if (type == "t" || type == "a" || type == "x" || type == "y")
                            {
                                theval = objstable[Convert.ToInt32(val)];
                            }
                            else
                            {
                                theval = new SquirrelDebugValue(val, UnpackType(type));
                            }
                            lvar.Value = theval;
                            frame.Locals.Add(lvar);
                        }
                    }
                }
                frames.Add(frame);
            }
        }
 public AD7Property(SquirrelDebugObject dobj)
 {
     sqdbgobj = dobj;
 }