Skip to content

Commit fedec67

Browse files
author
Vance Morrison
committed
Minor changes in symbol lookup. Added Nuget and reference source PDB sources.
1 parent 20a6bcc commit fedec67

File tree

3 files changed

+35
-15
lines changed

3 files changed

+35
-15
lines changed

src/HeapDump/GCHeapDumper.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1760,8 +1760,7 @@ private void DumpAllSegments()
17601760
if (m_gcHeapDump.MemoryGraph.NodeCount >= m_maxNodeCount ||
17611761
m_gcHeapDump.MemoryGraph.DistinctRefCount + m_children.Count > m_maxNodeCount)
17621762
{
1763-
m_log.WriteLine("WARNING, exceeded the maximum number of node allowed {0} (because dump will be larger than 4GB))",
1764-
m_maxNodeCount);
1763+
m_log.WriteLine("WARNING, exceeded the maximum number of node allowed {0}", m_maxNodeCount);
17651764
m_log.WriteLine("{0,5:f1}s: Truncating heap dump.", m_sw.Elapsed.TotalSeconds);
17661765
return;
17671766
}

src/TraceEvent/Symbols/SymbolPath.cs

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -72,17 +72,11 @@ public static string MicrosoftSymbolServerPath
7272
#if !PUBLIC_ONLY
7373
if (ComputerNameExists("symweb.corp.microsoft.com"))
7474
s_MicrosoftSymbolServerPath = "SRV*http://symweb.corp.microsoft.com"; // Internal Microsoft location.
75-
else
76-
s_MicrosoftSymbolServerPath = "SRV*http://msdl.microsoft.com/download/symbols";
77-
78-
// TODO Is this a hack?
79-
if (SymbolPath.ComputerNameExists("ddrps.corp.microsoft.com"))
80-
s_MicrosoftSymbolServerPath = s_MicrosoftSymbolServerPath + ";" + @"SRV*\\ddrps.corp.microsoft.com\symbols";
81-
if (SymbolPath.ComputerNameExists("clrmain"))
82-
s_MicrosoftSymbolServerPath = s_MicrosoftSymbolServerPath + ";" + @"SRV*\\clrmain\symbols";
83-
#else
84-
s_MicrosoftSymbolServerPath = "SRV*http://msdl.microsoft.com/download/symbols";
8575
#endif
76+
s_MicrosoftSymbolServerPath = s_MicrosoftSymbolServerPath +
77+
";" + @"SRV*http://msdl.microsoft.com/download/symbols" + // Operatig system Symbols
78+
";" + @"SRV*https://nuget.smbsrc.net" + // Nuget symbols
79+
";" + @"SRV*http://referencesource.microsoft.com/symbols"; // .NET Runtime desktop symbols
8680
}
8781
return s_MicrosoftSymbolServerPath;
8882
}

src/TraceEvent/Symbols/SymbolReader.cs

Lines changed: 30 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -746,7 +746,12 @@ internal bool GetPhysicalFileFromServer(string serverPath, string pdbIndexPath,
746746
{
747747
if (Uri.IsWellFormedUriString(serverPath, UriKind.Absolute))
748748
{
749-
var fullUri = serverPath + "/" + pdbIndexPath.Replace('\\', '/');
749+
var fullUri = serverPath;
750+
var tail = pdbIndexPath.Replace('\\', '/');
751+
if (!tail.StartsWith("/"))
752+
fullUri += "/" + tail;
753+
else
754+
fullUri += tail;
750755
try
751756
{
752757
var req = (System.Net.HttpWebRequest)System.Net.HttpWebRequest.Create(fullUri);
@@ -1659,6 +1664,8 @@ internal void LogManagedInfo(string pdbName, Guid pdbGuid, int pdbAge)
16591664
/// Gets the 'srcsvc' data stream from the PDB and return it in as a string. Returns null if it is not present.
16601665
///
16611666
/// There is a tool called pdbstr associated with srcsrv that basically does this.
1667+
/// pdbstr -r -s:srcsrv -p:PDBPATH
1668+
/// will dump it.
16621669
/// </summary>
16631670
internal string GetSrcSrvStream()
16641671
{
@@ -2115,6 +2122,21 @@ public bool ChecksumMatches
21152122
/// information from the PDB from 'pdbPath'. Will return a path to the returned file (uses
21162123
/// SourceCacheDirectory associated symbol reader for context where to put the file),
21172124
/// or null if unsuccessful.
2125+
///
2126+
/// There is a tool called pdbstr associated with srcsrv that basically does this.
2127+
/// pdbstr -r -s:srcsrv -p:PDBPATH
2128+
/// will dump it.
2129+
///
2130+
/// The basic flow is
2131+
///
2132+
/// There is a variables section and a files section
2133+
///
2134+
/// The file section is a list of items separated by *. The first is the path, the rest are up to you
2135+
///
2136+
/// You form a command by using the SRCSRVTRG variable and substituting variables %var1 where var1 is the first item in the * separated list
2137+
/// There are special operators %fnfile%(XXX), etc that manipulate the string XXX (get file name, translate \ to / ...
2138+
///
2139+
/// If what is at the end is a valid URL it is looked up.
21182140
/// </summary>
21192141
string GetSourceFromSrcServer()
21202142
{
@@ -2162,7 +2184,7 @@ string GetSourceFromSrcServer()
21622184
if (pieces.Length >= 2)
21632185
{
21642186
var buildTimePath = pieces[0];
2165-
// log.WriteLine("Found source {0} in the PDB", buildTimePath);
2187+
log.WriteLine("Found source {0} in the PDB", buildTimePath);
21662188
if (string.Compare(BuildTimeFilePath, buildTimePath, StringComparison.OrdinalIgnoreCase) == 0)
21672189
{
21682190
// Create variables for each of the pieces.
@@ -2174,7 +2196,6 @@ string GetSourceFromSrcServer()
21742196
{
21752197
if (Uri.IsWellFormedUriString(target, UriKind.Absolute))
21762198
{
2177-
log.WriteLine("Fetching file {0} from web.", target);
21782199
var url = target;
21792200
target = null;
21802201
if (vars.ContainsKey("HTTP_ALIAS"))
@@ -2327,9 +2348,15 @@ private static string FindTfExe()
23272348

23282349
private string SourceServerFetchVar(string variable, Dictionary<string, string> vars)
23292350
{
2351+
var log = m_symbolModule.m_reader.m_log;
23302352
string result = "";
23312353
if (vars.TryGetValue(variable, out result))
2354+
{
2355+
if (0 <= result.IndexOf('%') )
2356+
log.WriteLine("SourceServerFetchVar: Before Evaluation {0} = '{1}'", variable, result);
23322357
result = SourceServerEvaluate(result, vars);
2358+
}
2359+
log.WriteLine("SourceServerFetchVar: {0} = '{1}'", variable, result);
23332360
return result;
23342361
}
23352362

0 commit comments

Comments
 (0)