/*
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;
using System.Collections.ObjectModel;
namespace dnSpy.Contracts.Debugger.Engine {
///
/// A class that can update a
///
public abstract class DbgEngineThread {
///
/// Gets the thread
///
public abstract DbgThread Thread { get; }
///
/// Removes the thread and disposes of it. The engine has paused the program.
///
/// Message flags
public abstract void Remove(DbgEngineMessageFlags messageFlags);
///
/// Properties to update
///
[Flags]
public enum UpdateOptions {
///
/// No option is enabled
///
None = 0,
///
/// Update
///
AppDomain = 0x00000001,
///
/// Update
///
Kind = 0x00000002,
///
/// Update
///
Id = 0x00000004,
///
/// Update
///
ManagedId = 0x00000008,
///
/// Update
///
Name = 0x00000010,
///
/// Update
///
SuspendedCount = 0x00000020,
///
/// Update
///
State = 0x00000040,
}
///
/// Updates
///
/// New value
public void UpdateAppDomain(DbgAppDomain appDomain) => Update(UpdateOptions.AppDomain, appDomain: appDomain);
///
/// Updates
///
/// New value
public void UpdateKind(string kind) => Update(UpdateOptions.Kind, kind: kind);
///
/// Updates
///
/// New value
public void UpdateId(ulong id) => Update(UpdateOptions.Id, id: id);
///
/// Updates
///
/// New value
public void UpdateManagedId(ulong? managedId) => Update(UpdateOptions.ManagedId, managedId: managedId);
///
/// Updates
///
/// New value
public void UpdateName(string name) => Update(UpdateOptions.Name, name: name);
///
/// Updates
///
/// New value
public void UpdateSuspendedCount(int suspendedCount) => Update(UpdateOptions.SuspendedCount, suspendedCount: suspendedCount);
///
/// Updates
///
/// New value
public void UpdateState(ReadOnlyCollection state) => Update(UpdateOptions.State, state: state);
///
/// Updates properties
///
/// Options
/// New value
/// New value
/// New value
/// New value
/// New value
/// New value
/// New value
public abstract void Update(UpdateOptions options, DbgAppDomain? appDomain = null, string? kind = null, ulong id = 0, ulong? managedId = null, string? name = null, int suspendedCount = 0, ReadOnlyCollection? state = null);
}
}