Imported Upstream version 6.6.0.89

Former-commit-id: b39a328747c2f3414dc52e009fb6f0aa80ca2492
This commit is contained in:
Xamarin Public Jenkins (auto-signing)
2019-09-24 08:53:40 +00:00
parent cf815e07e0
commit 95fdb59ea6
2556 changed files with 138145 additions and 47453 deletions

View File

@@ -24,6 +24,7 @@ xammac_net_4_5_SUBDIRS := build class
xbuild_12_SUBDIRS := build class tools/xbuild
xbuild_14_SUBDIRS := build class tools/xbuild
winaot_SUBDIRS := build class
testing_winaot_interp_SUBDIRS := build class
orbis_SUBDIRS := build class
unreal_SUBDIRS := build class
wasm_SUBDIRS := build class
@@ -85,6 +86,7 @@ $(_boot_:%=profile-do--testing_aot_full_interp--%): profile-do--testing_a
$(_boot_:%=profile-do--testing_aot_hybrid--%): profile-do--testing_aot_hybrid--%: profile-do--build--%
$(_boot_:%=profile-do--testing_aot_full--%): profile-do--testing_aot_full--%: profile-do--build--%
$(_boot_:%=profile-do--winaot--%): profile-do--winaot--%: profile-do--build--%
$(_boot_:%=profile-do--testing_winaot_interp--%): profile-do--testing_winaot_interp--%: profile-do--build--%
$(_boot_:%=profile-do--orbis--%): profile-do--orbis--%: profile-do--build--%
$(_boot_:%=profile-do--unreal--%): profile-do--unreal--%: profile-do--build--%
$(_boot_:%=profile-do--wasm--%): profile-do--wasm--%: profile-do--build--%

View File

@@ -49,6 +49,7 @@ DISTFILES = \
library.make \
rules.make \
tests.make \
start-compiler-server.sh \
$(COMMON_SRCS:%=common/%) \
$(PLATFORMS:%=platforms/%.make) $(PROFILES:%=profiles/%.make)

View File

@@ -30,7 +30,7 @@
static partial class Consts
{
public const string MonoCorlibVersion = "62731146-81CF-4D61-826D-9A8DDED14432";
public const string MonoCorlibVersion = "2cfaeda3-94a9-44e5-8fcb-51979a3398c9";
}
#if !NETCORE
@@ -41,7 +41,7 @@ static partial class Consts
// Use these assembly version constants to make code more maintainable.
//
public const string MonoVersion = "6.4.0.199";
public const string MonoVersion = "6.6.0.89";
public const string MonoCompany = "Mono development team";
public const string MonoProduct = "Mono Common Language Infrastructure";
public const string MonoCopyright = "(c) Various Mono authors";

View File

@@ -41,9 +41,9 @@ class X
Version min_mono_version;
#if __MonoCS__
min_mono_version = new Version (6, 2);
min_mono_version = new Version (6, 5);
#else
min_mono_version = new Version (6, 2);
min_mono_version = new Version (6, 5);
#endif
if (version < min_mono_version)

View File

@@ -45,7 +45,7 @@ USE_MCS_FLAGS = $(COMPILER_SERVER_ARGS) /codepage:$(CODEPAGE) /nologo /noconfig
USE_MBAS_FLAGS = $(COMPILER_SERVER_ARGS) /codepage:$(CODEPAGE) $(LOCAL_MBAS_FLAGS) $(PLATFORM_MBAS_FLAGS) $(PROFILE_MBAS_FLAGS) $(MBAS_FLAGS)
USE_CFLAGS = $(LOCAL_CFLAGS) $(CFLAGS) $(CPPFLAGS)
CSCOMPILE = $(Q_MCS) $(MCS) $(USE_MCS_FLAGS)
CSC_RUNTIME_FLAGS = --aot-path=$(abspath $(topdir)/class/lib/$(BUILD_TOOLS_PROFILE)) --gc-params=nursery-size=64m
CSC_RUNTIME_FLAGS = --aot-path=$(abspath $(topdir)/class/lib/$(BUILD_TOOLS_PROFILE)) --gc-params=nursery-size=64m --clr-memory-model
BASCOMPILE = $(MBAS) $(USE_MBAS_FLAGS)
CCOMPILE = $(CC) $(USE_CFLAGS)
BOOT_COMPILE = $(Q_MCS) $(BOOTSTRAP_MCS) $(USE_MCS_FLAGS)

