Compare commits

..
Author SHA1 Message Date
Rodrigo Kumpera bcc380d6ba [runtime] Instrument mono_domain_alloc 2014-09-16 18:16:47 -04:00
Rodrigo Kumpera 8516f578ee [runtime] Instrument image and image set mempool allocation. 2014-09-16 16:58:17 -04:00
Rodrigo Kumpera feaa6e19fb [runtime] Implement runtime valloc reporting. 2014-09-08 19:24:31 -04:00
Rodrigo Kumpera e8953e705c Properly name all sgen_alloc_os_memory. 2014-09-08 17:12:58 -04:00
Rodrigo Kumpera 130f08e943 Add reporting to jitinfo. 2014-09-08 17:11:11 -04:00
Rodrigo Kumpera 89558be055 [runtime] Finish metadata reporting. 2014-09-08 16:55:45 -04:00
Rodrigo Kumpera f2c8417122 [runtime] Proposed implementation of the memory profiler.
To get a small taste of it in action run the following program with it:

sing System;
using System.Net;
using System.Runtime.InteropServices;
using System.Linq;

public class Test
{
	[DllImport ("__Internal")]
	public static extern void mono_memprof_dump ();

	static int MethodThatDoesLinq () {
		int[] x = new[] { 1,2,3,4};
		var k = x.Where (_ => _ <= 100).Select (_ => _ + 1);
		int r = 0;
		foreach (var v in k)
			r += v;
		return r;
	}
	public static void Main ()
	{
		mono_memprof_dump ();
		MethodThatDoesLinq ();
		Console.WriteLine ("----------------------");
		mono_memprof_dump ();
	}
}
2014-09-08 02:27:09 -04:00
820 changed files with 25792 additions and 21602 deletions

No files matched your search

