Imported Upstream version 4.2.0.179

Former-commit-id: 0a113cb3a6feb7873f632839b1307cc6033cd595
This commit is contained in:
Xamarin Public Jenkins
2015-08-26 07:17:56 -04:00
committed by Jo Shields
parent 183bba2c9a
commit 6992685b86
7507 changed files with 90259 additions and 657307 deletions

View File

@@ -1,59 +0,0 @@
//
// ConditionalAttribute.cs
//
// Author:
// Nick Drochak II (ndrochak@gol.com)
//
// (C) 2001 Nick Drochak II
//
//
// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
using System.Runtime.InteropServices;
namespace System.Diagnostics
{
[Serializable]
[AttributeUsage(
AttributeTargets.Class |
AttributeTargets.Method, AllowMultiple = true)]
[ComVisible (true)]
public sealed class ConditionalAttribute : System.Attribute
{
private string myCondition;
// Public Instance Constructors
public ConditionalAttribute(string conditionString)
{
myCondition = conditionString;
}
// Public Instance Properties
public string ConditionString { get { return myCondition; }
}
}
}

View File

@@ -1,86 +0,0 @@
//
// DebuggableAttribute.cs
//
// Author:
// Nick Drochak II (ndrochak@gol.com)
// Ben S. Stahlhood II (bstahlhood@gmail.com)
//
// (C) 2001 Nick Drochak II
//
//
// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
using System.Runtime.InteropServices;
namespace System.Diagnostics {
[AttributeUsage (AttributeTargets.Assembly | AttributeTargets.Module)]
[ComVisible (true)]
public sealed class DebuggableAttribute : System.Attribute {
private bool JITTrackingEnabledFlag;
private bool JITOptimizerDisabledFlag;
[Flags]
[ComVisible (true)]
public enum DebuggingModes {
// Fields
None = 0,
Default = 1,
IgnoreSymbolStoreSequencePoints = 2,
EnableEditAndContinue = 4,
DisableOptimizations = 256
}
private DebuggingModes debuggingModes = DebuggingModes.None;
public DebuggingModes DebuggingFlags {
get { return debuggingModes; }
}
// Public Instance Constructors
public DebuggableAttribute(bool isJITTrackingEnabled, bool isJITOptimizerDisabled)
{
JITTrackingEnabledFlag = isJITTrackingEnabled;
JITOptimizerDisabledFlag = isJITOptimizerDisabled;
if (isJITTrackingEnabled)
debuggingModes |= DebuggingModes.Default;
if (isJITOptimizerDisabled)
debuggingModes |= DebuggingModes.DisableOptimizations;
}
public DebuggableAttribute(DebuggingModes modes)
{
debuggingModes = modes;
JITTrackingEnabledFlag = (debuggingModes & DebuggingModes.Default) != 0;
JITOptimizerDisabledFlag = (debuggingModes & DebuggingModes.DisableOptimizations) != 0;
}
// Public Instance Properties
public bool IsJITTrackingEnabled { get { return JITTrackingEnabledFlag; } }
public bool IsJITOptimizerDisabled { get { return JITOptimizerDisabledFlag; } }
}
}

View File

@@ -1,54 +0,0 @@
//
// System.Diagnostics.DebuggerBrowsableAttribute.cs
//
// Author:
// Chris Toshok (toshok@novell.com)
//
//
// Copyright (C) 2005 Novell, Inc (http://www.novell.com)
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
using System;
using System.Runtime.InteropServices;
namespace System.Diagnostics {
[AttributeUsageAttribute(AttributeTargets.Field | AttributeTargets.Property)]
[ComVisible (true)]
public sealed class DebuggerBrowsableAttribute : Attribute
{
DebuggerBrowsableState state;
public DebuggerBrowsableAttribute (DebuggerBrowsableState state) {
this.state = state;
}
public DebuggerBrowsableState State {
get {
return state;
}
}
}
}

View File

