Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PDB Info and DBI streams #326

Merged
merged 16 commits into from
Jun 25, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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