You've already forked linux-packaging-mono
Imported Upstream version 6.6.0.89
Former-commit-id: b39a328747c2f3414dc52e009fb6f0aa80ca2492
This commit is contained in:
parent
cf815e07e0
commit
95fdb59ea6
@@ -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)))
|
||||
|
||||
@@ -1 +1 @@
|
||||
8342a6a8454aecca51da2612b8d0ab24295206bd
|
||||
319613988894e958c40cdcd218190a7ad2d6b27d
|
||||
@@ -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
|
||||
@@ -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)
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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");
|
||||
|
||||
@@ -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 ();
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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");
|
||||
|
||||
@@ -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";
|
||||
|
||||
@@ -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.");
|
||||
|
||||
@@ -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"));
|
||||
|
||||
@@ -1 +1 @@
|
||||
1f394d53c53a481ed108fe1e55be458a7fb03923
|
||||
75967555e6b2fb9903c055d496b749f56798e897
|
||||
@@ -1 +1 @@
|
||||
e28929ff29e77677e6a485008deaa2ea8b573660
|
||||
7d8ca92f4a478adc0358c7abf5f4069725fea2cc
|
||||
@@ -1 +1 @@
|
||||
a919644f85d6bc2807949463b1c8b703d5f58717
|
||||
6cc67dda4b894bb3ef0dffdc49ae8e816665c012
|
||||
@@ -325,8 +325,8 @@ namespace Mono.Unix {
|
||||
|
||||
public virtual void SetOwner (long owner, long group)
|
||||
{
|
||||
uint _owner = Convert.ToUInt32 (owner);
|
||||
uint _group = Convert.ToUInt32 (group);
|
||||
int _owner = Convert.ToInt32 (owner);
|
||||
int _group = Convert.ToInt32 (group);
|
||||
int r = Native.Syscall.chown (FullPath, _owner, _group);
|
||||
UnixMarshal.ThrowExceptionForLastErrorIf (r);
|
||||
}
|
||||
|
||||
@@ -356,7 +356,7 @@ namespace Mono.Unix {
|
||||
AssertNotDisposed ();
|
||||
|
||||
int r = Native.Syscall.fchown (fileDescriptor,
|
||||
Convert.ToUInt32 (user), Convert.ToUInt32 (group));
|
||||
Convert.ToInt32 (user), Convert.ToInt32 (group));
|
||||
UnixMarshal.ThrowExceptionForLastErrorIf (r);
|
||||
}
|
||||
|
||||
|
||||
@@ -94,7 +94,7 @@ namespace Mono.Unix {
|
||||
|
||||
public override void SetOwner (long owner, long group)
|
||||
{
|
||||
int r = Native.Syscall.lchown (FullPath, Convert.ToUInt32 (owner), Convert.ToUInt32 (group));
|
||||
int r = Native.Syscall.lchown (FullPath, Convert.ToInt32 (owner), Convert.ToInt32 (group));
|
||||
UnixMarshal.ThrowExceptionForLastErrorIf (r);
|
||||
}
|
||||
|
||||
|
||||
20
mcs/class/Mono.Profiler.Log/Mono.Profiler.Aot/ProfileBase.cs
Normal file
20
mcs/class/Mono.Profiler.Log/Mono.Profiler.Aot/ProfileBase.cs
Normal file
@@ -0,0 +1,20 @@
|
||||
namespace Mono.Profiler.Aot {
|
||||
public abstract class ProfileBase {
|
||||
|
||||
internal enum RecordType {
|
||||
NONE = 0,
|
||||
IMAGE = 1,
|
||||
TYPE = 2,
|
||||
GINST = 3,
|
||||
METHOD = 4
|
||||
}
|
||||
|
||||
internal enum MonoTypeEnum {
|
||||
MONO_TYPE_CLASS = 0x12,
|
||||
}
|
||||
|
||||
internal const string MAGIC = "AOTPROFILE";
|
||||
internal const int MAJOR_VERSION = 1;
|
||||
internal const int MINOR_VERSION = 0;
|
||||
}
|
||||
}
|
||||
@@ -9,26 +9,8 @@ namespace Mono.Profiler.Aot
|
||||
// Read the contents of a .aotprofile created by the AOT profiler
|
||||
// See mono-profiler-aot.h for a description of the file format
|
||||
//
|
||||
public sealed class ProfileReader
|
||||
public sealed class ProfileReader : ProfileBase
|
||||
{
|
||||
enum RecordType
|
||||
{
|
||||
NONE = 0,
|
||||
IMAGE = 1,
|
||||
TYPE = 2,
|
||||
GINST = 3,
|
||||
METHOD = 4
|
||||
}
|
||||
|
||||
enum MonoTypeEnum
|
||||
{
|
||||
MONO_TYPE_CLASS = 0x12,
|
||||
}
|
||||
|
||||
const string MAGIC = "AOTPROFILE";
|
||||
const int MAJOR_VERSION = 1;
|
||||
const int MINOR_VERSION = 0;
|
||||
|
||||
DataConverter conv;
|
||||
byte[] data;
|
||||
int pos;
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user