Imported Upstream version 4.6.0.125

Former-commit-id: a2155e9bd80020e49e72e86c44da02a8ac0e57a4
This commit is contained in:
Xamarin Public Jenkins (auto-signing)
2016-08-03 10:59:49 +00:00
parent a569aebcfd
commit e79aa3c0ed
17047 changed files with 3137615 additions and 392334 deletions

View File

@@ -1,239 +0,0 @@
2010-03-16 Jb Evain <jbevain@novell.com>
* StackFrame.cs: use MOONLIGHT symbol to disambiguate
MonoTouch and Moonlight code.
2010-03-07 Rodrigo Kumpera <rkumpera@novell.com>
* Debugger.cs: Add Obsolete attribute to .ctor().
2009-10-24 Sebastien Pouliot <sebastien@ximian.com>
* StackFrame.cs: Relax GetSecureFileName when the coreclr is not
active (i.e. show full path when compiling with smcs)
2009-10-08 Sebastien Pouliot <sebastien@ximian.com>
* StackFrame.cs: Introduce a new GetSecureFileName method that
will deal with CAS (regular framework) and will remove the path
(for Moonlight) on a stack frame.
* StackTrace.cs: Use the new StackFrame.GetSecureFileName to
simplify logic
2009-09-18 Sebastien Pouliot <sebastien@ximian.com>
* StackFrame.cs: Avoid imperative CAS checks for NET_2_1
2009-01-24 Zoltan Varga <vargaz@gmail.com>
* StackFrame.cs: Fix warnings.
2008-10-20 Cedric Vivier <cedricv@neonux.com>
* Debugger.cs: Implement Debugger.IsAttached
2008-04-03 Andreas Nahr <ClassDevelopment@A-SoftTech.com>
* StackTrace.cs: Fix parameter names
* DebuggerVisualizerAttribute.cs: Fix parameter names, fix wrong constructors (parameters
were incorrectly used, maybe result of the wrong parameter names),
remove unaccessible parameters, remove useless NET_2_0
2008-04-02 Andreas Nahr <ClassDevelopment@A-SoftTech.com>
* DebuggerTypeProxyAttribute.cs
* StackFrame.cs: Fix parameter names
2007-11-05 Sebastien Pouliot <sebastien@ximian.com>
* DebuggableAttribute.cs: Don't throw on DebuggingFlags property.
Fix part of #322850.
2007-05-16 Dick Porter <dick@ximian.com>
* ConditionalAttribute.cs:
* DebuggableAttribute.cs:
* Debugger.cs:
* DebuggerBrowsableAttribute.cs:
* DebuggerDisplayAttribute.cs:
* DebuggerHiddenAttribute.cs:
* DebuggerNonUserCodeAttribute.cs:
* DebuggerStepperBoundaryAttribute.cs:
* DebuggerStepThroughAttribute.cs:
* DebuggerTypeProxyAttribute.cs:
* DebuggerVisualizerAttribute.cs:
* StackFrame.cs:
* StackTrace.cs:
* DebuggerBrowsableState.cs: Update to 2.0 profile
2007-05-11 Rolf Bjarne Kvinge <RKvinge@novell.com>
* DebuggerDisplayAttribute.cs: Default Type, Name and Value is an empty string.
Fix name setter. Can't set a null TargetType, and use AssemblyQualifiedName
for the TargetTypeName.
2007-04-27 Zoltan Varga <vargaz@gmail.com>
* StackTrace.cs: Fix ToString () to be compatible with MS. Fixes #81207.
2006-07-24 Miguel de Icaza <miguel@novell.com>
* DebuggerDisplayAttribute.cs: Update the targets
2006-01-26 Zoltan Varga <vargaz@gmail.com>
* DebuggerNonUserCodeAttribute.cs: New file.
2005-12-16 Sebastien Pouliot <sebastien@ximian.com>
* StackTrace.cs: Added, if avilable, the filename/lineno debug
information in ToString() like it's done on the 2.0 framework (i.e.
Mono will display it for all profile, MS only in 2.0). Fix bug #75932.
2005-05-25 Zoltan Varga <vargaz@freemail.hu>
* StackTrace.cs: Add an internal ctor which skips unmanaged frames.
2005-04-16 Sebastien Pouliot <sebastien@ximian.com>
* StackFrame.cs: Moved documentation comments (XML) to monodoc.
Removed unused method ObjectsEqual.
2005-03-14 Sebastien Pouliot <sebastien@ximian.com>
* StackFrame.cs: Fix CAS unit tests for NET_1_1.
* StackTrace.cs: Fix CAS unit tests for NET_1_1.
2005-03-04 Zoltan Varga <vargaz@freemail.hu>
* StackFrame.cs: Add an internalMethodName field to return info about
the various runtime wrappers.
2005-03-02 Chris Toshok <toshok@ximian.com>
* DebuggerTypeProxyAttribute.cs, DebuggerBrowsableState.cs,
DebuggerDisplayAttribute.cs, DebuggerBrowsableAttribute: first cut
at 3/4 of the .net 2.0 debugger attributes.
2005-02-12 Marek Safar <marek.safar@seznam.cz>
* ConditionalAttribute.cs: NET_2_0 extension.
2005-01-27 Sebastien Pouliot <sebastien@ximian.com>
* StackFrame.cs: Add path discovery permission check for GetFilename
method. Changed ToString to use a StringBuilder and report correctly
(i.e. without exception) if filename is restricted. Removed dead code
(Equals/GetHashCode).
* StackTrace.cs: Removed dead code (Equals/GetHashCode).
2004-08-05 Sebastien Pouliot <sebastien@ximian.com>
* StackTrace.cs: Added missing exceptions. Added globalization. Now
using StringBuilder in ToString (fusioned FrameToString).
2004-08-04 Sebastien Pouliot <sebastien@ximian.com>
* StackTrace.cs: Implemented GetFrames as public virtual for NET_2_0
and internal for NET_1_0/NET_1_1 so it can be used for CAS. Removed
XML documentation and mono-ized the source code.
2004-06-15 Gert Driesen <drieseng@users.sourceforge.net>
* StackTrace.cs: added TODO for serialization
* StackFrame.cs: added TODO for serialization
2004-05-19 Gert Driesen (drieseng@users.sourceforge.net)
* DebuggerHiddenAttribute.cs
* DebuggerStepThroughAttribute.cs : now that Inherited is
false by default on AttributeUsageAttribute (as it
should be) we need to explicitly set Inherited to false
for those attributes where it should be false.
2003-09-18 Ravi Pratap <ravi@ximian.com>
* ConditionalAttribute.cs: AllowMultiple should be true according
to bug #48598.
2003-09-02 Ravi Pratap <ravi@ximian.com>
* DebuggerStepThroughAttribute.cs: Fix allowable targets to include class
and struct; remove property targets.
2003-07-01 Zoltan Varga <vargaz@freemail.hu>
* StackFrame.cs: Obtain frame info for 'fake' frames too, since this is
what MS does.
2003-01-01 Jaime Anguiano Olarra <jaime@gnome.org>
* Process.cs: skeleton for use in Remoting.
2002-06-19 Dietmar Maurer <dietmar@ximian.com>
* StackTrace.cs: impl. remaining constructors.
2002-06-18 Dietmar Maurer <dietmar@ximian.com>
* StackTrace.cs: use new internal call for constructors, use MS like
trace format.
* StackFrame.cs: impl. constructors using a new internal call.
2002-05-01 Duncan Mak <duncan@ximian.com>
* DebuggableAttribute.cs: Added missing AttributeUsage attribute.
2002-04-08 Jonathan Pryor <jonpryor@vt.edu>
* Debugger.cs: Added [MonoTODO] attribute to methods; modified IsLogging()
and Log() so that System.Diagnostics.DefaultTraceListener could use them
without having NotImplementedException's thrown, as the functionality
DefaultTraceListener is using is non-critical.
2002-04-08 Nick Drochak <ndrochak@gol.com>
* ConditionalAttribute.cs: Add AttributeUsage attribute for methods.
2002-01-23 Duncan Mak <duncan@ximian.com>
* DebuggerStepThroughAttribute.cs:
* DebuggerHiddenAttribte.cs: Add to CVS.
2002-01-04 Ravi Pratap <ravi@ximian.com>
* StackFrame.cs : Use the MonoTODO attribute to mark
incomplete code.
StackTrace.cs : Ditto.
2002-01-04 John R. Hicks <angryjohn69@nc.rr.com>
* Moved TraceListener, TextWriterTraceListener, and
DefaultTraceListener to System assembly....oops.
2002-01-04 John R. Hicks <angryjohn69@nc.rr.com>
* Added TextWriterTraceListener.cs, TraceListener.cs, and
DefaultTraceListener.cs to the build.
2002-01-04 John R. Hicks <angryjohn69@nc.rr.com>
* Added Debugger.cs to the build.
2001-09-02 Miguel de Icaza <miguel@ximian.com>
* Moved BooleanSwitch, Switch, TraceLevel and TraceSwitch to the
System assembly.
* Added StackFrame.cs and StackTrace.cs to the build.
2001-08-21 Nick Drochak <ndrochak@gol.com>
* Implemented ConditionalAttribute.cs and DebuggableAttribute.cs
2001-08-29 Alexander Klyubin <klyubin@aqris.com>
* Skeletal implementation of StackFrame and StackTrace classes.
The classes must be somehow connected to runtime environment in
order to generate proper traces.

