We need you! We're working hard on the next version of Developer Fusion -
Let us know what you think we should be up to!
-
Expand
Microsoft.Win32
-
Expand
Microsoft.Win32.SafeHandles
-
Expand
System
-
Expand
System.Runtime.Hosting
-
Expand
System.Runtime.InteropServices
-
Expand
System.Runtime.CompilerServices
-
Expand
System.Collections
-
Expand
System.Collections.Generic
-
Expand
System.Collections.ObjectModel
-
Expand
System.Configuration.Assemblies
-
Expand
System.Diagnostics
-
Expand
Assert
-
Expand
AssertFilter
-
Expand
AssertFilters
-
Expand
AssertSection
-
Expand
AssertWrapper
-
Expand
AsyncStreamReader
-
Expand
BooleanSwitch
-
Expand
ConditionalAttribute
-
Expand
ConsoleTraceListener
-
Expand
CorrelationManager
-
Expand
CounterSampleCalculator
-
Expand
DataReceivedEventArgs
-
Expand
Debug
-
Expand
DebuggableAttribute
-
Expand
Debugger
-
Expand
DebuggerBrowsableAttribute
-
Expand
DebuggerBrowsableState
-
Expand
DebuggerDisplayAttribute
-
Expand
DebuggerHiddenAttribute
-
Expand
DebuggerNonUserCodeAttribute
-
Expand
DebuggerStepperBoundaryAttribute
-
Expand
DebuggerStepThroughAttribute
-
Expand
DebuggerTypeProxyAttribute
-
Expand
DebuggerVisualizerAttribute
-
Expand
DebuggingModes
-
Expand
DefaultFilter
-
Expand
DefaultTraceListener
-
Expand
DelimitedListTraceListener
-
Expand
DiagnosticsConfiguration
-
Expand
DiagnosticsConfigurationHandler
-
Expand
EnvironmentBlock
-
Expand
EventTypeFilter
-
Expand
FilterElement
-
Expand
fred
-
Expand
InitState
-
Expand
ListenerElement
-
Expand
ListenerElementsCollection
-
Expand
Log
-
Expand
LoggingLevels
-
Expand
LogSwitch
-
Expand
ModuleInfo
-
Expand
MonitoringDescriptionAttribute
-
Expand
OrdinalCaseInsensitiveComparer
-
Expand
PerfCounterSection
-
Expand
Process
-
Expand
ProcessInfo
-
Expand
ProcessPriorityClass
-
Expand
ProcessStartInfo
-
Expand
ProcessThreadTimes
-
Expand
ProcessWaitHandle
-
Expand
ProcessWindowStyle
-
Expand
SharedListenerElementsCollection
-
Expand
SourceElement
-
Expand
SourceElementsCollection
-
Expand
SourceFilter
-
Expand
SourceLevels
-
Expand
SourceSwitch
-
Expand
StackFrame
-
Expand
StackFrameHelper
-
Expand
StackTrace
-
CalculateFramesToSkip(StackFrameHelper, int)
-
CaptureStackTrace(int, bool, Thread, Exception)
-
FrameCount()
-
GetFrame(int)
-
GetFrames()
-
GetManagedStackTraceStringHelper(bool)
-
GetStackFramesInternal(StackFrameHelper, int, Exception)
-
StackTrace()
-
StackTrace(bool)
-
StackTrace(Exception)
-
StackTrace(Exception, bool)
-
StackTrace(Exception, int)
-
StackTrace(Exception, int, bool)
-
StackTrace(int)
-
StackTrace(int, bool)
-
StackTrace(StackFrame)
-
StackTrace(Thread, bool)
-
ToString()
-
ToString(TraceFormat)
-
Expand
State
-
Expand
Stopwatch
-
Expand
StreamReadMode
-
Expand
Switch
-
Expand
SwitchAttribute
-
Expand
SwitchElement
-
Expand
SwitchElementsCollection
-
Expand
SwitchesDictionarySectionHandler
-
Expand
SwitchLevelAttribute
-
Expand
SystemDiagnosticsSection
-
Expand
TextWriterTraceListener
-
Expand
ThreadInfo
-
Expand
Trace
-
Expand
TraceEventCache
-
Expand
TraceEventType
-
Expand
TraceFilter
-
Expand
TraceFormat
-
Expand
TraceInternal
-
Expand
TraceLevel
-
Expand
TraceListener
-
Expand
TraceListenerCollection
-
Expand
TraceOptions
-
Expand
TraceSection
-
Expand
TraceSource
-
Expand
TraceSwitch
-
Expand
TraceUtils
-
Expand
TypedElement
-
Expand
XmlWriterTraceListener
-
Expand
System.Diagnostics.CodeAnalysis
-
Expand
System.Diagnostics.SymbolStore
-
Expand
System.Globalization
-
Expand
System.IO
-
Expand
System.IO.IsolatedStorage
-
Expand
System.Reflection
-
Expand
System.Reflection.Cache
-
Expand
System.Reflection.Emit
-
Expand
System.Resources
-
Expand
System.Runtime
-
Expand
System.Runtime.InteropServices.Expando
-
Expand
System.Runtime.ConstrainedExecution
-
Expand
System.Runtime.Remoting.Activation
-
Expand
System.Runtime.Remoting.Messaging
-
Expand
System.Runtime.Remoting.Channels
-
Expand
System.Runtime.Remoting.Lifetime
-
Expand
System.Runtime.Remoting
-
Expand
System.Runtime.Remoting.Contexts
-
Expand
System.Runtime.Remoting.Proxies
-
Expand
System.Runtime.Remoting.Metadata
-
Expand
System.Runtime.Remoting.Metadata.W3cXsd2001
-
Expand
System.Runtime.Remoting.Services
-
Expand
System.Runtime.Serialization
-
Expand
System.Runtime.Serialization.Formatters
-
Expand
System.Runtime.Serialization.Formatters.Binary
-
Expand
System.Runtime.Versioning
-
Expand
System.Security
-
Expand
System.Security.Cryptography
-
Expand
System.Security.Cryptography.X509Certificates
-
Expand
System.Security.Permissions
-
Expand
System.Security.Policy
-
Expand
System.Security.Principal
-
Expand
System.Security.Util
-
Expand
System.Text
-
Expand
System.Threading
-
Expand
System.Runtime.Remoting.Channels.Http
-
Expand
System.Runtime.Remoting.Channels.Tcp
-
Expand
System.Runtime.Remoting.MetadataServices
-
Expand
System.Runtime.Serialization.Formatters.Soap.Xml
-
Expand
System.Runtime.Serialization.Formatters.Soap
-
Expand
Microsoft.Tools.Caspol
-
Expand
Microsoft.Tools.Build
-
Expand
Microsoft.CSharp
-
Expand
System.CodeDom
-
Expand
System.CodeDom.Compiler
-
Expand
System.Collections.Specialized
-
Expand
System.ComponentModel
-
Expand
System.ComponentModel.Design
-
Expand
System.ComponentModel.Design.Serialization
-
Expand
System.Configuration
-
Expand
System.Web
-
Expand
System.Configuration.Provider
-
Expand
System.Configuration.Internal
-
Expand
System.Internal
-
Expand
System.Windows.Forms
-
Expand
System.Net
-
Expand
System.Net.Sockets
-
Expand
System.Net.NetworkInformation
-
Expand
System.Net.ComImports
-
Expand
System.Net.Security
-
Expand
System.Net.Cache
-
Expand
System.Net.Configuration
-
Expand
System.Text.RegularExpressions
-
Expand
System.Tools
-
Expand
System.IO.Compression
-
Expand
System.IO.Ports
-
Expand
System.Security.AccessControl
-
Expand
System.Xml
-
Expand
System.Xml.XPath.DataBinding
-
Expand
System.Xml.Schema
-
Expand
System.Xml.Serialization
-
Expand
System.Xml.Serialization.Advanced
-
Expand
System.Xml.Serialization.Configuration
-
Expand
System.Xml.XPath
-
Expand
System.Xml.Xsl
-
Expand
System.Xml.Xsl.IlGen
-
Expand
System.Xml.Xsl.Qil
-
Expand
System.Xml.Xsl.Runtime
-
Expand
System.Xml.Xsl.XPath
-
Expand
System.Xml.Xsl.Xslt
-
Expand
System.Xml.Xsl.XsltOld
-
Expand
System.Xml.Xsl.XsltOld.Debugger
-
Expand
Microsoft.JScript
-
Expand
Microsoft.Vsa
-
Expand
Microsoft.JScript.Vsa
- namespace System.Diagnostics
- {
- using System.Text;
- using System.Threading;
- using System;
- using System.Security;
- using System.Security.Permissions;
- using System.IO;
- using System.Reflection;
- using System.Runtime.InteropServices;
- using System.Runtime.CompilerServices;
- using System.Globalization;
- using System.Runtime.Serialization;
-
-
-
-
-
- [Serializable()]
- internal class StackFrameHelper
- {
- [NonSerialized()]
- private Thread targetThread;
- private int[] rgiOffset;
- private int[] rgiILOffset;
-
- private MethodBase[] rgMethodBase;
-
- #pragma warning disable 414 // Field is not used from managed.
-
-
- private object dynamicMethods;
- #pragma warning restore 414
-
- [NonSerialized()]
- private RuntimeMethodHandle[] rgMethodHandle;
- private string[] rgFilename;
- private int[] rgiLineNumber;
- private int[] rgiColumnNumber;
- private int iFrameCount;
- private bool fNeedFileInfo;
-
-
- public StackFrameHelper(bool fNeedFileLineColInfo, Thread target)
- {
- targetThread = target;
- rgMethodBase = null;
- rgMethodHandle = null;
- rgiOffset = null;
- rgiILOffset = null;
- rgFilename = null;
- rgiLineNumber = null;
- rgiColumnNumber = null;
- dynamicMethods = null;
- iFrameCount = 512;
-
-
- fNeedFileInfo = fNeedFileLineColInfo;
- }
-
- public virtual MethodBase GetMethodBase(int i)
- {
-
-
-
-
-
- RuntimeMethodHandle mh = rgMethodHandle[i];
-
- if (mh.IsNullHandle())
- return null;
-
- mh = mh.GetTypicalMethodDefinition();
-
- return RuntimeType.GetMethodBase(mh);
- }
-
- public virtual int GetOffset(int i)
- {
- return rgiOffset[i];
- }
- public virtual int GetILOffset(int i)
- {
- return rgiILOffset[i];
- }
- public virtual string GetFilename(int i)
- {
- return rgFilename[i];
- }
- public virtual int GetLineNumber(int i)
- {
- return rgiLineNumber[i];
- }
- public virtual int GetColumnNumber(int i)
- {
- return rgiColumnNumber[i];
- }
- public virtual int GetNumberOfFrames()
- {
- return iFrameCount;
- }
- public virtual void SetNumberOfFrames(int i)
- {
- iFrameCount = i;
- }
-
-
-
-
- [OnSerializing()]
- void OnSerializing(StreamingContext context)
- {
- rgMethodBase = (rgMethodHandle == null) ? null : new MethodBase[rgMethodHandle.Length];
- if (rgMethodHandle != null) {
- for (int i = 0; i < rgMethodHandle.Length; i++) {
- if (!rgMethodHandle[i].IsNullHandle())
- rgMethodBase[i] = RuntimeType.GetMethodBase(rgMethodHandle[i]);
- }
- }
- }
-
- [OnSerialized()]
- void OnSerialized(StreamingContext context)
- {
-
- rgMethodBase = null;
- }
-
- [OnDeserialized()]
- void OnDeserialized(StreamingContext context)
- {
-
- rgMethodHandle = (rgMethodBase == null) ? null : new RuntimeMethodHandle[rgMethodBase.Length];
- if (rgMethodBase != null) {
- for (int i = 0; i < rgMethodBase.Length; i++) {
- if (rgMethodBase[i] != null)
- rgMethodHandle[i] = rgMethodBase[i].MethodHandle;
- }
- }
- rgMethodBase = null;
- }
- }
-
-
-
-
-
-
-
- [SecurityPermission(SecurityAction.InheritanceDemand, UnmanagedCode = true)]
- [Serializable()]
- [System.Runtime.InteropServices.ComVisible(true)]
- public class StackTrace
- {
- private StackFrame[] frames;
- private int m_iNumOfFrames;
- public const int METHODS_TO_SKIP = 0;
- private int m_iMethodsToSkip;
-
-
- public StackTrace()
- {
- m_iNumOfFrames = 0;
- m_iMethodsToSkip = 0;
- CaptureStackTrace(METHODS_TO_SKIP, false, null, null);
- }
-
-
-
- public StackTrace(bool fNeedFileInfo)
- {
- m_iNumOfFrames = 0;
- m_iMethodsToSkip = 0;
- CaptureStackTrace(METHODS_TO_SKIP, fNeedFileInfo, null, null);
- }
-
-
-
-
- public StackTrace(int skipFrames)
- {
-
- if (skipFrames < 0)
- throw new ArgumentOutOfRangeException("skipFrames", Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegNum"));
-
- m_iNumOfFrames = 0;
- m_iMethodsToSkip = 0;
-
- CaptureStackTrace(skipFrames + METHODS_TO_SKIP, false, null, null);
- }
-
-
-
-
- public StackTrace(int skipFrames, bool fNeedFileInfo)
- {
-
- if (skipFrames < 0)
- throw new ArgumentOutOfRangeException("skipFrames", Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegNum"));
-
- m_iNumOfFrames = 0;
- m_iMethodsToSkip = 0;
-
- CaptureStackTrace(skipFrames + METHODS_TO_SKIP, fNeedFileInfo, null, null);
- }
-
-
-
- public StackTrace(Exception e)
- {
- if (e == null)
- throw new ArgumentNullException("e");
-
- m_iNumOfFrames = 0;
- m_iMethodsToSkip = 0;
- CaptureStackTrace(METHODS_TO_SKIP, false, null, e);
- }
-
-
-
- public StackTrace(Exception e, bool fNeedFileInfo)
- {
- if (e == null)
- throw new ArgumentNullException("e");
-
- m_iNumOfFrames = 0;
- m_iMethodsToSkip = 0;
- CaptureStackTrace(METHODS_TO_SKIP, fNeedFileInfo, null, e);
- }
-
-
-
-
- public StackTrace(Exception e, int skipFrames)
- {
- if (e == null)
- throw new ArgumentNullException("e");
-
- if (skipFrames < 0)
- throw new ArgumentOutOfRangeException("skipFrames", Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegNum"));
-
- m_iNumOfFrames = 0;
- m_iMethodsToSkip = 0;
-
- CaptureStackTrace(skipFrames + METHODS_TO_SKIP, false, null, e);
- }
-
-
-
-
- public StackTrace(Exception e, int skipFrames, bool fNeedFileInfo)
- {
- if (e == null)
- throw new ArgumentNullException("e");
-
- if (skipFrames < 0)
- throw new ArgumentOutOfRangeException("skipFrames", Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegNum"));
-
- m_iNumOfFrames = 0;
- m_iMethodsToSkip = 0;
-
- CaptureStackTrace(skipFrames + METHODS_TO_SKIP, fNeedFileInfo, null, e);
- }
-
-
-
-
-
- public StackTrace(StackFrame frame)
- {
- frames = new StackFrame[1];
- frames[0] = frame;
- m_iMethodsToSkip = 0;
- m_iNumOfFrames = 1;
- }
-
-
-
-
- public StackTrace(Thread targetThread, bool needFileInfo)
- {
- m_iNumOfFrames = 0;
- m_iMethodsToSkip = 0;
-
- CaptureStackTrace(METHODS_TO_SKIP, needFileInfo, targetThread, null);
-
- }
-
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- static internal extern void GetStackFramesInternal(StackFrameHelper sfh, int iSkip, Exception e);
-
- static internal int CalculateFramesToSkip(StackFrameHelper StackF, int iNumFrames)
- {
-
- int iRetVal = 0;
- string PackageName = "System.Diagnostics";
-
-
-
-
- for (int i = 0; i < iNumFrames; i++) {
- MethodBase mb = StackF.GetMethodBase(i);
- if (mb != null) {
- Type t = mb.DeclaringType;
- if (t == null)
- break;
- string ns = t.Namespace;
- if (ns == null)
- break;
- if (String.Compare(ns, PackageName, StringComparison.Ordinal) != 0)
- break;
- }
- iRetVal++;
- }
-
- return iRetVal;
- }
-
-
-
-
- private void CaptureStackTrace(int iSkip, bool fNeedFileInfo, Thread targetThread, Exception e)
- {
- m_iMethodsToSkip += iSkip;
-
- StackFrameHelper StackF = new StackFrameHelper(fNeedFileInfo, targetThread);
-
- GetStackFramesInternal(StackF, 0, e);
-
- m_iNumOfFrames = StackF.GetNumberOfFrames();
-
- if (m_iMethodsToSkip > m_iNumOfFrames)
- m_iMethodsToSkip = m_iNumOfFrames;
-
- if (m_iNumOfFrames != 0) {
- frames = new StackFrame[m_iNumOfFrames];
-
- for (int i = 0; i < m_iNumOfFrames; i++) {
- bool fDummy1 = true;
- bool fDummy2 = true;
- StackFrame sfTemp = new StackFrame(fDummy1, fDummy2);
-
- sfTemp.SetMethodBase(StackF.GetMethodBase(i));
- sfTemp.SetOffset(StackF.GetOffset(i));
- sfTemp.SetILOffset(StackF.GetILOffset(i));
-
- if (fNeedFileInfo) {
- sfTemp.SetFileName(StackF.GetFilename(i));
- sfTemp.SetLineNumber(StackF.GetLineNumber(i));
- sfTemp.SetColumnNumber(StackF.GetColumnNumber(i));
- }
-
- frames[i] = sfTemp;
- }
-
-
-
- if (e == null)
- m_iMethodsToSkip += CalculateFramesToSkip(StackF, m_iNumOfFrames);
-
- m_iNumOfFrames -= m_iMethodsToSkip;
- if (m_iNumOfFrames < 0) {
- m_iNumOfFrames = 0;
- }
- }
- else
-
-
- frames = null;
- }
-
-
-
- public virtual int FrameCount {
- get { return m_iNumOfFrames; }
- }
-
-
-
-
-
- public virtual StackFrame GetFrame(int index)
- {
- if ((frames != null) && (index < m_iNumOfFrames) && (index >= 0))
- return frames[index + m_iMethodsToSkip];
-
- return null;
- }
-
-
-
-
-
-
- [ComVisible(false)]
- public virtual StackFrame[] GetFrames()
- {
- if (frames == null || m_iNumOfFrames <= 0)
- return null;
-
- StackFrame[] array = new StackFrame[m_iNumOfFrames];
- Array.Copy(frames, m_iMethodsToSkip, array, 0, m_iNumOfFrames);
- return array;
- }
-
-
-
- public override string ToString()
- {
-
- return ToString(TraceFormat.TrailingNewLine);
- }
-
-
-
- internal enum TraceFormat
- {
- Normal,
- TrailingNewLine,
-
- NoResourceLookup
-
- }
-
-
-
- internal string ToString(TraceFormat traceFormat)
- {
- string word_At = "at";
- string inFileLineNum = "in {0}:line {1}";
-
- if (traceFormat != TraceFormat.NoResourceLookup) {
- word_At = Environment.GetResourceString("Word_At");
- inFileLineNum = Environment.GetResourceString("StackTrace_InFileLineNumber");
- }
-
- bool fFirstFrame = true;
- StringBuilder sb = new StringBuilder(255);
- for (int iFrameIndex = 0; iFrameIndex < m_iNumOfFrames; iFrameIndex++) {
- StackFrame sf = GetFrame(iFrameIndex);
- MethodBase mb = sf.GetMethod();
- if (mb != null) {
-
- if (fFirstFrame)
- fFirstFrame = false;
- else
- sb.Append(Environment.NewLine);
-
- sb.AppendFormat(CultureInfo.InvariantCulture, " {0} ", word_At);
-
- Type t = mb.DeclaringType;
-
- if (t != null) {
- sb.Append(t.FullName.Replace('+', '.'));
- sb.Append(".");
- }
- sb.Append(mb.Name);
-
-
- if (mb is MethodInfo && ((MethodInfo)mb).IsGenericMethod) {
- Type[] typars = ((MethodInfo)mb).GetGenericArguments();
- sb.Append("[");
- int k = 0;
- bool fFirstTyParam = true;
- while (k < typars.Length) {
- if (fFirstTyParam == false)
- sb.Append(",");
- else
- fFirstTyParam = false;
-
- sb.Append(typars[k].Name);
- k++;
- }
- sb.Append("]");
- }
-
-
- sb.Append("(");
- ParameterInfo[] pi = mb.GetParameters();
- bool fFirstParam = true;
- for (int j = 0; j < pi.Length; j++) {
- if (fFirstParam == false)
- sb.Append(", ");
- else
- fFirstParam = false;
-
- string typeName = "<UnknownType>";
- if (pi[j].ParameterType != null)
- typeName = pi[j].ParameterType.Name;
- sb.Append(typeName + " " + pi[j].Name);
- }
- sb.Append(")");
-
-
- if (sf.GetILOffset() != -1) {
-
-
- string fileName = null;
-
- try {
- fileName = sf.GetFileName();
- }
- catch (SecurityException) {
- }
-
- if (fileName != null) {
-
- sb.Append(' ');
- sb.AppendFormat(CultureInfo.InvariantCulture, inFileLineNum, fileName, sf.GetFileLineNumber());
- }
- }
-
- }
- }
-
- if (traceFormat == TraceFormat.TrailingNewLine)
- sb.Append(Environment.NewLine);
-
- return sb.ToString();
- }
-
-
-
- private static string GetManagedStackTraceStringHelper(bool fNeedFileInfo)
- {
-
-
-
- StackTrace st = new StackTrace(0, fNeedFileInfo);
- return st.ToString();
- }
- }
-
- }