@@ -1,43 +0,0 @@
//
// System.Diagnostics.DebuggerDisplayAttribute.cs
//
// Author:
// Chris Toshok (toshok@novell.com)
//
//
// Copyright (C) 2005 Novell, Inc (http://www.novell.com)
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
using System.Runtime.InteropServices;
namespace System.Diagnostics {
// XXX make sure this matches MS's enum
[ComVisible (true)]
public enum DebuggerBrowsableState
{
Never = 0,
Collapsed = 2,
RootHidden = 3
}
}

View File

@@ -1,108 +0,0 @@
//
// System.Diagnostics.DebuggerDisplayAttribute.cs
//
// Author:
// Chris Toshok (toshok@novell.com)
//
//
// Copyright (C) 2005 Novell, Inc (http://www.novell.com)
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
using System;
using System.Runtime.InteropServices;
namespace System.Diagnostics {
[AttributeUsageAttribute(AttributeTargets.Class |
AttributeTargets.Struct |
AttributeTargets.Enum |
AttributeTargets.Field |
AttributeTargets.Delegate |
AttributeTargets.Property |
AttributeTargets.Assembly, AllowMultiple=true)]
[ComVisible (true)]
public sealed class DebuggerDisplayAttribute : Attribute
{
string value, type, name;
string target_type_name;
Type target_type;
public DebuggerDisplayAttribute (string value) {
if (value == null)
value = string.Empty;
this.value = value;
this.type = string.Empty;
this.name = string.Empty;
}
public string Value {
get {
return value;
}
}
public Type Target {
get {
return target_type;
}
set {
if (value == null)
throw new ArgumentNullException ("value");
target_type = value;
target_type_name = target_type.AssemblyQualifiedName;
}
}
public string TargetTypeName {
get {
return target_type_name;
}
set {
target_type_name = value;
}
}
public string Type {
get {
return type;
}
set {
type = value;
}
}
public string Name {
get {
return name;
}
set {
name = value;
}
}
}
}

View File

@@ -1,51 +0,0 @@
//
// System.Diagnostics.DebuggerHiddenAttribute.cs
//
// Author: Duncan Mak (duncan@ximian.com)
//
// (C) Ximian, Inc. http://www.ximian.com
//
//
// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
using System;
using System.Runtime.InteropServices;
namespace System.Diagnostics
{
[AttributeUsage (AttributeTargets.Constructor |
AttributeTargets.Method | AttributeTargets.Property,
Inherited=false)]
[Serializable]
[ComVisible (true)]
public sealed class DebuggerHiddenAttribute : Attribute
{
public DebuggerHiddenAttribute ()
: base ()
{
}
}
}

View File

@@ -1,45 +0,0 @@
//
// System.Diagnostics.DebuggerNonUserCodeAttribute.cs
//
// Author: Zoltan Varga (vargaz@gmail.com)
//
// (C) Ximian, Inc. http://www.ximian.com
//
//
// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
using System;
using System.Runtime.InteropServices;
namespace System.Diagnostics
{
[AttributeUsageAttribute(AttributeTargets.Class|AttributeTargets.Struct|AttributeTargets.Constructor|AttributeTargets.Method|AttributeTargets.Property, Inherited=false)]
[ComVisibleAttribute(true)]
[Serializable]
public sealed class DebuggerNonUserCodeAttribute : Attribute
{
public DebuggerNonUserCodeAttribute () {
}
}
}

View File

@@ -1,49 +0,0 @@
//
// System.Diagnostics.DebuggerStepThroughAttribute.cs
//
// Author: Duncan Mak (duncan@ximian.com)
//
// (C) Ximian, Inc. http://www.ximian.com
//
//
// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
using System;
using System.Runtime.InteropServices;
namespace System.Diagnostics
{
[AttributeUsage (AttributeTargets.Class | AttributeTargets.Struct |
AttributeTargets.Constructor |
AttributeTargets.Method, Inherited=false)]
[Serializable]
[ComVisible (true)]
public sealed class DebuggerStepThroughAttribute : Attribute
{
public DebuggerStepThroughAttribute ()
: base ()
{
}
}
}

