Skip to content

Commit

Permalink
Fixes for CreateFromDbgEng (#1277)
Browse files Browse the repository at this point in the history
* Fix transposed filesize/timestamp

* Add symbol credential to CreateFromDbgEng
  • Loading branch information
leculver authored Jul 11, 2024
1 parent 5d7e526 commit eac78be
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ public IEnumerable<ModuleInfo> EnumerateModules()
{
string? fn = _symbols.GetModuleNameStringWide(DebugModuleName.Image, i, bases[i]) ?? "";

ModuleInfo info = new PEModuleInfo(this, bases[i], fn, true, mods[i].Size, mods[i].TimeDateStamp, GetVersionInfo(bases[i]));
ModuleInfo info = new PEModuleInfo(this, bases[i], fn, true, mods[i].TimeDateStamp, mods[i].Size, GetVersionInfo(bases[i]));
modules.Add(info);
}
}
Expand Down
5 changes: 3 additions & 2 deletions src/Microsoft.Diagnostics.Runtime/DataTarget.cs
Original file line number Diff line number Diff line change
Expand Up @@ -442,13 +442,14 @@ public static DataTarget CreateSnapshotAndAttach(int processId, TokenCredential?
/// (cdb.exe, windbg.exe, dbgeng.dll).
/// </summary>
/// <param name="pDebugClient">An IDebugClient interface.</param>
/// <param name="symbolCredential">A TokenCredential for azure based symbol servers.</param>
/// <returns>A <see cref="DataTarget"/> instance.</returns>
public static DataTarget CreateFromDbgEng(IntPtr pDebugClient)
public static DataTarget CreateFromDbgEng(IntPtr pDebugClient, TokenCredential? symbolCredential = null)
{
if (!RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
throw GetPlatformException();

CustomDataTarget customTarget = new(new DbgEngDataReader(pDebugClient), null);
CustomDataTarget customTarget = new(new DbgEngDataReader(pDebugClient), symbolCredential);
return new DataTarget(customTarget);
}

Expand Down

0 comments on commit eac78be

Please sign in to comment.