-3
View File
@@ -25,6 +25,3 @@
[submodule "external/ikdasm"]
path = external/ikdasm
url = git://github.com/mono/ikdasm.git
[submodule "external/referencesource"]
path = external/referencesource
url = git://github.com/mono/referencesource
+2 -2
View File
@@ -5,7 +5,7 @@ When contributing to the Mono project, please follow the [Mono Coding
Guidelines][1]. We have been using a coding style for many years,
please make your patches conform to these guidelines.
[1] http://www.mono-project.com/community/contributing/coding-guidelines/
[1] http://www.mono-project.com/Coding_Guidelines
Etiquette
=========
@@ -68,7 +68,7 @@ status of your pull request. If it succeeded and we like the changes,
a maintainer will likely merge it. Otherwise, you can amend your pull
request to fix build breakage and Jenkins will test it again.
[2] http://jenkins.mono-project.com/
[2] http://monojenkins.cloudapp.net
# Inactivity
+4
View File
@@ -494,12 +494,16 @@ Directory Roadmap
* `dis/` - CIL executable Disassembler
* `cli/` - Common code for the JIT and the interpreter.
* `io-layer/` - The I/O layer and system abstraction for
emulating the .NET IO model.
* `cil/` - Common Intermediate Representation, XML
definition of the CIL bytecodes.
* `interp/` - Interpreter for CLI executables (obsolete).
* `arch/` - Architecture specific portions.
* `man/` - Manual pages for the various Mono commands and programs.
+1 -1
View File
@@ -26,7 +26,7 @@ i?86-*-linux*|i?86-apple-darwin*|x86_64-*-linux*|powerpc-*-linux*|powerpc64-*-li
|amd64-*-freebsd*|i?86-*-freebsd*|ia64-*-freebsd*|arm*-*-linux*|sparc*-*-linux*|mips*-*-linux*|x86_64-apple-darwin*|aarch64*)
pic_options='-fPIC'
;;
?86-pc-cygwin*|i?86-pc-cygwin*|i?86-pc-mingw32*)
?86-pc-cygwin*|i?86-pc-cygwin*)
pic_options='-DDLL_EXPORT'
;;
i?86-apple-darwin*|arm-apple-darwin*)
-98
View File
@@ -1,98 +0,0 @@
#
# Appveyor configuration file for CI build of Mono on Windows (under Cygwin)
#
# For further details see http://www.appveyor.com
#
# Use 'unstable' Appveyor build worker image as Appveyor have added Cygwin to this for us
os: Unstable
#
# Custom environment variables
#
environment:
global:
CYG_ROOT: C:/cygwin
CYG_MIRROR: http://cygwin.mirror.constant.com
CYG_CACHE: C:/cygwin/var/cache/setup
NSIS_ROOT: C:\nsis
#
# Initialisation prior to pulling the Mono repository
#
init:
- 'echo Building Mono for Windows'
- 'echo System architecture: %PLATFORM%'
- 'echo Repo build branch is: %APPVEYOR_REPO_BRANCH%'
- 'echo Build folder is: %APPVEYOR_BUILD_FOLDER%'
# Attempt to ensure we don't try to convert line endings to Win32 CRLF as this will cause build to fail
- 'git config --global core.autocrlf input'
#
# Install needed build dependencies
#
install:
# NOTE: Already installed on current Appveyor unstable image
# - 'echo Retrieving Cygwin'
# - 'appveyor DownloadFile http://cygwin.com/setup-x86.exe -FileName %CYGROOT%/setup-x86.exe'
- 'echo Setting up Cygwin dependencies'
- '%CYG_ROOT%\setup-x86.exe -qnNdO -R "%CYG_ROOT%" -s "%CYG_MIRROR%" -l "%CYG_CACHE%" -P autoconf -P automake -P bison -P gcc-core -P gcc-g++ -P mingw-runtime -P mingw-binutils -P mingw-gcc-core -P mingw-gcc-g++ -P mingw-pthreads -P mingw-w32api -P libtool -P make -P python -P gettext-devel -P gettext -P intltool -P libiconv -P pkg-config -P git -P wget -P curl > NUL'
- 'echo Check Cygwin setup'
- '%CYG_ROOT%/bin/bash -lc "cygcheck -dc cygwin"'
- 'echo Done setting up Cygwin'
- 'echo Retrieving NSIS'
- 'appveyor DownloadFile "http://sunet.dl.sourceforge.net/project/nsis/NSIS 2/2.46/nsis-2.46-setup.exe" -FileName nsissetup.exe'
- 'echo Setting up NSIS'
- 'nsissetup.exe /S /D=%NSIS_ROOT%'
- 'echo Done setting up NSIS'
#
# NOTE: msbuild doesn't work at present so use Cygwin to build
#
#build:
# project: C:\projects\mono\msvc\mono.sln
# verbosity: detailed
# Cygwin build script
#
# NOTES:
#
# The stdin/stdout file descriptor appears not to be valid for the Appveyor
# build which causes failures as certain functions attempt to redirect
# default file handles. Ensure a dummy file descriptor is opened with exec.
#
build_script:
- cmd: 'echo Cygwin root is: %CYG_ROOT%'
- cmd: 'echo Build folder is: %APPVEYOR_BUILD_FOLDER%'
- cmd: 'echo Repo build branch is: %APPVEYOR_REPO_BRANCH%'
- cmd: 'echo Repo build commit is: %APPVEYOR_REPO_COMMIT%'
- cmd: 'echo Autogen running...'
- cmd: '%CYG_ROOT%/bin/bash -lc "cd $APPVEYOR_BUILD_FOLDER; exec 0</dev/null; NOCONFIGURE=1 ./autogen.sh --prefix=/usr/local --with-preview=yes"'
- cmd: 'echo Configure running...'
- cmd: '%CYG_ROOT%/bin/bash -lc "cd $APPVEYOR_BUILD_FOLDER; exec 0</dev/null; ./configure --host=i686-pc-mingw32"'
- cmd: 'echo Pulling monolite latest...'
- cmd: '%CYG_ROOT%/bin/bash -lc "cd $APPVEYOR_BUILD_FOLDER; exec 0</dev/null; make get-monolite-latest"'
- cmd: 'echo Make running...'
- cmd: '%CYG_ROOT%/bin/bash -lc "cd $APPVEYOR_BUILD_FOLDER; exec 0</dev/null; make"'
- cmd: 'echo Installing...'
- cmd: 'mkdir %APPVEYOR_BUILD_FOLDER%\install'
- cmd: '%CYG_ROOT%/bin/bash --login -lc "export CYGWIN=winsymlinks:native; mount \"$APPVEYOR_BUILD_FOLDER\install\" /usr/local; cd $APPVEYOR_BUILD_FOLDER; exec 0</dev/null; make install; umount /usr/local"'
# - cmd: 'echo Building package...'
# - cmd: 'cd %APPVEYOR_BUILD_FOLDER%'
# - cmd: '%NSIS_ROOT%\makensis /DMILESTONE=%APPVEYOR_REPO_BRANCH% /DSOURCE_INSTALL_DIR=%APPVEYOR_BUILD_FOLDER\install\*.* /DBUILDNUM=%APPVEYOR_BUILD_VERSION% monowiz.win32.nsi'
# - cmd: 'Building distribution...'
# - cmd: '%CYG_ROOT%/bin/bash -lc "export CYGWIN=winsymlinks:native; cd $APPVEYOR_BUILD_FOLDER; exec 0</dev/null; make dist"'
#
# Disable tests for now
#
test: off
#
# NOTE: Currently this is the Mono installation tree. In future we will create an installation package artifact.
# It has to be relative to the project path. Thus we have installed to within the build tree.
#
artifacts:
- path: install
name: mono-binaries
type: zip
+68 -28
View File
@@ -1,7 +1,7 @@
# Process this file with autoconf to produce a configure script.
#AC_PREREQ([2.62])
AC_INIT(mono, [3.12.1],
AC_INIT(mono, [3.10.1],
[http://bugzilla.xamarin.com/enter_bug.cgi?classification=Mono])
AC_CONFIG_SRCDIR([README.md])
@@ -115,9 +115,9 @@ case "$host" in
AC_DEFINE(MINGW_CROSS_COMPILE,1,[Cross-compiling using MinGW])
fi
HOST_CC="gcc"
# Windows XP SP2 is required
# Windows 2000 is required that includes Internet Explorer 5.01
CPPFLAGS="$CPPFLAGS -DWINVER=0x0502 -D_WIN32_WINNT=0x0502 -D_WIN32_IE=0x0501 -D_UNICODE -DUNICODE -DWIN32_THREADS -DFD_SETSIZE=1024"
LDFLAGS="$LDFLAGS -lmswsock -lws2_32 -lole32 -loleaut32 -lpsapi -lversion -ladvapi32 -lwinmm -lkernel32 -liphlpapi"
LDFLAGS="$LDFLAGS -lmswsock -lws2_32 -lole32 -loleaut32 -lpsapi -lversion -ladvapi32 -lwinmm -lkernel32"
libmono_cflags="-mms-bitfields -mwindows"
libmono_ldflags="-mms-bitfields -mwindows"
libdl=
@@ -578,7 +578,6 @@ else
fi
CFLAGS="$CFLAGS -g $WARN"
CFLAGS_FOR_LIBGC="$CFLAGS_FOR_LIBGC -g"
CPPFLAGS="$CPPFLAGS -g $WARN"
# Where's the 'mcs' source tree?
if test -d $srcdir/mcs; then
@@ -768,7 +767,7 @@ DISABLED_FEATURES=none
AC_ARG_ENABLE(minimal, [ --enable-minimal=LIST drop support for LIST subsystems.
LIST is a comma-separated list from: aot, profiler, decimal, pinvoke, debug, appdomains, verifier,
reflection_emit, reflection_emit_save, large_code, logging, com, ssa, generics, attach, jit, simd, soft_debug, perfcounters, normalization, assembly_remapping, shared_perfcounters, remoting,
security, sgen_remset, sgen_marksweep_par, sgen_marksweep_fixed, sgen_marksweep_fixed_par, sgen_copying, shared_handles.],
security, sgen_remset, sgen_marksweep_par, sgen_marksweep_fixed, sgen_marksweep_fixed_par, sgen_copying.],
[
for feature in `echo "$enable_minimal" | sed -e "s/,/ /g"`; do
eval "mono_feature_disable_$feature='yes'"
@@ -942,11 +941,6 @@ if test "x$mono_feature_disable_sgen_copying" = "xyes"; then
AC_MSG_NOTICE([Disabled major=copying support in SGEN.])
fi
if test "x$mono_feature_disable_shared_handles" = "xyes"; then
AC_DEFINE(DISABLE_SHARED_HANDLES, 1, [Disable inter-process shared handles])
AC_SUBST(DISABLE_SHARED_HANDLES)
fi
AC_ARG_ENABLE(executables, [ --disable-executables disable the build of the runtime executables], enable_executables=$enableval, enable_executables=yes)
AM_CONDITIONAL(DISABLE_EXECUTABLES, test x$enable_executables = xno)
@@ -1200,7 +1194,7 @@ if test x$target_win32 = xno; then
AC_CHECK_HEADERS(execinfo.h)
AC_CHECK_HEADERS(sys/auxv.h sys/resource.h)
AC_CHECK_HEADERS(sys/auxv.h)
AC_CHECK_FUNCS(getgrgid_r)
AC_CHECK_FUNCS(getgrnam_r)
@@ -1219,7 +1213,6 @@ if test x$target_win32 = xno; then
AC_CHECK_FUNCS(dl_iterate_phdr)
AC_CHECK_FUNCS(dladdr)
AC_CHECK_FUNCS(sysconf)
AC_CHECK_FUNCS(getrlimit)
AC_CHECK_FUNCS(sched_setaffinity)
AC_CHECK_FUNCS(sched_getcpu)
@@ -2289,7 +2282,6 @@ if test "x$ac_cv_have_dev_random" = "xno" \
fi
AC_MSG_CHECKING([if inter-process shared handles are requested])
# Same as --enable-minimal=shared_handles
AC_ARG_ENABLE(shared-handles, [ --disable-shared-handles disable inter-process shared handles], try_shared_handles=$enableval, try_shared_handles=yes)
AC_MSG_RESULT($try_shared_handles)
if test "x$try_shared_handles" != "xyes"; then
@@ -2460,6 +2452,8 @@ if test "x$enable_llvm" = "xyes"; then
# Should be something like '2.6' or '2.7svn'
llvm_version=`$LLVM_CONFIG --version`
major_version=`echo $llvm_version | cut -c 1`
minor_version=`echo $llvm_version | cut -c 3`
llvm_api_version=`$LLVM_CONFIG --mono-api-version 2>/dev/null`
AC_MSG_CHECKING(LLVM version)
AC_MSG_RESULT($llvm_version)
@@ -2480,8 +2474,14 @@ if test "x$enable_llvm" = "xyes"; then
AC_MSG_ERROR([Compiling with stock LLVM is not supported, please use the Mono LLVM repo at https://github.com/mono/llvm, with the GIT branch which matches this version of mono, i.e. 'mono-2-10' for Mono 2.10.])
fi
AC_DEFINE_UNQUOTED(LLVM_MAJOR_VERSION, $major_version, [Major version of LLVM libraries])
AC_DEFINE_UNQUOTED(LLVM_MINOR_VERSION, $minor_version, [Minor version of LLVM libraries])
AC_DEFINE_UNQUOTED(LLVM_VERSION, "$llvm_version", [Full version of LLVM libraties])
# Have to pass these on the command line since mini-llvm-cpp.h already includes
# llvm's config.h
LLVM_CXXFLAGS="$LLVM_CXXFLAGS -DLLVM_MAJOR_VERSION=$major_version -DLLVM_MINOR_VERSION=$minor_version"
AC_SUBST(LLVM_CFLAGS)
AC_SUBST(LLVM_CXXFLAGS)
AC_SUBST(LLVM_LIBS)
@@ -2498,6 +2498,8 @@ AM_CONDITIONAL(LOADED_LLVM, [test x$enable_loadedllvm = xyes])
TARGET="unknown"
ACCESS_UNALIGNED="yes"
JIT_SUPPORTED=no
INTERP_SUPPORTED=no
LIBC="libc.so.6"
INTL="libc.so.6"
SQLITE="libsqlite.so.0"
@@ -2510,6 +2512,7 @@ XINERAMA="libXinerama.so.1"
sizeof_register="SIZEOF_VOID_P"
jit_wanted=true
interp_wanted=false
sgen_supported=false
boehm_supported=true
case "$host" in
@@ -2518,6 +2521,7 @@ case "$host" in
arch_target=mips;
sgen_supported=true
ACCESS_UNALIGNED="no"
JIT_SUPPORTED=yes
AC_MSG_CHECKING(for mips n32)
AC_TRY_COMPILE([],[
@@ -2535,6 +2539,7 @@ case "$host" in
i*86-*-*)
TARGET=X86;
arch_target=x86;
JIT_SUPPORTED=yes
case $host_os in
solaris*)
LIBC="libc.so"
@@ -2580,6 +2585,7 @@ case "$host" in
x86_64-*-* | amd64-*-*)
TARGET=AMD64;
arch_target=amd64;
JIT_SUPPORTED=yes
if test "x$ac_cv_sizeof_void_p" = "x4"; then
AC_DEFINE(__mono_ilp32__, 1, [64 bit mode with 4 byte longs and pointers])
sizeof_register=8
@@ -2611,6 +2617,7 @@ case "$host" in
TARGET=IA64
arch_target=ia64
ACCESS_UNALIGNED="no"
JIT_SUPPORTED=yes
LIBC="libc.so.6.1"
INTL="libc.so.6.1"
AC_CHECK_LIB(unwind, _U_dyn_register, [], [AC_MSG_ERROR(library libunwind not found)])
@@ -2623,6 +2630,7 @@ case "$host" in
TARGET=SPARC
fi
arch_target=sparc;
JIT_SUPPORTED=yes
ACCESS_UNALIGNED="no"
case $host_os in
linux*) ;;
@@ -2655,6 +2663,7 @@ case "$host" in
CPPFLAGS="$CPPFLAGS -D__mono_ppc__"
fi
arch_target=ppc;
JIT_SUPPORTED=yes
case $host_os in
linux*|darwin*)
sgen_supported=true
@@ -2665,6 +2674,7 @@ case "$host" in
TARGET=ARM;
arch_target=arm;
ACCESS_UNALIGNED="no"
JIT_SUPPORTED=yes
CPPFLAGS="$CPPFLAGS -D__ARM_EABI__"
sgen_supported=true
;;
@@ -2672,6 +2682,7 @@ case "$host" in
TARGET=ARM;
arch_target=arm;
ACCESS_UNALIGNED="no"
JIT_SUPPORTED=yes
sgen_supported=true
AOT_SUPPORTED="yes"
CPPFLAGS="$CPPFLAGS -D__ARM_EABI__"
@@ -2681,6 +2692,7 @@ case "$host" in
# TARGET=ARM;
# arch_target=arm;
# ACCESS_UNALIGNED="no"
# JIT_SUPPORTED=yes
# sgen_supported=true
# AOT_SUPPORTED="no"
# ;;
@@ -2688,6 +2700,7 @@ case "$host" in
# https://lkml.org/lkml/2012/7/15/133
TARGET=ARM64
arch_target=arm64
JIT_SUPPORTED=yes
sgen_supported=true
boehm_supported=false
;;
@@ -2695,6 +2708,7 @@ case "$host" in
TARGET=S390X;
arch_target=s390x;
ACCESS_UNALIGNED="yes"
JIT_SUPPORTED=yes
sgen_supported=true
CFLAGS="$CFLAGS -mbackchain -D__USE_STRING_INLINES"
;;
@@ -2710,7 +2724,9 @@ if test "x$host" != "x$target"; then
TARGET=ARM;
arch_target=arm;
ACCESS_UNALIGNED="no"
JIT_SUPPORTED=yes
CPPFLAGS="$CPPFLAGS -D__ARM_EABI__"
jit_wanted=true
# Can't use tls, since it depends on the runtime detection of tls offsets
# in mono-compiler.h
with_tls=pthread
@@ -2748,6 +2764,7 @@ if test "x$host" != "x$target"; then
# arch_target=arm
# AC_DEFINE(TARGET_ARM, 1, [...])
# ACCESS_UNALIGNED="no"
# JIT_SUPPORTED=yes
# sizeof_register=4
# CPPFLAGS="$CPPFLAGS \
# -D__ARM_EABI__ \
@@ -2757,6 +2774,7 @@ if test "x$host" != "x$target"; then
# -DDISABLE_SOCKETS \
# -DDISABLE_ATTACH \
# -DUSE_NEWLIB"
# jit_wanted=true
# Can't use tls, since it depends on the runtime detection of tls offsets
# in mono-compiler.h
# with_tls=pthread
@@ -2773,7 +2791,9 @@ if test "x$host" != "x$target"; then
AC_DEFINE(TARGET_ARM, 1, [...])
AC_DEFINE(TARGET_ANDROID, 1, [...])
ACCESS_UNALIGNED="no"
JIT_SUPPORTED=yes
CPPFLAGS="$CPPFLAGS -D__ARM_EABI__"
jit_wanted=true
# Can't use tls, since it depends on the runtime detection of tls offsets
# in mono-compiler.h
with_tls=pthread
@@ -2788,20 +2808,10 @@ if test "x$host" != "x$target"; then
;;
esac
;;
i686*-linux-*)
TARGET=X86;
arch_target=x86;
AC_DEFINE(TARGET_X86, 1, [...])
AC_DEFINE(TARGET_ANDROID, 1, [...])
CPPFLAGS="$CPPFLAGS"
sgen_supported=true
# Can't use tls, since it depends on the runtime detection of tls offsets
# in mono-compiler.h
with_tls=pthread
target_mach=no
;;
aarch64-*)
TARGET=ARM64
JIT_SUPPORTED=yes
jit_wanted=true
;;
*)
AC_MSG_ERROR([Cross compiling is not supported for target $target])
@@ -2924,7 +2934,27 @@ fi
AC_SUBST(SGEN_DEFINES)
AM_CONDITIONAL(SUPPORT_SGEN, test x$buildsgen = xyes)
jit_status="Building and using the JIT"
USEJIT=false
if test x$JIT_SUPPORTED = xyes; then
if $jit_wanted; then
USEJIT=true
jit_status="Building and using the JIT"
else
if $interp_wanted; then
jit_status="Building the JIT, defaulting to the interpreter"
else
AC_ERROR(No JIT or interpreter support available or selected.)
fi
fi
else
if test x$interp_wanted = xtrue; then
jit_status="interpreter"
else
AC_ERROR(No JIT or interpreter support available or selected.)
fi
fi
AM_CONDITIONAL(USE_JIT, test x$USEJIT = xtrue)
libsuffix=".so"
@@ -3199,7 +3229,7 @@ case "x$libgc" in
;;
esac
AC_ARG_WITH(profile2, [ --with-profile2=yes,no If you want to install the 2.0/3.5 FX (defaults to yes)], [], [with_profile2=no])
AC_ARG_WITH(profile2, [ --with-profile2=yes,no If you want to install the 2.0/3.5 FX (defaults to yes)], [], [with_profile2=yes])
AC_ARG_WITH(profile4, [ --with-profile4=yes,no If you want to install the 4.0 FX (defaults to yes)], [], [with_profile4=yes])
AC_ARG_WITH(profile4_5,[ --with-profile4_5=yes,no If you want to install the 4.5 FX (defaults to yes)], [], [with_profile4_5=yes])
AC_ARG_WITH(monodroid, [ --with-monodroid=yes,no If you want to build the MonoDroid assemblies (defaults to no)], [], [with_monodroid=no])
@@ -3275,6 +3305,7 @@ dnl Consistency settings
dnl
if test x$cross_compiling = xyes -o x$enable_mcs_build = xno; then
DISABLE_MCS_DOCS=yes
with_profile2=no
with_profile4=no
with_profile4_5=no
with_monodroid=no
@@ -3298,6 +3329,7 @@ AC_SUBST(OPROFILE_LIBS)
libmono_ldflags="$libmono_ldflags $LIBS"
AM_CONDITIONAL(INSTALL_2_0, [test "x$with_profile2" = xyes])
AM_CONDITIONAL(INSTALL_4_0, [test "x$with_profile4" = xyes])
AM_CONDITIONAL(INSTALL_4_5, [test "x$with_profile4_5" = xyes])
AM_CONDITIONAL(INSTALL_MONODROID, [test "x$with_monodroid" != "xno"])
@@ -3325,6 +3357,8 @@ AM_CONDITIONAL(HOST_ARM, test x$HOST = xARM)
AM_CONDITIONAL(HOST_ARM64, test x$HOST = xARM64)
AM_CONDITIONAL(CROSS_COMPILE, test "x$host" != "x$target")
AM_CONDITIONAL(JIT_SUPPORTED, test x$JIT_SUPPORTED = xyes)
AM_CONDITIONAL(INTERP_SUPPORTED, test x$interp_wanted = xtrue)
AM_CONDITIONAL(INCLUDED_LIBGC, test x$libgc = xincluded)
AC_SUBST(LIBC)
@@ -3344,7 +3378,11 @@ AC_SUBST(LDFLAGS)
mono_build_root=`pwd`
AC_SUBST(mono_build_root)
mono_runtime=mono/mini/mono
if test x$USEJIT = xtrue; then
mono_runtime=mono/mini/mono
else
mono_runtime=mono/interpreter/mint
fi
AC_SUBST(mono_runtime)
mono_cfg_root=$mono_build_root/runtime
@@ -3541,6 +3579,7 @@ mono/arch/arm/Makefile
mono/arch/arm64/Makefile
mono/arch/ia64/Makefile
mono/arch/mips/Makefile
mono/interpreter/Makefile
mono/tests/Makefile
mono/tests/tests-config
mono/tests/assemblyresolve/Makefile
@@ -3742,6 +3781,7 @@ echo "
LLVM Back End: $enable_llvm (dynamically loaded: $enable_loadedllvm)
Libraries:
.NET 2.0/3.5: $with_profile2
.NET 4.0: $with_profile4
.NET 4.5: $with_profile4_5
MonoDroid: $with_monodroid
+9
View File
@@ -26,8 +26,17 @@ else
SGENPCFILE=
endif
if JIT_SUPPORTED
if INTERP_SUPPORTED
pkgconfig_DATA= mono.pc mono-2.pc mint.pc dotnet.pc dotnet35.pc wcf.pc mono-nunit.pc mono-cairo.pc mono-options.pc cecil.pc monodoc.pc mono-lineeditor.pc system.web.extensions_1.0.pc \
system.web.extensions.design_1.0.pc system.web.mvc.pc system.web.mvc2.pc system.web.mvc3.pc aspnetwebstack.pc reactive.pc xbuild12.pc $(SGENPCFILE)
else
pkgconfig_DATA= mono.pc mono-2.pc dotnet.pc dotnet35.pc wcf.pc mono-nunit.pc mono-cairo.pc mono-options.pc cecil.pc monodoc.pc mono-lineeditor.pc system.web.extensions_1.0.pc \
system.web.extensions.design_1.0.pc system.web.mvc.pc system.web.mvc2.pc system.web.mvc3.pc aspnetwebstack.pc reactive.pc xbuild12.pc $(SGENPCFILE)
endif
else
pkgconfig_DATA= mint.pc mono-nunit.pc mono-cairo.pc mono-options.pc cecil.pc monodoc.pc mono-lineeditor.pc
endif
DISTCLEANFILES= mono-2.pc mono.pc mint.pc dotnet.pc dotnet35.pc wcf.pc mono-nunit.pc mono-cairo.pc mono-options.pc cecil.pc monodoc.pc mono-lineeditor.pc system.web.extensions_1.0.pc \
system.web.extensions.design_1.0.pc system.web.mvc.pc system.web.mvc2.pc system.web.mvc3.pc aspnetwebstack.pc reactive.pc $(SGENPCFILE) mono-sgen-gdb.py
+1 -1
View File
@@ -10,7 +10,7 @@
<dllmap dll="i:odbc32.dll" target="libiodbc.dylib" os="osx"/>
<dllmap dll="oci" target="libclntsh@libsuffix@" os="!windows"/>
<dllmap dll="db2cli" target="libdb2_36@libsuffix@" os="!windows"/>
<dllmap dll="MonoPosixHelper" target="@prefix@/@reloc_libdir@/libMonoPosixHelper@libsuffix@" os="!windows" />
<dllmap dll="MonoPosixHelper" target="@prefix@/lib/libMonoPosixHelper@libsuffix@" os="!windows" />
<dllmap dll="i:msvcrt" target="@LIBC@" os="!windows"/>
<dllmap dll="i:msvcrt.dll" target="@LIBC@" os="!windows"/>
<dllmap dll="sqlite" target="@SQLITE@" os="!windows"/>
+3 -3
View File
@@ -99,14 +99,14 @@ mono-file-formats.tree: $(srcdir)/docs.make $(srcdir)/Makefile.am $(srcdir)/depl
deploy/.stamp: convert.exe Makefile.am
$(mkdir_p) html
runtimedir=`cd ../runtime && pwd`; export runtimedir; \
MONO_PATH=../mcs/class/lib/net_4_5 perl $(srcdir)/exdoc -h $(srcdir) -t . $(srcdir)/../mono/*/*.c
MONO_PATH=../mcs/class/lib/net_2_0 perl $(srcdir)/exdoc -h $(srcdir) -t . $(srcdir)/../mono/*/*.c
touch $@
extract: deploy/.stamp
convert.exe: convert.cs AgilityPack.dll
$(TOOL_MAKE) PROFILE=net_4_5 convert.exe
$(TOOL_MAKE) PROFILE=net_2_0 convert.exe
AgilityPack.dll:
$(TOOL_MAKE) PROFILE=net_4_5 AgilityPack.dll
$(TOOL_MAKE) PROFILE=net_2_0 AgilityPack.dll
+1 -1
View File
@@ -26,7 +26,7 @@ i?86-*-linux*|i?86-apple-darwin*|x86_64-*-linux*|powerpc-*-linux*|powerpc64-*-li
|amd64-*-freebsd*|i?86-*-freebsd*|ia64-*-freebsd*|arm*-*-linux*|sparc*-*-linux*|mips*-*-linux*|x86_64-apple-darwin*|aarch64*)
pic_options='-fPIC'
;;
?86-pc-cygwin*|i?86-pc-cygwin*|i?86-pc-mingw32*)
?86-pc-cygwin*|i?86-pc-cygwin*)
pic_options='-DDLL_EXPORT'
;;
i?86-apple-darwin*|arm-apple-darwin*)
+8
View File
@@ -57,6 +57,14 @@ typedef struct {
Slot *slot;
} Iter;
size_t
mono_eg_hashtable_get_memory_size (GHashTable *hashtable)
{
return sizeof (GHashTable) +
hashtable->in_use * sizeof (Slot) +
hashtable->table_size * sizeof (Slot*);
}
static const guint prime_tbl[] = {
11, 19, 37, 73, 109, 163, 251, 367, 557, 823, 1237,
1861, 2777, 4177, 6247, 9371, 14057, 21089, 31627,
+2
View File
@@ -467,6 +467,8 @@ guint g_spaced_primes_closest (guint x);
#define g_hash_table_insert(h,k,v) g_hash_table_insert_replace ((h),(k),(v),FALSE)
#define g_hash_table_replace(h,k,v) g_hash_table_insert_replace ((h),(k),(v),TRUE)
size_t mono_eg_hashtable_get_memory_size (GHashTable *hashtable);
gboolean g_direct_equal (gconstpointer v1, gconstpointer v2);
guint g_direct_hash (gconstpointer v1);
gboolean g_int_equal (gconstpointer v1, gconstpointer v2);
+1 -1
View File
@@ -176,7 +176,7 @@ default_stderr_handler (const gchar *message)
}
#elif defined(HOST_IOS)
#elif MONOTOUCH
#include <asl.h>
static int
+1 -1
View File
@@ -26,7 +26,7 @@ i?86-*-linux*|i?86-apple-darwin*|x86_64-*-linux*|powerpc-*-linux*|powerpc64-*-li
|amd64-*-freebsd*|i?86-*-freebsd*|ia64-*-freebsd*|arm*-*-linux*|sparc*-*-linux*|mips*-*-linux*|x86_64-apple-darwin*|aarch64*)
pic_options='-fPIC'
;;
?86-pc-cygwin*|i?86-pc-cygwin*|i?86-pc-mingw32*)
?86-pc-cygwin*|i?86-pc-cygwin*)
pic_options='-DDLL_EXPORT'
;;
i?86-apple-darwin*|arm-apple-darwin*)
+1 -1
View File
@@ -32,7 +32,7 @@
# define GC_LINUX_THREADS
#endif
#if defined(WIN32_THREADS)
# define GC_WIN32_THREADS 1
# define GC_WIN32_THREADS
#endif
#if defined(USE_LD_WRAP)
# define GC_USE_LD_WRAP
+13 -9
View File
@@ -1075,10 +1075,19 @@ first generation (of two). A larger nursery will usually speed up the
program but will obviously use more memory. The default nursery size
4 MB.
.TP
\fBmajor=\fIcollector\fR Specifies which major collector to use.
Options are `marksweep' for the Mark&Sweep collector, and
`marksweep-conc' for concurrent Mark&Sweep. The non-concurrent
Mark&Sweep collector is the default.
\fBmajor=\fIcollector\fR
Specifies which major collector to use. Options are `marksweep' for
the Mark&Sweep collector, `marksweep-conc' for concurrent Mark&Sweep,
`marksweep-par' for parallel Mark&Sweep, `marksweep-fixed' for
Mark&Sweep with a fixed heap, and `marksweep-fixed-par' for parallel
Mark&Sweep with a fixed heap. The Mark&Sweep collector is the default.
.TP
\fBmajor-heap-size=\fIsize\fR
Sets the size of the major heap (not including the large object space)
for the fixed-heap Mark&Sweep collector (i.e. `marksweep-fixed' and
`marksweep-fixed-par'). The size is in bytes, with optional suffixes
`k', `m' and `g' to specify kilo-, mega- and gigabytes, respectively.
The default is 512 megabytes.
.TP
\fBsoft-heap-limit=\fIsize\fR
Once the heap size gets larger than this size, ignore what the default
@@ -1257,11 +1266,6 @@ work, Mono needs to be compiled with the BINARY_PROTOCOL define on
sgen-gc.c. You can then use this command to explore the output
.nf
sgen-grep-binprot 0x1234 0x5678 < file
.TP
\fBnursery-canaries\fR
If set, objects allocated in the nursery are suffixed with a canary (guard)
word, which is checked on each minor collection. Can be used to detect/debug
heap corruption issues.
.fi
.ne
.RE
+5 -5
View File
@@ -6,16 +6,16 @@ SUBDIRS := build jay mcs class nunit24 ilasm tools tests errors docs
basic_SUBDIRS := build jay mcs class
build_SUBDIRS := build class mcs class/aot-compiler tools
net_2_0_SUBDIRS := build class nunit24 ilasm tools tests errors docs
monodroid_SUBDIRS := build class
monotouch_SUBDIRS := build class
monotouch_runtime_SUBDIRS := build class
xammac_SUBDIRS := build class
mobile_SUBDIRS := build class
mobile_static_SUBDIRS := build class
net_3_5_SUBDIRS := build class tools/xbuild
net_4_0_SUBDIRS := build class
net_4_5_SUBDIRS := build mcs class nunit24 ilasm tools tests errors docs
xbuild_12_SUBDIRS := build class tools/xbuild
xbuild_14_SUBDIRS := build class tools/xbuild
# List of test subdirs that should pass 100%
centum_tests := \
@@ -86,7 +86,7 @@ dir-check:
# fun specialty targets
PROFILES = net_3_5 net_4_0 net_4_5 xbuild_12 xbuild_14
PROFILES = net_2_0 net_3_5 net_4_0 net_4_5 xbuild_12
.PHONY: all-profiles $(STD_TARGETS:=-profiles)
all-profiles $(STD_TARGETS:=-profiles): %-profiles: profiles-do--%
@@ -105,16 +105,16 @@ profiles-do--run-test:
# Orchestrate the bootstrap here.
_boot_ = all clean install
$(_boot_:%=profile-do--xbuild_14--%): profile-do--xbuild_14--%: profile-do--net_4_5--%
$(_boot_:%=profile-do--xbuild_12--%): profile-do--xbuild_12--%: profile-do--net_4_5--%
$(_boot_:%=profile-do--net_4_5--%): profile-do--net_4_5--%: profile-do--build--%
$(_boot_:%=profile-do--net_4_0--%): profile-do--net_4_0--%: profile-do--build--%
$(_boot_:%=profile-do--net_3_5--%): profile-do--net_3_5--%: profile-do--net_2_0--%
$(_boot_:%=profile-do--monodroid--%): profile-do--monodroid--%: profile-do--build--%
$(_boot_:%=profile-do--monotouch--%): profile-do--monotouch--%: profile-do--build--%
$(_boot_:%=profile-do--monotouch_runtime--%): profile-do--monotouch_runtime--%: profile-do--build--%
$(_boot_:%=profile-do--xammac--%): profile-do--xammac--%: profile-do--build--%
$(_boot_:%=profile-do--mobile--%): profile-do--mobile--%: profile-do--build--%
$(_boot_:%=profile-do--mobile_static--%): profile-do--mobile_static--%: profile-do--build--%
$(_boot_:%=profile-do--net_2_0--%): profile-do--net_2_0--%: profile-do--build--%
$(_boot_:%=profile-do--build--%): profile-do--build--%: profile-do--basic--%
testcorlib:
+1 -2
View File
@@ -22,8 +22,7 @@ PROFILES = \
net_3_5 \
net_4_0 \
net_4_5 \
xbuild_12 \
xbuild_14
xbuild_12
COMMON_SRCS = \
Consts.cs.in \
+1 -16
View File
@@ -12,22 +12,7 @@ profile-check:
@:
DEFAULT_REFERENCES = -r:mscorlib.dll
PROFILE_MCS_FLAGS = \
-d:NET_1_1 \
-d:NET_2_0 \
-d:NET_2_1 \
-d:MOBILE \
-d:MOBILE_DYNAMIC \
-d:NET_3_5 \
-d:NET_4_0 \
-d:NET_4_5 \
-nowarn:1699 \
-nostdlib \
-lib:$(topdir)/class/lib/$(PROFILE) \
$(DEFAULT_REFERENCES) \
$(PLATFORM_DEBUG_FLAGS)
PROFILE_MCS_FLAGS = -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:MOBILE -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -nowarn:1699 -nostdlib -lib:$(topdir)/class/lib/$(PROFILE) $(DEFAULT_REFERENCES) $(PLATFORM_DEBUG_FLAGS)
FRAMEWORK_VERSION = 2.1
NO_INSTALL = yes
+1 -18
View File
@@ -12,24 +12,7 @@ profile-check:
@:
DEFAULT_REFERENCES = -r:mscorlib.dll
PROFILE_MCS_FLAGS = \
-d:NET_1_1 \
-d:NET_2_0 \
-d:NET_2_1 \
-d:NET_3_5 \
-d:NET_4_0 \
-d:NET_4_5 \
-d:MOBILE \
-d:FULL_AOT_RUNTIME \
-d:DISABLE_REMOTING \
-d:DISABLE_COM \
-nowarn:1699 \
-nostdlib \
-lib:$(topdir)/class/lib/$(PROFILE) \
$(DEFAULT_REFERENCES) \
$(PLATFORM_DEBUG_FLAGS)
PROFILE_MCS_FLAGS = -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE -d:FULL_AOT_RUNTIME -d:DISABLE_REMOTING -d:DISABLE_COM -nowarn:1699 -nostdlib -lib:$(topdir)/class/lib/$(PROFILE) $(DEFAULT_REFERENCES) $(PLATFORM_DEBUG_FLAGS)
FRAMEWORK_VERSION = 2.1
NO_TEST = yes
+1 -18
View File
@@ -12,24 +12,7 @@ profile-check:
@:
DEFAULT_REFERENCES = -r:mscorlib.dll
PROFILE_MCS_FLAGS = \
-d:NET_1_1 \
-d:NET_2_0 \
-d:NET_2_1 \
-d:NET_3_5 \
-d:NET_4_0 \
-d:NET_4_5 \
-d:MOBILE \
-d:MOBILE_DYNAMIC \
-d:MONODROID \
-d:ANDROID \
-nowarn:1699 \
-nostdlib \
-lib:$(topdir)/class/lib/$(PROFILE) \
$(DEFAULT_REFERENCES) \
$(PLATFORM_DEBUG_FLAGS)
PROFILE_MCS_FLAGS = -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE -d:MOBILE_DYNAMIC -d:MONODROID -nowarn:1699 -nostdlib -lib:$(topdir)/class/lib/$(PROFILE) $(DEFAULT_REFERENCES) $(PLATFORM_DEBUG_FLAGS)
FRAMEWORK_VERSION = 2.1
NO_TEST = yes
+2 -20
View File
@@ -12,27 +12,9 @@ profile-check:
@:
DEFAULT_REFERENCES = -r:mscorlib.dll
PROFILE_MCS_FLAGS = \
-d:NET_1_1 \
-d:NET_2_0 \
-d:NET_2_1 \
-d:NET_3_5 \
-d:NET_4_0 \
-d:NET_4_5 \
-d:MOBILE \
-d:MONOTOUCH \
-d:DISABLE_REMOTING \
-d:DISABLE_COM \
-d:FULL_AOT_RUNTIME \
-nowarn:1699 \
-nostdlib \
-lib:$(topdir)/class/lib/$(PROFILE) \
$(DEFAULT_REFERENCES) \
$(PLATFORM_DEBUG_FLAGS)
PROFILE_MCS_FLAGS = -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FULL_AOT_RUNTIME -nowarn:1699 -nostdlib -lib:$(topdir)/class/lib/$(PROFILE) $(DEFAULT_REFERENCES) $(PLATFORM_DEBUG_FLAGS)
FRAMEWORK_VERSION = 2.1
NO_TEST = yes
# the tuner takes care of the install
NO_INSTALL = yes
NO_INSTALL = yes
+16
View File
@@ -0,0 +1,16 @@
# -*- makefile -*-
BOOTSTRAP_PROFILE = build
BOOTSTRAP_MCS = MONO_PATH="$(topdir)/class/lib/$(BOOTSTRAP_PROFILE)$(PLATFORM_PATH_SEPARATOR)$$MONO_PATH" $(INTERNAL_GMCS)
MCS = MONO_PATH="$(topdir)/class/lib/$(BOOTSTRAP_PROFILE)$(PLATFORM_PATH_SEPARATOR)$$MONO_PATH" $(INTERNAL_GMCS)
# nuttzing!
profile-check:
@:
DEFAULT_REFERENCES = -r:mscorlib.dll
PROFILE_MCS_FLAGS = -d:NET_1_1 -d:NET_2_0 -nowarn:1699 -nostdlib -lib:$(topdir)/class/lib/$(PROFILE) $(DEFAULT_REFERENCES) $(PLATFORM_DEBUG_FLAGS)
FRAMEWORK_VERSION = 2.0
XBUILD_VERSION = 2.0
+20
View File
@@ -0,0 +1,20 @@
# -*- makefile -*-
BOOTSTRAP_PROFILE = build
MCS = MONO_PATH="$(topdir)/class/lib/$(BOOTSTRAP_PROFILE)$(PLATFORM_PATH_SEPARATOR)$$MONO_PATH" $(INTERNAL_GMCS)
# nuttzing!
profile-check:
@:
DEFAULT_REFERENCES = -r:mscorlib.dll
PROFILE_MCS_FLAGS = -d:NET_1_1 -d:NET_2_0 -d:NET_3_5 -nowarn:1699 -nostdlib -lib:$(topdir)/class/lib/$(PROFILE) -lib:$(topdir)/class/lib/net_2_0 $(DEFAULT_REFERENCES) $(PLATFORM_DEBUG_FLAGS)
FRAMEWORK_VERSION = 3.5
XBUILD_VERSION = 3.5
TEST_HARNESS = $(topdir)/class/lib/net_2_0/nunit-console.exe
TEST_MONO_PATH = $(topdir)/class/lib/net_2_0
-7
View File
@@ -1,7 +0,0 @@
# -*- makefile -*-
include $(topdir)/build/profiles/net_4_5.make
PROFILE_MCS_FLAGS := $(PROFILE_MCS_FLAGS) -d:XBUILD_12 -d:XBUILD_14 -lib:$(topdir)/class/lib/net_4_5
XBUILD_VERSION = 14.0
@@ -107,7 +107,7 @@ namespace Commons.Xml.Relaxng.Rnc
public RelaxngPattern Parse (TextReader source, string baseUri, string defaultNamespace)
{
this.defaultNamespace = defaultNamespace ?? string.Empty;
this.defaultNamespace = defaultNamespace;
if (defaultNamespace != null && defaultNamespace.Length != 0)
nsmgr.AddNamespace (String.Empty, defaultNamespace);
try {
@@ -13,7 +13,7 @@ using System.Xml;
using Commons.Xml.Nvdl;
using NUnit.Framework;
namespace MonoTests.Commons.Xml.Relaxng
namespace MonoTests.Commons.Xml.Nvdl
{
[TestFixture]
public class NvdlValidatingReaderTests
@@ -95,19 +95,5 @@ start = mine";
r.Close ();
}
}
[Test]
public void SimpleDefaultNamespace ()
{
var g = RncParser.ParseRnc (new StringReader ("element e { empty }"));
var x = XmlReader.Create (new StringReader ("<e/>"));
var r = new RelaxngValidatingReader (x, g);
try {
while (!r.EOF)
r.Read ();
} finally {
r.Close ();
}
}
}
}
@@ -8,7 +8,7 @@ TEST_ARCHIVE = testSuite.zip
RNCTESTS = test/RNCTest.xml
RNCTEST_ARCHIVE = anglia-test-suite.zip
all : relaxngtest.exe #anglia-test-runner.exe
all : relaxngtest.exe anglia-test-runner.exe
relaxngtest.exe : relaxngtest.cs $(TESTS)
$(MCS_RUNTIME) $(MCS) -debug+ relaxngtest.cs -r:Commons.Xml.Relaxng.dll
@@ -40,7 +40,6 @@
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Runtime.InteropServices.COMException))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Runtime.InteropServices.ComMemberType))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Runtime.InteropServices.ComSourceInterfacesAttribute))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Runtime.InteropServices.ComInterfaceType))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Runtime.InteropServices.ComTypes.IStream))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Runtime.InteropServices.ComTypes.STATSTG))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Runtime.InteropServices.CriticalHandle))]
+22 -24
View File
@@ -33,7 +33,6 @@ net_2_0_dirs := \
System.EnterpriseServices \
Mono.Data.Tds \
System.Data \
System.ComponentModel.DataAnnotations \
Accessibility \
Mono.WebBrowser \
System.Runtime.Serialization.Formatters.Soap \
@@ -82,6 +81,7 @@ net_2_0_dirs := \
System.ServiceModel \
System.Web.Extensions \
System.Web.Extensions.Design \
System.ComponentModel.DataAnnotations \
System.Web.DynamicData \
System.Web.Mvc2 \
Mono.C5 \
@@ -106,7 +106,7 @@ net_2_0_only_dirs := \
pcl_facade_dirs := Facades
mobile_common_dirs := \
mobile_dirs := \
corlib \
System \
System.Core \
@@ -134,27 +134,19 @@ mobile_common_dirs := \
System.Net \
System.Windows \
System.Xml.Serialization \
Mono.CSharp \
Microsoft.CSharp \
$(pcl_facade_dirs)
mobile_static_dirs := \
$(mobile_common_dirs) \
Mono.Dynamic.Interpreter
mobile_dynamic_dirs := \
$(mobile_common_dirs) \
monodroid_dirs := \
Mono.CompilerServices.SymbolWriter \
Mono.CSharp \
Microsoft.CSharp \
System.Net.Http
xammac_dirs := \
$(mobile_dynamic_dirs)
monodroid_dirs := \
$(mobile_dynamic_dirs)
monotouch_dirs := \
$(mobile_static_dirs)
Mono.CompilerServices.SymbolWriter \
Mono.CSharp \
Microsoft.CSharp \
System.Net.Http
monotouch_runtime_dirs := \
corlib \
@@ -163,6 +155,11 @@ monotouch_runtime_dirs := \
System.XML \
Mono.CSharp
monotouch_dirs := \
Mono.CSharp \
Microsoft.CSharp \
Mono.Dynamic.Interpreter
net_4_0_dirs := \
System.Numerics \
Microsoft.CSharp \
@@ -231,20 +228,21 @@ xbuild_4_0_dirs := \
$(xbuild_2_0_dirs) \
Microsoft.Build
monodroid_SUBDIRS := $(monodroid_dirs)
monotouch_SUBDIRS := $(monotouch_dirs)
net_2_0_SUBDIRS := $(net_2_0_dirs) $(net_2_0_only_dirs) $(xbuild_2_0_dirs) aot-compiler
monodroid_SUBDIRS := $(mobile_dirs) $(monodroid_dirs)
monotouch_SUBDIRS := $(mobile_dirs) $(monotouch_dirs)
monotouch_runtime_SUBDIRS := $(monotouch_runtime_dirs)
mobile_static_SUBDIRS := $(mobile_static_dirs)
mobile_SUBDIRS := $(mobile_dynamic_dirs)
xammac_SUBDIRS := $(xammac_dirs)
mobile_static_SUBDIRS := $(mobile_dirs)
mobile_SUBDIRS := $(mobile_dirs)
xammac_SUBDIRS := $(mobile_dirs) $(xammac_dirs)
net_3_5_SUBDIRS := $(xbuild_2_0_dirs)
net_4_0_SUBDIRS := $(net_2_0_dirs) $(net_4_0_dirs) $(net_4_0_only_dirs) $(xbuild_4_0_dirs)
net_4_5_SUBDIRS := $(net_2_0_dirs) $(net_4_0_dirs) $(net_4_5_dirs) $(xbuild_4_0_dirs) aot-compiler
xbuild_12_SUBDIRS := $(xbuild_4_0_dirs)
xbuild_14_SUBDIRS := $(xbuild_4_0_dirs)
include ../build/rules.make
SUBDIRS = $(net_2_0_dirs) $(net_2_0_only_dirs) $(mobile_static_dirs) $(mobile_dynamic_dirs) $(monotouch_dirs) $(monodroid_dirs) $(xammac_dirs) $(net_4_0_dirs) $(net_4_0_only_dirs) $(net_4_5_dirs)
SUBDIRS = $(net_2_0_dirs) $(net_2_0_only_dirs) $(mobile_dirs) $(monotouch_dirs) $(net_4_0_dirs) $(net_4_0_only_dirs) $(net_4_5_dirs)
DIST_ONLY_SUBDIRS = dlr aot-compiler $(xbuild_4_0_dirs)
@@ -175,7 +175,7 @@ namespace System.Windows.Forms {
Rectangle text_rectangle;
Rectangle image_rectangle;
ThemeEngine.Current.CalculateButtonTextAndImageLayout (pevent.Graphics, this, out text_rectangle, out image_rectangle);
ThemeEngine.Current.CalculateButtonTextAndImageLayout (this, out text_rectangle, out image_rectangle);
// Draw our button
if (this.FlatStyle == FlatStyle.Standard)
@@ -28,14 +28,9 @@
using System;
using System.Drawing;
using System.Diagnostics;
using System.IO;
namespace System.Windows.Forms
{
/// <summary>
/// http://msdn.microsoft.com/en-us/library/System.Windows.Forms.Help(v=vs.110).aspx
/// </summary>
public class Help
{
#region Constructor
@@ -47,7 +42,7 @@ namespace System.Windows.Forms
#region Public Static Methods
public static void ShowHelp (Control parent, string url)
{
ShowHelp (parent, url, null);
ShowHelp(parent, url, HelpNavigator.TableOfContents, null);
}
public static void ShowHelp (Control parent, string url, HelpNavigator navigator)
@@ -62,7 +57,9 @@ namespace System.Windows.Forms
public static void ShowHelp (Control parent, string url, string keyword)
{
ShowHelpTopic (url, keyword);
if (keyword == null || keyword == String.Empty)
ShowHelp (parent, url, HelpNavigator.TableOfContents, null);
ShowHelp (parent, url, HelpNavigator.Topic, keyword);
}
public static void ShowHelpIndex (Control parent, string url)
@@ -75,55 +72,5 @@ namespace System.Windows.Forms
{
}
#endregion // Public Static Methods
/// <summary>
/// Show a help file and topic using a help viewer
/// </summary>
/// <param name="helpFile">path to a .chm help file</param>
/// <param name="helpTopic">path to a topic in helpFile, or null</param>
private static void ShowHelpTopic (string helpFile, string helpTopic)
{
if (helpFile == null)
throw new ArgumentNullException ();
if (helpFile == String.Empty)
throw new ArgumentException ();
// Use forward slashes in helpFile path if needed
helpFile = helpFile.Replace (@"\", Path.DirectorySeparatorChar.ToString ());
string helpViewer = Environment.GetEnvironmentVariable ("MONO_HELP_VIEWER") ?? "chmsee";
string arguments = String.Format ("\"{0}\"", helpFile);
if (!String.IsNullOrEmpty (helpTopic)) {
if (!helpTopic.StartsWith ("/"))
helpTopic = "/" + helpTopic;
helpTopic = helpTopic.TrimEnd (' ');
arguments = String.Format ("\"{0}::{1}\"", helpFile, helpTopic);
}
try {
RunNonblockingProcess (helpViewer, arguments);
} catch (Exception e) {
// Don't crash if the help viewer couldn't be launched. There
// won't be an exception thrown if the help viewer can't find
// the help file; it's up to the help viewer to display such an error.
string message = String.Format ("The help viewer could not load. Maybe you don't have {0} installed or haven't set MONO_HELP_VIEWER. The specific error message was: {1}", helpViewer, e.Message);
Console.Error.WriteLine (message);
MessageBox.Show (message);
}
}
/// <remarks>
/// throws exception from Process.Start() if there was a problem starting
/// </remarks>
private static void RunNonblockingProcess (string command, string arguments)
{
using (Process process = new Process ()) {
process.StartInfo.FileName = command;
process.StartInfo.Arguments = arguments;
process.StartInfo.UseShellExecute = false;
process.Start ();
}
}
}
}
@@ -3663,8 +3663,7 @@ namespace System.Windows.Forms
if (View != View.Details) {
if (bounds.Left < 0)
h_scroll.Value += bounds.Left;
// Don't shift right unless right-to-left layout is active. (Xamarin bug 22483)
else if (this.RightToLeftLayout && bounds.Right > view_rect.Right)
else if (bounds.Right > view_rect.Right)
h_scroll.Value += (bounds.Right - view_rect.Right);
}
@@ -258,19 +258,11 @@ namespace System.Windows.Forms
StringFormat sf = FlagsToStringFormat (flags);
Size retval;
int proposedWidth;
if (proposedSize.Width == 0)
proposedWidth = Int32.MaxValue;
else {
proposedWidth = proposedSize.Width;
if ((flags & TextFormatFlags.NoPadding) == 0)
proposedWidth -= 9;
}
if (dc is Graphics)
retval = (dc as Graphics).MeasureString (text, font, proposedWidth, sf).ToSize ();
retval = (dc as Graphics).MeasureString (text, font, proposedSize.Width == 0 ? Int32.MaxValue : proposedSize.Width, sf).ToSize ();
else
retval = TextRenderer.MeasureString (text, font, proposedWidth, sf).ToSize ();
retval = TextRenderer.MeasureString (text, font, proposedSize.Width == 0 ? Int32.MaxValue : proposedSize.Width, sf).ToSize ();
if (retval.Width > 0 && (flags & TextFormatFlags.NoPadding) == 0)
retval.Width += 9;
@@ -492,6 +484,9 @@ namespace System.Windows.Forms
r.X += 2;
r.Width -= 2;
}
if ((flags & TextFormatFlags.WordEllipsis) == TextFormatFlags.WordEllipsis || (flags & TextFormatFlags.EndEllipsis) == TextFormatFlags.EndEllipsis || (flags & TextFormatFlags.WordBreak) == TextFormatFlags.WordBreak) {
r.Width -= 4;
}
if ((flags & TextFormatFlags.VerticalCenter) == TextFormatFlags.VerticalCenter && XplatUI.RunningOnUnix) {
r.Y -= 1;
}
@@ -698,7 +698,7 @@ namespace System.Windows.Forms
#region Button
public abstract Size CalculateButtonAutoSize (Button button);
public abstract void CalculateButtonTextAndImageLayout (Graphics g, ButtonBase b, out Rectangle textRectangle, out Rectangle imageRectangle);
public abstract void CalculateButtonTextAndImageLayout (ButtonBase b, out Rectangle textRectangle, out Rectangle imageRectangle);
public abstract void DrawButton (Graphics g, Button b, Rectangle textBounds, Rectangle imageBounds, Rectangle clipRectangle);
public abstract void DrawFlatButton (Graphics g, ButtonBase b, Rectangle textBounds, Rectangle imageBounds, Rectangle clipRectangle);
public abstract void DrawPopupButton (Graphics g, Button b, Rectangle textBounds, Rectangle imageBounds, Rectangle clipRectangle);
@@ -364,29 +364,28 @@ namespace System.Windows.Forms
return ret_size;
}
public override void CalculateButtonTextAndImageLayout (Graphics g, ButtonBase button, out Rectangle textRectangle, out Rectangle imageRectangle)
public override void CalculateButtonTextAndImageLayout (ButtonBase button, out Rectangle textRectangle, out Rectangle imageRectangle)
{
Image image = button.Image;
string text = button.Text;
Rectangle content_rect = button.PaddingClientRectangle;
Size text_size = TextRenderer.MeasureTextInternal (g, text, button.Font, content_rect.Size, button.TextFormatFlags, button.UseCompatibleTextRendering);
Size text_size = TextRenderer.MeasureTextInternal (text, button.Font, content_rect.Size, button.TextFormatFlags, button.UseCompatibleTextRendering);
Size image_size = image == null ? Size.Empty : image.Size;
textRectangle = Rectangle.Inflate (content_rect, -4, -4);
textRectangle = Rectangle.Empty;
imageRectangle = Rectangle.Empty;
bool displayEllipsis = (button.TextFormatFlags & (TextFormatFlags.EndEllipsis | TextFormatFlags.PathEllipsis | TextFormatFlags.WordEllipsis)) != 0;
switch (button.TextImageRelation) {
case TextImageRelation.Overlay:
// Overlay is easy, text always goes here
textRectangle = Rectangle.Inflate (content_rect, -4, -4);
if (button.Pressed)
textRectangle.Offset (1, 1);
// Image is dependent on ImageAlign
if (image == null) {
if (button.Pressed)
textRectangle.Offset (1, 1);
if (image == null)
return;
}
int image_x = 0;
int image_y = 0;
@@ -439,20 +438,22 @@ namespace System.Windows.Forms
imageRectangle = new Rectangle (image_x, image_y, image_width, image_height);
break;
case TextImageRelation.ImageAboveText:
LayoutTextAboveOrBelowImage (textRectangle, false, text_size, image_size, button.TextAlign, button.ImageAlign, displayEllipsis, out textRectangle, out imageRectangle);
content_rect.Inflate (-4, -4);
LayoutTextAboveOrBelowImage (content_rect, false, text_size, image_size, button.TextAlign, button.ImageAlign, out textRectangle, out imageRectangle);
break;
case TextImageRelation.TextAboveImage:
LayoutTextAboveOrBelowImage (textRectangle, true, text_size, image_size, button.TextAlign, button.ImageAlign, displayEllipsis, out textRectangle, out imageRectangle);
content_rect.Inflate (-4, -4);
LayoutTextAboveOrBelowImage (content_rect, true, text_size, image_size, button.TextAlign, button.ImageAlign, out textRectangle, out imageRectangle);
break;
case TextImageRelation.ImageBeforeText:
LayoutTextBeforeOrAfterImage (textRectangle, false, text_size, image_size, button.TextAlign, button.ImageAlign, out textRectangle, out imageRectangle);
content_rect.Inflate (-4, -4);
LayoutTextBeforeOrAfterImage (content_rect, false, text_size, image_size, button.TextAlign, button.ImageAlign, out textRectangle, out imageRectangle);
break;
case TextImageRelation.TextBeforeImage:
LayoutTextBeforeOrAfterImage (textRectangle, true, text_size, image_size, button.TextAlign, button.ImageAlign, out textRectangle, out imageRectangle);
content_rect.Inflate (-4, -4);
LayoutTextBeforeOrAfterImage (content_rect, true, text_size, image_size, button.TextAlign, button.ImageAlign, out textRectangle, out imageRectangle);
break;
}
if (button.Pressed)
textRectangle.Offset (1, 1);
}
private void LayoutTextBeforeOrAfterImage (Rectangle totalArea, bool textFirst, Size textSize, Size imageSize, System.Drawing.ContentAlignment textAlign, System.Drawing.ContentAlignment imageAlign, out Rectangle textRect, out Rectangle imageRect)
@@ -500,7 +501,7 @@ namespace System.Windows.Forms
imageRect = final_image_rect;
}
private void LayoutTextAboveOrBelowImage (Rectangle totalArea, bool textFirst, Size textSize, Size imageSize, System.Drawing.ContentAlignment textAlign, System.Drawing.ContentAlignment imageAlign, bool displayEllipsis, out Rectangle textRect, out Rectangle imageRect)
private void LayoutTextAboveOrBelowImage (Rectangle totalArea, bool textFirst, Size textSize, Size imageSize, System.Drawing.ContentAlignment textAlign, System.Drawing.ContentAlignment imageAlign, out Rectangle textRect, out Rectangle imageRect)
{
int element_spacing = 0; // Spacing between the Text and the Image
int total_height = textSize.Height + element_spacing + imageSize.Height;
@@ -536,25 +537,17 @@ namespace System.Windows.Forms
offset += (int)(2 * (excess_height / 3));
if (textFirst) {
var textHeight = excess_height >= 0 ? totalArea.Height - imageSize.Height - element_spacing: textSize.Height;
final_text_rect = new Rectangle (AlignInRectangle (totalArea, textSize, textAlign).Left, totalArea.Top + offset, textSize.Width, textHeight);
final_text_rect = new Rectangle (AlignInRectangle (totalArea, textSize, textAlign).Left, totalArea.Top + offset, textSize.Width, textSize.Height);
final_image_rect = new Rectangle (AlignInRectangle (totalArea, imageSize, imageAlign).Left, final_text_rect.Bottom + element_spacing, imageSize.Width, imageSize.Height);
}
else {
final_image_rect = new Rectangle (AlignInRectangle (totalArea, imageSize, imageAlign).Left, totalArea.Top + offset, imageSize.Width, imageSize.Height);
var textHeight = excess_height >= 0 ? totalArea.Height - final_image_rect.Height : textSize.Height;
final_text_rect = new Rectangle (AlignInRectangle (totalArea, textSize, textAlign).Left, final_image_rect.Bottom + element_spacing, textSize.Width, textHeight);
final_text_rect = new Rectangle (AlignInRectangle (totalArea, textSize, textAlign).Left, final_image_rect.Bottom + element_spacing, textSize.Width, textSize.Height);
if (final_text_rect.Bottom > totalArea.Bottom)
final_text_rect.Y = totalArea.Top;
}
if (displayEllipsis) {
// Don't use more space than is available otherwise ellipsis won't show
if (final_text_rect.Height > totalArea.Bottom)
final_text_rect.Height = totalArea.Bottom - final_text_rect.Top;
}
textRect = final_text_rect;
imageRect = final_image_rect;
}
@@ -1102,11 +1095,11 @@ namespace System.Windows.Forms
break;
case TextImageRelation.ImageAboveText:
content_rect.Inflate (-4, -4);
LayoutTextAboveOrBelowImage (content_rect, false, text_size, image_size, button.TextAlign, button.ImageAlign, false, out textRectangle, out imageRectangle);
LayoutTextAboveOrBelowImage (content_rect, false, text_size, image_size, button.TextAlign, button.ImageAlign, out textRectangle, out imageRectangle);
break;
case TextImageRelation.TextAboveImage:
content_rect.Inflate (-4, -4);
LayoutTextAboveOrBelowImage (content_rect, true, text_size, image_size, button.TextAlign, button.ImageAlign, false, out textRectangle, out imageRectangle);
LayoutTextAboveOrBelowImage (content_rect, true, text_size, image_size, button.TextAlign, button.ImageAlign, out textRectangle, out imageRectangle);
break;
case TextImageRelation.ImageBeforeText:
content_rect.Inflate (-4, -4);
@@ -1296,7 +1296,7 @@ namespace System.Windows.Forms {
buffer [i] = Marshal.ReadByte (prop, i);
Clipboard.Item = Encoding.UTF8.GetString (buffer);
} else if (property == UTF16_STRING) {
Clipboard.Item = Marshal.PtrToStringUni (prop);
Clipboard.Item = Marshal.PtrToStringUni (prop, Encoding.Unicode.GetMaxCharCount ((int)nitems));
} else if (property == RICHTEXTFORMAT)
Clipboard.Item = Marshal.PtrToStringAnsi(prop);
else if (DataFormats.ContainsFormat (property.ToInt32 ())) {
@@ -1018,27 +1018,13 @@ namespace Microsoft.Build.BuildEngine
if (!StartHandlerHasExecuted)
return;
if (EventArgs is ProjectStartedEventArgs) {
var pfa = finished_args as ProjectFinishedEventArgs;
// FIXME: BuildFinishedHandlerActual sends us BuildFinishedEventArgs via PopEvent
if (pfa == null)
return;
ConsoleLogger.ProjectFinishedHandler (Sender, pfa);
} else if (EventArgs is TargetStartedEventArgs) {
var fa = finished_args as TargetFinishedEventArgs;
// FIXME: BuildFinishedHandlerActual sends us BuildFinishedEventArgs via PopEvent
if (fa == null)
return;
ConsoleLogger.TargetFinishedHandler (Sender, fa);
} else if (EventArgs is TaskStartedEventArgs) {
// FIXME: BuildFinishedHandlerActual sends us BuildFinishedEventArgs via PopEvent
if (!(finished_args is TaskFinishedEventArgs))
return;
ConsoleLogger.TaskFinishedHandler (Sender, (TaskFinishedEventArgs) finished_args);
} else if (!(EventArgs is BuildStartedEventArgs))
if (EventArgs is ProjectStartedEventArgs)
ConsoleLogger.ProjectFinishedHandler (Sender, finished_args as ProjectFinishedEventArgs);
else if (EventArgs is TargetStartedEventArgs)
ConsoleLogger.TargetFinishedHandler (Sender, finished_args as TargetFinishedEventArgs);
else if (EventArgs is TaskStartedEventArgs)
ConsoleLogger.TaskFinishedHandler (Sender, finished_args as TaskFinishedEventArgs);
else if (!(EventArgs is BuildStartedEventArgs))
throw new InvalidOperationException ("Unexpected event on the stack, type: " + EventArgs.GetType ());
}
}
@@ -560,8 +560,11 @@ namespace Microsoft.Build.BuildEngine {
get {
// This is used as the fall back version if the
// project can't find a version to use
// Hard-coded to 2.0, so it allows even vs2005 projects
// to build correctly, as they won't have a ToolsVersion
// set!
return String.IsNullOrEmpty (defaultToolsVersion)
? "4.0"
? "2.0"
: defaultToolsVersion;
}
set {
@@ -99,12 +99,8 @@ namespace Microsoft.Build.BuildEngine {
try {
TaskExecutionMode taskExecutionMode;
string reason;
bool skip_completely;
if (!BuildTargetNeeded (out reason, out skip_completely)) {
if (!BuildTargetNeeded (out reason)) {
LogTargetSkipped (target, reason);
if (skip_completely)
return true;
taskExecutionMode = TaskExecutionMode.SkipAndSetOutput;
} else {
taskExecutionMode = TaskExecutionMode.Complete;
@@ -117,27 +113,8 @@ namespace Microsoft.Build.BuildEngine {
//FIXME: parsing attributes repeatedly
IBuildTask bt = target.BuildTasks [i];
// HACK: need some form of cross references checks
var tem = taskExecutionMode;
if (tem == TaskExecutionMode.SkipAndSetOutput) {
var bti = bt as BuildTask;
//
// BuildTargetNeeded checks only files timestamps but ignores any metadata dependencies
// that way we can end up in the situation when output metadata are populated but from
// incomplete dependencies.
//
// E.g.
// <CreateItem Include="$(IntermediateOutputPath)%(_PngImage.LogicalName)" AdditionalMetadata="LogicalName=%(_PngImage.LogicalName)">
// <Output TaskParameter="Include" />
// </CreateItem>
//
if (bti != null && bti.Name == "CreateItem")
tem = TaskExecutionMode.Complete;
}
TaskBatchingImpl batchingImpl = new TaskBatchingImpl (project);
bool task_result = batchingImpl.Build (bt, tem, out executeOnErrors);
bool task_result = batchingImpl.Build (bt, taskExecutionMode, out executeOnErrors);
if (task_result)
continue;
@@ -172,17 +149,15 @@ namespace Microsoft.Build.BuildEngine {
ParseAttribute (outputs);
}
bool BuildTargetNeeded (out string reason, out bool skipCompletely)
bool BuildTargetNeeded (out string reason)
{
reason = String.Empty;
ITaskItem [] inputFiles;
ITaskItem [] outputFiles;
DateTime youngestInput, oldestOutput;
skipCompletely = false;
if (String.IsNullOrEmpty (inputs.Trim ())) {
if (String.IsNullOrEmpty (inputs.Trim ()))
return true;
}
if (String.IsNullOrEmpty (outputs.Trim ())) {
project.ParentEngine.LogError ("Target {0} has inputs but no outputs specified.", name);
@@ -203,7 +178,6 @@ namespace Microsoft.Build.BuildEngine {
}
if (inputFiles == null || inputFiles.Length == 0) {
skipCompletely = true;
reason = String.Format ("No input files were specified for target {0}, skipping.", name);
return false;
}
@@ -112,7 +112,6 @@
<Compile Include="Microsoft.Build.BuildEngine\TaskBatchingImpl.cs" />
<Compile Include="Microsoft.Build.BuildEngine\TaskDatabase.cs" />
<Compile Include="Microsoft.Build.BuildEngine\TaskEngine.cs" />
<Compile Include="Microsoft.Build.BuildEngine\TaskExecutionMode.cs" />
<Compile Include="Microsoft.Build.BuildEngine\Token.cs" />
<Compile Include="Microsoft.Build.BuildEngine\Toolset.cs" />
<Compile Include="Microsoft.Build.BuildEngine\ToolsetCollection.cs" />
@@ -39,9 +39,7 @@ public static class Consts {
public static string BinPath {
get {
if (RunningOnMono ()) {
#if XBUILD_14
string profile = "xbuild_14";
#elif XBUILD_12
#if XBUILD_12
string profile = "xbuild_12";
#elif NET_4_5
string profile = "net_4_5";
@@ -56,9 +54,7 @@ public static class Consts {
var lib = Path.GetDirectoryName (Path.GetDirectoryName (corlib));
return Path.Combine (lib, profile);
} else {
#if XBUILD_14
return ToolLocationHelper.GetPathToBuildTools ("14.0");
#elif XBUILD_12
#if XBUILD_12
return ToolLocationHelper.GetPathToBuildTools ("12.0");
#elif NET_4_5
return ToolLocationHelper.GetPathToDotNetFramework (TargetDotNetFrameworkVersion.Version45);
@@ -75,9 +71,7 @@ public static class Consts {
public static string ToolsVersionString {
get {
#if XBUILD_14
return " ToolsVersion='14.0'";
#elif XBUILD_12
#if XBUILD_12
return " ToolsVersion='12.0'";
#elif NET_4_0
return " ToolsVersion='4.0'";
@@ -91,9 +85,7 @@ public static class Consts {
public static string GetTasksAsmPath ()
{
#if XBUILD_14
return Path.Combine (BinPath, "Microsoft.Build.Tasks.Core.dll");
#elif XBUILD_12
#if XBUILD_12
return Path.Combine (BinPath, "Microsoft.Build.Tasks.v12.0.dll");
#elif NET_4_0
return Path.Combine (BinPath, "Microsoft.Build.Tasks.v4.0.dll");
@@ -53,13 +53,8 @@ namespace Microsoft.Build.Utilities
#if XBUILD_12
Version451,
#endif
#if XBUILD_14
Version453,
#endif
#if XBUILD_14
VersionLatest = Version453
#elif XBUILD_12
#if XBUILD_12
VersionLatest = Version451
#elif NET_4_5
VersionLatest = Version45
@@ -233,20 +233,11 @@ namespace Microsoft.Build.Utilities
public static string GetPathToBuildTools (string toolsVersion)
{
string path;
switch (toolsVersion) {
case "12.0":
path = "xbuild_12";
break;
case "14.0":
path = "xbuild_14";
break;
default:
if (toolsVersion != "12.0")
return null;
}
if (Environment.GetEnvironmentVariable ("TESTING_MONO") != null)
return Path.Combine (lib_mono_dir, path);
return Path.Combine (lib_mono_dir, "xbuild_12");
if (runningOnDotNet) {
//see http://msdn.microsoft.com/en-us/library/vstudio/bb397428(v=vs.120).aspx
@@ -1,14 +1,12 @@
//
// ToolTask.cs: Base class for command line tool tasks.
//
// Authors:
// Author:
// Marek Sieradzki ([email protected])
// Ankit Jain ([email protected])
// Marek Safar ([email protected])
//
// (C) 2005 Marek Sieradzki
// Copyright 2009 Novell, Inc (http://www.novell.com)
// Copyright 2014 Xamarin Inc
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
@@ -92,45 +90,12 @@ namespace Microsoft.Build.Utilities
return true;
}
string CreateToolPath ()
{
string tp;
if (string.IsNullOrEmpty (ToolPath)) {
tp = GenerateFullPathToTool ();
if (string.IsNullOrEmpty (tp))
return null;
//
// GenerateFullPathToTool can return path including tool name
//
if (string.IsNullOrEmpty (ToolExe))
return tp;
tp = Path.GetDirectoryName (tp);
} else {
tp = ToolPath;
}
var path = Path.Combine (tp, ToolExe);
if (!File.Exists (path)) {
if (Log != null)
Log.LogError ("Tool executable '{0}' could not be found", path);
return null;
}
return path;
}
public override bool Execute ()
{
if (SkipTaskExecution ())
return true;
var tool_path = CreateToolPath ();
if (tool_path == null)
return false;
exitCode = ExecuteTool (tool_path, GenerateResponseFileCommands (),
exitCode = ExecuteTool (GenerateFullPathToTool (), GenerateResponseFileCommands (),
GenerateCommandLineCommands ());
// HandleTaskExecutionErrors is called only if exitCode != 0
@@ -324,14 +289,14 @@ namespace Microsoft.Build.Utilities
protected virtual string GenerateCommandLineCommands ()
{
return "";
return null;
}
protected abstract string GenerateFullPathToTool ();
protected virtual string GenerateResponseFileCommands ()
{
return "";
return null;
}
protected virtual string GetResponseFileSwitch (string responseFilePath)
@@ -26,7 +26,6 @@
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
@@ -425,53 +424,6 @@ namespace MonoTests.Microsoft.Build.Utilities {
Assert.AreEqual (a.ToolPath, "Bar", "#5");
a.ToolPath = "";
Assert.AreEqual (a.ToolPath, "", "#6");
a.Execute ();
}
[Test]
public void Execute_1 ()
{
var t = new TestExecuteToolTask ();
t.OnExecuteTool = delegate { Assert.Fail ("#1"); };
t.BuildEngine = new MockBuildEngine ();
Assert.IsFalse (t.Execute (), "result");
}
[Test]
public void Execute_2 ()
{
var t = new TestExecuteToolTask ();
t.BuildEngine = new MockBuildEngine ();
t.ToolPath = Directory.GetCurrentDirectory ();
t.ToolExe = "Makefile";
t.OnExecuteTool = (pathToTool, responseFileCommands, commandLineCommands) => {
Assert.AreEqual (Path.Combine (Directory.GetCurrentDirectory (), "Makefile"), pathToTool, "#1");
Assert.AreEqual ("", responseFileCommands, "#2");
Assert.AreEqual ("", commandLineCommands, "#3");
};
Assert.IsTrue (t.Execute (), "result");
}
[Test]
public void Execute_3 ()
{
var t = new TestExecuteToolTask ();
t.FullPathToTool = "fpt";
t.BuildEngine = new MockBuildEngine ();
t.ToolExe = "Makefile.mk";
t.OnExecuteTool = (pathToTool, responseFileCommands, commandLineCommands) => {
Assert.AreEqual ("Makefile.mk", pathToTool, "#1");
Assert.AreEqual ("", responseFileCommands, "#2");
Assert.AreEqual ("", commandLineCommands, "#3");
};
Assert.IsFalse (t.Execute (), "result");
}
}
@@ -596,86 +548,9 @@ namespace MonoTests.Microsoft.Build.Utilities {
}
protected override string GenerateFullPathToTool ()
{
return "";
}
}
class MockBuildEngine : IBuildEngine
{
public int ColumnNumberOfTaskNode {
get {
return 0;
}
}
public bool ContinueOnError {
get {
throw new NotImplementedException ();
}
}
public int LineNumberOfTaskNode {
get {
return 0;
}
}
public string ProjectFileOfTaskNode {
get {
return "ProjectFileOfTaskNode";
}
}
public bool BuildProjectFile (string projectFileName, string[] targetNames, IDictionary globalProperties, IDictionary targetOutputs)
{
throw new NotImplementedException ();
}
public void LogCustomEvent (CustomBuildEventArgs e)
{
}
public void LogErrorEvent (BuildErrorEventArgs e)
{
Console.WriteLine (e.Message);
}
public void LogMessageEvent (BuildMessageEventArgs e)
{
}
public void LogWarningEvent (BuildWarningEventArgs e)
{
}
}
class TestExecuteToolTask : ToolTask
{
public Action<string, string, string> OnExecuteTool;
public string FullPathToTool;
protected override string ToolName {
get { return "TestTool.exe"; }
}
protected override bool CallHostObjectToExecute ()
{
return base.CallHostObjectToExecute ();
}
protected override string GenerateFullPathToTool ()
{
return FullPathToTool;
}
protected override int ExecuteTool (string pathToTool, string responseFileCommands, string commandLineCommands)
{
if (OnExecuteTool != null)
OnExecuteTool (pathToTool, responseFileCommands, commandLineCommands);
return 0;
}
}
}
@@ -263,9 +263,6 @@ namespace Microsoft.Build.Evaluation
#endif
#if XBUILD_12
AddToolset (new Toolset ("12.0", ToolLocationHelper.GetPathToBuildTools ("12.0"), this, null));
#endif
#if XBUILD_14
AddToolset (new Toolset ("14.0", ToolLocationHelper.GetPathToBuildTools ("14.0"), this, null));
#endif
default_tools_version = toolsets.First ().ToolsVersion;
}
+1 -3
View File
@@ -6,9 +6,7 @@ LIBRARY = Mono.CSharp.dll
LIB_MCS_FLAGS = -r:System.Core.dll -r:System.Xml.dll -r:System.dll
MOBILE_STATIC := $(filter mobile_static monotouch, $(PROFILE))
ifdef MOBILE_STATIC
ifeq (monotouch, $(PROFILE))
LIB_MCS_FLAGS += -d:IOS_REFLECTION
endif
@@ -146,15 +146,6 @@ namespace MonoTests.EvaluatorTest
Assert.IsTrue (Evaluator.Run ("x();"), "#2");
}
[Test]
public void CapturedLocalVariable ()
{
Evaluator.Run ("using System;");
var res = Evaluator.Evaluate("var x = 123; Action a = () => x++; a(); x;");
Assert.AreEqual (124, res);
}
#if NET_4_0
[Test]
public void DynamicStatement ()
@@ -104,15 +104,7 @@ namespace MonoTests.EvaluatorTest
{
Evaluator.Run ("class A { class B { } }");
Evaluator.Run ("var x = new A ();");
}
[Test]
public void DelegateType ()
{
Evaluator.Run ("public delegate int D();");
Evaluator.Run ("D d = delegate () { return 7; };");
object res = Evaluator.Evaluate ("d();");
Assert.AreEqual (7, res);
}
}
}
@@ -1,13 +0,0 @@
#include Mono.CSharp.dll.sources
../corlib/System.Reflection.Emit/AssemblyBuilderAccess.cs
../corlib/System.Reflection.Emit/FlowControl.cs
../corlib/System.Reflection.Emit/OpCode.cs
../corlib/System.Reflection.Emit/OpCodeNames.cs
../corlib/System.Reflection.Emit/OpCodes.cs
../corlib/System.Reflection.Emit/OpCodeType.cs
../corlib/System.Reflection.Emit/OperandType.cs
../corlib/System.Reflection.Emit/PEFileKinds.cs
../corlib/System.Reflection.Emit/Label.cs
../corlib/System.Reflection.Emit/MethodToken.cs
../corlib/System.Reflection.Emit/StackBehaviour.cs
monotouch.cs
@@ -1,2 +1,13 @@
#include mobile_static_Mono.CSharp.dll.sources
monotouch.cs
#include Mono.CSharp.dll.sources
../corlib/System.Reflection.Emit/AssemblyBuilderAccess.cs
../corlib/System.Reflection.Emit/FlowControl.cs
../corlib/System.Reflection.Emit/OpCode.cs
../corlib/System.Reflection.Emit/OpCodeNames.cs
../corlib/System.Reflection.Emit/OpCodes.cs
../corlib/System.Reflection.Emit/OpCodeType.cs
../corlib/System.Reflection.Emit/OperandType.cs
../corlib/System.Reflection.Emit/PEFileKinds.cs
../corlib/System.Reflection.Emit/Label.cs
../corlib/System.Reflection.Emit/MethodToken.cs
../corlib/System.Reflection.Emit/StackBehaviour.cs
monotouch.cs
+4
View File
@@ -9,4 +9,8 @@ LIB_MCS_FLAGS = /r:$(corlib) -keyfile:$(LIBRARY_SNK) -r:System.Core.dll -d:NET_3
NO_TEST = yes
ifneq (net_2_0, $(PROFILE))
NO_INSTALL = yes
endif
include ../../build/library.make
@@ -41,9 +41,7 @@ using System.ComponentModel;
using System.Diagnostics;
using System.Net.Sockets;
using System.Globalization;
using System.Security;
using System.Text;
using System.Runtime.InteropServices;
namespace Mono.Data.Tds.Protocol
{
@@ -1470,7 +1468,7 @@ namespace Mono.Data.Tds.Protocol
t3.Domain = this.connectionParms.DefaultDomain;
t3.Host = this.connectionParms.Hostname;
t3.Username = this.connectionParms.User;
t3.Password = GetPlainPassword(this.connectionParms.Password);
t3.Password = this.connectionParms.Password;
Comm.StartPacket (TdsPacketType.SspAuth); // 0x11
Comm.Append (t3.GetBytes ());
@@ -1921,20 +1919,6 @@ namespace Mono.Data.Tds.Protocol
comm.Skip(4);
}
public static string GetPlainPassword(SecureString secPass)
{
IntPtr plainString = IntPtr.Zero;
try
{
plainString = Marshal.SecureStringToGlobalAllocUnicode(secPass);
return Marshal.PtrToStringUni(plainString);
}
finally
{
Marshal.ZeroFreeGlobalAllocUnicode(plainString);
}
}
#endregion // Private Methods
#if NET_2_0
@@ -29,7 +29,6 @@
//
using System;
using System.Security;
namespace Mono.Data.Tds.Protocol {
public sealed class Tds42 : Tds
@@ -78,7 +77,7 @@ namespace Mono.Data.Tds.Protocol {
Comm.Append ((byte) (tmp.Length < 30 ? tmp.Length : 30));
// password (offset 62 0x3e)
tmp = Comm.Append (GetPlainPassword(connectionParameters.Password), 30, pad);
tmp = Comm.Append (connectionParameters.Password, 30, pad);
Comm.Append ((byte) (tmp.Length < 30 ? tmp.Length : 30));
// hostproc (offset 93 0x5d)
@@ -146,7 +145,7 @@ namespace Mono.Data.Tds.Protocol {
// remote passwords
Comm.Append (empty, 2, pad);
tmp = Comm.Append (GetPlainPassword(connectionParameters.Password), 253, pad);
tmp = Comm.Append (connectionParameters.Password, 253, pad);
Comm.Append ((byte) (tmp.Length < 253 ? tmp.Length + 2 : 253 + 2));
// tds version
@@ -31,7 +31,6 @@
using Mono.Data.Tds;
using System;
using System.Text;
using System.Security;
namespace Mono.Data.Tds.Protocol
{
@@ -119,7 +118,7 @@ namespace Mono.Data.Tds.Protocol
// password (offset 62 0x3e)
// 62-92
tmp = Comm.Append (GetPlainPassword(connectionParameters.Password), 30, pad);
tmp = Comm.Append (connectionParameters.Password, 30, pad);
Comm.Append ((byte) (tmp.Length < 30 ? tmp.Length : 30));
// hostproc (offset 93 0x5d)
@@ -188,7 +187,7 @@ namespace Mono.Data.Tds.Protocol
// remote passwords
// 202-457
Comm.Append (empty, 2, pad);
tmp = Comm.Append (GetPlainPassword(connectionParameters.Password), 253, pad);
tmp = Comm.Append (connectionParameters.Password, 253, pad);
Comm.Append ((byte) (tmp.Length < 253 ? tmp.Length + 2 : 253 + 2));
// tds version
@@ -37,7 +37,6 @@
using System;
using System.Globalization;
using System.Text;
using System.Security;
using Mono.Security.Protocol.Ntlm;
@@ -393,12 +392,11 @@ namespace Mono.Data.Tds.Protocol
return IsConnected;
}
private static string EncryptPassword (SecureString secPass)
private static string EncryptPassword (string pass)
{
int xormask = 0x5a5a;
int len = secPass.Length;
int len = pass.Length;
char[] chars = new char[len];
string pass = GetPlainPassword(secPass);
for (int i = 0; i < len; ++i) {
int c = ((int) (pass[i])) ^ xormask;
@@ -489,19 +487,6 @@ namespace Mono.Data.Tds.Protocol
Comm.Append ((byte) 0x00); // no param meta data name
Comm.Append ((byte) 0x00); // no status flags
// Convert BigNVarChar values larger than 4000 chars to nvarchar(max)
// Need to do this here so WritePreparedParameterInfo emit the
// correct data type
foreach (TdsMetaParameter param2 in parameters) {
var colType = param2.GetMetaType ();
if (colType == TdsColumnType.BigNVarChar) {
int size = param2.GetActualSize ();
if ((size >> 1) > 4000)
param2.Size = -1;
}
}
// Write sql as a parameter value - UCS2
TdsMetaParameter param = new TdsMetaParameter ("sql",
@@ -31,7 +31,6 @@
//
using System;
using System.Security;
namespace Mono.Data.Tds.Protocol
{
@@ -43,8 +42,7 @@ namespace Mono.Data.Tds.Protocol
public string Hostname;
public string Language;
public string LibraryName;
public SecureString Password;
public bool PasswordSet;
public string Password;
public string ProgName;
public string User;
public bool DomainLogin;
@@ -64,8 +62,7 @@ namespace Mono.Data.Tds.Protocol
Hostname = System.Net.Dns.GetHostName();
Language = String.Empty;
LibraryName = "Mono";
Password = new SecureString();
PasswordSet = false;
Password = String.Empty;
ProgName = "Mono";
User = String.Empty;
DomainLogin = false;
+2 -2
View File
@@ -27,11 +27,11 @@
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
namespace MonoTests.Mono.Data.Tds
namespace bug4786test
{
using NUnit.Framework;
using global::Mono.Data.Tds.Protocol;
using Mono.Data.Tds.Protocol;
using System;
using System.Net;
using System.Net.Sockets;
@@ -155,12 +155,11 @@ namespace Mono.Debugger.Soft
[Flags]
enum InvokeFlags {
NONE = 0,
DISABLE_BREAKPOINTS = 1,
SINGLE_THREADED = 2,
OUT_THIS = 4,
OUT_ARGS = 8,
VIRTUAL = 16,
NONE = 0x0,
DISABLE_BREAKPOINTS = 0x1,
SINGLE_THREADED = 0x2,
OUT_THIS = 0x4,
OUT_ARGS = 0x8,
}
enum ElementType {
@@ -417,7 +416,7 @@ namespace Mono.Debugger.Soft
* with newer runtimes, and vice versa.
*/
internal const int MAJOR_VERSION = 2;
internal const int MINOR_VERSION = 38;
internal const int MINOR_VERSION = 35;
enum WPSuspendPolicy {
NONE = 0,
@@ -585,8 +584,7 @@ namespace Mono.Debugger.Soft
enum CmdStackFrame {
GET_VALUES = 1,
GET_THIS = 2,
SET_VALUES = 3,
GET_DOMAIN = 4,
SET_VALUES = 3
}
enum CmdArrayRef {
@@ -2379,10 +2377,6 @@ namespace Mono.Debugger.Soft
SendReceive (CommandSet.STACK_FRAME, (int)CmdStackFrame.SET_VALUES, new PacketWriter ().WriteId (thread_id).WriteId (id).WriteInt (len).WriteInts (pos).WriteValues (values));
}
internal long StackFrame_GetDomain (long thread_id, long id) {
return SendReceive (CommandSet.STACK_FRAME, (int)CmdStackFrame.GET_DOMAIN, new PacketWriter ().WriteId (thread_id).WriteId (id)).ReadId ();
}
/*
* ARRAYS
*/
@@ -22,11 +22,6 @@ namespace Mono.Debugger.Soft
/*
* Return the values of out arguments
*/
ReturnOutArgs = 8,
/*
* Do a virtual invoke
* Since protocol version 2.37
*/
Virtual = 16
ReturnOutArgs = 8
}
}
@@ -307,8 +307,6 @@ namespace Mono.Debugger.Soft
f |= InvokeFlags.OUT_THIS;
if ((options & InvokeOptions.ReturnOutArgs) != 0)
f |= InvokeFlags.OUT_ARGS;
if ((options & InvokeOptions.Virtual) != 0)
f |= InvokeFlags.VIRTUAL;
InvokeAsyncResult r = new InvokeAsyncResult { AsyncState = state, AsyncWaitHandle = new ManualResetEvent (false), VM = vm, Thread = thread, Callback = callback };
thread.InvalidateFrames ();
@@ -7,7 +7,6 @@ namespace Mono.Debugger.Soft
public class StackFrame : Mirror
{
ThreadMirror thread;
AppDomainMirror domain;
MethodMirror method;
int il_offset;
Location location;
@@ -33,16 +32,6 @@ namespace Mono.Debugger.Soft
}
}
public AppDomainMirror Domain {
get {
vm.CheckProtocolVersion (2, 38);
if (domain == null)
domain = vm.GetDomain (vm.conn.StackFrame_GetDomain (thread.Id, Id));
return domain;
}
}
public MethodMirror Method {
get {
return method;
@@ -22,10 +22,6 @@ public class TestsBase
static string base_static_s = "C";
#pragma warning restore 0414
#pragma warning restore 0169
public virtual string virtual_method () {
return "V1";
}
}
public enum AnEnum {
@@ -1369,10 +1365,6 @@ public class Tests : TestsBase, ITest2
j = 5;
set_ip_2 ();
}
public override string virtual_method () {
return "V2";
}
}
class TypeLoadClass {
@@ -2137,11 +2137,6 @@ public class DebuggerTests
v = this_obj.InvokeMethod (e.Thread, m, null);
AssertValue (42, v);
// virtual call
m = t.BaseType.GetMethod ("virtual_method");
v = this_obj.InvokeMethod (e.Thread, m, null, InvokeOptions.Virtual);
AssertValue ("V2", v);
#if NET_4_5
// instance
m = t.GetMethod ("invoke_pass_ref");
@@ -2869,10 +2864,8 @@ public class DebuggerTests
var frames = e.Thread.GetFrames ();
Assert.AreEqual ("invoke_in_domain", frames [0].Method.Name);
Assert.AreEqual (domain, frames [0].Domain);
Assert.AreEqual ("invoke", frames [1].Method.Name);
Assert.AreEqual ("domains", frames [2].Method.Name);
Assert.AreEqual (vm.RootDomain, frames [2].Domain);
// Test breakpoints on already JITted methods in other domains
m = entry_point.DeclaringType.GetMethod ("invoke_in_domain_2");
+2 -4
View File
@@ -9,9 +9,7 @@ LIB_MCS_FLAGS = -r:System.dll -r:System.Core.dll \
-d:MONO_INTERPRETER \
-delaysign -keyfile:../mono.pub
MOBILE_STATIC := $(filter mobile_static monotouch monotouch_runtime, $(PROFILE))
ifdef MOBILE_STATIC
ifeq (monotouch, $(subst _runtime,,$(PROFILE)))
mono_dynamic_interpreter_deps = $(the_libdir_base)plaincore/System.Core.dll
LIB_MCS_FLAGS += -lib:$(the_libdir_base)plaincore
endif
@@ -23,4 +21,4 @@ $(the_libdir_base)Mono.Dynamic.Interpreter.dll: $(mono_dynamic_interpreter_deps)
$(the_libdir_base)plaincore/System.Core.dll:
(cd ../System.Core; $(MAKE) $@)
.NOTPARALLEL: $(the_libdir_base)plaincore/System.Core.dll
.NOTPARALLEL: $(the_libdir_base)plaincore/System.Core.dll
@@ -39,7 +39,7 @@ using NUnit.Framework;
#if NDESK_OPTIONS
namespace Tests.NDesk.Options
#else
namespace MonoTests.Mono.Options
namespace Tests.Mono.Options
#endif
{
[TestFixture]
@@ -46,7 +46,7 @@ using NUnit.Framework;
#if NDESK_OPTIONS
namespace Tests.NDesk.Options
#else
namespace MonoTests.Mono.Options
namespace Tests.Mono.Options
#endif
{
class FooConverter : TypeConverter {
@@ -39,7 +39,7 @@ using NUnit.Framework;
#if NDESK_OPTIONS
namespace Tests.NDesk.Options
#else
namespace MonoTests.Mono.Options
namespace Tests.Mono.Options
#endif
{
class DefaultOption : Option {
@@ -31,7 +31,7 @@ using System;
#if NDESK_OPTIONS
namespace Tests.NDesk.Options
#else
namespace MonoTests.Mono.Options
namespace Tests.Mono.Options
#endif
{
static class Utils {
@@ -195,11 +195,6 @@ namespace Mono.Unix.Native {
return FromTimeT (time);
}
public static DateTime ToDateTime (long time, long nanoTime)
{
return FromTimeT (time).AddMilliseconds (nanoTime / 1000);
}
public static long FromDateTime (DateTime time)
{
return ToTimeT (time);
@@ -192,7 +192,7 @@ namespace Mono.Unix {
}
public DateTime LastAccessTime {
get {AssertValid (); return Native.NativeConvert.ToDateTime (stat.st_atime, stat.st_atime_nsec);}
get {AssertValid (); return Native.NativeConvert.ToDateTime (stat.st_atime);}
}
public DateTime LastAccessTimeUtc {
@@ -200,7 +200,7 @@ namespace Mono.Unix {
}
public DateTime LastWriteTime {
get {AssertValid (); return Native.NativeConvert.ToDateTime (stat.st_mtime, stat.st_mtime_nsec);}
get {AssertValid (); return Native.NativeConvert.ToDateTime (stat.st_mtime);}
}
public DateTime LastWriteTimeUtc {
@@ -208,7 +208,7 @@ namespace Mono.Unix {
}
public DateTime LastStatusChangeTime {
get {AssertValid (); return Native.NativeConvert.ToDateTime (stat.st_ctime, stat.st_ctime_nsec);}
get {AssertValid (); return Native.NativeConvert.ToDateTime (stat.st_ctime);}
}
public DateTime LastStatusChangeTimeUtc {
@@ -221,13 +221,15 @@ namespace Mono.Security.Cryptography {
string msg = Locale.GetText ("Could not create user key store '{0}'.");
throw new CryptographicException (String.Format (msg, _userPath), e);
}
if (!ProtectUser (_userPath)) {
string msg = Locale.GetText ("Could not secure user key store '{0}'.");
throw new IOException (String.Format (msg, _userPath));
}
_userPathExists = true;
}
}
if (!IsUserProtected (_userPath) && !ProtectUser (_userPath)) {
string msg = Locale.GetText ("Could not secure user key store '{0}'.");
throw new IOException (String.Format (msg, _userPath));
}
}
// is it properly protected ?
if (!IsUserProtected (_userPath)) {
@@ -256,13 +258,15 @@ namespace Mono.Security.Cryptography {
string msg = Locale.GetText ("Could not create machine key store '{0}'.");
throw new CryptographicException (String.Format (msg, _machinePath), e);
}
if (!ProtectMachine (_machinePath)) {
string msg = Locale.GetText ("Could not secure machine key store '{0}'.");
throw new IOException (String.Format (msg, _machinePath));
}
_machinePathExists = true;
}
}
if (!IsMachineProtected (_machinePath) && !ProtectMachine (_machinePath)) {
string msg = Locale.GetText ("Could not secure machine key store '{0}'.");
throw new IOException (String.Format (msg, _machinePath));
}
}
// is it properly protected ?
if (!IsMachineProtected (_machinePath)) {
@@ -97,26 +97,10 @@ namespace Mono.Security.X509 {
// methods
public void Clear ()
{
/*
* Both _certificates and _crls extend CollectionBase, whose Clear() method calls OnClear() and
* OnClearComplete(), which should be overridden in derivative classes. So we should not worry about
* other threads that might be holding references to _certificates or _crls. They should be smart enough
* to handle this gracefully. And if not, it's their own fault.
*/
ClearCertificates ();
ClearCrls ();
}
void ClearCertificates()
{
if (_certificates != null)
_certificates.Clear ();
_certificates = null;
}
void ClearCrls ()
{
if (_crls != null)
_crls.Clear ();
_crls = null;
@@ -133,7 +117,6 @@ namespace Mono.Security.X509 {
fs.Write (data, 0, data.Length);
fs.Close ();
}
ClearCertificates (); // We have modified the store on disk. So forget the old state.
}
#if !NET_2_1
// Try to save privateKey if available..
@@ -158,7 +141,6 @@ namespace Mono.Security.X509 {
byte[] data = crl.RawData;
fs.Write (data, 0, data.Length);
}
ClearCrls (); // We have modified the store on disk. So forget the old state.
}
}
@@ -167,7 +149,6 @@ namespace Mono.Security.X509 {
string filename = Path.Combine (_storePath, GetUniqueName (certificate));
if (File.Exists (filename)) {
File.Delete (filename);
ClearCertificates (); // We have modified the store on disk. So forget the old state.
}
}
@@ -176,7 +157,6 @@ namespace Mono.Security.X509 {
string filename = Path.Combine (_storePath, GetUniqueName (crl));
if (File.Exists (filename)) {
File.Delete (filename);
ClearCrls (); // We have modified the store on disk. So forget the old state.
}
}
@@ -256,13 +236,8 @@ namespace Mono.Security.X509 {
cspParams.Flags = CspProviderFlags.UseMachineKeyStore;
KeyPairPersistence kpp = new KeyPairPersistence (cspParams);
try {
if (!kpp.Load ())
return cert;
}
catch {
if (!kpp.Load ())
return cert;
}
if (cert.RSA != null)
cert.RSA = new RSACryptoServiceProvider (cspParams);
+1 -1
View File
@@ -10,7 +10,7 @@ NO_TEST = yes
# This is a .NET 2.0+ only assembly
VALID_PROFILE := $(filter net_4_0 net_4_5, $(PROFILE))
VALID_PROFILE := $(filter net_2_0 net_4_0 net_4_5, $(PROFILE))
ifndef VALID_PROFILE
LIBRARY_NAME = dummy-Mono.Simd.dll
NO_INSTALL = yes
@@ -12,7 +12,7 @@ CLEAN_FILES += $(STRING_MESSAGES)
EXTRA_DISTFILES = \
src/ComponentModel/Strings.resx
VALID_PROFILE := $(filter net_4_0 net_4_5 monotouch monodroid xammac mobile mobile_static, $(PROFILE))
VALID_PROFILE := $(filter net_4_0 net_4_5 monotouch monodroid xammac mobile_static, $(PROFILE))
ifndef VALID_PROFILE
LIBRARY_NAME = dummy-System.ComponentModel.Composition.dll
NO_INSTALL = yes
@@ -18,7 +18,7 @@ endif
TEST_MCS_FLAGS = $(LIB_MCS_FLAGS)
# This is a .NET 3.5+ assembly
VALID_PROFILE := $(filter net_2_0 net_4_0 net_4_5 monotouch monodroid xammac mobile mobile_static, $(PROFILE))
VALID_PROFILE := $(filter net_2_0 net_4_0 net_4_5 monotouch monodroid xammac mobile_static, $(PROFILE))
ifndef VALID_PROFILE
LIBRARY_NAME = dummy-System.ComponentModel.DataAnnotations.dll
NO_INSTALL = yes
@@ -1 +0,0 @@
#include net_4_5_System.ComponentModel.DataAnnotations.dll.sources
+6 -24
View File
@@ -10,16 +10,17 @@ ifneq (2.1, $(FRAMEWORK_VERSION))
LIB_MCS_FLAGS += -d:NET_3_5 -nowarn:1720
endif
MOBILE_DYNAMIC := $(filter monodroid xammac mobile, $(PROFILE))
MOBILE_STATIC := $(filter mobile_static monotouch monotouch_runtime, $(PROFILE))
ifeq (monodroid, $(PROFILE))
LIB_MCS_FLAGS += -d:FEATURE_CORE_DLR,FEATURE_REFEMIT,ANDROID
endif
ifdef MOBILE_DYNAMIC
ifeq (xammac, $(PROFILE))
LIB_MCS_FLAGS += -d:FEATURE_CORE_DLR,FEATURE_REFEMIT
endif
system_core_plain_libdir = $(the_libdir_base)plaincore
ifdef MOBILE_STATIC
ifeq (monotouch, $(subst _runtime,,$(PROFILE)))
extra_test_flags := -exclude:NotWorkingInterpreter
system_core_library_deps = $(the_libdir_base)Mono.Dynamic.Interpreter.dll $(system_core_plain_libdir)/System.Core.dll
LIB_MCS_FLAGS += -d:FEATURE_CORE_DLR
@@ -71,23 +72,4 @@ ifneq ($(PROFILE),basic)
csproj-local:
$(MAKE) csproj-local intermediate=plaincore/
endif
endif
#
# Android TimeZoneInfo testing....
#
tzi.exe: ../corlib/System/AndroidPlatform.cs $(wildcard System/TimeZone*.cs) ../../build/common/Consts.cs ../Mono.Options/Mono.Options/Options.cs
mcs /debug+ /out:$@ /unsafe "/d:INSIDE_CORLIB;MONODROID;NET_4_0;LIBC;SELF_TEST" $^
android-pull-tzdb:
mkdir -p android/tzdb/usr/share/zoneinfo
mkdir -p android/tzdb/misc/zoneinfo/zoneinfo
android_root=`adb shell echo '$$ANDROID_ROOT' | tr -d "\r"` ; \
android_data=`adb shell echo '$$ANDROID_DATA' | tr -d "\r"` ; \
adb $(ADB_TARGET) pull $$android_root/usr/share/zoneinfo android/tzdb/usr/share/zoneinfo ; \
adb $(ADB_TARGET) pull $$android_data/misc/zoneinfo/tzdata android/tzdb/misc/zoneinfo
mkdir -p android/tzdb/
android-dump-tzdata: tzi.exe android-pull-tzdb
__XA_OVERRIDE_TIMEZONE_ID__=America/New_York ANDROID_ROOT=`pwd` ANDROID_DATA=`pwd` mono --debug tzi.exe -o android/tzdata
endif
@@ -24,16 +24,13 @@
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
#if INSIDE_CORLIB || (NET_3_5 && !NET_4_0 && !MOBILE)
#if (INSIDE_CORLIB && NET_4_0) || (!INSIDE_CORLIB && (NET_3_5 && !NET_4_0 && !MOBILE))
using System.Runtime.CompilerServices;
using System.Runtime.Serialization;
namespace System
{
#if NET_4_0 || !INSIDE_CORLIB
public
#endif
sealed partial class TimeZoneInfo {
public sealed partial class TimeZoneInfo {
[SerializableAttribute]
#if MOBILE
[TypeForwardedFrom (Consts.AssemblySystem_Core)]
@@ -246,7 +246,6 @@ namespace System {
tzdataPath, offset, length, r, buffer.Length));
}
TimeZoneInfo.DumpTimeZoneDataToFile (id, buffer);
return buffer;
}
}
@@ -454,29 +453,29 @@ namespace System {
: db.GetAvailableIds ();
}
static TimeZoneInfo _GetTimeZone (string id, string name)
static TimeZoneInfo _GetTimeZone (string name)
{
if (db == null)
return null;
byte[] buffer = db.GetTimeZoneData (name);
if (buffer == null)
return null;
return TimeZoneInfo.ParseTZBuffer (id, buffer, buffer.Length);
return TimeZoneInfo.ParseTZBuffer (name, buffer, buffer.Length);
}
internal static TimeZoneInfo GetTimeZone (string id, string name)
internal static TimeZoneInfo GetTimeZone (string id)
{
if (name != null) {
if (name == "GMT" || name == "UTC")
return new TimeZoneInfo (id, TimeSpan.FromSeconds (0), id, name, name, null, disableDaylightSavingTime:true);
if (name.StartsWith ("GMT"))
if (id != null) {
if (id == "GMT" || id == "UTC")
return new TimeZoneInfo (id, TimeSpan.FromSeconds (0), id, id, id, null, true);
if (id.StartsWith ("GMT"))
return new TimeZoneInfo (id,
TimeSpan.FromSeconds (ParseNumericZone (name)),
id, name, name, null, disableDaylightSavingTime:true);
TimeSpan.FromSeconds (ParseNumericZone (id)),
id, id, id, null, true);
}
try {
return _GetTimeZone (id, name);
return _GetTimeZone (id);
} catch (Exception) {
return null;
}
@@ -534,12 +533,12 @@ namespace System {
static readonly object _lock = new object ();
static TimeZoneInfo defaultZone;
internal static TimeZoneInfo Local {
internal static TimeZoneInfo Default {
get {
lock (_lock) {
if (defaultZone != null)
return defaultZone;
return defaultZone = GetTimeZone ("Local", GetDefaultTimeZoneName ());
return defaultZone = GetTimeZone (GetDefaultTimeZoneName ());
}
}
}
@@ -554,10 +553,7 @@ namespace System {
{
IntPtr value = IntPtr.Zero;
int n = 0;
string defaultTimeZone = Environment.GetEnvironmentVariable ("__XA_OVERRIDE_TIMEZONE_ID__");
if (!string.IsNullOrEmpty (defaultTimeZone))
return defaultTimeZone;
string defaultTimeZone;
// Used by the tests
if (Environment.GetEnvironmentVariable ("__XA_USE_JAVA_DEFAULT_TIMEZONE_ID__") == null)
@@ -580,52 +576,25 @@ namespace System {
#if SELF_TEST
/*
* Compile:
* mcs /debug+ /out:tzi.exe /unsafe "/d:INSIDE_CORLIB;MONODROID;NET_4_0;LIBC;SELF_TEST" ../corlib/System/AndroidPlatform.cs System/TimeZone*.cs ../../build/common/Consts.cs ../Mono.Options/Mono.Options/Options.cs
* mcs /out:tzi.exe /unsafe "/d:INSIDE_CORLIB;MONODROID;NET_4_0;LIBC;SELF_TEST" System/TimeZone*.cs ../../build/common/Consts.cs ../Mono.Options/Mono.Options/Options.cs
* Prep:
* mkdir -p android/tzdb/usr/share/zoneinfo
* mkdir -p android/tzdb/misc/zoneinfo/zoneinfo
* mkdir -p usr/share/zoneinfo
* android_root=`adb shell echo '$ANDROID_ROOT' | tr -d "\r"`
* android_data=`adb shell echo '$ANDROID_DATA' | tr -d "\r"`
* adb pull $android_root/usr/share/zoneinfo android/tzdb/usr/share/zoneinfo
* adb pull $android_data/misc/zoneinfo/tzdata android/tzdb/misc/zoneinfo
* adb pull $android_root/usr/share/zoneinfo usr/share/zoneinfo
* Run:
* # Dump all timezone names
* __XA_OVERRIDE_TIMEZONE_ID__=America/New_York ANDROID_ROOT=`pwd` ANDROID_DATA=`pwd` mono --debug tzi.exe --offset=1969-01-01
*
* # Dump TimeZone data to files under path `tzdata`
* __XA_OVERRIDE_TIMEZONE_ID__=America/New_York ANDROID_ROOT=`pwd` ANDROID_DATA=`pwd` mono --debug tzi.exe -o android/tzdata
*
* # Dump TimeZone rules for specific timezone data (as dumped above)
* mono tzi.exe --offset=2012-10-24 -i=tzdata/Asia/Amman
* ANDROID_ROOT=`pwd` mono tzi.exe
*/
static void Main (string[] args)
{
DateTime? offset = null;
Func<IAndroidTimeZoneDB> c = () => GetDefaultTimeZoneDB ();
bool dump_rules = false;
Mono.Options.OptionSet p = null;
p = new Mono.Options.OptionSet () {
{ "i=",
"TimeZone data {FILE} to parse and dump",
v => DumpTimeZoneFile (v, offset)
},
{ "o=",
"Write TimeZone data files to {PATH}",
v => TimeZoneInfo.TimeZoneDataExportPath = v
},
{ "T=", "Create AndroidTzData from {PATH}.", v => {
c = () => new AndroidTzData (v);
} },
{ "Z=", "Create ZoneInfoDB from {DIR}.", v => {
c = () => new ZoneInfoDB (v);
} },
{ "offset=", "Show timezone info offset for DateTime {OFFSET}.", v => {
offset = DateTime.Parse (v);
Console.WriteLine ("Using DateTime Offset: {0}", offset);
} },
{ "R|dump-rules",
"Show timezone info offset for DateTime {OFFSET}.",
v => dump_rules = v != null },
{ "help", "Show this message and exit", v => {
p.WriteOptionDescriptions (Console.Out);
Environment.Exit (0);
@@ -637,16 +606,9 @@ namespace System {
foreach (var id in GetAvailableIds ()) {
Console.Write ("name={0,-40}", id);
try {
TimeZoneInfo zone = _GetTimeZone (id, id);
if (zone != null) {
Console.Write (" {0,-40}", zone);
if (offset.HasValue) {
Console.Write ("From Offset: {0}", zone.GetUtcOffset (offset.Value));
}
if (dump_rules) {
WriteZoneRules (zone);
}
}
TimeZoneInfo zone = _GetTimeZone (id);
if (zone != null)
Console.Write (" {0}", zone);
else {
Console.Write (" ERROR:null");
}
@@ -657,53 +619,6 @@ namespace System {
Console.WriteLine ();
}
}
static void WriteZoneRules (TimeZoneInfo zone)
{
var rules = zone.GetAdjustmentRules ();
for (int i = 0; i < rules.Length; ++i) {
var rule = rules [i];
Console.WriteLine ();
Console.Write ("\tAdjustmentRules[{0,3}]: DaylightDelta={1}; DateStart={2:yyyy-MM}; DateEnd={3:yyyy-MM}; DaylightTransitionStart={4:D2}-{5:D2}T{6}; DaylightTransitionEnd={7:D2}-{8:D2}T{9}",
i,
rule.DaylightDelta,
rule.DateStart, rule.DateEnd,
rule.DaylightTransitionStart.Month, rule.DaylightTransitionStart.Day, rule.DaylightTransitionStart.TimeOfDay.TimeOfDay,
rule.DaylightTransitionEnd.Month, rule.DaylightTransitionEnd.Day, rule.DaylightTransitionEnd.TimeOfDay.TimeOfDay);
}
}
static void DumpTimeZoneFile (string path, DateTime? time)
{
var buffer = File.ReadAllBytes (path);
var zone = ParseTZBuffer (path, buffer, buffer.Length);
Console.Write ("Rules for: {0}", path);
WriteZoneRules (zone);
Console.WriteLine ();
if (time.HasValue) {
var offset = zone.GetUtcOffset (time.Value);
var isDst = zone.IsDaylightSavingTime (time.Value);
Console.WriteLine ("\tDate({0}): Offset({1}) IsDST({2})", time.Value, offset, isDst);
}
}
#endif
}
#if SELF_TEST
static string TimeZoneDataExportPath;
#endif
internal static void DumpTimeZoneDataToFile (string id, byte[] buffer)
{
#if SELF_TEST
int p = id.LastIndexOf ('/');
var o = Path.Combine (TimeZoneDataExportPath,
p >= 0 ? id.Substring (0, p) : id);
if (p >= 0)
o = Path.Combine (o, id.Substring (p+1));
Directory.CreateDirectory (Path.GetDirectoryName (o));
using (var f = File.OpenWrite (o))
f.Write (buffer, 0, buffer.Length);
#endif
}
}
@@ -64,15 +64,12 @@ namespace System {
[DllImport ("__Internal")]
extern static IntPtr monotouch_timezone_get_data (string name, ref int size);
static Stream GetMonoTouchData (string name, bool throw_on_error = true)
static Stream GetMonoTouchData (string name)
{
int size = 0;
IntPtr data = monotouch_timezone_get_data (name, ref size);
if (size <= 0) {
if (throw_on_error)
throw new TimeZoneNotFoundException ();
return null;
}
if (size <= 0)
throw new TimeZoneNotFoundException ();
unsafe {
var s = new UnmanagedMemoryStream ((byte*) data, size);
@@ -24,7 +24,7 @@
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
#if INSIDE_CORLIB || (NET_3_5 && !NET_4_0 && !MOBILE)
#if (INSIDE_CORLIB && NET_4_0) || (!INSIDE_CORLIB && (NET_3_5 && !NET_4_0 && !MOBILE))
using System.Collections.Generic;
using System.Globalization;
@@ -33,10 +33,7 @@ using System.Text;
namespace System
{
#if NET_4_0 || !INSIDE_CORLIB
public
#endif
partial class TimeZoneInfo
public partial class TimeZoneInfo
{
public static TimeZoneInfo FromSerializedString (string source)
{
@@ -24,17 +24,14 @@
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
#if INSIDE_CORLIB || (NET_3_5 && !NET_4_0 && !MOBILE)
#if (INSIDE_CORLIB && NET_4_0) || (!INSIDE_CORLIB && (NET_3_5 && !NET_4_0 && !MOBILE))
using System.Runtime.CompilerServices;
using System.Runtime.Serialization;
namespace System
{
#if NET_4_0 || !INSIDE_CORLIB
public
#endif
sealed partial class TimeZoneInfo
public sealed partial class TimeZoneInfo
{
[SerializableAttribute]
#if MOBILE
+45 -170
View File
@@ -35,7 +35,7 @@ using System.Threading;
[assembly:TypeForwardedTo (typeof(TimeZoneInfo))]
#elif INSIDE_CORLIB || (NET_3_5 && !NET_4_0 && !MOBILE)
#elif (INSIDE_CORLIB && NET_4_0) || (!INSIDE_CORLIB && (NET_3_5 && !NET_4_0 && !MOBILE))
using System.Collections.Generic;
using System.Collections.ObjectModel;
@@ -57,10 +57,7 @@ namespace System
[TypeForwardedFrom (Consts.AssemblySystemCore_3_5)]
#endif
[SerializableAttribute]
#if NET_4_0 || !INSIDE_CORLIB
public
#endif
sealed partial class TimeZoneInfo : IEquatable<TimeZoneInfo>, ISerializable, IDeserializationCallback
public sealed partial class TimeZoneInfo : IEquatable<TimeZoneInfo>, ISerializable, IDeserializationCallback
{
TimeSpan baseUtcOffset;
public TimeSpan BaseUtcOffset {
@@ -103,31 +100,15 @@ namespace System
}
}
/*
TimeZone transitions are stored when there is a change on the base offset.
*/
private List<KeyValuePair<DateTime, TimeType>> transitions;
static TimeZoneInfo CreateLocal ()
{
#if MONODROID
return AndroidTimeZones.Local;
return AndroidTimeZones.Default;
#elif MONOTOUCH
using (Stream stream = GetMonoTouchData (null)) {
return BuildFromStream ("Local", stream);
}
#elif LIBC
var tz = Environment.GetEnvironmentVariable ("TZ");
if (tz != null) {
if (tz == String.Empty)
return Utc;
try {
return FindSystemTimeZoneByFileName (tz, Path.Combine (TimeZoneDirectory, tz));
} catch {
return Utc;
}
}
try {
return FindSystemTimeZoneByFileName ("Local", "/etc/localtime");
} catch {
@@ -351,7 +332,8 @@ namespace System
if (dateTime.Kind == DateTimeKind.Utc)
return dateTime;
return ConvertTimeToUtc (dateTime, TimeZoneInfo.Local);
//FIXME: do not rely on DateTime implementation !
return DateTime.SpecifyKind (dateTime.ToUniversalTime (), DateTimeKind.Utc);
}
public static DateTime ConvertTimeToUtc (DateTime dateTime, TimeZoneInfo sourceTimeZone)
@@ -368,9 +350,15 @@ namespace System
if (sourceTimeZone.IsInvalidTime (dateTime))
throw new ArgumentException ("dateTime parameter is an invalid time");
if (dateTime.Kind == DateTimeKind.Utc && sourceTimeZone == TimeZoneInfo.Utc)
return dateTime;
if (dateTime.Kind == DateTimeKind.Utc)
return dateTime;
if (dateTime.Kind == DateTimeKind.Local)
return ConvertTimeToUtc (dateTime);
if (sourceTimeZone.IsAmbiguousTime (dateTime) || !sourceTimeZone.IsDaylightSavingTime (dateTime))
return DateTime.SpecifyKind (dateTime - sourceTimeZone.BaseUtcOffset, DateTimeKind.Utc);
else {
@@ -427,7 +415,7 @@ namespace System
}
#endif
#if MONODROID
var timeZoneInfo = AndroidTimeZones.GetTimeZone (id, id);
var timeZoneInfo = AndroidTimeZones.GetTimeZone (id);
if (timeZoneInfo == null)
throw new TimeZoneNotFoundException ();
return timeZoneInfo;
@@ -656,16 +644,14 @@ namespace System
#endif
#if MONODROID
foreach (string id in AndroidTimeZones.GetAvailableIds ()) {
var tz = AndroidTimeZones.GetTimeZone (id, id);
var tz = AndroidTimeZones.GetTimeZone (id);
if (tz != null)
systemTimeZones.Add (tz);
}
#elif MONOTOUCH
if (systemTimeZones.Count == 0) {
foreach (string name in GetMonoTouchNames ()) {
using (Stream stream = GetMonoTouchData (name, false)) {
if (stream == null)
continue;
using (Stream stream = GetMonoTouchData (name)) {
systemTimeZones.Add (BuildFromStream (name, stream));
}
}
@@ -696,8 +682,13 @@ namespace System
public TimeSpan GetUtcOffset (DateTime dateTime)
{
bool isDST;
return GetUtcOffset (dateTime, out isDST);
if (IsDaylightSavingTime (dateTime)) {
AdjustmentRule rule = GetApplicableRule (dateTime);
if (rule != null)
return BaseUtcOffset + rule.DaylightDelta;
}
return BaseUtcOffset;
}
public TimeSpan GetUtcOffset (DateTimeOffset dateTimeOffset)
@@ -705,82 +696,6 @@ namespace System
throw new NotImplementedException ();
}
private TimeSpan GetUtcOffset (DateTime dateTime, out bool isDST)
{
isDST = false;
TimeZoneInfo tz = this;
if (dateTime.Kind == DateTimeKind.Utc)
tz = TimeZoneInfo.Utc;
if (dateTime.Kind == DateTimeKind.Local)
tz = TimeZoneInfo.Local;
bool isTzDst;
var tzOffset = GetUtcOffset (dateTime, tz, out isTzDst);
if (tz == this) {
isDST = isTzDst;
return tzOffset;
}
var utcTicks = dateTime.Ticks - tzOffset.Ticks;
if (utcTicks < 0 || utcTicks > DateTime.MaxValue.Ticks)
return BaseUtcOffset;
var utcDateTime = new DateTime (utcTicks, DateTimeKind.Utc);
return GetUtcOffset (utcDateTime, this, out isDST);
}
private static TimeSpan GetUtcOffset (DateTime dateTime, TimeZoneInfo tz, out bool isDST)
{
if (dateTime.Kind == DateTimeKind.Local && tz != TimeZoneInfo.Local)
throw new Exception ();
isDST = false;
if (tz == TimeZoneInfo.Utc)
return TimeSpan.Zero;
TimeSpan offset;
if (tz.TryGetTransitionOffset(dateTime, out offset, out isDST))
return offset;
if (dateTime.Kind == DateTimeKind.Utc) {
var utcRule = tz.GetApplicableRule (dateTime);
if (utcRule != null && tz.IsInDST (utcRule, dateTime)) {
isDST = true;
return tz.BaseUtcOffset + utcRule.DaylightDelta;
}
return tz.BaseUtcOffset;
}
var stdTicks = dateTime.Ticks - tz.BaseUtcOffset.Ticks;
if (stdTicks < 0 || stdTicks > DateTime.MaxValue.Ticks)
return tz.BaseUtcOffset;
var stdUtcDateTime = new DateTime (stdTicks, DateTimeKind.Utc);
var tzRule = tz.GetApplicableRule (stdUtcDateTime);
DateTime dstUtcDateTime = DateTime.MinValue;
if (tzRule != null) {
var dstTicks = stdUtcDateTime.Ticks - tzRule.DaylightDelta.Ticks;
if (dstTicks < 0 || dstTicks > DateTime.MaxValue.Ticks)
return tz.BaseUtcOffset;
dstUtcDateTime = new DateTime (dstTicks, DateTimeKind.Utc);
}
if (tzRule != null && tz.IsInDST (tzRule, stdUtcDateTime) && tz.IsInDST (tzRule, dstUtcDateTime)) {
isDST = true;
return tz.BaseUtcOffset + tzRule.DaylightDelta;
}
return tz.BaseUtcOffset;
}
public bool HasSameRules (TimeZoneInfo other)
{
if (other == null)
@@ -835,16 +750,6 @@ namespace System
throw new NotImplementedException ();
}
private bool IsInDST (AdjustmentRule rule, DateTime dateTime)
{
// Check whether we're in the dateTime year's DST period
if (IsInDSTForYear (rule, dateTime, dateTime.Year))
return true;
// We might be in the dateTime previous year's DST period
return IsInDSTForYear (rule, dateTime, dateTime.Year - 1);
}
bool IsInDSTForYear (AdjustmentRule rule, DateTime dateTime, int year)
{
DateTime DST_start = TransitionPoint (rule.DaylightTransitionStart, year);
@@ -867,11 +772,25 @@ namespace System
if (!SupportsDaylightSavingTime)
return false;
//FIXME: do not rely on DateTime implementation !
if ((dateTime.Kind == DateTimeKind.Local || dateTime.Kind == DateTimeKind.Unspecified) && this == TimeZoneInfo.Local)
return dateTime.IsDaylightSavingTime ();
//FIXME: do not rely on DateTime implementation !
if (dateTime.Kind == DateTimeKind.Local && this != TimeZoneInfo.Utc)
return IsDaylightSavingTime (DateTime.SpecifyKind (dateTime.ToUniversalTime (), DateTimeKind.Utc));
AdjustmentRule rule = GetApplicableRule (dateTime.Date);
if (rule == null)
return false;
bool isDst;
GetUtcOffset (dateTime, out isDst);
// Check whether we're in the dateTime year's DST period
if (IsInDSTForYear (rule, dateTime, dateTime.Year))
return true;
return isDst;
// We might be in the dateTime previous year's DST period
return IsInDSTForYear (rule, dateTime, dateTime.Year - 1);
}
public bool IsDaylightSavingTime (DateTimeOffset dateTimeOffset)
@@ -1048,40 +967,6 @@ namespace System
return null;
}
private bool TryGetTransitionOffset (DateTime dateTime, out TimeSpan offset,out bool isDst)
{
offset = BaseUtcOffset;
isDst = false;
if (transitions == null)
return false;
//Transitions are always in standard time
DateTime date = dateTime;
if (dateTime.Kind == DateTimeKind.Local && this != TimeZoneInfo.Local)
date = date.ToUniversalTime () + BaseUtcOffset;
if (dateTime.Kind == DateTimeKind.Utc && this != TimeZoneInfo.Utc)
date = date + BaseUtcOffset;
for (var i = transitions.Count - 1; i >= 0; i--) {
var pair = transitions [i];
DateTime ttime = pair.Key;
TimeType ttype = pair.Value;
if (ttime > date)
continue;
offset = new TimeSpan (0, 0, ttype.Offset);
isDst = ttype.IsDst;
return true;
}
return false;
}
private static DateTime TransitionPoint (TransitionTime transition, int year)
{
if (transition.IsFixedDateRule)
@@ -1172,19 +1057,16 @@ namespace System
bool dst_observed = false;
DateTime dst_start = DateTime.MinValue;
List<AdjustmentRule> adjustmentRules = new List<AdjustmentRule> ();
bool storeTransition = false;
for (int i = 0; i < transitions.Count; i++) {
var pair = transitions [i];
DateTime ttime = pair.Key;
TimeType ttype = pair.Value;
if (!ttype.IsDst) {
if (standardDisplayName != ttype.Name)
if (standardDisplayName != ttype.Name || baseUtcOffset.TotalSeconds != ttype.Offset) {
standardDisplayName = ttype.Name;
if (baseUtcOffset.TotalSeconds != ttype.Offset) {
daylightDisplayName = null;
baseUtcOffset = new TimeSpan (0, 0, ttype.Offset);
if (adjustmentRules.Count > 0) // We ignore AdjustmentRules but store transitions.
storeTransition = true;
adjustmentRules = new List<AdjustmentRule> ();
dst_observed = false;
}
@@ -1217,32 +1099,25 @@ namespace System
}
dst_observed = false;
} else {
if (daylightDisplayName != ttype.Name)
if (daylightDisplayName != ttype.Name || dstDelta.TotalSeconds != ttype.Offset - baseUtcOffset.TotalSeconds) {
daylightDisplayName = ttype.Name;
if (dstDelta.TotalSeconds != ttype.Offset - baseUtcOffset.TotalSeconds)
dstDelta = new TimeSpan(0, 0, ttype.Offset) - baseUtcOffset;
}
dst_start = ttime;
dst_observed = true;
}
}
TimeZoneInfo tz;
if (adjustmentRules.Count == 0 && !storeTransition) {
if (adjustmentRules.Count == 0) {
TimeType t = (TimeType)time_types [0];
if (standardDisplayName == null) {
standardDisplayName = t.Name;
baseUtcOffset = new TimeSpan (0, 0, t.Offset);
}
tz = CreateCustomTimeZone (id, baseUtcOffset, id, standardDisplayName);
return CreateCustomTimeZone (id, baseUtcOffset, id, standardDisplayName);
} else {
tz = CreateCustomTimeZone (id, baseUtcOffset, id, standardDisplayName, daylightDisplayName, ValidateRules (adjustmentRules).ToArray ());
return CreateCustomTimeZone (id, baseUtcOffset, id, standardDisplayName, daylightDisplayName, ValidateRules (adjustmentRules).ToArray ());
}
if (storeTransition)
tz.transitions = transitions;
return tz;
}
static Dictionary<int, string> ParseAbbreviations (byte [] buffer, int index, int count)
@@ -232,7 +232,7 @@ namespace MonoTests.System
DateTime afterDST = new DateTime (2007, 10, 28, 2, 0, 0, DateTimeKind.Unspecified);
Assert.IsFalse (london.IsDaylightSavingTime (beforeDST), "Just before DST");
Assert.IsTrue (london.IsDaylightSavingTime (startDST), "the first seconds of DST");
Assert.IsFalse (london.IsDaylightSavingTime (endDST), "The last seconds of DST");
Assert.IsTrue (london.IsDaylightSavingTime (endDST), "The last seconds of DST");
Assert.IsFalse (london.IsDaylightSavingTime (afterDST), "Just after DST");
}
@@ -804,143 +804,6 @@ namespace MonoTests.System
Assert.IsTrue (london.Equals (deserialized));
}
}
[TestFixture]
public class MultipleDaylightSavingTimeTests {
private TimeZoneInfo cairo;
private DateTime dst1Start;
private DateTime dst1End;
private DateTime dst2Start;
private DateTime dst2End;
private TimeSpan baseUtcOffset;
private TimeSpan dstUtcOffset;
private TimeSpan dstOffset;
[SetUp]
public void CreateTimeZones ()
{
/*
From 1/1/2014 12:00:00 AM to 6/30/2014 12:00:00 AM
Delta: 01:00:00
Begins at 12:00 AM on 16 May
Ends at 1:00 AM on 29 June
From 7/1/2014 12:00:00 AM to 12/31/2014 12:00:00 AM
Delta: 01:00:00
Begins at 12:00 AM on 29 July
Ends at 12:00 AM on 26 September
*/
dst1Start = new DateTime (2014, 5, 16);
dst1End = new DateTime (2014, 6, 29);
dst2Start = new DateTime (2014, 7, 29);
dst2End = new DateTime (2014, 9, 26);
baseUtcOffset = new TimeSpan (2, 0, 0);
dstUtcOffset = new TimeSpan (3, 0, 0);
dstOffset = dstUtcOffset - baseUtcOffset;
var rule1 = TimeZoneInfo.AdjustmentRule.CreateAdjustmentRule (
new DateTime (2014, 1, 1), new DateTime (2014, 6, 30), dstOffset,
CreateFixedDateRule (dst1Start), CreateFixedDateRule (dst1End));
var rule2 = TimeZoneInfo.AdjustmentRule.CreateAdjustmentRule (
new DateTime (2014, 7, 1), new DateTime (2014, 12, 31), dstOffset,
CreateFixedDateRule (dst2Start), CreateFixedDateRule (dst2End));
cairo = TimeZoneInfo.CreateCustomTimeZone ("Africa/Cairo", baseUtcOffset, "Africa/Cairo", "EET", "EEST",
new [] {rule1, rule2});
}
private static TimeZoneInfo.TransitionTime CreateFixedDateRule (DateTime dateTime)
{
var time = new DateTime (dateTime.Ticks - dateTime.Date.Ticks);
return TimeZoneInfo.TransitionTime.CreateFixedDateRule (time, dateTime.Month, dateTime.Day);
}
[Test]
public void GetUtcOffset_FromUTC ()
{
var d = dst1Start.Add (-baseUtcOffset);
d = DateTime.SpecifyKind (d, DateTimeKind.Utc);
Assert.AreEqual(baseUtcOffset, cairo.GetUtcOffset (d.Add (new TimeSpan(0,0,0,-1))));
Assert.AreEqual(dstUtcOffset, cairo.GetUtcOffset (d));
Assert.AreEqual(dstUtcOffset, cairo.GetUtcOffset (d.Add (new TimeSpan(0,0,0, 1))));
d = dst1End.Add (-baseUtcOffset-dstOffset);
d = DateTime.SpecifyKind (d, DateTimeKind.Utc);
Assert.AreEqual(dstUtcOffset, cairo.GetUtcOffset (d.Add (new TimeSpan(0,0,0,-1))));
Assert.AreEqual(baseUtcOffset, cairo.GetUtcOffset (d));
Assert.AreEqual(baseUtcOffset, cairo.GetUtcOffset (d.Add (new TimeSpan(0,0,0, 1))));
d = dst2Start.Add (-baseUtcOffset);
d = DateTime.SpecifyKind (d, DateTimeKind.Utc);
Assert.AreEqual(baseUtcOffset, cairo.GetUtcOffset (d.Add (new TimeSpan(0,0,0,-1))));
Assert.AreEqual(dstUtcOffset, cairo.GetUtcOffset (d));
Assert.AreEqual(dstUtcOffset, cairo.GetUtcOffset (d.Add (new TimeSpan(0,0,0, 1))));
d = dst2End.Add (-baseUtcOffset-dstOffset);
d = DateTime.SpecifyKind (d, DateTimeKind.Utc);
Assert.AreEqual(dstUtcOffset, cairo.GetUtcOffset (d.Add (new TimeSpan(0,0,0,-1))));
Assert.AreEqual(baseUtcOffset, cairo.GetUtcOffset (d));
Assert.AreEqual(baseUtcOffset, cairo.GetUtcOffset (d.Add (new TimeSpan(0,0,0, 1))));
}
[Test]
public void GetUtcOffset_FromLocal ()
{
var d = dst1Start.Add (-baseUtcOffset);
d = DateTime.SpecifyKind (d, DateTimeKind.Utc);
d = d.ToLocalTime ();
Assert.AreEqual(baseUtcOffset, cairo.GetUtcOffset (d.Add (new TimeSpan(0,0,0,-1))));
Assert.AreEqual(dstUtcOffset, cairo.GetUtcOffset (d));
Assert.AreEqual(dstUtcOffset, cairo.GetUtcOffset (d.Add (new TimeSpan(0,0,0, 1))));
d = dst1End.Add (-baseUtcOffset-dstOffset);
d = DateTime.SpecifyKind (d, DateTimeKind.Utc);
d = d.ToLocalTime ();
Assert.AreEqual(dstUtcOffset, cairo.GetUtcOffset (d.Add (new TimeSpan(0,0,0,-1))));
Assert.AreEqual(baseUtcOffset, cairo.GetUtcOffset (d));
Assert.AreEqual(baseUtcOffset, cairo.GetUtcOffset (d.Add (new TimeSpan(0,0,0, 1))));
d = dst2Start.Add (-baseUtcOffset);
d = DateTime.SpecifyKind (d, DateTimeKind.Utc);
d = d.ToLocalTime ();
Assert.AreEqual(baseUtcOffset, cairo.GetUtcOffset (d.Add (new TimeSpan(0,0,0,-1))));
Assert.AreEqual(dstUtcOffset, cairo.GetUtcOffset (d));
Assert.AreEqual(dstUtcOffset, cairo.GetUtcOffset (d.Add (new TimeSpan(0,0,0, 1))));
d = dst2End.Add (-baseUtcOffset-dstOffset);
d = DateTime.SpecifyKind (d, DateTimeKind.Utc);
d = d.ToLocalTime ();
Assert.AreEqual(dstUtcOffset, cairo.GetUtcOffset (d.Add (new TimeSpan(0,0,0,-1))));
Assert.AreEqual(baseUtcOffset, cairo.GetUtcOffset (d));
Assert.AreEqual(baseUtcOffset, cairo.GetUtcOffset (d.Add (new TimeSpan(0,0,0, 1))));
}
[Test]
public void GetUtcOffset_FromUnspecified ()
{
var d = dst1Start.Add (dstOffset);
Assert.AreEqual(baseUtcOffset, cairo.GetUtcOffset (d.Add (new TimeSpan(0,0,0,-1))));
Assert.AreEqual(dstUtcOffset, cairo.GetUtcOffset (d));
Assert.AreEqual(dstUtcOffset, cairo.GetUtcOffset (d.Add (new TimeSpan(0,0,0, 1))));
d = dst1End.Add (-dstOffset);
Assert.AreEqual(dstUtcOffset, cairo.GetUtcOffset (d.Add (new TimeSpan(0,0,0,-1))));
Assert.AreEqual(baseUtcOffset, cairo.GetUtcOffset (d));
Assert.AreEqual(baseUtcOffset, cairo.GetUtcOffset (d.Add (new TimeSpan(0,0,0, 1))));
d = dst2Start.Add (dstOffset);
Assert.AreEqual(baseUtcOffset, cairo.GetUtcOffset (d.Add (new TimeSpan(0,0,0,-1))));
Assert.AreEqual(dstUtcOffset, cairo.GetUtcOffset (d));
Assert.AreEqual(dstUtcOffset, cairo.GetUtcOffset (d.Add (new TimeSpan(0,0,0, 1))));
d = dst2End.Add (-dstOffset);
Assert.AreEqual(dstUtcOffset, cairo.GetUtcOffset (d.Add (new TimeSpan(0,0,0,-1))));
Assert.AreEqual(baseUtcOffset, cairo.GetUtcOffset (d));
Assert.AreEqual(baseUtcOffset, cairo.GetUtcOffset (d.Add (new TimeSpan(0,0,0, 1))));
}
}
}
}
#endif
@@ -1,4 +1,109 @@
#include mobile_common_System.Core.dll.sources
#include dynamic_System.Core.dll.sources
Assembly/AssemblyInfo.cs
System/Actions.cs
System/Funcs.cs
System/InvalidTimeZoneException.cs
System/TimeZoneInfo.AdjustmentRule.cs
System/TimeZoneInfo.cs
System/TimeZoneInfo.Serialization.cs
System/TimeZoneInfo.TransitionTime.cs
System/TimeZoneNotFoundException.cs
System/Util.cs
System.Runtime.CompilerServices/DynamicAttribute.cs
System.Runtime.CompilerServices/ExecutionScope.cs
System.Runtime.CompilerServices/ExtensionAttribute.cs
System.Runtime.CompilerServices/IStrongBox.cs
System.Runtime.CompilerServices/StrongBox_T.cs
System.Linq/Check.cs
System.Linq/Enumerable.cs
System.Linq/QueryableEnumerable.cs
System.Linq/QueryableTransformer.cs
System.Linq/Grouping.cs
System.Linq/IGrouping.cs
System.Linq/IOrderedQueryable.cs
System.Linq/IOrderedQueryable_T.cs
System.Linq/IOrderedEnumerable_T.cs
System.Linq/IQueryable.cs
System.Linq/IQueryable_T.cs
System.Linq/Lookup.cs
System.Linq/ILookup_T.cs
System.Linq/OrderedEnumerable.cs
System.Linq/OrderedSequence.cs
System.Linq/Queryable.cs
System.Linq/QuickSort.cs
System.Linq/SortContext.cs
System.Linq/SortDirection.cs
System.Linq/SortSequenceContext.cs
System.Linq/IQueryProvider.cs
System.Collections.Generic/HashSet.cs
System.Security.Cryptography/Aes.cs
System.Threading/LockRecursionPolicy.cs
System.Threading/ReaderWriterLockSlim.cs
System.Threading/ThreadLockState.cs
System.Threading/ReaderWriterLockSlimExtensions.cs
System.Linq.Parallel.QueryNodes/QueryBaseNode.cs
System.Linq.Parallel.QueryNodes/QueryCastNode.cs
System.Linq.Parallel.QueryNodes/QueryChildNode.cs
System.Linq.Parallel.QueryNodes/QueryConcatNode.cs
System.Linq.Parallel.QueryNodes/QueryDefaultEmptyNode.cs
System.Linq.Parallel.QueryNodes/QueryGroupByNode.cs
System.Linq.Parallel.QueryNodes/QueryHeadWorkerNode.cs
System.Linq.Parallel.QueryNodes/QueryJoinNode.cs
System.Linq.Parallel.QueryNodes/QueryMuxNode.cs
System.Linq.Parallel.QueryNodes/QueryOptionNode.cs
System.Linq.Parallel.QueryNodes/QueryOrderByNode.cs
System.Linq.Parallel.QueryNodes/QueryOrderGuardNode.cs
System.Linq.Parallel.QueryNodes/QueryOrderedStreamNode.cs
System.Linq.Parallel.QueryNodes/QueryReverseNode.cs
System.Linq.Parallel.QueryNodes/QuerySelectManyNode.cs
System.Linq.Parallel.QueryNodes/QuerySelectNode.cs
System.Linq.Parallel.QueryNodes/QuerySetNode.cs
System.Linq.Parallel.QueryNodes/QueryStartNode.cs
System.Linq.Parallel.QueryNodes/QueryStreamNode.cs
System.Linq.Parallel.QueryNodes/QueryWhereNode.cs
System.Linq.Parallel.QueryNodes/QueryZipNode.cs
System.Linq.Parallel.QueryNodes/SetInclusion.cs
System.Linq.Parallel.QueryNodes/WrapHelper.cs
System.Linq.Parallel/AggregationList.cs
System.Linq.Parallel/ConcurrentGrouping.cs
System.Linq.Parallel/ConcurrentLookup.cs
System.Linq.Parallel/INodeVisitor.cs
System.Linq.Parallel/IVisitableNode.cs
System.Linq.Parallel/OrderingEnumerator.cs
System.Linq.Parallel/ParallelExecuter.cs
System.Linq.Parallel/ParallelPartitioner.cs
System.Linq.Parallel/ParallelQueryEnumerator.cs
System.Linq.Parallel/ParallelQuickSort.cs
System.Linq.Parallel/QueryCheckerVisitor.cs
System.Linq.Parallel/QueryIsOrderedVisitor.cs
System.Linq.Parallel/QueryOptions.cs
System.Linq.Parallel/RangeList.cs
System.Linq.Parallel/RepeatList.cs
System.Linq.Parallel/ReverseList.cs
System.Linq.Parallel/StripPartitioner.cs
System.Linq.Parallel/TemporaryArea.cs
System.Linq/EnumerableExecutor.cs
System.Linq/EnumerableExecutor_T.cs
System.Linq/EnumerableQuery.cs
System.Linq/EnumerableQuery_T.cs
System.Linq/OrderedParallelQuery.cs
System.Linq/ParallelEnumerable.cs
System.Linq/ParallelExecutionMode.cs
System.Linq/ParallelMergeOptions.cs
System.Linq/ParallelQuery.cs
System.IO.MemoryMappedFiles/MemoryMappedFile.cs
System.IO.MemoryMappedFiles/MemoryMappedFileAccess.cs
System.IO.MemoryMappedFiles/MemoryMappedFileOptions.cs
System.IO.MemoryMappedFiles/MemoryMappedFileRights.cs
System.IO.MemoryMappedFiles/MemoryMappedFileSecurity.cs
System.IO.MemoryMappedFiles/MemoryMappedViewStream.cs
System.IO.MemoryMappedFiles/MemoryMappedViewAccessor.cs
Microsoft.Win32.SafeHandles/SafeMemoryMappedFileHandle.cs
Microsoft.Win32.SafeHandles/SafeMemoryMappedViewHandle.cs
System.IO/HandleInheritability.cs
System.Threading.Tasks/TaskExtensions.cs
System.Linq.Expressions/Extensions.cs
System.Linq.Expressions/ExpressionTransformer.cs
../dlr/Runtime/Microsoft.Scripting.Core/Ast/DynamicExpression.cs
../dlr/Runtime/Microsoft.Scripting.Core/Compiler/Closure.cs
System.Linq.Expressions/DynamicExpressionVisitor.cs
@@ -1,108 +0,0 @@
Assembly/AssemblyInfo.cs
System/Actions.cs
System/Funcs.cs
System/InvalidTimeZoneException.cs
System/TimeZoneInfo.AdjustmentRule.cs
System/TimeZoneInfo.cs
System/TimeZoneInfo.Serialization.cs
System/TimeZoneInfo.TransitionTime.cs
System/TimeZoneNotFoundException.cs
System/Util.cs
System.Runtime.CompilerServices/DynamicAttribute.cs
System.Runtime.CompilerServices/ExecutionScope.cs
System.Runtime.CompilerServices/ExtensionAttribute.cs
System.Runtime.CompilerServices/IStrongBox.cs
System.Runtime.CompilerServices/StrongBox_T.cs
System.Linq/Check.cs
System.Linq/Enumerable.cs
System.Linq/QueryableEnumerable.cs
System.Linq/QueryableTransformer.cs
System.Linq/Grouping.cs
System.Linq/IGrouping.cs
System.Linq/IOrderedQueryable.cs
System.Linq/IOrderedQueryable_T.cs
System.Linq/IOrderedEnumerable_T.cs
System.Linq/IQueryable.cs
System.Linq/IQueryable_T.cs
System.Linq/Lookup.cs
System.Linq/ILookup_T.cs
System.Linq/OrderedEnumerable.cs
System.Linq/OrderedSequence.cs
System.Linq/Queryable.cs
System.Linq/QuickSort.cs
System.Linq/SortContext.cs
System.Linq/SortDirection.cs
System.Linq/SortSequenceContext.cs
System.Linq/IQueryProvider.cs
System.Collections.Generic/HashSet.cs
System.Security.Cryptography/Aes.cs
System.Threading/LockRecursionPolicy.cs
System.Threading/ReaderWriterLockSlim.cs
System.Threading/ThreadLockState.cs
System.Threading/ReaderWriterLockSlimExtensions.cs
System.Linq.Parallel.QueryNodes/QueryBaseNode.cs
System.Linq.Parallel.QueryNodes/QueryCastNode.cs
System.Linq.Parallel.QueryNodes/QueryChildNode.cs
System.Linq.Parallel.QueryNodes/QueryConcatNode.cs
System.Linq.Parallel.QueryNodes/QueryDefaultEmptyNode.cs
System.Linq.Parallel.QueryNodes/QueryGroupByNode.cs
System.Linq.Parallel.QueryNodes/QueryHeadWorkerNode.cs
System.Linq.Parallel.QueryNodes/QueryJoinNode.cs
System.Linq.Parallel.QueryNodes/QueryMuxNode.cs
System.Linq.Parallel.QueryNodes/QueryOptionNode.cs
System.Linq.Parallel.QueryNodes/QueryOrderByNode.cs
System.Linq.Parallel.QueryNodes/QueryOrderGuardNode.cs
System.Linq.Parallel.QueryNodes/QueryOrderedStreamNode.cs
System.Linq.Parallel.QueryNodes/QueryReverseNode.cs
System.Linq.Parallel.QueryNodes/QuerySelectManyNode.cs
System.Linq.Parallel.QueryNodes/QuerySelectNode.cs
System.Linq.Parallel.QueryNodes/QuerySetNode.cs
System.Linq.Parallel.QueryNodes/QueryStartNode.cs
System.Linq.Parallel.QueryNodes/QueryStreamNode.cs
System.Linq.Parallel.QueryNodes/QueryWhereNode.cs
System.Linq.Parallel.QueryNodes/QueryZipNode.cs
System.Linq.Parallel.QueryNodes/SetInclusion.cs
System.Linq.Parallel.QueryNodes/WrapHelper.cs
System.Linq.Parallel/AggregationList.cs
System.Linq.Parallel/ConcurrentGrouping.cs
System.Linq.Parallel/ConcurrentLookup.cs
System.Linq.Parallel/INodeVisitor.cs
System.Linq.Parallel/IVisitableNode.cs
System.Linq.Parallel/OrderingEnumerator.cs
System.Linq.Parallel/ParallelExecuter.cs
System.Linq.Parallel/ParallelPartitioner.cs
System.Linq.Parallel/ParallelQueryEnumerator.cs
System.Linq.Parallel/ParallelQuickSort.cs
System.Linq.Parallel/QueryCheckerVisitor.cs
System.Linq.Parallel/QueryIsOrderedVisitor.cs
System.Linq.Parallel/QueryOptions.cs
System.Linq.Parallel/RangeList.cs
System.Linq.Parallel/RepeatList.cs
System.Linq.Parallel/ReverseList.cs
System.Linq.Parallel/StripPartitioner.cs
System.Linq.Parallel/TemporaryArea.cs
System.Linq/EnumerableExecutor.cs
System.Linq/EnumerableExecutor_T.cs
System.Linq/EnumerableQuery.cs
System.Linq/EnumerableQuery_T.cs
System.Linq/OrderedParallelQuery.cs
System.Linq/ParallelEnumerable.cs
System.Linq/ParallelExecutionMode.cs
System.Linq/ParallelMergeOptions.cs
System.Linq/ParallelQuery.cs
System.IO.MemoryMappedFiles/MemoryMappedFile.cs
System.IO.MemoryMappedFiles/MemoryMappedFileAccess.cs
System.IO.MemoryMappedFiles/MemoryMappedFileOptions.cs
System.IO.MemoryMappedFiles/MemoryMappedFileRights.cs
System.IO.MemoryMappedFiles/MemoryMappedFileSecurity.cs
System.IO.MemoryMappedFiles/MemoryMappedViewStream.cs
System.IO.MemoryMappedFiles/MemoryMappedViewAccessor.cs
Microsoft.Win32.SafeHandles/SafeMemoryMappedFileHandle.cs
Microsoft.Win32.SafeHandles/SafeMemoryMappedViewHandle.cs
System.IO/HandleInheritability.cs
System.Threading.Tasks/TaskExtensions.cs
System.Linq.Expressions/Extensions.cs
System.Linq.Expressions/ExpressionTransformer.cs
../dlr/Runtime/Microsoft.Scripting.Core/Ast/DynamicExpression.cs
../dlr/Runtime/Microsoft.Scripting.Core/Compiler/Closure.cs
System.Linq.Expressions/DynamicExpressionVisitor.cs
@@ -1,2 +0,0 @@
#include mobile_common_System.Core.dll.sources
#include interpreter_System.Core.dll.sources
@@ -1,4 +1,4 @@
#include mobile_common_System.Core.dll.sources
#include mobile_System.Core.dll.sources
#include dynamic_System.Core.dll.sources
@@ -1,3 +1,3 @@
#include mobile_common_System.Core.dll.sources
#include mobile_System.Core.dll.sources
#include interpreter_System.Core.dll.sources
System/TimeZoneInfo.MonoTouch.cs
@@ -1,4 +1,4 @@
#include mobile_common_System.Core.dll.sources
#include mobile_System.Core.dll.sources
#include dynamic_System.Core.dll.sources
+6 -1
View File
@@ -12,12 +12,17 @@ LIB_MCS_FLAGS = \
/resource:./src/DbLinq/Schema/Dbml/DbmlSchema.xsd,DbLinq.Schema.Dbml.DbmlSchema.xsd \
/d:MONO_STRICT /d:MONO_DEPLOY -warn:1
ifeq (2.0, $(FRAMEWORK_VERSION))
# This is a .NET 3.5 only assembly, but built during the 2.0 build
LIB_MCS_FLAGS += -d:NET_3_5 -nowarn:1720
endif
TEST_MCS_FLAGS = $(LIB_MCS_FLAGS)
EXTRA_DISTFILES = src/DbLinq/Schema/Dbml/DbmlSchema.xsd
# This is a .NET 3.5+ assembly
VALID_PROFILE := $(filter net_4_0 net_4_5, $(PROFILE))
VALID_PROFILE := $(filter net_2_0 net_4_0 net_4_5, $(PROFILE))
ifndef VALID_PROFILE
LIBRARY_NAME = dummy-System.Data.Linq.dll
NO_INSTALL = yes
@@ -95,7 +95,7 @@ namespace System.Data.OracleClient.Oci
IntPtr valuep,
int value_sz,
[MarshalAs (UnmanagedType.U2)] OciDataType dty,
IntPtr indp,
ref short indp,
IntPtr alenp,
IntPtr rcodep,
uint maxarr_len,
@@ -111,7 +111,7 @@ namespace System.Data.OracleClient.Oci
ref IntPtr valuep,
int value_sz,
[MarshalAs (UnmanagedType.U2)] OciDataType dty,
IntPtr indp,
ref short indp,
IntPtr alenp,
IntPtr rcodep,
uint maxarr_len,
@@ -127,7 +127,7 @@ namespace System.Data.OracleClient.Oci
byte[] valuep,
int value_sz,
[MarshalAs (UnmanagedType.U2)] OciDataType dty,
IntPtr indp,
ref short indp,
IntPtr alenp,
IntPtr rcodep,
uint maxarr_len,
@@ -142,7 +142,7 @@ namespace System.Data.OracleClient.Oci
IntPtr valuep,
int value_sz,
[MarshalAs (UnmanagedType.U2)] OciDataType dty,
IntPtr indp,
ref short indp,
IntPtr alenp,
IntPtr rcodep,
uint maxarr_len,
@@ -157,7 +157,7 @@ namespace System.Data.OracleClient.Oci
byte[] valuep,
int value_sz,
[MarshalAs (UnmanagedType.U2)] OciDataType dty,
IntPtr indp,
ref short indp,
IntPtr alenp,
IntPtr rcodep,
uint maxarr_len,
@@ -172,7 +172,7 @@ namespace System.Data.OracleClient.Oci
ref IntPtr valuep,
int value_sz,
[MarshalAs (UnmanagedType.U2)] OciDataType dty,
IntPtr indp,
ref short indp,
IntPtr alenp,
IntPtr rcodep,
uint maxarr_len,
@@ -193,8 +193,8 @@ namespace System.Data.OracleClient.Oci
IntPtr valuep,
int value_sz,
[MarshalAs (UnmanagedType.U4)] OciDataType dty,
IntPtr indp,
IntPtr rlenp,
ref short indp,
ref short rlenp,
IntPtr rcodep,
uint mode);
@@ -206,8 +206,8 @@ namespace System.Data.OracleClient.Oci
ref IntPtr valuep,
int value_sz,
[MarshalAs (UnmanagedType.U4)] OciDataType dty,
IntPtr indp,
IntPtr rlenp,
ref short indp,
ref short rlenp,
IntPtr rcodep,
uint mode);
@@ -547,7 +547,7 @@ namespace System.Data.OracleClient.Oci
IntPtr valuep,
int value_sz,
OciDataType dty,
IntPtr indp,
ref short indp,
IntPtr alenp,
IntPtr rcodep,
uint maxarr_len,
@@ -558,7 +558,7 @@ namespace System.Data.OracleClient.Oci
Trace.WriteLineIf(traceOci, "OCIBindByName", "OCI");
#endif
return OciNativeCalls.OCIBindByName (stmtp, out bindpp, errhp, placeholder, placeh_len, valuep,
value_sz, dty, indp, alenp, rcodep, maxarr_len, curelp, mode);
value_sz, dty, ref indp, alenp, rcodep, maxarr_len, curelp, mode);
}
internal static int OCIBindByNameRef (IntPtr stmtp,
@@ -569,7 +569,7 @@ namespace System.Data.OracleClient.Oci
ref IntPtr valuep,
int value_sz,
OciDataType dty,
IntPtr indp,
ref short indp,
IntPtr alenp,
IntPtr rcodep,
uint maxarr_len,
@@ -580,7 +580,7 @@ namespace System.Data.OracleClient.Oci
Trace.WriteLineIf(traceOci, "OCIBindByName", "OCI");
#endif
return OciNativeCalls.OCIBindByNameRef (stmtp, out bindpp, errhp, placeholder, placeh_len, ref valuep,
value_sz, dty, indp, alenp, rcodep, maxarr_len, curelp, mode);
value_sz, dty, ref indp, alenp, rcodep, maxarr_len, curelp, mode);
}
internal static int OCIBindByNameBytes (IntPtr stmtp,
@@ -591,7 +591,7 @@ namespace System.Data.OracleClient.Oci
byte[] valuep,
int value_sz,
[MarshalAs (UnmanagedType.U2)] OciDataType dty,
IntPtr indp,
ref short indp,
IntPtr alenp,
IntPtr rcodep,
uint maxarr_len,
@@ -602,7 +602,7 @@ namespace System.Data.OracleClient.Oci
Trace.WriteLineIf(traceOci, "OCIBindByName", "OCI");
#endif
return OciNativeCalls.OCIBindByNameBytes (stmtp, out bindpp, errhp, placeholder, placeh_len, valuep,
value_sz, dty, indp, alenp, rcodep, maxarr_len, curelp, mode);
value_sz, dty, ref indp, alenp, rcodep, maxarr_len, curelp, mode);
}
internal static int OCIBindByPos (IntPtr stmtp,
@@ -612,7 +612,7 @@ namespace System.Data.OracleClient.Oci
IntPtr valuep,
int value_sz,
[MarshalAs (UnmanagedType.U2)] OciDataType dty,
IntPtr indp,
ref short indp,
IntPtr alenp,
IntPtr rcodep,
uint maxarr_len,
@@ -623,7 +623,7 @@ namespace System.Data.OracleClient.Oci
Trace.WriteLineIf(traceOci, "OCIBindByPos", "OCI");
#endif
return OciNativeCalls.OCIBindByPos (stmtp, out bindpp, errhp, position, valuep,
value_sz, dty, indp, alenp, rcodep, maxarr_len, curelp, mode);
value_sz, dty, ref indp, alenp, rcodep, maxarr_len, curelp, mode);
}
internal static int OCIBindByPosRef (IntPtr stmtp,
@@ -633,7 +633,7 @@ namespace System.Data.OracleClient.Oci
ref IntPtr valuep,
int value_sz,
[MarshalAs (UnmanagedType.U2)] OciDataType dty,
IntPtr indp,
ref short indp,
IntPtr alenp,
IntPtr rcodep,
uint maxarr_len,
@@ -644,7 +644,7 @@ namespace System.Data.OracleClient.Oci
Trace.WriteLineIf(traceOci, "OCIBindByPos", "OCI");
#endif
return OciNativeCalls.OCIBindByPosRef (stmtp, out bindpp, errhp, position, ref valuep,
value_sz, dty, indp, alenp, rcodep, maxarr_len, curelp, mode);
value_sz, dty, ref indp, alenp, rcodep, maxarr_len, curelp, mode);
}
internal static int OCIBindByPosBytes (IntPtr stmtp,
@@ -654,7 +654,7 @@ namespace System.Data.OracleClient.Oci
byte[] valuep,
int value_sz,
[MarshalAs (UnmanagedType.U2)] OciDataType dty,
IntPtr indp,
ref short indp,
IntPtr alenp,
IntPtr rcodep,
uint maxarr_len,
@@ -665,7 +665,7 @@ namespace System.Data.OracleClient.Oci
Trace.WriteLineIf(traceOci, "OCIBindByPos", "OCI");
#endif
return OciNativeCalls.OCIBindByPosBytes (stmtp, out bindpp, errhp, position, valuep,
value_sz, dty, indp, alenp, rcodep, maxarr_len, curelp, mode);
value_sz, dty, ref indp, alenp, rcodep, maxarr_len, curelp, mode);
}
[DllImport ("oci")]
@@ -723,8 +723,8 @@ namespace System.Data.OracleClient.Oci
IntPtr valuep,
int value_sz,
OciDataType dty,
IntPtr indp,
IntPtr rlenp,
ref short indp,
ref short rlenp,
IntPtr rcodep,
uint mode)
{
@@ -732,7 +732,7 @@ namespace System.Data.OracleClient.Oci
Trace.WriteLineIf(traceOci, "OCIDefineByPos", "OCI");
#endif
return OciNativeCalls.OCIDefineByPos (stmtp, out defnpp, errhp, position, valuep,
value_sz, dty, indp, rlenp, rcodep, mode);
value_sz, dty, ref indp, ref rlenp, rcodep, mode);
}
internal static int OCIDefineByPosPtr (IntPtr stmtp,
@@ -742,8 +742,8 @@ namespace System.Data.OracleClient.Oci
ref IntPtr valuep,
int value_sz,
OciDataType dty,
IntPtr indp,
IntPtr rlenp,
ref short indp,
ref short rlenp,
IntPtr rcodep,
uint mode)
{
@@ -751,7 +751,7 @@ namespace System.Data.OracleClient.Oci
Trace.WriteLineIf(traceOci, "OCIDefineByPosPtr", "OCI");
#endif
return OciNativeCalls.OCIDefineByPosPtr (stmtp, out defnpp, errhp, position, ref valuep,
value_sz, dty, indp, rlenp, rcodep, mode);
value_sz, dty, ref indp, ref rlenp, rcodep, mode);
}
internal static int OCIDescriptorFree (IntPtr hndlp,
@@ -32,16 +32,16 @@ namespace System.Data.OracleClient.Oci
//IntPtr handle;
IntPtr value;
IntPtr indicator;
short indicator;
//OracleType type;
OciDataType ociType;
OciDataType definedType;
int definedSize;
IntPtr rlenp;
short rlenp = 0;
//short precision;
short scale;
Type fieldType;
string name;
//string name;
// Oracle defines the LONG VARCHAR and LONG VARRAW to have a size of 2 to the 31 power - 5
// see DefineLongVarChar and DefineLongVarRaw
@@ -70,13 +70,11 @@ namespace System.Data.OracleClient.Oci
{
OciParameterDescriptor parameter = ((OciStatementHandle) Parent).GetParameter (position);
name = parameter.GetName ();
//name = parameter.GetName ();
definedType = parameter.GetDataType ();
definedSize = parameter.GetDataSize ();
//precision = parameter.GetPrecision ();
scale = parameter.GetScale ();
rlenp = OciCalls.AllocateClear (sizeof(short));
indicator = OciCalls.AllocateClear (sizeof(short));
Define (position, connection);
@@ -105,7 +103,7 @@ namespace System.Data.OracleClient.Oci
}
internal bool IsNull {
get { return (Indicator == -1); }
get { return (indicator == -1); }
}
internal short Scale {
@@ -113,13 +111,7 @@ namespace System.Data.OracleClient.Oci
}
internal short Size {
get { return(Marshal.ReadInt16(rlenp)); }
set { Marshal.WriteInt16(rlenp, value); }
}
internal short Indicator {
get { return(Marshal.ReadInt16(indicator)); }
set { Marshal.WriteInt16(indicator, value); }
get { return rlenp; }
}
internal IntPtr Value {
@@ -200,8 +192,8 @@ namespace System.Data.OracleClient.Oci
ref value,
definedSize,
ociType,
indicator,
rlenp,
ref indicator,
ref rlenp,
IntPtr.Zero,
0);
@@ -230,8 +222,8 @@ namespace System.Data.OracleClient.Oci
value,
definedSize,
ociType,
indicator,
rlenp,
ref indicator,
ref rlenp,
IntPtr.Zero,
0);
@@ -269,11 +261,11 @@ namespace System.Data.OracleClient.Oci
value,
definedSize,
ociType,
indicator,
rlenp,
ref indicator,
ref rlenp,
IntPtr.Zero, 0);
Size = (short) definedSize;
rlenp = (short) definedSize;
if (status != 0) {
OciErrorInfo info = ErrorHandle.HandleError ();
@@ -299,8 +291,8 @@ namespace System.Data.OracleClient.Oci
value,
maxByteCount,
ociType,
indicator,
rlenp,
ref indicator,
ref rlenp,
IntPtr.Zero,
0);
OciErrorHandle.ThrowExceptionIfError (ErrorHandle, status);
@@ -320,10 +312,10 @@ namespace System.Data.OracleClient.Oci
ErrorHandle,
position + 1,
value,
definedSize,
definedSize * 2,
ociType,
indicator,
rlenp,
ref indicator,
ref rlenp,
IntPtr.Zero,
0);
@@ -365,8 +357,8 @@ namespace System.Data.OracleClient.Oci
ref value,
definedSize,
ociType,
indicator,
rlenp,
ref indicator,
ref rlenp,
IntPtr.Zero,
0);
@@ -394,8 +386,8 @@ namespace System.Data.OracleClient.Oci
value,
definedSize,
ociType,
indicator,
rlenp,
ref indicator,
ref rlenp,
IntPtr.Zero, 0);
if (status != 0) {
@@ -423,8 +415,8 @@ namespace System.Data.OracleClient.Oci
value,
definedSize,
ociType,
indicator,
rlenp,
ref indicator,
ref rlenp,
IntPtr.Zero, 0);
if (status != 0) {
@@ -467,8 +459,8 @@ namespace System.Data.OracleClient.Oci
ref value,
definedSize,
ociType,
indicator,
rlenp,
ref indicator,
ref rlenp,
IntPtr.Zero,
0);
@@ -495,8 +487,6 @@ namespace System.Data.OracleClient.Oci
}
disposed = true;
} finally {
Marshal.FreeHGlobal (indicator);
Marshal.FreeHGlobal (rlenp);
base.Dispose (disposing);
value = IntPtr.Zero;
}
@@ -37,13 +37,12 @@ using System.Text;
namespace System.Data.OracleClient
{
[TypeConverter (typeof(OracleParameter.OracleParameterConverter))]
public sealed class OracleParameter :
public sealed class OracleParameter :
#if NET_2_0
DbParameter, IDbDataParameter, ICloneable,
DbParameter, IDbDataParameter, ICloneable
#else
MarshalByRefObject, IDbDataParameter, IDataParameter, ICloneable,
MarshalByRefObject, IDbDataParameter, IDataParameter, ICloneable
#endif
IDisposable
{
#region Fields
@@ -67,7 +66,6 @@ namespace System.Data.OracleClient
object value = DBNull.Value;
OciLobLocator lobLocator; // only if Blob or Clob
IntPtr bindOutValue = IntPtr.Zero;
IntPtr indicator = IntPtr.Zero;
OciDateTimeDescriptor dateTimeDesc;
IntPtr cursor = IntPtr.Zero;
@@ -79,6 +77,7 @@ namespace System.Data.OracleClient
bool useRef;
OciDataType bindType;
short indicator;
int bindSize;
bool sizeManuallySet;
@@ -105,7 +104,6 @@ namespace System.Data.OracleClient
this.value = value.value;
this.lobLocator = value.lobLocator;
this.oracleTypeSet = value.oracleTypeSet;
this.indicator = OciCalls.AllocateClear (sizeof(short));
}
public OracleParameter ()
@@ -121,7 +119,6 @@ namespace System.Data.OracleClient
this.srcVersion = DataRowVersion.Current;
this.value = null;
this.oracleTypeSet = false;
this.indicator = OciCalls.AllocateClear (sizeof(short));
}
public OracleParameter (string name, object value)
@@ -132,7 +129,6 @@ namespace System.Data.OracleClient
srcColumn = string.Empty;
SourceVersion = DataRowVersion.Current;
InferOracleType (value);
this.indicator = OciCalls.AllocateClear (sizeof(short));
#if NET_2_0
// Find the OciType before inferring for the size
if (value != null && value != DBNull.Value) {
@@ -177,7 +173,6 @@ namespace System.Data.OracleClient
OracleType = oracleType;
SourceColumn = sourceColumn;
SourceVersion = sourceVersion;
this.indicator = OciCalls.AllocateClear (sizeof(short));
}
#endif
@@ -204,12 +199,6 @@ namespace System.Data.OracleClient
OracleType = oracleType;
SourceColumn = srcColumn;
SourceVersion = srcVersion;
this.indicator = OciCalls.AllocateClear (sizeof(short));
}
~OracleParameter ()
{
Dispose(false);
}
#endregion // Constructors
@@ -221,11 +210,6 @@ namespace System.Data.OracleClient
set { container = value; }
}
internal short Indicator {
get { return (Marshal.ReadInt16(indicator)); }
set { Marshal.WriteInt16(indicator, value); }
}
#if !NET_2_0
[Browsable (false)]
[RefreshProperties (RefreshProperties.All)]
@@ -469,6 +453,7 @@ namespace System.Data.OracleClient
}
if (isnull == true && direction == ParameterDirection.Input) {
indicator = 0;
bindType = OciDataType.VarChar2;
bindSize = 0;
} else {
@@ -480,6 +465,7 @@ namespace System.Data.OracleClient
case OciDataType.CharZ:
case OciDataType.OciString:
bindType = OciDataType.String;
indicator = 0;
svalue = "\0";
// convert value from managed type to type to marshal
if (direction == ParameterDirection.Input ||
@@ -572,7 +558,7 @@ namespace System.Data.OracleClient
dt = DateTime.MinValue;
sDate = "";
if (isnull)
Indicator = -1;
indicator = -1;
else if (v is String) {
sDate = (string) v;
dt = DateTime.Parse (sDate);
@@ -608,7 +594,7 @@ namespace System.Data.OracleClient
case OciDataType.Float:
case OciDataType.Number:
bindType = OciDataType.String;
Indicator = 0;
indicator = 0;
svalue = "\0";
// convert value from managed type to type to marshal
if (direction == ParameterDirection.Input ||
@@ -652,7 +638,7 @@ namespace System.Data.OracleClient
bindSize = Size + 5; // 4 bytes prepended for length, bytes, 1 byte NUL character
Indicator = 0;
indicator = 0;
svalue = "\0";
// convert value from managed type to type to marshal
if (direction == ParameterDirection.Input ||
@@ -772,7 +758,7 @@ namespace System.Data.OracleClient
case OciDataType.VarRaw:
bindType = OciDataType.VarRaw;
bindSize = Size + 2; // include 2 bytes prepended to hold the length
Indicator = 0;
indicator = 0;
bytes = new byte [bindSize];
if (direction == ParameterDirection.Input ||
direction == ParameterDirection.InputOutput) {
@@ -798,7 +784,7 @@ namespace System.Data.OracleClient
case OciDataType.LongVarRaw:
bindType = OciDataType.LongVarRaw;
bindSize = Size + 4; // include 4 bytes prepended to hold the length
Indicator = 0;
indicator = 0;
bytes = new byte [bindSize];
if (direction == ParameterDirection.Input ||
direction == ParameterDirection.InputOutput) {
@@ -868,7 +854,7 @@ namespace System.Data.OracleClient
ref bindValue,
bindSize,
bindType,
indicator,
ref indicator,
IntPtr.Zero,
IntPtr.Zero,
0,
@@ -884,7 +870,7 @@ namespace System.Data.OracleClient
ref bindValue,
bindSize,
bindType,
indicator,
ref indicator,
IntPtr.Zero,
IntPtr.Zero,
0,
@@ -901,7 +887,7 @@ namespace System.Data.OracleClient
ref cursor,
bindSize,
bindType,
indicator,
ref indicator,
IntPtr.Zero,
IntPtr.Zero,
0,
@@ -917,7 +903,7 @@ namespace System.Data.OracleClient
bytes,
bindSize,
bindType,
indicator,
ref indicator,
IntPtr.Zero,
IntPtr.Zero,
0,
@@ -933,7 +919,7 @@ namespace System.Data.OracleClient
bindValue,
bindSize,
bindType,
indicator,
ref indicator,
IntPtr.Zero,
IntPtr.Zero,
0,
@@ -1265,7 +1251,7 @@ namespace System.Data.OracleClient
// used to update the parameter value
// for Output, the output of InputOutput, and Return parameters
value = DBNull.Value;
if (Indicator == -1)
if (indicator == -1)
return;
int rsize = 0;
@@ -1467,22 +1453,6 @@ namespace System.Data.OracleClient
return buffer;
}
public void Dispose ()
{
Dispose (true);
}
void Dispose (bool disposing)
{
if (disposing) {
GC.SuppressFinalize(this);
}
if (indicator != IntPtr.Zero) {
Marshal.FreeHGlobal (indicator);
indicator = IntPtr.Zero;
}
}
#endregion // Methods
internal sealed class OracleParameterConverter : ExpandableObjectConverter
@@ -1 +1,2 @@
#include net_4_5_System.Data.Services.Client.dll.sources
#include System.Data.Services.Client.dll.sources
./Client/AssemblyAttributes.cs
@@ -26,11 +26,9 @@
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
using System;
using System.Data.Services;
using NUnit.Framework;
namespace MonoTests.System.Data.Services {
namespace System.Data.Services.Tests {
[TestFixture]
public class ChangeInterceptorAttributeTests {
[Test]
@@ -47,4 +45,4 @@ namespace MonoTests.System.Data.Services {
Assert.AreEqual ("setName", ci.EntitySetName);
}
}
}
}
Loaded 100 of 820 files, more files were not shown because too many files have changed in this diff. Show more