View File

@@ -1,45 +0,0 @@
//
// System.Diagnostics.DebuggerStepThroughAttribute.cs
//
// Author: Dick Porter (dick@ximian.com)
//
//
// Copyright (C) 2007 Novell, Inc (http://www.novell.com)
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
using System;
using System.Runtime.InteropServices;
namespace System.Diagnostics
{
[Serializable]
[ComVisible (true)]
[AttributeUsage (AttributeTargets.Constructor|AttributeTargets.Method,
Inherited=false)]
public sealed class DebuggerStepperBoundaryAttribute : Attribute
{
public DebuggerStepperBoundaryAttribute ()
{
}
}
}

View File

@@ -1,84 +0,0 @@
//
// System.Diagnostics.DebuggerTypeProxyAttribute.cs
//
// Authors:
// Chris Toshok (toshok@novell.com)
// Marek Safar (marek.safar@gmail.com)
//
//
// Copyright (C) 2005 Novell, Inc (http://www.novell.com)
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
using System;
using System.Runtime.InteropServices;
namespace System.Diagnostics {
[AttributeUsageAttribute(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Assembly, AllowMultiple = true)]
[ComVisible (true)]
public sealed class DebuggerTypeProxyAttribute : Attribute
{
string proxy_type_name;
string target_type_name;
Type target_type;
public DebuggerTypeProxyAttribute (string typeName) {
proxy_type_name = typeName;
}
public DebuggerTypeProxyAttribute (Type type)
{
if (type == null)
throw new ArgumentNullException ("type");
proxy_type_name = type.AssemblyQualifiedName;
}
public string ProxyTypeName {
get {
return proxy_type_name;
}
}
public Type Target {
get {
return target_type;
}
set {
target_type = value;
target_type_name = target_type.Name;
}
}
public string TargetTypeName {
get {
return target_type_name;
}
set {
target_type_name = value;
}
}
}
}

View File

@@ -1,136 +0,0 @@
//
// System.Diagnostics.DebuggerVisualizerAttribute.cs
//
// Author:
// Chris Toshok (toshok@novell.com)
//
//
// Copyright (C) 2005 Novell, Inc (http://www.novell.com)
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
using System;
using System.Runtime.InteropServices;
namespace System.Diagnostics
{
[AttributeUsageAttribute(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Assembly, AllowMultiple=true)]
[ComVisible (true)]
public sealed class DebuggerVisualizerAttribute : Attribute
{
private string description;
private string visualizerSourceName;
private string visualizerName;
private string targetTypeName;
private Type target;
public DebuggerVisualizerAttribute (string visualizerTypeName)
{
this.visualizerName = visualizerTypeName;
}
public DebuggerVisualizerAttribute (Type visualizer)
{
if (visualizer == null)
throw new ArgumentNullException ("visualizer");
this.visualizerName = visualizer.AssemblyQualifiedName;
}
public DebuggerVisualizerAttribute (string visualizerTypeName, string visualizerObjectSourceTypeName)
{
this.visualizerName = visualizerTypeName;
this.visualizerSourceName = visualizerObjectSourceTypeName;
}
public DebuggerVisualizerAttribute (string visualizerTypeName, Type visualizerObjectSource)
{
if (visualizerObjectSource == null)
throw new ArgumentNullException ("visualizerObjectSource");
this.visualizerName = visualizerTypeName;
this.visualizerSourceName = visualizerObjectSource.AssemblyQualifiedName;
}
public DebuggerVisualizerAttribute (Type visualizer, string visualizerObjectSourceTypeName)
{
if (visualizer == null)
throw new ArgumentNullException ("visualizer");
this.visualizerName = visualizer.AssemblyQualifiedName;
this.visualizerSourceName = visualizerObjectSourceTypeName;
}
public DebuggerVisualizerAttribute (Type visualizer, Type visualizerObjectSource)
{
if (visualizer == null)
throw new ArgumentNullException ("visualizer");
if (visualizerObjectSource == null)
throw new ArgumentNullException ("visualizerObjectSource");
this.visualizerName = visualizer.AssemblyQualifiedName;
this.visualizerSourceName = visualizerObjectSource.AssemblyQualifiedName;
}
public string Description {
get {
return description;
}
set {
description = value;
}
}
public Type Target {
get {
return target;
}
set {
target = value;
targetTypeName = target.AssemblyQualifiedName;
}
}
public string TargetTypeName {
get {
return targetTypeName;
}
set {
targetTypeName = value;
}
}
// Debugged program-side type
public string VisualizerObjectSourceTypeName {
get {
return visualizerSourceName;
}
}
// Debugger-side type
public string VisualizerTypeName {
get {
return visualizerName;
}
}
}
}

