You've already forked linux-packaging-mono
Imported Upstream version 5.18.0.142
Former-commit-id: 7467d4b717762eeaf652d77f1486dd11ffb1ff1f
This commit is contained in:
parent
e52655b4dc
commit
0abdbe5a7d
@@ -20,6 +20,11 @@ LIB_MCS_FLAGS = $(SIGN_FLAGS) $(EXTRA_LIB_MCS_FLAGS)
|
||||
# TODO: find a better solution.
|
||||
EMBEDDED_DRAWING_DEP := $(filter xammac_net_4_5 testing_aot_full testing_aot_hybrid, $(PROFILE))
|
||||
|
||||
ifeq ($(PROFILE),monodroid)
|
||||
# XA implements System.Drawing API inside Mono.Android
|
||||
API_BIN_REFS := Mono.Android
|
||||
else
|
||||
|
||||
ifndef EMBEDDED_DRAWING_DEP
|
||||
|
||||
# profiles which build a System.Drawing.dll in the repo
|
||||
@@ -29,12 +34,12 @@ ifdef REPO_DRAWING_DEP
|
||||
LIB_REFS += System.Drawing
|
||||
else
|
||||
# When System.Drawing.dll is not built in the Mono repo but in
|
||||
# the product repo like in the XI/XA case we need to pass in a reference
|
||||
# the product repo like in the XI case we need to pass in a reference
|
||||
# to the assembly containing drawing types like Rectangle etc. from there.
|
||||
# This needs to be passed in via EXTERNAL_FACADE_DRAWING_REFERENCE.
|
||||
LIB_MCS_FLAGS += /r:$(EXTERNAL_FACADE_DRAWING_REFERENCE)
|
||||
endif
|
||||
|
||||
endif
|
||||
endif
|
||||
|
||||
PLATFORM_DEBUG_FLAGS =
|
||||
|
@@ -28,6 +28,11 @@ else
|
||||
LIB_REFS += System.Web
|
||||
endif
|
||||
|
||||
ifeq ($(PROFILE),monodroid)
|
||||
# XA implements System.Drawing API inside Mono.Android
|
||||
API_BIN_REFS := Mono.Android
|
||||
else
|
||||
|
||||
# profiles which build a System.Drawing.dll in the repo
|
||||
REPO_DRAWING_DEP := $(filter net_4_x orbis winaot unreal wasm, $(PROFILE))
|
||||
|
||||
@@ -51,7 +56,7 @@ else
|
||||
# This needs to be passed in via EXTERNAL_FACADE_DRAWING_REFERENCE.
|
||||
LIB_MCS_FLAGS += /r:$(EXTERNAL_FACADE_DRAWING_REFERENCE)
|
||||
endif
|
||||
|
||||
endif
|
||||
endif
|
||||
|
||||
PLATFORM_DEBUG_FLAGS =
|
||||
|
@@ -40,6 +40,9 @@ netstandard_drawing_SUBDIRS = System.Drawing.Primitives netstandard
|
||||
monotouch_SUBDIRS = $(common_DEPS_SUBDIRS) $(mobile_only_DEPS_SUBDIRS)
|
||||
monotouch_PARALLEL_SUBDIRS = $(common_SUBDIRS) $(mobile_only_SUBDIRS)
|
||||
|
||||
monodroid_SUBDIRS = $(monotouch_SUBDIRS) $(netstandard_drawing_SUBDIRS)
|
||||
monodroid_PARALLEL_SUBDIRS = $(monotouch_PARALLEL_SUBDIRS)
|
||||
|
||||
# We don't build netstandard/System.Drawing.Primitives on monotouch etc. profiles by default,
|
||||
# except when EXTERNAL_FACADE_DRAWING_REFERENCE is defined which allows us to build it in Mono CI
|
||||
# (since the dependent drawing types are normally built in the product repos).
|
||||
@@ -63,9 +66,6 @@ System.Text.Encoding.CodePages
|
||||
|
||||
build_PARALLEL_SUBDIRS = $(basic_PARALLEL_SUBDIRS) System.Text.RegularExpressions System.Diagnostics.Contracts
|
||||
|
||||
monodroid_SUBDIRS = $(monotouch_SUBDIRS)
|
||||
monodroid_PARALLEL_SUBDIRS = $(monotouch_PARALLEL_SUBDIRS)
|
||||
|
||||
xammac_SUBDIRS = $(monotouch_SUBDIRS)
|
||||
xammac_PARALLEL_SUBDIRS = $(monotouch_PARALLEL_SUBDIRS)
|
||||
|
||||
|
569
mcs/class/I18N/EncodingTestBase.cs
Normal file
569
mcs/class/I18N/EncodingTestBase.cs
Normal file
File diff suppressed because it is too large
Load Diff
@@ -4,6 +4,7 @@ include ../../build/rules.make
|
||||
|
||||
DISTFILES = \
|
||||
Assembly/AssemblyInfo.cs \
|
||||
EncodingTestBase.cs \
|
||||
README \
|
||||
README.mono \
|
||||
mklist.sh \
|
||||
|
@@ -10,6 +10,9 @@ endif
|
||||
|
||||
# The minimal set of csc dependencies
|
||||
basic_SUBDIRS := \
|
||||
Mono.Cecil \
|
||||
$(MCS_MODE_dirs) \
|
||||
../tools/cil-stringreplacer \
|
||||
corlib \
|
||||
Mono.Security \
|
||||
System \
|
||||
@@ -19,15 +22,15 @@ basic_SUBDIRS := \
|
||||
System.ComponentModel.Composition.4.5 \
|
||||
System.Numerics \
|
||||
System.Xml.Linq \
|
||||
Mono.Cecil \
|
||||
$(MCS_MODE_dirs) \
|
||||
Mono.CompilerServices.SymbolWriter \
|
||||
PEAPI \
|
||||
../tools/cil-stringreplacer \
|
||||
../ilasm \
|
||||
corlib/il
|
||||
|
||||
build_SUBDIRS := \
|
||||
Mono.Cecil \
|
||||
$(MCS_MODE_dirs) \
|
||||
../tools/cil-stringreplacer \
|
||||
corlib \
|
||||
Mono.Security \
|
||||
System \
|
||||
@@ -41,11 +44,8 @@ build_SUBDIRS := \
|
||||
System.Xml.Linq \
|
||||
System.IO.Compression \
|
||||
System.Drawing \
|
||||
Mono.Cecil \
|
||||
$(MCS_MODE_dirs) \
|
||||
Mono.CompilerServices.SymbolWriter \
|
||||
PEAPI \
|
||||
../tools/cil-stringreplacer
|
||||
PEAPI
|
||||
|
||||
ifdef MCS_MODE
|
||||
basic_PARALLEL_SUBDIRS := ../mcs $(pcl_facade_dirs)
|
||||
@@ -410,9 +410,15 @@ DISTFILES = \
|
||||
doc/TemplateTest.cs \
|
||||
notes/BitVecto32.txt \
|
||||
MicrosoftAjaxLibrary/License.htm \
|
||||
test-helpers/NetworkHelpers.cs \
|
||||
test-helpers/SocketResponder.cs \
|
||||
$(foreach HOST_PLATFORM,darwin linux win32,lib/$(monolite_dir)/mcs.exe $(monolite_files))
|
||||
test-helpers/AdminHelper.cs \
|
||||
test-helpers/Configuration.Http.cs \
|
||||
test-helpers/NetworkHelpers.cs \
|
||||
test-helpers/NunitHelpers.cs \
|
||||
test-helpers/PlatformDetection.cs \
|
||||
test-helpers/RemoteExecutorTestBase.Mobile.cs \
|
||||
test-helpers/RemoteExecutorTestBase.Mono.cs \
|
||||
test-helpers/SocketResponder.cs \
|
||||
$(foreach HOST_PLATFORM,macos linux win32 unix,lib/$(monolite_dir)/mcs.exe $(monolite_files))
|
||||
|
||||
.PHONY: all-local $(STD_TARGETS:=-local)
|
||||
all-local $(STD_TARGETS:=-local):
|
||||
@@ -457,9 +463,10 @@ $(build_files:%=lib/build-$(HOST_PLATFORM)/%):
|
||||
dist-monolite: $(monolite_files) lib/$(monolite_dir)/mcs.exe
|
||||
|
||||
dist-monolite-all-platforms:
|
||||
$(MAKE) dist-monolite HOST_PLATFORM=darwin
|
||||
$(MAKE) dist-monolite HOST_PLATFORM=macos
|
||||
$(MAKE) dist-monolite HOST_PLATFORM=linux
|
||||
$(MAKE) dist-monolite HOST_PLATFORM=win32
|
||||
$(MAKE) dist-monolite HOST_PLATFORM=unix
|
||||
|
||||
package-monolite-latest:
|
||||
MONOLITE=monolite-$(HOST_PLATFORM)-$(MONO_CORLIB_VERSION)-latest; \
|
||||
@@ -467,9 +474,10 @@ package-monolite-latest:
|
||||
tar zcvpf $$MONOLITE.tar.gz --directory=lib $$MONOLITE/
|
||||
|
||||
package-monolite-latest-all-platforms:
|
||||
$(MAKE) package-monolite-latest HOST_PLATFORM=darwin
|
||||
$(MAKE) package-monolite-latest HOST_PLATFORM=macos
|
||||
$(MAKE) package-monolite-latest HOST_PLATFORM=linux
|
||||
$(MAKE) package-monolite-latest HOST_PLATFORM=win32
|
||||
$(MAKE) package-monolite-latest HOST_PLATFORM=unix
|
||||
|
||||
monolite_url = https://download.mono-project.com/monolite/monolite-$(BUILD_PLATFORM)-$(MONO_CORLIB_VERSION)-latest.tar.gz
|
||||
|
||||
|
@@ -40,7 +40,6 @@ corefx/SR.cs
|
||||
../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/RuntimeBinderInternalCompilerException.cs
|
||||
../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/*.cs
|
||||
../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/Binding/*.cs
|
||||
../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/Declarations/*.cs
|
||||
../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/Symbols/*.cs
|
||||
../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/Tree/*.cs
|
||||
../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/Tree/Visitors/*.cs
|
||||
|
@@ -0,0 +1,4 @@
|
||||
../../../external/corefx/src/CoreFx.Private.TestUtilities/src/System/AssertExtensions.cs
|
||||
|
||||
../../../external/corefx/src/Microsoft.CSharp/tests/*.cs
|
||||
|
@@ -87,7 +87,10 @@ namespace Mono.Btls.Interface
|
||||
|
||||
public byte[] GetSerialNumber (bool mono_style)
|
||||
{
|
||||
return Instance.GetSerialNumber (mono_style);
|
||||
var serial = Instance.GetSerialNumber (mono_style);
|
||||
if (mono_style)
|
||||
Array.Reverse (serial);
|
||||
return serial;
|
||||
}
|
||||
|
||||
public int GetVersion ()
|
||||
|
@@ -0,0 +1,6 @@
|
||||
Evaluator/BuildinCommands.cs
|
||||
Evaluator/CompletionTest.cs
|
||||
Evaluator/EvaluatorFixture.cs
|
||||
Evaluator/EvaluatorTest.cs
|
||||
Evaluator/ExpressionsTest.cs
|
||||
Evaluator/TypesTest.cs
|
@@ -0,0 +1 @@
|
||||
#include Mono.CSharp_test.dll.sources
|
@@ -2,11 +2,21 @@ thisdir = class/Mono.Cecil.Mdb
|
||||
include ../../build/rules.make
|
||||
|
||||
LIBRARY = Mono.Cecil.Mdb.dll
|
||||
LIBRARY_SNK = ../mono.snk
|
||||
KEYFILE = ../mono.snk
|
||||
LIBRARY_PACKAGE = none
|
||||
|
||||
LIB_REFS = System Mono.Cecil
|
||||
LIB_MCS_FLAGS = /d:CECIL -keyfile:$(LIBRARY_SNK) -publicsign
|
||||
API_BUILD := $(filter basic build, $(PROFILE))
|
||||
|
||||
ifdef API_BUILD
|
||||
DEFAULT_REFERENCES =
|
||||
API_BIN_REFS = System mscorlib
|
||||
else
|
||||
LIB_REFS = System
|
||||
endif
|
||||
|
||||
LIB_REFS += Mono.Cecil
|
||||
|
||||
LIB_MCS_FLAGS = -d:CECIL
|
||||
|
||||
NO_TEST = yes
|
||||
NO_INSTALL = yes
|
||||
|
@@ -2,11 +2,19 @@ thisdir = class/Mono.Cecil
|
||||
include ../../build/rules.make
|
||||
|
||||
LIBRARY = Mono.Cecil.dll
|
||||
LIBRARY_SNK = ../mono.snk
|
||||
KEYFILE = ../mono.snk
|
||||
LIBRARY_PACKAGE = none
|
||||
|
||||
API_BUILD := $(filter basic build, $(PROFILE))
|
||||
|
||||
ifdef API_BUILD
|
||||
DEFAULT_REFERENCES =
|
||||
API_BIN_REFS = System.Core System mscorlib
|
||||
else
|
||||
LIB_REFS = System.Core System
|
||||
LIB_MCS_FLAGS = -keyfile:$(LIBRARY_SNK) -d:NET_4_0 /publicsign
|
||||
endif
|
||||
|
||||
LIB_MCS_FLAGS = -d:NET_4_0
|
||||
|
||||
NO_TEST = yes
|
||||
|
||||
|
@@ -0,0 +1 @@
|
||||
#include Mono.Data.Sqlite_test.dll.sources
|
@@ -3,6 +3,7 @@ using System.Reflection;
|
||||
using Mono.Debugger;
|
||||
using Mono.Cecil;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
|
||||
namespace Mono.Debugger.Soft
|
||||
{
|
||||
@@ -15,8 +16,13 @@ namespace Mono.Debugger.Soft
|
||||
AssemblyName aname;
|
||||
AssemblyDefinition meta;
|
||||
AppDomainMirror domain;
|
||||
byte[] metadata_blob;
|
||||
bool? isDynamic;
|
||||
byte[] pdb_blob;
|
||||
Dictionary<string, long> typeCacheIgnoreCase = new Dictionary<string, long> (StringComparer.InvariantCultureIgnoreCase);
|
||||
Dictionary<string, long> typeCache = new Dictionary<string, long> ();
|
||||
Dictionary<uint, long> tokenTypeCache = new Dictionary<uint, long> ();
|
||||
Dictionary<uint, long> tokenMethodCache = new Dictionary<uint, long> ();
|
||||
|
||||
internal AssemblyMirror (VirtualMachine vm, long id) : base (vm, id) {
|
||||
}
|
||||
@@ -118,7 +124,9 @@ namespace Mono.Debugger.Soft
|
||||
*/
|
||||
public AssemblyDefinition Metadata {
|
||||
get {
|
||||
return meta;
|
||||
if (meta != null)
|
||||
return meta;
|
||||
return null;
|
||||
}
|
||||
set {
|
||||
if (value.MainModule.Name != ManifestModule.Name)
|
||||
@@ -128,5 +136,83 @@ namespace Mono.Debugger.Soft
|
||||
meta = value;
|
||||
}
|
||||
}
|
||||
|
||||
// Read assembly metadata from the debuggee
|
||||
// Since protocol version 2.47
|
||||
public AssemblyDefinition GetMetadata () {
|
||||
if (IsDynamic)
|
||||
throw new NotSupportedException ();
|
||||
|
||||
using (var ms = new MemoryStream (GetMetadataBlob ()))
|
||||
return meta = AssemblyDefinition.ReadAssembly (ms);
|
||||
}
|
||||
|
||||
public byte[] GetMetadataBlob () {
|
||||
if (metadata_blob != null)
|
||||
return metadata_blob;
|
||||
|
||||
vm.CheckProtocolVersion (2, 47);
|
||||
|
||||
return metadata_blob = vm.conn.Assembly_GetMetadataBlob (id);
|
||||
}
|
||||
|
||||
public bool IsDynamic {
|
||||
get {
|
||||
if (isDynamic.HasValue)
|
||||
return isDynamic.Value;
|
||||
|
||||
vm.CheckProtocolVersion (2, 47);
|
||||
|
||||
isDynamic = vm.conn.Assembly_IsDynamic (id);
|
||||
return isDynamic.Value;
|
||||
}
|
||||
}
|
||||
|
||||
public bool HasPdb {
|
||||
get {
|
||||
return pdb_blob != null;
|
||||
}
|
||||
}
|
||||
|
||||
public bool HasFetchedPdb { get; private set; }
|
||||
|
||||
public byte[] GetPdbBlob () {
|
||||
if (HasFetchedPdb)
|
||||
return pdb_blob;
|
||||
|
||||
vm.CheckProtocolVersion (2, 47);
|
||||
var blob = vm.conn.Assembly_GetPdbBlob (id);
|
||||
if (blob != null && blob.Length > 0) {
|
||||
pdb_blob = blob;
|
||||
}
|
||||
HasFetchedPdb = true;
|
||||
return pdb_blob;
|
||||
}
|
||||
|
||||
public TypeMirror GetType (uint token) {
|
||||
vm.CheckProtocolVersion (2, 47);
|
||||
if (IsDynamic)
|
||||
throw new NotSupportedException ();
|
||||
|
||||
long typeId;
|
||||
if (!tokenTypeCache.TryGetValue (token, out typeId)) {
|
||||
typeId = vm.conn.Assembly_GetType (id, token);
|
||||
tokenTypeCache.Add (token, typeId);
|
||||
}
|
||||
return vm.GetType (typeId);
|
||||
}
|
||||
|
||||
public MethodMirror GetMethod (uint token) {
|
||||
vm.CheckProtocolVersion (2, 47);
|
||||
if (IsDynamic)
|
||||
throw new NotSupportedException ();
|
||||
|
||||
long methodId;
|
||||
if (!tokenMethodCache.TryGetValue (token, out methodId)) {
|
||||
methodId = vm.conn.Assembly_GetMethod (id, token);
|
||||
tokenMethodCache.Add (token, methodId);
|
||||
}
|
||||
return vm.GetMethod (methodId);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -420,7 +420,7 @@ namespace Mono.Debugger.Soft
|
||||
* with newer runtimes, and vice versa.
|
||||
*/
|
||||
internal const int MAJOR_VERSION = 2;
|
||||
internal const int MINOR_VERSION = 46;
|
||||
internal const int MINOR_VERSION = 47;
|
||||
|
||||
enum WPSuspendPolicy {
|
||||
NONE = 0,
|
||||
@@ -534,7 +534,12 @@ namespace Mono.Debugger.Soft
|
||||
GET_OBJECT = 4,
|
||||
GET_TYPE = 5,
|
||||
GET_NAME = 6,
|
||||
GET_DOMAIN = 7
|
||||
GET_DOMAIN = 7,
|
||||
GET_METADATA_BLOB = 8,
|
||||
GET_IS_DYNAMIC = 9,
|
||||
GET_PDB_BLOB = 10,
|
||||
GET_TYPE_FROM_TOKEN = 11,
|
||||
GET_METHOD_FROM_TOKEN = 12
|
||||
}
|
||||
|
||||
enum CmdModule {
|
||||
@@ -648,6 +653,17 @@ namespace Mono.Debugger.Soft
|
||||
return packet [offset++];
|
||||
}
|
||||
|
||||
static byte[] decode_bytes (byte[] packet, ref int offset, int length)
|
||||
{
|
||||
if (length + offset > packet.Length)
|
||||
throw new ArgumentOutOfRangeException ();
|
||||
|
||||
var bytes = new byte[length];
|
||||
Array.Copy (packet, offset, bytes, 0, length);
|
||||
offset += length;
|
||||
return bytes;
|
||||
}
|
||||
|
||||
static int decode_short (byte[] packet, ref int offset) {
|
||||
int res = ((int)packet [offset] << 8) | (int)packet [offset + 1];
|
||||
offset += 2;
|
||||
@@ -895,6 +911,15 @@ namespace Mono.Debugger.Soft
|
||||
res [i] = ReadId ();
|
||||
return res;
|
||||
}
|
||||
|
||||
public byte[] ReadByteArray () {
|
||||
var length = ReadInt ();
|
||||
return decode_bytes (packet, ref offset, length);
|
||||
}
|
||||
|
||||
public bool ReadBool () {
|
||||
return ReadByte () != 0;
|
||||
}
|
||||
}
|
||||
|
||||
class PacketWriter {
|
||||
@@ -2135,6 +2160,26 @@ namespace Mono.Debugger.Soft
|
||||
internal long Assembly_GetIdDomain (long id) {
|
||||
return SendReceive (CommandSet.ASSEMBLY, (int)CmdAssembly.GET_DOMAIN, new PacketWriter ().WriteId (id)).ReadId ();
|
||||
}
|
||||
|
||||
internal byte[] Assembly_GetMetadataBlob (long id) {
|
||||
return SendReceive (CommandSet.ASSEMBLY, (int)CmdAssembly.GET_METADATA_BLOB, new PacketWriter ().WriteId (id)).ReadByteArray ();
|
||||
}
|
||||
|
||||
internal bool Assembly_IsDynamic (long id) {
|
||||
return SendReceive (CommandSet.ASSEMBLY, (int) CmdAssembly.GET_IS_DYNAMIC, new PacketWriter ().WriteId (id)).ReadBool ();
|
||||
}
|
||||
|
||||
internal byte[] Assembly_GetPdbBlob (long id) {
|
||||
return SendReceive (CommandSet.ASSEMBLY, (int)CmdAssembly.GET_PDB_BLOB, new PacketWriter ().WriteId (id)).ReadByteArray ();
|
||||
}
|
||||
|
||||
internal long Assembly_GetType (long id, uint token) {
|
||||
return SendReceive (CommandSet.ASSEMBLY, (int)CmdAssembly.GET_TYPE_FROM_TOKEN, new PacketWriter ().WriteId (id).WriteInt ((int)token)).ReadId ();
|
||||
}
|
||||
|
||||
internal long Assembly_GetMethod (long id, uint token) {
|
||||
return SendReceive (CommandSet.ASSEMBLY, (int)CmdAssembly.GET_METHOD_FROM_TOKEN, new PacketWriter ().WriteId (id).WriteInt ((int)token)).ReadId ();
|
||||
}
|
||||
|
||||
/*
|
||||
* TYPE
|
||||
|
@@ -522,43 +522,65 @@ namespace Mono.Debugger.Soft
|
||||
Dictionary <long, ObjectMirror> objects;
|
||||
object objects_lock = new object ();
|
||||
|
||||
internal T GetObject<T> (long id, long domain_id, long type_id) where T : ObjectMirror {
|
||||
// Return a mirror if it exists
|
||||
// Does not call into the debuggee
|
||||
internal T TryGetObject<T> (long id) where T : ObjectMirror {
|
||||
lock (objects_lock) {
|
||||
if (objects == null)
|
||||
objects = new Dictionary <long, ObjectMirror> ();
|
||||
ObjectMirror obj;
|
||||
if (!objects.TryGetValue (id, out obj)) {
|
||||
/*
|
||||
* Obtain the domain/type of the object to determine the type of
|
||||
* object we need to create.
|
||||
*/
|
||||
if (domain_id == 0 || type_id == 0) {
|
||||
if (conn.Version.AtLeast (2, 5)) {
|
||||
var info = conn.Object_GetInfo (id);
|
||||
domain_id = info.domain_id;
|
||||
type_id = info.type_id;
|
||||
} else {
|
||||
if (domain_id == 0)
|
||||
domain_id = conn.Object_GetDomain (id);
|
||||
if (type_id == 0)
|
||||
type_id = conn.Object_GetType (id);
|
||||
}
|
||||
}
|
||||
AppDomainMirror d = GetDomain (domain_id);
|
||||
TypeMirror t = GetType (type_id);
|
||||
|
||||
if (t.Assembly == d.Corlib && t.Namespace == "System.Threading" && t.Name == "Thread")
|
||||
obj = new ThreadMirror (this, id, t, d);
|
||||
else if (t.Assembly == d.Corlib && t.Namespace == "System" && t.Name == "String")
|
||||
obj = new StringMirror (this, id, t, d);
|
||||
else if (typeof (T) == typeof (ArrayMirror))
|
||||
obj = new ArrayMirror (this, id, t, d);
|
||||
else
|
||||
obj = new ObjectMirror (this, id, t, d);
|
||||
objects [id] = obj;
|
||||
}
|
||||
objects.TryGetValue (id, out obj);
|
||||
return (T)obj;
|
||||
}
|
||||
}
|
||||
|
||||
internal T GetObject<T> (long id, long domain_id, long type_id) where T : ObjectMirror {
|
||||
ObjectMirror obj = null;
|
||||
lock (objects_lock) {
|
||||
if (objects == null)
|
||||
objects = new Dictionary <long, ObjectMirror> ();
|
||||
objects.TryGetValue (id, out obj);
|
||||
}
|
||||
|
||||
if (obj == null) {
|
||||
/*
|
||||
* Obtain the domain/type of the object to determine the type of
|
||||
* object we need to create. Do this outside the lock.
|
||||
*/
|
||||
if (domain_id == 0 || type_id == 0) {
|
||||
if (conn.Version.AtLeast (2, 5)) {
|
||||
var info = conn.Object_GetInfo (id);
|
||||
domain_id = info.domain_id;
|
||||
type_id = info.type_id;
|
||||
} else {
|
||||
if (domain_id == 0)
|
||||
domain_id = conn.Object_GetDomain (id);
|
||||
if (type_id == 0)
|
||||
type_id = conn.Object_GetType (id);
|
||||
}
|
||||
}
|
||||
AppDomainMirror d = GetDomain (domain_id);
|
||||
TypeMirror t = GetType (type_id);
|
||||
|
||||
if (t.Assembly == d.Corlib && t.Namespace == "System.Threading" && t.Name == "Thread")
|
||||
obj = new ThreadMirror (this, id, t, d);
|
||||
else if (t.Assembly == d.Corlib && t.Namespace == "System" && t.Name == "String")
|
||||
obj = new StringMirror (this, id, t, d);
|
||||
else if (typeof (T) == typeof (ArrayMirror))
|
||||
obj = new ArrayMirror (this, id, t, d);
|
||||
else
|
||||
obj = new ObjectMirror (this, id, t, d);
|
||||
|
||||
// Publish
|
||||
lock (objects_lock) {
|
||||
ObjectMirror prev_obj;
|
||||
if (objects.TryGetValue (id, out prev_obj))
|
||||
obj = prev_obj;
|
||||
else
|
||||
objects [id] = obj;
|
||||
}
|
||||
}
|
||||
return (T)obj;
|
||||
}
|
||||
|
||||
internal T GetObject<T> (long id) where T : ObjectMirror {
|
||||
@@ -573,6 +595,10 @@ namespace Mono.Debugger.Soft
|
||||
return GetObject <ThreadMirror> (id);
|
||||
}
|
||||
|
||||
internal ThreadMirror TryGetThread (long id) {
|
||||
return TryGetObject <ThreadMirror> (id);
|
||||
}
|
||||
|
||||
Dictionary <long, FieldInfoMirror> fields;
|
||||
object fields_lock = new object ();
|
||||
|
||||
@@ -736,7 +762,11 @@ namespace Mono.Debugger.Soft
|
||||
l.Add (new ThreadStartEvent (vm, req_id, id));
|
||||
break;
|
||||
case EventType.ThreadDeath:
|
||||
vm.GetThread (id).InvalidateFrames ();
|
||||
// Avoid calling GetThread () since it might call into the debuggee
|
||||
// and we can't do that in the event handler
|
||||
var thread = vm.TryGetThread (id);
|
||||
if (thread != null)
|
||||
thread.InvalidateFrames ();
|
||||
vm.InvalidateThreadCache ();
|
||||
l.Add (new ThreadDeathEvent (vm, req_id, id));
|
||||
break;
|
||||
|
@@ -1 +1 @@
|
||||
de430ae354a18c8538fb43b6356a1a9c91226072
|
||||
7de7a22a0ef9acbae4274e23f83698cd8a31f7da
|
@@ -0,0 +1 @@
|
||||
#include Mono.Posix_test.dll.sources
|
@@ -11,17 +11,18 @@ LIB_MCS_FLAGS = /unsafe /publicsign /nowarn:0618
|
||||
|
||||
XTEST_LIB_REFS = System System.Core Facades/System.Threading.Tasks
|
||||
|
||||
xunit-test-local: log-profiler-test.exe
|
||||
xunit-test-local: $(topdir)/class/lib/$(PROFILE_DIRECTORY)/tests/log-profiler-test.exe
|
||||
|
||||
log-profiler-test.exe: Test/log-profiler-test.cs
|
||||
$(topdir)/class/lib/$(PROFILE_DIRECTORY)/tests/log-profiler-test.exe: Test/log-profiler-test.cs
|
||||
mkdir -p $(dir $@)
|
||||
$(CSCOMPILE) $(PLATFORM_DEBUG_FLAGS) /unsafe $(if $(MCS_MODE),,/warnaserror) /r:$(build_libdir)/mscorlib.dll /r:$(build_lib) /out:$@ $<
|
||||
|
||||
EXTRA_DISTFILES = \
|
||||
Test/log-profiler-test.cs
|
||||
|
||||
CLEAN_FILES = \
|
||||
log-profiler-test.exe \
|
||||
log-profiler-test.exe.mdb \
|
||||
log-profiler-test.pdb
|
||||
$(topdir)/class/lib/$(PROFILE_DIRECTORY)/tests/log-profiler-test.exe \
|
||||
$(topdir)/class/lib/$(PROFILE_DIRECTORY)/tests/log-profiler-test.exe.mdb \
|
||||
$(topdir)/class/lib/$(PROFILE_DIRECTORY)/tests/log-profiler-test.pdb
|
||||
|
||||
include ../../build/library.make
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user