Merge pull request #2824 from lambdageek/dev/monoerror-icalls-noraise
authormonojenkins <jo.shields+jenkins@xamarin.com>
Thu, 7 Apr 2016 19:06:02 +0000 (20:06 +0100)
committermonojenkins <jo.shields+jenkins@xamarin.com>
Thu, 7 Apr 2016 19:06:02 +0000 (20:06 +0100)
[runtime] Set pending exception in icalls instead of raising.

467 files changed:
acceptance-tests/coreclr.mk
configure.ac
docs/docs.make
external/android-libunwind/README [new file with mode: 0644]
external/android-libunwind/include/libunwind-aarch64.h [new file with mode: 0644]
external/android-libunwind/include/libunwind-arm.h [new file with mode: 0644]
external/android-libunwind/include/libunwind-common.h [new file with mode: 0644]
external/android-libunwind/include/libunwind-coredump.h [new file with mode: 0644]
external/android-libunwind/include/libunwind-dynamic.h [new file with mode: 0644]
external/android-libunwind/include/libunwind-hppa.h [new file with mode: 0644]
external/android-libunwind/include/libunwind-ia64.h [new file with mode: 0644]
external/android-libunwind/include/libunwind-mips.h [new file with mode: 0644]
external/android-libunwind/include/libunwind-ppc32.h [new file with mode: 0644]
external/android-libunwind/include/libunwind-ppc64.h [new file with mode: 0644]
external/android-libunwind/include/libunwind-ptrace.h [new file with mode: 0644]
external/android-libunwind/include/libunwind-sh.h [new file with mode: 0644]
external/android-libunwind/include/libunwind-x86.h [new file with mode: 0644]
external/android-libunwind/include/libunwind-x86_64.h [new file with mode: 0644]
external/android-libunwind/include/libunwind.h [new file with mode: 0644]
external/android-libunwind/include/unwind.h [new file with mode: 0644]
external/referencesource
libgc/configure.ac
man/mono.1
mcs/Makefile
mcs/build/config-default.make
mcs/build/executable.make
mcs/build/library.make
mcs/build/profiles/build.make
mcs/build/profiles/mobile.make
mcs/build/profiles/mobile_static.make
mcs/build/profiles/monodroid.make
mcs/build/profiles/monotouch_runtime.make
mcs/build/profiles/net_4_x.make
mcs/build/profiles/xammac.make
mcs/build/profiles/xbuild_12.make
mcs/build/profiles/xbuild_14.make
mcs/build/rules.make
mcs/build/tests.make
mcs/class/Accessibility/Makefile
mcs/class/Commons.Xml.Relaxng/Makefile
mcs/class/Compat.ICSharpCode.SharpZipLib/Makefile
mcs/class/Cscompmgd/Makefile
mcs/class/CustomMarshalers/Makefile
mcs/class/Facades/Makefile
mcs/class/Facades/Microsoft.Win32.Primitives/Makefile
mcs/class/Facades/Microsoft.Win32.Registry.AccessControl/Makefile
mcs/class/Facades/Microsoft.Win32.Registry/Makefile
mcs/class/Facades/System.AppContext/Makefile
mcs/class/Facades/System.Collections.Concurrent/Makefile
mcs/class/Facades/System.Collections.NonGeneric/Makefile
mcs/class/Facades/System.Collections.Specialized/Makefile
mcs/class/Facades/System.Collections/Makefile
mcs/class/Facades/System.ComponentModel.Annotations/Makefile
mcs/class/Facades/System.ComponentModel.EventBasedAsync/Makefile
mcs/class/Facades/System.ComponentModel.Primitives/Makefile
mcs/class/Facades/System.ComponentModel.TypeConverter/Makefile
mcs/class/Facades/System.ComponentModel/Makefile
mcs/class/Facades/System.Console/Makefile
mcs/class/Facades/System.Data.Common/Makefile
mcs/class/Facades/System.Data.SqlClient/Makefile
mcs/class/Facades/System.Diagnostics.Contracts/Makefile
mcs/class/Facades/System.Diagnostics.Debug/Makefile
mcs/class/Facades/System.Diagnostics.FileVersionInfo/Makefile
mcs/class/Facades/System.Diagnostics.PerformanceCounter/Makefile
mcs/class/Facades/System.Diagnostics.Process/Makefile
mcs/class/Facades/System.Diagnostics.StackTrace/Makefile
mcs/class/Facades/System.Diagnostics.TextWriterTraceListener/Makefile
mcs/class/Facades/System.Diagnostics.Tools/Makefile
mcs/class/Facades/System.Diagnostics.TraceEvent/Makefile
mcs/class/Facades/System.Diagnostics.TraceSource/Makefile
mcs/class/Facades/System.Diagnostics.Tracing/Makefile
mcs/class/Facades/System.Dynamic.Runtime/Makefile
mcs/class/Facades/System.Globalization.Calendars/Makefile
mcs/class/Facades/System.Globalization.Extensions/Makefile
mcs/class/Facades/System.Globalization/Makefile
mcs/class/Facades/System.IO.Compression.ZipFile/Makefile
mcs/class/Facades/System.IO.FileSystem.AccessControl/Makefile
mcs/class/Facades/System.IO.FileSystem.DriveInfo/Makefile
mcs/class/Facades/System.IO.FileSystem.Primitives/Makefile
mcs/class/Facades/System.IO.FileSystem.Watcher/Makefile
mcs/class/Facades/System.IO.FileSystem/Makefile
mcs/class/Facades/System.IO.IsolatedStorage/Makefile
mcs/class/Facades/System.IO.MemoryMappedFiles/Makefile
mcs/class/Facades/System.IO.Pipes/Makefile
mcs/class/Facades/System.IO.UnmanagedMemoryStream/Makefile
mcs/class/Facades/System.IO/Makefile
mcs/class/Facades/System.Linq.Expressions/Makefile
mcs/class/Facades/System.Linq.Parallel/Makefile
mcs/class/Facades/System.Linq.Queryable/Makefile
mcs/class/Facades/System.Linq/Makefile
mcs/class/Facades/System.Net.AuthenticationManager/Makefile
mcs/class/Facades/System.Net.Cache/Makefile
mcs/class/Facades/System.Net.Http.WebRequestHandler/Makefile
mcs/class/Facades/System.Net.HttpListener/Makefile
mcs/class/Facades/System.Net.Mail/Makefile
mcs/class/Facades/System.Net.NameResolution/Makefile
mcs/class/Facades/System.Net.NetworkInformation/Makefile
mcs/class/Facades/System.Net.Primitives/Makefile
mcs/class/Facades/System.Net.Requests/Makefile
mcs/class/Facades/System.Net.Security/Makefile
mcs/class/Facades/System.Net.ServicePoint/Makefile
mcs/class/Facades/System.Net.Sockets/Makefile
mcs/class/Facades/System.Net.Utilities/Makefile
mcs/class/Facades/System.Net.WebHeaderCollection/Makefile
mcs/class/Facades/System.Net.WebSockets.Client/Makefile
mcs/class/Facades/System.Net.WebSockets/Makefile
mcs/class/Facades/System.ObjectModel/Makefile
mcs/class/Facades/System.Private.CoreLib.InteropServices/Makefile
mcs/class/Facades/System.Private.CoreLib.Threading/Makefile
mcs/class/Facades/System.Reflection.Emit.ILGeneration/Makefile
mcs/class/Facades/System.Reflection.Emit.Lightweight/Makefile
mcs/class/Facades/System.Reflection.Emit/Makefile
mcs/class/Facades/System.Reflection.Extensions/Makefile
mcs/class/Facades/System.Reflection.Primitives/Makefile
mcs/class/Facades/System.Reflection.TypeExtensions/Makefile
mcs/class/Facades/System.Reflection/Makefile
mcs/class/Facades/System.Resources.ReaderWriter/Makefile
mcs/class/Facades/System.Resources.ResourceManager/Makefile
mcs/class/Facades/System.Runtime.CompilerServices.VisualC/Makefile
mcs/class/Facades/System.Runtime.Extensions/Makefile
mcs/class/Facades/System.Runtime.Handles/Makefile
mcs/class/Facades/System.Runtime.InteropServices.WindowsRuntime/Makefile
mcs/class/Facades/System.Runtime.InteropServices/Makefile
mcs/class/Facades/System.Runtime.Numerics/Makefile
mcs/class/Facades/System.Runtime.Serialization.Json/Makefile
mcs/class/Facades/System.Runtime.Serialization.Primitives/Makefile
mcs/class/Facades/System.Runtime.Serialization.Xml/Makefile
mcs/class/Facades/System.Runtime/Makefile
mcs/class/Facades/System.Security.AccessControl/Makefile
mcs/class/Facades/System.Security.Claims/Makefile
mcs/class/Facades/System.Security.Cryptography.DeriveBytes/Makefile
mcs/class/Facades/System.Security.Cryptography.Encoding/Makefile
mcs/class/Facades/System.Security.Cryptography.Encryption.Aes/Makefile
mcs/class/Facades/System.Security.Cryptography.Encryption.ECDiffieHellman/Makefile
mcs/class/Facades/System.Security.Cryptography.Encryption.ECDsa/Makefile
mcs/class/Facades/System.Security.Cryptography.Encryption/Makefile
mcs/class/Facades/System.Security.Cryptography.Hashing.Algorithms/Makefile
mcs/class/Facades/System.Security.Cryptography.Hashing/Makefile
mcs/class/Facades/System.Security.Cryptography.ProtectedData/Makefile
mcs/class/Facades/System.Security.Cryptography.RSA/Makefile
mcs/class/Facades/System.Security.Cryptography.RandomNumberGenerator/Makefile
mcs/class/Facades/System.Security.Cryptography.X509Certificates/Makefile
mcs/class/Facades/System.Security.Principal.Windows/Makefile
mcs/class/Facades/System.Security.Principal/Makefile
mcs/class/Facades/System.Security.SecureString/Makefile
mcs/class/Facades/System.ServiceModel.Duplex/Makefile
mcs/class/Facades/System.ServiceModel.Http/Makefile
mcs/class/Facades/System.ServiceModel.NetTcp/Makefile
mcs/class/Facades/System.ServiceModel.Primitives/Makefile
mcs/class/Facades/System.ServiceModel.Security/Makefile
mcs/class/Facades/System.ServiceProcess.ServiceController/Makefile
mcs/class/Facades/System.Text.Encoding.Extensions/Makefile
mcs/class/Facades/System.Text.Encoding/Makefile
mcs/class/Facades/System.Text.RegularExpressions/Makefile
mcs/class/Facades/System.Threading.AccessControl/Makefile
mcs/class/Facades/System.Threading.Overlapped/Makefile
mcs/class/Facades/System.Threading.Tasks.Parallel/Makefile
mcs/class/Facades/System.Threading.Tasks/Makefile
mcs/class/Facades/System.Threading.Thread/Makefile
mcs/class/Facades/System.Threading.ThreadPool/Makefile
mcs/class/Facades/System.Threading.Timer/Makefile
mcs/class/Facades/System.Threading/Makefile
mcs/class/Facades/System.Xml.ReaderWriter/Makefile
mcs/class/Facades/System.Xml.XDocument/Makefile
mcs/class/Facades/System.Xml.XPath.XDocument/Makefile
mcs/class/Facades/System.Xml.XPath/Makefile
mcs/class/Facades/System.Xml.XmlDocument/Makefile
mcs/class/Facades/System.Xml.XmlSerializer/Makefile
mcs/class/Facades/System.Xml.Xsl.Primitives/Makefile
mcs/class/I18N/CJK/Makefile
mcs/class/I18N/Common/Makefile
mcs/class/I18N/MidEast/Makefile
mcs/class/I18N/Other/Makefile
mcs/class/I18N/Rare/Makefile
mcs/class/I18N/West/Makefile
mcs/class/IBM.Data.DB2/Makefile
mcs/class/ICSharpCode.SharpZipLib/Makefile
mcs/class/Microsoft.Build.Engine/Makefile
mcs/class/Microsoft.Build.Framework/Makefile
mcs/class/Microsoft.Build.Tasks/Makefile
mcs/class/Microsoft.Build.Tasks/Microsoft.Build.Tasks/AssignProjectConfiguration.cs
mcs/class/Microsoft.Build.Tasks/Microsoft.Build.Tasks/CodeTaskFactory.cs
mcs/class/Microsoft.Build.Tasks/Test/Microsoft.Build.Tasks/AssignProjectConfigurationTest.cs
mcs/class/Microsoft.Build.Utilities/Makefile
mcs/class/Microsoft.Build/Makefile
mcs/class/Microsoft.VisualC/Makefile
mcs/class/Mono.C5/Makefile
mcs/class/Mono.C5/Test/AssemblyInfo.cs
mcs/class/Mono.CSharp/Makefile
mcs/class/Mono.Cecil.Mdb/Makefile
mcs/class/Mono.Cecil/Makefile
mcs/class/Mono.CodeContracts/Makefile
mcs/class/Mono.Data.Tds/Makefile
mcs/class/Mono.Debugger.Soft/Makefile
mcs/class/Mono.Directory.LDAP/Makefile
mcs/class/Mono.Dynamic.Interpreter/Makefile
mcs/class/Mono.Http/Makefile
mcs/class/Mono.Management/Makefile
mcs/class/Mono.Messaging.RabbitMQ/Makefile
mcs/class/Mono.Messaging/Makefile
mcs/class/Mono.Options/Makefile
mcs/class/Mono.Options/Mono.Options/Options.cs
mcs/class/Mono.Options/Test/Mono.Options/OptionSetTest.cs
mcs/class/Mono.Parallel/Makefile
mcs/class/Mono.Posix/Makefile
mcs/class/Mono.Security.Providers.NewTls/Makefile
mcs/class/Mono.Security/Assembly/AssemblyInfo.cs
mcs/class/Mono.Security/Makefile
mcs/class/Mono.Security/Mono.Security.Interface/CertificateValidationHelper.cs
mcs/class/Mono.Security/Mono.Security.Interface/MonoTlsProvider.cs
mcs/class/Mono.Security/monotouch_tv_opt_Mono.Security.dll.sources [deleted file]
mcs/class/Mono.Security/monotouch_watch_opt_Mono.Security.dll.sources [deleted file]
mcs/class/Mono.Simd/Makefile
mcs/class/Mono.XBuild.Tasks/Makefile
mcs/class/Mono.Xml.Ext/Makefile
mcs/class/Novell.Directory.Ldap/Makefile
mcs/class/PEAPI/Makefile
mcs/class/RabbitMQ.Client/src/apigen/Makefile
mcs/class/System.Configuration.Install/Makefile
mcs/class/System.Configuration/Makefile
mcs/class/System.Data.OracleClient/Makefile
mcs/class/System.Data.Services/Makefile
mcs/class/System.Data/Makefile
mcs/class/System.Design/Makefile
mcs/class/System.DirectoryServices/Makefile
mcs/class/System.Drawing.Design/Makefile
mcs/class/System.Drawing/Makefile
mcs/class/System.EnterpriseServices/Makefile
mcs/class/System.IO.Compression.FileSystem/Makefile
mcs/class/System.IO.Compression/Makefile
mcs/class/System.IdentityModel/Makefile
mcs/class/System.Management/Makefile
mcs/class/System.Messaging/Makefile
mcs/class/System.Net.Http.WebRequest/Makefile
mcs/class/System.Net.Http/Makefile
mcs/class/System.Reactive.Core/Makefile
mcs/class/System.Reactive.Linq/Makefile
mcs/class/System.Reactive.Observable.Aliases/Makefile
mcs/class/System.Reactive.PlatformServices/Makefile
mcs/class/System.Reactive.Providers/Makefile
mcs/class/System.Reactive.Runtime.Remoting/Makefile
mcs/class/System.Reactive.Windows.Forms/Makefile
mcs/class/System.Reactive.Windows.Threading/Makefile
mcs/class/System.Runtime.Remoting/Makefile
mcs/class/System.Runtime.Serialization.Formatters.Soap/Makefile
mcs/class/System.Runtime.Serialization.Formatters.Soap/Test/AssemblyInfo.cs
mcs/class/System.Runtime.Serialization/Makefile
mcs/class/System.Runtime.Serialization/ReferenceSources/SR.cs
mcs/class/System.Runtime.Serialization/ReferenceSources/SR.missing.cs [new file with mode: 0644]
mcs/class/System.Runtime.Serialization/ReferenceSources/SR_missing.cs [deleted file]
mcs/class/System.Runtime.Serialization/System.Runtime.Serialization.dll.sources
mcs/class/System.Security/Makefile
mcs/class/System.ServiceModel.Activation/Makefile
mcs/class/System.ServiceModel.Discovery/Makefile
mcs/class/System.ServiceModel.Routing/Makefile
mcs/class/System.ServiceModel/Makefile
mcs/class/System.Threading.Tasks.Dataflow/Makefile
mcs/class/System.Transactions/Makefile
mcs/class/System.Web.DynamicData/Makefile
mcs/class/System.Web.Extensions/Makefile
mcs/class/System.Web.Extensions/System.Web.Script.Serialization/JsonDeserializer.cs
mcs/class/System.Web.Extensions/Test/System.Web.Script.Serialization/JavaScriptSerializerTest.cs
mcs/class/System.Web.Services/Makefile
mcs/class/System.Web/Makefile
mcs/class/System.Web/Test/tools/Makefile
mcs/class/System.Windows.Forms/Makefile
mcs/class/System.XML/Makefile
mcs/class/System/Assembly/AssemblyInfo.cs
mcs/class/System/Makefile
mcs/class/System/Microsoft.CSharp/CSharpCodeCompiler.cs
mcs/class/System/Mono.Net.Security/ChainValidationHelper.cs
mcs/class/System/System.IO/KeventWatcher.cs
mcs/class/System/System.Net/EndPointListener.cs
mcs/class/WebMatrix.Data/Makefile
mcs/class/WindowsBase/Makefile
mcs/class/corlib/Assembly/AssemblyInfo.cs
mcs/class/corlib/Makefile
mcs/class/corlib/Mono.Interop/ComInteropProxy.cs
mcs/class/corlib/System.Security.Cryptography.X509Certificates/X509CertificateImplApple.cs
mcs/class/corlib/System/TypeSpec.cs
mcs/class/corlib/System/__ComObject.cs
mcs/class/corlib/Test/System.Runtime.ExceptionServices/ExceptionDispatchInfoTest.cs
mcs/class/corlib/Test/System/TypeTest.cs
mcs/class/corlib/monotouch_tv_runtime_corlib.dll.sources
mcs/class/corlib/monotouch_watch_runtime_corlib.dll.sources
mcs/class/monodoc/Makefile
mcs/errors/Makefile
mcs/mcs/Makefile
mcs/nunit24/ClientUtilities/util/Makefile
mcs/nunit24/ConsoleRunner/nunit-console-exe/Makefile
mcs/nunit24/ConsoleRunner/nunit-console/Makefile
mcs/nunit24/NUnitCore/core/Makefile
mcs/nunit24/NUnitCore/interfaces/Makefile
mcs/nunit24/NUnitExtensions/core/Makefile
mcs/nunit24/NUnitExtensions/framework/Makefile
mcs/nunit24/NUnitFramework/framework/Makefile
mcs/nunit24/NUnitMocks/mocks/Makefile
mcs/tools/Makefile
mcs/tools/al/Al.cs
mcs/tools/al/Makefile
mcs/tools/al/al.exe.sources
mcs/tools/browsercaps-updater/Makefile
mcs/tools/cccheck/Makefile
mcs/tools/ccrewrite/Makefile
mcs/tools/cil-stringreplacer/Makefile
mcs/tools/cil-strip/Makefile
mcs/tools/compiler-tester/Makefile
mcs/tools/corcompare/Makefile
mcs/tools/corcompare/mono-api-html/ApiChange.cs [deleted file]
mcs/tools/corcompare/mono-api-html/ApiDiff.cs [deleted file]
mcs/tools/corcompare/mono-api-html/AssemblyComparer.cs [deleted file]
mcs/tools/corcompare/mono-api-html/ClassComparer.cs [deleted file]
mcs/tools/corcompare/mono-api-html/Comparer.cs [deleted file]
mcs/tools/corcompare/mono-api-html/ConstructorComparer.cs [deleted file]
mcs/tools/corcompare/mono-api-html/EventComparer.cs [deleted file]
mcs/tools/corcompare/mono-api-html/FieldComparer.cs [deleted file]
mcs/tools/corcompare/mono-api-html/Helpers.cs [deleted file]
mcs/tools/corcompare/mono-api-html/InterfaceComparer.cs [deleted file]
mcs/tools/corcompare/mono-api-html/MemberComparer.cs [deleted file]
mcs/tools/corcompare/mono-api-html/MethodComparer.cs [deleted file]
mcs/tools/corcompare/mono-api-html/NamespaceComparer.cs [deleted file]
mcs/tools/corcompare/mono-api-html/PropertyComparer.cs [deleted file]
mcs/tools/corcompare/mono-api-html/mono-api-html.csproj [deleted file]
mcs/tools/corcompare/mono-api-info.exe.sources [new file with mode: 0644]
mcs/tools/csharp/Makefile
mcs/tools/culevel/Makefile
mcs/tools/disco/Makefile
mcs/tools/dtd2rng/Makefile
mcs/tools/dtd2xsd/Makefile
mcs/tools/gacutil/Makefile
mcs/tools/genxs/Makefile
mcs/tools/ictool/Makefile
mcs/tools/ikdasm/Makefile
mcs/tools/installutil/Makefile
mcs/tools/installvst/Makefile
mcs/tools/lc/Makefile
mcs/tools/linker-analyzer/Makefile
mcs/tools/linker/Makefile
mcs/tools/mconfig/Makefile
mcs/tools/mdbdump/Makefile
mcs/tools/mdbrebase/Makefile
mcs/tools/mdoc/Makefile
mcs/tools/mkbundle/Makefile
mcs/tools/mod/Makefile
mcs/tools/mono-api-html/ApiChange.cs [new file with mode: 0644]
mcs/tools/mono-api-html/ApiDiff.cs [new file with mode: 0644]
mcs/tools/mono-api-html/AssemblyComparer.cs [new file with mode: 0644]
mcs/tools/mono-api-html/ClassComparer.cs [new file with mode: 0644]
mcs/tools/mono-api-html/Comparer.cs [new file with mode: 0644]
mcs/tools/mono-api-html/ConstructorComparer.cs [new file with mode: 0644]
mcs/tools/mono-api-html/EventComparer.cs [new file with mode: 0644]
mcs/tools/mono-api-html/FieldComparer.cs [new file with mode: 0644]
mcs/tools/mono-api-html/Helpers.cs [new file with mode: 0644]
mcs/tools/mono-api-html/InterfaceComparer.cs [new file with mode: 0644]
mcs/tools/mono-api-html/Makefile [new file with mode: 0644]
mcs/tools/mono-api-html/MemberComparer.cs [new file with mode: 0644]
mcs/tools/mono-api-html/MethodComparer.cs [new file with mode: 0644]
mcs/tools/mono-api-html/NamespaceComparer.cs [new file with mode: 0644]
mcs/tools/mono-api-html/PropertyComparer.cs [new file with mode: 0644]
mcs/tools/mono-api-html/mono-api-html.csproj [new file with mode: 0644]
mcs/tools/mono-api-html/mono-api-html.exe.sources [new file with mode: 0644]
mcs/tools/mono-configuration-crypto/cli/Makefile
mcs/tools/mono-configuration-crypto/lib/Makefile
mcs/tools/mono-service/Makefile
mcs/tools/mono-shlib-cop/Makefile
mcs/tools/mono-symbolicate/Makefile
mcs/tools/mono-xmltool/Makefile
mcs/tools/mono-xsd/Makefile
mcs/tools/monop/Makefile
mcs/tools/msbuild/Makefile
mcs/tools/nunit-lite/NUnitLite/Makefile
mcs/tools/nunit-lite/nunit-lite-console/Makefile
mcs/tools/nunitreport/Makefile
mcs/tools/pdb2mdb/Makefile
mcs/tools/resgen/Makefile
mcs/tools/security/Makefile
mcs/tools/security/certview/Makefile
mcs/tools/sgen/Makefile
mcs/tools/soapsuds/Makefile
mcs/tools/sqlmetal/Makefile
mcs/tools/sqlmetal/Test/.gitattributes [deleted file]
mcs/tools/sqlmetal/Test/AssemblyInfo.cs [deleted file]
mcs/tools/sqlsharp/Makefile
mcs/tools/svcutil/Makefile
mcs/tools/tuner/Makefile
mcs/tools/txt2sr/Makefile
mcs/tools/txt2sr/txt2sr.cs
mcs/tools/wsdl/Makefile
mcs/tools/xbuild/Makefile
mcs/tools/xbuild/SolutionParser.cs
mcs/tools/xbuild/xbuild.make
mono/metadata/appdomain.c
mono/metadata/attach.c
mono/metadata/class-internals.h
mono/metadata/class.c
mono/metadata/cominterop.c
mono/metadata/exception.c
mono/metadata/gc.c
mono/metadata/icall.c
mono/metadata/loader.c
mono/metadata/marshal.c
mono/metadata/metadata-internals.h
mono/metadata/metadata.c
mono/metadata/metadata.h
mono/metadata/method-builder.c
mono/metadata/mono-basic-block.c
mono/metadata/object-offsets.h
mono/metadata/pedump.c
mono/metadata/profiler.c
mono/metadata/reflection-internals.h
mono/metadata/reflection.c
mono/metadata/reflection.h
mono/metadata/sgen-mono.c
mono/metadata/threadpool-ms-io.c
mono/metadata/threadpool-ms.c
mono/metadata/threads-types.h
mono/metadata/threads.c
mono/metadata/verify.c
mono/mini/Makefile.am.in
mono/mini/aot-compiler.c
mono/mini/debugger-agent.c
mono/mini/driver.c
mono/mini/dwarfwriter.c
mono/mini/exceptions-arm64.c
mono/mini/method-to-ir.c
mono/mini/mini-amd64-gsharedvt.c
mono/mini/mini-amd64.c
mono/mini/mini-amd64.h
mono/mini/mini-arm-tls.S
mono/mini/mini-arm64-gsharedvt.c
mono/mini/mini-arm64.c
mono/mini/mini-arm64.h
mono/mini/mini-exceptions-native-unwinder.c
mono/mini/mini-generic-sharing.c
mono/mini/mini-llvm.c
mono/mini/mini-posix.c
mono/mini/mini-runtime.c
mono/mini/mini.c
mono/mini/tramp-amd64-gsharedvt.c
mono/mini/tramp-arm64-gsharedvt.c
mono/mini/tramp-arm64.c
mono/mini/tramp-x86-gsharedvt.c
mono/profiler/decode.c
mono/profiler/proflog.c
mono/profiler/ptestrunner.pl
mono/sgen/sgen-gc.c
mono/tests/Makefile.am
mono/tests/sgen-toggleref.cs
mono/tests/test-runner.cs
mono/utils/atomic.c
mono/utils/atomic.h
mono/utils/mono-compiler.h
mono/utils/mono-dl.c
mono/utils/mono-error-internals.h
mono/utils/mono-error.c
mono/utils/mono-threads-posix-signals.c
mono/utils/mono-threads-posix-signals.h
mono/utils/mono-threads-posix.c
mono/utils/mono-threads.c
mono/utils/mono-threads.h
mono/utils/monobitset.h
msvc/libmono.vcxproj
msvc/libmonoruntime.vcxproj
scripts/babysitter [deleted file]
scripts/ci/babysitter [new file with mode: 0755]
scripts/ci/run-jenkins.sh [new file with mode: 0755]
scripts/ci/run-step.sh [new file with mode: 0755]

index 2271e371f6906a8ef575697b7ab23057ab51dd04..8f75b05470fe46685d232f3a35933dbc1080fc59 100644 (file)
@@ -5152,7 +5152,7 @@ $(CORECLR_PATH)%.exe: $(CORECLR_PATH)%.cs coreclr-testlibrary.dll
        $(MCS) -unsafe -debug -nowarn:0162 -nowarn:0168 -nowarn:0219 -nowarn:0414 -nowarn:0618 -nowarn:0169 -nowarn:1690 -nowarn:0649 -nowarn:0612 -nowarn:3021 -nowarn:0197 -r:coreclr-testlibrary.dll -d:MONO -out:$@ $<
 
 test-runner.exe: $(top_srcdir)/mono/tests/test-runner.cs
-       $(MCS) -debug -out:$@ $<
+       $(MCS) -debug -r:Mono.Posix.dll -out:$@ $<
 
 GCStressTests.exe: $(CORECLR_STRESSTEST_RUNNER_CS_SRC)
        $(MCS) -out:$@ -debug -d:PROJECTK_BUILD $(CORECLR_STRESSTEST_RUNNER_CS_SRC)
index 12ed84fb8431368f42b8760dd8216a919921ccd6..0341987c485a8f92e60172a01459695f365081b6 100644 (file)
@@ -1076,6 +1076,7 @@ if test x$host_win32 = xno; then
 
        dnl hires monotonic clock support
        AC_SEARCH_LIBS(clock_gettime, rt)
+       AC_CHECK_FUNCS(clock_nanosleep)
 
        dnl dynamic loader support
        AC_CHECK_FUNC(dlopen, DL_LIB="",
index c19ba5c33758cc2e935f459b907e8b3d22736a4a..f0b979903569b952d3875075a7af57206fc7f124 100644 (file)
@@ -13,10 +13,10 @@ ASSEMBLED_DOCS = \
        monoapi.tree monoapi.zip
 
 convert.exe: $(srcdir)/convert.cs AgilityPack.dll
-       $(CSCOMPILE) -r:System.Xml.dll -out:$@ $< -r:AgilityPack.dll
+       $(CSCOMPILE) -r:$(topdir)/class/lib/$(PROFILE)/System.Xml.dll -out:$@ $< -r:AgilityPack.dll
 
 AgilityPack.dll:
-       $(CSCOMPILE) -r:System.dll -r:System.Xml.dll -target:library -out:$@ $(srcdir)/HtmlAgilityPack/*.cs
+       $(CSCOMPILE) -r:$(topdir)/class/lib/$(PROFILE)/System.dll -r:$(topdir)/class/lib/$(PROFILE)/System.Xml.dll -target:library -out:$@ $(srcdir)/HtmlAgilityPack/*.cs
 
 monoapi.zip: monoapi.tree
        @test -f $@ || { rm -f $< && $(MAKE) $<; }
diff --git a/external/android-libunwind/README b/external/android-libunwind/README
new file mode 100644 (file)
index 0000000..b226141
--- /dev/null
@@ -0,0 +1,9 @@
+This is a copy of a few libunwind headers from https://android.googlesource.com/platform/external/libunwind
+
+We can't make the repo a git submodule because it contains a folder called 'aux' which
+is reserved on Windows and would break on checkout there.
+
+These files are unmodified from the originals and should preferably stay that
+way to avoid merge hell.
+
+Commit: 338c9755cfe3d009c3dfff7d108e2c3ddaa6f3bb (android-6.0.1_r24)
\ No newline at end of file
diff --git a/external/android-libunwind/include/libunwind-aarch64.h b/external/android-libunwind/include/libunwind-aarch64.h
new file mode 100644 (file)
index 0000000..700ed17
--- /dev/null
@@ -0,0 +1,219 @@
+/* libunwind - a platform-independent unwind library
+   Copyright (C) 2001-2004 Hewlett-Packard Co
+       Contributed by David Mosberger-Tang <davidm@hpl.hp.com>
+   Copyright (C) 2013 Linaro Limited
+
+This file is part of libunwind.
+
+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.  */
+
+#ifndef LIBUNWIND_H
+#define LIBUNWIND_H
+
+#if defined(__cplusplus) || defined(c_plusplus)
+extern "C" {
+#endif
+
+#include <inttypes.h>
+#include <stddef.h>
+#include <ucontext.h>
+
+#define UNW_TARGET     aarch64
+#define UNW_TARGET_AARCH64     1
+
+#define _U_TDEP_QP_TRUE        0       /* see libunwind-dynamic.h  */
+
+/* This needs to be big enough to accommodate "struct cursor", while
+   leaving some slack for future expansion.  Changing this value will
+   require recompiling all users of this library.  Stack allocation is
+   relatively cheap and unwind-state copying is relatively rare, so we
+   want to err on making it rather too big than too small.  */
+
+#define UNW_TDEP_CURSOR_LEN    4096
+
+typedef uint64_t unw_word_t;
+typedef int64_t unw_sword_t;
+
+typedef long double unw_tdep_fpreg_t;
+
+typedef struct
+  {
+    /* no aarch64-specific auxiliary proc-info */
+    /* ANDROID support update. */
+    char __reserved;
+    /* End of ANDROID update. */
+  }
+unw_tdep_proc_info_t;
+
+typedef enum
+  {
+    /* 64-bit general registers.  */
+    UNW_AARCH64_X0,
+    UNW_AARCH64_X1,
+    UNW_AARCH64_X2,
+    UNW_AARCH64_X3,
+    UNW_AARCH64_X4,
+    UNW_AARCH64_X5,
+    UNW_AARCH64_X6,
+    UNW_AARCH64_X7,
+    UNW_AARCH64_X8,
+
+    /* Temporary registers.  */
+    UNW_AARCH64_X9,
+    UNW_AARCH64_X10,
+    UNW_AARCH64_X11,
+    UNW_AARCH64_X12,
+    UNW_AARCH64_X13,
+    UNW_AARCH64_X14,
+    UNW_AARCH64_X15,
+
+    /* Intra-procedure-call temporary registers.  */
+    UNW_AARCH64_X16,
+    UNW_AARCH64_X17,
+
+    /* Callee-saved registers.  */
+    UNW_AARCH64_X18,
+    UNW_AARCH64_X19,
+    UNW_AARCH64_X20,
+    UNW_AARCH64_X21,
+    UNW_AARCH64_X22,
+    UNW_AARCH64_X23,
+    UNW_AARCH64_X24,
+    UNW_AARCH64_X25,
+    UNW_AARCH64_X26,
+    UNW_AARCH64_X27,
+    UNW_AARCH64_X28,
+
+    /* 64-bit frame pointer.  */
+    UNW_AARCH64_X29,
+
+    /* 64-bit link register.  */
+    UNW_AARCH64_X30,
+
+    /* 64-bit stack pointer.  */
+    UNW_AARCH64_SP =  31,
+    UNW_AARCH64_PC,
+    UNW_AARCH64_PSTATE,
+
+    /* 128-bit FP/Advanced SIMD registers.  */
+    UNW_AARCH64_V0 = 64,
+    UNW_AARCH64_V1,
+    UNW_AARCH64_V2,
+    UNW_AARCH64_V3,
+    UNW_AARCH64_V4,
+    UNW_AARCH64_V5,
+    UNW_AARCH64_V6,
+    UNW_AARCH64_V7,
+    UNW_AARCH64_V8,
+    UNW_AARCH64_V9,
+    UNW_AARCH64_V10,
+    UNW_AARCH64_V11,
+    UNW_AARCH64_V12,
+    UNW_AARCH64_V13,
+    UNW_AARCH64_V14,
+    UNW_AARCH64_V15,
+    UNW_AARCH64_V16,
+    UNW_AARCH64_V17,
+    UNW_AARCH64_V18,
+    UNW_AARCH64_V19,
+    UNW_AARCH64_V20,
+    UNW_AARCH64_V21,
+    UNW_AARCH64_V22,
+    UNW_AARCH64_V23,
+    UNW_AARCH64_V24,
+    UNW_AARCH64_V25,
+    UNW_AARCH64_V26,
+    UNW_AARCH64_V27,
+    UNW_AARCH64_V28,
+    UNW_AARCH64_V29,
+    UNW_AARCH64_V30,
+    UNW_AARCH64_V31,
+
+    UNW_AARCH64_FPSR,
+    UNW_AARCH64_FPCR,
+
+    /* For AArch64, the CFA is the value of SP (x31) at the call site of the
+       previous frame.  */
+    UNW_AARCH64_CFA = UNW_AARCH64_SP,
+
+    UNW_TDEP_LAST_REG = UNW_AARCH64_FPCR,
+
+    UNW_TDEP_IP = UNW_AARCH64_X30,
+    UNW_TDEP_SP = UNW_AARCH64_SP,
+    UNW_TDEP_EH = UNW_AARCH64_X0,
+
+  }
+aarch64_regnum_t;
+
+/* Use R0 through R3 to pass exception handling information.  */
+#define UNW_TDEP_NUM_EH_REGS   4
+
+typedef struct unw_tdep_save_loc
+  {
+    /* Additional target-dependent info on a save location.  */
+    /* ANDROID support update. */
+    char __reserved;
+    /* End of ANDROID update. */
+  }
+unw_tdep_save_loc_t;
+
+
+/* On AArch64, we can directly use ucontext_t as the unwind context.  */
+typedef ucontext_t unw_tdep_context_t;
+
+#include "libunwind-common.h"
+#include "libunwind-dynamic.h"
+
+/* ANDROID support update. */
+/* There is no getcontext in Android. */
+#define unw_tdep_getcontext(uc) (({                                    \
+  unw_tdep_context_t *unw_ctx = (uc);                                  \
+  register uint64_t *unw_base asm ("x0") = (uint64_t*) unw_ctx->uc_mcontext.regs;              \
+  __asm__ __volatile__ (                                               \
+     "stp x0, x1, [%[base], #0]\n" \
+     "stp x2, x3, [%[base], #16]\n" \
+     "stp x4, x5, [%[base], #32]\n" \
+     "stp x6, x7, [%[base], #48]\n" \
+     "stp x8, x9, [%[base], #64]\n" \
+     "stp x10, x11, [%[base], #80]\n" \
+     "stp x12, x13, [%[base], #96]\n" \
+     "stp x14, x13, [%[base], #112]\n" \
+     "stp x16, x17, [%[base], #128]\n" \
+     "stp x18, x19, [%[base], #144]\n" \
+     "stp x20, x21, [%[base], #160]\n" \
+     "stp x22, x23, [%[base], #176]\n" \
+     "stp x24, x25, [%[base], #192]\n" \
+     "stp x26, x27, [%[base], #208]\n" \
+     "stp x28, x29, [%[base], #224]\n" \
+     "str x30, [%[base], #240]\n" \
+     "mov x1, sp\n" \
+     "stp x1, x30, [%[base], #248]\n" \
+     : [base] "+r" (unw_base) : : "x1", "memory"); \
+  }), 0)
+/* End of ANDROID update. */
+#define unw_tdep_is_fpreg              UNW_ARCH_OBJ(is_fpreg)
+
+extern int unw_tdep_is_fpreg (int);
+
+#if defined(__cplusplus) || defined(c_plusplus)
+}
+#endif
+
+#endif /* LIBUNWIND_H */
diff --git a/external/android-libunwind/include/libunwind-arm.h b/external/android-libunwind/include/libunwind-arm.h
new file mode 100644 (file)
index 0000000..495948e
--- /dev/null
@@ -0,0 +1,308 @@
+/* libunwind - a platform-independent unwind library
+   Copyright (C) 2008 CodeSourcery
+
+This file is part of libunwind.
+
+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.  */
+
+#ifndef LIBUNWIND_H
+#define LIBUNWIND_H
+
+#if defined(__cplusplus) || defined(c_plusplus)
+extern "C" {
+#endif
+
+#include <inttypes.h>
+#include <stddef.h>
+
+#define UNW_TARGET     arm
+#define UNW_TARGET_ARM 1
+
+#define _U_TDEP_QP_TRUE        0       /* see libunwind-dynamic.h  */
+
+/* This needs to be big enough to accommodate "struct cursor", while
+   leaving some slack for future expansion.  Changing this value will
+   require recompiling all users of this library.  Stack allocation is
+   relatively cheap and unwind-state copying is relatively rare, so we
+   want to err on making it rather too big than too small.  */
+   
+/* FIXME for ARM. Too big?  What do other things use for similar tasks?  */
+#define UNW_TDEP_CURSOR_LEN    4096
+
+typedef uint32_t unw_word_t;
+typedef int32_t unw_sword_t;
+
+typedef long double unw_tdep_fpreg_t;
+
+typedef enum
+  {
+    UNW_ARM_R0,
+    UNW_ARM_R1,
+    UNW_ARM_R2,
+    UNW_ARM_R3,
+    UNW_ARM_R4,
+    UNW_ARM_R5,
+    UNW_ARM_R6,
+    UNW_ARM_R7,
+    UNW_ARM_R8,
+    UNW_ARM_R9,
+    UNW_ARM_R10,
+    UNW_ARM_R11,
+    UNW_ARM_R12,
+    UNW_ARM_R13,
+    UNW_ARM_R14,
+    UNW_ARM_R15,
+    
+    /* VFPv2 s0-s31 (obsolescent numberings).  */
+    UNW_ARM_S0 = 64,
+    UNW_ARM_S1,
+    UNW_ARM_S2,
+    UNW_ARM_S3,
+    UNW_ARM_S4,
+    UNW_ARM_S5,
+    UNW_ARM_S6,
+    UNW_ARM_S7,
+    UNW_ARM_S8,
+    UNW_ARM_S9,
+    UNW_ARM_S10,
+    UNW_ARM_S11,
+    UNW_ARM_S12,
+    UNW_ARM_S13,
+    UNW_ARM_S14,
+    UNW_ARM_S15,
+    UNW_ARM_S16,
+    UNW_ARM_S17,
+    UNW_ARM_S18,
+    UNW_ARM_S19,
+    UNW_ARM_S20,
+    UNW_ARM_S21,
+    UNW_ARM_S22,
+    UNW_ARM_S23,
+    UNW_ARM_S24,
+    UNW_ARM_S25,
+    UNW_ARM_S26,
+    UNW_ARM_S27,
+    UNW_ARM_S28,
+    UNW_ARM_S29,
+    UNW_ARM_S30,
+    UNW_ARM_S31,
+    
+    /* FPA register numberings.  */
+    UNW_ARM_F0 = 96,
+    UNW_ARM_F1,
+    UNW_ARM_F2,
+    UNW_ARM_F3,
+    UNW_ARM_F4,
+    UNW_ARM_F5,
+    UNW_ARM_F6,
+    UNW_ARM_F7,
+    
+    /* iWMMXt GR register numberings.  */
+    UNW_ARM_wCGR0 = 104,
+    UNW_ARM_wCGR1,
+    UNW_ARM_wCGR2,
+    UNW_ARM_wCGR3,
+    UNW_ARM_wCGR4,
+    UNW_ARM_wCGR5,
+    UNW_ARM_wCGR6,
+    UNW_ARM_wCGR7,
+    
+    /* iWMMXt register numberings.  */
+    UNW_ARM_wR0 = 112,
+    UNW_ARM_wR1,
+    UNW_ARM_wR2,
+    UNW_ARM_wR3,
+    UNW_ARM_wR4,
+    UNW_ARM_wR5,
+    UNW_ARM_wR6,
+    UNW_ARM_wR7,
+    UNW_ARM_wR8,
+    UNW_ARM_wR9,
+    UNW_ARM_wR10,
+    UNW_ARM_wR11,
+    UNW_ARM_wR12,
+    UNW_ARM_wR13,
+    UNW_ARM_wR14,
+    UNW_ARM_wR15,
+    
+    /* Two-byte encodings from here on.  */
+    
+    /* SPSR.  */
+    UNW_ARM_SPSR = 128,
+    UNW_ARM_SPSR_FIQ,
+    UNW_ARM_SPSR_IRQ,
+    UNW_ARM_SPSR_ABT,
+    UNW_ARM_SPSR_UND,
+    UNW_ARM_SPSR_SVC,
+    
+    /* User mode registers.  */
+    UNW_ARM_R8_USR = 144,
+    UNW_ARM_R9_USR,
+    UNW_ARM_R10_USR,
+    UNW_ARM_R11_USR,
+    UNW_ARM_R12_USR,
+    UNW_ARM_R13_USR,
+    UNW_ARM_R14_USR,
+    
+    /* FIQ registers.  */
+    UNW_ARM_R8_FIQ = 151,
+    UNW_ARM_R9_FIQ,
+    UNW_ARM_R10_FIQ,
+    UNW_ARM_R11_FIQ,
+    UNW_ARM_R12_FIQ,
+    UNW_ARM_R13_FIQ,
+    UNW_ARM_R14_FIQ,
+    
+    /* IRQ registers.  */
+    UNW_ARM_R13_IRQ = 158,
+    UNW_ARM_R14_IRQ,
+    
+    /* ABT registers.  */
+    UNW_ARM_R13_ABT = 160,
+    UNW_ARM_R14_ABT,
+    
+    /* UND registers.  */
+    UNW_ARM_R13_UND = 162,
+    UNW_ARM_R14_UND,
+    
+    /* SVC registers.  */
+    UNW_ARM_R13_SVC = 164,
+    UNW_ARM_R14_SVC,
+    
+    /* iWMMXt control registers.  */
+    UNW_ARM_wC0 = 192,
+    UNW_ARM_wC1,
+    UNW_ARM_wC2,
+    UNW_ARM_wC3,
+    UNW_ARM_wC4,
+    UNW_ARM_wC5,
+    UNW_ARM_wC6,
+    UNW_ARM_wC7,
+
+    /* VFPv3/Neon 64-bit registers.  */
+    UNW_ARM_D0 = 256,
+    UNW_ARM_D1,
+    UNW_ARM_D2,
+    UNW_ARM_D3,
+    UNW_ARM_D4,
+    UNW_ARM_D5,
+    UNW_ARM_D6,
+    UNW_ARM_D7,
+    UNW_ARM_D8,
+    UNW_ARM_D9,
+    UNW_ARM_D10,
+    UNW_ARM_D11,
+    UNW_ARM_D12,
+    UNW_ARM_D13,
+    UNW_ARM_D14,
+    UNW_ARM_D15,
+    UNW_ARM_D16,
+    UNW_ARM_D17,
+    UNW_ARM_D18,
+    UNW_ARM_D19,
+    UNW_ARM_D20,
+    UNW_ARM_D21,
+    UNW_ARM_D22,
+    UNW_ARM_D23,
+    UNW_ARM_D24,
+    UNW_ARM_D25,
+    UNW_ARM_D26,
+    UNW_ARM_D27,
+    UNW_ARM_D28,
+    UNW_ARM_D29,
+    UNW_ARM_D30,
+    UNW_ARM_D31,
+
+    /* For ARM, the CFA is the value of SP (r13) at the call site in the
+       previous frame.  */
+    UNW_ARM_CFA,
+
+    UNW_TDEP_LAST_REG = UNW_ARM_D31,
+
+    UNW_TDEP_IP = UNW_ARM_R14,  /* A little white lie.  */
+    UNW_TDEP_SP = UNW_ARM_R13,
+    UNW_TDEP_EH = UNW_ARM_R0   /* FIXME.  */
+  }
+arm_regnum_t;
+
+#define UNW_TDEP_NUM_EH_REGS   2       /* FIXME for ARM.  */
+
+typedef struct unw_tdep_save_loc
+  {
+    /* Additional target-dependent info on a save location.  */
+    /* ANDROID support update. */
+    char __reserved;
+    /* End of ANDROID update. */
+  }
+unw_tdep_save_loc_t;
+
+/* On ARM, we define our own unw_tdep_context instead of using ucontext_t.
+   This allows us to support systems that don't support getcontext and
+   therefore do not define ucontext_t.  */
+typedef struct unw_tdep_context
+  {
+    unsigned long regs[16];
+  }
+unw_tdep_context_t;
+
+/* There is no getcontext() on ARM.  Use a stub version which only saves GP
+   registers.  FIXME: Not ideal, may not be sufficient for all libunwind
+   use cases.  Stores pc+8, which is only approximately correct, really.  */
+#ifndef __thumb__
+#define unw_tdep_getcontext(uc) (({                                    \
+  unw_tdep_context_t *unw_ctx = (uc);                                  \
+  register unsigned long *unw_base asm ("r0") = unw_ctx->regs;         \
+  __asm__ __volatile__ (                                               \
+    "stmia %[base], {r0-r15}"                                          \
+    : : [base] "r" (unw_base) : "memory");                             \
+  }), 0)
+#else /* __thumb__ */
+#define unw_tdep_getcontext(uc) (({                                    \
+  unw_tdep_context_t *unw_ctx = (uc);                                  \
+  register unsigned long *unw_base asm ("r0") = unw_ctx->regs;         \
+  __asm__ __volatile__ (                                               \
+    ".align 2\nbx pc\nnop\n.code 32\n"                                 \
+    "stmia %[base], {r0-r15}\n"                                                \
+    "orr %[base], pc, #1\nbx %[base]"                                  \
+    : [base] "+r" (unw_base) : : "memory", "cc");                      \
+  }), 0)
+#endif
+
+#include "libunwind-dynamic.h"
+
+typedef struct
+  {
+    /* no arm-specific auxiliary proc-info */
+    /* ANDROID support update. */
+    char __reserved;
+    /* End of ANDROID update. */
+  }
+unw_tdep_proc_info_t;
+
+#include "libunwind-common.h"
+
+#define unw_tdep_is_fpreg              UNW_ARCH_OBJ(is_fpreg)
+extern int unw_tdep_is_fpreg (int);
+
+#if defined(__cplusplus) || defined(c_plusplus)
+}
+#endif
+
+#endif /* LIBUNWIND_H */
diff --git a/external/android-libunwind/include/libunwind-common.h b/external/android-libunwind/include/libunwind-common.h
new file mode 100644 (file)
index 0000000..f4cbc88
--- /dev/null
@@ -0,0 +1,308 @@
+/* libunwind - a platform-independent unwind library
+   Copyright (C) 2001-2004 Hewlett-Packard Co
+       Contributed by David Mosberger-Tang <davidm@hpl.hp.com>
+
+This file is part of libunwind.
+
+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.  */
+
+/* ANDROID support update. */
+#include <sys/types.h>
+/* End of ANDROID update. */
+
+#define UNW_VERSION_MAJOR      1
+#define UNW_VERSION_MINOR      1
+#define UNW_VERSION_EXTRA      
+
+#define UNW_VERSION_CODE(maj,min)      (((maj) << 16) | (min))
+#define UNW_VERSION    UNW_VERSION_CODE(UNW_VERSION_MAJOR, UNW_VERSION_MINOR)
+
+#define UNW_PASTE2(x,y)        x##y
+#define UNW_PASTE(x,y) UNW_PASTE2(x,y)
+#define UNW_OBJ(fn)    UNW_PASTE(UNW_PREFIX, fn)
+#define UNW_ARCH_OBJ(fn) UNW_PASTE(UNW_PASTE(UNW_PASTE(_U,UNW_TARGET),_), fn)
+
+#ifdef UNW_LOCAL_ONLY
+# ifdef UNW_ADDITIONAL_PREFIX
+#  define UNW_PREFIX   UNW_PASTE(UNW_PASTE(_UUL,UNW_TARGET),_)
+# else
+#  define UNW_PREFIX   UNW_PASTE(UNW_PASTE(_UL,UNW_TARGET),_)
+# endif
+#else /* !UNW_LOCAL_ONLY */
+# ifdef UNW_ADDITIONAL_PREFIX
+#  define UNW_PREFIX   UNW_PASTE(UNW_PASTE(_UU,UNW_TARGET),_)
+# else
+#  define UNW_PREFIX   UNW_PASTE(UNW_PASTE(_U,UNW_TARGET),_)
+# endif
+#endif /* !UNW_LOCAL_ONLY */
+
+/* Error codes.  The unwind routines return the *negated* values of
+   these error codes on error and a non-negative value on success.  */
+typedef enum
+  {
+    UNW_ESUCCESS = 0,          /* no error */
+    UNW_EUNSPEC,               /* unspecified (general) error */
+    UNW_ENOMEM,                        /* out of memory */
+    UNW_EBADREG,               /* bad register number */
+    UNW_EREADONLYREG,          /* attempt to write read-only register */
+    UNW_ESTOPUNWIND,           /* stop unwinding */
+    UNW_EINVALIDIP,            /* invalid IP */
+    UNW_EBADFRAME,             /* bad frame */
+    UNW_EINVAL,                        /* unsupported operation or bad value */
+    UNW_EBADVERSION,           /* unwind info has unsupported version */
+    UNW_ENOINFO                        /* no unwind info found */
+  }
+unw_error_t;
+
+/* The following enum defines the indices for a couple of
+   (pseudo-)registers which have the same meaning across all
+   platforms.  (RO) means read-only.  (RW) means read-write.  General
+   registers (aka "integer registers") are expected to start with
+   index 0.  The number of such registers is architecture-dependent.
+   The remaining indices can be used as an architecture sees fit.  The
+   last valid register index is given by UNW_REG_LAST.  */
+typedef enum
+  {
+    UNW_REG_IP = UNW_TDEP_IP,          /* (rw) instruction pointer (pc) */
+    UNW_REG_SP = UNW_TDEP_SP,          /* (ro) stack pointer */
+    UNW_REG_EH = UNW_TDEP_EH,          /* (rw) exception-handling reg base */
+    UNW_REG_LAST = UNW_TDEP_LAST_REG
+  }
+unw_frame_regnum_t;
+
+/* Number of exception-handler argument registers: */
+#define UNW_NUM_EH_REGS                UNW_TDEP_NUM_EH_REGS
+
+typedef enum
+  {
+    UNW_CACHE_NONE,                    /* no caching */
+    UNW_CACHE_GLOBAL,                  /* shared global cache */
+    UNW_CACHE_PER_THREAD               /* per-thread caching */
+  }
+unw_caching_policy_t;
+
+typedef int unw_regnum_t;
+
+/* The unwind cursor starts at the youngest (most deeply nested) frame
+   and is used to track the frame state as the unwinder steps from
+   frame to frame.  It is safe to make (shallow) copies of variables
+   of this type.  */
+typedef struct unw_cursor
+  {
+    unw_word_t opaque[UNW_TDEP_CURSOR_LEN];
+  }
+unw_cursor_t;
+
+/* This type encapsulates the entire (preserved) machine-state.  */
+typedef unw_tdep_context_t unw_context_t;
+
+/* unw_getcontext() fills the unw_context_t pointed to by UC with the
+   machine state as it exists at the call-site.  For implementation
+   reasons, this needs to be a target-dependent macro.  It's easiest
+   to think of unw_getcontext() as being identical to getcontext(). */
+#define unw_getcontext(uc)             unw_tdep_getcontext(uc)
+
+/* Return 1 if register number R is a floating-point register, zero
+   otherwise.
+   This routine is signal-safe.  */
+#define unw_is_fpreg(r)                        unw_tdep_is_fpreg(r)
+
+typedef unw_tdep_fpreg_t unw_fpreg_t;
+
+typedef struct unw_addr_space *unw_addr_space_t;
+
+/* Each target may define it's own set of flags, but bits 0-15 are
+   reserved for general libunwind-use.  */
+#define UNW_PI_FLAG_FIRST_TDEP_BIT     16
+/* The information comes from a .debug_frame section.  */
+#define UNW_PI_FLAG_DEBUG_FRAME        32
+
+typedef struct unw_proc_info
+  {
+    unw_word_t start_ip;       /* first IP covered by this procedure */
+    unw_word_t end_ip;         /* first IP NOT covered by this procedure */
+    unw_word_t lsda;           /* address of lang.-spec. data area (if any) */
+    unw_word_t handler;                /* optional personality routine */
+    unw_word_t gp;             /* global-pointer value for this procedure */
+    unw_word_t flags;          /* misc. flags */
+
+    int format;                        /* unwind-info format (arch-specific) */
+    int unwind_info_size;      /* size of the information (if applicable) */
+    void *unwind_info;         /* unwind-info (arch-specific) */
+    unw_tdep_proc_info_t extra;        /* target-dependent auxiliary proc-info */
+  }
+unw_proc_info_t;
+
+/* These are backend callback routines that provide access to the
+   state of a "remote" process.  This can be used, for example, to
+   unwind another process through the ptrace() interface.  */
+typedef struct unw_accessors
+  {
+    /* Look up the unwind info associated with instruction-pointer IP.
+       On success, the routine fills in the PROC_INFO structure.  */
+    int (*find_proc_info) (unw_addr_space_t, unw_word_t, unw_proc_info_t *,
+                          int, void *);
+
+    /* Release any resources (e.g., memory) that were allocated for
+       the unwind info returned in by a previous call to
+       find_proc_info() with NEED_UNWIND_INFO set to 1.  */
+    void (*put_unwind_info) (unw_addr_space_t, unw_proc_info_t *, void *);
+
+    /* Return the list-head of the dynamically registered unwind
+       info.  */
+    int (*get_dyn_info_list_addr) (unw_addr_space_t, unw_word_t *, void *);
+
+    /* Access aligned word at address ADDR.  The value is returned
+       according to the endianness of the host (e.g., if the host is
+       little-endian and the target is big-endian, access_mem() needs
+       to byte-swap the value before returning it).  */
+    int (*access_mem) (unw_addr_space_t, unw_word_t, unw_word_t *, int,
+                      void *);
+
+    /* Access register number REG at address ADDR.  */
+    int (*access_reg) (unw_addr_space_t, unw_regnum_t, unw_word_t *, int,
+                      void *);
+
+    /* Access register number REG at address ADDR.  */
+    int (*access_fpreg) (unw_addr_space_t, unw_regnum_t,
+                        unw_fpreg_t *, int, void *);
+
+    int (*resume) (unw_addr_space_t, unw_cursor_t *, void *);
+
+    /* Optional call back to obtain the name of a (static) procedure.
+       Dynamically generated procedures are handled automatically by
+       libunwind.  This callback is optional and may be set to
+       NULL.  */
+    int (*get_proc_name) (unw_addr_space_t, unw_word_t, char *, size_t,
+                         unw_word_t *, void *);
+  }
+unw_accessors_t;
+
+typedef enum unw_save_loc_type
+  {
+    UNW_SLT_NONE,      /* register is not saved ("not an l-value") */
+    UNW_SLT_MEMORY,    /* register has been saved in memory */
+    UNW_SLT_REG                /* register has been saved in (another) register */
+  }
+unw_save_loc_type_t;
+
+typedef struct unw_save_loc
+  {
+    unw_save_loc_type_t type;
+    union
+      {
+       unw_word_t addr;        /* valid if type==UNW_SLT_MEMORY */
+       unw_regnum_t regnum;    /* valid if type==UNW_SLT_REG */
+      }
+    u;
+    unw_tdep_save_loc_t extra; /* target-dependent additional information */
+  }
+unw_save_loc_t;
+
+/* ANDROID support update. */
+typedef struct unw_map_cursor
+  {
+    void *map_list;
+    void *cur_map;
+  }
+unw_map_cursor_t;
+
+typedef struct unw_map
+  {
+    unw_word_t start;
+    unw_word_t end;
+    unw_word_t offset;
+    unw_word_t load_base;
+    char *path;
+    int flags;
+  }
+unw_map_t;
+/* End of ANDROID update. */
+
+/* These routines work both for local and remote unwinding.  */
+
+#define unw_local_access_addr_space_init UNW_OBJ(local_access_addr_space_init)
+#define unw_local_addr_space   UNW_OBJ(local_addr_space)
+#define unw_create_addr_space  UNW_OBJ(create_addr_space)
+#define unw_destroy_addr_space UNW_OBJ(destroy_addr_space)
+#define unw_get_accessors      UNW_ARCH_OBJ(get_accessors)
+#define unw_init_local         UNW_OBJ(init_local)
+#define unw_init_remote                UNW_OBJ(init_remote)
+#define unw_step               UNW_OBJ(step)
+#define unw_resume             UNW_OBJ(resume)
+#define unw_get_proc_info      UNW_OBJ(get_proc_info)
+#define unw_get_proc_info_by_ip        UNW_OBJ(get_proc_info_by_ip)
+#define unw_get_reg            UNW_OBJ(get_reg)
+#define unw_set_reg            UNW_OBJ(set_reg)
+#define unw_get_fpreg          UNW_OBJ(get_fpreg)
+#define unw_set_fpreg          UNW_OBJ(set_fpreg)
+#define unw_get_save_loc       UNW_OBJ(get_save_loc)
+#define unw_is_signal_frame    UNW_OBJ(is_signal_frame)
+#define unw_handle_signal_frame        UNW_OBJ(handle_signal_frame)
+#define unw_get_proc_name      UNW_OBJ(get_proc_name)
+#define unw_get_proc_name_by_ip        UNW_OBJ(get_proc_name_by_ip)
+#define unw_set_caching_policy UNW_OBJ(set_caching_policy)
+#define unw_regname            UNW_ARCH_OBJ(regname)
+#define unw_flush_cache                UNW_ARCH_OBJ(flush_cache)
+#define unw_strerror           UNW_ARCH_OBJ(strerror)
+
+extern void unw_local_access_addr_space_init (unw_addr_space_t);
+extern unw_addr_space_t unw_create_addr_space (unw_accessors_t *, int);
+extern void unw_destroy_addr_space (unw_addr_space_t);
+extern unw_accessors_t *unw_get_accessors (unw_addr_space_t);
+extern void unw_flush_cache (unw_addr_space_t, unw_word_t, unw_word_t);
+extern int unw_set_caching_policy (unw_addr_space_t, unw_caching_policy_t);
+extern const char *unw_regname (unw_regnum_t);
+
+extern int unw_init_local (unw_cursor_t *, unw_context_t *);
+extern int unw_init_remote (unw_cursor_t *, unw_addr_space_t, void *);
+extern int unw_step (unw_cursor_t *);
+extern int unw_resume (unw_cursor_t *);
+extern int unw_get_proc_info (unw_cursor_t *, unw_proc_info_t *);
+extern int unw_get_proc_info_by_ip (unw_addr_space_t, unw_word_t,
+                                   unw_proc_info_t *, void *);
+extern int unw_get_reg (unw_cursor_t *, int, unw_word_t *);
+extern int unw_set_reg (unw_cursor_t *, int, unw_word_t);
+extern int unw_get_fpreg (unw_cursor_t *, int, unw_fpreg_t *);
+extern int unw_set_fpreg (unw_cursor_t *, int, unw_fpreg_t);
+extern int unw_get_save_loc (unw_cursor_t *, int, unw_save_loc_t *);
+extern int unw_is_signal_frame (unw_cursor_t *);
+extern int unw_handle_signal_frame (unw_cursor_t *);
+extern int unw_get_proc_name (unw_cursor_t *, char *, size_t, unw_word_t *);
+extern int unw_get_proc_name_by_ip (unw_addr_space_t, unw_word_t, char *,
+                                   size_t, unw_word_t *, void *);
+extern const char *unw_strerror (int);
+extern int unw_backtrace (void **, int);
+
+/* ANDROID support update. */
+extern int unw_map_local_cursor_valid (unw_map_cursor_t *);
+extern void unw_map_local_cursor_get (unw_map_cursor_t *);
+extern int unw_map_local_cursor_get_next (unw_map_cursor_t *, unw_map_t *);
+extern int unw_map_local_create (void);
+extern void unw_map_local_destroy (void);
+extern void unw_map_set (unw_addr_space_t, unw_map_cursor_t *);
+extern void unw_map_cursor_reset (unw_map_cursor_t *);
+extern void unw_map_cursor_clear (unw_map_cursor_t *);
+extern int unw_map_cursor_create (unw_map_cursor_t *, pid_t);
+extern void unw_map_cursor_destroy (unw_map_cursor_t *);
+extern int unw_map_cursor_get_next (unw_map_cursor_t *, unw_map_t *);
+/* End of ANDROID update. */
+
+extern unw_addr_space_t unw_local_addr_space;
diff --git a/external/android-libunwind/include/libunwind-coredump.h b/external/android-libunwind/include/libunwind-coredump.h
new file mode 100644 (file)
index 0000000..d2b05e7
--- /dev/null
@@ -0,0 +1,73 @@
+/* libunwind - a platform-independent unwind library
+
+This file is part of libunwind.
+
+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.  */
+
+#ifndef libunwind_coredump_h
+#define libunwind_coredump_h
+
+#include <libunwind.h>
+
+#if defined(__cplusplus) || defined(c_plusplus)
+extern "C" {
+#endif
+
+/* Helper routines which make it easy to use libunwind on a coredump.
+   They're available only if UNW_REMOTE_ONLY is _not_ defined and they
+   aren't really part of the libunwind API.  They are implemented in a
+   archive library called libunwind-coredump.a.  */
+
+struct UCD_info;
+
+extern struct UCD_info *_UCD_create(const char *filename);
+extern void _UCD_destroy(struct UCD_info *);
+
+extern int _UCD_get_num_threads(struct UCD_info *);
+extern void _UCD_select_thread(struct UCD_info *, int);
+extern pid_t _UCD_get_pid(struct UCD_info *);
+extern int _UCD_get_cursig(struct UCD_info *);
+extern int _UCD_add_backing_file_at_segment(struct UCD_info *, int phdr_no, const char *filename);
+extern int _UCD_add_backing_file_at_vaddr(struct UCD_info *,
+                                         unsigned long vaddr,
+                                         const char *filename);
+
+extern int _UCD_find_proc_info (unw_addr_space_t, unw_word_t,
+                               unw_proc_info_t *, int, void *);
+extern void _UCD_put_unwind_info (unw_addr_space_t, unw_proc_info_t *, void *);
+extern int _UCD_get_dyn_info_list_addr (unw_addr_space_t, unw_word_t *,
+                                       void *);
+extern int _UCD_access_mem (unw_addr_space_t, unw_word_t, unw_word_t *, int,
+                           void *);
+extern int _UCD_access_reg (unw_addr_space_t, unw_regnum_t, unw_word_t *,
+                           int, void *);
+extern int _UCD_access_fpreg (unw_addr_space_t, unw_regnum_t, unw_fpreg_t *,
+                             int, void *);
+extern int _UCD_get_proc_name (unw_addr_space_t, unw_word_t, char *, size_t,
+                              unw_word_t *, void *);
+extern int _UCD_resume (unw_addr_space_t, unw_cursor_t *, void *);
+extern unw_accessors_t _UCD_accessors;
+
+
+#if defined(__cplusplus) || defined(c_plusplus)
+}
+#endif
+
+#endif /* libunwind_coredump_h */
diff --git a/external/android-libunwind/include/libunwind-dynamic.h b/external/android-libunwind/include/libunwind-dynamic.h
new file mode 100644 (file)
index 0000000..584f392
--- /dev/null
@@ -0,0 +1,210 @@
+/* libunwind - a platform-independent unwind library
+   Copyright (C) 2002-2004 Hewlett-Packard Co
+       Contributed by David Mosberger-Tang <davidm@hpl.hp.com>
+
+This file is part of libunwind.
+
+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.  */
+
+/* This file defines the runtime-support routines for dynamically
+generated code.  Even though it is implemented as part of libunwind,
+it is logically separate from the interface to perform the actual
+unwinding.  In particular, this interface is always used in the
+context of the unwind target, whereas the rest of the unwind API is
+used in context of the process that is doing the unwind (which may be
+a debugger running on another machine, for example).
+
+Note that the data-structures declared here server a dual purpose:
+when a program registers a dynamically generated procedure, it uses
+these structures directly.  On the other hand, with remote-unwinding,
+the data-structures are read from the remote process's memory and
+translated into internalized versions.  To facilitate remote-access,
+the following rules should be followed in declaring these structures:
+
+ (1) Declare a member as a pointer only if the the information the
+     member points to needs to be internalized as well (e.g., a
+     string representing a procedure name should be declared as
+     "const char *", but the instruction pointer should be declared
+     as unw_word_t).
+
+ (2) Provide sufficient padding to ensure that no implicit padding
+     will be needed on any of the supported target architectures.  For
+     the time being, padding data structures with the assumption that
+     sizeof (unw_word_t) == 8 should be sufficient.  (Note: it's not
+     impossible to internalize structures with internal padding, but
+     it does make the process a bit harder).
+
+ (3) Don't declare members that contain bitfields or floating-point
+     values.
+
+ (4) Don't declare members with enumeration types.  Declare them as
+     int32_t instead.  */
+
+typedef enum
+  {
+    UNW_DYN_STOP = 0,          /* end-of-unwind-info marker */
+    UNW_DYN_SAVE_REG,          /* save register to another register */
+    UNW_DYN_SPILL_FP_REL,      /* frame-pointer-relative register spill */
+    UNW_DYN_SPILL_SP_REL,      /* stack-pointer-relative register spill */
+    UNW_DYN_ADD,               /* add constant value to a register */
+    UNW_DYN_POP_FRAMES,                /* drop one or more stack frames */
+    UNW_DYN_LABEL_STATE,       /* name the current state */
+    UNW_DYN_COPY_STATE,                /* set the region's entry-state */
+    UNW_DYN_ALIAS              /* get unwind info from an alias */
+  }
+unw_dyn_operation_t;
+
+typedef enum
+  {
+    UNW_INFO_FORMAT_DYNAMIC,           /* unw_dyn_proc_info_t */
+    UNW_INFO_FORMAT_TABLE,             /* unw_dyn_table_t */
+    UNW_INFO_FORMAT_REMOTE_TABLE,      /* unw_dyn_remote_table_t */
+    UNW_INFO_FORMAT_ARM_EXIDX          /* ARM specific unwind info */
+  }
+unw_dyn_info_format_t;
+
+typedef struct unw_dyn_op
+  {
+    int8_t tag;                                /* what operation? */
+    int8_t qp;                         /* qualifying predicate register */
+    int16_t reg;                       /* what register */
+    int32_t when;                      /* when does it take effect? */
+    unw_word_t val;                    /* auxiliary value */
+  }
+unw_dyn_op_t;
+
+typedef struct unw_dyn_region_info
+  {
+    struct unw_dyn_region_info *next;  /* linked list of regions */
+    int32_t insn_count;                        /* region length (# of instructions) */
+    uint32_t op_count;                 /* length of op-array */
+    unw_dyn_op_t op[1];                        /* variable-length op-array */
+  }
+unw_dyn_region_info_t;
+
+typedef struct unw_dyn_proc_info
+  {
+    unw_word_t name_ptr;       /* address of human-readable procedure name */
+    unw_word_t handler;                /* address of personality routine */
+    uint32_t flags;
+    int32_t pad0;
+    unw_dyn_region_info_t *regions;
+  }
+unw_dyn_proc_info_t;
+
+typedef struct unw_dyn_table_info
+  {
+    unw_word_t name_ptr;       /* addr. of table name (e.g., library name) */
+    unw_word_t segbase;                /* segment base */
+    unw_word_t table_len;      /* must be a multiple of sizeof(unw_word_t)! */
+    unw_word_t *table_data;
+  }
+unw_dyn_table_info_t;
+
+typedef struct unw_dyn_remote_table_info
+  {
+    unw_word_t name_ptr;       /* addr. of table name (e.g., library name) */
+    unw_word_t segbase;                /* segment base */
+    unw_word_t table_len;      /* must be a multiple of sizeof(unw_word_t)! */
+    unw_word_t table_data;
+  }
+unw_dyn_remote_table_info_t;
+
+typedef struct unw_dyn_info
+  {
+    /* doubly-linked list of dyn-info structures: */
+    struct unw_dyn_info *next;
+    struct unw_dyn_info *prev;
+    unw_word_t start_ip;       /* first IP covered by this entry */
+    unw_word_t end_ip;         /* first IP NOT covered by this entry */
+    unw_word_t gp;             /* global-pointer in effect for this entry */
+    int32_t format;            /* real type: unw_dyn_info_format_t */
+    int32_t pad;
+    union
+      {
+       unw_dyn_proc_info_t pi;
+       unw_dyn_table_info_t ti;
+       unw_dyn_remote_table_info_t rti;
+      }
+    u;
+  }
+unw_dyn_info_t;
+
+typedef struct unw_dyn_info_list
+  {
+    uint32_t version;
+    uint32_t generation;
+    unw_dyn_info_t *first;
+  }
+unw_dyn_info_list_t;
+
+/* Return the size (in bytes) of an unw_dyn_region_info_t structure that can
+   hold OP_COUNT ops.  */
+#define _U_dyn_region_info_size(op_count)                              \
+       ((char *) (((unw_dyn_region_info_t *) NULL)->op + (op_count))   \
+        - (char *) NULL)
+
+/* Register the unwind info for a single procedure.
+   This routine is NOT signal-safe.  */
+extern void _U_dyn_register (unw_dyn_info_t *);
+
+/* Cancel the unwind info for a single procedure.
+   This routine is NOT signal-safe.  */
+extern void _U_dyn_cancel (unw_dyn_info_t *);
+
+\f
+/* Convenience routines.  */
+
+#define _U_dyn_op(_tag, _qp, _when, _reg, _val)                                \
+       ((unw_dyn_op_t) { (_tag), (_qp), (_reg), (_when), (_val) })
+
+#define _U_dyn_op_save_reg(op, qp, when, reg, dst)                     \
+       (*(op) = _U_dyn_op (UNW_DYN_SAVE_REG, (qp), (when), (reg), (dst)))
+
+#define _U_dyn_op_spill_fp_rel(op, qp, when, reg, offset)              \
+       (*(op) = _U_dyn_op (UNW_DYN_SPILL_FP_REL, (qp), (when), (reg),  \
+                           (offset)))
+
+#define _U_dyn_op_spill_sp_rel(op, qp, when, reg, offset)              \
+       (*(op) = _U_dyn_op (UNW_DYN_SPILL_SP_REL, (qp), (when), (reg),  \
+                           (offset)))
+
+#define _U_dyn_op_add(op, qp, when, reg, value)                                \
+       (*(op) = _U_dyn_op (UNW_DYN_ADD, (qp), (when), (reg), (value)))
+
+#define _U_dyn_op_pop_frames(op, qp, when, num_frames)                 \
+       (*(op) = _U_dyn_op (UNW_DYN_POP_FRAMES, (qp), (when), 0, (num_frames)))
+
+#define _U_dyn_op_label_state(op, label)                               \
+       (*(op) = _U_dyn_op (UNW_DYN_LABEL_STATE, _U_QP_TRUE, -1, 0, (label)))
+
+#define _U_dyn_op_copy_state(op, label)                                        \
+       (*(op) = _U_dyn_op (UNW_DYN_COPY_STATE, _U_QP_TRUE, -1, 0, (label)))
+
+#define _U_dyn_op_alias(op, qp, when, addr)                            \
+       (*(op) = _U_dyn_op (UNW_DYN_ALIAS, (qp), (when), 0, (addr)))
+
+#define _U_dyn_op_stop(op)                                             \
+       (*(op) = _U_dyn_op (UNW_DYN_STOP, _U_QP_TRUE, -1, 0, 0))
+
+/* The target-dependent qualifying predicate which is always TRUE.  On
+   IA-64, that's p0 (0), on non-predicated architectures, the value is
+   ignored.  */
+#define _U_QP_TRUE     _U_TDEP_QP_TRUE
diff --git a/external/android-libunwind/include/libunwind-hppa.h b/external/android-libunwind/include/libunwind-hppa.h
new file mode 100644 (file)
index 0000000..b5fba56
--- /dev/null
@@ -0,0 +1,131 @@
+/* libunwind - a platform-independent unwind library
+   Copyright (C) 2003-2004 Hewlett-Packard Co
+
+This file is part of libunwind.
+
+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.  */
+
+#ifndef LIBUNWIND_H
+#define LIBUNWIND_H
+
+#if defined(__cplusplus) || defined(c_plusplus)
+extern "C" {
+#endif
+
+#include <inttypes.h>
+#include <ucontext.h>
+
+#define UNW_TARGET     hppa
+#define UNW_TARGET_HPPA        1
+
+#define _U_TDEP_QP_TRUE        0       /* see libunwind-dynamic.h  */
+
+/* This needs to be big enough to accommodate "struct cursor", while
+   leaving some slack for future expansion.  Changing this value will
+   require recompiling all users of this library.  Stack allocation is
+   relatively cheap and unwind-state copying is relatively rare, so we
+   want to err on making it rather too big than too small.  */
+#define UNW_TDEP_CURSOR_LEN    511
+
+typedef uint32_t unw_word_t;
+typedef int32_t unw_sword_t;
+
+typedef union
+  {
+    struct { unw_word_t bits[2]; } raw;
+    double val;
+  }
+unw_tdep_fpreg_t;
+
+typedef enum
+  {
+    /* Note: general registers are expected to start with index 0.
+       This convention facilitates architecture-independent
+       implementation of the C++ exception handling ABI.  See
+       _Unwind_SetGR() and _Unwind_GetGR() for details.  */
+    UNW_HPPA_GR = 0,
+     UNW_HPPA_RP = 2,                  /* return pointer */
+     UNW_HPPA_FP = 3,                  /* frame pointer */
+     UNW_HPPA_SP = UNW_HPPA_GR + 30,
+
+    UNW_HPPA_FR = UNW_HPPA_GR + 32,
+
+    UNW_HPPA_IP = UNW_HPPA_FR + 32,    /* instruction pointer */
+
+    /* other "preserved" registers (fpsr etc.)... */
+
+    /* PA-RISC has 4 exception-argument registers but they're not
+       contiguous.  To deal with this, we define 4 pseudo
+       exception-handling registers which we then alias to the actual
+       physical register.  */
+
+    UNW_HPPA_EH0 = UNW_HPPA_IP + 1,    /* alias for UNW_HPPA_GR + 20 */
+    UNW_HPPA_EH1 = UNW_HPPA_EH0 + 1,   /* alias for UNW_HPPA_GR + 21 */
+    UNW_HPPA_EH2 = UNW_HPPA_EH1 + 1,   /* alias for UNW_HPPA_GR + 22 */
+    UNW_HPPA_EH3 = UNW_HPPA_EH2 + 1,   /* alias for UNW_HPPA_GR + 31 */
+
+    /* frame info (read-only) */
+    UNW_HPPA_CFA,
+
+    UNW_TDEP_LAST_REG = UNW_HPPA_IP,
+
+    UNW_TDEP_IP = UNW_HPPA_IP,
+    UNW_TDEP_SP = UNW_HPPA_SP,
+    UNW_TDEP_EH = UNW_HPPA_EH0
+  }
+hppa_regnum_t;
+
+#define UNW_TDEP_NUM_EH_REGS   4
+
+typedef struct unw_tdep_save_loc
+  {
+    /* Additional target-dependent info on a save location.  */
+    /* ANDROID support update. */
+    char __reserved;
+    /* End of ANDROID update. */
+  }
+unw_tdep_save_loc_t;
+
+/* On PA-RISC, we can directly use ucontext_t as the unwind context.  */
+typedef ucontext_t unw_tdep_context_t;
+
+#define unw_tdep_is_fpreg(r)           ((unsigned) ((r) - UNW_HPPA_FR) < 32)
+
+#include "libunwind-dynamic.h"
+
+typedef struct
+  {
+    /* no PA-RISC-specific auxiliary proc-info */
+    /* ANDROID support update. */
+    char __reserved;
+    /* End of ANDROID update. */
+  }
+unw_tdep_proc_info_t;
+
+#include "libunwind-common.h"
+
+#define unw_tdep_getcontext            UNW_ARCH_OBJ (getcontext)
+extern int unw_tdep_getcontext (unw_tdep_context_t *);
+
+#if defined(__cplusplus) || defined(c_plusplus)
+}
+#endif
+
+#endif /* LIBUNWIND_H */
diff --git a/external/android-libunwind/include/libunwind-ia64.h b/external/android-libunwind/include/libunwind-ia64.h
new file mode 100644 (file)
index 0000000..4dcc4f9
--- /dev/null
@@ -0,0 +1,197 @@
+/* libunwind - a platform-independent unwind library
+   Copyright (C) 2001-2004 Hewlett-Packard Co
+       Contributed by David Mosberger-Tang <davidm@hpl.hp.com>
+
+This file is part of libunwind.
+
+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.  */
+
+#ifndef LIBUNWIND_H
+#define LIBUNWIND_H
+
+#include <inttypes.h>
+#include <ucontext.h>
+
+#if defined(__cplusplus) || defined(c_plusplus)
+extern "C" {
+#endif
+
+#ifdef ia64
+  /* This works around a bug in Intel's ECC v7.0 which defines "ia64"
+     as "1".  */
+# undef ia64
+#endif
+
+#ifdef __hpux
+  /* On HP-UX, there is no hope of supporting UNW_LOCAL_ONLY, because
+     it's impossible to obtain the address of the members in the
+     sigcontext structure.  */
+# undef UNW_LOCAL_ONLY
+# define UNW_GENERIC_ONLY
+#endif
+
+#define UNW_TARGET     ia64
+#define UNW_TARGET_IA64        1
+
+#define _U_TDEP_QP_TRUE        0       /* see libunwind-dynamic.h  */
+
+/* This needs to be big enough to accommodate "struct cursor", while
+   leaving some slack for future expansion.  Changing this value will
+   require recompiling all users of this library.  Stack allocation is
+   relatively cheap and unwind-state copying is relatively rare, so we
+   want to err on making it rather too big than too small.  */
+#define UNW_TDEP_CURSOR_LEN    511
+
+/* If this bit is it indicates that the procedure saved all of ar.bsp,
+   ar.bspstore, and ar.rnat.  If, additionally, ar.bsp != saved ar.bsp,
+   then this procedure has performed a register-backing-store switch.  */
+#define UNW_PI_FLAG_IA64_RBS_SWITCH_BIT        (UNW_PI_FLAG_FIRST_TDEP_BIT + 0)
+
+#define UNW_PI_FLAG_IA64_RBS_SWITCH    (1 << UNW_PI_FLAG_IA64_RBS_SWITCH_BIT)
+
+typedef uint64_t unw_word_t;
+typedef int64_t unw_sword_t;
+
+/* On IA-64, we want to access the contents of floating-point
+   registers as a pair of "words", but to ensure 16-byte alignment, we
+   make it a union that contains a "long double".  This will do the
+   Right Thing on all known IA-64 platforms, including HP-UX.  */
+typedef union
+  {
+    struct { unw_word_t bits[2]; } raw;
+    long double dummy; /* dummy to force 16-byte alignment */
+  }
+unw_tdep_fpreg_t;
+
+typedef struct
+  {
+    /* no ia64-specific auxiliary proc-info */
+    /* ANDROID support update. */
+    char __reserved;
+    /* End of ANDROID update. */
+  }
+unw_tdep_proc_info_t;
+
+typedef enum
+  {
+    /* Note: general registers are excepted to start with index 0.
+       This convention facilitates architecture-independent
+       implementation of the C++ exception handling ABI.  See
+       _Unwind_SetGR() and _Unwind_GetGR() for details.  */
+    UNW_IA64_GR = 0,                   /* general registers (r0..r127) */
+     UNW_IA64_GP = UNW_IA64_GR + 1,
+     UNW_IA64_TP = UNW_IA64_GR + 13,
+
+    UNW_IA64_NAT = UNW_IA64_GR + 128,  /* NaT registers (nat0..nat127) */
+
+    UNW_IA64_FR = UNW_IA64_NAT + 128,  /* fp registers (f0..f127) */
+
+    UNW_IA64_AR = UNW_IA64_FR + 128,   /* application registers (ar0..r127) */
+     UNW_IA64_AR_RSC = UNW_IA64_AR + 16,
+     UNW_IA64_AR_BSP = UNW_IA64_AR + 17,
+     UNW_IA64_AR_BSPSTORE = UNW_IA64_AR + 18,
+     UNW_IA64_AR_RNAT = UNW_IA64_AR + 19,
+     UNW_IA64_AR_CSD = UNW_IA64_AR + 25,
+     UNW_IA64_AR_26 = UNW_IA64_AR + 26,
+     UNW_IA64_AR_SSD = UNW_IA64_AR_26,
+     UNW_IA64_AR_CCV = UNW_IA64_AR + 32,
+     UNW_IA64_AR_UNAT = UNW_IA64_AR + 36,
+     UNW_IA64_AR_FPSR = UNW_IA64_AR + 40,
+     UNW_IA64_AR_PFS = UNW_IA64_AR + 64,
+     UNW_IA64_AR_LC = UNW_IA64_AR + 65,
+     UNW_IA64_AR_EC = UNW_IA64_AR + 66,
+
+    UNW_IA64_BR = UNW_IA64_AR + 128,   /* branch registers (b0..p7) */
+      UNW_IA64_RP = UNW_IA64_BR + 0,   /* return pointer (rp) */
+    UNW_IA64_PR = UNW_IA64_BR + 8,     /* predicate registers (p0..p63) */
+    UNW_IA64_CFM,
+
+    /* frame info: */
+    UNW_IA64_BSP,
+    UNW_IA64_IP,
+    UNW_IA64_SP,
+
+    UNW_TDEP_LAST_REG = UNW_IA64_SP,
+
+    UNW_TDEP_IP = UNW_IA64_IP,
+    UNW_TDEP_SP = UNW_IA64_SP,
+    UNW_TDEP_EH = UNW_IA64_GR + 15
+  }
+ia64_regnum_t;
+
+#define UNW_TDEP_NUM_EH_REGS   4       /* r15-r18 are exception args */
+
+typedef struct unw_tdep_save_loc
+  {
+    /* Additional target-dependent info on a save location.  On IA-64,
+       we use this to provide the bit number in which a NaT bit gets
+       saved.  */
+    uint8_t nat_bitnr;
+
+    /* Padding reserved for future use.  */
+    uint8_t reserved[7];
+  }
+unw_tdep_save_loc_t;
+
+/* On IA-64, we can directly use ucontext_t as the unwind context.  */
+typedef ucontext_t unw_tdep_context_t;
+
+#define unw_tdep_is_fpreg(r)           ((unsigned) ((r) - UNW_IA64_FR) < 128)
+
+#include "libunwind-dynamic.h"
+#include "libunwind-common.h"
+
+#ifdef __hpux
+  /* In theory, we could use _Uia64_getcontext() on HP-UX as well, but
+     the benefit of doing so would be marginal given that it can't
+     support UNW_LOCAL_ONLY.  */
+# define unw_tdep_getcontext           getcontext
+#else
+# define unw_tdep_getcontext           UNW_ARCH_OBJ (getcontext)
+  extern int unw_tdep_getcontext (unw_tdep_context_t *);
+#endif
+
+/* This is a helper routine to search an ia64 unwind table.  If the
+   address-space argument AS points to something other than the local
+   address-space, the memory for the unwind-info will be allocated
+   with malloc(), and should be free()d during the put_unwind_info()
+   callback.  This routine is signal-safe for the local-address-space
+   case ONLY.  */
+#define unw_search_ia64_unwind_table   UNW_OBJ(search_unwind_table)
+extern int unw_search_ia64_unwind_table (unw_addr_space_t, unw_word_t,
+                                        unw_dyn_info_t *, unw_proc_info_t *,
+                                        int, void *);
+
+/* This is a helper routine which the get_dyn_info_list_addr()
+   callback can use to locate the special dynamic-info list entry in
+   an IA-64 unwind table.  If the entry exists in the table, the
+   list-address is returned.  In all other cases, 0 is returned.  */
+extern unw_word_t _Uia64_find_dyn_list (unw_addr_space_t, unw_dyn_info_t *,
+                                       void *);
+
+/* This is a helper routine to obtain the kernel-unwind info.  It is
+   signal-safe.  */
+extern int _Uia64_get_kernel_table (unw_dyn_info_t *);
+
+#if defined(__cplusplus) || defined(c_plusplus)
+}
+#endif
+
+#endif /* LIBUNWIND_H */
diff --git a/external/android-libunwind/include/libunwind-mips.h b/external/android-libunwind/include/libunwind-mips.h
new file mode 100644 (file)
index 0000000..83e44de
--- /dev/null
@@ -0,0 +1,163 @@
+/* libunwind - a platform-independent unwind library
+   Copyright (C) 2008 CodeSourcery
+
+This file is part of libunwind.
+
+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.  */
+
+#ifndef LIBUNWIND_H
+#define LIBUNWIND_H
+
+#if defined(__cplusplus) || defined(c_plusplus)
+extern "C" {
+#endif
+
+#include <inttypes.h>
+#include <ucontext.h>
+
+#ifdef mips
+# undef mips
+#endif
+
+#define UNW_TARGET     mips
+#define UNW_TARGET_MIPS        1
+
+#define _U_TDEP_QP_TRUE        0       /* see libunwind-dynamic.h  */
+
+/* This needs to be big enough to accommodate "struct cursor", while
+   leaving some slack for future expansion.  Changing this value will
+   require recompiling all users of this library.  Stack allocation is
+   relatively cheap and unwind-state copying is relatively rare, so we
+   want to err on making it rather too big than too small.  */
+   
+/* FIXME for MIPS. Too big?  What do other things use for similar tasks?  */
+#define UNW_TDEP_CURSOR_LEN    4096
+
+/* The size of a "word" varies on MIPS.  This type is used for memory
+   addresses and register values.  To allow a single library to support
+   multiple ABIs, and to support N32 at all, we must use a 64-bit type
+   even when addresses are only 32 bits.  */
+typedef uint64_t unw_word_t;
+typedef int32_t unw_sword_t;
+
+/* FIXME: MIPS ABIs.  */
+typedef long double unw_tdep_fpreg_t;
+
+typedef enum
+  {
+    UNW_MIPS_R0,
+    UNW_MIPS_R1,
+    UNW_MIPS_R2,
+    UNW_MIPS_R3,
+    UNW_MIPS_R4,
+    UNW_MIPS_R5,
+    UNW_MIPS_R6,
+    UNW_MIPS_R7,
+    UNW_MIPS_R8,
+    UNW_MIPS_R9,
+    UNW_MIPS_R10,
+    UNW_MIPS_R11,
+    UNW_MIPS_R12,
+    UNW_MIPS_R13,
+    UNW_MIPS_R14,
+    UNW_MIPS_R15,
+    UNW_MIPS_R16,
+    UNW_MIPS_R17,
+    UNW_MIPS_R18,
+    UNW_MIPS_R19,
+    UNW_MIPS_R20,
+    UNW_MIPS_R21,
+    UNW_MIPS_R22,
+    UNW_MIPS_R23,
+    UNW_MIPS_R24,
+    UNW_MIPS_R25,
+    UNW_MIPS_R26,
+    UNW_MIPS_R27,
+    UNW_MIPS_R28,
+    UNW_MIPS_R29,
+    UNW_MIPS_R30,
+    UNW_MIPS_R31,
+
+    UNW_MIPS_PC = 34,
+
+    /* FIXME: Other registers!  */
+
+    /* For MIPS, the CFA is the value of SP (r29) at the call site in the
+       previous frame.  */
+    UNW_MIPS_CFA,
+
+    UNW_TDEP_LAST_REG = UNW_MIPS_R31,
+
+    UNW_TDEP_IP = UNW_MIPS_R31,
+    UNW_TDEP_SP = UNW_MIPS_R29,
+    UNW_TDEP_EH = UNW_MIPS_R0   /* FIXME.  */
+  }
+mips_regnum_t;
+
+typedef enum
+  {
+    UNW_MIPS_ABI_O32,
+    UNW_MIPS_ABI_N32,
+    UNW_MIPS_ABI_N64
+  }
+mips_abi_t;
+
+#define UNW_TDEP_NUM_EH_REGS   2       /* FIXME for MIPS.  */
+
+typedef struct unw_tdep_save_loc
+  {
+    /* Additional target-dependent info on a save location.  */
+    /* ANDROID support update. */
+    char __reserved;
+    /* End of ANDROID update. */
+  }
+unw_tdep_save_loc_t;
+
+/* On x86, we can directly use ucontext_t as the unwind context.  FIXME for
+   MIPS.  */
+typedef ucontext_t unw_tdep_context_t;
+
+#include "libunwind-dynamic.h"
+
+typedef struct
+  {
+    /* no mips-specific auxiliary proc-info */
+    /* ANDROID support update. */
+    char __reserved;
+    /* End of ANDROID update. */
+  }
+unw_tdep_proc_info_t;
+
+#include "libunwind-common.h"
+
+/* There is no getcontext() on MIPS.  Use a stub version which only saves GP
+   registers.  FIXME: Not ideal, may not be sufficient for all libunwind
+   use cases.  */
+#define unw_tdep_getcontext UNW_ARCH_OBJ(getcontext)
+extern int unw_tdep_getcontext (ucontext_t *uc);
+
+#define unw_tdep_is_fpreg              UNW_ARCH_OBJ(is_fpreg)
+extern int unw_tdep_is_fpreg (int);
+
+#if defined(__cplusplus) || defined(c_plusplus)
+}
+#endif
+
+#endif /* LIBUNWIND_H */
diff --git a/external/android-libunwind/include/libunwind-ppc32.h b/external/android-libunwind/include/libunwind-ppc32.h
new file mode 100644 (file)
index 0000000..51852e8
--- /dev/null
@@ -0,0 +1,213 @@
+/* libunwind - a platform-independent unwind library
+   Copyright (C) 2006-2007 IBM
+   Contributed by
+     Corey Ashford <cjashfor@us.ibm.com>
+     Jose Flavio Aguilar Paulino <jflavio@br.ibm.com> <joseflavio@gmail.com>
+
+   Copied from libunwind-x86_64.h, modified slightly for building
+   frysk successfully on ppc64, by Wu Zhou <woodzltc@cn.ibm.com>
+   Will be replaced when libunwind is ready on ppc64 platform.
+
+This file is part of libunwind.
+
+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.  */
+
+#ifndef LIBUNWIND_H
+#define LIBUNWIND_H
+
+#if defined(__cplusplus) || defined(c_plusplus)
+extern "C" {
+#endif
+
+#include <inttypes.h>
+#include <ucontext.h>
+
+#define UNW_TARGET             ppc32
+#define UNW_TARGET_PPC32       1
+
+#define _U_TDEP_QP_TRUE        0       /* see libunwind-dynamic.h  */
+
+/*
+ * This needs to be big enough to accommodate "struct cursor", while
+ * leaving some slack for future expansion.  Changing this value will
+ * require recompiling all users of this library.  Stack allocation is
+ * relatively cheap and unwind-state copying is relatively rare, so we want
+ * to err on making it rather too big than too small.
+ *
+ * To simplify this whole process, we are at least initially taking the
+ * tack that UNW_PPC32_* map straight across to the .eh_frame column register
+ * numbers.  These register numbers come from gcc's source in
+ * gcc/config/rs6000/rs6000.h
+ *
+ * UNW_TDEP_CURSOR_LEN is in terms of unw_word_t size.  Since we have 115
+ * elements in the loc array, each sized 2 * unw_word_t, plus the rest of
+ * the cursor struct, this puts us at about 2 * 115 + 40 = 270.  Let's
+ * round that up to 280.
+ */
+
+#define UNW_TDEP_CURSOR_LEN 280
+
+#if __WORDSIZE==32
+typedef uint32_t unw_word_t;
+typedef int32_t unw_sword_t;
+#else
+typedef uint64_t unw_word_t;
+typedef int64_t unw_sword_t;
+#endif
+
+typedef long double unw_tdep_fpreg_t;
+
+typedef enum
+  {
+    UNW_PPC32_R0,
+    UNW_PPC32_R1, /* called STACK_POINTER in gcc */
+    UNW_PPC32_R2,
+    UNW_PPC32_R3,
+    UNW_PPC32_R4,
+    UNW_PPC32_R5,
+    UNW_PPC32_R6,
+    UNW_PPC32_R7,
+    UNW_PPC32_R8,
+    UNW_PPC32_R9,
+    UNW_PPC32_R10,
+    UNW_PPC32_R11, /* called STATIC_CHAIN in gcc */
+    UNW_PPC32_R12,
+    UNW_PPC32_R13,
+    UNW_PPC32_R14,
+    UNW_PPC32_R15,
+    UNW_PPC32_R16,
+    UNW_PPC32_R17,
+    UNW_PPC32_R18,
+    UNW_PPC32_R19,
+    UNW_PPC32_R20,
+    UNW_PPC32_R21,
+    UNW_PPC32_R22,
+    UNW_PPC32_R23,
+    UNW_PPC32_R24,
+    UNW_PPC32_R25,
+    UNW_PPC32_R26,
+    UNW_PPC32_R27,
+    UNW_PPC32_R28,
+    UNW_PPC32_R29,
+    UNW_PPC32_R30,
+    UNW_PPC32_R31, /* called HARD_FRAME_POINTER in gcc */
+
+    /* Count Register */
+    UNW_PPC32_CTR = 32,
+    /* Fixed-Point Status and Control Register */
+    UNW_PPC32_XER = 33,
+    /* Condition Register */
+    UNW_PPC32_CCR = 34,
+    /* Machine State Register */
+    //UNW_PPC32_MSR = 35,
+    /* MQ or SPR0, not part of generic Power, part of MPC601 */
+    //UNW_PPC32_MQ = 36,
+    /* Link Register */
+    UNW_PPC32_LR = 36,
+    /* Floating Pointer Status and Control Register */
+    UNW_PPC32_FPSCR = 37,
+
+    UNW_PPC32_F0 = 48,
+    UNW_PPC32_F1,
+    UNW_PPC32_F2,
+    UNW_PPC32_F3,
+    UNW_PPC32_F4,
+    UNW_PPC32_F5,
+    UNW_PPC32_F6,
+    UNW_PPC32_F7,
+    UNW_PPC32_F8,
+    UNW_PPC32_F9,
+    UNW_PPC32_F10,
+    UNW_PPC32_F11,
+    UNW_PPC32_F12,
+    UNW_PPC32_F13,
+    UNW_PPC32_F14,
+    UNW_PPC32_F15,
+    UNW_PPC32_F16,
+    UNW_PPC32_F17,
+    UNW_PPC32_F18,
+    UNW_PPC32_F19,
+    UNW_PPC32_F20,
+    UNW_PPC32_F21,
+    UNW_PPC32_F22,
+    UNW_PPC32_F23,
+    UNW_PPC32_F24,
+    UNW_PPC32_F25,
+    UNW_PPC32_F26,
+    UNW_PPC32_F27,
+    UNW_PPC32_F28,
+    UNW_PPC32_F29,
+    UNW_PPC32_F30,
+    UNW_PPC32_F31,
+
+    UNW_TDEP_LAST_REG = UNW_PPC32_F31,
+
+    UNW_TDEP_IP = UNW_PPC32_LR,
+    UNW_TDEP_SP = UNW_PPC32_R1,
+    UNW_TDEP_EH = UNW_PPC32_R12
+  }
+ppc32_regnum_t;
+
+/*
+ * According to David Edelsohn, GNU gcc uses R3, R4, R5, and maybe R6 for
+ * passing parameters to exception handlers.
+ */
+
+#define UNW_TDEP_NUM_EH_REGS   4
+
+typedef struct unw_tdep_save_loc
+  {
+    /* Additional target-dependent info on a save location.  */
+    /* ANDROID support update. */
+    char __reserved;
+    /* End of ANDROID update. */
+  }
+unw_tdep_save_loc_t;
+
+/* On ppc, we can directly use ucontext_t as the unwind context.  */
+typedef ucontext_t unw_tdep_context_t;
+
+/* XXX this is not ideal: an application should not be prevented from
+   using the "getcontext" name just because it's using libunwind.  We
+   can't just use __getcontext() either, because that isn't exported
+   by glibc...  */
+#define unw_tdep_getcontext(uc)                (getcontext (uc), 0)
+
+#include "libunwind-dynamic.h"
+
+typedef struct
+  {
+    /* no ppc32-specific auxiliary proc-info */
+    /* ANDROID support update. */
+    char __reserved;
+    /* End of ANDROID update. */
+  }
+unw_tdep_proc_info_t;
+
+#include "libunwind-common.h"
+
+#define unw_tdep_is_fpreg              UNW_ARCH_OBJ(is_fpreg)
+extern int unw_tdep_is_fpreg (int);
+
+#if defined(__cplusplus) || defined(c_plusplus)
+}
+#endif
+
+#endif /* LIBUNWIND_H */
diff --git a/external/android-libunwind/include/libunwind-ppc64.h b/external/android-libunwind/include/libunwind-ppc64.h
new file mode 100644 (file)
index 0000000..e0dbaaa
--- /dev/null
@@ -0,0 +1,270 @@
+/* libunwind - a platform-independent unwind library
+   Copyright (C) 2006-2007 IBM
+   Contributed by
+     Corey Ashford <cjashfor@us.ibm.com>
+     Jose Flavio Aguilar Paulino <jflavio@br.ibm.com> <joseflavio@gmail.com>
+
+   Copied from libunwind-x86_64.h, modified slightly for building
+   frysk successfully on ppc64, by Wu Zhou <woodzltc@cn.ibm.com>
+   Will be replaced when libunwind is ready on ppc64 platform.
+
+This file is part of libunwind.
+
+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.  */
+
+#ifndef LIBUNWIND_H
+#define LIBUNWIND_H
+
+#if defined(__cplusplus) || defined(c_plusplus)
+extern "C" {
+#endif
+
+#include <inttypes.h>
+#include <ucontext.h>
+
+#define UNW_TARGET             ppc64
+#define UNW_TARGET_PPC64       1
+
+#define _U_TDEP_QP_TRUE        0       /* see libunwind-dynamic.h  */
+
+/*
+ * This needs to be big enough to accommodate "struct cursor", while
+ * leaving some slack for future expansion.  Changing this value will
+ * require recompiling all users of this library.  Stack allocation is
+ * relatively cheap and unwind-state copying is relatively rare, so we want
+ * to err on making it rather too big than too small.
+ *
+ * To simplify this whole process, we are at least initially taking the
+ * tack that UNW_PPC64_* map straight across to the .eh_frame column register
+ * numbers.  These register numbers come from gcc's source in
+ * gcc/config/rs6000/rs6000.h
+ *
+ * UNW_TDEP_CURSOR_LEN is in terms of unw_word_t size.  Since we have 115
+ * elements in the loc array, each sized 2 * unw_word_t, plus the rest of
+ * the cursor struct, this puts us at about 2 * 115 + 40 = 270.  Let's
+ * round that up to 280.
+ */
+
+#define UNW_TDEP_CURSOR_LEN 280
+
+#if __WORDSIZE==32
+typedef uint32_t unw_word_t;
+typedef int32_t unw_sword_t;
+#else
+typedef uint64_t unw_word_t;
+typedef int64_t unw_sword_t;
+#endif
+
+typedef long double unw_tdep_fpreg_t;
+
+/*
+ * Vector register (in PowerPC64 used for AltiVec registers)
+ */
+typedef struct {
+    uint64_t halves[2];
+} unw_tdep_vreg_t;
+
+typedef enum
+  {
+    UNW_PPC64_R0,
+    UNW_PPC64_R1, /* called STACK_POINTER in gcc */
+    UNW_PPC64_R2,
+    UNW_PPC64_R3,
+    UNW_PPC64_R4,
+    UNW_PPC64_R5,
+    UNW_PPC64_R6,
+    UNW_PPC64_R7,
+    UNW_PPC64_R8,
+    UNW_PPC64_R9,
+    UNW_PPC64_R10,
+    UNW_PPC64_R11, /* called STATIC_CHAIN in gcc */
+    UNW_PPC64_R12,
+    UNW_PPC64_R13,
+    UNW_PPC64_R14,
+    UNW_PPC64_R15,
+    UNW_PPC64_R16,
+    UNW_PPC64_R17,
+    UNW_PPC64_R18,
+    UNW_PPC64_R19,
+    UNW_PPC64_R20,
+    UNW_PPC64_R21,
+    UNW_PPC64_R22,
+    UNW_PPC64_R23,
+    UNW_PPC64_R24,
+    UNW_PPC64_R25,
+    UNW_PPC64_R26,
+    UNW_PPC64_R27,
+    UNW_PPC64_R28,
+    UNW_PPC64_R29,
+    UNW_PPC64_R30,
+    UNW_PPC64_R31, /* called HARD_FRAME_POINTER in gcc */
+
+    UNW_PPC64_F0 = 32,
+    UNW_PPC64_F1,
+    UNW_PPC64_F2,
+    UNW_PPC64_F3,
+    UNW_PPC64_F4,
+    UNW_PPC64_F5,
+    UNW_PPC64_F6,
+    UNW_PPC64_F7,
+    UNW_PPC64_F8,
+    UNW_PPC64_F9,
+    UNW_PPC64_F10,
+    UNW_PPC64_F11,
+    UNW_PPC64_F12,
+    UNW_PPC64_F13,
+    UNW_PPC64_F14,
+    UNW_PPC64_F15,
+    UNW_PPC64_F16,
+    UNW_PPC64_F17,
+    UNW_PPC64_F18,
+    UNW_PPC64_F19,
+    UNW_PPC64_F20,
+    UNW_PPC64_F21,
+    UNW_PPC64_F22,
+    UNW_PPC64_F23,
+    UNW_PPC64_F24,
+    UNW_PPC64_F25,
+    UNW_PPC64_F26,
+    UNW_PPC64_F27,
+    UNW_PPC64_F28,
+    UNW_PPC64_F29,
+    UNW_PPC64_F30,
+    UNW_PPC64_F31,
+    /* Note that there doesn't appear to be an .eh_frame register column
+       for the FPSCR register.  I don't know why this is.  Since .eh_frame
+       info is what this implementation uses for unwinding, we have no way
+       to unwind this register, and so we will not expose an FPSCR register
+       number in the libunwind API.
+     */
+
+    UNW_PPC64_LR = 65,
+    UNW_PPC64_CTR = 66,
+    UNW_PPC64_ARG_POINTER = 67,
+
+    UNW_PPC64_CR0 = 68,
+    UNW_PPC64_CR1,
+    UNW_PPC64_CR2,
+    UNW_PPC64_CR3,
+    UNW_PPC64_CR4,
+    /* CR5 .. CR7 are currently unused */
+    UNW_PPC64_CR5,
+    UNW_PPC64_CR6,
+    UNW_PPC64_CR7,
+
+    UNW_PPC64_XER = 76,
+
+    UNW_PPC64_V0 = 77,
+    UNW_PPC64_V1,
+    UNW_PPC64_V2,
+    UNW_PPC64_V3,
+    UNW_PPC64_V4,
+    UNW_PPC64_V5,
+    UNW_PPC64_V6,
+    UNW_PPC64_V7,
+    UNW_PPC64_V8,
+    UNW_PPC64_V9,
+    UNW_PPC64_V10,
+    UNW_PPC64_V11,
+    UNW_PPC64_V12,
+    UNW_PPC64_V13,
+    UNW_PPC64_V14,
+    UNW_PPC64_V15,
+    UNW_PPC64_V16,
+    UNW_PPC64_V17,
+    UNW_PPC64_V18,
+    UNW_PPC64_V19,
+    UNW_PPC64_V20,
+    UNW_PPC64_V21,
+    UNW_PPC64_V22,
+    UNW_PPC64_V23,
+    UNW_PPC64_V24,
+    UNW_PPC64_V25,
+    UNW_PPC64_V26,
+    UNW_PPC64_V27,
+    UNW_PPC64_V28,
+    UNW_PPC64_V29,
+    UNW_PPC64_V30,
+    UNW_PPC64_V31,
+
+    UNW_PPC64_VRSAVE = 109,
+    UNW_PPC64_VSCR = 110,
+    UNW_PPC64_SPE_ACC = 111,
+    UNW_PPC64_SPEFSCR = 112,
+
+    /* frame info (read-only) */
+    UNW_PPC64_FRAME_POINTER,
+    UNW_PPC64_NIP,
+
+
+    UNW_TDEP_LAST_REG = UNW_PPC64_NIP,
+
+    UNW_TDEP_IP = UNW_PPC64_NIP,
+    UNW_TDEP_SP = UNW_PPC64_R1,
+    UNW_TDEP_EH = UNW_PPC64_R12
+  }
+ppc64_regnum_t;
+
+/*
+ * According to David Edelsohn, GNU gcc uses R3, R4, R5, and maybe R6 for
+ * passing parameters to exception handlers.
+ */
+
+#define UNW_TDEP_NUM_EH_REGS   4
+
+typedef struct unw_tdep_save_loc
+  {
+    /* Additional target-dependent info on a save location.  */
+    /* ANDROID support update. */
+    char __reserved;
+    /* End of ANDROID update. */
+  }
+unw_tdep_save_loc_t;
+
+/* On ppc64, we can directly use ucontext_t as the unwind context.  */
+typedef ucontext_t unw_tdep_context_t;
+
+/* XXX this is not ideal: an application should not be prevented from
+   using the "getcontext" name just because it's using libunwind.  We
+   can't just use __getcontext() either, because that isn't exported
+   by glibc...  */
+#define unw_tdep_getcontext(uc)                (getcontext (uc), 0)
+
+#include "libunwind-dynamic.h"
+
+typedef struct
+  {
+    /* no ppc64-specific auxiliary proc-info */
+    /* ANDROID support update. */
+    char __reserved;
+    /* End of ANDROID update. */
+  }
+unw_tdep_proc_info_t;
+
+#include "libunwind-common.h"
+
+#define unw_tdep_is_fpreg              UNW_ARCH_OBJ(is_fpreg)
+extern int unw_tdep_is_fpreg (int);
+
+#if defined(__cplusplus) || defined(c_plusplus)
+}
+#endif
+
+#endif /* LIBUNWIND_H */
diff --git a/external/android-libunwind/include/libunwind-ptrace.h b/external/android-libunwind/include/libunwind-ptrace.h
new file mode 100644 (file)
index 0000000..7fca205
--- /dev/null
@@ -0,0 +1,63 @@
+/* libunwind - a platform-independent unwind library
+   Copyright (C) 2004 Hewlett-Packard Co
+       Contributed by David Mosberger-Tang <davidm@hpl.hp.com>
+
+This file is part of libunwind.
+
+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.  */
+
+#ifndef libunwind_ptrace_h
+#define libunwind_ptrace_h
+
+#include <libunwind.h>
+
+#if defined(__cplusplus) || defined(c_plusplus)
+extern "C" {
+#endif
+
+/* Helper routines which make it easy to use libunwind via ptrace().
+   They're available only if UNW_REMOTE_ONLY is _not_ defined and they
+   aren't really part of the libunwind API.  They are implemented in a
+   archive library called libunwind-ptrace.a.  */
+
+extern void *_UPT_create (pid_t);
+extern void _UPT_destroy (void *);
+extern int _UPT_find_proc_info (unw_addr_space_t, unw_word_t,
+                               unw_proc_info_t *, int, void *);
+extern void _UPT_put_unwind_info (unw_addr_space_t, unw_proc_info_t *, void *);
+extern int _UPT_get_dyn_info_list_addr (unw_addr_space_t, unw_word_t *,
+                                       void *);
+extern int _UPT_access_mem (unw_addr_space_t, unw_word_t, unw_word_t *, int,
+                           void *);
+extern int _UPT_access_reg (unw_addr_space_t, unw_regnum_t, unw_word_t *,
+                           int, void *);
+extern int _UPT_access_fpreg (unw_addr_space_t, unw_regnum_t, unw_fpreg_t *,
+                             int, void *);
+extern int _UPT_get_proc_name (unw_addr_space_t, unw_word_t, char *, size_t,
+                              unw_word_t *, void *);
+extern int _UPT_resume (unw_addr_space_t, unw_cursor_t *, void *);
+extern unw_accessors_t _UPT_accessors;
+
+
+#if defined(__cplusplus) || defined(c_plusplus)
+}
+#endif
+
+#endif /* libunwind_ptrace_h */
diff --git a/external/android-libunwind/include/libunwind-sh.h b/external/android-libunwind/include/libunwind-sh.h
new file mode 100644 (file)
index 0000000..8f36a25
--- /dev/null
@@ -0,0 +1,120 @@
+/* libunwind - a platform-independent unwind library
+   Copyright (C) 2008 CodeSourcery
+   Copyright (C) 2012 Tommi Rantala <tt.rantala@gmail.com>
+
+This file is part of libunwind.
+
+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.  */
+
+#ifndef LIBUNWIND_H
+#define LIBUNWIND_H
+
+#if defined(__cplusplus) || defined(c_plusplus)
+extern "C" {
+#endif
+
+#include <inttypes.h>
+#include <stddef.h>
+#include <ucontext.h>
+
+#define UNW_TARGET     sh
+#define UNW_TARGET_SH  1
+
+#define _U_TDEP_QP_TRUE        0       /* see libunwind-dynamic.h  */
+
+/* This needs to be big enough to accommodate "struct cursor", while
+   leaving some slack for future expansion.  Changing this value will
+   require recompiling all users of this library.  Stack allocation is
+   relatively cheap and unwind-state copying is relatively rare, so we
+   want to err on making it rather too big than too small.  */
+
+#define UNW_TDEP_CURSOR_LEN    4096
+
+typedef uint32_t unw_word_t;
+typedef int32_t unw_sword_t;
+
+typedef long double unw_tdep_fpreg_t;
+
+typedef enum
+  {
+    UNW_SH_R0,
+    UNW_SH_R1,
+    UNW_SH_R2,
+    UNW_SH_R3,
+    UNW_SH_R4,
+    UNW_SH_R5,
+    UNW_SH_R6,
+    UNW_SH_R7,
+    UNW_SH_R8,
+    UNW_SH_R9,
+    UNW_SH_R10,
+    UNW_SH_R11,
+    UNW_SH_R12,
+    UNW_SH_R13,
+    UNW_SH_R14,
+    UNW_SH_R15,
+
+    UNW_SH_PC,
+    UNW_SH_PR,
+
+    UNW_TDEP_LAST_REG = UNW_SH_PR,
+
+    UNW_TDEP_IP = UNW_SH_PR,
+    UNW_TDEP_SP = UNW_SH_R15,
+    UNW_TDEP_EH = UNW_SH_R0
+  }
+sh_regnum_t;
+
+#define UNW_TDEP_NUM_EH_REGS   2
+
+typedef ucontext_t unw_tdep_context_t;
+
+#define unw_tdep_getcontext(uc)                (getcontext (uc), 0)
+
+typedef struct unw_tdep_save_loc
+  {
+    /* Additional target-dependent info on a save location.  */
+    /* ANDROID support update. */
+    char __reserved;
+    /* End of ANDROID update. */
+  }
+unw_tdep_save_loc_t;
+
+#include "libunwind-dynamic.h"
+
+typedef struct
+  {
+    /* no sh-specific auxiliary proc-info */
+    /* ANDROID support update. */
+    char __reserved;
+    /* End of ANDROID update. */
+  }
+unw_tdep_proc_info_t;
+
+#include "libunwind-common.h"
+
+#define unw_tdep_is_fpreg              UNW_ARCH_OBJ(is_fpreg)
+extern int unw_tdep_is_fpreg (int);
+
+#if defined(__cplusplus) || defined(c_plusplus)
+}
+#endif
+
+#endif /* LIBUNWIND_H */
diff --git a/external/android-libunwind/include/libunwind-x86.h b/external/android-libunwind/include/libunwind-x86.h
new file mode 100644 (file)
index 0000000..e46632d
--- /dev/null
@@ -0,0 +1,193 @@
+/* libunwind - a platform-independent unwind library
+   Copyright (C) 2002-2004 Hewlett-Packard Co
+       Contributed by David Mosberger-Tang <davidm@hpl.hp.com>
+
+This file is part of libunwind.
+
+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.  */
+
+#ifndef LIBUNWIND_H
+#define LIBUNWIND_H
+
+#if defined(__cplusplus) || defined(c_plusplus)
+extern "C" {
+#endif
+
+#include <sys/types.h>
+#include <inttypes.h>
+#include <ucontext.h>
+
+#define UNW_TARGET     x86
+#define UNW_TARGET_X86 1
+
+#define _U_TDEP_QP_TRUE        0       /* see libunwind-dynamic.h  */
+
+/* This needs to be big enough to accommodate "struct cursor", while
+   leaving some slack for future expansion.  Changing this value will
+   require recompiling all users of this library.  Stack allocation is
+   relatively cheap and unwind-state copying is relatively rare, so we
+   want to err on making it rather too big than too small.  */
+#define UNW_TDEP_CURSOR_LEN    127
+
+typedef uint32_t unw_word_t;
+typedef int32_t unw_sword_t;
+
+typedef union {
+  struct { uint8_t b[4]; } val32;
+  struct { uint8_t b[10]; } val80;
+  struct { uint8_t b[16]; } val128;
+} unw_tdep_fpreg_t;
+
+typedef enum
+  {
+    /* Note: general registers are expected to start with index 0.
+       This convention facilitates architecture-independent
+       implementation of the C++ exception handling ABI.  See
+       _Unwind_SetGR() and _Unwind_GetGR() for details.
+
+       The described register usage convention is based on "System V
+       Application Binary Interface, Intel386 Architecture Processor
+       Supplement, Fourth Edition" at
+
+         http://www.linuxbase.org/spec/refspecs/elf/abi386-4.pdf
+
+       It would have been nice to use the same register numbering as
+       DWARF, but that doesn't work because the libunwind requires
+       that the exception argument registers be consecutive, which the
+       wouldn't be with the DWARF numbering.  */
+    UNW_X86_EAX,       /* scratch (exception argument 1) */
+    UNW_X86_EDX,       /* scratch (exception argument 2) */
+    UNW_X86_ECX,       /* scratch */
+    UNW_X86_EBX,       /* preserved */
+    UNW_X86_ESI,       /* preserved */
+    UNW_X86_EDI,       /* preserved */
+    UNW_X86_EBP,       /* (optional) frame-register */
+    UNW_X86_ESP,       /* (optional) frame-register */
+    UNW_X86_EIP,       /* frame-register */
+    UNW_X86_EFLAGS,    /* scratch (except for "direction", which is fixed */
+    UNW_X86_TRAPNO,    /* scratch */
+
+    /* MMX/stacked-fp registers */
+    UNW_X86_ST0,       /* fp return value */
+    UNW_X86_ST1,       /* scratch */
+    UNW_X86_ST2,       /* scratch */
+    UNW_X86_ST3,       /* scratch */
+    UNW_X86_ST4,       /* scratch */
+    UNW_X86_ST5,       /* scratch */
+    UNW_X86_ST6,       /* scratch */
+    UNW_X86_ST7,       /* scratch */
+
+    UNW_X86_FCW,       /* scratch */
+    UNW_X86_FSW,       /* scratch */
+    UNW_X86_FTW,       /* scratch */
+    UNW_X86_FOP,       /* scratch */
+    UNW_X86_FCS,       /* scratch */
+    UNW_X86_FIP,       /* scratch */
+    UNW_X86_FEA,       /* scratch */
+    UNW_X86_FDS,       /* scratch */
+
+    /* SSE registers */
+    UNW_X86_XMM0_lo,   /* scratch */
+    UNW_X86_XMM0_hi,   /* scratch */
+    UNW_X86_XMM1_lo,   /* scratch */
+    UNW_X86_XMM1_hi,   /* scratch */
+    UNW_X86_XMM2_lo,   /* scratch */
+    UNW_X86_XMM2_hi,   /* scratch */
+    UNW_X86_XMM3_lo,   /* scratch */
+    UNW_X86_XMM3_hi,   /* scratch */
+    UNW_X86_XMM4_lo,   /* scratch */
+    UNW_X86_XMM4_hi,   /* scratch */
+    UNW_X86_XMM5_lo,   /* scratch */
+    UNW_X86_XMM5_hi,   /* scratch */
+    UNW_X86_XMM6_lo,   /* scratch */
+    UNW_X86_XMM6_hi,   /* scratch */
+    UNW_X86_XMM7_lo,   /* scratch */
+    UNW_X86_XMM7_hi,   /* scratch */
+
+    UNW_X86_MXCSR,     /* scratch */
+
+    /* segment registers */
+    UNW_X86_GS,                /* special */
+    UNW_X86_FS,                /* special */
+    UNW_X86_ES,                /* special */
+    UNW_X86_DS,                /* special */
+    UNW_X86_SS,                /* special */
+    UNW_X86_CS,                /* special */
+    UNW_X86_TSS,       /* special */
+    UNW_X86_LDT,       /* special */
+
+    /* frame info (read-only) */
+    UNW_X86_CFA,
+
+    UNW_X86_XMM0,      /* scratch */
+    UNW_X86_XMM1,      /* scratch */
+    UNW_X86_XMM2,      /* scratch */
+    UNW_X86_XMM3,      /* scratch */
+    UNW_X86_XMM4,      /* scratch */
+    UNW_X86_XMM5,      /* scratch */
+    UNW_X86_XMM6,      /* scratch */
+    UNW_X86_XMM7,      /* scratch */
+
+    UNW_TDEP_LAST_REG = UNW_X86_XMM7,
+
+    UNW_TDEP_IP = UNW_X86_EIP,
+    UNW_TDEP_SP = UNW_X86_ESP,
+    UNW_TDEP_EH = UNW_X86_EAX
+  }
+x86_regnum_t;
+
+#define UNW_TDEP_NUM_EH_REGS   2       /* eax and edx are exception args */
+
+typedef struct unw_tdep_save_loc
+  {
+    /* Additional target-dependent info on a save location.  */
+    /* ANDROID support update. */
+    char __reserved;
+    /* End of ANDROID update. */
+  }
+unw_tdep_save_loc_t;
+
+/* On x86, we can directly use ucontext_t as the unwind context.  */
+typedef ucontext_t unw_tdep_context_t;
+
+#include "libunwind-dynamic.h"
+
+typedef struct
+  {
+    /* no x86-specific auxiliary proc-info */
+    /* ANDROID support update. */
+    char __reserved;
+    /* End of ANDROID update. */
+  }
+unw_tdep_proc_info_t;
+
+#include "libunwind-common.h"
+
+#define unw_tdep_getcontext            UNW_ARCH_OBJ(getcontext)
+extern int unw_tdep_getcontext (unw_tdep_context_t *);
+
+#define unw_tdep_is_fpreg              UNW_ARCH_OBJ(is_fpreg)
+extern int unw_tdep_is_fpreg (int);
+
+#if defined(__cplusplus) || defined(c_plusplus)
+}
+#endif
+
+#endif /* LIBUNWIND_H */
diff --git a/external/android-libunwind/include/libunwind-x86_64.h b/external/android-libunwind/include/libunwind-x86_64.h
new file mode 100644 (file)
index 0000000..ed8cb11
--- /dev/null
@@ -0,0 +1,145 @@
+/* libunwind - a platform-independent unwind library
+   Copyright (C) 2002-2004 Hewlett-Packard Co
+       Contributed by David Mosberger-Tang <davidm@hpl.hp.com>
+
+   Modified for x86_64 by Max Asbock <masbock@us.ibm.com>
+
+This file is part of libunwind.
+
+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.  */
+
+#ifndef LIBUNWIND_H
+#define LIBUNWIND_H
+
+#if defined(__cplusplus) || defined(c_plusplus)
+extern "C" {
+#endif
+
+#include <sys/types.h>
+#include <inttypes.h>
+#include <ucontext.h>
+
+#define UNW_TARGET             x86_64
+#define UNW_TARGET_X86_64      1
+
+#define _U_TDEP_QP_TRUE        0       /* see libunwind-dynamic.h  */
+
+/* This needs to be big enough to accommodate "struct cursor", while
+   leaving some slack for future expansion.  Changing this value will
+   require recompiling all users of this library.  Stack allocation is
+   relatively cheap and unwind-state copying is relatively rare, so we
+   want to err on making it rather too big than too small.  */
+#define UNW_TDEP_CURSOR_LEN    127
+
+typedef uint64_t unw_word_t;
+typedef int64_t unw_sword_t;
+
+typedef long double unw_tdep_fpreg_t;
+
+typedef enum
+  {
+    UNW_X86_64_RAX,
+    UNW_X86_64_RDX,
+    UNW_X86_64_RCX,
+    UNW_X86_64_RBX,
+    UNW_X86_64_RSI,
+    UNW_X86_64_RDI,
+    UNW_X86_64_RBP,
+    UNW_X86_64_RSP,
+    UNW_X86_64_R8,
+    UNW_X86_64_R9,
+    UNW_X86_64_R10,
+    UNW_X86_64_R11,
+    UNW_X86_64_R12,
+    UNW_X86_64_R13,
+    UNW_X86_64_R14,
+    UNW_X86_64_R15,
+    UNW_X86_64_RIP,
+#ifdef CONFIG_MSABI_SUPPORT
+    UNW_X86_64_XMM0,
+    UNW_X86_64_XMM1,
+    UNW_X86_64_XMM2,
+    UNW_X86_64_XMM3,
+    UNW_X86_64_XMM4,
+    UNW_X86_64_XMM5,
+    UNW_X86_64_XMM6,
+    UNW_X86_64_XMM7,
+    UNW_X86_64_XMM8,
+    UNW_X86_64_XMM9,
+    UNW_X86_64_XMM10,
+    UNW_X86_64_XMM11,
+    UNW_X86_64_XMM12,
+    UNW_X86_64_XMM13,
+    UNW_X86_64_XMM14,
+    UNW_X86_64_XMM15,
+    UNW_TDEP_LAST_REG = UNW_X86_64_XMM15,
+#else
+    UNW_TDEP_LAST_REG = UNW_X86_64_RIP,
+#endif
+
+    /* XXX Add other regs here */
+
+    /* frame info (read-only) */
+    UNW_X86_64_CFA,
+
+    UNW_TDEP_IP = UNW_X86_64_RIP,
+    UNW_TDEP_SP = UNW_X86_64_RSP,
+    UNW_TDEP_BP = UNW_X86_64_RBP,
+    UNW_TDEP_EH = UNW_X86_64_RAX
+  }
+x86_64_regnum_t;
+
+#define UNW_TDEP_NUM_EH_REGS   2       /* XXX Not sure what this means */
+
+typedef struct unw_tdep_save_loc
+  {
+    /* Additional target-dependent info on a save location.  */
+    /* ANDROID support update. */
+    char __reserved;
+    /* End of ANDROID update. */
+  }
+unw_tdep_save_loc_t;
+
+/* On x86_64, we can directly use ucontext_t as the unwind context.  */
+typedef ucontext_t unw_tdep_context_t;
+
+typedef struct
+  {
+    /* no x86-64-specific auxiliary proc-info */
+    /* ANDROID support update. */
+    char __reserved;
+    /* End of ANDROID update. */
+  }
+unw_tdep_proc_info_t;
+
+#include "libunwind-dynamic.h"
+#include "libunwind-common.h"
+
+#define unw_tdep_getcontext            UNW_ARCH_OBJ(getcontext)
+#define unw_tdep_is_fpreg              UNW_ARCH_OBJ(is_fpreg)
+
+extern int unw_tdep_getcontext (unw_tdep_context_t *);
+extern int unw_tdep_is_fpreg (int);
+
+#if defined(__cplusplus) || defined(c_plusplus)
+}
+#endif
+
+#endif /* LIBUNWIND_H */
diff --git a/external/android-libunwind/include/libunwind.h b/external/android-libunwind/include/libunwind.h
new file mode 100644 (file)
index 0000000..0fafda6
--- /dev/null
@@ -0,0 +1,34 @@
+/* Provide a real file - not a symlink - as it would cause multiarch conflicts
+   when multiple different arch releases are installed simultaneously.  */
+
+#ifndef UNW_REMOTE_ONLY
+
+#if defined __aarch64__
+#include "libunwind-aarch64.h"
+#elif defined __arm__
+# include "libunwind-arm.h"
+#elif defined __hppa__
+# include "libunwind-hppa.h"
+#elif defined __ia64__
+# include "libunwind-ia64.h"
+#elif defined __mips__
+# include "libunwind-mips.h"
+#elif defined __powerpc__ && !defined __powerpc64__
+# include "libunwind-ppc32.h"
+#elif defined __powerpc64__
+# include "libunwind-ppc64.h"
+#elif defined __sh__
+# include "libunwind-sh.h"
+#elif defined __i386__
+# include "libunwind-x86.h"
+#elif defined __x86_64__
+# include "libunwind-x86_64.h"
+#else
+# error "Unsupported arch"
+#endif
+
+#else /* UNW_REMOTE_ONLY */
+
+# include "libunwind-arm.h"
+
+#endif /* UNW_REMOTE_ONLY */
diff --git a/external/android-libunwind/include/unwind.h b/external/android-libunwind/include/unwind.h
new file mode 100644 (file)
index 0000000..f8d43d0
--- /dev/null
@@ -0,0 +1,154 @@
+/* libunwind - a platform-independent unwind library
+   Copyright (C) 2003 Hewlett-Packard Co
+       Contributed by David Mosberger-Tang <davidm@hpl.hp.com>
+
+This file is part of libunwind.
+
+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.  */
+
+#ifndef _UNWIND_H
+#define _UNWIND_H
+
+/* For uint64_t */
+#include <stdint.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* Minimal interface as per C++ ABI draft standard:
+
+       http://www.codesourcery.com/cxx-abi/abi-eh.html */
+
+typedef enum
+  {
+    _URC_NO_REASON = 0,
+    _URC_FOREIGN_EXCEPTION_CAUGHT = 1,
+    _URC_FATAL_PHASE2_ERROR = 2,
+    _URC_FATAL_PHASE1_ERROR = 3,
+    _URC_NORMAL_STOP = 4,
+    _URC_END_OF_STACK = 5,
+    _URC_HANDLER_FOUND = 6,
+    _URC_INSTALL_CONTEXT = 7,
+    _URC_CONTINUE_UNWIND = 8
+  }
+_Unwind_Reason_Code;
+
+typedef int _Unwind_Action;
+
+#define _UA_SEARCH_PHASE       1
+#define _UA_CLEANUP_PHASE      2
+#define _UA_HANDLER_FRAME      4
+#define _UA_FORCE_UNWIND       8
+
+struct _Unwind_Context;                /* opaque data-structure */
+struct _Unwind_Exception;      /* forward-declaration */
+
+typedef void (*_Unwind_Exception_Cleanup_Fn) (_Unwind_Reason_Code,
+                                             struct _Unwind_Exception *);
+
+typedef _Unwind_Reason_Code (*_Unwind_Stop_Fn) (int, _Unwind_Action,
+                                               uint64_t,
+                                               struct _Unwind_Exception *,
+                                               struct _Unwind_Context *,
+                                               void *);
+
+/* The C++ ABI requires exception_class, private_1, and private_2 to
+   be of type uint64 and the entire structure to be
+   double-word-aligned. Please note that exception_class stays 64-bit 
+   even on 32-bit machines for gcc compatibility.  */
+struct _Unwind_Exception
+  {
+    uint64_t exception_class;
+    _Unwind_Exception_Cleanup_Fn exception_cleanup;
+    unsigned long private_1;
+    unsigned long private_2;
+  } __attribute__((__aligned__));
+
+extern _Unwind_Reason_Code _Unwind_RaiseException (struct _Unwind_Exception *);
+extern _Unwind_Reason_Code _Unwind_ForcedUnwind (struct _Unwind_Exception *,
+                                                _Unwind_Stop_Fn, void *);
+extern void _Unwind_Resume (struct _Unwind_Exception *);
+extern void _Unwind_DeleteException (struct _Unwind_Exception *);
+extern unsigned long _Unwind_GetGR (struct _Unwind_Context *, int);
+extern void _Unwind_SetGR (struct _Unwind_Context *, int, unsigned long);
+extern unsigned long _Unwind_GetIP (struct _Unwind_Context *);
+extern unsigned long _Unwind_GetIPInfo (struct _Unwind_Context *, int *);
+extern void _Unwind_SetIP (struct _Unwind_Context *, unsigned long);
+extern unsigned long _Unwind_GetLanguageSpecificData (struct _Unwind_Context*);
+extern unsigned long _Unwind_GetRegionStart (struct _Unwind_Context *);
+
+#ifdef _GNU_SOURCE
+
+/* Callback for _Unwind_Backtrace().  The backtrace stops immediately
+   if the callback returns any value other than _URC_NO_REASON. */
+typedef _Unwind_Reason_Code (*_Unwind_Trace_Fn) (struct _Unwind_Context *,
+                                                void *);
+
+/* See http://gcc.gnu.org/ml/gcc-patches/2001-09/msg00082.html for why
+   _UA_END_OF_STACK exists.  */
+# define _UA_END_OF_STACK      16
+
+/* If the unwind was initiated due to a forced unwind, resume that
+   operation, else re-raise the exception.  This is used by
+   __cxa_rethrow().  */
+extern _Unwind_Reason_Code
+         _Unwind_Resume_or_Rethrow (struct _Unwind_Exception *);
+
+/* See http://gcc.gnu.org/ml/gcc-patches/2003-09/msg00154.html for why
+   _Unwind_GetBSP() exists.  */
+extern unsigned long _Unwind_GetBSP (struct _Unwind_Context *);
+
+/* Return the "canonical frame address" for the given context.
+   This is used by NPTL... */
+extern unsigned long _Unwind_GetCFA (struct _Unwind_Context *);
+
+/* Return the base-address for data references.  */
+extern unsigned long _Unwind_GetDataRelBase (struct _Unwind_Context *);
+
+/* Return the base-address for text references.  */
+extern unsigned long _Unwind_GetTextRelBase (struct _Unwind_Context *);
+
+/* Call _Unwind_Trace_Fn once for each stack-frame, without doing any
+   cleanup.  The first frame for which the callback is invoked is the
+   one for the caller of _Unwind_Backtrace().  _Unwind_Backtrace()
+   returns _URC_END_OF_STACK when the backtrace stopped due to
+   reaching the end of the call-chain or _URC_FATAL_PHASE1_ERROR if it
+   stops for any other reason.  */
+extern _Unwind_Reason_Code _Unwind_Backtrace (_Unwind_Trace_Fn, void *);
+
+/* Find the start-address of the procedure containing the specified IP
+   or NULL if it cannot be found (e.g., because the function has no
+   unwind info).  Note: there is not necessarily a one-to-one
+   correspondence between source-level functions and procedures: some
+   functions don't have unwind-info and others are split into multiple
+   procedures.  */
+extern void *_Unwind_FindEnclosingFunction (void *);
+
+/* See also Linux Standard Base Spec:
+    http://www.linuxbase.org/spec/refspecs/LSB_1.3.0/gLSB/gLSB/libgcc-s.html */
+
+#endif /* _GNU_SOURCE */
+
+#ifdef __cplusplus
+};
+#endif
+
+#endif /* _UNWIND_H */
index 6c6e36218c4a0b6dfb85bd27fa6746467761e8a0..2f66da8d34b30473dac23f02b1a843d0717b9f1a 160000 (submodule)
@@ -1 +1 @@
-Subproject commit 6c6e36218c4a0b6dfb85bd27fa6746467761e8a0
+Subproject commit 2f66da8d34b30473dac23f02b1a843d0717b9f1a
index ac992abfaf99aa62491ecd302c5e8be34881c022..7f5aa03148da79519f638f1bd93b37cdaa45c539 100644 (file)
@@ -233,10 +233,8 @@ AM_CONDITIONAL(POWERPC_DARWIN,test x$powerpc_darwin = xtrue)
 AC_MSG_CHECKING(for __sync_bool_compare_and_swap)
 AC_TRY_COMPILE([],[
 volatile unsigned int foo = 0;
-int main(int argc, char** argv) {
-    unsigned int r1 = __sync_bool_compare_and_swap(&foo, 0, 1);
-    return 0;
-}
+unsigned int r1 = __sync_bool_compare_and_swap(&foo, 0, 1);
+return 0;
 ], [
 AC_MSG_RESULT(yes)
 AC_DEFINE(HAS___SYNC_BOOL_COMPARE_AND_SWAP)
index 7eb8055fb4f56fdda2452b660572569c7b195c32..4c0d27d949bc27da038b7323e00375fd509a35f4 100644 (file)
@@ -786,8 +786,7 @@ to Mono, like this:
 .PP
 In the above sample Mono will load the user defined profiler from the
 shared library `mono-profiler-custom.so'.  This profiler module must
-be on your dynamic linker library path, or in the MONO_PROFILER_LIB_DIR
-path (see "RUNTIME OPTIONS" below).
+be on your dynamic linker library path.
 .PP 
 A list of other third party profilers is available from Mono's web
 site (www.mono-project.com/docs/advanced/performance-tips/)
@@ -1509,30 +1508,6 @@ For a complete description of recommended practices for application
 deployment, see
 http://www.mono-project.com/docs/getting-started/application-deployment/
 .TP
-\fBMONO_PROFILER_LIB_DIR\fR
-Provides a search path to the runtime where to look for custom profilers. See the
-section "CUSTOM PROFILERS" above for more information. Custom profilers will be
-searched for in the MONO_PROFILER_LIB_DIR path before the standard library paths.
-
-.TP
-\fBMONO_RTC\fR
-Experimental RTC support in the statistical profiler: if the user has
-the permission, more accurate statistics are gathered.  The MONO_RTC
-value must be restricted to what the Linux rtc allows: power of two
-from 64 to 8192 Hz. To enable higher frequencies like 4096 Hz, run as root:
-.nf
-
-       echo 4096 > /proc/sys/dev/rtc/max-user-freq
-
-.fi
-.Sp
-For example:
-.nf
-
-       MONO_RTC=4096 mono --profiler=default:stat program.exe
-
-.fi
-.TP 
 \fBMONO_SHARED_DIR\fR
 If set its the directory where the ".wapi" handle state is stored.
 This is the directory where the Windows I/O Emulation layer stores its
index 1f4566b61c75f38eb221f66a923fb57de932d930..7dbfb638917892d2637276347599b56aa8b8cfba 100644 (file)
@@ -86,11 +86,9 @@ package := mcs-$(VERSION)
 DISTFILES = \
        AUTHORS                 \
        COPYING                 \
-       COPYING.LIB             \
        INSTALL.txt             \
        Makefile                \
        mkinstalldirs           \
-       MIT.X11                 \
        MonoIcon.png            \
        README                  \
        ScalableMonoIcon.svg    \
index 658faa991ce56d6801dce5537d582c4f64333bab..145665799ccaaccd74e1c7a9617f8f1d725da98b 100644 (file)
@@ -10,7 +10,7 @@
 CODEPAGE = 65001
 
 RUNTIME_FLAGS = 
-TEST_HARNESS = $(topdir)/class/lib/$(PROFILE)/nunit-console.exe
+TEST_HARNESS = $(topdir)/class/lib/$(PROFILE)/$(PARENT_PROFILE)nunit-console.exe
 MCS_FLAGS = 
 MBAS_FLAGS = $(PLATFORM_DEBUG_FLAGS)
 LIBRARY_FLAGS = /noconfig
index 7ac3b33846239297cc064116a273e3035c542d00..29ba89909e6d397d8d2012a09999717af7561526 100644 (file)
@@ -31,6 +31,9 @@ ifdef base_prog_config
 PROGRAM_config := $(build_libdir)$(PROGRAM).config
 endif
 
+sn = $(topdir)/class/lib/$(BUILD_TOOLS_PROFILE)/sn.exe
+SN = MONO_PATH="$(topdir)/class/lib/$(BUILD_TOOLS_PROFILE)$(PLATFORM_PATH_SEPARATOR)$$MONO_PATH" $(RUNTIME) $(RUNTIME_FLAGS) $(sn) -q
+
 the_lib = $(the_libdir)$(base_prog)
 build_lib = $(build_libdir)$(base_prog)
 
@@ -110,7 +113,10 @@ endif
 $(the_lib): $(the_libdir)/.stamp
 
 $(build_lib): $(BUILT_SOURCES) $(EXTRA_SOURCES) $(response) $(build_libdir:=/.stamp)
-       $(PROGRAM_COMPILE) -target:exe -out:$@ $(BUILT_SOURCES) $(EXTRA_SOURCES) @$(response)
+       $(PROGRAM_COMPILE) $(MCS_REFERENCES) -target:exe -out:$@ $(BUILT_SOURCES) $(EXTRA_SOURCES) @$(response)
+ifdef PROGRAM_SNK
+       $(Q) $(SN) -R $@ $(PROGRAM_SNK)
+endif
 
 ifdef PROGRAM_USE_INTERMEDIATE_FILE
 $(the_lib): $(build_lib)
@@ -143,6 +149,9 @@ endif
 
 -include $(makefrag)
 
+MCS_REFERENCES = $(patsubst %,-r:$(topdir)/class/lib/$(PROFILE)/%.dll,$(LIB_REFS))
+MCS_REFERENCES += $(patsubst %,-r:$(topdir)/class/lib/$(PROFILE)/%.exe,$(EXE_REFS))
+
 all-local: $(makefrag) $(extra_targets)
 
 csproj-local:
index 1df98aeea1f035eb5e187138f58761eaccab60be..b420a8364d7d4c67e04dc46f5714d58910226525 100644 (file)
 # Have to rename to handle differences between assembly/directory names
 DEP_LIBS=$(patsubst System.Xml,System.XML,$(LIB_REFS))
 
-LIB_MCS_FLAGS += $(patsubst %,-r:%.dll,$(LIB_REFS))
+_FILTER_OUT = $(foreach x,$(2),$(if $(findstring $(1),$(x)),,$(x)))
+
+LIB_REFS_FULL = $(call _FILTER_OUT,=, $(LIB_REFS))
+LIB_REFS_ALIAS = $(filter-out $(LIB_REFS_FULL),$(LIB_REFS))
+
+LIB_MCS_FLAGS += $(patsubst %,-r:$(topdir)/class/lib/$(PROFILE)/%.dll,$(LIB_REFS_FULL))
+LIB_MCS_FLAGS += $(patsubst %,-r:%.dll, $(subst =,=$(topdir)/class/lib/$(PROFILE)/,$(LIB_REFS_ALIAS)))
 
 sourcefile = $(LIBRARY).sources
 
@@ -253,6 +259,7 @@ dist-local: dist-default
        for f in `$(topdir)/tools/removecomments.sh $(wildcard *$(LIBRARY).sources)` $(TEST_FILES) ; do \
          case $$f in \
          ../*) : ;; \
+         *.g.cs) : ;; \
          *) dest=`dirname "$$f"` ; \
             case $$subs in *" $$dest "*) : ;; *) subs=" $$dest$$subs" ; $(MKINSTALLDIRS) $(distdir)/$$dest ;; esac ; \
             cp -p "$$f" $(distdir)/$$dest || exit 1 ;; \
index 5273928a0ed6143d4fff29ee27776f826f67a3f0..3b4c7e0706e4fb4862fc5eaf17fffb0d805e6c65 100644 (file)
@@ -12,8 +12,8 @@ MCS = MONO_PATH="$(topdir)/class/lib/$(BOOTSTRAP_PROFILE)$(PLATFORM_PATH_SEPARAT
 profile-check:
        @:
 
-DEFAULT_REFERENCES = -r:mscorlib.dll
-PROFILE_MCS_FLAGS = -d:NET_4_0 -d:NET_4_5 -d:MONO -d:DISABLE_CAS_USE -nowarn:1699 -nostdlib -lib:$(topdir)/class/lib/$(PROFILE) $(DEFAULT_REFERENCES)
+DEFAULT_REFERENCES = -r:$(topdir)/class/lib/$(PROFILE)/mscorlib.dll
+PROFILE_MCS_FLAGS = -d:NET_4_0 -d:NET_4_5 -d:MONO -d:DISABLE_CAS_USE -nowarn:1699 -nostdlib $(DEFAULT_REFERENCES)
 
 NO_SIGN_ASSEMBLY = yes
 NO_TEST = yes
index 6f6108c08aa7d89ab89dda7de1b0247e3449494c..70908afa4e194fa55f910c259b89c231f11eebfd 100644 (file)
@@ -11,7 +11,7 @@ RESGEN = resgen2
 profile-check:
        @:
 
-DEFAULT_REFERENCES = -r:mscorlib.dll
+DEFAULT_REFERENCES = -r:$(topdir)/class/lib/$(PROFILE)/mscorlib.dll
 
 PROFILE_MCS_FLAGS = \
        -d:NET_1_1 \
@@ -26,7 +26,6 @@ PROFILE_MCS_FLAGS = \
        -d:DISABLE_CAS_USE \
        -nowarn:1699 \
        -nostdlib \
-       -lib:$(topdir)/class/lib/$(PROFILE) \
        $(DEFAULT_REFERENCES) \
        $(PLATFORM_DEBUG_FLAGS)
 
index 0c3c8125cfdcda56f5d59100d2dacb825666386b..f13e65d83ccb7bdfadde12ab9a255ee7001898aa 100644 (file)
@@ -11,7 +11,7 @@ RESGEN = resgen2
 profile-check:
        @:
 
-DEFAULT_REFERENCES = -r:mscorlib.dll
+DEFAULT_REFERENCES = -r:$(topdir)/class/lib/$(PROFILE)/mscorlib.dll
 
 PROFILE_MCS_FLAGS = \
        -d:NET_1_1 \
@@ -28,7 +28,6 @@ PROFILE_MCS_FLAGS = \
        -d:DISABLE_COM \
        -nowarn:1699 \
        -nostdlib \
-       -lib:$(topdir)/class/lib/$(PROFILE) \
        $(DEFAULT_REFERENCES) \
        $(PLATFORM_DEBUG_FLAGS)
 
index 49f85dcf8ee26c7273e367ef1a94366295cb9f47..9ea27d6c9c7f866de0d850093cad9056a9301ab9 100644 (file)
@@ -11,7 +11,7 @@ RESGEN = resgen2
 profile-check:
        @:
 
-DEFAULT_REFERENCES = -r:mscorlib.dll
+DEFAULT_REFERENCES = -r:$(topdir)/class/lib/$(PROFILE)/mscorlib.dll
 
 PROFILE_MCS_FLAGS = \
        -d:NET_1_1 \
@@ -28,7 +28,6 @@ PROFILE_MCS_FLAGS = \
        -d:ANDROID \
        -nowarn:1699 \
        -nostdlib \
-       -lib:$(topdir)/class/lib/$(PROFILE) \
        $(DEFAULT_REFERENCES) \
        $(PLATFORM_DEBUG_FLAGS)
 
index 7e963cb73c0e257ef02707a6f868c3259f9bd882..f127fd7d19043fc3f7a79656697477b03a109cfa 100644 (file)
@@ -13,7 +13,7 @@ RESGEN := $(dir $(shell which $(EXTERNAL_MCS)))resgen2
 profile-check:
        @:
 
-DEFAULT_REFERENCES = -r:mscorlib.dll
+DEFAULT_REFERENCES = -r:$(topdir)/class/lib/$(PROFILE)/mscorlib.dll
 PROFILE_MCS_FLAGS = \
        -d:NET_1_1 \
        -d:NET_2_0 \
@@ -30,7 +30,6 @@ PROFILE_MCS_FLAGS = \
        -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK \
        -nowarn:1699 \
        -nostdlib \
-       -lib:$(topdir)/class/lib/$(PROFILE) \
        $(DEFAULT_REFERENCES) \
        $(PLATFORM_DEBUG_FLAGS)
 
index a634dac392874f47f2629511bd5195a631403a69..a93b03b7f6b4fffa902356cac8ca5e2728aa2400 100644 (file)
@@ -10,8 +10,8 @@ MCS = MONO_PATH="$(topdir)/class/lib/$(BOOTSTRAP_PROFILE)$(PLATFORM_PATH_SEPARAT
 profile-check:
        @:
 
-DEFAULT_REFERENCES = -r:mscorlib.dll
-PROFILE_MCS_FLAGS = -d:NET_4_0 -d:NET_4_5 -d:NET_4_6 -d:MONO -d:DISABLE_CAS_USE  -nowarn:1699 -nostdlib -lib:$(topdir)/class/lib/$(PROFILE) $(DEFAULT_REFERENCES) $(PLATFORM_DEBUG_FLAGS)
+DEFAULT_REFERENCES = -r:$(topdir)/class/lib/$(PROFILE)/mscorlib.dll
+PROFILE_MCS_FLAGS = -d:NET_4_0 -d:NET_4_5 -d:NET_4_6 -d:MONO -d:DISABLE_CAS_USE  -nowarn:1699 -nostdlib $(DEFAULT_REFERENCES) $(PLATFORM_DEBUG_FLAGS)
 
 FRAMEWORK_VERSION = 4.5
 XBUILD_VERSION = 4.0
index a9a6ef9ab25b2d2eb070270665be2120624311e5..d3cbdb5d972e886f246edaf9ffef7269086697e5 100644 (file)
@@ -9,7 +9,7 @@ RESGEN := $(dir $(shell which $(EXTERNAL_MCS)))resgen2
 profile-check:
        @:
 
-DEFAULT_REFERENCES = -r:mscorlib.dll
+DEFAULT_REFERENCES = -r:$(topdir)/class/lib/$(PROFILE)/mscorlib.dll
 
 PROFILE_MCS_FLAGS = \
        -d:NET_1_1 \
@@ -27,7 +27,6 @@ PROFILE_MCS_FLAGS = \
        -d:XAMARIN_MODERN \
        -nowarn:1699 \
        -nostdlib \
-       -lib:$(topdir)/class/lib/$(PROFILE) \
        $(DEFAULT_REFERENCES) \
        $(PLATFORM_DEBUG_FLAGS)
 
index 7150d2529e9085cf0967696a6d2cd8855916af8f..a0b681071ddb49c38d4c62d9ed349c669e4391d8 100644 (file)
@@ -2,6 +2,10 @@
 
 include $(topdir)/build/profiles/net_4_x.make
 
-PROFILE_MCS_FLAGS := $(PROFILE_MCS_FLAGS) -d:XBUILD_12 -d:MONO -d:DISABLE_CAS_USE  -lib:$(topdir)/class/lib/net_4_x
+PARENT_PROFILE = ../net_4_x/
+DEFAULT_REFERENCES = -r:$(topdir)/class/lib/net_4_x/mscorlib.dll
+PROFILE_MCS_FLAGS := $(PROFILE_MCS_FLAGS) -d:XBUILD_12
+
+RESGEN_EXE = $(topdir)/class/lib/net_4_x/resgen.exe
 
 XBUILD_VERSION = 12.0
index 4e35ffc2305ef7a8c198773b45bdfda9b53b012a..60809393a62f1c526c67bd61f29d471753926fa9 100644 (file)
@@ -1,7 +1,7 @@
 # -*- makefile -*-
 
-include $(topdir)/build/profiles/net_4_x.make
+include $(topdir)/build/profiles/xbuild_12.make
 
-PROFILE_MCS_FLAGS := $(PROFILE_MCS_FLAGS) -d:XBUILD_12 -d:XBUILD_14 -d:MONO -d:DISABLE_CAS_USE  -lib:$(topdir)/class/lib/net_4_x
+PROFILE_MCS_FLAGS := $(PROFILE_MCS_FLAGS) -d:XBUILD_14
 
 XBUILD_VERSION = 14.0
index 54c946a8730f775da8f7976bdcec8fba17a3edf3..5fda8826d12968f30542b58a29219ceff5d11208 100644 (file)
@@ -43,9 +43,10 @@ MKINSTALLDIRS = $(SHELL) $(topdir)/mkinstalldirs
 INTERNAL_MBAS = $(RUNTIME) $(RUNTIME_FLAGS) $(topdir)/mbas/mbas.exe
 INTERNAL_GMCS = $(RUNTIME) $(RUNTIME_FLAGS) $(topdir)/class/lib/$(BUILD_TOOLS_PROFILE)/mcs.exe
 INTERNAL_ILASM = $(RUNTIME) $(RUNTIME_FLAGS) $(topdir)/class/lib/$(PROFILE)/ilasm.exe
-corlib = mscorlib.dll
+INTERNAL_CSC = $(RUNTIME) $(RUNTIME_FLAGS) $(CSC_LOCATION)
 
-INTERNAL_RESGEN = $(RUNTIME) $(RUNTIME_FLAGS) $(topdir)/class/lib/$(PROFILE)/resgen.exe
+RESGEN_EXE = $(topdir)/class/lib/$(PROFILE)/resgen.exe
+INTERNAL_RESGEN = $(RUNTIME) $(RUNTIME_FLAGS) $(RESGEN_EXE)
 RESGEN = MONO_PATH="$(topdir)/class/lib/$(PROFILE)$(PLATFORM_PATH_SEPARATOR)$$MONO_PATH" $(INTERNAL_RESGEN)
 STRING_REPLACER = MONO_PATH="$(topdir)/class/lib/$(BUILD_TOOLS_PROFILE)$(PLATFORM_PATH_SEPARATOR)$$MONO_PATH" $(RUNTIME) $(RUNTIME_FLAGS) $(topdir)/class/lib/$(BUILD_TOOLS_PROFILE)/cil-stringreplacer.exe
 
index e8d52d00332ba0d9a181e513ee90c06fd297b6e0..7f27dd9fd511c66eca5e9044e336c75bc5157a27 100644 (file)
@@ -25,7 +25,9 @@ else
 test_nunit_lib = nunit.framework.dll nunit.core.dll nunit.util.dll nunit.mocks.dll
 endif
 
-test_nunit_dep = $(test_nunit_lib:%=$(topdir)/class/lib/$(PROFILE)/%)
+TEST_LIB_MCS_FLAGS = $(patsubst %,-r:$(topdir)/class/lib/$(PROFILE)/%.dll,$(TEST_LIB_REFS))
+
+test_nunit_dep = $(test_nunit_lib:%=$(topdir)/class/lib/$(PROFILE)/$(PARENT_PROFILE)%)
 test_nunit_ref = $(test_nunit_dep:%=-r:%)
 tests_CLEAN_FILES += TestResult*.xml
 
@@ -41,7 +43,7 @@ test_sourcefile_excludes = $(test_lib).excludes
 test_pdb = $(test_lib:.dll=.pdb)
 test_response = $(depsdir)/$(test_lib).response
 test_makefrag = $(depsdir)/$(test_lib).makefrag
-test_flags = -r:$(the_assembly) $(test_nunit_ref) $(TEST_MCS_FLAGS)
+test_flags = -r:$(the_assembly) $(test_nunit_ref) $(TEST_MCS_FLAGS) $(TEST_LIB_MCS_FLAGS)
 tests_CLEAN_FILES += $(ASSEMBLY:$(ASSEMBLY_EXT)=_test*.dll) $(ASSEMBLY:$(ASSEMBLY_EXT)=_test*.pdb) $(test_response) $(test_makefrag)
 
 ifndef HAVE_CS_TESTS
@@ -58,11 +60,15 @@ $(test_nunit_dep): $(topdir)/build/deps/nunit-$(PROFILE).stamp
 
 ifdef NUNIT_LITE
 $(topdir)/build/deps/nunit-$(PROFILE).stamp:
+ifndef PARENT_PROFILE
        cd ${topdir}/tools/nunit-lite && $(MAKE)
+endif
        echo "stamp" >$@
 else
 $(topdir)/build/deps/nunit-$(PROFILE).stamp:
+ifndef PARENT_PROFILE
        cd ${topdir}/nunit24 && $(MAKE)
+endif
        echo "stamp" >$@
 endif
 
index 907ce82bb5bbd804a374c994167c2474a3479ec8..8700935681bd7b9038775d2d58304eb83be90ec2 100644 (file)
@@ -3,7 +3,7 @@ SUBDIRS =
 include ../../build/rules.make
 
 LIBRARY = Accessibility.dll
-LIB_MCS_FLAGS = /r:$(corlib)
+LIB_MCS_FLAGS =
 NO_TEST = yes
 
 include ../../build/library.make
index 1bc0fd2f2773f1c6f2c6e9a93d5de3ffddff8845..d63e7af0565267712121ff183e65084bf9ef92b0 100644 (file)
@@ -8,7 +8,7 @@ OTHER_RES = $(RESOURCE_FILES)
 
 LIBRARY = Commons.Xml.Relaxng.dll
 LIB_REFS = System System.Xml
-LIB_MCS_FLAGS = /r:$(corlib) \
+LIB_MCS_FLAGS = \
        $(foreach r, $(OTHER_RES), /resource:$(r),$(notdir $(r)))
 TEST_MCS_FLAGS = $(LIB_MCS_FLAGS) -nowarn:0618 -nowarn:219 -nowarn:169
 EXTRA_DISTFILES = \
index 9c11dbac65c299d9b2f5ad86cbe5b77fa28b999d..74debbe57e66c8e91a2587a24e111aa2b826f924 100644 (file)
@@ -8,7 +8,7 @@ LIBRARY_COMPAT = yes
 LIBRARY_SNK = SharpZipLib.key
 
 LIB_REFS = System System.Xml
-LIB_MCS_FLAGS = -r:$(corlib)
+LIB_MCS_FLAGS =
 NO_TEST = yes
 EXTRA_DISTFILES = SharpZipLib.pub $(LIBRARY_SNK)
 
index 3afddcca8fa2e31a225144ff1f86066acfa865f2..54ff581cee0b50832f0065c1d6f68a8cfd840820 100644 (file)
@@ -4,7 +4,7 @@ include ../../build/rules.make
 
 LIBRARY = Cscompmgd.dll
 LIB_REFS = System
-LIB_MCS_FLAGS = /r:$(corlib)
+LIB_MCS_FLAGS =
 TEST_MCS_FLAGS = $(LIB_MCS_FLAGS) -nowarn:0618 -nowarn:219 -nowarn:169
 LIBRARY_NAME = cscompmgd.dll
 
index 0e432dc33b19daa4ce376521876b7c89027df2e0..366921c583ffa6a658be493402581d2ac40a06c7 100644 (file)
@@ -4,7 +4,7 @@ include ../../build/rules.make
 
 LIBRARY = CustomMarshalers.dll
 LIB_REFS = System
-LIB_MCS_FLAGS = /r:$(corlib)
+LIB_MCS_FLAGS =
 NO_TEST = yes
 
 include ../../build/library.make
index 12f045eebd8ec6253a500ab92c300e7c4c54f975..d984f22ecd51922003ddc2fb5dd3a7bf711c4f0d 100644 (file)
@@ -37,7 +37,9 @@ doc-update-local:
 doc-update-recursive:
        @echo "do not recurse the Facades folder"
 
-System System.Core System.ComponentModel.DataAnnotations System.Numerics System.Runtime.Serialization System.XML System.ComponentModel.Composition System.ServiceModel System.Xml.Linq:
+System System.Core System.ComponentModel.DataAnnotations System.Numerics System.Runtime.Serialization System.XML \
+System.ComponentModel.Composition System.ServiceModel System.Xml.Linq System.Data System.IO.Compression.FileSystem \
+System.ServiceProcess System.Security System.Net.Http.WebRequest System.Net.Http:
 
 all-local-aot:
 
index 4b0a8ce48f852315136014265fd5026e902eee2b..d1b93730000cfeb9d7a940589a9551dd045769e6 100644 (file)
@@ -12,7 +12,7 @@ LIBRARY = Microsoft.Win32.Primitives.dll
 KEY_FILE = ../../msfinal.pub
 SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
 LIB_REFS = System
-LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib.dll
+LIB_MCS_FLAGS = $(SIGN_FLAGS) 
 
 PLATFORM_DEBUG_FLAGS =
 
index 68c77b28ef9b7ab8da342c4ffc948e0cef4b36ed..0b5f4acf6daad43a1597f99ada62b9ebd4f05fc2 100644 (file)
@@ -12,7 +12,7 @@ LIBRARY = Microsoft.Win32.Registry.AccessControl.dll
 KEY_FILE = ../../msfinal.pub
 SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
 LIB_REFS = System
-LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib.dll
+LIB_MCS_FLAGS = $(SIGN_FLAGS) 
 
 PLATFORM_DEBUG_FLAGS =
 
index 95a931f2a73e6c76d6e18cb230bab4b083e8f8eb..5f1030b7c72c610cf09e6c850a32935ca7874590 100644 (file)
@@ -12,7 +12,7 @@ LIBRARY = Microsoft.Win32.Registry.dll
 KEY_FILE = ../../msfinal.pub
 SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
 LIB_REFS = System
-LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib.dll
+LIB_MCS_FLAGS = $(SIGN_FLAGS) 
 
 PLATFORM_DEBUG_FLAGS =
 
index a428634b310354eea16aa4b1464e33d3906562a4..9170d927e04e6a6100557b4bd0eabadc421dd750 100644 (file)
@@ -12,7 +12,7 @@ LIBRARY = System.AppContext.dll
 KEY_FILE = ../../msfinal.pub
 SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
 LIB_REFS = System
-LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib.dll
+LIB_MCS_FLAGS = $(SIGN_FLAGS) 
 
 PLATFORM_DEBUG_FLAGS =
 
index 9fe40d3d849ba6f5fe9a1b854d89d270fb47f01b..d94e5d55dd2aa4ad2de702786f5ad8e7835bec6e 100644 (file)
@@ -12,7 +12,7 @@ LIBRARY = System.Collections.Concurrent.dll
 KEY_FILE = ../../msfinal.pub
 SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
 LIB_REFS = System
-LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib.dll
+LIB_MCS_FLAGS = $(SIGN_FLAGS) 
 
 PLATFORM_DEBUG_FLAGS =
 
index 6aa88932bd39bd51fdb5b480a0fc15c6c4844e00..f2f3cdb4772de684efb7216f3b876b12a3abb2f9 100644 (file)
@@ -12,7 +12,7 @@ LIBRARY = System.Collections.NonGeneric.dll
 KEY_FILE = ../../msfinal.pub
 SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
 LIB_REFS = System
-LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib.dll
+LIB_MCS_FLAGS = $(SIGN_FLAGS) 
 
 PLATFORM_DEBUG_FLAGS =
 
index 7730dc6182e9ce19d9066541087e11619c71a1b6..d391fa9ac5190ed4715718989e3ae3d0b0213ef3 100644 (file)
@@ -12,7 +12,7 @@ LIBRARY = System.Collections.Specialized.dll
 KEY_FILE = ../../msfinal.pub
 SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
 LIB_REFS = System
-LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib.dll
+LIB_MCS_FLAGS = $(SIGN_FLAGS) 
 
 PLATFORM_DEBUG_FLAGS =
 
index e91fa63b8d8946bd8b7d8bfc58b8f9039ffb6a97..dc6dca0073a2334fa85a0aa17e1017c539d8d556 100644 (file)
@@ -12,7 +12,7 @@ LIBRARY = System.Collections.dll
 KEY_FILE = ../../msfinal.pub
 SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
 LIB_REFS = System System.Core
-LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib.dll
+LIB_MCS_FLAGS = $(SIGN_FLAGS) 
 
 PLATFORM_DEBUG_FLAGS =
 
index 0e5a336b82cfd49d13d88ef67dbf30ca33847a0d..a4f1cc41c4d0305260e88acd5defefb4817be0e9 100644 (file)
@@ -12,7 +12,7 @@ LIBRARY = System.ComponentModel.Annotations.dll
 KEY_FILE = ../../msfinal.pub
 SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
 LIB_REFS = System.ComponentModel.DataAnnotations
-LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib.dll
+LIB_MCS_FLAGS = $(SIGN_FLAGS) 
 
 PLATFORM_DEBUG_FLAGS =
 
index 3bb78c169959296cd387ae7f09351add9b11ded6..48a6b9c11e617451abde35a362f117b433457a89 100644 (file)
@@ -12,7 +12,7 @@ LIBRARY = System.ComponentModel.EventBasedAsync.dll
 KEY_FILE = ../../msfinal.pub
 SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
 LIB_REFS = System
-LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib.dll
+LIB_MCS_FLAGS = $(SIGN_FLAGS) 
 
 PLATFORM_DEBUG_FLAGS =
 
index 8b46af0e4c20bec7dd4b688c8be54e40dbddd4ad..dac065757dee333e4ff0d549b12c6223ac8c1f2d 100644 (file)
@@ -12,7 +12,7 @@ LIBRARY = System.ComponentModel.Primitives.dll
 KEY_FILE = ../../msfinal.pub
 SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
 LIB_REFS = System
-LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib.dll
+LIB_MCS_FLAGS = $(SIGN_FLAGS) 
 
 PLATFORM_DEBUG_FLAGS =
 
index 9479c31e5d55ff566a80649825d80416fac742f4..6062e304a95bddb5401c33402610baa81e6b1251 100644 (file)
@@ -12,7 +12,7 @@ LIBRARY = System.ComponentModel.TypeConverter.dll
 KEY_FILE = ../../msfinal.pub
 SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
 LIB_REFS = System
-LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib.dll
+LIB_MCS_FLAGS = $(SIGN_FLAGS) 
 
 PLATFORM_DEBUG_FLAGS =
 
index 57c23bab8fcb480ec9199e685f7a0297d96e7cde..33b88f9541ee8bbac2b728a5064e1a6ef3dd7e33 100644 (file)
@@ -12,7 +12,7 @@ LIBRARY = System.ComponentModel.dll
 KEY_FILE = ../../msfinal.pub
 SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
 LIB_REFS = System
-LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib.dll
+LIB_MCS_FLAGS = $(SIGN_FLAGS) 
 
 PLATFORM_DEBUG_FLAGS =
 
index 7ec5ccd75e51a9b9b5fb3357bd4fd3ff911aa004..ea7312a4d7060b96f47c03c998097150cc34720f 100644 (file)
@@ -12,7 +12,7 @@ LIBRARY = System.Console.dll
 KEY_FILE = ../../msfinal.pub
 SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
 LIB_REFS = System
-LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib.dll
+LIB_MCS_FLAGS = $(SIGN_FLAGS) 
 
 PLATFORM_DEBUG_FLAGS =
 
index ca5b55bb5e4dfbdb31f8bb7e204654ee536e14ab..30bf3dd018146c2ca81002fde79578ff7f6457c1 100644 (file)
@@ -11,8 +11,8 @@ LIBRARY = System.Data.Common.dll
 
 KEY_FILE = ../../msfinal.pub
 SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
-LIB_REFS = System
-LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib.dll /r:System.Data.dll
+LIB_REFS = System System.Data
+LIB_MCS_FLAGS = $(SIGN_FLAGS)
 
 PLATFORM_DEBUG_FLAGS =
 
index 0fa130c8e282d2a27762cf34c4acf6278a628f29..f5eb7097fd6366eaad0662aa3f5f809e40fe6874 100644 (file)
@@ -11,8 +11,8 @@ LIBRARY = System.Data.SqlClient.dll
 
 KEY_FILE = ../../msfinal.pub
 SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
-LIB_REFS = System
-LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib.dll /r:System.Data.dll /r:System.Xml.dll
+LIB_REFS = System System.Data System.Xml
+LIB_MCS_FLAGS = $(SIGN_FLAGS)
 
 PLATFORM_DEBUG_FLAGS =
 
index 23dad544fc916db57359e244df2f82a805919bd4..391da57605b41150b50ce48906995e07bea39df2 100644 (file)
@@ -11,7 +11,7 @@ LIBRARY = System.Diagnostics.Contracts.dll
 
 KEY_FILE = ../../msfinal.pub
 SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
-LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib.dll
+LIB_MCS_FLAGS = $(SIGN_FLAGS) 
 
 PLATFORM_DEBUG_FLAGS =
 
index 34574abc438294f2009aacc169f0ee69ab33a4df..0eccd8767190f9b3a811a712cf0522f6e3a4cef2 100644 (file)
@@ -12,7 +12,7 @@ LIBRARY = System.Diagnostics.Debug.dll
 KEY_FILE = ../../msfinal.pub
 SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
 LIB_REFS = System
-LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib.dll
+LIB_MCS_FLAGS = $(SIGN_FLAGS) 
 
 PLATFORM_DEBUG_FLAGS =
 
index 2d2c4bfe8bbb783b2159ba9e254bd68a055e9bf3..1ac2f6cc2a05917d5e5d678a5a348715a75496b2 100644 (file)
@@ -12,7 +12,7 @@ LIBRARY = System.Diagnostics.FileVersionInfo.dll
 KEY_FILE = ../../msfinal.pub
 SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
 LIB_REFS = System
-LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib.dll
+LIB_MCS_FLAGS = $(SIGN_FLAGS) 
 
 PLATFORM_DEBUG_FLAGS =
 
index 499d313fc6cdc2b3b2974083d721641cbd401735..beda86068884cf88af0a51a363dd73dcca126150 100644 (file)
@@ -12,7 +12,7 @@ LIBRARY = System.Diagnostics.PerformanceCounter.dll
 KEY_FILE = ../../msfinal.pub
 SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
 LIB_REFS = System
-LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib.dll
+LIB_MCS_FLAGS = $(SIGN_FLAGS) 
 
 PLATFORM_DEBUG_FLAGS =
 
index c6980725fd1d3b9b2a3bac340130b476134c2cb3..83fd768e25124252caa659b24c03af6afdc7f86c 100644 (file)
@@ -12,7 +12,7 @@ LIBRARY = System.Diagnostics.Process.dll
 KEY_FILE = ../../msfinal.pub
 SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
 LIB_REFS = System
-LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib.dll
+LIB_MCS_FLAGS = $(SIGN_FLAGS) 
 
 PLATFORM_DEBUG_FLAGS =
 
index 169d8b79e1e61e7fd1a9ac44b712d11c37d90d7b..25d8ac37eddd1351ee41e37670615d9b8df46531 100644 (file)
@@ -12,7 +12,7 @@ LIBRARY = System.Diagnostics.StackTrace.dll
 KEY_FILE = ../../msfinal.pub
 SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
 LIB_REFS = System
-LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib.dll
+LIB_MCS_FLAGS = $(SIGN_FLAGS) 
 
 PLATFORM_DEBUG_FLAGS =
 
index 27e24e5ed7a223b4bd997a432b0d26d4ee02e314..aa7c6dc119fc4cfa8f0d8ed154b0cfcb4fa4ec9e 100644 (file)
@@ -12,7 +12,7 @@ LIBRARY = System.Diagnostics.TextWriterTraceListener.dll
 KEY_FILE = ../../msfinal.pub
 SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
 LIB_REFS = System
-LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib.dll
+LIB_MCS_FLAGS = $(SIGN_FLAGS) 
 
 PLATFORM_DEBUG_FLAGS =
 
index 494f8b90da060b4dbce7f760c85e0b015540994b..3d9b5158255726324e164ef659a6f48d05f977bd 100644 (file)
@@ -12,7 +12,7 @@ LIBRARY = System.Diagnostics.Tools.dll
 KEY_FILE = ../../msfinal.pub
 SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
 LIB_REFS = System
-LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib.dll
+LIB_MCS_FLAGS = $(SIGN_FLAGS) 
 
 PLATFORM_DEBUG_FLAGS =
 
index a109b64df9ac0b9102519fab385426eb04e91a1f..342e82dbf4a4288cc8cfa0269205ba1aa6b77de7 100644 (file)
@@ -12,7 +12,7 @@ LIBRARY = System.Diagnostics.TraceEvent.dll
 KEY_FILE = ../../msfinal.pub
 SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
 LIB_REFS = System
-LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib.dll
+LIB_MCS_FLAGS = $(SIGN_FLAGS) 
 
 PLATFORM_DEBUG_FLAGS =
 
index 2dbd5475cca82641a0af997389e9b86bc0582941..3467273f7c9ea984a9a7770ce90dc0e44359ee36 100644 (file)
@@ -12,7 +12,7 @@ LIBRARY = System.Diagnostics.TraceSource.dll
 KEY_FILE = ../../msfinal.pub
 SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
 LIB_REFS = System
-LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib.dll
+LIB_MCS_FLAGS = $(SIGN_FLAGS) 
 
 PLATFORM_DEBUG_FLAGS =
 
index 53a49cfff704df5cbefb9b134f291956caffa328..14b380da866454c7569c53a115dfa4e473422415 100644 (file)
@@ -11,7 +11,7 @@ LIBRARY = System.Diagnostics.Tracing.dll
 
 KEY_FILE = ../../msfinal.pub
 SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
-LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib.dll
+LIB_MCS_FLAGS = $(SIGN_FLAGS) 
 
 PLATFORM_DEBUG_FLAGS =
 
index 9380c0ecba4f95c19ba8b621b03f7c82d5dcf9af..a6bcda9f3deddfa3d64379e1b6908a4d1e884fe3 100644 (file)
@@ -12,7 +12,7 @@ LIBRARY = System.Dynamic.Runtime.dll
 KEY_FILE = ../../msfinal.pub
 SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
 LIB_REFS = System.Core System
-LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib.dll
+LIB_MCS_FLAGS = $(SIGN_FLAGS) 
 
 PLATFORM_DEBUG_FLAGS =
 
index 1659260c032b06ce4d0fb36e2e12558812ab73a9..5f419e9b635d47e2424ac026cdc42178f821cc79 100644 (file)
@@ -12,7 +12,7 @@ LIBRARY = System.Globalization.Calendars.dll
 KEY_FILE = ../../msfinal.pub
 SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
 LIB_REFS = System
-LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib.dll
+LIB_MCS_FLAGS = $(SIGN_FLAGS) 
 
 PLATFORM_DEBUG_FLAGS =
 
index e4923237e7b79385a76d073e0722c9a5a461419d..d3a57fa307dbd8b7121b25630aa667270b3dc640 100644 (file)
@@ -12,7 +12,7 @@ LIBRARY = System.Globalization.Extensions.dll
 KEY_FILE = ../../msfinal.pub
 SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
 LIB_REFS = System
-LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib.dll
+LIB_MCS_FLAGS = $(SIGN_FLAGS) 
 
 PLATFORM_DEBUG_FLAGS =
 
index e94f4b5561bbe4b68878cc75eca0e2ef3d851661..4f01dfeb76258fc89d9d03cecedd4742bf77d306 100644 (file)
@@ -11,7 +11,7 @@ LIBRARY = System.Globalization.dll
 
 KEY_FILE = ../../msfinal.pub
 SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
-LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib.dll
+LIB_MCS_FLAGS = $(SIGN_FLAGS) 
 
 PLATFORM_DEBUG_FLAGS =
 
index 0865314a1bda3abaed6ff8033176b11a9859d7f1..b4e4896a6295a8936564f4a0539974952652070c 100644 (file)
@@ -11,8 +11,8 @@ LIBRARY = System.IO.Compression.ZipFile.dll
 
 KEY_FILE = ../../msfinal.pub
 SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
-LIB_REFS = System
-LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib.dll /r:System.IO.Compression.FileSystem.dll
+LIB_REFS = System System.IO.Compression.FileSystem
+LIB_MCS_FLAGS = $(SIGN_FLAGS)
 
 PLATFORM_DEBUG_FLAGS =
 
index 6574fc6249952d0b4ddb143a5c2bcc03cf632b59..0198747a8a312def61d8cb153e45a6b6d038c168 100644 (file)
@@ -12,7 +12,7 @@ LIBRARY = System.IO.FileSystem.AccessControl.dll
 KEY_FILE = ../../msfinal.pub
 SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
 LIB_REFS = System
-LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib.dll
+LIB_MCS_FLAGS = $(SIGN_FLAGS) 
 
 PLATFORM_DEBUG_FLAGS =
 
index 096d6c7a7facd196627c335924caea1de7d4cfa3..0925c49d1557f854176a41a134cbcd81ad6bf124 100644 (file)
@@ -12,7 +12,7 @@ LIBRARY = System.IO.FileSystem.DriveInfo.dll
 KEY_FILE = ../../msfinal.pub
 SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
 LIB_REFS = System
-LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib.dll
+LIB_MCS_FLAGS = $(SIGN_FLAGS) 
 
 PLATFORM_DEBUG_FLAGS =
 
index 2622a088f2d2547165a9965bef8781de3e51bc12..31b27077e454a42cb23a1d7436d72e0498c6334b 100644 (file)
@@ -12,7 +12,7 @@ LIBRARY = System.IO.FileSystem.Primitives.dll
 KEY_FILE = ../../msfinal.pub
 SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
 LIB_REFS = System
-LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib.dll
+LIB_MCS_FLAGS = $(SIGN_FLAGS) 
 
 PLATFORM_DEBUG_FLAGS =
 
index 2a4d25e107348b40b171c36f5d4da5414f7a5fd0..caade8a02a0195d34405de7b8659995ef95b0d31 100644 (file)
@@ -12,7 +12,7 @@ LIBRARY = System.IO.FileSystem.Watcher.dll
 KEY_FILE = ../../msfinal.pub
 SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
 LIB_REFS = System
-LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib.dll
+LIB_MCS_FLAGS = $(SIGN_FLAGS) 
 
 PLATFORM_DEBUG_FLAGS =
 
index cbd49ccc53525461d170e49f2cc040e30a8264f1..178aa60efeaaad5830ac94aaab910a13751441e2 100644 (file)
@@ -12,7 +12,7 @@ LIBRARY = System.IO.FileSystem.dll
 KEY_FILE = ../../msfinal.pub
 SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
 LIB_REFS = System
-LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib.dll
+LIB_MCS_FLAGS = $(SIGN_FLAGS) 
 
 PLATFORM_DEBUG_FLAGS =
 
index e89d4be370bff6b7b2db7177c7470edc9ab28814..be6a315004b208b1c49e37455206199af6e43093 100644 (file)
@@ -12,7 +12,7 @@ LIBRARY = System.IO.IsolatedStorage.dll
 KEY_FILE = ../../msfinal.pub
 SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
 LIB_REFS = System
-LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib.dll
+LIB_MCS_FLAGS = $(SIGN_FLAGS) 
 
 PLATFORM_DEBUG_FLAGS =
 
index 1ea56e44d9432db6cd5104cca5ca05b32611ba71..656b03cd1262185c1b50734329bc9296795d8515 100644 (file)
@@ -11,8 +11,8 @@ LIBRARY = System.IO.MemoryMappedFiles.dll
 
 KEY_FILE = ../../msfinal.pub
 SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
-LIB_REFS = System
-LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib.dll /r:System.Core.dll
+LIB_REFS = System System.Core
+LIB_MCS_FLAGS = $(SIGN_FLAGS)
 
 PLATFORM_DEBUG_FLAGS =
 
index 999b161afd3c7fdcc284a39e5cbe958651a3b734..0d156aafeb131b3bf55145cd637bb68770340e39 100644 (file)
@@ -11,8 +11,8 @@ LIBRARY = System.IO.Pipes.dll
 
 KEY_FILE = ../../msfinal.pub
 SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
-LIB_REFS = System
-LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib.dll /r:System.Core.dll
+LIB_REFS = System System.Core
+LIB_MCS_FLAGS = $(SIGN_FLAGS)
 
 PLATFORM_DEBUG_FLAGS =
 
index c65888b23119152c3780cb424380e97c5bd4779c..c1605d9ccf85284ae1fa300fbc17dc35dfb10eb9 100644 (file)
@@ -12,7 +12,7 @@ LIBRARY = System.IO.UnmanagedMemoryStream.dll
 KEY_FILE = ../../msfinal.pub
 SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
 LIB_REFS = System
-LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib.dll
+LIB_MCS_FLAGS = $(SIGN_FLAGS) 
 
 PLATFORM_DEBUG_FLAGS =
 
index 42a6a9413b47bdab5bbf0052fc480259c8a19e99..89fc0db09634da4466bd382a6874697d517e21ab 100644 (file)
@@ -12,7 +12,7 @@ LIBRARY = System.IO.dll
 KEY_FILE = ../../msfinal.pub
 SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
 LIB_REFS = System
-LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib.dll
+LIB_MCS_FLAGS = $(SIGN_FLAGS) 
 
 PLATFORM_DEBUG_FLAGS =
 
index d2ad276ef09b821064fa829c6c23ecc933c16c01..bb78580fb433de302a0fdf8ef84e8abe7532799e 100644 (file)
@@ -12,7 +12,7 @@ LIBRARY = System.Linq.Expressions.dll
 KEY_FILE = ../../msfinal.pub
 SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
 LIB_REFS = System.Core
-LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib.dll
+LIB_MCS_FLAGS = $(SIGN_FLAGS) 
 
 PLATFORM_DEBUG_FLAGS =
 
index d68ebb41633709974ae71f366d6b7735bdbef05b..7d314bf5e9502836ca18c6ec152739898fba656c 100644 (file)
@@ -12,7 +12,7 @@ LIBRARY = System.Linq.Parallel.dll
 KEY_FILE = ../../msfinal.pub
 SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
 LIB_REFS = System.Core
-LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib.dll
+LIB_MCS_FLAGS = $(SIGN_FLAGS) 
 
 PLATFORM_DEBUG_FLAGS =
 
index 1f0225e3aeab978987d912eedf0b8ade5b17a445..6ea4c746ec840f02659775c5a1d330f33bb6c516 100644 (file)
@@ -12,7 +12,7 @@ LIBRARY = System.Linq.Queryable.dll
 KEY_FILE = ../../msfinal.pub
 SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
 LIB_REFS = System.Core
-LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib.dll
+LIB_MCS_FLAGS = $(SIGN_FLAGS) 
 
 PLATFORM_DEBUG_FLAGS =
 
index 17bcabbdf83bb028dc8fd82f28cebeb0c9d0dbd3..d9778697d4c882d682b44b80d7da16b3a0136284 100644 (file)
@@ -12,7 +12,7 @@ LIBRARY = System.Linq.dll
 KEY_FILE = ../../msfinal.pub
 SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
 LIB_REFS = System.Core
-LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib.dll
+LIB_MCS_FLAGS = $(SIGN_FLAGS) 
 
 PLATFORM_DEBUG_FLAGS =
 
index 4efed6d1b282b95efb47cbbc2d355990e87ce01e..293f80d25d36c56bcde1dd969c536cd941d29d6b 100644 (file)
@@ -12,7 +12,7 @@ LIBRARY = System.Net.AuthenticationManager.dll
 KEY_FILE = ../../msfinal.pub
 SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
 LIB_REFS = System
-LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib.dll
+LIB_MCS_FLAGS = $(SIGN_FLAGS) 
 
 PLATFORM_DEBUG_FLAGS =
 
index 9826235d5b1b5b01139196b8ba490e066808e91c..bbdcfce759232bb82559b6705da145b52307792a 100644 (file)
@@ -12,7 +12,7 @@ LIBRARY = System.Net.Cache.dll
 KEY_FILE = ../../msfinal.pub
 SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
 LIB_REFS = System
-LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib.dll
+LIB_MCS_FLAGS = $(SIGN_FLAGS) 
 
 PLATFORM_DEBUG_FLAGS =
 
index 202bfbe892aba93b0356b9f9626664d9f218d49e..7750bbae45a12a74751e744aa15684e2309aac89 100644 (file)
@@ -11,8 +11,8 @@ LIBRARY = System.Net.Http.WebRequestHandler.dll
 
 KEY_FILE = ../../msfinal.pub
 SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
-LIB_REFS = System
-LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib.dll /r:System.Net.Http.WebRequest.dll /r:System.Net.Http.dll
+LIB_REFS = System System.Net.Http.WebRequest System.Net.Http
+LIB_MCS_FLAGS = $(SIGN_FLAGS)
 
 PLATFORM_DEBUG_FLAGS =
 
index 401f473303c78037d6d58df94c47046c9f5e7396..3109e7076150771cdc3703a58b00258b94b09a77 100644 (file)
@@ -12,7 +12,7 @@ LIBRARY = System.Net.HttpListener.dll
 KEY_FILE = ../../msfinal.pub
 SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
 LIB_REFS = System
-LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib.dll /r:System.dll
+LIB_MCS_FLAGS = $(SIGN_FLAGS)
 
 PLATFORM_DEBUG_FLAGS =
 
index 32aca2f9665420600d201bb2d5a9499c83e9a5dd..fe936b17d9141732b41bf59c2e95fe8096f9f23f 100644 (file)
@@ -12,7 +12,7 @@ LIBRARY = System.Net.Mail.dll
 KEY_FILE = ../../msfinal.pub
 SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
 LIB_REFS = System
-LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib.dll /r:System.dll
+LIB_MCS_FLAGS = $(SIGN_FLAGS)
 
 PLATFORM_DEBUG_FLAGS =
 
index ae8b68c79d68b08b685526fdfb1fdd796ffea20b..142a303c38e0b9869ff4e7c185efb0d3977661e0 100644 (file)
@@ -12,7 +12,7 @@ LIBRARY = System.Net.NameResolution.dll
 KEY_FILE = ../../msfinal.pub
 SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
 LIB_REFS = System
-LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib.dll
+LIB_MCS_FLAGS = $(SIGN_FLAGS) 
 
 PLATFORM_DEBUG_FLAGS =
 
index 29df735469a22123eafc2e9d28163f4c1fd6331f..bc2a7ec81660b1daf4d03a1da95c73f02d8202aa 100644 (file)
@@ -12,7 +12,7 @@ LIBRARY = System.Net.NetworkInformation.dll
 KEY_FILE = ../../msfinal.pub
 SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
 LIB_REFS = System
-LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib.dll
+LIB_MCS_FLAGS = $(SIGN_FLAGS) 
 
 PLATFORM_DEBUG_FLAGS =
 
index babbd33274be478c719ef7b019bd31c6b5106e57..bc36271325922ee154f7268ad5ccec15fd8069a6 100644 (file)
@@ -12,7 +12,7 @@ LIBRARY = System.Net.Primitives.dll
 KEY_FILE = ../../msfinal.pub
 SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
 LIB_REFS = System
-LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib.dll
+LIB_MCS_FLAGS = $(SIGN_FLAGS) 
 
 PLATFORM_DEBUG_FLAGS =
 
index 947ca929cef91ae7c3a41704f7f45eb1f8a39f06..7a8a231bc3b45ac31461994436df5075a7cc81e6 100644 (file)
@@ -12,7 +12,7 @@ LIBRARY = System.Net.Requests.dll
 KEY_FILE = ../../msfinal.pub
 SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
 LIB_REFS = System
-LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib.dll
+LIB_MCS_FLAGS = $(SIGN_FLAGS) 
 
 PLATFORM_DEBUG_FLAGS =
 
index 4eab13bc8c870e90a8ff203be795f68f61467f90..cdd7db906c94970e9fab160103797a5d2baf446f 100644 (file)
@@ -12,7 +12,7 @@ LIBRARY = System.Net.Security.dll
 KEY_FILE = ../../msfinal.pub
 SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
 LIB_REFS = System
-LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib.dll /r:System.dll
+LIB_MCS_FLAGS = $(SIGN_FLAGS)
 
 PLATFORM_DEBUG_FLAGS =
 
index bb8e7229f721bdedb2aab7f4e0d6afe4fe5875f4..f0d095317dcaeea6f0b93505b3b726053a491f7a 100644 (file)
@@ -12,7 +12,7 @@ LIBRARY = System.Net.ServicePoint.dll
 KEY_FILE = ../../msfinal.pub
 SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
 LIB_REFS = System
-LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib.dll
+LIB_MCS_FLAGS = $(SIGN_FLAGS) 
 
 PLATFORM_DEBUG_FLAGS =
 
index 0cd78a8dac09f04214e7e0456b16cff94bbee806..bf60d5fef6be2147d79b9b70e5ab29430dc1f651 100644 (file)
@@ -12,7 +12,7 @@ LIBRARY = System.Net.Sockets.dll
 KEY_FILE = ../../msfinal.pub
 SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
 LIB_REFS = System
-LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib.dll /r:System.dll
+LIB_MCS_FLAGS = $(SIGN_FLAGS)
 
 PLATFORM_DEBUG_FLAGS =
 
index 77d83647a6d9ffc7f567085ea2122e49ac32391c..6f1a5166b8aa215aed0bc604a0f27cd72a06a610 100644 (file)
@@ -12,7 +12,7 @@ LIBRARY = System.Net.Utilities.dll
 KEY_FILE = ../../msfinal.pub
 SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
 LIB_REFS = System
-LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib.dll
+LIB_MCS_FLAGS = $(SIGN_FLAGS) 
 
 PLATFORM_DEBUG_FLAGS =
 
index b3fe02b3456caade8da72a4ef77390194ca72a8b..f6ec2a06526ec525bee6876f87f7ba7dd9055bdb 100644 (file)
@@ -12,7 +12,7 @@ LIBRARY = System.Net.WebHeaderCollection.dll
 KEY_FILE = ../../msfinal.pub
 SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
 LIB_REFS = System
-LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib.dll
+LIB_MCS_FLAGS = $(SIGN_FLAGS) 
 
 PLATFORM_DEBUG_FLAGS =
 
index 8489220e9602c57945b8d28077d393162d791f78..2552b0e0d5b3032027e0b89eb7bf4b6221791a6e 100644 (file)
@@ -12,7 +12,7 @@ LIBRARY = System.Net.WebSockets.Client.dll
 KEY_FILE = ../../msfinal.pub
 SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
 LIB_REFS = System
-LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib.dll
+LIB_MCS_FLAGS = $(SIGN_FLAGS) 
 
 PLATFORM_DEBUG_FLAGS =
 
index 783ae541c93d3af0459500e74594aec89b22b86e..e9fa98fd8b48fd01450122ab9bd74fc0a98b8d1c 100644 (file)
@@ -12,7 +12,7 @@ LIBRARY = System.Net.WebSockets.dll
 KEY_FILE = ../../msfinal.pub
 SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
 LIB_REFS = System
-LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib.dll
+LIB_MCS_FLAGS = $(SIGN_FLAGS) 
 
 PLATFORM_DEBUG_FLAGS =
 
index 56ca84ae0daa2b92d814c4b658b5e131364d5320..0838b23d3cfe1e301d46448072fec98ed020cb07 100644 (file)
@@ -12,7 +12,7 @@ LIBRARY = System.ObjectModel.dll
 KEY_FILE = ../../msfinal.pub
 SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
 LIB_REFS = System
-LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib.dll
+LIB_MCS_FLAGS = $(SIGN_FLAGS) 
 
 PLATFORM_DEBUG_FLAGS =
 
index ee55fc623754b07f78cbb5d91bfc0eb44d0247d7..7b03ca8fdb0eb1b55a0f6e5b49507b65a189e0df 100644 (file)
@@ -12,7 +12,7 @@ LIBRARY = System.Private.CoreLib.InteropServices.dll
 KEY_FILE = ../../msfinal.pub
 SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
 LIB_REFS = System
-LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib.dll
+LIB_MCS_FLAGS = $(SIGN_FLAGS) 
 
 PLATFORM_DEBUG_FLAGS =
 
index 52ce0e308ad25c830d36c54686ea57fcb720fe0c..347b171983ea6f8483fa59cb2b914782d4091029 100644 (file)
@@ -12,7 +12,7 @@ LIBRARY = System.Private.CoreLib.Threading.dll
 KEY_FILE = ../../msfinal.pub
 SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
 LIB_REFS = System
-LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib.dll
+LIB_MCS_FLAGS = $(SIGN_FLAGS) 
 
 PLATFORM_DEBUG_FLAGS =
 
index f9c54c54b2f4031fe241980dae629348dca72f0b..6ee536f7b71437a4b774e62b45834cde0297142e 100644 (file)
@@ -11,7 +11,7 @@ LIBRARY = System.Reflection.Emit.ILGeneration.dll
 
 KEY_FILE = ../../msfinal.pub
 SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
-LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib.dll
+LIB_MCS_FLAGS = $(SIGN_FLAGS) 
 
 PLATFORM_DEBUG_FLAGS =
 
index 70a46b888d520a0311bfccc254c7206ca5531df9..93292276ab10e15f578a62e8431405bc2153544c 100644 (file)
@@ -11,7 +11,7 @@ LIBRARY = System.Reflection.Emit.Lightweight.dll
 
 KEY_FILE = ../../msfinal.pub
 SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
-LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib.dll
+LIB_MCS_FLAGS = $(SIGN_FLAGS) 
 
 PLATFORM_DEBUG_FLAGS =
 
index 2227a3ca80f0acea2a613d60c0ac2f76accaeb1d..798d457271e1b199a3d1ade55adb63f526df5eaa 100644 (file)
@@ -11,7 +11,7 @@ LIBRARY = System.Reflection.Emit.dll
 
 KEY_FILE = ../../msfinal.pub
 SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
-LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib.dll
+LIB_MCS_FLAGS = $(SIGN_FLAGS) 
 
 PLATFORM_DEBUG_FLAGS =
 
index db7f3df173d8978bbda3b8522034c160c4336455..e1799cc150e5da36dfa74d857f5b85461b302b76 100644 (file)
@@ -11,7 +11,7 @@ LIBRARY = System.Reflection.Extensions.dll
 
 KEY_FILE = ../../msfinal.pub
 SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
-LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib.dll
+LIB_MCS_FLAGS = $(SIGN_FLAGS) 
 
 PLATFORM_DEBUG_FLAGS =
 
index 99a3a39505d2072a5501f32f5981201724999951..ee500e52ecbdc726ce75a1352b9925cd4d64e5cf 100644 (file)
@@ -11,7 +11,7 @@ LIBRARY = System.Reflection.Primitives.dll
 
 KEY_FILE = ../../msfinal.pub
 SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
-LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib.dll
+LIB_MCS_FLAGS = $(SIGN_FLAGS) 
 
 PLATFORM_DEBUG_FLAGS =
 
index 3e4d713ac5353037aee66eab5b599de85e59c8ab..b2bb49ecfd1b431029d66f45927f36d0e712e26b 100644 (file)
@@ -12,7 +12,7 @@ LIBRARY = System.Reflection.TypeExtensions.dll
 KEY_FILE = ../../msfinal.pub
 SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
 LIB_REFS = System
-LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib.dll
+LIB_MCS_FLAGS = $(SIGN_FLAGS) 
 
 PLATFORM_DEBUG_FLAGS =
 
index 862b9333ccc43509c9fe37ab453d52f5f9742856..3061a268a236132b4ab3e97479b4cd5a6f55d090 100644 (file)
@@ -11,7 +11,7 @@ LIBRARY = System.Reflection.dll
 
 KEY_FILE = ../../msfinal.pub
 SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
-LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib.dll
+LIB_MCS_FLAGS = $(SIGN_FLAGS) 
 
 PLATFORM_DEBUG_FLAGS =
 
index 48c56ade5a33b199bf38475aab9abbabc36908db..e2795e40f7d39338970d51e1603db8126eb12771 100644 (file)
@@ -12,7 +12,7 @@ LIBRARY = System.Resources.ReaderWriter.dll
 KEY_FILE = ../../msfinal.pub
 SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
 LIB_REFS = System
-LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib.dll
+LIB_MCS_FLAGS = $(SIGN_FLAGS) 
 
 PLATFORM_DEBUG_FLAGS =
 
index 72e539364cf89dc38ca7ac96214114c61ebe0336..15f241e4091c0ca1bbc9533964eeec76f904aa8e 100644 (file)
@@ -11,7 +11,7 @@ LIBRARY = System.Resources.ResourceManager.dll
 
 KEY_FILE = ../../msfinal.pub
 SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
-LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib.dll
+LIB_MCS_FLAGS = $(SIGN_FLAGS) 
 
 PLATFORM_DEBUG_FLAGS =
 
index 21d3f78844e17e8b91ce7bd25c04536df3abcfed..6f7f15c612e98df05db8f54e26515c807767901c 100644 (file)
@@ -12,7 +12,7 @@ LIBRARY = System.Runtime.CompilerServices.VisualC.dll
 KEY_FILE = ../../msfinal.pub
 SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
 LIB_REFS = System
-LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib.dll
+LIB_MCS_FLAGS = $(SIGN_FLAGS) 
 
 PLATFORM_DEBUG_FLAGS =
 
index 981cb5f8233e46740c20088a087db5f600d7acdc..70fd8c9330577b0c140791d38ccf5a615110ce01 100644 (file)
@@ -12,7 +12,7 @@ LIBRARY = System.Runtime.Extensions.dll
 KEY_FILE = ../../msfinal.pub
 SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
 LIB_REFS = System
-LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib.dll
+LIB_MCS_FLAGS = $(SIGN_FLAGS) 
 
 PLATFORM_DEBUG_FLAGS =
 
index 396738e44e53ccbd4cfed370816717bb0bf63158..db800c29abf056babb2ba8c8ee077d8f93a9bf94 100644 (file)
@@ -12,7 +12,7 @@ LIBRARY = System.Runtime.Handles.dll
 KEY_FILE = ../../msfinal.pub
 SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
 LIB_REFS = System System.Core
-LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib.dll
+LIB_MCS_FLAGS = $(SIGN_FLAGS) 
 
 PLATFORM_DEBUG_FLAGS =
 
index a6340fb3e76fde42cd7b3347c0ef8aa00aafccd5..1aaf02e2fc58c6d2334902e8acb610e1df459464 100644 (file)
@@ -11,7 +11,7 @@ LIBRARY = System.Runtime.InteropServices.WindowsRuntime.dll
 
 KEY_FILE = ../../msfinal.pub
 SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
-LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib.dll
+LIB_MCS_FLAGS = $(SIGN_FLAGS) 
 
 PLATFORM_DEBUG_FLAGS =
 
index 51ef698b24c1f5b14b64230d738372e2c0fa929f..dd20654dcd3a4675f21e4d31e77ab535d64f180b 100644 (file)
@@ -12,7 +12,7 @@ LIBRARY = System.Runtime.InteropServices.dll
 KEY_FILE = ../../msfinal.pub
 SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
 LIB_REFS = System System.Core
-LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib.dll
+LIB_MCS_FLAGS = $(SIGN_FLAGS) 
 
 PLATFORM_DEBUG_FLAGS =
 
index e452fc5aca5f84d2abe6e8501d24f19502be2e4b..57867bb26a13f9894d1fe689fb82339f35a94af3 100644 (file)
@@ -12,7 +12,7 @@ LIBRARY = System.Runtime.Numerics.dll
 KEY_FILE = ../../msfinal.pub
 SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
 LIB_REFS = System.Numerics
-LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib.dll
+LIB_MCS_FLAGS = $(SIGN_FLAGS) 
 
 PLATFORM_DEBUG_FLAGS =
 
index 304059eaabb16eac768554ffa94417381e4cdba8..b5ca5ce40b28333fc7b1d16bc3772b22cdbe537c 100644 (file)
@@ -12,7 +12,7 @@ LIBRARY = System.Runtime.Serialization.Json.dll
 KEY_FILE = ../../msfinal.pub
 SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
 LIB_REFS = System.Runtime.Serialization
-LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib.dll
+LIB_MCS_FLAGS = $(SIGN_FLAGS) 
 
 PLATFORM_DEBUG_FLAGS =
 
index 648884fc9b72276c82b7103587d657d025e332f6..3a2519549fc638191e38dad30136d69222edbd3a 100644 (file)
@@ -12,7 +12,7 @@ LIBRARY = System.Runtime.Serialization.Primitives.dll
 KEY_FILE = ../../msfinal.pub
 SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
 LIB_REFS = System.Runtime.Serialization
-LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib.dll
+LIB_MCS_FLAGS = $(SIGN_FLAGS) 
 
 PLATFORM_DEBUG_FLAGS =
 
index cc0aec4a369d40f21e1c667f26bd1b7781ffb351..774289eb4de9e987c0368ce80e90d818c7b7ef7e 100644 (file)
@@ -12,7 +12,7 @@ LIBRARY = System.Runtime.Serialization.Xml.dll
 KEY_FILE = ../../msfinal.pub
 SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
 LIB_REFS = System.Runtime.Serialization System.Xml
-LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib.dll
+LIB_MCS_FLAGS = $(SIGN_FLAGS) 
 
 PLATFORM_DEBUG_FLAGS =
 
index c59de1384080e288a20a1b5f3a5368e79129067d..e8ab4049a267a27e87f64c2f7668058c18d67e5b 100644 (file)
@@ -12,7 +12,7 @@ LIBRARY = System.Runtime.dll
 KEY_FILE = ../../msfinal.pub
 SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
 LIB_REFS = System System.ComponentModel.Composition System.Core
-LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib.dll
+LIB_MCS_FLAGS = $(SIGN_FLAGS)
 
 PLATFORM_DEBUG_FLAGS =
 
index 3491238f861b314949c1a6100278ec2f80c0c77c..5c6ad1c09ecffa7c0aad056d7828a93449bf3610 100644 (file)
@@ -12,7 +12,7 @@ LIBRARY = System.Security.AccessControl.dll
 KEY_FILE = ../../msfinal.pub
 SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
 LIB_REFS = System
-LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib.dll
+LIB_MCS_FLAGS = $(SIGN_FLAGS) 
 
 PLATFORM_DEBUG_FLAGS =
 
index 72b761e38a545cdae65eb899e1b28e82073642ab..36ff76137bace6f96b5ca5552a5439e4f57235f6 100644 (file)
@@ -12,7 +12,7 @@ LIBRARY = System.Security.Claims.dll
 KEY_FILE = ../../msfinal.pub
 SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
 LIB_REFS = System
-LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib.dll
+LIB_MCS_FLAGS = $(SIGN_FLAGS) 
 
 PLATFORM_DEBUG_FLAGS =
 
index 1beaa35e01372bf07f4670eafcc4754e474d5471..4988d34843d478cb1ac0c81001090c141349d195 100644 (file)
@@ -12,7 +12,7 @@ LIBRARY = System.Security.Cryptography.DeriveBytes.dll
 KEY_FILE = ../../msfinal.pub
 SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
 LIB_REFS = System
-LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib.dll
+LIB_MCS_FLAGS = $(SIGN_FLAGS) 
 
 PLATFORM_DEBUG_FLAGS =
 
index 5bf1ccf0ab3e4c366b2ae21f30d67d69e061b646..71d37e200e0d5a4f8c55a0f64eb805898bcb2918 100644 (file)
@@ -12,7 +12,7 @@ LIBRARY = System.Security.Cryptography.Encoding.dll
 KEY_FILE = ../../msfinal.pub
 SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
 LIB_REFS = System
-LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib.dll
+LIB_MCS_FLAGS = $(SIGN_FLAGS) 
 
 PLATFORM_DEBUG_FLAGS =
 
index b43610b676465f01bffde31cd47e558455c90c64..0598a53f1d492c67996b709b6a8fbdf5d423152e 100644 (file)
@@ -12,7 +12,7 @@ LIBRARY = System.Security.Cryptography.Encryption.Aes.dll
 KEY_FILE = ../../msfinal.pub
 SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
 LIB_REFS = System
-LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib.dll
+LIB_MCS_FLAGS = $(SIGN_FLAGS) 
 
 PLATFORM_DEBUG_FLAGS =
 
index a2c373ac08aa6e3267ab7a26502ab4acdbbf4913..03e69f1f95ae0e0e097336d9145814392b64978c 100644 (file)
@@ -11,8 +11,8 @@ LIBRARY = System.Security.Cryptography.Encryption.ECDiffieHellman.dll
 
 KEY_FILE = ../../msfinal.pub
 SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
-LIB_REFS = System
-LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib.dll /r:System.Core.dll
+LIB_REFS = System System.Core
+LIB_MCS_FLAGS = $(SIGN_FLAGS)
 
 PLATFORM_DEBUG_FLAGS =
 
index 2bae1ac269dfca35f65fd3a3b6065d512796a146..08e99941082c8f1c4bf6531a99da34dfa9b62543 100644 (file)
@@ -11,8 +11,8 @@ LIBRARY = System.Security.Cryptography.Encryption.ECDsa.dll
 
 KEY_FILE = ../../msfinal.pub
 SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
-LIB_REFS = System
-LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib.dll /r:System.Core.dll
+LIB_REFS = System System.Core
+LIB_MCS_FLAGS = $(SIGN_FLAGS)
 
 PLATFORM_DEBUG_FLAGS =
 
index 26d1d81df8097a7ab2b9d711f3674cc949b7ce0f..0e8b16442809185da2b5cbbd1360e5d6179ef6d7 100644 (file)
@@ -12,7 +12,7 @@ LIBRARY = System.Security.Cryptography.Encryption.dll
 KEY_FILE = ../../msfinal.pub
 SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
 LIB_REFS = System
-LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib.dll
+LIB_MCS_FLAGS = $(SIGN_FLAGS) 
 
 PLATFORM_DEBUG_FLAGS =
 
index e146e689b9771f847bdbddbd1cdbec3fef37e7c3..45dad5331da23e4452f0c252b3a388870f1eb3c4 100644 (file)
@@ -12,7 +12,7 @@ LIBRARY = System.Security.Cryptography.Hashing.Algorithms.dll
 KEY_FILE = ../../msfinal.pub
 SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
 LIB_REFS = System
-LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib.dll
+LIB_MCS_FLAGS = $(SIGN_FLAGS) 
 
 PLATFORM_DEBUG_FLAGS =
 
index 450bb596fd866717afb7f142bc914b02ce12a80b..9df5800609b98319608e55b58dd3b6579ff61ba9 100644 (file)
@@ -12,7 +12,7 @@ LIBRARY = System.Security.Cryptography.Hashing.dll
 KEY_FILE = ../../msfinal.pub
 SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
 LIB_REFS = System
-LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib.dll
+LIB_MCS_FLAGS = $(SIGN_FLAGS) 
 
 PLATFORM_DEBUG_FLAGS =
 
index f82c860416253a13030c5d35a30a5049c7a540b9..1cdbf1de8f3decb38ad50b6f289edf3d0ecdece2 100644 (file)
@@ -11,8 +11,8 @@ LIBRARY = System.Security.Cryptography.ProtectedData.dll
 
 KEY_FILE = ../../msfinal.pub
 SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
-LIB_REFS = System
-LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib.dll /r:System.Security.dll
+LIB_REFS = System System.Security
+LIB_MCS_FLAGS = $(SIGN_FLAGS)
 
 PLATFORM_DEBUG_FLAGS =
 
index a88e14ef6cc0dbbc3879cc0836347dd1401bade5..ea7df7a042ad62c9639d3c530aa08f154aeb648d 100644 (file)
@@ -12,7 +12,7 @@ LIBRARY = System.Security.Cryptography.RSA.dll
 KEY_FILE = ../../msfinal.pub
 SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
 LIB_REFS = System
-LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib.dll
+LIB_MCS_FLAGS = $(SIGN_FLAGS) 
 
 PLATFORM_DEBUG_FLAGS =
 
index d9fdec015a2853bf6591d0d2b8bb3386e067fb98..2ffcdbc236f40d94b2eeb61092344223b2c593e0 100644 (file)
@@ -12,7 +12,7 @@ LIBRARY = System.Security.Cryptography.RandomNumberGenerator.dll
 KEY_FILE = ../../msfinal.pub
 SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
 LIB_REFS = System
-LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib.dll
+LIB_MCS_FLAGS = $(SIGN_FLAGS) 
 
 PLATFORM_DEBUG_FLAGS =
 
index 911aa9fd26809df82d0a84e05d3316cd939dbd46..5ad2d813f95f024e4a80de3a6e15c9458230b531 100644 (file)
@@ -12,7 +12,7 @@ LIBRARY = System.Security.Cryptography.X509Certificates.dll
 KEY_FILE = ../../msfinal.pub
 SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
 LIB_REFS = System
-LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib.dll
+LIB_MCS_FLAGS = $(SIGN_FLAGS) 
 
 PLATFORM_DEBUG_FLAGS =
 
index 8284f5fd5ba3a6e7d3478e9a83c425fc8e546d70..a287f05cb84ff339c878bdd67fed4c535bcff718 100644 (file)
@@ -12,7 +12,7 @@ LIBRARY = System.Security.Principal.Windows.dll
 KEY_FILE = ../../msfinal.pub
 SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
 LIB_REFS = System
-LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib.dll
+LIB_MCS_FLAGS = $(SIGN_FLAGS) 
 
 PLATFORM_DEBUG_FLAGS =
 
index c4db680014922ad7d1a4320932584cd5d56eb691..1a1265a0e0571e49dac2d921ebeb481e2f287253 100644 (file)
@@ -11,7 +11,7 @@ LIBRARY = System.Security.Principal.dll
 
 KEY_FILE = ../../msfinal.pub
 SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
-LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib.dll
+LIB_MCS_FLAGS = $(SIGN_FLAGS) 
 
 PLATFORM_DEBUG_FLAGS =
 
index fb949fbe07e8e40b7b59c5bb96cb2fac21b685f5..b33d20dc20261912e900021303cca36c3d41bda3 100644 (file)
@@ -12,7 +12,7 @@ LIBRARY = System.Security.SecureString.dll
 KEY_FILE = ../../msfinal.pub
 SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
 LIB_REFS = System
-LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib.dll
+LIB_MCS_FLAGS = $(SIGN_FLAGS) 
 
 PLATFORM_DEBUG_FLAGS =
 
index 90f55a71d5eb9168513708b07cc5fab8d7454c7a..a8f568f78b58b0c2fa004f9c5efa73db345a3b76 100644 (file)
@@ -12,7 +12,7 @@ LIBRARY = System.ServiceModel.Duplex.dll
 KEY_FILE = ../../msfinal.pub
 SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
 LIB_REFS = System.ServiceModel
-LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib.dll
+LIB_MCS_FLAGS = $(SIGN_FLAGS) 
 
 PLATFORM_DEBUG_FLAGS =
 
index 99587810c49caec9570c7cb6cde16120cc562fc1..05f7925c2c66740a9ee27f12489d9e2e73fc10a8 100644 (file)
@@ -12,7 +12,7 @@ LIBRARY = System.ServiceModel.Http.dll
 KEY_FILE = ../../msfinal.pub
 SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
 LIB_REFS = System.ServiceModel
-LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib.dll
+LIB_MCS_FLAGS = $(SIGN_FLAGS) 
 
 PLATFORM_DEBUG_FLAGS =
 
index c01e4819efb8fdd94d709a6ca49971c8854025d5..f0af8c7dc6088864b77f302a9f60619ba3cb9170 100644 (file)
@@ -12,7 +12,7 @@ LIBRARY = System.ServiceModel.NetTcp.dll
 KEY_FILE = ../../msfinal.pub
 SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
 LIB_REFS = System.ServiceModel
-LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib.dll
+LIB_MCS_FLAGS = $(SIGN_FLAGS) 
 
 PLATFORM_DEBUG_FLAGS =
 
index 6f94ff346f87c6ea87d72ee2e5b3f4f32e4d54d2..5f65e0599a30b14d256482f517c0ec7e66a5e4db 100644 (file)
@@ -12,7 +12,7 @@ LIBRARY = System.ServiceModel.Primitives.dll
 KEY_FILE = ../../msfinal.pub
 SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
 LIB_REFS = System.ServiceModel System.Xml
-LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib.dll
+LIB_MCS_FLAGS = $(SIGN_FLAGS) 
 
 PLATFORM_DEBUG_FLAGS =
 
index 4e572464aa800736c72743cc8eba12301c2bd2f7..f68beafd26e7bb4b12b0d47624ee46a3e4babc93 100644 (file)
@@ -12,7 +12,7 @@ LIBRARY = System.ServiceModel.Security.dll
 KEY_FILE = ../../msfinal.pub
 SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
 LIB_REFS = System.ServiceModel
-LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib.dll
+LIB_MCS_FLAGS = $(SIGN_FLAGS) 
 
 PLATFORM_DEBUG_FLAGS =
 
index 9025a6cd91d1f028b489d5f179ab64dd0975a0a7..2724a34a105c35861c75080253a8dbf96d954e99 100644 (file)
@@ -11,8 +11,8 @@ LIBRARY = System.ServiceProcess.ServiceController.dll
 
 KEY_FILE = ../../msfinal.pub
 SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
-LIB_REFS = System
-LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib.dll /r:System.ServiceProcess.dll
+LIB_REFS = System System.ServiceProcess
+LIB_MCS_FLAGS = $(SIGN_FLAGS)
 
 PLATFORM_DEBUG_FLAGS =
 
index 114132e3a0fed95137f758c3280942607c68be5d..e851968fdb46f4ea5872733d58708af28e99f521 100644 (file)
@@ -11,7 +11,7 @@ LIBRARY = System.Text.Encoding.Extensions.dll
 
 KEY_FILE = ../../msfinal.pub
 SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
-LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib.dll
+LIB_MCS_FLAGS = $(SIGN_FLAGS) 
 
 PLATFORM_DEBUG_FLAGS =
 
index aeb003f7bb8810403737dc41b4f80faef827224d..fdfff71849704bb266a05fbd0132cba0818a7080 100644 (file)
@@ -11,7 +11,7 @@ LIBRARY = System.Text.Encoding.dll
 
 KEY_FILE = ../../msfinal.pub
 SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
-LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib.dll
+LIB_MCS_FLAGS = $(SIGN_FLAGS) 
 
 PLATFORM_DEBUG_FLAGS =
 
index 423212c687c95c769db104d74301ac7e4648c234..b345b0d5dcd484cb273644a2f97f5527a1e15200 100644 (file)
@@ -12,7 +12,7 @@ LIBRARY = System.Text.RegularExpressions.dll
 KEY_FILE = ../../msfinal.pub
 SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
 LIB_REFS = System
-LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib.dll
+LIB_MCS_FLAGS = $(SIGN_FLAGS) 
 
 PLATFORM_DEBUG_FLAGS =
 
index 56cf986675d62aa503060f6c9a8578ddb6563781..b0c9264a03b466ee7b50290b3c4b12b5fb140b92 100644 (file)
@@ -12,7 +12,7 @@ LIBRARY = System.Threading.AccessControl.dll
 KEY_FILE = ../../msfinal.pub
 SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
 LIB_REFS = System
-LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib.dll
+LIB_MCS_FLAGS = $(SIGN_FLAGS) 
 
 PLATFORM_DEBUG_FLAGS =
 
index 29dbfe5e191a07be8389120ac3cde1845bb14299..460fb4aff26d042fd0beb0c5b8bb7cd8ced7eb27 100644 (file)
@@ -12,7 +12,7 @@ LIBRARY = System.Threading.Overlapped.dll
 KEY_FILE = ../../msfinal.pub
 SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
 LIB_REFS = System
-LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib.dll
+LIB_MCS_FLAGS = $(SIGN_FLAGS) 
 
 PLATFORM_DEBUG_FLAGS =
 
index 1f74d4934d3698e818a16092e451a4b49aa1be56..7e350f61c2acd2c8ae208c847eb2e76a22427d3d 100644 (file)
@@ -11,7 +11,7 @@ LIBRARY = System.Threading.Tasks.Parallel.dll
 
 KEY_FILE = ../../msfinal.pub
 SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
-LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib.dll
+LIB_MCS_FLAGS = $(SIGN_FLAGS) 
 
 PLATFORM_DEBUG_FLAGS =
 
index c89db2377a85d6f7038bd6d382659d0814225f88..deea2c66a8a2cb9ddec8ba6e75ffeb52203f6af2 100644 (file)
@@ -12,7 +12,7 @@ LIBRARY = System.Threading.Tasks.dll
 KEY_FILE = ../../msfinal.pub
 SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
 LIB_REFS = System.Core
-LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib.dll
+LIB_MCS_FLAGS = $(SIGN_FLAGS) 
 
 PLATFORM_DEBUG_FLAGS =
 
index 177e8890f9f3a4ae66a69b6c8bbeaf8ddd9e838a..cc0bb96aa06b08bbbfa65e9c5b331bafd5a80571 100644 (file)
@@ -12,7 +12,7 @@ LIBRARY = System.Threading.Thread.dll
 KEY_FILE = ../../msfinal.pub
 SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
 LIB_REFS = System
-LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib.dll
+LIB_MCS_FLAGS = $(SIGN_FLAGS) 
 
 PLATFORM_DEBUG_FLAGS =
 
index 67b0082be9eb45a7f2bc53ab978ac782134423b3..604a88c87e7065f9427cf4e430610963436abe7e 100644 (file)
@@ -12,7 +12,7 @@ LIBRARY = System.Threading.ThreadPool.dll
 KEY_FILE = ../../msfinal.pub
 SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
 LIB_REFS = System
-LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib.dll
+LIB_MCS_FLAGS = $(SIGN_FLAGS) 
 
 PLATFORM_DEBUG_FLAGS =
 
index 35df02e1825fa6abfa486350d6610baa3b9d6278..5ab3f8409016c7442859ec1cb18d8ebd38b8347e 100644 (file)
@@ -12,7 +12,7 @@ LIBRARY = System.Threading.Timer.dll
 KEY_FILE = ../../msfinal.pub
 SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
 LIB_REFS = System System.Core
-LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib.dll
+LIB_MCS_FLAGS = $(SIGN_FLAGS) 
 
 PLATFORM_DEBUG_FLAGS =
 
index 1982ff8384e9ea2d120a49c149c125271ca7e772..b6b5c4cd67b94f12e4fe086238d094da6917ff56 100644 (file)
@@ -12,7 +12,7 @@ LIBRARY = System.Threading.dll
 KEY_FILE = ../../msfinal.pub
 SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
 LIB_REFS = System System.Core
-LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib.dll
+LIB_MCS_FLAGS = $(SIGN_FLAGS) 
 
 PLATFORM_DEBUG_FLAGS =
 
index 373c1ff882e09ea5f2813bbb97da43f8a7131ae3..27f820f582efa014841e2520d00d2bf79d5fdd0d 100644 (file)
@@ -12,7 +12,7 @@ LIBRARY = System.Xml.ReaderWriter.dll
 KEY_FILE = ../../msfinal.pub
 SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
 LIB_REFS = System.Xml
-LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib.dll
+LIB_MCS_FLAGS = $(SIGN_FLAGS) 
 
 PLATFORM_DEBUG_FLAGS =
 
index e55fec5512e39b994298218c5a744dd2f42d218e..79eaaf4424997ed36fae1a6e2819ff5f82446db0 100644 (file)
@@ -12,7 +12,7 @@ LIBRARY = System.Xml.XDocument.dll
 KEY_FILE = ../../msfinal.pub
 SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
 LIB_REFS = System.Xml.Linq System.Xml
-LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib.dll
+LIB_MCS_FLAGS = $(SIGN_FLAGS) 
 
 PLATFORM_DEBUG_FLAGS =
 
index ee05487967b100037c597d31a989ec4f46ec68bc..45ffe3482e084120afd9a7685bf6684b584bee83 100644 (file)
@@ -11,8 +11,8 @@ LIBRARY = System.Xml.XPath.XDocument.dll
 
 KEY_FILE = ../../msfinal.pub
 SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
-LIB_REFS = System
-LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib.dll /r:System.Xml.Linq.dll
+LIB_REFS = System System.Xml.Linq
+LIB_MCS_FLAGS = $(SIGN_FLAGS)
 
 PLATFORM_DEBUG_FLAGS =
 
index 86a093ba7ad96381ac707493d035fec55368bf6d..7a7ebf6de9d82973eadd8dac53399cf398d5630f 100644 (file)
@@ -11,8 +11,8 @@ LIBRARY = System.Xml.XPath.dll
 
 KEY_FILE = ../../msfinal.pub
 SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
-LIB_REFS = System
-LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib.dll /r:System.Xml.dll
+LIB_REFS = System System.Xml
+LIB_MCS_FLAGS = $(SIGN_FLAGS)
 
 PLATFORM_DEBUG_FLAGS =
 
index 68224f9f25fc2ddfc202bae61e11053f3299cafe..8628579f2f12557479e7a490377ff041f4506371 100644 (file)
@@ -11,8 +11,8 @@ LIBRARY = System.Xml.XmlDocument.dll
 
 KEY_FILE = ../../msfinal.pub
 SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
-LIB_REFS = System
-LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib.dll /r:System.Xml.dll
+LIB_REFS = System System.Xml
+LIB_MCS_FLAGS = $(SIGN_FLAGS)
 
 PLATFORM_DEBUG_FLAGS =
 
index 3a1e1396f75e7777c6f502807a016ebdb931a45a..f8c09af8c35d9f2ceaf74aac97f3f9f0c2d6afa1 100644 (file)
@@ -12,7 +12,7 @@ LIBRARY = System.Xml.XmlSerializer.dll
 KEY_FILE = ../../msfinal.pub
 SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
 LIB_REFS = System.Xml
-LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib.dll
+LIB_MCS_FLAGS = $(SIGN_FLAGS) 
 
 PLATFORM_DEBUG_FLAGS =
 
index d038a8d5840d941fd48ecde2056776e6492a1beb..abddd14886e03137b45f4bc0b9b742496446bfcc 100644 (file)
@@ -11,8 +11,8 @@ LIBRARY = System.Xml.Xsl.Primitives.dll
 
 KEY_FILE = ../../msfinal.pub
 SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
-LIB_REFS = System
-LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib.dll /r:System.Xml.dll
+LIB_REFS = System System.Xml
+LIB_MCS_FLAGS = $(SIGN_FLAGS)
 
 PLATFORM_DEBUG_FLAGS =
 
index 9d6c885099cefc9977a2be3b657c859db4e1dcb5..e5b85c14f00e175c866a1a4669d514a8218accaa 100644 (file)
@@ -3,7 +3,9 @@ SUBDIRS =
 include ../../../build/rules.make
 
 LIBRARY = I18N.CJK.dll
-LOCAL_MCS_FLAGS = /unsafe /resource:big5.table /resource:gb2312.table /resource:jis.table /resource:ks.table /resource:gb18030.table /r:$(corlib) /r:I18N.dll /define:DISABLE_UNSAFE
+LIB_REFS = I18N
+LOCAL_MCS_FLAGS = /unsafe /resource:big5.table /resource:gb2312.table /resource:jis.table /resource:ks.table /resource:gb18030.table /define:DISABLE_UNSAFE
+TEST_LIB_REFS = I18N
 
 EXTRA_DISTFILES = big5.table jis.table gb2312.table ks.table gb18030.table \
        README.gb18030 \
index af1aa401cd540d337743de75df02a68dcde2a914..b68973bdc26d306d50fbd3015329e547b33519f3 100644 (file)
@@ -3,7 +3,7 @@ SUBDIRS =
 include ../../../build/rules.make
 
 LIBRARY = I18N.dll
-LOCAL_MCS_FLAGS = /r:$(corlib) /unsafe /define:DISABLE_UNSAFE
+LOCAL_MCS_FLAGS = /unsafe /define:DISABLE_UNSAFE
 NO_TEST = yes
 
 include ../../../build/library.make
index aafe245f6a451fb417b2830e9e16d9c69d73eafd..1872c831e58291d947e74991686bf28cee8764ff 100644 (file)
@@ -3,8 +3,9 @@ SUBDIRS =
 include ../../../build/rules.make
 
 LIBRARY = I18N.MidEast.dll
-LOCAL_MCS_FLAGS = /r:$(corlib) /r:I18N.dll /unsafe
-#NO_TEST = yes
+LIB_REFS = I18N
+LOCAL_MCS_FLAGS = /unsafe
+TEST_LIB_REFS = I18N
 
 EXTRA_DISTFILES = $(wildcard *.ucm) \
        $(wildcard Test/texts/*.txt)
index e5740f32cb6cd1d248e8c29e3887530fc4e02a3d..47fac195ad91e2e7fc8153446f289c74d2aa8260 100644 (file)
@@ -3,7 +3,8 @@ SUBDIRS =
 include ../../../build/rules.make
 
 LIBRARY = I18N.Other.dll
-LOCAL_MCS_FLAGS = /r:$(corlib) /r:I18N.dll /unsafe
+LIB_REFS = I18N
+LOCAL_MCS_FLAGS = /unsafe
 NO_TEST = yes
 
 EXTRA_DISTFILES = $(wildcard *.ucm)
index fd315cfce147139cbdb02f64a060a34320ce283a..f558e20e555a7ac67077770c20b82913d4743ef6 100644 (file)
@@ -3,7 +3,8 @@ SUBDIRS =
 include ../../../build/rules.make
 
 LIBRARY = I18N.Rare.dll
-LOCAL_MCS_FLAGS = /r:$(corlib) /r:I18N.dll /unsafe
+LIB_REFS = I18N
+LOCAL_MCS_FLAGS = /unsafe
 NO_TEST = yes
 
 EXTRA_DISTFILES = $(wildcard *.ucm)
index e8b7afe3d0732c1589f0ee5ab59e551a4a953cd5..bc4b2386188478bf070d57a2a90973b2a6b08cc7 100644 (file)
@@ -3,7 +3,8 @@ SUBDIRS =
 include ../../../build/rules.make
 
 LIBRARY = I18N.West.dll
-LOCAL_MCS_FLAGS = /r:$(corlib) /r:I18N.dll /unsafe
+LIB_REFS = I18N
+LOCAL_MCS_FLAGS = /unsafe
 #NO_TEST = yes
 
 EXTRA_DISTFILES = $(wildcard *.ucm) \
index 732087d903e16fd8ff8484e352dd2440285fe2e0..630df027785d0286fa1c729208e98a65a39d4a69 100644 (file)
@@ -4,7 +4,7 @@ include ../../build/rules.make
 
 LIBRARY = IBM.Data.DB2.dll
 LIB_REFS = System System.Xml System.Data
-LIB_MCS_FLAGS = /unsafe /r:$(corlib) -warn:1
+LIB_MCS_FLAGS = /unsafe -warn:1
 NO_TEST = yes
 
 EXTRA_DISTFILES = ibm.pub
index 6a4052c5577796fcaffcaae252c9f334c9244693..bd64d2a4d66c7b991e6609fc8547288ec40a3bd3 100644 (file)
@@ -6,7 +6,7 @@ LIBRARY = ICSharpCode.SharpZipLib.dll
 LIBRARY_SNK = SharpZipLib.key
 
 LIB_REFS = System System.Xml
-LIB_MCS_FLAGS = /r:$(corlib) -warn:1
+LIB_MCS_FLAGS = -warn:1
 NO_TEST = yes
 EXTRA_DISTFILES = SharpZipLib.pub $(LIBRARY_SNK)
 
index 47216dc7d240adcdc7aff86163e6c1514107b056..9aed81206542d94d4976f0974107b89d405a8e89 100644 (file)
@@ -7,38 +7,28 @@ include $(XBUILD_DIR)/xbuild.make
 
 LIBRARY = Microsoft.Build.Engine.dll
 
-LIB_REFS = System System.Core System.Xml
-LIB_MCS_FLAGS = \
-       /r:$(corlib)            \
-       /r:System.dll           \
-       /r:System.Core.dll      \
-       /r:System.Xml.dll       \
-       /r:$(XBUILD_FRAMEWORK)  \
-       /r:$(XBUILD_UTILITIES)
-
-TEST_MCS_FLAGS = \
-       /r:$(XBUILD_FRAMEWORK)  \
-       /r:$(XBUILD_UTILITIES) \
-       /r:System.Xml.dll
+LIB_REFS = $(PARENT_PROFILE)System $(PARENT_PROFILE)System.Core $(PARENT_PROFILE)System.Xml $(XBUILD_FRAMEWORK) $(XBUILD_UTILITIES)
+LIB_MCS_FLAGS =
+
+TEST_MCS_FLAGS =
+TEST_LIB_REFS = $(XBUILD_FRAMEWORK) $(XBUILD_UTILITIES) $(PARENT_PROFILE)System.Xml
 
 EXTRA_DISTFILES = \
        Test/resources/TestTasks.cs             \
        Test/resources/*.*proj  \
        Test/resources/*.csproj
 
-Test/resources/TestTasks-$(PROFILE).dll: Test/resources/TestTasks.cs
-       $(CSCOMPILE) /out:$@ Test/resources/TestTasks.cs /r:$(XBUILD_FRAMEWORK) /r:$(XBUILD_UTILITIES) /target:library
+CLEAN_FILES = Test/resources/TestTasks-$(PROFILE).dll Test/resources/TestTasks-$(PROFILE).dll.mdb Test/resources/TestTasks-$(PROFILE).pdb
 
-clean-test-resources:
-       rm -f Test/resources/TestTasks*.dll Test/resources/TestTasks*.dll.mdb
+Test/resources/TestTasks-$(PROFILE).dll: Test/resources/TestTasks.cs
+       $(CSCOMPILE) /out:$@ Test/resources/TestTasks.cs /r:$(topdir)/class/lib/$(PROFILE)/$(XBUILD_FRAMEWORK).dll /r:$(topdir)/class/lib/$(PROFILE)/$(XBUILD_UTILITIES).dll /target:library
 
 test-local: compile-resources
 
 compile-resources: Test/resources/TestTasks-$(PROFILE).dll
        cp Test/resources/TestTasks-$(PROFILE).dll Test/resources/TestTasks.dll
        cp Test/resources/TestTasks-$(PROFILE).dll.mdb Test/resources/TestTasks.dll.mdb
-
-clean-local: clean-test-resources
+#      cp Test/resources/TestTasks-$(PROFILE).pdb Test/resources/TestTasks.pdb
 
 include $(XBUILD_DIR)/xbuild_test.make
 include ../../build/library.make
index 779dc9e2fd40f9df98f2e3dfdc2ed60fb4817198..f31f5a5835ea5f0b8f33c7bdfc059a0490a3e8e9 100644 (file)
@@ -7,10 +7,8 @@ include $(XBUILD_DIR)/xbuild.make
 
 LIBRARY = Microsoft.Build.Framework.dll
 
-LIB_REFS = System
-LIB_MCS_FLAGS = \
-       /r:$(corlib)                            \
-       /r:System.dll
+LIB_REFS = $(PARENT_PROFILE)System
+LIB_MCS_FLAGS =
 
 EXTRA_DISTFILES = \
        Mono.XBuild.Framework/AssemblyLoadInfo.cs
index 66b74a847289a6e708a92bb23fa294d3cab2e4bf..d451c754e74471c627da9bbd3e6ffd86fd871a90 100644 (file)
@@ -9,28 +9,14 @@ LIBRARY = Microsoft.Build.Tasks.dll
 
 LIBRARY_NAME = Microsoft.Build.Tasks$(NAME_SUFFIX).dll
 
-LIB_REFS = System System.Core System.Xml System.Windows.Forms
-LIB_MCS_FLAGS = \
-       /r:$(corlib)                            \
-       /r:System.dll                           \
-       /r:System.Core.dll                      \
-       /r:System.Xml.dll                       \
-       /r:System.Windows.Forms.dll             \
-       /r:$(XBUILD_UTILITIES)                  \
-       /r:$(XBUILD_FRAMEWORK)                  \
-       /r:$(XBUILD_ENGINE)                     \
-       /r:$(XBUILD_TASKS)
-
-TEST_MCS_FLAGS = \
-       /r:System.Xml.dll                       \
-       /r:$(XBUILD_ENGINE)     \
-       /r:$(XBUILD_FRAMEWORK)  \
-       /r:$(XBUILD_TASKS)      \
-       /r:$(XBUILD_UTILITIES)                  \
-       /r:System.Core.dll
+LIB_REFS = $(PARENT_PROFILE)System $(PARENT_PROFILE)System.Core $(PARENT_PROFILE)System.Xml $(PARENT_PROFILE)System.Windows.Forms \
+                       $(XBUILD_UTILITIES) $(XBUILD_FRAMEWORK) $(XBUILD_ENGINE) $(XBUILD_TASKS)
+
+TEST_MCS_FLAGS =
+TEST_LIB_REFS = $(PARENT_PROFILE)System.Xml $(XBUILD_ENGINE) $(XBUILD_FRAMEWORK) $(XBUILD_TASKS) $(XBUILD_UTILITIES) $(PARENT_PROFILE)System.Core
 
 ifeq (4, $(FRAMEWORK_VERSION_MAJOR))
-       TEST_MCS_FLAGS += /r:Microsoft.Build.dll
+TEST_LIB_REFS += Microsoft.Build
 endif
 
 EXTRA_DISTFILES = \
@@ -41,7 +27,7 @@ EXTRA_DISTFILES = \
        Test/test-config-file*
 
 Test/resources/test.dll: Test/resources/test.cs
-       $(CSCOMPILE) -target:library Test/resources/test.cs
+       $(CSCOMPILE) -target:library /out:$@ $<
 
 clean-test-resources:
        rm -f Test/resources/test.dll
index 6fd7954ab42c949f141c90ef3aeeec886a16c22d..bb85df584df4eb0e8f41e58f61c9a855bacec375 100644 (file)
@@ -41,6 +41,8 @@ namespace Microsoft.Build.Tasks {
                ITaskItem[]     assignedProjects;
                string          solutionConfigurationContents;
                ITaskItem[]     unassignedProjects;
+               Dictionary<Guid, string> guidToConfigPlatform;
+               Dictionary<string, string> absolutePathToConfigPlatform;
        
                public AssignProjectConfiguration ()
                {
@@ -53,10 +55,10 @@ namespace Microsoft.Build.Tasks {
                                return true;
 
                        XmlReader xr = null;
-                       Dictionary<Guid, string> guidToConfigPlatform = null;
+                       guidToConfigPlatform = new Dictionary<Guid, string> ();
+                       absolutePathToConfigPlatform = new Dictionary<string, string> ();
                        try {
                                xr = XmlReader.Create (new StringReader (solutionConfigurationContents));
-                               guidToConfigPlatform = new Dictionary<Guid, string> ();
 
                                xr.Read ();
                                while (!xr.EOF) {
@@ -65,12 +67,20 @@ namespace Microsoft.Build.Tasks {
                                                continue;
 
                                        string guid_str = xr.GetAttribute ("Project");
+                                       string abs_path = xr.GetAttribute ("AbsolutePath");
                                        string config_str = xr.ReadString ();
 
+                                       if (String.IsNullOrEmpty (config_str))
+                                               continue;
+
                                        Guid guid;
-                                       if (!String.IsNullOrEmpty (guid_str) && !String.IsNullOrEmpty (config_str) &&
-                                               TryParseGuid (guid_str, out guid))
+                                       if (TryParseGuid (guid_str, out guid))
                                                guidToConfigPlatform [guid] = config_str;
+
+                                       if (!String.IsNullOrEmpty (abs_path)) {
+                                               abs_path = Path.GetFullPath (abs_path);
+                                               absolutePathToConfigPlatform [abs_path] = config_str;
+                                       }
                                }
                        } catch (XmlException xe) {
                                Log.LogError ("XmlException while parsing SolutionConfigurationContents: {0}",
@@ -84,32 +94,22 @@ namespace Microsoft.Build.Tasks {
                        List<ITaskItem> tempAssignedProjects = new List<ITaskItem> ();
                        List<ITaskItem> tempUnassignedProjects = new List<ITaskItem> ();
                        foreach (ITaskItem item in ProjectReferences) {
-                               string config;
-
-                               string guid_str = item.GetMetadata ("Project");
+                               string config = GetConfigPlatformFromProjectReference (item);
 
-                               Guid guid = Guid.Empty;
-                               if (!string.IsNullOrEmpty(guid_str) && !TryParseGuid (guid_str, out guid)) {
-                                       Log.LogError ("Project reference '{0}' has invalid or missing guid for metadata 'Project'.",
-                                                       item.ItemSpec);
-                                       return false;
+                               if (String.IsNullOrEmpty (config)) {
+                                       tempUnassignedProjects.Add (item);
+                                       continue;
                                }
 
-                               if (guid != Guid.Empty && guidToConfigPlatform.TryGetValue (guid, out config)) {
-                                       string [] parts = config.Split (new char [] {'|'}, 2);
+                               string [] parts = config.Split (new char [] {'|'}, 2);
 
-                                       ITaskItem new_item = new TaskItem (item);
+                               ITaskItem new_item = new TaskItem (item);
 
-                                       new_item.SetMetadata ("SetConfiguration", "Configuration=" + parts [0]);
-                                       new_item.SetMetadata ("SetPlatform", "Platform=" +
-                                                       ((parts.Length > 1) ? parts [1] : String.Empty));
+                               new_item.SetMetadata ("SetConfiguration", "Configuration=" + parts [0]);
+                               new_item.SetMetadata ("SetPlatform", "Platform=" +
+                                               ((parts.Length > 1) ? parts [1] : String.Empty));
 
-                                       tempAssignedProjects.Add (new_item);
-                               } else {
-                                       Log.LogWarning ("Project reference '{0}' could not be resolved.",
-                                                       item.ItemSpec);
-                                       tempUnassignedProjects.Add (item);
-                               }
+                               tempAssignedProjects.Add (new_item);
                        }
 
                        assignedProjects = tempAssignedProjects.ToArray ();
@@ -118,9 +118,29 @@ namespace Microsoft.Build.Tasks {
                        return true;
                }
 
+               string GetConfigPlatformFromProjectReference (ITaskItem item)
+               {
+                       string guid_str = item.GetMetadata ("Project");
+                       string proj_full_path = item.GetMetadata ("FullPath");
+
+                       string config;
+                       Guid guid = Guid.Empty;
+                       if (TryParseGuid (guid_str, out guid) && guidToConfigPlatform.TryGetValue (guid, out config))
+                               return config;
+
+                       string abs_path = item.GetMetadata ("FullPath");
+                       if (absolutePathToConfigPlatform.TryGetValue (abs_path, out config))
+                               return config;
+
+                       return null;
+               }
+
                bool TryParseGuid (string guid_str, out Guid guid)
                {
                        guid = Guid.Empty;
+                       if (String.IsNullOrEmpty (guid_str))
+                               return false;
+
                        try {
                                guid = new Guid (guid_str);
                        } catch (ArgumentNullException) {
index 2102d41c3f32708d5536d74f87741b8fb7acc8d9..9d759e09d9d5be9fd8a72b9326d19cfcee53253c 100644 (file)
@@ -185,7 +185,7 @@ namespace Microsoft.Build.Tasks
                        var cscParams = new CompilerParameters ();
                        cscParams.ReferencedAssemblies.Add ("Microsoft.Build.Framework.dll");
                        cscParams.ReferencedAssemblies.Add ("Microsoft.Build.Utilities.v4.0.dll"); // since we use Task, it depends on this dll.
-                       cscParams.ReferencedAssemblies.AddRange (references.ToArray ());
+                       cscParams.ReferencedAssemblies.AddRange (GetReferences (references, taskFactoryLoggingHost));
                        cscParams.GenerateInMemory = true;
                        var results = CodeDomProvider.CreateProvider (language).CompileAssemblyFromDom (cscParams, ccu);
                        var errors = new CompilerError [results.Errors.Count];
@@ -197,6 +197,36 @@ namespace Microsoft.Build.Tasks
                        assembly = results.CompiledAssembly;
                        return true;
                }
+
+               static string[] GetReferences (List<string> references, IBuildEngine log)
+               {
+                       var res = new List<string> ();
+                       foreach (var r in references) {
+                               if (File.Exists (r)) {
+                                       res.Add (r);
+                                       continue;
+                               }
+
+                               Assembly assembly = null;
+
+                               try {
+                                       if (!r.EndsWith (".dll", StringComparison.OrdinalIgnoreCase) || !r.EndsWith (".exe", StringComparison.OrdinalIgnoreCase)) {
+                                               assembly = Assembly.LoadWithPartialName (r);
+                                       }
+
+                                       if (assembly != null) {
+                                               res.Add (assembly.Location);
+                                               continue;
+                                       }
+                               } catch {
+                               }
+
+                               log.LogErrorEvent (new BuildErrorEventArgs ("", "", "", 0, 0, 0, 0, "Assembly reference {r} could not be resolved", "", ""));
+                       }
+
+                       return res.ToArray ();
+               }
+
                public string FactoryName {
                        get { return "Code Task Factory"; }
                }
index f7d25591a8ce8973f4046ed5dbb53331841463c1..be1ea2c0fb787a177fcd0c7f659e97df04b10427 100644 (file)
@@ -32,6 +32,7 @@ using Microsoft.Build.Framework;
 using Microsoft.Build.Tasks;
 using Microsoft.Build.Utilities;
 using NUnit.Framework;
+using System.IO;
 using System.Text;
 
 namespace MonoTests.Microsoft.Build.Tasks
@@ -58,22 +59,73 @@ namespace MonoTests.Microsoft.Build.Tasks
                                "{DAE34193-B5C7-4488-A911-29EE15C84CBE}"
                        };
 
-                       CreateAndCheckProject (guids, project_ref_guids, new string[] {
-                                       "AssignedProjects : foo0.csproj;foo1.csproj;foo2.csproj;foo3.csproj: SetConfig: Configuration=Release",
+                       CreateAndCheckProject (guids, new bool[] {true, true, true, true, true, true},
+                                       project_ref_guids, new string[] {
+                                       "AssignedProjects : foo0.csproj;foo1.csproj;foo2.csproj;foo3.csproj;foo4.csproj: SetConfig: Configuration=Release",
                                        "AssignedProjects : foo0.csproj: SetPlatform: Platform=AnyCPU0",
                                        "AssignedProjects : foo1.csproj: SetPlatform: Platform=AnyCPU1",
                                        "AssignedProjects : foo2.csproj: SetPlatform: Platform=AnyCPU2",
                                        "AssignedProjects : foo3.csproj: SetPlatform: Platform=AnyCPU3",
-                                       "UnassignedProjects : foo4.csproj"},
+                                       "AssignedProjects : foo4.csproj: SetPlatform: Platform=AnyCPU4",
+                                       "UnassignedProjects : "},
                                        true,
                                         "A1#");
                }
 
                [Test]
-               public void TestInvalidProjectGuid ()
+               public void TestNoGuidAndNoAbsolutePathFound()
                {
                        string[] guids = new string[] {
+                               "asd"
+                       };
+
+                       string[] project_ref_guids = new string[] {
+                               "{DAE34193-B5C7-4488-A911-29EE15C84CB8}",
+                               "invalid guid",
+                               ""
+                       };
+
+                       CreateAndCheckProject (guids, new bool[]{false},
+                                       project_ref_guids,
+                                       new string[] {
+                                               "AssignedProjects : : SetConfig: ",
+                                               "AssignedProjects : : SetPlatform: ",
+                                               "UnassignedProjects : foo0.csproj;foo1.csproj;foo2.csproj"
+                                       },
+                                       true, "A1#");
+               }
+
+               [Test]
+               public void TestInvalidProjectGuidWithAbsolutePath ()
+               {
+                       string[] guids = new string[] {
+                               null, // no AbsPath
+                               "another invalid guid", // has AbsPath
+                       };
+
+                       string[] project_ref_guids = new string[] {
+                               "1234zxc", // this won't match because no AbsPath
+                               "xzxoiu",  // match with the second project, foo1.csproj
                                "{23F291D9-78DF-4133-8CF2-78CE104DDE63}",
+                               "badref"   // no corresponding project at all
+                       };
+
+                       CreateAndCheckProject (guids, new bool[]{false, true},
+                                       project_ref_guids,
+                                       new string[] {
+                                               "AssignedProjects : foo1.csproj: SetConfig: Configuration=Release",
+                                               "AssignedProjects : foo1.csproj: SetPlatform: Platform=AnyCPU1",
+                                               "UnassignedProjects : foo0.csproj;foo2.csproj;foo3.csproj"
+                                       },
+                                       true, "A1#");
+               }
+
+               [Test]
+               public void TestNoGuidWithAbsolutePath ()
+               {
+                       string[] guids = new string[] {
+                               "",
+                               null
                        };
 
                        string[] project_ref_guids = new string[] {
@@ -82,7 +134,14 @@ namespace MonoTests.Microsoft.Build.Tasks
                                "invalid guid"
                        };
 
-                       CreateAndCheckProject (guids, project_ref_guids, null, false, "A1#");
+                       CreateAndCheckProject (guids, new bool[]{true, false},
+                                       project_ref_guids,
+                                       new string[] {
+                                               "AssignedProjects : foo0.csproj: SetConfig: Configuration=Release",
+                                               "AssignedProjects : foo0.csproj: SetPlatform: Platform=AnyCPU0",
+                                               "UnassignedProjects : foo1.csproj;foo2.csproj"
+                                       },
+                                       true, "A1#");
                }
 
                [Test]
@@ -97,7 +156,8 @@ namespace MonoTests.Microsoft.Build.Tasks
                                "{23F291D9-78DF-4133-8CF2-78CE104DDE63}"
                        };
 
-                       CreateAndCheckProject (guids, project_ref_guids,
+                       CreateAndCheckProject (guids, new bool[]{false, true},
+                               project_ref_guids,
                                new string [] {
                                        "AssignedProjects : foo1.csproj: SetConfig: Configuration=Release",
                                        "AssignedProjects : foo1.csproj: SetPlatform: Platform=AnyCPU0",
@@ -106,14 +166,14 @@ namespace MonoTests.Microsoft.Build.Tasks
                }
 
 
-               void CreateAndCheckProject (string[] guids, string[] project_ref_guids, string[] messages, bool build_result, string prefix)
+               void CreateAndCheckProject (string[] guids, bool[] set_project_paths, string[] project_ref_guids, string[] messages, bool build_result, string prefix)
                {
                        Engine engine = new Engine (Consts.BinPath);
                        Project project = engine.CreateNewProject ();
                        TestMessageLogger testLogger = new TestMessageLogger ();
                        engine.RegisterLogger (testLogger);
 
-                       string projectString = CreateProject (guids, project_ref_guids);
+                       string projectString = CreateProject (guids, set_project_paths, project_ref_guids);
                        project.LoadXml (projectString);
 
                        try {
@@ -131,12 +191,12 @@ namespace MonoTests.Microsoft.Build.Tasks
                        }
                }
 
-               string CreateProject (string[] guids, string[] project_ref_guids)
+               string CreateProject (string[] guids, bool[] set_project_paths, string[] project_ref_guids)
                {
                        StringBuilder sb = new StringBuilder ();
                        sb.Append (@"<Project xmlns=""http://schemas.microsoft.com/developer/msbuild/2003"">");
                        sb.Append ("\n" + GetUsingTask ("AssignProjectConfiguration"));
-                       sb.AppendFormat (@"<PropertyGroup>{0}</PropertyGroup>", CreateSolutionConfigurationProperty (guids, "Release|AnyCPU"));
+                       sb.AppendFormat (@"<PropertyGroup>{0}</PropertyGroup>", CreateSolutionConfigurationProperty (guids, set_project_paths, "Release|AnyCPU"));
                        sb.Append (CreateProjectReferencesItemGroup (project_ref_guids));
 
                        sb.Append ("\n\t<Target Name=\"1\">\n");
@@ -154,13 +214,19 @@ namespace MonoTests.Microsoft.Build.Tasks
                        return sb.ToString ();
                }
 
-               string CreateSolutionConfigurationProperty (string[] guids, string config_str)
+               string CreateSolutionConfigurationProperty (string[] guids, bool[] set_project_paths, string config_str)
                {
+                       string abs_proj_path_prefix = Path.GetFullPath ("foo");
                        StringBuilder sb = new StringBuilder ();
                        sb.Append ("\n<CurrentSolutionConfigurationContents>\n");
                                sb.Append ("\t<foo xmlns=\"\">\n");
                                for (int i = 0; i < guids.Length; i++) {
-                                       sb.AppendFormat ("\t\t<bar Project=\"{0}\">{1}{2}</bar>\n",
+                                       sb.Append ("\t\t<bar");
+                                       if (guids[i] != null)
+                                               sb.AppendFormat (" Project=\"{0}\"", guids[i]);
+                                       if (set_project_paths[i])
+                                               sb.AppendFormat (" AbsolutePath=\"{0}{1}.csproj\" ", abs_proj_path_prefix, i);
+                                       sb.AppendFormat (">{1}{2}</bar>\n",
                                                guids[i], config_str, i);
                                }
                                sb.Append ("\t</foo>\n");
@@ -173,8 +239,12 @@ namespace MonoTests.Microsoft.Build.Tasks
                {
                        StringBuilder sb = new StringBuilder ();
                        sb.Append ("\n<ItemGroup>\n");
-                       for (int i = 0; i < guids.Length; i ++)
-                               sb.AppendFormat ("\t<ProjectReference Include=\"foo{1}.csproj\"><Project>{0}</Project></ProjectReference>\n", guids [i], i);
+                       for (int i = 0; i < guids.Length; i ++) {
+                               sb.AppendFormat ("\t<ProjectReference Include=\"foo{0}.csproj\">", i);
+                               if (guids[i] != null)
+                                       sb.AppendFormat ("<Project>{0}</Project>", guids[i]);
+                               sb.Append ("</ProjectReference>\n");
+                       }
                        sb.Append ("</ItemGroup>\n");
                        return sb.ToString ();
                }
index e44bbc2fe80a85d6b9b06961e073b20b66097b3a..10ef6780d4af6caf04ee40b279df2c40a3915ad6 100644 (file)
@@ -8,17 +8,13 @@ include $(XBUILD_DIR)/xbuild.make
 LIBRARY = Microsoft.Build.Utilities.dll
 LIBRARY_NAME = Microsoft.Build.Utilities$(NAME_SUFFIX).dll
 
-LIB_REFS = System System.Core System.Xml
-LIB_MCS_FLAGS = \
-       /r:$(corlib)                            \
-       /r:System.dll                           \
-       /r:System.Core.dll                      \
-       /r:System.Xml.dll                       \
-       /r:$(XBUILD_FRAMEWORK)
+LIB_REFS = $(PARENT_PROFILE)System $(PARENT_PROFILE)System.Core $(PARENT_PROFILE)System.Xml $(XBUILD_FRAMEWORK)
+LIB_MCS_FLAGS =
 
 TEST_RESX_RESOURCES = Test/Microsoft.Build.Utilities/Strings.resources
 
-TEST_MCS_FLAGS = /r:$(XBUILD_ENGINE) /r:$(XBUILD_FRAMEWORK) -r:System.dll -r:System.Core.dll $(TEST_RESX_RESOURCES:%=-resource:%)
+TEST_LIB_REFS = $(XBUILD_ENGINE) $(XBUILD_FRAMEWORK) $(PARENT_PROFILE)System $(PARENT_PROFILE)System.Core
+TEST_MCS_FLAGS = $(TEST_RESX_RESOURCES:%=-resource:%)
 
 include $(XBUILD_DIR)/xbuild_test.make
 include ../../build/library.make
@@ -27,6 +23,8 @@ EXTRA_DISTFILES = $(TEST_RESX_RESOURCES:.resources=.resx)
 
 CLEAN_FILES += $(TEST_RESX_RESOURCES)
 
+.NOTPARALLEL: $(TEST_RESX_RESOURCES)
+
 $(TEST_RESX_RESOURCES): %.resources: %.resx
        $(RESGEN) $< || cp $@.prebuilt $@
 
index 68cd09eb0431b5ef865d8b5197a966ec6e25834a..933782ff268b64d48a5d746d2223c93ffee7d39c 100644 (file)
@@ -7,18 +7,12 @@ include $(XBUILD_DIR)/xbuild.make
 
 LIBRARY = Microsoft.Build.dll
 
-LIB_REFS = System System.Core System.Xml Microsoft.Build.Engine Microsoft.Build.Framework
+LIB_REFS = $(PARENT_PROFILE)System $(PARENT_PROFILE)System.Core $(PARENT_PROFILE)System.Xml Microsoft.Build.Engine Microsoft.Build.Framework
 LIB_MCS_FLAGS = \
-       /r:$(corlib)                            \
-       /r:System.dll                           \
-       /r:System.Core.dll                      \
-       /r:System.Xml.dll                       \
-       /r:Microsoft.Build.Engine.dll           \
-       /r:Microsoft.Build.Framework.dll        \
        /d:MICROSOFT_BUILD_DLL
        
-TEST_MCS_FLAGS = $(LIB_MCS_FLAGS) \
-       /r:Microsoft.Build.Utilities.v4.0.dll
+TEST_MCS_FLAGS = $(LIB_MCS_FLAGS)
+TEST_LIB_REFS = $(XBUILD_UTILITIES)
 
 EXTRA_DISTFILES = \
        Microsoft.Build.Internal/ExpressionParser.jay   \
index 4110234a9803d8022b090bc1c2b724fac5825921..5d38210947f1d5370be2d19a2b626f56450c890e 100644 (file)
@@ -4,7 +4,7 @@ include ../../build/rules.make
 
 LIBRARY = Microsoft.VisualC.dll
 LIB_REFS = System
-LIB_MCS_FLAGS = /r:$(corlib)
+LIB_MCS_FLAGS =
 NO_TEST = yes
 
 include ../../build/library.make
index 71430e729329903df359647cba9950ff227dd722..c5f80e37114cd2d05a90a1ff92d7ee561a8d1422 100644 (file)
@@ -5,7 +5,7 @@ include ../../build/rules.make
 LIBRARY = Mono.C5.dll
 LIBRARY_SNK = c5.snk
 LIB_REFS = System
-LIB_MCS_FLAGS = /r:$(corlib) -nowarn:169,219,414,1030,3001,3005,3006
+LIB_MCS_FLAGS = -nowarn:169,219,414,1030,3001,3005,3006
 TEST_MCS_FLAGS = $(LIB_MCS_FLAGS) -nowarn:0618 -nowarn:219 -nowarn:169
 
 EXTRA_DISTFILES = \
index 485639075e7f768ebcd5b7863de682bfde32addd..2e7e70305ae1fb4a30d1cde3eaaa3d8c3fc5dd65 100644 (file)
@@ -47,7 +47,7 @@ using System.Runtime.CompilerServices;
 // You can specify all the values or you can default the Revision and Build Numbers 
 // by using the '*' as shown below:
 
-[assembly: AssemblyVersion("1.0.*")]
+[assembly: AssemblyVersion("1.0.0.0")]
 
 //
 // In order to sign your assembly you must specify a key to use. Refer to the 
index 5fe1a18705aa43e4600800f4ed850a216c73066b..d2ed176601d823af3053fa2f8ff4e6b6df0bf2b6 100644 (file)
@@ -15,9 +15,14 @@ ifndef NO_THREAD_ABORT
 REFERENCE_SOURCES_FLAGS += -d:MONO_FEATURE_THREAD_ABORT
 endif
 
-TEST_MCS_FLAGS = -r:System.Core.dll
+TEST_MCS_FLAGS =
+TEST_LIB_REFS = System.Core
 
 LIB_MCS_FLAGS += $(REFERENCE_SOURCES_FLAGS)
 
 include ../../build/library.make
 
+$(topdir)/mcs/cs-parser.cs:
+       $(MAKE) -C $(topdir)/mcs cs-parser.cs
+
+$(the_lib): $(topdir)/mcs/cs-parser.cs
index 70c759c1dab476f0ef70911f277f800221112e34..50357a7903d865a25d955aab0bb58912503f66da 100644 (file)
@@ -6,7 +6,7 @@ LIBRARY_SNK = ../mono.snk
 LIBRARY_PACKAGE = none
 
 LIB_REFS = System Mono.Cecil
-LIB_MCS_FLAGS = /r:$(corlib) /d:CECIL -keyfile:$(LIBRARY_SNK)
+LIB_MCS_FLAGS = /d:CECIL -keyfile:$(LIBRARY_SNK) -publicsign
 
 NO_TEST = yes
 NO_INSTALL = yes
index 790a21809ff02d6f977e5425d24e9289b163a4c8..53aee64f34a11535ec3a8a6bcd875bbba40e0cbf 100644 (file)
@@ -6,7 +6,7 @@ LIBRARY_SNK = ../mono.snk
 LIBRARY_PACKAGE = none
 
 LIB_REFS = System.Core
-LIB_MCS_FLAGS = /r:$(corlib) -keyfile:$(LIBRARY_SNK) -d:NET_3_5
+LIB_MCS_FLAGS = -keyfile:$(LIBRARY_SNK) -d:NET_3_5 /publicsign
 
 NO_TEST = yes
 
index 92a7619d1049ab94c9d42dcd5187db0d9cedae9e..b5e733dbcd989bf7ace531e2e599ce868a1d40a4 100644 (file)
@@ -6,8 +6,8 @@ LIBRARY = Mono.CodeContracts.dll
 
 LIB_REFS = System System.Core Mono.Cecil Mono.Cecil.Mdb
 LIB_MCS_FLAGS =
-#-r:Mono.Cecil.Pdb.dll
 
-TEST_MCS_FLAGS = -r:System.Core.dll -debug
+TEST_MCS_FLAGS =
+TEST_LIB_REFS = System.Core
 
 include ../../build/library.make
index 4f6cc0ca353c6e4f1a798b176a7b3fb68f2031ed..f1764c2282bff00b3e63a2fbdf97489cb93e5f22 100644 (file)
@@ -4,8 +4,9 @@ include ../../build/rules.make
 
 LIBRARY = Mono.Data.Tds.dll
 LIB_REFS = System System.Xml Mono.Security
-LIB_MCS_FLAGS = /r:$(corlib)
+LIB_MCS_FLAGS =
 
-TEST_MCS_FLAGS = /r:System.dll /r:System.Net.dll 
+TEST_MCS_FLAGS =
+TEST_LIB_REFS = System System.Net 
 
 include ../../build/library.make
index 659cf71668e2ae51c6e6846d8730e97ce77b1de8..d92fb61f8a9b42622bb75b7adf1437104e2833da 100644 (file)
@@ -5,9 +5,10 @@ LIBRARY = Mono.Debugger.Soft.dll
 LIBRARY_SNK = ../mono.snk
 
 LIB_REFS = System Mono.Cecil System.Core
-LIB_MCS_FLAGS = /r:$(corlib) /unsafe -D:MONO_DATACONVERTER_STATIC_METHODS -keyfile:$(LIBRARY_SNK)
+LIB_MCS_FLAGS = /unsafe -D:MONO_DATACONVERTER_STATIC_METHODS -keyfile:$(LIBRARY_SNK) /publicsign
 
-TEST_MCS_FLAGS = /r:Mono.Cecil.dll /r:System.dll /r:System.Core.dll
+TEST_MCS_FLAGS =
+TEST_LIB_REFS = Mono.Cecil System System.Core
 
 VALID_TEST_PROFILE := $(filter net_4_x, $(PROFILE))
 
@@ -17,7 +18,7 @@ ifdef VALID_TEST_PROFILE
 test-local: dtest-app.exe dtest-excfilter.exe
 
 dtest-app.exe: Test/dtest-app.cs
-       $(CSCOMPILE) -out:$@ -unsafe -debug -optimize- Test/dtest-app.cs
+       $(CSCOMPILE) -r:$(topdir)/class/lib/$(PROFILE)/System.Core.dll -r:$(topdir)/class/lib/$(PROFILE)/System.dll -out:$@ -unsafe $(PLATFORM_DEBUG_FLAGS) -optimize- Test/dtest-app.cs
 
 dtest-excfilter.exe: Test/dtest-excfilter.il
        MONO_PATH=$(topdir)/class/lib/$(PROFILE) $(INTERNAL_ILASM) -out:$@ /exe /debug Test/dtest-excfilter.il
@@ -29,7 +30,7 @@ check:
 
 endif
 
-CLEAN_FILES = dtest-app.exe dtest-app.exe.mdb dtest-excfilter.exe dtest-excfilter.exe.mdb
+CLEAN_FILES = dtest-app.exe dtest-app.exe.mdb dtest-app.pdb dtest-excfilter.exe dtest-excfilter.exe.mdb dtest-excfilter.pdb
 
 EXTRA_DISTFILES = \
        Test/dtest-app.cs \
index 919f24f0d62cc6c6d81d6cae14996cd8805c73cf..040a1801e1c29afd53171d01eb1a6e6cb9796542 100644 (file)
@@ -4,6 +4,6 @@ include ../../build/rules.make
 
 LIBRARY = Mono.Directory.LDAP.dll
 LIB_REFS = System System.Data
-LIB_MCS_FLAGS = /r:$(corlib)
+LIB_MCS_FLAGS =
 
 include ../../build/library.make
index 903006b49b56052e2c2ad929f63327c4ff43e085..6d9565ccbeec7bcc54cb52a404691fa3c3ee9a05 100644 (file)
@@ -4,7 +4,7 @@ include ../../build/rules.make
 
 LIBRARY = Mono.Dynamic.Interpreter.dll
 
-LIB_REFS = System System.Core
+LIB_REFS = System
 LIB_MCS_FLAGS = \
        -d:FEATURE_CORE_DLR,FEATURE_DBNULL,FEATURE_DEFAULT_PARAMETER_VALUE,FEATURE_GET_TYPE_INFO,FEATURE_VARIANCE,FEATURE_SERIALIZATION,CLR45 \
        -d:MONO_INTERPRETER \
@@ -12,7 +12,9 @@ LIB_MCS_FLAGS = \
 
 ifdef MOBILE_STATIC
 mono_dynamic_interpreter_deps = $(the_libdir_base)plaincore/System.Core.dll
-LIB_MCS_FLAGS += -lib:$(the_libdir_base)plaincore
+LIB_REFS += plaincore/System.Core
+else
+LIB_REFS += System.Core
 endif
 
 include ../../build/library.make
index d52144b2154268ec3c8b3322bd9816967b29b33e..f3801411afa27024cb3d2cb3624f384c2d951fa8 100644 (file)
@@ -4,8 +4,7 @@ include ../../build/rules.make
 
 LIBRARY = Mono.Http.dll
 LIB_REFS = System System.Xml System.Web ICSharpCode.SharpZipLib Mono.Security
-LIB_MCS_FLAGS = -r:$(corlib) \
-               -nowarn:618
+LIB_MCS_FLAGS = -nowarn:618
 
 NO_TEST = yes
 
index c4a97a86a898fc9bd75931f24356566facc105f3..5b7c92c5e4d83a7d3474efdee4fac9bf7e0722e9 100644 (file)
@@ -5,7 +5,7 @@ include ../../build/rules.make
 LIBRARY = Mono.Management.dll
 
 LIB_REFS = System Mono.Posix
-LIB_MCS_FLAGS = /r:$(corlib)
+LIB_MCS_FLAGS =
 NO_TEST = yes
 
 include ../../build/library.make
index d07fee59e7e9e17fe03a716395fe8728ee7aec4c..67f382812d8c76d0d99be3a27a3070dd84cd578e 100644 (file)
@@ -6,8 +6,8 @@ LIBRARY = Mono.Messaging.RabbitMQ.dll
 LIB_REFS = System System.Messaging Mono.Messaging RabbitMQ.Client
 LIB_MCS_FLAGS = -nowarn:618
 
-TEST_MCS_FLAGS = $(LIB_MCS_FLAGS) -nowarn:0618 -nowarn:219 -nowarn:169 \
-       /r:nunit.mocks.dll
+TEST_MCS_FLAGS = $(LIB_MCS_FLAGS) -nowarn:0618 -nowarn:219 -nowarn:169
+TEST_LIB_REFS = nunit.mocks
 
 include ../../build/library.make
 
index a2e3fbf7b44c30cd95a8f1e5c5f9aa3048a314f6..7788dfb60c89ec9946a89124b1f377312d4edd94 100644 (file)
@@ -7,6 +7,7 @@ LIBRARY = Mono.Messaging.dll
 LIB_REFS = System System.Configuration
 LIB_MCS_FLAGS =
 
-TEST_MCS_FLAGS = $(LIB_MCS_FLAGS) -nowarn:0618 -nowarn:219 -nowarn:169 /r:System.Messaging.dll /r:nunit.mocks.dll
+TEST_MCS_FLAGS = $(LIB_MCS_FLAGS) -nowarn:0618 -nowarn:219 -nowarn:169
+TEST_LIB_REFS = System.Messaging nunit.mocks
 
 include ../../build/library.make
index beee719c77f79c11e661f5b6f74856321a674e55..2fb4724b28123360a10f265cb35ae4fe5ce77153 100644 (file)
@@ -8,8 +8,9 @@ LIBRARY_PACKAGE = none
 NO_INSTALL = yes
 
 LIB_REFS = System
-LIB_MCS_FLAGS = /r:$(corlib)
-TEST_MCS_FLAGS = /r:Mono.Posix.dll /r:System.dll /r:System.Core.dll
+LIB_MCS_FLAGS =
+TEST_MCS_FLAGS =
+TEST_LIB_REFS = Mono.Posix System System.Core
 
 mono_sourcelibs_DIR  = $(DESTDIR)$(mono_libdir)/mono-source-libs
 mono_options_DATA = Mono.Options/Options.cs
index 23ee99324e85eb9dbcd3c37be7d7c63f4c6857dd..05810c39481db0174ff22f0c42d2954b5b044195 100644 (file)
@@ -477,7 +477,10 @@ namespace Mono.Options
                        try {
                                if (value != null) {
 #if PCL
-                                       t = (T) Convert.ChangeType (value, targetType);
+                                       if (targetType.GetTypeInfo ().IsEnum)
+                                               t = (T) Enum.Parse (targetType, value, true);
+                                       else
+                                               t = (T) Convert.ChangeType (value, targetType);
 #else
                                        TypeConverter conv = TypeDescriptor.GetConverter (targetType);
                                        t = (T) conv.ConvertFromString (value);
index a66f278498940c738b2202433d589db2f4c798f0..572223ebd667110f30f7aa6dd013693c351b4180 100644 (file)
@@ -269,6 +269,26 @@ namespace MonoTests.Mono.Options
                                        p, v => { v.Parse (_("-n=")); });
                }
 
+               [Test]
+               public void EnumValues ()
+               {
+                       DayOfWeek a = 0;
+                       OptionSet p = new OptionSet () {
+                               { "a=", (DayOfWeek v) => a = v },
+                       };
+                       p.Parse (_ ("-a=Monday"));
+                       Assert.AreEqual (a, DayOfWeek.Monday);
+                       p.Parse (_ ("-a=tuesday"));
+                       Assert.AreEqual (a, DayOfWeek.Tuesday);
+                       p.Parse (_ ("-a=3"));
+                       Assert.AreEqual (a, DayOfWeek.Wednesday);
+                       p.Parse (_ ("-a=Monday,Tuesday"));
+                       Assert.AreEqual (a, DayOfWeek.Monday | DayOfWeek.Tuesday);
+                       Utils.AssertException (typeof (OptionException),
+                                       "Could not convert string `Noday' to type DayOfWeek for option `-a'.",
+                                       p, v => { v.Parse (_ ("-a=Noday")); });
+               }
+
                [Test]
                public void BooleanValues ()
                {
index e2f587ed5e6b7ece3c9dcc9aaade968855c36736..75b5aff640be5ba18b2bd66e09a27292166e1f0e 100644 (file)
@@ -6,7 +6,8 @@ LIBRARY = Mono.Parallel.dll
 
 include ../../build/library.make
 
-TEST_MCS_FLAGS = /r:System.Core.dll
+TEST_MCS_FLAGS =
+TEST_LIB_REFS = System.Core
 
 LIB_REFS += System.Core System
-LIB_MCS_FLAGS += -d:INSIDE_MONO_PARALLEL -r:$(corlib)
+LIB_MCS_FLAGS += -d:INSIDE_MONO_PARALLEL
index 9cde3498e4d17dde9a74721a7ad9a25052da0ec4..10d14fc45edf0aee2674b538db53dcf7fefb8274 100644 (file)
@@ -6,8 +6,9 @@ LIBRARY = Mono.Posix.dll
 # Don't warn about [Obsolete] members, as there are now *lots* of [Obsolete]
 # members, generating volumes of output.
 LIB_REFS = System
-LIB_MCS_FLAGS = /unsafe /r:$(corlib) /nowarn:0618,612
-TEST_MCS_FLAGS = /unsafe /r:Mono.Posix.dll /r:System.dll /nowarn:0219,0618
+LIB_MCS_FLAGS = /unsafe /nowarn:0618,612
+TEST_MCS_FLAGS = /unsafe /nowarn:0219,0618
+TEST_LIB_REFS = Mono.Posix System
 
 LIBRARY_COMPILE = $(BOOT_COMPILE)
 
index a5f641229e46c52357d9af322f91e043b5f52272..54270bccc55d7dba50f4b2fb1d7cc47860e41135 100644 (file)
@@ -3,8 +3,8 @@ SUBDIRS =
 include ../../build/rules.make
 
 LIBRARY = Mono.Security.Providers.NewTls.dll
-LIB_MCS_FLAGS = -unsafe -nowarn:1030 -keyfile:../mono.pub -delaysign -r:System.dll \
-       -r:NewSystemSource=Mono.Security.Providers.NewSystemSource.dll -r:Mono.Security.dll
+LIB_REFS = System NewSystemSource=Mono.Security.Providers.NewSystemSource Mono.Security
+LIB_MCS_FLAGS = -unsafe -nowarn:1030 -keyfile:../mono.pub -delaysign
 
 include ../../build/library.make
 
index 55e17aad73d7012b058a7295e29c9a4e050974f4..b5bf191148e12eb7995fa6f6b1ebbddc328ce77e 100644 (file)
@@ -70,3 +70,4 @@ using System.Runtime.InteropServices;
 [assembly: InternalsVisibleTo ("Mono.Security.Providers.OldTls, PublicKey=002400000480000094000000060200000024000052534131000400000100010079159977d2d03a8e6bea7a2e74e8d1afcc93e8851974952bb480a12c9134474d04062447c37e0e68c080536fcf3c3fbe2ff9c979ce998475e506e8ce82dd5b0f350dc10e93bf2eeecf874b24770c5081dbea7447fddafa277b22de47d6ffea449674a4f9fccf84d15069089380284dbdd35f46cdff12a1bd78e4ef0065d016df")]
 [assembly: InternalsVisibleTo ("Mono.Security.Providers.DotNet, PublicKey=002400000480000094000000060200000024000052534131000400000100010079159977d2d03a8e6bea7a2e74e8d1afcc93e8851974952bb480a12c9134474d04062447c37e0e68c080536fcf3c3fbe2ff9c979ce998475e506e8ce82dd5b0f350dc10e93bf2eeecf874b24770c5081dbea7447fddafa277b22de47d6ffea449674a4f9fccf84d15069089380284dbdd35f46cdff12a1bd78e4ef0065d016df")]
 [assembly: InternalsVisibleTo ("Mono.Security.Providers.NewSystemSource, PublicKey=002400000480000094000000060200000024000052534131000400000100010079159977d2d03a8e6bea7a2e74e8d1afcc93e8851974952bb480a12c9134474d04062447c37e0e68c080536fcf3c3fbe2ff9c979ce998475e506e8ce82dd5b0f350dc10e93bf2eeecf874b24770c5081dbea7447fddafa277b22de47d6ffea449674a4f9fccf84d15069089380284dbdd35f46cdff12a1bd78e4ef0065d016df")]
+[assembly: InternalsVisibleTo ("Xamarin.BoringTls, PublicKey=002400000480000094000000060200000024000052534131000400001100000099dd12eda85767ae6f06023ee28e711c7e5a212462095c83868c29db75eddf6d8e296e03824c14fedd5f55553fed0b6173be3cc985a4b7f9fb7c83ccff8ba3938563b3d1f45a81122f12a1bcb73edcaad61a8456c7595a6da5184b4dd9d10f011b949ef1391fccfeab1ba62aa51c267ef8bd57ef1b6ba5a4c515d0badb81a78f")]
index 8a873fa9a47f0ca2085f41ca0a1e712ce04a1b3b..30d065aa304cc991dcee3e0a1482a3ebf4784333 100644 (file)
@@ -4,7 +4,7 @@ include ../../build/rules.make
 
 LIBRARY = Mono.Security.dll
 LOCAL_MCS_FLAGS = -lib:$(the_libdir_base)bare
-LIB_REFS = System
+LIB_REFS = bare/System
 LIB_MCS_FLAGS = -unsafe -nowarn:1030,3009
 TEST_MCS_FLAGS = $(LIB_MCS_FLAGS) -nowarn:169,219,618,672
 
index fc901084a7033bd84d08cd41e36590e0e52179b8..561e7888db7d1dc1162964c83b88a22c485fe056 100644 (file)
@@ -95,6 +95,14 @@ namespace Mono.Security.Interface
                 * If @serverMode is true, then we're a server and want to validate a certificate that we received from a client.
                 */
                ValidationResult ValidateCertificate (string targetHost, bool serverMode, X509CertificateCollection certificates);
+       }
+
+       internal interface ICertificateValidator2 : ICertificateValidator
+       {
+               /*
+                * Internal use only.
+                */
+               ValidationResult ValidateCertificate (string targetHost, bool serverMode, X509Certificate leaf, X509Chain chain);
 
                /*
                 * On OS X and Mobile, the @chain will be initialized with the @certificates, but not actually built.
@@ -137,15 +145,15 @@ namespace Mono.Security.Interface
                        get { return supportsTrustAnchors; }
                }
 
-               static ICertificateValidator GetDefaultValidator (MonoTlsProvider provider, MonoTlsSettings settings)
+               static ICertificateValidator2 GetDefaultValidator (MonoTlsProvider provider, MonoTlsSettings settings)
                {
-                       return (ICertificateValidator)NoReflectionHelper.GetDefaultCertificateValidator (provider, settings);
+                       return (ICertificateValidator2)NoReflectionHelper.GetDefaultCertificateValidator (provider, settings);
                }
 
                /*
                 * Internal API, intended to be used by MonoTlsProvider implementations.
                 */
-               public static ICertificateValidator GetValidator (MonoTlsProvider provider, MonoTlsSettings settings)
+               internal static ICertificateValidator2 GetValidator (MonoTlsProvider provider, MonoTlsSettings settings)
                {
                        return GetDefaultValidator (provider, settings);
                }
index 8b7c6ddecfc28a375c64139d08d003fb67f6a2ce..59b148c48c633a14c1dae94a1608242405aafd39 100644 (file)
@@ -129,7 +129,7 @@ namespace Mono.Security.Interface
                /*
                 * Allows a TLS provider to provide a custom system certificiate validator.
                 */
-               public virtual bool HasCustomSystemCertificateValidator {
+               internal virtual bool HasCustomSystemCertificateValidator {
                        get { return false; }
                }
 
@@ -142,13 +142,12 @@ namespace Mono.Security.Interface
                 * Returns `true` if certificate validation has been performed and `false` to invoke the
                 * default system validator.
                 */
-               public virtual bool InvokeSystemCertificateValidator (
-                       ICertificateValidator validator, string targetHost, bool serverMode,
-                       X509CertificateCollection certificates, ref X509Chain chain, out bool success,
-                       ref MonoSslPolicyErrors errors, ref int status11)
+               internal virtual bool InvokeSystemCertificateValidator (
+                       ICertificateValidator2 validator, string targetHost, bool serverMode,
+                       X509CertificateCollection certificates, bool wantsChain, ref X509Chain chain,
+                       out bool success, ref MonoSslPolicyErrors errors, ref int status11)
                {
-                       success = false;
-                       return false;
+                       throw new InvalidOperationException ();
                }
 
 #endregion
diff --git a/mcs/class/Mono.Security/monotouch_tv_opt_Mono.Security.dll.sources b/mcs/class/Mono.Security/monotouch_tv_opt_Mono.Security.dll.sources
deleted file mode 100644 (file)
index 19d6a04..0000000
+++ /dev/null
@@ -1 +0,0 @@
-#include monotouch_opt_Mono.Security.dll.sources
diff --git a/mcs/class/Mono.Security/monotouch_watch_opt_Mono.Security.dll.sources b/mcs/class/Mono.Security/monotouch_watch_opt_Mono.Security.dll.sources
deleted file mode 100644 (file)
index 19d6a04..0000000
+++ /dev/null
@@ -1 +0,0 @@
-#include monotouch_opt_Mono.Security.dll.sources
index 3e394f9287d9844f3ccad7606f3d0bfaed7988a9..d8e1e47414107bd6f95da97b4d1cf223d9f810cd 100644 (file)
@@ -4,8 +4,7 @@ include ../../build/rules.make
 
 LIBRARY = Mono.Simd.dll
 LIB_REFS = System.Core
-LIB_MCS_FLAGS = -r:$(corlib) /unsafe
-TEST_MCS_FLAGS = -r:Mono.Simd.dll
+LIB_MCS_FLAGS = /unsafe
 
 NO_TEST = yes
 
index ef144fe461de5ddc869c9b340e9a8296300434e3..8d50c7ad6294d7f8c10c527a4b39005e1c272e01 100644 (file)
@@ -7,11 +7,8 @@ include $(XBUILD_DIR)/xbuild.make
 
 LIBRARY = Mono.XBuild.Tasks.dll
 
-LIB_REFS = System System.Xml
-LIB_MCS_FLAGS = \
-       /r:$(corlib)                            \
-       /r:System.dll                           \
-       /r:System.Xml.dll
+LIB_REFS = $(PARENT_PROFILE)System $(PARENT_PROFILE)System.Xml
+LIB_MCS_FLAGS =
 
 include $(XBUILD_DIR)/xbuild_test.make
 
index 32b46e6664a290d399701de9d9f919500afe9035..e7ac06790fb53969ee5264f120f45abf95affe33 100644 (file)
@@ -11,7 +11,7 @@ SCARY_LIB=/lib:$(prefix)/lib
 endif
 
 LIB_REFS = System System.Xml
-LIB_MCS_FLAGS = $(SCARY_LIB) /unsafe /r:$(corlib)
+LIB_MCS_FLAGS = $(SCARY_LIB) /unsafe
 TEST_MCS_FLAGS = $(LIB_MCS_FLAGS)
 
 EXTRA_DISTFILES = \
index 25cd6cc4fdc4610fb6a4783f4cc441acf6f8e44a..9e0d99d6c0b7de775b2ecfc44b3d2a0067d41f15 100644 (file)
@@ -7,9 +7,6 @@ LIBRARY = Novell.Directory.Ldap.dll
 LIB_REFS = System Mono.Security
 LIB_MCS_FLAGS = \
        -warn:1 -nowarn:612 \
-       -r:$(corlib)                            \
-       -r:System.dll                           \
-       -r:Mono.Security.dll                    \
        $(RESX_RES:%=/res:%)
 
 include ../../build/library.make
index e699f77f53f1f88d963a7d07db05b820b682066a..f303415ba6ddae5b83ededf702d4c221c01dd489 100644 (file)
@@ -4,7 +4,7 @@ include ../../build/rules.make
 
 LIBRARY = PEAPI.dll
 LIB_REFS = System
-LIB_MCS_FLAGS = /r:$(corlib) -nowarn:414,618
+LIB_MCS_FLAGS = -nowarn:414,618
 NO_TEST = yes
 
 EXTRA_DISTFILES = README.txt
index 9d5e49a318156426af592e19ce0c9142f98f731c..9c48a40e29ddfb28882d65f65c684f91a69122ea 100644 (file)
@@ -4,9 +4,7 @@ SUBDIRS =
 include ../../../../build/rules.make
 
 PROGRAM = RabbitMQ.Client.Apigen.exe
-
-LOCAL_MCS_FLAGS = /r:System.dll     \
-                  /r:System.Xml.dll \
-                  /main:RabbitMQ.Client.Apigen.Apigen
+LIB_REFS = System System.Xml
+LOCAL_MCS_FLAGS = /main:RabbitMQ.Client.Apigen.Apigen
 
 include ../../../../build/executable.make
index 2da44f09fe567c5cae5d4d53fe703c7810e4b88e..cc8b4f8e95c096df78e66cd908d2ec93d242a37a 100644 (file)
@@ -3,7 +3,7 @@ include ../../build/rules.make
 
 LIBRARY = System.Configuration.Install.dll
 LIB_REFS = System System.Xml
-LIB_MCS_FLAGS = /r:$(corlib)
+LIB_MCS_FLAGS =
 
 NO_TEST = yes
 
index 43fc4253383bc9b14704a56345d09e916ff320a4..065753050515d74addcbc04d91e84ec71296e0c9 100644 (file)
@@ -5,11 +5,11 @@ include ../../build/rules.make
 
 LIBRARY = System.Configuration.dll
 
-LOCAL_MCS_FLAGS = -lib:$(secxml_libdir) -lib:$(bare_libdir)
-test_remove = $(LOCAL_MCS_FLAGS)
-LIB_REFS = System System.Xml System.Security
-LIB_MCS_FLAGS = -r:$(corlib) -nowarn:618
-TEST_MCS_FLAGS = $(LIB_MCS_FLAGS) 
+LOCAL_MCS_FLAGS = 
+LIB_REFS = secxml/System bare/System.Xml System.Security
+LIB_MCS_FLAGS = -nowarn:618
+TEST_MCS_FLAGS =
+TEST_LIB_REFS = System.Xml System
 
 include ../../build/library.make
 
index a4415a382bd4bce358826b9cd00e9c5e8bed9c39..2a70299375e2d0b0945dab6dde31376765b61d0b 100644 (file)
@@ -4,7 +4,7 @@ include ../../build/rules.make
 
 LIBRARY = System.Data.OracleClient.dll
 LIB_REFS = System System.Xml System.Data System.EnterpriseServices System.Drawing
-LIB_MCS_FLAGS = /r:$(corlib)
+LIB_MCS_FLAGS =
 
 TEST_MCS_FLAGS = $(LIB_MCS_FLAGS) /nowarn:618
 
index 5f9aeccafce598da00344ce165221e47a8a90874..b5fb3cb6fdd43622e5dcbd4664aa43b53329969f 100644 (file)
@@ -11,6 +11,7 @@ ifeq (4, $(FRAMEWORK_VERSION_MAJOR))
 LIB_REFS += System.ServiceModel.Activation
 endif
 
-TEST_MCS_FLAGS = -r:System.ServiceModel.dll -r:System.Core.dll
+TEST_MCS_FLAGS =
+TEST_LIB_REFS = System.ServiceModel System.Core
 
 include ../../build/library.make
index 9e19d39aed4c00ec15fedb482998a69ce3067e8c..0c84bbb1b4596a37674c746cdd4467ff84417034 100644 (file)
@@ -28,7 +28,8 @@ endif
 
 TXT_RESOURCE_STRINGS = ../../../external/referencesource/System.Data/system.data.txt
 
-TEST_MCS_FLAGS = $(LIB_MCS_FLAGS) -r:System.Core.dll -r:Mono.Data.Sqlite.dll -nowarn:618,169,612,219,168
+TEST_LIB_REFS = System.Core Mono.Data.Sqlite
+TEST_MCS_FLAGS = $(LIB_MCS_FLAGS) -nowarn:618,169,612,219,168
 
 TEST_MONO_PATH = .
 
index e941324ef83cafd239f80d65df847e4ff0104c26..3dc11aa3b01e293dc886b475ccd6ff36704715d2 100644 (file)
@@ -4,13 +4,11 @@ include ../../build/rules.make
 
 LIBRARY = System.Design.dll
 
-LIB_REFS = System System.Xml System.Web System.Windows.Forms System.Drawing Accessibility System.Data System.Configuration
-LIB_MCS_FLAGS = -r:$(corlib)
+LIB_REFS = System System.Xml plainweb/System.Web System.Windows.Forms System.Drawing Accessibility System.Data System.Configuration
+LIB_MCS_FLAGS =
 
-plainweb_dir = $(the_libdir_base)plainweb
-LOCAL_MCS_FLAGS = -lib:$(plainweb_dir)
-
-TEST_MCS_FLAGS = /r:System.dll -r:System.Drawing.dll -r:System.Windows.Forms
+TEST_LIB_REFS = System System.Drawing System.Windows.Forms
+TEST_MCS_FLAGS =
 
 include ../../build/library.make
 
index ff5403fd06a9fc2a583051869f7a69a85d068f78..7eccfe87a4e731d6cac7f8f7ae98709cebd1463a 100644 (file)
@@ -4,7 +4,7 @@ include ../../build/rules.make
 
 LIBRARY = System.DirectoryServices.dll
 LIB_REFS = System Novell.Directory.Ldap
-LIB_MCS_FLAGS = /r:$(corlib)
+LIB_MCS_FLAGS =
 TEST_MCS_FLAGS = $(LIB_MCS_FLAGS) -nowarn:0618 -nowarn:219 -nowarn:169
 
 include ../../build/library.make
index 9fa2fea63b52942595784a69c89493953f34c9da..7abb4b3f3aed433d4ad2975c59cdb8016af1414e 100644 (file)
@@ -4,7 +4,7 @@ include ../../build/rules.make
 
 LIBRARY = System.Drawing.Design.dll
 LIB_REFS = System System.Drawing System.Windows.Forms
-LIB_MCS_FLAGS = /r:$(corlib)
+LIB_MCS_FLAGS =
 NO_TEST = yes
 
 include ../../build/library.make
index 8827cb4f826929dbba8d2605da6f3972a634df93..59ff776b9f1ccbf1bb35ea36e60206a59417782f 100644 (file)
@@ -5,13 +5,14 @@ SUBDIRS =
 LIBRARY = System.Drawing.dll
 
 LIB_REFS = System
-LIB_MCS_FLAGS = /unsafe /r:$(corlib) \
+LIB_MCS_FLAGS = /unsafe \
        -resource:Assembly/Mono.ico,Mono.ico -resource:Assembly/Information.ico,Information.ico \
        -resource:Assembly/Error.ico,Error.ico -resource:Assembly/Warning.ico,Warning.ico \
        -resource:Assembly/Question.ico,Question.ico -resource:Assembly/Shield.ico,Shield.ico
 
+TEST_LIB_REFS = System.Drawing System.Runtime.Serialization.Formatters.Soap System.Xml
+
 TEST_MCS_FLAGS = $(LIB_MCS_FLAGS) -define:TEST -resource:Test/resources/indexed.png,indexed.png \
-        -r:System.Drawing.dll -r:System.Runtime.Serialization.Formatters.Soap.dll -r:System.Xml.dll \
        -nowarn:0618 -nowarn:219 -nowarn:169
 
 include ../../build/library.make
index f0eac39bcdf5cf9df7b333031f147f91d7d64ffb..90f38e9fc9ade77d12212d6d6ceffb38a063ab2d 100644 (file)
@@ -4,7 +4,7 @@ include ../../build/rules.make
 
 LIBRARY = System.EnterpriseServices.dll
 LIB_REFS = System.Transactions
-LIB_MCS_FLAGS = /nowarn:0168 /nowarn:0162 /r:$(corlib)
+LIB_MCS_FLAGS = /nowarn:0168 /nowarn:0162
 NO_TEST = yes
 
 include ../../build/library.make
index abc4e30ee80dea672bbb6ae14cfdd90449b6d521..7cfa024a71de3b0be96972f3dbe6ff146e649d33 100644 (file)
@@ -5,6 +5,7 @@ include ../../build/rules.make
 LIBRARY = System.IO.Compression.FileSystem.dll
 LIB_REFS = System System.IO.Compression
 LIB_MCS_FLAGS =
-TEST_MCS_FLAGS = /r:System.dll /r:System.Core.dll /r:System.IO.Compression.dll
+TEST_MCS_FLAGS =
+TEST_LIB_REFS = System System.Core System.IO.Compression
 
 include ../../build/library.make
index 3ca6899dacde9f589312031a31c0a8622a766770..0987f09e6e3085a0a4802b7c47a198d065cee52b 100644 (file)
@@ -5,6 +5,7 @@ include ../../build/rules.make
 LIBRARY = System.IO.Compression.dll
 LIB_REFS = System System.Core
 LIB_MCS_FLAGS = /unsafe
-TEST_MCS_FLAGS = /r:System.dll /r:System.Core.dll
+TEST_MCS_FLAGS =
+TEST_LIB_REFS = System System.Core
 
 include ../../build/library.make
index 9bf7e1d5877a04ff18d63b6b9fe8002f11023ab6..5a8a72c4c50e416866c1a7670beb50a626555741 100644 (file)
@@ -2,12 +2,6 @@ thisdir = class/System.IdentityModel
 SUBDIRS = 
 include ../../build/rules.make
 
-ifndef NO_SYSTEM_WEB_APPSERVICES_DEPENDENCY
-ifeq (4, $(FRAMEWORK_VERSION_MAJOR))
-OTHER_LIB_MCS_FLAGS = -r:System.Web.ApplicationServices.dll
-endif
-endif
-
 LIBRARY = System.IdentityModel.dll
 LIB_REFS = System System.Xml System.Security System.Configuration Mono.Security System.Runtime.Serialization
 LIB_MCS_FLAGS = \
@@ -18,6 +12,13 @@ ifndef NO_SYSTEM_WEB_DEPENDENCY
 LIB_REFS += System.Web
 endif
 
+
+ifndef NO_SYSTEM_WEB_APPSERVICES_DEPENDENCY
+ifeq (4, $(FRAMEWORK_VERSION_MAJOR))
+LIB_REFS += System.Web.ApplicationServices
+endif
+endif
+
 TEST_MCS_FLAGS = $(LIB_MCS_FLAGS)
 
 EXTRA_DISTFILES = \
index 4fe9d03dca2d1ff0808913fbdbed90c9da9de364..df76cf43bc2b085e3bc3c690db46e0ccaa0b00f2 100644 (file)
@@ -4,7 +4,7 @@ include ../../build/rules.make
 
 LIBRARY = System.Management.dll
 LIB_REFS = System System.Configuration.Install
-LIB_MCS_FLAGS = /r:$(corlib)
+LIB_MCS_FLAGS =
 NO_TEST = yes
 
 include ../../build/library.make
index 4cf4c29ab083040b47ed92087f5c42d22d0fdd2a..0412ea01555cf6bbcf44cb375c526bc75b3406bd 100644 (file)
@@ -10,8 +10,8 @@ LIB_REFS += System.Drawing
 endif
 
 LIB_MCS_FLAGS = /resource:System.Messaging/MessageQueue.resx
-TEST_MCS_FLAGS = $(LIB_MCS_FLAGS) -nowarn:0618 -nowarn:219 -nowarn:169 \
-               /r:nunit.mocks.dll
+TEST_MCS_FLAGS = $(LIB_MCS_FLAGS) -nowarn:0618 -nowarn:219 -nowarn:169
+TEST_LIB_REFS = nunit.mocks
 
 EXTRA_DISTFILES = System.Messaging/MessageQueue.resx
 
index fad726ff5f37fe25c837b901c5319e60293cd55f..b0d8e7a1a87879a4ee0431abe256ec6ab3538128 100644 (file)
@@ -7,6 +7,7 @@ LIBRARY = System.Net.Http.WebRequest.dll
 LIB_REFS = System.Net.Http System
 LIB_MCS_FLAGS =
 
-TEST_MCS_FLAGS = -r:System.Net.Http.dll
+TEST_MCS_FLAGS =
+TEST_LIB_REFS = System.Net.Http
 
 include ../../build/library.make
index aa3cdf921e56f3563c5d53c213ed72cf7c2cd1a9..bf1cbbd2799e04788e4554d8964bcdc757d54d64 100644 (file)
@@ -7,6 +7,7 @@ LIBRARY = System.Net.Http.dll
 LIB_REFS = System.Core System
 LIB_MCS_FLAGS = $(EXTRA_LIB_MCS_FLAGS)
 
-TEST_MCS_FLAGS = -r:System.dll -r:System.Core.dll
+TEST_LIB_REFS = System System.Core
+TEST_MCS_FLAGS =
 
 include ../../build/library.make
index 8e5efe308ce8a52ef8d8ea3c6492ee93188715aa..fc666baf51ca53b437ad7b1eb98e476efcad6f5b 100644 (file)
@@ -5,8 +5,7 @@ include ../../build/rules.make
 LIBRARY = System.Reactive.Core.dll
 LIB_REFS = System System.Core System.Reactive.Interfaces
 LIB_MCS_FLAGS = \
-               @more_build_args \
-               -r:System.Reactive.Interfaces.dll
+               @more_build_args
 
 ifeq (true, $(GENERATE_RESOURCES))
 LIB_MCS_FLAGS += /define:GENERATING_RESOURCES
index e05d3c0236e2cb69a33984069812a7674007bf90..f7f8f44e195f2eab4d452a18f622827a8a0742bd 100644 (file)
@@ -5,8 +5,7 @@ include ../../build/rules.make
 LIBRARY = System.Reactive.Linq.dll
 LIB_REFS = System System.Core System.Reactive.Interfaces System.Reactive.Core
 LIB_MCS_FLAGS = \
-               @more_build_args \
-               -r:System.Reactive.Core.dll
+               @more_build_args
 
 ifeq (true, $(GENERATE_RESOURCES))
 LIB_MCS_FLAGS += /define:GENERATING_RESOURCES
index ec5e06a73a84530412b32ec9723312c695c01319..0db9de14052ca03748e8ce734006ee299325b53f 100644 (file)
@@ -5,8 +5,7 @@ include ../../build/rules.make
 LIBRARY = System.Reactive.Observable.Aliases.dll
 LIB_REFS = System System.Core System.Reactive.Interfaces System.Reactive.Core System.Reactive.Linq System.Reactive.Providers
 LIB_MCS_FLAGS = \
-               @more_build_args \
-               -r:System.Reactive.Providers.dll
+               @more_build_args
 
 ifeq (true, $(GENERATE_RESOURCES))
 LIB_MCS_FLAGS += /define:GENERATING_RESOURCES
index 1a8675dc69af0736a30654aa87cc48b7952b9cd4..0333c27f2e74bd531e34c5af1666da5275c76ed4 100644 (file)
@@ -5,8 +5,7 @@ include ../../build/rules.make
 LIBRARY = System.Reactive.PlatformServices.dll
 LIB_REFS = System System.Core System.Reactive.Interfaces System.Reactive.Core System.Reactive.Linq
 LIB_MCS_FLAGS = \
-               @more_build_args \
-               -r:System.Reactive.Linq.dll
+               @more_build_args
 
 ifeq (true, $(GENERATE_RESOURCES))
 LIB_MCS_FLAGS += /define:GENERATING_RESOURCES
@@ -35,7 +34,8 @@ ifndef NO_TASK_DELAY
 LIB_MCS_FLAGS += -d:NO_TASK_DELAY
 endif
 
-TEST_MCS_FLAGS = $(LIB_MCS_FLAGS) -r:Mono.Reactive.Tests.dll
+TEST_MCS_FLAGS = $(LIB_MCS_FLAGS)
+TEST_LIB_REFS = Mono.Reactive.Tests
 
 EXTRA_DISTFILES = more_build_args $(RESX_RESOURCES:.resources=.resx) $(PREBUILT)
 
index 9aedac157d73c36b33b7a525f8b1c8d656141fc1..ab1f274d1503cf65d124a5069e797bedbc72cc65 100644 (file)
@@ -5,8 +5,7 @@ include ../../build/rules.make
 LIBRARY = System.Reactive.Providers.dll
 LIB_REFS = System System.Core System.Reactive.Interfaces System.Reactive.Core System.Reactive.Linq
 LIB_MCS_FLAGS = \
-               @more_build_args \
-               -r:System.Reactive.Linq.dll
+               @more_build_args
 
 ifeq (true, $(GENERATE_RESOURCES))
 LIB_MCS_FLAGS += /define:GENERATING_RESOURCES
index 389920631a72cccac89543143e9e7a3f69839fce..1834e7aaa259e9de7bb25255053d6ad27feb0825 100644 (file)
@@ -5,8 +5,7 @@ include ../../build/rules.make
 LIBRARY = System.Reactive.Runtime.Remoting.dll
 LIB_REFS = System System.Core System.Reactive.Interfaces System.Reactive.Core System.Reactive.Linq
 LIB_MCS_FLAGS = \
-               @more_build_args \
-               -r:System.Reactive.Linq.dll
+               @more_build_args
 
 ifeq (2.1, $(FRAMEWORK_VERSION))
 LIB_MCS_FLAGS += -d:NO_TASK_DELAY
index e2f9d24fa92a02a9472f1aee4ecef2a3d479b0fa..ef3327d3e3e3dd39af41698bb97d9b7ef7d9d372 100644 (file)
@@ -5,8 +5,7 @@ include ../../build/rules.make
 LIBRARY = System.Reactive.Windows.Forms.dll
 LIB_REFS = System System.Core System.Reactive.Interfaces System.Reactive.Core System.Reactive.Linq System.Windows.Forms
 LIB_MCS_FLAGS = \
-               @more_build_args \
-               -r:System.Windows.Forms.dll
+               @more_build_args
 
 ifeq (2.1, $(FRAMEWORK_VERSION))
 LIB_MCS_FLAGS += -d:NO_TASK_DELAY -d:HAS_AWAIT
index 3c0654cfac387f4690791f0dd8a3b55a7de1e269..66a3ff14f6c6518b55254691c13c1d65fd52e02e 100644 (file)
@@ -5,8 +5,7 @@ include ../../build/rules.make
 LIBRARY = System.Reactive.Windows.Threading.dll
 LIB_REFS = System System.Core System.Reactive.Interfaces System.Reactive.Core System.Reactive.Linq WindowsBase
 LIB_MCS_FLAGS = \
-               @more_build_args \
-               -r:WindowsBase.dll
+               @more_build_args
 
 ifeq (true, $(GENERATE_RESOURCES))
 LIB_MCS_FLAGS += /define:GENERATING_RESOURCES
index eeb73d0894eefe4d3fa471d20c063fb544c3abad..323d4241eb5ce80ee8106733b36fce329cd1cdc6 100644 (file)
@@ -5,13 +5,14 @@ include ../../build/rules.make
 LIBRARY = System.Runtime.Remoting.dll
 
 LIB_REFS = System System.Xml System.Runtime.Serialization.Formatters.Soap
-LIB_MCS_FLAGS = /r:$(corlib)
+LIB_MCS_FLAGS =
 
 ifndef NO_SYSTEM_WEB_DEPENDENCY
 LIB_REFS += System.Web
 endif
 
-TEST_MCS_FLAGS = $(LIB_MCS_FLAGS) -nowarn:618 /r:System.Runtime.Remoting.dll
+TEST_MCS_FLAGS = -nowarn:618
+TEST_LIB_REFS = System System.Xml
 
 TEST_MONO_PATH = .
 
index 76d3270616d3b94427d798d02bc23435b0124bfe..7a673f01fa3b3245627fb9114f3f97446c6ca515 100644 (file)
@@ -6,8 +6,10 @@ include ../../build/rules.make
 
 LIBRARY = System.Runtime.Serialization.Formatters.Soap.dll
 LIB_REFS = System.Xml
-LIB_MCS_FLAGS = /r:$(corlib)
-TEST_MCS_FLAGS = $(LIB_MCS_FLAGS) -r:System.dll -nowarn:0618 -nowarn:219 -nowarn:169
+LIB_MCS_FLAGS =
+
+TEST_LIB_REFS = System
+TEST_MCS_FLAGS = $(LIB_MCS_FLAGS) -nowarn:0618 -nowarn:219 -nowarn:169
 
 EXTRA_DISTFILES = \
        README          \
index dbacda112e889f0a83533f3e0dd6fdf890da770f..487ff5f1dd7ecafac8d3e3f3972db9435188bd3c 100644 (file)
@@ -23,7 +23,7 @@ using System.Runtime.CompilerServices;
 // You can specify all values by your own or you can build default build and revision\r
 // numbers with the '*' character (the default):\r
 \r
-[assembly: AssemblyVersion("1.0.*")]\r
+[assembly: AssemblyVersion("1.0.0.0")]\r
 \r
 // The following attributes specify the key for the sign of your assembly. See the\r
 // .NET Framework documentation for more information about signing.\r
index 21d8e716a39187f157f2511d834a5d5f4bf9add5..03b78193d75396a3290ce28ea264171a22647a4c 100644 (file)
@@ -11,6 +11,7 @@ LIB_MCS_FLAGS = \
                -d:NO_DYNAMIC_CODEGEN \
                /nowarn:168,169,219,414 \
                $(RESOURCE_FILES:%=/resource:%)
+TXT_RESOURCE_STRINGS = ../../../external/referencesource/System.Runtime.Serialization/System.Runtime.Serialization.txt
 
 ifneq (2.1, $(FRAMEWORK_VERSION))
 LIB_REFS += System.Data System.Configuration
@@ -27,8 +28,8 @@ TEST_RESOURCE_FILES = \
        Test/Resources/WSDL/collections.wsdl    \
        Test/Resources/WSDL/custom-collections.wsdl
 
-TEST_MCS_FLAGS = $(LIB_MCS_FLAGS) /r:System.ServiceModel.dll /r:System.Web.Services.dll \
-       $(TEST_RESOURCE_FILES:%=/resource:%)
+TEST_MCS_FLAGS = $(LIB_MCS_FLAGS) $(TEST_RESOURCE_FILES:%=/resource:%)
+TEST_LIB_REFS = System.ServiceModel System.Web.Services
 
 EXTRA_DISTFILES = $(RESOURCE_FILES) $(TEST_RESOURCE_FILES) \
        Test/Resources/FrameworkTypes/* \
index ae10d9fefa1675bfa8acd5a1ea6a57ad5edb09c7..856841518bf78dd21a75df312b81a2dad878ff36 100644 (file)
-using System.Globalization;
-
-#region "copy of ../../build/common/SR.cs"
-
-namespace System.Runtime.Serialization
+//
+// This file was generated by txt2sr tool
+//
+namespace System.Runtime.Serialization {
+partial class SR
 {
-       static partial class SR 
-       {
-
-        internal static string GetString(string name, params object[] args)
-        {
-                return GetString (CultureInfo.InvariantCulture, name, args);
-        }
-
-        internal static string GetString(CultureInfo culture, string name, params object[] args) {
-                return string.Format (culture, name, args);
-        }
-
-        internal static string GetString(string name)
-        {
-                return name;
-        }
-
-        internal static string GetString(CultureInfo culture, string name)
-        {
-                return name;
-        }
+       public const string ArrayExceededSize = "Array length '{0}' provided by the get-only collection of type '{1}' is less than the number of array elements found in the input stream.  Consider increasing the length of the array.";
+       public const string ArrayExceededSizeAttribute = "Array length '{0}' provided by Size attribute is not equal to the number of array elements '{1}' from namespace '{2}' found.";
+       public const string ArrayTypeIsNotSupported = "An internal error has occurred. '{0}[]' is not supported when generating code for serialization.";
+       public const string CannotDeserializeRefAtTopLevel = "Cannot deserialize since root element references unrecognized object with id '{0}'.";
+       public const string CannotLoadMemberType = "Cannot load member type '{0}'.";
+       public const string CannotSerializeObjectWithCycles = "Object graph for type '{0}' contains cycles and cannot be serialized if references are not tracked. Consider using the DataContractAttribute with the IsReference property set to true.";
+       public const string CanOnlyStoreIntoArgOrLocGot0 = "An internal error has occurred. Data can only be stored into ArgBuilder or LocalBuilder. Got: {0}.";
+       public const string CharIsInvalidPrimitive = "An internal error has occurred. Char is not a valid schema primitive and should be treated as int in DataContract.";
+       public const string CallbackMustReturnVoid = "Serialization Callback '{1}' in type '{0}' must return void.";
+       public const string CallbackParameterInvalid = "Serialization Callback '{1}' in type '{0}' must have a single parameter of type '{2}'.";
+       public const string CallbacksCannotBeVirtualMethods = "Virtual Method '{0}' of type '{1}' cannot be marked with '{2}' attribute.";
+       public const string CollectionMustHaveAddMethod = "Collection type '{0}' does not have a valid Add method.";
+       public const string CollectionMustHaveGetEnumeratorMethod = "Collection type '{0}' does not have a valid GetEnumerator method.";
+       public const string CollectionMustHaveItemType = "Collection type '{0}' must have a non-null item type.";
+       public const string CollectionTypeCannotBeBuiltIn = "{0} is a built-in type and cannot be a collection.";
+       public const string CollectionTypeCannotHaveDataContract = "{0} has DataContractAttribute attribute.";
+       public const string CollectionTypeDoesNotHaveAddMethod = "{0} does not have a valid Add method with parameter of type '{1}'.";
+       public const string CollectionTypeDoesNotHaveDefaultCtor = "{0} does not have a default constructor.";
+       public const string CollectionTypeHasMultipleDefinitionsOfInterface = "{0} has multiple definitions of interface '{1}'.";
+       public const string CollectionTypeIsNotIEnumerable = "{0} does not implement IEnumerable interface.";
+       public const string DataContractCacheOverflow = "An internal error has occurred. DataContract cache overflow.";
+       public const string DataContractNamespaceAlreadySet = "ContractNamespaceAttribute attribute maps CLR namespace '{2}' to multiple data contract namespaces '{0}' and '{1}'. You can map a CLR namespace to only one data contract namespace.";
+       public const string DataContractNamespaceIsNotValid = "DataContract namespace '{0}' is not a valid URI.";
+       public const string DataContractNamespaceReserved = "DataContract namespace '{0}' cannot be specified since it is reserved.";
+       public const string DataMemberOnEnumField = "Member '{0}.{1}' has DataMemberAttribute attribute. Use EnumMemberAttribute attribute instead.";
+       public const string DcTypeNotFoundOnDeserialize = "Element '{2}:{3}' contains data of the '{0}:{1}' data contract. The deserializer has no knowledge of any type that maps to this contract. Add the type corresponding to '{1}' to the list of known types - for example, by using the KnownTypeAttribute attribute or by adding it to the list of known types passed to DataContractSerializer.";
+       public const string DcTypeNotFoundOnSerialize = "Type '{0}' with data contract name '{1}:{2}' is not expected. Add any types not known statically to the list of known types - for example, by using the KnownTypeAttribute attribute or by adding them to the list of known types passed to DataContractSerializer.";
+       public const string DcTypeNotResolvedOnDeserialize = "Element '{2}:{3}' contains data from a type that maps to the name '{0}:{1}'. The deserializer has no knowledge of any type that maps to this name. Consider changing the implementation of the ResolveName method on your DataContractResolver to return a non-null value for name '{1}' and namespace '{0}'.";
+       public const string DeserializedObjectWithIdNotFound = "Deserialized object with reference id '{0}' not found in stream.";
+       public const string DupContractInKnownTypes = "Type '{0}' cannot be added to list of known types since another type '{1}' with the same data contract name '{2}:{3}' is already present.";
+       public const string DupKeyValueName = "The collection data contract type '{0}' specifies the same value '{1}' for both the KeyName and the ValueName properties. This is not allowed. Consider changing either the KeyName or the ValueName property.";
+       public const string DupEnumMemberValue = "Type '{2}' contains two members '{0}' 'and '{1}' with the same name '{3}'. Multiple members with the same name in one type are not supported. Consider changing one of the member names using EnumMemberAttribute attribute.";
+       public const string DupMemberName = "Type '{2}' contains two members '{0}' 'and '{1}' with the same data member name '{3}'. Multiple members with the same name in one type are not supported. Consider changing one of the member names using DataMemberAttribute attribute.";
+       public const string DuplicateAttribute = "Invalid Callback. Method '{3}' in type '{2}' has both '{0}' and '{1}'.";
+       public const string DuplicateCallback = "Invalid attribute. Both '{0}' and '{1}' in type '{2}' have '{3}'.";
+       public const string EncounteredWithNameNamespace = "{0}. Encountered '{1}'  with name '{2}', namespace '{3}'.";
+       public const string EnumTypeCannotHaveIsReference = "Enum type '{0}' cannot have the IsReference setting of '{1}'. Either change the setting to '{2}', or remove it completely.";
+       public const string ErrorDeserializing = "There was an error deserializing the object {0}. {1}";
+       public const string ErrorInLine = "Error in line {0} position {1}.";
+       public const string ErrorIsStartObject = "There was an error checking start element of object {0}. {1}";
+       public const string ErrorSerializing = "There was an error serializing the object {0}. {1}";
+       public const string ErrorTypeInfo = "of type {0}";
+       public const string ErrorWriteEndObject = "There was an error writing end element of object {0}. {1}";
+       public const string ErrorWriteStartObject = "There was an error writing start element of object {0}. {1}";
+       public const string ExceededMaxItemsQuota = "Maximum number of items that can be serialized or deserialized in an object graph is '{0}'.";
+       public const string ExpectingElement = "Expecting element '{1}' from namespace '{0}'.";
+       public const string ExpectingElementAtDeserialize = "Expecting state '{0}' when ReadObject is called.";
+       public const string ExpectingEnd = "Expecting End'{0}'.";
+       public const string ExpectingState = "Expecting state '{0}'.";
+       public const string GenericNameBraceMismatch = "The data contract name '{0}' for type '{1}' has a curly brace '{{' that is not matched with a closing curly brace. Curly braces have special meaning in data contract names - they are used to customize the naming of data contracts for generic types.";
+       public const string GenericParameterNotValid = "In the data contract name for type '{1}', there are curly braces with '{0}' inside, which is an invalid value. Curly braces have special meaning in data contract names - they are used to customize the naming of data contracts for generic types. Based on the number of generic parameters this type has, the contents of the curly braces must either be a number between 0 and '{2}' to insert the name of the generic parameter at that index or the '#' symbol to insert a digest of the generic parameter namespaces.";
+       public const string InconsistentIsReference = "The IsReference setting for type '{0}' is '{1}', but the same setting for its parent class '{2}' is '{3}'. Derived types must have the same value for IsReference as the base type. Change the setting on type '{0}' to '{3}', or on type '{2}' to '{1}', or do not set IsReference explicitly.";
+       public const string IndexedPropertyCannotBeSerialized = "Property '{1}' in type '{0}' cannot be serialized because serialization of indexed properties is not supported.";
+       public const string InterfaceTypeCannotBeCreated = "Interface type '{0}' cannot be created. Consider replacing with a non-interface serializable type.";
+       public const string InvalidCollectionContractItemName = "Type '{0}' cannot have CollectionDataContractAttribute attribute ItemName set to null or empty string.";
+       public const string InvalidCollectionContractKeyName = "Type '{0}' cannot have CollectionDataContractAttribute attribute KeyName set to null or empty string.";
+       public const string InvalidCollectionContractKeyNoDictionary = "The collection data contract type '{0}' specifies '{1}' for the KeyName property. This is not allowed since the type is not IDictionary. Remove the setting for the KeyName property.";
+       public const string InvalidCollectionContractName = "Type '{0}' cannot have CollectionDataContractAttribute attribute Name set to null or empty string.";
+       public const string InvalidCollectionContractNamespace = "Type '{0}' cannot have CollectionDataContractAttribute attribute Namespace set to null.";
+       public const string InvalidCollectionContractValueName = "Type '{0}' cannot have CollectionDataContractAttribute attribute ValueName set to null or empty string.";
+       public const string InvalidCollectionContractValueNoDictionary = "The collection data contract type '{0}' specifies '{1}' for the ValueName property. This is not allowed since the type is not IDictionary. Remove the setting for the ValueName property.";
+       public const string InvalidCollectionDataContract = "Type '{0}' with CollectionDataContractAttribute attribute is an invalid collection type since it";
+       public const string InvalidCollectionType = "Type '{0}' is an invalid collection type since it";
+       public const string InvalidDataContractName = "Type '{0}' cannot have DataContractAttribute attribute Name set to null or empty string.";
+       public const string InvalidDataContractNamespace = "Type '{0}' cannot have DataContractAttribute attribute Namespace set to null.";
+       public const string InvalidDataMemberName = "Member '{0}' in type '{1}' cannot have DataMemberAttribute attribute Name set to null or empty string.";
+       public const string InvalidEnumMemberValue = "'{0}' in type '{1}' cannot have EnumMemberAttribute attribute Value set to null or empty string.";
+       public const string InvalidEnumValueOnRead = "Invalid enum value '{0}' cannot be deserialized into type '{1}'. Ensure that the necessary enum values are present and are marked with EnumMemberAttribute attribute if the type has DataContractAttribute attribute.";
+       public const string InvalidEnumValueOnWrite = "Enum value '{0}' is invalid for type '{1}' and cannot be serialized. Ensure that the necessary enum values are present and are marked with EnumMemberAttribute attribute if the type has DataContractAttribute attribute.";
+       public const string InvalidGetSchemaMethod = "Type '{0}' cannot have MethodName on XmlSchemaProviderAttribute attribute set to null or empty string.";
+       public const string InvalidGlobalDataContractNamespace = "CLR namespace '{0}' cannot have ContractNamespace set to null.";
+       public const string InvalidMember = "Member '{0}.{1}' cannot be serialized since it is neither a field nor a property, and therefore cannot be marked with the DataMemberAttribute attribute. Remove the DataMemberAttribute attribute from the '{1}' member.";
+       public const string InvalidNonNullReturnValueByIsAny = "Method '{0}.{1}()' returns a non-null value. The return value must be null since IsAny=true.";
+       public const string InvalidPrimitiveType = "Type '{0}' is not a valid serializable type.";
+       public const string InvalidReturnTypeOnGetSchemaMethod = "Method '{0}.{1}()' returns '{2}'. The return type must be compatible with '{3}'.";
+       public const string InvalidSizeDefinition = "Invalid Size '{0}'. Must be non-negative integer.";
+       public const string InvalidXmlDataContractName = "XML data contract Name for type '{0}' cannot be set to null or empty string.";
+       public const string InvalidXsIdDefinition = "Invalid Id '{0}'. Must not be null or empty.";
+       public const string InvalidXsRefDefinition = "Invalid Ref '{0}'. Must not be null or empty.";
+       public const string IsAnyCannotBeNull = "A null value cannot be serialized at the top level for IXmlSerializable root type '{0}' since its IsAny setting is 'true'. This type must write all its contents including the root element. Verify that the IXmlSerializable implementation is correct.";
+       public const string IsAnyCannotBeSerializedAsDerivedType = "An object of type '{0}' cannot be serialized at the top level for IXmlSerializable root type '{1}' since its IsAny setting is 'true'. This type must write all its contents including the root element. Verify that the IXmlSerializable implementation is correct.";
+       public const string IsAnyCannotHaveXmlRoot = "Type '{0}' cannot specify an XmlRootAttribute attribute because its IsAny setting is 'true'. This type must write all its contents including the root element. Verify that the IXmlSerializable implementation is correct.";
+       public const string IsNotAssignableFrom = "An internal error has occurred. '{0}' is not assignable from '{1}' - error generating code for serialization.";
+       public const string IsRequiredDataMemberOnIsReferenceDataContractType = "'{0}.{1}' has the IsRequired setting of '{2}. However, '{0}' has the IsReference setting of '{2}', because either it is set explicitly, or it is derived from a base class. Set IsRequired on '{0}.{1}' to false, or disable IsReference on '{0}'.";
+       public const string IXmlSerializableCannotHaveCollectionDataContract = "Type '{0}' cannot be IXmlSerializable and have CollectionDataContractAttribute attribute.";
+       public const string IXmlSerializableCannotHaveDataContract = "Type '{0}' cannot be IXmlSerializable and have DataContractAttribute attribute.";
+       public const string IXmlSerializableIllegalOperation = "This method cannot be called from IXmlSerializable implementations.";
+       public const string IXmlSerializableMissingEndElements = "IXmlSerializable.WriteXml method of type '{0}' did not close all open tags. Verify that the IXmlSerializable implementation is correct.";
+       public const string IXmlSerializableMustHaveDefaultConstructor = "IXmlSerializable Type '{0}' must have default constructor.";
+       public const string IXmlSerializableWritePastSubTree = "IXmlSerializable.WriteXml method of type '{0}' attempted to close too many tags.  Verify that the IXmlSerializable implementation is correct.";
+       public const string KnownTypeAttributeEmptyString = "Method name specified by KnownTypeAttribute attribute on type '{0}' cannot be the empty string.";
+       public const string KnownTypeAttributeUnknownMethod = "KnownTypeAttribute attribute on type '{1}' specifies a method named '{0}' to provide known types. Static method '{0}()' was not found on this type. Ensure that the method exists and is marked as static.";
+       public const string KnownTypeAttributeReturnType = "KnownTypeAttribute attribute on type '{0}' specifies a method named '{1}' to provide known types. The return type of this method is invalid because it is not assignable to IEnumerable<Type>. Ensure that the method exists and has a valid signature.";
+       public const string KnownTypeAttributeOneScheme = "Type '{0}': If a KnownTypeAttribute attribute specifies a method it must be the only KnownTypeAttribute attribute on that type.";
+       public const string KnownTypeAttributeNoType = "KnownTypeAttribute attribute on type '{0}' contains no Type.";
+       public const string KnownTypeConfigClosedGenericDeclared = "Declared type '{0}' in config cannot be a closed or partial generic type.";
+       public const string KnownTypeAttributeValidMethodTypes = "Method specified by KnownTypeAttribute attribute on type '{0}' does not expose valid types.";
+       public const string KnownTypeAttributeNoData = "KnownTypeAttribute attribute on type '{0}' contains no data.";
+       public const string KnownTypeAttributeMethodNull = "Method specified by KnownTypeAttribute attribute on type '{0}' returned null.";
+       public const string MaxArrayLengthExceeded = "The maximum array length ({0}) has been exceeded while reading XML data for array of type '{1}'.";
+       public const string MissingGetSchemaMethod = "Type '{0}' does not have a static method '{1}' that takes a parameter of type 'System.Xml.Schema.XmlSchemaSet' as specified by the XmlSchemaProviderAttribute attribute.";
+       public const string MultipleIdDefinition = "Invalid XML encountered. The same Id value '{0}' is defined more than once. Multiple objects cannot be deserialized using the same Id.";
+       public const string NoConversionPossibleTo = "An internal error has occurred. No conversion is possible to '{0}' - error generating code for serialization.";
+       public const string NoGetMethodForProperty = "No get method for property '{1}' in type '{0}'.";
+       public const string NoSetMethodForProperty = "No set method for property '{1}' in type '{0}'.";
+       public const string NullKnownType = "One of the known types provided to the serializer via '{0}' argument was invalid because it was null. All known types specified must be non-null values.";
+       public const string NullValueReturnedForGetOnlyCollection = "The get-only collection of type '{0}' returned a null value.  The input stream contains collection items which cannot be added if the instance is null.  Consider initializing the collection either in the constructor of the the object or in the getter.";
+       public const string ObjectTableOverflow = "An internal error has occurred. Object table overflow. This could be caused by serializing or deserializing extremely large object graphs.";
+       public const string OrderCannotBeNegative = "Property 'Order' in DataMemberAttribute attribute cannot be a negative number.";
+       public const string ParameterCountMismatch = "Invalid number of parameters to call method '{0}'. Expected '{1}' parameters, but '{2}' were provided.";
+       public const string PartialTrustCollectionContractAddMethodNotPublic = "The collection data contract type '{0}' cannot be deserialized because the method '{1}' is not public. Making the method public will fix this error. Alternatively, you can make it internal, and use the InternalsVisibleToAttribute attribute on your assembly in order to enable serialization of internal members - see documentation for more details. Be aware that doing so has certain security implications.";
+       public const string PartialTrustCollectionContractNoPublicConstructor = "The collection data contract type '{0}' cannot be deserialized because it does not have a public parameterless constructor. Adding a public parameterless constructor will fix this error. Alternatively, you can make it internal, and use the InternalsVisibleToAttribute attribute on your assembly in order to enable serialization of internal members - see documentation for more details. Be aware that doing so has certain security implications.";
+       public const string PartialTrustCollectionContractTypeNotPublic = "The collection data contract type '{0}' cannot be deserialized because it does not have a public parameterless constructor. Adding a public parameterless constructor will fix this error. Alternatively, you can make it internal, and use the InternalsVisibleToAttribute attribute on your assembly in order to enable serialization of internal members - see documentation for more details. Be aware that doing so has certain security implications.";
+       public const string PartialTrustDataContractOnSerializingNotPublic = "The data contract type '{0}' cannot be serialized because the OnSerializing method '{1}' is not public. Making the method public will fix this error. Alternatively, you can make it internal, and use the InternalsVisibleToAttribute attribute on your assembly in order to enable serialization of internal members - see documentation for more details. Be aware that doing so has certain security implications.";
+       public const string PartialTrustDataContractOnSerializedNotPublic = "The data contract type '{0}' cannot be serialized because the OnSerialized method '{1}' is not public. Making the method public will fix this error. Alternatively, you can make it internal, and use the InternalsVisibleToAttribute attribute on your assembly in order to enable serialization of internal members - see documentation for more details. Be aware that doing so has certain security implications.";
+       public const string PartialTrustDataContractOnDeserializingNotPublic = "The data contract type '{0}' cannot be deserialized because the OnDeserializing method '{1}' is not public. Making the method public will fix this error. Alternatively, you can make it internal, and use the InternalsVisibleToAttribute attribute on your assembly in order to enable serialization of internal members - see documentation for more details. Be aware that doing so has certain security implications.";
+       public const string PartialTrustDataContractOnDeserializedNotPublic = "The data contract type '{0}' cannot be deserialized because the OnDeserialized method '{1}' is not public. Making the method public will fix this error. Alternatively, you can make it internal, and use the InternalsVisibleToAttribute attribute on your assembly in order to enable serialization of internal members - see documentation for more details. Be aware that doing so has certain security implications.";
+       public const string PartialTrustDataContractFieldGetNotPublic = "The data contract type '{0}' cannot be serialized because the member '{1}' is not public. Making the member public will fix this error. Alternatively, you can make it internal, and use the InternalsVisibleToAttribute attribute on your assembly in order to enable serialization of internal members - see documentation for more details. Be aware that doing so has certain security implications.";
+       public const string PartialTrustDataContractFieldSetNotPublic = "The data contract type '{0}' cannot be deserialized because the member '{1}' is not public. Making the member public will fix this error. Alternatively, you can make it internal, and use the InternalsVisibleToAttribute attribute on your assembly in order to enable serialization of internal members - see documentation for more details. Be aware that doing so has certain security implications.";
+       public const string PartialTrustDataContractPropertyGetNotPublic = "The data contract type '{0}' cannot be serialized because the property '{1}' does not have a public getter. Adding a public getter will fix this error. Alternatively, you can make it internal, and use the InternalsVisibleToAttribute attribute on your assembly in order to enable serialization of internal members - see documentation for more details. Be aware that doing so has certain security implications.";
+       public const string PartialTrustDataContractPropertySetNotPublic = "The data contract type '{0}' cannot be deserialized because the property '{1}' does not have a public setter. Adding a public setter will fix this error. Alternatively, you can make it internal, and use the InternalsVisibleToAttribute attribute on your assembly in order to enable serialization of internal members - see documentation for more details. Be aware that doing so has certain security implications.";
+       public const string PartialTrustDataContractTypeNotPublic = "The data contract type '{0}' is not serializable because it is not public. Making the type public will fix this error. Alternatively, you can make it internal, and use the InternalsVisibleToAttribute attribute on your assembly in order to enable serialization of internal members - see documentation for more details. Be aware that doing so has certain security implications.";
+       public const string PartialTrustNonAttributedSerializableTypeNoPublicConstructor = "The type '{0}' cannot be deserialized because it does not have a public parameterless constructor. Alternatively, you can make it internal, and use the InternalsVisibleToAttribute attribute on your assembly in order to enable serialization of internal members - see documentation for more details. Be aware that doing so has certain security implications.";
+       public const string PartialTrustIXmlSerializableTypeNotPublic = "The IXmlSerializable type '{0}' is not serializable in partial trust because it is not public. Adding a public parameterless constructor will fix this error. Alternatively, you can make it internal, and use the InternalsVisibleToAttribute attribute on your assembly in order to enable serialization of internal members - see documentation for more details. Be aware that doing so has certain security implications.";
+       public const string PartialTrustIXmlSerialzableNoPublicConstructor = "The IXmlSerializable type '{0}' cannot be deserialized because it does not have a public parameterless constructor. Adding a public parameterless constructor will fix this error. Alternatively, you can make it internal, and use the InternalsVisibleToAttribute attribute on your assembly in order to enable serialization of internal members - see documentation for more details. Be aware that doing so has certain security implications.";
+       public const string NonAttributedSerializableTypesMustHaveDefaultConstructor = "The Type '{0}' must have a parameterless constructor.";
+       public const string AttributedTypesCannotInheritFromNonAttributedSerializableTypes = "Type '{0}' cannot inherit from a type that is not marked with DataContractAttribute or SerializableAttribute.  Consider marking the base type '{1}' with DataContractAttribute or SerializableAttribute, or removing them from the derived type.";
+       public const string GetOnlyCollectionsNotSupported = "Get-only collection properties are not supported.  Consider adding a public setter to property '{0}.{1}' or marking the it with the IgnoreDataMemberAttribute.";
+       public const string QuotaMustBePositive = "Quota must be a positive value.";
+       public const string QuotaIsReadOnly = "The '{0}' quota is readonly.";
+       public const string QuotaCopyReadOnly = "Cannot copy XmlDictionaryReaderQuotas. Target is readonly.";
+       public const string RequiredMemberMustBeEmitted = "Member {0} in type {1} cannot be serialized. This exception is usually caused by trying to use a null value where a null value is not allowed. The '{0}' member is set to its default value (usually null or zero). The member's EmitDefault setting is 'false', indicating that the member should not be serialized. However, the member's IsRequired setting is 'true', indicating that it must be serialized. This conflict cannot be resolved.  Consider setting '{0}' to a non-default value. Alternatively, you can change the EmitDefaultValue property on the DataMemberAttribute attribute to true, or changing the IsRequired property to false.";
+       public const string ResolveTypeReturnedFalse = "An object of type '{0}' which derives from DataContractResolver returned false from its TryResolveType method when attempting to resolve the name for an object of type '{1}', indicating that the resolution failed. Change the TryResolveType implementation to return true.";
+       public const string ResolveTypeReturnedNull = "An object of type '{0}' which derives from DataContractResolver returned a null typeName or typeNamespace but not both from its TryResolveType method when attempting to resolve the name for an object of type '{1}'. Change the TryResolveType implementation to return non-null values, or to return null values for both typeName and typeNamespace in order to serialize as the declared type.";
+       public const string SupportForMultidimensionalArraysNotPresent = "Multi-dimensional arrays are not supported.";
+       public const string TooManyCollectionContracts = "Type '{0}' has more than one CollectionDataContractAttribute attribute.";
+       public const string TooManyDataContracts = "Type '{0}' has more than one DataContractAttribute attribute.";
+       public const string TooManyDataMembers = "Member '{0}.{1}' has more than one DataMemberAttribute attribute.";
+       public const string TooManyEnumMembers = "Member '{0}.{1}' has more than one EnumMemberAttribute attribute.";
+       public const string TooManyIgnoreDataMemberAttributes = "Member '{0}.{1}' has more than one IgnoreDataMemberAttribute attribute.";
+       public const string TypeMustBeConcrete = "Error while getting known types for Type '{0}'. The type must not be an open or partial generic class.";
+       public const string TypeNotSerializable = "Type '{0}' cannot be serialized. Consider marking it with the DataContractAttribute attribute, and marking all of its members you want serialized with the DataMemberAttribute attribute. Alternatively, you can ensure that the type is public and has a parameterless constructor - all public members of the type will then be serialized, and no attributes will be required.";
+       public const string UnexpectedContractType = "An internal error has occurred. Unexpected contract type '{0}' for type '{1}' encountered.";
+       public const string UnexpectedElementExpectingElements = "'{0}' '{1}' from namespace '{2}' is not expected. Expecting element '{3}'.";
+       public const string UnexpectedEndOfFile = "Unexpected end of file.";
+       public const string UnknownConstantType = "Unrecognized constant type '{0}'.";
+       public const string UnsupportedIDictionaryAsDataMemberType = "Cannot deserialize one of the DataMember because it is an IDictionary. Use IDictionary<K,V> instead.";
+       public const string ValueMustBeNonNegative = "The value of this argument must be non-negative.";
+       public const string ValueTypeCannotBeNull = "ValueType '{0}' cannot be null.";
+       public const string ValueTypeCannotHaveBaseType = "Data contract '{0}' from namespace '{1}' is a value type and cannot have base contract '{2}' from namespace '{3}'.";
+       public const string ValueTypeCannotHaveId = "ValueType '{0}' cannot have id.";
+       public const string ValueTypeCannotHaveIsReference = "Value type '{0}' cannot have the IsReference setting of '{1}'. Either change the setting to '{2}', or remove it completely.";
+       public const string ValueTypeCannotHaveRef = "ValueType '{0}' cannot have ref to another object.";
+       public const string XmlElementAttributes = "Only Element nodes have attributes.";
+       public const string XmlForObjectCannotHaveContent = "Element {0} from namespace {1} cannot have child contents to be deserialized as an object. Please use XElement to deserialize this pattern of XML.";
+       public const string XmlInvalidConversion = "The value '{0}' cannot be parsed as the type '{1}'.";
+       public const string XmlInvalidConversionWithoutValue = "The value cannot be parsed as the type '{0}'.";
+       public const string XmlStartElementExpected = "Start element expected. Found {0}.";
+       public const string XmlWriterMustBeInElement = "WriteState '{0}' not valid. Caller must write start element before serializing in contentOnly mode.";
+       public const string OffsetExceedsBufferSize = "The specified offset exceeds the buffer size ({0} bytes).";
+       public const string SizeExceedsRemainingBufferSpace = "The specified size exceeds the remaining buffer space ({0} bytes).";
+       public const string ValueMustBeInRange = "The value of this argument must fall within the range {0} to {1}.";
+       public const string XmlArrayTooSmallOutput = "Array too small.  Must be able to hold at least {0}.";
+       public const string XmlInvalidBase64Length = "Base64 sequence length ({0}) not valid. Must be a multiple of 4.";
+       public const string XmlInvalidBase64Sequence = "The characters '{0}' at offset {1} are not a valid Base64 sequence.";
+       public const string XmlInvalidBinHexLength = "BinHex sequence length ({0}) not valid. Must be a multiple of 2.";
+       public const string XmlInvalidBinHexSequence = "The characters '{0}' at offset {1} are not a valid BinHex sequence.";
+       public const string XmlInvalidHighSurrogate = "High surrogate char '0x{0}' not valid. High surrogate chars range from 0xD800 to 0xDBFF.";
+       public const string XmlInvalidLowSurrogate = "Low surrogate char '0x{0}' not valid. Low surrogate chars range from 0xDC00 to 0xDFFF.";
+       public const string XmlInvalidSurrogate = "Surrogate char '0x{0}' not valid. Surrogate chars range from 0x10000 to 0x10FFFF.";
+       public const string CombinedPrefixNSLength = "The combined length of the prefix and namespace must not be greater than {0}.";
+       public const string InvalidInclusivePrefixListCollection = "The inclusive namespace prefix collection cannot contain null as one of the items.";
+       public const string InvalidLocalNameEmpty = "The empty string is not a valid local name.";
+       public const string XmlArrayTooSmall = "Array too small.";
+       public const string XmlArrayTooSmallInput = "Array too small.  Length of available data must be at least {0}.";
+       public const string XmlBadBOM = "Unrecognized Byte Order Mark.";
+       public const string XmlBase64DataExpected = "Base64 encoded data expected. Found {0}.";
+       public const string XmlCDATAInvalidAtTopLevel = "CData elements not valid at top level of an XML document.";
+       public const string XmlCloseCData = "']]>' not valid in text node content.";
+       public const string XmlConversionOverflow = "The value '{0}' cannot be represented with the type '{1}'.";
+       public const string XmlDeclarationRequired = "An XML declaration with an encoding is required for all non-UTF8 documents.";
+       public const string XmlDeclMissingVersion = "Version not found in XML declaration.";
+       public const string XmlDeclMissing = "An XML declaration is required for all non-UTF8 documents.";
+       public const string XmlDeclNotFirst = "No characters can appear before the XML declaration.";
+       public const string XmlDictionaryStringIDRange = "XmlDictionaryString IDs must be in the range from {0} to {1}.";
+       public const string XmlDictionaryStringIDUndefinedSession = "XmlDictionaryString ID {0} not defined in the XmlBinaryReaderSession.";
+       public const string XmlDictionaryStringIDUndefinedStatic = "XmlDictionaryString ID {0} not defined in the static dictionary.";
+       public const string XmlDuplicateAttribute = "Duplicate attribute found. Both '{0}' and '{1}' are from the namespace '{2}'.";
+       public const string XmlEmptyNamespaceRequiresNullPrefix = "The empty namespace requires a null or empty prefix.";
+       public const string XmlEncodingMismatch = "The encoding in the declaration '{0}' does not match the encoding of the document '{1}'.";
+       public const string XmlEncodingNotSupported = "XML encoding not supported.";
+       public const string XmlEndElementExpected = "End element '{0}' from namespace '{1}' expected. Found {2}.";
+       public const string XmlEndElementNoOpenNodes = "No corresponding start element is open.";
+       public const string XmlExpectedEncoding = "The expected encoding '{0}' does not match the actual encoding '{1}'.";
+       public const string XmlFoundCData = "cdata '{0}'";
+       public const string XmlFoundComment = "comment '{0}'";
+       public const string XmlFoundElement = "element '{0}' from namespace '{1}'";
+       public const string XmlFoundEndElement = "end element '{0}' from namespace '{1}'";
+       public const string XmlFoundEndOfFile = "end of file";
+       public const string XmlFoundNodeType = "node {0}";
+       public const string XmlFoundText = "text '{0}'";
+       public const string XmlFullStartElementExpected = "Non-empty start element expected. Found {0}.";
+       public const string XmlFullStartElementLocalNameNsExpected = "Non-empty start element '{0}' from namespace '{1}' expected. Found {2}.";
+       public const string XmlFullStartElementNameExpected = "Non-empty start element '{0}' expected. Found {1}.";
+       public const string XmlIDDefined = "ID already defined.";
+       public const string XmlKeyAlreadyExists = "The specified key already exists in the dictionary.";
+       public const string XmlIllegalOutsideRoot = "Text cannot be written outside the root element.";
+       public const string XmlInvalidBytes = "Invalid byte encoding.";
+       public const string XmlInvalidCharRef = "Character reference not valid.";
+       public const string XmlInvalidCommentChars = "XML comments cannot contain '--' or end with '-'.";
+       public const string XmlInvalidDeclaration = "XML declaration can only be written at the beginning of the document.";
+       public const string XmlInvalidDepth = "Cannot call '{0}' while Depth is '{1}'.";
+       public const string XmlInvalidEncoding = "XML encoding must be 'UTF-8'.";
+       public const string XmlInvalidFFFE = "Characters with hexadecimal values 0xFFFE and 0xFFFF are not valid.";
+       public const string XmlInvalidFormat = "The input source is not correctly formatted.";
+       public const string XmlInvalidID = "ID must be >= 0.";
+       public const string XmlInvalidOperation = "The reader cannot be advanced.";
+       public const string XmlInvalidPrefixState = "A prefix cannot be defined while WriteState is '{0}'.";
+       public const string XmlInvalidQualifiedName = "Expected XML qualified name. Found '{0}'.";
+       public const string XmlInvalidRootData = "The data at the root level is invalid.";
+       public const string XmlInvalidStandalone = "'standalone' value in declaration must be 'yes' or 'no'.";
+       public const string XmlInvalidStream = "Stream returned by IStreamProvider cannot be null.";
+       public const string XmlInvalidUniqueId = "UniqueId cannot be zero length.";
+       public const string XmlInvalidUTF8Bytes = "'{0}' contains invalid UTF8 bytes.";
+       public const string XmlInvalidVersion = "XML version must be '1.0'.";
+       public const string XmlInvalidWriteState = "'{0}' cannot be called while WriteState is '{1}'.";
+       public const string XmlInvalidXmlByte = "The byte 0x{0} is not valid at this location.";
+       public const string XmlInvalidXmlSpace = "'{0}' is not a valid xml:space value. Valid values are 'default' and 'preserve'.";
+       public const string XmlLineInfo = "Line {0}, position {1}.";
+       public const string XmlMalformedDecl = "Malformed XML declaration.";
+       public const string XmlMaxArrayLengthExceeded = "The maximum array length quota ({0}) has been exceeded while reading XML data. This quota may be increased by changing the MaxArrayLength property on the XmlDictionaryReaderQuotas object used when creating the XML reader.";
+       public const string XmlMaxNameTableCharCountExceeded = "The maximum nametable character count quota ({0}) has been exceeded while reading XML data. The nametable is a data structure used to store strings encountered during XML processing - long XML documents with non-repeating element names, attribute names and attribute values may trigger this quota. This quota may be increased by changing the MaxNameTableCharCount property on the XmlDictionaryReaderQuotas object used when creating the XML reader.";
+       public const string XmlMethodNotSupported = "This XmlWriter implementation does not support the '{0}' method.";
+       public const string XmlMissingLowSurrogate = "The surrogate pair is invalid. Missing a low surrogate character.";
+       public const string XmlMultipleRootElements = "There are multiple root elements.";
+       public const string XmlNamespaceNotFound = "The namespace '{0}' is not defined.";
+       public const string XmlNestedArraysNotSupported = "Nested arrays are not supported.";
+       public const string XmlNoRootElement = "The document does not have a root element.";
+       public const string XmlOnlyOneRoot = "Only one root element is permitted per document.";
+       public const string XmlOnlyWhitespace = "Only white space characters can be written with this method.";
+       public const string XmlOnlySingleValue = "Only a single typed value may be written inside an attribute or content.";
+       public const string XmlPrefixBoundToNamespace = "The prefix '{0}' is bound to the namespace '{1}' and cannot be changed to '{2}'.";
+       public const string XmlProcessingInstructionNotSupported = "Processing instructions (other than the XML declaration) and DTDs are not supported.";
+       public const string XmlReservedPrefix = "Prefixes beginning with \"xml\" (regardless of casing) are reserved for use by XML.";
+       public const string XmlSpaceBetweenAttributes = "Whitespace must appear between attributes.";
+       public const string XmlSpecificBindingNamespace = "The namespace '{1}' can only be bound to the prefix '{0}'.";
+       public const string XmlSpecificBindingPrefix = "The prefix '{0}' can only be bound to the namespace '{1}'.";
+       public const string XmlStartElementLocalNameNsExpected = "Start element '{0}' from namespace '{1}' expected. Found {2}.";
+       public const string XmlStartElementNameExpected = "Start element '{0}' expected. Found {1}.";
+       public const string XmlTagMismatch = "Start element '{0}' does not match end element '{1}'.";
+       public const string XmlTokenExpected = "The token '{0}' was expected but found '{1}'.";
+       public const string XmlUndefinedPrefix = "The prefix '{0}' is not defined.";
+       public const string XmlUnexpectedEndElement = "No matching start tag for end element.";
+       public const string XmlUnexpectedEndOfFile = "Unexpected end of file. Following elements are not closed: {0}.";
+       public const string XmlWriterClosed = "The XmlWriter is closed.";
+       public const string Xml_InvalidNmToken = "Invalid NmToken value '{0}'.";
 }
-}
-
-/*
-namespace System.Text
-{
-       static partial class SR
-       {
-        internal static string GetString(string name, params object[] args)
-        {
-                return GetString (CultureInfo.InvariantCulture, name, args);
-        }
-
-        internal static string GetString(CultureInfo culture, string name, params object[] args) {
-                return string.Format (culture, name, args);
-        }
-
-        internal static string GetString(string name)
-        {
-                return name;
-        }
-
-        internal static string GetString(CultureInfo culture, string name)
-        {
-                return name;
-        }
-}
-}
-
-namespace System.Xml
-{
-       static partial class SR
-       {
-        internal static string GetString(string name, params object[] args)
-        {
-                return GetString (CultureInfo.InvariantCulture, name, args);
-        }
-
-        internal static string GetString(CultureInfo culture, string name, params object[] args) {
-                return string.Format (culture, name, args);
-        }
-
-        internal static string GetString(string name)
-        {
-                return name;
-        }
-
-        internal static string GetString(CultureInfo culture, string name)
-        {
-                return name;
-        }
-}
-}
-*/
-#endregion
-
-
-#region "retrieved string resources"
-
-namespace System.Runtime.Serialization
-{
-       static partial class SR {
-
-
-public const string ArrayExceededSize = @"Array length '{0}' provided by the get-only collection of type '{1}' is less than the number of array elements found in the input stream.  Consider increasing the length of the array.";
-public const string ArrayExceededSizeAttribute = @"Array length '{0}' provided by Size attribute is not equal to the number of array elements '{1}' from namespace '{2}' found.";
-public const string ArrayTypeIsNotSupported = @"An internal error has occurred. '{0}[]' is not supported when generating code for serialization.";
-public const string CannotDeserializeRefAtTopLevel = @"Cannot deserialize since root element references unrecognized object with id '{0}'.";
-public const string CannotLoadMemberType = @"Cannot load member type '{0}'.";
-public const string CannotSerializeObjectWithCycles = @"Object graph for type '{0}' contains cycles and cannot be serialized if references are not tracked. Consider using the DataContractAttribute with the IsReference property set to true.";
-public const string CanOnlyStoreIntoArgOrLocGot0 = @"An internal error has occurred. Data can only be stored into ArgBuilder or LocalBuilder. Got: {0}.";
-public const string CharIsInvalidPrimitive = @"An internal error has occurred. Char is not a valid schema primitive and should be treated as int in DataContract.";
-public const string CallbackMustReturnVoid = @"Serialization Callback '{1}' in type '{0}' must return void. ";
-public const string CallbackParameterInvalid = @"Serialization Callback '{1}' in type '{0}' must have a single parameter of type '{2}'. ";
-public const string CallbacksCannotBeVirtualMethods = @"Virtual Method '{0}' of type '{1}' cannot be marked with '{2}' attribute. ";
-public const string CollectionMustHaveAddMethod = @"Collection type '{0}' does not have a valid Add method.";
-public const string CollectionMustHaveGetEnumeratorMethod = @"Collection type '{0}' does not have a valid GetEnumerator method.";
-public const string CollectionMustHaveItemType = @"Collection type '{0}' must have a non-null item type.";
-public const string CollectionTypeCannotBeBuiltIn = @"{0} is a built-in type and cannot be a collection.";
-public const string CollectionTypeCannotHaveDataContract = @"{0} has DataContractAttribute attribute.";
-public const string CollectionTypeDoesNotHaveAddMethod = @"{0} does not have a valid Add method with parameter of type '{1}'.";
-public const string CollectionTypeDoesNotHaveDefaultCtor = @"{0} does not have a default constructor.";
-public const string CollectionTypeHasMultipleDefinitionsOfInterface = @"{0} has multiple definitions of interface '{1}'.";
-public const string CollectionTypeIsNotIEnumerable = @"{0} does not implement IEnumerable interface.";
-public const string DataContractCacheOverflow = @"An internal error has occurred. DataContract cache overflow.";
-public const string DataContractNamespaceAlreadySet = @"ContractNamespaceAttribute attribute maps CLR namespace '{2}' to multiple data contract namespaces '{0}' and '{1}'. You can map a CLR namespace to only one data contract namespace.";
-public const string DataContractNamespaceIsNotValid = @"DataContract namespace '{0}' is not a valid URI.";
-public const string DataContractNamespaceReserved = @"DataContract namespace '{0}' cannot be specified since it is reserved.";
-public const string DataMemberOnEnumField = @"Member '{0}.{1}' has DataMemberAttribute attribute. Use EnumMemberAttribute attribute instead.";
-public const string DcTypeNotFoundOnDeserialize = @"Element '{2}:{3}' contains data of the '{0}:{1}' data contract. The deserializer has no knowledge of any type that maps to this contract. Add the type corresponding to '{1}' to the list of known types - for example, by using the KnownTypeAttribute attribute or by adding it to the list of known types passed to DataContractSerializer.";
-public const string DcTypeNotFoundOnSerialize = @"Type '{0}' with data contract name '{1}:{2}' is not expected. Add any types not known statically to the list of known types - for example, by using the KnownTypeAttribute attribute or by adding them to the list of known types passed to DataContractSerializer.";
-public const string DcTypeNotResolvedOnDeserialize = @"Element '{2}:{3}' contains data from a type that maps to the name '{0}:{1}'. The deserializer has no knowledge of any type that maps to this name. Consider changing the implementation of the ResolveName method on your DataContractResolver to return a non-null value for name '{1}' and namespace '{0}'.";
-public const string DeserializedObjectWithIdNotFound = @"Deserialized object with reference id '{0}' not found in stream.";
-public const string DupContractInKnownTypes = @"Type '{0}' cannot be added to list of known types since another type '{1}' with the same data contract name '{2}:{3}' is already present.";
-public const string DupKeyValueName = @"The collection data contract type '{0}' specifies the same value '{1}' for both the KeyName and the ValueName properties. This is not allowed. Consider changing either the KeyName or the ValueName property.";
-public const string DupEnumMemberValue = @"Type '{2}' contains two members '{0}' 'and '{1}' with the same name '{3}'. Multiple members with the same name in one type are not supported. Consider changing one of the member names using EnumMemberAttribute attribute.";
-public const string DupMemberName = @"Type '{2}' contains two members '{0}' 'and '{1}' with the same data member name '{3}'. Multiple members with the same name in one type are not supported. Consider changing one of the member names using DataMemberAttribute attribute.";
-public const string DuplicateAttribute = @"Invalid Callback. Method '{3}' in type '{2}' has both '{0}' and '{1}'. ";
-public const string DuplicateCallback = @"Invalid attribute. Both '{0}' and '{1}' in type '{2}' have '{3}'. ";
-public const string EncounteredWithNameNamespace = @"{0}. Encountered '{1}'  with name '{2}', namespace '{3}'.";
-public const string EnumTypeCannotHaveIsReference = @"Enum type '{0}' cannot have the IsReference setting of '{1}'. Either change the setting to '{2}', or remove it completely.";
-public const string ErrorDeserializing = @"There was an error deserializing the object {0}. {1}";
-public const string ErrorInLine = @"Error in line {0} position {1}.";
-public const string ErrorIsStartObject = @"There was an error checking start element of object {0}. {1}";
-public const string ErrorSerializing = @"There was an error serializing the object {0}. {1}";
-public const string ErrorTypeInfo = @"of type {0}";
-public const string ErrorWriteEndObject = @"There was an error writing end element of object {0}. {1}";
-public const string ErrorWriteStartObject = @"There was an error writing start element of object {0}. {1}";
-public const string ExceededMaxItemsQuota = @"Maximum number of items that can be serialized or deserialized in an object graph is '{0}'.";
-public const string ExpectingElement = @"Expecting element '{1}' from namespace '{0}'.";
-public const string ExpectingElementAtDeserialize = @"Expecting state '{0}' when ReadObject is called.";
-public const string ExpectingEnd = @"Expecting End'{0}'.";
-public const string ExpectingState = @"Expecting state '{0}'.";
-public const string GenericNameBraceMismatch = @"The data contract name '{0}' for type '{1}' has a curly brace '{{' that is not matched with a closing curly brace. Curly braces have special meaning in data contract names - they are used to customize the naming of data contracts for generic types.";
-public const string GenericParameterNotValid = @"In the data contract name for type '{1}', there are curly braces with '{0}' inside, which is an invalid value. Curly braces have special meaning in data contract names - they are used to customize the naming of data contracts for generic types. Based on the number of generic parameters this type has, the contents of the curly braces must either be a number between 0 and '{2}' to insert the name of the generic parameter at that index or the '#' symbol to insert a digest of the generic parameter namespaces.";
-public const string InconsistentIsReference = @"The IsReference setting for type '{0}' is '{1}', but the same setting for its parent class '{2}' is '{3}'. Derived types must have the same value for IsReference as the base type. Change the setting on type '{0}' to '{3}', or on type '{2}' to '{1}', or do not set IsReference explicitly.";
-public const string IndexedPropertyCannotBeSerialized = @"Property '{1}' in type '{0}' cannot be serialized because serialization of indexed properties is not supported.";
-public const string InterfaceTypeCannotBeCreated = @"Interface type '{0}' cannot be created. Consider replacing with a non-interface serializable type.";
-public const string InvalidCollectionContractItemName = @"Type '{0}' cannot have CollectionDataContractAttribute attribute ItemName set to null or empty string.";
-public const string InvalidCollectionContractKeyName = @"Type '{0}' cannot have CollectionDataContractAttribute attribute KeyName set to null or empty string.";
-public const string InvalidCollectionContractKeyNoDictionary = @"The collection data contract type '{0}' specifies '{1}' for the KeyName property. This is not allowed since the type is not IDictionary. Remove the setting for the KeyName property.";
-public const string InvalidCollectionContractName = @"Type '{0}' cannot have CollectionDataContractAttribute attribute Name set to null or empty string.";
-public const string InvalidCollectionContractNamespace = @"Type '{0}' cannot have CollectionDataContractAttribute attribute Namespace set to null.";
-public const string InvalidCollectionContractValueName = @"Type '{0}' cannot have CollectionDataContractAttribute attribute ValueName set to null or empty string.";
-public const string InvalidCollectionContractValueNoDictionary = @"The collection data contract type '{0}' specifies '{1}' for the ValueName property. This is not allowed since the type is not IDictionary. Remove the setting for the ValueName property.";
-public const string InvalidCollectionDataContract = @"Type '{0}' with CollectionDataContractAttribute attribute is an invalid collection type since it";
-public const string InvalidCollectionType = @"Type '{0}' is an invalid collection type since it";
-public const string InvalidDataContractName = @"Type '{0}' cannot have DataContractAttribute attribute Name set to null or empty string.";
-public const string InvalidDataContractNamespace = @"Type '{0}' cannot have DataContractAttribute attribute Namespace set to null.";
-public const string InvalidDataMemberName = @"Member '{0}' in type '{1}' cannot have DataMemberAttribute attribute Name set to null or empty string.";
-public const string InvalidEnumMemberValue = @"'{0}' in type '{1}' cannot have EnumMemberAttribute attribute Value set to null or empty string.";
-public const string InvalidEnumValueOnRead = @"Invalid enum value '{0}' cannot be deserialized into type '{1}'. Ensure that the necessary enum values are present and are marked with EnumMemberAttribute attribute if the type has DataContractAttribute attribute.";
-public const string InvalidEnumValueOnWrite = @"Enum value '{0}' is invalid for type '{1}' and cannot be serialized. Ensure that the necessary enum values are present and are marked with EnumMemberAttribute attribute if the type has DataContractAttribute attribute.";
-public const string InvalidGetSchemaMethod = @"Type '{0}' cannot have MethodName on XmlSchemaProviderAttribute attribute set to null or empty string. ";
-public const string InvalidGlobalDataContractNamespace = @"CLR namespace '{0}' cannot have ContractNamespace set to null.";
-public const string InvalidMember = @"Member '{0}.{1}' cannot be serialized since it is neither a field nor a property, and therefore cannot be marked with the DataMemberAttribute attribute. Remove the DataMemberAttribute attribute from the '{1}' member.";
-public const string InvalidNonNullReturnValueByIsAny = @"Method '{0}.{1}()' returns a non-null value. The return value must be null since IsAny=true.";
-public const string InvalidPrimitiveType = @"Type '{0}' is not a valid serializable type.";
-public const string InvalidReturnTypeOnGetSchemaMethod = @"Method '{0}.{1}()' returns '{2}'. The return type must be compatible with '{3}'.";
-public const string InvalidSizeDefinition = @"Invalid Size '{0}'. Must be non-negative integer.";
-public const string InvalidXmlDataContractName = @"XML data contract Name for type '{0}' cannot be set to null or empty string.";
-public const string InvalidXsIdDefinition = @"Invalid Id '{0}'. Must not be null or empty.";
-public const string InvalidXsRefDefinition = @"Invalid Ref '{0}'. Must not be null or empty.";
-public const string IsAnyCannotBeNull = @"A null value cannot be serialized at the top level for IXmlSerializable root type '{0}' since its IsAny setting is 'true'. This type must write all its contents including the root element. Verify that the IXmlSerializable implementation is correct.";
-public const string IsAnyCannotBeSerializedAsDerivedType = @"An object of type '{0}' cannot be serialized at the top level for IXmlSerializable root type '{1}' since its IsAny setting is 'true'. This type must write all its contents including the root element. Verify that the IXmlSerializable implementation is correct.";
-public const string IsAnyCannotHaveXmlRoot = @"Type '{0}' cannot specify an XmlRootAttribute attribute because its IsAny setting is 'true'. This type must write all its contents including the root element. Verify that the IXmlSerializable implementation is correct.";
-public const string IsNotAssignableFrom = @"An internal error has occurred. '{0}' is not assignable from '{1}' - error generating code for serialization.";
-public const string IsRequiredDataMemberOnIsReferenceDataContractType = @"'{0}.{1}' has the IsRequired setting of '{2}. However, '{0}' has the IsReference setting of '{2}', because either it is set explicitly, or it is derived from a base class. Set IsRequired on '{0}.{1}' to false, or disable IsReference on '{0}'.";
-public const string IXmlSerializableCannotHaveCollectionDataContract = @"Type '{0}' cannot be IXmlSerializable and have CollectionDataContractAttribute attribute.";
-public const string IXmlSerializableCannotHaveDataContract = @"Type '{0}' cannot be IXmlSerializable and have DataContractAttribute attribute.";
-public const string IXmlSerializableIllegalOperation = @"This method cannot be called from IXmlSerializable implementations.";
-public const string IXmlSerializableMissingEndElements = @"IXmlSerializable.WriteXml method of type '{0}' did not close all open tags. Verify that the IXmlSerializable implementation is correct.";
-public const string IXmlSerializableMustHaveDefaultConstructor = @"IXmlSerializable Type '{0}' must have default constructor.";
-public const string IXmlSerializableWritePastSubTree = @"IXmlSerializable.WriteXml method of type '{0}' attempted to close too many tags.  Verify that the IXmlSerializable implementation is correct.";
-public const string KnownTypeAttributeEmptyString = @"Method name specified by KnownTypeAttribute attribute on type '{0}' cannot be the empty string.";
-public const string KnownTypeAttributeUnknownMethod = @"KnownTypeAttribute attribute on type '{1}' specifies a method named '{0}' to provide known types. Static method '{0}()' was not found on this type. Ensure that the method exists and is marked as static.";
-public const string KnownTypeAttributeReturnType = @"KnownTypeAttribute attribute on type '{0}' specifies a method named '{1}' to provide known types. The return type of this method is invalid because it is not assignable to IEnumerable<Type>. Ensure that the method exists and has a valid signature.";
-public const string KnownTypeAttributeOneScheme = @"Type '{0}': If a KnownTypeAttribute attribute specifies a method it must be the only KnownTypeAttribute attribute on that type.";
-public const string KnownTypeAttributeNoType = @"KnownTypeAttribute attribute on type '{0}' contains no Type.";
-public const string KnownTypeConfigClosedGenericDeclared = @"Declared type '{0}' in config cannot be a closed or partial generic type.";
-public const string KnownTypeAttributeValidMethodTypes = @"Method specified by KnownTypeAttribute attribute on type '{0}' does not expose valid types.";
-public const string KnownTypeAttributeNoData = @"KnownTypeAttribute attribute on type '{0}' contains no data.";
-public const string KnownTypeAttributeMethodNull = @"Method specified by KnownTypeAttribute attribute on type '{0}' returned null.";
-public const string MaxArrayLengthExceeded = @"The maximum array length ({0}) has been exceeded while reading XML data for array of type '{1}'.";
-public const string MissingGetSchemaMethod = @"Type '{0}' does not have a static method '{1}' that takes a parameter of type 'System.Xml.Schema.XmlSchemaSet' as specified by the XmlSchemaProviderAttribute attribute.";
-public const string MultipleIdDefinition = @"Invalid XML encountered. The same Id value '{0}' is defined more than once. Multiple objects cannot be deserialized using the same Id.";
-public const string NoConversionPossibleTo = @"An internal error has occurred. No conversion is possible to '{0}' - error generating code for serialization.";
-public const string NoGetMethodForProperty = @"No get method for property '{1}' in type '{0}'.";
-public const string NoSetMethodForProperty = @"No set method for property '{1}' in type '{0}'.";
-public const string NullKnownType = @"One of the known types provided to the serializer via '{0}' argument was invalid because it was null. All known types specified must be non-null values.";
-public const string NullValueReturnedForGetOnlyCollection = @"The get-only collection of type '{0}' returned a null value.  The input stream contains collection items which cannot be added if the instance is null.  Consider initializing the collection either in the constructor of the the object or in the getter.";
-public const string ObjectTableOverflow = @"An internal error has occurred. Object table overflow. This could be caused by serializing or deserializing extremely large object graphs.";
-public const string OrderCannotBeNegative = @"Property 'Order' in DataMemberAttribute attribute cannot be a negative number.";
-public const string ParameterCountMismatch = @"Invalid number of parameters to call method '{0}'. Expected '{1}' parameters, but '{2}' were provided.";
-public const string PartialTrustCollectionContractAddMethodNotPublic = @"The collection data contract type '{0}' cannot be deserialized because the method '{1}' is not public. Making the method public will fix this error. Alternatively, you can make it internal, and use the InternalsVisibleToAttribute attribute on your assembly in order to enable serialization of internal members - see documentation for more details. Be aware that doing so has certain security implications.";
-public const string PartialTrustCollectionContractNoPublicConstructor = @"The collection data contract type '{0}' cannot be deserialized because it does not have a public parameterless constructor. Adding a public parameterless constructor will fix this error. Alternatively, you can make it internal, and use the InternalsVisibleToAttribute attribute on your assembly in order to enable serialization of internal members - see documentation for more details. Be aware that doing so has certain security implications.";
-public const string PartialTrustCollectionContractTypeNotPublic = @"The collection data contract type '{0}' cannot be deserialized because it does not have a public parameterless constructor. Adding a public parameterless constructor will fix this error. Alternatively, you can make it internal, and use the InternalsVisibleToAttribute attribute on your assembly in order to enable serialization of internal members - see documentation for more details. Be aware that doing so has certain security implications.";
-public const string PartialTrustDataContractOnSerializingNotPublic = @"The data contract type '{0}' cannot be serialized because the OnSerializing method '{1}' is not public. Making the method public will fix this error. Alternatively, you can make it internal, and use the InternalsVisibleToAttribute attribute on your assembly in order to enable serialization of internal members - see documentation for more details. Be aware that doing so has certain security implications.";
-public const string PartialTrustDataContractOnSerializedNotPublic = @"The data contract type '{0}' cannot be serialized because the OnSerialized method '{1}' is not public. Making the method public will fix this error. Alternatively, you can make it internal, and use the InternalsVisibleToAttribute attribute on your assembly in order to enable serialization of internal members - see documentation for more details. Be aware that doing so has certain security implications.";
-public const string PartialTrustDataContractOnDeserializingNotPublic = @"The data contract type '{0}' cannot be deserialized because the OnDeserializing method '{1}' is not public. Making the method public will fix this error. Alternatively, you can make it internal, and use the InternalsVisibleToAttribute attribute on your assembly in order to enable serialization of internal members - see documentation for more details. Be aware that doing so has certain security implications.";
-public const string PartialTrustDataContractOnDeserializedNotPublic = @"The data contract type '{0}' cannot be deserialized because the OnDeserialized method '{1}' is not public. Making the method public will fix this error. Alternatively, you can make it internal, and use the InternalsVisibleToAttribute attribute on your assembly in order to enable serialization of internal members - see documentation for more details. Be aware that doing so has certain security implications.";
-public const string PartialTrustDataContractFieldGetNotPublic = @"The data contract type '{0}' cannot be serialized because the member '{1}' is not public. Making the member public will fix this error. Alternatively, you can make it internal, and use the InternalsVisibleToAttribute attribute on your assembly in order to enable serialization of internal members - see documentation for more details. Be aware that doing so has certain security implications.";
-public const string PartialTrustDataContractFieldSetNotPublic = @"The data contract type '{0}' cannot be deserialized because the member '{1}' is not public. Making the member public will fix this error. Alternatively, you can make it internal, and use the InternalsVisibleToAttribute attribute on your assembly in order to enable serialization of internal members - see documentation for more details. Be aware that doing so has certain security implications.";
-public const string PartialTrustDataContractPropertyGetNotPublic = @"The data contract type '{0}' cannot be serialized because the property '{1}' does not have a public getter. Adding a public getter will fix this error. Alternatively, you can make it internal, and use the InternalsVisibleToAttribute attribute on your assembly in order to enable serialization of internal members - see documentation for more details. Be aware that doing so has certain security implications.";
-public const string PartialTrustDataContractPropertySetNotPublic = @"The data contract type '{0}' cannot be deserialized because the property '{1}' does not have a public setter. Adding a public setter will fix this error. Alternatively, you can make it internal, and use the InternalsVisibleToAttribute attribute on your assembly in order to enable serialization of internal members - see documentation for more details. Be aware that doing so has certain security implications.";
-public const string PartialTrustDataContractTypeNotPublic = @"The data contract type '{0}' is not serializable because it is not public. Making the type public will fix this error. Alternatively, you can make it internal, and use the InternalsVisibleToAttribute attribute on your assembly in order to enable serialization of internal members - see documentation for more details. Be aware that doing so has certain security implications.";
-public const string PartialTrustNonAttributedSerializableTypeNoPublicConstructor = @"The type '{0}' cannot be deserialized because it does not have a public parameterless constructor. Alternatively, you can make it internal, and use the InternalsVisibleToAttribute attribute on your assembly in order to enable serialization of internal members - see documentation for more details. Be aware that doing so has certain security implications.";
-public const string PartialTrustIXmlSerializableTypeNotPublic = @"The IXmlSerializable type '{0}' is not serializable in partial trust because it is not public. Adding a public parameterless constructor will fix this error. Alternatively, you can make it internal, and use the InternalsVisibleToAttribute attribute on your assembly in order to enable serialization of internal members - see documentation for more details. Be aware that doing so has certain security implications.";
-public const string PartialTrustIXmlSerialzableNoPublicConstructor = @"The IXmlSerializable type '{0}' cannot be deserialized because it does not have a public parameterless constructor. Adding a public parameterless constructor will fix this error. Alternatively, you can make it internal, and use the InternalsVisibleToAttribute attribute on your assembly in order to enable serialization of internal members - see documentation for more details. Be aware that doing so has certain security implications.";
-public const string NonAttributedSerializableTypesMustHaveDefaultConstructor = @"The Type '{0}' must have a parameterless constructor.";
-public const string AttributedTypesCannotInheritFromNonAttributedSerializableTypes = @"Type '{0}' cannot inherit from a type that is not marked with DataContractAttribute or SerializableAttribute.  Consider marking the base type '{1}' with DataContractAttribute or SerializableAttribute, or removing them from the derived type.";
-public const string GetOnlyCollectionsNotSupported = @"Get-only collection properties are not supported.  Consider adding a public setter to property '{0}.{1}' or marking the it with the IgnoreDataMemberAttribute. ";
-public const string QuotaMustBePositive = @"Quota must be a positive value.";
-public const string QuotaIsReadOnly = @"The '{0}' quota is readonly.";
-public const string QuotaCopyReadOnly = @"Cannot copy XmlDictionaryReaderQuotas. Target is readonly.";
-public const string RequiredMemberMustBeEmitted = @"Member {0} in type {1} cannot be serialized. This exception is usually caused by trying to use a null value where a null value is not allowed. The '{0}' member is set to its default value (usually null or zero). The member's EmitDefault setting is 'false', indicating that the member should not be serialized. However, the member's IsRequired setting is 'true', indicating that it must be serialized. This conflict cannot be resolved.  Consider setting '{0}' to a non-default value. Alternatively, you can change the EmitDefaultValue property on the DataMemberAttribute attribute to true, or changing the IsRequired property to false.";
-public const string ResolveTypeReturnedFalse = @"An object of type '{0}' which derives from DataContractResolver returned false from its TryResolveType method when attempting to resolve the name for an object of type '{1}', indicating that the resolution failed. Change the TryResolveType implementation to return true.";
-public const string ResolveTypeReturnedNull = @"An object of type '{0}' which derives from DataContractResolver returned a null typeName or typeNamespace but not both from its TryResolveType method when attempting to resolve the name for an object of type '{1}'. Change the TryResolveType implementation to return non-null values, or to return null values for both typeName and typeNamespace in order to serialize as the declared type.";
-public const string SupportForMultidimensionalArraysNotPresent = @"Multi-dimensional arrays are not supported.";
-public const string TooManyCollectionContracts = @"Type '{0}' has more than one CollectionDataContractAttribute attribute.";
-public const string TooManyDataContracts = @"Type '{0}' has more than one DataContractAttribute attribute.";
-public const string TooManyDataMembers = @"Member '{0}.{1}' has more than one DataMemberAttribute attribute.";
-public const string TooManyEnumMembers = @"Member '{0}.{1}' has more than one EnumMemberAttribute attribute.";
-public const string TooManyIgnoreDataMemberAttributes = @"Member '{0}.{1}' has more than one IgnoreDataMemberAttribute attribute.";
-public const string TypeMustBeConcrete = @"Error while getting known types for Type '{0}'. The type must not be an open or partial generic class.";
-public const string TypeNotSerializable = @"Type '{0}' cannot be serialized. Consider marking it with the DataContractAttribute attribute, and marking all of its members you want serialized with the DataMemberAttribute attribute. Alternatively, you can ensure that the type is public and has a parameterless constructor - all public members of the type will then be serialized, and no attributes will be required.";
-public const string UnexpectedContractType = @"An internal error has occurred. Unexpected contract type '{0}' for type '{1}' encountered.";
-public const string UnexpectedElementExpectingElements = @"'{0}' '{1}' from namespace '{2}' is not expected. Expecting element '{3}'.";
-public const string UnexpectedEndOfFile = @"Unexpected end of file.";
-public const string UnknownConstantType = @"Unrecognized constant type '{0}'.";
-public const string UnsupportedIDictionaryAsDataMemberType = @"Cannot deserialize one of the DataMember because it is an IDictionary. Use IDictionary<K,V> instead.";
-public const string ValueMustBeNonNegative = @"The value of this argument must be non-negative.";
-public const string ValueTypeCannotBeNull = @"ValueType '{0}' cannot be null.";
-public const string ValueTypeCannotHaveBaseType = @"Data contract '{0}' from namespace '{1}' is a value type and cannot have base contract '{2}' from namespace '{3}'.";
-public const string ValueTypeCannotHaveId = @"ValueType '{0}' cannot have id.";
-public const string ValueTypeCannotHaveIsReference = @"Value type '{0}' cannot have the IsReference setting of '{1}'. Either change the setting to '{2}', or remove it completely. ";
-public const string ValueTypeCannotHaveRef = @"ValueType '{0}' cannot have ref to another object.";
-public const string XmlElementAttributes = @"Only Element nodes have attributes.";
-public const string XmlForObjectCannotHaveContent = @"Element {0} from namespace {1} cannot have child contents to be deserialized as an object. Please use XElement to deserialize this pattern of XML.";
-public const string XmlInvalidConversion = @"The value '{0}' cannot be parsed as the type '{1}'.";
-public const string XmlInvalidConversionWithoutValue = @"The value cannot be parsed as the type '{0}'.";
-public const string XmlStartElementExpected = @"Start element expected. Found {0}.";
-public const string XmlWriterMustBeInElement = @"WriteState '{0}' not valid. Caller must write start element before serializing in contentOnly mode.";
-
-       }
-}
-
-namespace System.Runtime.Serialization
-{
-       static partial class SR {
-
-public const string OffsetExceedsBufferSize = @"The specified offset exceeds the buffer size ({0} bytes).";
-public const string SizeExceedsRemainingBufferSpace = @"The specified size exceeds the remaining buffer space ({0} bytes).";
-public const string ValueMustBeInRange = @"The value of this argument must fall within the range {0} to {1}.";
-public const string XmlArrayTooSmallOutput = @"Array too small.  Must be able to hold at least {0}.";
-public const string XmlInvalidBase64Length = @"Base64 sequence length ({0}) not valid. Must be a multiple of 4.";
-public const string XmlInvalidBase64Sequence = @"The characters '{0}' at offset {1} are not a valid Base64 sequence.";
-public const string XmlInvalidBinHexLength = @"BinHex sequence length ({0}) not valid. Must be a multiple of 2.";
-public const string XmlInvalidBinHexSequence = @"The characters '{0}' at offset {1} are not a valid BinHex sequence.";
-public const string XmlInvalidHighSurrogate = @"High surrogate char '0x{0}' not valid. High surrogate chars range from 0xD800 to 0xDBFF.";
-public const string XmlInvalidLowSurrogate = @"Low surrogate char '0x{0}' not valid. Low surrogate chars range from 0xDC00 to 0xDFFF.";
-public const string XmlInvalidSurrogate = @"Surrogate char '0x{0}' not valid. Surrogate chars range from 0x10000 to 0x10FFFF.";
-
-       }
-}
-
-namespace System.Runtime.Serialization
-{
-       static partial class SR {
-
-public const string CombinedPrefixNSLength = @"The combined length of the prefix and namespace must not be greater than {0}.";
-public const string InvalidInclusivePrefixListCollection = @"The inclusive namespace prefix collection cannot contain null as one of the items.";
-public const string InvalidLocalNameEmpty = @"The empty string is not a valid local name.";
-public const string XmlArrayTooSmall = @"Array too small.";
-public const string XmlArrayTooSmallInput = @"Array too small.  Length of available data must be at least {0}.";
-public const string XmlBadBOM = @"Unrecognized Byte Order Mark.";
-public const string XmlBase64DataExpected = @"Base64 encoded data expected. Found {0}.";
-public const string XmlCDATAInvalidAtTopLevel = @"CData elements not valid at top level of an XML document.";
-public const string XmlCloseCData = @"']]>' not valid in text node content.";
-public const string XmlConversionOverflow = @"The value '{0}' cannot be represented with the type '{1}'.";
-public const string XmlDeclarationRequired = @"An XML declaration with an encoding is required for all non-UTF8 documents.";
-public const string XmlDeclMissingVersion = @"Version not found in XML declaration.";
-public const string XmlDeclMissing = @"An XML declaration is required for all non-UTF8 documents.";
-public const string XmlDeclNotFirst = @"No characters can appear before the XML declaration.";
-public const string XmlDictionaryStringIDRange = @"XmlDictionaryString IDs must be in the range from {0} to {1}.";
-public const string XmlDictionaryStringIDUndefinedSession = @"XmlDictionaryString ID {0} not defined in the XmlBinaryReaderSession.";
-public const string XmlDictionaryStringIDUndefinedStatic = @"XmlDictionaryString ID {0} not defined in the static dictionary.";
-public const string XmlDuplicateAttribute = @"Duplicate attribute found. Both '{0}' and '{1}' are from the namespace '{2}'.";
-public const string XmlEmptyNamespaceRequiresNullPrefix = @"The empty namespace requires a null or empty prefix.";
-public const string XmlEncodingMismatch = @"The encoding in the declaration '{0}' does not match the encoding of the document '{1}'.";
-public const string XmlEncodingNotSupported = @"XML encoding not supported.";
-public const string XmlEndElementExpected = @"End element '{0}' from namespace '{1}' expected. Found {2}.";
-public const string XmlEndElementNoOpenNodes = @"No corresponding start element is open.";
-public const string XmlExpectedEncoding = @"The expected encoding '{0}' does not match the actual encoding '{1}'.";
-public const string XmlFoundCData = @"cdata '{0}'";
-public const string XmlFoundComment = @"comment '{0}'";
-public const string XmlFoundElement = @"element '{0}' from namespace '{1}'";
-public const string XmlFoundEndElement = @"end element '{0}' from namespace '{1}'";
-public const string XmlFoundEndOfFile = @"end of file";
-public const string XmlFoundNodeType = @"node {0}";
-public const string XmlFoundText = @"text '{0}'";
-public const string XmlFullStartElementExpected = @"Non-empty start element expected. Found {0}.";
-public const string XmlFullStartElementLocalNameNsExpected = @"Non-empty start element '{0}' from namespace '{1}' expected. Found {2}.";
-public const string XmlFullStartElementNameExpected = @"Non-empty start element '{0}' expected. Found {1}.";
-public const string XmlIDDefined = @"ID already defined.";
-public const string XmlKeyAlreadyExists = @"The specified key already exists in the dictionary.";
-public const string XmlIllegalOutsideRoot = @"Text cannot be written outside the root element.";
-public const string XmlInvalidBytes = @"Invalid byte encoding.";
-public const string XmlInvalidCharRef = @"Character reference not valid.";
-public const string XmlInvalidCommentChars = @"XML comments cannot contain '--' or end with '-'.";
-public const string XmlInvalidDeclaration = @"XML declaration can only be written at the beginning of the document.";
-public const string XmlInvalidDepth = @"Cannot call '{0}' while Depth is '{1}'.";
-public const string XmlInvalidEncoding = @"XML encoding must be 'UTF-8'.";
-public const string XmlInvalidFFFE = @"Characters with hexadecimal values 0xFFFE and 0xFFFF are not valid.";
-public const string XmlInvalidFormat = @"The input source is not correctly formatted.";
-public const string XmlInvalidID = @"ID must be >= 0.";
-public const string XmlInvalidOperation = @"The reader cannot be advanced.";
-public const string XmlInvalidPrefixState = @"A prefix cannot be defined while WriteState is '{0}'.";
-public const string XmlInvalidQualifiedName = @"Expected XML qualified name. Found '{0}'.";
-public const string XmlInvalidRootData = @"The data at the root level is invalid.";
-public const string XmlInvalidStandalone = @"'standalone' value in declaration must be 'yes' or 'no'.";
-public const string XmlInvalidStream = @"Stream returned by IStreamProvider cannot be null.";
-public const string XmlInvalidUniqueId = @"UniqueId cannot be zero length.";
-public const string XmlInvalidUTF8Bytes = @"'{0}' contains invalid UTF8 bytes.";
-public const string XmlInvalidVersion = @"XML version must be '1.0'.";
-public const string XmlInvalidWriteState = @"'{0}' cannot be called while WriteState is '{1}'.";
-public const string XmlInvalidXmlByte = @"The byte 0x{0} is not valid at this location.";
-public const string XmlInvalidXmlSpace = @"'{0}' is not a valid xml:space value. Valid values are 'default' and 'preserve'.";
-public const string XmlLineInfo = @"Line {0}, position {1}.";
-public const string XmlMalformedDecl = @"Malformed XML declaration.";
-public const string XmlMaxArrayLengthExceeded = @"The maximum array length quota ({0}) has been exceeded while reading XML data. This quota may be increased by changing the MaxArrayLength property on the XmlDictionaryReaderQuotas object used when creating the XML reader.";
-
-
-public const string XmlMaxNameTableCharCountExceeded = @"The maximum nametable character count quota ({0}) has been exceeded while reading XML data. The nametable is a data structure used to store strings encountered during XML processing - long XML documents with non-repeating element names, attribute names and attribute values may trigger this quota. This quota may be increased by changing the MaxNameTableCharCount property on the XmlDictionaryReaderQuotas object used when creating the XML reader.";
-
-public const string XmlMethodNotSupported = @"This XmlWriter implementation does not support the '{0}' method.";
-public const string XmlMissingLowSurrogate = @"The surrogate pair is invalid. Missing a low surrogate character.";
-public const string XmlMultipleRootElements = @"There are multiple root elements.";
-public const string XmlNamespaceNotFound = @"The namespace '{0}' is not defined.";
-public const string XmlNestedArraysNotSupported = @"Nested arrays are not supported.";
-public const string XmlNoRootElement = @"The document does not have a root element.";
-public const string XmlOnlyOneRoot = @"Only one root element is permitted per document.";
-public const string XmlOnlyWhitespace = @"Only white space characters can be written with this method.";
-public const string XmlOnlySingleValue = @"Only a single typed value may be written inside an attribute or content.";
-public const string XmlPrefixBoundToNamespace = @"The prefix '{0}' is bound to the namespace '{1}' and cannot be changed to '{2}'.";
-public const string XmlProcessingInstructionNotSupported = @"Processing instructions (other than the XML declaration) and DTDs are not supported.";
-public const string XmlReservedPrefix = @"Prefixes beginning with ""xml"" (regardless of casing) are reserved for use by XML.";
-public const string XmlSpaceBetweenAttributes = @"Whitespace must appear between attributes.";
-public const string XmlSpecificBindingNamespace = @"The namespace '{1}' can only be bound to the prefix '{0}'.";
-public const string XmlSpecificBindingPrefix = @"The prefix '{0}' can only be bound to the namespace '{1}'.";
-public const string XmlStartElementLocalNameNsExpected = @"Start element '{0}' from namespace '{1}' expected. Found {2}.";
-public const string XmlStartElementNameExpected = @"Start element '{0}' expected. Found {1}.";
-public const string XmlTagMismatch = @"Start element '{0}' does not match end element '{1}'.";
-public const string XmlTokenExpected = @"The token '{0}' was expected but found '{1}'.";
-public const string XmlUndefinedPrefix = @"The prefix '{0}' is not defined.";
-public const string XmlUnexpectedEndElement = @"No matching start tag for end element.";
-public const string XmlUnexpectedEndOfFile = @"Unexpected end of file. Following elements are not closed: {0}.";
-public const string XmlWriterClosed = @"The XmlWriter is closed.";
-public const string Xml_InvalidNmToken = @"Invalid NmToken value '{0}'.";
-
-       }
-}
-
-#endregion
+}
\ No newline at end of file
diff --git a/mcs/class/System.Runtime.Serialization/ReferenceSources/SR.missing.cs b/mcs/class/System.Runtime.Serialization/ReferenceSources/SR.missing.cs
new file mode 100644 (file)
index 0000000..aa1b841
--- /dev/null
@@ -0,0 +1,312 @@
+using System.Globalization;
+
+namespace System.Runtime.Serialization
+{
+       static partial class SR
+       {
+               internal static string GetString(string name, params object[] args)
+               {
+                       return GetString (CultureInfo.InvariantCulture, name, args);
+               }
+
+               internal static string GetString(CultureInfo culture, string name, params object[] args)
+               {
+                       return string.Format (culture, name, args);
+               }
+
+               internal static string GetString(string name)
+               {
+                       return name;
+               }
+
+               internal static string GetString(CultureInfo culture, string name)
+               {
+                       return name;
+               }
+
+#region MissingInStrings.txt
+
+//
+// This was retrieved as follows:
+//
+// 1. mcs ReferenceSources/SR.cs -t:library -out:existing.dll
+// 2. mcs {https://raw.githubusercontent.com/mono/mono/wip-serialization-halfway/mcs/class/System.Runtime.Serialization/ReferenceSource/SR.cs} -t:library -out:full.dll
+// 3. csharp -e "System.IO.File.WriteAllLines ("existing.txt", System.Reflection.Assembly.ReflectionOnlyLoadFrom ("existing.dll").GetTypes ().SelectMany (t => t.GetFields ()).Select (f => f.Name).ToArray ())"
+// 4. csharp -e "System.IO.File.WriteAllLines ("full.txt", System.Reflection.Assembly.ReflectionOnlyLoadFrom ("full.dll").GetTypes ().SelectMany (t => t.GetFields ()).Select (f => f.Name).ToArray ())"
+// 5. csharp
+//     var existing = System.IO.File.ReadAllLines ("existing.txt");
+//     var full = System.IO.File.ReadAllLines ("full.txt");
+//  var missing = full.Where (f => !existing.Contains (f));
+//  System.IO.File.WriteAllLines ("missing.cs", missing.Select (m => "public const string " + m + " = @\"" + m + "\";").ToArray ())
+// 6. copy missing.cs contents here.
+//
+
+public const string AbstractElementNotSupported = @"Abstract element '{0}' is not supported.";
+public const string AbstractTypeNotSupported = @"Abstract type is not supported";
+public const string AmbiguousReferencedCollectionTypes1 = @"Ambiguous collection types were referenced: {0}";
+public const string AmbiguousReferencedCollectionTypes3 = @"In '{0}' element in '{1}' namespace, ambiguous collection types were referenced: {2}";
+public const string AmbiguousReferencedTypes1 = @"Ambiguous types were referenced: {0}";
+public const string AmbiguousReferencedTypes3 = @"In '{0}' element in '{1}' namespace, ambiguous types were referenced: {2}";
+public const string AnnotationAttributeNotFound = @"Annotation attribute was not found: default value annotation is '{0}', type is '{1}' in '{2}' namespace, emit default value is {3}.";
+public const string AnonymousTypeNotSupported = @"Anonymous type is not supported. Type is '{0}' in '{1}' namespace.";
+public const string AnyAttributeNotSupported = @"XML Schema 'any' attribute is not supported";
+public const string ArrayItemFormMustBe = @"For array item, element 'form' must be {0}.";
+public const string ArraySizeAttributeIncorrect = @"Array size attribute is incorrect; must be between {0} and {1}.";
+
+public const string ArrayTypeCannotBeImported = @"Array type cannot be imported for '{0}' in '{1}' namespace: {2}.";
+public const string AssemblyNotFound = @"Assembly '{0}' was not found.";
+public const string AttributeNotFound = @"Attribute was not found for CLR type '{1}' in namespace '{0}'. XML reader node is on {2}, '{4}' node in '{3}' namespace.";
+public const string BaseTypeNotISerializable = @"Base type '{0}' in '{1}' namespace is not ISerializable.";
+public const string CannotComputeUniqueName = @"Cannot compute unique name for '{0}'.";
+public const string CannotDeriveFromSealedReferenceType = @"Cannod drive from sealed reference type '{2}', for '{0}' element in '{1}' namespace.";
+public const string CannotDeserializeForwardedType = @"Cannot deserialize forwarded type '{0}'.";
+public const string CannotExportNullAssembly = @"Cannot export null assembly.";
+public const string CannotExportNullKnownType = @"Cannot export null known type.";
+public const string CannotExportNullType = @"Cannot export null type.";
+public const string CannotHaveDuplicateAttributeNames = @"Cannot have duplicate attribute names '{0}'.";
+public const string CannotHaveDuplicateElementNames = @"Cannot have duplicate element names '{0}'.";
+public const string CannotImportInvalidSchemas = @"Cannot import invalid schemas.";
+public const string CannotImportNullDataContractName = @"Cannot import data contract with null name.";
+public const string CannotImportNullSchema = @"Cannot import from schema list that contains null.";
+public const string CannotSetMembersForReferencedType = @"Cannot set members for already referenced type. Base type is '{0}'.";
+public const string CannotSetNamespaceForReferencedType = @"Cannot set namespace for already referenced type. Base type is '{0}'.";
+public const string CannotUseGenericTypeAsBase = @"For '{0}' in '{1}' namespace, generic type cannot be referenced as the base type.";
+public const string ChangingFullTypeNameNotSupported = @"Changing full type name is not supported. Serialization type name: '{0}', data contract type name: '{1}'.";
+public const string CircularTypeReference = @"Circular type reference was found for '{0}' in '{1}' namespace.";
+public const string ClassDataContractReturnedForGetOnlyCollection = @"For '{0}' type, class data contract was returned for get-only collection.";
+public const string CLRNamespaceMappedMultipleTimes = @"CLR namespace is mapped multiple times. Current data contract namespace is '{0}', found '{1}' for CLR namespace '{2}'.";
+public const string ClrTypeNotFound = @"CLR type '{1}' in assembly '{0}' is not found.";
+public const string CollectionAssignedToIncompatibleInterface = @"Collection of type '{0}' is assigned to an incompatible interface '{1}'";
+public const string ComplexTypeRestrictionNotSupported = @"XML schema complexType restriction is not supported.";
+public const string ConfigDataContractSerializerSectionLoadError = @"Failed to load configuration section for dataContractSerializer.";
+public const string ConfigIndexOutOfRange = @"For type '{0}', configuration index is out of range.";
+public const string ConfigMustOnlyAddParamsWithType = @"Configuration parameter element must only add params with type."; // huh? the code doesn't make a lot of sense to me...
+public const string ConfigMustOnlySetTypeOrIndex = @"Configuration parameter element can set only one of either type or index.";
+public const string ConfigMustSetTypeOrIndex = @"Configuration parameter element must set either type or index.";
+public const string CouldNotReadSerializationSchema = @"Could not read serialization schema for '{0}' namespace.";
+public const string DefaultOnElementNotSupported = @"On element '{0}', default value is not supported.";
+public const string DerivedTypeNotISerializable = @"On type '{0}' in '{1}' namespace, derived type is not ISerializable.";
+public const string DupContractInDataContractSet = @"Duplicate contract in data contract set was found, for '{0}' in '{1}' namespace.";
+public const string DuplicateExtensionDataSetMethod = @"Duplicate extension data set method was found, for method '{0}', existing method is '{1}', on data contract type '{2}'.";
+public const string DupTypeContractInDataContractSet = @"Duplicate type contract in data contract set. Type name '{0}', for data contract '{1}' in '{2}' namespace.";
+public const string ElementMaxOccursMustBe = @"On element '{0}', schema element maxOccurs must be 1.";
+public const string ElementMinOccursMustBe = @"On element '{0}', schema element minOccurs must be less or equal to 1.";
+public const string ElementRefOnLocalElementNotSupported = @"For local element, ref is not supported. The referenced name is '{0}' in '{1}' namespace.";
+public const string EnumEnumerationFacetsMustHaveValue = @"Schema enumeration facet must have values.";
+public const string EnumListInAnonymousTypeNotSupported = @"Enum list in anonymous type is not supported.";
+public const string EnumListMustContainAnonymousType = @"Enum list must contain an anonymous type.";
+public const string EnumOnlyEnumerationFacetsSupported = @"For schema facets, only enumeration is supported.";
+public const string EnumRestrictionInvalid = @"For simpleType restriction, only enum is supported and this type could not be convert to enum.";
+public const string EnumTypeCannotBeImported = @"For '{0}' in '{1}' namespace, enum type cannot be imported: {2}";
+public const string EnumTypeNotSupportedByDataContractJsonSerializer = @"Enum type is not supported by DataContractJsonSerializer. The underlying type is '{0}'.";
+public const string EnumUnionInAnonymousTypeNotSupported = @"Enum union in anonymous type is not supported.";
+public const string ExtensionDataSetMustReturnVoid = @"For type '{0}' method '{1}', extension data set method must return void.";
+public const string ExtensionDataSetParameterInvalid = @"For type '{0}' method '{1}', extension data set method has invalid type of parameter '{2}'.";
+public const string FactoryObjectContainsSelfReference = @"Factory object contains a reference to self. Old object is '{0}', new object is '{1}'.";
+public const string FactoryTypeNotISerializable = @"For data contract '{1}', factory type '{0}' is not ISerializable.";
+public const string FixedOnElementNotSupported = @"On schema element '{0}', fixed value is not supported.";
+public const string FlushBufferAlreadyInUse = @"Flush buffer is already in use.";
+public const string FormMustBeQualified = @"On schema element '{0}', form must be qualified.";
+public const string GenericAnnotationAttributeNotFound = @"On type '{0}' Generic annotation attribute '{1}' was not found.";
+public const string GenericAnnotationForNestedLevelMustBeIncreasing = @"On type '{2}', generic annotation for nested level must be increasing. Argument element is '{0}' in '{1}' namespace.";
+public const string GenericAnnotationHasInvalidAttributeValue = @"On type '{2}', generic annotation has invalid attribute value '{3}'. Argument element is '{0}' in '{1}' namespace. Nested level attribute attribute name is '{4}'. Type is '{5}'."; // dunno if this makes sense...
+public const string GenericAnnotationHasInvalidElement = @"On type '{2}', generic annotation has invalid element. Argument element is '{0}' in '{1}' namespace.";
+public const string GenericTypeNameMismatch = @"Generic type name mismatch. Expected '{0}' in '{1}' namespace, got '{2}' in '{3}' namespace instead.";
+public const string GenericTypeNotExportable = @"Generic type '{0}' is not exportable.";
+public const string GetOnlyCollectionMustHaveAddMethod = @"On type '{0}', get-only collection must have an Add method.";
+public const string GetRealObjectReturnedNull = @"On the surrogate data contract for '{0}', GetRealObject method returned null.";
+public const string InvalidAnnotationExpectingText = @"For annotation element '{0}' in namespace '{1}', expected text but got element '{2}' in '{3}' namespace.";
+public const string InvalidAssemblyFormat = @"'{0}': invalid assembly format.";
+public const string InvalidCharacterEncountered = @"Encountered an invalid character '{0}'.";
+public const string InvalidClassDerivation = @"Invalid class derivation from '{0}' in '{1}' namespace.";
+public const string InvalidClrNameGeneratedForISerializable = @"Invalid CLR name '{2}' is generated for ISerializable type '{0}' in '{1}' namespace.";
+public const string InvalidClrNamespaceGeneratedForISerializable = @"Invalid CLR namespace '{3}' is generated for ISerializable type '{0}' in '{1}' namespace. Data contract namespace from the URI would be generated as '{2}'.";
+public const string InvalidDataNode = @"Invalid data node for '{0}' type.";
+public const string InvalidEmitDefaultAnnotation = @"Invalid EmilDefault annotation for '{0}' in type '{1}' in '{2}' namespace.";
+public const string InvalidEnumBaseType = @"Invalid enum base type is specified for type '{0}' in '{1}' namespace, element name is '{2}' in '{3}' namespace.";
+public const string InvalidISerializableDerivation = @"Invalid ISerializable derivation from '{0}' in '{1}' namespace.";
+public const string InvalidKeyValueType = @"'{0}' is an invalid key value type.";
+public const string InvalidKeyValueTypeNamespace = @"'{0}' in '{1}' namespace is an invalid key value type.";
+public const string InvalidReturnSchemaOnGetSchemaMethod = @"On type '{0}', the return value from GetSchema method was invalid.";
+public const string InvalidStateInExtensionDataReader = @"Invalid state in extension data reader.";
+public const string InvalidXmlDeserializingExtensionData = @"Invalid XML while deserializing extension data.";
+public const string IsAnyNotSupportedByNetDataContractSerializer = @"For type '{0}', IsAny is not supported by NetDataContractSerializer.";
+public const string IsDictionaryFormattedIncorrectly = @"IsDictionary formatted value '{0}' is incorrect: {1}";
+public const string ISerializableAssemblyNameSetToZero = @"ISerializable AssemblyName is set to ""0"" for type '{0}'.";
+public const string ISerializableCannotHaveDataContract = @"ISerializable type '{0}' cannot have DataContract.";
+public const string ISerializableContainsMoreThanOneItems = @"ISerializable cannot contain more than one item.";
+public const string ISerializableDerivedContainsOneOrMoreItems = @"Type derived from ISerializable cannot contain more than one item.";
+public const string ISerializableDoesNotContainAny = @"ISerializable does not contain any element.";
+public const string ISerializableMustRefFactoryTypeAttribute = @"ISerializable must have ref attribute that points to its factory type.";
+public const string ISerializableTypeCannotBeImported = @"ISerializable type '{0}' in '{1}' namespace cannot be imported: {2}";
+public const string ISerializableWildcardMaxOccursMustBe = @"ISerializable wildcard maxOccurs must be '{0}'.";
+public const string ISerializableWildcardMinOccursMustBe = @"ISerializable wildcard maxOccurs must be '{0}'.";
+public const string ISerializableWildcardNamespaceInvalid = @"ISerializable wildcard namespace is invalid: '{0}'.";
+public const string ISerializableWildcardProcessContentsInvalid = @"ISerializable wildcard processContents is invalid: '{0}'.";
+public const string IsReferenceGetOnlyCollectionsNotSupported = @"On type '{1}', attribute '{0}' points to get-only collection, which is not supported.";
+public const string IsValueTypeFormattedIncorrectly = @"IsValueType is formatted incorrectly as '{0}': {1}";
+public const string JsonAttributeAlreadyWritten = @"JSON attribute '{0}' is already written.";
+public const string JsonAttributeMustHaveElement = @"JSON attribute must have an owner element.";
+public const string JsonCannotWriteStandaloneTextAfterQuotedText = @"JSON writer cannot write standalone text after quoted text.";
+public const string JsonCannotWriteTextAfterNonTextAttribute = @"JSON writer cannot write text after non-text attribute. Data type is '{0}'.";
+public const string JsonDateTimeOutOfRange = @"JSON DateTime is out of range.";
+public const string JsonDuplicateMemberInInput = @"Duplicate member '{0}' is found in JSON input.";
+public const string JsonDuplicateMemberNames = @"Duplicate member, including '{1}', is found in JSON input, in type '{0}'.";
+public const string JsonEncodingNotSupported = @"JSON Encoding is not supported.";
+public const string JsonEncounteredUnexpectedCharacter = @"Encountered an unexpected character '{0}' in JSON.";
+public const string JsonEndElementNoOpenNodes = @"Encountered an end element while there was no open element in JSON writer.";
+public const string JsonExpectedEncoding = @"Expected encoding '{0}', got '{1}' instead.";
+public const string JsonInvalidBytes = @"Invalid bytes in JSON.";
+public const string JsonInvalidDataTypeSpecifiedForServerType = @"The specified data type is invalid for server type. Type: '{0}', specified data type: '{1}', server type: '{2}', object '{3}'."; // I wonder if this makes sense...
+public const string JsonInvalidDateTimeString = @"Invalid JSON dateTime string is specified: original value '{0}', start guide writer: {1}, end guard writer: {2}.";
+public const string JsonInvalidFFFE = @"FFFE in JSON is invalid.";
+public const string JsonInvalidItemNameForArrayElement = @"Invalid JSON item name '{0}' for array element (item element is '{1}' in JSON).";
+public const string JsonInvalidLocalNameEmpty = @"Empty string is invalid as a local name.";
+public const string JsonInvalidMethodBetweenStartEndAttribute = @"Invalid method call state between start and end attribute.";
+public const string JsonInvalidRootElementName = @"Invalid root element name '{0}' (root element is '{1}' in JSON).";
+public const string JsonInvalidStartElementCall = @"Invalid call to JSON WriteStartElement method.";
+public const string JsonInvalidWriteState = @"Invalid write state {1} for '{0}' method.";
+public const string JsonMethodNotSupported = @"Method {0} is not supported in JSON.";
+public const string JsonMultipleRootElementsNotAllowedOnWriter = @"Multiple root element is not allowed on JSON writer.";
+public const string JsonMustSpecifyDataType = @"On JSON writer data type '{0}' must be specified. Object string is '{1}', server type string is '{2}'.";
+public const string JsonMustUseWriteStringForWritingAttributeValues = @"On JSON writer WriteString must be used for writing attribute values.";
+public const string JsonNamespaceMustBeEmpty = @"JSON namespace is specified as '{0}' but it must be empty.";
+public const string JsonNestedArraysNotSupported = @"Nested array is not supported in JSON: '{0}'";
+public const string JsonNodeTypeArrayOrObjectNotSpecified = @"Either Object or Array of JSON node type must be specified.";
+public const string JsonNoMatchingStartAttribute = @"WriteEndAttribute was called while there is no open attribute.";
+public const string JsonOffsetExceedsBufferSize = @"On JSON writer, offset exceeded buffer size {0}.";
+public const string JsonOneRequiredMemberNotFound = @"Required member {1} in type '{0}' is not found.";
+public const string JsonOnlyWhitespace = @"Only whitespace characters are allowed for {1} method. The specified value is '{0}'";
+public const string JsonOpenAttributeMustBeClosedFirst = @"JSON attribute must be closed first before calling {0} method.";
+public const string JsonPrefixMustBeNullOrEmpty = @"JSON prefix must be null or empty. '{0}' is specified instead.";
+public const string JsonRequiredMembersNotFound = @"Required members {0} in type '{1}' are not found.";
+public const string JsonServerTypeSpecifiedForInvalidDataType = @"Server type is specified for invalid data type in JSON. Server type: '{0}', type: '{1}', dataType: '{2}', object: '{3}'.";
+public const string JsonSizeExceedsRemainingBufferSpace = @"JSON size exceeded remaining buffer space, by {0} byte(s).";
+public const string JsonTypeNotSupportedByDataContractJsonSerializer = @"Type '{0}' is not suppotred by DataContractJsonSerializer.";
+public const string JsonUnexpectedAttributeLocalName = @"Unexpected attribute local name '{0}'.";
+public const string JsonUnexpectedAttributeValue = @"Unexpected attribute value '{0}'.";
+public const string JsonUnexpectedEndOfFile = @"Unexpected end of file in JSON.";
+public const string JsonUnsupportedForIsReference = @"Unsupported value for IsReference for type '{0}', IsReference value is {1}.";
+public const string JsonWriteArrayNotSupported = @"JSON WriteArray is not supported.";
+public const string JsonWriterClosed = @"JSON writer is already closed.";
+public const string JsonXmlInvalidDeclaration = @"Attempt to write invalid XML declration.";
+public const string JsonXmlProcessingInstructionNotSupported = @"processing instruction is not supported in JSON writer.";
+public const string KeyTypeCannotBeParsedInSimpleDictionary = @"Key type '{1}' for collection type '{0}' cannot be parsed in simple dictionary.";
+public const string KnownTypeConfigGenericParamMismatch = @"Generic parameter count do not match between known type and configuration. Type is '{0}', known type has {1} parameters, configuration has {2} parameters.";
+public const string KnownTypeConfigIndexOutOfBounds = @"For known type configuration, index is out of bound. Root type: '{0}' has {1} type arguments, and index was {2}.";
+public const string KnownTypeConfigIndexOutOfBoundsZero = @"For known type configuration, index is out of bound. Root type: '{0}' has {1} type arguments, and index was {2}.";
+public const string KnownTypeConfigObject = @"Known type configuration specifies System.Object.";
+public const string MaxMimePartsExceeded = @"MIME parts number exceeded the maximum settings. Must be less than {0}. Specified as '{1}'.";
+public const string MimeContentTypeHeaderInvalid = @"MIME content type header is invalid.";
+public const string MimeHeaderInvalidCharacter = @"MIME header has an invalid character ('{0}', {1} in hexadecimal value).";
+public const string MimeMessageGetContentStreamCalledAlready = @"On MimeMessage, GetContentStream method is already called.";
+public const string MimeReaderHeaderAlreadyExists = @"MIME header '{0}' already exists.";
+public const string MimeReaderMalformedHeader = @"Malformed MIME header.";
+public const string MimeReaderResetCalledBeforeEOF = @"On MimeReader, Reset method is called before EOF.";
+public const string MimeReaderTruncated = @"MIME parts are truncated.";
+public const string MimeVersionHeaderInvalid = @"MIME version header is invalid.";
+public const string MimeWriterInvalidStateForClose = @"MIME writer is at invalid state for closing.";
+public const string MimeWriterInvalidStateForContent = @"MIME writer is at invalid state for content.";
+public const string MimeWriterInvalidStateForHeader = @"MIME writer is at invalid state for header.";
+public const string MimeWriterInvalidStateForStartPart = @"MIME writer is at invalid state for starting a part.";
+public const string MimeWriterInvalidStateForStartPreface = @"MIME writer is at invalid state for starting preface.";
+public const string MissingSchemaType = @"Schema type '{0}' is missing and required for '{1}' type.";
+public const string MixedContentNotSupported = @"Mixed content is not supported.";
+public const string MtomBoundaryInvalid = @"MIME boundary is invalid: '{0}'.";
+public const string MtomBufferQuotaExceeded = @"MTOM buffer quota exceeded. The maximum size is {0}.";
+public const string MtomContentTransferEncodingNotPresent = @"MTOM content transfer encoding is not present. ContentTransferEncoding header is '{0}'.";
+public const string MtomContentTransferEncodingNotSupported = @"MTOM content transfer encoding value is not supported. Raw value is '{0}', '{1}' in 7bit encoding, '{2}' in 8bit encoding, and '{3}' in binary.";
+public const string MtomContentTypeInvalid = @"MTOM content type is invalid.";
+public const string MtomDataMustNotContainXopInclude = @"MTOM data must not contain xop:Include element. '{0}' element in '{1}' namespace.";
+public const string MtomExceededMaxSizeInBytes = @"MTOM exceeded max size in bytes. The maximum size is {0}.";
+public const string MtomInvalidCIDUri = @"Invalid MTOM CID URI: '{0}'.";
+public const string MtomInvalidEmptyURI = @"empty URI is invalid for MTOM MIME part.";
+public const string MtomInvalidStartUri = @"Invalid MTOM start URI: '{0}'.";
+public const string MtomInvalidTransferEncodingForMimePart = @"Invalid transfer encoding for MIME part: '{0}', in binary: '{1}'.";
+public const string MtomMessageContentTypeNotFound = @"MTOM message content type was not found.";
+public const string MtomMessageInvalidContent = @"MTOM message content is invalid.";
+public const string MtomMessageInvalidContentInMimePart = @"MTOM message content in MIME part is invalid.";
+public const string MtomMessageInvalidMimeVersion = @"MTOM message has invalid MIME version. Expected '{1}', got '{0}' instead.";
+public const string MtomMessageNotApplicationXopXml = @"MTOM msssage type is not '{0}'.";
+public const string MtomMessageNotMultipart = @"MTOM message is not multipart: media type should be '{0}', media subtype should be '{1}'.";
+public const string MtomMessageRequiredParamNotSpecified = @"Required MTOM parameter '{0}' is not specified.";
+public const string MtomMimePartReferencedMoreThanOnce = @"Specified MIME part '{0}' is referenced more than once.";
+public const string MtomPartNotFound = @"MTOM part with URI '{0}' is not found.";
+public const string MtomRootContentTypeNotFound = @"MTOM root content type is not found.";
+public const string MtomRootNotApplicationXopXml = @"MTOM root should have media type '{0}' and subtype '{1}'.";
+public const string MtomRootPartNotFound = @"MTOM root part is not found.";
+public const string MtomRootRequiredParamNotSpecified = @"Required MTOM root parameter '{0}' is not specified.";
+public const string MtomRootUnexpectedCharset = @"Unexpected charset on MTOM root. Expected '{1}', got '{0}' instead.";
+public const string MtomRootUnexpectedType = @"Unexpected type on MTOM root. Expected '{1}', got '{0}' instead.";
+public const string MtomXopIncludeHrefNotSpecified = @"xop Include element did not specify '{0}' attribute.";
+public const string MtomXopIncludeInvalidXopAttributes = @"xop Include element has invalid attribute: '{0}' in '{1}' namespace.";
+public const string MtomXopIncludeInvalidXopElement = @"xop Include element has invalid element: '{0}' in '{1}' namespace.";
+public const string MustContainOnlyLocalElements = @"Only local elements can be imported.";
+public const string NoAsyncWritePending = @"No async write operation is pending.";
+public const string NonOptionalFieldMemberOnIsReferenceSerializableType = @"For type '{0}', non-optional field member '{1}' is on the Serializable type that has IsReference as {2}.";
+public const string OnlyDataContractTypesCanHaveExtensionData = @"On '{0}' type, only DataContract types can have extension data.";
+public const string PartialTrustISerializableNoPublicConstructor = @"Partial trust access required for the constructor on the ISerializable type '{0}'";
+public const string QueryGeneratorPathToMemberNotFound = @"The path to member was not found for XPath query generator.";
+public const string ReadNotSupportedOnStream = @"Read operation is not supported on the Stream.";
+public const string ReadOnlyClassDeserialization = @"Error on deserializing read-only members in the class: {0}";
+public const string ReadOnlyCollectionDeserialization = @"Error on deserializing read-only collection: {0}";
+public const string RecursiveCollectionType = @"Type '{0}' involves recursive collection.";
+public const string RedefineNotSupported = @"XML Schema 'redefine' is not supported.";
+public const string ReferencedBaseTypeDoesNotExist = @"Referenced base type does not exist. Data contract name: '{0}' in '{1}' namespace, expected type: '{2}' in '{3}' namespace. Collection can be '{4}' or '{5}'."; // is it the expected message? I'm quite unsure.
+public const string ReferencedCollectionTypesCannotContainNull = @"Referenced collection types cannot contain null.";
+public const string ReferencedTypeDoesNotMatch = @"Referenced type '{0}' does not match the expected type '{1}' in '{2}' namespace.";
+public const string ReferencedTypeMatchingMessage = @"Reference type matches.";
+public const string ReferencedTypeNotMatchingMessage = @"Reference type does not match.";
+public const string ReferencedTypesCannotContainNull = @"Referenced types cannot contain null.";
+public const string RequiresClassDataContractToSetIsISerializable = @"To set IsISerializable, class data cotnract is required.";
+public const string RootParticleMustBeSequence = @"Root particle must be sequence to be imported.";
+public const string RootSequenceMaxOccursMustBe = @"On root sequence, maxOccurs must be 1.";
+public const string RootSequenceMustBeRequired = @"Root sequence must have an item and minOccurs must be 1.";
+public const string SeekNotSupportedOnStream = @"Seek operation is not supported on this Stream.";
+public const string SerializationInfo_ConstructorNotFound = @"Constructor that takes SerializationInfo and StreamingContext is not found for '{0}'.";
+public const string SimpleContentNotSupported = @"Simple content is not supported.";
+public const string SimpleTypeRestrictionDoesNotSpecifyBase = @"This simpleType restriction does not specify the base type.";
+public const string SimpleTypeUnionNotSupported = @"simpleType union is not supported.";
+public const string SpecifiedTypeNotFoundInSchema = @"Specified type '{0}' in '{1}' namespace is not found in the schemas.";
+public const string SubstitutionGroupOnElementNotSupported = @"substitutionGroups on elements are not supported.";
+public const string SurrogatesWithGetOnlyCollectionsNotSupported = @"Surrogates with get-only collections are not supported. Type '{1}' contains '{2}' which is of '{0}' type.";
+public const string SurrogatesWithGetOnlyCollectionsNotSupportedSerDeser = @"Surrogates with get-only collections are not supported. Found on type '{0}'.";
+public const string TopLevelElementRepresentsDifferentType = @"Top-level element represents a different type. Expected '{0}' type in '{1}' namespace.";
+public const string TraceCodeElementIgnored = @"Element ignored";
+public const string TraceCodeFactoryTypeNotFound = @"Factory type not found";
+public const string TraceCodeObjectWithLargeDepth = @"Object with large depth";
+public const string TraceCodeReadObjectBegin = @"ReadObject begins";
+public const string TraceCodeReadObjectEnd = @"ReadObject ends";
+public const string TraceCodeWriteObjectBegin = @"WriteObject begins";
+public const string TraceCodeWriteObjectContentBegin = @"WriteObjectContent begins";
+public const string TraceCodeWriteObjectContentEnd = @"WriteObjectContent ends";
+public const string TraceCodeWriteObjectEnd = @"WriteObject ends";
+public const string TraceCodeXsdExportAnnotationFailed = @"XSD export annotation failed";
+public const string TraceCodeXsdExportBegin = @"XSD export begins";
+public const string TraceCodeXsdExportDupItems = @"XSD export duplicate items";
+public const string TraceCodeXsdExportEnd = @"XSD export ends";
+public const string TraceCodeXsdExportError = @"XSD export error";
+public const string TraceCodeXsdImportAnnotationFailed = @"XSD import annotation failed";
+public const string TraceCodeXsdImportBegin = @"XSD import begins";
+public const string TraceCodeXsdImportEnd = @"XSD import ends";
+public const string TraceCodeXsdImportError = @"XSD import error";
+public const string TypeCannotBeForwardedFrom = @"Type '{0}' in assembly '{1}' cannot be forwarded from assembly '{2}'.";
+public const string TypeCannotBeImported = @"Type '{0}' in '{1}' namespace cannot be imported: {2}";
+public const string TypeCannotBeImportedHowToFix = @"Type cannot be imported: {0}"; // I cannot see where HowToFix is given from...
+public const string TypeHasNotBeenImported = @"Type '{0}' in '{1}' namespace has not been imported.";
+public const string TypeMustBeIXmlSerializable = @"Type '{0}' must be IXmlSerializable. Contract type: '{1}', contract name: '{2}' in '{3}' namespace.";
+public const string TypeShouldNotContainAttributes = @"Type should not contain attributes. Serialization namespace: '{0}'.";
+public const string UnknownXmlType = @"Unknown XML type: '{0}'.";
+public const string WriteBufferOverflow = @"Write buffer overflow.";
+public const string WriteNotSupportedOnStream = @"Write operation is not supported on this '{0}' Stream.";
+public const string XmlCanonicalizationNotStarted = @"XML canonicalization was not started.";
+public const string XmlCanonicalizationStarted = @"XML canonicalization started";
+public const string XmlMaxArrayLengthOrMaxItemsQuotaExceeded = @"XML max array length or max items quota exceeded. It must be less than {0}.";
+public const string XmlMaxBytesPerReadExceeded = @"XML max bytes per read exceeded. It must be less than {0}.";
+public const string XmlMaxDepthExceeded = @"XML max depth exceeded. It must be less than {0}.";
+public const string XmlMaxStringContentLengthExceeded = @"XML max string content length exceeded. It must be less than {0}.";
+public const string XmlObjectAssignedToIncompatibleInterface = @"Object of type '{0}' is assigned to an incompatible interface '{1}'.";
+
+#endregion
+       }
+}
diff --git a/mcs/class/System.Runtime.Serialization/ReferenceSources/SR_missing.cs b/mcs/class/System.Runtime.Serialization/ReferenceSources/SR_missing.cs
deleted file mode 100644 (file)
index 972c50a..0000000
+++ /dev/null
@@ -1,291 +0,0 @@
-namespace System.Runtime.Serialization
-{
-       static partial class SR
-       {
-
-#region MissingInStrings.txt
-
-//
-// This was retrieved as follows:
-//
-// 1. mcs ReferenceSources/SR.cs -t:library -out:existing.dll
-// 2. mcs {https://raw.githubusercontent.com/mono/mono/wip-serialization-halfway/mcs/class/System.Runtime.Serialization/ReferenceSource/SR.cs} -t:library -out:full.dll
-// 3. csharp -e "System.IO.File.WriteAllLines ("existing.txt", System.Reflection.Assembly.ReflectionOnlyLoadFrom ("existing.dll").GetTypes ().SelectMany (t => t.GetFields ()).Select (f => f.Name).ToArray ())"
-// 4. csharp -e "System.IO.File.WriteAllLines ("full.txt", System.Reflection.Assembly.ReflectionOnlyLoadFrom ("full.dll").GetTypes ().SelectMany (t => t.GetFields ()).Select (f => f.Name).ToArray ())"
-// 5. csharp
-//     var existing = System.IO.File.ReadAllLines ("existing.txt");
-//     var full = System.IO.File.ReadAllLines ("full.txt");
-//  var missing = full.Where (f => !existing.Contains (f));
-//  System.IO.File.WriteAllLines ("missing.cs", missing.Select (m => "public const string " + m + " = @\"" + m + "\";").ToArray ())
-// 6. copy missing.cs contents here.
-//
-
-public const string AbstractElementNotSupported = @"Abstract element '{0}' is not supported.";
-public const string AbstractTypeNotSupported = @"Abstract type is not supported";
-public const string AmbiguousReferencedCollectionTypes1 = @"Ambiguous collection types were referenced: {0}";
-public const string AmbiguousReferencedCollectionTypes3 = @"In '{0}' element in '{1}' namespace, ambiguous collection types were referenced: {2}";
-public const string AmbiguousReferencedTypes1 = @"Ambiguous types were referenced: {0}";
-public const string AmbiguousReferencedTypes3 = @"In '{0}' element in '{1}' namespace, ambiguous types were referenced: {2}";
-public const string AnnotationAttributeNotFound = @"Annotation attribute was not found: default value annotation is '{0}', type is '{1}' in '{2}' namespace, emit default value is {3}.";
-public const string AnonymousTypeNotSupported = @"Anonymous type is not supported. Type is '{0}' in '{1}' namespace.";
-public const string AnyAttributeNotSupported = @"XML Schema 'any' attribute is not supported";
-public const string ArrayItemFormMustBe = @"For array item, element 'form' must be {0}.";
-public const string ArraySizeAttributeIncorrect = @"Array size attribute is incorrect; must be between {0} and {1}.";
-
-public const string ArrayTypeCannotBeImported = @"Array type cannot be imported for '{0}' in '{1}' namespace: {2}.";
-public const string AssemblyNotFound = @"Assembly '{0}' was not found.";
-public const string AttributeNotFound = @"Attribute was not found for CLR type '{1}' in namespace '{0}'. XML reader node is on {2}, '{4}' node in '{3}' namespace.";
-public const string BaseTypeNotISerializable = @"Base type '{0}' in '{1}' namespace is not ISerializable.";
-public const string CannotComputeUniqueName = @"Cannot compute unique name for '{0}'.";
-public const string CannotDeriveFromSealedReferenceType = @"Cannod drive from sealed reference type '{2}', for '{0}' element in '{1}' namespace.";
-public const string CannotDeserializeForwardedType = @"Cannot deserialize forwarded type '{0}'.";
-public const string CannotExportNullAssembly = @"Cannot export null assembly.";
-public const string CannotExportNullKnownType = @"Cannot export null known type.";
-public const string CannotExportNullType = @"Cannot export null type.";
-public const string CannotHaveDuplicateAttributeNames = @"Cannot have duplicate attribute names '{0}'.";
-public const string CannotHaveDuplicateElementNames = @"Cannot have duplicate element names '{0}'.";
-public const string CannotImportInvalidSchemas = @"Cannot import invalid schemas.";
-public const string CannotImportNullDataContractName = @"Cannot import data contract with null name.";
-public const string CannotImportNullSchema = @"Cannot import from schema list that contains null.";
-public const string CannotSetMembersForReferencedType = @"Cannot set members for already referenced type. Base type is '{0}'.";
-public const string CannotSetNamespaceForReferencedType = @"Cannot set namespace for already referenced type. Base type is '{0}'.";
-public const string CannotUseGenericTypeAsBase = @"For '{0}' in '{1}' namespace, generic type cannot be referenced as the base type.";
-public const string ChangingFullTypeNameNotSupported = @"Changing full type name is not supported. Serialization type name: '{0}', data contract type name: '{1}'.";
-public const string CircularTypeReference = @"Circular type reference was found for '{0}' in '{1}' namespace.";
-public const string ClassDataContractReturnedForGetOnlyCollection = @"For '{0}' type, class data contract was returned for get-only collection.";
-public const string CLRNamespaceMappedMultipleTimes = @"CLR namespace is mapped multiple times. Current data contract namespace is '{0}', found '{1}' for CLR namespace '{2}'.";
-public const string ClrTypeNotFound = @"CLR type '{1}' in assembly '{0}' is not found.";
-public const string CollectionAssignedToIncompatibleInterface = @"Collection of type '{0}' is assigned to an incompatible interface '{1}'";
-public const string ComplexTypeRestrictionNotSupported = @"XML schema complexType restriction is not supported.";
-public const string ConfigDataContractSerializerSectionLoadError = @"Failed to load configuration section for dataContractSerializer.";
-public const string ConfigIndexOutOfRange = @"For type '{0}', configuration index is out of range.";
-public const string ConfigMustOnlyAddParamsWithType = @"Configuration parameter element must only add params with type."; // huh? the code doesn't make a lot of sense to me...
-public const string ConfigMustOnlySetTypeOrIndex = @"Configuration parameter element can set only one of either type or index.";
-public const string ConfigMustSetTypeOrIndex = @"Configuration parameter element must set either type or index.";
-public const string CouldNotReadSerializationSchema = @"Could not read serialization schema for '{0}' namespace.";
-public const string DefaultOnElementNotSupported = @"On element '{0}', default value is not supported.";
-public const string DerivedTypeNotISerializable = @"On type '{0}' in '{1}' namespace, derived type is not ISerializable.";
-public const string DupContractInDataContractSet = @"Duplicate contract in data contract set was found, for '{0}' in '{1}' namespace.";
-public const string DuplicateExtensionDataSetMethod = @"Duplicate extension data set method was found, for method '{0}', existing method is '{1}', on data contract type '{2}'.";
-public const string DupTypeContractInDataContractSet = @"Duplicate type contract in data contract set. Type name '{0}', for data contract '{1}' in '{2}' namespace.";
-public const string ElementMaxOccursMustBe = @"On element '{0}', schema element maxOccurs must be 1.";
-public const string ElementMinOccursMustBe = @"On element '{0}', schema element minOccurs must be less or equal to 1.";
-public const string ElementRefOnLocalElementNotSupported = @"For local element, ref is not supported. The referenced name is '{0}' in '{1}' namespace.";
-public const string EnumEnumerationFacetsMustHaveValue = @"Schema enumeration facet must have values.";
-public const string EnumListInAnonymousTypeNotSupported = @"Enum list in anonymous type is not supported.";
-public const string EnumListMustContainAnonymousType = @"Enum list must contain an anonymous type.";
-public const string EnumOnlyEnumerationFacetsSupported = @"For schema facets, only enumeration is supported.";
-public const string EnumRestrictionInvalid = @"For simpleType restriction, only enum is supported and this type could not be convert to enum.";
-public const string EnumTypeCannotBeImported = @"For '{0}' in '{1}' namespace, enum type cannot be imported: {2}";
-public const string EnumTypeNotSupportedByDataContractJsonSerializer = @"Enum type is not supported by DataContractJsonSerializer. The underlying type is '{0}'.";
-public const string EnumUnionInAnonymousTypeNotSupported = @"Enum union in anonymous type is not supported.";
-public const string ExtensionDataSetMustReturnVoid = @"For type '{0}' method '{1}', extension data set method must return void.";
-public const string ExtensionDataSetParameterInvalid = @"For type '{0}' method '{1}', extension data set method has invalid type of parameter '{2}'.";
-public const string FactoryObjectContainsSelfReference = @"Factory object contains a reference to self. Old object is '{0}', new object is '{1}'.";
-public const string FactoryTypeNotISerializable = @"For data contract '{1}', factory type '{0}' is not ISerializable.";
-public const string FixedOnElementNotSupported = @"On schema element '{0}', fixed value is not supported.";
-public const string FlushBufferAlreadyInUse = @"Flush buffer is already in use.";
-public const string FormMustBeQualified = @"On schema element '{0}', form must be qualified.";
-public const string GenericAnnotationAttributeNotFound = @"On type '{0}' Generic annotation attribute '{1}' was not found.";
-public const string GenericAnnotationForNestedLevelMustBeIncreasing = @"On type '{2}', generic annotation for nested level must be increasing. Argument element is '{0}' in '{1}' namespace.";
-public const string GenericAnnotationHasInvalidAttributeValue = @"On type '{2}', generic annotation has invalid attribute value '{3}'. Argument element is '{0}' in '{1}' namespace. Nested level attribute attribute name is '{4}'. Type is '{5}'."; // dunno if this makes sense...
-public const string GenericAnnotationHasInvalidElement = @"On type '{2}', generic annotation has invalid element. Argument element is '{0}' in '{1}' namespace.";
-public const string GenericTypeNameMismatch = @"Generic type name mismatch. Expected '{0}' in '{1}' namespace, got '{2}' in '{3}' namespace instead.";
-public const string GenericTypeNotExportable = @"Generic type '{0}' is not exportable.";
-public const string GetOnlyCollectionMustHaveAddMethod = @"On type '{0}', get-only collection must have an Add method.";
-public const string GetRealObjectReturnedNull = @"On the surrogate data contract for '{0}', GetRealObject method returned null.";
-public const string InvalidAnnotationExpectingText = @"For annotation element '{0}' in namespace '{1}', expected text but got element '{2}' in '{3}' namespace.";
-public const string InvalidAssemblyFormat = @"'{0}': invalid assembly format.";
-public const string InvalidCharacterEncountered = @"Encountered an invalid character '{0}'.";
-public const string InvalidClassDerivation = @"Invalid class derivation from '{0}' in '{1}' namespace.";
-public const string InvalidClrNameGeneratedForISerializable = @"Invalid CLR name '{2}' is generated for ISerializable type '{0}' in '{1}' namespace.";
-public const string InvalidClrNamespaceGeneratedForISerializable = @"Invalid CLR namespace '{3}' is generated for ISerializable type '{0}' in '{1}' namespace. Data contract namespace from the URI would be generated as '{2}'.";
-public const string InvalidDataNode = @"Invalid data node for '{0}' type.";
-public const string InvalidEmitDefaultAnnotation = @"Invalid EmilDefault annotation for '{0}' in type '{1}' in '{2}' namespace.";
-public const string InvalidEnumBaseType = @"Invalid enum base type is specified for type '{0}' in '{1}' namespace, element name is '{2}' in '{3}' namespace.";
-public const string InvalidISerializableDerivation = @"Invalid ISerializable derivation from '{0}' in '{1}' namespace.";
-public const string InvalidKeyValueType = @"'{0}' is an invalid key value type.";
-public const string InvalidKeyValueTypeNamespace = @"'{0}' in '{1}' namespace is an invalid key value type.";
-public const string InvalidReturnSchemaOnGetSchemaMethod = @"On type '{0}', the return value from GetSchema method was invalid.";
-public const string InvalidStateInExtensionDataReader = @"Invalid state in extension data reader.";
-public const string InvalidXmlDeserializingExtensionData = @"Invalid XML while deserializing extension data.";
-public const string IsAnyNotSupportedByNetDataContractSerializer = @"For type '{0}', IsAny is not supported by NetDataContractSerializer.";
-public const string IsDictionaryFormattedIncorrectly = @"IsDictionary formatted value '{0}' is incorrect: {1}";
-public const string ISerializableAssemblyNameSetToZero = @"ISerializable AssemblyName is set to ""0"" for type '{0}'.";
-public const string ISerializableCannotHaveDataContract = @"ISerializable type '{0}' cannot have DataContract.";
-public const string ISerializableContainsMoreThanOneItems = @"ISerializable cannot contain more than one item.";
-public const string ISerializableDerivedContainsOneOrMoreItems = @"Type derived from ISerializable cannot contain more than one item.";
-public const string ISerializableDoesNotContainAny = @"ISerializable does not contain any element.";
-public const string ISerializableMustRefFactoryTypeAttribute = @"ISerializable must have ref attribute that points to its factory type.";
-public const string ISerializableTypeCannotBeImported = @"ISerializable type '{0}' in '{1}' namespace cannot be imported: {2}";
-public const string ISerializableWildcardMaxOccursMustBe = @"ISerializable wildcard maxOccurs must be '{0}'.";
-public const string ISerializableWildcardMinOccursMustBe = @"ISerializable wildcard maxOccurs must be '{0}'.";
-public const string ISerializableWildcardNamespaceInvalid = @"ISerializable wildcard namespace is invalid: '{0}'.";
-public const string ISerializableWildcardProcessContentsInvalid = @"ISerializable wildcard processContents is invalid: '{0}'.";
-public const string IsReferenceGetOnlyCollectionsNotSupported = @"On type '{1}', attribute '{0}' points to get-only collection, which is not supported.";
-public const string IsValueTypeFormattedIncorrectly = @"IsValueType is formatted incorrectly as '{0}': {1}";
-public const string JsonAttributeAlreadyWritten = @"JSON attribute '{0}' is already written.";
-public const string JsonAttributeMustHaveElement = @"JSON attribute must have an owner element.";
-public const string JsonCannotWriteStandaloneTextAfterQuotedText = @"JSON writer cannot write standalone text after quoted text.";
-public const string JsonCannotWriteTextAfterNonTextAttribute = @"JSON writer cannot write text after non-text attribute. Data type is '{0}'.";
-public const string JsonDateTimeOutOfRange = @"JSON DateTime is out of range.";
-public const string JsonDuplicateMemberInInput = @"Duplicate member '{0}' is found in JSON input.";
-public const string JsonDuplicateMemberNames = @"Duplicate member, including '{1}', is found in JSON input, in type '{0}'.";
-public const string JsonEncodingNotSupported = @"JSON Encoding is not supported.";
-public const string JsonEncounteredUnexpectedCharacter = @"Encountered an unexpected character '{0}' in JSON.";
-public const string JsonEndElementNoOpenNodes = @"Encountered an end element while there was no open element in JSON writer.";
-public const string JsonExpectedEncoding = @"Expected encoding '{0}', got '{1}' instead.";
-public const string JsonInvalidBytes = @"Invalid bytes in JSON.";
-public const string JsonInvalidDataTypeSpecifiedForServerType = @"The specified data type is invalid for server type. Type: '{0}', specified data type: '{1}', server type: '{2}', object '{3}'."; // I wonder if this makes sense...
-public const string JsonInvalidDateTimeString = @"Invalid JSON dateTime string is specified: original value '{0}', start guide writer: {1}, end guard writer: {2}.";
-public const string JsonInvalidFFFE = @"FFFE in JSON is invalid.";
-public const string JsonInvalidItemNameForArrayElement = @"Invalid JSON item name '{0}' for array element (item element is '{1}' in JSON).";
-public const string JsonInvalidLocalNameEmpty = @"Empty string is invalid as a local name.";
-public const string JsonInvalidMethodBetweenStartEndAttribute = @"Invalid method call state between start and end attribute.";
-public const string JsonInvalidRootElementName = @"Invalid root element name '{0}' (root element is '{1}' in JSON).";
-public const string JsonInvalidStartElementCall = @"Invalid call to JSON WriteStartElement method.";
-public const string JsonInvalidWriteState = @"Invalid write state {1} for '{0}' method.";
-public const string JsonMethodNotSupported = @"Method {0} is not supported in JSON.";
-public const string JsonMultipleRootElementsNotAllowedOnWriter = @"Multiple root element is not allowed on JSON writer.";
-public const string JsonMustSpecifyDataType = @"On JSON writer data type '{0}' must be specified. Object string is '{1}', server type string is '{2}'.";
-public const string JsonMustUseWriteStringForWritingAttributeValues = @"On JSON writer WriteString must be used for writing attribute values.";
-public const string JsonNamespaceMustBeEmpty = @"JSON namespace is specified as '{0}' but it must be empty.";
-public const string JsonNestedArraysNotSupported = @"Nested array is not supported in JSON: '{0}'";
-public const string JsonNodeTypeArrayOrObjectNotSpecified = @"Either Object or Array of JSON node type must be specified.";
-public const string JsonNoMatchingStartAttribute = @"WriteEndAttribute was called while there is no open attribute.";
-public const string JsonOffsetExceedsBufferSize = @"On JSON writer, offset exceeded buffer size {0}.";
-public const string JsonOneRequiredMemberNotFound = @"Required member {1} in type '{0}' is not found.";
-public const string JsonOnlyWhitespace = @"Only whitespace characters are allowed for {1} method. The specified value is '{0}'";
-public const string JsonOpenAttributeMustBeClosedFirst = @"JSON attribute must be closed first before calling {0} method.";
-public const string JsonPrefixMustBeNullOrEmpty = @"JSON prefix must be null or empty. '{0}' is specified instead.";
-public const string JsonRequiredMembersNotFound = @"Required members {0} in type '{1}' are not found.";
-public const string JsonServerTypeSpecifiedForInvalidDataType = @"Server type is specified for invalid data type in JSON. Server type: '{0}', type: '{1}', dataType: '{2}', object: '{3}'.";
-public const string JsonSizeExceedsRemainingBufferSpace = @"JSON size exceeded remaining buffer space, by {0} byte(s).";
-public const string JsonTypeNotSupportedByDataContractJsonSerializer = @"Type '{0}' is not suppotred by DataContractJsonSerializer.";
-public const string JsonUnexpectedAttributeLocalName = @"Unexpected attribute local name '{0}'.";
-public const string JsonUnexpectedAttributeValue = @"Unexpected attribute value '{0}'.";
-public const string JsonUnexpectedEndOfFile = @"Unexpected end of file in JSON.";
-public const string JsonUnsupportedForIsReference = @"Unsupported value for IsReference for type '{0}', IsReference value is {1}.";
-public const string JsonWriteArrayNotSupported = @"JSON WriteArray is not supported.";
-public const string JsonWriterClosed = @"JSON writer is already closed.";
-public const string JsonXmlInvalidDeclaration = @"Attempt to write invalid XML declration.";
-public const string JsonXmlProcessingInstructionNotSupported = @"processing instruction is not supported in JSON writer.";
-public const string KeyTypeCannotBeParsedInSimpleDictionary = @"Key type '{1}' for collection type '{0}' cannot be parsed in simple dictionary.";
-public const string KnownTypeConfigGenericParamMismatch = @"Generic parameter count do not match between known type and configuration. Type is '{0}', known type has {1} parameters, configuration has {2} parameters.";
-public const string KnownTypeConfigIndexOutOfBounds = @"For known type configuration, index is out of bound. Root type: '{0}' has {1} type arguments, and index was {2}.";
-public const string KnownTypeConfigIndexOutOfBoundsZero = @"For known type configuration, index is out of bound. Root type: '{0}' has {1} type arguments, and index was {2}.";
-public const string KnownTypeConfigObject = @"Known type configuration specifies System.Object.";
-public const string MaxMimePartsExceeded = @"MIME parts number exceeded the maximum settings. Must be less than {0}. Specified as '{1}'.";
-public const string MimeContentTypeHeaderInvalid = @"MIME content type header is invalid.";
-public const string MimeHeaderInvalidCharacter = @"MIME header has an invalid character ('{0}', {1} in hexadecimal value).";
-public const string MimeMessageGetContentStreamCalledAlready = @"On MimeMessage, GetContentStream method is already called.";
-public const string MimeReaderHeaderAlreadyExists = @"MIME header '{0}' already exists.";
-public const string MimeReaderMalformedHeader = @"Malformed MIME header.";
-public const string MimeReaderResetCalledBeforeEOF = @"On MimeReader, Reset method is called before EOF.";
-public const string MimeReaderTruncated = @"MIME parts are truncated.";
-public const string MimeVersionHeaderInvalid = @"MIME version header is invalid.";
-public const string MimeWriterInvalidStateForClose = @"MIME writer is at invalid state for closing.";
-public const string MimeWriterInvalidStateForContent = @"MIME writer is at invalid state for content.";
-public const string MimeWriterInvalidStateForHeader = @"MIME writer is at invalid state for header.";
-public const string MimeWriterInvalidStateForStartPart = @"MIME writer is at invalid state for starting a part.";
-public const string MimeWriterInvalidStateForStartPreface = @"MIME writer is at invalid state for starting preface.";
-public const string MissingSchemaType = @"Schema type '{0}' is missing and required for '{1}' type.";
-public const string MixedContentNotSupported = @"Mixed content is not supported.";
-public const string MtomBoundaryInvalid = @"MIME boundary is invalid: '{0}'.";
-public const string MtomBufferQuotaExceeded = @"MTOM buffer quota exceeded. The maximum size is {0}.";
-public const string MtomContentTransferEncodingNotPresent = @"MTOM content transfer encoding is not present. ContentTransferEncoding header is '{0}'.";
-public const string MtomContentTransferEncodingNotSupported = @"MTOM content transfer encoding value is not supported. Raw value is '{0}', '{1}' in 7bit encoding, '{2}' in 8bit encoding, and '{3}' in binary.";
-public const string MtomContentTypeInvalid = @"MTOM content type is invalid.";
-public const string MtomDataMustNotContainXopInclude = @"MTOM data must not contain xop:Include element. '{0}' element in '{1}' namespace.";
-public const string MtomExceededMaxSizeInBytes = @"MTOM exceeded max size in bytes. The maximum size is {0}.";
-public const string MtomInvalidCIDUri = @"Invalid MTOM CID URI: '{0}'.";
-public const string MtomInvalidEmptyURI = @"empty URI is invalid for MTOM MIME part.";
-public const string MtomInvalidStartUri = @"Invalid MTOM start URI: '{0}'.";
-public const string MtomInvalidTransferEncodingForMimePart = @"Invalid transfer encoding for MIME part: '{0}', in binary: '{1}'.";
-public const string MtomMessageContentTypeNotFound = @"MTOM message content type was not found.";
-public const string MtomMessageInvalidContent = @"MTOM message content is invalid.";
-public const string MtomMessageInvalidContentInMimePart = @"MTOM message content in MIME part is invalid.";
-public const string MtomMessageInvalidMimeVersion = @"MTOM message has invalid MIME version. Expected '{1}', got '{0}' instead.";
-public const string MtomMessageNotApplicationXopXml = @"MTOM msssage type is not '{0}'.";
-public const string MtomMessageNotMultipart = @"MTOM message is not multipart: media type should be '{0}', media subtype should be '{1}'.";
-public const string MtomMessageRequiredParamNotSpecified = @"Required MTOM parameter '{0}' is not specified.";
-public const string MtomMimePartReferencedMoreThanOnce = @"Specified MIME part '{0}' is referenced more than once.";
-public const string MtomPartNotFound = @"MTOM part with URI '{0}' is not found.";
-public const string MtomRootContentTypeNotFound = @"MTOM root content type is not found.";
-public const string MtomRootNotApplicationXopXml = @"MTOM root should have media type '{0}' and subtype '{1}'.";
-public const string MtomRootPartNotFound = @"MTOM root part is not found.";
-public const string MtomRootRequiredParamNotSpecified = @"Required MTOM root parameter '{0}' is not specified.";
-public const string MtomRootUnexpectedCharset = @"Unexpected charset on MTOM root. Expected '{1}', got '{0}' instead.";
-public const string MtomRootUnexpectedType = @"Unexpected type on MTOM root. Expected '{1}', got '{0}' instead.";
-public const string MtomXopIncludeHrefNotSpecified = @"xop Include element did not specify '{0}' attribute.";
-public const string MtomXopIncludeInvalidXopAttributes = @"xop Include element has invalid attribute: '{0}' in '{1}' namespace.";
-public const string MtomXopIncludeInvalidXopElement = @"xop Include element has invalid element: '{0}' in '{1}' namespace.";
-public const string MustContainOnlyLocalElements = @"Only local elements can be imported.";
-public const string NoAsyncWritePending = @"No async write operation is pending.";
-public const string NonOptionalFieldMemberOnIsReferenceSerializableType = @"For type '{0}', non-optional field member '{1}' is on the Serializable type that has IsReference as {2}.";
-public const string OnlyDataContractTypesCanHaveExtensionData = @"On '{0}' type, only DataContract types can have extension data.";
-public const string PartialTrustISerializableNoPublicConstructor = @"Partial trust access required for the constructor on the ISerializable type '{0}'";
-public const string QueryGeneratorPathToMemberNotFound = @"The path to member was not found for XPath query generator.";
-public const string ReadNotSupportedOnStream = @"Read operation is not supported on the Stream.";
-public const string ReadOnlyClassDeserialization = @"Error on deserializing read-only members in the class: {0}";
-public const string ReadOnlyCollectionDeserialization = @"Error on deserializing read-only collection: {0}";
-public const string RecursiveCollectionType = @"Type '{0}' involves recursive collection.";
-public const string RedefineNotSupported = @"XML Schema 'redefine' is not supported.";
-public const string ReferencedBaseTypeDoesNotExist = @"Referenced base type does not exist. Data contract name: '{0}' in '{1}' namespace, expected type: '{2}' in '{3}' namespace. Collection can be '{4}' or '{5}'."; // is it the expected message? I'm quite unsure.
-public const string ReferencedCollectionTypesCannotContainNull = @"Referenced collection types cannot contain null.";
-public const string ReferencedTypeDoesNotMatch = @"Referenced type '{0}' does not match the expected type '{1}' in '{2}' namespace.";
-public const string ReferencedTypeMatchingMessage = @"Reference type matches.";
-public const string ReferencedTypeNotMatchingMessage = @"Reference type does not match.";
-public const string ReferencedTypesCannotContainNull = @"Referenced types cannot contain null.";
-public const string RequiresClassDataContractToSetIsISerializable = @"To set IsISerializable, class data cotnract is required.";
-public const string RootParticleMustBeSequence = @"Root particle must be sequence to be imported.";
-public const string RootSequenceMaxOccursMustBe = @"On root sequence, maxOccurs must be 1.";
-public const string RootSequenceMustBeRequired = @"Root sequence must have an item and minOccurs must be 1.";
-public const string SeekNotSupportedOnStream = @"Seek operation is not supported on this Stream.";
-public const string SerializationInfo_ConstructorNotFound = @"Constructor that takes SerializationInfo and StreamingContext is not found for '{0}'.";
-public const string SimpleContentNotSupported = @"Simple content is not supported.";
-public const string SimpleTypeRestrictionDoesNotSpecifyBase = @"This simpleType restriction does not specify the base type.";
-public const string SimpleTypeUnionNotSupported = @"simpleType union is not supported.";
-public const string SpecifiedTypeNotFoundInSchema = @"Specified type '{0}' in '{1}' namespace is not found in the schemas.";
-public const string SubstitutionGroupOnElementNotSupported = @"substitutionGroups on elements are not supported.";
-public const string SurrogatesWithGetOnlyCollectionsNotSupported = @"Surrogates with get-only collections are not supported. Type '{1}' contains '{2}' which is of '{0}' type.";
-public const string SurrogatesWithGetOnlyCollectionsNotSupportedSerDeser = @"Surrogates with get-only collections are not supported. Found on type '{0}'.";
-public const string TopLevelElementRepresentsDifferentType = @"Top-level element represents a different type. Expected '{0}' type in '{1}' namespace.";
-public const string TraceCodeElementIgnored = @"Element ignored";
-public const string TraceCodeFactoryTypeNotFound = @"Factory type not found";
-public const string TraceCodeObjectWithLargeDepth = @"Object with large depth";
-public const string TraceCodeReadObjectBegin = @"ReadObject begins";
-public const string TraceCodeReadObjectEnd = @"ReadObject ends";
-public const string TraceCodeWriteObjectBegin = @"WriteObject begins";
-public const string TraceCodeWriteObjectContentBegin = @"WriteObjectContent begins";
-public const string TraceCodeWriteObjectContentEnd = @"WriteObjectContent ends";
-public const string TraceCodeWriteObjectEnd = @"WriteObject ends";
-public const string TraceCodeXsdExportAnnotationFailed = @"XSD export annotation failed";
-public const string TraceCodeXsdExportBegin = @"XSD export begins";
-public const string TraceCodeXsdExportDupItems = @"XSD export duplicate items";
-public const string TraceCodeXsdExportEnd = @"XSD export ends";
-public const string TraceCodeXsdExportError = @"XSD export error";
-public const string TraceCodeXsdImportAnnotationFailed = @"XSD import annotation failed";
-public const string TraceCodeXsdImportBegin = @"XSD import begins";
-public const string TraceCodeXsdImportEnd = @"XSD import ends";
-public const string TraceCodeXsdImportError = @"XSD import error";
-public const string TypeCannotBeForwardedFrom = @"Type '{0}' in assembly '{1}' cannot be forwarded from assembly '{2}'.";
-public const string TypeCannotBeImported = @"Type '{0}' in '{1}' namespace cannot be imported: {2}";
-public const string TypeCannotBeImportedHowToFix = @"Type cannot be imported: {0}"; // I cannot see where HowToFix is given from...
-public const string TypeHasNotBeenImported = @"Type '{0}' in '{1}' namespace has not been imported.";
-public const string TypeMustBeIXmlSerializable = @"Type '{0}' must be IXmlSerializable. Contract type: '{1}', contract name: '{2}' in '{3}' namespace.";
-public const string TypeShouldNotContainAttributes = @"Type should not contain attributes. Serialization namespace: '{0}'.";
-public const string UnknownXmlType = @"Unknown XML type: '{0}'.";
-public const string WriteBufferOverflow = @"Write buffer overflow.";
-public const string WriteNotSupportedOnStream = @"Write operation is not supported on this '{0}' Stream.";
-public const string XmlCanonicalizationNotStarted = @"XML canonicalization was not started.";
-public const string XmlCanonicalizationStarted = @"XML canonicalization started";
-public const string XmlMaxArrayLengthOrMaxItemsQuotaExceeded = @"XML max array length or max items quota exceeded. It must be less than {0}.";
-public const string XmlMaxBytesPerReadExceeded = @"XML max bytes per read exceeded. It must be less than {0}.";
-public const string XmlMaxDepthExceeded = @"XML max depth exceeded. It must be less than {0}.";
-public const string XmlMaxStringContentLengthExceeded = @"XML max string content length exceeded. It must be less than {0}.";
-public const string XmlObjectAssignedToIncompatibleInterface = @"Object of type '{0}' is assigned to an incompatible interface '{1}'.";
-
-#endregion
-       }
-}
index 63c072d99e9386e2e103b8fe8650c14f1df12426..9e790d522b7eeae84c83c918ccb91584bed7e9fc 100644 (file)
@@ -5,7 +5,7 @@ Assembly/AssemblyInfo.cs
 ReferenceSources/DiagnosticUtility.cs
 ReferenceSources/FxTrace.cs
 ReferenceSources/SR.cs
-ReferenceSources/SR_missing.cs
+ReferenceSources/SR.missing.cs
 ReferenceSources/XmlExceptionHelper.cs
 
 ReferenceSources/BitFlagsGenerator.cs
index 03e2493cc2606e41cabdaa5cabc0fbfb26db05f0..451a06e2f4c2e91d8827c10f0103166bebf7aaa0 100644 (file)
@@ -3,10 +3,9 @@ SUBDIRS =
 include ../../build/rules.make
 
 LIBRARY = System.Security.dll
-LIB_REFS = System System.Xml Mono.Security
+LIB_REFS = secxml/System bare/System.Xml Mono.Security
 LIB_MCS_FLAGS = -nowarn:618 \
        -d:SECURITY_DEP \
-       -r:$(corlib) \
        -nowarn:414
 
 LOCAL_MCS_FLAGS = -lib:$(secxml_libdir) -lib:$(bare_libdir)
index ad7f73f1b92be950c3c6236ff50567dab61271f9..2be1563c1d7fe3fcd25604e4bbcefd2b6a3489fc 100644 (file)
@@ -4,14 +4,13 @@ include ../../build/rules.make
 
 LIBRARY = System.ServiceModel.Activation.dll
 
-LIB_REFS = System.Core System System.ServiceModel
+LIB_REFS = System.Core System plainservice/System.ServiceModel
 LIB_MCS_FLAGS =
 
-TEST_MCS_FLAGS = -r:System.dll -r:System.Core.dll
+TEST_MCS_FLAGS =
+TEST_LIB_REFS = System System.Core
 
-plainservicemodel_dir = $(the_libdir_base)plainservice
-servicemodel = $(plainservicemodel_dir)/System.ServiceModel.dll
-LOCAL_MCS_FLAGS = -lib:$(plainservicemodel_dir)
+servicemodel = $(the_libdir_base)plainservice/System.ServiceModel.dll
 
 include ../../build/library.make
 
index 75422d19e74fbd15a21aa447024b116fd0fdb180..d46df268454428326dff800cee795250cb365896 100644 (file)
@@ -8,8 +8,7 @@ LIB_MCS_FLAGS =
 
 ifneq (2.1, $(FRAMEWORK_VERSION))
 LIB_REFS += System.Configuration
-LIB_MCS_FLAGS += -d:NET_3_5 -d:NET_3_0         \
-                       -r:System.Configuration.dll
+LIB_MCS_FLAGS += -d:NET_3_5 -d:NET_3_0 
 endif
 
 TEST_MCS_FLAGS = $(LIB_MCS_FLAGS)
index ad9a78e6a60c6f2c9a67566f26c10a6c286d2152..f8d30f60025f57b042f907851c4feef3c5be7019 100644 (file)
@@ -8,8 +8,7 @@ LIB_MCS_FLAGS =
 
 ifneq (2.1, $(FRAMEWORK_VERSION))
 LIB_REFS += System.Configuration
-LIB_MCS_FLAGS += -d:NET_3_5 -d:NET_3_0         \
-                       -r:System.Configuration.dll
+LIB_MCS_FLAGS += -d:NET_3_5 -d:NET_3_0
 endif
 
 TEST_MCS_FLAGS = $(LIB_MCS_FLAGS)
index 03dbd5fd9e59d7fd8b5b225e7ed63040f22fc059..5f09e6a23292aadd8f61059dbe303d53c118bc57 100644 (file)
@@ -34,7 +34,8 @@ activation = $(the_libdir_base)System.ServiceModel.Activation.dll
 servicemodel_deps = $(activation)
 
 ifneq (plainservice/,$(intermediate))
-LIB_MCS_FLAGS += -define:HAS_ACTIVATION -r:System.ServiceModel.Activation.dll
+LIB_REFS += System.ServiceModel.Activation
+LIB_MCS_FLAGS += -define:HAS_ACTIVATION
 endif 
 endif # NO_SYSTEM_SERVICEMODEL_ACTIVATION_DEPENDENCY
 
index 349e5c75754d6e3996c58e5041b9253198c7b489..017f1a880c8a371ee9a228c80fe6c8aaebf9991d 100644 (file)
@@ -7,8 +7,9 @@ LIBRARY = System.Threading.Tasks.Dataflow.dll
 include ../../build/library.make
 
 LIB_REFS += System.Core System
-LIB_MCS_FLAGS += -r:$(corlib) -d:CONCURRENT_COLLECTIONS
+LIB_MCS_FLAGS += -d:CONCURRENT_COLLECTIONS
 
-TEST_MCS_FLAGS = -r:System.Core.dll -r:System.dll
+TEST_MCS_FLAGS =
+TEST_LIB_REFS = System.Core System
 
 EXTRA_DISTFILES=README.md
index 08e9bd68021ad136a721544c9f3a7366b8dd10cc..07672c10b06da81802b6a3ac7188edce5129ee90 100644 (file)
@@ -5,10 +5,10 @@ include ../../build/rules.make
 LIBRARY = System.Transactions.dll
 ifdef MOBILE_PROFILE
 LIB_REFS = System
-LIB_MCS_FLAGS = /r:$(corlib) /define:MOBILE
+LIB_MCS_FLAGS = /define:MOBILE
 else
 LIB_REFS = System System.Configuration
-LIB_MCS_FLAGS = /r:$(corlib)
+LIB_MCS_FLAGS =
 endif
 
 TEST_MCS_FLAGS = $(LIB_MCS_FLAGS)
index 08cb7d04c2b6c0d14512c03a8f744431da3b33b6..df81a3719ca47c816f3937a33d1e1886bae5831d 100644 (file)
@@ -160,11 +160,11 @@ TEST_RESOURCE_FILES = \
 
 NUNIT_RESOURCE_FILES = $(TEST_RESOURCE_FILES)
 
-TEST_MCS_FLAGS = $(LIB_MCS_FLAGS) -r:System.ComponentModel.DataAnnotations.dll -r:System.Configuration.dll \
-       $(NUNIT_RESOURCE_FILES:%=/resource:%) -r:SystemWebTestShim.dll -r:System.Xml.dll
+TEST_LIB_REFS = System.ComponentModel.DataAnnotations System.Configuration SystemWebTestShim System.Xml
+TEST_MCS_FLAGS = $(LIB_MCS_FLAGS) $(NUNIT_RESOURCE_FILES:%=/resource:%)
 
 ifeq (4, $(FRAMEWORK_VERSION_MAJOR))
-TEST_MCS_FLAGS += -r:System.Web.ApplicationServices.dll
+TEST_LIB_REFS += System.Web.ApplicationServices
 endif
 
 EXTRA_DISTFILES = $(foreach resource,$(TEST_RESOURCE_FILES), $(shell echo $(subst \`,\\\`,$(resource)) | cut -d ',' -f 1))
index bf15f32944f8a2e700ca4acc1066ddedf799497e..4a3f8a48970acbdeb930cc1d3928e8e329f9698f 100644 (file)
@@ -39,7 +39,7 @@ NUNIT_RESOURCE_FILES= \
 CLASSLIB_DIR = $(topdir)/class/lib/$(PROFILE)
 
 STANDALONE_RUNNER_SUPPORT_ASSEMBLY = $(CLASSLIB_DIR)/standalone-runner-support.dll
-STANDALONE_TEST_MCS_FLAGS = $(LIB_MCS_FLAGS) $(PROFILE_MCS_FLAGS) -debug:full -r:$(STANDALONE_RUNNER_SUPPORT_ASSEMBLY) -r:System.Web.dll -r:System.Web.Extensions.dll -r:nunit.framework.dll
+STANDALONE_TEST_MCS_FLAGS = $(LIB_MCS_FLAGS) $(PROFILE_MCS_FLAGS) -r:$(STANDALONE_RUNNER_SUPPORT_ASSEMBLY) -r:$(topdir)/class/lib/$(PROFILE)/System.Web.dll -r:$(topdir)/class/lib/$(PROFILE)/System.Web.Extensions.dll -r:$(topdir)/class/lib/$(PROFILE)/nunit.framework.dll
 STANDALONE_TEST_ASSEMBLY = System.Web.Extensions_standalone_test_$(PROFILE).dll
 STANDALONE_TEST_MAKEFRAG = $(depsdir)/$(STANDALONE_TEST_ASSEMBLY).makefrag
 
@@ -49,20 +49,20 @@ ifdef TESTNAME
 RUN_STANDALONE += --test=$(TESTNAME)
 endif
 
-ifeq (4, $(FRAMEWORK_VERSION_MAJOR))
-OTHER_LIB_MCS_FLAGS += -r:System.Web.ApplicationServices.dll
-endif
-
 LIB_REFS = System System.Core System.Drawing System.Data System.Data.Linq System.Xml System.Web System.Web.Services System.Configuration System.EnterpriseServices System.ServiceModel
 LIB_MCS_FLAGS = \
        -unsafe \
        -define:NET_3_5                 \
        -define:SYSTEM_WEB_EXTENSIONS   \
-       -r:$(corlib)                    \
        $(OTHER_LIB_MCS_FLAGS)          \
        $(RESOURCE_FILES:%=/resource:%)
 
-TEST_MCS_FLAGS = $(LIB_MCS_FLAGS) -doc:$(test_lib:.dll=.xml) -nowarn:219,169,1591 $(NUNIT_RESOURCE_FILES:%=/resource:%) -r:SystemWebTestShim.dll -define:SYSTEM_WEB_EXTENSIONS
+ifeq (4, $(FRAMEWORK_VERSION_MAJOR))
+LIB_REFS += System.Web.ApplicationServices
+endif
+
+TEST_LIB_REFS = SystemWebTestShim
+TEST_MCS_FLAGS = $(LIB_MCS_FLAGS) -doc:$(test_lib:.dll=.xml) -nowarn:219,169,1591 $(NUNIT_RESOURCE_FILES:%=/resource:%) -define:SYSTEM_WEB_EXTENSIONS
 
 EXTRA_DISTFILES = $(RESOURCE_FILES_DIST) $(NUNIT_RESOURCE_FILES) \
        System.Web.Extensions_standalone_test.dll.sources \
index 891b1ef66ce35e2bd5bfe39da86555d0efe195e4..29e6cfb92b86bd69a4e665ccb7ab5a94d7cb4732 100644 (file)
@@ -473,22 +473,22 @@ namespace System.Web.Script.Serialization
                                case JsonType.INTEGER:
                                        /* MS AJAX.NET JSON parser promotes big integers to double */
                                        
-                                       if (Int32.TryParse (s, out intValue))
+                                       if (Int32.TryParse (s, NumberStyles.Integer, CultureInfo.InvariantCulture, out intValue))
                                                result = intValue;
-                                       else if (Int64.TryParse (s, out longValue))
+                                       else if (Int64.TryParse (s, NumberStyles.Integer, CultureInfo.InvariantCulture, out longValue))
                                                result = longValue;
-                                       else if (Decimal.TryParse (s, out decimalValue))
+                                       else if (Decimal.TryParse (s, NumberStyles.Integer, CultureInfo.InvariantCulture, out decimalValue))
                                                result = decimalValue;
-                                       else if (Double.TryParse (s, out doubleValue))
+                                       else if (Double.TryParse (s, NumberStyles.Integer, CultureInfo.InvariantCulture, out doubleValue))
                                                result = doubleValue;
                                        else
                                                converted = false;
                                        break;
 
                                case JsonType.FLOAT:
-                                       if (Decimal.TryParse (s, out decimalValue))
+                                       if (Decimal.TryParse (s, NumberStyles.Float, CultureInfo.InvariantCulture, out decimalValue))
                                                result = decimalValue;
-                                       else if (Double.TryParse (s, out doubleValue))
+                                       else if (Double.TryParse (s, NumberStyles.Float, CultureInfo.InvariantCulture, out doubleValue))
                                                result = doubleValue;
                                        else
                                                converted = false;
index 8dc9e38c43b75b78c8be7d286bc3bf4736c51827..61e4b502d66fa576ee93829bd322d9ef8bfb2f30 100644 (file)
@@ -1439,5 +1439,43 @@ namespace MonoTests.System.Web.Script.Serialization
                        Assert.AreEqual (1337.0, obj.d);
                        Assert.AreEqual (null, obj.o);
                }
+
+               [Test]
+               public void DeserializeInCultureWithCommaSeparator ()
+               {
+                       var origCulture = Thread.CurrentThread.CurrentCulture;
+
+                       try {
+                               Thread.CurrentThread.CurrentCulture = new CultureInfo ("en-US");
+                               CommaSeparatorTest ();
+
+                               Thread.CurrentThread.CurrentCulture = new CultureInfo ("fi-FI");
+                               CommaSeparatorTest ();
+                       } finally {
+                               Thread.CurrentThread.CurrentCulture = origCulture;
+                       }
+               }
+
+               public class DoubleTest
+               {
+                       public double[] value { get; set; }
+               }
+
+               void CommaSeparatorTest()
+               {
+                       JavaScriptSerializer serializer = new JavaScriptSerializer ();
+
+                       DoubleTest array = new DoubleTest ();
+                       array.value = new[] { 123.345, 0.69 };
+
+                       string arrayJson = serializer.Serialize (array);
+                       Console.WriteLine (arrayJson);
+
+                       // This throwed incorrectly a "System.ArgumentException: Invalid JSON primitive: 123.345" with a CurrentThread.CultureInfo that has a comma as the number separator.
+                       DoubleTest obj = serializer.Deserialize<DoubleTest> (arrayJson);
+
+                       Assert.AreEqual (123.345, obj.value[0], "#1");
+                       Assert.AreEqual (0.69, obj.value[1], "#2");
+               }
        }
 }
index c189f7963eb63425694f478679cdad6841ffab3d..0e8dd48092a02ed4dec8aa97c7c34f192ae50502 100644 (file)
@@ -7,9 +7,6 @@ ifdef MOBILE_PROFILE
 LIB_REFS = System System.Xml
 LIB_MCS_FLAGS = \
        -nowarn:649 -nowarn:169                 \
-       -r:$(corlib)                            \
-       -r:System.dll                           \
-       -r:System.Xml.dll                       \
        -resource:System.Web.Services.Description/wsdl-1.1.xsd,wsdl-1.1.xsd \
        -resource:System.Web.Services.Description/wsdl-1.1-soap.xsd,wsdl-1.1-soap.xsd \
        -resource:System.Web.Services.Description/web-reference.xsd,web-reference.xsd
@@ -18,19 +15,15 @@ LIB_REFS = System System.EnterpriseServices System.Xml System.Data
 LIB_MCS_FLAGS = -nowarn:168,169,219,414,612,649 -d:MONO_BROKEN_CONFIGURATION_DLL
 
 ifndef NO_SYSTEM_WEB_DEPENDENCY
-LIB_REFS += System.Web
-plainweb_dir = $(the_libdir_base)plainweb
-plainweb = $(plainweb_dir)/System.Web.dll
-system_web_services_deps = $(plainweb)
-LOCAL_MCS_FLAGS += -lib:$(plainweb_dir)
+plainweb = $(the_libdir_base)plainweb/System.Web.dll
+system_web_deps = $(plainweb)
+LIB_REFS += plainweb/System.Web
 endif
 
 ifndef NO_SYSTEM_DESIGN_DEPENDENCY
-LIB_REFS += System.Design
-plaindesign_dir = $(the_libdir_base)plaindesign
-plaindesign = $(plaindesign_dir)/System.Design.dll
+plaindesign = $(the_libdir_base)plaindesign/System.Design.dll
 system_design_deps = $(plaindesign)
-LOCAL_MCS_FLAGS += -lib:$(plaindesign_dir)
+LIB_REFS += plaindesign/System.Design
 endif
 
 ifndef NO_SYSTEM_DIRECTORY_SERVICES_DEPENDENCY
@@ -63,7 +56,7 @@ EXTRA_DISTFILES = \
 
 include ../../build/library.make
 
-$(the_libdir_base)$(LIBRARY): $(system_web_services_deps) $(system_design_deps)
+$(the_libdir_base)$(LIBRARY): $(system_web_deps) $(system_design_deps)
 
 $(plainweb):
        (cd ../System.Web; $(MAKE) $@)
index 72f14d105779d04a3118b84c4d456bc0fce77c8c..9656cafa25b83a982e5f191d59a1db6bbd8c8100 100644 (file)
@@ -233,33 +233,33 @@ NUNIT_APP_CODE_FILES = $(TEST_APP_CODE_FILES)
 NUNIT_APP_GLOBALRESOURCES_FILES = $(TEST_APP_GLOBALRESOURCES_FILES)
 
 OTHER_RES += $(RESOURCE_FILES_2)
-OTHER_LIB_MCS_FLAGS = -d:INSIDE_SYSTEM_WEB -nowarn:618 -r:System.Configuration.dll -r:Mono.Data.Sqlite.dll
+OTHER_LIB_MCS_FLAGS = -d:INSIDE_SYSTEM_WEB -nowarn:618
 
 ifeq (4, $(FRAMEWORK_VERSION_MAJOR))
-OTHER_LIB_MCS_FLAGS += -r:System.Web.ApplicationServices.dll
 OTHER_RES += $(RESOURCE_FILES_4)
 endif
 
 TXT_RESOURCE_STRINGS = ../../../external/referencesource/System.Web/System.Web.txt
 
-LIB_REFS = System System.Core System.Drawing System.Data System.Xml System.EnterpriseServices System.Runtime.Serialization.Formatters.Soap System.ComponentModel.DataAnnotations
+LIB_REFS = System System.Core System.Drawing System.Data System.Xml System.EnterpriseServices System.Runtime.Serialization.Formatters.Soap \
+       System.ComponentModel.DataAnnotations System.Web.ApplicationServices System.Configuration Mono.Data.Sqlite
 LIB_MCS_FLAGS = \
        -unsafe \
        -nowarn:612,618 \
-       -r:$(corlib)                    \
        $(OTHER_LIB_MCS_FLAGS) \
        $(RESX_RES:%=/resource:%) \
        $(OTHER_RES:%=/resource:%)
 
 ifneq (plainweb/,$(intermediate))
-LIB_REFS += System.Web.Services System.Design
+LIB_REFS += System.Web.Services plaindesign/System.Design
 LIB_MCS_FLAGS += -define:WEBSERVICES_DEP -lib:$(the_libdir_base)plaindesign
 
 all-local: System.Web/UplevelHelper.cs resources/TranslationResources.resources 
 
 endif
 
-TEST_MCS_FLAGS = $(LIB_MCS_FLAGS) -doc:$(test_lib:.dll=.xml) -nowarn:219,169,1591 -r:SystemWebTestShim.dll \
+TEST_LIB_REFS = SystemWebTestShim
+TEST_MCS_FLAGS = $(LIB_MCS_FLAGS) -doc:$(test_lib:.dll=.xml) -nowarn:219,169,1591 \
        $(NUNIT_RESOURCE_FILES:%=/resource:%) \
        $(foreach file,$(NUNIT_APP_CODE_FILES),$(shell echo $(file) | sed -e 's;\(.*\)/\(.*\);/resource:\1/\2,App_Code/\2 ;g')) \
        $(foreach file,$(NUNIT_APP_GLOBALRESOURCES_FILES),$(shell echo $(file) | sed -e 's;\(.*\)/\(.*\);/resource:\1/\2,App_GlobalResources/\2 ;g'))
@@ -322,11 +322,11 @@ endif
 
 CLASSLIB_DIR = $(topdir)/class/lib/$(PROFILE)
 
-STANDALONE_RUNNER_SUPPORT_MCS_FLAGS = $(LIB_MCS_FLAGS) $(PROFILE_MCS_FLAGS) -d:STANDALONE_TEST -debug:full -r:System.Web.dll -r:nunit.framework.dll
+STANDALONE_RUNNER_SUPPORT_MCS_FLAGS = $(LIB_MCS_FLAGS) $(PROFILE_MCS_FLAGS) -d:STANDALONE_TEST -r:$(topdir)/class/lib/$(PROFILE)/System.Web.dll -r:$(topdir)/class/lib/$(PROFILE)/nunit.framework.dll
 STANDALONE_RUNNER_SUPPORT_ASSEMBLY = $(CLASSLIB_DIR)/standalone-runner-support.dll
 STANDALONE_RUNNER_SUPPORT_MAKEFRAG = $(depsdir)/$(PROFILE)_standalone-runner-support.dll.makefrag
 
-STANDALONE_TEST_MCS_FLAGS = $(LIB_MCS_FLAGS) $(PROFILE_MCS_FLAGS) -debug:full -r:$(STANDALONE_RUNNER_SUPPORT_ASSEMBLY) -r:System.Web.dll -r:nunit.framework.dll
+STANDALONE_TEST_MCS_FLAGS = $(LIB_MCS_FLAGS) $(PROFILE_MCS_FLAGS) -r:$(STANDALONE_RUNNER_SUPPORT_ASSEMBLY) -r:$(topdir)/class/lib/$(PROFILE)/System.Web.dll -r:$(topdir)/class/lib/$(PROFILE)/nunit.framework.dll
 STANDALONE_TEST_ASSEMBLY = System.Web_standalone_test_$(PROFILE).dll
 STANDALONE_TEST_MAKEFRAG = $(depsdir)/$(STANDALONE_TEST_ASSEMBLY).makefrag
 
index bfe9f95caa27775f0c959b4c0ca17c8ae708845a..9cbb4159d004d5bf1c20d5f539f159e050336666 100644 (file)
@@ -10,9 +10,9 @@ STANDALONE_RUNNER_SOURCES = \
        ../../../Mono.Options/Mono.Options/Options.cs \
 
 STANDALONE_RUNNER_REFERENCES = \
-       -lib:$(CLASSLIB_DIR) \
        -r:$(STANDALONE_RUNNER_SUPPORT_ASSEMBLY) \
-       -r:System.Web.dll
+       -r:$(CLASSLIB_DIR)/System.Web.dll \
+       -r:$(CLASSLIB_DIR)/System.dll
 
 CACHE_PQ_TEST_GENERATOR_SOURCES = \
        CachePQTestGenerator/CacheItemComparer.cs \
@@ -27,7 +27,6 @@ CACHE_PQ_TEST_GENERATOR_SOURCES = \
        ../System.Web.Caching/CacheItemPriorityQueueTestSupport.cs
 
 CACHE_PQ_TEST_GENERATOR_REFERENCES = \
-       -lib:$(CLASSLIB_DIR) \
        -pkg:dotnet
 
 CACHE_PQ_TEST_SEQUENCES = $(wildcard ./CachePQTestGenerator/Sequences/*.seq)
@@ -36,13 +35,13 @@ CACHE_PQ_TEST_PACKED_SEQUENCES = $(wildcard ./CachePQTestGenerator/Sequences/*.s
 all-local: HtmlWriter.dll standalone-runner.exe cache-pq-test-generator.exe
 
 HtmlWriter.dll: HtmlWriter.cs
-       $(MCS) -t:library -r:System.Web.dll $<
+       $(CSCOMPILE) -t:library -r:System.Web.dll $<
 
 standalone-runner.exe: deps $(STANDALONE_RUNNER_SOURCES)
-       $(MCS) -debug:full $(STANDALONE_RUNNER_REFERENCES) -out:$@ $(STANDALONE_RUNNER_SOURCES)
+       $(CSCOMPILE) $(STANDALONE_RUNNER_REFERENCES) -out:$@ $(STANDALONE_RUNNER_SOURCES)
 
 cache-pq-test-generator.exe: $(CACHE_PQ_TEST_GENERATOR_SOURCES)
-       $(MCS) -debug:full -d:DEBUG $(CACHE_PQ_TEST_GENERATOR_REFERENCES) -out:$@ $(CACHE_PQ_TEST_GENERATOR_SOURCES)
+       $(CSCOMPILE) -d:DEBUG $(CACHE_PQ_TEST_GENERATOR_REFERENCES) -out:$@ $(CACHE_PQ_TEST_GENERATOR_SOURCES)
 
 generate-cache-pq-tests: cache-pq-test-generator.exe 
        for f in $(patsubst %.seq.gz,%.seq,$(CACHE_PQ_TEST_PACKED_SEQUENCES)); do \
index 3d8113656cf5f9dd2acce3436c67bd6a1e9c3e27..06eacbcbcf7cd073d64de672105b60d866fa266a 100644 (file)
@@ -5,7 +5,6 @@ LIBRARY = System.Windows.Forms.dll
 
 LIB_REFS = System System.Xml System.Drawing Accessibility System.Data Mono.Posix Mono.WebBrowser System.Configuration System.Runtime.Serialization.Formatters.Soap
 LIB_MCS_FLAGS = /unsafe \
-       /r:$(corlib) \
        @System.Windows.Forms.dll.resources \
        -nowarn:618,612,809
 
@@ -100,13 +99,15 @@ EXTRA_DISTFILES = \
        $(IMAGES_RESOURCES) \
        $(TEST_DISTFILES)
 
-TEST_MCS_FLAGS = /r:System.Data.dll /r:System.Drawing.dll /r:Accessibility.dll -r:System.dll -r:System.Xml.dll -r:System.Runtime.Serialization.Formatters.Soap\
+TEST_LIB_REFS = System.Data System.Drawing Accessibility System System.Xml System.Runtime.Serialization.Formatters.Soap
+TEST_MCS_FLAGS = \
        -resource:Test/resources/a.cur,a.cur \
        -resource:Test/resources/32x32.ico,32x32.ico \
        -nowarn:618,612
 
 DummyAssembly.dll:
-       $(CSCOMPILE) /target:library /out:$@ Test/DummyAssembly/AnotherSerializable.cs Test/DummyAssembly/Convertable.cs Test/DummyAssembly/Properties/AssemblyInfo.cs
+       $(CSCOMPILE) /target:library /out:$@ Test/DummyAssembly/AnotherSerializable.cs Test/DummyAssembly/Convertable.cs Test/DummyAssembly/Properties/AssemblyInfo.cs \
+       -r:$(topdir)/class/lib/$(PROFILE)/System.dll
 
 test-local: DummyAssembly.dll
 
index 183612a105348969632ad26a81b0835b28379a36..e66bd2e4635074301139ad12b82b242026bc4fda 100644 (file)
@@ -17,23 +17,24 @@ TXT_RESOURCE_STRINGS = \
        ../../../external/referencesource/System.Xml/System.Xml.txt \
        ../../../external/referencesource/System.Data.SqlXml/System.Xml.Utils.txt
 
-LIB_REFS = System
-LIB_MCS_FLAGS = -r:$(corlib)  -nowarn:219,414,649,1717 -unsafe -d:ASYNC
+LIB_MCS_FLAGS = -nowarn:219,414,649,1717 -unsafe -d:ASYNC
 
 ifeq (2.1, $(FRAMEWORK_VERSION))
 LIB_MCS_FLAGS += -d:AGCLR -d:NET_2_1_HACK -d:DISABLE_XSLT_COMPILER -d:DISABLE_XSLT_SCRIPT,MONO_HYBRID_SYSTEM_XML -d:DISABLE_CAS_USE
 endif
-TEST_MCS_FLAGS = $(LIB_MCS_FLAGS) -nowarn:0618 -nowarn:219 -nowarn:169 -r:System.Data.dll -r:System.Core.dll
 
-ifndef MOBILE_PROFILE
-FINAL_MCS_FLAGS = -r:System.Configuration.dll -d:CONFIGURATION_DEP
-endif
+TEST_LIB_REFS = System.Data System.Core
+TEST_MCS_FLAGS = $(LIB_MCS_FLAGS) -nowarn:0618 -nowarn:219 -nowarn:169
 
 ifneq (bare/,$(intermediate))
-LIB_MCS_FLAGS += $(FINAL_MCS_FLAGS)
+LIB_REFS += secxml/System 
+ifndef MOBILE_PROFILE
+LIB_REFS += System.Configuration
+LIB_MCS_FLAGS += -d:CONFIGURATION_DEP
+endif
+else
+LIB_REFS += $(intermediate)System
 endif
-
-LOCAL_MCS_FLAGS += -lib:$(bare_libdir)
 
 nist_dom_files = \
        ITest.cs readme.txt util.cs \
index a7651da891f7900adbb0b0cead4fa0ad03b94ce3..69456085a2bda90e18facc43bc4dcfcdffedf776 100644 (file)
@@ -83,3 +83,5 @@ using System.Runtime.InteropServices;
        [assembly: InternalsVisibleTo ("Mono.Security.Providers.NewTls, PublicKey=002400000480000094000000060200000024000052534131000400000100010079159977d2d03a8e6bea7a2e74e8d1afcc93e8851974952bb480a12c9134474d04062447c37e0e68c080536fcf3c3fbe2ff9c979ce998475e506e8ce82dd5b0f350dc10e93bf2eeecf874b24770c5081dbea7447fddafa277b22de47d6ffea449674a4f9fccf84d15069089380284dbdd35f46cdff12a1bd78e4ef0065d016df")]
        [assembly: InternalsVisibleTo ("Mono.Security.Providers.DotNet, PublicKey=002400000480000094000000060200000024000052534131000400000100010079159977d2d03a8e6bea7a2e74e8d1afcc93e8851974952bb480a12c9134474d04062447c37e0e68c080536fcf3c3fbe2ff9c979ce998475e506e8ce82dd5b0f350dc10e93bf2eeecf874b24770c5081dbea7447fddafa277b22de47d6ffea449674a4f9fccf84d15069089380284dbdd35f46cdff12a1bd78e4ef0065d016df")]
        [assembly: InternalsVisibleTo ("Mono.Security, PublicKey=002400000480000094000000060200000024000052534131000400000100010079159977d2d03a8e6bea7a2e74e8d1afcc93e8851974952bb480a12c9134474d04062447c37e0e68c080536fcf3c3fbe2ff9c979ce998475e506e8ce82dd5b0f350dc10e93bf2eeecf874b24770c5081dbea7447fddafa277b22de47d6ffea449674a4f9fccf84d15069089380284dbdd35f46cdff12a1bd78e4ef0065d016df")]
+
+       [assembly: InternalsVisibleTo ("Xamarin.BoringTls, PublicKey=002400000480000094000000060200000024000052534131000400001100000099dd12eda85767ae6f06023ee28e711c7e5a212462095c83868c29db75eddf6d8e296e03824c14fedd5f55553fed0b6173be3cc985a4b7f9fb7c83ccff8ba3938563b3d1f45a81122f12a1bcb73edcaad61a8456c7595a6da5184b4dd9d10f011b949ef1391fccfeab1ba62aa51c267ef8bd57ef1b6ba5a4c515d0badb81a78f")]
index 25031265acc6825dabdb97cc1350dabdce1a4215..1e19b0dd5bc02a9678e3d765cbe66b224864fa06 100644 (file)
@@ -19,7 +19,9 @@ TEST_RESOURCES = \
        Test/System/test-uri-props-manual.txt \
        Test/System/test-uri-relative-props.txt
 
-TEST_MCS_FLAGS = -r:System.Drawing.dll -r:Mono.Security.dll -r:System.Data.dll -r:System.Xml.dll -r:System.Core.dll -nowarn:618,672,219,67,169,612 \
+TEST_LIB_REFS = System.Drawing Mono.Security System.Data System.Xml System.Core System.Configuration
+
+TEST_MCS_FLAGS = -nowarn:618,672,219,67,169,612 \
        $(foreach f, $(TEST_RESOURCES), -resource:$(f),$(notdir $(f)))
 
 REFERENCE_SOURCES_FLAGS = -d:FEATURE_PAL,SYSTEM_NAMESPACE,MONO,PLATFORM_UNIX
@@ -29,7 +31,6 @@ TEST_MCS_FLAGS += -d:MONO_FEATURE_PROCESS_START
 endif
 
 LIB_MCS_FLAGS = -nowarn:618 -d:CONFIGURATION_2_0 $(REFERENCE_SOURCES_FLAGS) -unsafe $(RESOURCE_FILES:%=-resource:%)
-TEST_MCS_FLAGS += -r:System.Configuration.dll
 
 ifndef NO_THREAD_ABORT
 REFERENCE_SOURCES_FLAGS += -d:MONO_FEATURE_THREAD_ABORT
@@ -50,7 +51,6 @@ ifdef MOBILE_PROFILE
 LIB_MCS_FLAGS += -d:INSIDE_SYSTEM -d:SECURITY_DEP
 else
 EXTERN_ALIAS_FLAGS = -d:MONO_SECURITY_ALIAS -d:MONO_X509_ALIAS
-FINAL_MCS_FLAGS = -r:System.Configuration.dll -d:CONFIGURATION_DEP
 endif
 
 #
@@ -58,7 +58,7 @@ endif
 #
 ifeq (secxml/, $(intermediate))
 LOCAL_MCS_FLAGS = -lib:$(bare_libdir) 
-LIB_REFS += System.Xml MonoSecurity=Mono.Security
+LIB_REFS += bare/System.Xml MonoSecurity=Mono.Security
 LIB_MCS_FLAGS += -d:SECURITY_DEP -d:XML_DEP -r:PrebuiltSystem=$(bare_libdir)/System.dll $(EXTERN_ALIAS_FLAGS)
 endif
 
@@ -67,7 +67,13 @@ endif
 #
 ifndef intermediate
 LIB_REFS += System.Xml MonoSecurity=Mono.Security
-LIB_MCS_FLAGS += -d:SECURITY_DEP -d:XML_DEP -r:PrebuiltSystem=$(secxml_libdir)/System.dll $(EXTERN_ALIAS_FLAGS) $(FINAL_MCS_FLAGS)
+LIB_MCS_FLAGS += -d:SECURITY_DEP -d:XML_DEP -r:PrebuiltSystem=$(secxml_libdir)/System.dll $(EXTERN_ALIAS_FLAGS)
+
+ifndef MOBILE_PROFILE
+LIB_REFS += System.Configuration
+LIB_MCS_FLAGS += -d:CONFIGURATION_DEP
+endif
+
 endif
 
 EXTRA_DISTFILES = \
index 675d20f06d460620376a2361fa9ffbf8b999bd58..a4de75e853a54719fc8293f8852e83e2e32092be 100644 (file)
@@ -366,6 +366,8 @@ namespace Mono.CSharp
                                }
                        }
 
+                       args.Append ("/noconfig ");
+
                        args.Append (" -- ");
                        foreach (string source in fileNames)
                                args.AppendFormat("\"{0}\" ",source);
index 617fbdefd531e5d2e6686ce7cc15f85348498a34..9a5eab25ce6f4aee6f104fb0eb41ef4479c53c2c 100644 (file)
@@ -74,7 +74,7 @@ namespace Mono.Net.Security
 {
        internal delegate bool ServerCertValidationCallbackWrapper (ServerCertValidationCallback callback, X509Certificate certificate, X509Chain chain, MonoSslPolicyErrors sslPolicyErrors);
 
-       internal class ChainValidationHelper : ICertificateValidator
+       internal class ChainValidationHelper : ICertificateValidator2
        {
                readonly object sender;
                readonly MonoTlsSettings settings;
@@ -228,7 +228,7 @@ namespace Mono.Net.Security
                        var certs = new XX509CertificateCollection ();
                        certs.Add (new X509Certificate2 (certificate.GetRawCertData ()));
 
-                       var result = ValidateChain (string.Empty, true, certs, (SslPolicyErrors)errors);
+                       var result = ValidateChain (string.Empty, true, certificate, null, certs, (SslPolicyErrors)errors);
                        if (result == null)
                                return false;
 
@@ -238,7 +238,27 @@ namespace Mono.Net.Security
                public ValidationResult ValidateCertificate (string host, bool serverMode, XX509CertificateCollection certs)
                {
                        try {
-                               var result = ValidateChain (host, serverMode, certs, 0);
+                               X509Certificate leaf;
+                               if (certs != null && certs.Count != 0)
+                                       leaf = certs [0];
+                               else
+                                       leaf = null;
+                               var result = ValidateChain (host, serverMode, leaf, null, certs, 0);
+                               if (tlsStream != null)
+                                       tlsStream.CertificateValidationFailed = result == null || !result.Trusted || result.UserDenied;
+                               return result;
+                       } catch {
+                               if (tlsStream != null)
+                                       tlsStream.CertificateValidationFailed = true;
+                               throw;
+                       }
+               }
+
+               public ValidationResult ValidateCertificate (string host, bool serverMode, X509Certificate leaf, XX509Chain xchain)
+               {
+                       try {
+                               var chain = (X509Chain)(object)xchain;
+                               var result = ValidateChain (host, serverMode, leaf, chain, null, 0);
                                if (tlsStream != null)
                                        tlsStream.CertificateValidationFailed = result == null || !result.Trusted || result.UserDenied;
                                return result;
@@ -249,7 +269,28 @@ namespace Mono.Net.Security
                        }
                }
 
-               ValidationResult ValidateChain (string host, bool server, XX509CertificateCollection certs, SslPolicyErrors errors)
+               ValidationResult ValidateChain (string host, bool server, X509Certificate leaf,
+                                               X509Chain chain, XX509CertificateCollection certs,
+                                               SslPolicyErrors errors)
+               {
+                       var oldChain = chain;
+                       var ownsChain = chain == null;
+                       try {
+                               var result = ValidateChain (host, server, leaf, ref chain, certs, errors);
+                               if (chain != oldChain)
+                                       ownsChain = true;
+
+                               return result;
+                       } finally {
+                               // If ValidateChain() changed the chain, then we need to free it.
+                               if (ownsChain && chain != null)
+                                       chain.Dispose ();
+                       }
+               }
+
+               ValidationResult ValidateChain (string host, bool server, X509Certificate leaf,
+                                               ref X509Chain chain, XX509CertificateCollection certs,
+                                               SslPolicyErrors errors)
                {
                        // user_denied is true if the user callback is called and returns false
                        bool user_denied = false;
@@ -257,12 +298,6 @@ namespace Mono.Net.Security
 
                        var hasCallback = certValidationCallback != null || callbackWrapper != null;
 
-                       X509Certificate leaf;
-                       if (certs == null || certs.Count == 0)
-                               leaf = null;
-                       else
-                               leaf = certs [0];
-
                        if (tlsStream != null)
                                request.ServicePoint.UpdateServerCertificate (leaf);
 
@@ -281,7 +316,6 @@ namespace Mono.Net.Security
                        ICertificatePolicy policy = ServicePointManager.GetLegacyCertificatePolicy ();
 
                        int status11 = 0; // Error code passed to the obsolete ICertificatePolicy callback
-                       X509Chain chain = null;
 
                        bool wantsChain = SystemCertificateValidator.NeedsChain (settings);
                        if (!wantsChain && hasCallback) {
@@ -289,16 +323,15 @@ namespace Mono.Net.Security
                                        wantsChain = true;
                        }
 
-                       if (wantsChain)
-                               chain = SystemCertificateValidator.CreateX509Chain (certs);
-
                        bool providerValidated = false;
                        if (provider != null && provider.HasCustomSystemCertificateValidator) {
                                var xerrors = (MonoSslPolicyErrors)errors;
                                var xchain = (XX509Chain)(object)chain;
-                               providerValidated = provider.InvokeSystemCertificateValidator (this, host, server, certs, ref xchain, out result, ref xerrors, ref status11);
+                               providerValidated = provider.InvokeSystemCertificateValidator (this, host, server, certs, wantsChain, ref xchain, out result, ref xerrors, ref status11);
                                chain = (X509Chain)(object)xchain;
                                errors = (SslPolicyErrors)xerrors;
+                       } else if (wantsChain) {
+                               chain = SystemCertificateValidator.CreateX509Chain (certs);
                        }
 
                        if (!providerValidated)
index b2d964ceb5e0cc451618a2dfc914fd78f8dbc446..f17eb58d28dca262aeb2205bcaa41468a5183292 100644 (file)
@@ -317,10 +317,17 @@ namespace System.IO {
                        var eventBuffer = new kevent[0]; // we don't want to take any events from the queue at this point
                        var changes = CreateChangeList (ref initialFds);
 
-                       int numEvents = kevent (conn, changes, changes.Length, eventBuffer, eventBuffer.Length, ref immediate_timeout);
+                       int numEvents;
+                       int errno = 0;
+                       do {
+                               numEvents = kevent (conn, changes, changes.Length, eventBuffer, eventBuffer.Length, ref immediate_timeout);
+                               if (numEvents == -1) {
+                                       errno = Marshal.GetLastWin32Error ();
+                               }
+                       } while (numEvents == -1 && errno == EINTR);
 
                        if (numEvents == -1) {
-                               var errMsg = String.Format ("kevent() error at initial event registration, error code = '{0}'", Marshal.GetLastWin32Error ());
+                               var errMsg = String.Format ("kevent() error at initial event registration, error code = '{0}'", errno);
                                throw new IOException (errMsg);
                        }
                }
@@ -384,9 +391,10 @@ namespace System.IO {
                                        // Stop () signals us to stop by closing the connection
                                        if (requestStop)
                                                break;
-                                       if (++retries == 3)
+                                       int errno = Marshal.GetLastWin32Error ();
+                                       if (errno != EINTR && ++retries == 3)
                                                throw new IOException (String.Format (
-                                                       "persistent kevent() error, error code = '{0}'", Marshal.GetLastWin32Error ()));
+                                                       "persistent kevent() error, error code = '{0}'", errno));
 
                                        continue;
                                }
@@ -646,6 +654,7 @@ namespace System.IO {
                const int O_EVTONLY = 0x8000;
                const int F_GETPATH = 50;
                const int __DARWIN_MAXPATHLEN = 1024;
+               const int EINTR = 4;
                static readonly kevent[] emptyEventList = new System.IO.kevent[0];
                int maxFds = Int32.MaxValue;
 
@@ -665,19 +674,19 @@ namespace System.IO {
                string fixupPath = null;
                string fullPathNoLastSlash = null;
 
-               [DllImport ("libc", EntryPoint="fcntl", CharSet=CharSet.Auto, SetLastError=true)]
+               [DllImport ("libc", CharSet=CharSet.Auto, SetLastError=true)]
                static extern int fcntl (int file_names_by_descriptor, int cmd, StringBuilder sb);
 
-               [DllImport ("libc")]
+               [DllImport ("libc", SetLastError=true)]
                extern static int open (string path, int flags, int mode_t);
 
                [DllImport ("libc")]
                extern static int close (int fd);
 
-               [DllImport ("libc")]
+               [DllImport ("libc", SetLastError=true)]
                extern static int kqueue ();
 
-               [DllImport ("libc")]
+               [DllImport ("libc", SetLastError=true)]
                extern static int kevent (int kq, [In]kevent[] ev, int nchanges, [Out]kevent[] evtlist, int nevents, [In] ref timespec time);
 
                [MethodImplAttribute(MethodImplOptions.InternalCall)]
index 9726b91358b2ffeb1030370681e901b519a6ee8d..5400d73b87e7e6fee4d7d365260f00d7797f81d9 100644 (file)
@@ -73,7 +73,7 @@ namespace System.Net {
                        SocketAsyncEventArgs args = new SocketAsyncEventArgs ();
                        args.UserToken = this;
                        args.Completed += OnAccept;
-                       sock.AcceptAsync (args);
+                       Accept (sock, args);
                        prefixes = new Hashtable ();
                        unregistered = new Dictionary<HttpConnection, HttpConnection> ();
                }
@@ -82,28 +82,25 @@ namespace System.Net {
                        get { return listener; }
                }
 
-               static void OnAccept (object sender, EventArgs e)
+               static void Accept (Socket socket, SocketAsyncEventArgs e) {
+                       e.AcceptSocket = null;
+                       var asyn = socket.AcceptAsync(e);
+                       if (!asyn) {
+                               ProcessAccept(e);
+                       }
+               }
+
+
+               static void ProcessAccept (SocketAsyncEventArgs args) 
                {
-                       SocketAsyncEventArgs args = (SocketAsyncEventArgs) e;
-                       EndPointListener epl = (EndPointListener) args.UserToken;
                        Socket accepted = null;
-                       if (args.SocketError == SocketError.Success) {
+                       if (args.SocketError == SocketError.Success)
                                accepted = args.AcceptSocket;
-                               args.AcceptSocket = null;
-                       }
 
-                       try {
-                               if (epl.sock != null)
-                                       epl.sock.AcceptAsync (args);
-                       } catch {
-                               if (accepted != null) {
-                                       try {
-                                               accepted.Close ();
-                                       } catch {}
-                                       accepted = null;
-                               }
-                       } 
+                       EndPointListener epl = (EndPointListener) args.UserToken;
+
 
+                       Accept (epl.sock, args);
                        if (accepted == null)
                                return;
 
@@ -118,7 +115,12 @@ namespace System.Net {
                        conn.BeginReadRequest ();
                }
 
-               internal void RemoveConnection (HttpConnection conn)
+               static void OnAccept (object sender, SocketAsyncEventArgs e) 
+               {
+                       ProcessAccept (e);
+               }
+
+               internal void RemoveConnection (HttpConnection conn) 
                {
                        lock (unregistered) {
                                unregistered.Remove (conn);
index 476d3be7c22a21f834b329fd99a54215c312f005..2ee3b170c48f98baddbe1cbbb1e54337f9332648 100644 (file)
@@ -5,7 +5,8 @@ include ../../build/rules.make
 LIBRARY = WebMatrix.Data.dll
 
 LIB_REFS = System System.Data System.Core System.Configuration
-LIB_MCS_FLAGS = -r:$(corlib)
-TEST_MCS_FLAGS = -r:System.dll -r:System.Core.dll -r:System.Data.dll -r:Mono.Data.Sqlite.dll -r:Microsoft.CSharp.dll
+LIB_MCS_FLAGS =
+TEST_MCS_FLAGS =
+TEST_LIB_REFS = System System.Core System.Data Mono.Data.Sqlite Microsoft.CSharp
 
 include ../../build/library.make
index 172a501446ed8ef2cdff39eaa58e4ce4ab20906d..842c1ed0ebe00b59e48bc1392671abaa8d8fb563 100644 (file)
@@ -5,14 +5,15 @@ LIBRARY = WindowsBase.dll
 
 LIB_REFS = System System.Xml
 LIB_MCS_FLAGS = -unsafe
-TEST_MCS_FLAGS = -unsafe -r:WindowsBase.dll -r:System.dll -r:System.Xml.dll -r:System.Core.dll
+TEST_MCS_FLAGS = -unsafe
+TEST_LIB_REFS = WindowsBase System System.Xml System.Core
 
 ifeq (2.0, $(FRAMEWORK_VERSION))
 LIB_MCS_FLAGS += -d:NET_3_0
 endif
 ifeq (4, $(FRAMEWORK_VERSION_MAJOR))
 LIB_REFS += System.Xaml
-TEST_MCS_FLAGS += -r:System.Xaml.dll
+TEST_LIB_REFS += System.Xaml
 endif
 
 include ../../build/library.make
index cf95aee80ea0e92aa4eec92c3b2ce8c4a6bf8ccd..3c68cceb82bd865d74cc309f0221d75921bfc667 100644 (file)
@@ -94,4 +94,5 @@ using System.Runtime.InteropServices;
 [assembly: InternalsVisibleTo ("Xamarin.Mac, PublicKey=0024000004800000940000000602000000240000525341310004000011000000438ac2a5acfbf16cbd2b2b47a62762f273df9cb2795ceccdf77d10bf508e69e7a362ea7a45455bbf3ac955e1f2e2814f144e5d817efc4c6502cc012df310783348304e3ae38573c6d658c234025821fda87a0be8a0d504df564e2c93b2b878925f42503e9d54dfef9f9586d9e6f38a305769587b1de01f6c0410328b2c9733db")]
 #endif
 
+[assembly: InternalsVisibleTo ("Xamarin.BoringTls, PublicKey=002400000480000094000000060200000024000052534131000400001100000099dd12eda85767ae6f06023ee28e711c7e5a212462095c83868c29db75eddf6d8e296e03824c14fedd5f55553fed0b6173be3cc985a4b7f9fb7c83ccff8ba3938563b3d1f45a81122f12a1bcb73edcaad61a8456c7595a6da5184b4dd9d10f011b949ef1391fccfeab1ba62aa51c267ef8bd57ef1b6ba5a4c515d0badb81a78f")]
 [assembly: Guid ("BED7F4EA-1A96-11D2-8F08-00A0C9A6186D")]
index aff30966f5a5a3555c898dfa1bf8223a3202559f..95b3bc8d33703c3e3ba1bee382763bebd35f5267 100644 (file)
@@ -61,14 +61,14 @@ WARNING_ABOUT_DISABLED_WARNING=1635
 LOCAL_MCS_FLAGS = -unsafe -nostdlib -nowarn:612,618,$(WARNING_ABOUT_DISABLED_WARNING) -d:INSIDE_CORLIB,MONO_CULTURE_DATA -d:LIBC $(REFERENCE_SOURCES_FLAGS)
 DEFAULT_REFERENCES =
 
-ifdef MOBILE_STATIC
-CORLIB_MONO_POSIX_REF =
-else
-CORLIB_MONO_POSIX_REF = -r:Mono.Posix.dll
+TEST_LIB_REFS = System.Core System
+
+ifndef MOBILE_STATIC
+TEST_LIB_REFS += Mono.Posix
 endif
 
 # System.IO/DirectoryInfoTest.cs needs Mono.Posix
-TEST_MCS_FLAGS += -debug -nowarn:168,219,618,672 -unsafe $(CORLIB_MONO_POSIX_REF) -r:System.Core.dll -r:System.dll \
+TEST_MCS_FLAGS += -debug -nowarn:168,219,618,672 -unsafe \
                                 -define:MONO_DATACONVERTER_STATIC_METHODS $(TEST_RESX_RESOURCES:%=-resource:%)
 
 EXTRA_DISTFILES = \
@@ -108,11 +108,11 @@ $(test_lib): $(TEST_RESOURCES) $(satellite_assembly1) $(satellite_assembly2)
 
 $(satellite_assembly1): Test/resources/culture-es-ES.cs Test/resources/Resources.es-ES.resources
        @mkdir -p es-ES
-       $(CSCOMPILE) -target:library -r:$(corlib) Test/resources/culture-es-ES.cs -resource:Test/resources/Resources.es-ES.resources -out:$@
+       $(CSCOMPILE) -target:library -r:$(topdir)/class/lib/$(PROFILE)/mscorlib.dll Test/resources/culture-es-ES.cs -resource:Test/resources/Resources.es-ES.resources -out:$@
 
 $(satellite_assembly2): Test/resources/culture-nn-NO.cs Test/resources/Resources.nn-NO.resources
        @mkdir -p nn-NO
-       $(CSCOMPILE) -target:library -r:$(corlib) Test/resources/culture-nn-NO.cs -resource:Test/resources/Resources.nn-NO.resources -out:$@
+       $(CSCOMPILE) -target:library -r:$(topdir)/class/lib/$(PROFILE)/mscorlib.dll Test/resources/culture-nn-NO.cs -resource:Test/resources/Resources.nn-NO.resources -out:$@
 
 vtsdir = Test/System.Runtime.Serialization.Formatters.Binary/VersionTolerantSerialization
 vtslibs = \
@@ -127,11 +127,13 @@ test-vts: $(vtslibs) $(vtsdir)/$(PROFILE)_TestLib/BinarySerializationOverVersion
 
 $(vtsdir)/$(PROFILE)_TestLib/%/Address.dll: $(vtsdir)/VersionTolerantSerializationTestLib/%/Address.cs
        @mkdir -p $(dir $@)
-       $(CSCOMPILE) -target:library -r:$(corlib) -warn:0 -out:$@ $^
+       $(CSCOMPILE) -target:library -warn:0 -r:$(topdir)/class/lib/$(PROFILE)/mscorlib.dll -out:$@ $^
 
 $(vtsdir)/$(PROFILE)_TestLib/BinarySerializationOverVersions.exe: $(vtsdir)/BinarySerializationOverVersions.cs $(vtsdir)/$(PROFILE)_TestLib/1.0/Address.dll $(test_nunit_dep)
-       $(CSCOMPILE) $(test_nunit_ref) -warn:0 -r:$(corlib) \
+       $(CSCOMPILE) $(test_nunit_ref) -warn:0 \
                -r:$(vtsdir)/$(PROFILE)_TestLib/1.0/Address.dll \
+               -r:$(topdir)/class/lib/$(PROFILE)/mscorlib.dll \
+               -r:$(topdir)/class/lib/$(PROFILE)/System.dll \
                $(vtsdir)/BinarySerializationOverVersions.cs -out:$@
        @cp $(vtsdir)/$(PROFILE)_TestLib/1.0/Address.dll $(vtsdir)/$(PROFILE)_TestLib
 
@@ -164,6 +166,9 @@ EXTRA_DISTFILES += \
        $(vtsdir)/VersionTolerantSerializationTestLib/6.0/Address.cs \
        $(vtsdir)/BinarySerializationOverVersions.cs
 
+EXTRA_DISTFILES += \
+       CommonCrypto/Makefile.include
+
 #
 # Android TimeZoneInfo testing....
 #
index b97f416a83d50549462a94c2bb9b9f9fd10a9c78..88d713ed8c2a87836d455ed7d2884e0e47c8bd06 100644 (file)
@@ -68,7 +68,7 @@ namespace Mono.Interop
                {
                        // called from unmanaged code after .ctor is invoked
                        // we need .ctor to create unmanaged object and thus IUnknown property value
-                       if (FindProxy(com_object.IUnknown) == null)
+                       if (FindProxy (com_object.IUnknown) == null)
                                AddProxy (com_object.IUnknown, this);
                        else
                                System.Threading.Interlocked.Increment (ref ref_count);
@@ -82,7 +82,7 @@ namespace Mono.Interop
                internal ComInteropProxy (IntPtr pUnk, Type t)
                        : base (t)
                {
-                       com_object = new __ComObject (pUnk);
+                       com_object = new __ComObject (pUnk, this);
                        CacheProxy ();
                }
 
@@ -108,17 +108,20 @@ namespace Mono.Interop
                // already known, a cached proxy will be returned.
                internal static ComInteropProxy CreateProxy (Type t)
                {
-                       ComInteropProxy proxy = new ComInteropProxy (t);
-                       proxy.com_object.Initialize (t);
-
-                       ComInteropProxy cachedProxy = FindProxy (proxy.com_object.IUnknown);
+                       IntPtr iunknown = __ComObject.CreateIUnknown (t);
+                       ComInteropProxy proxy;
+                       ComInteropProxy cachedProxy = FindProxy (iunknown);
                        if (cachedProxy != null) {
                                // check that the COM type of the cached proxy matches
                                // the requested type. See 2nd part of bug #520437.
                                Type cachedType = cachedProxy.com_object.GetType ();
                                if (cachedType != t)
                                        throw new InvalidCastException (String.Format ("Unable to cast object of type '{0}' to type '{1}'.", cachedType, t));
-                               return cachedProxy;
+                               proxy = cachedProxy;
+                               Marshal.Release (iunknown);
+                       } else {
+                               proxy = new ComInteropProxy (t);
+                               proxy.com_object.Initialize (iunknown, proxy);
                        }
                        return proxy;
                }
index bca51601728f046097307b415569ba392851b551..c1fbac195286e29110b1bbcbfd844d91a4b8be99 100644 (file)
@@ -52,7 +52,7 @@ namespace System.Security.Cryptography.X509Certificates
                        }
                }
 
-               public override string GetSubjectSummary ()
+               public string GetSubjectSummary ()
                {
                        ThrowIfContextInvalid ();
                        IntPtr cfstr = SecCertificateCopySubjectSummary (handle);
@@ -107,14 +107,14 @@ namespace System.Security.Cryptography.X509Certificates
                        return FallbackImpl.GetIssuerName (legacyV1Mode);
                }
 
-               public override DateTime GetEffectiveDateString ()
+               public override DateTime GetValidFrom ()
                {
-                       return FallbackImpl.GetEffectiveDateString ();
+                       return FallbackImpl.GetValidFrom ();
                }
 
-               public override DateTime GetExpirationDateString ()
+               public override DateTime GetValidUntil ()
                {
-                       return FallbackImpl.GetExpirationDateString ();
+                       return FallbackImpl.GetValidUntil ();
                }
 
                public override string GetKeyAlgorithm ()
@@ -170,8 +170,8 @@ namespace System.Security.Cryptography.X509Certificates
                        sb.AppendFormat ("[Subject]{0}  {1}{0}{0}", nl, GetSubjectName (false));
 
                        sb.AppendFormat ("[Issuer]{0}  {1}{0}{0}", nl, GetIssuerName (false));
-                       sb.AppendFormat ("[Not Before]{0}  {1}{0}{0}", nl, GetEffectiveDateString ());
-                       sb.AppendFormat ("[Not After]{0}  {1}{0}{0}", nl, GetExpirationDateString ());
+                       sb.AppendFormat ("[Not Before]{0}  {1}{0}{0}", nl, GetValidFrom ().ToLocalTime ());
+                       sb.AppendFormat ("[Not After]{0}  {1}{0}{0}", nl, GetValidUntil ().ToLocalTime ());
                        sb.AppendFormat ("[Thumbprint]{0}  {1}{0}", nl, X509Helper.ToHexString (GetCertHash ()));
 
                        sb.Append (nl);
index 9ad485e07cd52b254e1265c18d95f3e0a2fc9c4d..3cf08ae352089a434b6c8ac006bf6ab5e9c6e1a3 100644 (file)
@@ -218,7 +218,7 @@ namespace System {
                        if (typeName == null)
                                throw new ArgumentNullException ("typeName");
 
-                       TypeSpec res = Parse (typeName, ref pos, false, false);
+                       TypeSpec res = Parse (typeName, ref pos, false, true);
                        if (pos < typeName.Length)
                                throw new ArgumentException ("Count not parse the whole type name", "typeName");
                        return res;
@@ -287,7 +287,7 @@ namespace System {
                {
                        Assembly asm = null;
                        if (assemblyResolver == null && typeResolver == null)
-                               return Type.GetType (name.DisplayName, throwOnError, ignoreCase);
+                               return Type.GetType (DisplayFullName, throwOnError, ignoreCase);
 
                        if (assembly_name != null) {
                                if (assemblyResolver != null)
@@ -376,6 +376,12 @@ namespace System {
                        pos = p;
                }
 
+               static void BoundCheck (int idx, string s)
+               {
+                       if (idx >= s.Length)
+                               throw new ArgumentException ("Invalid generic arguments spec", "typeName");
+               }
+
                static TypeIdentifier ParsedTypeIdentifier (string displayName)
                {
                        return TypeIdentifiers.FromDisplay(displayName);
@@ -383,6 +389,17 @@ namespace System {
 
                static TypeSpec Parse (string name, ref int p, bool is_recurse, bool allow_aqn)
                {
+                       // Invariants:
+                       //  - On exit p, is updated to pos the current unconsumed character.
+                       //
+                       //  - The callee peeks at but does not consume delimiters following
+                       //    recurisve parse (so for a recursive call like the args of "Foo[P,Q]"
+                       //    we'll return with p either on ',' or on ']'.  If the name was aqn'd
+                       //    "Foo[[P,assmblystuff],Q]" on return p with be on the ']' just
+                       //    after the "assmblystuff")
+                       //
+                       //  - If allow_aqn is True, assembly qualification is optional.
+                       //    If allow_aqn is False, assembly qualification is prohibited.
                        int pos = p;
                        int name_start;
                        bool in_modifiers = false;
@@ -450,18 +467,24 @@ namespace System {
                                                data.AddModifier (new PointerSpec(pointer_level));
                                                break;
                                        case ',':
-                                               if (is_recurse) {
+                                               if (is_recurse && allow_aqn) {
                                                        int end = pos;
                                                        while (end < name.Length && name [end] != ']')
                                                                ++end;
                                                        if (end >= name.Length)
                                                                throw new ArgumentException ("Unmatched ']' while parsing generic argument assembly name");
                                                        data.assembly_name = name.Substring (pos + 1, end - pos - 1).Trim ();
-                                                       p = end + 1;
+                                                       p = end;
                                                        return data;                                            
                                                }
-                                               data.assembly_name = name.Substring (pos + 1).Trim ();
-                                               pos = name.Length;
+                                               if (is_recurse) {
+                                                       p = pos;
+                                                       return data;
+                                               }
+                                               if (allow_aqn) {
+                                                       data.assembly_name = name.Substring (pos + 1).Trim ();
+                                                       pos = name.Length;
+                                               }
                                                break;
                                        case '[':
                                                if (data.is_byref)
@@ -482,11 +505,17 @@ namespace System {
                                                                if (aqn)
                                                                        ++pos; //skip '[' to the start of the type
                                                                args.Add (Parse (name, ref pos, true, aqn));
-                                                               if (pos >= name.Length)
-                                                                       throw new ArgumentException ("Invalid generic arguments spec", "typeName");
+                                                               BoundCheck (pos, name);
+                                                               if (aqn) {
+                                                                       if (name [pos] == ']')
+                                                                               ++pos;
+                                                                       else
+                                                                               throw new ArgumentException ("Unclosed assembly-qualified type name at " + name[pos], "typeName");
+                                                                       BoundCheck (pos, name);
+}
 
                                                                if (name [pos] == ']')
-                                                                               break;
+                                                                       break;
                                                                if (name [pos] == ',')
                                                                        ++pos; // skip ',' to the start of the next arg
                                                                else
@@ -523,7 +552,7 @@ namespace System {
                                                break;
                                        case ']':
                                                if (is_recurse) {
-                                                       p = pos + 1;
+                                                       p = pos;
                                                        return data;
                                                }
                                                throw new ArgumentException ("Unmatched ']'", "typeName");
index a772d0fef9791888bd00475df9459c80dc2cc4d6..2e7e6066af533f349baeb1462d36c468c53ac937 100644 (file)
@@ -63,6 +63,9 @@ namespace System
                #endregion
 #pragma warning restore 169
 
+               // keep a reference to the proxy so it doesn't get garbage collected before the RCW
+               ComInteropProxy proxy;
+
                [MethodImplAttribute (MethodImplOptions.InternalCall)]
                internal static extern __ComObject CreateRCW (Type t);
 
@@ -71,10 +74,13 @@ namespace System
 
                ~__ComObject ()
                {       
-                       if (synchronization_context != null)
-                               synchronization_context.Post ((state) => ReleaseInterfaces (), this);
-                       else
-                               ReleaseInterfaces ();                           
+                       if (hash_table != IntPtr.Zero) {
+                               if (synchronization_context != null)
+                                       synchronization_context.Post ((state) => ReleaseInterfaces (), this);
+                               else
+                                       ReleaseInterfaces ();
+                       }
+                       proxy = null;
                }
 
                public __ComObject ()
@@ -86,14 +92,22 @@ namespace System
                        Initialize (t);
                }
 
-               internal __ComObject (IntPtr pItf)
+               internal __ComObject (IntPtr pItf, ComInteropProxy p)
                {
+                       proxy = p;
                        InitializeApartmentDetails ();
                        Guid iid = IID_IUnknown;
                        int hr = Marshal.QueryInterface (pItf, ref iid, out iunknown);
                        Marshal.ThrowExceptionForHR (hr);
                }
 
+               internal void Initialize (IntPtr pUnk, ComInteropProxy p)
+               {
+                       proxy = p;
+                       InitializeApartmentDetails ();
+                       iunknown = pUnk;
+               }
+
                internal void Initialize (Type t)
                {
                        InitializeApartmentDetails ();
@@ -101,8 +115,14 @@ namespace System
                        if (iunknown != IntPtr.Zero)
                                return;
 
+                       iunknown = CreateIUnknown (t);
+               }
+
+               internal static IntPtr CreateIUnknown(Type t)
+               {
                        System.Runtime.CompilerServices.RuntimeHelpers.RunClassConstructor (t.TypeHandle);
-                       
+
+                       IntPtr iunknown;
                        ObjectCreationDelegate ocd = ExtensibleClassFactory.GetObjectCreationCallback (t);
                        if (ocd != null) {
                                iunknown = ocd (IntPtr.Zero);
@@ -113,6 +133,8 @@ namespace System
                                int hr = CoCreateInstance (GetCLSID (t), IntPtr.Zero, 0x1 | 0x4 | 0x10, IID_IUnknown, out iunknown);
                                Marshal.ThrowExceptionForHR (hr);
                        }
+
+                       return iunknown;
                }
 
                private void InitializeApartmentDetails ()
index 9c566b4bafcc7111e311a308657b7f7c0922191c..900ffec6e7c4e570d6954ebb45176ad648e7912a 100644 (file)
@@ -35,6 +35,7 @@ using System.Diagnostics;
 namespace MonoTests.System.Runtime.ExceptionServices
 {
        [TestFixture]
+       [Category ("BitcodeNotWorking")]
        public class ExceptionDispatchInfoTest
        {
                [Test]
index 4279cee8ec9d835c8c29d2e4ec86feccb179020b..cbf44c17f358df1b94a0c1977772271af40ac3e4 100644 (file)
@@ -4059,17 +4059,27 @@ namespace MonoTests.System
                        } catch (ArgumentNullException) {}
                }
 
-               void MustAE (string tname) {
+               void MustAE_general (string tname, Func<string,Type> getType) {
                        try {
-                               var res = Type.GetType (tname, name => {
-                                       return Assembly.Load (name);
-                               },(asm,name,ignore) => {
-                                       return (object)asm == null ? Type.GetType (name, false, ignore) : asm.GetType (name, false, ignore);
-                               }, true, false);
+                               var res = getType (tname);
                                Assert.Fail (tname);
                        } catch (ArgumentException) {}
                }
 
+               void MustAE (string typename) {
+                       MustAE_general (typename, tname => {
+                                       return Type.GetType (tname, name => {
+                                                       return Assembly.Load (name);
+                                               },(asm,name,ignore) => {
+                                                       return (object)asm == null ? Type.GetType (name, false, ignore) : asm.GetType (name, false, ignore);
+                                               }, true, false);
+                               });
+               }
+
+               void MustAEnn (string typename) {
+                       MustAE_general (typename, tname => Type.GetType (tname, null, null));
+               }
+
                void MustFNFE (string tname) {
                        try {
                                var res = Type.GetType (tname, name => {
@@ -4152,6 +4162,56 @@ namespace MonoTests.System
                        Assert.AreEqual (Type.GetType ("MonoTests.System.Foo`1[System.Int32"), null, "#15");
                }
 
+               [Test]
+               public void GetTypeNullDelegatesParseGenericCorrectly () {
+                       Assert.AreEqual (Type.GetType ("MonoTests.System.Foo`1", null, null), typeof (Foo<>), "#1");
+                       Assert.AreEqual (Type.GetType ("MonoTests.System.Foo`1[System.Int32]", null, null), typeof (Foo<int>), "#2");
+                       Assert.AreEqual (Type.GetType ("MonoTests.System.Foo`1[[System.Int32]]", null, null), typeof (Foo<int>), "#3");
+                       Assert.AreEqual (Type.GetType ("MonoTests.System.Foo`1[System.Int32][]", null, null), typeof (Foo<int>[]), "#4");
+                       Assert.AreEqual (Type.GetType ("MonoTests.System.Foo`1[System.Int32][,]", null, null), typeof (Foo<int>[,]), "#5");
+                       Assert.AreEqual (Type.GetType ("MonoTests.System.Foo`1[]", null, null), typeof (Foo<>).MakeArrayType(), "#6");
+                       Assert.AreEqual (Type.GetType ("MonoTests.System.Foo`1[,]", null, null), typeof (Foo<>).MakeArrayType (2), "#7");
+                       Assert.AreEqual (Type.GetType ("MonoTests.System.Foo`1[][]", null, null), typeof (Foo<>).MakeArrayType ().MakeArrayType (), "#8");
+
+                       MustAEnn ("MonoTests.System.Foo`1[][System.Int32]");
+                       MustAEnn ("MonoTests.System.Foo`1[");
+                       MustAEnn ("MonoTests.System.Foo`1[[");
+                       MustAEnn ("MonoTests.System.Foo`1[[]");
+                       MustAEnn ("MonoTests.System.Foo`1[,");
+                       MustAEnn ("MonoTests.System.Foo`1[*");
+                       MustAEnn ("MonoTests.System.Foo`1[System.Int32");
+               }
+
+               Dictionary<int, T> MakeDictHelper<T> (T[] arr) {
+                       return new Dictionary<int, T>();
+               }
+
+               [Test]
+               public void GetTypeAnonymousParseCorrectly () {
+                       var x = new { X = 1 };
+                       var a = new [] { x };
+                       var d = MakeDictHelper (a);
+
+                       var x_type = x.GetType ();
+                       var a_type = a.GetType ();
+                       var d_type = d.GetType ();
+
+                       Assert.AreEqual (Type.GetType (x_type.ToString ()), x_type, "#1");
+                       Assert.AreEqual (Type.GetType (x_type.ToString (), null, null), x_type, "#2");
+                       Assert.AreEqual (Type.GetType (a_type.ToString ()), a_type, "#3");
+                       Assert.AreEqual (Type.GetType (a_type.ToString (), null, null), a_type, "#4");
+                       Assert.AreEqual (Type.GetType (d_type.ToString ()), d_type, "#5");
+                       Assert.AreEqual (Type.GetType (d_type.ToString (), null, null), d_type, "#6");
+
+                       Assert.AreEqual (Type.GetType (x_type.FullName), x_type, "#7");
+                       Assert.AreEqual (Type.GetType (x_type.FullName, null, null), x_type, "#8");
+                       Assert.AreEqual (Type.GetType (a_type.FullName), a_type, "#9");
+                       Assert.AreEqual (Type.GetType (a_type.FullName, null, null), a_type, "#10");
+                       Assert.AreEqual (Type.GetType (d_type.FullName), d_type, "#11");
+                       Assert.AreEqual (Type.GetType (d_type.FullName, null, null), d_type, "#12");
+
+               }
+
 #if !MONOTOUCH && !MOBILE_STATIC
                [Test]
                [Category ("AndroidNotWorking")] // requires symbol writer
index da77893bcc50c66f173571e43a57595448b44e27..e802a034dd64f2aa7f7a9a97dd76b0aaf3ed4294 100644 (file)
@@ -1 +1,27 @@
 #include corlib.dll.sources
+CommonCrypto/CommonCrypto.cs
+CommonCrypto/CryptorTransform.cs
+CommonCrypto/FastCryptorTransform.cs
+CommonCrypto/CorlibExtras.cs
+CommonCrypto/MD5CryptoServiceProvider.g.cs
+CommonCrypto/SHA1CryptoServiceProvider.g.cs
+CommonCrypto/SHA1CryptoServiceProvider.g.cs
+CommonCrypto/SHA1Managed.g.cs
+CommonCrypto/SHA256Managed.g.cs
+CommonCrypto/SHA384Managed.g.cs
+CommonCrypto/SHA512Managed.g.cs
+CommonCrypto/TripleDESCryptoServiceProvider.g.cs
+CommonCrypto/DESCryptoServiceProvider.g.cs
+CommonCrypto/RC2CryptoServiceProvider.g.cs
+CommonCrypto/RijndaelManaged.cs
+CommonCrypto/SecRandom.cs
+CommonCrypto/RC4CommonCrypto.cs
+CommonCrypto/MD2Managed.g.cs
+CommonCrypto/MD4Managed.g.cs
+System/Environment.iOS.cs
+System/Guid.MonoTouch.cs
+System/NotSupportedException.iOS.cs
+CoreFoundation/CFHelpers.cs
+System.Security.Cryptography.X509Certificates/X509CertificateImplApple.cs
+System.Security.Cryptography.X509Certificates/X509Helper.Apple.cs
+System.Text/EncodingHelper.MonoTouch.cs
index da77893bcc50c66f173571e43a57595448b44e27..e802a034dd64f2aa7f7a9a97dd76b0aaf3ed4294 100644 (file)
@@ -1 +1,27 @@
 #include corlib.dll.sources
+CommonCrypto/CommonCrypto.cs
+CommonCrypto/CryptorTransform.cs
+CommonCrypto/FastCryptorTransform.cs
+CommonCrypto/CorlibExtras.cs
+CommonCrypto/MD5CryptoServiceProvider.g.cs
+CommonCrypto/SHA1CryptoServiceProvider.g.cs
+CommonCrypto/SHA1CryptoServiceProvider.g.cs
+CommonCrypto/SHA1Managed.g.cs
+CommonCrypto/SHA256Managed.g.cs
+CommonCrypto/SHA384Managed.g.cs
+CommonCrypto/SHA512Managed.g.cs
+CommonCrypto/TripleDESCryptoServiceProvider.g.cs
+CommonCrypto/DESCryptoServiceProvider.g.cs
+CommonCrypto/RC2CryptoServiceProvider.g.cs
+CommonCrypto/RijndaelManaged.cs
+CommonCrypto/SecRandom.cs
+CommonCrypto/RC4CommonCrypto.cs
+CommonCrypto/MD2Managed.g.cs
+CommonCrypto/MD4Managed.g.cs
+System/Environment.iOS.cs
+System/Guid.MonoTouch.cs
+System/NotSupportedException.iOS.cs
+CoreFoundation/CFHelpers.cs
+System.Security.Cryptography.X509Certificates/X509CertificateImplApple.cs
+System.Security.Cryptography.X509Certificates/X509Helper.Apple.cs
+System.Text/EncodingHelper.MonoTouch.cs
index 1c85d9abac643e6f5038fa7815a51c2eac5d7da7..50f84cfd617c820f399f74f922a2aec939654b99 100644 (file)
@@ -111,11 +111,12 @@ LIB_MCS_FLAGS = \
        /resource:Resources/mono-ecma.xsl,mono-ecma.xsl                   \
        /resource:Resources/toc-html.xsl,toc-html.xsl                     \
        $(IMAGE_RESOURCE_COMMAND)                                                             \
-       /r:$(corlib)
+       /publicsign
 
 CLEAN_FILES += $(the_lib).config
 
-TEST_MCS_FLAGS = /r:System.dll /r:System.Core.dll /r:System.Xml.dll
+TEST_MCS_FLAGS =
+TEST_LIB_REFS = System System.Core System.Xml
 
 DOC_SOURCE_DIRS = \
        ../../docs \
index f30dae6f26941cec62d8d36d15dfb1bd1227974b..2c37329cd15342b852201f9c230bd5f42a01b3b6 100644 (file)
@@ -83,6 +83,36 @@ dist-local: dist-default
 
 csproj-local install-local uninstall-local:
 
+CS0029-26-lib.dll : CS0029-26-lib.cs
+       $(CSCOMPILE) /target:library /publicsign /out:$@ $<
+
+CS0266-25-lib.dll: CS0266-25-lib.cs
+       $(CSCOMPILE) /target:library /r:$(topdir)/class/lib/$(PROFILE)/System.Core.dll /out:$@ $<
+
+dlls/first/CS1701-lib.dll: dlls/first/CS1701-lib.cs
+       $(CSCOMPILE) /target:library /warn:0 /publicsign /out:$@ $<
+
+dlls/first/CS1702-lib.dll: dlls/first/CS1702-lib.cs
+       $(CSCOMPILE) /target:library /warn:0 /publicsign /out:$@ $<
+
+dlls/first/CS1703-lib.dll: dlls/first/CS1703-lib.cs
+       $(CSCOMPILE) /target:library /warn:0 /publicsign /out:$@ $<
+
+dlls/first/CS1705-lib.dll: dlls/first/CS1705-lib.cs
+       $(CSCOMPILE) /target:library /warn:0 /publicsign /out:$@ $<
+
+dlls/second/CS1701-lib.dll: dlls/second/CS1701-lib.cs
+       $(CSCOMPILE) /target:library /warn:0 /publicsign /out:$@ $<
+
+dlls/second/CS1702-lib.dll: dlls/second/CS1702-lib.cs
+       $(CSCOMPILE) /target:library /warn:0 /publicsign /out:$@ $<
+
+dlls/second/CS1703-lib.dll: dlls/second/CS1703-lib.cs
+       $(CSCOMPILE) /target:library /warn:0 /publicsign /out:$@ $<
+
+dlls/second/CS1705-lib.dll: dlls/second/CS1705-lib.cs
+       $(CSCOMPILE) /target:library /warn:0 /publicsign /out:$@ $<
+
 CS1701-lib.dll : CS1701-lib.cs
        $(CSCOMPILE) /target:library /warn:0 /r:dlls/first/CS1701-lib.dll /out:$@ $<
 
index 3a3e789e0b0c9bcb29064ed565ec931016c75dac..01285712a2b3787590464510bc71d67f99167ed0 100644 (file)
@@ -12,19 +12,21 @@ EXTRA_DISTFILES = \
        cs-parser.jay           \
        mcs.exe.sources
 
-LIB_REFS = System System.Core System.Xml
-
 ifeq (basic, $(PROFILE))
+LOCAL_MCS_FLAGS += -r:System.dll -r:System.Core.dll -r:System.Xml.dll -debug
+
 PROGRAM = basic.exe
 sourcefile = mcs.exe.sources
 else
+LIB_REFS = System System.Core System.Xml
+
 PROGRAM_USE_INTERMEDIATE_FILE = true
 PROGRAM = mcs.exe
 the_libdir = $(topdir)/class/lib/build/
-LOCAL_MCS_FLAGS += -lib:$(topdir)/class/lib/build -debug
+LOCAL_MCS_FLAGS += -debug
 endif
 
-LOCAL_MCS_FLAGS += -d:STATIC,NO_SYMBOL_WRITER,NO_AUTHENTICODE -r:System.Core.dll -r:System.Xml.dll
+LOCAL_MCS_FLAGS += -d:STATIC,NO_SYMBOL_WRITER,NO_AUTHENTICODE
 
 ifndef NO_THREAD_ABORT
 REFERENCE_SOURCES_FLAGS += -d:MONO_FEATURE_THREAD_ABORT
index fe0910186fe43ff3478be0db86d691b9c471a492..7a291b287a7c04caaf70e006548829969cec067b 100644 (file)
@@ -5,11 +5,8 @@ include ../../../build/rules.make
 LIBRARY = nunit.util.dll
 LIBRARY_SNK = $(topdir)/nunit24/nunit.snk
 
-LOCAL_MCS_FLAGS= \
-       /resource:Transform.resources,NUnit.Util.Transform.resources \
-       -r:nunit.core.dll -r:nunit.core.interfaces.dll -r:System.dll \
-       -r:System.Xml.dll -r:System.Runtime.Remoting.dll \
-       /d:MONO /d:StronglyNamedAssembly -warn:1
+LOCAL_MCS_FLAGS= /resource:Transform.resources,NUnit.Util.Transform.resources /d:MONO /d:StronglyNamedAssembly /publicsign -warn:1
+LIB_REFS = nunit.core nunit.core.interfaces System System.Xml System.Runtime.Remoting
 NO_TEST = yo
 
 RESX_RES = Transform.resources
index b09931ffef6cec8e1811c8954abed8a4f3817796..72ce02dc4295faebb9c8a9d525c059e9493dc9dc 100644 (file)
@@ -3,9 +3,9 @@ SUBDIRS =
 include ../../../build/rules.make
 
 PROGRAM = nunit-console.exe
-LOCAL_MCS_FLAGS = \
-       /r:nunit.framework.dll /r:nunit.util.dll /r:nunit.core.dll \
-       /r:nunit-console-runner.dll
+LOCAL_MCS_FLAGS =
+LIB_REFS = nunit.framework nunit.util nunit.core nunit-console-runner
+
 EXTRA_DISTFILES = App.ico \
        nunit-console.exe.csproj \
        nunit-console.exe_VS2005.csproj \
index 52fe21bf61bd20ba7b9146cb190bff2faef5d5d3..b72165aba26d29183205711c97bd0578739e191b 100644 (file)
@@ -5,10 +5,8 @@ include ../../../build/rules.make
 LIBRARY = nunit-console-runner.dll
 LIBRARY_SNK = $(topdir)/nunit24/nunit.snk
 
-LOCAL_MCS_FLAGS= \
-       -r:nunit.core.dll -r:nunit.core.interfaces.dll -r:nunit.util.dll \
-       -r:System.dll -r:System.Xml.dll \
-       /d:MONO /d:StronglyNamedAssembly
+LOCAL_MCS_FLAGS= /d:MONO /d:StronglyNamedAssembly /publicsign
+LIB_REFS = nunit.core nunit.core.interfaces nunit.util System System.Xml
 NO_TEST = yo
 
 EXTRA_DISTFILES = nunit-console.csproj nunit-console_VS2005.csproj
index ac3b0146fbfb99fc9f9ecb04302b6c3fed65fd3d..83a2e01bd0e038c550791c58e54b57bdbe203305 100644 (file)
@@ -5,7 +5,8 @@ include ../../../build/rules.make
 LIBRARY = nunit.core.dll
 LIBRARY_SNK = $(topdir)/nunit24/nunit.snk
 
-LOCAL_MCS_FLAGS= -r:nunit.framework.dll -r:nunit.core.interfaces.dll -r:System.dll /d:StronglyNamedAssembly -warn:1
+LOCAL_MCS_FLAGS = /d:StronglyNamedAssembly -warn:1 /publicsign
+LIB_REFS = nunit.framework nunit.core.interfaces System
 NO_TEST = yo
 
 EXTRA_DISTFILES = nunit.core.dll.csproj nunit.core.dll_VS2005.csproj
index e9ddcc79faffa2990629eb1ecd221fb850e39243..592ce5bc160609434cccbf45e3a41e9473fbefe8 100644 (file)
@@ -5,7 +5,8 @@ include ../../../build/rules.make
 LIBRARY = nunit.core.interfaces.dll
 LIBRARY_SNK = $(topdir)/nunit24/nunit.snk
 
-LOCAL_MCS_FLAGS= -debug -r:nunit.framework.dll -r:System.dll /d:StronglyNamedAssembly
+LOCAL_MCS_FLAGS= /d:StronglyNamedAssembly /publicsign
+LIB_REFS = nunit.framework System
 NO_TEST = yo
 
 EXTRA_DISTFILES = nunit.core.interfaces.dll.csproj nunit.core.interfaces.dll_VS2005.csproj
index 48f8ccf8f6fddb1a8a87d0838ab0c888fb9cefad..9e3ba945a67a7904b0ea369ab0a7509b581c9471 100644 (file)
@@ -5,10 +5,8 @@ include ../../../build/rules.make
 LIBRARY = nunit.core.extensions.dll
 LIBRARY_SNK = $(topdir)/nunit24/nunit.snk
 
-LIB_MCS_FLAGS = \
-       -debug \
-       /r:nunit.core.dll /r:nunit.core.interfaces.dll \
-       /r:System.Xml.dll /r:System.dll /d:StronglyNamedAssembly
+LIB_MCS_FLAGS =  /d:StronglyNamedAssembly /publicsign
+LIB_REFS = nunit.core nunit.core.interfaces System.Xml System
 NO_TEST = yo
 
 EXTRA_DISTFILES = \
index 81d6b15439d091dc1e5fd4e99e4d3d3e2bd97b1d..7cd03514e37831f9193f83dbffccd4de19cf5434 100644 (file)
@@ -5,7 +5,8 @@ include ../../../build/rules.make
 LIBRARY = nunit.framework.extensions.dll
 LIBRARY_SNK = $(topdir)/nunit24/nunit.snk
 
-LIB_MCS_FLAGS = -debug /r:System.Xml.dll /r:System.dll /d:StronglyNamedAssembly
+LIB_MCS_FLAGS = /d:StronglyNamedAssembly /publicsign
+LIB_REFS = System.Xml System
 NO_TEST = yo
 
 EXTRA_DISTFILES = \
index 157b0b4d5783cf517eb9e8d38508d7df8bc08e95..43076d8c8553ae0954ad041a6b77b9286e9ae6b1 100644 (file)
@@ -6,7 +6,8 @@ LIBRARY = NUnit.Framework.dll
 LIBRARY_NAME = nunit.framework.dll
 LIBRARY_SNK = $(topdir)/nunit24/nunit.snk
 
-LIB_MCS_FLAGS = /r:System.Xml.dll /r:System.dll /d:StronglyNamedAssembly -warn:1
+LIB_MCS_FLAGS = /d:StronglyNamedAssembly -warn:1 /publicsign
+LIB_REFS = System.Xml System
 NO_TEST = yo
 
 EXTRA_DISTFILES = \
index b9769c4777d6576f992949c24bf4e893ec3df3bd..0c6ab3ca272cd9f41a757fe80c2b2a22149c51da 100644 (file)
@@ -5,7 +5,8 @@ include ../../../build/rules.make
 LIBRARY = nunit.mocks.dll
 LIBRARY_SNK = $(topdir)/nunit24/nunit.snk
 
-LOCAL_MCS_FLAGS= -debug -r:nunit.framework.dll -r:System.dll /d:StronglyNamedAssembly
+LOCAL_MCS_FLAGS= /d:StronglyNamedAssembly /publicsign
+LIB_REFS = nunit.framework System
 NO_TEST = yo
 
 EXTRA_DISTFILES = \
index 418bcdd85f5cfaa1b52bb9af6ade6a8739bbe0b2..d95558b30831328d0943d51f4ca56f88f894aad7 100644 (file)
@@ -16,6 +16,7 @@ net_4_5_dirs := \
        xbuild          \
        csharp          \
        corcompare      \
+       mono-api-html \
        compiler-tester \
        mono-xmltool    \
        mono-shlib-cop  \
index caf1a67a5b2a322c1a2020f6dbcec1b674f9e242..bdc741144ea595cb7d7bcbeb8b509e5a3e225148 100644 (file)
@@ -12,6 +12,7 @@ using System;
 using System.Globalization;
 using System.IO;
 using System.Collections;
+using System.Collections.Generic;
 using System.Reflection;
 using System.Reflection.Emit;
 using System.Security.Cryptography;
@@ -19,6 +20,7 @@ using System.Text;
 using System.Configuration.Assemblies;
 
 using Mono.Security.Cryptography;
+using IKR = IKVM.Reflection;
 
 namespace Mono.AssemblyLinker
 {
@@ -591,46 +593,8 @@ namespace Mono.AssemblyLinker
                         * Emit Manifest
                         * */
 
-                       if (isTemplateFile) {
-                               // LAMESPEC: according to MSDN, the template assembly must have a
-                               // strong name but this is not enforced
-                               Assembly assembly = Assembly.LoadFrom (templateFile);
-
-                               // inherit signing related settings from template, but do not
-                               // override command-line options
-                               object [] attrs = assembly.GetCustomAttributes (true);
-                               foreach (object o in attrs) {
-                                       if (o is AssemblyKeyFileAttribute) {
-                                               if (keyfile != null)
-                                                       // ignore if specified on command line
-                                                       continue;
-                                               AssemblyKeyFileAttribute keyFileAttr = (AssemblyKeyFileAttribute) o;
-                                               // ignore null or zero-length keyfile
-                                               if (keyFileAttr.KeyFile == null || keyFileAttr.KeyFile.Length == 0)
-                                                       continue;
-                                               keyfile = Path.Combine (Path.GetDirectoryName(templateFile),
-                                                       keyFileAttr.KeyFile);
-                                       } else if (o is AssemblyDelaySignAttribute) {
-                                               if (delaysign != DelaySign.NotSet)
-                                                       // ignore if specified on command line
-                                                       continue;
-                                               AssemblyDelaySignAttribute delaySignAttr = (AssemblyDelaySignAttribute) o;
-                                               delaysign = delaySignAttr.DelaySign ? DelaySign.Yes :
-                                                       DelaySign.No;
-                                       } else if (o is AssemblyKeyNameAttribute) {
-                                               if (keyname != null)
-                                                       // ignore if specified on command line
-                                                       continue;
-                                               AssemblyKeyNameAttribute keynameAttr = (AssemblyKeyNameAttribute) o;
-                                               // ignore null or zero-length keyname
-                                               if (keynameAttr.KeyName == null || keynameAttr.KeyName.Length == 0)
-                                                       continue;
-                                               keyname = keynameAttr.KeyName;
-                                       }
-                               }
-                               aname.Version = assembly.GetName().Version;
-                               aname.HashAlgorithm = assembly.GetName().HashAlgorithm;
-                       }
+                       if (isTemplateFile)
+                               aname = ReadCustomAttributesFromTemplateFile (templateFile, aname);
 
                        SetKeyPair (aname);
 
@@ -765,6 +729,85 @@ namespace Mono.AssemblyLinker
                        }
                }
 
+               private AssemblyName ReadCustomAttributesFromTemplateFile (string templateFile, AssemblyName aname)
+               {
+                       // LAMESPEC: according to MSDN, the template assembly must have a
+                       // strong name but this is not enforced
+                       const IKR.UniverseOptions options = IKR.UniverseOptions.MetadataOnly;
+
+                       var universe = new IKR.Universe (options);
+                       var asm = universe.LoadFile (templateFile);
+
+                       // Create missing assemblies, we don't want to load them!
+                       // Code taken from ikdasm
+                       var names = new HashSet<string> ();
+                       IKR.AssemblyName[] assembly_refs = asm.ManifestModule.__GetReferencedAssemblies ();
+
+                       var resolved_assemblies = new IKR.Assembly [assembly_refs.Length];
+                       for (int i = 0; i < resolved_assemblies.Length; i++) {
+                               string name = assembly_refs [i].Name;
+
+                               while (names.Contains (name)) {
+                                       name = name + "_" + i;
+                               }
+                               names.Add (name);
+                               resolved_assemblies [i] = universe.CreateMissingAssembly (assembly_refs [i].FullName);
+                       }
+                       asm.ManifestModule.__ResolveReferencedAssemblies (resolved_assemblies);
+
+                       foreach (var attr_data in asm.__GetCustomAttributes (null, false)) {
+                               string asm_name = attr_data.AttributeType.Assembly.GetName ().Name;
+                               if (asm_name != "mscorlib")
+                                       continue;
+
+                               switch (attr_data.AttributeType.FullName) {
+                                       case "System.Reflection.AssemblyKeyFileAttribute": {
+                                               if (keyfile != null)
+                                                       // ignore if specified on command line
+                                                       continue;
+
+                                               // / AssemblyKeyFileAttribute .ctor(string keyFile)
+                                               string key_file_value = (string) attr_data.ConstructorArguments [0].Value;
+
+                                               if (!String.IsNullOrEmpty (key_file_value))
+                                                       keyfile = Path.Combine (Path.GetDirectoryName (templateFile), key_file_value);
+                                       }
+                                       break;
+
+                                       case "System.Reflection.AssemblyDelaySignAttribute": {
+                                               if (delaysign != DelaySign.NotSet)
+                                                       // ignore if specified on command line
+                                                       continue;
+
+                                               // AssemblyDelaySignAttribute .ctor(bool delaySign)
+                                               bool delay_sign_value = (bool) attr_data.ConstructorArguments [0].Value;
+                                               delaysign = delay_sign_value ? DelaySign.Yes : DelaySign.No;
+                                       }
+                                       break;
+
+                                       case "System.Reflection.AssemblyKeyNameAttribute": {
+                                               if (keyname != null)
+                                                       // ignore if specified on command line
+                                                       continue;
+
+                                               // AssemblyKeyNameAttribute .ctor(string keyName)
+                                               string key_name_value = (string) attr_data.ConstructorArguments [0].Value;
+
+                                               // ignore null or zero-length keyname
+                                               if (!String.IsNullOrEmpty (key_name_value))
+                                                       keyname = key_name_value;
+                                       }
+                                       break;
+                               }
+                       }
+
+                       var asm_name_for_template_file = asm.GetName ();
+                       aname.Version = asm_name_for_template_file.Version;
+                       aname.HashAlgorithm = asm_name_for_template_file.HashAlgorithm;
+
+                       return aname;
+               }
+
                private void LoadArgs (string file, ArrayList args) {
                        StreamReader f = null;
                        string line;
index a4505c123f5ab7a5fbfc8cbafa8b04c0ada6ca66..d2cea54c02e12c544c56576c93308018b211d71a 100644 (file)
@@ -2,7 +2,8 @@ thisdir = tools/al
 SUBDIRS = 
 include ../../build/rules.make
 
-LOCAL_MCS_FLAGS = -r:Mono.Security.dll
+LOCAL_MCS_FLAGS =
+LIB_REFS = System System.Core Mono.Security System.Security Mono.CompilerServices.SymbolWriter
 PROGRAM = al.exe
 
 CLEAN_FILES = al.exe al.exe.mdb
index 08f674c872a3517204d766c24283477200aa0991..96d3be17ba56dbd1414eefabea4bb4a5704559b1 100644 (file)
@@ -1,2 +1,9 @@
 Al.cs
 ../../build/common/Consts.cs
+../../../external/ikvm/reflect/*.cs
+../../../external/ikvm/reflect/Emit/*.cs
+../../../external/ikvm/reflect/Metadata/*.cs
+../../../external/ikvm/reflect/Reader/*.cs
+../../../external/ikvm/reflect/Writer/*.cs
+../../../external/ikvm/reflect/Impl/*.cs
+../../../external/ikvm/reflect/Properties/*.cs
index a39c748e5e6c5c9d0b017ff1980db73c1c0935b8..6d2df98702dc1a8030bf2d02651524743aa5caca 100644 (file)
@@ -2,7 +2,8 @@ thisdir = tools/browsercaps-updater
 SUBDIRS = 
 include ../../build/rules.make
 
-LOCAL_MCS_FLAGS = -r:System.dll
+LOCAL_MCS_FLAGS =
+LIB_REFS = System
 
 PROGRAM = browsercaps-updater.exe
 
index 71935aebb6c5735e4dda47ec573e79eca95cc532..52d624ffed493aae6de62feccda36aec2f1f089f 100644 (file)
@@ -4,6 +4,7 @@ include ../../build/rules.make
 
 PROGRAM = cccheck.exe
 
-LOCAL_MCS_FLAGS = -r:Mono.CodeContracts.dll -r:System.dll
+LOCAL_MCS_FLAGS =
+LIB_REFS = Mono.CodeContracts System
 
 include ../../build/executable.make
index bac67d3de8ae52278bef66d29f67091d394c902c..00e711b27953e86b2fcab9f4ae4ef2d55bbc067e 100644 (file)
@@ -4,6 +4,7 @@ include ../../build/rules.make
 
 PROGRAM = ccrewrite.exe
 
-LOCAL_MCS_FLAGS = -r:Mono.CodeContracts.dll -r:System.dll -r:System.Core.dll
+LOCAL_MCS_FLAGS =
+LIB_REFS = Mono.CodeContracts System System.Core
 
 include ../../build/executable.make
index 9b07560ab3997c9f56a23edbc71e127d02ca7a34..a6708e2d371e1245bcce89b70772e3ff57ebf7ae 100644 (file)
@@ -5,6 +5,6 @@ include ../../build/rules.make
 PROGRAM = cil-stringreplacer.exe
 NO_INSTALL = yes
 
-LOCAL_MCS_FLAGS = -r:System.dll -r:Mono.Cecil.dll
+LIB_REFS = System Mono.Cecil
 
 include ../../build/executable.make
index 6c3154589a67f21cc0866e0ad37de1cc393e7ef0..e84d78325e6b1cb4efd81b13174b37445881aa51 100644 (file)
@@ -2,7 +2,8 @@ thisdir = tools/cil-strip
 SUBDIRS =
 include ../../build/rules.make
 
-LOCAL_MCS_FLAGS = -r:System.dll
+LOCAL_MCS_FLAGS =
+LIB_REFS = System
 
 PROGRAM = mono-cil-strip.exe
 
index 2e0ec2bc8dfc4da1721c9a7697a0eebc2be24c50..b3c2a5a450a7ee009eca10d6f239be79fa13af8b 100644 (file)
@@ -5,6 +5,7 @@ include ../../build/rules.make
 PROGRAM = compiler-tester.exe
 NO_INSTALL = yes
 
-LOCAL_MCS_FLAGS = -r:System.dll -r:System.Core.dll -r:System.Xml.dll
+LOCAL_MCS_FLAGS =
+LIB_REFS = System System.Core System.Xml
 
 include $(topdir)/build/executable.make
index 760f9cf5045c92e217bbb7edcdb66d7e8aa86b20..2f4a664387a5e0a0cba898163b21250e876f4b04 100644 (file)
@@ -2,63 +2,9 @@ thisdir = tools/corcompare
 SUBDIRS =
 include ../../build/rules.make
 
-ALL_PROGRAMS = mono-api-info.exe mono-api-html.exe
+LIB_REFS = Mono.Cecil System.Xml System.Core System
+LOCAL_MCS_FLAGS =
 
-PROGRAM_INSTALL_DIR = $(mono_libdir)/mono/$(FRAMEWORK_VERSION)
+PROGRAM = mono-api-info.exe
 
-APIINFO_SOURCES = \
-       mono-api-info.cs \
-       AssemblyResolver.cs     \
-       Util.cs \
-       WellFormedXmlWriter.cs \
-       ../../class/Mono.Options/Mono.Options/Options.cs
-
-APIHTML_SOURCES = \
-       mono-api-html/ApiChange.cs \
-       mono-api-html/ApiDiff.cs \
-       mono-api-html/AssemblyComparer.cs \
-       mono-api-html/ClassComparer.cs \
-       mono-api-html/Comparer.cs \
-       mono-api-html/ConstructorComparer.cs \
-       mono-api-html/EventComparer.cs \
-       mono-api-html/FieldComparer.cs \
-       mono-api-html/Helpers.cs \
-       mono-api-html/InterfaceComparer.cs \
-       mono-api-html/MemberComparer.cs \
-       mono-api-html/MethodComparer.cs \
-       mono-api-html/NamespaceComparer.cs \
-       mono-api-html/PropertyComparer.cs \
-       ../../class/Mono.Options/Mono.Options/Options.cs
-
-
-DISTFILES= $(APIINFO_SOURCES) $(APIHTML_SOURCES)
-
-all-local: $(ALL_PROGRAMS)
-
-csproj-local doc-update-local:
-
-install-local: $(ALL_PROGRAMS)
-       $(MKINSTALLDIRS) $(DESTDIR)$(PROGRAM_INSTALL_DIR)
-       for i in $(ALL_PROGRAMS) ; do \
-               $(INSTALL_BIN) $$i $(DESTDIR)$(PROGRAM_INSTALL_DIR) ; \
-       done
-
-uninstall-local:
-       for i in $(ALL_PROGRAMS) ; do \
-           rm -f $(DESTDIR)$(PROGRAM_INSTALL_DIR)/`basename $$i` ; \
-       done
-
-test-local:
-
-run-test-local run-test-ondotnet-local:
-
-clean-local:
-       rm -f *.exe *.pdb
-
-dist-local: dist-default
-
-mono-api-info.exe: $(APIINFO_SOURCES)
-       $(CSCOMPILE) -r:Mono.Cecil.dll -r:System.Xml.dll -r:System.Core.dll -r:System.dll -out:$@ $^
-
-mono-api-html.exe: $(APIHTML_SOURCES)
-       $(CSCOMPILE) -r:Mono.Cecil.dll -r:System.Xml.dll -r:System.Core.dll -r:System.dll -r:System.Xml.Linq.dll -out:$@ $^
+include ../../build/executable.make
diff --git a/mcs/tools/corcompare/mono-api-html/ApiChange.cs b/mcs/tools/corcompare/mono-api-html/ApiChange.cs
deleted file mode 100644 (file)
index 1d902ca..0000000
+++ /dev/null
@@ -1,81 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Text;
-using System.Xml.Linq;
-
-namespace Xamarin.ApiDiff
-{
-       public class ApiChange
-       {
-               public string Header;
-               public StringBuilder Member = new StringBuilder ();
-               public bool Breaking;
-               public bool AnyChange;
-               public bool HasIgnoredChanges;
-
-               public ApiChange Append (string text)
-               {
-                       Member.Append (text);
-                       return this;
-               }
-
-               public ApiChange AppendAdded (string text, bool breaking = false)
-               {
-                       Member.Append ("<span class='added ").Append (breaking ? "added-breaking-inline" : string.Empty).Append ("'>");
-                       Member.Append (text);
-                       Member.Append ("</span>");
-                       Breaking |= breaking;
-                       AnyChange = true;
-                       return this;
-               }
-
-               public ApiChange AppendRemoved (string text, bool breaking = true)
-               {
-                       Member.Append ("<span class='removed removed-inline ").Append (breaking ? "removed-breaking-inline" : string.Empty).Append ("'>");
-                       Member.Append (text);
-                       Member.Append ("</span>");
-                       Breaking |= breaking;
-                       AnyChange = true;
-                       return this;
-               }
-
-               public ApiChange AppendModified (string old, string @new, bool breaking = true)
-               {
-                       if (old.Length > 0)
-                               AppendRemoved (old, breaking);
-                       if (old.Length > 0 && @new.Length > 0)
-                               Append (" ");
-                       if (@new.Length > 0)
-                               AppendAdded (@new);
-                       Breaking |= breaking;
-                       AnyChange = true;
-                       return this;
-               }
-       }
-
-       public class ApiChanges : Dictionary<string, List<ApiChange>> {
-               public void Add (XElement source, XElement target, ApiChange change)
-               {
-                       if (!change.AnyChange) {
-                               // This is most likely because the rendering doesn't take into account something that's different (solution: fix rendering).
-                               if (!change.HasIgnoredChanges) {
-                                       var isField = source.Name.LocalName == "field";
-                                       if (isField) {
-                                               Console.WriteLine ("Comparison resulting in no changes (src: {2} dst: {3}) :\n{0}\n{1}\n\n", source.ToString (), target.ToString (), source.GetFieldAttributes (), target.GetFieldAttributes ());
-                                       } else {
-                                               Console.WriteLine ("Comparison resulting in no changes (src: {2} dst: {3}) :\n{0}\n{1}\n\n", source.ToString (), target.ToString (), source.GetMethodAttributes (), target.GetMethodAttributes ());
-                                       }
-                               }
-                               return;
-                       }
-
-                       List<ApiChange> list;
-                       if (!TryGetValue (change.Header, out list)) {
-                               list = new List<ApiChange> ();
-                               base.Add (change.Header, list);
-                       }
-                       list.Add (change);
-               }
-       }
-}
-
diff --git a/mcs/tools/corcompare/mono-api-html/ApiDiff.cs b/mcs/tools/corcompare/mono-api-html/ApiDiff.cs
deleted file mode 100644 (file)
index 8fe2784..0000000
+++ /dev/null
@@ -1,277 +0,0 @@
-//
-// The main differences with mono-api-diff are:
-// * this tool directly produce HTML similar to gdiff.sh used for Xamarin.iOS
-// * this tool reports changes in an "evolutionary" way, not in a breaking way,
-//   i.e. it does not assume the source assembly is right (but simply older)
-// * the diff .xml output was not easy to convert back into the HTML format
-//   that gdiff.sh produced
-// 
-// Authors
-//    Sebastien Pouliot  <sebastien@xamarin.com>
-//
-// Copyright 2013-2014 Xamarin Inc. http://www.xamarin.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.IO;
-using System.Collections.Generic;
-using System.Text.RegularExpressions;
-
-using Mono.Options;
-
-namespace Xamarin.ApiDiff {
-
-       public static class State {
-               static TextWriter output;
-
-               public static TextWriter Output { 
-                       get {
-                               if (output == null)
-                                       output = Console.Out;
-                               return output;
-                       }
-                       set { output = value; } 
-               }
-
-               public static string Assembly { get; set; }
-               public static string Namespace { get; set; }
-               public static string Type { get; set; }
-               public static string BaseType { get; set; }
-
-               public static int Indent { get; set; }
-
-               static List<Regex> ignoreAdded = new List<Regex> ();
-               public static List<Regex> IgnoreAdded {
-                       get { return ignoreAdded; }
-               }
-
-               static List<Regex> ignoreNew = new List<Regex> ();
-               public static List<Regex> IgnoreNew {
-                       get { return ignoreNew; }
-               }
-
-               static List<Regex> ignoreRemoved = new List<Regex> ();
-               public static List<Regex> IgnoreRemoved {
-                       get { return ignoreRemoved; }
-               }
-
-               public  static  bool    IgnoreParameterNameChanges  { get; set; }
-               public  static  bool    IgnoreVirtualChanges        { get; set; }
-               public  static  bool    IgnoreAddedPropertySetters  { get; set; }
-
-               public static bool Lax;
-               public static bool Colorize = true;
-       }
-
-       class Program {
-
-               public static int Main (string[] args)
-               {
-                       var showHelp = false;
-                       string diff = null;
-                       List<string> extra = null;
-
-                       var options = new OptionSet {
-                               { "h|help", "Show this help", v => showHelp = true },
-                               { "d|diff=", "HTML diff file out output (omit for stdout)", v => diff = v },
-                               { "i|ignore=", "Ignore new, added, and removed members whose description matches a given C# regular expression (see below).",
-                                       v => {
-                                               var r = new Regex (v);
-                                               State.IgnoreAdded.Add (r);
-                                               State.IgnoreRemoved.Add (r);
-                                               State.IgnoreNew.Add (r);
-                                       }
-                               },
-                               { "a|ignore-added=", "Ignore added members whose description matches a given C# regular expression (see below).",
-                                       v => State.IgnoreAdded.Add (new Regex (v))
-                               },
-                               { "r|ignore-removed=", "Ignore removed members whose description matches a given C# regular expression (see below).",
-                                       v => State.IgnoreRemoved.Add (new Regex (v))
-                               },
-                               { "n|ignore-new=", "Ignore new namespaces and types whose description matches a given C# regular expression (see below).",
-                                       v => State.IgnoreNew.Add (new Regex (v))
-                               },
-                               { "ignore-changes-parameter-names", "Ignore changes to parameter names for identically prototyped methods.",
-                                       v => State.IgnoreParameterNameChanges   = v != null
-                               },
-                               { "ignore-changes-property-setters", "Ignore adding setters to properties.",
-                                       v => State.IgnoreAddedPropertySetters = v != null
-                               },
-                               { "ignore-changes-virtual", "Ignore changing non-`virtual` to `virtual` or adding `override`.",
-                                       v => State.IgnoreVirtualChanges = v != null
-                               },
-                               { "c|colorize:", "Colorize HTML output", v => State.Colorize = string.IsNullOrEmpty (v) ? true : bool.Parse (v) },
-                               { "x|lax", "Ignore duplicate XML entries", v => State.Lax = true }
-                       };
-
-                       try {
-                               extra = options.Parse (args);
-                       } catch (OptionException e) {
-                               Console.WriteLine ("Option error: {0}", e.Message);
-                               showHelp = true;
-                       }
-
-                       if (showHelp || extra == null || extra.Count < 2 || extra.Count > 3) {
-                               Console.WriteLine (@"Usage: mono-api-html [options] <reference.xml> <assembly.xml> [diff.html]");
-                               Console.WriteLine ();
-                               Console.WriteLine ("Available options:");
-                               options.WriteOptionDescriptions (Console.Out);
-                               Console.WriteLine ();
-                               Console.WriteLine ("Ignoring Members:");
-                               Console.WriteLine ();
-                               Console.WriteLine ("  Members that were added can be filtered out of the diff by using the");
-                               Console.WriteLine ("  -i, --ignore-added option. The option takes a C# regular expression");
-                               Console.WriteLine ("  to match against member descriptions. For example, to ignore the");
-                               Console.WriteLine ("  introduction of the interfaces 'INSCopying' and 'INSCoding' on types");
-                               Console.WriteLine ("  pass the following to mono-api-html:");
-                               Console.WriteLine ();
-                               Console.WriteLine ("    mono-api-html ... -i 'INSCopying$' -i 'INSCoding$'");
-                               Console.WriteLine ();
-                               Console.WriteLine ("  The regular expressions will match any member description ending with");
-                               Console.WriteLine ("  'INSCopying' or 'INSCoding'.");
-                               Console.WriteLine ();
-                               return 1;
-                       }
-
-                       var input = extra [0];
-                       var output = extra [1];
-                       if (extra.Count == 3 && diff == null)
-                               diff = extra [2];
-
-                       try {
-                               var ac = new AssemblyComparer (input, output);
-                               if (diff != null) {
-                                       string diffHtml = String.Empty;
-                                       using (var writer = new StringWriter ()) {
-                                               State.Output = writer;
-                                               ac.Compare ();
-                                               diffHtml = State.Output.ToString ();
-                                       }
-                                       if (diffHtml.Length > 0) {
-                                               using (var file = new StreamWriter (diff)) {
-                                                       file.WriteLine ("<div>");
-                                                       if (State.Colorize) {
-                                                               file.WriteLine ("<style scoped>");
-                                                               file.WriteLine ("\t.obsolete { color: gray; }");
-                                                               file.WriteLine ("\t.added { color: green; }");
-                                                               file.WriteLine ("\t.removed-inline { text-decoration: line-through; }");
-                                                               file.WriteLine ("\t.removed-breaking-inline { color: red;}");
-                                                               file.WriteLine ("\t.added-breaking-inline { text-decoration: underline; }");
-                                                               file.WriteLine ("\t.nonbreaking { color: black; }");
-                                                               file.WriteLine ("\t.breaking { color: red; }");
-                                                               file.WriteLine ("</style>");
-                                                       }
-                                                       file.WriteLine (
-@"<script type=""text/javascript"">
-       // Only some elements have 'data-is-[non-]breaking' attributes. Here we
-       // iterate over all descendents elements, and set 'data-is-[non-]breaking'
-       // depending on whether there are any descendents with that attribute.
-       function propagateDataAttribute (element)
-       {
-               if (element.hasAttribute ('data-is-propagated'))
-                       return;
-
-               var i;
-               var any_breaking = element.hasAttribute ('data-is-breaking');
-               var any_non_breaking = element.hasAttribute ('data-is-non-breaking');
-               for (i = 0; i < element.children.length; i++) {
-                       var el = element.children [i];
-                       propagateDataAttribute (el);
-                       any_breaking |= el.hasAttribute ('data-is-breaking');
-                       any_non_breaking |= el.hasAttribute ('data-is-non-breaking');
-               }
-               
-               if (any_breaking)
-                       element.setAttribute ('data-is-breaking', null);
-               else if (any_non_breaking)
-                       element.setAttribute ('data-is-non-breaking', null);
-               element.setAttribute ('data-is-propagated', null);
-       }
-
-       function hideNonBreakingChanges ()
-       {
-               var topNodes = document.querySelectorAll ('[data-is-topmost]');
-               var n;
-               var i;
-               for (n = 0; n < topNodes.length; n++) {
-                       propagateDataAttribute (topNodes [n]);
-                       var elements = topNodes [n].querySelectorAll ('[data-is-non-breaking]');
-                       for (i = 0; i < elements.length; i++) {
-                               var el = elements [i];
-                               if (!el.hasAttribute ('data-original-display'))
-                                       el.setAttribute ('data-original-display', el.style.display);
-                               el.style.display = 'none';
-                       }
-               }
-               
-               var links = document.getElementsByClassName ('hide-nonbreaking');
-               for (i = 0; i < links.length; i++)
-                       links [i].style.display = 'none';
-               links = document.getElementsByClassName ('restore-nonbreaking');
-               for (i = 0; i < links.length; i++)
-                       links [i].style.display = '';
-       }
-
-       function showNonBreakingChanges ()
-       {
-               var elements = document.querySelectorAll ('[data-original-display]');
-               var i;
-               for (i = 0; i < elements.length; i++) {
-                       var el = elements [i];
-                       el.style.display = el.getAttribute ('data-original-display');
-               }
-
-               var links = document.getElementsByClassName ('hide-nonbreaking');
-               for (i = 0; i < links.length; i++)
-                       links [i].style.display = '';
-               links = document.getElementsByClassName ('restore-nonbreaking');
-               for (i = 0; i < links.length; i++)
-                       links [i].style.display = 'none';
-       }
-</script>");
-                                                       if (ac.SourceAssembly == ac.TargetAssembly) {
-                                                               file.WriteLine ("<h1>{0}.dll</h1>", ac.SourceAssembly);
-                                                       } else {
-                                                               file.WriteLine ("<h1>{0}.dll vs {1}.dll</h1>", ac.SourceAssembly, ac.TargetAssembly);
-                                                       }
-                                                       file.WriteLine ("<a href='javascript: hideNonBreakingChanges (); ' class='hide-nonbreaking'>Hide non-breaking changes</a>");
-                                                       file.WriteLine ("<a href='javascript: showNonBreakingChanges (); ' class='restore-nonbreaking' style='display: none;'>Show non-breaking changes</a>");
-                                                       file.WriteLine ("<br/>");
-                                                       file.WriteLine ("<div data-is-topmost>");
-                                                       file.Write (diffHtml);
-                                                       file.WriteLine ("</div> <!-- end topmost div -->");
-                                                       file.WriteLine ("</div>");
-                                               }
-                                       }
-                               } else {
-                                       State.Output = Console.Out;
-                                       ac.Compare ();
-                               }
-                       }
-                       catch (Exception e) {
-                               Console.WriteLine (e);
-                               return 1;
-                       }
-                       return 0;
-               }
-       }
-}
diff --git a/mcs/tools/corcompare/mono-api-html/AssemblyComparer.cs b/mcs/tools/corcompare/mono-api-html/AssemblyComparer.cs
deleted file mode 100644 (file)
index adbd862..0000000
+++ /dev/null
@@ -1,79 +0,0 @@
-// 
-// Authors
-//    Sebastien Pouliot  <sebastien@xamarin.com>
-//
-// Copyright 2013 Xamarin Inc. http://www.xamarin.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.Collections.Generic;
-using System.Xml.Linq;
-
-namespace Xamarin.ApiDiff {
-
-       public class AssemblyComparer : Comparer {
-
-               XDocument source;
-               XDocument target;
-               NamespaceComparer comparer;
-
-               public AssemblyComparer (string sourceFile, string targetFile)
-               {
-                       source = XDocument.Load (sourceFile);
-                       target = XDocument.Load (targetFile);
-                       comparer =  new NamespaceComparer ();
-               }
-
-               public string SourceAssembly { get; private set; }
-               public string TargetAssembly { get; private set; }
-
-               public void Compare ()
-               {
-                       Compare (source.Element ("assemblies").Elements ("assembly"), 
-                                target.Element ("assemblies").Elements ("assembly"));
-               }
-
-               public override void SetContext (XElement current)
-               {
-                       State.Assembly = current.GetAttribute ("name");
-               }
-
-               public override void Added (XElement target, bool wasParentAdded)
-               {
-                       // one assembly per xml file
-               }
-
-               public override void Modified (XElement source, XElement target, ApiChanges diff)
-               {
-                       SourceAssembly = source.GetAttribute ("name");
-                       TargetAssembly = target.GetAttribute ("name");
-                       // TODO: version
-                       // ? custom attributes ?
-                       comparer.Compare (source, target);
-               }
-
-               public override void Removed (XElement source)
-               {
-                       // one assembly per xml file
-               }
-       }
-}
\ No newline at end of file
diff --git a/mcs/tools/corcompare/mono-api-html/ClassComparer.cs b/mcs/tools/corcompare/mono-api-html/ClassComparer.cs
deleted file mode 100644 (file)
index a3399fb..0000000
+++ /dev/null
@@ -1,261 +0,0 @@
-// 
-// Authors
-//    Sebastien Pouliot  <sebastien@xamarin.com>
-//
-// Copyright 2013 Xamarin Inc. http://www.xamarin.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.Collections.Generic;
-using System.IO;
-using System.Linq;
-using System.Xml.Linq;
-
-namespace Xamarin.ApiDiff {
-
-       public class ClassComparer : Comparer {
-
-               InterfaceComparer icomparer;
-               ConstructorComparer ccomparer;
-               FieldComparer fcomparer;
-               PropertyComparer pcomparer;
-               EventComparer ecomparer;
-               MethodComparer mcomparer;
-               ClassComparer kcomparer;
-
-               public ClassComparer ()
-               {
-                       icomparer = new InterfaceComparer ();
-                       ccomparer = new ConstructorComparer ();
-                       fcomparer = new FieldComparer ();
-                       pcomparer = new PropertyComparer ();
-                       ecomparer = new EventComparer ();
-                       mcomparer = new MethodComparer ();
-               }
-
-               public override void SetContext (XElement current)
-               {
-                       State.Type = current.GetAttribute ("name");
-                       State.BaseType = current.GetAttribute ("base");
-               }
-
-               public void Compare (XElement source, XElement target)
-               {
-                       var s = source.Element ("classes");
-                       var t = target.Element ("classes");
-                       if (XNode.DeepEquals (s, t))
-                               return;
-                       Compare (s.Elements ("class"), t.Elements ("class"));
-               }
-
-               public override void Added (XElement target, bool wasParentAdded)
-               {
-                       string name = target.Attribute ("name").Value;
-                       if (State.IgnoreNew.Any (re => re.IsMatch (name)))
-                               return;
-                       Output.WriteLine ("<div> <!-- start type {0} -->", name);
-                       Output.WriteLine ("<h3>New Type {0}.{1}</h3>", State.Namespace, name);
-                       Output.WriteLine ("<pre class='added' data-is-non-breaking>");
-                       State.Indent = 0;
-                       AddedInner (target);
-                       Output.WriteLine ("</pre>");
-                       Output.WriteLine ("</div> <!-- end type {0} -->", name);
-               }
-
-               public void AddedInner (XElement target)
-               {
-                       SetContext (target);
-                       if (target.IsTrue ("serializable"))
-                               Indent ().WriteLine ("[Serializable]");
-
-                       var type = target.Attribute ("type").Value;
-
-                       if (type == "enum") {
-                               // check if [Flags] is present
-                               var cattrs = target.Element ("attributes");
-                               if (cattrs != null) {
-                                       foreach (var ca in cattrs.Elements ("attribute")) {
-                                               if (ca.GetAttribute ("name") == "System.FlagsAttribute") {
-                                                       Indent ().WriteLine ("[Flags]");
-                                                       break;
-                                               }
-                                       }
-                               }
-                       }
-
-                       Indent ().Write ("public");
-
-                       if (type != "enum") {
-                               bool seal = target.IsTrue ("sealed");
-                               bool abst = target.IsTrue ("abstract");
-                               if (seal && abst)
-                                       Output.Write (" static");
-                               else if (seal && type != "struct")
-                                       Output.Write (" sealed");
-                               else if (abst && type != "interface")
-                                       Output.Write (" abstract");
-                       }
-
-                       Output.Write (' ');
-                       Output.Write (type);
-                       Output.Write (' ');
-                       Output.Write (target.GetAttribute ("name"));
-
-                       var baseclass = target.GetAttribute ("base");
-                       if ((type != "enum") && (type != "struct")) {
-                               if (baseclass != null) {
-                                       if (baseclass == "System.Object") {
-                                               // while true we do not need to be reminded every time...
-                                               baseclass = null;
-                                       } else {
-                                               Output.Write (" : ");
-                                               Output.Write (baseclass);
-                                       }
-                               }
-                       }
-
-                       // interfaces on enums are "standard" not user provided - so we do not want to show them
-                       if (type != "enum") {
-                               var i = target.Element ("interfaces");
-                               if (i != null) {
-                                       var interfaces = new List<string> ();
-                                       foreach (var iface in i.Elements ("interface"))
-                                               interfaces.Add (icomparer.GetDescription (iface));
-                                       Output.Write ((baseclass == null) ? " : " : ", ");
-                                       Output.Write (String.Join (", ", interfaces));
-                               }
-                       }
-
-                       Output.WriteLine (" {");
-
-                       var t = target.Element ("constructors");
-                       if (t != null) {
-                               Indent ().WriteLine ("\t// constructors");
-                               foreach (var ctor in t.Elements ("constructor"))
-                                       ccomparer.Added (ctor, true);
-                       }
-
-                       t = target.Element ("fields");
-                       if (t != null) {
-                               if (type != "enum")
-                                       Indent ().WriteLine ("\t// fields");
-                               else
-                                       SetContext (target);
-                               foreach (var field in t.Elements ("field"))
-                                       fcomparer.Added (field, true);
-                       }
-
-                       t = target.Element ("properties");
-                       if (t != null) {
-                               Indent ().WriteLine ("\t// properties");
-                               foreach (var property in t.Elements ("property"))
-                                       pcomparer.Added (property, true);
-                       }
-
-                       t = target.Element ("events");
-                       if (t != null) {
-                               Indent ().WriteLine ("\t// events");
-                               foreach (var evnt in t.Elements ("event"))
-                                       ecomparer.Added (evnt, true);
-                       }
-
-                       t = target.Element ("methods");
-                       if (t != null) {
-                               Indent ().WriteLine ("\t// methods");
-                               foreach (var method in t.Elements ("method"))
-                                       mcomparer.Added (method, true);
-                       }
-
-                       t = target.Element ("classes");
-                       if (t != null) {
-                               Output.WriteLine ();
-                               Indent ().WriteLine ("\t// inner types");
-                               kcomparer = new NestedClassComparer ();
-                               State.Indent++;
-                               foreach (var inner in t.Elements ("class"))
-                                       kcomparer.AddedInner (inner);
-                               State.Indent--;
-                       }
-                       Indent ().WriteLine ("}");
-               }
-
-               public override void Modified (XElement source, XElement target, ApiChanges diff)
-               {
-                       // hack - there could be changes that we're not monitoring (e.g. attributes properties)
-                       var output = Output;
-                       State.Output = new StringWriter ();
-
-                       var sb = source.GetAttribute ("base");
-                       var tb = target.GetAttribute ("base");
-                       if (sb != tb) {
-                               Output.Write ("Modified base type: ");
-                               Output.WriteLine (new ApiChange ().AppendModified (sb, tb, true).Member.ToString ());
-                       }
-
-                       ccomparer.Compare (source, target);
-                       icomparer.Compare (source, target);
-                       fcomparer.Compare (source, target);
-                       pcomparer.Compare (source, target);
-                       ecomparer.Compare (source, target);
-                       mcomparer.Compare (source, target);
-
-                       var si = source.Element ("classes");
-                       if (si != null) {
-                               var ti = target.Element ("classes");
-                               kcomparer = new NestedClassComparer ();
-                               kcomparer.Compare (si.Elements ("class"), ti == null ? null : ti.Elements ("class"));
-                       }
-
-                       var s = (Output as StringWriter).ToString ();
-                       State.Output = output;
-                       if (s.Length > 0) {
-                               var tn = GetTypeName (target);
-                               Output.WriteLine ("<!-- start type {0} --> <div>", tn);
-                               Output.WriteLine ("<h3>Type Changed: {0}.{1}</h3>", State.Namespace, GetTypeName (target));
-                               Output.WriteLine (s);
-                               Output.WriteLine ("</div> <!-- end type {0} -->", tn);
-                       }
-               }
-
-               public override void Removed (XElement source)
-               {
-                       Output.Write ("<h3>Removed Type <span class='breaking' data-is-breaking>{0}.{1}</span></h3>", State.Namespace, GetTypeName (source));
-               }
-
-               public virtual string GetTypeName (XElement type)
-               {
-                       return type.GetAttribute ("name");
-               }
-       }
-
-       public class NestedClassComparer : ClassComparer {
-
-               public override void SetContext (XElement current)
-               {
-               }
-
-               public override string GetTypeName (XElement type)
-               {
-                       return State.Type + "." + base.GetTypeName (type);
-               }
-       }
-}
\ No newline at end of file
diff --git a/mcs/tools/corcompare/mono-api-html/Comparer.cs b/mcs/tools/corcompare/mono-api-html/Comparer.cs
deleted file mode 100644 (file)
index 4210b9b..0000000
+++ /dev/null
@@ -1,98 +0,0 @@
-// 
-// Authors
-//    Sebastien Pouliot  <sebastien@xamarin.com>
-//
-// Copyright 2013 Xamarin Inc. http://www.xamarin.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.Collections.Generic;
-using System.IO;
-using System.Linq;
-using System.Xml.Linq;
-
-namespace Xamarin.ApiDiff {
-
-       public abstract class Comparer {
-
-               protected List<XElement> removed = new List<XElement> ();
-               protected ApiChanges modified = new ApiChanges ();
-
-               public TextWriter Output {
-                       get { return State.Output; }
-               }
-
-               protected TextWriter Indent ()
-               {
-                       for (int i = 0; i < State.Indent; i++)
-                               State.Output.Write ("\t");
-                       return State.Output;
-               }
-
-               public abstract void Added (XElement target, bool wasParentAdded);
-               public abstract void Modified (XElement source, XElement target, ApiChanges changes);
-               public abstract void Removed (XElement source);
-
-               public virtual bool Equals (XElement source, XElement target, ApiChanges changes)
-               {
-                       return XNode.DeepEquals (source, target);
-               }
-
-               public abstract void SetContext (XElement current);
-
-               public virtual void Compare (IEnumerable<XElement> source, IEnumerable<XElement> target)
-               {
-                       removed.Clear ();
-                       modified.Clear ();
-
-                       foreach (var s in source) {
-                               SetContext (s);
-                               string sn = s.GetAttribute ("name");
-                               var t = target == null ? null : target.SingleOrDefault (x => x.GetAttribute ("name") == sn);
-                               if (t == null) {
-                                       // not in target, it was removed
-                                       removed.Add (s);
-                               } else {
-                                       t.Remove ();
-                                       // possibly modified
-                                       if (Equals (s, t, modified))
-                                               continue;
-
-                                       // still in target so will be part of Added
-                                       Modified (s, t, modified);
-                               }
-                       }
-                       // delayed, that way we show "Modified", "Added" and then "Removed"
-                       foreach (var item in removed) {
-                               SetContext (item);
-                               Removed (item);
-                       }
-                       // remaining == newly added in target
-                       if (target != null) {
-                               foreach (var item in target) {
-                                       SetContext (item);
-                                       Added (item, false);
-                               }
-                       }
-               }
-       }
-}
\ No newline at end of file
diff --git a/mcs/tools/corcompare/mono-api-html/ConstructorComparer.cs b/mcs/tools/corcompare/mono-api-html/ConstructorComparer.cs
deleted file mode 100644 (file)
index 9bd837e..0000000
+++ /dev/null
@@ -1,148 +0,0 @@
-// 
-// Authors
-//    Sebastien Pouliot  <sebastien@xamarin.com>
-//
-// Copyright 2013 Xamarin Inc. http://www.xamarin.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.Collections.Generic;
-using System.Reflection;
-using System.Text;
-using System.Xml.Linq;
-
-namespace Xamarin.ApiDiff {
-
-       // MethodComparer inherits from this one
-       public class ConstructorComparer : MemberComparer {
-
-               public override string GroupName {
-                       get { return "constructors"; }
-               }
-
-               public override string ElementName {
-                       get { return "constructor"; }
-               }
-
-               public override bool Find (XElement e)
-               {
-                       return (e.Attribute ("name").Value == Source.Attribute ("name").Value);
-               }
-
-               void RenderReturnType (XElement source, XElement target, ApiChange change)
-               {
-                       var srcType = source.GetTypeName ("returntype");
-                       var tgtType = target.GetTypeName ("returntype");
-
-                       if (srcType != tgtType) {
-                               change.AppendModified (srcType, tgtType, true);
-                               change.Append (" ");
-                       } else if (srcType != null) {
-                               // ctor don't have a return type
-                               change.Append (srcType);
-                               change.Append (" ");
-                       }
-               }
-
-               public override bool Equals (XElement source, XElement target, ApiChanges changes)
-               {
-                       if (base.Equals (source, target, changes))
-                               return true;
-                               
-                       var change = new ApiChange ();
-                       change.Header = "Modified " + GroupName;
-                       RenderMethodAttributes (source, target, change);
-                       RenderReturnType (source, target, change);
-                       RenderName (source, target, change);
-                       RenderGenericParameters (source, target, change);
-                       RenderParameters (source, target, change);
-
-                       changes.Add (source, target, change);
-
-                       return false;
-               }
-
-               public override string GetDescription (XElement e)
-               {
-                       var sb = new StringBuilder ();
-
-                       var attribs = e.Attribute ("attrib");
-                       if (attribs != null) {
-                               var attr = (MethodAttributes) Int32.Parse (attribs.Value);
-                               if ((attr & MethodAttributes.Public) != MethodAttributes.Public) {
-                                       sb.Append ("protected ");
-                               } else {
-                                       sb.Append ("public ");
-                               }
-
-                               if ((attr & MethodAttributes.Static) != 0) {
-                                       sb.Append ("static ");
-                               } else if ((attr & MethodAttributes.Virtual) != 0) {
-                                       if ((attr & MethodAttributes.VtableLayoutMask) == 0)
-                                               sb.Append ("override ");
-                                       else
-                                               sb.Append ("virtual ");
-                               }
-                       }
-
-                       string name = e.GetAttribute ("name");
-
-                       var r = e.GetTypeName ("returntype");
-                       if (r != null) {
-                               // ctor dont' have a return type
-                               sb.Append (r).Append (' ');
-                       } else {
-                               // show the constructor as it would be defined in C#
-                               name = name.Replace (".ctor", State.Type);
-                       }
-
-                       // the XML file `name` does not contain parameter names, so we must process them ourselves
-                       // which gives us the opportunity to simplify type names
-                       sb.Append (name.Substring (0, name.IndexOf ('(')));
-
-                       var genericp = e.Element ("generic-parameters");
-                       if (genericp != null) {
-                               var list = new List<string> ();
-                               foreach (var p in genericp.Elements ("generic-parameter")) {
-                                       list.Add (p.GetTypeName ("name"));
-                               }
-                               sb.Append ("&lt;").Append (String.Join (", ", list)).Append ("&gt;");
-                       }
-
-                       sb.Append (" (");
-                       var parameters = e.Element ("parameters");
-                       if (parameters != null) {
-                               var list = new List<string> ();
-                               foreach (var p in parameters.Elements ("parameter")) {
-                                       var pTypeName   = p.GetTypeName ("type");
-                                       list.Add (State.IgnoreParameterNameChanges
-                                               ? pTypeName
-                                               : pTypeName + " " + p.GetAttribute ("name"));
-                               }
-                               sb.Append (String.Join (", ", list));
-                       }
-                       sb.Append (");");
-
-                       return sb.ToString ();
-               }
-       }
-}
\ No newline at end of file
diff --git a/mcs/tools/corcompare/mono-api-html/EventComparer.cs b/mcs/tools/corcompare/mono-api-html/EventComparer.cs
deleted file mode 100644 (file)
index 693f16f..0000000
+++ /dev/null
@@ -1,75 +0,0 @@
-// 
-// Authors
-//    Sebastien Pouliot  <sebastien@xamarin.com>
-//
-// Copyright 2013 Xamarin Inc. http://www.xamarin.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.Text;
-using System.Xml.Linq;
-
-namespace Xamarin.ApiDiff {
-
-       public class EventComparer : MemberComparer {
-
-               public override string GroupName {
-                       get { return "events"; }
-               }
-
-               public override string ElementName {
-                       get { return "event"; }
-               }
-
-               public override bool Equals (XElement source, XElement target, ApiChanges changes)
-               {
-                       if (base.Equals (source, target, changes))
-                               return true;
-
-                       var change = new ApiChange ();
-                       change.Header = "Modified " + GroupName;
-                       change.Append ("public event ");
-
-                       var srcEventType = source.GetTypeName ("eventtype");
-                       var tgtEventType = target.GetTypeName ("eventtype");
-
-                       if (srcEventType != tgtEventType) {
-                               change.AppendModified (srcEventType, tgtEventType, true);
-                       } else {
-                               change.Append (srcEventType);
-                       }
-                       change.Append (" ");
-                       change.Append (source.GetAttribute ("name")).Append (";");
-                       return false;
-               }
-
-               public override string GetDescription (XElement e)
-               {
-                       StringBuilder sb = new StringBuilder ();
-                       // TODO: attribs
-                       sb.Append ("public event ");
-                       sb.Append (e.GetTypeName ("eventtype")).Append (' ');
-                       sb.Append (e.GetAttribute ("name")).Append (';');
-                       return sb.ToString ();
-               }
-       }
-}
\ No newline at end of file
diff --git a/mcs/tools/corcompare/mono-api-html/FieldComparer.cs b/mcs/tools/corcompare/mono-api-html/FieldComparer.cs
deleted file mode 100644 (file)
index a2b0225..0000000
+++ /dev/null
@@ -1,211 +0,0 @@
-// 
-// Authors
-//    Sebastien Pouliot  <sebastien@xamarin.com>
-//
-// Copyright 2013-2014 Xamarin Inc. http://www.xamarin.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.Collections.Generic;
-using System.Linq;
-using System.Reflection;
-using System.Text;
-using System.Xml.Linq;
-
-namespace Xamarin.ApiDiff {
-
-       public class FieldComparer : MemberComparer {
-
-               public override string GroupName {
-                       get { return "fields"; }
-               }
-
-               public override string ElementName {
-                       get { return "field"; }
-               }
-
-               void RenderFieldAttributes (FieldAttributes source, FieldAttributes target, ApiChange change)
-               {
-                       var srcNotSerialized = (source & FieldAttributes.NotSerialized) == FieldAttributes.NotSerialized;
-                       var tgtNotSerialized = (target & FieldAttributes.NotSerialized) == FieldAttributes.NotSerialized;
-                       if (srcNotSerialized != tgtNotSerialized) {
-                               // this is not a breaking change, so only render it if it changed.
-                               if (srcNotSerialized) {
-                                       change.AppendRemoved ("[NonSerialized]\n");
-                               } else {
-                                       change.AppendAdded ("[NonSerialized]\n");
-                               }
-                       }
-
-                       // the visibility values are the same for MethodAttributes and FieldAttributes, so just use the same method.
-                       RenderVisibility ((MethodAttributes) source, (MethodAttributes) target, change);
-                       // same for the static flag
-                       RenderStatic ((MethodAttributes) source, (MethodAttributes) target, change);
-
-                       var srcLiteral = (source & FieldAttributes.Literal) != 0;
-                       var tgtLiteral = (target & FieldAttributes.Literal) != 0;
-
-                       if (srcLiteral) {
-                               if (tgtLiteral) {
-                                       change.Append ("const ");
-                               } else {
-                                       change.AppendRemoved ("const", true).Append (" ");
-                               }
-                       } else if (tgtLiteral) {
-                               change.AppendAdded ("const", true).Append (" ");
-                       }
-
-                       var srcInitOnly = (source & FieldAttributes.InitOnly) != 0;
-                       var tgtInitOnly = (target & FieldAttributes.InitOnly) != 0;
-                       if (srcInitOnly) {
-                               if (tgtInitOnly) {
-                                       change.Append ("readonly ");
-                               } else {
-                                       change.AppendRemoved ("readonly", false).Append (" ");
-                               }
-                       } else if (tgtInitOnly) {
-                               change.AppendAdded ("readonly", true).Append (" ");
-                       }
-               }
-
-               public override bool Equals (XElement source, XElement target, ApiChanges changes)
-               {
-                       if (base.Equals (source, target, changes))
-                               return true;
-
-                       var name = source.GetAttribute ("name");
-                       var srcValue = source.GetAttribute ("value");
-                       var tgtValue = target.GetAttribute ("value");
-                       var change = new ApiChange ();
-                       change.Header = "Modified " + GroupName;
-
-                       if (State.BaseType == "System.Enum") {
-                               change.Append (name).Append (" = ");
-                               if (srcValue != tgtValue) {
-                                       change.AppendModified (srcValue, tgtValue, true);
-                               } else {
-                                       change.Append (srcValue);
-                               }
-                       } else {
-                               RenderFieldAttributes (source.GetFieldAttributes (), target.GetFieldAttributes (), change);
-
-                               var srcType = source.GetTypeName ("fieldtype");
-                               var tgtType = target.GetTypeName ("fieldtype");
-
-                               if (srcType != tgtType) {
-                                       change.AppendModified (srcType, tgtType, true);
-                               } else {
-                                       change.Append (srcType);
-                               }
-                               change.Append (" ");
-                               change.Append (name);
-
-                               if (srcType == "string" && srcValue != null)
-                                       srcValue = "\"" + srcValue + "\"";
-
-                               if (tgtType == "string" && tgtValue != null)
-                                       tgtValue = "\"" + tgtValue + "\"";
-
-                               if (srcValue != tgtValue) {
-                                       change.Append (" = ");
-                                       if (srcValue == null)
-                                               srcValue = "null";
-                                       if (tgtValue == null)
-                                               tgtValue = "null";
-                                       change.AppendModified (srcValue, tgtValue, true);
-                               } else if (srcValue != null) {
-                                       change.Append (" = ");
-                                       change.Append (srcValue);
-                               }
-                               change.Append (";");
-                       }
-
-                       changes.Add (source, target, change);
-
-                       return false;
-               }
-
-               public override string GetDescription (XElement e)
-               {
-                       var sb = new StringBuilder ();
-
-                       string name = e.GetAttribute ("name");
-                       string value = e.GetAttribute ("value");
-
-                       if (State.BaseType == "System.Enum") {
-                               sb.Append (name).Append (" = ").Append (value).Append (',');
-                       } else {
-                               var attribs = e.Attribute ("attrib");
-                               if (attribs != null) {
-                                       var attr = (FieldAttributes)Int32.Parse (attribs.Value);
-                                       if ((attr & FieldAttributes.Public) != FieldAttributes.Public) {
-                                               sb.Append ("protected ");
-                                       } else {
-                                               sb.Append ("public ");
-                                       }
-
-                                       if ((attr & FieldAttributes.Static) != 0)
-                                               sb.Append ("static ");
-
-                                       if ((attr & FieldAttributes.Literal) != 0)
-                                               sb.Append ("const ");
-                               }
-
-                               string ftype = e.GetTypeName ("fieldtype");
-                               sb.Append (ftype).Append (' ');
-                               sb.Append (name);
-                               if (ftype == "string" && e.Attribute ("value") != null) {
-                                       if (value == null)
-                                               sb.Append (" = null");
-                                       else
-                                               sb.Append (" = \"").Append (value).Append ('"');
-                               }
-                               sb.Append (';');
-                       }
-
-                       return sb.ToString ();
-               }
-
-               public override void BeforeAdding (IEnumerable<XElement> list)
-               {
-                       first = true;
-                       if (State.BaseType == "System.Enum") {
-                               Output.WriteLine ("<div>");
-                               Output.WriteLine ("<p>Added value{0}:</p>", list.Count () > 1 ? "s" : String.Empty);
-                               Output.WriteLine ("<pre class='added' data-is-non-breaking>");
-                       } else {
-                               base.BeforeAdding (list);
-                       }
-               }
-
-               public override void BeforeRemoving (IEnumerable<XElement> list)
-               {
-                       first = true;
-                       if (State.BaseType == "System.Enum") {
-                               Output.WriteLine ("<p>Removed value{0}:</p>", list.Count () > 1 ? "s" : String.Empty);
-                               Output.WriteLine ("<pre class='removed' data-is-breaking>");
-                       } else {
-                               base.BeforeRemoving (list);
-                       }
-               }
-       }
-}
\ No newline at end of file
diff --git a/mcs/tools/corcompare/mono-api-html/Helpers.cs b/mcs/tools/corcompare/mono-api-html/Helpers.cs
deleted file mode 100644 (file)
index 8769785..0000000
+++ /dev/null
@@ -1,207 +0,0 @@
-// 
-// Authors
-//    Sebastien Pouliot  <sebastien@xamarin.com>
-//
-// Copyright 2013-2014 Xamarin Inc. http://www.xamarin.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.Collections.Generic;
-using System.Linq;
-using System.Reflection;
-using System.Text;
-using System.Xml.Linq;
-
-namespace Xamarin.ApiDiff {
-
-       public static class Helper {
-               public static bool IsTrue (this XElement self, string name)
-               {
-                       return (self.GetAttribute (name) == "true");
-               }
-
-               public static string GetAttribute (this XElement self, string name)
-               {
-                       var n = self.Attribute (name);
-                       if (n == null)
-                               return null;
-                       return n.Value;
-               }
-
-               // null == no obsolete, String.Empty == no description
-               public static string GetObsoleteMessage (this XElement self)
-               {
-                       var cattrs = self.Element ("attributes");
-                       if (cattrs == null)
-                               return null;
-
-                       foreach (var ca in cattrs.Elements ("attribute")) {
-                               if (ca.GetAttribute ("name") != "System.ObsoleteAttribute")
-                                       continue;
-                               var props = ca.Element ("properties");
-                               if (props == null)
-                                       return String.Empty; // no description
-                               foreach (var p in props.Elements ("property")) {
-                                       if (p.GetAttribute ("name") != "Message")
-                                               continue;
-                                       return p.GetAttribute ("value");
-                               }
-                       }
-                       return null;
-               }
-
-               public static IEnumerable<XElement> Descendants (this XElement self, params string[] names)
-               {
-                       XElement el = self;
-                       if (el == null)
-                               return null;
-
-                       for (int i = 0; i < names.Length - 1; i++) {
-                               el = el.Element (names [i]);
-                               if (el == null)
-                                       return null;
-                       }
-                       return el.Elements (names [names.Length - 1]);
-               }
-
-               public static List<XElement> DescendantList (this XElement self, params string[] names)
-               {
-                       var descendants = self.Descendants (names);
-                       if (descendants == null)
-                               return null;
-                       return descendants.ToList ();
-               }
-
-               // make it beautiful (.NET -> C#)
-               public static string GetTypeName (this XElement self, string name)
-               {
-                       string type = self.GetAttribute (name);
-                       if (type == null)
-                               return null;
-
-                       StringBuilder sb = null;
-                       bool is_nullable = false;
-                       if (type.StartsWith ("System.Nullable`1[", StringComparison.Ordinal)) {
-                               is_nullable = true;
-                               sb = new StringBuilder (type, 18, type.Length - 19, 1024);
-                       } else {
-                               sb = new StringBuilder (type);
-                       }
-
-                       bool is_ref = (sb [sb.Length - 1] == '&');
-                       if (is_ref)
-                               sb.Remove (sb.Length - 1, 1);
-
-                       int array = 0;
-                       while ((sb [sb.Length - 1] == ']') && (sb [sb.Length - 2] == '[')) {
-                               sb.Remove (sb.Length - 2, 2);
-                               array++;
-                       }
-
-                       bool is_pointer = (sb [sb.Length - 1] == '*');
-                       if (is_pointer)
-                               sb.Remove (sb.Length - 1, 1);
-
-                       type = GetTypeName (sb.Replace ('+', '.').ToString ());
-                       sb.Length = 0;
-                       if (is_ref)
-                               sb.Append (self.GetAttribute ("direction")).Append (' ');
-
-                       sb.Append (type);
-
-                       while (array-- > 0)
-                               sb.Append ("[]");
-                       if (is_nullable)
-                               sb.Append ('?');
-                       if (is_pointer)
-                               sb.Append ('*');
-                       return sb.ToString ();
-               }
-
-               static string GetTypeName (string type)
-               {
-                       int pos = type.IndexOf ('`');
-                       if (pos >= 0) {
-                               int end = type.LastIndexOf (']');
-                               string subtype = type.Substring (pos + 3, end - pos - 3);
-                               return type.Substring (0, pos) + "&lt;" + GetTypeName (subtype) + "&gt;";
-                       }
-
-                       switch (type) {
-                       case "System.String":
-                               return "string";
-                       case "System.Int32":
-                               return "int";
-                       case "System.UInt32":
-                               return "uint";
-                       case "System.Int64":
-                               return "long";
-                       case "System.UInt64":
-                               return "ulong";
-                       case "System.Void":
-                               return "void";
-                       case "System.Boolean":
-                               return "bool";
-                       case "System.Object":
-                               return "object";
-                       case "System.Single":
-                               return "float";
-                       case "System.Double":
-                               return "double";
-                       case "System.Byte":
-                               return "byte";
-                       case "System.SByte":
-                               return "sbyte";
-                       case "System.Int16":
-                               return "short";
-                       case "System.UInt16":
-                               return "ushort";
-                       case "System.Char":
-                               return "char";
-                       case "System.nint":
-                               return "nint";
-                       case "System.nuint":
-                               return "uint";
-                       case "System.nfloat":
-                               return "nfloat";
-                       case "System.IntPtr":
-                               return "IntPtr";
-                       default:
-                               if (type.StartsWith (State.Namespace, StringComparison.Ordinal))
-                                       type = type.Substring (State.Namespace.Length + 1);
-                               return type;
-                       }
-               }
-
-               public static MethodAttributes GetMethodAttributes (this XElement element)
-               {
-                       var srcAttribs = element.Attribute ("attrib");
-                       return (MethodAttributes) (srcAttribs != null ? Int32.Parse (srcAttribs.Value) : 0);
-               }
-
-               public static FieldAttributes GetFieldAttributes (this XElement element)
-               {
-                       var srcAttribs = element.Attribute ("attrib");
-                       return (FieldAttributes) (srcAttribs != null ? Int32.Parse (srcAttribs.Value) : 0);
-               }
-       }
-}
\ No newline at end of file
diff --git a/mcs/tools/corcompare/mono-api-html/InterfaceComparer.cs b/mcs/tools/corcompare/mono-api-html/InterfaceComparer.cs
deleted file mode 100644 (file)
index df52f16..0000000
+++ /dev/null
@@ -1,47 +0,0 @@
-// 
-// Authors
-//    Sebastien Pouliot  <sebastien@xamarin.com>
-//
-// Copyright 2013 Xamarin Inc. http://www.xamarin.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.Xml.Linq;
-
-namespace Xamarin.ApiDiff {
-
-       public class InterfaceComparer : MemberComparer {
-
-               public override string GroupName {
-                       get { return "interfaces"; }
-               }
-
-               public override string ElementName {
-                       get { return "interface"; }
-               }
-
-               public override string GetDescription (XElement e)
-               {
-                       return e.GetTypeName ("name");
-               }
-       }
-}
\ No newline at end of file
diff --git a/mcs/tools/corcompare/mono-api-html/MemberComparer.cs b/mcs/tools/corcompare/mono-api-html/MemberComparer.cs
deleted file mode 100644 (file)
index d12d866..0000000
+++ /dev/null
@@ -1,608 +0,0 @@
-// 
-// Authors
-//    Sebastien Pouliot  <sebastien@xamarin.com>
-//
-// Copyright 2013-2014 Xamarin Inc. http://www.xamarin.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.Collections.Generic;
-using System.Linq;
-using System.Reflection;
-using System.Text;
-using System.Xml.Linq;
-
-namespace Xamarin.ApiDiff {
-
-       public abstract class MemberComparer : Comparer {
-
-               // true if this is the first element being added or removed in the group being rendered
-               protected bool first;
-
-               public abstract string GroupName { get; }
-               public abstract string ElementName { get; }
-
-               protected virtual bool IsBreakingRemoval (XElement e)
-               {
-                       return true;
-               }
-
-               public void Compare (XElement source, XElement target)
-               {
-                       var s = source.Element (GroupName);
-                       var t = target.Element (GroupName);
-                       if (XNode.DeepEquals (s, t))
-                               return;
-
-                       if (s == null) {
-                               Add (t.Elements (ElementName));
-                       } else if (t == null) {
-                               Remove (s.Elements (ElementName));
-                       } else {
-                               Compare (s.Elements (ElementName), t.Elements (ElementName));
-                       }
-               }
-
-               public override void SetContext (XElement current)
-               {
-               }
-
-               string GetContainingType (XElement el)
-               {
-                       return el.Ancestors ("class").First ().Attribute ("type").Value;
-               }
-
-               bool IsInInterface (XElement el)
-               {
-                       return GetContainingType (el) == "interface";
-               }
-
-               public XElement Source { get; set; }
-
-               public virtual bool Find (XElement e)
-               {
-                       return e.GetAttribute ("name") == Source.GetAttribute ("name");
-               }
-
-               XElement Find (IEnumerable<XElement> target)
-               {
-                       return State.Lax ? target.FirstOrDefault (Find) : target.SingleOrDefault (Find);
-               }
-
-               public override void Compare (IEnumerable<XElement> source, IEnumerable<XElement> target)
-               {
-                       removed.Clear ();
-                       modified.Clear ();
-
-                       foreach (var s in source) {
-                               SetContext (s);
-                               Source = s;
-                               var t = Find (target);
-                               if (t == null) {
-                                       // not in target, it was removed
-                                       removed.Add (s);
-                               } else {
-                                       t.Remove ();
-                                       // possibly modified
-                                       if (Equals (s, t, modified))
-                                               continue;
-
-                                       Modified (s, t, modified);
-                               }
-                       }
-                       // delayed, that way we show "Modified", "Added" and then "Removed"
-                       Remove (removed);
-
-                       Modify (modified);
-
-                       // remaining == newly added in target
-                       Add (target);
-               }
-
-               void Add (IEnumerable<XElement> elements)
-               {
-                       bool a = false;
-                       foreach (var item in elements) {
-                               SetContext (item);
-                               if (State.IgnoreAdded.Any (re => re.IsMatch (GetDescription (item))))
-                                       continue;
-                               if (!a) {
-                                       BeforeAdding (elements);
-                                       a = true;
-                               }
-                               Added (item, false);
-                       }
-                       if (a)
-                               AfterAdding ();
-               }
-
-               void Modify (ApiChanges modified)
-               {
-                       foreach (var changes in modified) {
-                               Output.WriteLine ("<p>{0}:</p>", changes.Key);
-                               Output.WriteLine ("<pre>");
-                               foreach (var element in changes.Value) {
-                                       Output.Write ("<div {0}>", element.Breaking ? "data-is-breaking" : "data-is-non-breaking");
-                                       foreach (var line in element.Member.ToString ().Split ('\n'))
-                                               Output.WriteLine ("\t{0}", line);
-                                       Output.Write ("</div>");
-
-                               }
-                               Output.WriteLine ("</pre>");
-                       }
-               }
-
-               void Remove (IEnumerable<XElement> elements)
-               {
-                       bool r = false;
-                       foreach (var item in elements) {
-                               if (State.IgnoreRemoved.Any (re => re.IsMatch (GetDescription (item))))
-                                       continue;
-                               SetContext (item);
-                               if (!r) {
-                                       BeforeRemoving (elements);
-                                       r = true;
-                               }
-                               Removed (item);
-                       }
-                       if (r)
-                               AfterRemoving ();
-               }
-                       
-               public abstract string GetDescription (XElement e);
-
-               protected StringBuilder GetObsoleteMessage (XElement e)
-               {
-                       var sb = new StringBuilder ();
-                       string o = e.GetObsoleteMessage ();
-                       if (o != null) {
-                               sb.Append ("[Obsolete");
-                               if (o.Length > 0)
-                                       sb.Append (" (\"").Append (o).Append ("\")");
-                               sb.AppendLine ("]");
-                               for (int i = 0; i < State.Indent + 1; i++)
-                                       sb.Append ('\t');
-                       }
-                       return sb;
-               }
-
-               public override bool Equals (XElement source, XElement target, ApiChanges changes)
-               {
-                       RenderAttributes (source, target, changes);
-
-                       // We don't want to compare attributes.
-                       RemoveAttributes (source);
-                       RemoveAttributes (target);
-
-                       return base.Equals (source, target, changes);
-               }
-
-               public virtual void BeforeAdding (IEnumerable<XElement> list)
-               {
-                       first = true;
-                       Output.WriteLine ("<div>");
-                       Output.WriteLine ("<p>Added {0}:</p>", list.Count () > 1 ? GroupName : ElementName);
-                       Output.WriteLine ("<pre>");
-               }
-
-               public override void Added (XElement target, bool wasParentAdded)
-               {
-                       var o = GetObsoleteMessage (target);
-                       if (!first && (o.Length > 0))
-                               Output.WriteLine ();
-                       Indent ();
-                       bool isInterfaceBreakingChange = !wasParentAdded && IsInInterface (target);
-                       Output.Write ("\t<span class='added added-{0} {1}' {2}>", ElementName, isInterfaceBreakingChange ? "breaking" : string.Empty, isInterfaceBreakingChange ? "data-is-breaking" : "data-is-non-breaking");
-                       Output.Write ("{0}{1}", o, GetDescription (target));
-                       Output.WriteLine ("</span>");
-                       first = false;
-               }
-
-               public virtual void AfterAdding ()
-               {
-                       Output.WriteLine ("</pre>");
-                       Output.WriteLine ("</div>");
-               }
-
-               public override void Modified (XElement source, XElement target, ApiChanges change)
-               {
-               }
-
-               public virtual void BeforeRemoving (IEnumerable<XElement> list)
-               {
-                       first = true;
-                       Output.WriteLine ("<p>Removed {0}:</p>\n", list.Count () > 1 ? GroupName : ElementName);
-                       Output.WriteLine ("<pre>");
-               }
-
-               public override void Removed (XElement source)
-               {
-                       var o = GetObsoleteMessage (source);
-                       if (!first && (o.Length > 0))
-                               Output.WriteLine ();
-
-                       bool is_breaking = IsBreakingRemoval (source);
-
-                       Indent ();
-                       Output.Write ("\t<span class='removed removed-{0} {2}' {1}>", ElementName, is_breaking ? "data-is-breaking" : "data-is-non-breaking", is_breaking ? "breaking" : string.Empty);
-                       Output.Write ("{0}{1}", o, GetDescription (source));
-                       Output.WriteLine ("</span>");
-                       first = false;
-               }
-
-               public virtual void AfterRemoving ()
-               {
-                       Output.WriteLine ("</pre>");;
-               }
-
-               string RenderGenericParameter (XElement gp)
-               {
-                       var sb = new StringBuilder ();
-                       sb.Append (gp.GetTypeName ("name"));
-
-                       var constraints = gp.DescendantList ("generic-parameter-constraints", "generic-parameter-constraint");
-                       if (constraints != null && constraints.Count > 0) {
-                               sb.Append (" : ");
-                               for (int i = 0; i < constraints.Count; i++) {
-                                       if (i > 0)
-                                               sb.Append (", ");
-                                       sb.Append (constraints [i].GetTypeName ("name"));
-                               }
-                       }
-                       return sb.ToString ();
-               }
-
-               protected void RenderGenericParameters (XElement source, XElement target, ApiChange change)
-               {
-                       var src = source.DescendantList ("generic-parameters", "generic-parameter");
-                       var tgt = target.DescendantList ("generic-parameters", "generic-parameter");
-                       var srcCount = src == null ? 0 : src.Count;
-                       var tgtCount = tgt == null ? 0 : tgt.Count;
-
-                       if (srcCount == 0 && tgtCount == 0)
-                               return;
-
-                       change.Append ("&lt;");
-                       for (int i = 0; i < Math.Max (srcCount, tgtCount); i++) {
-                               if (i > 0)
-                                       change.Append (", ");
-                               if (i >= srcCount) {
-                                       change.AppendAdded (RenderGenericParameter (tgt [i]), true);
-                               } else if (i >= tgtCount) {
-                                       change.AppendRemoved (RenderGenericParameter (src [i]), true);
-                               } else {
-                                       var srcName = RenderGenericParameter (src [i]);
-                                       var tgtName = RenderGenericParameter (tgt [i]);
-
-                                       if (srcName != tgtName) {
-                                               change.AppendModified (srcName, tgtName, true);
-                                       } else {
-                                               change.Append (srcName);
-                                       }
-                                       }
-                               }
-                       change.Append ("&gt;");
-               }
-
-               protected string FormatValue (string type, string value)
-               {
-                       if (value == null)
-                               return "null";
-
-                       if (type == "string")
-                               return "\"" + value + "\"";
-                       else if (type == "bool") {
-                               switch (value) {
-                               case "True":
-                                       return "true";
-                               case "False":
-                                       return "false";
-                               default:
-                                       return value;
-                               }
-                       }
-
-                       return value;
-               }
-
-               protected void RenderParameters (XElement source, XElement target, ApiChange change)
-               {
-                       var src = source.DescendantList ("parameters", "parameter");
-                       var tgt = target.DescendantList ("parameters", "parameter");
-                       var srcCount = src == null ? 0 : src.Count;
-                       var tgtCount = tgt == null ? 0 : tgt.Count;
-
-                       change.Append (" (");
-                       for (int i = 0; i < Math.Max (srcCount, tgtCount); i++) {
-                               if (i > 0)
-                                       change.Append (", ");
-
-                               if (i >= srcCount) {
-                                       change.AppendAdded (tgt [i].GetTypeName ("type") + " " + tgt [i].GetAttribute ("name"), true);
-                               } else if (i >= tgtCount) {
-                                       change.AppendRemoved (src [i].GetTypeName ("type") + " " + src [i].GetAttribute ("name"), true);
-                               } else {
-                                       var paramSourceType = src [i].GetTypeName ("type");
-                                       var paramTargetType = tgt [i].GetTypeName ("type");
-
-                                       var paramSourceName = src [i].GetAttribute ("name");
-                                       var paramTargetName = tgt [i].GetAttribute ("name");
-
-                                       if (paramSourceType != paramTargetType) {
-                                               change.AppendModified (paramSourceType, paramTargetType, true);
-                                       } else {
-                                               change.Append (paramSourceType);
-                                       }
-                                       change.Append (" ");
-                                       if (paramSourceName != paramTargetName) {
-                                               change.AppendModified (paramSourceName, paramTargetName, false);
-                                       } else {
-                                               change.Append (paramSourceName);
-                                       }
-
-                                       var optSource = src [i].Attribute ("optional");
-                                       var optTarget = tgt [i].Attribute ("optional");
-                                       var srcValue = FormatValue (paramSourceType, src [i].GetAttribute ("defaultValue"));
-                                       var tgtValue = FormatValue (paramTargetType, tgt [i].GetAttribute ("defaultValue"));
-
-                                       if (optSource != null) {
-                                               if (optTarget != null) {
-                                                       change.Append (" = ");
-                                                       if (srcValue != tgtValue) {
-                                                               change.AppendModified (srcValue, tgtValue, false);
-                                                       } else {
-                                                               change.Append (tgtValue);
-                                                       }
-                                               } else {
-                                                       change.AppendRemoved (" = " + srcValue);
-                                               }
-                                       } else {
-                                               if (optTarget != null)
-                                                       change.AppendAdded (" = " + tgtValue);
-                                       }
-                               }
-                       }
-
-                       change.Append (")");
-
-                       // Ignore any parameter name changes if requested.
-                       if (State.IgnoreParameterNameChanges && !change.Breaking) {
-                               change.AnyChange = false;
-                               change.HasIgnoredChanges = true;
-                       }
-               }
-
-               void RenderVTable (MethodAttributes source, MethodAttributes target, ApiChange change)
-               {
-                       var srcAbstract = (source & MethodAttributes.Abstract) == MethodAttributes.Abstract;
-                       var tgtAbstract = (target & MethodAttributes.Abstract) == MethodAttributes.Abstract;
-                       var srcFinal = (source & MethodAttributes.Final) == MethodAttributes.Final;
-                       var tgtFinal = (target & MethodAttributes.Final) == MethodAttributes.Final;
-                       var srcVirtual = (source & MethodAttributes.Virtual) == MethodAttributes.Virtual;
-                       var tgtVirtual = (target & MethodAttributes.Virtual) == MethodAttributes.Virtual;
-                       var srcOverride = (source & MethodAttributes.VtableLayoutMask) != MethodAttributes.NewSlot;
-                       var tgtOverride = (target & MethodAttributes.VtableLayoutMask) != MethodAttributes.NewSlot;
-
-                       var srcWord = srcVirtual ? (srcOverride ? "override" : "virtual") : string.Empty;
-                       var tgtWord = tgtVirtual ? (tgtOverride ? "override" : "virtual") : string.Empty;
-                       var breaking = srcWord.Length > 0 && tgtWord.Length == 0;
-
-                       if (srcAbstract) {
-                               if (tgtAbstract) {
-                                       change.Append ("abstract ");
-                               } else if (tgtVirtual) {
-                                       change.AppendModified ("abstract", tgtWord, false).Append (" ");
-                               } else {
-                                       change.AppendRemoved ("abstract").Append (" ");
-                               }
-                       } else {
-                               if (tgtAbstract) {
-                                       change.AppendAdded ("abstract", true).Append (" ");
-                               } else if (srcWord != tgtWord) {
-                                       if (!tgtFinal)
-                                               change.AppendModified (srcWord, tgtWord, breaking).Append (" ");
-                               } else if (tgtWord.Length > 0) {
-                                       change.Append (tgtWord).Append (" ");
-                               } else if (srcWord.Length > 0) {
-                                       change.AppendRemoved (srcWord, breaking).Append (" ");
-                               }
-                       }
-
-                       if (srcFinal) {
-                               if (tgtFinal) {
-                                       change.Append ("final ");
-                               } else {
-                                       change.AppendRemoved ("final", false).Append (" "); // removing 'final' is not a breaking change.
-                               }
-                       } else {
-                               if (tgtFinal && srcVirtual) {
-                                       change.AppendModified ("virtual", "final", true).Append (" "); // adding 'final' is a breaking change if the member was virtual
-                               }
-                       }
-
-                       if (!srcVirtual && !srcFinal && tgtVirtual && tgtFinal) {
-                               // existing member implements a member from a new interface
-                               // this would show up as 'virtual final', which is redundant, so show nothing at all.
-                               change.HasIgnoredChanges = true;
-                       }
-
-                       // Ignore non-breaking virtual changes.
-                       if (State.IgnoreVirtualChanges && !change.Breaking) {
-                               change.AnyChange = false;
-                               change.HasIgnoredChanges = true;
-                       }
-
-                       var tgtSecurity = (source & MethodAttributes.HasSecurity) == MethodAttributes.HasSecurity;
-                       var srcSecurity = (target & MethodAttributes.HasSecurity) == MethodAttributes.HasSecurity;
-
-                       if (tgtSecurity != srcSecurity)
-                               change.HasIgnoredChanges = true;
-
-                       var srcPInvoke = (source & MethodAttributes.PinvokeImpl) == MethodAttributes.PinvokeImpl;
-                       var tgtPInvoke = (target & MethodAttributes.PinvokeImpl) == MethodAttributes.PinvokeImpl;
-                       if (srcPInvoke != tgtPInvoke)
-                               change.HasIgnoredChanges = true;
-               }
-
-               protected string GetVisibility (MethodAttributes attr)
-               {
-                       switch (attr) {
-                       case MethodAttributes.Private:
-                       case MethodAttributes.PrivateScope:
-                               return "private";
-                       case MethodAttributes.Assembly:
-                               return "internal";
-                       case MethodAttributes.FamANDAssem:
-                               return "private internal";
-                       case MethodAttributes.FamORAssem:
-                               return "protected"; // customers don't care about 'internal';
-                       case MethodAttributes.Family:
-                               return "protected";
-                       case MethodAttributes.Public:
-                               return "public";
-                       default:
-                               throw new NotImplementedException ();
-                       }
-               }
-
-               protected void RenderVisibility (MethodAttributes source, MethodAttributes target, ApiChange diff)
-               {
-                       source = source & MethodAttributes.MemberAccessMask;
-                       target = target & MethodAttributes.MemberAccessMask;
-
-                       if (source == target) {
-                               diff.Append (GetVisibility (target));
-                       } else {
-                               var breaking = false;
-                               switch (source) {
-                               case MethodAttributes.Private:
-                               case MethodAttributes.Assembly:
-                               case MethodAttributes.FamANDAssem:
-                                       break; // these are not publicly visible, thus not breaking
-                               case MethodAttributes.FamORAssem:
-                               case MethodAttributes.Family:
-                                       switch (target) {
-                                       case MethodAttributes.Public:
-                                               // to public is not a breaking change
-                                               break;
-                                       case MethodAttributes.Family:
-                                       case MethodAttributes.FamORAssem:
-                                               // not a breaking change, but should still show up in diff
-                                               break;
-                                       default:
-                                               // anything else is a breaking change
-                                               breaking = true;
-                                               break;
-                                       }
-                                       break;
-                               case MethodAttributes.Public:
-                               default:
-                                       // any change from public is breaking.
-                                       breaking = true;
-                                       break;
-                               }
-
-                               diff.AppendModified (GetVisibility (source), GetVisibility (target), breaking);
-                       }
-                       diff.Append (" ");
-               }
-
-               protected void RenderStatic (MethodAttributes src, MethodAttributes tgt, ApiChange diff)
-               {
-                       var srcStatic = (src & MethodAttributes.Static) == MethodAttributes.Static;
-                       var tgtStatic = (tgt & MethodAttributes.Static) == MethodAttributes.Static;
-
-                       if (srcStatic != tgtStatic) {
-                               if (srcStatic) {
-                                       diff.AppendRemoved ("static", true).Append (" ");
-                               } else {
-                                       diff.AppendAdded ("static", true).Append (" ");
-                               }
-                       }
-               }
-
-               protected void RenderMethodAttributes (MethodAttributes src, MethodAttributes tgt, ApiChange diff)
-               {
-                       RenderStatic (src, tgt, diff);
-                       RenderVisibility (src & MethodAttributes.MemberAccessMask, tgt & MethodAttributes.MemberAccessMask, diff);
-                       RenderVTable (src, tgt, diff);
-               }
-
-               protected void RenderMethodAttributes (XElement source, XElement target, ApiChange diff)
-               {
-                       RenderMethodAttributes (source.GetMethodAttributes (), target.GetMethodAttributes (), diff);
-               }
-
-               protected void RemoveAttributes (XElement element)
-               {
-                       var srcAttributes = element.Element ("attributes");
-                       if (srcAttributes != null)
-                               srcAttributes.Remove ();
-
-                       foreach (var el in element.Elements ())
-                               RemoveAttributes (el);
-               }
-
-               protected void RenderAttributes (XElement source, XElement target, ApiChanges changes)
-               {
-                       var srcObsolete = source.GetObsoleteMessage ();
-                       var tgtObsolete = target.GetObsoleteMessage ();
-
-                       if (srcObsolete == tgtObsolete)
-                               return; // nothing changed
-
-                       if (srcObsolete == null) {
-                               if (tgtObsolete == null)
-                                       return; // neither is obsolete
-                               var change = new ApiChange ();
-                               change.Header = "Obsoleted " + GroupName;
-                               change.Append (string.Format ("<span class='obsolete obsolete-{0}' data-is-non-breaking>", ElementName));
-                               change.Append ("[Obsolete (");
-                               if (tgtObsolete != string.Empty)
-                                       change.Append ("\"").Append (tgtObsolete).Append ("\"");
-                               change.Append (")]\n");
-                               change.Append (GetDescription (target));
-                               change.Append ("</span>");
-                               change.AnyChange = true;
-                               changes.Add (source, target, change);
-                       } else if (tgtObsolete == null) {
-                               // Made non-obsolete. Do we care to report this?
-                       } else {
-                               // Obsolete message changed. Do we care to report this?
-                       }
-               }
-
-               protected void RenderName (XElement source, XElement target, ApiChange change)
-               {
-                       var name = target.GetAttribute ("name");
-                       // show the constructor as it would be defined in C#
-                       name = name.Replace (".ctor", State.Type);
-
-                       var p = name.IndexOf ('(');
-                       if (p >= 0)
-                               name = name.Substring (0, p);
-
-                       change.Append (name);
-               }
-
-       }
-}
diff --git a/mcs/tools/corcompare/mono-api-html/MethodComparer.cs b/mcs/tools/corcompare/mono-api-html/MethodComparer.cs
deleted file mode 100644 (file)
index 4c893e7..0000000
+++ /dev/null
@@ -1,77 +0,0 @@
-// 
-// Authors
-//    Sebastien Pouliot  <sebastien@xamarin.com>
-//
-// Copyright 2013 Xamarin Inc. http://www.xamarin.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.Linq;
-using System.Reflection;
-using System.Xml.Linq;
-
-namespace Xamarin.ApiDiff {
-
-       public class MethodComparer : ConstructorComparer {
-
-               public override string GroupName {
-                       get { return "methods"; }
-               }
-
-               public override string ElementName {
-                       get { return "method"; }
-               }
-
-               // operators have identical names but vary by return types
-               public override bool Find (XElement e)
-               {
-                       if (e.GetAttribute ("name") != Source.GetAttribute ("name"))
-                               return false;
-
-                       if (e.GetAttribute ("returntype") != Source.GetAttribute ("returntype"))
-                               return false;
-
-                       var eGP = e.Element ("generic-parameters");
-                       var sGP = Source.Element ("generic-parameters");
-
-                       if (eGP == null && sGP == null)
-                               return true;
-                       else if (eGP == null ^ sGP == null)
-                               return false;
-                       else {
-                               var eGPs = eGP.Elements ("generic-parameter");
-                               var sGPs = sGP.Elements ("generic-parameter");
-                               return eGPs.Count () == sGPs.Count ();
-                       }
-               }
-
-               protected override bool IsBreakingRemoval (XElement e)
-               {
-                       // Removing virtual methods that override another method is not a breaking change.
-                       var is_override = e.Attribute ("is-override");
-                       if (is_override != null)
-                               return is_override.Value != "true";
-                       
-                       return true; // all other removals are breaking changes
-               }
-       }
-}
\ No newline at end of file
diff --git a/mcs/tools/corcompare/mono-api-html/NamespaceComparer.cs b/mcs/tools/corcompare/mono-api-html/NamespaceComparer.cs
deleted file mode 100644 (file)
index 063e34e..0000000
+++ /dev/null
@@ -1,104 +0,0 @@
-// 
-// Authors
-//    Sebastien Pouliot  <sebastien@xamarin.com>
-//
-// Copyright 2013 Xamarin Inc. http://www.xamarin.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.Collections.Generic;
-using System.IO;
-using System.Linq;
-using System.Xml.Linq;
-
-namespace Xamarin.ApiDiff {
-
-       public class NamespaceComparer : Comparer {
-
-               ClassComparer comparer;
-
-               public NamespaceComparer ()
-               {
-                       comparer =  new ClassComparer ();
-               }
-
-               public void Compare (XElement source, XElement target)
-               {
-                       var s = source.Element ("namespaces");
-                       var t = target.Element ("namespaces");
-                       if (XNode.DeepEquals (s, t))
-                               return;
-                       Compare (s.Elements ("namespace"), t.Elements ("namespace"));
-               }
-
-               public override void SetContext (XElement current)
-               {
-                       State.Namespace = current.Attribute ("name").Value;
-               }
-
-               public override void Added (XElement target, bool wasParentAdded)
-               {
-                       string name = target.Attribute ("name").Value;
-                       if (State.IgnoreNew.Any (re => re.IsMatch (name)))
-                               return;
-
-                       Output.WriteLine ("<!-- start namespace {0} --> <div> ", name);
-                       Output.WriteLine ("<h2>New Namespace {0}</h2>", name);
-                       Output.WriteLine ();
-                       // list all new types
-                       foreach (var addedType in target.Element ("classes").Elements ("class"))
-                               comparer.Added (addedType, true);
-                       Output.WriteLine ("</div> <!-- end namespace {0} -->", name);
-                       Output.WriteLine ();
-               }
-
-               public override void Modified (XElement source, XElement target, ApiChanges differences)
-               {
-                       var output = Output;
-                       State.Output = new StringWriter ();
-                       comparer.Compare (source, target);
-
-                       var s = Output.ToString ();
-                       State.Output = output;
-                       if (s.Length > 0) {
-                               var name = target.Attribute ("name").Value;
-                               Output.WriteLine ("<!-- start namespace {0} --> <div> ", name);
-                               Output.WriteLine ("<h2>Namespace {0}</h2>", name);
-                               Output.WriteLine (s);
-                               Output.WriteLine ("</div> <!-- end namespace {0} -->", name);
-                       }
-               }
-
-               public override void Removed (XElement source)
-               {
-                       var name = source.Attribute ("name").Value;
-                       Output.WriteLine ("<!-- start namespace {0} --> <div>", name);
-                       Output.WriteLine ("<h2>Removed Namespace {0}</h2>", name);
-                       Output.WriteLine ();
-                       // list all removed types
-                       foreach (var removedType in source.Element ("classes").Elements ("class"))
-                               comparer.Removed (removedType);
-                       Output.WriteLine ("</div> <!-- end namespace {0} -->", name);
-                       Output.WriteLine ();
-               }
-       }
-}
\ No newline at end of file
diff --git a/mcs/tools/corcompare/mono-api-html/PropertyComparer.cs b/mcs/tools/corcompare/mono-api-html/PropertyComparer.cs
deleted file mode 100644 (file)
index f51dd23..0000000
+++ /dev/null
@@ -1,254 +0,0 @@
-// 
-// Authors
-//    Sebastien Pouliot  <sebastien@xamarin.com>
-//
-// Copyright 2013 Xamarin Inc. http://www.xamarin.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.Collections.Generic;
-using System.Reflection;
-using System.Text;
-using System.Xml.Linq;
-
-namespace Xamarin.ApiDiff {
-
-       public class PropertyComparer : MemberComparer {
-
-               public override string GroupName {
-                       get { return "properties"; }
-               }
-
-               public override string ElementName {
-                       get { return "property"; }
-               }
-
-               public override bool Find (XElement e)
-               {
-                       if (!base.Find (e))
-                               return false;
-                       // the same Item (indexer) property can have different parameters
-                       return e.GetAttribute ("params") == Source.GetAttribute ("params");
-               }
-
-               void GetAccessors (XElement element, out XElement getter, out XElement setter)
-               {
-                       var methods = element.Element ("methods");
-
-                       getter = null;
-                       setter = null;
-
-                       if (methods == null)
-                               return;
-                               
-                       foreach (var m in methods.Elements ("method")) {
-                               var n = m.GetAttribute ("name");
-                               if (n.StartsWith ("get_", StringComparison.Ordinal)) {
-                                       getter = m;
-                               } else if (n.StartsWith ("set_", StringComparison.Ordinal)) {
-                                       setter = m;
-                               }
-                       }
-               }
-
-               MethodAttributes GetMethodAttributes (XElement getter, XElement setter)
-               {
-                       if (getter == null)
-                               return setter.GetMethodAttributes ();
-                       else if (setter == null)
-                               return getter.GetMethodAttributes ();
-
-                       var gAttr = getter.GetMethodAttributes ();
-                       var sAttr = setter.GetMethodAttributes ();
-                       var g = gAttr & MethodAttributes.MemberAccessMask;
-                       var s = sAttr & MethodAttributes.MemberAccessMask;
-                       // Visibility is ordered numerically (higher value = more visible).
-                       // We want the most visible.
-                       var visibility = (MethodAttributes) Math.Max ((int) g, (int) s);
-                       // Do a bitwise or with the rest of the flags
-                       var g_no_visibility = gAttr & ~MethodAttributes.MemberAccessMask;
-                       var s_no_visibility = sAttr & ~MethodAttributes.MemberAccessMask;
-                       return g_no_visibility | s_no_visibility | visibility;
-               }
-
-               void RenderPropertyType (XElement source, XElement target, ApiChange change)
-               {
-                       var srcType = source.GetTypeName ("ptype");
-                       var tgtType = target.GetTypeName ("ptype");
-
-                       if (srcType == tgtType) {
-                               change.Append (tgtType);
-                       } else {
-                               change.AppendModified (srcType, tgtType, true);
-                       }
-                       change.Append (" ");
-               }
-
-               void RenderAccessors (XElement srcGetter, XElement tgtGetter, XElement srcSetter, XElement tgtSetter, ApiChange change)
-               {
-                       // FIXME: this doesn't render changes in the accessor visibility (a protected setter can become public for instance).
-                       change.Append (" {");
-                       if (tgtGetter != null) {
-                               if (srcGetter != null) {
-                                       change.Append (" ").Append ("get;");
-                               } else {
-                                       change.Append (" ").AppendAdded ("get;");
-                               }
-                       } else if (srcGetter != null) {
-                               change.Append (" ").AppendRemoved ("get;");
-                       }
-
-                       if (tgtSetter != null) {
-                               if (srcSetter != null) {
-                                       change.Append (" ").Append ("set;");
-                               } else {
-                                       change.Append (" ").AppendAdded ("set;");
-                               }
-                       } else if (srcSetter != null) {
-                               change.Append (" ").AppendRemoved ("set;");
-                       }
-
-                       change.Append (" }");
-
-                       // Ignore added property setters if asked to
-                       if (srcSetter == null && tgtSetter != null && State.IgnoreAddedPropertySetters && !change.Breaking) {
-                               change.AnyChange = false;
-                               change.HasIgnoredChanges = true;
-                       }
-               }
-
-               void RenderIndexers (List<XElement> srcIndexers, List<XElement> tgtIndexers, ApiChange change)
-               {
-                       change.Append ("this [");
-                       for (int i = 0; i < srcIndexers.Count; i++) {
-                               var source = srcIndexers [i];
-                               var target = tgtIndexers [i];
-
-                               if (i > 0)
-                                       change.Append (", ");
-
-                               var srcType = source.GetTypeName ("type");
-                               var tgtType = target.GetTypeName ("type");
-                               if (srcType == tgtType) {
-                                       change.Append (tgtType);
-                               } else {
-                                       change.AppendModified (srcType, tgtType, true);
-                               }
-                               change.Append (" ");
-
-                               var srcName = source.GetAttribute ("name");
-                               var tgtName = target.GetAttribute ("name");
-                               if (srcName == tgtName) {
-                                       change.Append (tgtName);
-                               } else {
-                                       change.AppendModified (srcName, tgtName, true);
-                               }
-                       }
-                       change.Append ("]");
-               }
-
-               public override bool Equals (XElement source, XElement target, ApiChanges changes)
-               {
-                       if (base.Equals (source, target, changes))
-                               return true;
-
-                       XElement srcGetter, srcSetter;
-                       XElement tgtGetter, tgtSetter;
-                       GetAccessors (source, out srcGetter, out srcSetter);
-                       GetAccessors (target, out tgtGetter, out tgtSetter);
-
-                       List<XElement> srcIndexers = null;
-                       List<XElement> tgtIndexers = null;
-                       bool isIndexer = false;
-                       if (srcGetter != null) {
-                               srcIndexers = srcGetter.DescendantList ("parameters", "parameter");
-                               tgtIndexers = tgtGetter.DescendantList ("parameters", "parameter");
-                               isIndexer = srcIndexers != null && srcIndexers.Count > 0;
-                       }
-
-                       var change = new ApiChange ();
-                       change.Header = "Modified " + GroupName;
-                       RenderMethodAttributes (GetMethodAttributes (srcGetter, srcSetter), GetMethodAttributes (tgtGetter, tgtSetter), change);
-                       RenderPropertyType (source, target, change);
-                       if (isIndexer) {
-                               RenderIndexers (srcIndexers, tgtIndexers, change);
-                       } else {
-                               RenderName (source, target, change);
-                       }
-                       RenderGenericParameters (source, target, change);
-                       RenderAccessors (srcGetter, tgtGetter, srcSetter, tgtSetter, change);
-
-                       changes.Add (source, target, change);
-
-                       return false;
-               }
-
-               void GetProperties (XElement e, out bool @virtual, out bool @override, out bool @static, out bool getter, out bool setter, out bool family)
-               {
-                       @virtual = @override = @static = getter = setter = family = false;
-
-                       var methods = e.Element ("methods");
-                       if (methods != null) {
-                               foreach (var m in methods.Elements ("method")) {
-                                       @virtual |= m.IsTrue ("virtual");
-                                       @static |= m.IsTrue ("static");
-                                       var n = m.GetAttribute ("name");
-                                       getter |= n.StartsWith ("get_", StringComparison.Ordinal);
-                                       setter |= n.StartsWith ("set_", StringComparison.Ordinal);
-                                       var attribs = (MethodAttributes) Int32.Parse (m.GetAttribute ("attrib"));
-                                       family = ((attribs & MethodAttributes.Public) != MethodAttributes.Public);
-                                       @override |= (attribs & MethodAttributes.NewSlot) == 0;
-                               }
-                       }
-               }
-
-               public override string GetDescription (XElement e)
-               {
-                       string name = e.Attribute ("name").Value;
-                       string ptype = e.GetTypeName ("ptype");
-
-                       bool virt = false;
-                       bool over = false;
-                       bool stat = false;
-                       bool getter = false;
-                       bool setter = false;
-                       bool family = false;
-                       GetProperties (e, out virt, out over, out stat, out getter, out setter, out family);
-
-                       var sb = new StringBuilder ();
-
-                       sb.Append (family ? "protected " : "public ");
-                       if (virt && !State.IgnoreVirtualChanges)
-                               sb.Append (over ? "override " : "virtual ");
-                       else if (stat)
-                               sb.Append ("static ");
-                       sb.Append (ptype).Append (' ').Append (name).Append (" { ");
-                       if (getter)
-                               sb.Append ("get; ");
-                       if (setter)
-                               sb.Append ("set; ");
-                       sb.Append ("}");
-
-                       return sb.ToString ();
-               }
-       }
-}
\ No newline at end of file
diff --git a/mcs/tools/corcompare/mono-api-html/mono-api-html.csproj b/mcs/tools/corcompare/mono-api-html/mono-api-html.csproj
deleted file mode 100644 (file)
index 6ac0f24..0000000
+++ /dev/null
@@ -1,57 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
-  <PropertyGroup>
-    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
-    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
-    <ProductVersion>8.0.30703</ProductVersion>
-    <SchemaVersion>2.0</SchemaVersion>
-    <ProjectGuid>{D25986E2-7A41-4966-A26D-5614BAC7B8A7}</ProjectGuid>
-    <OutputType>Exe</OutputType>
-    <RootNamespace>Xamarin.ApiDiff</RootNamespace>
-    <AssemblyName>mono-api-html</AssemblyName>
-  </PropertyGroup>
-  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
-    <DebugSymbols>true</DebugSymbols>
-    <DebugType>full</DebugType>
-    <Optimize>false</Optimize>
-    <OutputPath>bin\Debug</OutputPath>
-    <DefineConstants>DEBUG;</DefineConstants>
-    <ErrorReport>prompt</ErrorReport>
-    <WarningLevel>4</WarningLevel>
-    <ConsolePause>false</ConsolePause>
-  </PropertyGroup>
-  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
-    <DebugType>full</DebugType>
-    <Optimize>true</Optimize>
-    <OutputPath>bin\Release</OutputPath>
-    <ErrorReport>prompt</ErrorReport>
-    <WarningLevel>4</WarningLevel>
-    <Externalconsole>true</Externalconsole>
-  </PropertyGroup>
-  <ItemGroup>
-    <Reference Include="System" />
-    <Reference Include="System.Xml.Linq" />
-    <Reference Include="System.Xml" />
-    <Reference Include="System.Core" />
-  </ItemGroup>
-  <ItemGroup>
-    <Compile Include="Helpers.cs" />
-    <Compile Include="InterfaceComparer.cs" />
-    <Compile Include="NamespaceComparer.cs" />
-    <Compile Include="MemberComparer.cs" />
-    <Compile Include="FieldComparer.cs" />
-    <Compile Include="PropertyComparer.cs" />
-    <Compile Include="EventComparer.cs" />
-    <Compile Include="MethodComparer.cs" />
-    <Compile Include="ConstructorComparer.cs" />
-    <Compile Include="Comparer.cs" />
-    <Compile Include="AssemblyComparer.cs" />
-    <Compile Include="ClassComparer.cs" />
-    <Compile Include="ApiDiff.cs" />
-    <Compile Include="..\..\..\class\Mono.Options\Mono.Options\Options.cs">
-      <Link>Options.cs</Link>
-    </Compile>
-    <Compile Include="ApiChange.cs" />
-  </ItemGroup>
-  <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
-</Project>
diff --git a/mcs/tools/corcompare/mono-api-info.exe.sources b/mcs/tools/corcompare/mono-api-info.exe.sources
new file mode 100644 (file)
index 0000000..9ae6cd0
--- /dev/null
@@ -0,0 +1,5 @@
+AssemblyResolver.cs
+Util.cs
+WellFormedXmlWriter.cs
+mono-api-info.cs
+../../class/Mono.Options/Mono.Options/Options.cs
index 7a03be5761c6aadb0b99e9f4e2711e2d8bc4d919..1c3a80355eeddb2acf1b3c69ad375dc43d830219 100644 (file)
@@ -6,7 +6,8 @@ include ../../build/rules.make
 
 // 3021: CLS attribute not needed since assembly is not CLS compliant
 NOWARNS = -nowarn:3021
-LOCAL_MCS_FLAGS = -r:$(topdir)/class/lib/$(PROFILE)/Mono.CSharp.dll -r:$(topdir)/class/lib/$(PROFILE)/Mono.Posix.dll -r:Mono.Management.dll -r:System.dll -unsafe $(NOWARNS)
+LOCAL_MCS_FLAGS = -unsafe $(NOWARNS)
+LIB_REFS = Mono.CSharp Mono.Posix Mono.Management System 
 
 PROGRAM = csharp.exe
 
index cfc68da231092773d7d28b5b1f70db7f1d977266..c186b8e74a2a58b5d3fa99ad212257135ea682b2 100644 (file)
@@ -2,7 +2,7 @@ thisdir = tools/culevel
 SUBDIRS = 
 include ../../build/rules.make
 
-LOCAL_MCS_FLAGS = -r:System.dll -r:System.Xml.dll
+LIB_REFS = System System.Xml
 PROGRAM = culevel.exe
 
 CLEAN_FILES = culevel.exe culevel.exe.mdb
index 12869f51ecffda24935dcdf5f4e3b5c3864e982a..77721fa1df1151e137011b04e547c2d3c056e696 100644 (file)
@@ -2,7 +2,8 @@ thisdir = tools/disco
 SUBDIRS = 
 include ../../build/rules.make
 
-LOCAL_MCS_FLAGS = -r:System.Xml.dll -r:System.Web.Services.dll -r:System.dll
+LOCAL_MCS_FLAGS =
+LIB_REFS = System.Xml System.Web.Services System
 PROGRAM = disco.exe
 
 include ../../build/executable.make
index 48e0059409c292f10f66beaf1f49b043c599b799..14f8c2906b980e0defecd1b062d16fd2c74ec58b 100644 (file)
@@ -2,7 +2,8 @@ thisdir = tools/dtd2rng
 SUBDIRS = 
 include ../../build/rules.make
 
-LOCAL_MCS_FLAGS = -r:System.Xml.dll -r:Commons.Xml.Relaxng.dll
+LOCAL_MCS_FLAGS =
+LIB_REFS = System.Xml Commons.Xml.Relaxng
 PROGRAM = dtd2rng.exe
 
 include ../../build/executable.make
index 80431266b27582058736a48796b23a9f4332305d..fa500c8c679cd0e18ec0a47f30d322e1079e415b 100755 (executable)
@@ -2,7 +2,8 @@ thisdir = tools/dtd2xsd
 SUBDIRS = 
 include ../../build/rules.make
 
-LOCAL_MCS_FLAGS = -r:System.Xml.dll
+LOCAL_MCS_FLAGS =
+LIB_REFS = System.Xml
 PROGRAM = dtd2xsd.exe
 
 include ../../build/executable.make
index 878830f124886cd0723c47115b443a2f065003ac..f98314ecec7afb9db0957bb70edde80431c647b9 100644 (file)
@@ -2,7 +2,8 @@ thisdir = tools/gacutil
 SUBDIRS = 
 include ../../build/rules.make
 
-LOCAL_MCS_FLAGS = -r:Mono.Security.dll -unsafe
+LIB_REFS = Mono.Security
+LOCAL_MCS_FLAGS = -unsafe
 
 PROGRAM = gacutil.exe
 
index 21b38e8fd3c77839f1e7c09c22d5c1d03757b527..71819a2eb5248b1cdff27957f75b0c2ef0d346f8 100644 (file)
@@ -2,7 +2,8 @@ thisdir = tools/genxs
 SUBDIRS = 
 include ../../build/rules.make
 
-LOCAL_MCS_FLAGS = -r:System.Xml.dll
+LOCAL_MCS_FLAGS =
+LIB_REFS = System.Xml
 PROGRAM = genxs.exe
 
 include ../../build/executable.make
index 13ffb114c20ae90ec83b3f38f68a7ca1c182916f..f34409878c3704c9ca6d76d1d195ce409847362b 100644 (file)
@@ -2,7 +2,8 @@ thisdir = tools/ictool
 SUBDIRS =
 include ../../build/rules.make
 
-LOCAL_MCS_FLAGS = -r:System.Xml.dll
+LOCAL_MCS_FLAGS =
+LIB_REFS = System.Xml
 
 PROGRAM = ictool.exe
 EXTRA_DISTFILES = ictool-config.xml
index 6a6cb6fb544db6637da27823b0190bfdd1174d7e..1d0a78c83e06d3a62586fed60fa271de9adf34d0 100644 (file)
@@ -3,9 +3,9 @@ SUBDIRS =
 include ../../build/rules.make
 
 PROGRAM = ikdasm.exe
-
+LIB_REFS = System System.Core System.Security
 LOCAL_MCS_FLAGS = \
-       -d:NO_SYMBOL_WRITER /r:System.Security.dll /r:System.Core.dll /r:System.dll
+       -d:NO_SYMBOL_WRITER
 
 #EXTRA_DISTFILES = LICENSE
 
index c545a4630eb709aff273ca3c64311e0385af1189..e7f4401169feaa1252c91b4660b67879989fb673 100644 (file)
@@ -2,7 +2,8 @@ thisdir = tools/installutil
 SUBDIRS = 
 include ../../build/rules.make
 
-LOCAL_MCS_FLAGS = -r:System.Configuration.Install.dll -r:System.dll
+LOCAL_MCS_FLAGS =
+LIB_REFS = System.Configuration.Install System
 
 PROGRAM = installutil.exe
 
index a5479c948ddc4bf6dc16582d74cdcf551970de08..3ba67fe0d8fd4f202d654b2efc5cd6c114e2a268 100644 (file)
@@ -2,7 +2,8 @@ thisdir = tools/installvst
 SUBDIRS = 
 include ../../build/rules.make
 
-LOCAL_MCS_FLAGS = -r:System.Xml.dll
+LOCAL_MCS_FLAGS =
+LIB_REFS = System.Xml
 PROGRAM = installvst.exe
 
 include ../../build/executable.make
index d77c8ab6f73644033b12e156f2e7b0e1beadcf8c..905a75a488aa6ea5827e7a3cbb7d8892170ad8e3 100644 (file)
@@ -2,7 +2,8 @@ thisdir = tools/lc
 SUBDIRS = 
 include ../../build/rules.make
 
-LOCAL_MCS_FLAGS = -r:System.dll -r:System.Core.dll
+LOCAL_MCS_FLAGS =
+LIB_REFS = System System.Core
 PROGRAM = lc.exe
 
 CLEAN_FILES = lc.exe lc.exe.mdb
index e68e7f6c39bd676345c56b3c8145120648aaf3ae..08a3fdc093a7dbcd9725f02eb1ace282edf12dfe 100644 (file)
@@ -4,6 +4,7 @@ include ../../build/rules.make
 
 PROGRAM = linkeranalyzer.exe
 
-LOCAL_MCS_FLAGS = /r:System.dll /r:System.Xml.dll
+LIB_REFS = System System.Xml
+LOCAL_MCS_FLAGS =
 
 include ../../build/executable.make
index 63c5eb6adce769bff8c1b9107149ad02576bd708..3dd8398d2bcfad2456c4cf303d6cc2cd34666bf0 100644 (file)
@@ -2,10 +2,6 @@ thisdir = tools/linker
 SUBDIRS =
 include ../../build/rules.make
 
-PROGRAM_SNK = ../../class/mono.snk
-
-CECIL = $(topdir)/class/lib/$(PROFILE)/Mono.Cecil.dll
-
 RESOURCES = \
        Descriptors/mscorlib.xml        \
        Descriptors/System.xml          \
@@ -18,7 +14,8 @@ PROGRAM = monolinker.exe
 
 $(PROGRAM): $(RESOURCES)
 
-LOCAL_MCS_FLAGS = /r:$(CECIL) /r:System.Xml.dll /r:System.Core.dll /r:System.dll $(RESOURCES:%=-resource:%)
+LIB_REFS = System System.Core System.Xml Mono.Cecil
+LOCAL_MCS_FLAGS = $(RESOURCES:%=-resource:%)
 
 EXTRA_DISTFILES = $(RESOURCES)
 
index f7f8721adc130c0e0e46f926ff74fe2bb3cabe26..92fc95c91f12e5a9cb6264dbda65c233aba2ab30 100644 (file)
@@ -2,7 +2,8 @@ thisdir = tools/mconfig
 SUBDIRS = 
 include ../../build/rules.make
 
-LOCAL_MCS_FLAGS = -r:System.Xml.dll -r:System.dll
+LOCAL_MCS_FLAGS =
+LIB_REFS = System.Xml System
 PROGRAM = mconfig.exe
 
 BUILT_SOURCES=Mono.MonoConfig/consts.cs
index 9647a44d52fdf3bc1b86f45a9b1feeba9cdf0d36..55d4012a13a2e633cd475f6e91b7e340d55b83bb 100644 (file)
@@ -4,9 +4,7 @@ include ../../build/rules.make
 
 PROGRAM = mdbdump.exe
 
-LOCAL_MCS_FLAGS = \
-       /r:System.Xml.dll \
-       /r:Mono.Cecil.dll       \
-       /r:Mono.CompilerServices.SymbolWriter.dll
+LIB_REFS = Mono.Cecil System.Xml Mono.CompilerServices.SymbolWriter
+LOCAL_MCS_FLAGS =
 
 include ../../build/executable.make
index e0432ef90a798ad6d610903a14bba6d56bc06958..e0f6fe81956c8d31dcc2fda6fd1dabbec4db5658 100644 (file)
@@ -4,7 +4,7 @@ include ../../build/rules.make
 
 PROGRAM = mdbrebase.exe
 
-LOCAL_MCS_FLAGS = /r:Mono.CompilerServices.SymbolWriter.dll /r:System.dll
-
+LIB_REFS = System Mono.CompilerServices.SymbolWriter
+LOCAL_MCS_FLAGS =
 
 include ../../build/executable.make
index 3fb309b227320e5b6d26830d56d7e35143adf14c..efb76cbf9e0dea90c21deeae424c932d5d57c504 100644 (file)
@@ -12,16 +12,10 @@ MDOC_COMMON_FLAGS = \
        /resource:Resources/msitomsx.xsl,msitomsx.xsl                               \
        /resource:Resources/overview.xsl,overview.xsl                               \
        /resource:Resources/stylesheet.xsl,stylesheet.xsl                           \
-       /r:System.Web.dll                                                           \
-       /r:System.Xml.Linq.dll                                                      \
-       /r:ICSharpCode.SharpZipLib.dll                                              \
-       /r:Mono.Cecil.dll \
-       /r:System.dll \
-       /r:System.Xml.dll \
-       /r:System.Core.dll
-
-LOCAL_MCS_FLAGS = $(MDOC_COMMON_FLAGS) \
-       /r:monodoc.dll
+
+LIB_REFS = monodoc System System.Xml System.Core Mono.Cecil ICSharpCode.SharpZipLib System.Xml.Linq System.Web
+       
+LOCAL_MCS_FLAGS = $(MDOC_COMMON_FLAGS)
 PROGRAM = mdoc.exe
 PROGRAM_DEPS = $(topdir)/class/lib/$(PROFILE)/monodoc.dll
 
@@ -98,51 +92,51 @@ cleanup:
        -rm -f monodocer1.exe*
 
 Test/DocTest-addNonGeneric.dll:
-       $(CSCOMPILE) $(TEST_CSCFLAGS) -debug -unsafe -target:library -out:$@ Test/DocTest-addNonGeneric.cs
+       $(CSCOMPILE) $(TEST_CSCFLAGS) -unsafe -target:library -out:$@ Test/DocTest-addNonGeneric.cs
 
 Test/DocTest-addNonGeneric-v2.dll:
-       $(CSCOMPILE) $(TEST_CSCFLAGS) -debug -unsafe -target:library -out:$@ Test/DocTest-addNonGeneric.cs /define:V2
+       $(CSCOMPILE) $(TEST_CSCFLAGS) -unsafe -target:library -out:$@ Test/DocTest-addNonGeneric.cs /define:V2
 
 Test/DocTest-DropNS-classic-secondary.dll:
        @echo $(value @)
-       $(CSCOMPILE) $(TEST_CSCFLAGS) -debug -unsafe -target:library -out:$@ Test/DocTest-DropNS-classic-secondary.cs
+       $(CSCOMPILE) $(TEST_CSCFLAGS) -unsafe -target:library -out:$@ Test/DocTest-DropNS-classic-secondary.cs
 
 Test/DocTest-DropNS-classic.dll:
        @echo $(value @)
-       $(CSCOMPILE) $(TEST_CSCFLAGS) -debug -unsafe -target:library -out:$@ Test/DocTest-DropNS-classic.cs
+       $(CSCOMPILE) $(TEST_CSCFLAGS) -unsafe -target:library -out:$@ Test/DocTest-DropNS-classic.cs
 
 Test/DocTest-DropNS-unified.dll:
-       $(CSCOMPILE) $(TEST_CSCFLAGS) -debug -unsafe -target:library -out:$@ Test/DocTest-DropNS-unified.cs
+       $(CSCOMPILE) $(TEST_CSCFLAGS) -unsafe -target:library -out:$@ Test/DocTest-DropNS-unified.cs
 
 Test/DocTest-DropNS-unified-multitest.dll:
        rm -f $@
-       $(CSCOMPILE) $(TEST_CSCFLAGS) -debug -unsafe -target:library -out:$@ Test/DocTest-DropNS-unified.cs /define:MULTITEST
+       $(CSCOMPILE) $(TEST_CSCFLAGS) -unsafe -target:library -out:$@ Test/DocTest-DropNS-unified.cs /define:MULTITEST
 
 Test/DocTest-DropNS-classic-multitest.dll:
        rm -f $@
-       $(CSCOMPILE) $(TEST_CSCFLAGS) -debug -unsafe -target:library -out:$@ Test/DocTest-DropNS-classic.cs /define:MULTITEST
+       $(CSCOMPILE) $(TEST_CSCFLAGS) -unsafe -target:library -out:$@ Test/DocTest-DropNS-classic.cs /define:MULTITEST
 
 Test/DocTest-DropNS-unified-deletetest.dll:
        rm -f Test/DocTest-DropNS-unified-deletetest.dll
-       $(CSCOMPILE) $(TEST_CSCFLAGS) -debug -unsafe -target:library -out:$@ Test/DocTest-DropNS-unified.cs /define:DELETETEST
+       $(CSCOMPILE) $(TEST_CSCFLAGS) -unsafe -target:library -out:$@ Test/DocTest-DropNS-unified.cs /define:DELETETEST
 
 Test/DocTest-DropNS-unified-deletetest-V2.dll:
        rm -f Test/DocTest-DropNS-unified-deletetest.dll
-       $(CSCOMPILE) $(TEST_CSCFLAGS) -debug -unsafe -target:library -out:Test/DocTest-DropNS-unified-deletetest.dll Test/DocTest-DropNS-unified.cs /define:DELETETEST,V2
+       $(CSCOMPILE) $(TEST_CSCFLAGS) -unsafe -target:library -out:Test/DocTest-DropNS-unified-deletetest.dll Test/DocTest-DropNS-unified.cs /define:DELETETEST,V2
 
 Test/DocTest-DropNS-classic-deletetest.dll:
        rm -f Test/DocTest-DropNS-classic-deletetest.dll
-       $(CSCOMPILE) $(TEST_CSCFLAGS) -debug -unsafe -target:library -out:$@ Test/DocTest-DropNS-classic.cs /define:DELETETEST
+       $(CSCOMPILE) $(TEST_CSCFLAGS) -unsafe -target:library -out:$@ Test/DocTest-DropNS-classic.cs /define:DELETETEST
 
 Test/DocTest-DropNS-classic-deletetest-V2.dll:
        rm -f Test/DocTest-DropNS-classic-deletetest.dll
-       $(CSCOMPILE) $(TEST_CSCFLAGS) -debug -unsafe -target:library -out:Test/DocTest-DropNS-classic-deletetest.dll Test/DocTest-DropNS-classic.cs /define:DELETETEST,V2
+       $(CSCOMPILE) $(TEST_CSCFLAGS) -unsafe -target:library -out:Test/DocTest-DropNS-classic-deletetest.dll Test/DocTest-DropNS-classic.cs /define:DELETETEST,V2
 
 Test/DocTest.dll: 
-       $(CSCOMPILE) $(TEST_CSCFLAGS) -debug -unsafe -target:library -out:$@ Test/DocTest.cs
+       $(CSCOMPILE) $(TEST_CSCFLAGS) -unsafe -target:library -out:$@ Test/DocTest.cs -r:$(topdir)/class/lib/$(PROFILE)/System.Core.dll -r:$(topdir)/class/lib/$(PROFILE)/Microsoft.CSharp.dll
 
 Test/DocTest-InternalInterface.dll: 
-       $(CSCOMPILE) $(TEST_CSCFLAGS) -debug -unsafe -target:library -out:$@ Test/DocTest-InternalInterface.cs
+       $(CSCOMPILE) $(TEST_CSCFLAGS) -unsafe -target:library -out:$@ Test/DocTest-InternalInterface.cs
 
 Test/DocTest.dll-v1: 
        -rm -f Test/DocTest.cs
@@ -158,7 +152,7 @@ Test/DocTest.dll-v2:
        $(MAKE) TEST_CSCFLAGS=$(TEST_CSCFLAGS) Test/DocTest.dll
 
 Test/DocTest-enumerations.dll: 
-       $(CSCOMPILE) $(TEST_CSCFLAGS) -debug -unsafe -target:library -out:$@ Test/DocTest-enumerations.cs
+       $(CSCOMPILE) $(TEST_CSCFLAGS) -unsafe -target:library -out:$@ Test/DocTest-enumerations.cs
 
 check-monodocer-addNonGeneric: $(PROGRAM)
        -rm -Rf Test/en.actual
index 44620aacd1fef6eedb2d430e917e391cbb334099..867c1d3e2df0fd3c833b427f1927b62103831449 100644 (file)
@@ -10,7 +10,8 @@ RESOURCE_FILES = $(OTHER_RES)
 
 LOCAL_MCS_FLAGS= $(OTHER_RES:%=-resource:%)
 
-LOCAL_MCS_FLAGS += -d:STATIC,NO_SYMBOL_WRITER,NO_AUTHENTICODE -r:System.Xml.dll -r:System.dll
+LOCAL_MCS_FLAGS += -d:STATIC,NO_SYMBOL_WRITER,NO_AUTHENTICODE
+LIB_REFS = System.Xml System
 
 EXTRA_DISTFILES = $(RESOURCE_FILES)
 
index 90c9afcb026b42f8208b7e4bc4ea6ce7bf61fff9..35133d61dbe817bc079816a88ef6337606ef4385 100644 (file)
@@ -2,7 +2,8 @@ thisdir = tools/mod
 SUBDIRS = 
 include ../../build/rules.make
 
-LOCAL_MCS_FLAGS = /r:monodoc.dll
+LIB_REFS = monodoc
+LOCAL_MCS_FLAGS =
 
 PROGRAM = mod.exe
 
diff --git a/mcs/tools/mono-api-html/ApiChange.cs b/mcs/tools/mono-api-html/ApiChange.cs
new file mode 100644 (file)
index 0000000..1d902ca
--- /dev/null
@@ -0,0 +1,81 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+using System.Xml.Linq;
+
+namespace Xamarin.ApiDiff
+{
+       public class ApiChange
+       {
+               public string Header;
+               public StringBuilder Member = new StringBuilder ();
+               public bool Breaking;
+               public bool AnyChange;
+               public bool HasIgnoredChanges;
+
+               public ApiChange Append (string text)
+               {
+                       Member.Append (text);
+                       return this;
+               }
+
+               public ApiChange AppendAdded (string text, bool breaking = false)
+               {
+                       Member.Append ("<span class='added ").Append (breaking ? "added-breaking-inline" : string.Empty).Append ("'>");
+                       Member.Append (text);
+                       Member.Append ("</span>");
+                       Breaking |= breaking;
+                       AnyChange = true;
+                       return this;
+               }
+
+               public ApiChange AppendRemoved (string text, bool breaking = true)
+               {
+                       Member.Append ("<span class='removed removed-inline ").Append (breaking ? "removed-breaking-inline" : string.Empty).Append ("'>");
+                       Member.Append (text);
+                       Member.Append ("</span>");
+                       Breaking |= breaking;
+                       AnyChange = true;
+                       return this;
+               }
+
+               public ApiChange AppendModified (string old, string @new, bool breaking = true)
+               {
+                       if (old.Length > 0)
+                               AppendRemoved (old, breaking);
+                       if (old.Length > 0 && @new.Length > 0)
+                               Append (" ");
+                       if (@new.Length > 0)
+                               AppendAdded (@new);
+                       Breaking |= breaking;
+                       AnyChange = true;
+                       return this;
+               }
+       }
+
+       public class ApiChanges : Dictionary<string, List<ApiChange>> {
+               public void Add (XElement source, XElement target, ApiChange change)
+               {
+                       if (!change.AnyChange) {
+                               // This is most likely because the rendering doesn't take into account something that's different (solution: fix rendering).
+                               if (!change.HasIgnoredChanges) {
+                                       var isField = source.Name.LocalName == "field";
+                                       if (isField) {
+                                               Console.WriteLine ("Comparison resulting in no changes (src: {2} dst: {3}) :\n{0}\n{1}\n\n", source.ToString (), target.ToString (), source.GetFieldAttributes (), target.GetFieldAttributes ());
+                                       } else {
+                                               Console.WriteLine ("Comparison resulting in no changes (src: {2} dst: {3}) :\n{0}\n{1}\n\n", source.ToString (), target.ToString (), source.GetMethodAttributes (), target.GetMethodAttributes ());
+                                       }
+                               }
+                               return;
+                       }
+
+                       List<ApiChange> list;
+                       if (!TryGetValue (change.Header, out list)) {
+                               list = new List<ApiChange> ();
+                               base.Add (change.Header, list);
+                       }
+                       list.Add (change);
+               }
+       }
+}
+
diff --git a/mcs/tools/mono-api-html/ApiDiff.cs b/mcs/tools/mono-api-html/ApiDiff.cs
new file mode 100644 (file)
index 0000000..8fe2784
--- /dev/null
@@ -0,0 +1,277 @@
+//
+// The main differences with mono-api-diff are:
+// * this tool directly produce HTML similar to gdiff.sh used for Xamarin.iOS
+// * this tool reports changes in an "evolutionary" way, not in a breaking way,
+//   i.e. it does not assume the source assembly is right (but simply older)
+// * the diff .xml output was not easy to convert back into the HTML format
+//   that gdiff.sh produced
+// 
+// Authors
+//    Sebastien Pouliot  <sebastien@xamarin.com>
+//
+// Copyright 2013-2014 Xamarin Inc. http://www.xamarin.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.IO;
+using System.Collections.Generic;
+using System.Text.RegularExpressions;
+
+using Mono.Options;
+
+namespace Xamarin.ApiDiff {
+
+       public static class State {
+               static TextWriter output;
+
+               public static TextWriter Output { 
+                       get {
+                               if (output == null)
+                                       output = Console.Out;
+                               return output;
+                       }
+                       set { output = value; } 
+               }
+
+               public static string Assembly { get; set; }
+               public static string Namespace { get; set; }
+               public static string Type { get; set; }
+               public static string BaseType { get; set; }
+
+               public static int Indent { get; set; }
+
+               static List<Regex> ignoreAdded = new List<Regex> ();
+               public static List<Regex> IgnoreAdded {
+                       get { return ignoreAdded; }
+               }
+
+               static List<Regex> ignoreNew = new List<Regex> ();
+               public static List<Regex> IgnoreNew {
+                       get { return ignoreNew; }
+               }
+
+               static List<Regex> ignoreRemoved = new List<Regex> ();
+               public static List<Regex> IgnoreRemoved {
+                       get { return ignoreRemoved; }
+               }
+
+               public  static  bool    IgnoreParameterNameChanges  { get; set; }
+               public  static  bool    IgnoreVirtualChanges        { get; set; }
+               public  static  bool    IgnoreAddedPropertySetters  { get; set; }
+
+               public static bool Lax;
+               public static bool Colorize = true;
+       }
+
+       class Program {
+
+               public static int Main (string[] args)
+               {
+                       var showHelp = false;
+                       string diff = null;
+                       List<string> extra = null;
+
+                       var options = new OptionSet {
+                               { "h|help", "Show this help", v => showHelp = true },
+                               { "d|diff=", "HTML diff file out output (omit for stdout)", v => diff = v },
+                               { "i|ignore=", "Ignore new, added, and removed members whose description matches a given C# regular expression (see below).",
+                                       v => {
+                                               var r = new Regex (v);
+                                               State.IgnoreAdded.Add (r);
+                                               State.IgnoreRemoved.Add (r);
+                                               State.IgnoreNew.Add (r);
+                                       }
+                               },
+                               { "a|ignore-added=", "Ignore added members whose description matches a given C# regular expression (see below).",
+                                       v => State.IgnoreAdded.Add (new Regex (v))
+                               },
+                               { "r|ignore-removed=", "Ignore removed members whose description matches a given C# regular expression (see below).",
+                                       v => State.IgnoreRemoved.Add (new Regex (v))
+                               },
+                               { "n|ignore-new=", "Ignore new namespaces and types whose description matches a given C# regular expression (see below).",
+                                       v => State.IgnoreNew.Add (new Regex (v))
+                               },
+                               { "ignore-changes-parameter-names", "Ignore changes to parameter names for identically prototyped methods.",
+                                       v => State.IgnoreParameterNameChanges   = v != null
+                               },
+                               { "ignore-changes-property-setters", "Ignore adding setters to properties.",
+                                       v => State.IgnoreAddedPropertySetters = v != null
+                               },
+                               { "ignore-changes-virtual", "Ignore changing non-`virtual` to `virtual` or adding `override`.",
+                                       v => State.IgnoreVirtualChanges = v != null
+                               },
+                               { "c|colorize:", "Colorize HTML output", v => State.Colorize = string.IsNullOrEmpty (v) ? true : bool.Parse (v) },
+                               { "x|lax", "Ignore duplicate XML entries", v => State.Lax = true }
+                       };
+
+                       try {
+                               extra = options.Parse (args);
+                       } catch (OptionException e) {
+                               Console.WriteLine ("Option error: {0}", e.Message);
+                               showHelp = true;
+                       }
+
+                       if (showHelp || extra == null || extra.Count < 2 || extra.Count > 3) {
+                               Console.WriteLine (@"Usage: mono-api-html [options] <reference.xml> <assembly.xml> [diff.html]");
+                               Console.WriteLine ();
+                               Console.WriteLine ("Available options:");
+                               options.WriteOptionDescriptions (Console.Out);
+                               Console.WriteLine ();
+                               Console.WriteLine ("Ignoring Members:");
+                               Console.WriteLine ();
+                               Console.WriteLine ("  Members that were added can be filtered out of the diff by using the");
+                               Console.WriteLine ("  -i, --ignore-added option. The option takes a C# regular expression");
+                               Console.WriteLine ("  to match against member descriptions. For example, to ignore the");
+                               Console.WriteLine ("  introduction of the interfaces 'INSCopying' and 'INSCoding' on types");
+                               Console.WriteLine ("  pass the following to mono-api-html:");
+                               Console.WriteLine ();
+                               Console.WriteLine ("    mono-api-html ... -i 'INSCopying$' -i 'INSCoding$'");
+                               Console.WriteLine ();
+                               Console.WriteLine ("  The regular expressions will match any member description ending with");
+                               Console.WriteLine ("  'INSCopying' or 'INSCoding'.");
+                               Console.WriteLine ();
+                               return 1;
+                       }
+
+                       var input = extra [0];
+                       var output = extra [1];
+                       if (extra.Count == 3 && diff == null)
+                               diff = extra [2];
+
+                       try {
+                               var ac = new AssemblyComparer (input, output);
+                               if (diff != null) {
+                                       string diffHtml = String.Empty;
+                                       using (var writer = new StringWriter ()) {
+                                               State.Output = writer;
+                                               ac.Compare ();
+                                               diffHtml = State.Output.ToString ();
+                                       }
+                                       if (diffHtml.Length > 0) {
+                                               using (var file = new StreamWriter (diff)) {
+                                                       file.WriteLine ("<div>");
+                                                       if (State.Colorize) {
+                                                               file.WriteLine ("<style scoped>");
+                                                               file.WriteLine ("\t.obsolete { color: gray; }");
+                                                               file.WriteLine ("\t.added { color: green; }");
+                                                               file.WriteLine ("\t.removed-inline { text-decoration: line-through; }");
+                                                               file.WriteLine ("\t.removed-breaking-inline { color: red;}");
+                                                               file.WriteLine ("\t.added-breaking-inline { text-decoration: underline; }");
+                                                               file.WriteLine ("\t.nonbreaking { color: black; }");
+                                                               file.WriteLine ("\t.breaking { color: red; }");
+                                                               file.WriteLine ("</style>");
+                                                       }
+                                                       file.WriteLine (
+@"<script type=""text/javascript"">
+       // Only some elements have 'data-is-[non-]breaking' attributes. Here we
+       // iterate over all descendents elements, and set 'data-is-[non-]breaking'
+       // depending on whether there are any descendents with that attribute.
+       function propagateDataAttribute (element)
+       {
+               if (element.hasAttribute ('data-is-propagated'))
+                       return;
+
+               var i;
+               var any_breaking = element.hasAttribute ('data-is-breaking');
+               var any_non_breaking = element.hasAttribute ('data-is-non-breaking');
+               for (i = 0; i < element.children.length; i++) {
+                       var el = element.children [i];
+                       propagateDataAttribute (el);
+                       any_breaking |= el.hasAttribute ('data-is-breaking');
+                       any_non_breaking |= el.hasAttribute ('data-is-non-breaking');
+               }
+               
+               if (any_breaking)
+                       element.setAttribute ('data-is-breaking', null);
+               else if (any_non_breaking)
+                       element.setAttribute ('data-is-non-breaking', null);
+               element.setAttribute ('data-is-propagated', null);
+       }
+
+       function hideNonBreakingChanges ()
+       {
+               var topNodes = document.querySelectorAll ('[data-is-topmost]');
+               var n;
+               var i;
+               for (n = 0; n < topNodes.length; n++) {
+                       propagateDataAttribute (topNodes [n]);
+                       var elements = topNodes [n].querySelectorAll ('[data-is-non-breaking]');
+                       for (i = 0; i < elements.length; i++) {
+                               var el = elements [i];
+                               if (!el.hasAttribute ('data-original-display'))
+                                       el.setAttribute ('data-original-display', el.style.display);
+                               el.style.display = 'none';
+                       }
+               }
+               
+               var links = document.getElementsByClassName ('hide-nonbreaking');
+               for (i = 0; i < links.length; i++)
+                       links [i].style.display = 'none';
+               links = document.getElementsByClassName ('restore-nonbreaking');
+               for (i = 0; i < links.length; i++)
+                       links [i].style.display = '';
+       }
+
+       function showNonBreakingChanges ()
+       {
+               var elements = document.querySelectorAll ('[data-original-display]');
+               var i;
+               for (i = 0; i < elements.length; i++) {
+                       var el = elements [i];
+                       el.style.display = el.getAttribute ('data-original-display');
+               }
+
+               var links = document.getElementsByClassName ('hide-nonbreaking');
+               for (i = 0; i < links.length; i++)
+                       links [i].style.display = '';
+               links = document.getElementsByClassName ('restore-nonbreaking');
+               for (i = 0; i < links.length; i++)
+                       links [i].style.display = 'none';
+       }
+</script>");
+                                                       if (ac.SourceAssembly == ac.TargetAssembly) {
+                                                               file.WriteLine ("<h1>{0}.dll</h1>", ac.SourceAssembly);
+                                                       } else {
+                                                               file.WriteLine ("<h1>{0}.dll vs {1}.dll</h1>", ac.SourceAssembly, ac.TargetAssembly);
+                                                       }
+                                                       file.WriteLine ("<a href='javascript: hideNonBreakingChanges (); ' class='hide-nonbreaking'>Hide non-breaking changes</a>");
+                                                       file.WriteLine ("<a href='javascript: showNonBreakingChanges (); ' class='restore-nonbreaking' style='display: none;'>Show non-breaking changes</a>");
+                                                       file.WriteLine ("<br/>");
+                                                       file.WriteLine ("<div data-is-topmost>");
+                                                       file.Write (diffHtml);
+                                                       file.WriteLine ("</div> <!-- end topmost div -->");
+                                                       file.WriteLine ("</div>");
+                                               }
+                                       }
+                               } else {
+                                       State.Output = Console.Out;
+                                       ac.Compare ();
+                               }
+                       }
+                       catch (Exception e) {
+                               Console.WriteLine (e);
+                               return 1;
+                       }
+                       return 0;
+               }
+       }
+}
diff --git a/mcs/tools/mono-api-html/AssemblyComparer.cs b/mcs/tools/mono-api-html/AssemblyComparer.cs
new file mode 100644 (file)
index 0000000..adbd862
--- /dev/null
@@ -0,0 +1,79 @@
+// 
+// Authors
+//    Sebastien Pouliot  <sebastien@xamarin.com>
+//
+// Copyright 2013 Xamarin Inc. http://www.xamarin.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.Collections.Generic;
+using System.Xml.Linq;
+
+namespace Xamarin.ApiDiff {
+
+       public class AssemblyComparer : Comparer {
+
+               XDocument source;
+               XDocument target;
+               NamespaceComparer comparer;
+
+               public AssemblyComparer (string sourceFile, string targetFile)
+               {
+                       source = XDocument.Load (sourceFile);
+                       target = XDocument.Load (targetFile);
+                       comparer =  new NamespaceComparer ();
+               }
+
+               public string SourceAssembly { get; private set; }
+               public string TargetAssembly { get; private set; }
+
+               public void Compare ()
+               {
+                       Compare (source.Element ("assemblies").Elements ("assembly"), 
+                                target.Element ("assemblies").Elements ("assembly"));
+               }
+
+               public override void SetContext (XElement current)
+               {
+                       State.Assembly = current.GetAttribute ("name");
+               }
+
+               public override void Added (XElement target, bool wasParentAdded)
+               {
+                       // one assembly per xml file
+               }
+
+               public override void Modified (XElement source, XElement target, ApiChanges diff)
+               {
+                       SourceAssembly = source.GetAttribute ("name");
+                       TargetAssembly = target.GetAttribute ("name");
+                       // TODO: version
+                       // ? custom attributes ?
+                       comparer.Compare (source, target);
+               }
+
+               public override void Removed (XElement source)
+               {
+                       // one assembly per xml file
+               }
+       }
+}
\ No newline at end of file
diff --git a/mcs/tools/mono-api-html/ClassComparer.cs b/mcs/tools/mono-api-html/ClassComparer.cs
new file mode 100644 (file)
index 0000000..a3399fb
--- /dev/null
@@ -0,0 +1,261 @@
+// 
+// Authors
+//    Sebastien Pouliot  <sebastien@xamarin.com>
+//
+// Copyright 2013 Xamarin Inc. http://www.xamarin.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.Collections.Generic;
+using System.IO;
+using System.Linq;
+using System.Xml.Linq;
+
+namespace Xamarin.ApiDiff {
+
+       public class ClassComparer : Comparer {
+
+               InterfaceComparer icomparer;
+               ConstructorComparer ccomparer;
+               FieldComparer fcomparer;
+               PropertyComparer pcomparer;
+               EventComparer ecomparer;
+               MethodComparer mcomparer;
+               ClassComparer kcomparer;
+
+               public ClassComparer ()
+               {
+                       icomparer = new InterfaceComparer ();
+                       ccomparer = new ConstructorComparer ();
+                       fcomparer = new FieldComparer ();
+                       pcomparer = new PropertyComparer ();
+                       ecomparer = new EventComparer ();
+                       mcomparer = new MethodComparer ();
+               }
+
+               public override void SetContext (XElement current)
+               {
+                       State.Type = current.GetAttribute ("name");
+                       State.BaseType = current.GetAttribute ("base");
+               }
+
+               public void Compare (XElement source, XElement target)
+               {
+                       var s = source.Element ("classes");
+                       var t = target.Element ("classes");
+                       if (XNode.DeepEquals (s, t))
+                               return;
+                       Compare (s.Elements ("class"), t.Elements ("class"));
+               }
+
+               public override void Added (XElement target, bool wasParentAdded)
+               {
+                       string name = target.Attribute ("name").Value;
+                       if (State.IgnoreNew.Any (re => re.IsMatch (name)))
+                               return;
+                       Output.WriteLine ("<div> <!-- start type {0} -->", name);
+                       Output.WriteLine ("<h3>New Type {0}.{1}</h3>", State.Namespace, name);
+                       Output.WriteLine ("<pre class='added' data-is-non-breaking>");
+                       State.Indent = 0;
+                       AddedInner (target);
+                       Output.WriteLine ("</pre>");
+                       Output.WriteLine ("</div> <!-- end type {0} -->", name);
+               }
+
+               public void AddedInner (XElement target)
+               {
+                       SetContext (target);
+                       if (target.IsTrue ("serializable"))
+                               Indent ().WriteLine ("[Serializable]");
+
+                       var type = target.Attribute ("type").Value;
+
+                       if (type == "enum") {
+                               // check if [Flags] is present
+                               var cattrs = target.Element ("attributes");
+                               if (cattrs != null) {
+                                       foreach (var ca in cattrs.Elements ("attribute")) {
+                                               if (ca.GetAttribute ("name") == "System.FlagsAttribute") {
+                                                       Indent ().WriteLine ("[Flags]");
+                                                       break;
+                                               }
+                                       }
+                               }
+                       }
+
+                       Indent ().Write ("public");
+
+                       if (type != "enum") {
+                               bool seal = target.IsTrue ("sealed");
+                               bool abst = target.IsTrue ("abstract");
+                               if (seal && abst)
+                                       Output.Write (" static");
+                               else if (seal && type != "struct")
+                                       Output.Write (" sealed");
+                               else if (abst && type != "interface")
+                                       Output.Write (" abstract");
+                       }
+
+                       Output.Write (' ');
+                       Output.Write (type);
+                       Output.Write (' ');
+                       Output.Write (target.GetAttribute ("name"));
+
+                       var baseclass = target.GetAttribute ("base");
+                       if ((type != "enum") && (type != "struct")) {
+                               if (baseclass != null) {
+                                       if (baseclass == "System.Object") {
+                                               // while true we do not need to be reminded every time...
+                                               baseclass = null;
+                                       } else {
+                                               Output.Write (" : ");
+                                               Output.Write (baseclass);
+                                       }
+                               }
+                       }
+
+                       // interfaces on enums are "standard" not user provided - so we do not want to show them
+                       if (type != "enum") {
+                               var i = target.Element ("interfaces");
+                               if (i != null) {
+                                       var interfaces = new List<string> ();
+                                       foreach (var iface in i.Elements ("interface"))
+                                               interfaces.Add (icomparer.GetDescription (iface));
+                                       Output.Write ((baseclass == null) ? " : " : ", ");
+                                       Output.Write (String.Join (", ", interfaces));
+                               }
+                       }
+
+                       Output.WriteLine (" {");
+
+                       var t = target.Element ("constructors");
+                       if (t != null) {
+                               Indent ().WriteLine ("\t// constructors");
+                               foreach (var ctor in t.Elements ("constructor"))
+                                       ccomparer.Added (ctor, true);
+                       }
+
+                       t = target.Element ("fields");
+                       if (t != null) {
+                               if (type != "enum")
+                                       Indent ().WriteLine ("\t// fields");
+                               else
+                                       SetContext (target);
+                               foreach (var field in t.Elements ("field"))
+                                       fcomparer.Added (field, true);
+                       }
+
+                       t = target.Element ("properties");
+                       if (t != null) {
+                               Indent ().WriteLine ("\t// properties");
+                               foreach (var property in t.Elements ("property"))
+                                       pcomparer.Added (property, true);
+                       }
+
+                       t = target.Element ("events");
+                       if (t != null) {
+                               Indent ().WriteLine ("\t// events");
+                               foreach (var evnt in t.Elements ("event"))
+                                       ecomparer.Added (evnt, true);
+                       }
+
+                       t = target.Element ("methods");
+                       if (t != null) {
+                               Indent ().WriteLine ("\t// methods");
+                               foreach (var method in t.Elements ("method"))
+                                       mcomparer.Added (method, true);
+                       }
+
+                       t = target.Element ("classes");
+                       if (t != null) {
+                               Output.WriteLine ();
+                               Indent ().WriteLine ("\t// inner types");
+                               kcomparer = new NestedClassComparer ();
+                               State.Indent++;
+                               foreach (var inner in t.Elements ("class"))
+                                       kcomparer.AddedInner (inner);
+                               State.Indent--;
+                       }
+                       Indent ().WriteLine ("}");
+               }
+
+               public override void Modified (XElement source, XElement target, ApiChanges diff)
+               {
+                       // hack - there could be changes that we're not monitoring (e.g. attributes properties)
+                       var output = Output;
+                       State.Output = new StringWriter ();
+
+                       var sb = source.GetAttribute ("base");
+                       var tb = target.GetAttribute ("base");
+                       if (sb != tb) {
+                               Output.Write ("Modified base type: ");
+                               Output.WriteLine (new ApiChange ().AppendModified (sb, tb, true).Member.ToString ());
+                       }
+
+                       ccomparer.Compare (source, target);
+                       icomparer.Compare (source, target);
+                       fcomparer.Compare (source, target);
+                       pcomparer.Compare (source, target);
+                       ecomparer.Compare (source, target);
+                       mcomparer.Compare (source, target);
+
+                       var si = source.Element ("classes");
+                       if (si != null) {
+                               var ti = target.Element ("classes");
+                               kcomparer = new NestedClassComparer ();
+                               kcomparer.Compare (si.Elements ("class"), ti == null ? null : ti.Elements ("class"));
+                       }
+
+                       var s = (Output as StringWriter).ToString ();
+                       State.Output = output;
+                       if (s.Length > 0) {
+                               var tn = GetTypeName (target);
+                               Output.WriteLine ("<!-- start type {0} --> <div>", tn);
+                               Output.WriteLine ("<h3>Type Changed: {0}.{1}</h3>", State.Namespace, GetTypeName (target));
+                               Output.WriteLine (s);
+                               Output.WriteLine ("</div> <!-- end type {0} -->", tn);
+                       }
+               }
+
+               public override void Removed (XElement source)
+               {
+                       Output.Write ("<h3>Removed Type <span class='breaking' data-is-breaking>{0}.{1}</span></h3>", State.Namespace, GetTypeName (source));
+               }
+
+               public virtual string GetTypeName (XElement type)
+               {
+                       return type.GetAttribute ("name");
+               }
+       }
+
+       public class NestedClassComparer : ClassComparer {
+
+               public override void SetContext (XElement current)
+               {
+               }
+
+               public override string GetTypeName (XElement type)
+               {
+                       return State.Type + "." + base.GetTypeName (type);
+               }
+       }
+}
\ No newline at end of file
diff --git a/mcs/tools/mono-api-html/Comparer.cs b/mcs/tools/mono-api-html/Comparer.cs
new file mode 100644 (file)
index 0000000..4210b9b
--- /dev/null
@@ -0,0 +1,98 @@
+// 
+// Authors
+//    Sebastien Pouliot  <sebastien@xamarin.com>
+//
+// Copyright 2013 Xamarin Inc. http://www.xamarin.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.Collections.Generic;
+using System.IO;
+using System.Linq;
+using System.Xml.Linq;
+
+namespace Xamarin.ApiDiff {
+
+       public abstract class Comparer {
+
+               protected List<XElement> removed = new List<XElement> ();
+               protected ApiChanges modified = new ApiChanges ();
+
+               public TextWriter Output {
+                       get { return State.Output; }
+               }
+
+               protected TextWriter Indent ()
+               {
+                       for (int i = 0; i < State.Indent; i++)
+                               State.Output.Write ("\t");
+                       return State.Output;
+               }
+
+               public abstract void Added (XElement target, bool wasParentAdded);
+               public abstract void Modified (XElement source, XElement target, ApiChanges changes);
+               public abstract void Removed (XElement source);
+
+               public virtual bool Equals (XElement source, XElement target, ApiChanges changes)
+               {
+                       return XNode.DeepEquals (source, target);
+               }
+
+               public abstract void SetContext (XElement current);
+
+               public virtual void Compare (IEnumerable<XElement> source, IEnumerable<XElement> target)
+               {
+                       removed.Clear ();
+                       modified.Clear ();
+
+                       foreach (var s in source) {
+                               SetContext (s);
+                               string sn = s.GetAttribute ("name");
+                               var t = target == null ? null : target.SingleOrDefault (x => x.GetAttribute ("name") == sn);
+                               if (t == null) {
+                                       // not in target, it was removed
+                                       removed.Add (s);
+                               } else {
+                                       t.Remove ();
+                                       // possibly modified
+                                       if (Equals (s, t, modified))
+                                               continue;
+
+                                       // still in target so will be part of Added
+                                       Modified (s, t, modified);
+                               }
+                       }
+                       // delayed, that way we show "Modified", "Added" and then "Removed"
+                       foreach (var item in removed) {
+                               SetContext (item);
+                               Removed (item);
+                       }
+                       // remaining == newly added in target
+                       if (target != null) {
+                               foreach (var item in target) {
+                                       SetContext (item);
+                                       Added (item, false);
+                               }
+                       }
+               }
+       }
+}
\ No newline at end of file
diff --git a/mcs/tools/mono-api-html/ConstructorComparer.cs b/mcs/tools/mono-api-html/ConstructorComparer.cs
new file mode 100644 (file)
index 0000000..9bd837e
--- /dev/null
@@ -0,0 +1,148 @@
+// 
+// Authors
+//    Sebastien Pouliot  <sebastien@xamarin.com>
+//
+// Copyright 2013 Xamarin Inc. http://www.xamarin.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.Collections.Generic;
+using System.Reflection;
+using System.Text;
+using System.Xml.Linq;
+
+namespace Xamarin.ApiDiff {
+
+       // MethodComparer inherits from this one
+       public class ConstructorComparer : MemberComparer {
+
+               public override string GroupName {
+                       get { return "constructors"; }
+               }
+
+               public override string ElementName {
+                       get { return "constructor"; }
+               }
+
+               public override bool Find (XElement e)
+               {
+                       return (e.Attribute ("name").Value == Source.Attribute ("name").Value);
+               }
+
+               void RenderReturnType (XElement source, XElement target, ApiChange change)
+               {
+                       var srcType = source.GetTypeName ("returntype");
+                       var tgtType = target.GetTypeName ("returntype");
+
+                       if (srcType != tgtType) {
+                               change.AppendModified (srcType, tgtType, true);
+                               change.Append (" ");
+                       } else if (srcType != null) {
+                               // ctor don't have a return type
+                               change.Append (srcType);
+                               change.Append (" ");
+                       }
+               }
+
+               public override bool Equals (XElement source, XElement target, ApiChanges changes)
+               {
+                       if (base.Equals (source, target, changes))
+                               return true;
+                               
+                       var change = new ApiChange ();
+                       change.Header = "Modified " + GroupName;
+                       RenderMethodAttributes (source, target, change);
+                       RenderReturnType (source, target, change);
+                       RenderName (source, target, change);
+                       RenderGenericParameters (source, target, change);
+                       RenderParameters (source, target, change);
+
+                       changes.Add (source, target, change);
+
+                       return false;
+               }
+
+               public override string GetDescription (XElement e)
+               {
+                       var sb = new StringBuilder ();
+
+                       var attribs = e.Attribute ("attrib");
+                       if (attribs != null) {
+                               var attr = (MethodAttributes) Int32.Parse (attribs.Value);
+                               if ((attr & MethodAttributes.Public) != MethodAttributes.Public) {
+                                       sb.Append ("protected ");
+                               } else {
+                                       sb.Append ("public ");
+                               }
+
+                               if ((attr & MethodAttributes.Static) != 0) {
+                                       sb.Append ("static ");
+                               } else if ((attr & MethodAttributes.Virtual) != 0) {
+                                       if ((attr & MethodAttributes.VtableLayoutMask) == 0)
+                                               sb.Append ("override ");
+                                       else
+                                               sb.Append ("virtual ");
+                               }
+                       }
+
+                       string name = e.GetAttribute ("name");
+
+                       var r = e.GetTypeName ("returntype");
+                       if (r != null) {
+                               // ctor dont' have a return type
+                               sb.Append (r).Append (' ');
+                       } else {
+                               // show the constructor as it would be defined in C#
+                               name = name.Replace (".ctor", State.Type);
+                       }
+
+                       // the XML file `name` does not contain parameter names, so we must process them ourselves
+                       // which gives us the opportunity to simplify type names
+                       sb.Append (name.Substring (0, name.IndexOf ('(')));
+
+                       var genericp = e.Element ("generic-parameters");
+                       if (genericp != null) {
+                               var list = new List<string> ();
+                               foreach (var p in genericp.Elements ("generic-parameter")) {
+                                       list.Add (p.GetTypeName ("name"));
+                               }
+                               sb.Append ("&lt;").Append (String.Join (", ", list)).Append ("&gt;");
+                       }
+
+                       sb.Append (" (");
+                       var parameters = e.Element ("parameters");
+                       if (parameters != null) {
+                               var list = new List<string> ();
+                               foreach (var p in parameters.Elements ("parameter")) {
+                                       var pTypeName   = p.GetTypeName ("type");
+                                       list.Add (State.IgnoreParameterNameChanges
+                                               ? pTypeName
+                                               : pTypeName + " " + p.GetAttribute ("name"));
+                               }
+                               sb.Append (String.Join (", ", list));
+                       }
+                       sb.Append (");");
+
+                       return sb.ToString ();
+               }
+       }
+}
\ No newline at end of file
diff --git a/mcs/tools/mono-api-html/EventComparer.cs b/mcs/tools/mono-api-html/EventComparer.cs
new file mode 100644 (file)
index 0000000..693f16f
--- /dev/null
@@ -0,0 +1,75 @@
+// 
+// Authors
+//    Sebastien Pouliot  <sebastien@xamarin.com>
+//
+// Copyright 2013 Xamarin Inc. http://www.xamarin.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.Text;
+using System.Xml.Linq;
+
+namespace Xamarin.ApiDiff {
+
+       public class EventComparer : MemberComparer {
+
+               public override string GroupName {
+                       get { return "events"; }
+               }
+
+               public override string ElementName {
+                       get { return "event"; }
+               }
+
+               public override bool Equals (XElement source, XElement target, ApiChanges changes)
+               {
+                       if (base.Equals (source, target, changes))
+                               return true;
+
+                       var change = new ApiChange ();
+                       change.Header = "Modified " + GroupName;
+                       change.Append ("public event ");
+
+                       var srcEventType = source.GetTypeName ("eventtype");
+                       var tgtEventType = target.GetTypeName ("eventtype");
+
+                       if (srcEventType != tgtEventType) {
+                               change.AppendModified (srcEventType, tgtEventType, true);
+                       } else {
+                               change.Append (srcEventType);
+                       }
+                       change.Append (" ");
+                       change.Append (source.GetAttribute ("name")).Append (";");
+                       return false;
+               }
+
+               public override string GetDescription (XElement e)
+               {
+                       StringBuilder sb = new StringBuilder ();
+                       // TODO: attribs
+                       sb.Append ("public event ");
+                       sb.Append (e.GetTypeName ("eventtype")).Append (' ');
+                       sb.Append (e.GetAttribute ("name")).Append (';');
+                       return sb.ToString ();
+               }
+       }
+}
\ No newline at end of file
diff --git a/mcs/tools/mono-api-html/FieldComparer.cs b/mcs/tools/mono-api-html/FieldComparer.cs
new file mode 100644 (file)
index 0000000..a2b0225
--- /dev/null
@@ -0,0 +1,211 @@
+// 
+// Authors
+//    Sebastien Pouliot  <sebastien@xamarin.com>
+//
+// Copyright 2013-2014 Xamarin Inc. http://www.xamarin.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.Collections.Generic;
+using System.Linq;
+using System.Reflection;
+using System.Text;
+using System.Xml.Linq;
+
+namespace Xamarin.ApiDiff {
+
+       public class FieldComparer : MemberComparer {
+
+               public override string GroupName {
+                       get { return "fields"; }
+               }
+
+               public override string ElementName {
+                       get { return "field"; }
+               }
+
+               void RenderFieldAttributes (FieldAttributes source, FieldAttributes target, ApiChange change)
+               {
+                       var srcNotSerialized = (source & FieldAttributes.NotSerialized) == FieldAttributes.NotSerialized;
+                       var tgtNotSerialized = (target & FieldAttributes.NotSerialized) == FieldAttributes.NotSerialized;
+                       if (srcNotSerialized != tgtNotSerialized) {
+                               // this is not a breaking change, so only render it if it changed.
+                               if (srcNotSerialized) {
+                                       change.AppendRemoved ("[NonSerialized]\n");
+                               } else {
+                                       change.AppendAdded ("[NonSerialized]\n");
+                               }
+                       }
+
+                       // the visibility values are the same for MethodAttributes and FieldAttributes, so just use the same method.
+                       RenderVisibility ((MethodAttributes) source, (MethodAttributes) target, change);
+                       // same for the static flag
+                       RenderStatic ((MethodAttributes) source, (MethodAttributes) target, change);
+
+                       var srcLiteral = (source & FieldAttributes.Literal) != 0;
+                       var tgtLiteral = (target & FieldAttributes.Literal) != 0;
+
+                       if (srcLiteral) {
+                               if (tgtLiteral) {
+                                       change.Append ("const ");
+                               } else {
+                                       change.AppendRemoved ("const", true).Append (" ");
+                               }
+                       } else if (tgtLiteral) {
+                               change.AppendAdded ("const", true).Append (" ");
+                       }
+
+                       var srcInitOnly = (source & FieldAttributes.InitOnly) != 0;
+                       var tgtInitOnly = (target & FieldAttributes.InitOnly) != 0;
+                       if (srcInitOnly) {
+                               if (tgtInitOnly) {
+                                       change.Append ("readonly ");
+                               } else {
+                                       change.AppendRemoved ("readonly", false).Append (" ");
+                               }
+                       } else if (tgtInitOnly) {
+                               change.AppendAdded ("readonly", true).Append (" ");
+                       }
+               }
+
+               public override bool Equals (XElement source, XElement target, ApiChanges changes)
+               {
+                       if (base.Equals (source, target, changes))
+                               return true;
+
+                       var name = source.GetAttribute ("name");
+                       var srcValue = source.GetAttribute ("value");
+                       var tgtValue = target.GetAttribute ("value");
+                       var change = new ApiChange ();
+                       change.Header = "Modified " + GroupName;
+
+                       if (State.BaseType == "System.Enum") {
+                               change.Append (name).Append (" = ");
+                               if (srcValue != tgtValue) {
+                                       change.AppendModified (srcValue, tgtValue, true);
+                               } else {
+                                       change.Append (srcValue);
+                               }
+                       } else {
+                               RenderFieldAttributes (source.GetFieldAttributes (), target.GetFieldAttributes (), change);
+
+                               var srcType = source.GetTypeName ("fieldtype");
+                               var tgtType = target.GetTypeName ("fieldtype");
+
+                               if (srcType != tgtType) {
+                                       change.AppendModified (srcType, tgtType, true);
+                               } else {
+                                       change.Append (srcType);
+                               }
+                               change.Append (" ");
+                               change.Append (name);
+
+                               if (srcType == "string" && srcValue != null)
+                                       srcValue = "\"" + srcValue + "\"";
+
+                               if (tgtType == "string" && tgtValue != null)
+                                       tgtValue = "\"" + tgtValue + "\"";
+
+                               if (srcValue != tgtValue) {
+                                       change.Append (" = ");
+                                       if (srcValue == null)
+                                               srcValue = "null";
+                                       if (tgtValue == null)
+                                               tgtValue = "null";
+                                       change.AppendModified (srcValue, tgtValue, true);
+                               } else if (srcValue != null) {
+                                       change.Append (" = ");
+                                       change.Append (srcValue);
+                               }
+                               change.Append (";");
+                       }
+
+                       changes.Add (source, target, change);
+
+                       return false;
+               }
+
+               public override string GetDescription (XElement e)
+               {
+                       var sb = new StringBuilder ();
+
+                       string name = e.GetAttribute ("name");
+                       string value = e.GetAttribute ("value");
+
+                       if (State.BaseType == "System.Enum") {
+                               sb.Append (name).Append (" = ").Append (value).Append (',');
+                       } else {
+                               var attribs = e.Attribute ("attrib");
+                               if (attribs != null) {
+                                       var attr = (FieldAttributes)Int32.Parse (attribs.Value);
+                                       if ((attr & FieldAttributes.Public) != FieldAttributes.Public) {
+                                               sb.Append ("protected ");
+                                       } else {
+                                               sb.Append ("public ");
+                                       }
+
+                                       if ((attr & FieldAttributes.Static) != 0)
+                                               sb.Append ("static ");
+
+                                       if ((attr & FieldAttributes.Literal) != 0)
+                                               sb.Append ("const ");
+                               }
+
+                               string ftype = e.GetTypeName ("fieldtype");
+                               sb.Append (ftype).Append (' ');
+                               sb.Append (name);
+                               if (ftype == "string" && e.Attribute ("value") != null) {
+                                       if (value == null)
+                                               sb.Append (" = null");
+                                       else
+                                               sb.Append (" = \"").Append (value).Append ('"');
+                               }
+                               sb.Append (';');
+                       }
+
+                       return sb.ToString ();
+               }
+
+               public override void BeforeAdding (IEnumerable<XElement> list)
+               {
+                       first = true;
+                       if (State.BaseType == "System.Enum") {
+                               Output.WriteLine ("<div>");
+                               Output.WriteLine ("<p>Added value{0}:</p>", list.Count () > 1 ? "s" : String.Empty);
+                               Output.WriteLine ("<pre class='added' data-is-non-breaking>");
+                       } else {
+                               base.BeforeAdding (list);
+                       }
+               }
+
+               public override void BeforeRemoving (IEnumerable<XElement> list)
+               {
+                       first = true;
+                       if (State.BaseType == "System.Enum") {
+                               Output.WriteLine ("<p>Removed value{0}:</p>", list.Count () > 1 ? "s" : String.Empty);
+                               Output.WriteLine ("<pre class='removed' data-is-breaking>");
+                       } else {
+                               base.BeforeRemoving (list);
+                       }
+               }
+       }
+}
\ No newline at end of file
diff --git a/mcs/tools/mono-api-html/Helpers.cs b/mcs/tools/mono-api-html/Helpers.cs
new file mode 100644 (file)
index 0000000..8769785
--- /dev/null
@@ -0,0 +1,207 @@
+// 
+// Authors
+//    Sebastien Pouliot  <sebastien@xamarin.com>
+//
+// Copyright 2013-2014 Xamarin Inc. http://www.xamarin.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.Collections.Generic;
+using System.Linq;
+using System.Reflection;
+using System.Text;
+using System.Xml.Linq;
+
+namespace Xamarin.ApiDiff {
+
+       public static class Helper {
+               public static bool IsTrue (this XElement self, string name)
+               {
+                       return (self.GetAttribute (name) == "true");
+               }
+
+               public static string GetAttribute (this XElement self, string name)
+               {
+                       var n = self.Attribute (name);
+                       if (n == null)
+                               return null;
+                       return n.Value;
+               }
+
+               // null == no obsolete, String.Empty == no description
+               public static string GetObsoleteMessage (this XElement self)
+               {
+                       var cattrs = self.Element ("attributes");
+                       if (cattrs == null)
+                               return null;
+
+                       foreach (var ca in cattrs.Elements ("attribute")) {
+                               if (ca.GetAttribute ("name") != "System.ObsoleteAttribute")
+                                       continue;
+                               var props = ca.Element ("properties");
+                               if (props == null)
+                                       return String.Empty; // no description
+                               foreach (var p in props.Elements ("property")) {
+                                       if (p.GetAttribute ("name") != "Message")
+                                               continue;
+                                       return p.GetAttribute ("value");
+                               }
+                       }
+                       return null;
+               }
+
+               public static IEnumerable<XElement> Descendants (this XElement self, params string[] names)
+               {
+                       XElement el = self;
+                       if (el == null)
+                               return null;
+
+                       for (int i = 0; i < names.Length - 1; i++) {
+                               el = el.Element (names [i]);
+                               if (el == null)
+                                       return null;
+                       }
+                       return el.Elements (names [names.Length - 1]);
+               }
+
+               public static List<XElement> DescendantList (this XElement self, params string[] names)
+               {
+                       var descendants = self.Descendants (names);
+                       if (descendants == null)
+                               return null;
+                       return descendants.ToList ();
+               }
+
+               // make it beautiful (.NET -> C#)
+               public static string GetTypeName (this XElement self, string name)
+               {
+                       string type = self.GetAttribute (name);
+                       if (type == null)
+                               return null;
+
+                       StringBuilder sb = null;
+                       bool is_nullable = false;
+                       if (type.StartsWith ("System.Nullable`1[", StringComparison.Ordinal)) {
+                               is_nullable = true;
+                               sb = new StringBuilder (type, 18, type.Length - 19, 1024);
+                       } else {
+                               sb = new StringBuilder (type);
+                       }
+
+                       bool is_ref = (sb [sb.Length - 1] == '&');
+                       if (is_ref)
+                               sb.Remove (sb.Length - 1, 1);
+
+                       int array = 0;
+                       while ((sb [sb.Length - 1] == ']') && (sb [sb.Length - 2] == '[')) {
+                               sb.Remove (sb.Length - 2, 2);
+                               array++;
+                       }
+
+                       bool is_pointer = (sb [sb.Length - 1] == '*');
+                       if (is_pointer)
+                               sb.Remove (sb.Length - 1, 1);
+
+                       type = GetTypeName (sb.Replace ('+', '.').ToString ());
+                       sb.Length = 0;
+                       if (is_ref)
+                               sb.Append (self.GetAttribute ("direction")).Append (' ');
+
+                       sb.Append (type);
+
+                       while (array-- > 0)
+                               sb.Append ("[]");
+                       if (is_nullable)
+                               sb.Append ('?');
+                       if (is_pointer)
+                               sb.Append ('*');
+                       return sb.ToString ();
+               }
+
+               static string GetTypeName (string type)
+               {
+                       int pos = type.IndexOf ('`');
+                       if (pos >= 0) {
+                               int end = type.LastIndexOf (']');
+                               string subtype = type.Substring (pos + 3, end - pos - 3);
+                               return type.Substring (0, pos) + "&lt;" + GetTypeName (subtype) + "&gt;";
+                       }
+
+                       switch (type) {
+                       case "System.String":
+                               return "string";
+                       case "System.Int32":
+                               return "int";
+                       case "System.UInt32":
+                               return "uint";
+                       case "System.Int64":
+                               return "long";
+                       case "System.UInt64":
+                               return "ulong";
+                       case "System.Void":
+                               return "void";
+                       case "System.Boolean":
+                               return "bool";
+                       case "System.Object":
+                               return "object";
+                       case "System.Single":
+                               return "float";
+                       case "System.Double":
+                               return "double";
+                       case "System.Byte":
+                               return "byte";
+                       case "System.SByte":
+                               return "sbyte";
+                       case "System.Int16":
+                               return "short";
+                       case "System.UInt16":
+                               return "ushort";
+                       case "System.Char":
+                               return "char";
+                       case "System.nint":
+                               return "nint";
+                       case "System.nuint":
+                               return "uint";
+                       case "System.nfloat":
+                               return "nfloat";
+                       case "System.IntPtr":
+                               return "IntPtr";
+                       default:
+                               if (type.StartsWith (State.Namespace, StringComparison.Ordinal))
+                                       type = type.Substring (State.Namespace.Length + 1);
+                               return type;
+                       }
+               }
+
+               public static MethodAttributes GetMethodAttributes (this XElement element)
+               {
+                       var srcAttribs = element.Attribute ("attrib");
+                       return (MethodAttributes) (srcAttribs != null ? Int32.Parse (srcAttribs.Value) : 0);
+               }
+
+               public static FieldAttributes GetFieldAttributes (this XElement element)
+               {
+                       var srcAttribs = element.Attribute ("attrib");
+                       return (FieldAttributes) (srcAttribs != null ? Int32.Parse (srcAttribs.Value) : 0);
+               }
+       }
+}
\ No newline at end of file
diff --git a/mcs/tools/mono-api-html/InterfaceComparer.cs b/mcs/tools/mono-api-html/InterfaceComparer.cs
new file mode 100644 (file)
index 0000000..df52f16
--- /dev/null
@@ -0,0 +1,47 @@
+// 
+// Authors
+//    Sebastien Pouliot  <sebastien@xamarin.com>
+//
+// Copyright 2013 Xamarin Inc. http://www.xamarin.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.Xml.Linq;
+
+namespace Xamarin.ApiDiff {
+
+       public class InterfaceComparer : MemberComparer {
+
+               public override string GroupName {
+                       get { return "interfaces"; }
+               }
+
+               public override string ElementName {
+                       get { return "interface"; }
+               }
+
+               public override string GetDescription (XElement e)
+               {
+                       return e.GetTypeName ("name");
+               }
+       }
+}
\ No newline at end of file
diff --git a/mcs/tools/mono-api-html/Makefile b/mcs/tools/mono-api-html/Makefile
new file mode 100644 (file)
index 0000000..e1c55c1
--- /dev/null
@@ -0,0 +1,10 @@
+thisdir = tools/mono-api-html
+SUBDIRS =
+include ../../build/rules.make
+
+LIB_REFS = Mono.Cecil System.Xml System.Core System System.Xml.Linq
+LOCAL_MCS_FLAGS =
+
+PROGRAM = mono-api-html.exe
+
+include ../../build/executable.make
diff --git a/mcs/tools/mono-api-html/MemberComparer.cs b/mcs/tools/mono-api-html/MemberComparer.cs
new file mode 100644 (file)
index 0000000..d12d866
--- /dev/null
@@ -0,0 +1,608 @@
+// 
+// Authors
+//    Sebastien Pouliot  <sebastien@xamarin.com>
+//
+// Copyright 2013-2014 Xamarin Inc. http://www.xamarin.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.Collections.Generic;
+using System.Linq;
+using System.Reflection;
+using System.Text;
+using System.Xml.Linq;
+
+namespace Xamarin.ApiDiff {
+
+       public abstract class MemberComparer : Comparer {
+
+               // true if this is the first element being added or removed in the group being rendered
+               protected bool first;
+
+               public abstract string GroupName { get; }
+               public abstract string ElementName { get; }
+
+               protected virtual bool IsBreakingRemoval (XElement e)
+               {
+                       return true;
+               }
+
+               public void Compare (XElement source, XElement target)
+               {
+                       var s = source.Element (GroupName);
+                       var t = target.Element (GroupName);
+                       if (XNode.DeepEquals (s, t))
+                               return;
+
+                       if (s == null) {
+                               Add (t.Elements (ElementName));
+                       } else if (t == null) {
+                               Remove (s.Elements (ElementName));
+                       } else {
+                               Compare (s.Elements (ElementName), t.Elements (ElementName));
+                       }
+               }
+
+               public override void SetContext (XElement current)
+               {
+               }
+
+               string GetContainingType (XElement el)
+               {
+                       return el.Ancestors ("class").First ().Attribute ("type").Value;
+               }
+
+               bool IsInInterface (XElement el)
+               {
+                       return GetContainingType (el) == "interface";
+               }
+
+               public XElement Source { get; set; }
+
+               public virtual bool Find (XElement e)
+               {
+                       return e.GetAttribute ("name") == Source.GetAttribute ("name");
+               }
+
+               XElement Find (IEnumerable<XElement> target)
+               {
+                       return State.Lax ? target.FirstOrDefault (Find) : target.SingleOrDefault (Find);
+               }
+
+               public override void Compare (IEnumerable<XElement> source, IEnumerable<XElement> target)
+               {
+                       removed.Clear ();
+                       modified.Clear ();
+
+                       foreach (var s in source) {
+                               SetContext (s);
+                               Source = s;
+                               var t = Find (target);
+                               if (t == null) {
+                                       // not in target, it was removed
+                                       removed.Add (s);
+                               } else {
+                                       t.Remove ();
+                                       // possibly modified
+                                       if (Equals (s, t, modified))
+                                               continue;
+
+                                       Modified (s, t, modified);
+                               }
+                       }
+                       // delayed, that way we show "Modified", "Added" and then "Removed"
+                       Remove (removed);
+
+                       Modify (modified);
+
+                       // remaining == newly added in target
+                       Add (target);
+               }
+
+               void Add (IEnumerable<XElement> elements)
+               {
+                       bool a = false;
+                       foreach (var item in elements) {
+                               SetContext (item);
+                               if (State.IgnoreAdded.Any (re => re.IsMatch (GetDescription (item))))
+                                       continue;
+                               if (!a) {
+                                       BeforeAdding (elements);
+                                       a = true;
+                               }
+                               Added (item, false);
+                       }
+                       if (a)
+                               AfterAdding ();
+               }
+
+               void Modify (ApiChanges modified)
+               {
+                       foreach (var changes in modified) {
+                               Output.WriteLine ("<p>{0}:</p>", changes.Key);
+                               Output.WriteLine ("<pre>");
+                               foreach (var element in changes.Value) {
+                                       Output.Write ("<div {0}>", element.Breaking ? "data-is-breaking" : "data-is-non-breaking");
+                                       foreach (var line in element.Member.ToString ().Split ('\n'))
+                                               Output.WriteLine ("\t{0}", line);
+                                       Output.Write ("</div>");
+
+                               }
+                               Output.WriteLine ("</pre>");
+                       }
+               }
+
+               void Remove (IEnumerable<XElement> elements)
+               {
+                       bool r = false;
+                       foreach (var item in elements) {
+                               if (State.IgnoreRemoved.Any (re => re.IsMatch (GetDescription (item))))
+                                       continue;
+                               SetContext (item);
+                               if (!r) {
+                                       BeforeRemoving (elements);
+                                       r = true;
+                               }
+                               Removed (item);
+                       }
+                       if (r)
+                               AfterRemoving ();
+               }
+                       
+               public abstract string GetDescription (XElement e);
+
+               protected StringBuilder GetObsoleteMessage (XElement e)
+               {
+                       var sb = new StringBuilder ();
+                       string o = e.GetObsoleteMessage ();
+                       if (o != null) {
+                               sb.Append ("[Obsolete");
+                               if (o.Length > 0)
+                                       sb.Append (" (\"").Append (o).Append ("\")");
+                               sb.AppendLine ("]");
+                               for (int i = 0; i < State.Indent + 1; i++)
+                                       sb.Append ('\t');
+                       }
+                       return sb;
+               }
+
+               public override bool Equals (XElement source, XElement target, ApiChanges changes)
+               {
+                       RenderAttributes (source, target, changes);
+
+                       // We don't want to compare attributes.
+                       RemoveAttributes (source);
+                       RemoveAttributes (target);
+
+                       return base.Equals (source, target, changes);
+               }
+
+               public virtual void BeforeAdding (IEnumerable<XElement> list)
+               {
+                       first = true;
+                       Output.WriteLine ("<div>");
+                       Output.WriteLine ("<p>Added {0}:</p>", list.Count () > 1 ? GroupName : ElementName);
+                       Output.WriteLine ("<pre>");
+               }
+
+               public override void Added (XElement target, bool wasParentAdded)
+               {
+                       var o = GetObsoleteMessage (target);
+                       if (!first && (o.Length > 0))
+                               Output.WriteLine ();
+                       Indent ();
+                       bool isInterfaceBreakingChange = !wasParentAdded && IsInInterface (target);
+                       Output.Write ("\t<span class='added added-{0} {1}' {2}>", ElementName, isInterfaceBreakingChange ? "breaking" : string.Empty, isInterfaceBreakingChange ? "data-is-breaking" : "data-is-non-breaking");
+                       Output.Write ("{0}{1}", o, GetDescription (target));
+                       Output.WriteLine ("</span>");
+                       first = false;
+               }
+
+               public virtual void AfterAdding ()
+               {
+                       Output.WriteLine ("</pre>");
+                       Output.WriteLine ("</div>");
+               }
+
+               public override void Modified (XElement source, XElement target, ApiChanges change)
+               {
+               }
+
+               public virtual void BeforeRemoving (IEnumerable<XElement> list)
+               {
+                       first = true;
+                       Output.WriteLine ("<p>Removed {0}:</p>\n", list.Count () > 1 ? GroupName : ElementName);
+                       Output.WriteLine ("<pre>");
+               }
+
+               public override void Removed (XElement source)
+               {
+                       var o = GetObsoleteMessage (source);
+                       if (!first && (o.Length > 0))
+                               Output.WriteLine ();
+
+                       bool is_breaking = IsBreakingRemoval (source);
+
+                       Indent ();
+                       Output.Write ("\t<span class='removed removed-{0} {2}' {1}>", ElementName, is_breaking ? "data-is-breaking" : "data-is-non-breaking", is_breaking ? "breaking" : string.Empty);
+                       Output.Write ("{0}{1}", o, GetDescription (source));
+                       Output.WriteLine ("</span>");
+                       first = false;
+               }
+
+               public virtual void AfterRemoving ()
+               {
+                       Output.WriteLine ("</pre>");;
+               }
+
+               string RenderGenericParameter (XElement gp)
+               {
+                       var sb = new StringBuilder ();
+                       sb.Append (gp.GetTypeName ("name"));
+
+                       var constraints = gp.DescendantList ("generic-parameter-constraints", "generic-parameter-constraint");
+                       if (constraints != null && constraints.Count > 0) {
+                               sb.Append (" : ");
+                               for (int i = 0; i < constraints.Count; i++) {
+                                       if (i > 0)
+                                               sb.Append (", ");
+                                       sb.Append (constraints [i].GetTypeName ("name"));
+                               }
+                       }
+                       return sb.ToString ();
+               }
+
+               protected void RenderGenericParameters (XElement source, XElement target, ApiChange change)
+               {
+                       var src = source.DescendantList ("generic-parameters", "generic-parameter");
+                       var tgt = target.DescendantList ("generic-parameters", "generic-parameter");
+                       var srcCount = src == null ? 0 : src.Count;
+                       var tgtCount = tgt == null ? 0 : tgt.Count;
+
+                       if (srcCount == 0 && tgtCount == 0)
+                               return;
+
+                       change.Append ("&lt;");
+                       for (int i = 0; i < Math.Max (srcCount, tgtCount); i++) {
+                               if (i > 0)
+                                       change.Append (", ");
+                               if (i >= srcCount) {
+                                       change.AppendAdded (RenderGenericParameter (tgt [i]), true);
+                               } else if (i >= tgtCount) {
+                                       change.AppendRemoved (RenderGenericParameter (src [i]), true);
+                               } else {
+                                       var srcName = RenderGenericParameter (src [i]);
+                                       var tgtName = RenderGenericParameter (tgt [i]);
+
+                                       if (srcName != tgtName) {
+                                               change.AppendModified (srcName, tgtName, true);
+                                       } else {
+                                               change.Append (srcName);
+                                       }
+                                       }
+                               }
+                       change.Append ("&gt;");
+               }
+
+               protected string FormatValue (string type, string value)
+               {
+                       if (value == null)
+                               return "null";
+
+                       if (type == "string")
+                               return "\"" + value + "\"";
+                       else if (type == "bool") {
+                               switch (value) {
+                               case "True":
+                                       return "true";
+                               case "False":
+                                       return "false";
+                               default:
+                                       return value;
+                               }
+                       }
+
+                       return value;
+               }
+
+               protected void RenderParameters (XElement source, XElement target, ApiChange change)
+               {
+                       var src = source.DescendantList ("parameters", "parameter");
+                       var tgt = target.DescendantList ("parameters", "parameter");
+                       var srcCount = src == null ? 0 : src.Count;
+                       var tgtCount = tgt == null ? 0 : tgt.Count;
+
+                       change.Append (" (");
+                       for (int i = 0; i < Math.Max (srcCount, tgtCount); i++) {
+                               if (i > 0)
+                                       change.Append (", ");
+
+                               if (i >= srcCount) {
+                                       change.AppendAdded (tgt [i].GetTypeName ("type") + " " + tgt [i].GetAttribute ("name"), true);
+                               } else if (i >= tgtCount) {
+                                       change.AppendRemoved (src [i].GetTypeName ("type") + " " + src [i].GetAttribute ("name"), true);
+                               } else {
+                                       var paramSourceType = src [i].GetTypeName ("type");
+                                       var paramTargetType = tgt [i].GetTypeName ("type");
+
+                                       var paramSourceName = src [i].GetAttribute ("name");
+                                       var paramTargetName = tgt [i].GetAttribute ("name");
+
+                                       if (paramSourceType != paramTargetType) {
+                                               change.AppendModified (paramSourceType, paramTargetType, true);
+                                       } else {
+                                               change.Append (paramSourceType);
+                                       }
+                                       change.Append (" ");
+                                       if (paramSourceName != paramTargetName) {
+                                               change.AppendModified (paramSourceName, paramTargetName, false);
+                                       } else {
+                                               change.Append (paramSourceName);
+                                       }
+
+                                       var optSource = src [i].Attribute ("optional");
+                                       var optTarget = tgt [i].Attribute ("optional");
+                                       var srcValue = FormatValue (paramSourceType, src [i].GetAttribute ("defaultValue"));
+                                       var tgtValue = FormatValue (paramTargetType, tgt [i].GetAttribute ("defaultValue"));
+
+                                       if (optSource != null) {
+                                               if (optTarget != null) {
+                                                       change.Append (" = ");
+                                                       if (srcValue != tgtValue) {
+                                                               change.AppendModified (srcValue, tgtValue, false);
+                                                       } else {
+                                                               change.Append (tgtValue);
+                                                       }
+                                               } else {
+                                                       change.AppendRemoved (" = " + srcValue);
+                                               }
+                                       } else {
+                                               if (optTarget != null)
+                                                       change.AppendAdded (" = " + tgtValue);
+                                       }
+                               }
+                       }
+
+                       change.Append (")");
+
+                       // Ignore any parameter name changes if requested.
+                       if (State.IgnoreParameterNameChanges && !change.Breaking) {
+                               change.AnyChange = false;
+                               change.HasIgnoredChanges = true;
+                       }
+               }
+
+               void RenderVTable (MethodAttributes source, MethodAttributes target, ApiChange change)
+               {
+                       var srcAbstract = (source & MethodAttributes.Abstract) == MethodAttributes.Abstract;
+                       var tgtAbstract = (target & MethodAttributes.Abstract) == MethodAttributes.Abstract;
+                       var srcFinal = (source & MethodAttributes.Final) == MethodAttributes.Final;
+                       var tgtFinal = (target & MethodAttributes.Final) == MethodAttributes.Final;
+                       var srcVirtual = (source & MethodAttributes.Virtual) == MethodAttributes.Virtual;
+                       var tgtVirtual = (target & MethodAttributes.Virtual) == MethodAttributes.Virtual;
+                       var srcOverride = (source & MethodAttributes.VtableLayoutMask) != MethodAttributes.NewSlot;
+                       var tgtOverride = (target & MethodAttributes.VtableLayoutMask) != MethodAttributes.NewSlot;
+
+                       var srcWord = srcVirtual ? (srcOverride ? "override" : "virtual") : string.Empty;
+                       var tgtWord = tgtVirtual ? (tgtOverride ? "override" : "virtual") : string.Empty;
+                       var breaking = srcWord.Length > 0 && tgtWord.Length == 0;
+
+                       if (srcAbstract) {
+                               if (tgtAbstract) {
+                                       change.Append ("abstract ");
+                               } else if (tgtVirtual) {
+                                       change.AppendModified ("abstract", tgtWord, false).Append (" ");
+                               } else {
+                                       change.AppendRemoved ("abstract").Append (" ");
+                               }
+                       } else {
+                               if (tgtAbstract) {
+                                       change.AppendAdded ("abstract", true).Append (" ");
+                               } else if (srcWord != tgtWord) {
+                                       if (!tgtFinal)
+                                               change.AppendModified (srcWord, tgtWord, breaking).Append (" ");
+                               } else if (tgtWord.Length > 0) {
+                                       change.Append (tgtWord).Append (" ");
+                               } else if (srcWord.Length > 0) {
+                                       change.AppendRemoved (srcWord, breaking).Append (" ");
+                               }
+                       }
+
+                       if (srcFinal) {
+                               if (tgtFinal) {
+                                       change.Append ("final ");
+                               } else {
+                                       change.AppendRemoved ("final", false).Append (" "); // removing 'final' is not a breaking change.
+                               }
+                       } else {
+                               if (tgtFinal && srcVirtual) {
+                                       change.AppendModified ("virtual", "final", true).Append (" "); // adding 'final' is a breaking change if the member was virtual
+                               }
+                       }
+
+                       if (!srcVirtual && !srcFinal && tgtVirtual && tgtFinal) {
+                               // existing member implements a member from a new interface
+                               // this would show up as 'virtual final', which is redundant, so show nothing at all.
+                               change.HasIgnoredChanges = true;
+                       }
+
+                       // Ignore non-breaking virtual changes.
+                       if (State.IgnoreVirtualChanges && !change.Breaking) {
+                               change.AnyChange = false;
+                               change.HasIgnoredChanges = true;
+                       }
+
+                       var tgtSecurity = (source & MethodAttributes.HasSecurity) == MethodAttributes.HasSecurity;
+                       var srcSecurity = (target & MethodAttributes.HasSecurity) == MethodAttributes.HasSecurity;
+
+                       if (tgtSecurity != srcSecurity)
+                               change.HasIgnoredChanges = true;
+
+                       var srcPInvoke = (source & MethodAttributes.PinvokeImpl) == MethodAttributes.PinvokeImpl;
+                       var tgtPInvoke = (target & MethodAttributes.PinvokeImpl) == MethodAttributes.PinvokeImpl;
+                       if (srcPInvoke != tgtPInvoke)
+                               change.HasIgnoredChanges = true;
+               }
+
+               protected string GetVisibility (MethodAttributes attr)
+               {
+                       switch (attr) {
+                       case MethodAttributes.Private:
+                       case MethodAttributes.PrivateScope:
+                               return "private";
+                       case MethodAttributes.Assembly:
+                               return "internal";
+                       case MethodAttributes.FamANDAssem:
+                               return "private internal";
+                       case MethodAttributes.FamORAssem:
+                               return "protected"; // customers don't care about 'internal';
+                       case MethodAttributes.Family:
+                               return "protected";
+                       case MethodAttributes.Public:
+                               return "public";
+                       default:
+                               throw new NotImplementedException ();
+                       }
+               }
+
+               protected void RenderVisibility (MethodAttributes source, MethodAttributes target, ApiChange diff)
+               {
+                       source = source & MethodAttributes.MemberAccessMask;
+                       target = target & MethodAttributes.MemberAccessMask;
+
+                       if (source == target) {
+                               diff.Append (GetVisibility (target));
+                       } else {
+                               var breaking = false;
+                               switch (source) {
+                               case MethodAttributes.Private:
+                               case MethodAttributes.Assembly:
+                               case MethodAttributes.FamANDAssem:
+                                       break; // these are not publicly visible, thus not breaking
+                               case MethodAttributes.FamORAssem:
+                               case MethodAttributes.Family:
+                                       switch (target) {
+                                       case MethodAttributes.Public:
+                                               // to public is not a breaking change
+                                               break;
+                                       case MethodAttributes.Family:
+                                       case MethodAttributes.FamORAssem:
+                                               // not a breaking change, but should still show up in diff
+                                               break;
+                                       default:
+                                               // anything else is a breaking change
+                                               breaking = true;
+                                               break;
+                                       }
+                                       break;
+                               case MethodAttributes.Public:
+                               default:
+                                       // any change from public is breaking.
+                                       breaking = true;
+                                       break;
+                               }
+
+                               diff.AppendModified (GetVisibility (source), GetVisibility (target), breaking);
+                       }
+                       diff.Append (" ");
+               }
+
+               protected void RenderStatic (MethodAttributes src, MethodAttributes tgt, ApiChange diff)
+               {
+                       var srcStatic = (src & MethodAttributes.Static) == MethodAttributes.Static;
+                       var tgtStatic = (tgt & MethodAttributes.Static) == MethodAttributes.Static;
+
+                       if (srcStatic != tgtStatic) {
+                               if (srcStatic) {
+                                       diff.AppendRemoved ("static", true).Append (" ");
+                               } else {
+                                       diff.AppendAdded ("static", true).Append (" ");
+                               }
+                       }
+               }
+
+               protected void RenderMethodAttributes (MethodAttributes src, MethodAttributes tgt, ApiChange diff)
+               {
+                       RenderStatic (src, tgt, diff);
+                       RenderVisibility (src & MethodAttributes.MemberAccessMask, tgt & MethodAttributes.MemberAccessMask, diff);
+                       RenderVTable (src, tgt, diff);
+               }
+
+               protected void RenderMethodAttributes (XElement source, XElement target, ApiChange diff)
+               {
+                       RenderMethodAttributes (source.GetMethodAttributes (), target.GetMethodAttributes (), diff);
+               }
+
+               protected void RemoveAttributes (XElement element)
+               {
+                       var srcAttributes = element.Element ("attributes");
+                       if (srcAttributes != null)
+                               srcAttributes.Remove ();
+
+                       foreach (var el in element.Elements ())
+                               RemoveAttributes (el);
+               }
+
+               protected void RenderAttributes (XElement source, XElement target, ApiChanges changes)
+               {
+                       var srcObsolete = source.GetObsoleteMessage ();
+                       var tgtObsolete = target.GetObsoleteMessage ();
+
+                       if (srcObsolete == tgtObsolete)
+                               return; // nothing changed
+
+                       if (srcObsolete == null) {
+                               if (tgtObsolete == null)
+                                       return; // neither is obsolete
+                               var change = new ApiChange ();
+                               change.Header = "Obsoleted " + GroupName;
+                               change.Append (string.Format ("<span class='obsolete obsolete-{0}' data-is-non-breaking>", ElementName));
+                               change.Append ("[Obsolete (");
+                               if (tgtObsolete != string.Empty)
+                                       change.Append ("\"").Append (tgtObsolete).Append ("\"");
+                               change.Append (")]\n");
+                               change.Append (GetDescription (target));
+                               change.Append ("</span>");
+                               change.AnyChange = true;
+                               changes.Add (source, target, change);
+                       } else if (tgtObsolete == null) {
+                               // Made non-obsolete. Do we care to report this?
+                       } else {
+                               // Obsolete message changed. Do we care to report this?
+                       }
+               }
+
+               protected void RenderName (XElement source, XElement target, ApiChange change)
+               {
+                       var name = target.GetAttribute ("name");
+                       // show the constructor as it would be defined in C#
+                       name = name.Replace (".ctor", State.Type);
+
+                       var p = name.IndexOf ('(');
+                       if (p >= 0)
+                               name = name.Substring (0, p);
+
+                       change.Append (name);
+               }
+
+       }
+}
diff --git a/mcs/tools/mono-api-html/MethodComparer.cs b/mcs/tools/mono-api-html/MethodComparer.cs
new file mode 100644 (file)
index 0000000..4c893e7
--- /dev/null
@@ -0,0 +1,77 @@
+// 
+// Authors
+//    Sebastien Pouliot  <sebastien@xamarin.com>
+//
+// Copyright 2013 Xamarin Inc. http://www.xamarin.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.Linq;
+using System.Reflection;
+using System.Xml.Linq;
+
+namespace Xamarin.ApiDiff {
+
+       public class MethodComparer : ConstructorComparer {
+
+               public override string GroupName {
+                       get { return "methods"; }
+               }
+
+               public override string ElementName {
+                       get { return "method"; }
+               }
+
+               // operators have identical names but vary by return types
+               public override bool Find (XElement e)
+               {
+                       if (e.GetAttribute ("name") != Source.GetAttribute ("name"))
+                               return false;
+
+                       if (e.GetAttribute ("returntype") != Source.GetAttribute ("returntype"))
+                               return false;
+
+                       var eGP = e.Element ("generic-parameters");
+                       var sGP = Source.Element ("generic-parameters");
+
+                       if (eGP == null && sGP == null)
+                               return true;
+                       else if (eGP == null ^ sGP == null)
+                               return false;
+                       else {
+                               var eGPs = eGP.Elements ("generic-parameter");
+                               var sGPs = sGP.Elements ("generic-parameter");
+                               return eGPs.Count () == sGPs.Count ();
+                       }
+               }
+
+               protected override bool IsBreakingRemoval (XElement e)
+               {
+                       // Removing virtual methods that override another method is not a breaking change.
+                       var is_override = e.Attribute ("is-override");
+                       if (is_override != null)
+                               return is_override.Value != "true";
+                       
+                       return true; // all other removals are breaking changes
+               }
+       }
+}
\ No newline at end of file
diff --git a/mcs/tools/mono-api-html/NamespaceComparer.cs b/mcs/tools/mono-api-html/NamespaceComparer.cs
new file mode 100644 (file)
index 0000000..063e34e
--- /dev/null
@@ -0,0 +1,104 @@
+// 
+// Authors
+//    Sebastien Pouliot  <sebastien@xamarin.com>
+//
+// Copyright 2013 Xamarin Inc. http://www.xamarin.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.Collections.Generic;
+using System.IO;
+using System.Linq;
+using System.Xml.Linq;
+
+namespace Xamarin.ApiDiff {
+
+       public class NamespaceComparer : Comparer {
+
+               ClassComparer comparer;
+
+               public NamespaceComparer ()
+               {
+                       comparer =  new ClassComparer ();
+               }
+
+               public void Compare (XElement source, XElement target)
+               {
+                       var s = source.Element ("namespaces");
+                       var t = target.Element ("namespaces");
+                       if (XNode.DeepEquals (s, t))
+                               return;
+                       Compare (s.Elements ("namespace"), t.Elements ("namespace"));
+               }
+
+               public override void SetContext (XElement current)
+               {
+                       State.Namespace = current.Attribute ("name").Value;
+               }
+
+               public override void Added (XElement target, bool wasParentAdded)
+               {
+                       string name = target.Attribute ("name").Value;
+                       if (State.IgnoreNew.Any (re => re.IsMatch (name)))
+                               return;
+
+                       Output.WriteLine ("<!-- start namespace {0} --> <div> ", name);
+                       Output.WriteLine ("<h2>New Namespace {0}</h2>", name);
+                       Output.WriteLine ();
+                       // list all new types
+                       foreach (var addedType in target.Element ("classes").Elements ("class"))
+                               comparer.Added (addedType, true);
+                       Output.WriteLine ("</div> <!-- end namespace {0} -->", name);
+                       Output.WriteLine ();
+               }
+
+               public override void Modified (XElement source, XElement target, ApiChanges differences)
+               {
+                       var output = Output;
+                       State.Output = new StringWriter ();
+                       comparer.Compare (source, target);
+
+                       var s = Output.ToString ();
+                       State.Output = output;
+                       if (s.Length > 0) {
+                               var name = target.Attribute ("name").Value;
+                               Output.WriteLine ("<!-- start namespace {0} --> <div> ", name);
+                               Output.WriteLine ("<h2>Namespace {0}</h2>", name);
+                               Output.WriteLine (s);
+                               Output.WriteLine ("</div> <!-- end namespace {0} -->", name);
+                       }
+               }
+
+               public override void Removed (XElement source)
+               {
+                       var name = source.Attribute ("name").Value;
+                       Output.WriteLine ("<!-- start namespace {0} --> <div>", name);
+                       Output.WriteLine ("<h2>Removed Namespace {0}</h2>", name);
+                       Output.WriteLine ();
+                       // list all removed types
+                       foreach (var removedType in source.Element ("classes").Elements ("class"))
+                               comparer.Removed (removedType);
+                       Output.WriteLine ("</div> <!-- end namespace {0} -->", name);
+                       Output.WriteLine ();
+               }
+       }
+}
\ No newline at end of file
diff --git a/mcs/tools/mono-api-html/PropertyComparer.cs b/mcs/tools/mono-api-html/PropertyComparer.cs
new file mode 100644 (file)
index 0000000..f51dd23
--- /dev/null
@@ -0,0 +1,254 @@
+// 
+// Authors
+//    Sebastien Pouliot  <sebastien@xamarin.com>
+//
+// Copyright 2013 Xamarin Inc. http://www.xamarin.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.Collections.Generic;
+using System.Reflection;
+using System.Text;
+using System.Xml.Linq;
+
+namespace Xamarin.ApiDiff {
+
+       public class PropertyComparer : MemberComparer {
+
+               public override string GroupName {
+                       get { return "properties"; }
+               }
+
+               public override string ElementName {
+                       get { return "property"; }
+               }
+
+               public override bool Find (XElement e)
+               {
+                       if (!base.Find (e))
+                               return false;
+                       // the same Item (indexer) property can have different parameters
+                       return e.GetAttribute ("params") == Source.GetAttribute ("params");
+               }
+
+               void GetAccessors (XElement element, out XElement getter, out XElement setter)
+               {
+                       var methods = element.Element ("methods");
+
+                       getter = null;
+                       setter = null;
+
+                       if (methods == null)
+                               return;
+                               
+                       foreach (var m in methods.Elements ("method")) {
+                               var n = m.GetAttribute ("name");
+                               if (n.StartsWith ("get_", StringComparison.Ordinal)) {
+                                       getter = m;
+                               } else if (n.StartsWith ("set_", StringComparison.Ordinal)) {
+                                       setter = m;
+                               }
+                       }
+               }
+
+               MethodAttributes GetMethodAttributes (XElement getter, XElement setter)
+               {
+                       if (getter == null)
+                               return setter.GetMethodAttributes ();
+                       else if (setter == null)
+                               return getter.GetMethodAttributes ();
+
+                       var gAttr = getter.GetMethodAttributes ();
+                       var sAttr = setter.GetMethodAttributes ();
+                       var g = gAttr & MethodAttributes.MemberAccessMask;
+                       var s = sAttr & MethodAttributes.MemberAccessMask;
+                       // Visibility is ordered numerically (higher value = more visible).
+                       // We want the most visible.
+                       var visibility = (MethodAttributes) Math.Max ((int) g, (int) s);
+                       // Do a bitwise or with the rest of the flags
+                       var g_no_visibility = gAttr & ~MethodAttributes.MemberAccessMask;
+                       var s_no_visibility = sAttr & ~MethodAttributes.MemberAccessMask;
+                       return g_no_visibility | s_no_visibility | visibility;
+               }
+
+               void RenderPropertyType (XElement source, XElement target, ApiChange change)
+               {
+                       var srcType = source.GetTypeName ("ptype");
+                       var tgtType = target.GetTypeName ("ptype");
+
+                       if (srcType == tgtType) {
+                               change.Append (tgtType);
+                       } else {
+                               change.AppendModified (srcType, tgtType, true);
+                       }
+                       change.Append (" ");
+               }
+
+               void RenderAccessors (XElement srcGetter, XElement tgtGetter, XElement srcSetter, XElement tgtSetter, ApiChange change)
+               {
+                       // FIXME: this doesn't render changes in the accessor visibility (a protected setter can become public for instance).
+                       change.Append (" {");
+                       if (tgtGetter != null) {
+                               if (srcGetter != null) {
+                                       change.Append (" ").Append ("get;");
+                               } else {
+                                       change.Append (" ").AppendAdded ("get;");
+                               }
+                       } else if (srcGetter != null) {
+                               change.Append (" ").AppendRemoved ("get;");
+                       }
+
+                       if (tgtSetter != null) {
+                               if (srcSetter != null) {
+                                       change.Append (" ").Append ("set;");
+                               } else {
+                                       change.Append (" ").AppendAdded ("set;");
+                               }
+                       } else if (srcSetter != null) {
+                               change.Append (" ").AppendRemoved ("set;");
+                       }
+
+                       change.Append (" }");
+
+                       // Ignore added property setters if asked to
+                       if (srcSetter == null && tgtSetter != null && State.IgnoreAddedPropertySetters && !change.Breaking) {
+                               change.AnyChange = false;
+                               change.HasIgnoredChanges = true;
+                       }
+               }
+
+               void RenderIndexers (List<XElement> srcIndexers, List<XElement> tgtIndexers, ApiChange change)
+               {
+                       change.Append ("this [");
+                       for (int i = 0; i < srcIndexers.Count; i++) {
+                               var source = srcIndexers [i];
+                               var target = tgtIndexers [i];
+
+                               if (i > 0)
+                                       change.Append (", ");
+
+                               var srcType = source.GetTypeName ("type");
+                               var tgtType = target.GetTypeName ("type");
+                               if (srcType == tgtType) {
+                                       change.Append (tgtType);
+                               } else {
+                                       change.AppendModified (srcType, tgtType, true);
+                               }
+                               change.Append (" ");
+
+                               var srcName = source.GetAttribute ("name");
+                               var tgtName = target.GetAttribute ("name");
+                               if (srcName == tgtName) {
+                                       change.Append (tgtName);
+                               } else {
+                                       change.AppendModified (srcName, tgtName, true);
+                               }
+                       }
+                       change.Append ("]");
+               }
+
+               public override bool Equals (XElement source, XElement target, ApiChanges changes)
+               {
+                       if (base.Equals (source, target, changes))
+                               return true;
+
+                       XElement srcGetter, srcSetter;
+                       XElement tgtGetter, tgtSetter;
+                       GetAccessors (source, out srcGetter, out srcSetter);
+                       GetAccessors (target, out tgtGetter, out tgtSetter);
+
+                       List<XElement> srcIndexers = null;
+                       List<XElement> tgtIndexers = null;
+                       bool isIndexer = false;
+                       if (srcGetter != null) {
+                               srcIndexers = srcGetter.DescendantList ("parameters", "parameter");
+                               tgtIndexers = tgtGetter.DescendantList ("parameters", "parameter");
+                               isIndexer = srcIndexers != null && srcIndexers.Count > 0;
+                       }
+
+                       var change = new ApiChange ();
+                       change.Header = "Modified " + GroupName;
+                       RenderMethodAttributes (GetMethodAttributes (srcGetter, srcSetter), GetMethodAttributes (tgtGetter, tgtSetter), change);
+                       RenderPropertyType (source, target, change);
+                       if (isIndexer) {
+                               RenderIndexers (srcIndexers, tgtIndexers, change);
+                       } else {
+                               RenderName (source, target, change);
+                       }
+                       RenderGenericParameters (source, target, change);
+                       RenderAccessors (srcGetter, tgtGetter, srcSetter, tgtSetter, change);
+
+                       changes.Add (source, target, change);
+
+                       return false;
+               }
+
+               void GetProperties (XElement e, out bool @virtual, out bool @override, out bool @static, out bool getter, out bool setter, out bool family)
+               {
+                       @virtual = @override = @static = getter = setter = family = false;
+
+                       var methods = e.Element ("methods");
+                       if (methods != null) {
+                               foreach (var m in methods.Elements ("method")) {
+                                       @virtual |= m.IsTrue ("virtual");
+                                       @static |= m.IsTrue ("static");
+                                       var n = m.GetAttribute ("name");
+                                       getter |= n.StartsWith ("get_", StringComparison.Ordinal);
+                                       setter |= n.StartsWith ("set_", StringComparison.Ordinal);
+                                       var attribs = (MethodAttributes) Int32.Parse (m.GetAttribute ("attrib"));
+                                       family = ((attribs & MethodAttributes.Public) != MethodAttributes.Public);
+                                       @override |= (attribs & MethodAttributes.NewSlot) == 0;
+                               }
+                       }
+               }
+
+               public override string GetDescription (XElement e)
+               {
+                       string name = e.Attribute ("name").Value;
+                       string ptype = e.GetTypeName ("ptype");
+
+                       bool virt = false;
+                       bool over = false;
+                       bool stat = false;
+                       bool getter = false;
+                       bool setter = false;
+                       bool family = false;
+                       GetProperties (e, out virt, out over, out stat, out getter, out setter, out family);
+
+                       var sb = new StringBuilder ();
+
+                       sb.Append (family ? "protected " : "public ");
+                       if (virt && !State.IgnoreVirtualChanges)
+                               sb.Append (over ? "override " : "virtual ");
+                       else if (stat)
+                               sb.Append ("static ");
+                       sb.Append (ptype).Append (' ').Append (name).Append (" { ");
+                       if (getter)
+                               sb.Append ("get; ");
+                       if (setter)
+                               sb.Append ("set; ");
+                       sb.Append ("}");
+
+                       return sb.ToString ();
+               }
+       }
+}
\ No newline at end of file
diff --git a/mcs/tools/mono-api-html/mono-api-html.csproj b/mcs/tools/mono-api-html/mono-api-html.csproj
new file mode 100644 (file)
index 0000000..6ac0f24
--- /dev/null
@@ -0,0 +1,57 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <ProductVersion>8.0.30703</ProductVersion>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{D25986E2-7A41-4966-A26D-5614BAC7B8A7}</ProjectGuid>
+    <OutputType>Exe</OutputType>
+    <RootNamespace>Xamarin.ApiDiff</RootNamespace>
+    <AssemblyName>mono-api-html</AssemblyName>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+    <DebugSymbols>true</DebugSymbols>
+    <DebugType>full</DebugType>
+    <Optimize>false</Optimize>
+    <OutputPath>bin\Debug</OutputPath>
+    <DefineConstants>DEBUG;</DefineConstants>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+    <ConsolePause>false</ConsolePause>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+    <DebugType>full</DebugType>
+    <Optimize>true</Optimize>
+    <OutputPath>bin\Release</OutputPath>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+    <Externalconsole>true</Externalconsole>
+  </PropertyGroup>
+  <ItemGroup>
+    <Reference Include="System" />
+    <Reference Include="System.Xml.Linq" />
+    <Reference Include="System.Xml" />
+    <Reference Include="System.Core" />
+  </ItemGroup>
+  <ItemGroup>
+    <Compile Include="Helpers.cs" />
+    <Compile Include="InterfaceComparer.cs" />
+    <Compile Include="NamespaceComparer.cs" />
+    <Compile Include="MemberComparer.cs" />
+    <Compile Include="FieldComparer.cs" />
+    <Compile Include="PropertyComparer.cs" />
+    <Compile Include="EventComparer.cs" />
+    <Compile Include="MethodComparer.cs" />
+    <Compile Include="ConstructorComparer.cs" />
+    <Compile Include="Comparer.cs" />
+    <Compile Include="AssemblyComparer.cs" />
+    <Compile Include="ClassComparer.cs" />
+    <Compile Include="ApiDiff.cs" />
+    <Compile Include="..\..\..\class\Mono.Options\Mono.Options\Options.cs">
+      <Link>Options.cs</Link>
+    </Compile>
+    <Compile Include="ApiChange.cs" />
+  </ItemGroup>
+  <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
+</Project>
diff --git a/mcs/tools/mono-api-html/mono-api-html.exe.sources b/mcs/tools/mono-api-html/mono-api-html.exe.sources
new file mode 100644 (file)
index 0000000..69a2679
--- /dev/null
@@ -0,0 +1,15 @@
+ApiChange.cs
+ApiDiff.cs
+AssemblyComparer.cs
+ClassComparer.cs
+Comparer.cs
+ConstructorComparer.cs
+EventComparer.cs
+FieldComparer.cs
+Helpers.cs
+InterfaceComparer.cs
+MemberComparer.cs
+MethodComparer.cs
+NamespaceComparer.cs
+PropertyComparer.cs
+../../class/Mono.Options/Mono.Options/Options.cs
index 36d7feb5946ff49b8c0053ea68c68ac987b0b1aa..fe3b52f8d213ba8d713445c79878e7347473d6aa 100644 (file)
@@ -2,11 +2,8 @@ thisdir = tools/mono-configuration-crypto/cli
 SUBDIRS = 
 include ../../../build/rules.make
 
-LOCAL_MCS_FLAGS = -r:Mono.Security.dll \
-                 -r:System.Security.dll \
-                 -r:System.Configuration.dll \
-                 -r:System.dll \
-                 -r:$(topdir)/class/lib/$(PROFILE)/Mono.Configuration.Crypto.dll
+LOCAL_MCS_FLAGS =
+LIB_REFS = Mono.Security System.Security System.Configuration System Mono.Configuration.Crypto
 
 PROGRAM = mono-configuration-crypto.exe
 PROGRAM_INSTALL_DIR = $(mono_libdir)/mono/mono-configuration-crypto/$(FRAMEWORK_VERSION)
index 06351749f74360d7b70e454012f6367ba069a49f..d06b52ae235c72d16a707948b4af176374ccfb57 100644 (file)
@@ -2,7 +2,8 @@ thisdir = tools/mono-configuration-crypto/lib
 SUBDIRS =
 include ../../../build/rules.make
 
-LOCAL_MCS_FLAGS = -r:System.dll -r:Mono.Security.dll -r:System.Security.dll -r:System.Configuration.dll -r:System.Xml.dll
+LOCAL_MCS_FLAGS =
+LIB_REFS = System Mono.Security System.Security System.Configuration System.Xml
 LIBRARY = Mono.Configuration.Crypto.dll
 LIBRARY_INSTALL_DIR = $(mono_libdir)/mono/mono-configuration-crypto/$(FRAMEWORK_VERSION)
 
index 7e8331eb46acbb1864fa0614bd835a1b7656c49b..84286e7f95fffbf75b4559235ea776e10005d7c5 100644 (file)
@@ -4,9 +4,12 @@ include ../../build/rules.make
 
 PROGRAM = mono-service.exe
 
+PROGRAM_SNK = ../../class/mono.snk
+
 include ../../build/executable.make
 
-LOCAL_MCS_FLAGS = -r:System.ServiceProcess.dll -r:Mono.Posix.dll -r:System.dll -unsafe
+LOCAL_MCS_FLAGS = -unsafe -publicsign
+LIB_REFS = System.ServiceProcess Mono.Posix System
 
 # Copied from library.make
 
index e4e4b557eb431584db275f77fa28bba95f6f1a34..2bfc65599d9abfef1c2b5cf6509dd0b420b0ca71 100644 (file)
@@ -2,7 +2,8 @@ thisdir = tools/mono-shlib-cop
 SUBDIRS = 
 include ../../build/rules.make
 
-LOCAL_MCS_FLAGS = -r:Mono.Posix.dll -r:System.dll -r:System.Xml.dll
+LOCAL_MCS_FLAGS =
+LIB_REFS = Mono.Posix System System.Xml
 
 PROGRAM = mono-shlib-cop.exe
 
index 35cdfd88a39e21ee4d503c0316bbc2c31577d1a7..1a621f6f825d481048b2f70abf119b4d4a9c925b 100644 (file)
@@ -4,12 +4,9 @@ include ../../build/rules.make
 
 PROGRAM = mono-symbolicate.exe
 
-LOCAL_MCS_FLAGS = \
-       /r:Mono.Cecil.dll       \
-       /r:Mono.CompilerServices.SymbolWriter.dll \
-       /r:System.Xml.dll \
-       /r:System.Core.dll \
-       /r:System.dll
+LOCAL_MCS_FLAGS =
+
+LIB_REFS = Mono.Cecil Mono.CompilerServices.SymbolWriter System.Xml System.Core System
 
 include ../../build/executable.make
 
@@ -36,10 +33,10 @@ CHECK_DIFF = @\
                exit 1; \
        fi
 
-BUILD_TEST_EXE = @\
+BUILD_TEST_EXE = \
        rm -rf $(OUT_DIR); \
        mkdir -p $(OUT_DIR); \
-       $(MCS) -debug $(TEST_CS) -out:$(TEST_EXE)
+       $(CSCOMPILE) $(TEST_CS) -out:$(TEST_EXE)
 
 check: test-local
 
index fc39f8298abdbf07eab940cdece113ab7c772e1e..7439a2eb9dd8ee3ce2314e11386db963ed15ee44 100644 (file)
@@ -2,7 +2,8 @@ thisdir = tools/mono-xmltool
 SUBDIRS = 
 include ../../build/rules.make
 
-LOCAL_MCS_FLAGS = -r:System.Xml.dll -r:Commons.Xml.Relaxng.dll
+LOCAL_MCS_FLAGS =
+LIB_REFS = System.Xml Commons.Xml.Relaxng
 PROGRAM = mono-xmltool.exe
 
 include ../../build/executable.make
index 85a08599fa7d107700ba39bbac25c04e7b8baa75..d9e77ac82512e62478431fa12d1092bb544bf101 100644 (file)
@@ -2,7 +2,8 @@ thisdir = tools/mono-xsd
 SUBDIRS = 
 include ../../build/rules.make
 
-LOCAL_MCS_FLAGS = -r:System.Xml.dll -r:System.Data.dll -r:System.dll
+LOCAL_MCS_FLAGS =
+LIB_REFS = System.Xml System.Data System
 PROGRAM = xsd.exe
 
 include ../../build/executable.make
index 280122793695abea4a0cd10aafaa9e5633736d35..4e84d9916fa15b756445b5148fe51d1faa292c17 100644 (file)
@@ -3,7 +3,8 @@ SUBDIRS =
 include ../../build/rules.make
 
 PROGRAM = monop.exe
-LOCAL_MCS_FLAGS += -d:NO_AUTHENTICODE,STATIC,NO_SYMBOL_WRITER -r:System.dll
+LOCAL_MCS_FLAGS += -d:NO_AUTHENTICODE,STATIC,NO_SYMBOL_WRITER
+LIB_REFS = System
 
 CLEAN_FILES = monop.exe monop2.exe *.mdb
 
index 61339b1a5cc54c0208bfdce507a971cbec418648..6e78792b5868ab5d47e7e593029a76e477b4c81a 100644 (file)
@@ -3,8 +3,8 @@ SUBDIRS =
 include ../../build/rules.make
 NO_TESTS = yes
 
-BUILD_FRAMEWORK = Microsoft.Build.Framework.dll
-BUILD_NEW_ENGINE = Microsoft.Build.dll
+BUILD_FRAMEWORK = Microsoft.Build.Framework
+BUILD_NEW_ENGINE = Microsoft.Build
 INSTALL_FRAMEWORK_VERSION = $(FRAMEWORK_VERSION)
 
 include ../xbuild/xbuild.make
@@ -16,13 +16,12 @@ else
 ifeq (4, $(FRAMEWORK_VERSION_MAJOR))
 NAME_SUFFIX = .v4.0
 ASSEMBLY_VERSION = 4.0.0.0
-BUILD_FRAMEWORK := $(topdir)/class/lib/$(PROFILE)/$(BUILD_FRAMEWORK)
-BUILD_NEW_ENGINE := $(topdir)/class/lib/$(PROFILE)/$(BUILD_NEW_ENGINE)
 INSTALL_FRAMEWORK_VERSION = 4.0
 endif
 endif
 
-LOCAL_MCS_FLAGS = -r:$(BUILD_FRAMEWORK) -r:$(BUILD_NEW_ENGINE)
+LOCAL_MCS_FLAGS =
+LIB_REFS = $(BUILD_FRAMEWORK) $(BUILD_NEW_ENGINE)
 PROGRAM = msbuild.exe
 
 include ../../build/executable.make
index 9dd062fe9c17d64b740cf05c7292407ce4e865c1..1d448c2915a429c91b9c5e1ee0fff76424ec6f93 100644 (file)
@@ -5,7 +5,8 @@ include ../../../build/rules.make
 LIBRARY = nunitlite.dll
 LIBRARY_SNK = ../../../../external/nunit-lite/NUnitLite-1.0.0/src/framework/nunit.snk
 
-LOCAL_MCS_FLAGS= /target:library /define:"__MOBILE__;TRACE;DEBUG;NET_4_0;CLR_4_0,NUNITLITE" /nostdlib -r:System.dll -r:System.Xml.dll -r:System.Core.dll -r:mscorlib.dll /warn:4 /noconfig /debug:full /debug+ /keyfile:$(LIBRARY_SNK) /optimize
+LOCAL_MCS_FLAGS= /target:library /define:"__MOBILE__;TRACE;DEBUG;NET_4_0;CLR_4_0,NUNITLITE" /warn:4 /keyfile:$(LIBRARY_SNK)
+LIB_REFS = System System.Xml System.Core
 
 NO_TEST = yes
 
index 920f74d29a5941b0702fda299a7ef8fa81c6f63c..c3697e420fce5135bb9f1e0e66f3dde69ec50913 100644 (file)
@@ -3,7 +3,8 @@ SUBDIRS =
 include ../../../build/rules.make
 
 PROGRAM = nunit-lite-console.exe
-LOCAL_MCS_FLAGS = /r:nunitlite.dll 
+LIB_REFS = nunitlite
+LOCAL_MCS_FLAGS =
 
 include ../../../build/executable.make
 
index 057ddabea6985815875497e7634b628b921ead29..3d3f647bc3c54b77ac49c284fef7d49601300748 100644 (file)
@@ -3,7 +3,8 @@ SUBDIRS =
 NO_INSTALL = 1
 include ../../build/rules.make
 
-LOCAL_MCS_FLAGS = -r:System.Xml.dll
+LOCAL_MCS_FLAGS =
+LIB_REFS = System.Xml
 
 EXTRA_DISTFILES = \
        Media/*.png             \
index 8de09cc43e9be603deef79feefa7a3821c0aefc3..0d2f377310c452dd2762799fa4a11315c6295f79 100644 (file)
@@ -4,10 +4,8 @@ include ../../build/rules.make
 
 PROGRAM = pdb2mdb.exe
 
-LOCAL_MCS_FLAGS = \
-       /r:Mono.Cecil.dll       \
-       /r:Mono.CompilerServices.SymbolWriter.dll \
-       /r:System.Core.dll
+LOCAL_MCS_FLAGS =
+LIB_REFS = Mono.Cecil Mono.CompilerServices.SymbolWriter System.Core
 
 
 EXTRA_DISTFILES = LICENSE
index 117f99231d7289d325329229c49bf7e458fe0ed6..2ccbf5869c73ee3b6fe5b67a5d0c46bca88d76bb 100644 (file)
@@ -6,7 +6,7 @@ PROGRAM = resgen.exe
 
 CLEAN_FILES = resgen.exe
 
-LOCAL_MCS_FLAGS = -r:System.dll -r:System.Xml.dll -r:System.Core.dll
+LIB_REFS = System System.Xml System.Core
 
 INSTALL_PROFILE := $(filter $(DEFAULT_PROFILE), $(PROFILE))
 ifndef INSTALL_PROFILE
index d75599dcee58228921d6ceb6e2e66d4f2a90114c..e4bfbb4d315122fddfa2005af3bfcc6458b5a0d5 100644 (file)
@@ -3,7 +3,8 @@ SUBDIRS =
 DIST_ONLY_SUBDIRS = certview
 include ../../build/rules.make
 
-LOCAL_MCS_FLAGS = /lib:$(topdir)/class/lib/$(PROFILE) -r:Mono.Security.dll -r:System.dll
+LOCAL_MCS_FLAGS = 
+LIB_REFS = Mono.Security System
 
 SECURITY_PROGRAMS = secutil.exe cert2spc.exe sn.exe makecert.exe chktrust.exe crlupdate.exe \
        signcode.exe setreg.exe certmgr.exe caspol.exe permview.exe mozroots.exe cert-sync.exe
@@ -58,10 +59,10 @@ clean-local:
 dist-local: dist-default
 
 sn.exe $(topdir)/class/lib/$(PROFILE)/sn.exe: $(SN_SOURCES)
-       $(CSCOMPILE) /out:$@ $(SN_SOURCES)
+       $(CSCOMPILE) -r:$(topdir)/class/lib/$(PROFILE)/Mono.Security.dll /out:$@ $(SN_SOURCES)
 
 permview.exe: permview.cs
-       $(CSCOMPILE) $^ $(HELPER_SOURCES) -r:Mono.Cecil.dll
+       $(CSCOMPILE) $^ $(HELPER_SOURCES) -r:$(topdir)/class/lib/$(PROFILE)/Mono.Cecil.dll
 
 %.exe: %.cs $(HELPER_SOURCES)
-       $(CSCOMPILE) $^
+       $(CSCOMPILE) -r:$(topdir)/class/lib/$(PROFILE)/Mono.Security.dll -r:$(topdir)/class/lib/$(PROFILE)/System.dll $^
index 377d396f01544b966efe696ca173a29e879d9f05..aaa92049f4ba4c34224be91fa86eb12b9d0ced1d 100644 (file)
@@ -3,7 +3,8 @@ SUBDIRS =
 include ../../../build/rules.make
 
 RESGEN = resgen
-LOCAL_MCS_FLAGS = /lib:$(topdir)/class/lib /r:Mono.Security.dll /r:System.Xml.dll /win32icon:mono.ico
+LIB_REFS = Mono.Security System.Xml
+LOCAL_MCS_FLAGS = /win32icon:mono.ico
 
 # SWF isn't quite good enough to build this yet.
 
index bf5bd1c904e560af111c0b9f312dc980f7965fa9..e7750a2c11b4b525bc791204b3f18a5404e99621 100644 (file)
@@ -2,7 +2,8 @@ thisdir = tools/sgen
 SUBDIRS = 
 include ../../build/rules.make
 
-LOCAL_MCS_FLAGS = -r:System.Xml.dll -r:System.dll
+LOCAL_MCS_FLAGS =
+LIB_REFS = System.Xml System
 PROGRAM = sgen.exe
 
 include ../../build/executable.make
index 2fccb32ad59c2b328baf0f9c6580dd532e29a446..1fc6cb2763e6cd3e6b52d59ee4b07bd7d3b92cde 100644 (file)
@@ -2,7 +2,8 @@ thisdir = tools/soapsuds
 SUBDIRS = 
 include ../../build/rules.make
 
-LOCAL_MCS_FLAGS = -r:System.Runtime.Remoting.dll -r:System.dll
+LOCAL_MCS_FLAGS =
+LIB_REFS = System.Runtime.Remoting System
 PROGRAM = soapsuds.exe
 
 include ../../build/executable.make
index 7bd68482312e9491925aa0ebcd7e03e933e5e54e..6be257edd226798b815e1c859abc4c628edf6d16 100644 (file)
@@ -11,30 +11,21 @@ LOCAL_MCS_FLAGS = \
        -resource:$(dbmetal_src)/Language/EnglishWords.txt,$(ns).EnglishWords.txt \
        -resource:$(dbmetal_src)/Language/FrenchWords.txt,$(ns).FrenchWords.txt   \
        -resource:$(dbmetal_src)/Language/GermanWords.txt,$(ns).GermanWords.txt   \
-       -r:System.Configuration.dll                                             \
-       -r:System.Core.dll                                                      \
-       -r:System.Data.dll                                                      \
-       -r:System.Data.Linq.dll                                                 \
-       -r:System.Xml.dll \
-       -r:System.dll
+       -publicsign
 
+LIB_REFS = System.Configuration System.Core System.Data System.Data.Linq System.Xml System
+       
 SQLMETAL_RESOURCES = \
        $(dbmetal_src)/Language/EnglishWords.txt \
        $(dbmetal_src)/Language/FrenchWords.txt  \
        $(dbmetal_src)/Language/GermanWords.txt
 
-SQLMETAL_TEST_FILES = \
-       Test/AssemblyInfo.cs
-
 EXTRA_DISTFILES = \
-       $(SQLMETAL_RESOURCES) \
-       $(SQLMETAL_TEST_FILES)
+       $(SQLMETAL_RESOURCES)
 
 PROGRAM = sqlmetal.exe
 
 $(PROGRAM) : Makefile $(SQLMETAL_RESOURCES)
 
-HAS_NUNIT_TEST = yes
-
 include ../../build/executable.make
 
diff --git a/mcs/tools/sqlmetal/Test/.gitattributes b/mcs/tools/sqlmetal/Test/.gitattributes
deleted file mode 100644 (file)
index f7d8287..0000000
+++ /dev/null
@@ -1 +0,0 @@
-/AssemblyInfo.cs -crlf
diff --git a/mcs/tools/sqlmetal/Test/AssemblyInfo.cs b/mcs/tools/sqlmetal/Test/AssemblyInfo.cs
deleted file mode 100644 (file)
index 5ff26a5..0000000
+++ /dev/null
@@ -1,42 +0,0 @@
-//\r
-// AssemblyInfo.cs\r
-//\r
-// Author:\r
-//   Jonathan Pryor  <jpryor@novell.com>\r
-//\r
-// Copyright (C) 2009 Novell, Inc.\r
-//\r
-\r
-//\r
-// Permission is hereby granted, free of charge, to any person obtaining\r
-// a copy of this software and associated documentation files (the\r
-// "Software"), to deal in the Software without restriction, including\r
-// without limitation the rights to use, copy, modify, merge, publish,\r
-// distribute, sublicense, and/or sell copies of the Software, and to\r
-// permit persons to whom the Software is furnished to do so, subject to\r
-// the following conditions:\r
-// \r
-// The above copyright notice and this permission notice shall be\r
-// included in all copies or substantial portions of the Software.\r
-// \r
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,\r
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\r
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\r
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\r
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\r
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\r
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r
-//\r
-\r
-using System;\r
-using System.Reflection;\r
-using System.Runtime.CompilerServices;\r
-\r
-[assembly: AssemblyTitle ("sqlmetal_test")]\r
-[assembly: AssemblyDescription ("sqlmetal.exe Unit Tests")]\r
-[assembly: AssemblyDefaultAlias ("SqlMetal_test.dll")]\r
-\r
-[assembly: CLSCompliant (true)]\r
-\r
-// Unit tests needs access to the DbLinq internals\r
-\r
index 042e97b92a31ca95e2b8554eccc8ed8146943ea5..88ad1f8d9b5cca744ae8ae233bec051b2a7d20fa 100644 (file)
@@ -2,7 +2,8 @@ thisdir = tools/SqlSharp
 SUBDIRS = 
 include ../../build/rules.make
 
-LOCAL_MCS_FLAGS = -r:System.dll -r:System.Xml.dll -r:System.Data.dll
+LOCAL_MCS_FLAGS =
+LIB_REFS = System System.Xml System.Data
 PROGRAM = sqlsharp.exe
 
 EXTRA_DISTFILES = README
index cf174fe39794ccb28d2282f4c16f50d258cea44d..b194a5b144d5fbda9d79c1408da449490ca2134f 100644 (file)
@@ -2,14 +2,8 @@ thisdir = tools/svcutil
 SUBDIRS = 
 include ../../build/rules.make
 
-LOCAL_MCS_FLAGS = \
-       -r:System.Core.dll \
-       -r:System.Runtime.Serialization.dll \
-       -r:System.ServiceModel.dll \
-       -r:System.Web.Services.dll \
-       -r:System.Configuration.dll \
-       -r:System.dll \
-       -r:System.Xml.dll
+LOCAL_MCS_FLAGS =
+LIB_REFS = System.Core System.Runtime.Serialization System.ServiceModel System.Web.Services System.Configuration System System.Xml
        
 PROGRAM = svcutil.exe
 
index bfc24a16c459ce42a05b821a4e7ef530b6024f46..c364223deb0419d3df72bd4ed047101a2d167dd7 100644 (file)
@@ -3,10 +3,8 @@ SUBDIRS =
 DEP_DIRS = linker
 include ../../build/rules.make
 
-CECIL = $(topdir)/class/lib/$(PROFILE)/Mono.Cecil.dll
-LINKER = $(topdir)/class/lib/$(PROFILE)/monolinker.exe
-
-LOCAL_MCS_FLAGS = -r:System.dll -r:System.Core.dll -r:System.Xml.dll -r:$(LINKER) -r:$(CECIL)
+LOCAL_MCS_FLAGS = -r:$(topdir)/class/lib/$(PROFILE)/monolinker.exe
+LIB_REFS = System System.Core System.Xml Mono.Cecil
 
 LIBRARY = Mono.Tuner.dll
 
index f60bd4dc20d4c1cd61681928bdddd067640e222d..8291f0b21c951803f3f3105c216c8f8a431e8681 100644 (file)
@@ -4,6 +4,7 @@ include ../../build/rules.make
 
 PROGRAM = txt2sr.exe
 
+LIB_REFS = System
 LOCAL_MCS_FLAGS =
 
 include ../../build/executable.make
index bf30b54e865782da427ced9d9f0753168f2c6a7f..7a103203f23c7d6c877e04d6ea779d397c83ab84 100644 (file)
@@ -38,6 +38,7 @@ public class Program
                public bool ShowHelp { get; set; }
                public bool Verbose { get; set; }
                public List<string> ResourcesStrings { get; }
+               public bool IgnoreSemicolon { get; set; }
 
                public CmdOptions ()
                {
@@ -55,7 +56,9 @@ public class Program
                        { "h|help",  "Display available options", 
                                v => options.ShowHelp = v != null },
                        { "v|verbose",  "Use verbose output", 
-                               v => options.Verbose = v != null },                     
+                               v => options.Verbose = v != null },
+                       { "ignore-semicolon", "Reads lines starting with semicolon",
+                               v => options.IgnoreSemicolon = v != null },
                };
 
                List<string> extra;
@@ -142,14 +145,22 @@ public class Program
 
                        foreach (var l in File.ReadLines (fileName)) {
                                var line = l.Trim ();
-                               if (line.Length == 0 || line [0] == '#' || line [0] == ';')
+                               if (line.Length == 0 || line [0] == '#')
                                        continue;
 
+                               int start = 0;
+                               if (line [0] == ';') {
+                                       if (!options.IgnoreSemicolon)
+                                               continue;
+
+                                       start = 1;
+                               }
+
                                var epos = line.IndexOf ('=');
                                if (epos < 0)
                                        continue;
 
-                               var key = line.Substring (0, epos).Trim ();
+                               var key = line.Substring (start, epos - start).Trim ();
                                if (key.Contains (" "))
                                        continue;
 
index 786c81885f058917cf44cce45d1416c33a07b8ea..293cf9d2811497344bac95184a292e9936e12289 100644 (file)
@@ -2,7 +2,8 @@ thisdir = tools/wsdl
 SUBDIRS = 
 include ../../build/rules.make
 
-LOCAL_MCS_FLAGS = -r:System.Xml.dll -r:System.Web.Services.dll -r:System.dll
+LOCAL_MCS_FLAGS =
+LIB_REFS = System.Xml System.Web.Services System
 
 PROGRAM = wsdl.exe
 
index 0ca5126a6d42fd4da33a7267f4956c5f57f14441..70457756436001b8c749fe9c846bd6e0a218c05c 100644 (file)
@@ -5,7 +5,8 @@ NO_TESTS = yes
 
 include xbuild.make
 
-LOCAL_MCS_FLAGS = -r:$(XBUILD_FRAMEWORK) -r:$(XBUILD_UTILITIES) -r:$(XBUILD_ENGINE) -r:$(XBUILD_MSTASKS) -r:System.dll -r:System.Core.dll
+LOCAL_MCS_FLAGS =
+LIB_REFS = $(XBUILD_FRAMEWORK) $(XBUILD_UTILITIES) $(XBUILD_ENGINE) $(XBUILD_MSTASKS) $(PARENT_PROFILE)System $(PARENT_PROFILE)System.Core
 PROGRAM = xbuild.exe
 
 include ../../build/executable.make
index bf44c515970b467421ac6bcb6a1a6df5874fd203..44ac70d2f963f328fd8bb2ad840912446e262454 100644 (file)
@@ -510,8 +510,8 @@ namespace Mono.XBuild.CommandLine {
                                if (solutionTarget.Configuration == targetInfo.Key.Configuration &&
                                                solutionTarget.Platform == targetInfo.Key.Platform) {
                                        solutionConfigurationContents.AppendFormat (
-                                                       "<ProjectConfiguration Project=\"{0}\">{1}|{2}</ProjectConfiguration>",
-                                       guid.ToString ("B").ToUpper (), targetInfo.Value.Configuration, targetInfo.Value.Platform);
+                                                       "<ProjectConfiguration Project=\"{0}\" AbsolutePath=\"{1}\">{2}|{3}</ProjectConfiguration>",
+                                                       guid.ToString ("B").ToUpper (), projectInfo.FileName, targetInfo.Value.Configuration, targetInfo.Value.Platform);
                                }
                        }
                }
index 7247c7f8b0d1b04d7f52adefd0962d68fff07bc1..cda9d9b0e61b012485cc2b2ac2a17379bda9d1c9 100644 (file)
@@ -6,13 +6,13 @@ ifeq (14.0, $(XBUILD_VERSION))
 NAME_SUFFIX = .Core
 endif
 
-XBUILD_FRAMEWORK := $(topdir)/class/lib/$(PROFILE)/Microsoft.Build.Framework.dll
-XBUILD_ENGINE := $(topdir)/class/lib/$(PROFILE)/Microsoft.Build.Engine.dll
-XBUILD_UTILITIES := $(topdir)/class/lib/$(PROFILE)/Microsoft.Build.Utilities$(NAME_SUFFIX).dll
-XBUILD_TASKS := $(topdir)/class/lib/$(PROFILE)/Mono.XBuild.Tasks.dll
-XBUILD_MSTASKS := $(topdir)/class/lib/$(PROFILE)/Microsoft.Build.Tasks$(NAME_SUFFIX).dll
+XBUILD_FRAMEWORK := Microsoft.Build.Framework
+XBUILD_ENGINE := Microsoft.Build.Engine
+XBUILD_UTILITIES := Microsoft.Build.Utilities$(NAME_SUFFIX)
+XBUILD_TASKS := Mono.XBuild.Tasks
+XBUILD_MSTASKS := Microsoft.Build.Tasks$(NAME_SUFFIX)
 ifeq (14.0, $(XBUILD_VERSION))
-XBUILD_MSTASKS := $(topdir)/class/lib/$(PROFILE)/Microsoft.Build.Tasks.Core.dll
+XBUILD_MSTASKS := Microsoft.Build.Tasks.Core
 endif
 
 XBUILD_ASSEMBLY_VERSION = $(XBUILD_VERSION).0.0
index 93169cda59d4ba1ac7fb1a526b6a1b9a352bd489..71bfc07952fd368df01fbf19665f8e22a7fa0121 100644 (file)
@@ -2431,6 +2431,8 @@ unload_thread_main (void *arg)
        /* Force it to be attached to avoid racing during shutdown. */
        thread = mono_thread_attach_full (mono_get_root_domain (), TRUE, &error);
        mono_error_raise_exception (&error); /* FIXME don't raise here */
+       mono_thread_set_name_internal (thread->internal_thread, mono_string_new (mono_get_root_domain (), "Domain unloader"), TRUE, &error);
+       mono_error_raise_exception (&error); /* FIXME don't raise here */
 
        /* 
         * FIXME: Abort our parent thread last, so we can return a failure 
index 9e54462633cf92da422cb9e8d06a9783b4dae022..6b65259b962b437f20e121671fb189b8486219c3 100644 (file)
@@ -475,11 +475,14 @@ transport_start_receive (void)
 static guint32 WINAPI
 receiver_thread (void *arg)
 {
+       MonoError error;
        int res, content_len;
        guint8 buffer [256];
        guint8 *p, *p_end;
        MonoObject *exc;
 
+       mono_thread_info_set_name (mono_native_thread_id_get (), "Attach receiver");
+
        printf ("attach: Listening on '%s'...\n", server_uri);
 
        while (TRUE) {
@@ -490,11 +493,13 @@ receiver_thread (void *arg)
 
                printf ("attach: Connected.\n");
 
-               mono_thread_attach (mono_get_root_domain ());
+               MonoThread *thread = mono_thread_attach (mono_get_root_domain ());
+               mono_thread_set_name_internal (thread->internal_thread, mono_string_new (mono_get_root_domain (), "Attach receiver"), TRUE, &error);
+               mono_error_assert_ok (&error);
                /* Ask the runtime to not abort this thread */
                //mono_thread_current ()->flags |= MONO_THREAD_FLAG_DONT_MANAGE;
                /* Ask the runtime to not wait for this thread */
-               mono_thread_internal_current ()->state |= ThreadState_Background;
+               thread->internal_thread->state |= ThreadState_Background;
 
                while (TRUE) {
                        char *cmd, *agent_name, *agent_args;
index b86e7eda40ec5240dd839081662c19c752f968e6..bff89986c37acd3fa26b618a7b9768f6310950f9 100644 (file)
@@ -721,16 +721,6 @@ typedef struct {
        gboolean no_raise;
 } MonoJitICallInfo;
 
-typedef struct {
-       guint8 exception_type;
-       char *class_name; /* If kind == TYPE */
-       char *assembly_name; /* If kind == TYPE or ASSEMBLY */
-       MonoClass *klass; /* If kind != TYPE */
-       const char *member_name; /* If kind != TYPE */
-       gboolean ref_only; /* If kind == ASSEMBLY */
-       char *msg; /* If kind == BAD_IMAGE */
-} MonoLoaderError;
-
 void
 mono_class_setup_supertypes (MonoClass *klass);
 
@@ -1234,32 +1224,6 @@ mono_loader_lock_if_inited (void);
 void
 mono_loader_unlock_if_inited (void);
 
-void
-mono_loader_set_error_assembly_load (const char *assembly_name, gboolean ref_only);
-
-void
-mono_loader_set_error_type_load (const char *class_name, const char *assembly_name);
-
-void
-mono_loader_set_error_method_load (const char *class_name, const char *member_name);
-
-void
-mono_loader_set_error_field_load (MonoClass *klass, const char *member_name);
-void
-mono_loader_set_error_bad_image (char *msg);
-
-MonoException *
-mono_loader_error_prepare_exception (MonoLoaderError *error);
-
-MonoLoaderError *
-mono_loader_get_last_error (void);
-
-void
-mono_loader_clear_error    (void);
-
-void
-mono_loader_assert_no_error (void);
-
 void
 mono_reflection_init       (void);
 
index f7b36279f4af17942f00dd9af24aea8a7ba2e9b3..355d09916f80dd226ad46e488f59c7a1d8e956ef 100644 (file)
@@ -286,15 +286,10 @@ mono_class_from_typeref_checked (MonoImage *image, guint32 type_token, MonoError
 done:
        /* Generic case, should be avoided for when a better error is possible. */
        if (!res && mono_error_ok (error)) {
-               if (mono_loader_get_last_error ()) { /*FIXME plug the above to not leak errors*/
-                       mono_error_set_from_loader_error (error);
-               } else {
-                       char *name = mono_class_name_from_token (image, type_token);
-                       char *assembly = mono_assembly_name_from_token (image, type_token);
-                       mono_error_set_type_load_name (error, name, assembly, "Could not resolve type with token %08x", type_token);
-               }
+               char *name = mono_class_name_from_token (image, type_token);
+               char *assembly = mono_assembly_name_from_token (image, type_token);
+               mono_error_set_type_load_name (error, name, assembly, "Could not resolve type with token %08x", type_token);
        }
-       mono_loader_assert_no_error ();
        return res;
 }
 
@@ -1351,7 +1346,6 @@ mono_class_find_enum_basetype (MonoClass *klass, MonoError *error)
        mono_error_set_type_load_class (error, klass, "Could not find base type");
 
 fail:
-       mono_loader_assert_no_error ();
        return NULL;
 }
 
@@ -5035,59 +5029,6 @@ concat_two_strings_with_zero (MonoImage *image, const char *s1, const char *s2)
        return s;
 }
 
-static void
-set_failure_from_loader_error (MonoClass *klass, MonoLoaderError *error)
-{
-       gpointer exception_data = NULL;
-
-       switch (error->exception_type) {
-       case MONO_EXCEPTION_TYPE_LOAD:
-               exception_data = concat_two_strings_with_zero (klass->image, error->class_name, error->assembly_name);
-               break;
-
-       case MONO_EXCEPTION_MISSING_METHOD:
-               exception_data = concat_two_strings_with_zero (klass->image, error->class_name, error->member_name);
-               break;
-
-       case MONO_EXCEPTION_MISSING_FIELD: {
-               const char *name_space = error->klass->name_space ? error->klass->name_space : NULL;
-               const char *class_name;
-
-               if (name_space)
-                       class_name = g_strdup_printf ("%s.%s", name_space, error->klass->name);
-               else
-                       class_name = error->klass->name;
-
-               exception_data = concat_two_strings_with_zero (klass->image, class_name, error->member_name);
-               
-               if (name_space)
-                       g_free ((void*)class_name);
-               break;
-       }
-
-       case MONO_EXCEPTION_FILE_NOT_FOUND: {
-               const char *msg;
-
-               if (error->ref_only)
-                       msg = "Cannot resolve dependency to assembly '%s' because it has not been preloaded. When using the ReflectionOnly APIs, dependent assemblies must be pre-loaded or loaded on demand through the ReflectionOnlyAssemblyResolve event.";
-               else
-                       msg = "Could not load file or assembly '%s' or one of its dependencies.";
-
-               exception_data = concat_two_strings_with_zero (klass->image, msg, error->assembly_name);
-               break;
-       }
-
-       case MONO_EXCEPTION_BAD_IMAGE:
-               exception_data = error->msg;
-               break;
-
-       default :
-               g_assert_not_reached ();
-       }
-
-       mono_class_set_failure (klass, error->exception_type, exception_data);
-}
-
 /**
  * mono_class_init:
  * @class: the class to initialize
@@ -5193,7 +5134,7 @@ mono_class_init (MonoClass *klass)
        else
                if (!klass->size_inited){
                        mono_class_setup_fields (klass);
-                       if (mono_class_has_failure (klass) || mono_loader_get_last_error ())
+                       if (mono_class_has_failure (klass))
                                goto leave;
                }
                                
@@ -5302,8 +5243,6 @@ mono_class_init (MonoClass *klass)
                        mono_class_set_failure (klass, MONO_EXCEPTION_TYPE_LOAD, NULL);
                        goto leave;
                }
-               if (mono_loader_get_last_error ())
-                       goto leave;
                if (!klass->parent->vtable_size) {
                        /* FIXME: Get rid of this somehow */
                        mono_class_setup_vtable (klass->parent);
@@ -5311,8 +5250,6 @@ mono_class_init (MonoClass *klass)
                                mono_class_set_failure (klass, MONO_EXCEPTION_TYPE_LOAD, NULL);
                                goto leave;
                        }
-                       if (mono_loader_get_last_error ())
-                               goto leave;
                }
                first_iface_slot = klass->parent->vtable_size;
                if (mono_class_need_stelemref_method (klass))
@@ -5325,13 +5262,6 @@ mono_class_init (MonoClass *klass)
        if (mono_security_core_clr_enabled ())
                mono_security_core_clr_check_inheritance (klass);
 
-       if (mono_loader_get_last_error ()) {
-               if (!mono_class_has_failure (klass)) {
-                       set_failure_from_loader_error (klass, mono_loader_get_last_error ());
-               }
-               mono_loader_clear_error ();
-       }
-
        if (klass->generic_class && !mono_verifier_class_is_valid_generic_instantiation (klass))
                mono_class_set_failure (klass, MONO_EXCEPTION_TYPE_LOAD, g_strdup ("Invalid generic instantiation"));
 
@@ -5380,7 +5310,7 @@ mono_class_has_finalizer (MonoClass *klass)
                                 * ignores overrides.
                                 */
                                mono_class_setup_vtable (klass);
-                               if (mono_class_has_failure (klass) || mono_loader_get_last_error ())
+                               if (mono_class_has_failure (klass))
                                        cmethod = NULL;
                                else
                                        cmethod = klass->vtable [finalize_slot];
@@ -5765,7 +5695,6 @@ mono_class_create_from_typedef (MonoImage *image, guint32 type_token, MonoError
 
        if (mono_metadata_token_table (type_token) != MONO_TABLE_TYPEDEF || tidx > tt->rows) {
                mono_error_set_bad_image (error, image, "Invalid typedef token %x", type_token);
-               mono_loader_assert_no_error ();
                return NULL;
        }
 
@@ -5773,7 +5702,6 @@ mono_class_create_from_typedef (MonoImage *image, guint32 type_token, MonoError
 
        if ((klass = (MonoClass *)mono_internal_hash_table_lookup (&image->class_cache, GUINT_TO_POINTER (type_token)))) {
                mono_loader_unlock ();
-               mono_loader_assert_no_error ();
                return klass;
        }
 
@@ -5863,7 +5791,6 @@ mono_class_create_from_typedef (MonoImage *image, guint32 type_token, MonoError
                        mono_class_set_failure (klass, MONO_EXCEPTION_TYPE_LOAD, g_strdup (mono_error_get_message (error)));
                        mono_loader_unlock ();
                        mono_profiler_class_loaded (klass, MONO_PROFILE_FAILED);
-                       mono_loader_assert_no_error ();
                        return NULL;
                }
        }
@@ -5935,7 +5862,6 @@ mono_class_create_from_typedef (MonoImage *image, guint32 type_token, MonoError
                        mono_class_set_failure (klass, MONO_EXCEPTION_TYPE_LOAD, g_strdup (mono_error_get_message (error)));
                        mono_loader_unlock ();
                        mono_profiler_class_loaded (klass, MONO_PROFILE_FAILED);
-                       mono_loader_assert_no_error ();
                        return NULL;
                }
                klass->cast_class = klass->element_class = mono_class_from_mono_type (enum_basetype);
@@ -5950,7 +5876,6 @@ mono_class_create_from_typedef (MonoImage *image, guint32 type_token, MonoError
                mono_class_set_failure (klass, MONO_EXCEPTION_TYPE_LOAD, g_strdup_printf ("Could not load generic parameter constrains due to %s", mono_error_get_message (error)));
                mono_loader_unlock ();
                mono_profiler_class_loaded (klass, MONO_PROFILE_FAILED);
-               mono_loader_assert_no_error ();
                return NULL;
        }
 
@@ -5962,7 +5887,6 @@ mono_class_create_from_typedef (MonoImage *image, guint32 type_token, MonoError
        mono_loader_unlock ();
 
        mono_profiler_class_loaded (klass, MONO_PROFILE_OK);
-       mono_loader_assert_no_error ();
 
        return klass;
 
@@ -5970,7 +5894,6 @@ parent_failure:
        mono_class_setup_mono_type (klass);
        mono_loader_unlock ();
        mono_profiler_class_loaded (klass, MONO_PROFILE_FAILED);
-       mono_loader_assert_no_error ();
        return NULL;
 }
 
@@ -6635,7 +6558,6 @@ mono_type_retrieve_from_typespec (MonoImage *image, guint32 type_spec, MonoGener
                MonoType *inflated = inflate_generic_type (NULL, t, context, error);
 
                if (!mono_error_ok (error)) {
-                       mono_loader_assert_no_error ();
                        return NULL;
                }
 
@@ -7518,7 +7440,6 @@ mono_type_get_checked (MonoImage *image, guint32 type_token, MonoGenericContext
                MonoClass *klass = mono_class_get_checked (image, type_token, error);
 
                if (!klass) {
-                       mono_loader_assert_no_error ();
                        return NULL;
                }
 
@@ -7529,7 +7450,6 @@ mono_type_get_checked (MonoImage *image, guint32 type_token, MonoGenericContext
        type = mono_type_retrieve_from_typespec (image, type_token, context, &inflated, error);
 
        if (!type) {
-               mono_loader_assert_no_error ();
                return NULL;
        }
 
@@ -10078,17 +9998,8 @@ mono_class_get_exception_for_failure (MonoClass *klass)
                return mono_exception_from_name_msg (mono_defaults.corlib, "System", "InvalidProgramException", "");
        }
        default: {
-               MonoLoaderError *error;
-               MonoException *ex;
-               
-               error = mono_loader_get_last_error ();
-               if (error != NULL){
-                       ex = mono_loader_error_prepare_exception (error);
-                       return ex;
-               }
-               
                /* TODO - handle other class related failures */
-               return NULL;
+               return mono_get_exception_execution_engine ("Unknown class failure");
        }
        }
 }
index 88f1ea21b1950338417d4d9cd0f1f3b8c6b30a1c..08450558d9d27e9998da65efb7ea26943303570f 100644 (file)
@@ -97,7 +97,6 @@ GENERATE_GET_CLASS_WITH_CACHE (variant,    System, Variant)
 
 static GENERATE_GET_CLASS_WITH_CACHE (interface_type_attribute, System.Runtime.InteropServices, InterfaceTypeAttribute)
 static GENERATE_GET_CLASS_WITH_CACHE (guid_attribute, System.Runtime.InteropServices, GuidAttribute)
-static GENERATE_GET_CLASS_WITH_CACHE (com_visible_attribute, System.Runtime.InteropServices, ComVisibleAttribute)
 
 /* Upon creation of a CCW, only allocate a weak handle and set the
  * reference count to 0. If the unmanaged client code decides to addref and
index 332ac557d1ee77e5e5eb86213eb59ae6e47beda5..e2e162f702a1efeb69e0226a5a4ab8eedb4d52d4 100644 (file)
@@ -940,8 +940,10 @@ ves_icall_Mono_Runtime_GetNativeStackTrace (MonoException *exc)
 {
        char *trace;
        MonoString *res;
-       if (!exc)
-               mono_raise_exception (mono_get_exception_argument_null ("exception"));
+       if (!exc) {
+               mono_set_pending_exception (mono_get_exception_argument_null ("exception"));
+               return NULL;
+       }
 
        trace = mono_exception_get_native_backtrace (exc);
        res = mono_string_new (mono_domain_get (), trace);
index 148bbedee6444a74666934c4a37d4b5377e69b2e..bf02f2892b2e8ff3f8c0f544e2c3a08cf4dfa2b5 100644 (file)
@@ -748,6 +748,10 @@ finalize_domain_objects (DomainFinalizationReq *req)
 static guint32
 finalizer_thread (gpointer unused)
 {
+       MonoError error;
+       mono_thread_set_name_internal (mono_thread_internal_current (), mono_string_new (mono_get_root_domain (), "Finalizer"), FALSE, &error);
+       mono_error_assert_ok (&error);
+
        gboolean wait = TRUE;
 
        /* Register a hazard free queue pump callback */
@@ -823,7 +827,6 @@ void
 mono_gc_init_finalizer_thread (void)
 {
        gc_thread = mono_thread_create_internal (mono_domain_get (), finalizer_thread, NULL, FALSE, 0);
-       ves_icall_System_Threading_Thread_SetName_internal (gc_thread, mono_string_new (mono_domain_get (), "Finalizer"));
 }
 
 void
index 8e2fbdf3b650902ff1cd6d1324ae2a89271b5686..e1572c3f55990945c886dee665d5c64f18b1c321 100644 (file)
@@ -1280,7 +1280,7 @@ ves_icall_System_Reflection_Emit_CustomAttributeBuilder_GetBlob (MonoReflectionA
 }
 
 static gboolean
-get_caller (MonoMethod *m, gint32 no, gint32 ilo, gboolean managed, gpointer data)
+get_executing (MonoMethod *m, gint32 no, gint32 ilo, gboolean managed, gpointer data)
 {
        MonoMethod **dest = (MonoMethod **)data;
 
@@ -1288,11 +1288,9 @@ get_caller (MonoMethod *m, gint32 no, gint32 ilo, gboolean managed, gpointer dat
        if (!managed)
                return FALSE;
 
-       if (m == *dest) {
-               *dest = NULL;
-               return FALSE;
-       }
        if (!(*dest)) {
+               if (!strcmp (m->klass->name_space, "System.Reflection"))
+                       return FALSE;
                *dest = m;
                return TRUE;
        }
@@ -1300,7 +1298,7 @@ get_caller (MonoMethod *m, gint32 no, gint32 ilo, gboolean managed, gpointer dat
 }
 
 static gboolean
-get_executing (MonoMethod *m, gint32 no, gint32 ilo, gboolean managed, gpointer data)
+get_caller_no_reflection (MonoMethod *m, gint32 no, gint32 ilo, gboolean managed, gpointer data)
 {
        MonoMethod **dest = (MonoMethod **)data;
 
@@ -1308,9 +1306,18 @@ get_executing (MonoMethod *m, gint32 no, gint32 ilo, gboolean managed, gpointer
        if (!managed)
                return FALSE;
 
+       if (m->wrapper_type != MONO_WRAPPER_NONE)
+               return FALSE;
+
+       if (m == *dest) {
+               *dest = NULL;
+               return FALSE;
+       }
+
+       if (m->klass->image == mono_defaults.corlib && !strcmp (m->klass->name_space, "System.Reflection"))
+               return FALSE;
+
        if (!(*dest)) {
-               if (!strcmp (m->klass->name_space, "System.Reflection"))
-                       return FALSE;
                *dest = m;
                return TRUE;
        }
@@ -1318,7 +1325,7 @@ get_executing (MonoMethod *m, gint32 no, gint32 ilo, gboolean managed, gpointer
 }
 
 static gboolean
-get_caller_no_reflection (MonoMethod *m, gint32 no, gint32 ilo, gboolean managed, gpointer data)
+get_caller_no_system_or_reflection (MonoMethod *m, gint32 no, gint32 ilo, gboolean managed, gpointer data)
 {
        MonoMethod **dest = (MonoMethod **)data;
 
@@ -1329,13 +1336,15 @@ get_caller_no_reflection (MonoMethod *m, gint32 no, gint32 ilo, gboolean managed
        if (m->wrapper_type != MONO_WRAPPER_NONE)
                return FALSE;
 
-       if (m->klass->image == mono_defaults.corlib && !strcmp (m->klass->name_space, "System.Reflection"))
-               return FALSE;
-
        if (m == *dest) {
                *dest = NULL;
                return FALSE;
        }
+
+       if (m->klass->image == mono_defaults.corlib && ((!strcmp (m->klass->name_space, "System.Reflection"))
+                                                                                                       || (!strcmp (m->klass->name_space, "System"))))
+               return FALSE;
+
        if (!(*dest)) {
                *dest = m;
                return TRUE;
@@ -1351,6 +1360,7 @@ type_from_parsed_name (MonoTypeNameParse *info, MonoBoolean ignoreCase, MonoErro
        MonoType *type = NULL;
        MonoAssembly *assembly = NULL;
        gboolean type_resolve = FALSE;
+       MonoImage *rootimage = NULL;
 
        mono_error_init (error);
 
@@ -1361,10 +1371,23 @@ type_from_parsed_name (MonoTypeNameParse *info, MonoBoolean ignoreCase, MonoErro
         */
        m = mono_method_get_last_managed ();
        dest = m;
-
-       mono_stack_walk_no_il (get_caller_no_reflection, &dest);
-       if (!dest)
-               dest = m;
+       if (m && m->klass->image != mono_defaults.corlib) {
+               /* Happens with inlining */
+       } else {
+               /* Ugly hack: type_from_parsed_name is called from
+                * System.Type.internal_from_name, which is called most
+                * directly from System.Type.GetType(string,bool,bool) but
+                * also indirectly from places such as
+                * System.Type.GetType(string,func,func) (via
+                * System.TypeNameParser.GetType and System.TypeSpec.Resolve)
+                * so we need to skip over all of those to find the true caller.
+                *
+                * It would be nice if we had stack marks.
+                */
+               mono_stack_walk_no_il (get_caller_no_system_or_reflection, &dest);
+               if (!dest)
+                       dest = m;
+       }
 
        /*
         * FIXME: mono_method_get_last_managed() sometimes returns NULL, thus
@@ -1377,6 +1400,7 @@ type_from_parsed_name (MonoTypeNameParse *info, MonoBoolean ignoreCase, MonoErro
        if (dest) {
                assembly = dest->klass->image->assembly;
                type_resolve = TRUE;
+               rootimage = assembly->image;
        } else {
                g_warning (G_STRLOC);
        }
@@ -1384,21 +1408,28 @@ type_from_parsed_name (MonoTypeNameParse *info, MonoBoolean ignoreCase, MonoErro
        if (info->assembly.name)
                assembly = mono_assembly_load (&info->assembly, assembly ? assembly->basedir : NULL, NULL);
 
-
        if (assembly) {
                /* When loading from the current assembly, AppDomain.TypeResolve will not be called yet */
-               type = mono_reflection_get_type_checked (assembly->image, info, ignoreCase, &type_resolve, error);
+               type = mono_reflection_get_type_checked (rootimage, assembly->image, info, ignoreCase, &type_resolve, error);
                return_val_if_nok (error, NULL);
        }
 
+       // XXXX - aleksey -
+       //  Say we're looking for System.Generic.Dict<int, Local>
+       //  we FAIL the get type above, because S.G.Dict isn't in assembly->image.  So we drop down here.
+       //  but then we FAIL AGAIN because now we pass null as the image and the rootimage and everything
+       //  is messed up when we go to construct the Local as the type arg...
+       //
+       // By contrast, if we started with Mine<System.Generic.Dict<int, Local>> we'd go in with assembly->image
+       // as the root and then even the detour into generics would still not screw us when we went to load Local.
        if (!info->assembly.name && !type) {
                /* try mscorlib */
-               type = mono_reflection_get_type_checked (NULL, info, ignoreCase, &type_resolve, error);
+               type = mono_reflection_get_type_checked (rootimage, NULL, info, ignoreCase, &type_resolve, error);
                return_val_if_nok (error, NULL);
        }
        if (assembly && !type && type_resolve) {
                type_resolve = FALSE; /* This will invoke TypeResolve if not done in the first 'if' */
-               type = mono_reflection_get_type_checked (assembly->image, info, ignoreCase, &type_resolve, error);
+               type = mono_reflection_get_type_checked (rootimage, assembly->image, info, ignoreCase, &type_resolve, error);
                return_val_if_nok (error, NULL);
        }
 
@@ -1424,10 +1455,12 @@ ves_icall_System_Type_internal_from_name (MonoString *name,
        /* mono_reflection_parse_type() mangles the string */
        if (!parsedOk) {
                mono_reflection_free_type_info (&info);
-               g_free (str);
                if (throwOnError) {
-                       mono_set_pending_exception (mono_get_exception_argument("typeName", "failed parse"));
+                       mono_error_init (&error);
+                       mono_error_set_argument (&error, "typeName", "failed parse: %s", str);
+                       mono_error_set_pending_exception (&error);
                }
+               g_free (str);
                return NULL;
        }
 
@@ -1450,7 +1483,6 @@ ves_icall_System_Type_internal_from_name (MonoString *name,
                if (throwOnError)
                        e = mono_get_exception_type_load (name, NULL);
 
-               mono_loader_clear_error ();
                if (e) {
                        mono_set_pending_exception (e);
                        return NULL;
@@ -3803,8 +3835,7 @@ mono_class_get_methods_by_name (MonoClass *klass, const char *name, guint32 bfla
        /* An optimization for calls made from Delegate:CreateDelegate () */
        if (klass->delegate && name && !strcmp (name, "Invoke") && (bflags == (BFLAGS_Public | BFLAGS_Static | BFLAGS_Instance))) {
                method = mono_get_delegate_invoke (klass);
-               if (mono_loader_get_last_error ())
-                       goto loader_error;
+               g_assert (method);
 
                g_ptr_array_add (array, method);
                return array;
@@ -3812,7 +3843,7 @@ mono_class_get_methods_by_name (MonoClass *klass, const char *name, guint32 bfla
 
        mono_class_setup_methods (klass);
        mono_class_setup_vtable (klass);
-       if (mono_class_has_failure (klass) || mono_loader_get_last_error ())
+       if (mono_class_has_failure (klass))
                goto loader_error;
 
        if (is_generic_parameter (&klass->byval_arg))
@@ -3828,7 +3859,7 @@ mono_class_get_methods_by_name (MonoClass *klass, const char *name, guint32 bfla
 handle_parent:
        mono_class_setup_methods (klass);
        mono_class_setup_vtable (klass);
-       if (mono_class_has_failure (klass) || mono_loader_get_last_error ())
+       if (mono_class_has_failure (klass))
                goto loader_error;              
 
        iter = NULL;
@@ -3888,8 +3919,7 @@ loader_error:
        if (mono_class_has_failure (klass)) {
                *ex = mono_class_get_exception_for_failure (klass);
        } else {
-               *ex = mono_loader_error_prepare_exception (mono_loader_get_last_error ());
-               mono_loader_clear_error ();
+               *ex = mono_get_exception_execution_engine ("Unknown error");
        }
        return NULL;
 }
@@ -4127,7 +4157,7 @@ ves_icall_Type_GetPropertiesByName (MonoReflectionType *type, MonoString *name,
 handle_parent:
        mono_class_setup_methods (klass);
        mono_class_setup_vtable (klass);
-       if (mono_class_has_failure (klass) || mono_loader_get_last_error ())
+       if (mono_class_has_failure (klass))
                goto loader_error;
 
        iter = NULL;
@@ -4200,9 +4230,6 @@ handle_parent:
 loader_error:
        if (mono_class_has_failure (klass)) {
                mono_error_set_exception_instance (&error, mono_class_get_exception_for_failure (klass));
-       } else {
-               mono_error_set_from_loader_error (&error);
-               mono_loader_clear_error ();
        }
 
 failure:
@@ -4261,7 +4288,7 @@ ves_icall_Type_GetEvents_internal (MonoReflectionType *type, MonoString *name, g
 handle_parent:
        mono_class_setup_methods (klass);
        mono_class_setup_vtable (klass);
-       if (mono_class_has_failure (klass) || mono_loader_get_last_error ())
+       if (mono_class_has_failure (klass))
                goto loader_error;
 
        iter = NULL;
@@ -4344,9 +4371,6 @@ handle_parent:
 loader_error:
        if (mono_class_has_failure (klass)) {
                mono_error_set_exception_instance (&error, mono_class_get_exception_for_failure (klass));
-       } else {
-               mono_error_set_from_loader_error (&error);
-               mono_loader_clear_error ();
        }
 
 failure:
@@ -4481,7 +4505,7 @@ ves_icall_System_Reflection_Assembly_InternalGetType (MonoReflectionAssembly *as
 
        if (module != NULL) {
                if (module->image) {
-                       type = mono_reflection_get_type_checked (module->image, &info, ignoreCase, &type_resolve, &error);
+                       type = mono_reflection_get_type_checked (module->image, module->image, &info, ignoreCase, &type_resolve, &error);
                        if (!is_ok (&error)) {
                                g_free (str);
                                mono_reflection_free_type_info (&info);
@@ -4501,7 +4525,7 @@ ves_icall_System_Reflection_Assembly_InternalGetType (MonoReflectionAssembly *as
                        if (abuilder->modules) {
                                for (i = 0; i < mono_array_length (abuilder->modules); ++i) {
                                        MonoReflectionModuleBuilder *mb = mono_array_get (abuilder->modules, MonoReflectionModuleBuilder*, i);
-                                       type = mono_reflection_get_type_checked (&mb->dynamic_image->image, &info, ignoreCase, &type_resolve, &error);
+                                       type = mono_reflection_get_type_checked (&mb->dynamic_image->image, &mb->dynamic_image->image, &info, ignoreCase, &type_resolve, &error);
                                        if (!is_ok (&error)) {
                                                g_free (str);
                                                mono_reflection_free_type_info (&info);
@@ -4516,7 +4540,7 @@ ves_icall_System_Reflection_Assembly_InternalGetType (MonoReflectionAssembly *as
                        if (!type && abuilder->loaded_modules) {
                                for (i = 0; i < mono_array_length (abuilder->loaded_modules); ++i) {
                                        MonoReflectionModule *mod = mono_array_get (abuilder->loaded_modules, MonoReflectionModule*, i);
-                                       type = mono_reflection_get_type_checked (mod->image, &info, ignoreCase, &type_resolve, &error);
+                                       type = mono_reflection_get_type_checked (mod->image, mod->image, &info, ignoreCase, &type_resolve, &error);
                                        if (!is_ok (&error)) {
                                                g_free (str);
                                                mono_reflection_free_type_info (&info);
@@ -4529,7 +4553,7 @@ ves_icall_System_Reflection_Assembly_InternalGetType (MonoReflectionAssembly *as
                        }
                }
                else {
-                       type = mono_reflection_get_type_checked (assembly->assembly->image, &info, ignoreCase, &type_resolve, &error);
+                       type = mono_reflection_get_type_checked (assembly->assembly->image, assembly->assembly->image, &info, ignoreCase, &type_resolve, &error);
                        if (!is_ok (&error)) {
                                g_free (str);
                                mono_reflection_free_type_info (&info);
@@ -4545,20 +4569,9 @@ ves_icall_System_Reflection_Assembly_InternalGetType (MonoReflectionAssembly *as
                if (throwOnError)
                        e = mono_get_exception_type_load (name, NULL);
 
-               if (mono_loader_get_last_error () && mono_defaults.generic_ilist_class)
-                       e = mono_loader_error_prepare_exception (mono_loader_get_last_error ());
-
-               mono_loader_clear_error ();
-
                if (e != NULL)
                        mono_set_pending_exception (e);
                return NULL;
-       } else if (mono_loader_get_last_error ()) {
-               if (throwOnError) {
-                       mono_set_pending_exception (mono_loader_error_prepare_exception (mono_loader_get_last_error ()));
-                       return NULL;
-               }
-               mono_loader_clear_error ();
        }
 
        if (type->type == MONO_TYPE_CLASS) {
@@ -4568,7 +4581,6 @@ ves_icall_System_Reflection_Assembly_InternalGetType (MonoReflectionAssembly *as
                if (throwOnError && mono_class_has_failure (klass)) {
                        /* report SecurityException (or others) that occured when loading the assembly */
                        MonoException *exc = mono_class_get_exception_for_failure (klass);
-                       mono_loader_clear_error ();
                        mono_set_pending_exception (exc);
                        return NULL;
                }
@@ -5603,7 +5615,6 @@ mono_module_get_types (MonoDomain *domain, MonoImage *image, MonoArray **excepti
        for (i = 1; i < tdef->rows; ++i) {
                if (!exportedOnly || mono_module_type_is_visible (tdef, image, i + 1)) {
                        klass = mono_class_get_checked (image, (i + 1) | MONO_TOKEN_TYPE_DEF, error);
-                       mono_loader_assert_no_error (); /* Plug any leaks */
                        
                        if (klass) {
                                rt = mono_type_get_object_checked (domain, &klass->byval_arg, error);
@@ -5708,8 +5719,6 @@ ves_icall_System_Reflection_Assembly_GetTypes (MonoReflectionAssembly *assembly,
                MonoArray *exl = NULL;
                int j, length = g_list_length (list) + ex_count;
 
-               mono_loader_clear_error ();
-
                exl = mono_array_new (domain, mono_defaults.exception_class, length);
                /* Types for which mono_class_get_checked () succeeded */
                for (i = 0, tmp = list; tmp; i++, tmp = tmp->next) {
@@ -5733,7 +5742,6 @@ ves_icall_System_Reflection_Assembly_GetTypes (MonoReflectionAssembly *assembly,
                        mono_error_set_pending_exception (&error);
                        return NULL;
                }
-               mono_loader_clear_error ();
                mono_set_pending_exception (exc);
                return NULL;
        }
@@ -8054,12 +8062,7 @@ custom_attrs_get_by_type (MonoObject *obj, MonoReflectionType *attr_type)
                return NULL;
        }
 
-       if (mono_loader_get_last_error ()) {
-               mono_set_pending_exception (mono_loader_error_prepare_exception (mono_loader_get_last_error ()));
-               return NULL;
-       } else {
-               return res;
-       }
+       return res;
 }
 
 ICALL_EXPORT MonoArray*
index 56992b3612738bd5ea800a0a50edc2817068c202..2922234965a5035b83acf0ce6b3f0f7b51d22f18 100644 (file)
@@ -67,11 +67,6 @@ static guint32 memberref_sig_cache_size;
 static guint32 methods_size;
 static guint32 signatures_size;
 
-/*
- * This TLS variable contains the last type load error encountered by the loader.
- */
-MonoNativeTlsKey loader_error_thread_id;
-
 /*
  * This TLS variable holds how many times the current thread has acquired the loader 
  * lock.
@@ -103,7 +98,6 @@ mono_loader_init ()
                mono_os_mutex_init_recursive (&global_loader_data_mutex);
                loader_lock_inited = TRUE;
 
-               mono_native_tls_alloc (&loader_error_thread_id, NULL);
                mono_native_tls_alloc (&loader_lock_nest_id, NULL);
 
                mono_counters_init ();
@@ -125,7 +119,6 @@ mono_loader_cleanup (void)
 {
        dllmap_cleanup ();
 
-       mono_native_tls_free (loader_error_thread_id);
        mono_native_tls_free (loader_lock_nest_id);
 
        mono_coop_mutex_destroy (&loader_mutex);
@@ -133,281 +126,6 @@ mono_loader_cleanup (void)
        loader_lock_inited = FALSE;     
 }
 
-/*
- * Handling of type load errors should be done as follows:
- *
- *   If something could not be loaded, the loader should call one of the
- * mono_loader_set_error_XXX functions ()
- * with the appropriate arguments, then return NULL to report the failure. The error 
- * should be propagated until it reaches code which can throw managed exceptions. At that
- * point, an exception should be thrown based on the information returned by
- * mono_loader_get_last_error (). Then the error should be cleared by calling 
- * mono_loader_clear_error ().
- */
-
-static void
-set_loader_error (MonoLoaderError *error)
-{
-       mono_loader_clear_error ();
-       mono_native_tls_set_value (loader_error_thread_id, error);
-}
-
-/**
- * mono_loader_set_error_assembly_load:
- *
- * Set the loader error for this thread. 
- */
-void
-mono_loader_set_error_assembly_load (const char *assembly_name, gboolean ref_only)
-{
-       MonoLoaderError *error;
-
-       if (mono_loader_get_last_error ()) 
-               return;
-
-       error = g_new0 (MonoLoaderError, 1);
-       error->exception_type = MONO_EXCEPTION_FILE_NOT_FOUND;
-       error->assembly_name = g_strdup (assembly_name);
-       error->ref_only = ref_only;
-
-       /* 
-        * This is not strictly needed, but some (most) of the loader code still
-        * can't deal with load errors, and this message is more helpful than an
-        * assert.
-        */
-       if (ref_only)
-               mono_trace (G_LOG_LEVEL_WARNING, MONO_TRACE_ASSEMBLY, "Cannot resolve dependency to assembly '%s' because it has not been preloaded. When using the ReflectionOnly APIs, dependent assemblies must be pre-loaded or loaded on demand through the ReflectionOnlyAssemblyResolve event.", assembly_name);
-       else
-               mono_trace (G_LOG_LEVEL_WARNING, MONO_TRACE_ASSEMBLY, "Could not load file or assembly '%s' or one of its dependencies.", assembly_name);
-
-       set_loader_error (error);
-}
-
-/**
- * mono_loader_set_error_type_load:
- *
- * Set the loader error for this thread. 
- */
-void
-mono_loader_set_error_type_load (const char *class_name, const char *assembly_name)
-{
-       MonoLoaderError *error;
-
-       if (mono_loader_get_last_error ()) 
-               return;
-
-       error = g_new0 (MonoLoaderError, 1);
-       error->exception_type = MONO_EXCEPTION_TYPE_LOAD;
-       error->class_name = g_strdup (class_name);
-       error->assembly_name = g_strdup (assembly_name);
-
-       /* 
-        * This is not strictly needed, but some (most) of the loader code still
-        * can't deal with load errors, and this message is more helpful than an
-        * assert.
-        */
-       mono_trace_warning (MONO_TRACE_TYPE, "The class %s could not be loaded, used in %s", class_name, assembly_name);
-
-       set_loader_error (error);
-}
-
-/*
- * mono_loader_set_error_method_load:
- *
- *   Set the loader error for this thread. MEMBER_NAME should point to a string
- * inside metadata.
- */
-void
-mono_loader_set_error_method_load (const char *class_name, const char *member_name)
-{
-       MonoLoaderError *error;
-
-       /* FIXME: Store the signature as well */
-       if (mono_loader_get_last_error ())
-               return;
-
-       error = g_new0 (MonoLoaderError, 1);
-       error->exception_type = MONO_EXCEPTION_MISSING_METHOD;
-       error->class_name = g_strdup (class_name);
-       error->member_name = member_name;
-
-       set_loader_error (error);
-}
-
-/*
- * mono_loader_set_error_field_load:
- *
- * Set the loader error for this thread. MEMBER_NAME should point to a string
- * inside metadata.
- */
-void
-mono_loader_set_error_field_load (MonoClass *klass, const char *member_name)
-{
-       MonoLoaderError *error;
-
-       /* FIXME: Store the signature as well */
-       if (mono_loader_get_last_error ())
-               return;
-
-       error = g_new0 (MonoLoaderError, 1);
-       error->exception_type = MONO_EXCEPTION_MISSING_FIELD;
-       error->klass = klass;
-       error->member_name = member_name;
-
-       set_loader_error (error);
-}
-
-/*
- * mono_loader_set_error_bad_image:
- *
- * Set the loader error for this thread. 
- */
-void
-mono_loader_set_error_bad_image (char *msg)
-{
-       MonoLoaderError *error;
-
-       if (mono_loader_get_last_error ())
-               return;
-
-       error = g_new0 (MonoLoaderError, 1);
-       error->exception_type = MONO_EXCEPTION_BAD_IMAGE;
-       error->msg = msg;
-
-       set_loader_error (error);
-}      
-
-
-/*
- * mono_loader_get_last_error:
- *
- *   Returns information about the last type load exception encountered by the loader, or
- * NULL. After use, the exception should be cleared by calling mono_loader_clear_error.
- */
-MonoLoaderError*
-mono_loader_get_last_error (void)
-{
-       return (MonoLoaderError*)mono_native_tls_get_value (loader_error_thread_id);
-}
-
-void
-mono_loader_assert_no_error (void)
-{
-       MonoLoaderError *error = mono_loader_get_last_error ();
-
-       if (error) {
-               g_print ("Unhandled loader error: %x, %s %s %s\n", error->exception_type, error->msg, error->assembly_name, error->class_name);
-               g_assert_not_reached ();
-       }
-}
-
-/**
- * mono_loader_clear_error:
- *
- * Disposes any loader error messages on this thread
- */
-void
-mono_loader_clear_error (void)
-{
-       MonoLoaderError *ex = (MonoLoaderError*)mono_native_tls_get_value (loader_error_thread_id);
-
-       if (ex) {
-               g_free (ex->class_name);
-               g_free (ex->assembly_name);
-               g_free (ex->msg);
-               g_free (ex);
-
-               mono_native_tls_set_value (loader_error_thread_id, NULL);
-       }
-}
-
-/**
- * mono_loader_error_prepare_exception:
- * @error: The MonoLoaderError to turn into an exception
- *
- * This turns a MonoLoaderError into an exception that can be thrown
- * and resets the Mono Loader Error state during this process.
- *
- */
-MonoException *
-mono_loader_error_prepare_exception (MonoLoaderError *error)
-{
-       MonoException *ex = NULL;
-
-       switch (error->exception_type) {
-       case MONO_EXCEPTION_TYPE_LOAD: {
-               char *cname = g_strdup (error->class_name);
-               char *aname = g_strdup (error->assembly_name);
-               MonoString *class_name;
-               
-               mono_loader_clear_error ();
-               
-               class_name = mono_string_new (mono_domain_get (), cname);
-
-               ex = mono_get_exception_type_load (class_name, aname);
-               g_free (cname);
-               g_free (aname);
-               break;
-        }
-       case MONO_EXCEPTION_MISSING_METHOD: {
-               char *cname = g_strdup (error->class_name);
-               char *aname = g_strdup (error->member_name);
-               
-               mono_loader_clear_error ();
-               ex = mono_get_exception_missing_method (cname, aname);
-               g_free (cname);
-               g_free (aname);
-               break;
-       }
-               
-       case MONO_EXCEPTION_MISSING_FIELD: {
-               char *class_name;
-               char *cmembername = g_strdup (error->member_name);
-               if (error->klass)
-                       class_name = mono_type_get_full_name (error->klass);
-               else
-                       class_name = g_strdup ("");
-
-               mono_loader_clear_error ();
-               
-               ex = mono_get_exception_missing_field (class_name, cmembername);
-               g_free (class_name);
-               g_free (cmembername);
-               break;
-        }
-       
-       case MONO_EXCEPTION_FILE_NOT_FOUND: {
-               char *msg;
-               char *filename;
-
-               if (error->ref_only)
-                       msg = g_strdup_printf ("Cannot resolve dependency to assembly '%s' because it has not been preloaded. When using the ReflectionOnly APIs, dependent assemblies must be pre-loaded or loaded on demand through the ReflectionOnlyAssemblyResolve event.", error->assembly_name);
-               else
-                       msg = g_strdup_printf ("Could not load file or assembly '%s' or one of its dependencies.", error->assembly_name);
-               filename = g_strdup (error->assembly_name);
-               /* Has to call this before calling anything which might call mono_class_init () */
-               mono_loader_clear_error ();
-               ex = mono_get_exception_file_not_found2 (msg, mono_string_new (mono_domain_get (), filename));
-               g_free (msg);
-               g_free (filename);
-               break;
-       }
-
-       case MONO_EXCEPTION_BAD_IMAGE: {
-               char *msg = g_strdup (error->msg);
-               mono_loader_clear_error ();
-               ex = mono_get_exception_bad_image_format (msg);
-               g_free (msg);
-               break;
-       }
-
-       default:
-               g_assert_not_reached ();
-       }
-
-       return ex;
-}
-
 /*
  * find_cached_memberref_sig:
  *
@@ -529,7 +247,6 @@ field_from_memberref (MonoImage *image, guint32 token, MonoClass **retklass,
        field = mono_class_get_field_from_name_full (klass, fname, sig_type);
 
        if (!field) {
-               mono_loader_assert_no_error ();
                mono_error_set_field_load (error, klass, fname, "Could not find field '%s'", fname);
        }
 
@@ -583,7 +300,6 @@ mono_field_from_token_checked (MonoImage *image, guint32 token, MonoClass **retk
 
        if (mono_metadata_token_table (token) == MONO_TABLE_MEMBERREF) {
                field = field_from_memberref (image, token, retklass, context, error);
-               mono_loader_assert_no_error ();
        } else {
                type = mono_metadata_typedef_from_field (image, mono_metadata_token_index (token));
                if (!type) {
@@ -599,10 +315,7 @@ mono_field_from_token_checked (MonoImage *image, guint32 token, MonoClass **retk
                        *retklass = k;
                field = mono_class_get_field (k, token);
                if (!field) {
-                       if (mono_loader_get_last_error ())
-                               mono_error_set_from_loader_error (error);
-                       else
-                               mono_error_set_bad_image (error, image, "Could not resolve field token 0x%08x", token);
+                       mono_error_set_bad_image (error, image, "Could not resolve field token 0x%08x", token);
                }
        }
 
@@ -612,7 +325,6 @@ mono_field_from_token_checked (MonoImage *image, guint32 token, MonoClass **retk
                mono_image_unlock (image);
        }
 
-       mono_loader_assert_no_error ();
        return field;
 }
 
@@ -1165,19 +877,14 @@ method_from_memberref (MonoImage *image, guint32 idx, MonoGenericContext *typesp
                g_free (msig);
                msig = g_string_free (s, FALSE);
 
-               if (mono_loader_get_last_error ()) /* FIXME find_method and mono_method_search_in_array_class can leak a loader error */
-                       mono_error_set_from_loader_error (error);
-               else
-                       mono_error_set_method_load (error, klass, mname, "Could not find method %s", msig);
+               mono_error_set_method_load (error, klass, mname, "Could not find method %s", msig);
 
                g_free (msig);
        }
 
-       mono_loader_assert_no_error ();
        return method;
 
 fail:
-       mono_loader_assert_no_error ();
        g_assert (!mono_error_ok (error));
        return NULL;
 }
@@ -1243,7 +950,6 @@ method_from_methodspec (MonoImage *image, MonoGenericContext *context, guint32 i
        new_context.method_inst = inst;
 
        method = mono_class_inflate_generic_method_full_checked (method, klass, &new_context, error);
-       mono_loader_assert_no_error ();
        return method;
 }
 
@@ -1882,7 +1588,6 @@ mono_get_method_from_token (MonoImage *image, guint32 token, MonoClass *klass,
 
                result = (MonoMethod *)mono_lookup_dynamic_token_class (image, token, TRUE, &handle_class, context, error);
                mono_error_assert_ok (error);
-               mono_loader_assert_no_error ();
 
                // This checks the memberref type as well
                if (result && handle_class != mono_defaults.methodhandle_class) {
@@ -1953,7 +1658,6 @@ mono_get_method_from_token (MonoImage *image, guint32 token, MonoClass *klass,
         */
        if (*sig & 0x10) {
                generic_container = mono_metadata_load_generic_params (image, token, container);
-               mono_loader_assert_no_error (); /* FIXME don't swallow this error. */
        }
        if (generic_container) {
                result->is_generic = TRUE;
@@ -1988,7 +1692,6 @@ mono_get_method_from_token (MonoImage *image, guint32 token, MonoClass *klass,
        if (generic_container)
                mono_method_set_generic_container (result, generic_container);
 
-       mono_loader_assert_no_error ();
        return result;
 }
 
index 18f93d260e3897cc70f53bbfde9b45a0229526fb..a847b0f58624a0587765b4bd6e526bda2787d1d6 100644 (file)
@@ -2346,7 +2346,7 @@ mono_marshal_get_string_to_ptr_conv (MonoMethodPInvoke *piinfo, MonoMarshalSpec
        case MONO_NATIVE_BSTR:
                return MONO_MARSHAL_CONV_STR_BSTR;
        default:
-               return (MonoMarshalConv)-1;
+               return MONO_MARSHAL_CONV_INVALID;
        }
 }
 
@@ -2366,7 +2366,7 @@ mono_marshal_get_stringbuilder_to_ptr_conv (MonoMethodPInvoke *piinfo, MonoMarsh
                return MONO_MARSHAL_CONV_SB_LPTSTR;
                break;
        default:
-               return (MonoMarshalConv)-1;
+               return MONO_MARSHAL_CONV_INVALID;
        }
 }
 
@@ -2389,7 +2389,7 @@ mono_marshal_get_ptr_to_string_conv (MonoMethodPInvoke *piinfo, MonoMarshalSpec
        case MONO_NATIVE_BSTR:
                return MONO_MARSHAL_CONV_BSTR_STR;
        default:
-               return (MonoMarshalConv)-1;
+               return MONO_MARSHAL_CONV_INVALID;
        }
 }
 
@@ -2415,7 +2415,7 @@ mono_marshal_get_ptr_to_stringbuilder_conv (MonoMethodPInvoke *piinfo, MonoMarsh
                return MONO_MARSHAL_CONV_LPTSTR_SB;
                break;
        default:
-               return (MonoMarshalConv)-1;
+               return MONO_MARSHAL_CONV_INVALID;
        }
 }
 
@@ -5105,7 +5105,7 @@ emit_marshal_string (EmitMarshalContext *m, int argnum, MonoType *t,
                        mono_mb_emit_ldarg (mb, argnum);
                }
 
-               if (conv == -1) {
+               if (conv == MONO_MARSHAL_CONV_INVALID) {
                        char *msg = g_strdup_printf ("string marshalling conversion %d not implemented", encoding);
                        mono_mb_emit_exception_marshal_directive (mb, msg);
                } else {
@@ -5117,7 +5117,7 @@ emit_marshal_string (EmitMarshalContext *m, int argnum, MonoType *t,
 
        case MARSHAL_ACTION_CONV_OUT:
                conv = mono_marshal_get_ptr_to_string_conv (m->piinfo, spec, &need_free);
-               if (conv == -1) {
+               if (conv == MONO_MARSHAL_CONV_INVALID) {
                        char *msg = g_strdup_printf ("string marshalling conversion %d not implemented", encoding);
                        mono_mb_emit_exception_marshal_directive (mb, msg);
                        break;
@@ -5177,7 +5177,7 @@ emit_marshal_string (EmitMarshalContext *m, int argnum, MonoType *t,
                mono_mb_emit_stloc (mb, 0);
                                
                conv = mono_marshal_get_ptr_to_string_conv (m->piinfo, spec, &need_free);
-               if (conv == -1) {
+               if (conv == MONO_MARSHAL_CONV_INVALID) {
                        char *msg = g_strdup_printf ("string marshalling conversion %d not implemented", encoding);
                        mono_mb_emit_exception_marshal_directive (mb, msg);
                        break;
@@ -5206,7 +5206,7 @@ emit_marshal_string (EmitMarshalContext *m, int argnum, MonoType *t,
                }
 
                conv = mono_marshal_get_ptr_to_string_conv (m->piinfo, spec, &need_free);
-               if (conv == -1) {
+               if (conv == MONO_MARSHAL_CONV_INVALID) {
                        char *msg = g_strdup_printf ("string marshalling conversion %d not implemented", encoding);
                        mono_mb_emit_exception_marshal_directive (mb, msg);
                        break;
@@ -5534,7 +5534,7 @@ emit_marshal_object (EmitMarshalContext *m, int argnum, MonoType *t,
                        if (t->byref && !(t->attrs & PARAM_ATTRIBUTE_IN) && (t->attrs & PARAM_ATTRIBUTE_OUT))
                                break;
 
-                       if (conv == -1) {
+                       if (conv == MONO_MARSHAL_CONV_INVALID) {
                                char *msg = g_strdup_printf ("stringbuilder marshalling conversion %d not implemented", encoding);
                                mono_mb_emit_exception_marshal_directive (mb, msg);
                                break;
@@ -6170,9 +6170,9 @@ emit_marshal_array (EmitMarshalContext *m, int argnum, MonoType *t,
                                conv = mono_marshal_get_stringbuilder_to_ptr_conv (m->piinfo, spec);
                        }
                        else
-                               conv = (MonoMarshalConv)-1;
+                               conv = MONO_MARSHAL_CONV_INVALID;
 
-                       if (is_string && conv == -1) {
+                       if (is_string && conv == MONO_MARSHAL_CONV_INVALID) {
                                char *msg = g_strdup_printf ("string/stringbuilder marshalling conversion %d not implemented", encoding);
                                mono_mb_emit_exception_marshal_directive (mb, msg);
                                break;
@@ -6344,7 +6344,7 @@ emit_marshal_array (EmitMarshalContext *m, int argnum, MonoType *t,
                                gboolean need_free2;
                                MonoMarshalConv conv = mono_marshal_get_ptr_to_stringbuilder_conv (m->piinfo, spec, &need_free2);
 
-                               g_assert (conv != -1);
+                               g_assert (conv != MONO_MARSHAL_CONV_INVALID);
 
                                /* dest */
                                mono_mb_emit_ldarg (mb, argnum);
@@ -6491,7 +6491,7 @@ emit_marshal_array (EmitMarshalContext *m, int argnum, MonoType *t,
                        conv = mono_marshal_get_ptr_to_stringbuilder_conv (m->piinfo, spec, &need_free);
                }
                else
-                       conv = (MonoMarshalConv)-1;
+                       conv = MONO_MARSHAL_CONV_INVALID;
 
                mono_marshal_load_type_info (eklass);
 
@@ -6586,7 +6586,7 @@ emit_marshal_array (EmitMarshalContext *m, int argnum, MonoType *t,
 
                /* Emit marshalling code */
                if (is_string) {
-                       g_assert (conv != -1);
+                       g_assert (conv != MONO_MARSHAL_CONV_INVALID);
 
                        mono_mb_emit_ldloc (mb, conv_arg);
                        mono_mb_emit_ldloc (mb, index_var);
@@ -6654,7 +6654,7 @@ emit_marshal_array (EmitMarshalContext *m, int argnum, MonoType *t,
                        conv = mono_marshal_get_stringbuilder_to_ptr_conv (m->piinfo, spec);
                }
                else
-                       conv = (MonoMarshalConv)-1;
+                       conv = MONO_MARSHAL_CONV_INVALID;
 
                mono_marshal_load_type_info (eklass);
 
@@ -6702,7 +6702,7 @@ emit_marshal_array (EmitMarshalContext *m, int argnum, MonoType *t,
 
                /* Emit marshalling code */
                if (is_string) {
-                       g_assert (conv != -1);
+                       g_assert (conv != MONO_MARSHAL_CONV_INVALID);
 
                        /* dest */
                        mono_mb_emit_ldloc (mb, dest_ptr);
@@ -6736,7 +6736,7 @@ emit_marshal_array (EmitMarshalContext *m, int argnum, MonoType *t,
                MonoClass *eklass;
                guint32 label1, label2, label3;
                int index_var, src, dest, esize;
-               MonoMarshalConv conv = (MonoMarshalConv)-1;
+               MonoMarshalConv conv = MONO_MARSHAL_CONV_INVALID;
                gboolean is_string = FALSE;
                
                g_assert (!t->byref);
@@ -6799,7 +6799,7 @@ emit_marshal_array (EmitMarshalContext *m, int argnum, MonoType *t,
 
                /* Emit marshalling code */
                if (is_string) {
-                       g_assert (conv != -1);
+                       g_assert (conv != MONO_MARSHAL_CONV_INVALID);
 
                        /* dest */
                        mono_mb_emit_ldloc (mb, dest);
index 57fc425083ef37f62392541ec68810018d0ebe15..6b8fdcb44ca396a788f220bac28c4795f2bd4752 100644 (file)
@@ -774,7 +774,7 @@ gboolean
 mono_metadata_generic_param_equal (MonoGenericParam *p1, MonoGenericParam *p2);
 
 void mono_dynamic_stream_reset  (MonoDynamicStream* stream);
-void mono_assembly_addref       (MonoAssembly *assembly);
+MONO_API void mono_assembly_addref       (MonoAssembly *assembly);
 void mono_assembly_load_friends (MonoAssembly* ass);
 gboolean mono_assembly_has_skip_verification (MonoAssembly* ass);
 
index 5a19ef2d17dcb302805159d6e6508e9795d3eded..d278a7487ee68a8d59dce5902675362b2200dd39 100644 (file)
@@ -2049,13 +2049,11 @@ mono_metadata_parse_method_signature_full (MonoImage *m, MonoGenericContainer *c
        for (i = 0; i < method->param_count; ++i) {
                if (*ptr == MONO_TYPE_SENTINEL) {
                        if (method->call_convention != MONO_CALL_VARARG || def) {
-                               mono_loader_assert_no_error ();
                                mono_error_set_bad_image (error, m, "Found sentinel for methoddef or no vararg");
                                g_free (pattrs);
                                return NULL;
                        }
                        if (method->sentinelpos >= 0) {
-                               mono_loader_assert_no_error ();
                                mono_error_set_bad_image (error, m, "Found sentinel twice in the same signature.");
                                g_free (pattrs);
                                return NULL;
@@ -2090,7 +2088,6 @@ mono_metadata_parse_method_signature_full (MonoImage *m, MonoGenericContainer *c
         * Add signature to a cache and increase ref count...
         */
 
-       mono_loader_assert_no_error ();
        return method;
 }
 
@@ -6163,7 +6160,6 @@ mono_metadata_load_generic_param_constraints_checked (MonoImage *image, guint32
                return TRUE;
        for (i = 0; i < container->type_argc; i++) {
                if (!get_constraints (image, start_row + i, &mono_generic_container_get_param_info (container, i)->constraints, container, error)) {
-                       mono_loader_assert_no_error ();
                        return FALSE;
                }
        }
index afc21d48e66a222e41b33846c4b5368659b977f0..35afec7e3eac6f0a4eea92c57f7aededa9b4c917 100644 (file)
 
 MONO_BEGIN_DECLS
 
-/*
- * When embedding, you have to define MONO_ZERO_LEN_ARRAY before including any
- * other Mono header file if you use a different compiler from the one used to
- * build Mono.
- */
-#ifndef MONO_ZERO_LEN_ARRAY
-#ifdef __GNUC__
-#define MONO_ZERO_LEN_ARRAY 0
-#else
-#define MONO_ZERO_LEN_ARRAY 1
-#endif
-#endif
-
 #define MONO_TYPE_ISSTRUCT(t) mono_type_is_struct (t)
 #define MONO_TYPE_IS_VOID(t) mono_type_is_void (t)
 #define MONO_TYPE_IS_POINTER(t) mono_type_is_pointer (t)
@@ -178,6 +165,8 @@ typedef enum {
        MONO_MARSHAL_CONV_HANDLEREF
 } MonoMarshalConv;
 
+#define MONO_MARSHAL_CONV_INVALID ((MonoMarshalConv)-1)
+
 typedef struct {
        MonoMarshalNative native;
        union {
index 98431f7d64a8daa71bb9589f2f189c69f033b0d8..4f6eb93ba60da7444c0b6b873b002bb1f5dd9dab 100644 (file)
@@ -98,6 +98,12 @@ void
 mono_mb_free (MonoMethodBuilder *mb)
 {
 #ifndef DISABLE_JIT
+       GList *l;
+
+       for (l = mb->locals_list; l; l = l->next) {
+               /* Allocated in mono_mb_add_local () */
+               g_free (l->data);
+       }
        g_list_free (mb->locals_list);
        if (!mb->dynamic) {
                g_free (mb->method);
@@ -150,7 +156,7 @@ mono_mb_create_method (MonoMethodBuilder *mb, MonoMethodSignature *signature, in
                header->code = mb->code;
 
                for (i = 0, l = mb->locals_list; l; l = l->next, i++) {
-                       header->locals [i] = mono_metadata_type_dup (NULL, (MonoType*)l->data);
+                       header->locals [i] = (MonoType*)l->data;
                }
        } else
 #endif
@@ -174,11 +180,15 @@ mono_mb_create_method (MonoMethodBuilder *mb, MonoMethodSignature *signature, in
                memcpy ((char*)header->code, mb->code, mb->pos);
 
                for (i = 0, l = mb->locals_list; l; l = l->next, i++) {
-                       header->locals [i] = mono_metadata_type_dup (NULL, (MonoType*)l->data);
+                       header->locals [i] = (MonoType*)l->data;
                }
 #endif
        }
 
+       /* Free the locals list so mono_mb_free () doesn't free the types twice */
+       g_list_free (mb->locals_list);
+       mb->locals_list = NULL;
+
        method->signature = signature;
        if (!signature->hasthis)
                method->flags |= METHOD_ATTRIBUTE_STATIC;
@@ -270,12 +280,19 @@ int
 mono_mb_add_local (MonoMethodBuilder *mb, MonoType *type)
 {
        int res;
+       MonoType *t;
+
+       /*
+        * Have to make a copy early since type might be sig->ret,
+        * which is transient, see mono_metadata_signature_dup_internal_with_padding ().
+        */
+       t = mono_metadata_type_dup (NULL, type);
 
        g_assert (mb != NULL);
        g_assert (type != NULL);
 
        res = mb->locals;
-       mb->locals_list = g_list_append (mb->locals_list, type);
+       mb->locals_list = g_list_append (mb->locals_list, t);
        mb->locals++;
 
        return res;
index 564c83a6151db8cba9ce666d90a3b85ccef6cc2d..5ccb938df9b03a0f8dfb9a77c6a8accb80e9c2f0 100644 (file)
@@ -240,6 +240,8 @@ bb_split (MonoSimpleBasicBlock *first, MonoSimpleBasicBlock *hint, MonoSimpleBas
 {
        MonoSimpleBasicBlock *res, *bb = first;
 
+       mono_error_init (error);
+
        if (bb_idx_is_contained (hint, target)) {
                first = hint;
        } else if (hint->next && bb_idx_is_contained (hint->next, target)) {
@@ -336,6 +338,8 @@ bb_formation_il_pass (const unsigned char *start, const unsigned char *end, Mono
        MonoSimpleBasicBlock *branch, *next, *current;
        const MonoOpcode *opcode;
 
+       mono_error_init (error);
+
        current = bb;
 
        while (ip < end) {
@@ -464,6 +468,9 @@ bb_formation_eh_pass (MonoMethodHeader *header, MonoSimpleBasicBlock *bb, MonoSi
 {
        int i;
        int end = header->code_size;
+
+       mono_error_init (error);
+
        /*We must split at all points to verify for targets in the middle of an instruction*/
        for (i = 0; i < header->num_clauses; ++i) {
                MonoExceptionClause *clause = header->clauses + i;
@@ -520,6 +527,8 @@ mono_basic_block_split (MonoMethod *method, MonoError *error, MonoMethodHeader *
        MonoSimpleBasicBlock *bb, *root;
        const unsigned char *start, *end;
 
+       mono_error_init (error);
+
        start = header->code;
        end = start + header->code_size;
 
index 36763dd311c3bf922c7171a261af3c9ca121bf9f..c032bc0ff585868f3c67cfb9e3512dea1728b2ad 100644 (file)
@@ -185,10 +185,6 @@ DECL_OFFSET(MonoLMF, eip)
 DECL_OFFSET(MonoContext, gregs)
 DECL_OFFSET(MonoContext, fregs)
 
-#ifdef TARGET_WIN32
-DECL_OFFSET(MonoLMF, lmf_addr)
-#endif
-
 DECL_OFFSET(MonoLMF, rsp)
 DECL_OFFSET(MonoLMF, rbp)
 DECL_OFFSET(MonoLMF, rip)
index 3af4153a867419f66b11691e5e18896d3034c1ab..eac9bfba360a0fb62258c16efe8afbcb53206698 100644 (file)
@@ -362,7 +362,6 @@ dump_verify_info (MonoImage *image, int flags)
                for (i = 0; i < m->rows; ++i) {
                        MonoMethod *method;
                        MonoError error;
-                       mono_loader_clear_error ();
 
                        method = mono_get_method_checked (image, MONO_TOKEN_METHOD_DEF | (i+1), NULL, NULL, &error);
                        if (!method) {
@@ -487,16 +486,14 @@ verify_image_file (const char *fname)
                        continue;
                }
                mono_class_init (klass);
-               if (mono_class_has_failure (klass) || mono_loader_get_last_error ()) {
+               if (mono_class_has_failure (klass)) {
                        printf ("Error verifying class(0x%08x) %s.%s a type load error happened\n", token, klass->name_space, klass->name);
-                       mono_loader_clear_error ();
                        ++count;
                }
 
                mono_class_setup_vtable (klass);
-               if (mono_class_has_failure (klass) || mono_loader_get_last_error ()) {
+               if (mono_class_has_failure (klass)) {
                        printf ("Error verifying class(0x%08x) %s.%s a type load error happened\n", token, klass->name_space, klass->name);
-                       mono_loader_clear_error ();
                        ++count;
                }
        }
index d74a273d085bf0825656642a845a683722b5ea89..bb8579e7ad904bc4ebf04bbde85ce61ddf6e9a74 100644 (file)
@@ -1161,6 +1161,7 @@ load_embedded_profiler (const char *desc, const char *name)
        return result;
 }
 
+// TODO: Much of the library loading code here is custom. It would be better to merge this with mono-dl
 static gboolean
 load_profiler_from_directory (const char *directory, const char *libname, const char *desc)
 {
@@ -1169,13 +1170,13 @@ load_profiler_from_directory (const char *directory, const char *libname, const
        char *err;
        void *iter;
 
-       mono_trace (G_LOG_LEVEL_INFO, MONO_TRACE_ASSEMBLY, "Attempting to load profiler %s from %s (desc %s)", libname, directory, desc);
+       mono_trace (G_LOG_LEVEL_INFO, MONO_TRACE_DLLIMPORT, "Attempting to load profiler %s from %s (desc %s)", libname, directory, desc);
 
        iter = NULL;
        err = NULL;
        while ((path = mono_dl_build_path (directory, libname, &iter))) {
                pmodule = mono_dl_open (path, MONO_DL_LAZY, &err);
-               mono_trace (G_LOG_LEVEL_INFO, MONO_TRACE_ASSEMBLY, "Attempting to load profiler: %s %ssuccessful, err: %s", path, pmodule?"":"not ", err);
+               mono_trace (G_LOG_LEVEL_INFO, MONO_TRACE_DLLIMPORT, "Attempting to load profiler: %s, %ssuccessful, err: %s", path, pmodule?"":"not ", err);
                g_free (path);
                g_free (err);
                if (pmodule)
@@ -1186,10 +1187,11 @@ load_profiler_from_directory (const char *directory, const char *libname, const
 }
 
 static gboolean
-load_profiler_from_mono_instalation (const char *libname, const char *desc)
+load_profiler_from_mono_installation (const char *libname, const char *desc)
 {
        char *err = NULL;
        MonoDl *pmodule = mono_dl_open_runtime_lib (libname, MONO_DL_LAZY, &err);
+       mono_trace (G_LOG_LEVEL_INFO, MONO_TRACE_DLLIMPORT, "Attempting to load profiler from runtime libs: %s, %ssuccessful, err: %s", libname, pmodule?"":"not ", err);
        g_free (err);
        if (pmodule)
                return load_profiler (pmodule, desc, INITIALIZER_NAME);
@@ -1254,15 +1256,11 @@ mono_profiler_load (const char *desc)
                }
                if (!load_embedded_profiler (desc, mname)) {
                        libname = g_strdup_printf ("mono-profiler-%s", mname);
-                       char *profiler_lib_dir = getenv ("MONO_PROFILER_LIB_DIR");
-                       if (profiler_lib_dir)
-                               res = load_profiler_from_directory (profiler_lib_dir, libname, desc);
+                       res = load_profiler_from_mono_installation (libname, desc);
                        if (!res && mono_config_get_assemblies_dir ())
                                res = load_profiler_from_directory (mono_assembly_getrootdir (), libname, desc);
                        if (!res)
                                res = load_profiler_from_directory (NULL, libname, desc);
-                       if (!res)
-                               res = load_profiler_from_mono_instalation (libname, desc);
                        if (!res)
                                g_warning ("The '%s' profiler wasn't found in the main executable nor could it be loaded from '%s'.", mname, libname);
                        g_free (libname);
index 600f2c6d268906ab4c360248e961b5b394b6188e..327bb93142ce85d0579bf1bd8ae484a92e545331 100644 (file)
@@ -10,7 +10,7 @@
 #include <mono/utils/mono-error.h>
 
 MonoType*
-mono_reflection_get_type_checked (MonoImage* image, MonoTypeNameParse *info, mono_bool ignorecase, mono_bool *type_resolve, MonoError *error);
+mono_reflection_get_type_checked (MonoImage *rootimage, MonoImage* image, MonoTypeNameParse *info, mono_bool ignorecase, mono_bool *type_resolve, MonoError *error);
 
 MonoType*
 mono_reflection_type_from_name_checked (char *name, MonoImage *image, MonoError *error);
index 47b228175ade861b6e8621fab5965f046ea071c1..d477f51c245565a438cfa64ce3d1e469e98a2a1c 100644 (file)
@@ -8629,6 +8629,7 @@ mono_reflection_get_type (MonoImage* image, MonoTypeNameParse *info, gboolean ig
 
 /**
  * mono_reflection_get_type_checked:
+ * @rootimage: the image of the currently active managed caller
  * @image: a metadata context
  * @info: type description structure
  * @ignorecase: flag for case-insensitive string compares
@@ -8639,9 +8640,9 @@ mono_reflection_get_type (MonoImage* image, MonoTypeNameParse *info, gboolean ig
  *
  */
 MonoType*
-mono_reflection_get_type_checked (MonoImage* image, MonoTypeNameParse *info, gboolean ignorecase, gboolean *type_resolve, MonoError *error) {
+mono_reflection_get_type_checked (MonoImage *rootimage, MonoImage* image, MonoTypeNameParse *info, gboolean ignorecase, gboolean *type_resolve, MonoError *error) {
        mono_error_init (error);
-       return mono_reflection_get_type_with_rootimage (image, image, info, ignorecase, type_resolve, error);
+       return mono_reflection_get_type_with_rootimage (rootimage, image, info, ignorecase, type_resolve, error);
 }
 
 
@@ -9702,11 +9703,6 @@ mono_reflection_resolve_custom_attribute_data (MonoReflectionMethod *ref_method,
        if (!mono_error_ok (&error))
                goto leave;
 
-       if (mono_loader_get_last_error ()) {
-               mono_error_set_from_loader_error (&error);
-               goto leave;
-       }
-
        if (!typedargs || !namedargs)
                goto leave;
 
@@ -10433,7 +10429,6 @@ mono_reflection_get_custom_attrs_by_type (MonoObject *obj, MonoClass *attr_klass
                if (!result)
                        return NULL;
        } else {
-               mono_loader_assert_no_error ();
                result = mono_array_new_cached (mono_domain_get (), mono_defaults.attribute_class, 0);
        }
 
@@ -10501,9 +10496,6 @@ mono_reflection_get_custom_attrs_data_checked (MonoObject *obj, MonoError *error
        } else
                result = mono_array_new (mono_domain_get (), mono_defaults.customattribute_data_class, 0);
 
-       if (mono_loader_get_last_error ())
-               mono_error_set_from_loader_error (error);
-
        return result;
 }
 
index af85ac1b3c3eb1c8423c252eed10cf9fa82f77d9..ad28290bcc93a30e979f7e7d7cc3b1e09e8fafb4 100644 (file)
@@ -1,6 +1,7 @@
 #ifndef __METADATA_REFLECTION_H__
 #define __METADATA_REFLECTION_H__
 
+#include <mono/utils/mono-compiler.h>
 #include <mono/metadata/object.h>
 
 MONO_BEGIN_DECLS
index 2956d95420a1460145c6ab4a3c8e688ef5ce00f4..cadd83f30fd0d1f37a30312a54e32b9f213d1401 100644 (file)
@@ -2298,6 +2298,7 @@ void
 sgen_client_thread_register_worker (void)
 {
        mono_thread_info_register_small_id ();
+       mono_thread_info_set_name (mono_native_thread_id_get (), "SGen worker");
 }
 
 /* Variables holding start/end nursery so it won't have to be passed at every call */
@@ -2938,9 +2939,14 @@ sgen_client_describe_invalid_pointer (GCObject *ptr)
        sgen_bridge_describe_pointer (ptr);
 }
 
+static gboolean gc_inited;
+
 void
 mono_gc_base_init (void)
 {
+       if (gc_inited)
+               return;
+
        mono_counters_init ();
 
 #ifdef HEAVY_STATISTICS
@@ -2963,6 +2969,8 @@ mono_gc_base_init (void)
        if (mono_tls_key_get_offset (TLS_KEY_SGEN_TLAB_NEXT_ADDR) == -1)
                sgen_set_use_managed_allocator (FALSE);
 #endif
+
+       gc_inited = TRUE;
 }
 
 void
index 5f4f36a193f92ec0ee314160d9c1ea6db52dfc75..b479fb1bd35a20946061e8a5c812a2fa716afc81 100644 (file)
@@ -584,7 +584,7 @@ ves_icall_System_IOSelector_Add (gpointer handle, MonoIOSelectorJob *job)
 
        g_assert (handle >= 0);
 
-       g_assert (job->operation == EVENT_IN ^ job->operation == EVENT_OUT);
+       g_assert ((job->operation == EVENT_IN) ^ (job->operation == EVENT_OUT));
        g_assert (job->callback);
 
        if (mono_runtime_is_shutting_down ())
index 62fc34aef3f2b11e470b7a8912c819bbf68a6db1..14ebdf648ceb2ff052f46f2115b62b87830ded6a 100644 (file)
@@ -592,7 +592,8 @@ worker_thread (gpointer data)
        thread = mono_thread_internal_current ();
        g_assert (thread);
 
-       mono_thread_set_name_internal (thread, mono_string_new (mono_domain_get (), "Threadpool worker"), FALSE);
+       mono_thread_set_name_internal (thread, mono_string_new (mono_get_root_domain (), "Threadpool worker"), FALSE, &error);
+       mono_error_assert_ok (&error);
 
        mono_coop_mutex_lock (&threadpool->active_threads_lock);
        g_ptr_array_add (threadpool->working_threads, thread);
index b970e96e038a2fd0944ccb0c01295aa048b4e7f7..f767247435aa25f7ebe39c62836cf651692fa93e 100644 (file)
@@ -218,7 +218,7 @@ MONO_API MonoException* mono_thread_get_undeniable_exception (void);
 
 MonoException* mono_thread_get_and_clear_pending_exception (void);
 
-void mono_thread_set_name_internal (MonoInternalThread *this_obj, MonoString *name, gboolean managed);
+void mono_thread_set_name_internal (MonoInternalThread *this_obj, MonoString *name, gboolean managed, MonoError *error);
 
 void mono_runtime_set_has_tls_get (gboolean val);
 gboolean mono_runtime_has_tls_get (void);
index 5884d0270e58ee9ce7dd577fc37d3d16a8a4fced..856f0abf8797153ac0049e640442c89ba8097713 100644 (file)
@@ -454,7 +454,9 @@ static void thread_cleanup (MonoInternalThread *thread)
        }
        mono_release_type_locks (thread);
 
-       mono_profiler_thread_end (thread->tid);
+       /* Can happen when we attach the profiler helper thread in order to heapshot. */
+       if (!mono_thread_info_lookup (thread->tid)->tools_thread)
+               mono_profiler_thread_end (thread->tid);
 
        if (thread == mono_thread_internal_current ()) {
                /*
@@ -616,23 +618,25 @@ create_internal_thread (MonoError *error)
        return thread;
 }
 
-static void
-init_root_domain_thread (MonoInternalThread *thread, MonoThread *candidate)
+static gboolean
+init_root_domain_thread (MonoInternalThread *thread, MonoThread *candidate, MonoError *error)
 {
-       MonoError error;
        MonoDomain *domain = mono_get_root_domain ();
 
+       mono_error_init (error);
        if (!candidate || candidate->obj.vtable->domain != domain) {
-               candidate = new_thread_with_internal (domain, thread, &error);
-               mono_error_raise_exception (&error); /* FIXME don't raise here */
+               candidate = new_thread_with_internal (domain, thread, error);
+               return_val_if_nok (error, FALSE);
        }
        set_current_thread_for_domain (domain, thread, candidate);
        g_assert (!thread->root_domain_thread);
        MONO_OBJECT_SETREF (thread, root_domain_thread, candidate);
+       return TRUE;
 }
 
 static guint32 WINAPI start_wrapper_internal(void *data)
 {
+       MonoError error;
        MonoThreadInfo *info;
        StartInfo *start_info = (StartInfo *)data;
        guint32 (*start_func)(void *);
@@ -681,7 +685,8 @@ static guint32 WINAPI start_wrapper_internal(void *data)
        /* We have to do this here because mono_thread_new_init()
           requires that root_domain_thread is set up. */
        thread_adjust_static_data (internal);
-       init_root_domain_thread (internal, start_info->obj);
+       init_root_domain_thread (internal, start_info->obj, &error);
+       mono_error_raise_exception (&error); /* FIXME don't raise here */
 
        /* This MUST be called before any managed code can be
         * executed, as it calls the callback function that (for the
@@ -725,6 +730,7 @@ static guint32 WINAPI start_wrapper_internal(void *data)
        if (internal->name && (internal->flags & MONO_THREAD_FLAG_NAME_SET)) {
                char *tname = g_utf16_to_utf8 (internal->name, internal->name_len, NULL, NULL, NULL);
                mono_profiler_thread_name (internal->tid, tname);
+               mono_thread_info_set_name (internal->tid, tname);
                g_free (tname);
        }
        /* start_func is set only for unmanaged start functions */
@@ -787,7 +793,7 @@ static guint32 WINAPI start_wrapper(void *data)
  */
 static gboolean
 create_thread (MonoThread *thread, MonoInternalThread *internal, StartInfo *start_info, gboolean threadpool_thread, guint32 stack_size,
-                          gboolean throw_on_failure)
+                          MonoError *error)
 {
        HANDLE thread_handle;
        MonoNativeThreadId tid;
@@ -799,6 +805,8 @@ create_thread (MonoThread *thread, MonoInternalThread *internal, StartInfo *star
         */
        mono_threads_join_threads ();
 
+       mono_error_init (error);
+
        mono_threads_lock ();
        if (shutting_down) {
                g_free (start_info);
@@ -834,15 +842,12 @@ create_thread (MonoThread *thread, MonoInternalThread *internal, StartInfo *star
                                                                                                stack_size, create_flags, &tid);
 
        if (thread_handle == NULL) {
-               /* The thread couldn't be created, so throw an exception */
+               /* The thread couldn't be created, so set an exception */
                mono_threads_lock ();
                mono_g_hash_table_remove (threads_starting_up, thread);
                mono_threads_unlock ();
                g_free (start_info);
-               if (throw_on_failure)
-                       mono_raise_exception (mono_get_exception_execution_engine ("Couldn't create thread"));
-               else
-                       g_warning ("%s: CreateThread error 0x%x", __func__, GetLastError ());
+               mono_error_set_execution_engine (error, "Couldn't create thread. Error 0x%x", GetLastError());
                return FALSE;
        }
        THREAD_DEBUG (g_message ("%s: Started thread ID %"G_GSIZE_FORMAT" (handle %p)", __func__, tid, thread_handle));
@@ -931,9 +936,11 @@ mono_thread_create_internal (MonoDomain *domain, gpointer func, gpointer arg, gb
        start_info->obj = thread;
        start_info->start_arg = arg;
 
-       res = create_thread (thread, internal, start_info, threadpool_thread, stack_size, TRUE);
-       if (!res)
+       res = create_thread (thread, internal, start_info, threadpool_thread, stack_size, &error);
+       if (!res) {
+               mono_error_raise_exception (&error); /* FIXME don't raise here */
                return NULL;
+       }
 
        /* Check that the managed and unmanaged layout of MonoInternalThread matches */
 #ifndef MONO_CROSS_COMPILE
@@ -1019,7 +1026,9 @@ mono_thread_attach_full (MonoDomain *domain, gboolean force_attach, MonoError *e
 
        thread_adjust_static_data (thread);
 
-       init_root_domain_thread (thread, current_thread);
+       init_root_domain_thread (thread, current_thread, error);
+       return_val_if_nok (error, NULL);
+
        if (domain != mono_get_root_domain ())
                set_current_thread_for_domain (domain, thread, current_thread);
 
@@ -1036,8 +1045,10 @@ mono_thread_attach_full (MonoDomain *domain, gboolean force_attach, MonoError *e
                        mono_thread_attach_cb (MONO_NATIVE_THREAD_ID_TO_UINT (tid), staddr + stsize);
        }
 
-       // FIXME: Need a separate callback
-       mono_profiler_thread_start (MONO_NATIVE_THREAD_ID_TO_UINT (tid));
+       /* Can happen when we attach the profiler helper thread in order to heapshot. */
+       if (!info->tools_thread)
+               // FIXME: Need a separate callback
+               mono_profiler_thread_start (MONO_NATIVE_THREAD_ID_TO_UINT (tid));
 
        return current_thread;
 }
@@ -1123,6 +1134,7 @@ HANDLE
 ves_icall_System_Threading_Thread_Thread_internal (MonoThread *this_obj,
                                                                                                   MonoObject *start)
 {
+       MonoError error;
        StartInfo *start_info;
        MonoInternalThread *internal;
        gboolean res;
@@ -1153,8 +1165,9 @@ ves_icall_System_Threading_Thread_Thread_internal (MonoThread *this_obj,
        start_info->obj = this_obj;
        g_assert (this_obj->obj.vtable->domain == mono_domain_get ());
 
-       res = create_thread (this_obj, internal, start_info, FALSE, 0, FALSE);
+       res = create_thread (this_obj, internal, start_info, FALSE, 0, &error);
        if (!res) {
+               mono_error_cleanup (&error);
                UNLOCK_THREAD (internal);
                return NULL;
        }
@@ -1345,14 +1358,16 @@ ves_icall_System_Threading_Thread_GetName_internal (MonoInternalThread *this_obj
 }
 
 void 
-mono_thread_set_name_internal (MonoInternalThread *this_obj, MonoString *name, gboolean managed)
+mono_thread_set_name_internal (MonoInternalThread *this_obj, MonoString *name, gboolean managed, MonoError *error)
 {
        LOCK_THREAD (this_obj);
 
+       mono_error_init (error);
+
        if ((this_obj->flags & MONO_THREAD_FLAG_NAME_SET) && !this_obj->threadpool_thread) {
                UNLOCK_THREAD (this_obj);
                
-               mono_raise_exception (mono_get_exception_invalid_operation ("Thread.Name can only be set once."));
+               mono_error_set_invalid_operation (error, "Thread.Name can only be set once.");
                return;
        }
        if (this_obj->name) {
@@ -1383,7 +1398,9 @@ mono_thread_set_name_internal (MonoInternalThread *this_obj, MonoString *name, g
 void 
 ves_icall_System_Threading_Thread_SetName_internal (MonoInternalThread *this_obj, MonoString *name)
 {
-       mono_thread_set_name_internal (this_obj, name, TRUE);
+       MonoError error;
+       mono_thread_set_name_internal (this_obj, name, TRUE, &error);
+       mono_error_set_pending_exception (&error);
 }
 
 /*
index 1d291ddb459d2d26df9f940b10ba05548fd50630..c3da0227e3c78f729968ffa1e9c4391a47a84e51 100644 (file)
@@ -885,12 +885,11 @@ mono_type_is_valid_in_context (VerifyContext *ctx, MonoType *type)
 
        klass = mono_class_from_mono_type (type);
        mono_class_init (klass);
-       if (mono_loader_get_last_error () || mono_class_has_failure (klass)) {
+       if (mono_class_has_failure (klass)) {
                if (klass->generic_class && !mono_class_is_valid_generic_instantiation (NULL, klass))
                        ADD_VERIFY_ERROR2 (ctx, g_strdup_printf ("Invalid generic instantiation of type %s.%s at 0x%04x", klass->name_space, klass->name, ctx->ip_offset), MONO_EXCEPTION_TYPE_LOAD);
                else
                        ADD_VERIFY_ERROR2 (ctx, g_strdup_printf ("Could not load type %s.%s at 0x%04x", klass->name_space, klass->name, ctx->ip_offset), MONO_EXCEPTION_TYPE_LOAD);
-               mono_loader_clear_error ();
                return FALSE;
        }
 
@@ -1021,9 +1020,8 @@ verifier_load_type (VerifyContext *ctx, int token, const char *opcode) {
                mono_error_cleanup (&error); /*FIXME don't swallow the error */
        }
 
-       if (!type || mono_loader_get_last_error ()) {
+       if (!type) {
                ADD_VERIFY_ERROR2 (ctx, g_strdup_printf ("Cannot load type from token 0x%08x for %s at 0x%04x", token, opcode, ctx->ip_offset), MONO_EXCEPTION_BAD_IMAGE);
-               mono_loader_clear_error ();
                return NULL;
        }
 
index 8fc453350cd2eb87f7cabfeefe778b0a69265c65..39752cdf079a71d5d6a9aa85705aadc32b0e2141 100755 (executable)
@@ -48,7 +48,8 @@ RUNTIME_EXECUTABLE = $(if $(BOEHM),$(top_builddir)/mono/mini/mono-boehm,$(top_bu
 MINI_RUNTIME = MONO_PATH=$(CLASS) $(RUNTIME_EXECUTABLE)
 RUNTIME_AOTCHECK = MONO_PATH="$(CLASS)$(PLATFORM_PATH_SEPARATOR)." $(RUNTIME_EXECUTABLE)
 
-MCS = $(MINI_RUNTIME) $(mcs_topdir)/class/lib/build/mcs.exe -unsafe -nowarn:0162
+CSC = $(mcs_topdir)/class/lib/build/mcs.exe
+MCS = CSC_SDK_PATH_DISABLED= $(MINI_RUNTIME) $(CSC) -unsafe -nowarn:0162 -nologo -noconfig -r:$(CLASS)/mscorlib.dll -r:$(CLASS)/System.dll
 ILASM = $(MINI_RUNTIME) $(CLASS)/ilasm.exe
 
 AM_CFLAGS = \
@@ -602,13 +603,13 @@ libmonoinclude_HEADERS = jit.h
 CSFLAGS = -unsafe -nowarn:0219,0169,0414,0649
 
 basic-simd.exe: basic-simd.cs TestDriver.dll
-       $(MCS) -out:$@ $(CSFLAGS) $< -r:TestDriver.dll -r:Mono.Simd.dll
+       $(MCS) -out:$@ $(CSFLAGS) $< -r:TestDriver.dll -r:$(CLASS)/Mono.Simd.dll
 
 nacl.exe: nacl.cs TestDriver.dll
-       $(MCS) -out:$@ $(CSFLAGS) $< -r:TestDriver.dll -r:Mono.Simd.dll
+       $(MCS) -out:$@ $(CSFLAGS) $< -r:TestDriver.dll -r:$(CLASS)/Mono.Simd.dll
 
 generics.exe: generics.cs TestDriver.dll generics-variant-types.dll
-       $(MCS) -out:$@ $(CSFLAGS) $< -r:TestDriver.dll -r:generics-variant-types.dll
+       $(MCS) -out:$@ $(CSFLAGS) $< -r:TestDriver.dll -r:generics-variant-types.dll -r:$(CLASS)/System.Core.dll
 
 %.exe: %.cs TestDriver.dll
        $(MCS) -out:$@ $(CSFLAGS) $< -r:TestDriver.dll
index dd2780edac9e524123b6483fca0e54cb4e5ff95b..f65b3a6ee68a58a0b22aae2c31695b1d46471843 100644 (file)
@@ -1120,8 +1120,7 @@ arm64_emit_static_rgctx_trampoline (MonoAotCompile *acfg, int offset, int *tramp
        /* Similar to the specific trampolines, but use the rgctx reg instead of ip1 */
 
        /* Load argument from first GOT slot */
-       g_assert (MONO_ARCH_RGCTX_REG == 27);
-       arm64_emit_load_got_slot (acfg, ARMREG_R27, offset);
+       arm64_emit_load_got_slot (acfg, MONO_ARCH_RGCTX_REG, offset);
        /* Load generic trampoline address from second GOT slot */
        arm64_emit_load_got_slot (acfg, ARMREG_R16, offset + 1);
        fprintf (acfg->fp, "br x16\n");
@@ -7548,8 +7547,6 @@ compile_method (MonoAotCompile *acfg, MonoMethod *method)
        cfg = mini_method_compile (method, acfg->opts, mono_get_root_domain (), flags, 0, index);
        mono_time_track_end (&mono_jit_stats.jit_time, jit_timer);
 
-       mono_loader_clear_error ();
-
        if (cfg->exception_type == MONO_EXCEPTION_GENERIC_SHARING_FAILED) {
                if (acfg->aot_opts.print_skipped_methods)
                        printf ("Skip (gshared failure): %s (%s)\n", mono_method_get_full_name (method), cfg->exception_message);
@@ -7868,7 +7865,10 @@ compile_thread_main (gpointer *user_data)
        GPtrArray *methods = (GPtrArray *)user_data [2];
        int i;
 
-       mono_thread_attach (domain);
+       MonoError error;
+       MonoThread *thread = mono_thread_attach (domain);
+       mono_thread_set_name_internal (thread->internal_thread, mono_string_new (mono_get_root_domain (), "AOT compiler"), TRUE, &error);
+       mono_error_assert_ok (&error);
 
        for (i = 0; i < methods->len; ++i)
                compile_method (acfg, (MonoMethod *)g_ptr_array_index (methods, i));
index b2712b486eb1dcea61a4dcc220c2550953f907ca..c7e18a0f0d9af49c4a515e255662d5781568a4e1 100644 (file)
@@ -7258,7 +7258,7 @@ vm_commands (int command, int id, guint8 *p, guint8 *end, Buffer *buf)
                                        MonoError error;
                                        type_resolve = TRUE;
                                        /* FIXME really okay to call while holding locks? */
-                                       t = mono_reflection_get_type_checked (ass->image, &info, ignore_case, &type_resolve, &error);
+                                       t = mono_reflection_get_type_checked (ass->image, ass->image, &info, ignore_case, &type_resolve, &error);
                                        mono_error_cleanup (&error); 
                                        if (t) {
                                                g_ptr_array_add (res_classes, mono_type_get_class (t));
@@ -7692,7 +7692,7 @@ assembly_commands (int command, guint8 *p, guint8 *end, Buffer *buf)
                } else {
                        if (info.assembly.name)
                                NOT_IMPLEMENTED;
-                       t = mono_reflection_get_type_checked (ass->image, &info, ignorecase, &type_resolve, &error);
+                       t = mono_reflection_get_type_checked (ass->image, ass->image, &info, ignorecase, &type_resolve, &error);
                        if (!is_ok (&error)) {
                                mono_error_cleanup (&error); /* FIXME don't swallow the error */
                                mono_reflection_free_type_info (&info);
@@ -9675,6 +9675,7 @@ wait_for_attach (void)
 static guint32 WINAPI
 debugger_thread (void *arg)
 {
+       MonoError error;
        int res, len, id, flags, command = 0;
        CommandSet command_set = (CommandSet)0;
        guint8 header [HEADER_LENGTH];
@@ -9690,8 +9691,11 @@ debugger_thread (void *arg)
        debugger_thread_id = mono_native_thread_id_get ();
 
        attach_cookie = mono_jit_thread_attach (mono_get_root_domain (), &attach_dummy);
+       MonoInternalThread *thread = mono_thread_internal_current ();
+       mono_thread_set_name_internal (thread, mono_string_new (mono_get_root_domain (), "Debugger agent"), TRUE, &error);
+       mono_error_assert_ok (&error);
 
-       mono_thread_internal_current ()->flags |= MONO_THREAD_FLAG_DONT_MANAGE;
+       thread->flags |= MONO_THREAD_FLAG_DONT_MANAGE;
 
        mono_set_is_debugger_attached (TRUE);
        
index a84cd2f6ab049bf3bde009f94c6c947ece646446..f1c27d7dc404fe214ff5d13837dfd7677988ea65 100644 (file)
@@ -1191,6 +1191,8 @@ mini_usage_jitdeveloper (void)
                 "    --agent=ASSEMBLY[:ARG] Loads the specific agent assembly and executes its Main method with the given argument before loading the main assembly.\n"
                 "    --no-x86-stack-align   Don't align stack on x86\n"
                 "\n"
+                "The options supported by MONO_DEBUG can also be passed on the command line.\n"
+                "\n"
                 "Other options:\n" 
                 "    --graph[=TYPE] METHOD  Draws a graph of the specified method:\n");
        
@@ -1440,6 +1442,7 @@ mono_jit_parse_options (int argc, char * argv[])
 #else
                        mono_use_llvm = TRUE;
 #endif
+               } else if (argv [i][0] == '-' && argv [i][1] == '-' && mini_parse_debug_option (argv [i] + 2)) {
                } else {
                        fprintf (stderr, "Unsupported command line option: '%s'\n", argv [i]);
                        exit (1);
@@ -1912,6 +1915,7 @@ mono_main (int argc, char* argv[])
                } else if (strcmp (argv [i], "--nacl-null-checks-off") == 0){
                        nacl_null_checks_off = TRUE;
 #endif
+               } else if (argv [i][0] == '-' && argv [i][1] == '-' && mini_parse_debug_option (argv [i] + 2)) {
                } else {
                        fprintf (stderr, "Unknown command line option: '%s'\n", argv [i]);
                        return 1;
@@ -1983,8 +1987,16 @@ mono_main (int argc, char* argv[])
        /* Set rootdir before loading config */
        mono_set_rootdir ();
 
-       if (enable_profile)
+       /*
+        * We only set the native name of the thread since MS.NET leaves the
+        * managed thread name for the main thread as null.
+        */
+       mono_thread_info_set_name (mono_native_thread_id_get (), "Main");
+
+       if (enable_profile) {
                mono_profiler_load (profile_options);
+               mono_profiler_thread_name (mono_native_thread_id_get (), "Main");
+       }
 
        mono_attach_parse_options (attach_options);
 
index b53661e519b4d18cdcf1534dfd45191dc0a0511e..ad25f58728ec9c6a3de38dd253f4e0cecdb92c78 100644 (file)
@@ -572,71 +572,6 @@ static DwarfBasicType basic_types [] = {
 #define LINE_BASE -5
 #define LINE_RANGE 14
 
-/* Subsections of the .debug_line section */
-#define LINE_SUBSECTION_HEADER 1
-#define LINE_SUBSECTION_INCLUDES 2
-#define LINE_SUBSECTION_FILES 3
-#define LINE_SUBSECTION_DATA 4
-#define LINE_SUBSECTION_END 5
-
-static int
-emit_line_number_file_name (MonoDwarfWriter *w, const char *name,
-                                                       gint64 last_mod_time, gint64 file_size)
-{
-       int index;
-       int dir_index;
-       char *basename = NULL;
-
-       if (!w->file_to_index)
-               w->file_to_index = g_hash_table_new (g_str_hash, g_str_equal);
-
-       index = GPOINTER_TO_UINT (g_hash_table_lookup (w->file_to_index, name));
-       if (index > 0)
-               return index;
-
-       if (g_path_is_absolute (name)) {
-               char *dir = g_path_get_dirname (name);
-
-               if (!w->dir_to_index)
-                       w->dir_to_index = g_hash_table_new (g_str_hash, g_str_equal);
-
-               dir_index = GPOINTER_TO_UINT (g_hash_table_lookup (w->dir_to_index, dir));
-               if (dir_index == 0) {
-                       emit_section_change (w, ".debug_line", LINE_SUBSECTION_INCLUDES);
-                       emit_string (w, dir);
-
-                       dir_index = ++ w->line_number_dir_index;
-                       g_hash_table_insert (w->dir_to_index, g_strdup (dir), GUINT_TO_POINTER (dir_index));
-               }
-
-               g_free (dir);
-
-               basename = g_path_get_basename (name);
-       } else {
-               dir_index = 0;
-       }
-
-       emit_section_change (w, ".debug_line", LINE_SUBSECTION_FILES);
-
-       if (basename)
-               emit_string (w, basename);
-       else
-               emit_string (w, name);
-       emit_uleb128 (w, dir_index);
-       emit_byte (w, 0);
-       emit_byte (w, 0);
-
-       emit_section_change (w, ".debug_line", LINE_SUBSECTION_DATA);
-
-       if (basename)
-               g_free (basename);
-
-       index = ++ w->line_number_file_index;
-       g_hash_table_insert (w->file_to_index, g_strdup (name), GUINT_TO_POINTER (index));
-
-       return index;
-}
-
 static int
 get_line_number_file_name (MonoDwarfWriter *w, const char *name)
 {
@@ -1658,7 +1593,7 @@ emit_line_number_info (MonoDwarfWriter *w, MonoMethod *method,
                addr_diff = i - prev_native_offset;
 
                if (first) {    
-                       emit_section_change (w, ".debug_line", LINE_SUBSECTION_DATA);
+                       emit_section_change (w, ".debug_line", 0);
 
                        emit_byte (w, 0);
                        emit_byte (w, sizeof (gpointer) + 1);
@@ -1732,7 +1667,7 @@ emit_line_number_info (MonoDwarfWriter *w, MonoMethod *method,
 
                il_to_line = g_new0 (int, header->code_size);
 
-               emit_section_change (w, ".debug_line", LINE_SUBSECTION_DATA);
+               emit_section_change (w, ".debug_line", 0);
                emit_byte (w, 0);
                emit_byte (w, sizeof (gpointer) + 1);
                emit_byte (w, DW_LNE_set_address);
index 717443c9a67dcfa6056ba65dc63f468457059ead..fe210faa3a22ce14883bcad17c657328cf8bd746 100644 (file)
@@ -378,8 +378,10 @@ mono_arm_throw_exception (gpointer arg, mgreg_t pc, mgreg_t *int_regs, gdouble *
 
        if (mono_object_isinst_checked (exc, mono_defaults.exception_class, &error)) {
                MonoException *mono_ex = (MonoException*)exc;
-               if (!rethrow)
+               if (!rethrow) {
                        mono_ex->stack_trace = NULL;
+                       mono_ex->trace_ips = NULL;
+               }
        }
        mono_error_assert_ok (&error);
 
@@ -500,18 +502,6 @@ mono_arch_unwind_frame (MonoDomain *domain, MonoJitTlsData *jit_tls,
        return FALSE;
 }
 
-void
-mono_arch_sigctx_to_monoctx (void *sigctx, MonoContext *mctx)
-{
-       mono_sigctx_to_monoctx (sigctx, mctx);
-}
-
-void
-mono_arch_monoctx_to_sigctx (MonoContext *mctx, void *sigctx)
-{
-       mono_monoctx_to_sigctx (mctx, sigctx);
-}
-
 /*
  * handle_exception:
  *
@@ -548,7 +538,7 @@ mono_arch_handle_exception (void *ctx, gpointer obj)
        jit_tls = mono_native_tls_get_value (mono_jit_tls_id);
 
        /* Pass the ctx parameter in TLS */
-       mono_arch_sigctx_to_monoctx (sigctx, &jit_tls->ex_ctx);
+       mono_sigctx_to_monoctx (sigctx, &jit_tls->ex_ctx);
        /* The others in registers */
        UCONTEXT_REG_R0 (sigctx) = (gsize)obj;
 
index aed8309edf6ef795d06aca1840712df51809916c..587d08254e5f2143e2555a1d3bc579ddb2bb42e5 100644 (file)
@@ -7261,7 +7261,6 @@ inline_method (MonoCompile *cfg, MonoMethod *cmethod, MonoMethodSignature *fsig,
                if (cfg->verbose_level > 2)
                        printf ("INLINE ABORTED %s (cost %d)\n", mono_method_full_name (cmethod, TRUE), costs);
                cfg->exception_type = MONO_EXCEPTION_NONE;
-               mono_loader_clear_error ();
 
                /* This gets rid of the newly added bblocks */
                cfg->cbb = prev_cbb;
index c3e2e99bc861f879e695351b5a8e34c634f95e86..dffa9370f27024990fe7e52ab6a01d3128ca4498 100644 (file)
@@ -274,7 +274,7 @@ mono_arch_get_gsharedvt_call_info (gpointer addr, MonoMethodSignature *normal_si
        DEBUG_AMD64_GSHAREDVT_PRINT ("source sig: (%s) return (%s)\n", mono_signature_get_desc (caller_sig, FALSE), mono_type_full_name (mono_signature_get_return_type (caller_sig))); // Leak
        DEBUG_AMD64_GSHAREDVT_PRINT ("dest sig: (%s) return (%s)\n", mono_signature_get_desc (callee_sig, FALSE), mono_type_full_name (mono_signature_get_return_type (callee_sig)));
 
-       if (gcinfo->ret.is_gsharedvt_return_value) {
+       if (gcinfo->ret.storage == ArgGsharedvtVariableInReg) {
                /*
                 * The return type is gsharedvt
                 */
@@ -357,7 +357,7 @@ mono_arch_get_gsharedvt_call_info (gpointer addr, MonoMethodSignature *normal_si
 
        if (cinfo->ret.storage == ArgValuetypeAddrInIReg) {
                /* Both the caller and the callee pass the vtype ret address in r8 */
-               g_assert (cinfo->ret.storage == gcinfo->ret.storage);
+               g_assert (gcinfo->ret.storage == ArgValuetypeAddrInIReg || gcinfo->ret.storage == ArgGsharedvtVariableInReg);
                add_to_map (map, map_reg (cinfo->ret.reg), map_reg (cinfo->ret.reg));
        }
 
@@ -370,7 +370,7 @@ mono_arch_get_gsharedvt_call_info (gpointer addr, MonoMethodSignature *normal_si
        info->calli = calli;
 
        if (var_ret) {
-               g_assert (gcinfo->ret.is_gsharedvt_return_value);
+               g_assert (gcinfo->ret.storage == ArgGsharedvtVariableInReg);
                info->vret_arg_reg = map_reg (gcinfo->ret.reg);
                DEBUG_AMD64_GSHAREDVT_PRINT ("mapping vreg_arg_reg to %d in reg %s\n", info->vret_arg_reg, mono_arch_regname (gcinfo->ret.reg));
        } else {
@@ -475,4 +475,4 @@ mono_arch_get_gsharedvt_call_info (gpointer addr, MonoMethodSignature *normal_si
        return info;
 }
 
-#endif
\ No newline at end of file
+#endif
index 18e48283d95cf103e25714f8d4478a8276a654f8..901a6c99d76554f74d5ef72cec3a828b6e0802c8 100644 (file)
@@ -1108,6 +1108,7 @@ get_call_info (MonoMemPool *mp, MonoMethodSignature *sig)
                cinfo = (CallInfo *)g_malloc0 (sizeof (CallInfo) + (sizeof (ArgInfo) * n));
 
        cinfo->nargs = n;
+       cinfo->gsharedvt = mini_is_gsharedvt_variable_signature (sig);
 
        gr = 0;
        fr = 0;
@@ -1158,8 +1159,7 @@ get_call_info (MonoMemPool *mp, MonoMethodSignature *sig)
                        break;
                }
                if (mini_is_gsharedvt_type (ret_type)) {
-                       cinfo->ret.storage = ArgValuetypeAddrInIReg;
-                       cinfo->ret.is_gsharedvt_return_value = 1;
+                       cinfo->ret.storage = ArgGsharedvtVariableInReg;
                        break;
                }
                /* fall through */
@@ -1174,8 +1174,7 @@ get_call_info (MonoMemPool *mp, MonoMethodSignature *sig)
        case MONO_TYPE_VAR:
        case MONO_TYPE_MVAR:
                g_assert (mini_is_gsharedvt_type (ret_type));
-               cinfo->ret.storage = ArgValuetypeAddrInIReg;
-               cinfo->ret.is_gsharedvt_return_value = 1;
+               cinfo->ret.storage = ArgGsharedvtVariableInReg;
                break;
        case MONO_TYPE_VOID:
                break;
@@ -1191,7 +1190,8 @@ get_call_info (MonoMemPool *mp, MonoMethodSignature *sig)
         * are sometimes made using calli without sig->hasthis set, like in the delegate
         * invoke wrappers.
         */
-       if (cinfo->ret.storage == ArgValuetypeAddrInIReg && !is_pinvoke && (sig->hasthis || (sig->param_count > 0 && MONO_TYPE_IS_REFERENCE (mini_get_underlying_type (sig->params [0]))))) {
+       ArgStorage ret_storage = cinfo->ret.storage;
+       if ((ret_storage == ArgValuetypeAddrInIReg || ret_storage == ArgGsharedvtVariableInReg) && !is_pinvoke && (sig->hasthis || (sig->param_count > 0 && MONO_TYPE_IS_REFERENCE (mini_get_underlying_type (sig->params [0]))))) {
                if (sig->hasthis) {
                        add_general (&gr, &stack_size, cinfo->args + 0);
                } else {
@@ -1199,16 +1199,16 @@ get_call_info (MonoMemPool *mp, MonoMethodSignature *sig)
                        pstart = 1;
                }
                add_general (&gr, &stack_size, &cinfo->ret);
-               cinfo->ret.storage = ArgValuetypeAddrInIReg;
+               cinfo->ret.storage = ret_storage;
                cinfo->vret_arg_index = 1;
        } else {
                /* this */
                if (sig->hasthis)
                        add_general (&gr, &stack_size, cinfo->args + 0);
 
-               if (cinfo->ret.storage == ArgValuetypeAddrInIReg) {
+               if (ret_storage == ArgValuetypeAddrInIReg || ret_storage == ArgGsharedvtVariableInReg) {
                        add_general (&gr, &stack_size, &cinfo->ret);
-                       cinfo->ret.storage = ArgValuetypeAddrInIReg;
+                       cinfo->ret.storage = ret_storage;
                }
        }
 
@@ -1865,6 +1865,7 @@ mono_arch_allocate_vars (MonoCompile *cfg)
                        cfg->ret->dreg = cinfo->ret.reg;
                        break;
                case ArgValuetypeAddrInIReg:
+               case ArgGsharedvtVariableInReg:
                        /* The register is volatile */
                        cfg->vret_addr->opcode = OP_REGOFFSET;
                        cfg->vret_addr->inst_basereg = cfg->frame_reg;
@@ -2042,7 +2043,7 @@ mono_arch_create_vars (MonoCompile *cfg)
                cfg->ret_var_is_local = TRUE;
 
        sig_ret = mini_get_underlying_type (sig->ret);
-       if (cinfo->ret.storage == ArgValuetypeAddrInIReg) {
+       if (cinfo->ret.storage == ArgValuetypeAddrInIReg || cinfo->ret.storage == ArgGsharedvtVariableInReg) {
                cfg->vret_addr = mono_compile_create_var (cfg, &mono_defaults.int_class->byval_arg, OP_ARG);
                if (G_UNLIKELY (cfg->verbose_level > 1)) {
                        printf ("vret_addr = ");
@@ -2230,6 +2231,7 @@ mono_arch_get_llvm_call_info (MonoCompile *cfg, MonoMethodSignature *sig)
                break;
        }
        case ArgValuetypeAddrInIReg:
+       case ArgGsharedvtVariableInReg:
                /* Vtype returned using a hidden argument */
                linfo->ret.storage = LLVMArgVtypeRetAddr;
                linfo->vret_arg_index = cinfo->vret_arg_index;
@@ -2479,7 +2481,8 @@ mono_arch_emit_call (MonoCompile *cfg, MonoCallInst *call)
                        MONO_EMIT_NEW_UNALU (cfg, OP_MOVE, ((MonoInst*)cfg->arch.vret_addr_loc)->dreg, call->vret_var->dreg);
                }
                break;
-       case ArgValuetypeAddrInIReg: {
+       case ArgValuetypeAddrInIReg:
+       case ArgGsharedvtVariableInReg: {
                MonoInst *vtarg;
                MONO_INST_NEW (cfg, vtarg, OP_MOVE);
                vtarg->sreg1 = call->vret_var->dreg;
@@ -2770,7 +2773,7 @@ mono_arch_start_dyn_call (MonoDynCallInfo *info, gpointer **args, guint8 *ret, g
                        pindex = 1;
        }
 
-       if (dinfo->cinfo->ret.storage == ArgValuetypeAddrInIReg)
+       if (dinfo->cinfo->ret.storage == ArgValuetypeAddrInIReg || dinfo->cinfo->ret.storage == ArgGsharedvtVariableInReg)
                p->regs [greg ++] = PTR_TO_GREG(ret);
 
        for (i = pindex; i < sig->param_count; i++) {
@@ -2951,7 +2954,7 @@ mono_arch_finish_dyn_call (MonoDynCallInfo *info, guint8 *buf)
                        /* Fall through */
                }
        case MONO_TYPE_VALUETYPE:
-               if (dinfo->cinfo->ret.storage == ArgValuetypeAddrInIReg) {
+               if (dinfo->cinfo->ret.storage == ArgValuetypeAddrInIReg || dinfo->cinfo->ret.storage == ArgGsharedvtVariableInReg) {
                        /* Nothing to do */
                } else {
                        ArgInfo *ainfo = &dinfo->cinfo->ret;
index c22c9be0fd0007b3969fc7beec42ac686e66e0d9..1d04234c1785f7d5eb0045764bc3212a81cdfc42 100644 (file)
@@ -275,6 +275,8 @@ typedef enum {
        /* gsharedvt argument passed by addr */
        ArgGSharedVtInReg,
        ArgGSharedVtOnStack,
+       /* Variable sized gsharedvt argument passed/returned by addr */
+       ArgGsharedvtVariableInReg,
        ArgNone /* only in pair_storage */
 } ArgStorage;
 
@@ -282,7 +284,6 @@ typedef struct {
        gint16 offset;
        gint8  reg;
        ArgStorage storage : 8;
-       gboolean is_gsharedvt_return_value : 1;
 
        /* Only if storage == ArgValuetypeInReg */
        ArgStorage pair_storage [2];
@@ -300,6 +301,7 @@ typedef struct {
        guint32 reg_usage;
        guint32 freg_usage;
        gboolean need_stack_align;
+       gboolean gsharedvt;
        /* The index of the vret arg in the argument list */
        int vret_arg_index;
        ArgInfo ret;
index 47a6dbb5ba2fda5c38e2923c67edefd4f4f5635c..c8fa1c9519b8a3cd82b81e7b38120ab20f2c0fbd 100644 (file)
@@ -130,7 +130,7 @@ DECLARE_GLOBAL_SYMBOL mono_fallback_set_tls_key
        .align 4
 DECLARE_GLOBAL_SYMBOL mono_fast_get_tls_key2
        bic     r0, r0, #0x80000000
-       mrc     15, 0, r1, cr13, cr0, #3
+       mrc     p15, 0, r1, cr13, cr0, #3
        lsls    r0, r0, #3
        ldr     r1, [r1, #4]
        add     r0, r1
@@ -146,7 +146,7 @@ DECLARE_GLOBAL_SYMBOL mono_fast_get_tls_key2_end
        .align 4
 DECLARE_GLOBAL_SYMBOL mono_fast_set_tls_key2
        bic     r0, r0, #0x80000000
-       mrc     15, 0, r2, cr13, cr0, #3
+       mrc     p15, 0, r2, cr13, cr0, #3
        lsls    r0, r0, #3
        ldr     r2, [r2, #4]
        add     r0, r2
index 3d9664b56bfde0998bb87aefb64287777b929571..df24c53c6581c444f8c8c02ce774215617ad4f0b 100644 (file)
@@ -14,7 +14,7 @@
 /*
  * GSHAREDVT
  */
-#ifdef MONO_ARCH_GSHARED_SUPPORTED
+#ifdef MONO_ARCH_GSHAREDVT_SUPPORTED
 
 #define ALIGN_TO(val,align) ((((guint64)val) + ((align) - 1)) & ~((align) - 1))
 
@@ -415,4 +415,4 @@ mono_arm_gsharedvt_init (void)
 {
 }
 
-#endif /* MONO_ARCH_GSHARED_SUPPORTED */
\ No newline at end of file
+#endif /* MONO_ARCH_GSHAREDVT_SUPPORTED */
index 83fe015daa57455a7eebb8a748e4ce0060bfe7ab..cb75bdf7a74fda7899a813f97ceae60ad6f7c895 100644 (file)
@@ -1165,10 +1165,10 @@ add_valuetype (CallInfo *cinfo, ArgInfo *ainfo, MonoType *t)
        int field_offsets [16];
        guint32 align;
 
-       size = mini_type_stack_size_full (t, &align, FALSE);
+       size = mini_type_stack_size_full (t, &align, cinfo->pinvoke);
        align_size = ALIGN_TO (size, 8);
 
-       nregs = size / 8;
+       nregs = align_size / 8;
        if (is_hfa (t, &nfields, &esize, field_offsets)) {
                /*
                 * The struct might include nested float structs aligned at 8,
@@ -1318,6 +1318,7 @@ get_call_info (MonoMemPool *mp, MonoMethodSignature *sig)
                cinfo = g_malloc0 (sizeof (CallInfo) + (sizeof (ArgInfo) * n));
 
        cinfo->nargs = n;
+       cinfo->pinvoke = sig->pinvoke;
 
        /* Return value */
        add_param (cinfo, &cinfo->ret, sig->ret);
@@ -5215,3 +5216,22 @@ mono_arch_get_call_info (MonoMemPool *mp, MonoMethodSignature *sig)
        return get_call_info (mp, sig);
 }
 
+gpointer
+mono_arch_install_handler_block_guard (MonoJitInfo *ji, MonoJitExceptionInfo *clause, MonoContext *ctx, gpointer new_value)
+{
+       gpointer *lr_loc;
+       char *old_value;
+       char *bp;
+
+       /*Load the spvar*/
+       bp = MONO_CONTEXT_GET_BP (ctx);
+       lr_loc = (gpointer*)(bp + clause->exvar_offset);
+
+       old_value = *lr_loc;
+       if ((char*)old_value < (char*)ji->code_start || (char*)old_value > ((char*)ji->code_start + ji->code_size))
+               return old_value;
+
+       *lr_loc = new_value;
+
+       return old_value;
+}
index 154859e7165a50298f3d43ac989abaebc062bd80..e3e90eb6ea59bd350346001e0c5c22a065e4349e 100644 (file)
@@ -159,6 +159,7 @@ typedef struct {
 #define MONO_ARCH_HAVE_OP_GENERIC_CLASS_INIT 1
 #define MONO_ARCH_HAVE_OPCODE_NEEDS_EMULATION 1
 #define MONO_ARCH_HAVE_DECOMPOSE_LONG_OPTS 1
+#define MONO_ARCH_HAVE_HANDLER_BLOCK_GUARD 1
 
 #ifdef TARGET_IOS
 
@@ -174,7 +175,7 @@ typedef struct {
 
 #endif
 
-#if defined(TARGET_APPLETVOS)
+#if defined(TARGET_APPLETVOS) || defined(TARGET_IOS)
 #define MONO_ARCH_HAVE_UNWIND_BACKTRACE 1
 #endif
 
@@ -232,6 +233,7 @@ typedef struct {
 typedef struct {
        int nargs;
        int gr, fr, stack_usage;
+       gboolean pinvoke;
        ArgInfo ret;
        ArgInfo sig_cookie;
        ArgInfo args [1];
index 64e0e39eae4bd2d46ec85ab3b4f01070ae6336d1..08fa26bb1abfbfb0a7e98e5d353dec1a9cf623ce 100644 (file)
@@ -9,6 +9,8 @@
  */
 #include <config.h>
 
+#include <mono/utils/mono-logger-internals.h>
+
 /*
  * Attempt to handle native SIGSEGVs with libunwind or libcorkscrew.
  */
@@ -28,7 +30,7 @@
 
 #define UNW_LOCAL_ONLY
 #undef _U /* ctype.h apparently defines this and it screws up the libunwind headers. */
-#include "android-libunwind/libunwind.h"
+#include "../../external/android-libunwind/include/libunwind.h"
 #define _U 0x01
 
 #define FUNC_NAME_LENGTH 512
index 928763b23494cf9466b63c9a1a4863ca9ad98325..1c37f38d726df2839d8fe82a9172edf7c47f2962 100644 (file)
@@ -2639,8 +2639,6 @@ mini_method_is_open (MonoMethod *method)
 
 /* Lazy class loading functions */
 static GENERATE_TRY_GET_CLASS_WITH_CACHE (iasync_state_machine, System.Runtime.CompilerServices, IAsyncStateMachine)
-static GENERATE_TRY_GET_CLASS_WITH_CACHE (async_state_machine_attribute, System.Runtime.CompilerServices, AsyncStateMachineAttribute)
-
 
 static G_GNUC_UNUSED gboolean
 is_async_state_machine_class (MonoClass *klass)
index adec297e3c3ebfaff926f66a07fea1c05851de76..d6e2677cd237c65c788902a67174e02c426ce9d9 100644 (file)
@@ -3148,7 +3148,7 @@ process_call (EmitContext *ctx, MonoBasicBlock *bb, LLVMBuilderRef *builder_ref,
        gboolean is_virtual, calli, preserveall;
        LLVMBuilderRef builder = *builder_ref;
 
-       if (call->signature->call_convention != MONO_CALL_DEFAULT) {
+       if ((call->signature->call_convention != MONO_CALL_DEFAULT) && !((call->signature->call_convention == MONO_CALL_C) && ctx->llvm_only)) {
                set_failure (ctx, "non-default callconv");
                return;
        }
index 7be84488f5877f979e259857c2383e12c373d542..d5787acf13b6dff1e2468d5002302a1aca978a16 100644 (file)
@@ -27,7 +27,7 @@
 #include <sys/syscall.h>
 #endif
 #include <errno.h>
-
+#include <sched.h>
 
 #include <mono/metadata/assembly.h>
 #include <mono/metadata/loader.h>
@@ -59,6 +59,7 @@
 #include <mono/utils/dtrace.h>
 #include <mono/utils/mono-signal-handler.h>
 #include <mono/utils/mono-threads.h>
+#include <mono/utils/mono-threads-posix-signals.h>
 
 #include "mini.h"
 #include <string.h>
 
 #include "jit-icalls.h"
 
+#ifdef PLATFORM_MACOSX
+#include <mach/mach.h>
+#include <mach/mach_time.h>
+#include <mach/clock.h>
+#endif
+
 #if defined(__native_client__) || defined(HOST_WATCHOS)
 
 void
@@ -235,21 +242,11 @@ MONO_SIG_HANDLER_FUNC (static, sigabrt_signal_handler)
 #define FULL_STAT_PROFILER_BACKTRACE 0
 #endif
 
-#ifdef SIGPROF
-
-static int profiling_signal_in_use;
-
-#if defined(__ia64__) || defined(__sparc__) || defined(sparc)
-
-MONO_SIG_HANDLER_FUNC (static, sigprof_signal_handler)
-{
-       if (mono_chain_signal (MONO_SIG_HANDLER_PARAMS))
-               return;
-
-       NOT_IMPLEMENTED;
-}
+#if (defined (USE_POSIX_BACKEND) && defined (SIGRTMIN)) || defined (SIGPROF)
+#define HAVE_PROFILER_SIGNAL
+#endif
 
-#else
+#ifdef HAVE_PROFILER_SIGNAL
 
 static void
 per_thread_profiler_hit (void *ctx)
@@ -325,7 +322,7 @@ per_thread_profiler_hit (void *ctx)
        }
 }
 
-MONO_SIG_HANDLER_FUNC (static, sigprof_signal_handler)
+MONO_SIG_HANDLER_FUNC (static, profiler_signal_handler)
 {
        int old_errno = errno;
        int hp_save_index;
@@ -339,18 +336,6 @@ MONO_SIG_HANDLER_FUNC (static, sigprof_signal_handler)
 
        hp_save_index = mono_hazard_pointer_save_for_signal_handler ();
 
-       /* If we can't consume a profiling request it means we're the initiator. */
-       if (!(mono_threads_consume_async_jobs () & MONO_SERVICE_REQUEST_SAMPLE)) {
-               FOREACH_THREAD_SAFE (info) {
-                       if (mono_thread_info_get_tid (info) == mono_native_thread_id_get () ||
-                           !mono_thread_info_is_live (info))
-                               continue;
-
-                       mono_threads_add_async_job (info, MONO_SERVICE_REQUEST_SAMPLE);
-                       mono_threads_pthread_kill (info, profiling_signal_in_use);
-               } FOREACH_THREAD_SAFE_END
-       }
-
        mono_thread_info_set_is_async_context (TRUE);
        per_thread_profiler_hit (ctx);
        mono_thread_info_set_is_async_context (FALSE);
@@ -361,7 +346,6 @@ MONO_SIG_HANDLER_FUNC (static, sigprof_signal_handler)
        mono_chain_signal (MONO_SIG_HANDLER_PARAMS);
 }
 
-#endif
 #endif
 
 MONO_SIG_HANDLER_FUNC (static, sigquit_signal_handler)
@@ -522,123 +506,274 @@ mono_runtime_cleanup_handlers (void)
        free_saved_signal_handlers ();
 }
 
-#ifdef HAVE_LINUX_RTC_H
-#include <linux/rtc.h>
-#include <sys/ioctl.h>
-#include <fcntl.h>
-static int rtc_fd = -1;
+#ifdef HAVE_PROFILER_SIGNAL
+
+#ifdef PLATFORM_MACOSX
+
+static clock_serv_t sampling_clock_service;
 
-static int
-enable_rtc_timer (gboolean enable)
+static void
+clock_init (void)
 {
-       int flags;
-       flags = fcntl (rtc_fd, F_GETFL);
-       if (flags < 0) {
-               perror ("getflags");
-               return 0;
-       }
-       if (enable)
-               flags |= FASYNC;
-       else
-               flags &= ~FASYNC;
-       if (fcntl (rtc_fd, F_SETFL, flags) == -1) {
-               perror ("setflags");
-               return 0;
-       }
-       return 1;
+       kern_return_t ret;
+
+       if ((ret = host_get_clock_service (mach_host_self (), SYSTEM_CLOCK, &sampling_clock_service)) != KERN_SUCCESS)
+               g_error ("%s: host_get_clock_service () returned %d", __func__, ret);
 }
-#endif
 
-void
-mono_runtime_shutdown_stat_profiler (void)
+static void
+clock_cleanup (void)
 {
-#ifdef HAVE_LINUX_RTC_H
-       if (rtc_fd >= 0)
-               enable_rtc_timer (FALSE);
-#endif
+       kern_return_t ret;
+
+       if ((ret = mach_port_deallocate (mach_task_self (), sampling_clock_service)) != KERN_SUCCESS)
+               g_error ("%s: mach_port_deallocate () returned %d", __func__, ret);
 }
 
-#ifdef ITIMER_PROF
-static int
-get_itimer_mode (void)
+static guint64
+clock_get_time_ns (void)
 {
-       switch (mono_profiler_get_sampling_mode ()) {
-       case MONO_PROFILER_STAT_MODE_PROCESS: return ITIMER_PROF;
-       case MONO_PROFILER_STAT_MODE_REAL: return ITIMER_REAL;
-       }
-       g_assert_not_reached ();
-       return 0;
+       kern_return_t ret;
+       mach_timespec_t mach_ts;
+
+       if ((ret = clock_get_time (sampling_clock_service, &mach_ts)) != KERN_SUCCESS)
+               g_error ("%s: clock_get_time () returned %d", __func__, ret);
+
+       return ((guint64) mach_ts.tv_sec * 1000000000) + (guint64) mach_ts.tv_nsec;
 }
 
-static int
-get_itimer_signal (void)
+static void
+clock_sleep_ns_abs (guint64 ns_abs)
+{
+       kern_return_t ret;
+       mach_timespec_t then, remain_unused;
+
+       then.tv_sec = ns_abs / 1000000000;
+       then.tv_nsec = ns_abs % 1000000000;
+
+       do {
+               ret = clock_sleep (sampling_clock_service, TIME_ABSOLUTE, then, &remain_unused);
+
+               if (ret != KERN_SUCCESS && ret != KERN_ABORTED)
+                       g_error ("%s: clock_sleep () returned %d", __func__, ret);
+       } while (ret == KERN_ABORTED);
+}
+
+#else
+
+clockid_t sampling_posix_clock;
+
+static void
+clock_init (void)
 {
        switch (mono_profiler_get_sampling_mode ()) {
-       case MONO_PROFILER_STAT_MODE_PROCESS: return SIGPROF;
-       case MONO_PROFILER_STAT_MODE_REAL: return SIGALRM;
+       case MONO_PROFILER_STAT_MODE_PROCESS:
+#ifdef HAVE_CLOCK_NANOSLEEP
+               /*
+                * If we don't have clock_nanosleep (), measuring the process time
+                * makes very little sense as we can only use nanosleep () to sleep on
+                * real time.
+                */
+               sampling_posix_clock = CLOCK_PROCESS_CPUTIME_ID;
+               break;
+#endif
+       case MONO_PROFILER_STAT_MODE_REAL: sampling_posix_clock = CLOCK_MONOTONIC; break;
+       default: g_assert_not_reached (); break;
        }
-       g_assert_not_reached ();
-       return 0;
 }
+
+static void
+clock_cleanup (void)
+{
+}
+
+static guint64
+clock_get_time_ns (void)
+{
+       struct timespec ts;
+
+       if (clock_gettime (sampling_posix_clock, &ts) == -1)
+               g_error ("%s: clock_gettime () returned -1, errno = %d", __func__, errno);
+
+       return ((guint64) ts.tv_sec * 1000000000) + (guint64) ts.tv_nsec;
+}
+
+static void
+clock_sleep_ns_abs (guint64 ns_abs)
+{
+#ifdef HAVE_CLOCK_NANOSLEEP
+       int ret;
+       struct timespec then;
+
+       then.tv_sec = ns_abs / 1000000000;
+       then.tv_nsec = ns_abs % 1000000000;
+
+       do {
+               ret = clock_nanosleep (sampling_posix_clock, TIMER_ABSTIME, &then, NULL);
+
+               if (ret != 0 && ret != EINTR)
+                       g_error ("%s: clock_nanosleep () returned %d", __func__, ret);
+       } while (ret == EINTR);
+#else
+       int ret;
+       gint64 diff;
+       struct timespec req;
+
+       /*
+        * What follows is a crude attempt at emulating clock_nanosleep () on OSs
+        * which don't provide it (e.g. FreeBSD).
+        *
+        * The problem with nanosleep () is that if it is interrupted by a signal,
+        * time will drift as a result of having to restart the call after the
+        * signal handler has finished. For this reason, we avoid using the rem
+        * argument of nanosleep (). Instead, before every nanosleep () call, we
+        * check if enough time has passed to satisfy the sleep request. If yes, we
+        * simply return. If not, we calculate the difference and do another sleep.
+        *
+        * This should reduce the amount of drift that happens because we account
+        * for the time spent executing the signal handler, which nanosleep () is
+        * not guaranteed to do for the rem argument.
+        *
+        * The downside to this approach is that it is slightly expensive: We have
+        * to make an extra system call to retrieve the current time whenever we're
+        * going to restart a nanosleep () call. This is unlikely to be a problem
+        * in practice since the sampling thread won't be receiving many signals in
+        * the first place (it's a tools thread, so no STW), and because typical
+        * sleep periods for the thread are many orders of magnitude bigger than
+        * the time it takes to actually perform that system call (just a few
+        * nanoseconds).
+        */
+       do {
+               diff = (gint64) ns_abs - (gint64) clock_get_time_ns ();
+
+               if (diff <= 0)
+                       break;
+
+               req.tv_sec = diff / 1000000000;
+               req.tv_nsec = diff % 1000000000;
+
+               if ((ret = nanosleep (&req, NULL)) == -1 && errno != EINTR)
+                       g_error ("%s: nanosleep () returned -1, errno = %d", __func__, errno);
+       } while (ret == -1);
+#endif
+}
+
 #endif
 
+static int profiler_signal;
+static MonoNativeThreadId sampling_thread;
+static volatile gint32 sampling_thread_running;
+
+static mono_native_thread_return_t
+sampling_thread_func (void *data)
+{
+       mono_threads_attach_tools_thread ();
+       mono_thread_info_set_name (mono_native_thread_id_get (), "Profiler sampler");
+
+       gint64 rate = 1000000000 / mono_profiler_get_sampling_rate ();
+
+       int old_policy;
+       struct sched_param old_sched;
+       pthread_getschedparam (pthread_self (), &old_policy, &old_sched);
+
+       /*
+        * Attempt to switch the thread to real time scheduling. This will not
+        * necessarily work on all OSs; for example, most Linux systems will give
+        * us EPERM here unless configured to allow this.
+        *
+        * TODO: This does not work on Mac (and maybe some other OSs). On Mac, we
+        * have to use the Mach thread policy routines to switch to real-time
+        * scheduling. This is quite tricky as we need to specify how often we'll
+        * be doing work (easy), the normal processing time needed (also easy),
+        * and the maximum amount of processing time needed (hard). This is
+        * further complicated by the fact that if we misbehave and take too long
+        * to do our work, the kernel may knock us back down to the normal thread
+        * scheduling policy without telling us.
+        */
+       struct sched_param sched = { .sched_priority = sched_get_priority_max (SCHED_FIFO) };
+       pthread_setschedparam (pthread_self (), SCHED_FIFO, &sched);
+
+       clock_init ();
+
+       guint64 sleep = clock_get_time_ns ();
+
+       while (InterlockedRead (&sampling_thread_running)) {
+               sleep += rate;
+
+               FOREACH_THREAD_SAFE (info) {
+                       /* info should never be this thread as we're a tools thread. */
+                       g_assert (mono_thread_info_get_tid (info) != mono_native_thread_id_get ());
+
+                       mono_threads_pthread_kill (info, profiler_signal);
+               } FOREACH_THREAD_SAFE_END
+
+               clock_sleep_ns_abs (sleep);
+       }
+
+       clock_cleanup ();
+
+       pthread_setschedparam (pthread_self (), old_policy, &old_sched);
+
+       mono_thread_info_detach ();
+
+       return NULL;
+}
+
+void
+mono_runtime_shutdown_stat_profiler (void)
+{
+       InterlockedWrite (&sampling_thread_running, 0);
+       pthread_join (sampling_thread, NULL);
+
+       /*
+        * We can't safely remove the signal handler because we have no guarantee
+        * that all pending signals have been delivered at this point. This should
+        * not really be a problem anyway.
+        */
+       //remove_signal_handler (profiler_signal);
+}
+
 void
 mono_runtime_setup_stat_profiler (void)
 {
-#ifdef ITIMER_PROF
-       struct itimerval itval;
-       static int inited = 0;
-#ifdef HAVE_LINUX_RTC_H
-       const char *rtc_freq;
-       if (!inited && (rtc_freq = g_getenv ("MONO_RTC"))) {
-               int freq = 0;
-               inited = 1;
-               if (*rtc_freq)
-                       freq = atoi (rtc_freq);
-               if (!freq)
-                       freq = 1024;
-               rtc_fd = open ("/dev/rtc", O_RDONLY);
-               if (rtc_fd == -1) {
-                       perror ("open /dev/rtc");
-                       return;
-               }
-               profiling_signal_in_use = SIGPROF;
-               add_signal_handler (profiling_signal_in_use, sigprof_signal_handler, SA_RESTART);
-               if (ioctl (rtc_fd, RTC_IRQP_SET, freq) == -1) {
-                       perror ("set rtc freq");
-                       return;
-               }
-               if (ioctl (rtc_fd, RTC_PIE_ON, 0) == -1) {
-                       perror ("start rtc");
-                       return;
-               }
-               if (fcntl (rtc_fd, F_SETSIG, SIGPROF) == -1) {
-                       perror ("setsig");
-                       return;
-               }
-               if (fcntl (rtc_fd, F_SETOWN, getpid ()) == -1) {
-                       perror ("setown");
-                       return;
-               }
-               enable_rtc_timer (TRUE);
-               return;
-       }
-       if (rtc_fd >= 0)
-               return;
+       /*
+        * Use a real-time signal when possible. This gives us roughly a 99% signal
+        * delivery rate in all cases. On the other hand, using a regular signal
+        * tends to result in awful delivery rates when the application is heavily
+        * loaded.
+        *
+        * TODO: On Mac, we should explore using the Mach thread suspend/resume
+        * functions and doing the stack walk from the sampling thread. This would
+        * get us a 100% sampling rate. However, this may interfere with the GC's
+        * STW logic. Could perhaps be solved by taking the suspend lock.
+        */
+#if defined (USE_POSIX_BACKEND) && defined (SIGRTMIN)
+       /* Just take the first real-time signal we can get. */
+       profiler_signal = mono_threads_posix_signal_search_alternative (-1);
+#else
+       profiler_signal = SIGPROF;
 #endif
 
-       itval.it_interval.tv_usec = (1000000 / mono_profiler_get_sampling_rate ()) - 1;
-       itval.it_interval.tv_sec = 0;
-       itval.it_value = itval.it_interval;
-       if (inited)
-               return;
-       inited = 1;
-       profiling_signal_in_use = get_itimer_signal ();
-       add_signal_handler (profiling_signal_in_use, sigprof_signal_handler, SA_RESTART);
-       setitimer (get_itimer_mode (), &itval, NULL);
-#endif
+       add_signal_handler (profiler_signal, profiler_signal_handler, SA_RESTART);
+
+       InterlockedWrite (&sampling_thread_running, 1);
+       mono_native_thread_create (&sampling_thread, sampling_thread_func, NULL);
+}
+
+#else
+
+void
+mono_runtime_shutdown_stat_profiler (void)
+{
+}
+
+void
+mono_runtime_setup_stat_profiler (void)
+{
 }
 
+#endif
+
 #if !defined(PLATFORM_MACOSX)
 pid_t
 mono_runtime_syscall_fork ()
index 06238b4d68898a161a0b196d77a2fb05774f94f4..795bab9e41d319ebb23ec690c14ee6cf6c288980 100644 (file)
@@ -3065,13 +3065,13 @@ mono_jit_create_remoting_trampoline (MonoDomain *domain, MonoMethod *method, Mon
 }
 #endif
 
-static void
+static G_GNUC_UNUSED void
 no_imt_trampoline (void)
 {
        g_assert_not_reached ();
 }
 
-static void
+static G_GNUC_UNUSED void
 no_vcall_trampoline (void)
 {
        g_assert_not_reached ();
@@ -4164,7 +4164,8 @@ print_jit_stats (void)
 void
 mini_cleanup (MonoDomain *domain)
 {
-       mono_runtime_shutdown_stat_profiler ();
+       if (mono_profiler_get_events () & MONO_PROFILE_STATISTICAL)
+               mono_runtime_shutdown_stat_profiler ();
 
 #ifndef DISABLE_COM
        cominterop_release_all_rcws ();
@@ -4181,12 +4182,12 @@ mini_cleanup (MonoDomain *domain)
        /* This accesses metadata so needs to be called before runtime shutdown */
        print_jit_stats ();
 
-       mono_profiler_shutdown ();
-
 #ifndef MONO_CROSS_COMPILE
        mono_runtime_cleanup (domain);
 #endif
 
+       mono_profiler_shutdown ();
+
        free_jit_tls_data ((MonoJitTlsData *)mono_native_tls_get_value (mono_jit_tls_id));
 
        mono_icall_cleanup ();
index 7101e69b33c22c279a381de66ddecf27a2bed2bd..1865ee98caf79114bc364c1e41b8e4ba40a4f3b6 100644 (file)
@@ -1230,18 +1230,6 @@ mini_method_verify (MonoCompile *cfg, MonoMethod *method, gboolean fail_compile)
 
        res = mono_method_verify_with_current_settings (method, cfg->skip_visibility, is_fulltrust);
 
-       if (mono_loader_get_last_error ()) {
-               if (fail_compile) {
-                       mono_cfg_set_exception (cfg, MONO_EXCEPTION_MONO_ERROR);
-                       mono_error_set_from_loader_error (&cfg->error);
-               } else {
-                       mono_loader_clear_error ();
-               }
-               if (res)
-                       mono_free_verify_list (res);
-               return TRUE;
-       }
-
        if (res) { 
                for (tmp = res; tmp; tmp = tmp->next) {
                        MonoVerifyInfoExtended *info = (MonoVerifyInfoExtended *)tmp->data;
@@ -4375,7 +4363,8 @@ mono_jit_compile_method_inner (MonoMethod *method, MonoDomain *target_domain, in
        case MONO_EXCEPTION_MISSING_FIELD:
        case MONO_EXCEPTION_MISSING_METHOD:
        case MONO_EXCEPTION_FILE_NOT_FOUND:
-       case MONO_EXCEPTION_BAD_IMAGE: {
+       case MONO_EXCEPTION_BAD_IMAGE:
+       case MONO_EXCEPTION_INVALID_PROGRAM: {
                /* Throw a type load exception if needed */
                if (cfg->exception_ptr) {
                        ex = mono_class_get_exception_for_failure ((MonoClass *)cfg->exception_ptr);
@@ -4390,6 +4379,8 @@ mono_jit_compile_method_inner (MonoMethod *method, MonoDomain *target_domain, in
                                ex = mono_exception_from_name_msg (mono_defaults.corlib, "System.IO", "FileNotFoundException", cfg->exception_message);
                        else if (cfg->exception_type == MONO_EXCEPTION_BAD_IMAGE)
                                ex = mono_get_exception_bad_image_format (cfg->exception_message);
+                       else if (cfg->exception_type == MONO_EXCEPTION_INVALID_PROGRAM)
+                               ex = mono_exception_from_name_msg (mono_defaults.corlib, "System", "InvalidProgramException", cfg->exception_message);
                        else
                                g_assert_not_reached ();
                }
index 0b28eebbf69498480ec36111a1e0b5a4e5f7cc13..1be75933c8efa6041ac798234d72967e4c8f6b8d 100644 (file)
@@ -439,22 +439,6 @@ mono_arch_get_gsharedvt_trampoline (MonoTrampInfo **info, gboolean aot)
        return buf;
 }
 
-#else
-
-gpointer
-mono_arch_get_gsharedvt_arg_trampoline (MonoDomain *domain, gpointer arg, gpointer addr)
-{
-       g_assert_not_reached ();
-       return NULL;
-}
-
-gpointer
-mono_arch_get_gsharedvt_trampoline (MonoTrampInfo **info, gboolean aot)
-{
-       g_assert_not_reached ();
-       return NULL;
-}
-
 #endif
 
 #else
@@ -466,18 +450,4 @@ mono_amd64_start_gsharedvt_call (GSharedVtCallInfo *info, gpointer *caller, gpoi
        return NULL;
 }
 
-gpointer
-mono_arch_get_gsharedvt_arg_trampoline (MonoDomain *domain, gpointer arg, gpointer addr)
-{
-       g_assert_not_reached ();
-       return NULL;
-}
-
-gpointer
-mono_arch_get_gsharedvt_trampoline (MonoTrampInfo **info, gboolean aot)
-{
-       *info = NULL;
-       return NULL;
-}
-
 #endif
\ No newline at end of file
index 13f73d9983b46ce0257f6f3b7c788866180425e3..175f75ddaab47c94e9875726f6f0b6bab579a731 100644 (file)
@@ -16,7 +16,7 @@
 /*
  * GSHAREDVT
  */
-#ifdef MONO_ARCH_GSHARED_SUPPORTED
+#ifdef MONO_ARCH_GSHAREDVT_SUPPORTED
 
 /*
  * mono_arch_get_gsharedvt_arg_trampoline:
@@ -562,21 +562,4 @@ mono_arch_get_gsharedvt_trampoline (MonoTrampInfo **info, gboolean aot)
 
 #endif
 
-#else
-
-gpointer
-mono_arch_get_gsharedvt_trampoline (MonoTrampInfo **info, gboolean aot)
-{
-       if (info)
-               *info = NULL;
-       return NULL;
-}
-
-gpointer
-mono_arch_get_gsharedvt_arg_trampoline (MonoDomain *domain, gpointer arg, gpointer addr)
-{
-       g_assert_not_reached ();
-       return NULL;
-}
-
-#endif /* MONO_ARCH_GSHARED_SUPPORTED */
\ No newline at end of file
+#endif /* MONO_ARCH_GSHAREDVT_SUPPORTED */
index 5088fea22978419b52d1251e9be4633be87e6c81..1f44713976548f2ab5152b5f8716b182d2e2f225 100644 (file)
@@ -97,9 +97,9 @@ mono_arch_get_plt_info_offset (guint8 *plt_entry, mgreg_t *regs, guint8 *code)
 guchar*
 mono_arch_create_generic_trampoline (MonoTrampolineType tramp_type, MonoTrampInfo **info, gboolean aot)
 {
-       guint8 *code, *buf, *tramp;
+       guint8 *code, *buf, *tramp, *labels [16];
        int i, buf_len, imm;
-       int frame_size, offset, gregs_offset, num_fregs, fregs_offset, arg_offset, lmf_offset;
+       int frame_size, offset, gregs_offset, num_fregs, fregs_offset, arg_offset, lmf_offset, res_offset;
        guint64 gregs_regset;
        GSList *unwind_ops = NULL;
        MonoJumpInfo *ji = NULL;
@@ -128,6 +128,9 @@ mono_arch_create_generic_trampoline (MonoTrampolineType tramp_type, MonoTrampInf
        /* arg */
        arg_offset = offset;
        offset += 8;
+       /* result */
+       res_offset = offset;
+       offset += 8;
        /* LMF */
        lmf_offset = offset;
        offset += sizeof (MonoLMF);
@@ -222,6 +225,9 @@ mono_arch_create_generic_trampoline (MonoTrampolineType tramp_type, MonoTrampInf
        }
        arm_blrx (code, ARMREG_IP0);
 
+       /* Save the result */
+       arm_strx (code, ARMREG_R0, ARMREG_FP, res_offset);
+
        /* Restore LMF */
        /* Similar to emit_restore_lmf () */
        /* Clobbers ip0/ip1 */
@@ -234,8 +240,19 @@ mono_arch_create_generic_trampoline (MonoTrampolineType tramp_type, MonoTrampInf
        /* *lmf_addr = previous_lmf */
        arm_strx (code, ARMREG_IP1, ARMREG_IP0, 0);
 
-       /* Save the result to ip1 */
-       arm_movx (code, ARMREG_IP1, ARMREG_R0);
+       /* Check for thread interruption */
+       /* This is not perf critical code so no need to check the interrupt flag */
+       if (aot) {
+               code = mono_arm_emit_aotconst (&ji, code, buf, ARMREG_IP0, MONO_PATCH_INFO_JIT_ICALL_ADDR, "mono_thread_force_interruption_checkpoint_noraise");
+       } else {
+               code = mono_arm_emit_imm64 (code, ARMREG_IP0, (guint64)mono_thread_force_interruption_checkpoint_noraise);
+       }
+       arm_blrx (code, ARMREG_IP0);
+       /* Check whenever there is an exception to be thrown */
+       labels [0] = code;
+       arm_cbnzx (code, ARMREG_R0, 0);
+
+       /* Normal case */
 
        /* Restore gregs */
        /* Only have to load the argument regs (r0..r8) and the rgctx reg */
@@ -244,6 +261,9 @@ mono_arch_create_generic_trampoline (MonoTrampolineType tramp_type, MonoTrampInf
        for (i = 0; i < num_fregs; ++i)
                arm_ldrfpx (code, i, ARMREG_FP, fregs_offset + (i * 8));
 
+       /* Load the result */
+       arm_ldrx (code, ARMREG_IP1, ARMREG_FP, res_offset);
+
        /* These trampolines return a value */
        if (tramp_type == MONO_TRAMPOLINE_RGCTX_LAZY_FETCH)
                arm_movx (code, ARMREG_R0, ARMREG_IP1);
@@ -256,6 +276,29 @@ mono_arch_create_generic_trampoline (MonoTrampolineType tramp_type, MonoTrampInf
        else
                arm_brx (code, ARMREG_IP1);
 
+       /* Exception case */
+       mono_arm_patch (labels [0], code, MONO_R_ARM64_CBZ);
+
+       /*
+        * We have an exception we want to throw in the caller's frame, so pop
+        * the trampoline frame and throw from the caller.
+        */
+       code = mono_arm_emit_destroy_frame (code, frame_size, ((1 << ARMREG_IP0)));
+       /* We are in the parent frame, the exception is in x0 */
+       /*
+        * EH is initialized after trampolines, so get the address of the variable
+        * which contains throw_exception, and load it from there.
+        */
+       if (aot) {
+               /* Not really a jit icall */
+               code = mono_arm_emit_aotconst (&ji, code, buf, ARMREG_IP0, MONO_PATCH_INFO_JIT_ICALL_ADDR, "throw_exception_addr");
+       } else {
+               code = mono_arm_emit_imm64 (code, ARMREG_IP0, (guint64)mono_get_throw_exception_addr ());
+       }
+       arm_ldrx (code, ARMREG_IP0, ARMREG_IP0, 0);
+       /* lr contains the return address, the trampoline will use it as the throw site */
+       arm_brx (code, ARMREG_IP0);
+
        g_assert ((code - buf) < buf_len);
        mono_arch_flush_icache (buf, code - buf);
 
@@ -464,6 +507,54 @@ mono_arch_create_general_rgctx_lazy_fetch_trampoline (MonoTrampInfo **info, gboo
        return buf;
 }
 
+static gpointer
+handler_block_trampoline_helper (gpointer *ptr)
+{
+       MonoJitTlsData *jit_tls = mono_native_tls_get_value (mono_jit_tls_id);
+       return jit_tls->handler_block_return_address;
+}
+
+gpointer
+mono_arch_create_handler_block_trampoline (MonoTrampInfo **info, gboolean aot)
+{
+       guint8 *tramp;
+       guint8 *code, *buf;
+       int tramp_size = 64;
+       MonoJumpInfo *ji = NULL;
+       GSList *unwind_ops = NULL;
+
+       g_assert (!aot);
+
+       code = buf = mono_global_codeman_reserve (tramp_size);
+
+       unwind_ops = NULL;
+
+       tramp = mono_arch_create_specific_trampoline (NULL, MONO_TRAMPOLINE_HANDLER_BLOCK_GUARD, NULL, NULL);
+
+       /*
+       This trampoline restore the call chain of the handler block then jumps into the code that deals with it.
+       */
+
+       /*
+        * We are in a method frame after the call emitted by OP_CALL_HANDLER.
+        */
+       code = mono_arm_emit_imm64 (code, ARMREG_IP0, (guint64)handler_block_trampoline_helper);
+       /* Set it as the return address so the trampoline will return to it */
+       arm_movx (code, ARMREG_LR, ARMREG_IP0);
+
+       /* Call the trampoline */
+       code = mono_arm_emit_imm64 (code, ARMREG_IP0, (guint64)tramp);
+       arm_brx (code, ARMREG_IP0);
+
+       mono_arch_flush_icache (buf, code - buf);
+       mono_profiler_code_buffer_new (buf, code - buf, MONO_PROFILER_CODE_BUFFER_HELPER, NULL);
+       g_assert (code - buf <= tramp_size);
+
+       *info = mono_tramp_info_create ("handler_block_trampoline", buf, code - buf, ji, unwind_ops);
+
+       return buf;
+}
+
 /*
  * mono_arch_create_sdb_trampoline:
  *
index 757325c27f005670bc82644a02c46ef5910e18b4..5482504beac9a030f672da799d03a2c9c9edabbd 100644 (file)
@@ -357,13 +357,4 @@ mono_arch_get_gsharedvt_trampoline (MonoTrampInfo **info, gboolean aot)
        return buf;
 }
 
-#else
-
-gpointer
-mono_arch_get_gsharedvt_trampoline (MonoTrampInfo **info, gboolean aot)
-{
-       *info = NULL;
-       return NULL;
-}
-
 #endif /* MONO_ARCH_GSHAREDVT_SUPPORTED */
index d88694d198ebb4fcb7fec4e2a0705c2fe63f3395..10eaba51c6ce6d7bce0d68888f4666b44bf9c18c 100644 (file)
@@ -2256,8 +2256,6 @@ decode_buffer (ProfContext *ctx)
                        time_from += startup_time;
                        time_to += startup_time;
                }
-               if (!thread->name)
-                       thread->name = pstrdup ("Main");
        }
        for (i = 0; i < thread->stack_id; ++i)
                thread->stack [i]->recurse_count++;
@@ -3152,7 +3150,9 @@ dump_threads (ProfContext *ctx)
        ThreadContext *thread;
        fprintf (outfile, "\nThread summary\n");
        for (thread = ctx->threads; thread; thread = thread->next) {
-               fprintf (outfile, "\tThread: %p, name: \"%s\"\n", (void*)thread->thread_id, thread->name? thread->name: "");
+               if (thread->thread_id) {
+                       fprintf (outfile, "\tThread: %p, name: \"%s\"\n", (void*)thread->thread_id, thread->name? thread->name: "");
+               }
        }
 }
 
index c32f40c62d32009737404f7732419fbdd4447a19..3d9079f45f73bcea0397a83985bbd5dc445a68de 100644 (file)
@@ -12,6 +12,7 @@
 
 #include <config.h>
 #include "../mini/jit.h"
+#include "../metadata/metadata-internals.h"
 #include <mono/metadata/profiler.h>
 #include <mono/metadata/threads.h>
 #include <mono/metadata/mono-gc.h>
@@ -514,6 +515,7 @@ struct _MonoProfiler {
 #endif
        volatile gint32 run_writer_thread;
        MonoLockFreeQueue writer_queue;
+       MonoSemType writer_queue_sem;
        MonoConcurrentHashTable *method_table;
        mono_mutex_t method_table_mutex;
        BinaryObject *binary_objects;
@@ -893,6 +895,7 @@ send_buffer (MonoProfiler *prof, GPtrArray *methods, LogBuffer *buffer)
        entry->methods = methods;
        entry->buffer = buffer;
        mono_lock_free_queue_enqueue (&prof->writer_queue, &entry->node);
+       mono_os_sem_post (&prof->writer_queue_sem);
 }
 
 static void
@@ -932,7 +935,7 @@ process_requests (MonoProfiler *profiler)
 }
 
 static void counters_init (MonoProfiler *profiler);
-static void counters_sample (MonoProfiler *profiler, uint64_t timestamp);
+static void counters_sample (MonoProfiler *profiler, uint64_t timestamp, gboolean threadless);
 
 /*
  * Can be called only at safe callback locations.
@@ -962,6 +965,15 @@ safe_send (MonoProfiler *profiler, LogBuffer *logbuffer)
        TLS_GET (LogBuffer, tlsbuffer)->call_depth = cd;
 }
 
+static void
+safe_send_threadless (MonoProfiler *prof, LogBuffer *buf)
+{
+       for (LogBuffer *iter = buf; iter; iter = iter->next)
+               iter->thread_id = 0;
+
+       safe_send (prof, buf);
+}
+
 static int
 gc_reference (MonoObject *obj, MonoClass *klass, uintptr_t size, uintptr_t num, MonoObject **refs, uintptr_t *offsets, void *data)
 {
@@ -2910,7 +2922,7 @@ counters_init (MonoProfiler *profiler)
 }
 
 static void
-counters_emit (MonoProfiler *profiler)
+counters_emit (MonoProfiler *profiler, gboolean threadless)
 {
        MonoCounterAgent *agent;
        LogBuffer *logbuffer;
@@ -2969,13 +2981,16 @@ counters_emit (MonoProfiler *profiler)
        }
        EXIT_LOG (logbuffer);
 
-       safe_send (profiler, logbuffer);
+       if (threadless)
+               safe_send_threadless (profiler, logbuffer);
+       else
+               safe_send (profiler, logbuffer);
 
        mono_os_mutex_unlock (&counters_mutex);
 }
 
 static void
-counters_sample (MonoProfiler *profiler, uint64_t timestamp)
+counters_sample (MonoProfiler *profiler, uint64_t timestamp, gboolean threadless)
 {
        MonoCounterAgent *agent;
        MonoCounter *counter;
@@ -2988,7 +3003,7 @@ counters_sample (MonoProfiler *profiler, uint64_t timestamp)
        if (!counters_initialized)
                return;
 
-       counters_emit (profiler);
+       counters_emit (profiler, threadless);
 
        buffer_size = 8;
        buffer = calloc (1, buffer_size);
@@ -3100,7 +3115,10 @@ counters_sample (MonoProfiler *profiler, uint64_t timestamp)
        emit_value (logbuffer, 0);
        EXIT_LOG (logbuffer);
 
-       safe_send (profiler, logbuffer);
+       if (threadless)
+               safe_send_threadless (profiler, logbuffer);
+       else
+               safe_send (profiler, logbuffer);
 
        mono_os_mutex_unlock (&counters_mutex);
 }
@@ -3121,7 +3139,7 @@ struct _PerfCounterAgent {
 static PerfCounterAgent *perfcounters = NULL;
 
 static void
-perfcounters_emit (MonoProfiler *profiler)
+perfcounters_emit (MonoProfiler *profiler, gboolean threadless)
 {
        PerfCounterAgent *pcagent;
        LogBuffer *logbuffer;
@@ -3172,7 +3190,10 @@ perfcounters_emit (MonoProfiler *profiler)
        }
        EXIT_LOG (logbuffer);
 
-       safe_send (profiler, logbuffer);
+       if (threadless)
+               safe_send_threadless (profiler, logbuffer);
+       else
+               safe_send (profiler, logbuffer);
 }
 
 static gboolean
@@ -3209,7 +3230,7 @@ perfcounters_foreach (char *category_name, char *name, unsigned char type, gint6
 }
 
 static void
-perfcounters_sample (MonoProfiler *profiler, uint64_t timestamp)
+perfcounters_sample (MonoProfiler *profiler, uint64_t timestamp, gboolean threadless)
 {
        PerfCounterAgent *pcagent;
        LogBuffer *logbuffer;
@@ -3226,7 +3247,7 @@ perfcounters_sample (MonoProfiler *profiler, uint64_t timestamp)
 
        mono_perfcounter_foreach (perfcounters_foreach, perfcounters);
 
-       perfcounters_emit (profiler);
+       perfcounters_emit (profiler, threadless);
 
        size =
                EVENT_SIZE /* event */ +
@@ -3266,13 +3287,16 @@ perfcounters_sample (MonoProfiler *profiler, uint64_t timestamp)
        emit_value (logbuffer, 0);
        EXIT_LOG (logbuffer);
 
-       safe_send (profiler, logbuffer);
+       if (threadless)
+               safe_send_threadless (profiler, logbuffer);
+       else
+               safe_send (profiler, logbuffer);
 
        mono_os_mutex_unlock (&counters_mutex);
 }
 
 static void
-counters_and_perfcounters_sample (MonoProfiler *prof)
+counters_and_perfcounters_sample (MonoProfiler *prof, gboolean threadless)
 {
        static uint64_t start = -1;
        uint64_t now;
@@ -3281,8 +3305,8 @@ counters_and_perfcounters_sample (MonoProfiler *prof)
                start = current_time ();
 
        now = current_time ();
-       counters_sample (prof, (now - start) / 1000/ 1000);
-       perfcounters_sample (prof, (now - start) / 1000/ 1000);
+       counters_sample (prof, (now - start) / 1000/ 1000, threadless);
+       perfcounters_sample (prof, (now - start) / 1000/ 1000, threadless);
 }
 
 #define COVERAGE_DEBUG(x) if (debug_coverage) {x}
@@ -3772,6 +3796,11 @@ coverage_filter (MonoProfiler *prof, MonoMethod *method)
 
        assembly = mono_image_get_assembly (image);
 
+       // Need to keep the assemblies around for as long as they are kept in the hashtable
+       // Nunit, for example, has a habit of unloading them before the coverage statistics are
+       // generated causing a crash. See https://bugzilla.xamarin.com/show_bug.cgi?id=39325
+       mono_assembly_addref (assembly);
+
        mono_os_mutex_lock (&coverage_mutex);
        mono_conc_hashtable_insert (coverage_methods, method, method);
        mono_conc_hashtable_insert (coverage_assemblies, assembly, assembly);
@@ -3913,6 +3942,13 @@ coverage_init (MonoProfiler *prof)
 #endif /* DISABLE_HELPER_THREAD */
 }
 
+static void
+unref_coverage_assemblies (gpointer key, gpointer value, gpointer userdata)
+{
+       MonoAssembly *assembly = (MonoAssembly *)value;
+       mono_assembly_close (assembly);
+}
+
 static void
 log_shutdown (MonoProfiler *prof)
 {
@@ -3920,7 +3956,7 @@ log_shutdown (MonoProfiler *prof)
 
        in_shutdown = 1;
 #ifndef DISABLE_HELPER_THREAD
-       counters_and_perfcounters_sample (prof);
+       counters_and_perfcounters_sample (prof, FALSE);
 
        dump_coverage (prof);
 
@@ -3947,8 +3983,11 @@ log_shutdown (MonoProfiler *prof)
        TLS_SET (tlsmethodlist, NULL);
 
        InterlockedWrite (&prof->run_writer_thread, 0);
+       mono_os_sem_post (&prof->writer_queue_sem);
        pthread_join (prof->writer_thread, &res);
 
+       mono_os_sem_destroy (&prof->writer_queue_sem);
+
 #if defined (HAVE_SYS_ZLIB)
        if (prof->gzfile)
                gzclose (prof->gzfile);
@@ -3962,6 +4001,10 @@ log_shutdown (MonoProfiler *prof)
        mono_os_mutex_destroy (&prof->method_table_mutex);
 
        if (coverage_initialized) {
+               mono_os_mutex_lock (&coverage_mutex);
+               mono_conc_hashtable_foreach (coverage_assemblies, unref_coverage_assemblies, prof);
+               mono_os_mutex_unlock (&coverage_mutex);
+
                mono_conc_hashtable_destroy (coverage_methods);
                mono_conc_hashtable_destroy (coverage_assemblies);
                mono_conc_hashtable_destroy (coverage_classes);
@@ -4050,6 +4093,8 @@ helper_thread (void* arg)
        MonoThread *thread = NULL;
 
        mono_threads_attach_tools_thread ();
+       mono_thread_info_set_name (mono_native_thread_id_get (), "Profiler helper");
+
        //fprintf (stderr, "Server listening\n");
        command_socket = -1;
        while (1) {
@@ -4080,7 +4125,7 @@ helper_thread (void* arg)
                }
 #endif
 
-               counters_and_perfcounters_sample (prof);
+               counters_and_perfcounters_sample (prof, TRUE);
 
                tv.tv_sec = 1;
                tv.tv_usec = 0;
@@ -4109,7 +4154,7 @@ helper_thread (void* arg)
                                if (sbuf) {
                                        dump_sample_hits (prof, sbuf);
                                        free_buffer (sbuf, sbuf->size);
-                                       safe_send (prof, ensure_logbuf (0));
+                                       safe_send_threadless (prof, ensure_logbuf (0));
                                }
                                continue;
                        }
@@ -4130,7 +4175,7 @@ helper_thread (void* arg)
                                }
                        }
 #endif
-                       safe_send (prof, ensure_logbuf (0));
+                       safe_send_threadless (prof, ensure_logbuf (0));
                        return NULL;
                }
 #if USE_PERF_EVENTS
@@ -4141,7 +4186,7 @@ helper_thread (void* arg)
                                        continue;
                                if (FD_ISSET (perf_data [i].perf_fd, &rfds)) {
                                        read_perf_mmap (prof, i);
-                                       safe_send (prof, ensure_logbuf (0));
+                                       safe_send_threadless (prof, ensure_logbuf (0));
                                }
                        }
                }
@@ -4179,6 +4224,9 @@ helper_thread (void* arg)
                        continue;
                //fprintf (stderr, "Accepted connection\n");
        }
+
+       mono_thread_info_detach ();
+
        return NULL;
 }
 
@@ -4226,92 +4274,113 @@ start_helper_thread (MonoProfiler* prof)
 }
 #endif
 
-static void *
-writer_thread (void *arg)
+static gboolean
+handle_writer_queue_entry (MonoProfiler *prof)
 {
-       MonoProfiler *prof = (MonoProfiler *)arg;
+       WriterQueueEntry *entry;
 
-       mono_threads_attach_tools_thread ();
+       if ((entry = (WriterQueueEntry *) mono_lock_free_queue_dequeue (&prof->writer_queue))) {
+               LogBuffer *method_buffer = NULL;
+               gboolean new_methods = FALSE;
 
-       dump_header (prof);
+               if (entry->methods->len)
+                       method_buffer = create_buffer ();
 
-       while (InterlockedRead (&prof->run_writer_thread)) {
-               WriterQueueEntry *entry;
+               /*
+                * Encode the method events in a temporary log buffer that we
+                * flush to disk before the main buffer, ensuring that all
+                * methods have metadata emitted before they're referenced.
+                */
+               for (guint i = 0; i < entry->methods->len; i++) {
+                       MethodInfo *info = (MethodInfo *)g_ptr_array_index (entry->methods, i);
 
-               while ((entry = (WriterQueueEntry *) mono_lock_free_queue_dequeue (&prof->writer_queue))) {
-                       LogBuffer *method_buffer = NULL;
-                       gboolean new_methods = FALSE;
+                       if (mono_conc_hashtable_lookup (prof->method_table, info->method))
+                               continue;
 
-                       if (entry->methods->len)
-                               method_buffer = create_buffer ();
+                       new_methods = TRUE;
 
                        /*
-                        * Encode the method events in a temporary log buffer that we
-                        * flush to disk before the main buffer, ensuring that all
-                        * methods have metadata emitted before they're referenced.
+                        * Other threads use this hash table to get a general
+                        * idea of whether a method has already been emitted to
+                        * the stream. Due to the way we add to this table, it
+                        * can easily happen that multiple threads queue up the
+                        * same methods, but that's OK since eventually all
+                        * methods will be in this table and the thread-local
+                        * method lists will just be empty for the rest of the
+                        * app's lifetime.
                         */
-                       for (guint i = 0; i < entry->methods->len; i++) {
-                               MethodInfo *info = (MethodInfo *)g_ptr_array_index (entry->methods, i);
+                       mono_os_mutex_lock (&prof->method_table_mutex);
+                       mono_conc_hashtable_insert (prof->method_table, info->method, info->method);
+                       mono_os_mutex_unlock (&prof->method_table_mutex);
+
+                       char *name = mono_method_full_name (info->method, 1);
+                       int nlen = strlen (name) + 1;
+                       void *cstart = info->ji ? mono_jit_info_get_code_start (info->ji) : NULL;
+                       int csize = info->ji ? mono_jit_info_get_code_size (info->ji) : 0;
+
+                       method_buffer = ensure_logbuf_inner (method_buffer,
+                               EVENT_SIZE /* event */ +
+                               LEB128_SIZE /* time */ +
+                               LEB128_SIZE /* method */ +
+                               LEB128_SIZE /* start */ +
+                               LEB128_SIZE /* size */ +
+                               nlen /* name */
+                       );
+
+                       emit_byte (method_buffer, TYPE_JIT | TYPE_METHOD);
+                       emit_time (method_buffer, info->time);
+                       emit_method_inner (method_buffer, info->method);
+                       emit_ptr (method_buffer, cstart);
+                       emit_value (method_buffer, csize);
+
+                       memcpy (method_buffer->cursor, name, nlen);
+                       method_buffer->cursor += nlen;
+
+                       mono_free (name);
+                       free (info);
+               }
 
-                               if (mono_conc_hashtable_lookup (prof->method_table, info->method))
-                                       continue;
+               g_ptr_array_free (entry->methods, TRUE);
 
-                               new_methods = TRUE;
-
-                               /*
-                                * Other threads use this hash table to get a general
-                                * idea of whether a method has already been emitted to
-                                * the stream. Due to the way we add to this table, it
-                                * can easily happen that multiple threads queue up the
-                                * same methods, but that's OK since eventually all
-                                * methods will be in this table and the thread-local
-                                * method lists will just be empty for the rest of the
-                                * app's lifetime.
-                                */
-                               mono_os_mutex_lock (&prof->method_table_mutex);
-                               mono_conc_hashtable_insert (prof->method_table, info->method, info->method);
-                               mono_os_mutex_unlock (&prof->method_table_mutex);
-
-                               char *name = mono_method_full_name (info->method, 1);
-                               int nlen = strlen (name) + 1;
-                               void *cstart = info->ji ? mono_jit_info_get_code_start (info->ji) : NULL;
-                               int csize = info->ji ? mono_jit_info_get_code_size (info->ji) : 0;
-
-                               method_buffer = ensure_logbuf_inner (method_buffer,
-                                       EVENT_SIZE /* event */ +
-                                       LEB128_SIZE /* time */ +
-                                       LEB128_SIZE /* method */ +
-                                       LEB128_SIZE /* start */ +
-                                       LEB128_SIZE /* size */ +
-                                       nlen /* name */
-                               );
-
-                               emit_byte (method_buffer, TYPE_JIT | TYPE_METHOD);
-                               emit_time (method_buffer, info->time);
-                               emit_method_inner (method_buffer, info->method);
-                               emit_ptr (method_buffer, cstart);
-                               emit_value (method_buffer, csize);
-
-                               memcpy (method_buffer->cursor, name, nlen);
-                               method_buffer->cursor += nlen;
-
-                               mono_free (name);
-                               free (info);
-                       }
+               if (new_methods) {
+                       for (LogBuffer *iter = method_buffer; iter; iter = iter->next)
+                               iter->thread_id = 0;
 
-                       g_ptr_array_free (entry->methods, TRUE);
+                       dump_buffer (prof, method_buffer);
+               } else if (method_buffer)
+                       free_buffer (method_buffer, method_buffer->size);
 
-                       if (new_methods)
-                               dump_buffer (prof, method_buffer);
-                       else if (method_buffer)
-                               free_buffer (method_buffer, method_buffer->size);
+               dump_buffer (prof, entry->buffer);
 
-                       dump_buffer (prof, entry->buffer);
+               free (entry);
 
-                       free (entry);
-               }
+               return TRUE;
        }
 
+       return FALSE;
+}
+
+static void *
+writer_thread (void *arg)
+{
+       MonoProfiler *prof = (MonoProfiler *)arg;
+       WriterQueueEntry *entry;
+
+       mono_threads_attach_tools_thread ();
+       mono_thread_info_set_name (mono_native_thread_id_get (), "Profiler writer");
+
+       dump_header (prof);
+
+       while (InterlockedRead (&prof->run_writer_thread)) {
+               mono_os_sem_wait (&prof->writer_queue_sem, MONO_SEM_FLAGS_NONE);
+               handle_writer_queue_entry (prof);
+       }
+
+       /* Drain any remaining entries on shutdown. */
+       while (handle_writer_queue_entry (prof));
+
+       mono_thread_info_detach ();
+
        return NULL;
 }
 
@@ -4338,7 +4407,7 @@ runtime_initialized (MonoProfiler *profiler)
        InterlockedWrite (&runtime_inited, 1);
 #ifndef DISABLE_HELPER_THREAD
        counters_init (profiler);
-       counters_sample (profiler, 0);
+       counters_sample (profiler, 0, FALSE);
 #endif
        /* ensure the main thread data and startup are available soon */
        safe_send (profiler, ensure_logbuf (0));
@@ -4420,6 +4489,8 @@ create_profiler (const char *filename, GPtrArray *filters)
 #endif
 
        mono_lock_free_queue_init (&prof->writer_queue);
+       mono_os_sem_init (&prof->writer_queue_sem, 1);
+
        mono_os_mutex_init (&prof->method_table_mutex);
        prof->method_table = mono_conc_hashtable_new (NULL, NULL);
 
index 5215621c2fdf7f22e669d26a39579b1dcc3e319e..e6323460651712aad82d05a0bb261ae9ba88f1e8 100755 (executable)
@@ -15,7 +15,6 @@ my $minibuilddir = $builddir . "/mono/mini";
 
 # Setup the execution environment
 # for the profiler module
-append_path ("MONO_PROFILER_LIB_DIR", $profbuilddir . "/.libs");
 append_path ("DYLD_LIBRARY_PATH", $minibuilddir . "/.libs");
 # for mprof-report
 append_path ("PATH", $profbuilddir);
index 57e6f6931fc85ae980bee580694ee17c045b6d6f..e6b8d672dce53fbb73037cc2c4dbfe39bca1a9a7 100644 (file)
@@ -1074,6 +1074,12 @@ finish_gray_stack (int generation, ScanCopyContext ctx)
        if (sgen_client_bridge_need_processing ())
                sgen_client_bridge_reset_data ();
 
+       /*
+        * Mark all strong toggleref objects. This must be done before we walk ephemerons or finalizers
+        * to ensure they see the full set of live objects.
+        */
+       sgen_client_mark_togglerefs (start_addr, end_addr, ctx);
+
        /*
         * Walk the ephemeron tables marking all values with reachable keys. This must be completely done
         * before processing finalizable objects and non-tracking weak links to avoid finalizing/clearing
@@ -1086,8 +1092,6 @@ finish_gray_stack (int generation, ScanCopyContext ctx)
                ++ephemeron_rounds;
        } while (!done_with_ephemerons);
 
-       sgen_client_mark_togglerefs (start_addr, end_addr, ctx);
-
        if (sgen_client_bridge_need_processing ()) {
                /*Make sure the gray stack is empty before we process bridge objects so we get liveness right*/
                sgen_drain_gray_stack (ctx);
index 83b7d196cbd2b12005d107ba4df1eb074b2c175d..965b148ec74a6989ce25b6817e334af0b3f0f36a 100644 (file)
@@ -877,7 +877,7 @@ runtest: $(TESTSI_CS) $(TESTSI_IL) $(TESTBS) libtest.la $(PREREQSI_IL) $(PREREQS
 
 runtest-managed: test-runner.exe $(TESTSI_CS) $(TESTSI_IL) $(TESTBS) libtest.la $(PREREQSI_IL) $(PREREQSI_CS)
        @if [ "x$$CI" = "x1" ]; then disabled_tests="$(DISABLED_TESTS_WRENCH)"; else disabled_tests="$(DISABLED_TESTS)"; fi; \
-       $(RUNTIME) --debug ./test-runner.exe -j a --testsuite-name "runtime" --disabled "$${disabled_tests}" $(TESTSI_CS) $(TESTBS) $(TESTSI_IL)
+       $(RUNTIME) --debug ./test-runner.exe -j a --testsuite-name "runtime" --timeout 300 --disabled "$${disabled_tests}" $(TESTSI_CS) $(TESTBS) $(TESTSI_IL)
 
 runtest-managed-serial: test-runner.exe $(TESTSI_CS) $(TESTSI_IL) $(TESTBS) libtest.la $(PREREQSI_IL) $(PREREQSI_CS)
        @if [ "x$$CI" = "x1" ]; then disabled_tests="$(DISABLED_TESTS_WRENCH)"; else disabled_tests="$(DISABLED_TESTS)"; fi; \
index d604294fee0884166128bd9687335ba1cd394e03..f4f2df11555816c07308e4935012b020ea486dd1 100644 (file)
@@ -3,6 +3,7 @@ using System.Collections;
 using System.Collections.Generic;
 using System.Threading;
 using System.Runtime.InteropServices;
+using System.Runtime.CompilerServices;
 
 public class Toggleref {
        public int __test;
@@ -42,23 +43,23 @@ class Driver {
                mono_gc_toggleref_add (Helper.ObjToPtr (obj), true);
        }
 
+       static Toggleref a, b;
+
        static void SetupLinks () {
-               var a = new Toggleref () { id = "root" };
-               var b = new Toggleref () { id = "child" };
-               a.link.Add (b);
-               a.__test = Toggleref.STRONG;
-               b.__test = Toggleref.WEAK;
-               Register (a);
-               Register (b);
-               root = new WeakReference<Toggleref> (a, false);
-               child = new WeakReference<Toggleref> (b, false);
+               var r = new Toggleref () { id = "root" };
+               var c = new Toggleref () { id = "child" };
+               r.link.Add (c);
+               r.__test = Toggleref.STRONG;
+               c.__test = Toggleref.WEAK;
+               Register (r);
+               Register (c);
+               root = new WeakReference<Toggleref> (r, false);
+               child = new WeakReference<Toggleref> (c, false);
        }
 
-       static Toggleref a, b;
-
-       static int Main ()
+       static int test_0_root_keeps_child ()
        {
-               
+               Console.WriteLine ("test_0_root_keeps_child");
                var t = new Thread (SetupLinks);
                t.Start ();
                t.Join ();
@@ -94,6 +95,116 @@ class Driver {
 
 
                return 0;
+       }
+
+       static void SetupLinks2 () {
+               var r = new Toggleref () { id = "root" };
+               var c = new Toggleref () { id = "child" };
+
+               r.__test = Toggleref.STRONG;
+               c.__test = Toggleref.WEAK;
+               Register (r);
+               Register (c);
+               root = new WeakReference<Toggleref> (r, false);
+               child = new WeakReference<Toggleref> (c, false);
+       }
+
+       static int test_0_child_goes_away ()
+       {
+               Console.WriteLine ("test_0_child_goes_away");
+
+               var t = new Thread (SetupLinks2);
+               t.Start ();
+               t.Join ();
+
+               GC.Collect ();
+               GC.WaitForPendingFinalizers ();
+
+               Console.WriteLine ("try get A {0}", root.TryGetTarget (out a));
+               Console.WriteLine ("try get B {0}", child.TryGetTarget (out b));
+               Console.WriteLine ("a is null {0}", a == null);
+               Console.WriteLine ("b is null {0}", b == null);
+               if (a == null || b != null)
+                       return 1;
+               Console.WriteLine ("a test {0}", a.__test);
+
+               return 0;
+       }
+
+       static ConditionalWeakTable<Toggleref, object> cwt = new ConditionalWeakTable<Toggleref, object> ();
+       static WeakReference<object> root_value, child_value;
+       static object a_val, b_val;
+
+
+       static void SetupLinks3 () {
+               var r = new Toggleref () { id = "root" };
+               var c = new Toggleref () { id = "child" };
+
+               r.__test = Toggleref.STRONG;
+               c.__test = Toggleref.WEAK;
+               Register (r);
+               Register (c);
+               root = new WeakReference<Toggleref> (r, false);
+               child = new WeakReference<Toggleref> (c, false);
+
+               var root_val = new object ();
+               var child_val = new object ();
+
+               cwt.Add (r, root_val);
+               cwt.Add (c, child_val);
+
+               root_value = new WeakReference<object> (root_val, false);
+               child_value = new WeakReference<object> (child_val, false);
+       }
+
+       static int test_0_CWT_keep_child_alive ()
+       {
+               Console.WriteLine ("test_0_CWT_keep_child_alive");
+
+               var t = new Thread (SetupLinks3);
+               t.Start ();
+               t.Join ();
+
+               GC.Collect ();
+               GC.WaitForPendingFinalizers ();
+
+               Console.WriteLine ("try get A {0}", root.TryGetTarget (out a));
+               Console.WriteLine ("try get B {0}", child.TryGetTarget (out b));
+               Console.WriteLine ("a is null {0}", a == null);
+               Console.WriteLine ("b is null {0}", b == null);
+               if (a == null || b != null)
+                       return 1;
+               Console.WriteLine ("a test {0}", a.__test);
+
+               Console.WriteLine ("try get a_val {0}", root_value.TryGetTarget (out a_val));
+               Console.WriteLine ("try get v_val {0}", child_value.TryGetTarget (out b_val));
+
+               //the strong toggleref must keep the CWT value to remains alive
+               if (a_val == null)
+                       return 2;
+
+               //the weak toggleref should allow the CWT value to go away
+               if (b_val != null)
+                       return 3;
+
+               object res_value = null;
+               bool res = cwt.TryGetValue (a, out res_value);
+               Console.WriteLine ("CWT result {0} -> {1}", res, res_value == a_val);
+
+               //the strong val is not on the CWT
+               if (!res)
+                       return 4;
+
+               //for some reason the value is not the right one
+               if (res_value != a_val)
+                       return 5;
+
+               return 0;
+       }
 
+       static int Main (string[] args)
+       {
+               return TestDriver.RunTests (typeof (Driver), args);
        }
+
 }
\ No newline at end of file
index ae52220e335db404bdfe5ff59d2c6d0aa701d702..95011edf2c9c2d6d200ad577696870a5813372f0 100644 (file)
@@ -261,7 +261,10 @@ public class TestRunner
 
                                                output.Write ("timed out");
 
-                                               p.Kill ();
+                                               try {
+                                                       p.Kill ();
+                                               } catch {
+                                               }
                                        } else if (p.ExitCode != expectedExitCode) {
                                                var end = DateTime.UtcNow;
 
index b6d1e5f20554000d4b037008ee01dce5e1d5eeba..86afad502ffe27947c4bf7718bc49abbd4ded33c 100644 (file)
@@ -503,7 +503,7 @@ InterlockedCompareExchange64(volatile gint64 *dest, gint64 exch, gint64 comp)
        return __sync_val_compare_and_swap (dest, comp, exch);
 }
 
-#elif defined (HAVE_64BIT_CMPXCHG_FALLBACK)
+#elif defined (__arm__) && defined (HAVE_ARMV7) && (defined(TARGET_IOS) || defined(TARGET_WATCHOS) || defined(TARGET_ANDROID))
 
 #if defined (TARGET_IOS) || defined (TARGET_WATCHOS)
 
index 78ab036a22b9f2b013fb61bb946113306110f29a..4f5f010afd31bd61551347f754fe9f31639b0bae 100755 (executable)
@@ -22,10 +22,6 @@ F/MonoDroid( 1568): shared runtime initialization error: Cannot load library: re
 Apple targets have historically being problematic, xcode 4.6 would miscompile the intrinsic.
 */
 
-#if defined (__arm__) && defined (HAVE_ARMV7)
-#define HAVE_64BIT_CMPXCHG_FALLBACK /* See atomic.c in this directory. */
-#endif
-
 /* On Windows, we always use the functions provided by the Windows API. */
 #if defined(__WIN32__) || defined(_WIN32)
 
index 2b3b86e2ef2e305dd8de427b6eb4902b999283de..04bc26e4f53ff3ef3796dc25ba3536144b6ba48d 100644 (file)
@@ -7,6 +7,19 @@
  */
 #include <config.h>
 
+/*
+ * When embedding, you have to define MONO_ZERO_LEN_ARRAY before including any
+ * other Mono header file if you use a different compiler from the one used to
+ * build Mono.
+ */
+#ifndef MONO_ZERO_LEN_ARRAY
+#ifdef __GNUC__
+#define MONO_ZERO_LEN_ARRAY 0
+#else
+#define MONO_ZERO_LEN_ARRAY 1
+#endif
+#endif
+
 #ifdef __GNUC__
 #define MONO_ATTR_USED __attribute__ ((used))
 #else
index 62493555a30752086a450b0d954005060e9575d0..43116130309eec7195e24a87f8d39e10e544dbce 100644 (file)
@@ -402,28 +402,35 @@ mono_dl_open_runtime_lib (const char* lib_name, int flags, char **error_msg)
        if (binl != -1) {
                char *base;
                char *resolvedname, *name;
+               char *baseparent = NULL;
                buf [binl] = 0;
                resolvedname = mono_path_resolve_symlinks (buf);
                base = g_path_get_dirname (resolvedname);
                name = g_strdup_printf ("%s/.libs", base);
                runtime_lib = try_load (lib_name, name, flags, error_msg);
                g_free (name);
+               if (!runtime_lib)
+                       baseparent = g_path_get_dirname (base);
                if (!runtime_lib) {
-                       char *newbase = g_path_get_dirname (base);
-                       name = g_strdup_printf ("%s/lib", newbase);
+                       name = g_strdup_printf ("%s/lib", baseparent);
                        runtime_lib = try_load (lib_name, name, flags, error_msg);
                        g_free (name);
                }
 #ifdef __MACH__
                if (!runtime_lib) {
-                       char *newbase = g_path_get_dirname (base);
-                       name = g_strdup_printf ("%s/Libraries", newbase);
+                       name = g_strdup_printf ("%s/Libraries", baseparent);
                        runtime_lib = try_load (lib_name, name, flags, error_msg);
                        g_free (name);
                }
 #endif
+               if (!runtime_lib) {
+                       name = g_strdup_printf ("%s/profiler/.libs", baseparent);
+                       runtime_lib = try_load (lib_name, name, flags, error_msg);
+                       g_free (name);
+               }
                g_free (base);
                g_free (resolvedname);
+               g_free (baseparent);
        }
        if (!runtime_lib)
                runtime_lib = try_load (lib_name, NULL, flags, error_msg);
index 559998255665b96f3296be7cada14627505ae1c1..71498c0d99b4e2e8148f5c73658aba7b934c2f0a 100644 (file)
@@ -2,7 +2,7 @@
 #define __MONO_ERROR_INTERNALS_H__
 
 #include "mono/utils/mono-compiler.h"
-#include "mono/metadata/object-internals.h"
+#include "mono/metadata/class-internals.h"
 
 /*Keep in sync with MonoError*/
 typedef struct {
@@ -103,10 +103,10 @@ void
 mono_error_set_not_supported (MonoError *error, const char *msg_format, ...);
 
 void
-mono_error_set_exception_instance (MonoError *error, MonoException *exc);
+mono_error_set_invalid_operation (MonoError *error, const char *msg_format, ...);
 
 void
-mono_error_set_from_loader_error (MonoError *error);
+mono_error_set_exception_instance (MonoError *error, MonoException *exc);
 
 MonoException*
 mono_error_prepare_exception (MonoError *error, MonoError *error_out);
@@ -117,9 +117,6 @@ mono_error_convert_to_exception (MonoError *error);
 void
 mono_error_raise_exception (MonoError *error);
 
-void
-mono_loader_set_error_from_mono_error (MonoError *oerror);
-
 void
 mono_error_move (MonoError *dest, MonoError *src);
 
index 94c0c4fd35a29639b9d692e08a9d7ce32d4ffbe8..84d04781e708927500ec5fc106ec46066cacfda4 100644 (file)
@@ -12,9 +12,7 @@
 #include "mono-error-internals.h"
 
 #include <mono/metadata/exception.h>
-#include <mono/metadata/class-internals.h>
 #include <mono/metadata/debug-helpers.h>
-#include <mono/metadata/object.h>
 #include <mono/metadata/object-internals.h>
 
 #define set_error_messagev() do { \
@@ -91,6 +89,13 @@ mono_error_init_flags (MonoError *oerror, unsigned short flags)
        error->flags = flags;
 }
 
+/**
+ * mono_error_init:
+ * @error: Pointer to MonoError struct to initialize
+ *
+ * Any function which takes a MonoError for purposes of reporting an error
+ * is required to call either this or mono_error_init_flags on entry.
+ */
 void
 mono_error_init (MonoError *error)
 {
@@ -388,7 +393,7 @@ mono_error_set_execution_engine (MonoError *oerror, const char *msg_format, ...)
 }
 
 /**
- * mono_error_set_execution_engine:
+ * mono_error_set_not_supported:
  *
  * System.NotSupportedException
  */
@@ -401,120 +406,28 @@ mono_error_set_not_supported (MonoError *oerror, const char *msg_format, ...)
        va_end (args);
 }
 
+/**
+ * mono_error_set_invalid_operation:
+ *
+ * System.InvalidOperationException
+ */
 void
-mono_error_set_exception_instance (MonoError *oerror, MonoException *exc)
+mono_error_set_invalid_operation (MonoError *oerror, const char *msg_format, ...)
 {
-       MonoErrorInternal *error = (MonoErrorInternal*)oerror;
-
-       mono_error_prepare (error);
-       error->error_code = MONO_ERROR_EXCEPTION_INSTANCE;
-       error->exn.instance_handle = mono_gchandle_new (exc ? &exc->object : NULL, FALSE);
+       va_list args;
+       va_start (args, msg_format);
+       mono_error_set_generic_errorv (oerror, "System", "InvalidOperationException", msg_format, args);
+       va_end (args);
 }
 
 void
-mono_error_set_from_loader_error (MonoError *oerror)
+mono_error_set_exception_instance (MonoError *oerror, MonoException *exc)
 {
-       MonoLoaderError *loader_error = mono_loader_get_last_error ();
        MonoErrorInternal *error = (MonoErrorInternal*)oerror;
-       gboolean dup_strings = TRUE;
 
        mono_error_prepare (error);
-
-       if (!loader_error) {
-               mono_error_set_execution_engine (oerror, "Runtime tried to produce a mono-error from an empty loader-error");
-               return;
-       }
-
-       switch (loader_error->exception_type) {
-       case MONO_EXCEPTION_NONE:
-               mono_error_set_execution_engine (oerror, "Runtime tried to produce a mono-error from a non-error loader-error");
-               break;
-
-       case MONO_EXCEPTION_INVALID_PROGRAM:
-               mono_error_set_generic_error (oerror, "System", "InvalidProgramException", "Failed for unknown reasons.");
-               break;
-
-       case MONO_EXCEPTION_UNVERIFIABLE_IL:
-               mono_error_set_generic_error (oerror, "System.Security", "VerificationException", "Failed for unknown reasons.");
-               break;
-
-       case MONO_EXCEPTION_MISSING_METHOD:
-               error->error_code = MONO_ERROR_MISSING_METHOD;
-               mono_error_set_type_name (oerror, loader_error->class_name);
-               mono_error_set_member_name (oerror, loader_error->member_name);
-               error->full_message = g_strdup ("Failed for unknown reasons.");
-               break;
-
-       case MONO_EXCEPTION_MISSING_FIELD:
-               mono_error_set_field_load (oerror, loader_error->klass, loader_error->member_name, "Failed for unknown reasons.");
-               break;
-
-       case MONO_EXCEPTION_TYPE_LOAD:
-               mono_error_set_type_load_name (oerror, g_strdup (loader_error->class_name), g_strdup (loader_error->assembly_name), "Failed for unknown reasons.");
-               dup_strings = FALSE;
-               break;
-       
-       case MONO_EXCEPTION_FILE_NOT_FOUND:
-               mono_error_set_assembly_load_simple (oerror, loader_error->assembly_name, loader_error->ref_only);
-               break;
-
-       case MONO_EXCEPTION_METHOD_ACCESS:
-               mono_error_set_generic_error (oerror, "System", "MethodAccessException", "Failed for unknown reasons.");
-               break;
-
-       case MONO_EXCEPTION_FIELD_ACCESS:
-               mono_error_set_generic_error (oerror, "System", "FieldAccessException", "Failed for unknown reasons.");
-               break;
-
-       case MONO_EXCEPTION_OBJECT_SUPPLIED:
-       case MONO_EXCEPTION_GENERIC_SHARING_FAILED:
-               mono_error_set_execution_engine (oerror, "Runtime tried to produce a mono-error from JIT internal error %d", loader_error->exception_type);
-               break;
-
-       case MONO_EXCEPTION_BAD_IMAGE:
-               mono_error_set_bad_image_name (oerror, "<unknown>", "%s", loader_error->msg);
-               break;
-
-       case MONO_EXCEPTION_OUT_OF_MEMORY:
-               mono_error_set_out_of_memory (oerror, "Failed for unknown reasons.");
-               break;
-
-       default:
-               mono_error_set_execution_engine (oerror, "Runtime tried to produce an unknown loader-error %d", loader_error->exception_type);
-               break;
-       }
-
-       mono_error_dup_strings (oerror, dup_strings);
-       mono_loader_clear_error ();
-}
-
-void
-mono_loader_set_error_from_mono_error (MonoError *oerror)
-{
-       MonoErrorInternal *error = (MonoErrorInternal*)oerror;
-
-       switch (error->error_code) {
-       case MONO_ERROR_MISSING_METHOD:
-               mono_loader_set_error_method_load (get_type_name (error), error->member_name);
-               break;
-       case MONO_ERROR_MISSING_FIELD:
-               mono_loader_set_error_field_load (error->exn.klass, error->member_name);
-               break;
-       case MONO_ERROR_TYPE_LOAD:
-               mono_loader_set_error_type_load (get_type_name (error), get_assembly_name (error));
-               break;
-       case MONO_ERROR_FILE_NOT_FOUND:
-               /* XXX can't recover if it's ref only or not */
-               mono_loader_set_error_assembly_load (get_assembly_name (error), FALSE);
-               break;
-       case MONO_ERROR_BAD_IMAGE:
-               mono_loader_set_error_bad_image (g_strdup (error->full_message));
-               break;
-       case MONO_ERROR_EXCEPTION_INSTANCE:
-               mono_loader_set_error_bad_image (g_strdup_printf ("Non translatable error"));
-       default:
-               mono_loader_set_error_bad_image (g_strdup_printf ("Non translatable error: %s", error->full_message));
-       }
+       error->error_code = MONO_ERROR_EXCEPTION_INSTANCE;
+       error->exn.instance_handle = mono_gchandle_new (exc ? &exc->object : NULL, FALSE);
 }
 
 void
index 39caeb54d65b68c918bdc04f991d2a53c4163e13..8200b101913cc05c9e612c69a2077737a5a5ac85 100644 (file)
@@ -36,8 +36,8 @@ static sigset_t suspend_ack_signal_mask;
 //Can't avoid the circular dep on this. Will be gone pretty soon
 extern int mono_gc_get_suspend_signal (void);
 
-static int
-signal_search_alternative (int min_signal)
+int
+mono_threads_posix_signal_search_alternative (int min_signal)
 {
 #if !defined (SIGRTMIN)
        g_error ("signal search only works with RTMIN");
@@ -88,7 +88,7 @@ suspend_signal_get (void)
 #else
        static int suspend_signum = -1;
        if (suspend_signum == -1)
-               suspend_signum = signal_search_alternative (-1);
+               suspend_signum = mono_threads_posix_signal_search_alternative (-1);
        return suspend_signum;
 #endif /* SIGRTMIN */
 }
@@ -107,7 +107,7 @@ restart_signal_get (void)
 #else
        static int resume_signum = -1;
        if (resume_signum == -1)
-               resume_signum = signal_search_alternative (suspend_signal_get () + 1);
+               resume_signum = mono_threads_posix_signal_search_alternative (suspend_signal_get () + 1);
        return resume_signum;
 #endif /* SIGRTMIN */
 }
@@ -127,7 +127,7 @@ abort_signal_get (void)
 #else
        static int abort_signum = -1;
        if (abort_signum == -1)
-               abort_signum = signal_search_alternative (restart_signal_get () + 1);
+               abort_signum = mono_threads_posix_signal_search_alternative (restart_signal_get () + 1);
        return abort_signum;
 #endif /* SIGRTMIN */
 }
index 2bdcf8e789ac29e055359ce26c8a4dfb5c406bba..59a38c1ceb21fcf922d109ffdff71091415978a5 100644 (file)
@@ -14,6 +14,9 @@ typedef enum {
        MONO_THREADS_POSIX_INIT_SIGNALS_ABORT,
 } MonoThreadPosixInitSignals;
 
+int
+mono_threads_posix_signal_search_alternative (int min_signal);
+
 void
 mono_threads_posix_init_signals (MonoThreadPosixInitSignals signals);
 
@@ -28,4 +31,4 @@ mono_threads_posix_get_abort_signal (void);
 
 #endif /* defined(USE_POSIX_BACKEND) || defined(USE_POSIX_SYSCALL_ABORT) */
 
-#endif /* __MONO_THREADS_POSIX_SIGNALS_H__ */
\ No newline at end of file
+#endif /* __MONO_THREADS_POSIX_SIGNALS_H__ */
index 54f183e58f03659937730f70797d3de5b411c0db..7fe86b96273e80ded338c90b945f0dd256646806 100644 (file)
@@ -279,7 +279,24 @@ mono_native_thread_create (MonoNativeThreadId *tid, gpointer func, gpointer arg)
 void
 mono_threads_core_set_name (MonoNativeThreadId tid, const char *name)
 {
-#if defined (HAVE_PTHREAD_SETNAME_NP) && !defined (__MACH__)
+#ifdef __MACH__
+       /*
+        * We can't set the thread name for other threads, but we can at least make
+        * it work for threads that try to change their own name.
+        */
+       if (tid != mono_native_thread_id_get ())
+               return;
+
+       if (!name) {
+               pthread_setname_np ("");
+       } else {
+               char n [63];
+
+               strncpy (n, name, 63);
+               n [62] = '\0';
+               pthread_setname_np (n);
+       }
+#elif defined (HAVE_PTHREAD_SETNAME_NP)
        if (!name) {
                pthread_setname_np (tid, "");
        } else {
index 0b142ee1c3f0024fedbce186aa41c65df83e484e..b6e70329c96dc4c6f5660c3d071c3b37f8cde78a 100644 (file)
@@ -1519,27 +1519,3 @@ mono_thread_info_describe_interrupt_token (MonoThreadInfo *info, GString *text)
        else
                g_string_append_printf (text, "waiting");
 }
-
-/* info must be self or be held in a hazard pointer. */
-gboolean
-mono_threads_add_async_job (MonoThreadInfo *info, MonoAsyncJob job)
-{
-       MonoAsyncJob old_job;
-       do {
-               old_job = (MonoAsyncJob) info->service_requests;
-               if (old_job & job)
-                       return FALSE;
-       } while (InterlockedCompareExchange (&info->service_requests, old_job | job, old_job) != old_job);
-       return TRUE;
-}
-
-MonoAsyncJob
-mono_threads_consume_async_jobs (void)
-{
-       MonoThreadInfo *info = (MonoThreadInfo*)mono_native_tls_get_value (thread_info_key);
-
-       if (!info)
-               return (MonoAsyncJob) 0;
-
-       return (MonoAsyncJob) InterlockedExchange (&info->service_requests, 0);
-}
index 1019dda1884e4c078e4f9de583e74a339c223bfc..97c77de6e7df32e02c97b643813bec873cbd7dc6 100644 (file)
@@ -164,13 +164,6 @@ enum {
        ASYNC_SUSPEND_STATE_INDEX = 1,
 };
 
-/*
- * This enum tells which async thread service corresponds to which bit.
- */
-typedef enum {
-       MONO_SERVICE_REQUEST_SAMPLE = 1,
-} MonoAsyncJob;
-
 typedef struct _MonoThreadInfoInterruptToken MonoThreadInfoInterruptToken;
 
 typedef struct {
@@ -241,12 +234,6 @@ typedef struct {
        /* Set when the thread is started, or in _wapi_thread_duplicate () */
        HANDLE handle;
 
-       /* Asynchronous service request. This flag is meant to be consumed by the multiplexing signal handlers to discover what sort of work they need to do.
-        * Use the mono_threads_add_async_job and mono_threads_consume_async_jobs APIs to modify this flag.
-        * In the future the signaling should be part of the API, but for now, it's only for massaging the bits.
-        */
-       volatile gint32 service_requests;
-
        void *jit_data;
 
        MonoThreadInfoInterruptToken *interrupt_token;
@@ -346,7 +333,7 @@ mono_thread_info_register_small_id (void);
 THREAD_INFO_TYPE *
 mono_thread_info_attach (void *baseptr);
 
-void
+MONO_API void
 mono_thread_info_detach (void);
 
 gboolean
@@ -370,7 +357,7 @@ mono_thread_info_lookup (MonoNativeThreadId id);
 gboolean
 mono_thread_info_resume (MonoNativeThreadId tid);
 
-void
+MONO_API void
 mono_thread_info_set_name (MonoNativeThreadId tid, const char *name);
 
 void
@@ -466,17 +453,6 @@ mono_threads_get_max_stack_size (void);
 HANDLE
 mono_threads_open_thread_handle (HANDLE handle, MonoNativeThreadId tid);
 
-/*
-This is the async job submission/consumption API.
-XXX: This is a PROVISIONAL API only meant to be used by the statistical profiler.
-If you want to use/extend it anywhere else, understand that you'll have to do some API design work to better fit this puppy.
-*/
-gboolean
-mono_threads_add_async_job (THREAD_INFO_TYPE *info, MonoAsyncJob job);
-
-MonoAsyncJob
-mono_threads_consume_async_jobs (void);
-
 MONO_API void
 mono_threads_attach_tools_thread (void);
 
@@ -547,7 +523,7 @@ void mono_threads_core_set_name (MonoNativeThreadId tid, const char *name);
 void mono_threads_coop_begin_global_suspend (void);
 void mono_threads_coop_end_global_suspend (void);
 
-MonoNativeThreadId
+MONO_API MonoNativeThreadId
 mono_native_thread_id_get (void);
 
 gboolean
index 8abe83907ceeb5cbdb419f03c0a12bc92c0365e2..e95f4847e6cf61f0b5ae64e6993212eecde4098a 100644 (file)
@@ -2,26 +2,14 @@
 #define __MONO_BITSET_H__
 
 #include <glib.h>
+#include <mono/utils/mono-compiler.h>
+
 #ifdef SGEN_WITHOUT_MONO
-#include "mono/utils/mono-compiler.h"
 #define MONO_API
 #else
 #include <mono/utils/mono-publib.h>
 #endif
 
-/*
- * When embedding, you have to define MONO_ZERO_LEN_ARRAY before including any
- * other Mono header file if you use a different compiler from the one used to
- * build Mono.
- */
-#ifndef MONO_ZERO_LEN_ARRAY
-#ifdef __GNUC__
-#define MONO_ZERO_LEN_ARRAY 0
-#else
-#define MONO_ZERO_LEN_ARRAY 1
-#endif
-#endif
-
 #define MONO_BITSET_BITS_PER_CHUNK (8 * sizeof (gsize))
 
 typedef struct {
index 1a541ddea20e453728d1a57dadbdfe178684e2ea..bcf1f7a7ab5ae07a4f706b54f8fb1166974ecc91 100644 (file)
       <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>\r
       <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release_SGen|Win32'">true</ExcludedFromBuild>\r
     </ClCompile>\r
+    <ClCompile Include="..\mono\mini\mini-amd64-gsharedvt.c">\r
+      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>\r
+      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug_SGen|Win32'">true</ExcludedFromBuild>\r
+      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>\r
+      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release_SGen|Win32'">true</ExcludedFromBuild>\r
+    </ClCompile>\r
     <ClCompile Include="..\mono\mini\mini-runtime.c" />\r
     <ClCompile Include="..\mono\mini\mini-windows.c" />\r
     <ClCompile Include="..\mono\mini\mini-x86.c">\r
       <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>\r
       <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release_SGen|x64'">true</ExcludedFromBuild>\r
     </ClCompile>\r
+    <ClCompile Include="..\mono\mini\mini-x86-gsharedvt.c">\r
+      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>\r
+      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug_SGen|x64'">true</ExcludedFromBuild>\r
+      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>\r
+      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release_SGen|x64'">true</ExcludedFromBuild>\r
+    </ClCompile>\r
     <ClCompile Include="..\mono\mini\mini.c" />\r
     <ClInclude Include="..\mono\metadata\remoting.h" />\r
     <ClInclude Include="..\mono\mini\ir-emit.h" />\r
       <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>\r
       <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release_SGen|Win32'">true</ExcludedFromBuild>\r
     </ClInclude>\r
+    <ClInclude Include="..\mono\mini\mini-amd64-gsharedvt.h">\r
+      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>\r
+      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug_SGen|Win32'">true</ExcludedFromBuild>\r
+      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>\r
+      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release_SGen|Win32'">true</ExcludedFromBuild>\r
+    </ClInclude>\r
     <ClInclude Include="..\mono\mini\mini-x86.h">\r
       <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>\r
       <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug_SGen|x64'">true</ExcludedFromBuild>\r
     <ClCompile Include="..\mono\mini\aot-runtime.c" />\r
     <ClCompile Include="..\mono\mini\graph.c" />\r
     <ClCompile Include="..\mono\mini\mini-codegen.c" />\r
+    <ClCompile Include="..\mono\mini\mini-cross-helpers.c" />\r
     <ClCompile Include="..\mono\mini\mini-exceptions.c" />\r
+    <ClCompile Include="..\mono\mini\mini-exceptions-native-unwinder.c" />\r
     <ClCompile Include="..\mono\mini\mini-trampolines.c  " />\r
     <ClCompile Include="..\mono\mini\tramp-amd64.c">\r
       <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>\r
       <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>\r
       <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release_SGen|Win32'">true</ExcludedFromBuild>\r
     </ClCompile>\r
+    <ClCompile Include="..\mono\mini\tramp-amd64-gsharedvt.c">\r
+      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>\r
+      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug_SGen|Win32'">true</ExcludedFromBuild>\r
+      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>\r
+      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release_SGen|Win32'">true</ExcludedFromBuild>\r
+    </ClCompile>\r
     <ClCompile Include="..\mono\mini\tramp-x86.c">\r
       <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>\r
       <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug_SGen|x64'">true</ExcludedFromBuild>\r
       <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>\r
       <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release_SGen|x64'">true</ExcludedFromBuild>\r
     </ClCompile>\r
+    <ClCompile Include="..\mono\mini\tramp-x86-gsharedvt.c">\r
+      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>\r
+      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug_SGen|x64'">true</ExcludedFromBuild>\r
+      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>\r
+      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release_SGen|x64'">true</ExcludedFromBuild>\r
+    </ClCompile>\r
     <ClCompile Include="..\mono\mini\branch-opts.c" />\r
     <ClCompile Include="..\mono\mini\mini-generic-sharing.c" />\r
     <ClInclude Include="..\mono\mini\simd-methods.h" />\r
index 8bcf531528280627f8ed9d8852b4384f8ee4bf65..d8f354b76079eb2f3d601a0f7ff7e3082a13fc04 100644 (file)
@@ -67,6 +67,7 @@
     <ClCompile Include="..\mono\metadata\mempool.c" />\r
     <ClCompile Include="..\mono\metadata\metadata-verify.c" />\r
     <ClCompile Include="..\mono\metadata\metadata.c" />\r
+    <ClCompile Include="..\mono\metadata\metadata-cross-helpers.c" />\r
     <ClCompile Include="..\mono\metadata\method-builder.c" />\r
     <ClCompile Include="..\mono\metadata\monitor.c" />\r
     <ClCompile Include="..\mono\metadata\mono-basic-block.c" />\r
     <ClCompile Include="..\mono\metadata\sysmath.c" />\r
     <ClCompile Include="..\mono\metadata\threads.c" />\r
     <ClCompile Include="..\mono\metadata\verify.c" />\r
-    <ClCompile Include="..\mono\mini\mini-cross-helpers.c" />\r
   </ItemGroup>\r
   <ItemGroup>\r
     <ClInclude Include="..\mono\metadata\appdomain.h" />\r
diff --git a/scripts/babysitter b/scripts/babysitter
deleted file mode 100755 (executable)
index f8b5a6c..0000000
+++ /dev/null
@@ -1,409 +0,0 @@
-#!/usr/bin/env python
-
-# Mimics GNU timeout, but does some fancy tracking based on custom features in mono nunit24.
-
-import argparse
-import subprocess
-import re
-import signal
-import time
-import sys
-import os.path
-import copy
-import tempfile
-import calendar
-import json
-
-### Constants
-
-# Here is how the communication with nunit works. It has to work with two constraints:
-# - We don't invoke nunit directly. We invoke some Makefile which invokes some other Makefile
-#   and at some point down the line someone calls nunit.
-# - nunit has to be able to report back to us even if (especially if) it terminates improperly.
-# To deal with all this, communication babysitter->nunit is done by environment variables,
-# and communication nunit->babysitter is done by leaving behind files in known locations.
-
-# Filenames
-
-CURRENT_TEST_FILE = "babysitter_report_current_test_file.txt"
-RAN_TEST_FILE     = "babysitter_report_ran_test_file.txt"
-FAILED_TEST_FILE  = "babysitter_report_failed_test_file.txt"
-LOGGING_FILE      = "babysitter_report.json_lines"
-
-# Environment keys
-
-# Keys used for Babysitter<->Nunit IPC
-CURRENT_TEST_KEY  = 'MONO_BABYSITTER_NUNIT_CURRENT_TEST_FILE' # Tell nunit where to leave files
-RAN_TEST_KEY      = 'MONO_BABYSITTER_NUNIT_RAN_TEST_FILE'
-FAILED_TEST_KEY   = 'MONO_BABYSITTER_NUNIT_FAILED_TEST_FILE'
-RUN_KEY           = 'MONO_BABYSITTER_NUNIT_RUN_TEST' # Semicolon-separated list of test names
-RUN_MODE_KEY      = 'MONO_BABYSITTER_NUNIT_RUN_MODE' # Equal to either RUN or AFTER
-
-# Keys used for script configuration (see --help text)
-LOG_FILE_KEY      = 'MONO_BABYSITTER_LOG_FILE'       # Path
-RETRY_KEY         = 'MONO_BABYSITTER_RETRY'          # Equal to an integer
-VERBOSE_KEY       = 'MONO_BABYSITTER_VERBOSE'        # "Undocumented"-- used for debugging babysitter
-
-# JSON keys
-
-DATE_JSON       = 'date'          # POSIX timestamp of test suite run
-INVOKE_JSON     = 'invocation'
-COUNT_JSON      = 'iteration'        # How many times was command executed?
-LIMIT_JSON      = 'failure_max'
-SUPPORT_JSON    = 'babysitter_protocol' # Was the test suite running with a babysitter-aware nunit?
-FINAL_CODE_JSON = 'final_code'
-TESTS_JSON      = 'tests'         # Holds dictionary of (test case name)->(dict with TEST_ keys below)
-TEST_FAILURES         = 'normal_failures'
-TEST_CRASH_FAILURES   = 'crash_failures'
-TEST_TIMEOUT_FAILURES = 'timeout_failures'
-
-### Interpret arguments
-
-scriptname = sys.argv[0]
-
-# This is very silly: This program needs to switch from argparse to manual parsing
-# after the second positional argument, but argparse doesn't let you do this.
-# I work around this with a custom subclass which can selectively swallow errors:
-class Hesitate(Exception):
-       pass
-class HesitantParser(argparse.ArgumentParser):
-       def __init__(s, *args, **kwargs):
-               s.hesitating = True  # Errors will be swallowed until this is set false
-               argparse.ArgumentParser.__init__(s, *args, **kwargs)
-       def error(s, *args, **kwargs):
-               if s.hesitating:
-                       raise Hesitate() # Bail out before errors are printed.
-               argparse.ArgumentParser.error(s, *args, **kwargs)
-
-# Define args
-argparser = HesitantParser(description="""\
-Run a test suite with a timeout.\n
-Durations are floating point numbers followed by an optional unit:\n
-'s' for seconds (the default)
-'m' for minutes
-'h' for hours
-'d' for days\n
-supported environment variables:
-  %s: File to write logs to (as line-delimited JSON)
-  %s: If set to a number, failed test cases will be rerun this many times (NUnit test suites only)""" %
-               (LOG_FILE_KEY, RETRY_KEY),
-       formatter_class=argparse.RawTextHelpFormatter)
-argparser.add_argument('-s', '--signal', dest='signal', metavar='signal', default='TERM',
-       help="Send this signal to the command on timeout, instead of TERM.")
-argparser.add_argument('-k', '--kill-after-duration', dest='kill_after', metavar='duration',
-       help="If process continues running after signal, send KILL after this duration.")
-argparser.add_argument('duration',
-       help="Time to run before sending signal.")
-argparser.add_argument('command', nargs="+", help="Command+args to run.")
-
-# Repeatedly parse the given args until we find the shortest prefix for which parsing succeeds.
-argc = len(sys.argv)
-extra_args = []
-for limit in range(1,argc+1):
-       try:
-               if limit == argc: # On the final pass, parse for real
-                       argparser.hesitating = False
-               args = argparser.parse_args(sys.argv[1:limit])
-               # If we're still here, parse_args succeeded.
-               # The final parsed arg is the command; remaining argv items are its args.
-               extra_args = sys.argv[limit:]
-               break
-       except Hesitate: # Before the final pass, if parse_args fails, skip
-               pass
-
-argparser.hesitating = False # Just act like a normal argparser from here
-
-durationre = re.compile(r'(\d+)([smhd]?)')
-def parse_duration(duration): # Accept units
-       match = durationre.match(duration)
-       if not match:
-               argparser.error("Could not understand duration %s" % duration)
-       time, units = match.group(1), match.group(2)
-       time = int(time)
-       if units == 'm':
-               time *= 60
-       elif units == 'h':
-               time *= 60*60
-       elif units == 'd':
-               time *= 60*60*24
-       return time
-
-def parse_signal(sig):        # Accept names
-       if sig.isdigit():
-               return int(sig)
-       for k,v in signal.__dict__.iteritems():
-               if k == ("SIG%s" % sig):
-                       return v
-       argparser.error("Could not understand signal name %s" % sig)
-
-# Final interpretation of arguments
-duration = parse_duration(args.duration)
-kill_after = parse_duration(args.kill_after) if args.kill_after is not None else None
-timeout_signal = parse_signal(args.signal)
-command = args.command + extra_args
-
-# Process environment
-global_env = copy.deepcopy( os.environ )
-
-verbose = VERBOSE_KEY in global_env
-logging = LOG_FILE_KEY in global_env
-logfile = global_env[LOG_FILE_KEY] if logging else None
-crash_resuming = True # TODO: Consider exposing this option, or adding a retry_on_crash option.
-failmax = int(global_env[RETRY_KEY]) if RETRY_KEY in global_env else 0
-babysitting = True # If false, babysitter becomes a timeout clone with no env manipulation or anything.
-if babysitting:
-       babysitter_dir = tempfile.mkdtemp()
-       global_env[CURRENT_TEST_KEY] = os.path.join(babysitter_dir, CURRENT_TEST_FILE)
-       global_env[RAN_TEST_KEY]     = os.path.join(babysitter_dir, RAN_TEST_FILE)
-       global_env[FAILED_TEST_KEY]  = os.path.join(babysitter_dir, FAILED_TEST_FILE)
-
-have_unix_process_groups = 'killpg' in os.__dict__
-have_windows_process_groups = 'CREATE_NEW_PROCESS_GROUP' in subprocess.__dict__
-
-### Timeout implementation
-
-def wait(proc, duration):
-       # TODO: If we detect Python 3.3, Popen objects have a wait(timeout) method we can use
-       start = time.time()
-       while True:
-               code = proc.poll()
-               if code is not None:
-                       return code
-               if time.time()-start > duration:
-                       return None
-               time.sleep(0.05)
-
-# Popen and send_signal can't be called in their basic forms because we want to
-# send signals to all children, not just to the immediately spawned process.
-# Unfortunately the way to do this varies by operating system.
-def popen(*args, **kwargs):
-       if have_unix_process_groups: # Call function on spawn to become process group leader
-               kwargs['preexec_fn'] = os.setsid
-       elif have_windows_process_groups: # Set magic flag for Windows process groups
-               kwargs['creationflags'] = subprocess.CREATE_NEW_PROCESS_GROUP
-       return subprocess.Popen(*args, **kwargs)
-
-def send_signal(proc, sig):
-       if have_unix_process_groups: # UNIX
-               # For compatibility with GNU timeout, pre-send the signal to just the monitored process
-               os.kill(proc.pid, sig)
-               # Send signal to entire group
-               os.killpg(proc.pid, sig)
-               # For compatibility with GNU Timeout, send a SIGCONT after the signal
-               # (so delivery has a chance to occur even for stopped processes)
-               if sig != signal.SIGKILL and sig != signal.SIGCONT:
-                       os.kill(proc.pid, signal.SIGCONT)
-       elif have_windows_process_groups: # Windows with Python 2.7 or better
-               os.kill(proc.pid, sig) # Becuase CREATE_NEW_PROCESS_GROUP, will go to entire group
-       else: # Windows with Python 2.6-- CREATE_NEW_PROCESS_GROUP not supported
-               proc.send_signal(sig) # No way to contact group, just kill process
-
-### Utility functions
-
-def attemptDelete(path):
-       try:
-               os.remove(path)
-       except OSError:
-               pass
-
-def attemptLines(path):
-       try:
-               with open(path) as f:
-                       return map(lambda s: s.strip('\r\n'), f.readlines())
-       except (OSError, IOError):
-               return []
-
-def attemptFirstLine(path):
-       lines = attemptLines(path)
-       if lines:
-               return lines[0]
-       return None
-
-def posixtime(): # Amazingly, time.time() does not guarantee an epoch in the docs. However this does:
-       return calendar.timegm(time.gmtime())
-
-failcount = {}
-def failure_may_retry(test):
-       if test not in failcount:
-               failcount[test] = 0
-       failcount[test] += 1
-       return failcount[test] < failmax
-
-def verbose_print(arg):
-       if (verbose):
-               print(arg)
-
-def failure_annotate(test):
-       return "%s (failure #%d of %d allowed)" % (test, failcount[test], failmax)
-
-def pluralize(lst):
-       return "s" if len(lst) > 1 else ""
-
-### Run command
-
-def run(): # Returns exit code
-       resume_after = []
-       retry_these = []
-       ever_completed = False
-       died_politely = False
-       proc = None
-       code = None
-
-       # Set up logging
-       log = {DATE_JSON: posixtime(), COUNT_JSON:0, LIMIT_JSON:failmax, SUPPORT_JSON:False,
-               INVOKE_JSON: " ".join(command)}
-
-       def log_value(key, set=None, add=None, target=log): # Call to add toplevel value to log
-               if add is not None:
-                       if key not in target:
-                               target[key] = 0
-                       target[key] += add
-               else:
-                       target[key] = set
-
-       def log_test(testname, key, set=None, add=None):   # Call to add test-case-level value to log
-               if TESTS_JSON not in log:
-                       log[TESTS_JSON] = {}
-               if testname not in log[TESTS_JSON]:
-                       log[TESTS_JSON][testname] = {}
-               log_value(key, set=set, add=add, target=log[TESTS_JSON][testname])
-
-       # Ready to run tests
-       try:
-               while True:
-                       env = copy.copy(global_env)
-                       if ever_completed:
-                               retry_next = []
-                       else: # Persist reported failures list until first non-crash run
-                               retry_next = retry_these
-
-                       log_value(COUNT_JSON, add=1)
-
-                       # Prepare environment/filesystem
-                       if babysitting:
-                               for key in [CURRENT_TEST_KEY, RAN_TEST_KEY, FAILED_TEST_KEY]:
-                                       attemptDelete(env[key])
-                               if resume_after:
-                                       env[RUN_KEY] = ";".join(resume_after)
-                                       env[RUN_MODE_KEY] = "EXCLUDE"
-                               elif retry_these:
-                                       env[RUN_KEY] = ";".join(retry_these)
-                                       env[RUN_MODE_KEY] = "RUN"
-
-                       # Run test suite
-                       try:
-                               proc = popen(command, env=env)
-                       except OSError:
-                               died_politely = True
-                               sys.stderr.write("%s: Could not execute command `%s`\n" % (scriptname, command[0]))
-                               sys.exit(127)
-
-                       code = wait(proc, duration)
-                       timed_out = code is None
-                       if timed_out:                  # Initial timeout
-                               send_signal(proc, timeout_signal)
-                               if kill_after is not None: # Kill-after timeout
-                                       code = wait(proc, kill_after)
-                                       if code is None:
-                                               send_signal(proc, signal.SIGKILL)
-                               code = proc.wait()         # Waits forever
-                               sys.stderr.write("%s: Command `%s` timed out\n" % (scriptname, command[0]))
-                       died_politely = True
-
-                       # The test suite has now run, and what happens next varies:
-                       # 1. The suite either completed fully without failures, or timed out: Just quit.
-                       # 2. The suite crashed (halted without completing):
-                       #   Remember any failures for later and rerun, using a blacklist of testcases we have completed.
-                       # 3. The suite completed, but there were failures reported:
-                       #   Rerun, using a whitelist of only reported-failed testcases.
-                       # 4. The suite crashed partway through a run with a whitelist:
-                       #   Rerun, using a whitelist consisting of the previous whitelist minus successful testcases.
-
-                       crashed_at = attemptFirstLine(env[CURRENT_TEST_KEY])
-                       failed_tests = attemptLines(env[FAILED_TEST_KEY])
-                       ran_tests = attemptLines(env[RAN_TEST_KEY])
-                       bailout = False
-
-                       if crashed_at or failed_tests or ran_tests: # Test suite follows the babysitter protocol
-                               log_value(SUPPORT_JSON, True)
-
-                       if not crashed_at and not ever_completed:  # The resume_after whitelist is only
-                               resume_after = []                      # used before the first noncrashing run
-                               ever_completed = True
-
-                       if timed_out:       # Currently no retries after timeout
-                               bailout = True
-                               code = 124      # See GNU timeout manpage
-
-                       if code or crashed_at: # Process failures
-                               # Handle crash failures
-                               if crashed_at and not timed_out:
-                                       log_test(crashed_at, TEST_CRASH_FAILURES, add=1)
-                                       if not crash_resuming:
-                                               bailout = True
-
-                                       if failure_may_retry(crashed_at):
-                                               if ever_completed:           # Rerun with whitelist next time
-                                                       for test in retry_these: # Prepopulate with last whitelist minus run testcases
-                                                               if test == crashed_at or test not in ran_tests: # (plus crashed testcase)
-                                                                       retry_next.append(test)
-                                               else:                            # Rerun with blacklist next time
-                                                       for test in ran_tests:       # Add testcases we just ran to blacklist
-                                                               if test != crashed_at:   # (except for the crashed testcase)
-                                                                       resume_after.append(test)
-                                       else:
-                                               bailout = True
-
-                               # Handle reported failures
-                               for test in failed_tests:
-                                       log_test(test, TEST_FAILURES, add=1)
-                                       if failure_may_retry(test):
-                                               retry_next.append(test)
-                                       else:
-                                               bailout = True
-
-                               # Report human-readable failures for stdout log.
-                               message = "%s:" % (scriptname)
-                               if timed_out:
-                                       message += " Saw timeout in test case %s (never allowed)." % (crashed_at)
-                               elif crashed_at:
-                                       message += " Saw crash in test case %s." % (failure_annotate(crashed_at))
-                               if failed_tests:
-                                       message += " Saw test failure in test case%s %s." % (pluralize(failed_tests), "; ".join(map(failure_annotate, failed_tests)))
-                               if not (timed_out or crashed_at or failed_tests):
-                                       message += " Test suite terminated with code %d, " % (code)
-                                       if log[SUPPORT_JSON]:
-                                               message += "but failure did not occur during a test case. Halting."
-                                       else:
-                                               message += "and suite cannot report test case data. Halting."
-                               elif bailout:
-                                       message += " Will halt testing."
-                               print(message)
-
-                       if bailout or not (resume_after or retry_next): # If not retrying
-                               return code
-
-                       # If we got here, a retry is occurring
-                       retry_these = retry_next
-
-                       # Report human-readable retry notice for stdout log.
-                       message = "%s: Will rerun test suite" % (scriptname)
-                       if log[COUNT_JSON] > 1:
-                               message += " (iteration #%d)" % (log[COUNT_JSON])
-                       if resume_after:
-                               message += ", resuming at crashed testcase %s." % (crashed_at)
-                       else:
-                               message += ", running previously failed testcase%s: %s." % (pluralize(retry_these), "; ".join(retry_these))
-                       print(message)
-       finally:
-               # Emergency: Ensure command does not outlive this script
-               if proc is not None and not died_politely:
-                       send_signal(proc, signal.SIGKILL)
-
-               # Write out logs
-               log_value(FINAL_CODE_JSON, "EXCEPTION" if code is None else code)
-               if logging:
-                       with open(logfile, "a") as f:
-                               f.write(json.dumps(log) + os.linesep)
-
-sys.exit( run() )
diff --git a/scripts/ci/babysitter b/scripts/ci/babysitter
new file mode 100755 (executable)
index 0000000..f8b5a6c
--- /dev/null
@@ -0,0 +1,409 @@
+#!/usr/bin/env python
+
+# Mimics GNU timeout, but does some fancy tracking based on custom features in mono nunit24.
+
+import argparse
+import subprocess
+import re
+import signal
+import time
+import sys
+import os.path
+import copy
+import tempfile
+import calendar
+import json
+
+### Constants
+
+# Here is how the communication with nunit works. It has to work with two constraints:
+# - We don't invoke nunit directly. We invoke some Makefile which invokes some other Makefile
+#   and at some point down the line someone calls nunit.
+# - nunit has to be able to report back to us even if (especially if) it terminates improperly.
+# To deal with all this, communication babysitter->nunit is done by environment variables,
+# and communication nunit->babysitter is done by leaving behind files in known locations.
+
+# Filenames
+
+CURRENT_TEST_FILE = "babysitter_report_current_test_file.txt"
+RAN_TEST_FILE     = "babysitter_report_ran_test_file.txt"
+FAILED_TEST_FILE  = "babysitter_report_failed_test_file.txt"
+LOGGING_FILE      = "babysitter_report.json_lines"
+
+# Environment keys
+
+# Keys used for Babysitter<->Nunit IPC
+CURRENT_TEST_KEY  = 'MONO_BABYSITTER_NUNIT_CURRENT_TEST_FILE' # Tell nunit where to leave files
+RAN_TEST_KEY      = 'MONO_BABYSITTER_NUNIT_RAN_TEST_FILE'
+FAILED_TEST_KEY   = 'MONO_BABYSITTER_NUNIT_FAILED_TEST_FILE'
+RUN_KEY           = 'MONO_BABYSITTER_NUNIT_RUN_TEST' # Semicolon-separated list of test names
+RUN_MODE_KEY      = 'MONO_BABYSITTER_NUNIT_RUN_MODE' # Equal to either RUN or AFTER
+
+# Keys used for script configuration (see --help text)
+LOG_FILE_KEY      = 'MONO_BABYSITTER_LOG_FILE'       # Path
+RETRY_KEY         = 'MONO_BABYSITTER_RETRY'          # Equal to an integer
+VERBOSE_KEY       = 'MONO_BABYSITTER_VERBOSE'        # "Undocumented"-- used for debugging babysitter
+
+# JSON keys
+
+DATE_JSON       = 'date'          # POSIX timestamp of test suite run
+INVOKE_JSON     = 'invocation'
+COUNT_JSON      = 'iteration'        # How many times was command executed?
+LIMIT_JSON      = 'failure_max'
+SUPPORT_JSON    = 'babysitter_protocol' # Was the test suite running with a babysitter-aware nunit?
+FINAL_CODE_JSON = 'final_code'
+TESTS_JSON      = 'tests'         # Holds dictionary of (test case name)->(dict with TEST_ keys below)
+TEST_FAILURES         = 'normal_failures'
+TEST_CRASH_FAILURES   = 'crash_failures'
+TEST_TIMEOUT_FAILURES = 'timeout_failures'
+
+### Interpret arguments
+
+scriptname = sys.argv[0]
+
+# This is very silly: This program needs to switch from argparse to manual parsing
+# after the second positional argument, but argparse doesn't let you do this.
+# I work around this with a custom subclass which can selectively swallow errors:
+class Hesitate(Exception):
+       pass
+class HesitantParser(argparse.ArgumentParser):
+       def __init__(s, *args, **kwargs):
+               s.hesitating = True  # Errors will be swallowed until this is set false
+               argparse.ArgumentParser.__init__(s, *args, **kwargs)
+       def error(s, *args, **kwargs):
+               if s.hesitating:
+                       raise Hesitate() # Bail out before errors are printed.
+               argparse.ArgumentParser.error(s, *args, **kwargs)
+
+# Define args
+argparser = HesitantParser(description="""\
+Run a test suite with a timeout.\n
+Durations are floating point numbers followed by an optional unit:\n
+'s' for seconds (the default)
+'m' for minutes
+'h' for hours
+'d' for days\n
+supported environment variables:
+  %s: File to write logs to (as line-delimited JSON)
+  %s: If set to a number, failed test cases will be rerun this many times (NUnit test suites only)""" %
+               (LOG_FILE_KEY, RETRY_KEY),
+       formatter_class=argparse.RawTextHelpFormatter)
+argparser.add_argument('-s', '--signal', dest='signal', metavar='signal', default='TERM',
+       help="Send this signal to the command on timeout, instead of TERM.")
+argparser.add_argument('-k', '--kill-after-duration', dest='kill_after', metavar='duration',
+       help="If process continues running after signal, send KILL after this duration.")
+argparser.add_argument('duration',
+       help="Time to run before sending signal.")
+argparser.add_argument('command', nargs="+", help="Command+args to run.")
+
+# Repeatedly parse the given args until we find the shortest prefix for which parsing succeeds.
+argc = len(sys.argv)
+extra_args = []
+for limit in range(1,argc+1):
+       try:
+               if limit == argc: # On the final pass, parse for real
+                       argparser.hesitating = False
+               args = argparser.parse_args(sys.argv[1:limit])
+               # If we're still here, parse_args succeeded.
+               # The final parsed arg is the command; remaining argv items are its args.
+               extra_args = sys.argv[limit:]
+               break
+       except Hesitate: # Before the final pass, if parse_args fails, skip
+               pass
+
+argparser.hesitating = False # Just act like a normal argparser from here
+
+durationre = re.compile(r'(\d+)([smhd]?)')
+def parse_duration(duration): # Accept units
+       match = durationre.match(duration)
+       if not match:
+               argparser.error("Could not understand duration %s" % duration)
+       time, units = match.group(1), match.group(2)
+       time = int(time)
+       if units == 'm':
+               time *= 60
+       elif units == 'h':
+               time *= 60*60
+       elif units == 'd':
+               time *= 60*60*24
+       return time
+
+def parse_signal(sig):        # Accept names
+       if sig.isdigit():
+               return int(sig)
+       for k,v in signal.__dict__.iteritems():
+               if k == ("SIG%s" % sig):
+                       return v
+       argparser.error("Could not understand signal name %s" % sig)
+
+# Final interpretation of arguments
+duration = parse_duration(args.duration)
+kill_after = parse_duration(args.kill_after) if args.kill_after is not None else None
+timeout_signal = parse_signal(args.signal)
+command = args.command + extra_args
+
+# Process environment
+global_env = copy.deepcopy( os.environ )
+
+verbose = VERBOSE_KEY in global_env
+logging = LOG_FILE_KEY in global_env
+logfile = global_env[LOG_FILE_KEY] if logging else None
+crash_resuming = True # TODO: Consider exposing this option, or adding a retry_on_crash option.
+failmax = int(global_env[RETRY_KEY]) if RETRY_KEY in global_env else 0
+babysitting = True # If false, babysitter becomes a timeout clone with no env manipulation or anything.
+if babysitting:
+       babysitter_dir = tempfile.mkdtemp()
+       global_env[CURRENT_TEST_KEY] = os.path.join(babysitter_dir, CURRENT_TEST_FILE)
+       global_env[RAN_TEST_KEY]     = os.path.join(babysitter_dir, RAN_TEST_FILE)
+       global_env[FAILED_TEST_KEY]  = os.path.join(babysitter_dir, FAILED_TEST_FILE)
+
+have_unix_process_groups = 'killpg' in os.__dict__
+have_windows_process_groups = 'CREATE_NEW_PROCESS_GROUP' in subprocess.__dict__
+
+### Timeout implementation
+
+def wait(proc, duration):
+       # TODO: If we detect Python 3.3, Popen objects have a wait(timeout) method we can use
+       start = time.time()
+       while True:
+               code = proc.poll()
+               if code is not None:
+                       return code
+               if time.time()-start > duration:
+                       return None
+               time.sleep(0.05)
+
+# Popen and send_signal can't be called in their basic forms because we want to
+# send signals to all children, not just to the immediately spawned process.
+# Unfortunately the way to do this varies by operating system.
+def popen(*args, **kwargs):
+       if have_unix_process_groups: # Call function on spawn to become process group leader
+               kwargs['preexec_fn'] = os.setsid
+       elif have_windows_process_groups: # Set magic flag for Windows process groups
+               kwargs['creationflags'] = subprocess.CREATE_NEW_PROCESS_GROUP
+       return subprocess.Popen(*args, **kwargs)
+
+def send_signal(proc, sig):
+       if have_unix_process_groups: # UNIX
+               # For compatibility with GNU timeout, pre-send the signal to just the monitored process
+               os.kill(proc.pid, sig)
+               # Send signal to entire group
+               os.killpg(proc.pid, sig)
+               # For compatibility with GNU Timeout, send a SIGCONT after the signal
+               # (so delivery has a chance to occur even for stopped processes)
+               if sig != signal.SIGKILL and sig != signal.SIGCONT:
+                       os.kill(proc.pid, signal.SIGCONT)
+       elif have_windows_process_groups: # Windows with Python 2.7 or better
+               os.kill(proc.pid, sig) # Becuase CREATE_NEW_PROCESS_GROUP, will go to entire group
+       else: # Windows with Python 2.6-- CREATE_NEW_PROCESS_GROUP not supported
+               proc.send_signal(sig) # No way to contact group, just kill process
+
+### Utility functions
+
+def attemptDelete(path):
+       try:
+               os.remove(path)
+       except OSError:
+               pass
+
+def attemptLines(path):
+       try:
+               with open(path) as f:
+                       return map(lambda s: s.strip('\r\n'), f.readlines())
+       except (OSError, IOError):
+               return []
+
+def attemptFirstLine(path):
+       lines = attemptLines(path)
+       if lines:
+               return lines[0]
+       return None
+
+def posixtime(): # Amazingly, time.time() does not guarantee an epoch in the docs. However this does:
+       return calendar.timegm(time.gmtime())
+
+failcount = {}
+def failure_may_retry(test):
+       if test not in failcount:
+               failcount[test] = 0
+       failcount[test] += 1
+       return failcount[test] < failmax
+
+def verbose_print(arg):
+       if (verbose):
+               print(arg)
+
+def failure_annotate(test):
+       return "%s (failure #%d of %d allowed)" % (test, failcount[test], failmax)
+
+def pluralize(lst):
+       return "s" if len(lst) > 1 else ""
+
+### Run command
+
+def run(): # Returns exit code
+       resume_after = []
+       retry_these = []
+       ever_completed = False
+       died_politely = False
+       proc = None
+       code = None
+
+       # Set up logging
+       log = {DATE_JSON: posixtime(), COUNT_JSON:0, LIMIT_JSON:failmax, SUPPORT_JSON:False,
+               INVOKE_JSON: " ".join(command)}
+
+       def log_value(key, set=None, add=None, target=log): # Call to add toplevel value to log
+               if add is not None:
+                       if key not in target:
+                               target[key] = 0
+                       target[key] += add
+               else:
+                       target[key] = set
+
+       def log_test(testname, key, set=None, add=None):   # Call to add test-case-level value to log
+               if TESTS_JSON not in log:
+                       log[TESTS_JSON] = {}
+               if testname not in log[TESTS_JSON]:
+                       log[TESTS_JSON][testname] = {}
+               log_value(key, set=set, add=add, target=log[TESTS_JSON][testname])
+
+       # Ready to run tests
+       try:
+               while True:
+                       env = copy.copy(global_env)
+                       if ever_completed:
+                               retry_next = []
+                       else: # Persist reported failures list until first non-crash run
+                               retry_next = retry_these
+
+                       log_value(COUNT_JSON, add=1)
+
+                       # Prepare environment/filesystem
+                       if babysitting:
+                               for key in [CURRENT_TEST_KEY, RAN_TEST_KEY, FAILED_TEST_KEY]:
+                                       attemptDelete(env[key])
+                               if resume_after:
+                                       env[RUN_KEY] = ";".join(resume_after)
+                                       env[RUN_MODE_KEY] = "EXCLUDE"
+                               elif retry_these:
+                                       env[RUN_KEY] = ";".join(retry_these)
+                                       env[RUN_MODE_KEY] = "RUN"
+
+                       # Run test suite
+                       try:
+                               proc = popen(command, env=env)
+                       except OSError:
+                               died_politely = True
+                               sys.stderr.write("%s: Could not execute command `%s`\n" % (scriptname, command[0]))
+                               sys.exit(127)
+
+                       code = wait(proc, duration)
+                       timed_out = code is None
+                       if timed_out:                  # Initial timeout
+                               send_signal(proc, timeout_signal)
+                               if kill_after is not None: # Kill-after timeout
+                                       code = wait(proc, kill_after)
+                                       if code is None:
+                                               send_signal(proc, signal.SIGKILL)
+                               code = proc.wait()         # Waits forever
+                               sys.stderr.write("%s: Command `%s` timed out\n" % (scriptname, command[0]))
+                       died_politely = True
+
+                       # The test suite has now run, and what happens next varies:
+                       # 1. The suite either completed fully without failures, or timed out: Just quit.
+                       # 2. The suite crashed (halted without completing):
+                       #   Remember any failures for later and rerun, using a blacklist of testcases we have completed.
+                       # 3. The suite completed, but there were failures reported:
+                       #   Rerun, using a whitelist of only reported-failed testcases.
+                       # 4. The suite crashed partway through a run with a whitelist:
+                       #   Rerun, using a whitelist consisting of the previous whitelist minus successful testcases.
+
+                       crashed_at = attemptFirstLine(env[CURRENT_TEST_KEY])
+                       failed_tests = attemptLines(env[FAILED_TEST_KEY])
+                       ran_tests = attemptLines(env[RAN_TEST_KEY])
+                       bailout = False
+
+                       if crashed_at or failed_tests or ran_tests: # Test suite follows the babysitter protocol
+                               log_value(SUPPORT_JSON, True)
+
+                       if not crashed_at and not ever_completed:  # The resume_after whitelist is only
+                               resume_after = []                      # used before the first noncrashing run
+                               ever_completed = True
+
+                       if timed_out:       # Currently no retries after timeout
+                               bailout = True
+                               code = 124      # See GNU timeout manpage
+
+                       if code or crashed_at: # Process failures
+                               # Handle crash failures
+                               if crashed_at and not timed_out:
+                                       log_test(crashed_at, TEST_CRASH_FAILURES, add=1)
+                                       if not crash_resuming:
+                                               bailout = True
+
+                                       if failure_may_retry(crashed_at):
+                                               if ever_completed:           # Rerun with whitelist next time
+                                                       for test in retry_these: # Prepopulate with last whitelist minus run testcases
+                                                               if test == crashed_at or test not in ran_tests: # (plus crashed testcase)
+                                                                       retry_next.append(test)
+                                               else:                            # Rerun with blacklist next time
+                                                       for test in ran_tests:       # Add testcases we just ran to blacklist
+                                                               if test != crashed_at:   # (except for the crashed testcase)
+                                                                       resume_after.append(test)
+                                       else:
+                                               bailout = True
+
+                               # Handle reported failures
+                               for test in failed_tests:
+                                       log_test(test, TEST_FAILURES, add=1)
+                                       if failure_may_retry(test):
+                                               retry_next.append(test)
+                                       else:
+                                               bailout = True
+
+                               # Report human-readable failures for stdout log.
+                               message = "%s:" % (scriptname)
+                               if timed_out:
+                                       message += " Saw timeout in test case %s (never allowed)." % (crashed_at)
+                               elif crashed_at:
+                                       message += " Saw crash in test case %s." % (failure_annotate(crashed_at))
+                               if failed_tests:
+                                       message += " Saw test failure in test case%s %s." % (pluralize(failed_tests), "; ".join(map(failure_annotate, failed_tests)))
+                               if not (timed_out or crashed_at or failed_tests):
+                                       message += " Test suite terminated with code %d, " % (code)
+                                       if log[SUPPORT_JSON]:
+                                               message += "but failure did not occur during a test case. Halting."
+                                       else:
+                                               message += "and suite cannot report test case data. Halting."
+                               elif bailout:
+                                       message += " Will halt testing."
+                               print(message)
+
+                       if bailout or not (resume_after or retry_next): # If not retrying
+                               return code
+
+                       # If we got here, a retry is occurring
+                       retry_these = retry_next
+
+                       # Report human-readable retry notice for stdout log.
+                       message = "%s: Will rerun test suite" % (scriptname)
+                       if log[COUNT_JSON] > 1:
+                               message += " (iteration #%d)" % (log[COUNT_JSON])
+                       if resume_after:
+                               message += ", resuming at crashed testcase %s." % (crashed_at)
+                       else:
+                               message += ", running previously failed testcase%s: %s." % (pluralize(retry_these), "; ".join(retry_these))
+                       print(message)
+       finally:
+               # Emergency: Ensure command does not outlive this script
+               if proc is not None and not died_politely:
+                       send_signal(proc, signal.SIGKILL)
+
+               # Write out logs
+               log_value(FINAL_CODE_JSON, "EXCEPTION" if code is None else code)
+               if logging:
+                       with open(logfile, "a") as f:
+                               f.write(json.dumps(log) + os.linesep)
+
+sys.exit( run() )
diff --git a/scripts/ci/run-jenkins.sh b/scripts/ci/run-jenkins.sh
new file mode 100755 (executable)
index 0000000..2507bc9
--- /dev/null
@@ -0,0 +1,101 @@
+#!/bin/bash -e
+
+TESTCMD=`dirname "${BASH_SOURCE[0]}"`/run-step.sh
+
+export TEST_HARNESS_VERBOSE=1
+
+if [[ ${label} == 'osx-i386' ]]; then EXTRA_CONF_FLAGS="--with-libgdiplus=/Library/Frameworks/Mono.framework/Versions/Current/lib/libgdiplus.dylib --enable-nls=no --build=i386-apple-darwin11.2.0"; fi
+if [[ ${label} == 'osx-amd64' ]]; then EXTRA_CONF_FLAGS="--with-libgdiplus=/Library/Frameworks/Mono.framework/Versions/Current/lib/libgdiplus.dylib --enable-nls=no"; fi
+if [[ ${label} == 'w32' ]]; then PLATFORM=Win32; EXTRA_CONF_FLAGS="--host=i686-pc-mingw32"; export MONO_EXECUTABLE="`cygpath -u ${WORKSPACE}\\\msvc\\\Win32\\\bin\\\Release_SGen\\\mono-sgen.exe`";fi
+if [[ ${label} == 'w64' ]]; then PLATFORM=x64; EXTRA_CONF_FLAGS="--host=i686-pc-mingw32"; export MONO_EXECUTABLE="`cygpath -u ${WORKSPACE}\\\msvc\\\x64\\\bin\\\Release_SGen\\\mono-sgen.exe`"; fi
+
+${TESTCMD} --label=configure --timeout=60m --fatal ./autogen.sh --with-monodroid --with-monotouch --with-monotouch_watch --with-monotouch_tv --with-xammac --with-mobile_static $EXTRA_CONF_FLAGS
+if [[ ${label} == w* ]];
+    then
+    ${TESTCMD} --label=make-msvc --timeout=60m --fatal "/cygdrive/c/Program\ Files\ \(x86\)/MSBuild/12.0/Bin/MSBuild.exe" /p:Platform=${PLATFORM} /p:Configuration=Release msvc/mono.sln
+    ${TESTCMD} --label=make-msvc-sgen --timeout=60m --fatal "/cygdrive/c/Program\ Files\ \(x86\)/MSBuild/12.0/Bin/MSBuild.exe" /p:Platform=${PLATFORM} /p:Configuration=Release_SGen msvc/mono.sln
+fi
+${TESTCMD} --label=make --timeout=300m --fatal make -w V=1
+if [[ -n "${ghprbPullId}" ]] && [[ ${label} == w* ]];
+    then
+    exit 0
+    # we don't run the test suite on Windows PRs, we just ensure the build succeeds, so end here
+fi
+${TESTCMD} --label=mini --timeout=5m make -w -C mono/mini -k check
+${TESTCMD} --label=runtime --timeout=120m make -w -C mono/tests -k test-wrench V=1 CI=1
+${TESTCMD} --label=corlib --timeout=30m make -w -C mcs/class/corlib run-test
+${TESTCMD} --label=verify --timeout=15m make -w -C runtime mcs-compileall
+${TESTCMD} --label=profiler --timeout=30m make -w -C mono/profiler -k check
+${TESTCMD} --label=compiler --timeout=30m make -w -C mcs/tests run-test
+${TESTCMD} --label=compiler-errors --timeout=30m make -w -C mcs/errors run-test
+${TESTCMD} --label=System --timeout=10m make -w -C mcs/class/System run-test
+${TESTCMD} --label=System.XML --timeout=5m make -w -C mcs/class/System.XML run-test
+${TESTCMD} --label=Mono.Security --timeout=5m make -w -C mcs/class/Mono.Security run-test
+${TESTCMD} --label=System.Security --timeout=5m make -w -C mcs/class/System.Security run-test
+${TESTCMD} --label=System.Drawing --timeout=5m make -w -C mcs/class/System.Drawing run-test
+if [[ ${label} == osx-* ]]
+then ${TESTCMD} --label=Windows.Forms --skip
+else ${TESTCMD} --label=Windows.Forms --timeout=5m make -w -C mcs/class/System.Windows.Forms run-test
+fi
+${TESTCMD} --label=System.Data --timeout=5m make -w -C mcs/class/System.Data run-test
+${TESTCMD} --label=System.Data.OracleClient --timeout=5m make -w -C mcs/class/System.Data.OracleClient run-test
+${TESTCMD} --label=System.Design --timeout=5m make -w -C mcs/class/System.Design run-test
+${TESTCMD} --label=Mono.Posix --timeout=5m make -w -C mcs/class/Mono.Posix run-test
+${TESTCMD} --label=System.Web --timeout=30m make -w -C mcs/class/System.Web run-test
+${TESTCMD} --label=System.Web.Services --timeout=5m make -w -C mcs/class/System.Web.Services run-test
+${TESTCMD} --label=System.Runtime.SFS --timeout=5m make -w -C mcs/class/System.Runtime.Serialization.Formatters.Soap run-test
+${TESTCMD} --label=System.Runtime.Remoting --timeout=5m make -w -C mcs/class/System.Runtime.Remoting run-test
+${TESTCMD} --label=Cscompmgd --timeout=5m make -w -C mcs/class/Cscompmgd run-test
+${TESTCMD} --label=Commons.Xml.Relaxng --timeout=5m make -w -C mcs/class/Commons.Xml.Relaxng run-test
+${TESTCMD} --label=System.ServiceProcess --timeout=5m make -w -C mcs/class/System.ServiceProcess run-test
+${TESTCMD} --label=I18N.CJK --timeout=5m make -w -C mcs/class/I18N/CJK run-test
+${TESTCMD} --label=I18N.West --timeout=5m make -w -C mcs/class/I18N/West run-test
+${TESTCMD} --label=I18N.MidEast --timeout=5m make -w -C mcs/class/I18N/MidEast run-test
+${TESTCMD} --label=System.DirectoryServices --timeout=5m make -w -C mcs/class/System.DirectoryServices run-test
+${TESTCMD} --label=Microsoft.Build.Engine --timeout=5m make -w -C mcs/class/Microsoft.Build.Engine run-test
+${TESTCMD} --label=Microsoft.Build.Framework --timeout=5m make -w -C mcs/class/Microsoft.Build.Framework run-test
+${TESTCMD} --label=Microsoft.Build.Tasks --timeout=5m make -w -C mcs/class/Microsoft.Build.Tasks run-test
+${TESTCMD} --label=Microsoft.Build.Utilities --timeout=5m make -w -C mcs/class/Microsoft.Build.Utilities run-test
+${TESTCMD} --label=Mono.C5 --timeout=5m make -w -C mcs/class/Mono.C5 run-test
+${TESTCMD} --label=System.Configuration --timeout=5m make -w -C mcs/class/System.Configuration run-test
+${TESTCMD} --label=System.Transactions --timeout=5m make -w -C mcs/class/System.Transactions run-test
+${TESTCMD} --label=System.Web.Extensions --timeout=5m make -w -C mcs/class/System.Web.Extensions run-test
+${TESTCMD} --label=System.Core --timeout=15m make -w -C mcs/class/System.Core run-test
+${TESTCMD} --label=symbolicate --timeout=60m make -w -C mcs/tools/mono-symbolicate check
+${TESTCMD} --label=System.Xml.Linq --timeout=5m make -w -C mcs/class/System.Xml.Linq run-test
+${TESTCMD} --label=System.Data.DSE --timeout=5m make -w -C mcs/class/System.Data.DataSetExtensions run-test
+${TESTCMD} --label=System.Web.Abstractions --timeout=5m make -w -C mcs/class/System.Web.Abstractions run-test
+${TESTCMD} --label=System.Web.Routing --timeout=5m make -w -C mcs/class/System.Web.Routing run-test
+${TESTCMD} --label=System.Runtime.Serialization --timeout=5m make -w -C mcs/class/System.Runtime.Serialization run-test
+${TESTCMD} --label=System.IdentityModel --timeout=5m make -w -C mcs/class/System.IdentityModel run-test
+${TESTCMD} --label=System.ServiceModel --timeout=15m make -w -C mcs/class/System.ServiceModel run-test
+${TESTCMD} --label=System.ServiceModel.Web --timeout=5m make -w -C mcs/class/System.ServiceModel.Web run-test
+${TESTCMD} --label=System.Web.Extensions-standalone --timeout=5m make -w -C mcs/class/System.Web.Extensions run-standalone-test
+${TESTCMD} --label=System.ComponentModel.DataAnnotations --timeout=5m make -w -C mcs/class/System.ComponentModel.DataAnnotations run-test
+${TESTCMD} --label=Mono.CodeContracts --timeout=5m make -w -C mcs/class/Mono.CodeContracts run-test
+${TESTCMD} --label=System.Runtime.Caching --timeout=5m make -w -C mcs/class/System.Runtime.Caching run-test
+${TESTCMD} --label=System.Data.Services --timeout=5m make -w -C mcs/class/System.Data.Services run-test
+${TESTCMD} --label=System.Web.DynamicData --timeout=5m make -w -C mcs/class/System.Web.DynamicData run-test
+${TESTCMD} --label=Mono.CSharp --timeout=5m make -w -C mcs/class/Mono.CSharp run-test
+${TESTCMD} --label=WindowsBase --timeout=5m make -w -C mcs/class/WindowsBase run-test
+${TESTCMD} --label=System.Numerics --timeout=5m make -w -C mcs/class/System.Numerics run-test
+${TESTCMD} --label=System.Runtime.DurableInstancing --timeout=5m make -w -C mcs/class/System.Runtime.DurableInstancing run-test
+${TESTCMD} --label=System.ServiceModel.Discovery --timeout=5m make -w -C mcs/class/System.ServiceModel.Discovery run-test
+${TESTCMD} --label=System.Xaml --timeout=5m make -w -C mcs/class/System.Xaml run-test
+${TESTCMD} --label=System.Net.Http --timeout=5m make -w -C mcs/class/System.Net.Http run-test
+${TESTCMD} --label=System.Json --timeout=5m make -w -C mcs/class/System.Json run-test
+${TESTCMD} --label=System.Threading.Tasks.Dataflow --timeout=5m make -w -C mcs/class/System.Threading.Tasks.Dataflow run-test
+${TESTCMD} --label=Mono.Debugger.Soft --timeout=5m make -w -C mcs/class/Mono.Debugger.Soft run-test
+${TESTCMD} --label=Microsoft.Build --timeout=5m make -w -C mcs/class/Microsoft.Build run-test
+${TESTCMD} --label=monodoc --timeout=10m make -w -C mcs/tools/mdoc run-test
+${TESTCMD} --label=Microsoft.Build-12 --timeout=10m make -w -C mcs/class/Microsoft.Build run-test PROFILE=xbuild_12
+${TESTCMD} --label=Microsoft.Build.Engine-12 --timeout=60m make -w -C mcs/class/Microsoft.Build.Engine run-test PROFILE=xbuild_12
+${TESTCMD} --label=Microsoft.Build.Framework-12 --timeout=60m make -w -C mcs/class/Microsoft.Build.Framework run-test PROFILE=xbuild_12
+${TESTCMD} --label=Microsoft.Build.Tasks-12 --timeout=60m make -w -C mcs/class/Microsoft.Build.Tasks run-test PROFILE=xbuild_12
+${TESTCMD} --label=Microsoft.Build.Utilities-12 --timeout=60m make -w -C mcs/class/Microsoft.Build.Utilities run-test PROFILE=xbuild_12
+${TESTCMD} --label=Microsoft.Build-14 --timeout=60m make -w -C mcs/class/Microsoft.Build run-test PROFILE=xbuild_14
+${TESTCMD} --label=Microsoft.Build.Engine-14 --timeout=60m make -w -C mcs/class/Microsoft.Build.Engine run-test PROFILE=xbuild_14
+${TESTCMD} --label=Microsoft.Build.Framework-14 --timeout=60m make -w -C mcs/class/Microsoft.Build.Framework run-test PROFILE=xbuild_14
+${TESTCMD} --label=Microsoft.Build.Tasks-14 --timeout=60m make -w -C mcs/class/Microsoft.Build.Tasks run-test PROFILE=xbuild_14
+${TESTCMD} --label=Microsoft.Build.Utilities-14 --timeout=60m make -w -C mcs/class/Microsoft.Build.Utilities run-test PROFILE=xbuild_14
+rm -fr /tmp/jenkins-temp-aspnet*
diff --git a/scripts/ci/run-step.sh b/scripts/ci/run-step.sh
new file mode 100755 (executable)
index 0000000..4ea5fbc
--- /dev/null
@@ -0,0 +1,60 @@
+#!/bin/bash -e
+TIMEOUTCMD=`dirname "${BASH_SOURCE[0]}"`/babysitter
+if ! ${TIMEOUTCMD} -h >/dev/null 2>&1; then
+    TIMEOUTCMD=timeout  # fall back to timeout if babysitter doesn't work (e.g. python not installed or wrong version)
+fi
+
+export MONO_BABYSITTER_LOG_FILE=babysitter_report.json_lines
+
+helptext ()
+{
+    echo "run-step.sh {--label=LABEL} {--skip|--timeout=TIMEOUT [--fatal]} command to run with arguments"
+}
+
+for i in "$@"
+do
+case $i in
+    --help)
+    helptext
+    exit 0
+    ;;
+    --label=*)
+    LABEL="${i#*=}"
+    shift # past argument=value
+    ;;
+    --timeout=*)
+    TIMEOUT="${i#*=}"
+    shift # past argument=value
+    ;;
+    --fatal)
+    FATAL="true"
+    shift # past argument
+    ;;
+    --skip)
+    SKIP="true"
+    shift # past argument
+    ;;
+    *)
+            # unknown option, assume just part of cmdline
+    ;;
+esac
+done
+if [ -n "${SKIP}" ] && [ -z "${LABEL}" ]
+    then helptext
+    exit 1
+fi
+if [ -n "${SKIP}" ]
+    then echo -e "*** start: ${LABEL}\n*** end(0): ${LABEL}: \e[45mSkipped\e[0m"
+    exit 0
+fi
+if [ -z "${LABEL}" ] || [ -z "${TIMEOUT}" ]
+    then helptext
+    exit 1
+fi
+STARTTIME=`date +%s`
+echo "*** start: ${LABEL}"
+if [ -n "${FATAL}" ]; then
+    ${TIMEOUTCMD} --signal=ABRT --kill-after=60s ${TIMEOUT} "$@" && echo -e "*** end($(echo $(date +%s) - ${STARTTIME} | bc)): ${LABEL}: \e[42mPassed\e[0m" || (echo -e "*** end($(echo $(date +%s) - ${STARTTIME} | bc)): ${LABEL}: \e[41mFailed\e[0m" && exit 1)
+else
+    ${TIMEOUTCMD} --signal=ABRT --kill-after=60s ${TIMEOUT} "$@" && echo -e "*** end($(echo $(date +%s) - ${STARTTIME} | bc)): ${LABEL}: \e[42mPassed\e[0m" || echo -e "*** end($(echo $(date +%s) - ${STARTTIME} | bc)): ${LABEL}: \e[43mUnstable\e[0m"
+fi