/*
Copyright (C) 2014-2019 de4dot@gmail.com
This file is part of dnSpy
dnSpy is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
dnSpy is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with dnSpy. If not, see .
*/
using dnSpy.Contracts.Debugger.Evaluation;
namespace dnSpy.Contracts.Debugger.Engine.Evaluation {
///
/// Common error messages
///
public static class PredefinedEvaluationErrorMessages {
const string SUFFIX = " <({[dnSpy]})> ";
///
/// Some error
///
public const string InternalDebuggerError = nameof(InternalDebuggerError) + SUFFIX;
///
/// is set but expression causes side effects
///
public const string ExpressionCausesSideEffects = nameof(ExpressionCausesSideEffects) + SUFFIX;
///
/// or
/// is set but code must call a method
///
public const string FuncEvalDisabled = nameof(FuncEvalDisabled) + SUFFIX;
///
/// Function evaluation timed out
///
public const string FuncEvalTimedOut = nameof(FuncEvalTimedOut) + SUFFIX;
///
/// Function evaluation timed out previously and is disabled until the user continues the debugged program
///
public const string FuncEvalTimedOutNowDisabled = nameof(FuncEvalTimedOutNowDisabled) + SUFFIX;
///
/// The debugged program isn't paused so it's not possible to func-eval
///
public const string CanFuncEvalOnlyWhenPaused = nameof(CanFuncEvalOnlyWhenPaused) + SUFFIX;
///
/// It's not possible to func-eval when an unhandled exception has occurred
///
public const string CantFuncEvalWhenUnhandledExceptionHasOccurred = nameof(CantFuncEvalWhenUnhandledExceptionHasOccurred) + SUFFIX;
///
/// It's not possible to func-eval, eg. because we're already func-eval'ing
///
public const string CantFuncEval = nameof(CantFuncEval) + SUFFIX;
///
/// It's not possible to func-eval because the thread isn't at a safe point where a GC can occur
///
public const string CantFuncEvaluateWhenThreadIsAtUnsafePoint = nameof(CantFuncEvaluateWhenThreadIsAtUnsafePoint) + SUFFIX;
///
/// Can't func eval since all threads must execute (the code called )
///
public const string FuncEvalRequiresAllThreadsToRun = nameof(FuncEvalRequiresAllThreadsToRun) + SUFFIX;
///
/// Can't read local or argument because it's not available at the current IP or it's been optimized away
///
public const string CannotReadLocalOrArgumentMaybeOptimizedAway = nameof(CannotReadLocalOrArgumentMaybeOptimizedAway) + SUFFIX;
///
/// Runtime can't read a field, local
///
public const string RuntimeIsUnableToEvaluateExpression = nameof(RuntimeIsUnableToEvaluateExpression) + SUFFIX;
// If more errors are added, also update the code in PredefinedEvaluationErrorMessagesHelper
}
namespace Internal {
///
/// Converts values to localized strings
///
public interface IPredefinedEvaluationErrorMessagesHelper {
///
/// Gets a message
///
/// An error message (eg. one in )
///
string GetErrorMessage(string error);
}
}
}