View File

@@ -50,6 +50,7 @@ namespace System.Diagnostics {
private int ilOffset = OFFSET_UNKNOWN;
private int nativeOffset = OFFSET_UNKNOWN;
private long methodAddress;
private uint methodIndex;
private MethodBase methodBase;
private string fileName;
private int lineNumber;
@@ -59,6 +60,9 @@ namespace System.Diagnostics {
#pragma warning restore 649
#endregion
[MethodImplAttribute (MethodImplOptions.InternalCall)]
extern static int GetILOffsetFromFile (string path, int methodToken, uint methodIndex, int nativeOffset);
[MethodImplAttribute(MethodImplOptions.InternalCall)]
extern static bool get_frame_info (int skip, bool needFileInfo, out MethodBase method,
out int iloffset, out int native_offset,
@@ -171,6 +175,11 @@ namespace System.Diagnostics {
return methodAddress;
}
internal uint GetMethodIndex ()
{
return methodIndex;
}
internal string GetInternalMethodName ()
{
return internalMethodName;

View File

@@ -57,6 +57,7 @@ namespace System.Diagnostics {
public const int METHODS_TO_SKIP = 0;
private StackFrame[] frames;
readonly StackTrace[] captured_traces;
private bool debug_info;
public StackTrace ()
@@ -148,6 +149,8 @@ namespace System.Diagnostics {
frames = l.ToArray ();
}
}
captured_traces = e.captured_traces;
}
public StackTrace (StackFrame frame)
@@ -189,56 +192,139 @@ namespace System.Diagnostics {
return frames;
}
public override string ToString ()
bool AddFrames (StringBuilder sb, bool isException = false)
{
string newline = String.Format ("{0} {1} ", Environment.NewLine, Locale.GetText ("at"));
bool printOffset;
string debugInfo, indentation;
string unknown = Locale.GetText ("<unknown method>");
string debuginfo = Locale.GetText (" in {0}:line {1}");
StringBuilder sb = new StringBuilder ();
for (int i = 0; i < FrameCount; i++) {
StackFrame frame = GetFrame (i);
if (i > 0)
sb.Append (newline);
else
sb.AppendFormat (" {0} ", Locale.GetText ("at"));
MethodBase method = frame.GetMethod ();
if (method != null) {
// Method information available
sb.AppendFormat ("{0}.{1}", method.DeclaringType.FullName, method.Name);
/* Append parameter information */
sb.Append ("(");
ParameterInfo[] p = method.GetParametersInternal ();
for (int j = 0; j < p.Length; ++j) {
if (j > 0)
sb.Append (", ");
Type pt = p[j].ParameterType;
bool byref = pt.IsByRef;
if (byref)
pt = pt.GetElementType ();
if (pt.IsClass && pt.Namespace != String.Empty) {
sb.Append (pt.Namespace);
sb.Append (".");
}
sb.Append (pt.Name);
if (byref)
sb.Append (" ByRef");
sb.AppendFormat (" {0}", p [j].Name);
}
sb.Append (")");
}
else {
// Method information not available
sb.Append (unknown);
}
if (debug_info) {
// we were asked for debugging informations
// but that doesn't mean we have the debug information available
string fname = frame.GetSecureFileName ();
if (fname != "<filename unknown>")
sb.AppendFormat (debuginfo, fname, frame.GetFileLineNumber ());
if (isException) {
printOffset = true;
indentation = " ";
debugInfo = Locale.GetText (" in {0}:{1} ");
} else {
printOffset = false;
indentation = " ";
debugInfo = Locale.GetText (" in {0}:line {1}");
}
var newline = String.Format ("{0}{1}{2} ", Environment.NewLine, indentation,
Locale.GetText ("at"));
int i;
for (i = 0; i < FrameCount; i++) {
StackFrame frame = GetFrame (i);
if (i == 0)
sb.AppendFormat ("{0}{1} ", indentation, Locale.GetText ("at"));
else
sb.Append (newline);
if (frame.GetMethod () == null) {
string internal_name = frame.GetInternalMethodName ();
if (internal_name != null)
sb.Append (internal_name);
else if (printOffset)
sb.AppendFormat ("<0x{0:x5} + 0x{1:x5}> {2}", frame.GetMethodAddress (), frame.GetNativeOffset (), unknown);
else
sb.AppendFormat (unknown);
} else {
GetFullNameForStackTrace (sb, frame.GetMethod ());
if (printOffset) {
if (frame.GetILOffset () == -1) {
sb.AppendFormat (" <0x{0:x5} + 0x{1:x5}>", frame.GetMethodAddress (), frame.GetNativeOffset ());
if (frame.GetMethodIndex () != 0xffffff)
sb.AppendFormat (" {0}", frame.GetMethodIndex ());
} else {
sb.AppendFormat (" [0x{0:x5}]", frame.GetILOffset ());
}
}
sb.AppendFormat (debugInfo, frame.GetSecureFileName (),
frame.GetFileLineNumber ());
}
}
return i != 0;
}
// This method is also used with reflection by mono-symbolicate tool.
// mono-symbolicate tool uses this method to check which method matches
// the stack frame method signature.
static void GetFullNameForStackTrace (StringBuilder sb, MethodBase mi)
{
var declaringType = mi.DeclaringType;
if (declaringType.IsGenericType && !declaringType.IsGenericTypeDefinition)
declaringType = declaringType.GetGenericTypeDefinition ();
// Get generic definition
var bindingflags = BindingFlags.Instance | BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic;
foreach (var m in declaringType.GetMethods (bindingflags)) {
if (m.MetadataToken == mi.MetadataToken) {
mi = m;
break;
}
}
sb.Append (declaringType.ToString ());
sb.Append (".");
sb.Append (mi.Name);
if (mi.IsGenericMethod) {
Type[] gen_params = mi.GetGenericArguments ();
sb.Append ("[");
for (int j = 0; j < gen_params.Length; j++) {
if (j > 0)
sb.Append (",");
sb.Append (gen_params [j].Name);
}
sb.Append ("]");
}
ParameterInfo[] p = mi.GetParametersInternal ();
sb.Append (" (");
for (int i = 0; i < p.Length; ++i) {
if (i > 0)
sb.Append (", ");
Type pt = p[i].ParameterType;
if (pt.IsGenericType && ! pt.IsGenericTypeDefinition)
pt = pt.GetGenericTypeDefinition ();
if (pt.IsClass && !String.IsNullOrEmpty (pt.Namespace)) {
sb.Append (pt.Namespace);
sb.Append (".");
}
sb.Append (pt.Name);
if (p [i].Name != null) {
sb.Append (" ");
sb.Append (p [i].Name);
}
}
sb.Append (")");
}
public override string ToString ()
{
StringBuilder sb = new StringBuilder ();
//
// Add traces captured using ExceptionDispatchInfo
//
if (captured_traces != null) {
foreach (var t in captured_traces) {
if (!t.AddFrames (sb, true))
continue;
sb.Append (Environment.NewLine);
sb.Append ("--- End of stack trace from previous location where exception was thrown ---");
sb.Append (Environment.NewLine);
}
}
AddFrames (sb);
return sb.ToString ();
}