//
        // Makes reasonable effort to construct one useful line of a stack trace. Returns null if it can't.
        //
        public static String CreateStackTraceString(IntPtr ip, bool includeFileInfo)
        {
            if (IsDiaStackTraceResolutionDisabled())
            {
                return(null);
            }

            try
            {
                int hr;

                int         rva;
                IDiaSession session = GetDiaSession(ip, out rva);
                if (session == null)
                {
                    return(null);
                }

                StringBuilder sb = new StringBuilder();
                IDiaSymbol    symbol;
                hr = session.FindSymbolByRVA(rva, SymTagEnum.SymTagFunction, out symbol);
                if (hr != S_OK)
                {
                    return(null);
                }
                String functionName;
                hr = symbol.GetName(out functionName);
                if (hr == S_OK)
                {
                    sb.Append(functionName.Demanglify());
                }
                else
                {
                    sb.Append("<Function Name Not Available>");
                }

                sb.Append(CreateParameterListString(session, symbol));

                if (includeFileInfo)
                {
                    sb.Append(CreateSourceInfoString(session, rva));
                }

                return(sb.ToString());
            }
            catch
            {
                return(null);
            }
        }