WriteStackTrace() static private method

static private WriteStackTrace ( StringBuilder sb ) : void
sb StringBuilder
return void
Ejemplo n.º 1
0
Archivo: Vm.cs Proyecto: mbrezu/Shovel
 static void HandleContext(Vm vm)
 {
     var stackTraceSb = new StringBuilder ();
     vm.WriteStackTrace (stackTraceSb);
     var stackTrace = stackTraceSb.ToString ();
     var currentEnvironmentSb = new StringBuilder ();
     vm.WriteCurrentEnvironment (currentEnvironmentSb);
     var currentEnvironment = currentEnvironmentSb.ToString ();
     var result = new HashInstance ();
     result.Add (Value.Make ("stack"), Value.Make (stackTrace));
     result.Add (Value.Make ("environment"), Value.Make (currentEnvironment));
     vm.IncrementCells (6 + stackTrace.Length + currentEnvironment.Length);
     vm.stack.Push (Value.Make (result));
     vm.programCounter ++;
     return;
 }