mono.git
7 years ago[msvc] Update csproj files (#4336)
monojenkins [Tue, 7 Feb 2017 16:36:06 +0000 (16:36 +0000)]
[msvc] Update csproj files (#4336)

7 years agoMerge pull request #4334 from ntherning/exclude-mono_w32socket_disconnect-on-non...
Niklas Therning [Tue, 7 Feb 2017 14:00:34 +0000 (15:00 +0100)]
Merge pull request #4334 from ntherning/exclude-mono_w32socket_disconnect-on-non-desktop-uwp

Exclude mono_w32socket_disconnect() on unsupported Windows families

7 years agoExclude mono_w32socket_disconnect() on unsupported Windows families
Niklas Therning [Tue, 7 Feb 2017 09:19:55 +0000 (10:19 +0100)]
Exclude mono_w32socket_disconnect() on unsupported Windows families

7 years ago[corlib] Update TimeZoneTest ios simulator check
Marek Safar [Tue, 7 Feb 2017 09:22:01 +0000 (10:22 +0100)]
[corlib] Update TimeZoneTest ios simulator check

7 years agoTemp fix for broken TimeZoneInfo on Windows families without registry access
Niklas Therning [Mon, 6 Feb 2017 12:53:53 +0000 (13:53 +0100)]
Temp fix for broken TimeZoneInfo on Windows families without registry access

Band aid fix until we can switch to CoreRT's implementation.

7 years agoRemove comment from Thread.cs describing field removed in 4.8
Andi McClure [Mon, 6 Feb 2017 22:33:48 +0000 (17:33 -0500)]
Remove comment from Thread.cs describing field removed in 4.8

7 years agoRemove debugging spew in MonoBtlsX509LookupMonoCollection.cs.
Martin Baulig [Mon, 6 Feb 2017 22:27:59 +0000 (23:27 +0100)]
Remove debugging spew in MonoBtlsX509LookupMonoCollection.cs.

7 years ago[arm] Use TARGET_IOS instead of __APPLE__ so we don't use the ios abi when cross...
Zoltan Varga [Mon, 6 Feb 2017 22:25:53 +0000 (17:25 -0500)]
[arm] Use TARGET_IOS instead of __APPLE__ so we don't use the ios abi when cross compiling from osx to android.

7 years ago[btls]: Add option to specify the certificate search paths. (#4318)
Martin Baulig [Mon, 6 Feb 2017 22:18:21 +0000 (23:18 +0100)]
[btls]: Add option to specify the certificate search paths. (#4318)

* [btls]: Add option to specify the certificate search paths.

* MonoTlsSettings.CertificateSearchPaths: new property.

Valid values are

- @default - add default search paths
- @user - add default user search path
- @machine - add default machine search path
- @trust - add 'MonoTlsSettings.TrustedRoots'
- @pem:<directory> - custom directory containing certificates in PEM format
- @der:<directory> - same, in DER format

* Make it internal for the moment.

* Cosmetic; use "?.".

7 years ago[sgen] Don't assert when suspending detaching thread (#4292)
Vlad Brezae [Mon, 6 Feb 2017 19:20:21 +0000 (21:20 +0200)]
[sgen] Don't assert when suspending detaching thread (#4292)

This means that the thread will be part of the stw (not skipped), so if the stack pointer is not between the expected ranges we dont scan the thread. In other parts of the runtime, suspending here is handled by the suspend_can_continue flag.

7 years ago[tests] Fix duplicate variable setting in assemblyresolve
Alexander Köplinger [Mon, 6 Feb 2017 11:32:48 +0000 (12:32 +0100)]
[tests] Fix duplicate variable setting in assemblyresolve

Probably bad merge conflict resolution in 5d054b1852f24b620e5800c06141201602e69d0e

7 years ago[runtime] Get mono/tests running on bitcode/arm (#4233)
Alexander Kyte [Mon, 6 Feb 2017 06:12:54 +0000 (01:12 -0500)]
[runtime] Get mono/tests running on bitcode/arm (#4233)

7 years ago[acceptance-tests] Baseline failing coreclr tests for now (#4325)
Alexander Köplinger [Sat, 4 Feb 2017 15:50:01 +0000 (16:50 +0100)]
[acceptance-tests] Baseline failing coreclr tests for now (#4325)

We can look into them when we have time, but for now let's
just ensure no new failures sneak in.

7 years ago[xbuild] Add .NET 4.6.2 entries and frameworklist.xml (#4326)
Alexander Köplinger [Sat, 4 Feb 2017 15:48:56 +0000 (16:48 +0100)]
[xbuild] Add .NET 4.6.2 entries and frameworklist.xml (#4326)

7 years ago[runtime] Require C# namespace to be quoted.
Jon Purdy [Fri, 3 Feb 2017 20:46:29 +0000 (12:46 -0800)]
[runtime] Require C# namespace to be quoted.

In GENERATE_GET_CLASS_WITH_CACHE and GENERATE_TRY_GET_CLASS_WITH_CACHE,
we were just quoting the namespace immediately.

7 years ago[runtime] Avoid 'strncpy'.
Jon Purdy [Fri, 3 Feb 2017 00:37:46 +0000 (16:37 -0800)]
[runtime] Avoid 'strncpy'.

Its null-padding behavior can be surprising.

7 years ago[runtime] Use double-underscored attributes.
Jon Purdy [Thu, 2 Feb 2017 23:42:45 +0000 (15:42 -0800)]
[runtime] Use double-underscored attributes.

E.g., 'aligned' => '__aligned__'. We use the following attributes:

 * aligned
 * always_inline
 * cold
 * deprecated
 * error
 * format
 * naked
 * noinline
 * packed
 * printf
 * tls_model
 * unavailable
 * used
 * visibility
 * warn_unused_result

7 years ago[runtime] Remove redundant #includes.
Jon Purdy [Thu, 2 Feb 2017 23:49:06 +0000 (15:49 -0800)]
[runtime] Remove redundant #includes.

7 years ago[runtime] Avoid invalid characters.
Jon Purdy [Thu, 2 Feb 2017 23:27:46 +0000 (15:27 -0800)]
[runtime] Avoid invalid characters.

There were some unquoted backticks and form-feed characters.

7 years ago[runtime] Use ins->prev in mono_analyze_liveness. (#4296)
vkargov [Fri, 3 Feb 2017 20:52:56 +0000 (12:52 -0800)]
[runtime] Use ins->prev in mono_analyze_liveness. (#4296)

* [runtime] Add the missing MONO_BB_FOR_EACH_INS_REVERSE macro.

* [runtime] Use ins->prev instead of building reverse ins array in mono_analyze_liveness.

7 years ago[runtime] Fix the computation of token sizes in ppdb files, the PDB stream has an...
Zoltan Varga [Fri, 3 Feb 2017 12:43:14 +0000 (07:43 -0500)]
[runtime] Fix the computation of token sizes in ppdb files, the PDB stream has an additional table which contains the token sizes for the metadata tables referenced by the ppdb tables. (#4321)

7 years ago[xbuild] Disable pre-2.0 csc hack to use /debug:portable (#4322)
Ankit Jain [Fri, 3 Feb 2017 12:19:05 +0000 (07:19 -0500)]
[xbuild] Disable pre-2.0 csc hack to use /debug:portable (#4322)

This hack should not be required now, as roslyn emits the correct debug
files with /debug:full and /debug:pdbonly, on non-windows platform.

This manifested as https://bugzilla.xamarin.com/show_bug.cgi?id=50710 ,
where the Xamarin.Mac targets override `$(CscToolExe)` to use `mcs`, but
xbuild's `ManagedCompiler` *always* converts `DebugType={full,pdbonly}`
to `/debug:portable`, which would cause mcs to complain.

7 years ago[runtime] Factor out some code from mono_metadata_compute_size () to make it easier...
Zoltan Varga [Thu, 2 Feb 2017 19:30:06 +0000 (14:30 -0500)]
[runtime] Factor out some code from mono_metadata_compute_size () to make it easier to add ppdb support later. NFC. (#4320)

7 years agoMerge pull request #4306 from BrzVlad/fix-roslyn-ppc
Vlad Brezae [Thu, 2 Feb 2017 19:11:33 +0000 (21:11 +0200)]
Merge pull request #4306 from BrzVlad/fix-roslyn-ppc

[ppc] Save all the registers in the context

7 years agoRevert "Default powerpc to build with mcs (#4313)"
Vlad Brezae [Wed, 1 Feb 2017 16:29:26 +0000 (18:29 +0200)]
Revert "Default powerpc to build with mcs (#4313)"

This reverts commit 6a2a23dcebbf5bd19560b3bdeec54e13e26901f8.

7 years ago[ppc] Save all the registers in the context
Vlad Brezae [Tue, 31 Jan 2017 22:09:41 +0000 (00:09 +0200)]
[ppc] Save all the registers in the context

When suspending a thread, we were only saving the callee save registers in the context. Therefore SGen was failing to pin some objects. In order to store the registers in order, a code refactoring was necessary.

7 years ago[btls]: Make the 'MonoBtlsX509LookupMonoCollection' logic consistent with the native...
Martin Baulig [Thu, 2 Feb 2017 17:48:20 +0000 (18:48 +0100)]
[btls]: Make the 'MonoBtlsX509LookupMonoCollection' logic consistent with the native implementation. (#4319)

7 years ago[BTLS]: Improve error handling. (#4317)
Martin Baulig [Thu, 2 Feb 2017 17:43:02 +0000 (18:43 +0100)]
[BTLS]: Improve error handling. (#4317)

* Add new native mono_btls_error_peek_error_line() and
  mono_btls_error_get_error_line().

* Add `MonoBtlsError.PeekError(out string, out int)` and
  `MonoBtlsError.GetError(out string, out int)` overloads.

* MonoBtlsContext.GetException(): use it here.

7 years agoMerge pull request #4316 from mono/work-51562
Martin Baulig [Thu, 2 Feb 2017 11:06:23 +0000 (12:06 +0100)]
Merge pull request #4316 from mono/work-51562

[btls]: Allow importing a null `byte[]`.  Fixes #51562.

7 years agoMerge pull request #4312 from ntherning/winaot-tests-on-jenkins
Niklas Therning [Thu, 2 Feb 2017 07:11:36 +0000 (02:11 -0500)]
Merge pull request #4312 from ntherning/winaot-tests-on-jenkins

Adds CI scripts to run the test suites under the winaot profile

7 years agoRevert "[runtime] Fix the computation of token sizes in ppdb files, the PDB stream...
Zoltan Varga [Wed, 1 Feb 2017 20:36:40 +0000 (15:36 -0500)]
Revert "[runtime] Fix the computation of token sizes in ppdb files, the PDB stream has an additional table which contains the token sizes for the metadata tables referenced by the ppdb tables. (#4304)"

This reverts commit c35cdfa2dec8c15fdf49a6032c437751a97a5e08.

Revert this as it causes test failures.

7 years agoSend assembly and type load events in the domain that contains them rather than the...
Jonathan Chambers [Wed, 1 Feb 2017 19:58:23 +0000 (14:58 -0500)]
Send assembly and type load events in the domain that contains them rather than the root domain in the attach/defer case. (#4314)

7 years ago[btls]: Allow importing a null `byte[]`. Fixes #51562.
Martin Baulig [Wed, 1 Feb 2017 18:36:33 +0000 (19:36 +0100)]
[btls]: Allow importing a null `byte[]`.  Fixes #51562.

7 years ago[runtime] Fix the computation of token sizes in ppdb files, the PDB stream has an...
Zoltan Varga [Wed, 1 Feb 2017 18:05:22 +0000 (13:05 -0500)]
[runtime] Fix the computation of token sizes in ppdb files, the PDB stream has an additional table which contains the token sizes for the metadata tables referenced by the ppdb tables. (#4304)

7 years ago[x86] Fix a race in the single stepping seq point assembly, we were doing a null...
Zoltan Varga [Wed, 1 Feb 2017 17:56:34 +0000 (12:56 -0500)]
[x86] Fix a race in the single stepping seq point assembly, we were doing a null check using cmp_membase, following by a call_membase, but the value could change between the two instructions, leading to a nullref. Fixes #50117. (#4308)

7 years ago[sdb] Add a Domain property to AssemblyMirror. (#4309)
Zoltan Varga [Wed, 1 Feb 2017 17:45:38 +0000 (12:45 -0500)]
[sdb] Add a Domain property to AssemblyMirror. (#4309)

7 years ago[runtime] Update comments in mono-debug-debugger.h.
Zoltan Varga [Wed, 1 Feb 2017 17:42:40 +0000 (12:42 -0500)]
[runtime] Update comments in mono-debug-debugger.h.

7 years ago[msvc] Update csproj files (#4315)
monojenkins [Wed, 1 Feb 2017 16:40:17 +0000 (16:40 +0000)]
[msvc] Update csproj files (#4315)

7 years agoDefault powerpc to build with mcs (#4313)
Alexander Köplinger [Wed, 1 Feb 2017 15:47:01 +0000 (16:47 +0100)]
Default powerpc to build with mcs (#4313)

It crashes during build with roslyn on Jenkins.

7 years ago[System.Data] referencesource -> corefx (#4299)
Egor Bogatov [Wed, 1 Feb 2017 14:49:21 +0000 (15:49 +0100)]
[System.Data] referencesource -> corefx (#4299)

* [System.Data] SQLTypes from corefx

* [System.Data] DataStorage + subclasses from corefx

* [System.Data] remove dead referencesource.sources references

* [System.Data] Generate SR.cs from corefx using resx2sr tool

* [System.Data] move common references to corefx.common.sources

* [System.Data] remove /ReferenceSources/SR.cs

* [System.Data] remove duplicates in corefx.common.sources (accidentally were added)

* [System.Data] simple types & enums from corefx

* [System.Data] referencesource -> corefx

* [System.Data] Referencesource -> corefx

* [System.Data] re-order (sort) files in corefx.common.sources, DbCommandBuilder from corefx

* [System.Data] Referencesource -> corefx

* [System.Data] DataRow, DataSet, Filters, etc from corefx. XmlDataDocument is internal in corefx but used to be public in mono.

* [System.Data] rollback referencesource changes

* [System.Data] Wrap /referencesource/DataSet.cs with #ifdef COREFX in order to include missing DataSetSchemaImporterExtension and ignore DataSet

7 years ago[System] Disable SocketTest.ConnectedProperty on testing_aot_full for now
Alexander Köplinger [Wed, 1 Feb 2017 14:20:11 +0000 (15:20 +0100)]
[System] Disable SocketTest.ConnectedProperty on testing_aot_full for now

It failed since we introduced this profile and it was disabled
on Mac a few years ago. A bug is filed to investigate why it only
fails on FullAOT on Linux but works on non-FullAOT builds.

Disable the test for now to get closer to a green build.

https://bugzilla.xamarin.com/show_bug.cgi?id=52157

7 years ago[ci] Bump timeout for compile-runtime-tests
Alexander Köplinger [Wed, 1 Feb 2017 13:27:01 +0000 (14:27 +0100)]
[ci] Bump timeout for compile-runtime-tests

The new Azure Windows builders sometimes run into this timeout.

7 years agoAdds CI scripts to run the test suites under the winaot profile
Niklas Therning [Wed, 1 Feb 2017 07:33:36 +0000 (08:33 +0100)]
Adds CI scripts to run the test suites under the winaot profile

7 years agoMerge pull request #4301 from ntherning/fix-Mono.Posix-API-breakage
Niklas Therning [Wed, 1 Feb 2017 12:58:54 +0000 (07:58 -0500)]
Merge pull request #4301 from ntherning/fix-Mono.Posix-API-breakage

Fixes the Mono.Posix API breakage introduced in #3985

7 years ago[runtime] Fix parse_optimizations () so the optimization names don't … (#4300)
Zoltan Varga [Wed, 1 Feb 2017 12:42:14 +0000 (07:42 -0500)]
[runtime] Fix parse_optimizations () so the optimization names don't … (#4300)

* [runtime] Fix parse_optimizations () so the optimization names don't need to be in a particular order.

* [jit] Avoid unused bits in optflags.

7 years ago[ppdb] Fix support for embedded ppdb data.
Zoltan Varga [Wed, 1 Feb 2017 10:37:17 +0000 (05:37 -0500)]
[ppdb] Fix support for embedded ppdb data.

7 years agoFixes the Mono.Posix API breakage introduced in #3985
Niklas Therning [Tue, 31 Jan 2017 10:03:15 +0000 (05:03 -0500)]
Fixes the Mono.Posix API breakage introduced in #3985

Also reverts the changes done to support/map.c. This is a generated file which
shouldn't be changed directly. An alternate fix for the problem in map.c on
Windows was to make sure L_SET et al are defined in mph.h which was already
done for Solaris.

7 years agoMerge pull request #4310 from marek-safar/roslyn-rc3
Marek Safar [Wed, 1 Feb 2017 08:10:29 +0000 (09:10 +0100)]
Merge pull request #4310 from marek-safar/roslyn-rc3

Bump roslyn to rc3

7 years agoMerge pull request #4302 from marek-safar/corefx-bump
Marek Safar [Wed, 1 Feb 2017 07:31:03 +0000 (08:31 +0100)]
Merge pull request #4302 from marek-safar/corefx-bump

Bump corefx

7 years agoBump roslyn to rc3
Marek Safar [Tue, 31 Jan 2017 22:52:58 +0000 (23:52 +0100)]
Bump roslyn to rc3

7 years agoBump corefx
Marek Safar [Tue, 31 Jan 2017 10:10:24 +0000 (11:10 +0100)]
Bump corefx

7 years ago[tests] Fix assemblyresolve_event4.exe and reference-loader.exe FullAOT test fails
Alexander Köplinger [Tue, 31 Jan 2017 21:05:31 +0000 (22:05 +0100)]
[tests] Fix assemblyresolve_event4.exe and reference-loader.exe FullAOT test fails

Fix assemblyresolve/Makefile.am so it correctly AOTs the
dependency of assemblyresolve_event4.exe (CLASS was empty before).

Disable reference-loader.exe since we can't AOT the
TestingReferenceAssembly.dll assembly which is a dependency
of the test so it would fail. Discussed with Aleksey, this is OK
because even if we could AOT the assembly we wouldn't use it since
the assembly loader looks at the managed assembly first, finds the
attribute and bails out before looking at the AOT image.

7 years ago[System] Fix AsyncOperationManager test that fails on the testing_full_aot profile
Alexander Köplinger [Tue, 31 Jan 2017 18:24:15 +0000 (19:24 +0100)]
[System] Fix AsyncOperationManager test that fails on the testing_full_aot profile

It seems the first assert only applies to XI/XM, so use those
in the condition instead of the profiles where it doesn't apply.

7 years agoDon't try to AOT test assemblies in runtime_preset=all (#4303)
Alexander Köplinger [Tue, 31 Jan 2017 18:18:58 +0000 (19:18 +0100)]
Don't try to AOT test assemblies in runtime_preset=all (#4303)

This got broken in ee048db72f867214ba2b9926d70a03badd79b33f
when the winaot profile was added to FULL_AOT_TESTS since we
enable that profile for building with runtime_preset=all which
means that FULL_AOT_TESTS would be defined and the runtime tests
would try to AOT the test assemblies.

Instead, we now only try to AOT if we're actually testing
a profile that needs it. Also introduced a new HYBRID_AOT_TESTS
variable and replaced the existing INSTALL_TESTING_AOT_HYBRID
since that profile would run into the same issue if we included
it in runtime_preset=all (using the INSTALL_ variables to decide
about tests is misleading!)

7 years ago[mono] Update ignored assemblies list to include System.ValueTuple
Marek Safar [Mon, 30 Jan 2017 16:40:32 +0000 (17:40 +0100)]
[mono] Update ignored assemblies list to include System.ValueTuple

7 years ago[mono] Update ignored assemblies list to include System.Reflection.DispatchProxy
Marek Safar [Mon, 30 Jan 2017 15:59:37 +0000 (16:59 +0100)]
[mono] Update ignored assemblies list to include System.Reflection.DispatchProxy

7 years ago[System.ServiceProcess] Fix test failure on Windows Server 2016
Alexander Köplinger [Mon, 30 Jan 2017 14:42:24 +0000 (15:42 +0100)]
[System.ServiceProcess] Fix test failure on Windows Server 2016

Use different service as the former has different dependencies
on the server edition.

7 years ago[System.Web] Fix two more EOL test failures on Windows
Alexander Köplinger [Mon, 30 Jan 2017 13:52:24 +0000 (14:52 +0100)]
[System.Web] Fix two more EOL test failures on Windows

7 years agoMerge pull request #4297 from kumpera/fix-profiler-osx-linking
Rodrigo Kumpera [Mon, 30 Jan 2017 15:54:55 +0000 (10:54 -0500)]
Merge pull request #4297 from kumpera/fix-profiler-osx-linking

[profiler] On OSX, don't link against libmonosgen.

7 years ago[build] Use multiple inputs in profiled aot
Marek Safar [Sat, 28 Jan 2017 00:16:53 +0000 (19:16 -0500)]
[build] Use multiple inputs in profiled aot

7 years ago[docs] Add a basic doxyfile
Jon Purdy [Thu, 26 Jan 2017 22:11:07 +0000 (14:11 -0800)]
[docs] Add a basic doxyfile

Bare minimum Doxygen configuration with dependency graphs.

7 years ago[bcl] Update tests that failed when .cs file contained CRLF
Alexander Köplinger [Sat, 28 Jan 2017 01:23:38 +0000 (02:23 +0100)]
[bcl] Update tests that failed when .cs file contained CRLF

Most of them used multiline C# string literals which
means they contained the line ending character of the file.
Updated to make the tests resilient to having CRLF instead of LF.

Some of the mcs tests used a checksum to compare files,
ensured those are checked out using LF.

7 years agoFix non-osx build.
Rodrigo Kumpera [Fri, 27 Jan 2017 19:51:31 +0000 (14:51 -0500)]
Fix non-osx build.

7 years ago[profiler] Don't link to libmonosgen on OSX. Fixes in tree execution.
Rodrigo Kumpera [Fri, 27 Jan 2017 18:29:15 +0000 (13:29 -0500)]
[profiler] Don't link to libmonosgen on OSX. Fixes in tree execution.

Loading profiling modules from the build tree fails on OSX because libmonosgen usually is not present in the install prefix.

This change is slightly overly complicated as I explicitly don't want to change iOS&friends.

7 years ago[scripts] Set custom csc nursery-size
Marek Safar [Fri, 27 Jan 2017 18:28:23 +0000 (13:28 -0500)]
[scripts] Set custom csc nursery-size

7 years ago[build] Install correct csc aot images
Marek Safar [Fri, 27 Jan 2017 18:28:03 +0000 (13:28 -0500)]
[build] Install correct csc aot images

7 years ago[interpreter] make space in args array to sneak in `this` in mint_newobj
Bernhard Urban [Fri, 27 Jan 2017 17:30:51 +0000 (18:30 +0100)]
[interpreter] make space in args array to sneak in `this` in mint_newobj

7 years ago[interpreter] change calling convention for `this` argument
Bernhard Urban [Fri, 27 Jan 2017 17:30:45 +0000 (18:30 +0100)]
[interpreter] change calling convention for `this` argument

the interpreter handles the `this` argument in the frame explicitly.
This doesn't align well with mini which treats `this` as normal
parameter on the stack.  That's just asking for troubles, e.g. for
native wrappers we convert signatures from virtual to static.

7 years ago[interpreter] fix CEE_LDOBJ for valuetypes
Bernhard Urban [Fri, 27 Jan 2017 17:30:43 +0000 (18:30 +0100)]
[interpreter] fix CEE_LDOBJ for valuetypes

7 years ago[interpreter] first version of CEE{LD,ST}ELEM
Bernhard Urban [Fri, 27 Jan 2017 17:30:40 +0000 (18:30 +0100)]
[interpreter] first version of CEE{LD,ST}ELEM

7 years ago[interpreter] fixed bug in mint_vtresult, we need the new vt address on the stack
Bernhard Urban [Fri, 27 Jan 2017 17:30:37 +0000 (18:30 +0100)]
[interpreter] fixed bug in mint_vtresult, we need the new vt address on the stack

7 years ago[interpreter] reserve storage on valuetype stack in mint_unbox
Bernhard Urban [Fri, 27 Jan 2017 17:30:35 +0000 (18:30 +0100)]
[interpreter] reserve storage on valuetype stack in mint_unbox

7 years ago[interpreter] fix some type -> klass accesses
Bernhard Urban [Fri, 27 Jan 2017 17:30:32 +0000 (18:30 +0100)]
[interpreter] fix some type -> klass accesses

mono_class_from_mono_type respects generic instantiations

7 years ago[interpreter] call managed boxing for nullable
Bernhard Urban [Fri, 27 Jan 2017 17:30:29 +0000 (18:30 +0100)]
[interpreter] call managed boxing for nullable

7 years ago[interpreter] make box instruction respect generics
Bernhard Urban [Fri, 27 Jan 2017 17:30:27 +0000 (18:30 +0100)]
[interpreter] make box instruction respect generics

7 years ago[interpreter] improve tracing
Bernhard Urban [Fri, 27 Jan 2017 17:30:24 +0000 (18:30 +0100)]
[interpreter] improve tracing

7 years ago[interpreter] implement unbox_any. call managed unbox implementation for Nullable...
Bernhard Urban [Fri, 27 Jan 2017 17:30:22 +0000 (18:30 +0100)]
[interpreter] implement unbox_any.  call managed unbox implementation for Nullable struct

7 years ago[interpreter] add temporary regression tests for generics
Bernhard Urban [Fri, 27 Jan 2017 17:30:19 +0000 (18:30 +0100)]
[interpreter] add temporary regression tests for generics

until we can execute generics.cs

7 years ago[interpreter] integrate compile_method and runtime_invoke into mini
Bernhard Urban [Fri, 27 Jan 2017 17:30:17 +0000 (18:30 +0100)]
[interpreter] integrate compile_method and runtime_invoke into mini

7 years ago[runtime] Add more system assemblies remapping
Marek Safar [Fri, 27 Jan 2017 17:16:29 +0000 (12:16 -0500)]
[runtime] Add more system assemblies remapping

7 years agoA few more LF .gitattributes fixes
Alexander Köplinger [Fri, 27 Jan 2017 14:58:54 +0000 (15:58 +0100)]
A few more LF .gitattributes fixes

7 years agoAlways use LF line endings for config.rpath/configure.host as well
Alexander Köplinger [Fri, 27 Jan 2017 14:06:16 +0000 (15:06 +0100)]
Always use LF line endings for config.rpath/configure.host as well

7 years agoAdd .sh extension to update_submodules so it gets correct line ending
Alexander Köplinger [Fri, 27 Jan 2017 14:18:23 +0000 (15:18 +0100)]
Add .sh extension to update_submodules so it gets correct line ending

It'd not be recognized as a shell file so it'd get CRLF line
endings on Windows which doesn't work. Also added a shebang.

Also remove get-cygwin-deps.sh, it is long outdated.
Correct instructions are on the Mono website.

7 years agoMake sure .sh files always have LF line ending
Alexander Köplinger [Fri, 27 Jan 2017 13:07:08 +0000 (14:07 +0100)]
Make sure .sh files always have LF line ending

This removes the need to set core.autocrlf=input when compiling
Mono on Windows via cygwin.

7 years ago[Debugger] Added support for stepping over await and out of async met…
David Karlaš [Fri, 27 Jan 2017 10:17:40 +0000 (11:17 +0100)]
[Debugger] Added support for stepping over await and out of async met…
…hods

method-to-ir.c: Added sequence points on IL offsets yieldOffsets and resumeOffsets since we need stepping to stop yieldOffset and ability to set breakpoint on resumeOffset
seq-points.c: This change is needed since we need to know if we are at last non-empty SeqPoint in method, but without this change is_last_non_empty method in debugger-agent.c would loop forever since blocks point between each other in cycles
doest-app.cs and dtest.cs: unit test
debugger-agent.c: I will explain how stepping over `await` and stepping out of `async` method works in commit message, code itself should be self explaining with comments

Step-In and Step-Out case: inside `async` method we do everything same except two things:
1. At end of method we switch to step-out logic
This is important because normal stepping-in/over would step out into “thread pool” calling code. Which is not what we want, we want to continue stepping where .Wait, .Result or `await` is waiting for our Task to finish. `is_last_non_empty` is needed because last non-empty SeqPoint is placed before SetResult(see line 33 in decompiled method below) so we can do StepOut logic before SetResult method is called.  I will explain how step-out works below.
2. When stepping is finished we check if we stepped on yieldOffset(this happens when user is about to step over `await` call) and Task has IsCompleted false(didn’t finish immediately)(line 11 in decompiled method). If we stopped on yieldOffset we put breakpoint on resumeOffset SeqPoint(line 19 in decompiled method) and resume execution so when our AsyncStateMachine is called back after Task(the one that our `await` call triggered) is finished we hit breakpoint and user is just after `await` call. It’s important that we set `async_id` before resuming at yieldOffset so we can check when breakpoint is hit if this is our Task or some other that is executing at same time, since we can’t check threads since threads can change before and after `await` call.

Step-Out case: When user requests step-out or user requests step-in/over and we are at end of method, we set breakpoint in special .Net framework method called “NotifyDebuggerOfWaitCompletion” and call “SetNotificationForWaitCompletion” method so after Task is finished(when we call .SetResult, line 33 in decompiled method).

Method that called our `async` method and got our Task(on which we called “SetNotificationForWaitCompletion”) returned. When it calls .Wait(), .Result, or `await` on our task it will call “NotifyDebuggerOfWaitCompletion”(framework does this). At that point our breakpoint(inside “NotifyDebuggerOfWaitCompletion”) is hit and we do step-out until we get to where user called .Wait(), .Result, and `await`.(Of course if ProjectCodeOnly is enabled, otherwise it’s in 1 method above “NotifyDebuggerOfWaitCompletion”).

I added also ppdb dump and monodis if anyone wants more data:

C# code:
public static async Task<int> ss_await_1 () {
    var a = 1;
    await Task.Delay (20);
    return a + 2;
}
C# decompiled:
  1: void IAsyncStateMachine.MoveNext ()
  2: {
  3:     int num = this.<>1__state;
  4:     int result;
  5:     try {
  6:         TaskAwaiter taskAwaiter;
  7:         if (num != 0) {
  8:           this.<a>5__1 = 1;
  9:           taskAwaiter = Task.Delay (20).GetAwaiter ();
10:           if (!taskAwaiter.get_IsCompleted ()) {
11:                this.<>1__state = 0;
12:                this.<>u__1 = taskAwaiter;
13:               Tests.<ss_await_1>d__90 <ss_await_1>d__ = this;
14:               this.<>t__builder.AwaitUnsafeOnCompleted<TaskAwaiter, Tests.<ss_await_1>d__90> (ref taskAwaiter, ref <ss_await_1>d__);
15:                return;
16:            }
17:        }
18:        else {
19:            taskAwaiter = this.<>u__1;
20:            this.<>u__1 = default(TaskAwaiter);
21:            this.<>1__state = -1;
22:        }
23:        taskAwaiter.GetResult ();
24:        taskAwaiter = default(TaskAwaiter);
25:        result = this.<a>5__1 + 2;
26:    }
27:    catch (Exception exception) {
28:        this.<>1__state = -2;
29:        this.<>t__builder.SetException (exception);
30:        return;
31:    }
32:    this.<>1__state = -2;
33:    this.<>t__builder.SetResult (result);
34:}

ppdb dump for this method:
<method containingType="Tests+&lt;ss_await_1&gt;d__90" name="MoveNext">
    <sequencePoints>
    <entry offset="0x0" hidden="true" document="1" />
    <entry offset="0x7" hidden="true" document="1" />
    <entry offset="0xe" startLine="744" startColumn="46" endLine="744" endColumn="47" document="1" />
    <entry offset="0xf" startLine="745" startColumn="3" endLine="745" endColumn="13" document="1" />
    <entry offset="0x16" startLine="746" startColumn="3" endLine="746" endColumn="25" document="1" />
    <entry offset="0x23" hidden="true" document="1" />
    <entry offset="0x7c" startLine="747" startColumn="3" endLine="747" endColumn="16" document="1" />
    <entry offset="0x87" hidden="true" document="1" />
    <entry offset="0xa1" startLine="748" startColumn="2" endLine="748" endColumn="3" document="1" />
    <entry offset="0xa9" hidden="true" document="1" />
    </sequencePoints>
    <scope startOffset="0x0" endOffset="0xb7" />
    <asyncInfo>
    <kickoffMethod declaringType="Tests" methodName="ss_await_1" />
    <await yield="0x35" resume="0x50" declaringType="Tests+&lt;ss_await_1&gt;d__90" methodName="MoveNext" />
    </asyncInfo>
</method>

monodis:
.method private final virtual hidebysig newslot
        instance default void MoveNext ()  cil managed
{
    // Method begins at RVA 0x41f0
.override Could not decode method override class [mscorlib]System.Runtime.CompilerServices.IAsyncStateMachine::MoveNext due to (null)
// Code size 183 (0xb7)
.maxstack 3
.locals init (
    int32 V_0,
    int32 V_1,
    valuetype [mscorlib]System.Runtime.CompilerServices.TaskAwaiterV_2,
    class Tests/'<ss_await_1>d__90' V_3,
    class [mscorlib]System.Exception V_4)
IL_0000:  ldarg.0
IL_0001:  ldfld int32 Tests/'<ss_await_1>d__90'::'<>1__state'
IL_0006:  stloc.0
.try { // 0
    IL_0007:  ldloc.0
    IL_0008:  brfalse.s IL_000c

    IL_000a:  br.s IL_000e

    IL_000c:  br.s IL_0050

    IL_000e:  nop
    IL_000f:  ldarg.0
    IL_0010:  ldc.i4.1
    IL_0011:  stfld int32 Tests/'<ss_await_1>d__90'::'<a>5__1'
    IL_0016:  ldc.i4.s 0x14
    IL_0018:  call class [mscorlib]System.Threading.Tasks.Task class [mscorlib]System.Threading.Tasks.Task::Delay(int32)
    IL_001d:  callvirt instance valuetype [mscorlib]System.Runtime.CompilerServices.TaskAwaiter class [mscorlib]System.Threading.Tasks.Task::GetAwaiter()
    IL_0022:  stloc.2
    IL_0023:  ldloca.s 2
    IL_0025:  call instance bool valuetype [mscorlib]System.Runtime.CompilerServices.TaskAwaiter::get_IsCompleted()
    IL_002a:  brtrue.s IL_006c

    IL_002c:  ldarg.0
    IL_002d:  ldc.i4.0
    IL_002e:  dup
    IL_002f:  stloc.0
    IL_0030:  stfld int32 Tests/'<ss_await_1>d__90'::'<>1__state'
    IL_0035:  ldarg.0
    IL_0036:  ldloc.2
    IL_0037:  stfld valuetype [mscorlib]System.Runtime.CompilerServices.TaskAwaiter Tests/'<ss_await_1>d__90'::'<>u__1'
    IL_003c:  ldarg.0
    IL_003d:  stloc.3
    IL_003e:  ldarg.0
    IL_003f:  ldflda valuetype [mscorlib]System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1<int32> Tests/'<ss_await_1>d__90'::'<>t__builder'
    IL_0044:  ldloca.s 2
    IL_0046:  ldloca.s 3
    IL_0048:  call instance void valuetype [mscorlib]System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1<int32>::AwaitUnsafeOnCompleted<valuetype [mscorlib]System.Runtime.CompilerServices.TaskAwaiter, class Tests/'<ss_await_1>d__90'> ([out] !!0&, [out] !!1&)
    IL_004d:  nop
    IL_004e:  leave.s IL_00b6

    IL_0050:  ldarg.0
    IL_0051:  ldfld valuetype [mscorlib]System.Runtime.CompilerServices.TaskAwaiter Tests/'<ss_await_1>d__90'::'<>u__1'
    IL_0056:  stloc.2
    IL_0057:  ldarg.0
    IL_0058:  ldflda valuetype [mscorlib]System.Runtime.CompilerServices.TaskAwaiter Tests/'<ss_await_1>d__90'::'<>u__1'
    IL_005d:  initobj [mscorlib]System.Runtime.CompilerServices.TaskAwaiter
    IL_0063:  ldarg.0
    IL_0064:  ldc.i4.m1
    IL_0065:  dup
    IL_0066:  stloc.0
    IL_0067:  stfld int32 Tests/'<ss_await_1>d__90'::'<>1__state'
    IL_006c:  ldloca.s 2
    IL_006e:  call instance void valuetype [mscorlib]System.Runtime.CompilerServices.TaskAwaiter::GetResult()
    IL_0073:  nop
    IL_0074:  ldloca.s 2
    IL_0076:  initobj [mscorlib]System.Runtime.CompilerServices.TaskAwaiter
    IL_007c:  ldarg.0
    IL_007d:  ldfld int32 Tests/'<ss_await_1>d__90'::'<a>5__1'
    IL_0082:  ldc.i4.2
    IL_0083:  add
    IL_0084:  stloc.1
    IL_0085:  leave.s IL_00a1

} // end .try 0
catch class [mscorlib]System.Exception { // 0
    IL_0087:  stloc.s 4
    IL_0089:  ldarg.0
    IL_008a:  ldc.i4.s 0xfffffffe
    IL_008c:  stfld int32 Tests/'<ss_await_1>d__90'::'<>1__state'
    IL_0091:  ldarg.0
    IL_0092:  ldflda valuetype [mscorlib]System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1<int32> Tests/'<ss_await_1>d__90'::'<>t__builder'
    IL_0097:  ldloc.s 4
    IL_0099:  call instance void valuetype [mscorlib]System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1<int32>::SetException(class [mscorlib]System.Exception)
    IL_009e:  nop
    IL_009f:  leave.s IL_00b6

} // end handler 0
IL_00a1:  ldarg.0
IL_00a2:  ldc.i4.s 0xfffffffe
IL_00a4:  stfld int32 Tests/'<ss_await_1>d__90'::'<>1__state'
IL_00a9:  ldarg.0
IL_00aa:  ldflda valuetype [mscorlib]System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1<int32> Tests/'<ss_await_1>d__90'::'<>t__builder'
IL_00af:  ldloc.1
IL_00b0:  call instance void valuetype [mscorlib]System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1<int32>::SetResult(!0)
IL_00b5:  nop
IL_00b6:  ret
} // end of method <ss_await_1>d__90::MoveNext

7 years ago[Ppdb] Support for reading CustomDebugInformation and more specifically AsyncMethodDe...
David Karlaš [Fri, 27 Jan 2017 10:17:15 +0000 (11:17 +0100)]
[Ppdb] Support for reading CustomDebugInformation and more specifically AsyncMethodDebugInfo

7 years ago[msvc] Update csproj files (#4295)
monojenkins [Thu, 26 Jan 2017 16:40:33 +0000 (16:40 +0000)]
[msvc] Update csproj files (#4295)

7 years ago[System.Data] SqlTypes and DataStorage from corefx (#4291)
Egor Bogatov [Thu, 26 Jan 2017 13:48:23 +0000 (14:48 +0100)]
[System.Data] SqlTypes and DataStorage from corefx (#4291)

7 years ago[ci] Set execute bit on run-test-mcs.sh
Alexander Köplinger [Thu, 26 Jan 2017 10:59:09 +0000 (11:59 +0100)]
[ci] Set execute bit on run-test-mcs.sh

7 years ago[ci] run mcs tests on mcs lane
Marek Safar [Thu, 26 Jan 2017 02:47:40 +0000 (21:47 -0500)]
[ci] run mcs tests on mcs lane

7 years agoFix PLATFORM_AOT_SUFFIX check in configure.ac
Alexander Köplinger [Thu, 26 Jan 2017 00:33:49 +0000 (01:33 +0100)]
Fix PLATFORM_AOT_SUFFIX check in configure.ac

7 years agoSkip AOTing profile assemblies if AOT_BUILD_FLAGS is not set
Alexander Köplinger [Wed, 25 Jan 2017 19:59:01 +0000 (20:59 +0100)]
Skip AOTing profile assemblies if AOT_BUILD_FLAGS is not set

Fixes the issue from a4b3ba6177d1af7dc93ba5cce56f444eeb976611
and 6f4f3643c6abf58d97a290c74254a74173736316.

When building those profiles as part of runtime_preset=all,
the AOT_BUILD_FLAGS variable is not set so AOTing doesn't work
because the command line flag in rules.make is incomplete.

We don't really need/want to AOT for runtime_preset=all,
the point is just to make sure these BCL profiles still build.

7 years ago[tools] Simplify cecil usage in stringreplacer
Marek Safar [Tue, 24 Jan 2017 22:12:52 +0000 (17:12 -0500)]
[tools] Simplify cecil usage in  stringreplacer

7 years agoDisable winaot in the runtime_preset=all as well
Alexander Köplinger [Wed, 25 Jan 2017 19:22:18 +0000 (20:22 +0100)]
Disable winaot in the runtime_preset=all as well

It runs into the same issue as orbis (6f4f3643c6abf58d97a290c74254a74173736316).

7 years ago[appdomain] Use coop handles for most methods in System.AppDomain (#4286)
Aleksey Kliger (λgeek) [Wed, 25 Jan 2017 18:53:46 +0000 (13:53 -0500)]
[appdomain] Use coop handles for most methods in System.AppDomain (#4286)

* [runtime] Use coop handles for ves_icall_System_AppDomain_GetData

* [runtime] Add mono_string_new_utf16_handle function that returns a MonoStringHandle

* [runtime] Use coop handles for ves_icall_System_AppDomain_InternalGetProcessGuid

* [runtime] Use coop handles for System.AppDomain icalls

  - ves_icall_System_AppDomain_InternalIsFinalizingForUnload
  - ves_icall_System_AppDomain_InternalPushDomainRef
  - ves_icall_System_AppDomain_InternalPushDomainRefByID
    (This one is slightly non-trivial because we switch from MonoException to MonoError)
  - ves_icall_System_AppDomain_InternalPopDomainRef
  - ves_icall_System_AppDomain_InternalSetDomainByID

* [runtime] Use coop handles for ves_icall_System_AppDomain_InternalSetDomain

* [runtime] Use coop handles for ves_icall_System_AppDomain_SetData

* [runtime] Coop handles for some AppDomain icalls

  - ves_icall_System_AppDomain_getCurDomain
  - ves_icall_System_AppDomain_getFriendlyName
  - ves_icall_System_AppDomain_getRootDomain
  - ves_icall_System_AppDomain_getSetup

* [coop handles] Add mono_string_handle_length function

* [marshal] Add mono_marshal_xdomain_copy_value_handle

* [coop handles] Add mono_aray_new_full_handle

* [appdomain] Use handles in mono_array_clone_in_domain

* [runtime] Use coop handles for ves_icall_System_AppDomain_createDomain

* [appdomain] Use coop handles for ves_icall_System_AppDomain_InternalUnload

7 years agoMerge pull request #4276 from henricm/winaot
Marek Safar [Wed, 25 Jan 2017 18:16:04 +0000 (13:16 -0500)]
Merge pull request #4276 from henricm/winaot

Updates for winaot profile

7 years agoChanging Win32_IP_ADAPTER_INFO to struct to work on AOT builds
Henric Müller [Tue, 17 Jan 2017 15:20:03 +0000 (16:20 +0100)]
Changing Win32_IP_ADAPTER_INFO to struct to work on AOT builds

7 years agoFixing AsyncOperationManagerTest test for winaot profile
Henric Müller [Tue, 17 Jan 2017 15:18:27 +0000 (16:18 +0100)]
Fixing AsyncOperationManagerTest test for winaot profile

7 years agoFixing tests that asume IPV4 when first adapter is IPV6
Henric Müller [Tue, 17 Jan 2017 15:14:26 +0000 (16:14 +0100)]
Fixing tests that asume IPV4 when first adapter is IPV6

7 years agoEnabling NativeObjectSecurity on windows aot
Henric Müller [Tue, 17 Jan 2017 15:12:04 +0000 (16:12 +0100)]
Enabling NativeObjectSecurity on windows aot