private void RuntimeError(RuntimeError error) { string line = error.Token?.Line.ToString() ?? "unknown"; standardOutputHandler($"[line {line}] {error.Message}"); hadRuntimeError = true; }
/// <summary> /// Generate detailed report when the simulator crashs /// </summary> /// <param name="e">The error caused the crash</param> /// <returns>Detailed error message</returns> private string GenerateDebugInformation(RuntimeError e) { string s = ""; s += "\n\nDEBUG Information:\n---------------------------------\n"; for (int iCounter = 0; iCounter < 12; iCounter++) { s += "R" + iCounter + "=" + theSimulator.R[iCounter].ToString16() + "\t"; } s += "AP=" + theSimulator.R[12].ToString16() + "\tFP=" + theSimulator.R[13].ToString16() + "\tSP=" + theSimulator.R[14].ToString16() + "\tPC=" + theSimulator.R[15].ToString16() + "\t"; s += "C=" + theSimulator.R.PSL.C + "\tV=" + theSimulator.R.PSL.V + "\tN=" + theSimulator.R.PSL.N + "\tZ=" + theSimulator.R.PSL.Z + "\n"; s += "Error occured at address " + Convert.ToString(e.PC, 16) + "\n"; s += "STACK:\n---------------------------------\n"; int iCurrAddr = theSimulator.R[14]; for (int iCounter = 0; iCounter < 3; ++iCounter) // 3 = number of lines { s += "0x" + Convert.ToString(iCurrAddr, 16) + ":\t"; for (int i = 0; i < 8; ++i) { s += Convert.ToString((uint)theSimulator.memory.Read(iCurrAddr, 4, false), 8).ToUpper() + "\t"; iCurrAddr += 4; } s += "\n"; } return(s); }
public override int GetHashCode() { int hash = 1; if (resultCase_ == ResultOneofCase.ParseError) { hash ^= ParseError.GetHashCode(); } if (resultCase_ == ResultOneofCase.SerializeError) { hash ^= SerializeError.GetHashCode(); } if (resultCase_ == ResultOneofCase.RuntimeError) { hash ^= RuntimeError.GetHashCode(); } if (resultCase_ == ResultOneofCase.ProtobufPayload) { hash ^= ProtobufPayload.GetHashCode(); } if (resultCase_ == ResultOneofCase.JsonPayload) { hash ^= JsonPayload.GetHashCode(); } if (resultCase_ == ResultOneofCase.Skipped) { hash ^= Skipped.GetHashCode(); } hash ^= (int)resultCase_; return(hash); }
public void AddError(RuntimeError e) { var stackName = $"{_processors?.Get()?.RootStackName()}"; e.Text = $"{stackName}\t{e.Text}"; AddError((Error)e); }
private void ClearRuntimeError() { if (FLastRuntimeError != null) { FErrorList.Remove(FLastRuntimeError); FLastRuntimeError = null; FLastRuntimeErrorString = null; FEditor.ClearRuntimeErrors(); } }
/// <summary> /// Reports a non-functioning asset to the runtime framework. /// </summary> /// <param name="assetInfo">The <see cref="IAssetInfo" /> representing the asset in error.</param> /// <exception cref="ArgumentNullException"><paramref name="assetInfo" /> is null.</exception> public void ReportAssetError(IAssetInfo assetInfo) { if (assetInfo == null) { throw new ArgumentNullException(nameof(assetInfo)); } RuntimeError assetError = new RuntimeError(assetInfo.AssetId); SessionProxyBackendConnection.HandleAssetError(assetError); }
public void Evaluate(int SpreadMax) { if (FAttachedNode != null) { var lastRuntimeErrorString = FAttachedNode.LastRuntimeError; if (!string.IsNullOrEmpty(lastRuntimeErrorString)) { if (lastRuntimeErrorString != FLastRuntimeErrorString) { if (FLastRuntimeError != null) { FErrorList.Remove(FLastRuntimeError); } FLastRuntimeError = new RuntimeError(lastRuntimeErrorString); FErrorList.Add(FLastRuntimeError); FEditor.ShowRuntimeErrors(new RuntimeError[] { FLastRuntimeError }); } FLastRuntimeErrorString = lastRuntimeErrorString; } else { ClearRuntimeError(); } } else { ClearRuntimeError(); } // Show or hide error table if (IsErrorTableVisible) { if (FErrorList.Count == 0) { HideErrorTable(); } } else if (FErrorList.Count > 0) { ShowErrorTable(); } }
/// <summary> /// Handles the runtime error for this host. /// </summary> /// <param name="error">The error information.</param> public override bool HandleError(RuntimeError error) { TraceFactory.Logger.Debug(error.ErrorId); lock (_lockObject) { // Determine if the error is already being handled, if so then return, // if not, set the flag that this thread will take care of it. if (!_isHandlingError) { TraceFactory.Logger.Debug("Handling error set true"); // Turn on indicator that this thread is already handling the error _isHandlingError = true; } else { // The error is already being handled, so return TraceFactory.Logger.Debug("Error for {0} is already being handled, returning...".FormatWith(_machine.Name)); return(true); } } bool success; // Attempt to power up the simulator, indicate failure if it doesn't work. if (!PowerUpSimulator()) { MapElement.UpdateStatus("Recovery Failed", RuntimeState.Error); success = false; } else { MapElement.UpdateStatus("Running"); success = true; } // Turn off indicator that a thread is already handling the error lock (_lockObject) { TraceFactory.Logger.Debug("HandlingError = false"); _isHandlingError = false; } return(success); }
public void ReportRuntimeError(RuntimeError error) { Console.WriteLine($"{error.Message}\n[line {error.Token.Line}]"); }
public RuntimeErrorCellProvider(RuntimeError error) { FError = error; }
public static void RuntimeError(RuntimeError error) { Console.WriteLine($"{error.Message}\n[line {error.token.Line}]"); hadRuntimeError = true; }
/// <summary> /// Handles the runtime error for this print queue. /// </summary> /// <param name="error">The error information.</param> public virtual void HandleError(RuntimeError error) { // Implemented as needed by child classes }
protected void InvokeRuntimeError(ErrorWithPath error) { SaveErrorMessage(error); RuntimeError?.Invoke(error); }
void AddError(StatementList statements, Identifier reader, RuntimeError code, params Expression[] args) { ExpressionList list = new ExpressionList(); list.Add(new Literal(code, Runtime.RuntimeError)); foreach (Expression e in args) list.Add(e); statements.Add(new ExpressionStatement(new MethodCall(new QualifiedIdentifier(reader, Identifier.For("Error")), list))); }
public RuntimeException(string message, RuntimeError error) : base(message) { Error = error; }
// "Gracfully" report the error back to the user, without bombing. internal static void RuntimeError(RuntimeError ex) { Console.WriteLine($"{ex.Message}\n[Line: {ex.Token.Line}]"); hadRuntimeError = true; }
public static void RuntimeError(RuntimeError error) { log.Error($"[line {error.Token.LineNumber}] {error.Message}"); RuntimeErrorOccured = true; }
public void AddRuntimeError(RuntimeError err) { throw new NotImplementedException(); }
public static void HandleAssetError(RuntimeError error) { SessionProxyBackendConnection.Run(c => c.HandleAssetError(error)); }
private static void AssertFailRuntimeErrorHandler(RuntimeError runtimeError) { throw runtimeError; }
/// <summary> /// Handles the runtime error for this host. /// </summary> /// <param name="error">The error information.</param> public virtual bool HandleError(RuntimeError error) { // Implemented as needed by child classes return(true); }
public static void DisplayRuntimeError(RuntimeError error) { Console.Error.WriteLine("[line " + error._token._line + "] Runtime Error: " + error.Message); _hadRuntimeError = true; }
private static void AssertFailRuntimeErrorHandler(RuntimeError runtimeError) { throw new Exception($"RuntimeError occurred: {runtimeError.Message}", runtimeError); }
private static void runtimeError(RuntimeError error) { Console.Error.WriteLine($"{error.Message} \n[line {error.token.line} ]"); hadRuntimeError = true; }
internal static void RuntimeError(RuntimeError error) { Reporter.ReportRuntimeError(error); HadRuntimeError = true; }