View File

@@ -0,0 +1,25 @@
#!/usr/bin/env bash
# usage: start-compiler-server.sh <working directory> <log path> <pipename>
# ensure that VBCS_RUNTIME and VBCS_LOCATION environment variables are set.
set -u
set -e
if [ -s "$VBCS_LOCATION" ]; then
CMD="RoslynCommandLineLogFile=$2 $VBCS_RUNTIME --clr-memory-model --gc-params=nursery-size=64m \"$VBCS_LOCATION\" -pipename:$3 &"
echo "Log location set to $2"
touch "$2"
echo "cd $1; bash -c \"$CMD\""
cd "$1"
bash -c "$CMD"
RESULT=$?
if [ $RESULT -eq 0 ]; then
echo Compiler server started.
else
echo Failed to start compiler server.
fi;
else
echo No compiler server found at path "$VBCS_LOCATION". Ensure that VBCS_LOCATION is set in config.make or passed as a parameter to make.
echo Use ENABLE_COMPILER_SERVER=0 to disable the use of the compiler server and continue to build.
exit 1
fi;

View File

@@ -15,20 +15,20 @@ SIGN_FLAGS = /delaysign /nowarn:1616,1699,618
LIB_REFS = System System.Xml System.Xml.Linq System.Core System.Numerics System.Net.Http \
System.IO.Compression System.ComponentModel.Composition System.IO.Compression.FileSystem
LIB_MCS_FLAGS = $(SIGN_FLAGS) $(EXTRA_LIB_MCS_FLAGS)
LIB_MCS_FLAGS = $(SIGN_FLAGS)
ifneq ($(PROFILE),build)
ifeq ($(PROFILE),build)
# for the build profile we include stubs for these types directly in netstandard.dll
LIB_MCS_FLAGS += -d:SYSTEM_WEB_IMPLEMENTATION
else ifeq ($(PROFILE),wasm)
LIB_MCS_FLAGS += -d:SYSTEM_WEB_IMPLEMENTATION -unsafe
LIB_REFS += System.Transactions System.Runtime.Serialization System.Data
ifeq ($(PROFILE),xammac_net_4_5)
LIB_REFS += System.Web.Services
else ifeq ($(PROFILE),xammac_net_4_5)
LIB_REFS += System.Web.Services System.Transactions System.Runtime.Serialization System.Data
else ifeq (2.1, $(FRAMEWORK_VERSION))
LIB_REFS += System.Web.Services
LIB_REFS += System.Web.Services System.Transactions System.Runtime.Serialization System.Data
else
LIB_REFS += System.Web
endif
LIB_REFS += System.Web System.Transactions System.Runtime.Serialization System.Data
endif
ifneq (,$(filter build net_4_x, $(PROFILE)))

View File

@@ -1 +1 @@
8342a6a8454aecca51da2612b8d0ab24295206bd
319613988894e958c40cdcd218190a7ad2d6b27d

View File

