/* 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 System.ComponentModel; using System.Diagnostics; using System.Runtime.CompilerServices; namespace dnSpy.Contracts.Debugger { /// /// Global debugger settings. This class is thread safe. Listeners will be notified /// on a random thread. /// public abstract class DebuggerSettings : INotifyPropertyChanged { /// /// Raised when a property is changed /// public event PropertyChangedEventHandler? PropertyChanged; /// /// Raises /// /// Name of property that got changed protected void OnPropertyChanged(string propName) => PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propName)); /// /// true to use hexadecimal numbers, false to use decimal numbers /// public abstract bool UseHexadecimal { get; set; } /// /// true to use digit separators /// public abstract bool UseDigitSeparators { get; set; } /// /// true to colorize debugger tool windows and other debugger UI objects /// public abstract bool SyntaxHighlight { get; set; } /// /// true to auto open the locals window when the debugger starts /// public abstract bool AutoOpenLocalsWindow { get; set; } /// /// Use modules loaded from memory instead of files. Useful if a module gets decrypted at runtime. /// public abstract bool UseMemoryModules { get; set; } /// /// true if properties and methods can be executed (used by locals / watch windows) /// public abstract bool PropertyEvalAndFunctionCalls { get; set; } /// /// Use ToString() or similar method to get a string representation of an object (used by locals / watch windows) /// public abstract bool UseStringConversionFunction { get; set; } /// /// true to prevent detection of managed debuggers /// public abstract bool PreventManagedDebuggerDetection { get; set; } /// /// true to patch IsDebuggerPresent() so it can't be used to detect native debuggers /// public abstract bool AntiIsDebuggerPresent { get; set; } /// /// true to patch CheckRemoteDebuggerPresent() so it can't be used to detect native debuggers /// public abstract bool AntiCheckRemoteDebuggerPresent { get; set; } /// /// true to ignore break instructions and method calls /// public abstract bool IgnoreBreakInstructions { get; set; } /// /// true to break all processes when one process breaks /// public abstract bool BreakAllProcesses { get; set; } /// /// true to enable Managed Debugging Assistants (MDA) /// public abstract bool EnableManagedDebuggingAssistants { get; set; } /// /// Highlights the value of a variable that has changed in variables windows /// public abstract bool HighlightChangedVariables { get; set; } /// /// Shows raw structure of objects in variables windows /// public abstract bool ShowRawStructureOfObjects { get; set; } /// /// Sort parameters (locals window) /// public abstract bool SortParameters { get; set; } /// /// Sort locals (locals window) /// public abstract bool SortLocals { get; set; } /// /// Group parameters and locals together (locals window) /// public abstract bool GroupParametersAndLocalsTogether { get; set; } /// /// Show compiler generated variables (locals/autos window) /// public abstract bool ShowCompilerGeneratedVariables { get; set; } /// /// Show decompiler generated variables (locals/autos window) /// public abstract bool ShowDecompilerGeneratedVariables { get; set; } /// /// Hide compiler generated members in variables windows (respect debugger attributes, eg. ) /// public abstract bool HideCompilerGeneratedMembers { get; set; } /// /// Respect attributes that can hide a member, eg. and /// public abstract bool RespectHideMemberAttributes { get; set; } /// /// Hide deprecated members /// public abstract bool HideDeprecatedError { get; set; } /// /// Suppress JIT optimization on module load (system modules). If false, the code will be optimized and /// much more difficult to debug (it will be like when attaching to a process). /// System modules are all non-program modules (eg. GAC assemblies). /// public abstract bool SuppressJITOptimization_SystemModules { get; set; } /// /// Suppress JIT optimization on module load (program modules). If false, the code will be optimized and /// much more difficult to debug (it will be like when attaching to a process). /// All modules in the same folder, or sub folder, as the main executable are considered program modules. /// public abstract bool SuppressJITOptimization_ProgramModules { get; set; } /// /// Give focus to the active process /// public abstract bool FocusActiveProcess { get; set; } /// /// Give focus to the debugger when eg. a breakpoint is hit /// public abstract bool FocusDebuggerWhenProcessBreaks { get; set; } /// /// Show return values in Locals window /// public abstract bool ShowReturnValues { get; set; } /// /// Redirect GUI applications' console output to the Output window /// public abstract bool RedirectGuiConsoleOutput { get; set; } /// /// Show only public members in variables windows /// public abstract bool ShowOnlyPublicMembers { get; set; } /// /// Show all locals. Captured variables aren't shown, their display classes are shown instead. /// public abstract bool ShowRawLocals { get; set; } /// /// Async debugging (step over await statements, step out of async methods) /// public abstract bool AsyncDebugging { get; set; } /// /// Step over properties and operators /// public abstract bool StepOverPropertiesAndOperators { get; set; } /// /// Ignore unhandled exceptions /// public abstract bool IgnoreUnhandledExceptions { get; set; } /// /// Show the full string value even if it's a very long string /// public abstract bool FullString { get; set; } } }