Skip to content

Commit

Permalink
Merge pull request #326 from Washi1337/feature/pdb-meta-streams
Browse files Browse the repository at this point in the history
PDB Info and DBI streams
  • Loading branch information
Washi1337 authored Jun 25, 2022
2 parents d30aa97 + e871718 commit a774186
Show file tree
Hide file tree
Showing 23 changed files with 2,346 additions and 29 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -65,22 +65,7 @@ public SerializedStringsStream(string name, in BinaryStreamReader reader)
if (!_cachedStrings.TryGetValue(index, out var value) && index < _reader.Length)
{
var stringsReader = _reader.ForkRelative(index);
byte[] rawData = stringsReader.ReadBytesUntil(0);

if (rawData.Length == 0)
{
value = Utf8String.Empty;
}
else
{
// Trim off null terminator byte if its present.
int actualLength = rawData.Length;
if (rawData[actualLength - 1] == 0)
actualLength--;

value = new Utf8String(rawData, 0, actualLength);
}

value = stringsReader.ReadUtf8String();
_cachedStrings[index] = value;
}

Expand Down
1 change: 1 addition & 0 deletions src/AsmResolver.Symbols.Pdb/AsmResolver.Symbols.Pdb.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
</PropertyGroup>

<ItemGroup>
<ProjectReference Include="..\AsmResolver.PE.File\AsmResolver.PE.File.csproj" />
<ProjectReference Include="..\AsmResolver\AsmResolver.csproj" />
</ItemGroup>

Expand Down
30 changes: 30 additions & 0 deletions src/AsmResolver.Symbols.Pdb/Metadata/Dbi/DbiAttributes.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
using System;

namespace AsmResolver.Symbols.Pdb.Metadata.Dbi;

/// <summary>
/// Provides members defining all attributes that can be assigned to a single DBI stream.
/// </summary>
[Flags]
public enum DbiAttributes : ushort
{
/// <summary>
/// Indicates no attributes were assigned.
/// </summary>
None = 0,

/// <summary>
/// Indicates the program was linked in an incremental manner.
/// </summary>
IncrementallyLinked = 1,

/// <summary>
/// Indicates private symbols were stripped from the PDB file.
/// </summary>
PrivateSymbolsStripped = 2,

/// <summary>
/// Indicates the program was linked using link.exe with the undocumented <c>/DEBUG:CTYPES</c> flag.
/// </summary>
HasConflictingTypes = 4,
}
Loading

0 comments on commit a774186

Please sign in to comment.