/*
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 .
*/
namespace dnSpy.Contracts.Debugger.Exceptions {
///
/// Thrown exception in the debugged process
///
public abstract class DbgException : DbgObject {
///
/// Gets the process
///
public DbgProcess Process => Runtime.Process;
///
/// Gets the runtime
///
public abstract DbgRuntime Runtime { get; }
///
/// Gets the exception id
///
public abstract DbgExceptionId Id { get; }
///
/// Gets the exception event flags
///
public abstract DbgExceptionEventFlags Flags { get; }
///
/// true if it's a first chance exception
///
public bool IsFirstChance => (Flags & DbgExceptionEventFlags.FirstChance) != 0;
///
/// true if it's a second chance exception
///
public bool IsSecondChance => (Flags & DbgExceptionEventFlags.SecondChance) != 0;
///
/// true if it's an unhandled exception. The program will be terminated if it tries to run again.
///
public bool IsUnhandled => (Flags & DbgExceptionEventFlags.Unhandled) != 0;
///
/// Exception message or null if none
///
public abstract string? Message { get; }
///
/// Thread where exception was thrown or null if it's not known
///
public abstract DbgThread? Thread { get; }
///
/// Module where exception was thrown or null if it's not known
///
public abstract DbgModule? Module { get; }
}
}