namespace System.Diagnostics {
[Serializable]
- [MonoTODO ("Fix serialization compatibility with MS.NET")]
+#if NET_2_0
+ [ComVisible (true)]
+#endif
+ [MonoTODO ("Serialized objects are not compatible with .NET")]
public class StackTrace {
public const int METHODS_TO_SKIP = 0;
#if ONLY_1_1
[ReflectionPermission (SecurityAction.Demand, TypeInformation = true)]
#endif
- [MonoTODO]
+ [MonoTODO ("Not possible to create StackTraces from other threads")]
public StackTrace (Thread targetThread, bool needFileInfo)
{
throw new NotImplementedException ();
StringBuilder sb = new StringBuilder ();
for (int i = 0; i < FrameCount; i++) {
StackFrame frame = GetFrame (i);
- sb.Append (newline);
+ 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);
+ sb.AppendFormat ("{0}.{1}", method.DeclaringType.FullName, method.Name);
+ /* Append parameter information */
+ sb.Append ("(");
+ ParameterInfo[] p = method.GetParameters ();
+ 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