protected void ParseCurrentLevel(List specs) { // Use the stack spec to build the structure long offset = 0; foreach (PythonDictionary spec in specs) { // Add this argument Argument newArg = new Argument(_pyBoss, _address + offset, spec, _process, _depth, this, NamePrefix); _args.Add(newArg); _arg_offsets.Add(offset); offset += newArg.Size; // Add it as dynamic member variable to the current arguments struct so that // it can be accessed naturally from python. this.SetMember(newArg.Name, newArg); } _size = offset; }
public Arguments(PythonBoss pyBoss, long address, List specs, Process process, int depth, Argument parent, string namePrefix) { NamePrefix = namePrefix; _process = process; _address = address; _pyBoss = pyBoss; _depth = depth; _parent = parent; _args = new List<Argument>(specs.Count); _arg_offsets = new List<long>(specs.Count); // Handle the case of infinite recursion if (depth > 1000) throw new Exception("Error when processing argument types: An infinite loop has been detected, this is caused by a type somehow including a pointer to itself. Name: " + namePrefix); ParseCurrentLevel(specs); ParseNextLevel(); }