/*
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.Metadata;
namespace dnSpy.Contracts.Debugger.DotNet.Code {
///
/// .NET code location
///
public interface IDbgDotNetCodeLocation {
///
/// Gets the module
///
ModuleId Module { get; }
///
/// Gets the token of a method within the module
///
uint Token { get; }
///
/// Gets the IL offset within the method body
///
uint Offset { get; }
///
/// Gets the IL offset mapping
///
DbgILOffsetMapping ILOffsetMapping { get; }
///
/// Gets the debugger module or null
///
DbgModule? DbgModule { get; }
///
/// Gets the native address
///
DbgDotNetNativeFunctionAddress NativeAddress { get; }
}
///
/// Native address info
///
public readonly struct DbgDotNetNativeFunctionAddress {
///
/// No address
///
public static readonly DbgDotNetNativeFunctionAddress None = default;
///
/// Gets the address or 0 if it's not available
///
public ulong Address { get; }
///
/// Gets the offset relative to
///
public ulong Offset { get; }
///
/// Gets the instruction pointer
///
public ulong IP => Address + Offset;
///
/// Constructor
///
/// Address or 0 if it's not available
/// Offset relative to
public DbgDotNetNativeFunctionAddress(ulong address, ulong offset) {
Address = address;
Offset = offset;
}
}
}