/*
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;
namespace dnSpy.Contracts.Disassembly {
///
/// Contains the code that will be disassembled
///
public readonly struct NativeCode {
///
/// Gets the code kind
///
public NativeCodeKind Kind { get; }
///
/// Gets the optimization kind
///
public NativeCodeOptimization Optimization { get; }
///
/// All blocks to disassemble
///
public NativeCodeBlock[] Blocks { get; }
///
/// Extra optional info, or null if none
///
public NativeCodeInfo? CodeInfo { get; }
///
/// Variable info or null
///
public NativeVariableInfo[]? VariableInfo { get; }
///
/// Method name or null
///
public string? MethodName { get; }
///
/// Short method name or null
///
public string? ShortMethodName { get; }
///
/// Module name or null
///
public string? ModuleName { get; }
///
/// Constructor
///
/// Code kind
/// Optimization kind
/// All blocks to disassemble
/// Extra code info or null
/// Variable info or null
/// Method name or null
/// Short method name or null
/// Module name or null
public NativeCode(NativeCodeKind kind, NativeCodeOptimization optimization, NativeCodeBlock[] blocks, NativeCodeInfo? codeInfo, NativeVariableInfo[]? variableInfo, string? methodName, string? shortMethodName, string? moduleName) {
Kind = kind;
Optimization = optimization;
Blocks = blocks ?? throw new ArgumentNullException(nameof(blocks));
CodeInfo = codeInfo;
VariableInfo = variableInfo;
MethodName = methodName;
ShortMethodName = shortMethodName;
ModuleName = moduleName;
}
}
///
/// Base class of extra info a disassembler can use
///
public abstract class NativeCodeInfo {
}
}