Support SerializeObjectState for System.Exception (bug #39824)
authorAndi McClure <andi.mcclure@xamarin.com>
Wed, 13 Apr 2016 22:36:08 +0000 (18:36 -0400)
committerAndi McClure <andi.mcclure@xamarin.com>
Wed, 13 Apr 2016 22:36:08 +0000 (18:36 -0400)
commitb04a3a355f6bcf51b8af3d18588cde06a3caafe3
treee8560ce53f8c5f10265d2a0b975149e3c8920ab3
parent8ed1ada0142c3b8d0d3452eb5939529a133f2696
Support SerializeObjectState for System.Exception (bug #39824)

Per current .NET, exception serialization may be implemented using the
SerializeObjectState event. Use of this approach is mandatory for
certain classes, such as HttpRequestException subclasses. Mono does
not support it. The solution is to switch out our System.Exception
implementation for the referencesource one.

To accommodate this, classes that access System.Exception internal
fields directly must switch to the new field names; a new support
method is added to System.Environment; the "security level" methods
and icall are added to MonoCMethods; and the field order in
_MonoException must be adjusted. A new test is also added in the
System.Runtime.Serialization assembly.
mcs/class/System.Runtime.Serialization/System.Runtime.Serialization_test.dll.sources
mcs/class/System.Runtime.Serialization/Test/System.Runtime.Serialization/Exceptions.cs [new file with mode: 0644]
mcs/class/corlib/System.IO/Path.cs
mcs/class/corlib/System.Reflection/MonoMethod.cs
mcs/class/corlib/System.Runtime.InteropServices/Marshal.cs
mcs/class/corlib/System/Environment.cs
mcs/class/corlib/System/Exception.cs [deleted file]
mcs/class/corlib/corlib.dll.sources
mono/metadata/icall-def.h
mono/metadata/object-internals.h