예제 #1
0
 private bool StatusCallback(
     IntPtr hProcess,
     SymbolReaderNativeMethods.SymCallbackActions ActionCode,
     ulong UserData,
     ulong UserContext)
 {
     bool ret = false;
     switch (ActionCode)
     {
         case SymbolReaderNativeMethods.SymCallbackActions.CBA_SRCSRV_INFO:
         case SymbolReaderNativeMethods.SymCallbackActions.CBA_DEBUG_INFO:
             var line = new String((char*)UserData).Trim();
             m_log.WriteLine(Regex.Replace(line, @"\p{C}+", String.Empty));
             ret = true;
             break;
         default:
             // messages.Append("STATUS: Code=").Append(ActionCode).AppendLine();
             break;
     }
     return ret;
 }
예제 #2
0
        internal string FindPdbInPrivateBuilds(string pdbSimpleName, string fileVersion, SymbolReaderNativeMethods.SymFindFileInPathProc FindSymbolFileCallBack)
        {
            if (string.IsNullOrEmpty(fileVersion))
                return null;

            var arches = new string[] { "x86", "amd64" };
            foreach (var arch in arches)
            {
                var buildPath = FindPrivateBuildPdbSearchPath(fileVersion, arch);
                if (buildPath == null)
                    continue;

                pdbSimpleName = Path.GetFileNameWithoutExtension(pdbSimpleName);
                var fullPath = Path.Combine(buildPath, @"dll\" + pdbSimpleName + ".pdb");
                if (!File.Exists(fullPath))
                {
                    fullPath = Path.Combine(buildPath, @"exe\" + pdbSimpleName + ".pdb");
                    if (!File.Exists(fullPath))
                        continue;
                }

                if (FindSymbolFileCallBack(fullPath, IntPtr.Zero))
                    continue;

                return fullPath;
            }
            return null;
        }