Skip to content

Commit e8812e7

Browse files
Capture PDBs in --make-repro-path (#121163)
Repro for dotnet/roslyn#80952 was somewhat harder to obtain because we don't pack PDBs into the repro package (they are not command line arguments and the compiler looks for them next to the assembly). This is a simple change to just look for .pdb files next to the files we're packing. Cc @dotnet/ilc-contrib
1 parent b71517e commit e8812e7

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

src/coreclr/tools/Common/CommandLineHelpers.cs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -311,9 +311,22 @@ string ConvertFromOriginalPathToReproPackagePath(bool input, string originalPath
311311
string reproFileDir = prefix + originalToReproPackageFileName.Count.ToString() + Path.DirectorySeparatorChar;
312312
reproPackagePath = Path.Combine(reproFileDir, Path.GetFileName(originalPath));
313313
if (!input)
314+
{
314315
archive.CreateEntry(reproFileDir); // for outputs just create output directory
316+
}
315317
else
318+
{
316319
archive.CreateEntryFromFile(originalPath, reproPackagePath);
320+
321+
// The compiler probes for .pdb files next to input assemblies. For simplicity, just try to look
322+
// for PDB next to any file we package.
323+
string originalPdbPath = Path.ChangeExtension(originalPath, "pdb");
324+
if (!string.Equals(originalPath, originalPdbPath, StringComparison.InvariantCultureIgnoreCase)
325+
&& File.Exists(originalPdbPath))
326+
{
327+
archive.CreateEntryFromFile(originalPdbPath, Path.ChangeExtension(reproPackagePath, "pdb"));
328+
}
329+
}
317330
originalToReproPackageFileName.Add(originalPath, reproPackagePath);
318331

319332
return reproPackagePath;

0 commit comments

Comments
 (0)