@@ -0,0 +1,4 @@
#include netstandard.dll.sources
../../../../external/corefx/src/System.Web.HttpUtility/src/System/Web/HttpUtility.cs
../../../../external/corefx/src/System.Web.HttpUtility/src/System/Web/Util/*.cs

View File

@@ -69,6 +69,9 @@ monotouch_tv_PARALLEL_SUBDIRS = $(monotouch_PARALLEL_SUBDIRS)
winaot_SUBDIRS = $(common_DEPS_SUBDIRS) System.Drawing.Common
winaot_PARALLEL_SUBDIRS = $(common_SUBDIRS) $(mobile_only_SUBDIRS)
testing_winaot_interp_SUBDIRS = $(common_DEPS_SUBDIRS) System.Drawing.Common
testing_winaot_interp_PARALLEL_SUBDIRS = $(common_SUBDIRS) $(mobile_only_SUBDIRS)
orbis_SUBDIRS = $(common_DEPS_SUBDIRS) System.Drawing.Common
orbis_PARALLEL_SUBDIRS = $(common_SUBDIRS) $(mobile_only_SUBDIRS)
@@ -76,7 +79,7 @@ unreal_SUBDIRS = $(common_DEPS_SUBDIRS) System.Drawing.Common
unreal_PARALLEL_SUBDIRS = $(common_SUBDIRS) $(mobile_only_SUBDIRS)
wasm_SUBDIRS = $(common_DEPS_SUBDIRS) System.Drawing.Common
wasm_PARALLEL_SUBDIRS = $(common_SUBDIRS) $(mobile_only_SUBDIRS)
wasm_PARALLEL_SUBDIRS = $(filter-out System.ServiceModel.%, $(common_SUBDIRS)) $(mobile_only_SUBDIRS)
testing_aot_full_SUBDIRS = $(common_DEPS_SUBDIRS) System.Drawing.Common
testing_aot_full_PARALLEL_SUBDIRS = $(common_SUBDIRS) $(mobile_only_SUBDIRS)

View File

@@ -161,11 +161,34 @@ winaot_dirs_parallel := \
$(mobile_common_dirs_parallel) \
Mono.Simd
testing_winaot_interp_dirs_parallel := \
$(mobile_common_dirs_parallel) \
Mono.Simd
unreal_dirs_parallel := \
$(mobile_common_dirs_parallel)
wasm_dirs_parallel := \
$(mobile_common_dirs_parallel)
Mono.Security \
System \
System.Core \
System.XML \
System.Security \
I18N \
System.Transactions \
System.ServiceModel.Internals \
System.Runtime.Serialization \
System.Data \
System.Xml.Linq \
System.Numerics \
System.Numerics.Vectors \
System.IO.Compression \
System.IO.Compression.FileSystem \
System.ComponentModel.DataAnnotations \
System.ComponentModel.Composition.4.5 \
System.Net.Http \
Microsoft.CSharp \
System.Runtime.CompilerServices.Unsafe
wasm_tools_dirs_parallel := \
Mono.Cecil
@@ -412,6 +435,9 @@ xbuild_14_SUBDIRS := $(xbuild_4_0_dirs) Microsoft.NuGet.Build.Tasks
winaot_SUBDIRS := $(mobile_common_dirs)
winaot_PARALLEL_SUBDIRS := $(winaot_dirs_parallel)
testing_winaot_interp_SUBDIRS := $(mobile_common_dirs)
testing_winaot_interp_PARALLEL_SUBDIRS := $(testing_winaot_interp_dirs_parallel)
orbis_SUBDIRS := $(mobile_common_dirs)
orbis_PARALLEL_SUBDIRS := $(orbis_dirs_parallel)
@@ -423,7 +449,7 @@ wasm_PARALLEL_SUBDIRS := $(wasm_dirs_parallel)
wasm_tools_SUBDIRS :=
wasm_tools_PARALLEL_SUBDIRS := $(wasm_tools_dirs_parallel)
netcore_SUBDIRS := System.Private.CoreLib
netcore_SUBDIRS :=
netcore_PARALLEL_SUBDIRS :=
include ../build/rules.make

View File

@@ -72,6 +72,14 @@ namespace Mono.Debugger.Soft
return vm.GetObject<StringMirror> (vm.conn.Domain_CreateString (id, s));
}
public ArrayMirror CreateByteArray (byte [] bytes) {
vm.CheckProtocolVersion (2, 52);
if (bytes == null)
throw new ArgumentNullException ("bytes");
return vm.GetObject<ArrayMirror> (vm.conn.Domain_CreateByteArray (id, bytes));
}
public ObjectMirror CreateBoxedValue (Value value) {
if (value == null)
throw new ArgumentNullException ("value");

View File

@@ -151,7 +151,8 @@ namespace Mono.Debugger.Soft
enum ValueTypeId {
VALUE_TYPE_ID_NULL = 0xf0,
VALUE_TYPE_ID_TYPE = 0xf1,
VALUE_TYPE_ID_PARENT_VTYPE = 0xf2
VALUE_TYPE_ID_PARENT_VTYPE = 0xf2,
VALUE_TYPE_ID_FIXED_ARRAY = 0xf3
}
[Flags]
@@ -215,6 +216,7 @@ namespace Mono.Debugger.Soft
public bool IsEnum; // For ElementType.ValueType
public long Id; /* For VALUE_TYPE_ID_TYPE */
public int Index; /* For VALUE_TYPE_PARENT_VTYPE */
public int FixedSize;
}
class ModuleInfo {
@@ -427,7 +429,7 @@ namespace Mono.Debugger.Soft
* with newer runtimes, and vice versa.
*/
internal const int MAJOR_VERSION = 2;
internal const int MINOR_VERSION = 51;
internal const int MINOR_VERSION = 53;
enum WPSuspendPolicy {
NONE = 0,
@@ -533,7 +535,8 @@ namespace Mono.Debugger.Soft
GET_ENTRY_ASSEMBLY = 4,
CREATE_STRING = 5,
GET_CORLIB = 6,
CREATE_BOXED_VALUE = 7
CREATE_BOXED_VALUE = 7,
CREATE_BYTE_ARRAY = 8,
}
enum CmdAssembly {
@@ -854,7 +857,6 @@ namespace Mono.Debugger.Soft
public ValueImpl ReadValue () {
ElementType etype = (ElementType)ReadByte ();
switch (etype) {
case ElementType.Void:
return new ValueImpl { Type = etype };
@@ -915,11 +917,94 @@ namespace Mono.Debugger.Soft
return new ValueImpl () { Type = etype, Id = ReadId () };
case (ElementType)ValueTypeId.VALUE_TYPE_ID_PARENT_VTYPE:
return new ValueImpl () { Type = etype, Index = ReadInt () };
case (ElementType)ValueTypeId.VALUE_TYPE_ID_FIXED_ARRAY:
return ReadValueFixedSize ();
default:
throw new NotImplementedException ("Unable to handle type " + etype);
}
}
ValueImpl ReadValueFixedSize () {
var lenFixedSize = 1;
ElementType etype = (ElementType)ReadByte ();
lenFixedSize = ReadInt ();
switch (etype) {
case ElementType.I1: {
var val = new sbyte[lenFixedSize];
for (int i = 0; i < lenFixedSize; i++)
val[i] = (sbyte)ReadInt ();
return new ValueImpl { Type = etype, Value = val };
}
case ElementType.U1: {
var val = new byte[lenFixedSize];
for (int i = 0; i < lenFixedSize; i++)
val[i] = (byte)ReadInt ();
return new ValueImpl { Type = etype, Value = val };
}
case ElementType.Boolean: {
var val = new bool[lenFixedSize];
for (int i = 0; i < lenFixedSize; i++)
val[i] = (ReadInt () != 0);
return new ValueImpl { Type = etype, Value = val };
}
case ElementType.I2: {
var val = new short[lenFixedSize];
for (int i = 0; i < lenFixedSize; i++)
val[i] = (short)ReadInt ();
return new ValueImpl { Type = etype, Value = val };
}
case ElementType.U2: {
var val = new ushort[lenFixedSize];
for (int i = 0; i < lenFixedSize; i++)
val[i] = (ushort)ReadInt ();
return new ValueImpl { Type = etype, Value = val };
}
case ElementType.Char: {
var val = new char[lenFixedSize];
for (int i = 0; i < lenFixedSize; i++)
val[i] = (char)ReadInt ();
return new ValueImpl { Type = etype, Value = val };
}
case ElementType.I4: {
var val = new int[lenFixedSize];
for (int i = 0; i < lenFixedSize; i++)
val[i] = ReadInt ();
return new ValueImpl { Type = etype, Value = val };
}
case ElementType.U4: {
var val = new uint[lenFixedSize];
for (int i = 0; i < lenFixedSize; i++)
val[i] = (uint)ReadInt ();
return new ValueImpl { Type = etype, Value = val };
}
case ElementType.I8: {
var val = new long[lenFixedSize];
for (int i = 0; i < lenFixedSize; i++)
val[i] = ReadLong ();
return new ValueImpl { Type = etype, Value = val };
}
case ElementType.U8: {
var val = new ulong[lenFixedSize];
for (int i = 0; i < lenFixedSize; i++)
val[i] = (ulong) ReadLong ();
return new ValueImpl { Type = etype, Value = val };
}
case ElementType.R4: {
var val = new float[lenFixedSize];
for (int i = 0; i < lenFixedSize; i++)
val[i] = ReadFloat ();
return new ValueImpl { Type = etype, Value = val };
}
case ElementType.R8: {
var val = new double[lenFixedSize];
for (int i = 0; i < lenFixedSize; i++)
val[i] = ReadDouble ();
return new ValueImpl { Type = etype, Value = val };
}
}
throw new NotImplementedException ("Unable to handle type " + etype);
}
public long[] ReadIds (int n) {
long[] res = new long [n];
for (int i = 0; i < n; ++i)
@@ -1025,6 +1110,16 @@ namespace Mono.Debugger.Soft
offset += b.Length;
return this;
}
public PacketWriter WriteBytes (byte[] b) {
if (b == null)
return WriteInt (-1);
MakeRoom (4);
encode_int (data, b.Length, ref offset);
MakeRoom (b.Length);
Buffer.BlockCopy (b, 0, data, offset, b.Length);
offset += b.Length;
return this;
}
public PacketWriter WriteBool (bool val) {
WriteByte (val ? (byte)1 : (byte)0);
@@ -1035,9 +1130,13 @@ namespace Mono.Debugger.Soft
ElementType t;
if (v.Value != null)
t = TypeCodeToElementType (Type.GetTypeCode (v.Value.GetType ()));
t = TypeCodeToElementType (Type.GetTypeCode (v.Value.GetType ()), v.Value.GetType ());
else
t = v.Type;
if (v.FixedSize > 1 && t != ElementType.ValueType) {
WriteFixedSizeValue (v);
return this;
}
WriteByte ((byte)t);
switch (t) {
case ElementType.Boolean:
@@ -1102,6 +1201,61 @@ namespace Mono.Debugger.Soft
return this;
}
PacketWriter WriteFixedSizeValue (ValueImpl v) {
ElementType t;
if (v.Value != null)
t = TypeCodeToElementType (Type.GetTypeCode (v.Value.GetType ()), v.Value.GetType ());
else
t = v.Type;
WriteByte ((byte) ValueTypeId.VALUE_TYPE_ID_FIXED_ARRAY);
WriteByte ((byte)t);
WriteInt (v.FixedSize);
for (int j = 0 ; j < v.FixedSize; j++) {
switch (t) {
case ElementType.Boolean:
WriteInt (((bool[])v.Value)[j]? 1 : 0);
break;
case ElementType.Char:
WriteInt ((int)((char[])v.Value)[j]);
break;
case ElementType.I1:
WriteInt ((int)((sbyte[])v.Value)[j]);
break;
case ElementType.U1:
WriteInt ((int)((byte[])v.Value)[j]);
break;
case ElementType.I2:
WriteInt ((int)((short[])v.Value)[j]);
break;
case ElementType.U2:
WriteInt ((int)((ushort[])v.Value)[j]);
break;
case ElementType.I4:
WriteInt ((int)((int[])v.Value)[j]);
break;
case ElementType.U4:
WriteInt ((int)((uint[])v.Value)[j]);
break;
case ElementType.I8:
WriteLong ((long)((long[])v.Value)[j]);
break;
case ElementType.U8:
WriteLong ((long)((ulong[])v.Value)[j]);
break;
case ElementType.R4:
WriteFloat (((float[])v.Value)[j]);
break;
case ElementType.R8:
WriteDouble (((double[])v.Value)[j]);
break;
default:
throw new NotImplementedException ();
}
}
return this;
}
public PacketWriter WriteValues (ValueImpl[] values) {
for (int i = 0; i < values.Length; ++i)
WriteValue (values [i]);
@@ -1684,7 +1838,7 @@ namespace Mono.Debugger.Soft
return res;
}
static ElementType TypeCodeToElementType (TypeCode c) {
static ElementType TypeCodeToElementType (TypeCode c, Type t) {
switch (c) {
case TypeCode.Boolean:
return ElementType.Boolean;
@@ -1710,6 +1864,8 @@ namespace Mono.Debugger.Soft
return ElementType.R4;
case TypeCode.Double:
return ElementType.R8;
case TypeCode.Object:
return TypeCodeToElementType(Type.GetTypeCode (t.GetElementType()), t.GetElementType());
default:
throw new NotImplementedException ();
}
@@ -1903,6 +2059,12 @@ namespace Mono.Debugger.Soft
return SendReceive (CommandSet.APPDOMAIN, (int)CmdAppDomain.CREATE_STRING, new PacketWriter ().WriteId (id).WriteString (s)).ReadId ();
}
internal long Domain_CreateByteArray (long id, byte [] bytes) {
var w = new PacketWriter ().WriteId (id);
w.WriteBytes (bytes);
return SendReceive (CommandSet.APPDOMAIN, (int)CmdAppDomain.CREATE_BYTE_ARRAY, w).ReadId ();
}
internal long Domain_CreateBoxedValue (long id, long type_id, ValueImpl v) {
return SendReceive (CommandSet.APPDOMAIN, (int)CmdAppDomain.CREATE_BOXED_VALUE, new PacketWriter ().WriteId (id).WriteId (type_id).WriteValue (v)).ReadId ();
}

View File

@@ -17,6 +17,7 @@ namespace Mono.Debugger.Soft
FieldAttributes attrs;
CustomAttributeDataMirror[] cattrs;
bool inited;
int len_fixed_size_array;
#if ENABLE_CECIL
C.FieldDefinition meta;
@@ -27,6 +28,7 @@ namespace Mono.Debugger.Soft
this.name = name;
this.type = type;
this.attrs = attrs;
this.len_fixed_size_array = -1;
inited = true;
}
@@ -162,6 +164,28 @@ namespace Mono.Debugger.Soft
}
}
public int FixedSize
{
get
{
if (len_fixed_size_array == -1) {
if (!vm.Version.AtLeast (2, 53) || !type.IsValueType) {
len_fixed_size_array = 0;
}
else {
var fbas = this.GetCustomAttributes (true);
for (int j = 0 ; j < fbas.Length; ++j) {
if (fbas [j].Constructor.DeclaringType.FullName.Equals("System.Runtime.CompilerServices.FixedBufferAttribute")){
len_fixed_size_array = (int) fbas [j].ConstructorArguments[1].Value;
break;
}
}
}
}
return len_fixed_size_array;
}
}
public CustomAttributeDataMirror[] GetCustomAttributes (bool inherit) {
return GetCAttrs (null, inherit);
}

View File

@@ -168,6 +168,10 @@ namespace Mono.Debugger.Soft
throw new ArgumentNullException ("loc");
try {
vm.conn.Thread_SetIP (id, loc.Method.Id, loc.ILOffset);
if (vm.conn.Version.AtLeast(2, 52)) {
InvalidateFrames();
FetchFrames(true);
}
} catch (CommandException ex) {
if (ex.ErrorCode == ErrorCode.INVALID_ARGUMENT)
throw new ArgumentException ("loc doesn't refer to a location in the current method of this thread.", "loc");

View File

@@ -357,20 +357,18 @@ namespace Mono.Debugger.Soft
public string CSharpName {
get {
if (IsArray) {
if (GetArrayRank () == 1)
var ranks = GetArrayRank ();
if (ranks == 1)
return GetElementType ().CSharpName + "[]";
else {
string ranks = "";
for (int i = 0; i < GetArrayRank (); ++i)
ranks += ',';
return GetElementType ().CSharpName + "[" + ranks + "]";
}
return GetElementType ().CSharpName + "[" + new string(',', ranks - 1) + "]";
}
if (IsPrimitive) {
switch (Name) {
case "Byte":
return "byte";
case "Sbyte":
case "SByte":
return "sbyte";
case "Char":
return "char";

View File

@@ -724,7 +724,32 @@ namespace Mono.Debugger.Soft
return new ValueImpl { Type = (ElementType)ValueTypeId.VALUE_TYPE_ID_NULL, Objid = 0 };
duplicates.Add (v);
return new ValueImpl { Type = ElementType.ValueType, Klass = (v as StructMirror).Type.Id, Fields = EncodeValues ((v as StructMirror).Fields, duplicates) };
return new ValueImpl { Type = ElementType.ValueType, Klass = (v as StructMirror).Type.Id, Fields = EncodeFieldValues ((v as StructMirror).Fields, (v as StructMirror).Type.GetFields (), duplicates, 1) };
} else if (v is PointerValue) {
PointerValue val = (PointerValue)v;
return new ValueImpl { Type = ElementType.Ptr, Klass = val.Type.Id, Value = val.Address };
} else {
throw new NotSupportedException ("Value of type " + v.GetType());
}
}
internal ValueImpl EncodeValueFixedSize (Value v, List<Value> duplicates, int len_fixed_size) {
if (v is PrimitiveValue) {
object val = (v as PrimitiveValue).Value;
if (val == null)
return new ValueImpl { Type = (ElementType)ValueTypeId.VALUE_TYPE_ID_NULL, Objid = 0 };
else
return new ValueImpl { Value = val , FixedSize = len_fixed_size};
} else if (v is ObjectMirror) {
return new ValueImpl { Type = ElementType.Object, Objid = (v as ObjectMirror).Id };
} else if (v is StructMirror) {
if (duplicates == null)
duplicates = new List<Value> ();
if (duplicates.Contains (v))
return new ValueImpl { Type = (ElementType)ValueTypeId.VALUE_TYPE_ID_NULL, Objid = 0 };
duplicates.Add (v);
return new ValueImpl { Type = ElementType.ValueType, Klass = (v as StructMirror).Type.Id, Fields = EncodeFieldValues ((v as StructMirror).Fields, (v as StructMirror).Type.GetFields (), duplicates, len_fixed_size) };
} else if (v is PointerValue) {
PointerValue val = (PointerValue)v;
return new ValueImpl { Type = ElementType.Ptr, Klass = val.Type.Id, Value = val.Address };
@@ -740,6 +765,17 @@ namespace Mono.Debugger.Soft
return res;
}
internal ValueImpl[] EncodeFieldValues (IList<Value> values, FieldInfoMirror[] field_info, List<Value> duplicates, int fixedSize) {
ValueImpl[] res = new ValueImpl [values.Count];
for (int i = 0; i < values.Count; ++i) {
if (fixedSize > 1 || field_info [i].FixedSize > 1)
res [i] = EncodeValueFixedSize (values [i], duplicates, fixedSize > 1 ? fixedSize : field_info [i].FixedSize);
else
res [i] = EncodeValue (values [i], duplicates);
}
return res;
}
internal void CheckProtocolVersion (int major, int minor) {
if (!conn.Version.AtLeast (major, minor))
throw new NotSupportedException ("This request is not supported by the protocol version implemented by the debuggee.");

View File

@@ -174,6 +174,95 @@ public struct AStruct : ITest2 {
}
}
public struct int4
{
public int w, x, y, z;
public int4(int w, int x, int y, int z)
{
this.w = w;
this.x = x;
this.y = y;
this.z = z;
}
}
public struct char4
{
public int w, x, y, z;
public char4(char w, char x, char y, char z)
{
this.w = w;
this.x = x;
this.y = y;
this.z = z;
}
}
public unsafe struct NodeTestFixedArray
{
private fixed short buffer[4];
private fixed char buffer2[4];
public int4 Buffer
{
set
{
fixed (NodeTestFixedArray* p = &this) {
p->buffer[0] = (short)value.w;
p->buffer[1] = (short)value.x;
p->buffer[2] = (short)value.y;
p->buffer[3] = (short)value.z;
}
}
}
public char4 Buffer2
{
set
{
fixed (NodeTestFixedArray* p = &this) {
p->buffer2[0] = (char)value.w;
p->buffer2[1] = (char)value.x;
p->buffer2[2] = (char)value.y;
p->buffer2[3] = (char)value.z;
}
}
}
public String getBuffer0() {
fixed (NodeTestFixedArray* p = &this)
return Convert.ToString(p->buffer[0]);
}
public String getBuffer1() {
fixed (NodeTestFixedArray* p = &this)
return Convert.ToString(p->buffer[1]);
}
public String getBuffer2() {
fixed (NodeTestFixedArray* p = &this)
return Convert.ToString(p->buffer[2]);
}
public String getBuffer3() {
fixed (NodeTestFixedArray* p = &this)
return Convert.ToString(p->buffer[3]);
}
public String getBuffer2_0() {
fixed (NodeTestFixedArray* p = &this)
return Char.ToString(p->buffer2[0]);
}
public String getBuffer2_1() {
fixed (NodeTestFixedArray* p = &this)
return Char.ToString(p->buffer2[1]);
}
public String getBuffer2_2() {
fixed (NodeTestFixedArray* p = &this)
return Char.ToString(p->buffer2[2]);
}
public String getBuffer2_3() {
fixed (NodeTestFixedArray* p = &this)
return Char.ToString(p->buffer2[3]);
}
}
public struct BlittableStruct {
public int i;
@@ -494,6 +583,7 @@ public class Tests : TestsBase, ITest2
field_with_unsafe_cast_value();
inspect_enumerator_in_generic_struct();
if_property_stepping();
fixed_size_array();
return 3;
}
@@ -730,6 +820,13 @@ public class Tests : TestsBase, ITest2
Thread.Sleep(300);
}
[MethodImplAttribute (MethodImplOptions.NoInlining)]
public static void fixed_size_array () {
var n = new NodeTestFixedArray();
n.Buffer = new int4(1, 2, 3, 4);
n.Buffer2 = new char4('a', 'b', 'c', 'd');
}
[MethodImplAttribute (MethodImplOptions.NoInlining)]
public static void inspect_enumerator_in_generic_struct() {
TestEnumeratorInsideGenericStruct<String, String> generic_struct = new TestEnumeratorInsideGenericStruct<String, String>(new KeyValuePair<string, string>("0", "f1"));

View File

@@ -1 +1 @@
1f394d53c53a481ed108fe1e55be458a7fb03923
75967555e6b2fb9903c055d496b749f56798e897

View File

@@ -1 +1 @@
e28929ff29e77677e6a485008deaa2ea8b573660
7d8ca92f4a478adc0358c7abf5f4069725fea2cc

Some files were not shown because too many files have changed in this diff Show More