View File

@@ -60,9 +60,6 @@ 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,

View File

@@ -37,6 +37,7 @@ using System.Security;
using System.Security.Permissions;
using System.Text;
using System.Threading;
using System.IO;
namespace System.Diagnostics {
@@ -60,6 +61,9 @@ namespace System.Diagnostics {
readonly StackTrace[] captured_traces;
private bool debug_info;
private static Dictionary<string, Func<StackTrace, string>> metadataHandlers;
[MethodImplAttribute (MethodImplOptions.NoInlining)]
public StackTrace ()
{
init_frames (METHODS_TO_SKIP, false);
@@ -219,17 +223,14 @@ namespace System.Diagnostics {
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)
public 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;
const BindingFlags bindingflags = BindingFlags.Instance | BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic;
foreach (var m in declaringType.GetMethods (bindingflags)) {
if (m.MetadataToken == mi.MetadataToken) {
mi = m;
@@ -253,7 +254,7 @@ namespace System.Diagnostics {
sb.Append ("]");
}
ParameterInfo[] p = mi.GetParametersInternal ();
ParameterInfo[] p = mi.GetParameters ();
sb.Append (" (");
for (int i = 0; i < p.Length; ++i) {
@@ -264,18 +265,15 @@ namespace System.Diagnostics {
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);
sb.Append (pt.ToString());
if (p [i].Name != null) {
sb.Append (" ");
sb.Append (p [i].Name);
}
}
sb.Append (")");
}
}
public override string ToString ()
{
@@ -289,6 +287,8 @@ namespace System.Diagnostics {
if (!t.AddFrames (sb))
continue;
t.AddMetadata (sb);
sb.Append (Environment.NewLine);
sb.Append ("--- End of stack trace from previous location where exception was thrown ---");
sb.Append (Environment.NewLine);
@@ -296,13 +296,78 @@ namespace System.Diagnostics {
}
AddFrames (sb);
AddMetadata (sb);
return sb.ToString ();
}
void AddMetadata (StringBuilder sb)
{
if (metadataHandlers == null)
InitMetadataHandlers ();
foreach (var handler in metadataHandlers) {
var lines = handler.Value (this);
using (var reader = new StringReader (lines)) {
string line;
while ((line = reader.ReadLine()) != null) {
sb.AppendLine ();
sb.AppendFormat ("[{0}] {1}", handler.Key, line);
}
}
}
}
internal String ToString (TraceFormat traceFormat)
{
// TODO:
return ToString ();
}
static void InitMetadataHandlers ()
{
metadataHandlers = new Dictionary<string, Func<StackTrace, string>> (StringComparer.Ordinal);
var aotid = Assembly.GetAotId ();
if (aotid != null)
AddMetadataHandler ("AOTID", st => { return new Guid (aotid).ToString ("N"); });
AddMetadataHandler ("MVID", st => {
var mvidLines = new Dictionary<Guid, List<int>> ();
var frames = st.GetFrames ();
for (var lineNumber = 0; lineNumber < frames.Length; lineNumber++) {
var method = frames[lineNumber].GetMethod ();
if (method == null)
continue;
var mvid = method.Module.ModuleVersionId;
List<int> lines = null;
if (!mvidLines.TryGetValue (mvid, out lines)) {
lines = new List<int> ();
mvidLines.Add (mvid, lines);
}
lines.Add (lineNumber);
}
var mvids = new List<Guid> (mvidLines.Keys);
mvids.Sort ();
var sb = new StringBuilder ();
foreach (var mvid in mvids)
sb.AppendLine (string.Format ("{0} {1}", mvid.ToString ("N"), string.Join (",", mvidLines[mvid])));
return sb.ToString ();
});
}
// This method signature should not change, apps can use it with reflection to add custom metadata handlers.
private static void AddMetadataHandler (string id, Func<StackTrace, string> handler)
{
if (metadataHandlers == null)
InitMetadataHandlers ();
metadataHandlers.Add (id, handler);
}
}
}