< Summary

Line coverage
0%
Covered lines: 0
Uncovered lines: 17
Coverable lines: 17
Total lines: 86
Line coverage: 0%
Branch coverage
N/A
Covered branches: 0
Total branches: 0
Branch coverage: N/A
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

MethodBranch coverage Cyclomatic complexity NPath complexity Sequence coverage
.ctor(...)100%110%

File(s)

https://raw.githubusercontent.com/dotnet/runtime/811a7eabb75c42db53440e8ba3f60c07511cfd1f/src/libraries/System.Reflection.Metadata/src/System/Reflection/PortableExecutable/DebugDirectory/DebugDirectoryEntry.cs

#LineLine coverage
 1// Licensed to the .NET Foundation under one or more agreements.
 2// The .NET Foundation licenses this file to you under the MIT license.
 3
 4using System.Reflection.Metadata;
 5
 6namespace System.Reflection.PortableExecutable
 7{
 8    /// <summary>
 9    /// Identifies the location, size and format of a block of debug information.
 10    /// </summary>
 11    public readonly struct DebugDirectoryEntry
 12    {
 13        internal const int Size =
 14            sizeof(uint) +   // Characteristics
 15            sizeof(uint) +   // TimeDataStamp
 16            sizeof(uint) +   // Version
 17            sizeof(uint) +   // Type
 18            sizeof(uint) +   // SizeOfData
 19            sizeof(uint) +   // AddressOfRawData
 20            sizeof(uint);    // PointerToRawData
 21
 22        /// <summary>
 23        /// The time and date that the debug data was created if the PE/COFF file is not deterministic,
 24        /// otherwise a value based on the hash of the content.
 25        /// </summary>
 26        /// <remarks>
 27        /// The algorithm used to calculate this value is an implementation
 28        /// detail of the tool that produced the file.
 29        /// </remarks>
 030        public uint Stamp { get; }
 31
 32        /// <summary>
 33        /// The major version number of the debug data format.
 34        /// </summary>
 035        public ushort MajorVersion { get; }
 36
 37        /// <summary>
 38        /// The minor version number of the debug data format.
 39        /// </summary>
 040        public ushort MinorVersion { get; }
 41
 42        /// <summary>
 43        /// The format of debugging information.
 44        /// </summary>
 045        public DebugDirectoryEntryType Type { get; }
 46
 47        /// <summary>
 48        /// The size of the debug data (not including the debug directory itself).
 49        /// </summary>
 050        public int DataSize { get; }
 51
 52        /// <summary>
 53        /// The address of the debug data when loaded, relative to the image base.
 54        /// </summary>
 055        public int DataRelativeVirtualAddress { get; }
 56
 57        /// <summary>
 58        /// The file pointer to the debug data.
 59        /// </summary>
 060        public int DataPointer { get; }
 61
 62        /// <summary>
 63        /// True if the entry is a <see cref="DebugDirectoryEntryType.CodeView"/> entry pointing to a Portable PDB.
 64        /// </summary>
 065        public bool IsPortableCodeView => MinorVersion == PortablePdbVersions.PortableCodeViewVersionMagic;
 66
 67        public DebugDirectoryEntry(
 68            uint stamp,
 69            ushort majorVersion,
 70            ushort minorVersion,
 71            DebugDirectoryEntryType type,
 72            int dataSize,
 73            int dataRelativeVirtualAddress,
 74            int dataPointer)
 075        {
 076            Stamp = stamp;
 077            MajorVersion = majorVersion;
 078            MinorVersion = minorVersion;
 079            Type = type;
 080            DataSize = dataSize;
 081            DataRelativeVirtualAddress = dataRelativeVirtualAddress;
 082            DataPointer = dataPointer;
 083        }
 84    }
 85}
 86