[runtime] Set pending exception in icalls instead of raising.
$(MCS) -unsafe -debug -nowarn:0162 -nowarn:0168 -nowarn:0219 -nowarn:0414 -nowarn:0618 -nowarn:0169 -nowarn:1690 -nowarn:0649 -nowarn:0612 -nowarn:3021 -nowarn:0197 -r:coreclr-testlibrary.dll -d:MONO -out:$@ $<
test-runner.exe: $(top_srcdir)/mono/tests/test-runner.cs
- $(MCS) -debug -out:$@ $<
+ $(MCS) -debug -r:Mono.Posix.dll -out:$@ $<
GCStressTests.exe: $(CORECLR_STRESSTEST_RUNNER_CS_SRC)
$(MCS) -out:$@ -debug -d:PROJECTK_BUILD $(CORECLR_STRESSTEST_RUNNER_CS_SRC)
dnl hires monotonic clock support
AC_SEARCH_LIBS(clock_gettime, rt)
+ AC_CHECK_FUNCS(clock_nanosleep)
dnl dynamic loader support
AC_CHECK_FUNC(dlopen, DL_LIB="",
monoapi.tree monoapi.zip
convert.exe: $(srcdir)/convert.cs AgilityPack.dll
- $(CSCOMPILE) -r:System.Xml.dll -out:$@ $< -r:AgilityPack.dll
+ $(CSCOMPILE) -r:$(topdir)/class/lib/$(PROFILE)/System.Xml.dll -out:$@ $< -r:AgilityPack.dll
AgilityPack.dll:
- $(CSCOMPILE) -r:System.dll -r:System.Xml.dll -target:library -out:$@ $(srcdir)/HtmlAgilityPack/*.cs
+ $(CSCOMPILE) -r:$(topdir)/class/lib/$(PROFILE)/System.dll -r:$(topdir)/class/lib/$(PROFILE)/System.Xml.dll -target:library -out:$@ $(srcdir)/HtmlAgilityPack/*.cs
monoapi.zip: monoapi.tree
@test -f $@ || { rm -f $< && $(MAKE) $<; }
--- /dev/null
+This is a copy of a few libunwind headers from https://android.googlesource.com/platform/external/libunwind
+
+We can't make the repo a git submodule because it contains a folder called 'aux' which
+is reserved on Windows and would break on checkout there.
+
+These files are unmodified from the originals and should preferably stay that
+way to avoid merge hell.
+
+Commit: 338c9755cfe3d009c3dfff7d108e2c3ddaa6f3bb (android-6.0.1_r24)
\ No newline at end of file
--- /dev/null
+/* libunwind - a platform-independent unwind library
+ Copyright (C) 2001-2004 Hewlett-Packard Co
+ Contributed by David Mosberger-Tang <davidm@hpl.hp.com>
+ Copyright (C) 2013 Linaro Limited
+
+This file is part of libunwind.
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+"Software"), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
+
+#ifndef LIBUNWIND_H
+#define LIBUNWIND_H
+
+#if defined(__cplusplus) || defined(c_plusplus)
+extern "C" {
+#endif
+
+#include <inttypes.h>
+#include <stddef.h>
+#include <ucontext.h>
+
+#define UNW_TARGET aarch64
+#define UNW_TARGET_AARCH64 1
+
+#define _U_TDEP_QP_TRUE 0 /* see libunwind-dynamic.h */
+
+/* This needs to be big enough to accommodate "struct cursor", while
+ leaving some slack for future expansion. Changing this value will
+ require recompiling all users of this library. Stack allocation is
+ relatively cheap and unwind-state copying is relatively rare, so we
+ want to err on making it rather too big than too small. */
+
+#define UNW_TDEP_CURSOR_LEN 4096
+
+typedef uint64_t unw_word_t;
+typedef int64_t unw_sword_t;
+
+typedef long double unw_tdep_fpreg_t;
+
+typedef struct
+ {
+ /* no aarch64-specific auxiliary proc-info */
+ /* ANDROID support update. */
+ char __reserved;
+ /* End of ANDROID update. */
+ }
+unw_tdep_proc_info_t;
+
+typedef enum
+ {
+ /* 64-bit general registers. */
+ UNW_AARCH64_X0,
+ UNW_AARCH64_X1,
+ UNW_AARCH64_X2,
+ UNW_AARCH64_X3,
+ UNW_AARCH64_X4,
+ UNW_AARCH64_X5,
+ UNW_AARCH64_X6,
+ UNW_AARCH64_X7,
+ UNW_AARCH64_X8,
+
+ /* Temporary registers. */
+ UNW_AARCH64_X9,
+ UNW_AARCH64_X10,
+ UNW_AARCH64_X11,
+ UNW_AARCH64_X12,
+ UNW_AARCH64_X13,
+ UNW_AARCH64_X14,
+ UNW_AARCH64_X15,
+
+ /* Intra-procedure-call temporary registers. */
+ UNW_AARCH64_X16,
+ UNW_AARCH64_X17,
+
+ /* Callee-saved registers. */
+ UNW_AARCH64_X18,
+ UNW_AARCH64_X19,
+ UNW_AARCH64_X20,
+ UNW_AARCH64_X21,
+ UNW_AARCH64_X22,
+ UNW_AARCH64_X23,
+ UNW_AARCH64_X24,
+ UNW_AARCH64_X25,
+ UNW_AARCH64_X26,
+ UNW_AARCH64_X27,
+ UNW_AARCH64_X28,
+
+ /* 64-bit frame pointer. */
+ UNW_AARCH64_X29,
+
+ /* 64-bit link register. */
+ UNW_AARCH64_X30,
+
+ /* 64-bit stack pointer. */
+ UNW_AARCH64_SP = 31,
+ UNW_AARCH64_PC,
+ UNW_AARCH64_PSTATE,
+
+ /* 128-bit FP/Advanced SIMD registers. */
+ UNW_AARCH64_V0 = 64,
+ UNW_AARCH64_V1,
+ UNW_AARCH64_V2,
+ UNW_AARCH64_V3,
+ UNW_AARCH64_V4,
+ UNW_AARCH64_V5,
+ UNW_AARCH64_V6,
+ UNW_AARCH64_V7,
+ UNW_AARCH64_V8,
+ UNW_AARCH64_V9,
+ UNW_AARCH64_V10,
+ UNW_AARCH64_V11,
+ UNW_AARCH64_V12,
+ UNW_AARCH64_V13,
+ UNW_AARCH64_V14,
+ UNW_AARCH64_V15,
+ UNW_AARCH64_V16,
+ UNW_AARCH64_V17,
+ UNW_AARCH64_V18,
+ UNW_AARCH64_V19,
+ UNW_AARCH64_V20,
+ UNW_AARCH64_V21,
+ UNW_AARCH64_V22,
+ UNW_AARCH64_V23,
+ UNW_AARCH64_V24,
+ UNW_AARCH64_V25,
+ UNW_AARCH64_V26,
+ UNW_AARCH64_V27,
+ UNW_AARCH64_V28,
+ UNW_AARCH64_V29,
+ UNW_AARCH64_V30,
+ UNW_AARCH64_V31,
+
+ UNW_AARCH64_FPSR,
+ UNW_AARCH64_FPCR,
+
+ /* For AArch64, the CFA is the value of SP (x31) at the call site of the
+ previous frame. */
+ UNW_AARCH64_CFA = UNW_AARCH64_SP,
+
+ UNW_TDEP_LAST_REG = UNW_AARCH64_FPCR,
+
+ UNW_TDEP_IP = UNW_AARCH64_X30,
+ UNW_TDEP_SP = UNW_AARCH64_SP,
+ UNW_TDEP_EH = UNW_AARCH64_X0,
+
+ }
+aarch64_regnum_t;
+
+/* Use R0 through R3 to pass exception handling information. */
+#define UNW_TDEP_NUM_EH_REGS 4
+
+typedef struct unw_tdep_save_loc
+ {
+ /* Additional target-dependent info on a save location. */
+ /* ANDROID support update. */
+ char __reserved;
+ /* End of ANDROID update. */
+ }
+unw_tdep_save_loc_t;
+
+
+/* On AArch64, we can directly use ucontext_t as the unwind context. */
+typedef ucontext_t unw_tdep_context_t;
+
+#include "libunwind-common.h"
+#include "libunwind-dynamic.h"
+
+/* ANDROID support update. */
+/* There is no getcontext in Android. */
+#define unw_tdep_getcontext(uc) (({ \
+ unw_tdep_context_t *unw_ctx = (uc); \
+ register uint64_t *unw_base asm ("x0") = (uint64_t*) unw_ctx->uc_mcontext.regs; \
+ __asm__ __volatile__ ( \
+ "stp x0, x1, [%[base], #0]\n" \
+ "stp x2, x3, [%[base], #16]\n" \
+ "stp x4, x5, [%[base], #32]\n" \
+ "stp x6, x7, [%[base], #48]\n" \
+ "stp x8, x9, [%[base], #64]\n" \
+ "stp x10, x11, [%[base], #80]\n" \
+ "stp x12, x13, [%[base], #96]\n" \
+ "stp x14, x13, [%[base], #112]\n" \
+ "stp x16, x17, [%[base], #128]\n" \
+ "stp x18, x19, [%[base], #144]\n" \
+ "stp x20, x21, [%[base], #160]\n" \
+ "stp x22, x23, [%[base], #176]\n" \
+ "stp x24, x25, [%[base], #192]\n" \
+ "stp x26, x27, [%[base], #208]\n" \
+ "stp x28, x29, [%[base], #224]\n" \
+ "str x30, [%[base], #240]\n" \
+ "mov x1, sp\n" \
+ "stp x1, x30, [%[base], #248]\n" \
+ : [base] "+r" (unw_base) : : "x1", "memory"); \
+ }), 0)
+/* End of ANDROID update. */
+#define unw_tdep_is_fpreg UNW_ARCH_OBJ(is_fpreg)
+
+extern int unw_tdep_is_fpreg (int);
+
+#if defined(__cplusplus) || defined(c_plusplus)
+}
+#endif
+
+#endif /* LIBUNWIND_H */
--- /dev/null
+/* libunwind - a platform-independent unwind library
+ Copyright (C) 2008 CodeSourcery
+
+This file is part of libunwind.
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+"Software"), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
+
+#ifndef LIBUNWIND_H
+#define LIBUNWIND_H
+
+#if defined(__cplusplus) || defined(c_plusplus)
+extern "C" {
+#endif
+
+#include <inttypes.h>
+#include <stddef.h>
+
+#define UNW_TARGET arm
+#define UNW_TARGET_ARM 1
+
+#define _U_TDEP_QP_TRUE 0 /* see libunwind-dynamic.h */
+
+/* This needs to be big enough to accommodate "struct cursor", while
+ leaving some slack for future expansion. Changing this value will
+ require recompiling all users of this library. Stack allocation is
+ relatively cheap and unwind-state copying is relatively rare, so we
+ want to err on making it rather too big than too small. */
+
+/* FIXME for ARM. Too big? What do other things use for similar tasks? */
+#define UNW_TDEP_CURSOR_LEN 4096
+
+typedef uint32_t unw_word_t;
+typedef int32_t unw_sword_t;
+
+typedef long double unw_tdep_fpreg_t;
+
+typedef enum
+ {
+ UNW_ARM_R0,
+ UNW_ARM_R1,
+ UNW_ARM_R2,
+ UNW_ARM_R3,
+ UNW_ARM_R4,
+ UNW_ARM_R5,
+ UNW_ARM_R6,
+ UNW_ARM_R7,
+ UNW_ARM_R8,
+ UNW_ARM_R9,
+ UNW_ARM_R10,
+ UNW_ARM_R11,
+ UNW_ARM_R12,
+ UNW_ARM_R13,
+ UNW_ARM_R14,
+ UNW_ARM_R15,
+
+ /* VFPv2 s0-s31 (obsolescent numberings). */
+ UNW_ARM_S0 = 64,
+ UNW_ARM_S1,
+ UNW_ARM_S2,
+ UNW_ARM_S3,
+ UNW_ARM_S4,
+ UNW_ARM_S5,
+ UNW_ARM_S6,
+ UNW_ARM_S7,
+ UNW_ARM_S8,
+ UNW_ARM_S9,
+ UNW_ARM_S10,
+ UNW_ARM_S11,
+ UNW_ARM_S12,
+ UNW_ARM_S13,
+ UNW_ARM_S14,
+ UNW_ARM_S15,
+ UNW_ARM_S16,
+ UNW_ARM_S17,
+ UNW_ARM_S18,
+ UNW_ARM_S19,
+ UNW_ARM_S20,
+ UNW_ARM_S21,
+ UNW_ARM_S22,
+ UNW_ARM_S23,
+ UNW_ARM_S24,
+ UNW_ARM_S25,
+ UNW_ARM_S26,
+ UNW_ARM_S27,
+ UNW_ARM_S28,
+ UNW_ARM_S29,
+ UNW_ARM_S30,
+ UNW_ARM_S31,
+
+ /* FPA register numberings. */
+ UNW_ARM_F0 = 96,
+ UNW_ARM_F1,
+ UNW_ARM_F2,
+ UNW_ARM_F3,
+ UNW_ARM_F4,
+ UNW_ARM_F5,
+ UNW_ARM_F6,
+ UNW_ARM_F7,
+
+ /* iWMMXt GR register numberings. */
+ UNW_ARM_wCGR0 = 104,
+ UNW_ARM_wCGR1,
+ UNW_ARM_wCGR2,
+ UNW_ARM_wCGR3,
+ UNW_ARM_wCGR4,
+ UNW_ARM_wCGR5,
+ UNW_ARM_wCGR6,
+ UNW_ARM_wCGR7,
+
+ /* iWMMXt register numberings. */
+ UNW_ARM_wR0 = 112,
+ UNW_ARM_wR1,
+ UNW_ARM_wR2,
+ UNW_ARM_wR3,
+ UNW_ARM_wR4,
+ UNW_ARM_wR5,
+ UNW_ARM_wR6,
+ UNW_ARM_wR7,
+ UNW_ARM_wR8,
+ UNW_ARM_wR9,
+ UNW_ARM_wR10,
+ UNW_ARM_wR11,
+ UNW_ARM_wR12,
+ UNW_ARM_wR13,
+ UNW_ARM_wR14,
+ UNW_ARM_wR15,
+
+ /* Two-byte encodings from here on. */
+
+ /* SPSR. */
+ UNW_ARM_SPSR = 128,
+ UNW_ARM_SPSR_FIQ,
+ UNW_ARM_SPSR_IRQ,
+ UNW_ARM_SPSR_ABT,
+ UNW_ARM_SPSR_UND,
+ UNW_ARM_SPSR_SVC,
+
+ /* User mode registers. */
+ UNW_ARM_R8_USR = 144,
+ UNW_ARM_R9_USR,
+ UNW_ARM_R10_USR,
+ UNW_ARM_R11_USR,
+ UNW_ARM_R12_USR,
+ UNW_ARM_R13_USR,
+ UNW_ARM_R14_USR,
+
+ /* FIQ registers. */
+ UNW_ARM_R8_FIQ = 151,
+ UNW_ARM_R9_FIQ,
+ UNW_ARM_R10_FIQ,
+ UNW_ARM_R11_FIQ,
+ UNW_ARM_R12_FIQ,
+ UNW_ARM_R13_FIQ,
+ UNW_ARM_R14_FIQ,
+
+ /* IRQ registers. */
+ UNW_ARM_R13_IRQ = 158,
+ UNW_ARM_R14_IRQ,
+
+ /* ABT registers. */
+ UNW_ARM_R13_ABT = 160,
+ UNW_ARM_R14_ABT,
+
+ /* UND registers. */
+ UNW_ARM_R13_UND = 162,
+ UNW_ARM_R14_UND,
+
+ /* SVC registers. */
+ UNW_ARM_R13_SVC = 164,
+ UNW_ARM_R14_SVC,
+
+ /* iWMMXt control registers. */
+ UNW_ARM_wC0 = 192,
+ UNW_ARM_wC1,
+ UNW_ARM_wC2,
+ UNW_ARM_wC3,
+ UNW_ARM_wC4,
+ UNW_ARM_wC5,
+ UNW_ARM_wC6,
+ UNW_ARM_wC7,
+
+ /* VFPv3/Neon 64-bit registers. */
+ UNW_ARM_D0 = 256,
+ UNW_ARM_D1,
+ UNW_ARM_D2,
+ UNW_ARM_D3,
+ UNW_ARM_D4,
+ UNW_ARM_D5,
+ UNW_ARM_D6,
+ UNW_ARM_D7,
+ UNW_ARM_D8,
+ UNW_ARM_D9,
+ UNW_ARM_D10,
+ UNW_ARM_D11,
+ UNW_ARM_D12,
+ UNW_ARM_D13,
+ UNW_ARM_D14,
+ UNW_ARM_D15,
+ UNW_ARM_D16,
+ UNW_ARM_D17,
+ UNW_ARM_D18,
+ UNW_ARM_D19,
+ UNW_ARM_D20,
+ UNW_ARM_D21,
+ UNW_ARM_D22,
+ UNW_ARM_D23,
+ UNW_ARM_D24,
+ UNW_ARM_D25,
+ UNW_ARM_D26,
+ UNW_ARM_D27,
+ UNW_ARM_D28,
+ UNW_ARM_D29,
+ UNW_ARM_D30,
+ UNW_ARM_D31,
+
+ /* For ARM, the CFA is the value of SP (r13) at the call site in the
+ previous frame. */
+ UNW_ARM_CFA,
+
+ UNW_TDEP_LAST_REG = UNW_ARM_D31,
+
+ UNW_TDEP_IP = UNW_ARM_R14, /* A little white lie. */
+ UNW_TDEP_SP = UNW_ARM_R13,
+ UNW_TDEP_EH = UNW_ARM_R0 /* FIXME. */
+ }
+arm_regnum_t;
+
+#define UNW_TDEP_NUM_EH_REGS 2 /* FIXME for ARM. */
+
+typedef struct unw_tdep_save_loc
+ {
+ /* Additional target-dependent info on a save location. */
+ /* ANDROID support update. */
+ char __reserved;
+ /* End of ANDROID update. */
+ }
+unw_tdep_save_loc_t;
+
+/* On ARM, we define our own unw_tdep_context instead of using ucontext_t.
+ This allows us to support systems that don't support getcontext and
+ therefore do not define ucontext_t. */
+typedef struct unw_tdep_context
+ {
+ unsigned long regs[16];
+ }
+unw_tdep_context_t;
+
+/* There is no getcontext() on ARM. Use a stub version which only saves GP
+ registers. FIXME: Not ideal, may not be sufficient for all libunwind
+ use cases. Stores pc+8, which is only approximately correct, really. */
+#ifndef __thumb__
+#define unw_tdep_getcontext(uc) (({ \
+ unw_tdep_context_t *unw_ctx = (uc); \
+ register unsigned long *unw_base asm ("r0") = unw_ctx->regs; \
+ __asm__ __volatile__ ( \
+ "stmia %[base], {r0-r15}" \
+ : : [base] "r" (unw_base) : "memory"); \
+ }), 0)
+#else /* __thumb__ */
+#define unw_tdep_getcontext(uc) (({ \
+ unw_tdep_context_t *unw_ctx = (uc); \
+ register unsigned long *unw_base asm ("r0") = unw_ctx->regs; \
+ __asm__ __volatile__ ( \
+ ".align 2\nbx pc\nnop\n.code 32\n" \
+ "stmia %[base], {r0-r15}\n" \
+ "orr %[base], pc, #1\nbx %[base]" \
+ : [base] "+r" (unw_base) : : "memory", "cc"); \
+ }), 0)
+#endif
+
+#include "libunwind-dynamic.h"
+
+typedef struct
+ {
+ /* no arm-specific auxiliary proc-info */
+ /* ANDROID support update. */
+ char __reserved;
+ /* End of ANDROID update. */
+ }
+unw_tdep_proc_info_t;
+
+#include "libunwind-common.h"
+
+#define unw_tdep_is_fpreg UNW_ARCH_OBJ(is_fpreg)
+extern int unw_tdep_is_fpreg (int);
+
+#if defined(__cplusplus) || defined(c_plusplus)
+}
+#endif
+
+#endif /* LIBUNWIND_H */
--- /dev/null
+/* libunwind - a platform-independent unwind library
+ Copyright (C) 2001-2004 Hewlett-Packard Co
+ Contributed by David Mosberger-Tang <davidm@hpl.hp.com>
+
+This file is part of libunwind.
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+"Software"), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
+
+/* ANDROID support update. */
+#include <sys/types.h>
+/* End of ANDROID update. */
+
+#define UNW_VERSION_MAJOR 1
+#define UNW_VERSION_MINOR 1
+#define UNW_VERSION_EXTRA
+
+#define UNW_VERSION_CODE(maj,min) (((maj) << 16) | (min))
+#define UNW_VERSION UNW_VERSION_CODE(UNW_VERSION_MAJOR, UNW_VERSION_MINOR)
+
+#define UNW_PASTE2(x,y) x##y
+#define UNW_PASTE(x,y) UNW_PASTE2(x,y)
+#define UNW_OBJ(fn) UNW_PASTE(UNW_PREFIX, fn)
+#define UNW_ARCH_OBJ(fn) UNW_PASTE(UNW_PASTE(UNW_PASTE(_U,UNW_TARGET),_), fn)
+
+#ifdef UNW_LOCAL_ONLY
+# ifdef UNW_ADDITIONAL_PREFIX
+# define UNW_PREFIX UNW_PASTE(UNW_PASTE(_UUL,UNW_TARGET),_)
+# else
+# define UNW_PREFIX UNW_PASTE(UNW_PASTE(_UL,UNW_TARGET),_)
+# endif
+#else /* !UNW_LOCAL_ONLY */
+# ifdef UNW_ADDITIONAL_PREFIX
+# define UNW_PREFIX UNW_PASTE(UNW_PASTE(_UU,UNW_TARGET),_)
+# else
+# define UNW_PREFIX UNW_PASTE(UNW_PASTE(_U,UNW_TARGET),_)
+# endif
+#endif /* !UNW_LOCAL_ONLY */
+
+/* Error codes. The unwind routines return the *negated* values of
+ these error codes on error and a non-negative value on success. */
+typedef enum
+ {
+ UNW_ESUCCESS = 0, /* no error */
+ UNW_EUNSPEC, /* unspecified (general) error */
+ UNW_ENOMEM, /* out of memory */
+ UNW_EBADREG, /* bad register number */
+ UNW_EREADONLYREG, /* attempt to write read-only register */
+ UNW_ESTOPUNWIND, /* stop unwinding */
+ UNW_EINVALIDIP, /* invalid IP */
+ UNW_EBADFRAME, /* bad frame */
+ UNW_EINVAL, /* unsupported operation or bad value */
+ UNW_EBADVERSION, /* unwind info has unsupported version */
+ UNW_ENOINFO /* no unwind info found */
+ }
+unw_error_t;
+
+/* The following enum defines the indices for a couple of
+ (pseudo-)registers which have the same meaning across all
+ platforms. (RO) means read-only. (RW) means read-write. General
+ registers (aka "integer registers") are expected to start with
+ index 0. The number of such registers is architecture-dependent.
+ The remaining indices can be used as an architecture sees fit. The
+ last valid register index is given by UNW_REG_LAST. */
+typedef enum
+ {
+ UNW_REG_IP = UNW_TDEP_IP, /* (rw) instruction pointer (pc) */
+ UNW_REG_SP = UNW_TDEP_SP, /* (ro) stack pointer */
+ UNW_REG_EH = UNW_TDEP_EH, /* (rw) exception-handling reg base */
+ UNW_REG_LAST = UNW_TDEP_LAST_REG
+ }
+unw_frame_regnum_t;
+
+/* Number of exception-handler argument registers: */
+#define UNW_NUM_EH_REGS UNW_TDEP_NUM_EH_REGS
+
+typedef enum
+ {
+ UNW_CACHE_NONE, /* no caching */
+ UNW_CACHE_GLOBAL, /* shared global cache */
+ UNW_CACHE_PER_THREAD /* per-thread caching */
+ }
+unw_caching_policy_t;
+
+typedef int unw_regnum_t;
+
+/* The unwind cursor starts at the youngest (most deeply nested) frame
+ and is used to track the frame state as the unwinder steps from
+ frame to frame. It is safe to make (shallow) copies of variables
+ of this type. */
+typedef struct unw_cursor
+ {
+ unw_word_t opaque[UNW_TDEP_CURSOR_LEN];
+ }
+unw_cursor_t;
+
+/* This type encapsulates the entire (preserved) machine-state. */
+typedef unw_tdep_context_t unw_context_t;
+
+/* unw_getcontext() fills the unw_context_t pointed to by UC with the
+ machine state as it exists at the call-site. For implementation
+ reasons, this needs to be a target-dependent macro. It's easiest
+ to think of unw_getcontext() as being identical to getcontext(). */
+#define unw_getcontext(uc) unw_tdep_getcontext(uc)
+
+/* Return 1 if register number R is a floating-point register, zero
+ otherwise.
+ This routine is signal-safe. */
+#define unw_is_fpreg(r) unw_tdep_is_fpreg(r)
+
+typedef unw_tdep_fpreg_t unw_fpreg_t;
+
+typedef struct unw_addr_space *unw_addr_space_t;
+
+/* Each target may define it's own set of flags, but bits 0-15 are
+ reserved for general libunwind-use. */
+#define UNW_PI_FLAG_FIRST_TDEP_BIT 16
+/* The information comes from a .debug_frame section. */
+#define UNW_PI_FLAG_DEBUG_FRAME 32
+
+typedef struct unw_proc_info
+ {
+ unw_word_t start_ip; /* first IP covered by this procedure */
+ unw_word_t end_ip; /* first IP NOT covered by this procedure */
+ unw_word_t lsda; /* address of lang.-spec. data area (if any) */
+ unw_word_t handler; /* optional personality routine */
+ unw_word_t gp; /* global-pointer value for this procedure */
+ unw_word_t flags; /* misc. flags */
+
+ int format; /* unwind-info format (arch-specific) */
+ int unwind_info_size; /* size of the information (if applicable) */
+ void *unwind_info; /* unwind-info (arch-specific) */
+ unw_tdep_proc_info_t extra; /* target-dependent auxiliary proc-info */
+ }
+unw_proc_info_t;
+
+/* These are backend callback routines that provide access to the
+ state of a "remote" process. This can be used, for example, to
+ unwind another process through the ptrace() interface. */
+typedef struct unw_accessors
+ {
+ /* Look up the unwind info associated with instruction-pointer IP.
+ On success, the routine fills in the PROC_INFO structure. */
+ int (*find_proc_info) (unw_addr_space_t, unw_word_t, unw_proc_info_t *,
+ int, void *);
+
+ /* Release any resources (e.g., memory) that were allocated for
+ the unwind info returned in by a previous call to
+ find_proc_info() with NEED_UNWIND_INFO set to 1. */
+ void (*put_unwind_info) (unw_addr_space_t, unw_proc_info_t *, void *);
+
+ /* Return the list-head of the dynamically registered unwind
+ info. */
+ int (*get_dyn_info_list_addr) (unw_addr_space_t, unw_word_t *, void *);
+
+ /* Access aligned word at address ADDR. The value is returned
+ according to the endianness of the host (e.g., if the host is
+ little-endian and the target is big-endian, access_mem() needs
+ to byte-swap the value before returning it). */
+ int (*access_mem) (unw_addr_space_t, unw_word_t, unw_word_t *, int,
+ void *);
+
+ /* Access register number REG at address ADDR. */
+ int (*access_reg) (unw_addr_space_t, unw_regnum_t, unw_word_t *, int,
+ void *);
+
+ /* Access register number REG at address ADDR. */
+ int (*access_fpreg) (unw_addr_space_t, unw_regnum_t,
+ unw_fpreg_t *, int, void *);
+
+ int (*resume) (unw_addr_space_t, unw_cursor_t *, void *);
+
+ /* Optional call back to obtain the name of a (static) procedure.
+ Dynamically generated procedures are handled automatically by
+ libunwind. This callback is optional and may be set to
+ NULL. */
+ int (*get_proc_name) (unw_addr_space_t, unw_word_t, char *, size_t,
+ unw_word_t *, void *);
+ }
+unw_accessors_t;
+
+typedef enum unw_save_loc_type
+ {
+ UNW_SLT_NONE, /* register is not saved ("not an l-value") */
+ UNW_SLT_MEMORY, /* register has been saved in memory */
+ UNW_SLT_REG /* register has been saved in (another) register */
+ }
+unw_save_loc_type_t;
+
+typedef struct unw_save_loc
+ {
+ unw_save_loc_type_t type;
+ union
+ {
+ unw_word_t addr; /* valid if type==UNW_SLT_MEMORY */
+ unw_regnum_t regnum; /* valid if type==UNW_SLT_REG */
+ }
+ u;
+ unw_tdep_save_loc_t extra; /* target-dependent additional information */
+ }
+unw_save_loc_t;
+
+/* ANDROID support update. */
+typedef struct unw_map_cursor
+ {
+ void *map_list;
+ void *cur_map;
+ }
+unw_map_cursor_t;
+
+typedef struct unw_map
+ {
+ unw_word_t start;
+ unw_word_t end;
+ unw_word_t offset;
+ unw_word_t load_base;
+ char *path;
+ int flags;
+ }
+unw_map_t;
+/* End of ANDROID update. */
+
+/* These routines work both for local and remote unwinding. */
+
+#define unw_local_access_addr_space_init UNW_OBJ(local_access_addr_space_init)
+#define unw_local_addr_space UNW_OBJ(local_addr_space)
+#define unw_create_addr_space UNW_OBJ(create_addr_space)
+#define unw_destroy_addr_space UNW_OBJ(destroy_addr_space)
+#define unw_get_accessors UNW_ARCH_OBJ(get_accessors)
+#define unw_init_local UNW_OBJ(init_local)
+#define unw_init_remote UNW_OBJ(init_remote)
+#define unw_step UNW_OBJ(step)
+#define unw_resume UNW_OBJ(resume)
+#define unw_get_proc_info UNW_OBJ(get_proc_info)
+#define unw_get_proc_info_by_ip UNW_OBJ(get_proc_info_by_ip)
+#define unw_get_reg UNW_OBJ(get_reg)
+#define unw_set_reg UNW_OBJ(set_reg)
+#define unw_get_fpreg UNW_OBJ(get_fpreg)
+#define unw_set_fpreg UNW_OBJ(set_fpreg)
+#define unw_get_save_loc UNW_OBJ(get_save_loc)
+#define unw_is_signal_frame UNW_OBJ(is_signal_frame)
+#define unw_handle_signal_frame UNW_OBJ(handle_signal_frame)
+#define unw_get_proc_name UNW_OBJ(get_proc_name)
+#define unw_get_proc_name_by_ip UNW_OBJ(get_proc_name_by_ip)
+#define unw_set_caching_policy UNW_OBJ(set_caching_policy)
+#define unw_regname UNW_ARCH_OBJ(regname)
+#define unw_flush_cache UNW_ARCH_OBJ(flush_cache)
+#define unw_strerror UNW_ARCH_OBJ(strerror)
+
+extern void unw_local_access_addr_space_init (unw_addr_space_t);
+extern unw_addr_space_t unw_create_addr_space (unw_accessors_t *, int);
+extern void unw_destroy_addr_space (unw_addr_space_t);
+extern unw_accessors_t *unw_get_accessors (unw_addr_space_t);
+extern void unw_flush_cache (unw_addr_space_t, unw_word_t, unw_word_t);
+extern int unw_set_caching_policy (unw_addr_space_t, unw_caching_policy_t);
+extern const char *unw_regname (unw_regnum_t);
+
+extern int unw_init_local (unw_cursor_t *, unw_context_t *);
+extern int unw_init_remote (unw_cursor_t *, unw_addr_space_t, void *);
+extern int unw_step (unw_cursor_t *);
+extern int unw_resume (unw_cursor_t *);
+extern int unw_get_proc_info (unw_cursor_t *, unw_proc_info_t *);
+extern int unw_get_proc_info_by_ip (unw_addr_space_t, unw_word_t,
+ unw_proc_info_t *, void *);
+extern int unw_get_reg (unw_cursor_t *, int, unw_word_t *);
+extern int unw_set_reg (unw_cursor_t *, int, unw_word_t);
+extern int unw_get_fpreg (unw_cursor_t *, int, unw_fpreg_t *);
+extern int unw_set_fpreg (unw_cursor_t *, int, unw_fpreg_t);
+extern int unw_get_save_loc (unw_cursor_t *, int, unw_save_loc_t *);
+extern int unw_is_signal_frame (unw_cursor_t *);
+extern int unw_handle_signal_frame (unw_cursor_t *);
+extern int unw_get_proc_name (unw_cursor_t *, char *, size_t, unw_word_t *);
+extern int unw_get_proc_name_by_ip (unw_addr_space_t, unw_word_t, char *,
+ size_t, unw_word_t *, void *);
+extern const char *unw_strerror (int);
+extern int unw_backtrace (void **, int);
+
+/* ANDROID support update. */
+extern int unw_map_local_cursor_valid (unw_map_cursor_t *);
+extern void unw_map_local_cursor_get (unw_map_cursor_t *);
+extern int unw_map_local_cursor_get_next (unw_map_cursor_t *, unw_map_t *);
+extern int unw_map_local_create (void);
+extern void unw_map_local_destroy (void);
+extern void unw_map_set (unw_addr_space_t, unw_map_cursor_t *);
+extern void unw_map_cursor_reset (unw_map_cursor_t *);
+extern void unw_map_cursor_clear (unw_map_cursor_t *);
+extern int unw_map_cursor_create (unw_map_cursor_t *, pid_t);
+extern void unw_map_cursor_destroy (unw_map_cursor_t *);
+extern int unw_map_cursor_get_next (unw_map_cursor_t *, unw_map_t *);
+/* End of ANDROID update. */
+
+extern unw_addr_space_t unw_local_addr_space;
--- /dev/null
+/* libunwind - a platform-independent unwind library
+
+This file is part of libunwind.
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+"Software"), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
+
+#ifndef libunwind_coredump_h
+#define libunwind_coredump_h
+
+#include <libunwind.h>
+
+#if defined(__cplusplus) || defined(c_plusplus)
+extern "C" {
+#endif
+
+/* Helper routines which make it easy to use libunwind on a coredump.
+ They're available only if UNW_REMOTE_ONLY is _not_ defined and they
+ aren't really part of the libunwind API. They are implemented in a
+ archive library called libunwind-coredump.a. */
+
+struct UCD_info;
+
+extern struct UCD_info *_UCD_create(const char *filename);
+extern void _UCD_destroy(struct UCD_info *);
+
+extern int _UCD_get_num_threads(struct UCD_info *);
+extern void _UCD_select_thread(struct UCD_info *, int);
+extern pid_t _UCD_get_pid(struct UCD_info *);
+extern int _UCD_get_cursig(struct UCD_info *);
+extern int _UCD_add_backing_file_at_segment(struct UCD_info *, int phdr_no, const char *filename);
+extern int _UCD_add_backing_file_at_vaddr(struct UCD_info *,
+ unsigned long vaddr,
+ const char *filename);
+
+extern int _UCD_find_proc_info (unw_addr_space_t, unw_word_t,
+ unw_proc_info_t *, int, void *);
+extern void _UCD_put_unwind_info (unw_addr_space_t, unw_proc_info_t *, void *);
+extern int _UCD_get_dyn_info_list_addr (unw_addr_space_t, unw_word_t *,
+ void *);
+extern int _UCD_access_mem (unw_addr_space_t, unw_word_t, unw_word_t *, int,
+ void *);
+extern int _UCD_access_reg (unw_addr_space_t, unw_regnum_t, unw_word_t *,
+ int, void *);
+extern int _UCD_access_fpreg (unw_addr_space_t, unw_regnum_t, unw_fpreg_t *,
+ int, void *);
+extern int _UCD_get_proc_name (unw_addr_space_t, unw_word_t, char *, size_t,
+ unw_word_t *, void *);
+extern int _UCD_resume (unw_addr_space_t, unw_cursor_t *, void *);
+extern unw_accessors_t _UCD_accessors;
+
+
+#if defined(__cplusplus) || defined(c_plusplus)
+}
+#endif
+
+#endif /* libunwind_coredump_h */
--- /dev/null
+/* libunwind - a platform-independent unwind library
+ Copyright (C) 2002-2004 Hewlett-Packard Co
+ Contributed by David Mosberger-Tang <davidm@hpl.hp.com>
+
+This file is part of libunwind.
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+"Software"), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
+
+/* This file defines the runtime-support routines for dynamically
+generated code. Even though it is implemented as part of libunwind,
+it is logically separate from the interface to perform the actual
+unwinding. In particular, this interface is always used in the
+context of the unwind target, whereas the rest of the unwind API is
+used in context of the process that is doing the unwind (which may be
+a debugger running on another machine, for example).
+
+Note that the data-structures declared here server a dual purpose:
+when a program registers a dynamically generated procedure, it uses
+these structures directly. On the other hand, with remote-unwinding,
+the data-structures are read from the remote process's memory and
+translated into internalized versions. To facilitate remote-access,
+the following rules should be followed in declaring these structures:
+
+ (1) Declare a member as a pointer only if the the information the
+ member points to needs to be internalized as well (e.g., a
+ string representing a procedure name should be declared as
+ "const char *", but the instruction pointer should be declared
+ as unw_word_t).
+
+ (2) Provide sufficient padding to ensure that no implicit padding
+ will be needed on any of the supported target architectures. For
+ the time being, padding data structures with the assumption that
+ sizeof (unw_word_t) == 8 should be sufficient. (Note: it's not
+ impossible to internalize structures with internal padding, but
+ it does make the process a bit harder).
+
+ (3) Don't declare members that contain bitfields or floating-point
+ values.
+
+ (4) Don't declare members with enumeration types. Declare them as
+ int32_t instead. */
+
+typedef enum
+ {
+ UNW_DYN_STOP = 0, /* end-of-unwind-info marker */
+ UNW_DYN_SAVE_REG, /* save register to another register */
+ UNW_DYN_SPILL_FP_REL, /* frame-pointer-relative register spill */
+ UNW_DYN_SPILL_SP_REL, /* stack-pointer-relative register spill */
+ UNW_DYN_ADD, /* add constant value to a register */
+ UNW_DYN_POP_FRAMES, /* drop one or more stack frames */
+ UNW_DYN_LABEL_STATE, /* name the current state */
+ UNW_DYN_COPY_STATE, /* set the region's entry-state */
+ UNW_DYN_ALIAS /* get unwind info from an alias */
+ }
+unw_dyn_operation_t;
+
+typedef enum
+ {
+ UNW_INFO_FORMAT_DYNAMIC, /* unw_dyn_proc_info_t */
+ UNW_INFO_FORMAT_TABLE, /* unw_dyn_table_t */
+ UNW_INFO_FORMAT_REMOTE_TABLE, /* unw_dyn_remote_table_t */
+ UNW_INFO_FORMAT_ARM_EXIDX /* ARM specific unwind info */
+ }
+unw_dyn_info_format_t;
+
+typedef struct unw_dyn_op
+ {
+ int8_t tag; /* what operation? */
+ int8_t qp; /* qualifying predicate register */
+ int16_t reg; /* what register */
+ int32_t when; /* when does it take effect? */
+ unw_word_t val; /* auxiliary value */
+ }
+unw_dyn_op_t;
+
+typedef struct unw_dyn_region_info
+ {
+ struct unw_dyn_region_info *next; /* linked list of regions */
+ int32_t insn_count; /* region length (# of instructions) */
+ uint32_t op_count; /* length of op-array */
+ unw_dyn_op_t op[1]; /* variable-length op-array */
+ }
+unw_dyn_region_info_t;
+
+typedef struct unw_dyn_proc_info
+ {
+ unw_word_t name_ptr; /* address of human-readable procedure name */
+ unw_word_t handler; /* address of personality routine */
+ uint32_t flags;
+ int32_t pad0;
+ unw_dyn_region_info_t *regions;
+ }
+unw_dyn_proc_info_t;
+
+typedef struct unw_dyn_table_info
+ {
+ unw_word_t name_ptr; /* addr. of table name (e.g., library name) */
+ unw_word_t segbase; /* segment base */
+ unw_word_t table_len; /* must be a multiple of sizeof(unw_word_t)! */
+ unw_word_t *table_data;
+ }
+unw_dyn_table_info_t;
+
+typedef struct unw_dyn_remote_table_info
+ {
+ unw_word_t name_ptr; /* addr. of table name (e.g., library name) */
+ unw_word_t segbase; /* segment base */
+ unw_word_t table_len; /* must be a multiple of sizeof(unw_word_t)! */
+ unw_word_t table_data;
+ }
+unw_dyn_remote_table_info_t;
+
+typedef struct unw_dyn_info
+ {
+ /* doubly-linked list of dyn-info structures: */
+ struct unw_dyn_info *next;
+ struct unw_dyn_info *prev;
+ unw_word_t start_ip; /* first IP covered by this entry */
+ unw_word_t end_ip; /* first IP NOT covered by this entry */
+ unw_word_t gp; /* global-pointer in effect for this entry */
+ int32_t format; /* real type: unw_dyn_info_format_t */
+ int32_t pad;
+ union
+ {
+ unw_dyn_proc_info_t pi;
+ unw_dyn_table_info_t ti;
+ unw_dyn_remote_table_info_t rti;
+ }
+ u;
+ }
+unw_dyn_info_t;
+
+typedef struct unw_dyn_info_list
+ {
+ uint32_t version;
+ uint32_t generation;
+ unw_dyn_info_t *first;
+ }
+unw_dyn_info_list_t;
+
+/* Return the size (in bytes) of an unw_dyn_region_info_t structure that can
+ hold OP_COUNT ops. */
+#define _U_dyn_region_info_size(op_count) \
+ ((char *) (((unw_dyn_region_info_t *) NULL)->op + (op_count)) \
+ - (char *) NULL)
+
+/* Register the unwind info for a single procedure.
+ This routine is NOT signal-safe. */
+extern void _U_dyn_register (unw_dyn_info_t *);
+
+/* Cancel the unwind info for a single procedure.
+ This routine is NOT signal-safe. */
+extern void _U_dyn_cancel (unw_dyn_info_t *);
+
+\f
+/* Convenience routines. */
+
+#define _U_dyn_op(_tag, _qp, _when, _reg, _val) \
+ ((unw_dyn_op_t) { (_tag), (_qp), (_reg), (_when), (_val) })
+
+#define _U_dyn_op_save_reg(op, qp, when, reg, dst) \
+ (*(op) = _U_dyn_op (UNW_DYN_SAVE_REG, (qp), (when), (reg), (dst)))
+
+#define _U_dyn_op_spill_fp_rel(op, qp, when, reg, offset) \
+ (*(op) = _U_dyn_op (UNW_DYN_SPILL_FP_REL, (qp), (when), (reg), \
+ (offset)))
+
+#define _U_dyn_op_spill_sp_rel(op, qp, when, reg, offset) \
+ (*(op) = _U_dyn_op (UNW_DYN_SPILL_SP_REL, (qp), (when), (reg), \
+ (offset)))
+
+#define _U_dyn_op_add(op, qp, when, reg, value) \
+ (*(op) = _U_dyn_op (UNW_DYN_ADD, (qp), (when), (reg), (value)))
+
+#define _U_dyn_op_pop_frames(op, qp, when, num_frames) \
+ (*(op) = _U_dyn_op (UNW_DYN_POP_FRAMES, (qp), (when), 0, (num_frames)))
+
+#define _U_dyn_op_label_state(op, label) \
+ (*(op) = _U_dyn_op (UNW_DYN_LABEL_STATE, _U_QP_TRUE, -1, 0, (label)))
+
+#define _U_dyn_op_copy_state(op, label) \
+ (*(op) = _U_dyn_op (UNW_DYN_COPY_STATE, _U_QP_TRUE, -1, 0, (label)))
+
+#define _U_dyn_op_alias(op, qp, when, addr) \
+ (*(op) = _U_dyn_op (UNW_DYN_ALIAS, (qp), (when), 0, (addr)))
+
+#define _U_dyn_op_stop(op) \
+ (*(op) = _U_dyn_op (UNW_DYN_STOP, _U_QP_TRUE, -1, 0, 0))
+
+/* The target-dependent qualifying predicate which is always TRUE. On
+ IA-64, that's p0 (0), on non-predicated architectures, the value is
+ ignored. */
+#define _U_QP_TRUE _U_TDEP_QP_TRUE
--- /dev/null
+/* libunwind - a platform-independent unwind library
+ Copyright (C) 2003-2004 Hewlett-Packard Co
+
+This file is part of libunwind.
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+"Software"), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
+
+#ifndef LIBUNWIND_H
+#define LIBUNWIND_H
+
+#if defined(__cplusplus) || defined(c_plusplus)
+extern "C" {
+#endif
+
+#include <inttypes.h>
+#include <ucontext.h>
+
+#define UNW_TARGET hppa
+#define UNW_TARGET_HPPA 1
+
+#define _U_TDEP_QP_TRUE 0 /* see libunwind-dynamic.h */
+
+/* This needs to be big enough to accommodate "struct cursor", while
+ leaving some slack for future expansion. Changing this value will
+ require recompiling all users of this library. Stack allocation is
+ relatively cheap and unwind-state copying is relatively rare, so we
+ want to err on making it rather too big than too small. */
+#define UNW_TDEP_CURSOR_LEN 511
+
+typedef uint32_t unw_word_t;
+typedef int32_t unw_sword_t;
+
+typedef union
+ {
+ struct { unw_word_t bits[2]; } raw;
+ double val;
+ }
+unw_tdep_fpreg_t;
+
+typedef enum
+ {
+ /* Note: general registers are expected to start with index 0.
+ This convention facilitates architecture-independent
+ implementation of the C++ exception handling ABI. See
+ _Unwind_SetGR() and _Unwind_GetGR() for details. */
+ UNW_HPPA_GR = 0,
+ UNW_HPPA_RP = 2, /* return pointer */
+ UNW_HPPA_FP = 3, /* frame pointer */
+ UNW_HPPA_SP = UNW_HPPA_GR + 30,
+
+ UNW_HPPA_FR = UNW_HPPA_GR + 32,
+
+ UNW_HPPA_IP = UNW_HPPA_FR + 32, /* instruction pointer */
+
+ /* other "preserved" registers (fpsr etc.)... */
+
+ /* PA-RISC has 4 exception-argument registers but they're not
+ contiguous. To deal with this, we define 4 pseudo
+ exception-handling registers which we then alias to the actual
+ physical register. */
+
+ UNW_HPPA_EH0 = UNW_HPPA_IP + 1, /* alias for UNW_HPPA_GR + 20 */
+ UNW_HPPA_EH1 = UNW_HPPA_EH0 + 1, /* alias for UNW_HPPA_GR + 21 */
+ UNW_HPPA_EH2 = UNW_HPPA_EH1 + 1, /* alias for UNW_HPPA_GR + 22 */
+ UNW_HPPA_EH3 = UNW_HPPA_EH2 + 1, /* alias for UNW_HPPA_GR + 31 */
+
+ /* frame info (read-only) */
+ UNW_HPPA_CFA,
+
+ UNW_TDEP_LAST_REG = UNW_HPPA_IP,
+
+ UNW_TDEP_IP = UNW_HPPA_IP,
+ UNW_TDEP_SP = UNW_HPPA_SP,
+ UNW_TDEP_EH = UNW_HPPA_EH0
+ }
+hppa_regnum_t;
+
+#define UNW_TDEP_NUM_EH_REGS 4
+
+typedef struct unw_tdep_save_loc
+ {
+ /* Additional target-dependent info on a save location. */
+ /* ANDROID support update. */
+ char __reserved;
+ /* End of ANDROID update. */
+ }
+unw_tdep_save_loc_t;
+
+/* On PA-RISC, we can directly use ucontext_t as the unwind context. */
+typedef ucontext_t unw_tdep_context_t;
+
+#define unw_tdep_is_fpreg(r) ((unsigned) ((r) - UNW_HPPA_FR) < 32)
+
+#include "libunwind-dynamic.h"
+
+typedef struct
+ {
+ /* no PA-RISC-specific auxiliary proc-info */
+ /* ANDROID support update. */
+ char __reserved;
+ /* End of ANDROID update. */
+ }
+unw_tdep_proc_info_t;
+
+#include "libunwind-common.h"
+
+#define unw_tdep_getcontext UNW_ARCH_OBJ (getcontext)
+extern int unw_tdep_getcontext (unw_tdep_context_t *);
+
+#if defined(__cplusplus) || defined(c_plusplus)
+}
+#endif
+
+#endif /* LIBUNWIND_H */
--- /dev/null
+/* libunwind - a platform-independent unwind library
+ Copyright (C) 2001-2004 Hewlett-Packard Co
+ Contributed by David Mosberger-Tang <davidm@hpl.hp.com>
+
+This file is part of libunwind.
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+"Software"), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
+
+#ifndef LIBUNWIND_H
+#define LIBUNWIND_H
+
+#include <inttypes.h>
+#include <ucontext.h>
+
+#if defined(__cplusplus) || defined(c_plusplus)
+extern "C" {
+#endif
+
+#ifdef ia64
+ /* This works around a bug in Intel's ECC v7.0 which defines "ia64"
+ as "1". */
+# undef ia64
+#endif
+
+#ifdef __hpux
+ /* On HP-UX, there is no hope of supporting UNW_LOCAL_ONLY, because
+ it's impossible to obtain the address of the members in the
+ sigcontext structure. */
+# undef UNW_LOCAL_ONLY
+# define UNW_GENERIC_ONLY
+#endif
+
+#define UNW_TARGET ia64
+#define UNW_TARGET_IA64 1
+
+#define _U_TDEP_QP_TRUE 0 /* see libunwind-dynamic.h */
+
+/* This needs to be big enough to accommodate "struct cursor", while
+ leaving some slack for future expansion. Changing this value will
+ require recompiling all users of this library. Stack allocation is
+ relatively cheap and unwind-state copying is relatively rare, so we
+ want to err on making it rather too big than too small. */
+#define UNW_TDEP_CURSOR_LEN 511
+
+/* If this bit is it indicates that the procedure saved all of ar.bsp,
+ ar.bspstore, and ar.rnat. If, additionally, ar.bsp != saved ar.bsp,
+ then this procedure has performed a register-backing-store switch. */
+#define UNW_PI_FLAG_IA64_RBS_SWITCH_BIT (UNW_PI_FLAG_FIRST_TDEP_BIT + 0)
+
+#define UNW_PI_FLAG_IA64_RBS_SWITCH (1 << UNW_PI_FLAG_IA64_RBS_SWITCH_BIT)
+
+typedef uint64_t unw_word_t;
+typedef int64_t unw_sword_t;
+
+/* On IA-64, we want to access the contents of floating-point
+ registers as a pair of "words", but to ensure 16-byte alignment, we
+ make it a union that contains a "long double". This will do the
+ Right Thing on all known IA-64 platforms, including HP-UX. */
+typedef union
+ {
+ struct { unw_word_t bits[2]; } raw;
+ long double dummy; /* dummy to force 16-byte alignment */
+ }
+unw_tdep_fpreg_t;
+
+typedef struct
+ {
+ /* no ia64-specific auxiliary proc-info */
+ /* ANDROID support update. */
+ char __reserved;
+ /* End of ANDROID update. */
+ }
+unw_tdep_proc_info_t;
+
+typedef enum
+ {
+ /* Note: general registers are excepted to start with index 0.
+ This convention facilitates architecture-independent
+ implementation of the C++ exception handling ABI. See
+ _Unwind_SetGR() and _Unwind_GetGR() for details. */
+ UNW_IA64_GR = 0, /* general registers (r0..r127) */
+ UNW_IA64_GP = UNW_IA64_GR + 1,
+ UNW_IA64_TP = UNW_IA64_GR + 13,
+
+ UNW_IA64_NAT = UNW_IA64_GR + 128, /* NaT registers (nat0..nat127) */
+
+ UNW_IA64_FR = UNW_IA64_NAT + 128, /* fp registers (f0..f127) */
+
+ UNW_IA64_AR = UNW_IA64_FR + 128, /* application registers (ar0..r127) */
+ UNW_IA64_AR_RSC = UNW_IA64_AR + 16,
+ UNW_IA64_AR_BSP = UNW_IA64_AR + 17,
+ UNW_IA64_AR_BSPSTORE = UNW_IA64_AR + 18,
+ UNW_IA64_AR_RNAT = UNW_IA64_AR + 19,
+ UNW_IA64_AR_CSD = UNW_IA64_AR + 25,
+ UNW_IA64_AR_26 = UNW_IA64_AR + 26,
+ UNW_IA64_AR_SSD = UNW_IA64_AR_26,
+ UNW_IA64_AR_CCV = UNW_IA64_AR + 32,
+ UNW_IA64_AR_UNAT = UNW_IA64_AR + 36,
+ UNW_IA64_AR_FPSR = UNW_IA64_AR + 40,
+ UNW_IA64_AR_PFS = UNW_IA64_AR + 64,
+ UNW_IA64_AR_LC = UNW_IA64_AR + 65,
+ UNW_IA64_AR_EC = UNW_IA64_AR + 66,
+
+ UNW_IA64_BR = UNW_IA64_AR + 128, /* branch registers (b0..p7) */
+ UNW_IA64_RP = UNW_IA64_BR + 0, /* return pointer (rp) */
+ UNW_IA64_PR = UNW_IA64_BR + 8, /* predicate registers (p0..p63) */
+ UNW_IA64_CFM,
+
+ /* frame info: */
+ UNW_IA64_BSP,
+ UNW_IA64_IP,
+ UNW_IA64_SP,
+
+ UNW_TDEP_LAST_REG = UNW_IA64_SP,
+
+ UNW_TDEP_IP = UNW_IA64_IP,
+ UNW_TDEP_SP = UNW_IA64_SP,
+ UNW_TDEP_EH = UNW_IA64_GR + 15
+ }
+ia64_regnum_t;
+
+#define UNW_TDEP_NUM_EH_REGS 4 /* r15-r18 are exception args */
+
+typedef struct unw_tdep_save_loc
+ {
+ /* Additional target-dependent info on a save location. On IA-64,
+ we use this to provide the bit number in which a NaT bit gets
+ saved. */
+ uint8_t nat_bitnr;
+
+ /* Padding reserved for future use. */
+ uint8_t reserved[7];
+ }
+unw_tdep_save_loc_t;
+
+/* On IA-64, we can directly use ucontext_t as the unwind context. */
+typedef ucontext_t unw_tdep_context_t;
+
+#define unw_tdep_is_fpreg(r) ((unsigned) ((r) - UNW_IA64_FR) < 128)
+
+#include "libunwind-dynamic.h"
+#include "libunwind-common.h"
+
+#ifdef __hpux
+ /* In theory, we could use _Uia64_getcontext() on HP-UX as well, but
+ the benefit of doing so would be marginal given that it can't
+ support UNW_LOCAL_ONLY. */
+# define unw_tdep_getcontext getcontext
+#else
+# define unw_tdep_getcontext UNW_ARCH_OBJ (getcontext)
+ extern int unw_tdep_getcontext (unw_tdep_context_t *);
+#endif
+
+/* This is a helper routine to search an ia64 unwind table. If the
+ address-space argument AS points to something other than the local
+ address-space, the memory for the unwind-info will be allocated
+ with malloc(), and should be free()d during the put_unwind_info()
+ callback. This routine is signal-safe for the local-address-space
+ case ONLY. */
+#define unw_search_ia64_unwind_table UNW_OBJ(search_unwind_table)
+extern int unw_search_ia64_unwind_table (unw_addr_space_t, unw_word_t,
+ unw_dyn_info_t *, unw_proc_info_t *,
+ int, void *);
+
+/* This is a helper routine which the get_dyn_info_list_addr()
+ callback can use to locate the special dynamic-info list entry in
+ an IA-64 unwind table. If the entry exists in the table, the
+ list-address is returned. In all other cases, 0 is returned. */
+extern unw_word_t _Uia64_find_dyn_list (unw_addr_space_t, unw_dyn_info_t *,
+ void *);
+
+/* This is a helper routine to obtain the kernel-unwind info. It is
+ signal-safe. */
+extern int _Uia64_get_kernel_table (unw_dyn_info_t *);
+
+#if defined(__cplusplus) || defined(c_plusplus)
+}
+#endif
+
+#endif /* LIBUNWIND_H */
--- /dev/null
+/* libunwind - a platform-independent unwind library
+ Copyright (C) 2008 CodeSourcery
+
+This file is part of libunwind.
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+"Software"), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
+
+#ifndef LIBUNWIND_H
+#define LIBUNWIND_H
+
+#if defined(__cplusplus) || defined(c_plusplus)
+extern "C" {
+#endif
+
+#include <inttypes.h>
+#include <ucontext.h>
+
+#ifdef mips
+# undef mips
+#endif
+
+#define UNW_TARGET mips
+#define UNW_TARGET_MIPS 1
+
+#define _U_TDEP_QP_TRUE 0 /* see libunwind-dynamic.h */
+
+/* This needs to be big enough to accommodate "struct cursor", while
+ leaving some slack for future expansion. Changing this value will
+ require recompiling all users of this library. Stack allocation is
+ relatively cheap and unwind-state copying is relatively rare, so we
+ want to err on making it rather too big than too small. */
+
+/* FIXME for MIPS. Too big? What do other things use for similar tasks? */
+#define UNW_TDEP_CURSOR_LEN 4096
+
+/* The size of a "word" varies on MIPS. This type is used for memory
+ addresses and register values. To allow a single library to support
+ multiple ABIs, and to support N32 at all, we must use a 64-bit type
+ even when addresses are only 32 bits. */
+typedef uint64_t unw_word_t;
+typedef int32_t unw_sword_t;
+
+/* FIXME: MIPS ABIs. */
+typedef long double unw_tdep_fpreg_t;
+
+typedef enum
+ {
+ UNW_MIPS_R0,
+ UNW_MIPS_R1,
+ UNW_MIPS_R2,
+ UNW_MIPS_R3,
+ UNW_MIPS_R4,
+ UNW_MIPS_R5,
+ UNW_MIPS_R6,
+ UNW_MIPS_R7,
+ UNW_MIPS_R8,
+ UNW_MIPS_R9,
+ UNW_MIPS_R10,
+ UNW_MIPS_R11,
+ UNW_MIPS_R12,
+ UNW_MIPS_R13,
+ UNW_MIPS_R14,
+ UNW_MIPS_R15,
+ UNW_MIPS_R16,
+ UNW_MIPS_R17,
+ UNW_MIPS_R18,
+ UNW_MIPS_R19,
+ UNW_MIPS_R20,
+ UNW_MIPS_R21,
+ UNW_MIPS_R22,
+ UNW_MIPS_R23,
+ UNW_MIPS_R24,
+ UNW_MIPS_R25,
+ UNW_MIPS_R26,
+ UNW_MIPS_R27,
+ UNW_MIPS_R28,
+ UNW_MIPS_R29,
+ UNW_MIPS_R30,
+ UNW_MIPS_R31,
+
+ UNW_MIPS_PC = 34,
+
+ /* FIXME: Other registers! */
+
+ /* For MIPS, the CFA is the value of SP (r29) at the call site in the
+ previous frame. */
+ UNW_MIPS_CFA,
+
+ UNW_TDEP_LAST_REG = UNW_MIPS_R31,
+
+ UNW_TDEP_IP = UNW_MIPS_R31,
+ UNW_TDEP_SP = UNW_MIPS_R29,
+ UNW_TDEP_EH = UNW_MIPS_R0 /* FIXME. */
+ }
+mips_regnum_t;
+
+typedef enum
+ {
+ UNW_MIPS_ABI_O32,
+ UNW_MIPS_ABI_N32,
+ UNW_MIPS_ABI_N64
+ }
+mips_abi_t;
+
+#define UNW_TDEP_NUM_EH_REGS 2 /* FIXME for MIPS. */
+
+typedef struct unw_tdep_save_loc
+ {
+ /* Additional target-dependent info on a save location. */
+ /* ANDROID support update. */
+ char __reserved;
+ /* End of ANDROID update. */
+ }
+unw_tdep_save_loc_t;
+
+/* On x86, we can directly use ucontext_t as the unwind context. FIXME for
+ MIPS. */
+typedef ucontext_t unw_tdep_context_t;
+
+#include "libunwind-dynamic.h"
+
+typedef struct
+ {
+ /* no mips-specific auxiliary proc-info */
+ /* ANDROID support update. */
+ char __reserved;
+ /* End of ANDROID update. */
+ }
+unw_tdep_proc_info_t;
+
+#include "libunwind-common.h"
+
+/* There is no getcontext() on MIPS. Use a stub version which only saves GP
+ registers. FIXME: Not ideal, may not be sufficient for all libunwind
+ use cases. */
+#define unw_tdep_getcontext UNW_ARCH_OBJ(getcontext)
+extern int unw_tdep_getcontext (ucontext_t *uc);
+
+#define unw_tdep_is_fpreg UNW_ARCH_OBJ(is_fpreg)
+extern int unw_tdep_is_fpreg (int);
+
+#if defined(__cplusplus) || defined(c_plusplus)
+}
+#endif
+
+#endif /* LIBUNWIND_H */
--- /dev/null
+/* libunwind - a platform-independent unwind library
+ Copyright (C) 2006-2007 IBM
+ Contributed by
+ Corey Ashford <cjashfor@us.ibm.com>
+ Jose Flavio Aguilar Paulino <jflavio@br.ibm.com> <joseflavio@gmail.com>
+
+ Copied from libunwind-x86_64.h, modified slightly for building
+ frysk successfully on ppc64, by Wu Zhou <woodzltc@cn.ibm.com>
+ Will be replaced when libunwind is ready on ppc64 platform.
+
+This file is part of libunwind.
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+"Software"), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
+
+#ifndef LIBUNWIND_H
+#define LIBUNWIND_H
+
+#if defined(__cplusplus) || defined(c_plusplus)
+extern "C" {
+#endif
+
+#include <inttypes.h>
+#include <ucontext.h>
+
+#define UNW_TARGET ppc32
+#define UNW_TARGET_PPC32 1
+
+#define _U_TDEP_QP_TRUE 0 /* see libunwind-dynamic.h */
+
+/*
+ * This needs to be big enough to accommodate "struct cursor", while
+ * leaving some slack for future expansion. Changing this value will
+ * require recompiling all users of this library. Stack allocation is
+ * relatively cheap and unwind-state copying is relatively rare, so we want
+ * to err on making it rather too big than too small.
+ *
+ * To simplify this whole process, we are at least initially taking the
+ * tack that UNW_PPC32_* map straight across to the .eh_frame column register
+ * numbers. These register numbers come from gcc's source in
+ * gcc/config/rs6000/rs6000.h
+ *
+ * UNW_TDEP_CURSOR_LEN is in terms of unw_word_t size. Since we have 115
+ * elements in the loc array, each sized 2 * unw_word_t, plus the rest of
+ * the cursor struct, this puts us at about 2 * 115 + 40 = 270. Let's
+ * round that up to 280.
+ */
+
+#define UNW_TDEP_CURSOR_LEN 280
+
+#if __WORDSIZE==32
+typedef uint32_t unw_word_t;
+typedef int32_t unw_sword_t;
+#else
+typedef uint64_t unw_word_t;
+typedef int64_t unw_sword_t;
+#endif
+
+typedef long double unw_tdep_fpreg_t;
+
+typedef enum
+ {
+ UNW_PPC32_R0,
+ UNW_PPC32_R1, /* called STACK_POINTER in gcc */
+ UNW_PPC32_R2,
+ UNW_PPC32_R3,
+ UNW_PPC32_R4,
+ UNW_PPC32_R5,
+ UNW_PPC32_R6,
+ UNW_PPC32_R7,
+ UNW_PPC32_R8,
+ UNW_PPC32_R9,
+ UNW_PPC32_R10,
+ UNW_PPC32_R11, /* called STATIC_CHAIN in gcc */
+ UNW_PPC32_R12,
+ UNW_PPC32_R13,
+ UNW_PPC32_R14,
+ UNW_PPC32_R15,
+ UNW_PPC32_R16,
+ UNW_PPC32_R17,
+ UNW_PPC32_R18,
+ UNW_PPC32_R19,
+ UNW_PPC32_R20,
+ UNW_PPC32_R21,
+ UNW_PPC32_R22,
+ UNW_PPC32_R23,
+ UNW_PPC32_R24,
+ UNW_PPC32_R25,
+ UNW_PPC32_R26,
+ UNW_PPC32_R27,
+ UNW_PPC32_R28,
+ UNW_PPC32_R29,
+ UNW_PPC32_R30,
+ UNW_PPC32_R31, /* called HARD_FRAME_POINTER in gcc */
+
+ /* Count Register */
+ UNW_PPC32_CTR = 32,
+ /* Fixed-Point Status and Control Register */
+ UNW_PPC32_XER = 33,
+ /* Condition Register */
+ UNW_PPC32_CCR = 34,
+ /* Machine State Register */
+ //UNW_PPC32_MSR = 35,
+ /* MQ or SPR0, not part of generic Power, part of MPC601 */
+ //UNW_PPC32_MQ = 36,
+ /* Link Register */
+ UNW_PPC32_LR = 36,
+ /* Floating Pointer Status and Control Register */
+ UNW_PPC32_FPSCR = 37,
+
+ UNW_PPC32_F0 = 48,
+ UNW_PPC32_F1,
+ UNW_PPC32_F2,
+ UNW_PPC32_F3,
+ UNW_PPC32_F4,
+ UNW_PPC32_F5,
+ UNW_PPC32_F6,
+ UNW_PPC32_F7,
+ UNW_PPC32_F8,
+ UNW_PPC32_F9,
+ UNW_PPC32_F10,
+ UNW_PPC32_F11,
+ UNW_PPC32_F12,
+ UNW_PPC32_F13,
+ UNW_PPC32_F14,
+ UNW_PPC32_F15,
+ UNW_PPC32_F16,
+ UNW_PPC32_F17,
+ UNW_PPC32_F18,
+ UNW_PPC32_F19,
+ UNW_PPC32_F20,
+ UNW_PPC32_F21,
+ UNW_PPC32_F22,
+ UNW_PPC32_F23,
+ UNW_PPC32_F24,
+ UNW_PPC32_F25,
+ UNW_PPC32_F26,
+ UNW_PPC32_F27,
+ UNW_PPC32_F28,
+ UNW_PPC32_F29,
+ UNW_PPC32_F30,
+ UNW_PPC32_F31,
+
+ UNW_TDEP_LAST_REG = UNW_PPC32_F31,
+
+ UNW_TDEP_IP = UNW_PPC32_LR,
+ UNW_TDEP_SP = UNW_PPC32_R1,
+ UNW_TDEP_EH = UNW_PPC32_R12
+ }
+ppc32_regnum_t;
+
+/*
+ * According to David Edelsohn, GNU gcc uses R3, R4, R5, and maybe R6 for
+ * passing parameters to exception handlers.
+ */
+
+#define UNW_TDEP_NUM_EH_REGS 4
+
+typedef struct unw_tdep_save_loc
+ {
+ /* Additional target-dependent info on a save location. */
+ /* ANDROID support update. */
+ char __reserved;
+ /* End of ANDROID update. */
+ }
+unw_tdep_save_loc_t;
+
+/* On ppc, we can directly use ucontext_t as the unwind context. */
+typedef ucontext_t unw_tdep_context_t;
+
+/* XXX this is not ideal: an application should not be prevented from
+ using the "getcontext" name just because it's using libunwind. We
+ can't just use __getcontext() either, because that isn't exported
+ by glibc... */
+#define unw_tdep_getcontext(uc) (getcontext (uc), 0)
+
+#include "libunwind-dynamic.h"
+
+typedef struct
+ {
+ /* no ppc32-specific auxiliary proc-info */
+ /* ANDROID support update. */
+ char __reserved;
+ /* End of ANDROID update. */
+ }
+unw_tdep_proc_info_t;
+
+#include "libunwind-common.h"
+
+#define unw_tdep_is_fpreg UNW_ARCH_OBJ(is_fpreg)
+extern int unw_tdep_is_fpreg (int);
+
+#if defined(__cplusplus) || defined(c_plusplus)
+}
+#endif
+
+#endif /* LIBUNWIND_H */
--- /dev/null
+/* libunwind - a platform-independent unwind library
+ Copyright (C) 2006-2007 IBM
+ Contributed by
+ Corey Ashford <cjashfor@us.ibm.com>
+ Jose Flavio Aguilar Paulino <jflavio@br.ibm.com> <joseflavio@gmail.com>
+
+ Copied from libunwind-x86_64.h, modified slightly for building
+ frysk successfully on ppc64, by Wu Zhou <woodzltc@cn.ibm.com>
+ Will be replaced when libunwind is ready on ppc64 platform.
+
+This file is part of libunwind.
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+"Software"), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
+
+#ifndef LIBUNWIND_H
+#define LIBUNWIND_H
+
+#if defined(__cplusplus) || defined(c_plusplus)
+extern "C" {
+#endif
+
+#include <inttypes.h>
+#include <ucontext.h>
+
+#define UNW_TARGET ppc64
+#define UNW_TARGET_PPC64 1
+
+#define _U_TDEP_QP_TRUE 0 /* see libunwind-dynamic.h */
+
+/*
+ * This needs to be big enough to accommodate "struct cursor", while
+ * leaving some slack for future expansion. Changing this value will
+ * require recompiling all users of this library. Stack allocation is
+ * relatively cheap and unwind-state copying is relatively rare, so we want
+ * to err on making it rather too big than too small.
+ *
+ * To simplify this whole process, we are at least initially taking the
+ * tack that UNW_PPC64_* map straight across to the .eh_frame column register
+ * numbers. These register numbers come from gcc's source in
+ * gcc/config/rs6000/rs6000.h
+ *
+ * UNW_TDEP_CURSOR_LEN is in terms of unw_word_t size. Since we have 115
+ * elements in the loc array, each sized 2 * unw_word_t, plus the rest of
+ * the cursor struct, this puts us at about 2 * 115 + 40 = 270. Let's
+ * round that up to 280.
+ */
+
+#define UNW_TDEP_CURSOR_LEN 280
+
+#if __WORDSIZE==32
+typedef uint32_t unw_word_t;
+typedef int32_t unw_sword_t;
+#else
+typedef uint64_t unw_word_t;
+typedef int64_t unw_sword_t;
+#endif
+
+typedef long double unw_tdep_fpreg_t;
+
+/*
+ * Vector register (in PowerPC64 used for AltiVec registers)
+ */
+typedef struct {
+ uint64_t halves[2];
+} unw_tdep_vreg_t;
+
+typedef enum
+ {
+ UNW_PPC64_R0,
+ UNW_PPC64_R1, /* called STACK_POINTER in gcc */
+ UNW_PPC64_R2,
+ UNW_PPC64_R3,
+ UNW_PPC64_R4,
+ UNW_PPC64_R5,
+ UNW_PPC64_R6,
+ UNW_PPC64_R7,
+ UNW_PPC64_R8,
+ UNW_PPC64_R9,
+ UNW_PPC64_R10,
+ UNW_PPC64_R11, /* called STATIC_CHAIN in gcc */
+ UNW_PPC64_R12,
+ UNW_PPC64_R13,
+ UNW_PPC64_R14,
+ UNW_PPC64_R15,
+ UNW_PPC64_R16,
+ UNW_PPC64_R17,
+ UNW_PPC64_R18,
+ UNW_PPC64_R19,
+ UNW_PPC64_R20,
+ UNW_PPC64_R21,
+ UNW_PPC64_R22,
+ UNW_PPC64_R23,
+ UNW_PPC64_R24,
+ UNW_PPC64_R25,
+ UNW_PPC64_R26,
+ UNW_PPC64_R27,
+ UNW_PPC64_R28,
+ UNW_PPC64_R29,
+ UNW_PPC64_R30,
+ UNW_PPC64_R31, /* called HARD_FRAME_POINTER in gcc */
+
+ UNW_PPC64_F0 = 32,
+ UNW_PPC64_F1,
+ UNW_PPC64_F2,
+ UNW_PPC64_F3,
+ UNW_PPC64_F4,
+ UNW_PPC64_F5,
+ UNW_PPC64_F6,
+ UNW_PPC64_F7,
+ UNW_PPC64_F8,
+ UNW_PPC64_F9,
+ UNW_PPC64_F10,
+ UNW_PPC64_F11,
+ UNW_PPC64_F12,
+ UNW_PPC64_F13,
+ UNW_PPC64_F14,
+ UNW_PPC64_F15,
+ UNW_PPC64_F16,
+ UNW_PPC64_F17,
+ UNW_PPC64_F18,
+ UNW_PPC64_F19,
+ UNW_PPC64_F20,
+ UNW_PPC64_F21,
+ UNW_PPC64_F22,
+ UNW_PPC64_F23,
+ UNW_PPC64_F24,
+ UNW_PPC64_F25,
+ UNW_PPC64_F26,
+ UNW_PPC64_F27,
+ UNW_PPC64_F28,
+ UNW_PPC64_F29,
+ UNW_PPC64_F30,
+ UNW_PPC64_F31,
+ /* Note that there doesn't appear to be an .eh_frame register column
+ for the FPSCR register. I don't know why this is. Since .eh_frame
+ info is what this implementation uses for unwinding, we have no way
+ to unwind this register, and so we will not expose an FPSCR register
+ number in the libunwind API.
+ */
+
+ UNW_PPC64_LR = 65,
+ UNW_PPC64_CTR = 66,
+ UNW_PPC64_ARG_POINTER = 67,
+
+ UNW_PPC64_CR0 = 68,
+ UNW_PPC64_CR1,
+ UNW_PPC64_CR2,
+ UNW_PPC64_CR3,
+ UNW_PPC64_CR4,
+ /* CR5 .. CR7 are currently unused */
+ UNW_PPC64_CR5,
+ UNW_PPC64_CR6,
+ UNW_PPC64_CR7,
+
+ UNW_PPC64_XER = 76,
+
+ UNW_PPC64_V0 = 77,
+ UNW_PPC64_V1,
+ UNW_PPC64_V2,
+ UNW_PPC64_V3,
+ UNW_PPC64_V4,
+ UNW_PPC64_V5,
+ UNW_PPC64_V6,
+ UNW_PPC64_V7,
+ UNW_PPC64_V8,
+ UNW_PPC64_V9,
+ UNW_PPC64_V10,
+ UNW_PPC64_V11,
+ UNW_PPC64_V12,
+ UNW_PPC64_V13,
+ UNW_PPC64_V14,
+ UNW_PPC64_V15,
+ UNW_PPC64_V16,
+ UNW_PPC64_V17,
+ UNW_PPC64_V18,
+ UNW_PPC64_V19,
+ UNW_PPC64_V20,
+ UNW_PPC64_V21,
+ UNW_PPC64_V22,
+ UNW_PPC64_V23,
+ UNW_PPC64_V24,
+ UNW_PPC64_V25,
+ UNW_PPC64_V26,
+ UNW_PPC64_V27,
+ UNW_PPC64_V28,
+ UNW_PPC64_V29,
+ UNW_PPC64_V30,
+ UNW_PPC64_V31,
+
+ UNW_PPC64_VRSAVE = 109,
+ UNW_PPC64_VSCR = 110,
+ UNW_PPC64_SPE_ACC = 111,
+ UNW_PPC64_SPEFSCR = 112,
+
+ /* frame info (read-only) */
+ UNW_PPC64_FRAME_POINTER,
+ UNW_PPC64_NIP,
+
+
+ UNW_TDEP_LAST_REG = UNW_PPC64_NIP,
+
+ UNW_TDEP_IP = UNW_PPC64_NIP,
+ UNW_TDEP_SP = UNW_PPC64_R1,
+ UNW_TDEP_EH = UNW_PPC64_R12
+ }
+ppc64_regnum_t;
+
+/*
+ * According to David Edelsohn, GNU gcc uses R3, R4, R5, and maybe R6 for
+ * passing parameters to exception handlers.
+ */
+
+#define UNW_TDEP_NUM_EH_REGS 4
+
+typedef struct unw_tdep_save_loc
+ {
+ /* Additional target-dependent info on a save location. */
+ /* ANDROID support update. */
+ char __reserved;
+ /* End of ANDROID update. */
+ }
+unw_tdep_save_loc_t;
+
+/* On ppc64, we can directly use ucontext_t as the unwind context. */
+typedef ucontext_t unw_tdep_context_t;
+
+/* XXX this is not ideal: an application should not be prevented from
+ using the "getcontext" name just because it's using libunwind. We
+ can't just use __getcontext() either, because that isn't exported
+ by glibc... */
+#define unw_tdep_getcontext(uc) (getcontext (uc), 0)
+
+#include "libunwind-dynamic.h"
+
+typedef struct
+ {
+ /* no ppc64-specific auxiliary proc-info */
+ /* ANDROID support update. */
+ char __reserved;
+ /* End of ANDROID update. */
+ }
+unw_tdep_proc_info_t;
+
+#include "libunwind-common.h"
+
+#define unw_tdep_is_fpreg UNW_ARCH_OBJ(is_fpreg)
+extern int unw_tdep_is_fpreg (int);
+
+#if defined(__cplusplus) || defined(c_plusplus)
+}
+#endif
+
+#endif /* LIBUNWIND_H */
--- /dev/null
+/* libunwind - a platform-independent unwind library
+ Copyright (C) 2004 Hewlett-Packard Co
+ Contributed by David Mosberger-Tang <davidm@hpl.hp.com>
+
+This file is part of libunwind.
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+"Software"), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
+
+#ifndef libunwind_ptrace_h
+#define libunwind_ptrace_h
+
+#include <libunwind.h>
+
+#if defined(__cplusplus) || defined(c_plusplus)
+extern "C" {
+#endif
+
+/* Helper routines which make it easy to use libunwind via ptrace().
+ They're available only if UNW_REMOTE_ONLY is _not_ defined and they
+ aren't really part of the libunwind API. They are implemented in a
+ archive library called libunwind-ptrace.a. */
+
+extern void *_UPT_create (pid_t);
+extern void _UPT_destroy (void *);
+extern int _UPT_find_proc_info (unw_addr_space_t, unw_word_t,
+ unw_proc_info_t *, int, void *);
+extern void _UPT_put_unwind_info (unw_addr_space_t, unw_proc_info_t *, void *);
+extern int _UPT_get_dyn_info_list_addr (unw_addr_space_t, unw_word_t *,
+ void *);
+extern int _UPT_access_mem (unw_addr_space_t, unw_word_t, unw_word_t *, int,
+ void *);
+extern int _UPT_access_reg (unw_addr_space_t, unw_regnum_t, unw_word_t *,
+ int, void *);
+extern int _UPT_access_fpreg (unw_addr_space_t, unw_regnum_t, unw_fpreg_t *,
+ int, void *);
+extern int _UPT_get_proc_name (unw_addr_space_t, unw_word_t, char *, size_t,
+ unw_word_t *, void *);
+extern int _UPT_resume (unw_addr_space_t, unw_cursor_t *, void *);
+extern unw_accessors_t _UPT_accessors;
+
+
+#if defined(__cplusplus) || defined(c_plusplus)
+}
+#endif
+
+#endif /* libunwind_ptrace_h */
--- /dev/null
+/* libunwind - a platform-independent unwind library
+ Copyright (C) 2008 CodeSourcery
+ Copyright (C) 2012 Tommi Rantala <tt.rantala@gmail.com>
+
+This file is part of libunwind.
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+"Software"), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
+
+#ifndef LIBUNWIND_H
+#define LIBUNWIND_H
+
+#if defined(__cplusplus) || defined(c_plusplus)
+extern "C" {
+#endif
+
+#include <inttypes.h>
+#include <stddef.h>
+#include <ucontext.h>
+
+#define UNW_TARGET sh
+#define UNW_TARGET_SH 1
+
+#define _U_TDEP_QP_TRUE 0 /* see libunwind-dynamic.h */
+
+/* This needs to be big enough to accommodate "struct cursor", while
+ leaving some slack for future expansion. Changing this value will
+ require recompiling all users of this library. Stack allocation is
+ relatively cheap and unwind-state copying is relatively rare, so we
+ want to err on making it rather too big than too small. */
+
+#define UNW_TDEP_CURSOR_LEN 4096
+
+typedef uint32_t unw_word_t;
+typedef int32_t unw_sword_t;
+
+typedef long double unw_tdep_fpreg_t;
+
+typedef enum
+ {
+ UNW_SH_R0,
+ UNW_SH_R1,
+ UNW_SH_R2,
+ UNW_SH_R3,
+ UNW_SH_R4,
+ UNW_SH_R5,
+ UNW_SH_R6,
+ UNW_SH_R7,
+ UNW_SH_R8,
+ UNW_SH_R9,
+ UNW_SH_R10,
+ UNW_SH_R11,
+ UNW_SH_R12,
+ UNW_SH_R13,
+ UNW_SH_R14,
+ UNW_SH_R15,
+
+ UNW_SH_PC,
+ UNW_SH_PR,
+
+ UNW_TDEP_LAST_REG = UNW_SH_PR,
+
+ UNW_TDEP_IP = UNW_SH_PR,
+ UNW_TDEP_SP = UNW_SH_R15,
+ UNW_TDEP_EH = UNW_SH_R0
+ }
+sh_regnum_t;
+
+#define UNW_TDEP_NUM_EH_REGS 2
+
+typedef ucontext_t unw_tdep_context_t;
+
+#define unw_tdep_getcontext(uc) (getcontext (uc), 0)
+
+typedef struct unw_tdep_save_loc
+ {
+ /* Additional target-dependent info on a save location. */
+ /* ANDROID support update. */
+ char __reserved;
+ /* End of ANDROID update. */
+ }
+unw_tdep_save_loc_t;
+
+#include "libunwind-dynamic.h"
+
+typedef struct
+ {
+ /* no sh-specific auxiliary proc-info */
+ /* ANDROID support update. */
+ char __reserved;
+ /* End of ANDROID update. */
+ }
+unw_tdep_proc_info_t;
+
+#include "libunwind-common.h"
+
+#define unw_tdep_is_fpreg UNW_ARCH_OBJ(is_fpreg)
+extern int unw_tdep_is_fpreg (int);
+
+#if defined(__cplusplus) || defined(c_plusplus)
+}
+#endif
+
+#endif /* LIBUNWIND_H */
--- /dev/null
+/* libunwind - a platform-independent unwind library
+ Copyright (C) 2002-2004 Hewlett-Packard Co
+ Contributed by David Mosberger-Tang <davidm@hpl.hp.com>
+
+This file is part of libunwind.
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+"Software"), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
+
+#ifndef LIBUNWIND_H
+#define LIBUNWIND_H
+
+#if defined(__cplusplus) || defined(c_plusplus)
+extern "C" {
+#endif
+
+#include <sys/types.h>
+#include <inttypes.h>
+#include <ucontext.h>
+
+#define UNW_TARGET x86
+#define UNW_TARGET_X86 1
+
+#define _U_TDEP_QP_TRUE 0 /* see libunwind-dynamic.h */
+
+/* This needs to be big enough to accommodate "struct cursor", while
+ leaving some slack for future expansion. Changing this value will
+ require recompiling all users of this library. Stack allocation is
+ relatively cheap and unwind-state copying is relatively rare, so we
+ want to err on making it rather too big than too small. */
+#define UNW_TDEP_CURSOR_LEN 127
+
+typedef uint32_t unw_word_t;
+typedef int32_t unw_sword_t;
+
+typedef union {
+ struct { uint8_t b[4]; } val32;
+ struct { uint8_t b[10]; } val80;
+ struct { uint8_t b[16]; } val128;
+} unw_tdep_fpreg_t;
+
+typedef enum
+ {
+ /* Note: general registers are expected to start with index 0.
+ This convention facilitates architecture-independent
+ implementation of the C++ exception handling ABI. See
+ _Unwind_SetGR() and _Unwind_GetGR() for details.
+
+ The described register usage convention is based on "System V
+ Application Binary Interface, Intel386 Architecture Processor
+ Supplement, Fourth Edition" at
+
+ http://www.linuxbase.org/spec/refspecs/elf/abi386-4.pdf
+
+ It would have been nice to use the same register numbering as
+ DWARF, but that doesn't work because the libunwind requires
+ that the exception argument registers be consecutive, which the
+ wouldn't be with the DWARF numbering. */
+ UNW_X86_EAX, /* scratch (exception argument 1) */
+ UNW_X86_EDX, /* scratch (exception argument 2) */
+ UNW_X86_ECX, /* scratch */
+ UNW_X86_EBX, /* preserved */
+ UNW_X86_ESI, /* preserved */
+ UNW_X86_EDI, /* preserved */
+ UNW_X86_EBP, /* (optional) frame-register */
+ UNW_X86_ESP, /* (optional) frame-register */
+ UNW_X86_EIP, /* frame-register */
+ UNW_X86_EFLAGS, /* scratch (except for "direction", which is fixed */
+ UNW_X86_TRAPNO, /* scratch */
+
+ /* MMX/stacked-fp registers */
+ UNW_X86_ST0, /* fp return value */
+ UNW_X86_ST1, /* scratch */
+ UNW_X86_ST2, /* scratch */
+ UNW_X86_ST3, /* scratch */
+ UNW_X86_ST4, /* scratch */
+ UNW_X86_ST5, /* scratch */
+ UNW_X86_ST6, /* scratch */
+ UNW_X86_ST7, /* scratch */
+
+ UNW_X86_FCW, /* scratch */
+ UNW_X86_FSW, /* scratch */
+ UNW_X86_FTW, /* scratch */
+ UNW_X86_FOP, /* scratch */
+ UNW_X86_FCS, /* scratch */
+ UNW_X86_FIP, /* scratch */
+ UNW_X86_FEA, /* scratch */
+ UNW_X86_FDS, /* scratch */
+
+ /* SSE registers */
+ UNW_X86_XMM0_lo, /* scratch */
+ UNW_X86_XMM0_hi, /* scratch */
+ UNW_X86_XMM1_lo, /* scratch */
+ UNW_X86_XMM1_hi, /* scratch */
+ UNW_X86_XMM2_lo, /* scratch */
+ UNW_X86_XMM2_hi, /* scratch */
+ UNW_X86_XMM3_lo, /* scratch */
+ UNW_X86_XMM3_hi, /* scratch */
+ UNW_X86_XMM4_lo, /* scratch */
+ UNW_X86_XMM4_hi, /* scratch */
+ UNW_X86_XMM5_lo, /* scratch */
+ UNW_X86_XMM5_hi, /* scratch */
+ UNW_X86_XMM6_lo, /* scratch */
+ UNW_X86_XMM6_hi, /* scratch */
+ UNW_X86_XMM7_lo, /* scratch */
+ UNW_X86_XMM7_hi, /* scratch */
+
+ UNW_X86_MXCSR, /* scratch */
+
+ /* segment registers */
+ UNW_X86_GS, /* special */
+ UNW_X86_FS, /* special */
+ UNW_X86_ES, /* special */
+ UNW_X86_DS, /* special */
+ UNW_X86_SS, /* special */
+ UNW_X86_CS, /* special */
+ UNW_X86_TSS, /* special */
+ UNW_X86_LDT, /* special */
+
+ /* frame info (read-only) */
+ UNW_X86_CFA,
+
+ UNW_X86_XMM0, /* scratch */
+ UNW_X86_XMM1, /* scratch */
+ UNW_X86_XMM2, /* scratch */
+ UNW_X86_XMM3, /* scratch */
+ UNW_X86_XMM4, /* scratch */
+ UNW_X86_XMM5, /* scratch */
+ UNW_X86_XMM6, /* scratch */
+ UNW_X86_XMM7, /* scratch */
+
+ UNW_TDEP_LAST_REG = UNW_X86_XMM7,
+
+ UNW_TDEP_IP = UNW_X86_EIP,
+ UNW_TDEP_SP = UNW_X86_ESP,
+ UNW_TDEP_EH = UNW_X86_EAX
+ }
+x86_regnum_t;
+
+#define UNW_TDEP_NUM_EH_REGS 2 /* eax and edx are exception args */
+
+typedef struct unw_tdep_save_loc
+ {
+ /* Additional target-dependent info on a save location. */
+ /* ANDROID support update. */
+ char __reserved;
+ /* End of ANDROID update. */
+ }
+unw_tdep_save_loc_t;
+
+/* On x86, we can directly use ucontext_t as the unwind context. */
+typedef ucontext_t unw_tdep_context_t;
+
+#include "libunwind-dynamic.h"
+
+typedef struct
+ {
+ /* no x86-specific auxiliary proc-info */
+ /* ANDROID support update. */
+ char __reserved;
+ /* End of ANDROID update. */
+ }
+unw_tdep_proc_info_t;
+
+#include "libunwind-common.h"
+
+#define unw_tdep_getcontext UNW_ARCH_OBJ(getcontext)
+extern int unw_tdep_getcontext (unw_tdep_context_t *);
+
+#define unw_tdep_is_fpreg UNW_ARCH_OBJ(is_fpreg)
+extern int unw_tdep_is_fpreg (int);
+
+#if defined(__cplusplus) || defined(c_plusplus)
+}
+#endif
+
+#endif /* LIBUNWIND_H */
--- /dev/null
+/* libunwind - a platform-independent unwind library
+ Copyright (C) 2002-2004 Hewlett-Packard Co
+ Contributed by David Mosberger-Tang <davidm@hpl.hp.com>
+
+ Modified for x86_64 by Max Asbock <masbock@us.ibm.com>
+
+This file is part of libunwind.
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+"Software"), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
+
+#ifndef LIBUNWIND_H
+#define LIBUNWIND_H
+
+#if defined(__cplusplus) || defined(c_plusplus)
+extern "C" {
+#endif
+
+#include <sys/types.h>
+#include <inttypes.h>
+#include <ucontext.h>
+
+#define UNW_TARGET x86_64
+#define UNW_TARGET_X86_64 1
+
+#define _U_TDEP_QP_TRUE 0 /* see libunwind-dynamic.h */
+
+/* This needs to be big enough to accommodate "struct cursor", while
+ leaving some slack for future expansion. Changing this value will
+ require recompiling all users of this library. Stack allocation is
+ relatively cheap and unwind-state copying is relatively rare, so we
+ want to err on making it rather too big than too small. */
+#define UNW_TDEP_CURSOR_LEN 127
+
+typedef uint64_t unw_word_t;
+typedef int64_t unw_sword_t;
+
+typedef long double unw_tdep_fpreg_t;
+
+typedef enum
+ {
+ UNW_X86_64_RAX,
+ UNW_X86_64_RDX,
+ UNW_X86_64_RCX,
+ UNW_X86_64_RBX,
+ UNW_X86_64_RSI,
+ UNW_X86_64_RDI,
+ UNW_X86_64_RBP,
+ UNW_X86_64_RSP,
+ UNW_X86_64_R8,
+ UNW_X86_64_R9,
+ UNW_X86_64_R10,
+ UNW_X86_64_R11,
+ UNW_X86_64_R12,
+ UNW_X86_64_R13,
+ UNW_X86_64_R14,
+ UNW_X86_64_R15,
+ UNW_X86_64_RIP,
+#ifdef CONFIG_MSABI_SUPPORT
+ UNW_X86_64_XMM0,
+ UNW_X86_64_XMM1,
+ UNW_X86_64_XMM2,
+ UNW_X86_64_XMM3,
+ UNW_X86_64_XMM4,
+ UNW_X86_64_XMM5,
+ UNW_X86_64_XMM6,
+ UNW_X86_64_XMM7,
+ UNW_X86_64_XMM8,
+ UNW_X86_64_XMM9,
+ UNW_X86_64_XMM10,
+ UNW_X86_64_XMM11,
+ UNW_X86_64_XMM12,
+ UNW_X86_64_XMM13,
+ UNW_X86_64_XMM14,
+ UNW_X86_64_XMM15,
+ UNW_TDEP_LAST_REG = UNW_X86_64_XMM15,
+#else
+ UNW_TDEP_LAST_REG = UNW_X86_64_RIP,
+#endif
+
+ /* XXX Add other regs here */
+
+ /* frame info (read-only) */
+ UNW_X86_64_CFA,
+
+ UNW_TDEP_IP = UNW_X86_64_RIP,
+ UNW_TDEP_SP = UNW_X86_64_RSP,
+ UNW_TDEP_BP = UNW_X86_64_RBP,
+ UNW_TDEP_EH = UNW_X86_64_RAX
+ }
+x86_64_regnum_t;
+
+#define UNW_TDEP_NUM_EH_REGS 2 /* XXX Not sure what this means */
+
+typedef struct unw_tdep_save_loc
+ {
+ /* Additional target-dependent info on a save location. */
+ /* ANDROID support update. */
+ char __reserved;
+ /* End of ANDROID update. */
+ }
+unw_tdep_save_loc_t;
+
+/* On x86_64, we can directly use ucontext_t as the unwind context. */
+typedef ucontext_t unw_tdep_context_t;
+
+typedef struct
+ {
+ /* no x86-64-specific auxiliary proc-info */
+ /* ANDROID support update. */
+ char __reserved;
+ /* End of ANDROID update. */
+ }
+unw_tdep_proc_info_t;
+
+#include "libunwind-dynamic.h"
+#include "libunwind-common.h"
+
+#define unw_tdep_getcontext UNW_ARCH_OBJ(getcontext)
+#define unw_tdep_is_fpreg UNW_ARCH_OBJ(is_fpreg)
+
+extern int unw_tdep_getcontext (unw_tdep_context_t *);
+extern int unw_tdep_is_fpreg (int);
+
+#if defined(__cplusplus) || defined(c_plusplus)
+}
+#endif
+
+#endif /* LIBUNWIND_H */
--- /dev/null
+/* Provide a real file - not a symlink - as it would cause multiarch conflicts
+ when multiple different arch releases are installed simultaneously. */
+
+#ifndef UNW_REMOTE_ONLY
+
+#if defined __aarch64__
+#include "libunwind-aarch64.h"
+#elif defined __arm__
+# include "libunwind-arm.h"
+#elif defined __hppa__
+# include "libunwind-hppa.h"
+#elif defined __ia64__
+# include "libunwind-ia64.h"
+#elif defined __mips__
+# include "libunwind-mips.h"
+#elif defined __powerpc__ && !defined __powerpc64__
+# include "libunwind-ppc32.h"
+#elif defined __powerpc64__
+# include "libunwind-ppc64.h"
+#elif defined __sh__
+# include "libunwind-sh.h"
+#elif defined __i386__
+# include "libunwind-x86.h"
+#elif defined __x86_64__
+# include "libunwind-x86_64.h"
+#else
+# error "Unsupported arch"
+#endif
+
+#else /* UNW_REMOTE_ONLY */
+
+# include "libunwind-arm.h"
+
+#endif /* UNW_REMOTE_ONLY */
--- /dev/null
+/* libunwind - a platform-independent unwind library
+ Copyright (C) 2003 Hewlett-Packard Co
+ Contributed by David Mosberger-Tang <davidm@hpl.hp.com>
+
+This file is part of libunwind.
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+"Software"), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
+
+#ifndef _UNWIND_H
+#define _UNWIND_H
+
+/* For uint64_t */
+#include <stdint.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* Minimal interface as per C++ ABI draft standard:
+
+ http://www.codesourcery.com/cxx-abi/abi-eh.html */
+
+typedef enum
+ {
+ _URC_NO_REASON = 0,
+ _URC_FOREIGN_EXCEPTION_CAUGHT = 1,
+ _URC_FATAL_PHASE2_ERROR = 2,
+ _URC_FATAL_PHASE1_ERROR = 3,
+ _URC_NORMAL_STOP = 4,
+ _URC_END_OF_STACK = 5,
+ _URC_HANDLER_FOUND = 6,
+ _URC_INSTALL_CONTEXT = 7,
+ _URC_CONTINUE_UNWIND = 8
+ }
+_Unwind_Reason_Code;
+
+typedef int _Unwind_Action;
+
+#define _UA_SEARCH_PHASE 1
+#define _UA_CLEANUP_PHASE 2
+#define _UA_HANDLER_FRAME 4
+#define _UA_FORCE_UNWIND 8
+
+struct _Unwind_Context; /* opaque data-structure */
+struct _Unwind_Exception; /* forward-declaration */
+
+typedef void (*_Unwind_Exception_Cleanup_Fn) (_Unwind_Reason_Code,
+ struct _Unwind_Exception *);
+
+typedef _Unwind_Reason_Code (*_Unwind_Stop_Fn) (int, _Unwind_Action,
+ uint64_t,
+ struct _Unwind_Exception *,
+ struct _Unwind_Context *,
+ void *);
+
+/* The C++ ABI requires exception_class, private_1, and private_2 to
+ be of type uint64 and the entire structure to be
+ double-word-aligned. Please note that exception_class stays 64-bit
+ even on 32-bit machines for gcc compatibility. */
+struct _Unwind_Exception
+ {
+ uint64_t exception_class;
+ _Unwind_Exception_Cleanup_Fn exception_cleanup;
+ unsigned long private_1;
+ unsigned long private_2;
+ } __attribute__((__aligned__));
+
+extern _Unwind_Reason_Code _Unwind_RaiseException (struct _Unwind_Exception *);
+extern _Unwind_Reason_Code _Unwind_ForcedUnwind (struct _Unwind_Exception *,
+ _Unwind_Stop_Fn, void *);
+extern void _Unwind_Resume (struct _Unwind_Exception *);
+extern void _Unwind_DeleteException (struct _Unwind_Exception *);
+extern unsigned long _Unwind_GetGR (struct _Unwind_Context *, int);
+extern void _Unwind_SetGR (struct _Unwind_Context *, int, unsigned long);
+extern unsigned long _Unwind_GetIP (struct _Unwind_Context *);
+extern unsigned long _Unwind_GetIPInfo (struct _Unwind_Context *, int *);
+extern void _Unwind_SetIP (struct _Unwind_Context *, unsigned long);
+extern unsigned long _Unwind_GetLanguageSpecificData (struct _Unwind_Context*);
+extern unsigned long _Unwind_GetRegionStart (struct _Unwind_Context *);
+
+#ifdef _GNU_SOURCE
+
+/* Callback for _Unwind_Backtrace(). The backtrace stops immediately
+ if the callback returns any value other than _URC_NO_REASON. */
+typedef _Unwind_Reason_Code (*_Unwind_Trace_Fn) (struct _Unwind_Context *,
+ void *);
+
+/* See http://gcc.gnu.org/ml/gcc-patches/2001-09/msg00082.html for why
+ _UA_END_OF_STACK exists. */
+# define _UA_END_OF_STACK 16
+
+/* If the unwind was initiated due to a forced unwind, resume that
+ operation, else re-raise the exception. This is used by
+ __cxa_rethrow(). */
+extern _Unwind_Reason_Code
+ _Unwind_Resume_or_Rethrow (struct _Unwind_Exception *);
+
+/* See http://gcc.gnu.org/ml/gcc-patches/2003-09/msg00154.html for why
+ _Unwind_GetBSP() exists. */
+extern unsigned long _Unwind_GetBSP (struct _Unwind_Context *);
+
+/* Return the "canonical frame address" for the given context.
+ This is used by NPTL... */
+extern unsigned long _Unwind_GetCFA (struct _Unwind_Context *);
+
+/* Return the base-address for data references. */
+extern unsigned long _Unwind_GetDataRelBase (struct _Unwind_Context *);
+
+/* Return the base-address for text references. */
+extern unsigned long _Unwind_GetTextRelBase (struct _Unwind_Context *);
+
+/* Call _Unwind_Trace_Fn once for each stack-frame, without doing any
+ cleanup. The first frame for which the callback is invoked is the
+ one for the caller of _Unwind_Backtrace(). _Unwind_Backtrace()
+ returns _URC_END_OF_STACK when the backtrace stopped due to
+ reaching the end of the call-chain or _URC_FATAL_PHASE1_ERROR if it
+ stops for any other reason. */
+extern _Unwind_Reason_Code _Unwind_Backtrace (_Unwind_Trace_Fn, void *);
+
+/* Find the start-address of the procedure containing the specified IP
+ or NULL if it cannot be found (e.g., because the function has no
+ unwind info). Note: there is not necessarily a one-to-one
+ correspondence between source-level functions and procedures: some
+ functions don't have unwind-info and others are split into multiple
+ procedures. */
+extern void *_Unwind_FindEnclosingFunction (void *);
+
+/* See also Linux Standard Base Spec:
+ http://www.linuxbase.org/spec/refspecs/LSB_1.3.0/gLSB/gLSB/libgcc-s.html */
+
+#endif /* _GNU_SOURCE */
+
+#ifdef __cplusplus
+};
+#endif
+
+#endif /* _UNWIND_H */
-Subproject commit 6c6e36218c4a0b6dfb85bd27fa6746467761e8a0
+Subproject commit 2f66da8d34b30473dac23f02b1a843d0717b9f1a
AC_MSG_CHECKING(for __sync_bool_compare_and_swap)
AC_TRY_COMPILE([],[
volatile unsigned int foo = 0;
-int main(int argc, char** argv) {
- unsigned int r1 = __sync_bool_compare_and_swap(&foo, 0, 1);
- return 0;
-}
+unsigned int r1 = __sync_bool_compare_and_swap(&foo, 0, 1);
+return 0;
], [
AC_MSG_RESULT(yes)
AC_DEFINE(HAS___SYNC_BOOL_COMPARE_AND_SWAP)
.PP
In the above sample Mono will load the user defined profiler from the
shared library `mono-profiler-custom.so'. This profiler module must
-be on your dynamic linker library path, or in the MONO_PROFILER_LIB_DIR
-path (see "RUNTIME OPTIONS" below).
+be on your dynamic linker library path.
.PP
A list of other third party profilers is available from Mono's web
site (www.mono-project.com/docs/advanced/performance-tips/)
deployment, see
http://www.mono-project.com/docs/getting-started/application-deployment/
.TP
-\fBMONO_PROFILER_LIB_DIR\fR
-Provides a search path to the runtime where to look for custom profilers. See the
-section "CUSTOM PROFILERS" above for more information. Custom profilers will be
-searched for in the MONO_PROFILER_LIB_DIR path before the standard library paths.
-
-.TP
-\fBMONO_RTC\fR
-Experimental RTC support in the statistical profiler: if the user has
-the permission, more accurate statistics are gathered. The MONO_RTC
-value must be restricted to what the Linux rtc allows: power of two
-from 64 to 8192 Hz. To enable higher frequencies like 4096 Hz, run as root:
-.nf
-
- echo 4096 > /proc/sys/dev/rtc/max-user-freq
-
-.fi
-.Sp
-For example:
-.nf
-
- MONO_RTC=4096 mono --profiler=default:stat program.exe
-
-.fi
-.TP
\fBMONO_SHARED_DIR\fR
If set its the directory where the ".wapi" handle state is stored.
This is the directory where the Windows I/O Emulation layer stores its
DISTFILES = \
AUTHORS \
COPYING \
- COPYING.LIB \
INSTALL.txt \
Makefile \
mkinstalldirs \
- MIT.X11 \
MonoIcon.png \
README \
ScalableMonoIcon.svg \
CODEPAGE = 65001
RUNTIME_FLAGS =
-TEST_HARNESS = $(topdir)/class/lib/$(PROFILE)/nunit-console.exe
+TEST_HARNESS = $(topdir)/class/lib/$(PROFILE)/$(PARENT_PROFILE)nunit-console.exe
MCS_FLAGS =
MBAS_FLAGS = $(PLATFORM_DEBUG_FLAGS)
LIBRARY_FLAGS = /noconfig
PROGRAM_config := $(build_libdir)$(PROGRAM).config
endif
+sn = $(topdir)/class/lib/$(BUILD_TOOLS_PROFILE)/sn.exe
+SN = MONO_PATH="$(topdir)/class/lib/$(BUILD_TOOLS_PROFILE)$(PLATFORM_PATH_SEPARATOR)$$MONO_PATH" $(RUNTIME) $(RUNTIME_FLAGS) $(sn) -q
+
the_lib = $(the_libdir)$(base_prog)
build_lib = $(build_libdir)$(base_prog)
$(the_lib): $(the_libdir)/.stamp
$(build_lib): $(BUILT_SOURCES) $(EXTRA_SOURCES) $(response) $(build_libdir:=/.stamp)
- $(PROGRAM_COMPILE) -target:exe -out:$@ $(BUILT_SOURCES) $(EXTRA_SOURCES) @$(response)
+ $(PROGRAM_COMPILE) $(MCS_REFERENCES) -target:exe -out:$@ $(BUILT_SOURCES) $(EXTRA_SOURCES) @$(response)
+ifdef PROGRAM_SNK
+ $(Q) $(SN) -R $@ $(PROGRAM_SNK)
+endif
ifdef PROGRAM_USE_INTERMEDIATE_FILE
$(the_lib): $(build_lib)
-include $(makefrag)
+MCS_REFERENCES = $(patsubst %,-r:$(topdir)/class/lib/$(PROFILE)/%.dll,$(LIB_REFS))
+MCS_REFERENCES += $(patsubst %,-r:$(topdir)/class/lib/$(PROFILE)/%.exe,$(EXE_REFS))
+
all-local: $(makefrag) $(extra_targets)
csproj-local:
# Have to rename to handle differences between assembly/directory names
DEP_LIBS=$(patsubst System.Xml,System.XML,$(LIB_REFS))
-LIB_MCS_FLAGS += $(patsubst %,-r:%.dll,$(LIB_REFS))
+_FILTER_OUT = $(foreach x,$(2),$(if $(findstring $(1),$(x)),,$(x)))
+
+LIB_REFS_FULL = $(call _FILTER_OUT,=, $(LIB_REFS))
+LIB_REFS_ALIAS = $(filter-out $(LIB_REFS_FULL),$(LIB_REFS))
+
+LIB_MCS_FLAGS += $(patsubst %,-r:$(topdir)/class/lib/$(PROFILE)/%.dll,$(LIB_REFS_FULL))
+LIB_MCS_FLAGS += $(patsubst %,-r:%.dll, $(subst =,=$(topdir)/class/lib/$(PROFILE)/,$(LIB_REFS_ALIAS)))
sourcefile = $(LIBRARY).sources
for f in `$(topdir)/tools/removecomments.sh $(wildcard *$(LIBRARY).sources)` $(TEST_FILES) ; do \
case $$f in \
../*) : ;; \
+ *.g.cs) : ;; \
*) dest=`dirname "$$f"` ; \
case $$subs in *" $$dest "*) : ;; *) subs=" $$dest$$subs" ; $(MKINSTALLDIRS) $(distdir)/$$dest ;; esac ; \
cp -p "$$f" $(distdir)/$$dest || exit 1 ;; \
profile-check:
@:
-DEFAULT_REFERENCES = -r:mscorlib.dll
-PROFILE_MCS_FLAGS = -d:NET_4_0 -d:NET_4_5 -d:MONO -d:DISABLE_CAS_USE -nowarn:1699 -nostdlib -lib:$(topdir)/class/lib/$(PROFILE) $(DEFAULT_REFERENCES)
+DEFAULT_REFERENCES = -r:$(topdir)/class/lib/$(PROFILE)/mscorlib.dll
+PROFILE_MCS_FLAGS = -d:NET_4_0 -d:NET_4_5 -d:MONO -d:DISABLE_CAS_USE -nowarn:1699 -nostdlib $(DEFAULT_REFERENCES)
NO_SIGN_ASSEMBLY = yes
NO_TEST = yes
profile-check:
@:
-DEFAULT_REFERENCES = -r:mscorlib.dll
+DEFAULT_REFERENCES = -r:$(topdir)/class/lib/$(PROFILE)/mscorlib.dll
PROFILE_MCS_FLAGS = \
-d:NET_1_1 \
-d:DISABLE_CAS_USE \
-nowarn:1699 \
-nostdlib \
- -lib:$(topdir)/class/lib/$(PROFILE) \
$(DEFAULT_REFERENCES) \
$(PLATFORM_DEBUG_FLAGS)
profile-check:
@:
-DEFAULT_REFERENCES = -r:mscorlib.dll
+DEFAULT_REFERENCES = -r:$(topdir)/class/lib/$(PROFILE)/mscorlib.dll
PROFILE_MCS_FLAGS = \
-d:NET_1_1 \
-d:DISABLE_COM \
-nowarn:1699 \
-nostdlib \
- -lib:$(topdir)/class/lib/$(PROFILE) \
$(DEFAULT_REFERENCES) \
$(PLATFORM_DEBUG_FLAGS)
profile-check:
@:
-DEFAULT_REFERENCES = -r:mscorlib.dll
+DEFAULT_REFERENCES = -r:$(topdir)/class/lib/$(PROFILE)/mscorlib.dll
PROFILE_MCS_FLAGS = \
-d:NET_1_1 \
-d:ANDROID \
-nowarn:1699 \
-nostdlib \
- -lib:$(topdir)/class/lib/$(PROFILE) \
$(DEFAULT_REFERENCES) \
$(PLATFORM_DEBUG_FLAGS)
profile-check:
@:
-DEFAULT_REFERENCES = -r:mscorlib.dll
+DEFAULT_REFERENCES = -r:$(topdir)/class/lib/$(PROFILE)/mscorlib.dll
PROFILE_MCS_FLAGS = \
-d:NET_1_1 \
-d:NET_2_0 \
-d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK \
-nowarn:1699 \
-nostdlib \
- -lib:$(topdir)/class/lib/$(PROFILE) \
$(DEFAULT_REFERENCES) \
$(PLATFORM_DEBUG_FLAGS)
profile-check:
@:
-DEFAULT_REFERENCES = -r:mscorlib.dll
-PROFILE_MCS_FLAGS = -d:NET_4_0 -d:NET_4_5 -d:NET_4_6 -d:MONO -d:DISABLE_CAS_USE -nowarn:1699 -nostdlib -lib:$(topdir)/class/lib/$(PROFILE) $(DEFAULT_REFERENCES) $(PLATFORM_DEBUG_FLAGS)
+DEFAULT_REFERENCES = -r:$(topdir)/class/lib/$(PROFILE)/mscorlib.dll
+PROFILE_MCS_FLAGS = -d:NET_4_0 -d:NET_4_5 -d:NET_4_6 -d:MONO -d:DISABLE_CAS_USE -nowarn:1699 -nostdlib $(DEFAULT_REFERENCES) $(PLATFORM_DEBUG_FLAGS)
FRAMEWORK_VERSION = 4.5
XBUILD_VERSION = 4.0
profile-check:
@:
-DEFAULT_REFERENCES = -r:mscorlib.dll
+DEFAULT_REFERENCES = -r:$(topdir)/class/lib/$(PROFILE)/mscorlib.dll
PROFILE_MCS_FLAGS = \
-d:NET_1_1 \
-d:XAMARIN_MODERN \
-nowarn:1699 \
-nostdlib \
- -lib:$(topdir)/class/lib/$(PROFILE) \
$(DEFAULT_REFERENCES) \
$(PLATFORM_DEBUG_FLAGS)
include $(topdir)/build/profiles/net_4_x.make
-PROFILE_MCS_FLAGS := $(PROFILE_MCS_FLAGS) -d:XBUILD_12 -d:MONO -d:DISABLE_CAS_USE -lib:$(topdir)/class/lib/net_4_x
+PARENT_PROFILE = ../net_4_x/
+DEFAULT_REFERENCES = -r:$(topdir)/class/lib/net_4_x/mscorlib.dll
+PROFILE_MCS_FLAGS := $(PROFILE_MCS_FLAGS) -d:XBUILD_12
+
+RESGEN_EXE = $(topdir)/class/lib/net_4_x/resgen.exe
XBUILD_VERSION = 12.0
# -*- makefile -*-
-include $(topdir)/build/profiles/net_4_x.make
+include $(topdir)/build/profiles/xbuild_12.make
-PROFILE_MCS_FLAGS := $(PROFILE_MCS_FLAGS) -d:XBUILD_12 -d:XBUILD_14 -d:MONO -d:DISABLE_CAS_USE -lib:$(topdir)/class/lib/net_4_x
+PROFILE_MCS_FLAGS := $(PROFILE_MCS_FLAGS) -d:XBUILD_14
XBUILD_VERSION = 14.0
INTERNAL_MBAS = $(RUNTIME) $(RUNTIME_FLAGS) $(topdir)/mbas/mbas.exe
INTERNAL_GMCS = $(RUNTIME) $(RUNTIME_FLAGS) $(topdir)/class/lib/$(BUILD_TOOLS_PROFILE)/mcs.exe
INTERNAL_ILASM = $(RUNTIME) $(RUNTIME_FLAGS) $(topdir)/class/lib/$(PROFILE)/ilasm.exe
-corlib = mscorlib.dll
+INTERNAL_CSC = $(RUNTIME) $(RUNTIME_FLAGS) $(CSC_LOCATION)
-INTERNAL_RESGEN = $(RUNTIME) $(RUNTIME_FLAGS) $(topdir)/class/lib/$(PROFILE)/resgen.exe
+RESGEN_EXE = $(topdir)/class/lib/$(PROFILE)/resgen.exe
+INTERNAL_RESGEN = $(RUNTIME) $(RUNTIME_FLAGS) $(RESGEN_EXE)
RESGEN = MONO_PATH="$(topdir)/class/lib/$(PROFILE)$(PLATFORM_PATH_SEPARATOR)$$MONO_PATH" $(INTERNAL_RESGEN)
STRING_REPLACER = MONO_PATH="$(topdir)/class/lib/$(BUILD_TOOLS_PROFILE)$(PLATFORM_PATH_SEPARATOR)$$MONO_PATH" $(RUNTIME) $(RUNTIME_FLAGS) $(topdir)/class/lib/$(BUILD_TOOLS_PROFILE)/cil-stringreplacer.exe
test_nunit_lib = nunit.framework.dll nunit.core.dll nunit.util.dll nunit.mocks.dll
endif
-test_nunit_dep = $(test_nunit_lib:%=$(topdir)/class/lib/$(PROFILE)/%)
+TEST_LIB_MCS_FLAGS = $(patsubst %,-r:$(topdir)/class/lib/$(PROFILE)/%.dll,$(TEST_LIB_REFS))
+
+test_nunit_dep = $(test_nunit_lib:%=$(topdir)/class/lib/$(PROFILE)/$(PARENT_PROFILE)%)
test_nunit_ref = $(test_nunit_dep:%=-r:%)
tests_CLEAN_FILES += TestResult*.xml
test_pdb = $(test_lib:.dll=.pdb)
test_response = $(depsdir)/$(test_lib).response
test_makefrag = $(depsdir)/$(test_lib).makefrag
-test_flags = -r:$(the_assembly) $(test_nunit_ref) $(TEST_MCS_FLAGS)
+test_flags = -r:$(the_assembly) $(test_nunit_ref) $(TEST_MCS_FLAGS) $(TEST_LIB_MCS_FLAGS)
tests_CLEAN_FILES += $(ASSEMBLY:$(ASSEMBLY_EXT)=_test*.dll) $(ASSEMBLY:$(ASSEMBLY_EXT)=_test*.pdb) $(test_response) $(test_makefrag)
ifndef HAVE_CS_TESTS
ifdef NUNIT_LITE
$(topdir)/build/deps/nunit-$(PROFILE).stamp:
+ifndef PARENT_PROFILE
cd ${topdir}/tools/nunit-lite && $(MAKE)
+endif
echo "stamp" >$@
else
$(topdir)/build/deps/nunit-$(PROFILE).stamp:
+ifndef PARENT_PROFILE
cd ${topdir}/nunit24 && $(MAKE)
+endif
echo "stamp" >$@
endif
include ../../build/rules.make
LIBRARY = Accessibility.dll
-LIB_MCS_FLAGS = /r:$(corlib)
+LIB_MCS_FLAGS =
NO_TEST = yes
include ../../build/library.make
LIBRARY = Commons.Xml.Relaxng.dll
LIB_REFS = System System.Xml
-LIB_MCS_FLAGS = /r:$(corlib) \
+LIB_MCS_FLAGS = \
$(foreach r, $(OTHER_RES), /resource:$(r),$(notdir $(r)))
TEST_MCS_FLAGS = $(LIB_MCS_FLAGS) -nowarn:0618 -nowarn:219 -nowarn:169
EXTRA_DISTFILES = \
LIBRARY_SNK = SharpZipLib.key
LIB_REFS = System System.Xml
-LIB_MCS_FLAGS = -r:$(corlib)
+LIB_MCS_FLAGS =
NO_TEST = yes
EXTRA_DISTFILES = SharpZipLib.pub $(LIBRARY_SNK)
LIBRARY = Cscompmgd.dll
LIB_REFS = System
-LIB_MCS_FLAGS = /r:$(corlib)
+LIB_MCS_FLAGS =
TEST_MCS_FLAGS = $(LIB_MCS_FLAGS) -nowarn:0618 -nowarn:219 -nowarn:169
LIBRARY_NAME = cscompmgd.dll
LIBRARY = CustomMarshalers.dll
LIB_REFS = System
-LIB_MCS_FLAGS = /r:$(corlib)
+LIB_MCS_FLAGS =
NO_TEST = yes
include ../../build/library.make
doc-update-recursive:
@echo "do not recurse the Facades folder"
-System System.Core System.ComponentModel.DataAnnotations System.Numerics System.Runtime.Serialization System.XML System.ComponentModel.Composition System.ServiceModel System.Xml.Linq:
+System System.Core System.ComponentModel.DataAnnotations System.Numerics System.Runtime.Serialization System.XML \
+System.ComponentModel.Composition System.ServiceModel System.Xml.Linq System.Data System.IO.Compression.FileSystem \
+System.ServiceProcess System.Security System.Net.Http.WebRequest System.Net.Http:
all-local-aot:
KEY_FILE = ../../msfinal.pub
SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
LIB_REFS = System
-LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib.dll
+LIB_MCS_FLAGS = $(SIGN_FLAGS)
PLATFORM_DEBUG_FLAGS =
KEY_FILE = ../../msfinal.pub
SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
LIB_REFS = System
-LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib.dll
+LIB_MCS_FLAGS = $(SIGN_FLAGS)
PLATFORM_DEBUG_FLAGS =
KEY_FILE = ../../msfinal.pub
SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
LIB_REFS = System
-LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib.dll
+LIB_MCS_FLAGS = $(SIGN_FLAGS)
PLATFORM_DEBUG_FLAGS =
KEY_FILE = ../../msfinal.pub
SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
LIB_REFS = System
-LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib.dll
+LIB_MCS_FLAGS = $(SIGN_FLAGS)
PLATFORM_DEBUG_FLAGS =
KEY_FILE = ../../msfinal.pub
SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
LIB_REFS = System
-LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib.dll
+LIB_MCS_FLAGS = $(SIGN_FLAGS)
PLATFORM_DEBUG_FLAGS =
KEY_FILE = ../../msfinal.pub
SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
LIB_REFS = System
-LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib.dll
+LIB_MCS_FLAGS = $(SIGN_FLAGS)
PLATFORM_DEBUG_FLAGS =
KEY_FILE = ../../msfinal.pub
SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
LIB_REFS = System
-LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib.dll
+LIB_MCS_FLAGS = $(SIGN_FLAGS)
PLATFORM_DEBUG_FLAGS =
KEY_FILE = ../../msfinal.pub
SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
LIB_REFS = System System.Core
-LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib.dll
+LIB_MCS_FLAGS = $(SIGN_FLAGS)
PLATFORM_DEBUG_FLAGS =
KEY_FILE = ../../msfinal.pub
SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
LIB_REFS = System.ComponentModel.DataAnnotations
-LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib.dll
+LIB_MCS_FLAGS = $(SIGN_FLAGS)
PLATFORM_DEBUG_FLAGS =
KEY_FILE = ../../msfinal.pub
SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
LIB_REFS = System
-LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib.dll
+LIB_MCS_FLAGS = $(SIGN_FLAGS)
PLATFORM_DEBUG_FLAGS =
KEY_FILE = ../../msfinal.pub
SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
LIB_REFS = System
-LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib.dll
+LIB_MCS_FLAGS = $(SIGN_FLAGS)
PLATFORM_DEBUG_FLAGS =
KEY_FILE = ../../msfinal.pub
SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
LIB_REFS = System
-LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib.dll
+LIB_MCS_FLAGS = $(SIGN_FLAGS)
PLATFORM_DEBUG_FLAGS =
KEY_FILE = ../../msfinal.pub
SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
LIB_REFS = System
-LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib.dll
+LIB_MCS_FLAGS = $(SIGN_FLAGS)
PLATFORM_DEBUG_FLAGS =
KEY_FILE = ../../msfinal.pub
SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
LIB_REFS = System
-LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib.dll
+LIB_MCS_FLAGS = $(SIGN_FLAGS)
PLATFORM_DEBUG_FLAGS =
KEY_FILE = ../../msfinal.pub
SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
-LIB_REFS = System
-LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib.dll /r:System.Data.dll
+LIB_REFS = System System.Data
+LIB_MCS_FLAGS = $(SIGN_FLAGS)
PLATFORM_DEBUG_FLAGS =
KEY_FILE = ../../msfinal.pub
SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
-LIB_REFS = System
-LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib.dll /r:System.Data.dll /r:System.Xml.dll
+LIB_REFS = System System.Data System.Xml
+LIB_MCS_FLAGS = $(SIGN_FLAGS)
PLATFORM_DEBUG_FLAGS =
KEY_FILE = ../../msfinal.pub
SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
-LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib.dll
+LIB_MCS_FLAGS = $(SIGN_FLAGS)
PLATFORM_DEBUG_FLAGS =
KEY_FILE = ../../msfinal.pub
SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
LIB_REFS = System
-LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib.dll
+LIB_MCS_FLAGS = $(SIGN_FLAGS)
PLATFORM_DEBUG_FLAGS =
KEY_FILE = ../../msfinal.pub
SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
LIB_REFS = System
-LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib.dll
+LIB_MCS_FLAGS = $(SIGN_FLAGS)
PLATFORM_DEBUG_FLAGS =
KEY_FILE = ../../msfinal.pub
SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
LIB_REFS = System
-LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib.dll
+LIB_MCS_FLAGS = $(SIGN_FLAGS)
PLATFORM_DEBUG_FLAGS =
KEY_FILE = ../../msfinal.pub
SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
LIB_REFS = System
-LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib.dll
+LIB_MCS_FLAGS = $(SIGN_FLAGS)
PLATFORM_DEBUG_FLAGS =
KEY_FILE = ../../msfinal.pub
SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
LIB_REFS = System
-LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib.dll
+LIB_MCS_FLAGS = $(SIGN_FLAGS)
PLATFORM_DEBUG_FLAGS =
KEY_FILE = ../../msfinal.pub
SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
LIB_REFS = System
-LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib.dll
+LIB_MCS_FLAGS = $(SIGN_FLAGS)
PLATFORM_DEBUG_FLAGS =
KEY_FILE = ../../msfinal.pub
SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
LIB_REFS = System
-LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib.dll
+LIB_MCS_FLAGS = $(SIGN_FLAGS)
PLATFORM_DEBUG_FLAGS =
KEY_FILE = ../../msfinal.pub
SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
LIB_REFS = System
-LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib.dll
+LIB_MCS_FLAGS = $(SIGN_FLAGS)
PLATFORM_DEBUG_FLAGS =
KEY_FILE = ../../msfinal.pub
SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
LIB_REFS = System
-LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib.dll
+LIB_MCS_FLAGS = $(SIGN_FLAGS)
PLATFORM_DEBUG_FLAGS =
KEY_FILE = ../../msfinal.pub
SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
-LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib.dll
+LIB_MCS_FLAGS = $(SIGN_FLAGS)
PLATFORM_DEBUG_FLAGS =
KEY_FILE = ../../msfinal.pub
SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
LIB_REFS = System.Core System
-LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib.dll
+LIB_MCS_FLAGS = $(SIGN_FLAGS)
PLATFORM_DEBUG_FLAGS =
KEY_FILE = ../../msfinal.pub
SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
LIB_REFS = System
-LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib.dll
+LIB_MCS_FLAGS = $(SIGN_FLAGS)
PLATFORM_DEBUG_FLAGS =
KEY_FILE = ../../msfinal.pub
SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
LIB_REFS = System
-LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib.dll
+LIB_MCS_FLAGS = $(SIGN_FLAGS)
PLATFORM_DEBUG_FLAGS =
KEY_FILE = ../../msfinal.pub
SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
-LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib.dll
+LIB_MCS_FLAGS = $(SIGN_FLAGS)
PLATFORM_DEBUG_FLAGS =
KEY_FILE = ../../msfinal.pub
SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
-LIB_REFS = System
-LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib.dll /r:System.IO.Compression.FileSystem.dll
+LIB_REFS = System System.IO.Compression.FileSystem
+LIB_MCS_FLAGS = $(SIGN_FLAGS)
PLATFORM_DEBUG_FLAGS =
KEY_FILE = ../../msfinal.pub
SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
LIB_REFS = System
-LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib.dll
+LIB_MCS_FLAGS = $(SIGN_FLAGS)
PLATFORM_DEBUG_FLAGS =
KEY_FILE = ../../msfinal.pub
SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
LIB_REFS = System
-LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib.dll
+LIB_MCS_FLAGS = $(SIGN_FLAGS)
PLATFORM_DEBUG_FLAGS =
KEY_FILE = ../../msfinal.pub
SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
LIB_REFS = System
-LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib.dll
+LIB_MCS_FLAGS = $(SIGN_FLAGS)
PLATFORM_DEBUG_FLAGS =
KEY_FILE = ../../msfinal.pub
SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
LIB_REFS = System
-LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib.dll
+LIB_MCS_FLAGS = $(SIGN_FLAGS)
PLATFORM_DEBUG_FLAGS =
KEY_FILE = ../../msfinal.pub
SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
LIB_REFS = System
-LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib.dll
+LIB_MCS_FLAGS = $(SIGN_FLAGS)
PLATFORM_DEBUG_FLAGS =
KEY_FILE = ../../msfinal.pub
SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
LIB_REFS = System
-LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib.dll
+LIB_MCS_FLAGS = $(SIGN_FLAGS)
PLATFORM_DEBUG_FLAGS =
KEY_FILE = ../../msfinal.pub
SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
-LIB_REFS = System
-LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib.dll /r:System.Core.dll
+LIB_REFS = System System.Core
+LIB_MCS_FLAGS = $(SIGN_FLAGS)
PLATFORM_DEBUG_FLAGS =
KEY_FILE = ../../msfinal.pub
SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
-LIB_REFS = System
-LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib.dll /r:System.Core.dll
+LIB_REFS = System System.Core
+LIB_MCS_FLAGS = $(SIGN_FLAGS)
PLATFORM_DEBUG_FLAGS =
KEY_FILE = ../../msfinal.pub
SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
LIB_REFS = System
-LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib.dll
+LIB_MCS_FLAGS = $(SIGN_FLAGS)
PLATFORM_DEBUG_FLAGS =
KEY_FILE = ../../msfinal.pub
SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
LIB_REFS = System
-LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib.dll
+LIB_MCS_FLAGS = $(SIGN_FLAGS)
PLATFORM_DEBUG_FLAGS =
KEY_FILE = ../../msfinal.pub
SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
LIB_REFS = System.Core
-LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib.dll
+LIB_MCS_FLAGS = $(SIGN_FLAGS)
PLATFORM_DEBUG_FLAGS =
KEY_FILE = ../../msfinal.pub
SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
LIB_REFS = System.Core
-LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib.dll
+LIB_MCS_FLAGS = $(SIGN_FLAGS)
PLATFORM_DEBUG_FLAGS =
KEY_FILE = ../../msfinal.pub
SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
LIB_REFS = System.Core
-LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib.dll
+LIB_MCS_FLAGS = $(SIGN_FLAGS)
PLATFORM_DEBUG_FLAGS =
KEY_FILE = ../../msfinal.pub
SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
LIB_REFS = System.Core
-LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib.dll
+LIB_MCS_FLAGS = $(SIGN_FLAGS)
PLATFORM_DEBUG_FLAGS =
KEY_FILE = ../../msfinal.pub
SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
LIB_REFS = System
-LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib.dll
+LIB_MCS_FLAGS = $(SIGN_FLAGS)
PLATFORM_DEBUG_FLAGS =
KEY_FILE = ../../msfinal.pub
SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
LIB_REFS = System
-LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib.dll
+LIB_MCS_FLAGS = $(SIGN_FLAGS)
PLATFORM_DEBUG_FLAGS =
KEY_FILE = ../../msfinal.pub
SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
-LIB_REFS = System
-LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib.dll /r:System.Net.Http.WebRequest.dll /r:System.Net.Http.dll
+LIB_REFS = System System.Net.Http.WebRequest System.Net.Http
+LIB_MCS_FLAGS = $(SIGN_FLAGS)
PLATFORM_DEBUG_FLAGS =
KEY_FILE = ../../msfinal.pub
SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
LIB_REFS = System
-LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib.dll /r:System.dll
+LIB_MCS_FLAGS = $(SIGN_FLAGS)
PLATFORM_DEBUG_FLAGS =
KEY_FILE = ../../msfinal.pub
SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
LIB_REFS = System
-LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib.dll /r:System.dll
+LIB_MCS_FLAGS = $(SIGN_FLAGS)
PLATFORM_DEBUG_FLAGS =
KEY_FILE = ../../msfinal.pub
SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
LIB_REFS = System
-LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib.dll
+LIB_MCS_FLAGS = $(SIGN_FLAGS)
PLATFORM_DEBUG_FLAGS =
KEY_FILE = ../../msfinal.pub
SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
LIB_REFS = System
-LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib.dll
+LIB_MCS_FLAGS = $(SIGN_FLAGS)
PLATFORM_DEBUG_FLAGS =
KEY_FILE = ../../msfinal.pub
SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
LIB_REFS = System
-LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib.dll
+LIB_MCS_FLAGS = $(SIGN_FLAGS)
PLATFORM_DEBUG_FLAGS =
KEY_FILE = ../../msfinal.pub
SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
LIB_REFS = System
-LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib.dll
+LIB_MCS_FLAGS = $(SIGN_FLAGS)
PLATFORM_DEBUG_FLAGS =
KEY_FILE = ../../msfinal.pub
SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
LIB_REFS = System
-LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib.dll /r:System.dll
+LIB_MCS_FLAGS = $(SIGN_FLAGS)
PLATFORM_DEBUG_FLAGS =
KEY_FILE = ../../msfinal.pub
SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
LIB_REFS = System
-LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib.dll
+LIB_MCS_FLAGS = $(SIGN_FLAGS)
PLATFORM_DEBUG_FLAGS =
KEY_FILE = ../../msfinal.pub
SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
LIB_REFS = System
-LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib.dll /r:System.dll
+LIB_MCS_FLAGS = $(SIGN_FLAGS)
PLATFORM_DEBUG_FLAGS =
KEY_FILE = ../../msfinal.pub
SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
LIB_REFS = System
-LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib.dll
+LIB_MCS_FLAGS = $(SIGN_FLAGS)
PLATFORM_DEBUG_FLAGS =
KEY_FILE = ../../msfinal.pub
SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
LIB_REFS = System
-LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib.dll
+LIB_MCS_FLAGS = $(SIGN_FLAGS)
PLATFORM_DEBUG_FLAGS =
KEY_FILE = ../../msfinal.pub
SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
LIB_REFS = System
-LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib.dll
+LIB_MCS_FLAGS = $(SIGN_FLAGS)
PLATFORM_DEBUG_FLAGS =
KEY_FILE = ../../msfinal.pub
SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
LIB_REFS = System
-LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib.dll
+LIB_MCS_FLAGS = $(SIGN_FLAGS)
PLATFORM_DEBUG_FLAGS =
KEY_FILE = ../../msfinal.pub
SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
LIB_REFS = System
-LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib.dll
+LIB_MCS_FLAGS = $(SIGN_FLAGS)
PLATFORM_DEBUG_FLAGS =
KEY_FILE = ../../msfinal.pub
SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
LIB_REFS = System
-LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib.dll
+LIB_MCS_FLAGS = $(SIGN_FLAGS)
PLATFORM_DEBUG_FLAGS =
KEY_FILE = ../../msfinal.pub
SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
LIB_REFS = System
-LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib.dll
+LIB_MCS_FLAGS = $(SIGN_FLAGS)
PLATFORM_DEBUG_FLAGS =
KEY_FILE = ../../msfinal.pub
SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
-LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib.dll
+LIB_MCS_FLAGS = $(SIGN_FLAGS)
PLATFORM_DEBUG_FLAGS =
KEY_FILE = ../../msfinal.pub
SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
-LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib.dll
+LIB_MCS_FLAGS = $(SIGN_FLAGS)
PLATFORM_DEBUG_FLAGS =
KEY_FILE = ../../msfinal.pub
SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
-LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib.dll
+LIB_MCS_FLAGS = $(SIGN_FLAGS)
PLATFORM_DEBUG_FLAGS =
KEY_FILE = ../../msfinal.pub
SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
-LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib.dll
+LIB_MCS_FLAGS = $(SIGN_FLAGS)
PLATFORM_DEBUG_FLAGS =
KEY_FILE = ../../msfinal.pub
SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
-LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib.dll
+LIB_MCS_FLAGS = $(SIGN_FLAGS)
PLATFORM_DEBUG_FLAGS =
KEY_FILE = ../../msfinal.pub
SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
LIB_REFS = System
-LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib.dll
+LIB_MCS_FLAGS = $(SIGN_FLAGS)
PLATFORM_DEBUG_FLAGS =
KEY_FILE = ../../msfinal.pub
SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
-LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib.dll
+LIB_MCS_FLAGS = $(SIGN_FLAGS)
PLATFORM_DEBUG_FLAGS =
KEY_FILE = ../../msfinal.pub
SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
LIB_REFS = System
-LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib.dll
+LIB_MCS_FLAGS = $(SIGN_FLAGS)
PLATFORM_DEBUG_FLAGS =
KEY_FILE = ../../msfinal.pub
SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
-LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib.dll
+LIB_MCS_FLAGS = $(SIGN_FLAGS)
PLATFORM_DEBUG_FLAGS =
KEY_FILE = ../../msfinal.pub
SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
LIB_REFS = System
-LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib.dll
+LIB_MCS_FLAGS = $(SIGN_FLAGS)
PLATFORM_DEBUG_FLAGS =
KEY_FILE = ../../msfinal.pub
SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
LIB_REFS = System
-LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib.dll
+LIB_MCS_FLAGS = $(SIGN_FLAGS)
PLATFORM_DEBUG_FLAGS =
KEY_FILE = ../../msfinal.pub
SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
LIB_REFS = System System.Core
-LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib.dll
+LIB_MCS_FLAGS = $(SIGN_FLAGS)
PLATFORM_DEBUG_FLAGS =
KEY_FILE = ../../msfinal.pub
SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
-LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib.dll
+LIB_MCS_FLAGS = $(SIGN_FLAGS)
PLATFORM_DEBUG_FLAGS =
KEY_FILE = ../../msfinal.pub
SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
LIB_REFS = System System.Core
-LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib.dll
+LIB_MCS_FLAGS = $(SIGN_FLAGS)
PLATFORM_DEBUG_FLAGS =
KEY_FILE = ../../msfinal.pub
SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
LIB_REFS = System.Numerics
-LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib.dll
+LIB_MCS_FLAGS = $(SIGN_FLAGS)
PLATFORM_DEBUG_FLAGS =
KEY_FILE = ../../msfinal.pub
SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
LIB_REFS = System.Runtime.Serialization
-LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib.dll
+LIB_MCS_FLAGS = $(SIGN_FLAGS)
PLATFORM_DEBUG_FLAGS =
KEY_FILE = ../../msfinal.pub
SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
LIB_REFS = System.Runtime.Serialization
-LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib.dll
+LIB_MCS_FLAGS = $(SIGN_FLAGS)
PLATFORM_DEBUG_FLAGS =
KEY_FILE = ../../msfinal.pub
SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
LIB_REFS = System.Runtime.Serialization System.Xml
-LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib.dll
+LIB_MCS_FLAGS = $(SIGN_FLAGS)
PLATFORM_DEBUG_FLAGS =
KEY_FILE = ../../msfinal.pub
SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
LIB_REFS = System System.ComponentModel.Composition System.Core
-LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib.dll
+LIB_MCS_FLAGS = $(SIGN_FLAGS)
PLATFORM_DEBUG_FLAGS =
KEY_FILE = ../../msfinal.pub
SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
LIB_REFS = System
-LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib.dll
+LIB_MCS_FLAGS = $(SIGN_FLAGS)
PLATFORM_DEBUG_FLAGS =
KEY_FILE = ../../msfinal.pub
SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
LIB_REFS = System
-LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib.dll
+LIB_MCS_FLAGS = $(SIGN_FLAGS)
PLATFORM_DEBUG_FLAGS =
KEY_FILE = ../../msfinal.pub
SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
LIB_REFS = System
-LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib.dll
+LIB_MCS_FLAGS = $(SIGN_FLAGS)
PLATFORM_DEBUG_FLAGS =
KEY_FILE = ../../msfinal.pub
SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
LIB_REFS = System
-LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib.dll
+LIB_MCS_FLAGS = $(SIGN_FLAGS)
PLATFORM_DEBUG_FLAGS =
KEY_FILE = ../../msfinal.pub
SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
LIB_REFS = System
-LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib.dll
+LIB_MCS_FLAGS = $(SIGN_FLAGS)
PLATFORM_DEBUG_FLAGS =
KEY_FILE = ../../msfinal.pub
SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
-LIB_REFS = System
-LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib.dll /r:System.Core.dll
+LIB_REFS = System System.Core
+LIB_MCS_FLAGS = $(SIGN_FLAGS)
PLATFORM_DEBUG_FLAGS =
KEY_FILE = ../../msfinal.pub
SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
-LIB_REFS = System
-LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib.dll /r:System.Core.dll
+LIB_REFS = System System.Core
+LIB_MCS_FLAGS = $(SIGN_FLAGS)
PLATFORM_DEBUG_FLAGS =
KEY_FILE = ../../msfinal.pub
SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
LIB_REFS = System
-LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib.dll
+LIB_MCS_FLAGS = $(SIGN_FLAGS)
PLATFORM_DEBUG_FLAGS =
KEY_FILE = ../../msfinal.pub
SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
LIB_REFS = System
-LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib.dll
+LIB_MCS_FLAGS = $(SIGN_FLAGS)
PLATFORM_DEBUG_FLAGS =
KEY_FILE = ../../msfinal.pub
SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
LIB_REFS = System
-LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib.dll
+LIB_MCS_FLAGS = $(SIGN_FLAGS)
PLATFORM_DEBUG_FLAGS =
KEY_FILE = ../../msfinal.pub
SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
-LIB_REFS = System
-LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib.dll /r:System.Security.dll
+LIB_REFS = System System.Security
+LIB_MCS_FLAGS = $(SIGN_FLAGS)
PLATFORM_DEBUG_FLAGS =
KEY_FILE = ../../msfinal.pub
SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
LIB_REFS = System
-LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib.dll
+LIB_MCS_FLAGS = $(SIGN_FLAGS)
PLATFORM_DEBUG_FLAGS =
KEY_FILE = ../../msfinal.pub
SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
LIB_REFS = System
-LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib.dll
+LIB_MCS_FLAGS = $(SIGN_FLAGS)
PLATFORM_DEBUG_FLAGS =
KEY_FILE = ../../msfinal.pub
SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
LIB_REFS = System
-LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib.dll
+LIB_MCS_FLAGS = $(SIGN_FLAGS)
PLATFORM_DEBUG_FLAGS =
KEY_FILE = ../../msfinal.pub
SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
LIB_REFS = System
-LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib.dll
+LIB_MCS_FLAGS = $(SIGN_FLAGS)
PLATFORM_DEBUG_FLAGS =
KEY_FILE = ../../msfinal.pub
SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
-LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib.dll
+LIB_MCS_FLAGS = $(SIGN_FLAGS)
PLATFORM_DEBUG_FLAGS =
KEY_FILE = ../../msfinal.pub
SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
LIB_REFS = System
-LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib.dll
+LIB_MCS_FLAGS = $(SIGN_FLAGS)
PLATFORM_DEBUG_FLAGS =
KEY_FILE = ../../msfinal.pub
SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
LIB_REFS = System.ServiceModel
-LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib.dll
+LIB_MCS_FLAGS = $(SIGN_FLAGS)
PLATFORM_DEBUG_FLAGS =
KEY_FILE = ../../msfinal.pub
SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
LIB_REFS = System.ServiceModel
-LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib.dll
+LIB_MCS_FLAGS = $(SIGN_FLAGS)
PLATFORM_DEBUG_FLAGS =
KEY_FILE = ../../msfinal.pub
SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
LIB_REFS = System.ServiceModel
-LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib.dll
+LIB_MCS_FLAGS = $(SIGN_FLAGS)
PLATFORM_DEBUG_FLAGS =
KEY_FILE = ../../msfinal.pub
SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
LIB_REFS = System.ServiceModel System.Xml
-LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib.dll
+LIB_MCS_FLAGS = $(SIGN_FLAGS)
PLATFORM_DEBUG_FLAGS =
KEY_FILE = ../../msfinal.pub
SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
LIB_REFS = System.ServiceModel
-LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib.dll
+LIB_MCS_FLAGS = $(SIGN_FLAGS)
PLATFORM_DEBUG_FLAGS =
KEY_FILE = ../../msfinal.pub
SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
-LIB_REFS = System
-LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib.dll /r:System.ServiceProcess.dll
+LIB_REFS = System System.ServiceProcess
+LIB_MCS_FLAGS = $(SIGN_FLAGS)
PLATFORM_DEBUG_FLAGS =
KEY_FILE = ../../msfinal.pub
SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
-LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib.dll
+LIB_MCS_FLAGS = $(SIGN_FLAGS)
PLATFORM_DEBUG_FLAGS =
KEY_FILE = ../../msfinal.pub
SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
-LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib.dll
+LIB_MCS_FLAGS = $(SIGN_FLAGS)
PLATFORM_DEBUG_FLAGS =
KEY_FILE = ../../msfinal.pub
SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
LIB_REFS = System
-LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib.dll
+LIB_MCS_FLAGS = $(SIGN_FLAGS)
PLATFORM_DEBUG_FLAGS =
KEY_FILE = ../../msfinal.pub
SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
LIB_REFS = System
-LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib.dll
+LIB_MCS_FLAGS = $(SIGN_FLAGS)
PLATFORM_DEBUG_FLAGS =
KEY_FILE = ../../msfinal.pub
SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
LIB_REFS = System
-LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib.dll
+LIB_MCS_FLAGS = $(SIGN_FLAGS)
PLATFORM_DEBUG_FLAGS =
KEY_FILE = ../../msfinal.pub
SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
-LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib.dll
+LIB_MCS_FLAGS = $(SIGN_FLAGS)
PLATFORM_DEBUG_FLAGS =
KEY_FILE = ../../msfinal.pub
SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
LIB_REFS = System.Core
-LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib.dll
+LIB_MCS_FLAGS = $(SIGN_FLAGS)
PLATFORM_DEBUG_FLAGS =
KEY_FILE = ../../msfinal.pub
SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
LIB_REFS = System
-LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib.dll
+LIB_MCS_FLAGS = $(SIGN_FLAGS)
PLATFORM_DEBUG_FLAGS =
KEY_FILE = ../../msfinal.pub
SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
LIB_REFS = System
-LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib.dll
+LIB_MCS_FLAGS = $(SIGN_FLAGS)
PLATFORM_DEBUG_FLAGS =
KEY_FILE = ../../msfinal.pub
SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
LIB_REFS = System System.Core
-LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib.dll
+LIB_MCS_FLAGS = $(SIGN_FLAGS)
PLATFORM_DEBUG_FLAGS =
KEY_FILE = ../../msfinal.pub
SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
LIB_REFS = System System.Core
-LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib.dll
+LIB_MCS_FLAGS = $(SIGN_FLAGS)
PLATFORM_DEBUG_FLAGS =
KEY_FILE = ../../msfinal.pub
SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
LIB_REFS = System.Xml
-LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib.dll
+LIB_MCS_FLAGS = $(SIGN_FLAGS)
PLATFORM_DEBUG_FLAGS =
KEY_FILE = ../../msfinal.pub
SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
LIB_REFS = System.Xml.Linq System.Xml
-LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib.dll
+LIB_MCS_FLAGS = $(SIGN_FLAGS)
PLATFORM_DEBUG_FLAGS =
KEY_FILE = ../../msfinal.pub
SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
-LIB_REFS = System
-LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib.dll /r:System.Xml.Linq.dll
+LIB_REFS = System System.Xml.Linq
+LIB_MCS_FLAGS = $(SIGN_FLAGS)
PLATFORM_DEBUG_FLAGS =
KEY_FILE = ../../msfinal.pub
SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
-LIB_REFS = System
-LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib.dll /r:System.Xml.dll
+LIB_REFS = System System.Xml
+LIB_MCS_FLAGS = $(SIGN_FLAGS)
PLATFORM_DEBUG_FLAGS =
KEY_FILE = ../../msfinal.pub
SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
-LIB_REFS = System
-LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib.dll /r:System.Xml.dll
+LIB_REFS = System System.Xml
+LIB_MCS_FLAGS = $(SIGN_FLAGS)
PLATFORM_DEBUG_FLAGS =
KEY_FILE = ../../msfinal.pub
SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
LIB_REFS = System.Xml
-LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib.dll
+LIB_MCS_FLAGS = $(SIGN_FLAGS)
PLATFORM_DEBUG_FLAGS =
KEY_FILE = ../../msfinal.pub
SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
-LIB_REFS = System
-LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib.dll /r:System.Xml.dll
+LIB_REFS = System System.Xml
+LIB_MCS_FLAGS = $(SIGN_FLAGS)
PLATFORM_DEBUG_FLAGS =
include ../../../build/rules.make
LIBRARY = I18N.CJK.dll
-LOCAL_MCS_FLAGS = /unsafe /resource:big5.table /resource:gb2312.table /resource:jis.table /resource:ks.table /resource:gb18030.table /r:$(corlib) /r:I18N.dll /define:DISABLE_UNSAFE
+LIB_REFS = I18N
+LOCAL_MCS_FLAGS = /unsafe /resource:big5.table /resource:gb2312.table /resource:jis.table /resource:ks.table /resource:gb18030.table /define:DISABLE_UNSAFE
+TEST_LIB_REFS = I18N
EXTRA_DISTFILES = big5.table jis.table gb2312.table ks.table gb18030.table \
README.gb18030 \
include ../../../build/rules.make
LIBRARY = I18N.dll
-LOCAL_MCS_FLAGS = /r:$(corlib) /unsafe /define:DISABLE_UNSAFE
+LOCAL_MCS_FLAGS = /unsafe /define:DISABLE_UNSAFE
NO_TEST = yes
include ../../../build/library.make
include ../../../build/rules.make
LIBRARY = I18N.MidEast.dll
-LOCAL_MCS_FLAGS = /r:$(corlib) /r:I18N.dll /unsafe
-#NO_TEST = yes
+LIB_REFS = I18N
+LOCAL_MCS_FLAGS = /unsafe
+TEST_LIB_REFS = I18N
EXTRA_DISTFILES = $(wildcard *.ucm) \
$(wildcard Test/texts/*.txt)
include ../../../build/rules.make
LIBRARY = I18N.Other.dll
-LOCAL_MCS_FLAGS = /r:$(corlib) /r:I18N.dll /unsafe
+LIB_REFS = I18N
+LOCAL_MCS_FLAGS = /unsafe
NO_TEST = yes
EXTRA_DISTFILES = $(wildcard *.ucm)
include ../../../build/rules.make
LIBRARY = I18N.Rare.dll
-LOCAL_MCS_FLAGS = /r:$(corlib) /r:I18N.dll /unsafe
+LIB_REFS = I18N
+LOCAL_MCS_FLAGS = /unsafe
NO_TEST = yes
EXTRA_DISTFILES = $(wildcard *.ucm)
include ../../../build/rules.make
LIBRARY = I18N.West.dll
-LOCAL_MCS_FLAGS = /r:$(corlib) /r:I18N.dll /unsafe
+LIB_REFS = I18N
+LOCAL_MCS_FLAGS = /unsafe
#NO_TEST = yes
EXTRA_DISTFILES = $(wildcard *.ucm) \
LIBRARY = IBM.Data.DB2.dll
LIB_REFS = System System.Xml System.Data
-LIB_MCS_FLAGS = /unsafe /r:$(corlib) -warn:1
+LIB_MCS_FLAGS = /unsafe -warn:1
NO_TEST = yes
EXTRA_DISTFILES = ibm.pub
LIBRARY_SNK = SharpZipLib.key
LIB_REFS = System System.Xml
-LIB_MCS_FLAGS = /r:$(corlib) -warn:1
+LIB_MCS_FLAGS = -warn:1
NO_TEST = yes
EXTRA_DISTFILES = SharpZipLib.pub $(LIBRARY_SNK)
LIBRARY = Microsoft.Build.Engine.dll
-LIB_REFS = System System.Core System.Xml
-LIB_MCS_FLAGS = \
- /r:$(corlib) \
- /r:System.dll \
- /r:System.Core.dll \
- /r:System.Xml.dll \
- /r:$(XBUILD_FRAMEWORK) \
- /r:$(XBUILD_UTILITIES)
-
-TEST_MCS_FLAGS = \
- /r:$(XBUILD_FRAMEWORK) \
- /r:$(XBUILD_UTILITIES) \
- /r:System.Xml.dll
+LIB_REFS = $(PARENT_PROFILE)System $(PARENT_PROFILE)System.Core $(PARENT_PROFILE)System.Xml $(XBUILD_FRAMEWORK) $(XBUILD_UTILITIES)
+LIB_MCS_FLAGS =
+
+TEST_MCS_FLAGS =
+TEST_LIB_REFS = $(XBUILD_FRAMEWORK) $(XBUILD_UTILITIES) $(PARENT_PROFILE)System.Xml
EXTRA_DISTFILES = \
Test/resources/TestTasks.cs \
Test/resources/*.*proj \
Test/resources/*.csproj
-Test/resources/TestTasks-$(PROFILE).dll: Test/resources/TestTasks.cs
- $(CSCOMPILE) /out:$@ Test/resources/TestTasks.cs /r:$(XBUILD_FRAMEWORK) /r:$(XBUILD_UTILITIES) /target:library
+CLEAN_FILES = Test/resources/TestTasks-$(PROFILE).dll Test/resources/TestTasks-$(PROFILE).dll.mdb Test/resources/TestTasks-$(PROFILE).pdb
-clean-test-resources:
- rm -f Test/resources/TestTasks*.dll Test/resources/TestTasks*.dll.mdb
+Test/resources/TestTasks-$(PROFILE).dll: Test/resources/TestTasks.cs
+ $(CSCOMPILE) /out:$@ Test/resources/TestTasks.cs /r:$(topdir)/class/lib/$(PROFILE)/$(XBUILD_FRAMEWORK).dll /r:$(topdir)/class/lib/$(PROFILE)/$(XBUILD_UTILITIES).dll /target:library
test-local: compile-resources
compile-resources: Test/resources/TestTasks-$(PROFILE).dll
cp Test/resources/TestTasks-$(PROFILE).dll Test/resources/TestTasks.dll
cp Test/resources/TestTasks-$(PROFILE).dll.mdb Test/resources/TestTasks.dll.mdb
-
-clean-local: clean-test-resources
+# cp Test/resources/TestTasks-$(PROFILE).pdb Test/resources/TestTasks.pdb
include $(XBUILD_DIR)/xbuild_test.make
include ../../build/library.make
LIBRARY = Microsoft.Build.Framework.dll
-LIB_REFS = System
-LIB_MCS_FLAGS = \
- /r:$(corlib) \
- /r:System.dll
+LIB_REFS = $(PARENT_PROFILE)System
+LIB_MCS_FLAGS =
EXTRA_DISTFILES = \
Mono.XBuild.Framework/AssemblyLoadInfo.cs
LIBRARY_NAME = Microsoft.Build.Tasks$(NAME_SUFFIX).dll
-LIB_REFS = System System.Core System.Xml System.Windows.Forms
-LIB_MCS_FLAGS = \
- /r:$(corlib) \
- /r:System.dll \
- /r:System.Core.dll \
- /r:System.Xml.dll \
- /r:System.Windows.Forms.dll \
- /r:$(XBUILD_UTILITIES) \
- /r:$(XBUILD_FRAMEWORK) \
- /r:$(XBUILD_ENGINE) \
- /r:$(XBUILD_TASKS)
-
-TEST_MCS_FLAGS = \
- /r:System.Xml.dll \
- /r:$(XBUILD_ENGINE) \
- /r:$(XBUILD_FRAMEWORK) \
- /r:$(XBUILD_TASKS) \
- /r:$(XBUILD_UTILITIES) \
- /r:System.Core.dll
+LIB_REFS = $(PARENT_PROFILE)System $(PARENT_PROFILE)System.Core $(PARENT_PROFILE)System.Xml $(PARENT_PROFILE)System.Windows.Forms \
+ $(XBUILD_UTILITIES) $(XBUILD_FRAMEWORK) $(XBUILD_ENGINE) $(XBUILD_TASKS)
+
+TEST_MCS_FLAGS =
+TEST_LIB_REFS = $(PARENT_PROFILE)System.Xml $(XBUILD_ENGINE) $(XBUILD_FRAMEWORK) $(XBUILD_TASKS) $(XBUILD_UTILITIES) $(PARENT_PROFILE)System.Core
ifeq (4, $(FRAMEWORK_VERSION_MAJOR))
- TEST_MCS_FLAGS += /r:Microsoft.Build.dll
+TEST_LIB_REFS += Microsoft.Build
endif
EXTRA_DISTFILES = \
Test/test-config-file*
Test/resources/test.dll: Test/resources/test.cs
- $(CSCOMPILE) -target:library Test/resources/test.cs
+ $(CSCOMPILE) -target:library /out:$@ $<
clean-test-resources:
rm -f Test/resources/test.dll
ITaskItem[] assignedProjects;
string solutionConfigurationContents;
ITaskItem[] unassignedProjects;
+ Dictionary<Guid, string> guidToConfigPlatform;
+ Dictionary<string, string> absolutePathToConfigPlatform;
public AssignProjectConfiguration ()
{
return true;
XmlReader xr = null;
- Dictionary<Guid, string> guidToConfigPlatform = null;
+ guidToConfigPlatform = new Dictionary<Guid, string> ();
+ absolutePathToConfigPlatform = new Dictionary<string, string> ();
try {
xr = XmlReader.Create (new StringReader (solutionConfigurationContents));
- guidToConfigPlatform = new Dictionary<Guid, string> ();
xr.Read ();
while (!xr.EOF) {
continue;
string guid_str = xr.GetAttribute ("Project");
+ string abs_path = xr.GetAttribute ("AbsolutePath");
string config_str = xr.ReadString ();
+ if (String.IsNullOrEmpty (config_str))
+ continue;
+
Guid guid;
- if (!String.IsNullOrEmpty (guid_str) && !String.IsNullOrEmpty (config_str) &&
- TryParseGuid (guid_str, out guid))
+ if (TryParseGuid (guid_str, out guid))
guidToConfigPlatform [guid] = config_str;
+
+ if (!String.IsNullOrEmpty (abs_path)) {
+ abs_path = Path.GetFullPath (abs_path);
+ absolutePathToConfigPlatform [abs_path] = config_str;
+ }
}
} catch (XmlException xe) {
Log.LogError ("XmlException while parsing SolutionConfigurationContents: {0}",
List<ITaskItem> tempAssignedProjects = new List<ITaskItem> ();
List<ITaskItem> tempUnassignedProjects = new List<ITaskItem> ();
foreach (ITaskItem item in ProjectReferences) {
- string config;
-
- string guid_str = item.GetMetadata ("Project");
+ string config = GetConfigPlatformFromProjectReference (item);
- Guid guid = Guid.Empty;
- if (!string.IsNullOrEmpty(guid_str) && !TryParseGuid (guid_str, out guid)) {
- Log.LogError ("Project reference '{0}' has invalid or missing guid for metadata 'Project'.",
- item.ItemSpec);
- return false;
+ if (String.IsNullOrEmpty (config)) {
+ tempUnassignedProjects.Add (item);
+ continue;
}
- if (guid != Guid.Empty && guidToConfigPlatform.TryGetValue (guid, out config)) {
- string [] parts = config.Split (new char [] {'|'}, 2);
+ string [] parts = config.Split (new char [] {'|'}, 2);
- ITaskItem new_item = new TaskItem (item);
+ ITaskItem new_item = new TaskItem (item);
- new_item.SetMetadata ("SetConfiguration", "Configuration=" + parts [0]);
- new_item.SetMetadata ("SetPlatform", "Platform=" +
- ((parts.Length > 1) ? parts [1] : String.Empty));
+ new_item.SetMetadata ("SetConfiguration", "Configuration=" + parts [0]);
+ new_item.SetMetadata ("SetPlatform", "Platform=" +
+ ((parts.Length > 1) ? parts [1] : String.Empty));
- tempAssignedProjects.Add (new_item);
- } else {
- Log.LogWarning ("Project reference '{0}' could not be resolved.",
- item.ItemSpec);
- tempUnassignedProjects.Add (item);
- }
+ tempAssignedProjects.Add (new_item);
}
assignedProjects = tempAssignedProjects.ToArray ();
return true;
}
+ string GetConfigPlatformFromProjectReference (ITaskItem item)
+ {
+ string guid_str = item.GetMetadata ("Project");
+ string proj_full_path = item.GetMetadata ("FullPath");
+
+ string config;
+ Guid guid = Guid.Empty;
+ if (TryParseGuid (guid_str, out guid) && guidToConfigPlatform.TryGetValue (guid, out config))
+ return config;
+
+ string abs_path = item.GetMetadata ("FullPath");
+ if (absolutePathToConfigPlatform.TryGetValue (abs_path, out config))
+ return config;
+
+ return null;
+ }
+
bool TryParseGuid (string guid_str, out Guid guid)
{
guid = Guid.Empty;
+ if (String.IsNullOrEmpty (guid_str))
+ return false;
+
try {
guid = new Guid (guid_str);
} catch (ArgumentNullException) {
var cscParams = new CompilerParameters ();
cscParams.ReferencedAssemblies.Add ("Microsoft.Build.Framework.dll");
cscParams.ReferencedAssemblies.Add ("Microsoft.Build.Utilities.v4.0.dll"); // since we use Task, it depends on this dll.
- cscParams.ReferencedAssemblies.AddRange (references.ToArray ());
+ cscParams.ReferencedAssemblies.AddRange (GetReferences (references, taskFactoryLoggingHost));
cscParams.GenerateInMemory = true;
var results = CodeDomProvider.CreateProvider (language).CompileAssemblyFromDom (cscParams, ccu);
var errors = new CompilerError [results.Errors.Count];
assembly = results.CompiledAssembly;
return true;
}
+
+ static string[] GetReferences (List<string> references, IBuildEngine log)
+ {
+ var res = new List<string> ();
+ foreach (var r in references) {
+ if (File.Exists (r)) {
+ res.Add (r);
+ continue;
+ }
+
+ Assembly assembly = null;
+
+ try {
+ if (!r.EndsWith (".dll", StringComparison.OrdinalIgnoreCase) || !r.EndsWith (".exe", StringComparison.OrdinalIgnoreCase)) {
+ assembly = Assembly.LoadWithPartialName (r);
+ }
+
+ if (assembly != null) {
+ res.Add (assembly.Location);
+ continue;
+ }
+ } catch {
+ }
+
+ log.LogErrorEvent (new BuildErrorEventArgs ("", "", "", 0, 0, 0, 0, "Assembly reference {r} could not be resolved", "", ""));
+ }
+
+ return res.ToArray ();
+ }
+
public string FactoryName {
get { return "Code Task Factory"; }
}
using Microsoft.Build.Tasks;
using Microsoft.Build.Utilities;
using NUnit.Framework;
+using System.IO;
using System.Text;
namespace MonoTests.Microsoft.Build.Tasks
"{DAE34193-B5C7-4488-A911-29EE15C84CBE}"
};
- CreateAndCheckProject (guids, project_ref_guids, new string[] {
- "AssignedProjects : foo0.csproj;foo1.csproj;foo2.csproj;foo3.csproj: SetConfig: Configuration=Release",
+ CreateAndCheckProject (guids, new bool[] {true, true, true, true, true, true},
+ project_ref_guids, new string[] {
+ "AssignedProjects : foo0.csproj;foo1.csproj;foo2.csproj;foo3.csproj;foo4.csproj: SetConfig: Configuration=Release",
"AssignedProjects : foo0.csproj: SetPlatform: Platform=AnyCPU0",
"AssignedProjects : foo1.csproj: SetPlatform: Platform=AnyCPU1",
"AssignedProjects : foo2.csproj: SetPlatform: Platform=AnyCPU2",
"AssignedProjects : foo3.csproj: SetPlatform: Platform=AnyCPU3",
- "UnassignedProjects : foo4.csproj"},
+ "AssignedProjects : foo4.csproj: SetPlatform: Platform=AnyCPU4",
+ "UnassignedProjects : "},
true,
"A1#");
}
[Test]
- public void TestInvalidProjectGuid ()
+ public void TestNoGuidAndNoAbsolutePathFound()
{
string[] guids = new string[] {
+ "asd"
+ };
+
+ string[] project_ref_guids = new string[] {
+ "{DAE34193-B5C7-4488-A911-29EE15C84CB8}",
+ "invalid guid",
+ ""
+ };
+
+ CreateAndCheckProject (guids, new bool[]{false},
+ project_ref_guids,
+ new string[] {
+ "AssignedProjects : : SetConfig: ",
+ "AssignedProjects : : SetPlatform: ",
+ "UnassignedProjects : foo0.csproj;foo1.csproj;foo2.csproj"
+ },
+ true, "A1#");
+ }
+
+ [Test]
+ public void TestInvalidProjectGuidWithAbsolutePath ()
+ {
+ string[] guids = new string[] {
+ null, // no AbsPath
+ "another invalid guid", // has AbsPath
+ };
+
+ string[] project_ref_guids = new string[] {
+ "1234zxc", // this won't match because no AbsPath
+ "xzxoiu", // match with the second project, foo1.csproj
"{23F291D9-78DF-4133-8CF2-78CE104DDE63}",
+ "badref" // no corresponding project at all
+ };
+
+ CreateAndCheckProject (guids, new bool[]{false, true},
+ project_ref_guids,
+ new string[] {
+ "AssignedProjects : foo1.csproj: SetConfig: Configuration=Release",
+ "AssignedProjects : foo1.csproj: SetPlatform: Platform=AnyCPU1",
+ "UnassignedProjects : foo0.csproj;foo2.csproj;foo3.csproj"
+ },
+ true, "A1#");
+ }
+
+ [Test]
+ public void TestNoGuidWithAbsolutePath ()
+ {
+ string[] guids = new string[] {
+ "",
+ null
};
string[] project_ref_guids = new string[] {
"invalid guid"
};
- CreateAndCheckProject (guids, project_ref_guids, null, false, "A1#");
+ CreateAndCheckProject (guids, new bool[]{true, false},
+ project_ref_guids,
+ new string[] {
+ "AssignedProjects : foo0.csproj: SetConfig: Configuration=Release",
+ "AssignedProjects : foo0.csproj: SetPlatform: Platform=AnyCPU0",
+ "UnassignedProjects : foo1.csproj;foo2.csproj"
+ },
+ true, "A1#");
}
[Test]
"{23F291D9-78DF-4133-8CF2-78CE104DDE63}"
};
- CreateAndCheckProject (guids, project_ref_guids,
+ CreateAndCheckProject (guids, new bool[]{false, true},
+ project_ref_guids,
new string [] {
"AssignedProjects : foo1.csproj: SetConfig: Configuration=Release",
"AssignedProjects : foo1.csproj: SetPlatform: Platform=AnyCPU0",
}
- void CreateAndCheckProject (string[] guids, string[] project_ref_guids, string[] messages, bool build_result, string prefix)
+ void CreateAndCheckProject (string[] guids, bool[] set_project_paths, string[] project_ref_guids, string[] messages, bool build_result, string prefix)
{
Engine engine = new Engine (Consts.BinPath);
Project project = engine.CreateNewProject ();
TestMessageLogger testLogger = new TestMessageLogger ();
engine.RegisterLogger (testLogger);
- string projectString = CreateProject (guids, project_ref_guids);
+ string projectString = CreateProject (guids, set_project_paths, project_ref_guids);
project.LoadXml (projectString);
try {
}
}
- string CreateProject (string[] guids, string[] project_ref_guids)
+ string CreateProject (string[] guids, bool[] set_project_paths, string[] project_ref_guids)
{
StringBuilder sb = new StringBuilder ();
sb.Append (@"<Project xmlns=""http://schemas.microsoft.com/developer/msbuild/2003"">");
sb.Append ("\n" + GetUsingTask ("AssignProjectConfiguration"));
- sb.AppendFormat (@"<PropertyGroup>{0}</PropertyGroup>", CreateSolutionConfigurationProperty (guids, "Release|AnyCPU"));
+ sb.AppendFormat (@"<PropertyGroup>{0}</PropertyGroup>", CreateSolutionConfigurationProperty (guids, set_project_paths, "Release|AnyCPU"));
sb.Append (CreateProjectReferencesItemGroup (project_ref_guids));
sb.Append ("\n\t<Target Name=\"1\">\n");
return sb.ToString ();
}
- string CreateSolutionConfigurationProperty (string[] guids, string config_str)
+ string CreateSolutionConfigurationProperty (string[] guids, bool[] set_project_paths, string config_str)
{
+ string abs_proj_path_prefix = Path.GetFullPath ("foo");
StringBuilder sb = new StringBuilder ();
sb.Append ("\n<CurrentSolutionConfigurationContents>\n");
sb.Append ("\t<foo xmlns=\"\">\n");
for (int i = 0; i < guids.Length; i++) {
- sb.AppendFormat ("\t\t<bar Project=\"{0}\">{1}{2}</bar>\n",
+ sb.Append ("\t\t<bar");
+ if (guids[i] != null)
+ sb.AppendFormat (" Project=\"{0}\"", guids[i]);
+ if (set_project_paths[i])
+ sb.AppendFormat (" AbsolutePath=\"{0}{1}.csproj\" ", abs_proj_path_prefix, i);
+ sb.AppendFormat (">{1}{2}</bar>\n",
guids[i], config_str, i);
}
sb.Append ("\t</foo>\n");
{
StringBuilder sb = new StringBuilder ();
sb.Append ("\n<ItemGroup>\n");
- for (int i = 0; i < guids.Length; i ++)
- sb.AppendFormat ("\t<ProjectReference Include=\"foo{1}.csproj\"><Project>{0}</Project></ProjectReference>\n", guids [i], i);
+ for (int i = 0; i < guids.Length; i ++) {
+ sb.AppendFormat ("\t<ProjectReference Include=\"foo{0}.csproj\">", i);
+ if (guids[i] != null)
+ sb.AppendFormat ("<Project>{0}</Project>", guids[i]);
+ sb.Append ("</ProjectReference>\n");
+ }
sb.Append ("</ItemGroup>\n");
return sb.ToString ();
}
LIBRARY = Microsoft.Build.Utilities.dll
LIBRARY_NAME = Microsoft.Build.Utilities$(NAME_SUFFIX).dll
-LIB_REFS = System System.Core System.Xml
-LIB_MCS_FLAGS = \
- /r:$(corlib) \
- /r:System.dll \
- /r:System.Core.dll \
- /r:System.Xml.dll \
- /r:$(XBUILD_FRAMEWORK)
+LIB_REFS = $(PARENT_PROFILE)System $(PARENT_PROFILE)System.Core $(PARENT_PROFILE)System.Xml $(XBUILD_FRAMEWORK)
+LIB_MCS_FLAGS =
TEST_RESX_RESOURCES = Test/Microsoft.Build.Utilities/Strings.resources
-TEST_MCS_FLAGS = /r:$(XBUILD_ENGINE) /r:$(XBUILD_FRAMEWORK) -r:System.dll -r:System.Core.dll $(TEST_RESX_RESOURCES:%=-resource:%)
+TEST_LIB_REFS = $(XBUILD_ENGINE) $(XBUILD_FRAMEWORK) $(PARENT_PROFILE)System $(PARENT_PROFILE)System.Core
+TEST_MCS_FLAGS = $(TEST_RESX_RESOURCES:%=-resource:%)
include $(XBUILD_DIR)/xbuild_test.make
include ../../build/library.make
CLEAN_FILES += $(TEST_RESX_RESOURCES)
+.NOTPARALLEL: $(TEST_RESX_RESOURCES)
+
$(TEST_RESX_RESOURCES): %.resources: %.resx
$(RESGEN) $< || cp $@.prebuilt $@
LIBRARY = Microsoft.Build.dll
-LIB_REFS = System System.Core System.Xml Microsoft.Build.Engine Microsoft.Build.Framework
+LIB_REFS = $(PARENT_PROFILE)System $(PARENT_PROFILE)System.Core $(PARENT_PROFILE)System.Xml Microsoft.Build.Engine Microsoft.Build.Framework
LIB_MCS_FLAGS = \
- /r:$(corlib) \
- /r:System.dll \
- /r:System.Core.dll \
- /r:System.Xml.dll \
- /r:Microsoft.Build.Engine.dll \
- /r:Microsoft.Build.Framework.dll \
/d:MICROSOFT_BUILD_DLL
-TEST_MCS_FLAGS = $(LIB_MCS_FLAGS) \
- /r:Microsoft.Build.Utilities.v4.0.dll
+TEST_MCS_FLAGS = $(LIB_MCS_FLAGS)
+TEST_LIB_REFS = $(XBUILD_UTILITIES)
EXTRA_DISTFILES = \
Microsoft.Build.Internal/ExpressionParser.jay \
LIBRARY = Microsoft.VisualC.dll
LIB_REFS = System
-LIB_MCS_FLAGS = /r:$(corlib)
+LIB_MCS_FLAGS =
NO_TEST = yes
include ../../build/library.make
LIBRARY = Mono.C5.dll
LIBRARY_SNK = c5.snk
LIB_REFS = System
-LIB_MCS_FLAGS = /r:$(corlib) -nowarn:169,219,414,1030,3001,3005,3006
+LIB_MCS_FLAGS = -nowarn:169,219,414,1030,3001,3005,3006
TEST_MCS_FLAGS = $(LIB_MCS_FLAGS) -nowarn:0618 -nowarn:219 -nowarn:169
EXTRA_DISTFILES = \
// You can specify all the values or you can default the Revision and Build Numbers
// by using the '*' as shown below:
-[assembly: AssemblyVersion("1.0.*")]
+[assembly: AssemblyVersion("1.0.0.0")]
//
// In order to sign your assembly you must specify a key to use. Refer to the
REFERENCE_SOURCES_FLAGS += -d:MONO_FEATURE_THREAD_ABORT
endif
-TEST_MCS_FLAGS = -r:System.Core.dll
+TEST_MCS_FLAGS =
+TEST_LIB_REFS = System.Core
LIB_MCS_FLAGS += $(REFERENCE_SOURCES_FLAGS)
include ../../build/library.make
+$(topdir)/mcs/cs-parser.cs:
+ $(MAKE) -C $(topdir)/mcs cs-parser.cs
+
+$(the_lib): $(topdir)/mcs/cs-parser.cs
LIBRARY_PACKAGE = none
LIB_REFS = System Mono.Cecil
-LIB_MCS_FLAGS = /r:$(corlib) /d:CECIL -keyfile:$(LIBRARY_SNK)
+LIB_MCS_FLAGS = /d:CECIL -keyfile:$(LIBRARY_SNK) -publicsign
NO_TEST = yes
NO_INSTALL = yes
LIBRARY_PACKAGE = none
LIB_REFS = System.Core
-LIB_MCS_FLAGS = /r:$(corlib) -keyfile:$(LIBRARY_SNK) -d:NET_3_5
+LIB_MCS_FLAGS = -keyfile:$(LIBRARY_SNK) -d:NET_3_5 /publicsign
NO_TEST = yes
LIB_REFS = System System.Core Mono.Cecil Mono.Cecil.Mdb
LIB_MCS_FLAGS =
-#-r:Mono.Cecil.Pdb.dll
-TEST_MCS_FLAGS = -r:System.Core.dll -debug
+TEST_MCS_FLAGS =
+TEST_LIB_REFS = System.Core
include ../../build/library.make
LIBRARY = Mono.Data.Tds.dll
LIB_REFS = System System.Xml Mono.Security
-LIB_MCS_FLAGS = /r:$(corlib)
+LIB_MCS_FLAGS =
-TEST_MCS_FLAGS = /r:System.dll /r:System.Net.dll
+TEST_MCS_FLAGS =
+TEST_LIB_REFS = System System.Net
include ../../build/library.make
LIBRARY_SNK = ../mono.snk
LIB_REFS = System Mono.Cecil System.Core
-LIB_MCS_FLAGS = /r:$(corlib) /unsafe -D:MONO_DATACONVERTER_STATIC_METHODS -keyfile:$(LIBRARY_SNK)
+LIB_MCS_FLAGS = /unsafe -D:MONO_DATACONVERTER_STATIC_METHODS -keyfile:$(LIBRARY_SNK) /publicsign
-TEST_MCS_FLAGS = /r:Mono.Cecil.dll /r:System.dll /r:System.Core.dll
+TEST_MCS_FLAGS =
+TEST_LIB_REFS = Mono.Cecil System System.Core
VALID_TEST_PROFILE := $(filter net_4_x, $(PROFILE))
test-local: dtest-app.exe dtest-excfilter.exe
dtest-app.exe: Test/dtest-app.cs
- $(CSCOMPILE) -out:$@ -unsafe -debug -optimize- Test/dtest-app.cs
+ $(CSCOMPILE) -r:$(topdir)/class/lib/$(PROFILE)/System.Core.dll -r:$(topdir)/class/lib/$(PROFILE)/System.dll -out:$@ -unsafe $(PLATFORM_DEBUG_FLAGS) -optimize- Test/dtest-app.cs
dtest-excfilter.exe: Test/dtest-excfilter.il
MONO_PATH=$(topdir)/class/lib/$(PROFILE) $(INTERNAL_ILASM) -out:$@ /exe /debug Test/dtest-excfilter.il
endif
-CLEAN_FILES = dtest-app.exe dtest-app.exe.mdb dtest-excfilter.exe dtest-excfilter.exe.mdb
+CLEAN_FILES = dtest-app.exe dtest-app.exe.mdb dtest-app.pdb dtest-excfilter.exe dtest-excfilter.exe.mdb dtest-excfilter.pdb
EXTRA_DISTFILES = \
Test/dtest-app.cs \
LIBRARY = Mono.Directory.LDAP.dll
LIB_REFS = System System.Data
-LIB_MCS_FLAGS = /r:$(corlib)
+LIB_MCS_FLAGS =
include ../../build/library.make
LIBRARY = Mono.Dynamic.Interpreter.dll
-LIB_REFS = System System.Core
+LIB_REFS = System
LIB_MCS_FLAGS = \
-d:FEATURE_CORE_DLR,FEATURE_DBNULL,FEATURE_DEFAULT_PARAMETER_VALUE,FEATURE_GET_TYPE_INFO,FEATURE_VARIANCE,FEATURE_SERIALIZATION,CLR45 \
-d:MONO_INTERPRETER \
ifdef MOBILE_STATIC
mono_dynamic_interpreter_deps = $(the_libdir_base)plaincore/System.Core.dll
-LIB_MCS_FLAGS += -lib:$(the_libdir_base)plaincore
+LIB_REFS += plaincore/System.Core
+else
+LIB_REFS += System.Core
endif
include ../../build/library.make
LIBRARY = Mono.Http.dll
LIB_REFS = System System.Xml System.Web ICSharpCode.SharpZipLib Mono.Security
-LIB_MCS_FLAGS = -r:$(corlib) \
- -nowarn:618
+LIB_MCS_FLAGS = -nowarn:618
NO_TEST = yes
LIBRARY = Mono.Management.dll
LIB_REFS = System Mono.Posix
-LIB_MCS_FLAGS = /r:$(corlib)
+LIB_MCS_FLAGS =
NO_TEST = yes
include ../../build/library.make
LIB_REFS = System System.Messaging Mono.Messaging RabbitMQ.Client
LIB_MCS_FLAGS = -nowarn:618
-TEST_MCS_FLAGS = $(LIB_MCS_FLAGS) -nowarn:0618 -nowarn:219 -nowarn:169 \
- /r:nunit.mocks.dll
+TEST_MCS_FLAGS = $(LIB_MCS_FLAGS) -nowarn:0618 -nowarn:219 -nowarn:169
+TEST_LIB_REFS = nunit.mocks
include ../../build/library.make
LIB_REFS = System System.Configuration
LIB_MCS_FLAGS =
-TEST_MCS_FLAGS = $(LIB_MCS_FLAGS) -nowarn:0618 -nowarn:219 -nowarn:169 /r:System.Messaging.dll /r:nunit.mocks.dll
+TEST_MCS_FLAGS = $(LIB_MCS_FLAGS) -nowarn:0618 -nowarn:219 -nowarn:169
+TEST_LIB_REFS = System.Messaging nunit.mocks
include ../../build/library.make
NO_INSTALL = yes
LIB_REFS = System
-LIB_MCS_FLAGS = /r:$(corlib)
-TEST_MCS_FLAGS = /r:Mono.Posix.dll /r:System.dll /r:System.Core.dll
+LIB_MCS_FLAGS =
+TEST_MCS_FLAGS =
+TEST_LIB_REFS = Mono.Posix System System.Core
mono_sourcelibs_DIR = $(DESTDIR)$(mono_libdir)/mono-source-libs
mono_options_DATA = Mono.Options/Options.cs
try {
if (value != null) {
#if PCL
- t = (T) Convert.ChangeType (value, targetType);
+ if (targetType.GetTypeInfo ().IsEnum)
+ t = (T) Enum.Parse (targetType, value, true);
+ else
+ t = (T) Convert.ChangeType (value, targetType);
#else
TypeConverter conv = TypeDescriptor.GetConverter (targetType);
t = (T) conv.ConvertFromString (value);
p, v => { v.Parse (_("-n=")); });
}
+ [Test]
+ public void EnumValues ()
+ {
+ DayOfWeek a = 0;
+ OptionSet p = new OptionSet () {
+ { "a=", (DayOfWeek v) => a = v },
+ };
+ p.Parse (_ ("-a=Monday"));
+ Assert.AreEqual (a, DayOfWeek.Monday);
+ p.Parse (_ ("-a=tuesday"));
+ Assert.AreEqual (a, DayOfWeek.Tuesday);
+ p.Parse (_ ("-a=3"));
+ Assert.AreEqual (a, DayOfWeek.Wednesday);
+ p.Parse (_ ("-a=Monday,Tuesday"));
+ Assert.AreEqual (a, DayOfWeek.Monday | DayOfWeek.Tuesday);
+ Utils.AssertException (typeof (OptionException),
+ "Could not convert string `Noday' to type DayOfWeek for option `-a'.",
+ p, v => { v.Parse (_ ("-a=Noday")); });
+ }
+
[Test]
public void BooleanValues ()
{
include ../../build/library.make
-TEST_MCS_FLAGS = /r:System.Core.dll
+TEST_MCS_FLAGS =
+TEST_LIB_REFS = System.Core
LIB_REFS += System.Core System
-LIB_MCS_FLAGS += -d:INSIDE_MONO_PARALLEL -r:$(corlib)
+LIB_MCS_FLAGS += -d:INSIDE_MONO_PARALLEL
# Don't warn about [Obsolete] members, as there are now *lots* of [Obsolete]
# members, generating volumes of output.
LIB_REFS = System
-LIB_MCS_FLAGS = /unsafe /r:$(corlib) /nowarn:0618,612
-TEST_MCS_FLAGS = /unsafe /r:Mono.Posix.dll /r:System.dll /nowarn:0219,0618
+LIB_MCS_FLAGS = /unsafe /nowarn:0618,612
+TEST_MCS_FLAGS = /unsafe /nowarn:0219,0618
+TEST_LIB_REFS = Mono.Posix System
LIBRARY_COMPILE = $(BOOT_COMPILE)
include ../../build/rules.make
LIBRARY = Mono.Security.Providers.NewTls.dll
-LIB_MCS_FLAGS = -unsafe -nowarn:1030 -keyfile:../mono.pub -delaysign -r:System.dll \
- -r:NewSystemSource=Mono.Security.Providers.NewSystemSource.dll -r:Mono.Security.dll
+LIB_REFS = System NewSystemSource=Mono.Security.Providers.NewSystemSource Mono.Security
+LIB_MCS_FLAGS = -unsafe -nowarn:1030 -keyfile:../mono.pub -delaysign
include ../../build/library.make
[assembly: InternalsVisibleTo ("Mono.Security.Providers.OldTls, PublicKey=002400000480000094000000060200000024000052534131000400000100010079159977d2d03a8e6bea7a2e74e8d1afcc93e8851974952bb480a12c9134474d04062447c37e0e68c080536fcf3c3fbe2ff9c979ce998475e506e8ce82dd5b0f350dc10e93bf2eeecf874b24770c5081dbea7447fddafa277b22de47d6ffea449674a4f9fccf84d15069089380284dbdd35f46cdff12a1bd78e4ef0065d016df")]
[assembly: InternalsVisibleTo ("Mono.Security.Providers.DotNet, PublicKey=002400000480000094000000060200000024000052534131000400000100010079159977d2d03a8e6bea7a2e74e8d1afcc93e8851974952bb480a12c9134474d04062447c37e0e68c080536fcf3c3fbe2ff9c979ce998475e506e8ce82dd5b0f350dc10e93bf2eeecf874b24770c5081dbea7447fddafa277b22de47d6ffea449674a4f9fccf84d15069089380284dbdd35f46cdff12a1bd78e4ef0065d016df")]
[assembly: InternalsVisibleTo ("Mono.Security.Providers.NewSystemSource, PublicKey=002400000480000094000000060200000024000052534131000400000100010079159977d2d03a8e6bea7a2e74e8d1afcc93e8851974952bb480a12c9134474d04062447c37e0e68c080536fcf3c3fbe2ff9c979ce998475e506e8ce82dd5b0f350dc10e93bf2eeecf874b24770c5081dbea7447fddafa277b22de47d6ffea449674a4f9fccf84d15069089380284dbdd35f46cdff12a1bd78e4ef0065d016df")]
+[assembly: InternalsVisibleTo ("Xamarin.BoringTls, PublicKey=002400000480000094000000060200000024000052534131000400001100000099dd12eda85767ae6f06023ee28e711c7e5a212462095c83868c29db75eddf6d8e296e03824c14fedd5f55553fed0b6173be3cc985a4b7f9fb7c83ccff8ba3938563b3d1f45a81122f12a1bcb73edcaad61a8456c7595a6da5184b4dd9d10f011b949ef1391fccfeab1ba62aa51c267ef8bd57ef1b6ba5a4c515d0badb81a78f")]
LIBRARY = Mono.Security.dll
LOCAL_MCS_FLAGS = -lib:$(the_libdir_base)bare
-LIB_REFS = System
+LIB_REFS = bare/System
LIB_MCS_FLAGS = -unsafe -nowarn:1030,3009
TEST_MCS_FLAGS = $(LIB_MCS_FLAGS) -nowarn:169,219,618,672
* If @serverMode is true, then we're a server and want to validate a certificate that we received from a client.
*/
ValidationResult ValidateCertificate (string targetHost, bool serverMode, X509CertificateCollection certificates);
+ }
+
+ internal interface ICertificateValidator2 : ICertificateValidator
+ {
+ /*
+ * Internal use only.
+ */
+ ValidationResult ValidateCertificate (string targetHost, bool serverMode, X509Certificate leaf, X509Chain chain);
/*
* On OS X and Mobile, the @chain will be initialized with the @certificates, but not actually built.
get { return supportsTrustAnchors; }
}
- static ICertificateValidator GetDefaultValidator (MonoTlsProvider provider, MonoTlsSettings settings)
+ static ICertificateValidator2 GetDefaultValidator (MonoTlsProvider provider, MonoTlsSettings settings)
{
- return (ICertificateValidator)NoReflectionHelper.GetDefaultCertificateValidator (provider, settings);
+ return (ICertificateValidator2)NoReflectionHelper.GetDefaultCertificateValidator (provider, settings);
}
/*
* Internal API, intended to be used by MonoTlsProvider implementations.
*/
- public static ICertificateValidator GetValidator (MonoTlsProvider provider, MonoTlsSettings settings)
+ internal static ICertificateValidator2 GetValidator (MonoTlsProvider provider, MonoTlsSettings settings)
{
return GetDefaultValidator (provider, settings);
}
/*
* Allows a TLS provider to provide a custom system certificiate validator.
*/
- public virtual bool HasCustomSystemCertificateValidator {
+ internal virtual bool HasCustomSystemCertificateValidator {
get { return false; }
}
* Returns `true` if certificate validation has been performed and `false` to invoke the
* default system validator.
*/
- public virtual bool InvokeSystemCertificateValidator (
- ICertificateValidator validator, string targetHost, bool serverMode,
- X509CertificateCollection certificates, ref X509Chain chain, out bool success,
- ref MonoSslPolicyErrors errors, ref int status11)
+ internal virtual bool InvokeSystemCertificateValidator (
+ ICertificateValidator2 validator, string targetHost, bool serverMode,
+ X509CertificateCollection certificates, bool wantsChain, ref X509Chain chain,
+ out bool success, ref MonoSslPolicyErrors errors, ref int status11)
{
- success = false;
- return false;
+ throw new InvalidOperationException ();
}
#endregion
+++ /dev/null
-#include monotouch_opt_Mono.Security.dll.sources
+++ /dev/null
-#include monotouch_opt_Mono.Security.dll.sources
LIBRARY = Mono.Simd.dll
LIB_REFS = System.Core
-LIB_MCS_FLAGS = -r:$(corlib) /unsafe
-TEST_MCS_FLAGS = -r:Mono.Simd.dll
+LIB_MCS_FLAGS = /unsafe
NO_TEST = yes
LIBRARY = Mono.XBuild.Tasks.dll
-LIB_REFS = System System.Xml
-LIB_MCS_FLAGS = \
- /r:$(corlib) \
- /r:System.dll \
- /r:System.Xml.dll
+LIB_REFS = $(PARENT_PROFILE)System $(PARENT_PROFILE)System.Xml
+LIB_MCS_FLAGS =
include $(XBUILD_DIR)/xbuild_test.make
endif
LIB_REFS = System System.Xml
-LIB_MCS_FLAGS = $(SCARY_LIB) /unsafe /r:$(corlib)
+LIB_MCS_FLAGS = $(SCARY_LIB) /unsafe
TEST_MCS_FLAGS = $(LIB_MCS_FLAGS)
EXTRA_DISTFILES = \
LIB_REFS = System Mono.Security
LIB_MCS_FLAGS = \
-warn:1 -nowarn:612 \
- -r:$(corlib) \
- -r:System.dll \
- -r:Mono.Security.dll \
$(RESX_RES:%=/res:%)
include ../../build/library.make
LIBRARY = PEAPI.dll
LIB_REFS = System
-LIB_MCS_FLAGS = /r:$(corlib) -nowarn:414,618
+LIB_MCS_FLAGS = -nowarn:414,618
NO_TEST = yes
EXTRA_DISTFILES = README.txt
include ../../../../build/rules.make
PROGRAM = RabbitMQ.Client.Apigen.exe
-
-LOCAL_MCS_FLAGS = /r:System.dll \
- /r:System.Xml.dll \
- /main:RabbitMQ.Client.Apigen.Apigen
+LIB_REFS = System System.Xml
+LOCAL_MCS_FLAGS = /main:RabbitMQ.Client.Apigen.Apigen
include ../../../../build/executable.make
LIBRARY = System.Configuration.Install.dll
LIB_REFS = System System.Xml
-LIB_MCS_FLAGS = /r:$(corlib)
+LIB_MCS_FLAGS =
NO_TEST = yes
LIBRARY = System.Configuration.dll
-LOCAL_MCS_FLAGS = -lib:$(secxml_libdir) -lib:$(bare_libdir)
-test_remove = $(LOCAL_MCS_FLAGS)
-LIB_REFS = System System.Xml System.Security
-LIB_MCS_FLAGS = -r:$(corlib) -nowarn:618
-TEST_MCS_FLAGS = $(LIB_MCS_FLAGS)
+LOCAL_MCS_FLAGS =
+LIB_REFS = secxml/System bare/System.Xml System.Security
+LIB_MCS_FLAGS = -nowarn:618
+TEST_MCS_FLAGS =
+TEST_LIB_REFS = System.Xml System
include ../../build/library.make
LIBRARY = System.Data.OracleClient.dll
LIB_REFS = System System.Xml System.Data System.EnterpriseServices System.Drawing
-LIB_MCS_FLAGS = /r:$(corlib)
+LIB_MCS_FLAGS =
TEST_MCS_FLAGS = $(LIB_MCS_FLAGS) /nowarn:618
LIB_REFS += System.ServiceModel.Activation
endif
-TEST_MCS_FLAGS = -r:System.ServiceModel.dll -r:System.Core.dll
+TEST_MCS_FLAGS =
+TEST_LIB_REFS = System.ServiceModel System.Core
include ../../build/library.make
TXT_RESOURCE_STRINGS = ../../../external/referencesource/System.Data/system.data.txt
-TEST_MCS_FLAGS = $(LIB_MCS_FLAGS) -r:System.Core.dll -r:Mono.Data.Sqlite.dll -nowarn:618,169,612,219,168
+TEST_LIB_REFS = System.Core Mono.Data.Sqlite
+TEST_MCS_FLAGS = $(LIB_MCS_FLAGS) -nowarn:618,169,612,219,168
TEST_MONO_PATH = .
LIBRARY = System.Design.dll
-LIB_REFS = System System.Xml System.Web System.Windows.Forms System.Drawing Accessibility System.Data System.Configuration
-LIB_MCS_FLAGS = -r:$(corlib)
+LIB_REFS = System System.Xml plainweb/System.Web System.Windows.Forms System.Drawing Accessibility System.Data System.Configuration
+LIB_MCS_FLAGS =
-plainweb_dir = $(the_libdir_base)plainweb
-LOCAL_MCS_FLAGS = -lib:$(plainweb_dir)
-
-TEST_MCS_FLAGS = /r:System.dll -r:System.Drawing.dll -r:System.Windows.Forms
+TEST_LIB_REFS = System System.Drawing System.Windows.Forms
+TEST_MCS_FLAGS =
include ../../build/library.make
LIBRARY = System.DirectoryServices.dll
LIB_REFS = System Novell.Directory.Ldap
-LIB_MCS_FLAGS = /r:$(corlib)
+LIB_MCS_FLAGS =
TEST_MCS_FLAGS = $(LIB_MCS_FLAGS) -nowarn:0618 -nowarn:219 -nowarn:169
include ../../build/library.make
LIBRARY = System.Drawing.Design.dll
LIB_REFS = System System.Drawing System.Windows.Forms
-LIB_MCS_FLAGS = /r:$(corlib)
+LIB_MCS_FLAGS =
NO_TEST = yes
include ../../build/library.make
LIBRARY = System.Drawing.dll
LIB_REFS = System
-LIB_MCS_FLAGS = /unsafe /r:$(corlib) \
+LIB_MCS_FLAGS = /unsafe \
-resource:Assembly/Mono.ico,Mono.ico -resource:Assembly/Information.ico,Information.ico \
-resource:Assembly/Error.ico,Error.ico -resource:Assembly/Warning.ico,Warning.ico \
-resource:Assembly/Question.ico,Question.ico -resource:Assembly/Shield.ico,Shield.ico
+TEST_LIB_REFS = System.Drawing System.Runtime.Serialization.Formatters.Soap System.Xml
+
TEST_MCS_FLAGS = $(LIB_MCS_FLAGS) -define:TEST -resource:Test/resources/indexed.png,indexed.png \
- -r:System.Drawing.dll -r:System.Runtime.Serialization.Formatters.Soap.dll -r:System.Xml.dll \
-nowarn:0618 -nowarn:219 -nowarn:169
include ../../build/library.make
LIBRARY = System.EnterpriseServices.dll
LIB_REFS = System.Transactions
-LIB_MCS_FLAGS = /nowarn:0168 /nowarn:0162 /r:$(corlib)
+LIB_MCS_FLAGS = /nowarn:0168 /nowarn:0162
NO_TEST = yes
include ../../build/library.make
LIBRARY = System.IO.Compression.FileSystem.dll
LIB_REFS = System System.IO.Compression
LIB_MCS_FLAGS =
-TEST_MCS_FLAGS = /r:System.dll /r:System.Core.dll /r:System.IO.Compression.dll
+TEST_MCS_FLAGS =
+TEST_LIB_REFS = System System.Core System.IO.Compression
include ../../build/library.make
LIBRARY = System.IO.Compression.dll
LIB_REFS = System System.Core
LIB_MCS_FLAGS = /unsafe
-TEST_MCS_FLAGS = /r:System.dll /r:System.Core.dll
+TEST_MCS_FLAGS =
+TEST_LIB_REFS = System System.Core
include ../../build/library.make
SUBDIRS =
include ../../build/rules.make
-ifndef NO_SYSTEM_WEB_APPSERVICES_DEPENDENCY
-ifeq (4, $(FRAMEWORK_VERSION_MAJOR))
-OTHER_LIB_MCS_FLAGS = -r:System.Web.ApplicationServices.dll
-endif
-endif
-
LIBRARY = System.IdentityModel.dll
LIB_REFS = System System.Xml System.Security System.Configuration Mono.Security System.Runtime.Serialization
LIB_MCS_FLAGS = \
LIB_REFS += System.Web
endif
+
+ifndef NO_SYSTEM_WEB_APPSERVICES_DEPENDENCY
+ifeq (4, $(FRAMEWORK_VERSION_MAJOR))
+LIB_REFS += System.Web.ApplicationServices
+endif
+endif
+
TEST_MCS_FLAGS = $(LIB_MCS_FLAGS)
EXTRA_DISTFILES = \
LIBRARY = System.Management.dll
LIB_REFS = System System.Configuration.Install
-LIB_MCS_FLAGS = /r:$(corlib)
+LIB_MCS_FLAGS =
NO_TEST = yes
include ../../build/library.make
endif
LIB_MCS_FLAGS = /resource:System.Messaging/MessageQueue.resx
-TEST_MCS_FLAGS = $(LIB_MCS_FLAGS) -nowarn:0618 -nowarn:219 -nowarn:169 \
- /r:nunit.mocks.dll
+TEST_MCS_FLAGS = $(LIB_MCS_FLAGS) -nowarn:0618 -nowarn:219 -nowarn:169
+TEST_LIB_REFS = nunit.mocks
EXTRA_DISTFILES = System.Messaging/MessageQueue.resx
LIB_REFS = System.Net.Http System
LIB_MCS_FLAGS =
-TEST_MCS_FLAGS = -r:System.Net.Http.dll
+TEST_MCS_FLAGS =
+TEST_LIB_REFS = System.Net.Http
include ../../build/library.make
LIB_REFS = System.Core System
LIB_MCS_FLAGS = $(EXTRA_LIB_MCS_FLAGS)
-TEST_MCS_FLAGS = -r:System.dll -r:System.Core.dll
+TEST_LIB_REFS = System System.Core
+TEST_MCS_FLAGS =
include ../../build/library.make
LIBRARY = System.Reactive.Core.dll
LIB_REFS = System System.Core System.Reactive.Interfaces
LIB_MCS_FLAGS = \
- @more_build_args \
- -r:System.Reactive.Interfaces.dll
+ @more_build_args
ifeq (true, $(GENERATE_RESOURCES))
LIB_MCS_FLAGS += /define:GENERATING_RESOURCES
LIBRARY = System.Reactive.Linq.dll
LIB_REFS = System System.Core System.Reactive.Interfaces System.Reactive.Core
LIB_MCS_FLAGS = \
- @more_build_args \
- -r:System.Reactive.Core.dll
+ @more_build_args
ifeq (true, $(GENERATE_RESOURCES))
LIB_MCS_FLAGS += /define:GENERATING_RESOURCES
LIBRARY = System.Reactive.Observable.Aliases.dll
LIB_REFS = System System.Core System.Reactive.Interfaces System.Reactive.Core System.Reactive.Linq System.Reactive.Providers
LIB_MCS_FLAGS = \
- @more_build_args \
- -r:System.Reactive.Providers.dll
+ @more_build_args
ifeq (true, $(GENERATE_RESOURCES))
LIB_MCS_FLAGS += /define:GENERATING_RESOURCES
LIBRARY = System.Reactive.PlatformServices.dll
LIB_REFS = System System.Core System.Reactive.Interfaces System.Reactive.Core System.Reactive.Linq
LIB_MCS_FLAGS = \
- @more_build_args \
- -r:System.Reactive.Linq.dll
+ @more_build_args
ifeq (true, $(GENERATE_RESOURCES))
LIB_MCS_FLAGS += /define:GENERATING_RESOURCES
LIB_MCS_FLAGS += -d:NO_TASK_DELAY
endif
-TEST_MCS_FLAGS = $(LIB_MCS_FLAGS) -r:Mono.Reactive.Tests.dll
+TEST_MCS_FLAGS = $(LIB_MCS_FLAGS)
+TEST_LIB_REFS = Mono.Reactive.Tests
EXTRA_DISTFILES = more_build_args $(RESX_RESOURCES:.resources=.resx) $(PREBUILT)
LIBRARY = System.Reactive.Providers.dll
LIB_REFS = System System.Core System.Reactive.Interfaces System.Reactive.Core System.Reactive.Linq
LIB_MCS_FLAGS = \
- @more_build_args \
- -r:System.Reactive.Linq.dll
+ @more_build_args
ifeq (true, $(GENERATE_RESOURCES))
LIB_MCS_FLAGS += /define:GENERATING_RESOURCES
LIBRARY = System.Reactive.Runtime.Remoting.dll
LIB_REFS = System System.Core System.Reactive.Interfaces System.Reactive.Core System.Reactive.Linq
LIB_MCS_FLAGS = \
- @more_build_args \
- -r:System.Reactive.Linq.dll
+ @more_build_args
ifeq (2.1, $(FRAMEWORK_VERSION))
LIB_MCS_FLAGS += -d:NO_TASK_DELAY
LIBRARY = System.Reactive.Windows.Forms.dll
LIB_REFS = System System.Core System.Reactive.Interfaces System.Reactive.Core System.Reactive.Linq System.Windows.Forms
LIB_MCS_FLAGS = \
- @more_build_args \
- -r:System.Windows.Forms.dll
+ @more_build_args
ifeq (2.1, $(FRAMEWORK_VERSION))
LIB_MCS_FLAGS += -d:NO_TASK_DELAY -d:HAS_AWAIT
LIBRARY = System.Reactive.Windows.Threading.dll
LIB_REFS = System System.Core System.Reactive.Interfaces System.Reactive.Core System.Reactive.Linq WindowsBase
LIB_MCS_FLAGS = \
- @more_build_args \
- -r:WindowsBase.dll
+ @more_build_args
ifeq (true, $(GENERATE_RESOURCES))
LIB_MCS_FLAGS += /define:GENERATING_RESOURCES
LIBRARY = System.Runtime.Remoting.dll
LIB_REFS = System System.Xml System.Runtime.Serialization.Formatters.Soap
-LIB_MCS_FLAGS = /r:$(corlib)
+LIB_MCS_FLAGS =
ifndef NO_SYSTEM_WEB_DEPENDENCY
LIB_REFS += System.Web
endif
-TEST_MCS_FLAGS = $(LIB_MCS_FLAGS) -nowarn:618 /r:System.Runtime.Remoting.dll
+TEST_MCS_FLAGS = -nowarn:618
+TEST_LIB_REFS = System System.Xml
TEST_MONO_PATH = .
LIBRARY = System.Runtime.Serialization.Formatters.Soap.dll
LIB_REFS = System.Xml
-LIB_MCS_FLAGS = /r:$(corlib)
-TEST_MCS_FLAGS = $(LIB_MCS_FLAGS) -r:System.dll -nowarn:0618 -nowarn:219 -nowarn:169
+LIB_MCS_FLAGS =
+
+TEST_LIB_REFS = System
+TEST_MCS_FLAGS = $(LIB_MCS_FLAGS) -nowarn:0618 -nowarn:219 -nowarn:169
EXTRA_DISTFILES = \
README \
// You can specify all values by your own or you can build default build and revision\r
// numbers with the '*' character (the default):\r
\r
-[assembly: AssemblyVersion("1.0.*")]\r
+[assembly: AssemblyVersion("1.0.0.0")]\r
\r
// The following attributes specify the key for the sign of your assembly. See the\r
// .NET Framework documentation for more information about signing.\r
-d:NO_DYNAMIC_CODEGEN \
/nowarn:168,169,219,414 \
$(RESOURCE_FILES:%=/resource:%)
+TXT_RESOURCE_STRINGS = ../../../external/referencesource/System.Runtime.Serialization/System.Runtime.Serialization.txt
ifneq (2.1, $(FRAMEWORK_VERSION))
LIB_REFS += System.Data System.Configuration
Test/Resources/WSDL/collections.wsdl \
Test/Resources/WSDL/custom-collections.wsdl
-TEST_MCS_FLAGS = $(LIB_MCS_FLAGS) /r:System.ServiceModel.dll /r:System.Web.Services.dll \
- $(TEST_RESOURCE_FILES:%=/resource:%)
+TEST_MCS_FLAGS = $(LIB_MCS_FLAGS) $(TEST_RESOURCE_FILES:%=/resource:%)
+TEST_LIB_REFS = System.ServiceModel System.Web.Services
EXTRA_DISTFILES = $(RESOURCE_FILES) $(TEST_RESOURCE_FILES) \
Test/Resources/FrameworkTypes/* \
-using System.Globalization;
-
-#region "copy of ../../build/common/SR.cs"
-
-namespace System.Runtime.Serialization
+//
+// This file was generated by txt2sr tool
+//
+namespace System.Runtime.Serialization {
+partial class SR
{
- static partial class SR
- {
-
- internal static string GetString(string name, params object[] args)
- {
- return GetString (CultureInfo.InvariantCulture, name, args);
- }
-
- internal static string GetString(CultureInfo culture, string name, params object[] args) {
- return string.Format (culture, name, args);
- }
-
- internal static string GetString(string name)
- {
- return name;
- }
-
- internal static string GetString(CultureInfo culture, string name)
- {
- return name;
- }
+ public const string ArrayExceededSize = "Array length '{0}' provided by the get-only collection of type '{1}' is less than the number of array elements found in the input stream. Consider increasing the length of the array.";
+ public const string ArrayExceededSizeAttribute = "Array length '{0}' provided by Size attribute is not equal to the number of array elements '{1}' from namespace '{2}' found.";
+ public const string ArrayTypeIsNotSupported = "An internal error has occurred. '{0}[]' is not supported when generating code for serialization.";
+ public const string CannotDeserializeRefAtTopLevel = "Cannot deserialize since root element references unrecognized object with id '{0}'.";
+ public const string CannotLoadMemberType = "Cannot load member type '{0}'.";
+ public const string CannotSerializeObjectWithCycles = "Object graph for type '{0}' contains cycles and cannot be serialized if references are not tracked. Consider using the DataContractAttribute with the IsReference property set to true.";
+ public const string CanOnlyStoreIntoArgOrLocGot0 = "An internal error has occurred. Data can only be stored into ArgBuilder or LocalBuilder. Got: {0}.";
+ public const string CharIsInvalidPrimitive = "An internal error has occurred. Char is not a valid schema primitive and should be treated as int in DataContract.";
+ public const string CallbackMustReturnVoid = "Serialization Callback '{1}' in type '{0}' must return void.";
+ public const string CallbackParameterInvalid = "Serialization Callback '{1}' in type '{0}' must have a single parameter of type '{2}'.";
+ public const string CallbacksCannotBeVirtualMethods = "Virtual Method '{0}' of type '{1}' cannot be marked with '{2}' attribute.";
+ public const string CollectionMustHaveAddMethod = "Collection type '{0}' does not have a valid Add method.";
+ public const string CollectionMustHaveGetEnumeratorMethod = "Collection type '{0}' does not have a valid GetEnumerator method.";
+ public const string CollectionMustHaveItemType = "Collection type '{0}' must have a non-null item type.";
+ public const string CollectionTypeCannotBeBuiltIn = "{0} is a built-in type and cannot be a collection.";
+ public const string CollectionTypeCannotHaveDataContract = "{0} has DataContractAttribute attribute.";
+ public const string CollectionTypeDoesNotHaveAddMethod = "{0} does not have a valid Add method with parameter of type '{1}'.";
+ public const string CollectionTypeDoesNotHaveDefaultCtor = "{0} does not have a default constructor.";
+ public const string CollectionTypeHasMultipleDefinitionsOfInterface = "{0} has multiple definitions of interface '{1}'.";
+ public const string CollectionTypeIsNotIEnumerable = "{0} does not implement IEnumerable interface.";
+ public const string DataContractCacheOverflow = "An internal error has occurred. DataContract cache overflow.";
+ public const string DataContractNamespaceAlreadySet = "ContractNamespaceAttribute attribute maps CLR namespace '{2}' to multiple data contract namespaces '{0}' and '{1}'. You can map a CLR namespace to only one data contract namespace.";
+ public const string DataContractNamespaceIsNotValid = "DataContract namespace '{0}' is not a valid URI.";
+ public const string DataContractNamespaceReserved = "DataContract namespace '{0}' cannot be specified since it is reserved.";
+ public const string DataMemberOnEnumField = "Member '{0}.{1}' has DataMemberAttribute attribute. Use EnumMemberAttribute attribute instead.";
+ public const string DcTypeNotFoundOnDeserialize = "Element '{2}:{3}' contains data of the '{0}:{1}' data contract. The deserializer has no knowledge of any type that maps to this contract. Add the type corresponding to '{1}' to the list of known types - for example, by using the KnownTypeAttribute attribute or by adding it to the list of known types passed to DataContractSerializer.";
+ public const string DcTypeNotFoundOnSerialize = "Type '{0}' with data contract name '{1}:{2}' is not expected. Add any types not known statically to the list of known types - for example, by using the KnownTypeAttribute attribute or by adding them to the list of known types passed to DataContractSerializer.";
+ public const string DcTypeNotResolvedOnDeserialize = "Element '{2}:{3}' contains data from a type that maps to the name '{0}:{1}'. The deserializer has no knowledge of any type that maps to this name. Consider changing the implementation of the ResolveName method on your DataContractResolver to return a non-null value for name '{1}' and namespace '{0}'.";
+ public const string DeserializedObjectWithIdNotFound = "Deserialized object with reference id '{0}' not found in stream.";
+ public const string DupContractInKnownTypes = "Type '{0}' cannot be added to list of known types since another type '{1}' with the same data contract name '{2}:{3}' is already present.";
+ public const string DupKeyValueName = "The collection data contract type '{0}' specifies the same value '{1}' for both the KeyName and the ValueName properties. This is not allowed. Consider changing either the KeyName or the ValueName property.";
+ public const string DupEnumMemberValue = "Type '{2}' contains two members '{0}' 'and '{1}' with the same name '{3}'. Multiple members with the same name in one type are not supported. Consider changing one of the member names using EnumMemberAttribute attribute.";
+ public const string DupMemberName = "Type '{2}' contains two members '{0}' 'and '{1}' with the same data member name '{3}'. Multiple members with the same name in one type are not supported. Consider changing one of the member names using DataMemberAttribute attribute.";
+ public const string DuplicateAttribute = "Invalid Callback. Method '{3}' in type '{2}' has both '{0}' and '{1}'.";
+ public const string DuplicateCallback = "Invalid attribute. Both '{0}' and '{1}' in type '{2}' have '{3}'.";
+ public const string EncounteredWithNameNamespace = "{0}. Encountered '{1}' with name '{2}', namespace '{3}'.";
+ public const string EnumTypeCannotHaveIsReference = "Enum type '{0}' cannot have the IsReference setting of '{1}'. Either change the setting to '{2}', or remove it completely.";
+ public const string ErrorDeserializing = "There was an error deserializing the object {0}. {1}";
+ public const string ErrorInLine = "Error in line {0} position {1}.";
+ public const string ErrorIsStartObject = "There was an error checking start element of object {0}. {1}";
+ public const string ErrorSerializing = "There was an error serializing the object {0}. {1}";
+ public const string ErrorTypeInfo = "of type {0}";
+ public const string ErrorWriteEndObject = "There was an error writing end element of object {0}. {1}";
+ public const string ErrorWriteStartObject = "There was an error writing start element of object {0}. {1}";
+ public const string ExceededMaxItemsQuota = "Maximum number of items that can be serialized or deserialized in an object graph is '{0}'.";
+ public const string ExpectingElement = "Expecting element '{1}' from namespace '{0}'.";
+ public const string ExpectingElementAtDeserialize = "Expecting state '{0}' when ReadObject is called.";
+ public const string ExpectingEnd = "Expecting End'{0}'.";
+ public const string ExpectingState = "Expecting state '{0}'.";
+ public const string GenericNameBraceMismatch = "The data contract name '{0}' for type '{1}' has a curly brace '{{' that is not matched with a closing curly brace. Curly braces have special meaning in data contract names - they are used to customize the naming of data contracts for generic types.";
+ public const string GenericParameterNotValid = "In the data contract name for type '{1}', there are curly braces with '{0}' inside, which is an invalid value. Curly braces have special meaning in data contract names - they are used to customize the naming of data contracts for generic types. Based on the number of generic parameters this type has, the contents of the curly braces must either be a number between 0 and '{2}' to insert the name of the generic parameter at that index or the '#' symbol to insert a digest of the generic parameter namespaces.";
+ public const string InconsistentIsReference = "The IsReference setting for type '{0}' is '{1}', but the same setting for its parent class '{2}' is '{3}'. Derived types must have the same value for IsReference as the base type. Change the setting on type '{0}' to '{3}', or on type '{2}' to '{1}', or do not set IsReference explicitly.";
+ public const string IndexedPropertyCannotBeSerialized = "Property '{1}' in type '{0}' cannot be serialized because serialization of indexed properties is not supported.";
+ public const string InterfaceTypeCannotBeCreated = "Interface type '{0}' cannot be created. Consider replacing with a non-interface serializable type.";
+ public const string InvalidCollectionContractItemName = "Type '{0}' cannot have CollectionDataContractAttribute attribute ItemName set to null or empty string.";
+ public const string InvalidCollectionContractKeyName = "Type '{0}' cannot have CollectionDataContractAttribute attribute KeyName set to null or empty string.";
+ public const string InvalidCollectionContractKeyNoDictionary = "The collection data contract type '{0}' specifies '{1}' for the KeyName property. This is not allowed since the type is not IDictionary. Remove the setting for the KeyName property.";
+ public const string InvalidCollectionContractName = "Type '{0}' cannot have CollectionDataContractAttribute attribute Name set to null or empty string.";
+ public const string InvalidCollectionContractNamespace = "Type '{0}' cannot have CollectionDataContractAttribute attribute Namespace set to null.";
+ public const string InvalidCollectionContractValueName = "Type '{0}' cannot have CollectionDataContractAttribute attribute ValueName set to null or empty string.";
+ public const string InvalidCollectionContractValueNoDictionary = "The collection data contract type '{0}' specifies '{1}' for the ValueName property. This is not allowed since the type is not IDictionary. Remove the setting for the ValueName property.";
+ public const string InvalidCollectionDataContract = "Type '{0}' with CollectionDataContractAttribute attribute is an invalid collection type since it";
+ public const string InvalidCollectionType = "Type '{0}' is an invalid collection type since it";
+ public const string InvalidDataContractName = "Type '{0}' cannot have DataContractAttribute attribute Name set to null or empty string.";
+ public const string InvalidDataContractNamespace = "Type '{0}' cannot have DataContractAttribute attribute Namespace set to null.";
+ public const string InvalidDataMemberName = "Member '{0}' in type '{1}' cannot have DataMemberAttribute attribute Name set to null or empty string.";
+ public const string InvalidEnumMemberValue = "'{0}' in type '{1}' cannot have EnumMemberAttribute attribute Value set to null or empty string.";
+ public const string InvalidEnumValueOnRead = "Invalid enum value '{0}' cannot be deserialized into type '{1}'. Ensure that the necessary enum values are present and are marked with EnumMemberAttribute attribute if the type has DataContractAttribute attribute.";
+ public const string InvalidEnumValueOnWrite = "Enum value '{0}' is invalid for type '{1}' and cannot be serialized. Ensure that the necessary enum values are present and are marked with EnumMemberAttribute attribute if the type has DataContractAttribute attribute.";
+ public const string InvalidGetSchemaMethod = "Type '{0}' cannot have MethodName on XmlSchemaProviderAttribute attribute set to null or empty string.";
+ public const string InvalidGlobalDataContractNamespace = "CLR namespace '{0}' cannot have ContractNamespace set to null.";
+ public const string InvalidMember = "Member '{0}.{1}' cannot be serialized since it is neither a field nor a property, and therefore cannot be marked with the DataMemberAttribute attribute. Remove the DataMemberAttribute attribute from the '{1}' member.";
+ public const string InvalidNonNullReturnValueByIsAny = "Method '{0}.{1}()' returns a non-null value. The return value must be null since IsAny=true.";
+ public const string InvalidPrimitiveType = "Type '{0}' is not a valid serializable type.";
+ public const string InvalidReturnTypeOnGetSchemaMethod = "Method '{0}.{1}()' returns '{2}'. The return type must be compatible with '{3}'.";
+ public const string InvalidSizeDefinition = "Invalid Size '{0}'. Must be non-negative integer.";
+ public const string InvalidXmlDataContractName = "XML data contract Name for type '{0}' cannot be set to null or empty string.";
+ public const string InvalidXsIdDefinition = "Invalid Id '{0}'. Must not be null or empty.";
+ public const string InvalidXsRefDefinition = "Invalid Ref '{0}'. Must not be null or empty.";
+ public const string IsAnyCannotBeNull = "A null value cannot be serialized at the top level for IXmlSerializable root type '{0}' since its IsAny setting is 'true'. This type must write all its contents including the root element. Verify that the IXmlSerializable implementation is correct.";
+ public const string IsAnyCannotBeSerializedAsDerivedType = "An object of type '{0}' cannot be serialized at the top level for IXmlSerializable root type '{1}' since its IsAny setting is 'true'. This type must write all its contents including the root element. Verify that the IXmlSerializable implementation is correct.";
+ public const string IsAnyCannotHaveXmlRoot = "Type '{0}' cannot specify an XmlRootAttribute attribute because its IsAny setting is 'true'. This type must write all its contents including the root element. Verify that the IXmlSerializable implementation is correct.";
+ public const string IsNotAssignableFrom = "An internal error has occurred. '{0}' is not assignable from '{1}' - error generating code for serialization.";
+ public const string IsRequiredDataMemberOnIsReferenceDataContractType = "'{0}.{1}' has the IsRequired setting of '{2}. However, '{0}' has the IsReference setting of '{2}', because either it is set explicitly, or it is derived from a base class. Set IsRequired on '{0}.{1}' to false, or disable IsReference on '{0}'.";
+ public const string IXmlSerializableCannotHaveCollectionDataContract = "Type '{0}' cannot be IXmlSerializable and have CollectionDataContractAttribute attribute.";
+ public const string IXmlSerializableCannotHaveDataContract = "Type '{0}' cannot be IXmlSerializable and have DataContractAttribute attribute.";
+ public const string IXmlSerializableIllegalOperation = "This method cannot be called from IXmlSerializable implementations.";
+ public const string IXmlSerializableMissingEndElements = "IXmlSerializable.WriteXml method of type '{0}' did not close all open tags. Verify that the IXmlSerializable implementation is correct.";
+ public const string IXmlSerializableMustHaveDefaultConstructor = "IXmlSerializable Type '{0}' must have default constructor.";
+ public const string IXmlSerializableWritePastSubTree = "IXmlSerializable.WriteXml method of type '{0}' attempted to close too many tags. Verify that the IXmlSerializable implementation is correct.";
+ public const string KnownTypeAttributeEmptyString = "Method name specified by KnownTypeAttribute attribute on type '{0}' cannot be the empty string.";
+ public const string KnownTypeAttributeUnknownMethod = "KnownTypeAttribute attribute on type '{1}' specifies a method named '{0}' to provide known types. Static method '{0}()' was not found on this type. Ensure that the method exists and is marked as static.";
+ public const string KnownTypeAttributeReturnType = "KnownTypeAttribute attribute on type '{0}' specifies a method named '{1}' to provide known types. The return type of this method is invalid because it is not assignable to IEnumerable<Type>. Ensure that the method exists and has a valid signature.";
+ public const string KnownTypeAttributeOneScheme = "Type '{0}': If a KnownTypeAttribute attribute specifies a method it must be the only KnownTypeAttribute attribute on that type.";
+ public const string KnownTypeAttributeNoType = "KnownTypeAttribute attribute on type '{0}' contains no Type.";
+ public const string KnownTypeConfigClosedGenericDeclared = "Declared type '{0}' in config cannot be a closed or partial generic type.";
+ public const string KnownTypeAttributeValidMethodTypes = "Method specified by KnownTypeAttribute attribute on type '{0}' does not expose valid types.";
+ public const string KnownTypeAttributeNoData = "KnownTypeAttribute attribute on type '{0}' contains no data.";
+ public const string KnownTypeAttributeMethodNull = "Method specified by KnownTypeAttribute attribute on type '{0}' returned null.";
+ public const string MaxArrayLengthExceeded = "The maximum array length ({0}) has been exceeded while reading XML data for array of type '{1}'.";
+ public const string MissingGetSchemaMethod = "Type '{0}' does not have a static method '{1}' that takes a parameter of type 'System.Xml.Schema.XmlSchemaSet' as specified by the XmlSchemaProviderAttribute attribute.";
+ public const string MultipleIdDefinition = "Invalid XML encountered. The same Id value '{0}' is defined more than once. Multiple objects cannot be deserialized using the same Id.";
+ public const string NoConversionPossibleTo = "An internal error has occurred. No conversion is possible to '{0}' - error generating code for serialization.";
+ public const string NoGetMethodForProperty = "No get method for property '{1}' in type '{0}'.";
+ public const string NoSetMethodForProperty = "No set method for property '{1}' in type '{0}'.";
+ public const string NullKnownType = "One of the known types provided to the serializer via '{0}' argument was invalid because it was null. All known types specified must be non-null values.";
+ public const string NullValueReturnedForGetOnlyCollection = "The get-only collection of type '{0}' returned a null value. The input stream contains collection items which cannot be added if the instance is null. Consider initializing the collection either in the constructor of the the object or in the getter.";
+ public const string ObjectTableOverflow = "An internal error has occurred. Object table overflow. This could be caused by serializing or deserializing extremely large object graphs.";
+ public const string OrderCannotBeNegative = "Property 'Order' in DataMemberAttribute attribute cannot be a negative number.";
+ public const string ParameterCountMismatch = "Invalid number of parameters to call method '{0}'. Expected '{1}' parameters, but '{2}' were provided.";
+ public const string PartialTrustCollectionContractAddMethodNotPublic = "The collection data contract type '{0}' cannot be deserialized because the method '{1}' is not public. Making the method public will fix this error. Alternatively, you can make it internal, and use the InternalsVisibleToAttribute attribute on your assembly in order to enable serialization of internal members - see documentation for more details. Be aware that doing so has certain security implications.";
+ public const string PartialTrustCollectionContractNoPublicConstructor = "The collection data contract type '{0}' cannot be deserialized because it does not have a public parameterless constructor. Adding a public parameterless constructor will fix this error. Alternatively, you can make it internal, and use the InternalsVisibleToAttribute attribute on your assembly in order to enable serialization of internal members - see documentation for more details. Be aware that doing so has certain security implications.";
+ public const string PartialTrustCollectionContractTypeNotPublic = "The collection data contract type '{0}' cannot be deserialized because it does not have a public parameterless constructor. Adding a public parameterless constructor will fix this error. Alternatively, you can make it internal, and use the InternalsVisibleToAttribute attribute on your assembly in order to enable serialization of internal members - see documentation for more details. Be aware that doing so has certain security implications.";
+ public const string PartialTrustDataContractOnSerializingNotPublic = "The data contract type '{0}' cannot be serialized because the OnSerializing method '{1}' is not public. Making the method public will fix this error. Alternatively, you can make it internal, and use the InternalsVisibleToAttribute attribute on your assembly in order to enable serialization of internal members - see documentation for more details. Be aware that doing so has certain security implications.";
+ public const string PartialTrustDataContractOnSerializedNotPublic = "The data contract type '{0}' cannot be serialized because the OnSerialized method '{1}' is not public. Making the method public will fix this error. Alternatively, you can make it internal, and use the InternalsVisibleToAttribute attribute on your assembly in order to enable serialization of internal members - see documentation for more details. Be aware that doing so has certain security implications.";
+ public const string PartialTrustDataContractOnDeserializingNotPublic = "The data contract type '{0}' cannot be deserialized because the OnDeserializing method '{1}' is not public. Making the method public will fix this error. Alternatively, you can make it internal, and use the InternalsVisibleToAttribute attribute on your assembly in order to enable serialization of internal members - see documentation for more details. Be aware that doing so has certain security implications.";
+ public const string PartialTrustDataContractOnDeserializedNotPublic = "The data contract type '{0}' cannot be deserialized because the OnDeserialized method '{1}' is not public. Making the method public will fix this error. Alternatively, you can make it internal, and use the InternalsVisibleToAttribute attribute on your assembly in order to enable serialization of internal members - see documentation for more details. Be aware that doing so has certain security implications.";
+ public const string PartialTrustDataContractFieldGetNotPublic = "The data contract type '{0}' cannot be serialized because the member '{1}' is not public. Making the member public will fix this error. Alternatively, you can make it internal, and use the InternalsVisibleToAttribute attribute on your assembly in order to enable serialization of internal members - see documentation for more details. Be aware that doing so has certain security implications.";
+ public const string PartialTrustDataContractFieldSetNotPublic = "The data contract type '{0}' cannot be deserialized because the member '{1}' is not public. Making the member public will fix this error. Alternatively, you can make it internal, and use the InternalsVisibleToAttribute attribute on your assembly in order to enable serialization of internal members - see documentation for more details. Be aware that doing so has certain security implications.";
+ public const string PartialTrustDataContractPropertyGetNotPublic = "The data contract type '{0}' cannot be serialized because the property '{1}' does not have a public getter. Adding a public getter will fix this error. Alternatively, you can make it internal, and use the InternalsVisibleToAttribute attribute on your assembly in order to enable serialization of internal members - see documentation for more details. Be aware that doing so has certain security implications.";
+ public const string PartialTrustDataContractPropertySetNotPublic = "The data contract type '{0}' cannot be deserialized because the property '{1}' does not have a public setter. Adding a public setter will fix this error. Alternatively, you can make it internal, and use the InternalsVisibleToAttribute attribute on your assembly in order to enable serialization of internal members - see documentation for more details. Be aware that doing so has certain security implications.";
+ public const string PartialTrustDataContractTypeNotPublic = "The data contract type '{0}' is not serializable because it is not public. Making the type public will fix this error. Alternatively, you can make it internal, and use the InternalsVisibleToAttribute attribute on your assembly in order to enable serialization of internal members - see documentation for more details. Be aware that doing so has certain security implications.";
+ public const string PartialTrustNonAttributedSerializableTypeNoPublicConstructor = "The type '{0}' cannot be deserialized because it does not have a public parameterless constructor. Alternatively, you can make it internal, and use the InternalsVisibleToAttribute attribute on your assembly in order to enable serialization of internal members - see documentation for more details. Be aware that doing so has certain security implications.";
+ public const string PartialTrustIXmlSerializableTypeNotPublic = "The IXmlSerializable type '{0}' is not serializable in partial trust because it is not public. Adding a public parameterless constructor will fix this error. Alternatively, you can make it internal, and use the InternalsVisibleToAttribute attribute on your assembly in order to enable serialization of internal members - see documentation for more details. Be aware that doing so has certain security implications.";
+ public const string PartialTrustIXmlSerialzableNoPublicConstructor = "The IXmlSerializable type '{0}' cannot be deserialized because it does not have a public parameterless constructor. Adding a public parameterless constructor will fix this error. Alternatively, you can make it internal, and use the InternalsVisibleToAttribute attribute on your assembly in order to enable serialization of internal members - see documentation for more details. Be aware that doing so has certain security implications.";
+ public const string NonAttributedSerializableTypesMustHaveDefaultConstructor = "The Type '{0}' must have a parameterless constructor.";
+ public const string AttributedTypesCannotInheritFromNonAttributedSerializableTypes = "Type '{0}' cannot inherit from a type that is not marked with DataContractAttribute or SerializableAttribute. Consider marking the base type '{1}' with DataContractAttribute or SerializableAttribute, or removing them from the derived type.";
+ public const string GetOnlyCollectionsNotSupported = "Get-only collection properties are not supported. Consider adding a public setter to property '{0}.{1}' or marking the it with the IgnoreDataMemberAttribute.";
+ public const string QuotaMustBePositive = "Quota must be a positive value.";
+ public const string QuotaIsReadOnly = "The '{0}' quota is readonly.";
+ public const string QuotaCopyReadOnly = "Cannot copy XmlDictionaryReaderQuotas. Target is readonly.";
+ public const string RequiredMemberMustBeEmitted = "Member {0} in type {1} cannot be serialized. This exception is usually caused by trying to use a null value where a null value is not allowed. The '{0}' member is set to its default value (usually null or zero). The member's EmitDefault setting is 'false', indicating that the member should not be serialized. However, the member's IsRequired setting is 'true', indicating that it must be serialized. This conflict cannot be resolved. Consider setting '{0}' to a non-default value. Alternatively, you can change the EmitDefaultValue property on the DataMemberAttribute attribute to true, or changing the IsRequired property to false.";
+ public const string ResolveTypeReturnedFalse = "An object of type '{0}' which derives from DataContractResolver returned false from its TryResolveType method when attempting to resolve the name for an object of type '{1}', indicating that the resolution failed. Change the TryResolveType implementation to return true.";
+ public const string ResolveTypeReturnedNull = "An object of type '{0}' which derives from DataContractResolver returned a null typeName or typeNamespace but not both from its TryResolveType method when attempting to resolve the name for an object of type '{1}'. Change the TryResolveType implementation to return non-null values, or to return null values for both typeName and typeNamespace in order to serialize as the declared type.";
+ public const string SupportForMultidimensionalArraysNotPresent = "Multi-dimensional arrays are not supported.";
+ public const string TooManyCollectionContracts = "Type '{0}' has more than one CollectionDataContractAttribute attribute.";
+ public const string TooManyDataContracts = "Type '{0}' has more than one DataContractAttribute attribute.";
+ public const string TooManyDataMembers = "Member '{0}.{1}' has more than one DataMemberAttribute attribute.";
+ public const string TooManyEnumMembers = "Member '{0}.{1}' has more than one EnumMemberAttribute attribute.";
+ public const string TooManyIgnoreDataMemberAttributes = "Member '{0}.{1}' has more than one IgnoreDataMemberAttribute attribute.";
+ public const string TypeMustBeConcrete = "Error while getting known types for Type '{0}'. The type must not be an open or partial generic class.";
+ public const string TypeNotSerializable = "Type '{0}' cannot be serialized. Consider marking it with the DataContractAttribute attribute, and marking all of its members you want serialized with the DataMemberAttribute attribute. Alternatively, you can ensure that the type is public and has a parameterless constructor - all public members of the type will then be serialized, and no attributes will be required.";
+ public const string UnexpectedContractType = "An internal error has occurred. Unexpected contract type '{0}' for type '{1}' encountered.";
+ public const string UnexpectedElementExpectingElements = "'{0}' '{1}' from namespace '{2}' is not expected. Expecting element '{3}'.";
+ public const string UnexpectedEndOfFile = "Unexpected end of file.";
+ public const string UnknownConstantType = "Unrecognized constant type '{0}'.";
+ public const string UnsupportedIDictionaryAsDataMemberType = "Cannot deserialize one of the DataMember because it is an IDictionary. Use IDictionary<K,V> instead.";
+ public const string ValueMustBeNonNegative = "The value of this argument must be non-negative.";
+ public const string ValueTypeCannotBeNull = "ValueType '{0}' cannot be null.";
+ public const string ValueTypeCannotHaveBaseType = "Data contract '{0}' from namespace '{1}' is a value type and cannot have base contract '{2}' from namespace '{3}'.";
+ public const string ValueTypeCannotHaveId = "ValueType '{0}' cannot have id.";
+ public const string ValueTypeCannotHaveIsReference = "Value type '{0}' cannot have the IsReference setting of '{1}'. Either change the setting to '{2}', or remove it completely.";
+ public const string ValueTypeCannotHaveRef = "ValueType '{0}' cannot have ref to another object.";
+ public const string XmlElementAttributes = "Only Element nodes have attributes.";
+ public const string XmlForObjectCannotHaveContent = "Element {0} from namespace {1} cannot have child contents to be deserialized as an object. Please use XElement to deserialize this pattern of XML.";
+ public const string XmlInvalidConversion = "The value '{0}' cannot be parsed as the type '{1}'.";
+ public const string XmlInvalidConversionWithoutValue = "The value cannot be parsed as the type '{0}'.";
+ public const string XmlStartElementExpected = "Start element expected. Found {0}.";
+ public const string XmlWriterMustBeInElement = "WriteState '{0}' not valid. Caller must write start element before serializing in contentOnly mode.";
+ public const string OffsetExceedsBufferSize = "The specified offset exceeds the buffer size ({0} bytes).";
+ public const string SizeExceedsRemainingBufferSpace = "The specified size exceeds the remaining buffer space ({0} bytes).";
+ public const string ValueMustBeInRange = "The value of this argument must fall within the range {0} to {1}.";
+ public const string XmlArrayTooSmallOutput = "Array too small. Must be able to hold at least {0}.";
+ public const string XmlInvalidBase64Length = "Base64 sequence length ({0}) not valid. Must be a multiple of 4.";
+ public const string XmlInvalidBase64Sequence = "The characters '{0}' at offset {1} are not a valid Base64 sequence.";
+ public const string XmlInvalidBinHexLength = "BinHex sequence length ({0}) not valid. Must be a multiple of 2.";
+ public const string XmlInvalidBinHexSequence = "The characters '{0}' at offset {1} are not a valid BinHex sequence.";
+ public const string XmlInvalidHighSurrogate = "High surrogate char '0x{0}' not valid. High surrogate chars range from 0xD800 to 0xDBFF.";
+ public const string XmlInvalidLowSurrogate = "Low surrogate char '0x{0}' not valid. Low surrogate chars range from 0xDC00 to 0xDFFF.";
+ public const string XmlInvalidSurrogate = "Surrogate char '0x{0}' not valid. Surrogate chars range from 0x10000 to 0x10FFFF.";
+ public const string CombinedPrefixNSLength = "The combined length of the prefix and namespace must not be greater than {0}.";
+ public const string InvalidInclusivePrefixListCollection = "The inclusive namespace prefix collection cannot contain null as one of the items.";
+ public const string InvalidLocalNameEmpty = "The empty string is not a valid local name.";
+ public const string XmlArrayTooSmall = "Array too small.";
+ public const string XmlArrayTooSmallInput = "Array too small. Length of available data must be at least {0}.";
+ public const string XmlBadBOM = "Unrecognized Byte Order Mark.";
+ public const string XmlBase64DataExpected = "Base64 encoded data expected. Found {0}.";
+ public const string XmlCDATAInvalidAtTopLevel = "CData elements not valid at top level of an XML document.";
+ public const string XmlCloseCData = "']]>' not valid in text node content.";
+ public const string XmlConversionOverflow = "The value '{0}' cannot be represented with the type '{1}'.";
+ public const string XmlDeclarationRequired = "An XML declaration with an encoding is required for all non-UTF8 documents.";
+ public const string XmlDeclMissingVersion = "Version not found in XML declaration.";
+ public const string XmlDeclMissing = "An XML declaration is required for all non-UTF8 documents.";
+ public const string XmlDeclNotFirst = "No characters can appear before the XML declaration.";
+ public const string XmlDictionaryStringIDRange = "XmlDictionaryString IDs must be in the range from {0} to {1}.";
+ public const string XmlDictionaryStringIDUndefinedSession = "XmlDictionaryString ID {0} not defined in the XmlBinaryReaderSession.";
+ public const string XmlDictionaryStringIDUndefinedStatic = "XmlDictionaryString ID {0} not defined in the static dictionary.";
+ public const string XmlDuplicateAttribute = "Duplicate attribute found. Both '{0}' and '{1}' are from the namespace '{2}'.";
+ public const string XmlEmptyNamespaceRequiresNullPrefix = "The empty namespace requires a null or empty prefix.";
+ public const string XmlEncodingMismatch = "The encoding in the declaration '{0}' does not match the encoding of the document '{1}'.";
+ public const string XmlEncodingNotSupported = "XML encoding not supported.";
+ public const string XmlEndElementExpected = "End element '{0}' from namespace '{1}' expected. Found {2}.";
+ public const string XmlEndElementNoOpenNodes = "No corresponding start element is open.";
+ public const string XmlExpectedEncoding = "The expected encoding '{0}' does not match the actual encoding '{1}'.";
+ public const string XmlFoundCData = "cdata '{0}'";
+ public const string XmlFoundComment = "comment '{0}'";
+ public const string XmlFoundElement = "element '{0}' from namespace '{1}'";
+ public const string XmlFoundEndElement = "end element '{0}' from namespace '{1}'";
+ public const string XmlFoundEndOfFile = "end of file";
+ public const string XmlFoundNodeType = "node {0}";
+ public const string XmlFoundText = "text '{0}'";
+ public const string XmlFullStartElementExpected = "Non-empty start element expected. Found {0}.";
+ public const string XmlFullStartElementLocalNameNsExpected = "Non-empty start element '{0}' from namespace '{1}' expected. Found {2}.";
+ public const string XmlFullStartElementNameExpected = "Non-empty start element '{0}' expected. Found {1}.";
+ public const string XmlIDDefined = "ID already defined.";
+ public const string XmlKeyAlreadyExists = "The specified key already exists in the dictionary.";
+ public const string XmlIllegalOutsideRoot = "Text cannot be written outside the root element.";
+ public const string XmlInvalidBytes = "Invalid byte encoding.";
+ public const string XmlInvalidCharRef = "Character reference not valid.";
+ public const string XmlInvalidCommentChars = "XML comments cannot contain '--' or end with '-'.";
+ public const string XmlInvalidDeclaration = "XML declaration can only be written at the beginning of the document.";
+ public const string XmlInvalidDepth = "Cannot call '{0}' while Depth is '{1}'.";
+ public const string XmlInvalidEncoding = "XML encoding must be 'UTF-8'.";
+ public const string XmlInvalidFFFE = "Characters with hexadecimal values 0xFFFE and 0xFFFF are not valid.";
+ public const string XmlInvalidFormat = "The input source is not correctly formatted.";
+ public const string XmlInvalidID = "ID must be >= 0.";
+ public const string XmlInvalidOperation = "The reader cannot be advanced.";
+ public const string XmlInvalidPrefixState = "A prefix cannot be defined while WriteState is '{0}'.";
+ public const string XmlInvalidQualifiedName = "Expected XML qualified name. Found '{0}'.";
+ public const string XmlInvalidRootData = "The data at the root level is invalid.";
+ public const string XmlInvalidStandalone = "'standalone' value in declaration must be 'yes' or 'no'.";
+ public const string XmlInvalidStream = "Stream returned by IStreamProvider cannot be null.";
+ public const string XmlInvalidUniqueId = "UniqueId cannot be zero length.";
+ public const string XmlInvalidUTF8Bytes = "'{0}' contains invalid UTF8 bytes.";
+ public const string XmlInvalidVersion = "XML version must be '1.0'.";
+ public const string XmlInvalidWriteState = "'{0}' cannot be called while WriteState is '{1}'.";
+ public const string XmlInvalidXmlByte = "The byte 0x{0} is not valid at this location.";
+ public const string XmlInvalidXmlSpace = "'{0}' is not a valid xml:space value. Valid values are 'default' and 'preserve'.";
+ public const string XmlLineInfo = "Line {0}, position {1}.";
+ public const string XmlMalformedDecl = "Malformed XML declaration.";
+ public const string XmlMaxArrayLengthExceeded = "The maximum array length quota ({0}) has been exceeded while reading XML data. This quota may be increased by changing the MaxArrayLength property on the XmlDictionaryReaderQuotas object used when creating the XML reader.";
+ public const string XmlMaxNameTableCharCountExceeded = "The maximum nametable character count quota ({0}) has been exceeded while reading XML data. The nametable is a data structure used to store strings encountered during XML processing - long XML documents with non-repeating element names, attribute names and attribute values may trigger this quota. This quota may be increased by changing the MaxNameTableCharCount property on the XmlDictionaryReaderQuotas object used when creating the XML reader.";
+ public const string XmlMethodNotSupported = "This XmlWriter implementation does not support the '{0}' method.";
+ public const string XmlMissingLowSurrogate = "The surrogate pair is invalid. Missing a low surrogate character.";
+ public const string XmlMultipleRootElements = "There are multiple root elements.";
+ public const string XmlNamespaceNotFound = "The namespace '{0}' is not defined.";
+ public const string XmlNestedArraysNotSupported = "Nested arrays are not supported.";
+ public const string XmlNoRootElement = "The document does not have a root element.";
+ public const string XmlOnlyOneRoot = "Only one root element is permitted per document.";
+ public const string XmlOnlyWhitespace = "Only white space characters can be written with this method.";
+ public const string XmlOnlySingleValue = "Only a single typed value may be written inside an attribute or content.";
+ public const string XmlPrefixBoundToNamespace = "The prefix '{0}' is bound to the namespace '{1}' and cannot be changed to '{2}'.";
+ public const string XmlProcessingInstructionNotSupported = "Processing instructions (other than the XML declaration) and DTDs are not supported.";
+ public const string XmlReservedPrefix = "Prefixes beginning with \"xml\" (regardless of casing) are reserved for use by XML.";
+ public const string XmlSpaceBetweenAttributes = "Whitespace must appear between attributes.";
+ public const string XmlSpecificBindingNamespace = "The namespace '{1}' can only be bound to the prefix '{0}'.";
+ public const string XmlSpecificBindingPrefix = "The prefix '{0}' can only be bound to the namespace '{1}'.";
+ public const string XmlStartElementLocalNameNsExpected = "Start element '{0}' from namespace '{1}' expected. Found {2}.";
+ public const string XmlStartElementNameExpected = "Start element '{0}' expected. Found {1}.";
+ public const string XmlTagMismatch = "Start element '{0}' does not match end element '{1}'.";
+ public const string XmlTokenExpected = "The token '{0}' was expected but found '{1}'.";
+ public const string XmlUndefinedPrefix = "The prefix '{0}' is not defined.";
+ public const string XmlUnexpectedEndElement = "No matching start tag for end element.";
+ public const string XmlUnexpectedEndOfFile = "Unexpected end of file. Following elements are not closed: {0}.";
+ public const string XmlWriterClosed = "The XmlWriter is closed.";
+ public const string Xml_InvalidNmToken = "Invalid NmToken value '{0}'.";
}
-}
-
-/*
-namespace System.Text
-{
- static partial class SR
- {
- internal static string GetString(string name, params object[] args)
- {
- return GetString (CultureInfo.InvariantCulture, name, args);
- }
-
- internal static string GetString(CultureInfo culture, string name, params object[] args) {
- return string.Format (culture, name, args);
- }
-
- internal static string GetString(string name)
- {
- return name;
- }
-
- internal static string GetString(CultureInfo culture, string name)
- {
- return name;
- }
-}
-}
-
-namespace System.Xml
-{
- static partial class SR
- {
- internal static string GetString(string name, params object[] args)
- {
- return GetString (CultureInfo.InvariantCulture, name, args);
- }
-
- internal static string GetString(CultureInfo culture, string name, params object[] args) {
- return string.Format (culture, name, args);
- }
-
- internal static string GetString(string name)
- {
- return name;
- }
-
- internal static string GetString(CultureInfo culture, string name)
- {
- return name;
- }
-}
-}
-*/
-#endregion
-
-
-#region "retrieved string resources"
-
-namespace System.Runtime.Serialization
-{
- static partial class SR {
-
-
-public const string ArrayExceededSize = @"Array length '{0}' provided by the get-only collection of type '{1}' is less than the number of array elements found in the input stream. Consider increasing the length of the array.";
-public const string ArrayExceededSizeAttribute = @"Array length '{0}' provided by Size attribute is not equal to the number of array elements '{1}' from namespace '{2}' found.";
-public const string ArrayTypeIsNotSupported = @"An internal error has occurred. '{0}[]' is not supported when generating code for serialization.";
-public const string CannotDeserializeRefAtTopLevel = @"Cannot deserialize since root element references unrecognized object with id '{0}'.";
-public const string CannotLoadMemberType = @"Cannot load member type '{0}'.";
-public const string CannotSerializeObjectWithCycles = @"Object graph for type '{0}' contains cycles and cannot be serialized if references are not tracked. Consider using the DataContractAttribute with the IsReference property set to true.";
-public const string CanOnlyStoreIntoArgOrLocGot0 = @"An internal error has occurred. Data can only be stored into ArgBuilder or LocalBuilder. Got: {0}.";
-public const string CharIsInvalidPrimitive = @"An internal error has occurred. Char is not a valid schema primitive and should be treated as int in DataContract.";
-public const string CallbackMustReturnVoid = @"Serialization Callback '{1}' in type '{0}' must return void. ";
-public const string CallbackParameterInvalid = @"Serialization Callback '{1}' in type '{0}' must have a single parameter of type '{2}'. ";
-public const string CallbacksCannotBeVirtualMethods = @"Virtual Method '{0}' of type '{1}' cannot be marked with '{2}' attribute. ";
-public const string CollectionMustHaveAddMethod = @"Collection type '{0}' does not have a valid Add method.";
-public const string CollectionMustHaveGetEnumeratorMethod = @"Collection type '{0}' does not have a valid GetEnumerator method.";
-public const string CollectionMustHaveItemType = @"Collection type '{0}' must have a non-null item type.";
-public const string CollectionTypeCannotBeBuiltIn = @"{0} is a built-in type and cannot be a collection.";
-public const string CollectionTypeCannotHaveDataContract = @"{0} has DataContractAttribute attribute.";
-public const string CollectionTypeDoesNotHaveAddMethod = @"{0} does not have a valid Add method with parameter of type '{1}'.";
-public const string CollectionTypeDoesNotHaveDefaultCtor = @"{0} does not have a default constructor.";
-public const string CollectionTypeHasMultipleDefinitionsOfInterface = @"{0} has multiple definitions of interface '{1}'.";
-public const string CollectionTypeIsNotIEnumerable = @"{0} does not implement IEnumerable interface.";
-public const string DataContractCacheOverflow = @"An internal error has occurred. DataContract cache overflow.";
-public const string DataContractNamespaceAlreadySet = @"ContractNamespaceAttribute attribute maps CLR namespace '{2}' to multiple data contract namespaces '{0}' and '{1}'. You can map a CLR namespace to only one data contract namespace.";
-public const string DataContractNamespaceIsNotValid = @"DataContract namespace '{0}' is not a valid URI.";
-public const string DataContractNamespaceReserved = @"DataContract namespace '{0}' cannot be specified since it is reserved.";
-public const string DataMemberOnEnumField = @"Member '{0}.{1}' has DataMemberAttribute attribute. Use EnumMemberAttribute attribute instead.";
-public const string DcTypeNotFoundOnDeserialize = @"Element '{2}:{3}' contains data of the '{0}:{1}' data contract. The deserializer has no knowledge of any type that maps to this contract. Add the type corresponding to '{1}' to the list of known types - for example, by using the KnownTypeAttribute attribute or by adding it to the list of known types passed to DataContractSerializer.";
-public const string DcTypeNotFoundOnSerialize = @"Type '{0}' with data contract name '{1}:{2}' is not expected. Add any types not known statically to the list of known types - for example, by using the KnownTypeAttribute attribute or by adding them to the list of known types passed to DataContractSerializer.";
-public const string DcTypeNotResolvedOnDeserialize = @"Element '{2}:{3}' contains data from a type that maps to the name '{0}:{1}'. The deserializer has no knowledge of any type that maps to this name. Consider changing the implementation of the ResolveName method on your DataContractResolver to return a non-null value for name '{1}' and namespace '{0}'.";
-public const string DeserializedObjectWithIdNotFound = @"Deserialized object with reference id '{0}' not found in stream.";
-public const string DupContractInKnownTypes = @"Type '{0}' cannot be added to list of known types since another type '{1}' with the same data contract name '{2}:{3}' is already present.";
-public const string DupKeyValueName = @"The collection data contract type '{0}' specifies the same value '{1}' for both the KeyName and the ValueName properties. This is not allowed. Consider changing either the KeyName or the ValueName property.";
-public const string DupEnumMemberValue = @"Type '{2}' contains two members '{0}' 'and '{1}' with the same name '{3}'. Multiple members with the same name in one type are not supported. Consider changing one of the member names using EnumMemberAttribute attribute.";
-public const string DupMemberName = @"Type '{2}' contains two members '{0}' 'and '{1}' with the same data member name '{3}'. Multiple members with the same name in one type are not supported. Consider changing one of the member names using DataMemberAttribute attribute.";
-public const string DuplicateAttribute = @"Invalid Callback. Method '{3}' in type '{2}' has both '{0}' and '{1}'. ";
-public const string DuplicateCallback = @"Invalid attribute. Both '{0}' and '{1}' in type '{2}' have '{3}'. ";
-public const string EncounteredWithNameNamespace = @"{0}. Encountered '{1}' with name '{2}', namespace '{3}'.";
-public const string EnumTypeCannotHaveIsReference = @"Enum type '{0}' cannot have the IsReference setting of '{1}'. Either change the setting to '{2}', or remove it completely.";
-public const string ErrorDeserializing = @"There was an error deserializing the object {0}. {1}";
-public const string ErrorInLine = @"Error in line {0} position {1}.";
-public const string ErrorIsStartObject = @"There was an error checking start element of object {0}. {1}";
-public const string ErrorSerializing = @"There was an error serializing the object {0}. {1}";
-public const string ErrorTypeInfo = @"of type {0}";
-public const string ErrorWriteEndObject = @"There was an error writing end element of object {0}. {1}";
-public const string ErrorWriteStartObject = @"There was an error writing start element of object {0}. {1}";
-public const string ExceededMaxItemsQuota = @"Maximum number of items that can be serialized or deserialized in an object graph is '{0}'.";
-public const string ExpectingElement = @"Expecting element '{1}' from namespace '{0}'.";
-public const string ExpectingElementAtDeserialize = @"Expecting state '{0}' when ReadObject is called.";
-public const string ExpectingEnd = @"Expecting End'{0}'.";
-public const string ExpectingState = @"Expecting state '{0}'.";
-public const string GenericNameBraceMismatch = @"The data contract name '{0}' for type '{1}' has a curly brace '{{' that is not matched with a closing curly brace. Curly braces have special meaning in data contract names - they are used to customize the naming of data contracts for generic types.";
-public const string GenericParameterNotValid = @"In the data contract name for type '{1}', there are curly braces with '{0}' inside, which is an invalid value. Curly braces have special meaning in data contract names - they are used to customize the naming of data contracts for generic types. Based on the number of generic parameters this type has, the contents of the curly braces must either be a number between 0 and '{2}' to insert the name of the generic parameter at that index or the '#' symbol to insert a digest of the generic parameter namespaces.";
-public const string InconsistentIsReference = @"The IsReference setting for type '{0}' is '{1}', but the same setting for its parent class '{2}' is '{3}'. Derived types must have the same value for IsReference as the base type. Change the setting on type '{0}' to '{3}', or on type '{2}' to '{1}', or do not set IsReference explicitly.";
-public const string IndexedPropertyCannotBeSerialized = @"Property '{1}' in type '{0}' cannot be serialized because serialization of indexed properties is not supported.";
-public const string InterfaceTypeCannotBeCreated = @"Interface type '{0}' cannot be created. Consider replacing with a non-interface serializable type.";
-public const string InvalidCollectionContractItemName = @"Type '{0}' cannot have CollectionDataContractAttribute attribute ItemName set to null or empty string.";
-public const string InvalidCollectionContractKeyName = @"Type '{0}' cannot have CollectionDataContractAttribute attribute KeyName set to null or empty string.";
-public const string InvalidCollectionContractKeyNoDictionary = @"The collection data contract type '{0}' specifies '{1}' for the KeyName property. This is not allowed since the type is not IDictionary. Remove the setting for the KeyName property.";
-public const string InvalidCollectionContractName = @"Type '{0}' cannot have CollectionDataContractAttribute attribute Name set to null or empty string.";
-public const string InvalidCollectionContractNamespace = @"Type '{0}' cannot have CollectionDataContractAttribute attribute Namespace set to null.";
-public const string InvalidCollectionContractValueName = @"Type '{0}' cannot have CollectionDataContractAttribute attribute ValueName set to null or empty string.";
-public const string InvalidCollectionContractValueNoDictionary = @"The collection data contract type '{0}' specifies '{1}' for the ValueName property. This is not allowed since the type is not IDictionary. Remove the setting for the ValueName property.";
-public const string InvalidCollectionDataContract = @"Type '{0}' with CollectionDataContractAttribute attribute is an invalid collection type since it";
-public const string InvalidCollectionType = @"Type '{0}' is an invalid collection type since it";
-public const string InvalidDataContractName = @"Type '{0}' cannot have DataContractAttribute attribute Name set to null or empty string.";
-public const string InvalidDataContractNamespace = @"Type '{0}' cannot have DataContractAttribute attribute Namespace set to null.";
-public const string InvalidDataMemberName = @"Member '{0}' in type '{1}' cannot have DataMemberAttribute attribute Name set to null or empty string.";
-public const string InvalidEnumMemberValue = @"'{0}' in type '{1}' cannot have EnumMemberAttribute attribute Value set to null or empty string.";
-public const string InvalidEnumValueOnRead = @"Invalid enum value '{0}' cannot be deserialized into type '{1}'. Ensure that the necessary enum values are present and are marked with EnumMemberAttribute attribute if the type has DataContractAttribute attribute.";
-public const string InvalidEnumValueOnWrite = @"Enum value '{0}' is invalid for type '{1}' and cannot be serialized. Ensure that the necessary enum values are present and are marked with EnumMemberAttribute attribute if the type has DataContractAttribute attribute.";
-public const string InvalidGetSchemaMethod = @"Type '{0}' cannot have MethodName on XmlSchemaProviderAttribute attribute set to null or empty string. ";
-public const string InvalidGlobalDataContractNamespace = @"CLR namespace '{0}' cannot have ContractNamespace set to null.";
-public const string InvalidMember = @"Member '{0}.{1}' cannot be serialized since it is neither a field nor a property, and therefore cannot be marked with the DataMemberAttribute attribute. Remove the DataMemberAttribute attribute from the '{1}' member.";
-public const string InvalidNonNullReturnValueByIsAny = @"Method '{0}.{1}()' returns a non-null value. The return value must be null since IsAny=true.";
-public const string InvalidPrimitiveType = @"Type '{0}' is not a valid serializable type.";
-public const string InvalidReturnTypeOnGetSchemaMethod = @"Method '{0}.{1}()' returns '{2}'. The return type must be compatible with '{3}'.";
-public const string InvalidSizeDefinition = @"Invalid Size '{0}'. Must be non-negative integer.";
-public const string InvalidXmlDataContractName = @"XML data contract Name for type '{0}' cannot be set to null or empty string.";
-public const string InvalidXsIdDefinition = @"Invalid Id '{0}'. Must not be null or empty.";
-public const string InvalidXsRefDefinition = @"Invalid Ref '{0}'. Must not be null or empty.";
-public const string IsAnyCannotBeNull = @"A null value cannot be serialized at the top level for IXmlSerializable root type '{0}' since its IsAny setting is 'true'. This type must write all its contents including the root element. Verify that the IXmlSerializable implementation is correct.";
-public const string IsAnyCannotBeSerializedAsDerivedType = @"An object of type '{0}' cannot be serialized at the top level for IXmlSerializable root type '{1}' since its IsAny setting is 'true'. This type must write all its contents including the root element. Verify that the IXmlSerializable implementation is correct.";
-public const string IsAnyCannotHaveXmlRoot = @"Type '{0}' cannot specify an XmlRootAttribute attribute because its IsAny setting is 'true'. This type must write all its contents including the root element. Verify that the IXmlSerializable implementation is correct.";
-public const string IsNotAssignableFrom = @"An internal error has occurred. '{0}' is not assignable from '{1}' - error generating code for serialization.";
-public const string IsRequiredDataMemberOnIsReferenceDataContractType = @"'{0}.{1}' has the IsRequired setting of '{2}. However, '{0}' has the IsReference setting of '{2}', because either it is set explicitly, or it is derived from a base class. Set IsRequired on '{0}.{1}' to false, or disable IsReference on '{0}'.";
-public const string IXmlSerializableCannotHaveCollectionDataContract = @"Type '{0}' cannot be IXmlSerializable and have CollectionDataContractAttribute attribute.";
-public const string IXmlSerializableCannotHaveDataContract = @"Type '{0}' cannot be IXmlSerializable and have DataContractAttribute attribute.";
-public const string IXmlSerializableIllegalOperation = @"This method cannot be called from IXmlSerializable implementations.";
-public const string IXmlSerializableMissingEndElements = @"IXmlSerializable.WriteXml method of type '{0}' did not close all open tags. Verify that the IXmlSerializable implementation is correct.";
-public const string IXmlSerializableMustHaveDefaultConstructor = @"IXmlSerializable Type '{0}' must have default constructor.";
-public const string IXmlSerializableWritePastSubTree = @"IXmlSerializable.WriteXml method of type '{0}' attempted to close too many tags. Verify that the IXmlSerializable implementation is correct.";
-public const string KnownTypeAttributeEmptyString = @"Method name specified by KnownTypeAttribute attribute on type '{0}' cannot be the empty string.";
-public const string KnownTypeAttributeUnknownMethod = @"KnownTypeAttribute attribute on type '{1}' specifies a method named '{0}' to provide known types. Static method '{0}()' was not found on this type. Ensure that the method exists and is marked as static.";
-public const string KnownTypeAttributeReturnType = @"KnownTypeAttribute attribute on type '{0}' specifies a method named '{1}' to provide known types. The return type of this method is invalid because it is not assignable to IEnumerable<Type>. Ensure that the method exists and has a valid signature.";
-public const string KnownTypeAttributeOneScheme = @"Type '{0}': If a KnownTypeAttribute attribute specifies a method it must be the only KnownTypeAttribute attribute on that type.";
-public const string KnownTypeAttributeNoType = @"KnownTypeAttribute attribute on type '{0}' contains no Type.";
-public const string KnownTypeConfigClosedGenericDeclared = @"Declared type '{0}' in config cannot be a closed or partial generic type.";
-public const string KnownTypeAttributeValidMethodTypes = @"Method specified by KnownTypeAttribute attribute on type '{0}' does not expose valid types.";
-public const string KnownTypeAttributeNoData = @"KnownTypeAttribute attribute on type '{0}' contains no data.";
-public const string KnownTypeAttributeMethodNull = @"Method specified by KnownTypeAttribute attribute on type '{0}' returned null.";
-public const string MaxArrayLengthExceeded = @"The maximum array length ({0}) has been exceeded while reading XML data for array of type '{1}'.";
-public const string MissingGetSchemaMethod = @"Type '{0}' does not have a static method '{1}' that takes a parameter of type 'System.Xml.Schema.XmlSchemaSet' as specified by the XmlSchemaProviderAttribute attribute.";
-public const string MultipleIdDefinition = @"Invalid XML encountered. The same Id value '{0}' is defined more than once. Multiple objects cannot be deserialized using the same Id.";
-public const string NoConversionPossibleTo = @"An internal error has occurred. No conversion is possible to '{0}' - error generating code for serialization.";
-public const string NoGetMethodForProperty = @"No get method for property '{1}' in type '{0}'.";
-public const string NoSetMethodForProperty = @"No set method for property '{1}' in type '{0}'.";
-public const string NullKnownType = @"One of the known types provided to the serializer via '{0}' argument was invalid because it was null. All known types specified must be non-null values.";
-public const string NullValueReturnedForGetOnlyCollection = @"The get-only collection of type '{0}' returned a null value. The input stream contains collection items which cannot be added if the instance is null. Consider initializing the collection either in the constructor of the the object or in the getter.";
-public const string ObjectTableOverflow = @"An internal error has occurred. Object table overflow. This could be caused by serializing or deserializing extremely large object graphs.";
-public const string OrderCannotBeNegative = @"Property 'Order' in DataMemberAttribute attribute cannot be a negative number.";
-public const string ParameterCountMismatch = @"Invalid number of parameters to call method '{0}'. Expected '{1}' parameters, but '{2}' were provided.";
-public const string PartialTrustCollectionContractAddMethodNotPublic = @"The collection data contract type '{0}' cannot be deserialized because the method '{1}' is not public. Making the method public will fix this error. Alternatively, you can make it internal, and use the InternalsVisibleToAttribute attribute on your assembly in order to enable serialization of internal members - see documentation for more details. Be aware that doing so has certain security implications.";
-public const string PartialTrustCollectionContractNoPublicConstructor = @"The collection data contract type '{0}' cannot be deserialized because it does not have a public parameterless constructor. Adding a public parameterless constructor will fix this error. Alternatively, you can make it internal, and use the InternalsVisibleToAttribute attribute on your assembly in order to enable serialization of internal members - see documentation for more details. Be aware that doing so has certain security implications.";
-public const string PartialTrustCollectionContractTypeNotPublic = @"The collection data contract type '{0}' cannot be deserialized because it does not have a public parameterless constructor. Adding a public parameterless constructor will fix this error. Alternatively, you can make it internal, and use the InternalsVisibleToAttribute attribute on your assembly in order to enable serialization of internal members - see documentation for more details. Be aware that doing so has certain security implications.";
-public const string PartialTrustDataContractOnSerializingNotPublic = @"The data contract type '{0}' cannot be serialized because the OnSerializing method '{1}' is not public. Making the method public will fix this error. Alternatively, you can make it internal, and use the InternalsVisibleToAttribute attribute on your assembly in order to enable serialization of internal members - see documentation for more details. Be aware that doing so has certain security implications.";
-public const string PartialTrustDataContractOnSerializedNotPublic = @"The data contract type '{0}' cannot be serialized because the OnSerialized method '{1}' is not public. Making the method public will fix this error. Alternatively, you can make it internal, and use the InternalsVisibleToAttribute attribute on your assembly in order to enable serialization of internal members - see documentation for more details. Be aware that doing so has certain security implications.";
-public const string PartialTrustDataContractOnDeserializingNotPublic = @"The data contract type '{0}' cannot be deserialized because the OnDeserializing method '{1}' is not public. Making the method public will fix this error. Alternatively, you can make it internal, and use the InternalsVisibleToAttribute attribute on your assembly in order to enable serialization of internal members - see documentation for more details. Be aware that doing so has certain security implications.";
-public const string PartialTrustDataContractOnDeserializedNotPublic = @"The data contract type '{0}' cannot be deserialized because the OnDeserialized method '{1}' is not public. Making the method public will fix this error. Alternatively, you can make it internal, and use the InternalsVisibleToAttribute attribute on your assembly in order to enable serialization of internal members - see documentation for more details. Be aware that doing so has certain security implications.";
-public const string PartialTrustDataContractFieldGetNotPublic = @"The data contract type '{0}' cannot be serialized because the member '{1}' is not public. Making the member public will fix this error. Alternatively, you can make it internal, and use the InternalsVisibleToAttribute attribute on your assembly in order to enable serialization of internal members - see documentation for more details. Be aware that doing so has certain security implications.";
-public const string PartialTrustDataContractFieldSetNotPublic = @"The data contract type '{0}' cannot be deserialized because the member '{1}' is not public. Making the member public will fix this error. Alternatively, you can make it internal, and use the InternalsVisibleToAttribute attribute on your assembly in order to enable serialization of internal members - see documentation for more details. Be aware that doing so has certain security implications.";
-public const string PartialTrustDataContractPropertyGetNotPublic = @"The data contract type '{0}' cannot be serialized because the property '{1}' does not have a public getter. Adding a public getter will fix this error. Alternatively, you can make it internal, and use the InternalsVisibleToAttribute attribute on your assembly in order to enable serialization of internal members - see documentation for more details. Be aware that doing so has certain security implications.";
-public const string PartialTrustDataContractPropertySetNotPublic = @"The data contract type '{0}' cannot be deserialized because the property '{1}' does not have a public setter. Adding a public setter will fix this error. Alternatively, you can make it internal, and use the InternalsVisibleToAttribute attribute on your assembly in order to enable serialization of internal members - see documentation for more details. Be aware that doing so has certain security implications.";
-public const string PartialTrustDataContractTypeNotPublic = @"The data contract type '{0}' is not serializable because it is not public. Making the type public will fix this error. Alternatively, you can make it internal, and use the InternalsVisibleToAttribute attribute on your assembly in order to enable serialization of internal members - see documentation for more details. Be aware that doing so has certain security implications.";
-public const string PartialTrustNonAttributedSerializableTypeNoPublicConstructor = @"The type '{0}' cannot be deserialized because it does not have a public parameterless constructor. Alternatively, you can make it internal, and use the InternalsVisibleToAttribute attribute on your assembly in order to enable serialization of internal members - see documentation for more details. Be aware that doing so has certain security implications.";
-public const string PartialTrustIXmlSerializableTypeNotPublic = @"The IXmlSerializable type '{0}' is not serializable in partial trust because it is not public. Adding a public parameterless constructor will fix this error. Alternatively, you can make it internal, and use the InternalsVisibleToAttribute attribute on your assembly in order to enable serialization of internal members - see documentation for more details. Be aware that doing so has certain security implications.";
-public const string PartialTrustIXmlSerialzableNoPublicConstructor = @"The IXmlSerializable type '{0}' cannot be deserialized because it does not have a public parameterless constructor. Adding a public parameterless constructor will fix this error. Alternatively, you can make it internal, and use the InternalsVisibleToAttribute attribute on your assembly in order to enable serialization of internal members - see documentation for more details. Be aware that doing so has certain security implications.";
-public const string NonAttributedSerializableTypesMustHaveDefaultConstructor = @"The Type '{0}' must have a parameterless constructor.";
-public const string AttributedTypesCannotInheritFromNonAttributedSerializableTypes = @"Type '{0}' cannot inherit from a type that is not marked with DataContractAttribute or SerializableAttribute. Consider marking the base type '{1}' with DataContractAttribute or SerializableAttribute, or removing them from the derived type.";
-public const string GetOnlyCollectionsNotSupported = @"Get-only collection properties are not supported. Consider adding a public setter to property '{0}.{1}' or marking the it with the IgnoreDataMemberAttribute. ";
-public const string QuotaMustBePositive = @"Quota must be a positive value.";
-public const string QuotaIsReadOnly = @"The '{0}' quota is readonly.";
-public const string QuotaCopyReadOnly = @"Cannot copy XmlDictionaryReaderQuotas. Target is readonly.";
-public const string RequiredMemberMustBeEmitted = @"Member {0} in type {1} cannot be serialized. This exception is usually caused by trying to use a null value where a null value is not allowed. The '{0}' member is set to its default value (usually null or zero). The member's EmitDefault setting is 'false', indicating that the member should not be serialized. However, the member's IsRequired setting is 'true', indicating that it must be serialized. This conflict cannot be resolved. Consider setting '{0}' to a non-default value. Alternatively, you can change the EmitDefaultValue property on the DataMemberAttribute attribute to true, or changing the IsRequired property to false.";
-public const string ResolveTypeReturnedFalse = @"An object of type '{0}' which derives from DataContractResolver returned false from its TryResolveType method when attempting to resolve the name for an object of type '{1}', indicating that the resolution failed. Change the TryResolveType implementation to return true.";
-public const string ResolveTypeReturnedNull = @"An object of type '{0}' which derives from DataContractResolver returned a null typeName or typeNamespace but not both from its TryResolveType method when attempting to resolve the name for an object of type '{1}'. Change the TryResolveType implementation to return non-null values, or to return null values for both typeName and typeNamespace in order to serialize as the declared type.";
-public const string SupportForMultidimensionalArraysNotPresent = @"Multi-dimensional arrays are not supported.";
-public const string TooManyCollectionContracts = @"Type '{0}' has more than one CollectionDataContractAttribute attribute.";
-public const string TooManyDataContracts = @"Type '{0}' has more than one DataContractAttribute attribute.";
-public const string TooManyDataMembers = @"Member '{0}.{1}' has more than one DataMemberAttribute attribute.";
-public const string TooManyEnumMembers = @"Member '{0}.{1}' has more than one EnumMemberAttribute attribute.";
-public const string TooManyIgnoreDataMemberAttributes = @"Member '{0}.{1}' has more than one IgnoreDataMemberAttribute attribute.";
-public const string TypeMustBeConcrete = @"Error while getting known types for Type '{0}'. The type must not be an open or partial generic class.";
-public const string TypeNotSerializable = @"Type '{0}' cannot be serialized. Consider marking it with the DataContractAttribute attribute, and marking all of its members you want serialized with the DataMemberAttribute attribute. Alternatively, you can ensure that the type is public and has a parameterless constructor - all public members of the type will then be serialized, and no attributes will be required.";
-public const string UnexpectedContractType = @"An internal error has occurred. Unexpected contract type '{0}' for type '{1}' encountered.";
-public const string UnexpectedElementExpectingElements = @"'{0}' '{1}' from namespace '{2}' is not expected. Expecting element '{3}'.";
-public const string UnexpectedEndOfFile = @"Unexpected end of file.";
-public const string UnknownConstantType = @"Unrecognized constant type '{0}'.";
-public const string UnsupportedIDictionaryAsDataMemberType = @"Cannot deserialize one of the DataMember because it is an IDictionary. Use IDictionary<K,V> instead.";
-public const string ValueMustBeNonNegative = @"The value of this argument must be non-negative.";
-public const string ValueTypeCannotBeNull = @"ValueType '{0}' cannot be null.";
-public const string ValueTypeCannotHaveBaseType = @"Data contract '{0}' from namespace '{1}' is a value type and cannot have base contract '{2}' from namespace '{3}'.";
-public const string ValueTypeCannotHaveId = @"ValueType '{0}' cannot have id.";
-public const string ValueTypeCannotHaveIsReference = @"Value type '{0}' cannot have the IsReference setting of '{1}'. Either change the setting to '{2}', or remove it completely. ";
-public const string ValueTypeCannotHaveRef = @"ValueType '{0}' cannot have ref to another object.";
-public const string XmlElementAttributes = @"Only Element nodes have attributes.";
-public const string XmlForObjectCannotHaveContent = @"Element {0} from namespace {1} cannot have child contents to be deserialized as an object. Please use XElement to deserialize this pattern of XML.";
-public const string XmlInvalidConversion = @"The value '{0}' cannot be parsed as the type '{1}'.";
-public const string XmlInvalidConversionWithoutValue = @"The value cannot be parsed as the type '{0}'.";
-public const string XmlStartElementExpected = @"Start element expected. Found {0}.";
-public const string XmlWriterMustBeInElement = @"WriteState '{0}' not valid. Caller must write start element before serializing in contentOnly mode.";
-
- }
-}
-
-namespace System.Runtime.Serialization
-{
- static partial class SR {
-
-public const string OffsetExceedsBufferSize = @"The specified offset exceeds the buffer size ({0} bytes).";
-public const string SizeExceedsRemainingBufferSpace = @"The specified size exceeds the remaining buffer space ({0} bytes).";
-public const string ValueMustBeInRange = @"The value of this argument must fall within the range {0} to {1}.";
-public const string XmlArrayTooSmallOutput = @"Array too small. Must be able to hold at least {0}.";
-public const string XmlInvalidBase64Length = @"Base64 sequence length ({0}) not valid. Must be a multiple of 4.";
-public const string XmlInvalidBase64Sequence = @"The characters '{0}' at offset {1} are not a valid Base64 sequence.";
-public const string XmlInvalidBinHexLength = @"BinHex sequence length ({0}) not valid. Must be a multiple of 2.";
-public const string XmlInvalidBinHexSequence = @"The characters '{0}' at offset {1} are not a valid BinHex sequence.";
-public const string XmlInvalidHighSurrogate = @"High surrogate char '0x{0}' not valid. High surrogate chars range from 0xD800 to 0xDBFF.";
-public const string XmlInvalidLowSurrogate = @"Low surrogate char '0x{0}' not valid. Low surrogate chars range from 0xDC00 to 0xDFFF.";
-public const string XmlInvalidSurrogate = @"Surrogate char '0x{0}' not valid. Surrogate chars range from 0x10000 to 0x10FFFF.";
-
- }
-}
-
-namespace System.Runtime.Serialization
-{
- static partial class SR {
-
-public const string CombinedPrefixNSLength = @"The combined length of the prefix and namespace must not be greater than {0}.";
-public const string InvalidInclusivePrefixListCollection = @"The inclusive namespace prefix collection cannot contain null as one of the items.";
-public const string InvalidLocalNameEmpty = @"The empty string is not a valid local name.";
-public const string XmlArrayTooSmall = @"Array too small.";
-public const string XmlArrayTooSmallInput = @"Array too small. Length of available data must be at least {0}.";
-public const string XmlBadBOM = @"Unrecognized Byte Order Mark.";
-public const string XmlBase64DataExpected = @"Base64 encoded data expected. Found {0}.";
-public const string XmlCDATAInvalidAtTopLevel = @"CData elements not valid at top level of an XML document.";
-public const string XmlCloseCData = @"']]>' not valid in text node content.";
-public const string XmlConversionOverflow = @"The value '{0}' cannot be represented with the type '{1}'.";
-public const string XmlDeclarationRequired = @"An XML declaration with an encoding is required for all non-UTF8 documents.";
-public const string XmlDeclMissingVersion = @"Version not found in XML declaration.";
-public const string XmlDeclMissing = @"An XML declaration is required for all non-UTF8 documents.";
-public const string XmlDeclNotFirst = @"No characters can appear before the XML declaration.";
-public const string XmlDictionaryStringIDRange = @"XmlDictionaryString IDs must be in the range from {0} to {1}.";
-public const string XmlDictionaryStringIDUndefinedSession = @"XmlDictionaryString ID {0} not defined in the XmlBinaryReaderSession.";
-public const string XmlDictionaryStringIDUndefinedStatic = @"XmlDictionaryString ID {0} not defined in the static dictionary.";
-public const string XmlDuplicateAttribute = @"Duplicate attribute found. Both '{0}' and '{1}' are from the namespace '{2}'.";
-public const string XmlEmptyNamespaceRequiresNullPrefix = @"The empty namespace requires a null or empty prefix.";
-public const string XmlEncodingMismatch = @"The encoding in the declaration '{0}' does not match the encoding of the document '{1}'.";
-public const string XmlEncodingNotSupported = @"XML encoding not supported.";
-public const string XmlEndElementExpected = @"End element '{0}' from namespace '{1}' expected. Found {2}.";
-public const string XmlEndElementNoOpenNodes = @"No corresponding start element is open.";
-public const string XmlExpectedEncoding = @"The expected encoding '{0}' does not match the actual encoding '{1}'.";
-public const string XmlFoundCData = @"cdata '{0}'";
-public const string XmlFoundComment = @"comment '{0}'";
-public const string XmlFoundElement = @"element '{0}' from namespace '{1}'";
-public const string XmlFoundEndElement = @"end element '{0}' from namespace '{1}'";
-public const string XmlFoundEndOfFile = @"end of file";
-public const string XmlFoundNodeType = @"node {0}";
-public const string XmlFoundText = @"text '{0}'";
-public const string XmlFullStartElementExpected = @"Non-empty start element expected. Found {0}.";
-public const string XmlFullStartElementLocalNameNsExpected = @"Non-empty start element '{0}' from namespace '{1}' expected. Found {2}.";
-public const string XmlFullStartElementNameExpected = @"Non-empty start element '{0}' expected. Found {1}.";
-public const string XmlIDDefined = @"ID already defined.";
-public const string XmlKeyAlreadyExists = @"The specified key already exists in the dictionary.";
-public const string XmlIllegalOutsideRoot = @"Text cannot be written outside the root element.";
-public const string XmlInvalidBytes = @"Invalid byte encoding.";
-public const string XmlInvalidCharRef = @"Character reference not valid.";
-public const string XmlInvalidCommentChars = @"XML comments cannot contain '--' or end with '-'.";
-public const string XmlInvalidDeclaration = @"XML declaration can only be written at the beginning of the document.";
-public const string XmlInvalidDepth = @"Cannot call '{0}' while Depth is '{1}'.";
-public const string XmlInvalidEncoding = @"XML encoding must be 'UTF-8'.";
-public const string XmlInvalidFFFE = @"Characters with hexadecimal values 0xFFFE and 0xFFFF are not valid.";
-public const string XmlInvalidFormat = @"The input source is not correctly formatted.";
-public const string XmlInvalidID = @"ID must be >= 0.";
-public const string XmlInvalidOperation = @"The reader cannot be advanced.";
-public const string XmlInvalidPrefixState = @"A prefix cannot be defined while WriteState is '{0}'.";
-public const string XmlInvalidQualifiedName = @"Expected XML qualified name. Found '{0}'.";
-public const string XmlInvalidRootData = @"The data at the root level is invalid.";
-public const string XmlInvalidStandalone = @"'standalone' value in declaration must be 'yes' or 'no'.";
-public const string XmlInvalidStream = @"Stream returned by IStreamProvider cannot be null.";
-public const string XmlInvalidUniqueId = @"UniqueId cannot be zero length.";
-public const string XmlInvalidUTF8Bytes = @"'{0}' contains invalid UTF8 bytes.";
-public const string XmlInvalidVersion = @"XML version must be '1.0'.";
-public const string XmlInvalidWriteState = @"'{0}' cannot be called while WriteState is '{1}'.";
-public const string XmlInvalidXmlByte = @"The byte 0x{0} is not valid at this location.";
-public const string XmlInvalidXmlSpace = @"'{0}' is not a valid xml:space value. Valid values are 'default' and 'preserve'.";
-public const string XmlLineInfo = @"Line {0}, position {1}.";
-public const string XmlMalformedDecl = @"Malformed XML declaration.";
-public const string XmlMaxArrayLengthExceeded = @"The maximum array length quota ({0}) has been exceeded while reading XML data. This quota may be increased by changing the MaxArrayLength property on the XmlDictionaryReaderQuotas object used when creating the XML reader.";
-
-
-public const string XmlMaxNameTableCharCountExceeded = @"The maximum nametable character count quota ({0}) has been exceeded while reading XML data. The nametable is a data structure used to store strings encountered during XML processing - long XML documents with non-repeating element names, attribute names and attribute values may trigger this quota. This quota may be increased by changing the MaxNameTableCharCount property on the XmlDictionaryReaderQuotas object used when creating the XML reader.";
-
-public const string XmlMethodNotSupported = @"This XmlWriter implementation does not support the '{0}' method.";
-public const string XmlMissingLowSurrogate = @"The surrogate pair is invalid. Missing a low surrogate character.";
-public const string XmlMultipleRootElements = @"There are multiple root elements.";
-public const string XmlNamespaceNotFound = @"The namespace '{0}' is not defined.";
-public const string XmlNestedArraysNotSupported = @"Nested arrays are not supported.";
-public const string XmlNoRootElement = @"The document does not have a root element.";
-public const string XmlOnlyOneRoot = @"Only one root element is permitted per document.";
-public const string XmlOnlyWhitespace = @"Only white space characters can be written with this method.";
-public const string XmlOnlySingleValue = @"Only a single typed value may be written inside an attribute or content.";
-public const string XmlPrefixBoundToNamespace = @"The prefix '{0}' is bound to the namespace '{1}' and cannot be changed to '{2}'.";
-public const string XmlProcessingInstructionNotSupported = @"Processing instructions (other than the XML declaration) and DTDs are not supported.";
-public const string XmlReservedPrefix = @"Prefixes beginning with ""xml"" (regardless of casing) are reserved for use by XML.";
-public const string XmlSpaceBetweenAttributes = @"Whitespace must appear between attributes.";
-public const string XmlSpecificBindingNamespace = @"The namespace '{1}' can only be bound to the prefix '{0}'.";
-public const string XmlSpecificBindingPrefix = @"The prefix '{0}' can only be bound to the namespace '{1}'.";
-public const string XmlStartElementLocalNameNsExpected = @"Start element '{0}' from namespace '{1}' expected. Found {2}.";
-public const string XmlStartElementNameExpected = @"Start element '{0}' expected. Found {1}.";
-public const string XmlTagMismatch = @"Start element '{0}' does not match end element '{1}'.";
-public const string XmlTokenExpected = @"The token '{0}' was expected but found '{1}'.";
-public const string XmlUndefinedPrefix = @"The prefix '{0}' is not defined.";
-public const string XmlUnexpectedEndElement = @"No matching start tag for end element.";
-public const string XmlUnexpectedEndOfFile = @"Unexpected end of file. Following elements are not closed: {0}.";
-public const string XmlWriterClosed = @"The XmlWriter is closed.";
-public const string Xml_InvalidNmToken = @"Invalid NmToken value '{0}'.";
-
- }
-}
-
-#endregion
+}
\ No newline at end of file
--- /dev/null
+using System.Globalization;
+
+namespace System.Runtime.Serialization
+{
+ static partial class SR
+ {
+ internal static string GetString(string name, params object[] args)
+ {
+ return GetString (CultureInfo.InvariantCulture, name, args);
+ }
+
+ internal static string GetString(CultureInfo culture, string name, params object[] args)
+ {
+ return string.Format (culture, name, args);
+ }
+
+ internal static string GetString(string name)
+ {
+ return name;
+ }
+
+ internal static string GetString(CultureInfo culture, string name)
+ {
+ return name;
+ }
+
+#region MissingInStrings.txt
+
+//
+// This was retrieved as follows:
+//
+// 1. mcs ReferenceSources/SR.cs -t:library -out:existing.dll
+// 2. mcs {https://raw.githubusercontent.com/mono/mono/wip-serialization-halfway/mcs/class/System.Runtime.Serialization/ReferenceSource/SR.cs} -t:library -out:full.dll
+// 3. csharp -e "System.IO.File.WriteAllLines ("existing.txt", System.Reflection.Assembly.ReflectionOnlyLoadFrom ("existing.dll").GetTypes ().SelectMany (t => t.GetFields ()).Select (f => f.Name).ToArray ())"
+// 4. csharp -e "System.IO.File.WriteAllLines ("full.txt", System.Reflection.Assembly.ReflectionOnlyLoadFrom ("full.dll").GetTypes ().SelectMany (t => t.GetFields ()).Select (f => f.Name).ToArray ())"
+// 5. csharp
+// var existing = System.IO.File.ReadAllLines ("existing.txt");
+// var full = System.IO.File.ReadAllLines ("full.txt");
+// var missing = full.Where (f => !existing.Contains (f));
+// System.IO.File.WriteAllLines ("missing.cs", missing.Select (m => "public const string " + m + " = @\"" + m + "\";").ToArray ())
+// 6. copy missing.cs contents here.
+//
+
+public const string AbstractElementNotSupported = @"Abstract element '{0}' is not supported.";
+public const string AbstractTypeNotSupported = @"Abstract type is not supported";
+public const string AmbiguousReferencedCollectionTypes1 = @"Ambiguous collection types were referenced: {0}";
+public const string AmbiguousReferencedCollectionTypes3 = @"In '{0}' element in '{1}' namespace, ambiguous collection types were referenced: {2}";
+public const string AmbiguousReferencedTypes1 = @"Ambiguous types were referenced: {0}";
+public const string AmbiguousReferencedTypes3 = @"In '{0}' element in '{1}' namespace, ambiguous types were referenced: {2}";
+public const string AnnotationAttributeNotFound = @"Annotation attribute was not found: default value annotation is '{0}', type is '{1}' in '{2}' namespace, emit default value is {3}.";
+public const string AnonymousTypeNotSupported = @"Anonymous type is not supported. Type is '{0}' in '{1}' namespace.";
+public const string AnyAttributeNotSupported = @"XML Schema 'any' attribute is not supported";
+public const string ArrayItemFormMustBe = @"For array item, element 'form' must be {0}.";
+public const string ArraySizeAttributeIncorrect = @"Array size attribute is incorrect; must be between {0} and {1}.";
+
+public const string ArrayTypeCannotBeImported = @"Array type cannot be imported for '{0}' in '{1}' namespace: {2}.";
+public const string AssemblyNotFound = @"Assembly '{0}' was not found.";
+public const string AttributeNotFound = @"Attribute was not found for CLR type '{1}' in namespace '{0}'. XML reader node is on {2}, '{4}' node in '{3}' namespace.";
+public const string BaseTypeNotISerializable = @"Base type '{0}' in '{1}' namespace is not ISerializable.";
+public const string CannotComputeUniqueName = @"Cannot compute unique name for '{0}'.";
+public const string CannotDeriveFromSealedReferenceType = @"Cannod drive from sealed reference type '{2}', for '{0}' element in '{1}' namespace.";
+public const string CannotDeserializeForwardedType = @"Cannot deserialize forwarded type '{0}'.";
+public const string CannotExportNullAssembly = @"Cannot export null assembly.";
+public const string CannotExportNullKnownType = @"Cannot export null known type.";
+public const string CannotExportNullType = @"Cannot export null type.";
+public const string CannotHaveDuplicateAttributeNames = @"Cannot have duplicate attribute names '{0}'.";
+public const string CannotHaveDuplicateElementNames = @"Cannot have duplicate element names '{0}'.";
+public const string CannotImportInvalidSchemas = @"Cannot import invalid schemas.";
+public const string CannotImportNullDataContractName = @"Cannot import data contract with null name.";
+public const string CannotImportNullSchema = @"Cannot import from schema list that contains null.";
+public const string CannotSetMembersForReferencedType = @"Cannot set members for already referenced type. Base type is '{0}'.";
+public const string CannotSetNamespaceForReferencedType = @"Cannot set namespace for already referenced type. Base type is '{0}'.";
+public const string CannotUseGenericTypeAsBase = @"For '{0}' in '{1}' namespace, generic type cannot be referenced as the base type.";
+public const string ChangingFullTypeNameNotSupported = @"Changing full type name is not supported. Serialization type name: '{0}', data contract type name: '{1}'.";
+public const string CircularTypeReference = @"Circular type reference was found for '{0}' in '{1}' namespace.";
+public const string ClassDataContractReturnedForGetOnlyCollection = @"For '{0}' type, class data contract was returned for get-only collection.";
+public const string CLRNamespaceMappedMultipleTimes = @"CLR namespace is mapped multiple times. Current data contract namespace is '{0}', found '{1}' for CLR namespace '{2}'.";
+public const string ClrTypeNotFound = @"CLR type '{1}' in assembly '{0}' is not found.";
+public const string CollectionAssignedToIncompatibleInterface = @"Collection of type '{0}' is assigned to an incompatible interface '{1}'";
+public const string ComplexTypeRestrictionNotSupported = @"XML schema complexType restriction is not supported.";
+public const string ConfigDataContractSerializerSectionLoadError = @"Failed to load configuration section for dataContractSerializer.";
+public const string ConfigIndexOutOfRange = @"For type '{0}', configuration index is out of range.";
+public const string ConfigMustOnlyAddParamsWithType = @"Configuration parameter element must only add params with type."; // huh? the code doesn't make a lot of sense to me...
+public const string ConfigMustOnlySetTypeOrIndex = @"Configuration parameter element can set only one of either type or index.";
+public const string ConfigMustSetTypeOrIndex = @"Configuration parameter element must set either type or index.";
+public const string CouldNotReadSerializationSchema = @"Could not read serialization schema for '{0}' namespace.";
+public const string DefaultOnElementNotSupported = @"On element '{0}', default value is not supported.";
+public const string DerivedTypeNotISerializable = @"On type '{0}' in '{1}' namespace, derived type is not ISerializable.";
+public const string DupContractInDataContractSet = @"Duplicate contract in data contract set was found, for '{0}' in '{1}' namespace.";
+public const string DuplicateExtensionDataSetMethod = @"Duplicate extension data set method was found, for method '{0}', existing method is '{1}', on data contract type '{2}'.";
+public const string DupTypeContractInDataContractSet = @"Duplicate type contract in data contract set. Type name '{0}', for data contract '{1}' in '{2}' namespace.";
+public const string ElementMaxOccursMustBe = @"On element '{0}', schema element maxOccurs must be 1.";
+public const string ElementMinOccursMustBe = @"On element '{0}', schema element minOccurs must be less or equal to 1.";
+public const string ElementRefOnLocalElementNotSupported = @"For local element, ref is not supported. The referenced name is '{0}' in '{1}' namespace.";
+public const string EnumEnumerationFacetsMustHaveValue = @"Schema enumeration facet must have values.";
+public const string EnumListInAnonymousTypeNotSupported = @"Enum list in anonymous type is not supported.";
+public const string EnumListMustContainAnonymousType = @"Enum list must contain an anonymous type.";
+public const string EnumOnlyEnumerationFacetsSupported = @"For schema facets, only enumeration is supported.";
+public const string EnumRestrictionInvalid = @"For simpleType restriction, only enum is supported and this type could not be convert to enum.";
+public const string EnumTypeCannotBeImported = @"For '{0}' in '{1}' namespace, enum type cannot be imported: {2}";
+public const string EnumTypeNotSupportedByDataContractJsonSerializer = @"Enum type is not supported by DataContractJsonSerializer. The underlying type is '{0}'.";
+public const string EnumUnionInAnonymousTypeNotSupported = @"Enum union in anonymous type is not supported.";
+public const string ExtensionDataSetMustReturnVoid = @"For type '{0}' method '{1}', extension data set method must return void.";
+public const string ExtensionDataSetParameterInvalid = @"For type '{0}' method '{1}', extension data set method has invalid type of parameter '{2}'.";
+public const string FactoryObjectContainsSelfReference = @"Factory object contains a reference to self. Old object is '{0}', new object is '{1}'.";
+public const string FactoryTypeNotISerializable = @"For data contract '{1}', factory type '{0}' is not ISerializable.";
+public const string FixedOnElementNotSupported = @"On schema element '{0}', fixed value is not supported.";
+public const string FlushBufferAlreadyInUse = @"Flush buffer is already in use.";
+public const string FormMustBeQualified = @"On schema element '{0}', form must be qualified.";
+public const string GenericAnnotationAttributeNotFound = @"On type '{0}' Generic annotation attribute '{1}' was not found.";
+public const string GenericAnnotationForNestedLevelMustBeIncreasing = @"On type '{2}', generic annotation for nested level must be increasing. Argument element is '{0}' in '{1}' namespace.";
+public const string GenericAnnotationHasInvalidAttributeValue = @"On type '{2}', generic annotation has invalid attribute value '{3}'. Argument element is '{0}' in '{1}' namespace. Nested level attribute attribute name is '{4}'. Type is '{5}'."; // dunno if this makes sense...
+public const string GenericAnnotationHasInvalidElement = @"On type '{2}', generic annotation has invalid element. Argument element is '{0}' in '{1}' namespace.";
+public const string GenericTypeNameMismatch = @"Generic type name mismatch. Expected '{0}' in '{1}' namespace, got '{2}' in '{3}' namespace instead.";
+public const string GenericTypeNotExportable = @"Generic type '{0}' is not exportable.";
+public const string GetOnlyCollectionMustHaveAddMethod = @"On type '{0}', get-only collection must have an Add method.";
+public const string GetRealObjectReturnedNull = @"On the surrogate data contract for '{0}', GetRealObject method returned null.";
+public const string InvalidAnnotationExpectingText = @"For annotation element '{0}' in namespace '{1}', expected text but got element '{2}' in '{3}' namespace.";
+public const string InvalidAssemblyFormat = @"'{0}': invalid assembly format.";
+public const string InvalidCharacterEncountered = @"Encountered an invalid character '{0}'.";
+public const string InvalidClassDerivation = @"Invalid class derivation from '{0}' in '{1}' namespace.";
+public const string InvalidClrNameGeneratedForISerializable = @"Invalid CLR name '{2}' is generated for ISerializable type '{0}' in '{1}' namespace.";
+public const string InvalidClrNamespaceGeneratedForISerializable = @"Invalid CLR namespace '{3}' is generated for ISerializable type '{0}' in '{1}' namespace. Data contract namespace from the URI would be generated as '{2}'.";
+public const string InvalidDataNode = @"Invalid data node for '{0}' type.";
+public const string InvalidEmitDefaultAnnotation = @"Invalid EmilDefault annotation for '{0}' in type '{1}' in '{2}' namespace.";
+public const string InvalidEnumBaseType = @"Invalid enum base type is specified for type '{0}' in '{1}' namespace, element name is '{2}' in '{3}' namespace.";
+public const string InvalidISerializableDerivation = @"Invalid ISerializable derivation from '{0}' in '{1}' namespace.";
+public const string InvalidKeyValueType = @"'{0}' is an invalid key value type.";
+public const string InvalidKeyValueTypeNamespace = @"'{0}' in '{1}' namespace is an invalid key value type.";
+public const string InvalidReturnSchemaOnGetSchemaMethod = @"On type '{0}', the return value from GetSchema method was invalid.";
+public const string InvalidStateInExtensionDataReader = @"Invalid state in extension data reader.";
+public const string InvalidXmlDeserializingExtensionData = @"Invalid XML while deserializing extension data.";
+public const string IsAnyNotSupportedByNetDataContractSerializer = @"For type '{0}', IsAny is not supported by NetDataContractSerializer.";
+public const string IsDictionaryFormattedIncorrectly = @"IsDictionary formatted value '{0}' is incorrect: {1}";
+public const string ISerializableAssemblyNameSetToZero = @"ISerializable AssemblyName is set to ""0"" for type '{0}'.";
+public const string ISerializableCannotHaveDataContract = @"ISerializable type '{0}' cannot have DataContract.";
+public const string ISerializableContainsMoreThanOneItems = @"ISerializable cannot contain more than one item.";
+public const string ISerializableDerivedContainsOneOrMoreItems = @"Type derived from ISerializable cannot contain more than one item.";
+public const string ISerializableDoesNotContainAny = @"ISerializable does not contain any element.";
+public const string ISerializableMustRefFactoryTypeAttribute = @"ISerializable must have ref attribute that points to its factory type.";
+public const string ISerializableTypeCannotBeImported = @"ISerializable type '{0}' in '{1}' namespace cannot be imported: {2}";
+public const string ISerializableWildcardMaxOccursMustBe = @"ISerializable wildcard maxOccurs must be '{0}'.";
+public const string ISerializableWildcardMinOccursMustBe = @"ISerializable wildcard maxOccurs must be '{0}'.";
+public const string ISerializableWildcardNamespaceInvalid = @"ISerializable wildcard namespace is invalid: '{0}'.";
+public const string ISerializableWildcardProcessContentsInvalid = @"ISerializable wildcard processContents is invalid: '{0}'.";
+public const string IsReferenceGetOnlyCollectionsNotSupported = @"On type '{1}', attribute '{0}' points to get-only collection, which is not supported.";
+public const string IsValueTypeFormattedIncorrectly = @"IsValueType is formatted incorrectly as '{0}': {1}";
+public const string JsonAttributeAlreadyWritten = @"JSON attribute '{0}' is already written.";
+public const string JsonAttributeMustHaveElement = @"JSON attribute must have an owner element.";
+public const string JsonCannotWriteStandaloneTextAfterQuotedText = @"JSON writer cannot write standalone text after quoted text.";
+public const string JsonCannotWriteTextAfterNonTextAttribute = @"JSON writer cannot write text after non-text attribute. Data type is '{0}'.";
+public const string JsonDateTimeOutOfRange = @"JSON DateTime is out of range.";
+public const string JsonDuplicateMemberInInput = @"Duplicate member '{0}' is found in JSON input.";
+public const string JsonDuplicateMemberNames = @"Duplicate member, including '{1}', is found in JSON input, in type '{0}'.";
+public const string JsonEncodingNotSupported = @"JSON Encoding is not supported.";
+public const string JsonEncounteredUnexpectedCharacter = @"Encountered an unexpected character '{0}' in JSON.";
+public const string JsonEndElementNoOpenNodes = @"Encountered an end element while there was no open element in JSON writer.";
+public const string JsonExpectedEncoding = @"Expected encoding '{0}', got '{1}' instead.";
+public const string JsonInvalidBytes = @"Invalid bytes in JSON.";
+public const string JsonInvalidDataTypeSpecifiedForServerType = @"The specified data type is invalid for server type. Type: '{0}', specified data type: '{1}', server type: '{2}', object '{3}'."; // I wonder if this makes sense...
+public const string JsonInvalidDateTimeString = @"Invalid JSON dateTime string is specified: original value '{0}', start guide writer: {1}, end guard writer: {2}.";
+public const string JsonInvalidFFFE = @"FFFE in JSON is invalid.";
+public const string JsonInvalidItemNameForArrayElement = @"Invalid JSON item name '{0}' for array element (item element is '{1}' in JSON).";
+public const string JsonInvalidLocalNameEmpty = @"Empty string is invalid as a local name.";
+public const string JsonInvalidMethodBetweenStartEndAttribute = @"Invalid method call state between start and end attribute.";
+public const string JsonInvalidRootElementName = @"Invalid root element name '{0}' (root element is '{1}' in JSON).";
+public const string JsonInvalidStartElementCall = @"Invalid call to JSON WriteStartElement method.";
+public const string JsonInvalidWriteState = @"Invalid write state {1} for '{0}' method.";
+public const string JsonMethodNotSupported = @"Method {0} is not supported in JSON.";
+public const string JsonMultipleRootElementsNotAllowedOnWriter = @"Multiple root element is not allowed on JSON writer.";
+public const string JsonMustSpecifyDataType = @"On JSON writer data type '{0}' must be specified. Object string is '{1}', server type string is '{2}'.";
+public const string JsonMustUseWriteStringForWritingAttributeValues = @"On JSON writer WriteString must be used for writing attribute values.";
+public const string JsonNamespaceMustBeEmpty = @"JSON namespace is specified as '{0}' but it must be empty.";
+public const string JsonNestedArraysNotSupported = @"Nested array is not supported in JSON: '{0}'";
+public const string JsonNodeTypeArrayOrObjectNotSpecified = @"Either Object or Array of JSON node type must be specified.";
+public const string JsonNoMatchingStartAttribute = @"WriteEndAttribute was called while there is no open attribute.";
+public const string JsonOffsetExceedsBufferSize = @"On JSON writer, offset exceeded buffer size {0}.";
+public const string JsonOneRequiredMemberNotFound = @"Required member {1} in type '{0}' is not found.";
+public const string JsonOnlyWhitespace = @"Only whitespace characters are allowed for {1} method. The specified value is '{0}'";
+public const string JsonOpenAttributeMustBeClosedFirst = @"JSON attribute must be closed first before calling {0} method.";
+public const string JsonPrefixMustBeNullOrEmpty = @"JSON prefix must be null or empty. '{0}' is specified instead.";
+public const string JsonRequiredMembersNotFound = @"Required members {0} in type '{1}' are not found.";
+public const string JsonServerTypeSpecifiedForInvalidDataType = @"Server type is specified for invalid data type in JSON. Server type: '{0}', type: '{1}', dataType: '{2}', object: '{3}'.";
+public const string JsonSizeExceedsRemainingBufferSpace = @"JSON size exceeded remaining buffer space, by {0} byte(s).";
+public const string JsonTypeNotSupportedByDataContractJsonSerializer = @"Type '{0}' is not suppotred by DataContractJsonSerializer.";
+public const string JsonUnexpectedAttributeLocalName = @"Unexpected attribute local name '{0}'.";
+public const string JsonUnexpectedAttributeValue = @"Unexpected attribute value '{0}'.";
+public const string JsonUnexpectedEndOfFile = @"Unexpected end of file in JSON.";
+public const string JsonUnsupportedForIsReference = @"Unsupported value for IsReference for type '{0}', IsReference value is {1}.";
+public const string JsonWriteArrayNotSupported = @"JSON WriteArray is not supported.";
+public const string JsonWriterClosed = @"JSON writer is already closed.";
+public const string JsonXmlInvalidDeclaration = @"Attempt to write invalid XML declration.";
+public const string JsonXmlProcessingInstructionNotSupported = @"processing instruction is not supported in JSON writer.";
+public const string KeyTypeCannotBeParsedInSimpleDictionary = @"Key type '{1}' for collection type '{0}' cannot be parsed in simple dictionary.";
+public const string KnownTypeConfigGenericParamMismatch = @"Generic parameter count do not match between known type and configuration. Type is '{0}', known type has {1} parameters, configuration has {2} parameters.";
+public const string KnownTypeConfigIndexOutOfBounds = @"For known type configuration, index is out of bound. Root type: '{0}' has {1} type arguments, and index was {2}.";
+public const string KnownTypeConfigIndexOutOfBoundsZero = @"For known type configuration, index is out of bound. Root type: '{0}' has {1} type arguments, and index was {2}.";
+public const string KnownTypeConfigObject = @"Known type configuration specifies System.Object.";
+public const string MaxMimePartsExceeded = @"MIME parts number exceeded the maximum settings. Must be less than {0}. Specified as '{1}'.";
+public const string MimeContentTypeHeaderInvalid = @"MIME content type header is invalid.";
+public const string MimeHeaderInvalidCharacter = @"MIME header has an invalid character ('{0}', {1} in hexadecimal value).";
+public const string MimeMessageGetContentStreamCalledAlready = @"On MimeMessage, GetContentStream method is already called.";
+public const string MimeReaderHeaderAlreadyExists = @"MIME header '{0}' already exists.";
+public const string MimeReaderMalformedHeader = @"Malformed MIME header.";
+public const string MimeReaderResetCalledBeforeEOF = @"On MimeReader, Reset method is called before EOF.";
+public const string MimeReaderTruncated = @"MIME parts are truncated.";
+public const string MimeVersionHeaderInvalid = @"MIME version header is invalid.";
+public const string MimeWriterInvalidStateForClose = @"MIME writer is at invalid state for closing.";
+public const string MimeWriterInvalidStateForContent = @"MIME writer is at invalid state for content.";
+public const string MimeWriterInvalidStateForHeader = @"MIME writer is at invalid state for header.";
+public const string MimeWriterInvalidStateForStartPart = @"MIME writer is at invalid state for starting a part.";
+public const string MimeWriterInvalidStateForStartPreface = @"MIME writer is at invalid state for starting preface.";
+public const string MissingSchemaType = @"Schema type '{0}' is missing and required for '{1}' type.";
+public const string MixedContentNotSupported = @"Mixed content is not supported.";
+public const string MtomBoundaryInvalid = @"MIME boundary is invalid: '{0}'.";
+public const string MtomBufferQuotaExceeded = @"MTOM buffer quota exceeded. The maximum size is {0}.";
+public const string MtomContentTransferEncodingNotPresent = @"MTOM content transfer encoding is not present. ContentTransferEncoding header is '{0}'.";
+public const string MtomContentTransferEncodingNotSupported = @"MTOM content transfer encoding value is not supported. Raw value is '{0}', '{1}' in 7bit encoding, '{2}' in 8bit encoding, and '{3}' in binary.";
+public const string MtomContentTypeInvalid = @"MTOM content type is invalid.";
+public const string MtomDataMustNotContainXopInclude = @"MTOM data must not contain xop:Include element. '{0}' element in '{1}' namespace.";
+public const string MtomExceededMaxSizeInBytes = @"MTOM exceeded max size in bytes. The maximum size is {0}.";
+public const string MtomInvalidCIDUri = @"Invalid MTOM CID URI: '{0}'.";
+public const string MtomInvalidEmptyURI = @"empty URI is invalid for MTOM MIME part.";
+public const string MtomInvalidStartUri = @"Invalid MTOM start URI: '{0}'.";
+public const string MtomInvalidTransferEncodingForMimePart = @"Invalid transfer encoding for MIME part: '{0}', in binary: '{1}'.";
+public const string MtomMessageContentTypeNotFound = @"MTOM message content type was not found.";
+public const string MtomMessageInvalidContent = @"MTOM message content is invalid.";
+public const string MtomMessageInvalidContentInMimePart = @"MTOM message content in MIME part is invalid.";
+public const string MtomMessageInvalidMimeVersion = @"MTOM message has invalid MIME version. Expected '{1}', got '{0}' instead.";
+public const string MtomMessageNotApplicationXopXml = @"MTOM msssage type is not '{0}'.";
+public const string MtomMessageNotMultipart = @"MTOM message is not multipart: media type should be '{0}', media subtype should be '{1}'.";
+public const string MtomMessageRequiredParamNotSpecified = @"Required MTOM parameter '{0}' is not specified.";
+public const string MtomMimePartReferencedMoreThanOnce = @"Specified MIME part '{0}' is referenced more than once.";
+public const string MtomPartNotFound = @"MTOM part with URI '{0}' is not found.";
+public const string MtomRootContentTypeNotFound = @"MTOM root content type is not found.";
+public const string MtomRootNotApplicationXopXml = @"MTOM root should have media type '{0}' and subtype '{1}'.";
+public const string MtomRootPartNotFound = @"MTOM root part is not found.";
+public const string MtomRootRequiredParamNotSpecified = @"Required MTOM root parameter '{0}' is not specified.";
+public const string MtomRootUnexpectedCharset = @"Unexpected charset on MTOM root. Expected '{1}', got '{0}' instead.";
+public const string MtomRootUnexpectedType = @"Unexpected type on MTOM root. Expected '{1}', got '{0}' instead.";
+public const string MtomXopIncludeHrefNotSpecified = @"xop Include element did not specify '{0}' attribute.";
+public const string MtomXopIncludeInvalidXopAttributes = @"xop Include element has invalid attribute: '{0}' in '{1}' namespace.";
+public const string MtomXopIncludeInvalidXopElement = @"xop Include element has invalid element: '{0}' in '{1}' namespace.";
+public const string MustContainOnlyLocalElements = @"Only local elements can be imported.";
+public const string NoAsyncWritePending = @"No async write operation is pending.";
+public const string NonOptionalFieldMemberOnIsReferenceSerializableType = @"For type '{0}', non-optional field member '{1}' is on the Serializable type that has IsReference as {2}.";
+public const string OnlyDataContractTypesCanHaveExtensionData = @"On '{0}' type, only DataContract types can have extension data.";
+public const string PartialTrustISerializableNoPublicConstructor = @"Partial trust access required for the constructor on the ISerializable type '{0}'";
+public const string QueryGeneratorPathToMemberNotFound = @"The path to member was not found for XPath query generator.";
+public const string ReadNotSupportedOnStream = @"Read operation is not supported on the Stream.";
+public const string ReadOnlyClassDeserialization = @"Error on deserializing read-only members in the class: {0}";
+public const string ReadOnlyCollectionDeserialization = @"Error on deserializing read-only collection: {0}";
+public const string RecursiveCollectionType = @"Type '{0}' involves recursive collection.";
+public const string RedefineNotSupported = @"XML Schema 'redefine' is not supported.";
+public const string ReferencedBaseTypeDoesNotExist = @"Referenced base type does not exist. Data contract name: '{0}' in '{1}' namespace, expected type: '{2}' in '{3}' namespace. Collection can be '{4}' or '{5}'."; // is it the expected message? I'm quite unsure.
+public const string ReferencedCollectionTypesCannotContainNull = @"Referenced collection types cannot contain null.";
+public const string ReferencedTypeDoesNotMatch = @"Referenced type '{0}' does not match the expected type '{1}' in '{2}' namespace.";
+public const string ReferencedTypeMatchingMessage = @"Reference type matches.";
+public const string ReferencedTypeNotMatchingMessage = @"Reference type does not match.";
+public const string ReferencedTypesCannotContainNull = @"Referenced types cannot contain null.";
+public const string RequiresClassDataContractToSetIsISerializable = @"To set IsISerializable, class data cotnract is required.";
+public const string RootParticleMustBeSequence = @"Root particle must be sequence to be imported.";
+public const string RootSequenceMaxOccursMustBe = @"On root sequence, maxOccurs must be 1.";
+public const string RootSequenceMustBeRequired = @"Root sequence must have an item and minOccurs must be 1.";
+public const string SeekNotSupportedOnStream = @"Seek operation is not supported on this Stream.";
+public const string SerializationInfo_ConstructorNotFound = @"Constructor that takes SerializationInfo and StreamingContext is not found for '{0}'.";
+public const string SimpleContentNotSupported = @"Simple content is not supported.";
+public const string SimpleTypeRestrictionDoesNotSpecifyBase = @"This simpleType restriction does not specify the base type.";
+public const string SimpleTypeUnionNotSupported = @"simpleType union is not supported.";
+public const string SpecifiedTypeNotFoundInSchema = @"Specified type '{0}' in '{1}' namespace is not found in the schemas.";
+public const string SubstitutionGroupOnElementNotSupported = @"substitutionGroups on elements are not supported.";
+public const string SurrogatesWithGetOnlyCollectionsNotSupported = @"Surrogates with get-only collections are not supported. Type '{1}' contains '{2}' which is of '{0}' type.";
+public const string SurrogatesWithGetOnlyCollectionsNotSupportedSerDeser = @"Surrogates with get-only collections are not supported. Found on type '{0}'.";
+public const string TopLevelElementRepresentsDifferentType = @"Top-level element represents a different type. Expected '{0}' type in '{1}' namespace.";
+public const string TraceCodeElementIgnored = @"Element ignored";
+public const string TraceCodeFactoryTypeNotFound = @"Factory type not found";
+public const string TraceCodeObjectWithLargeDepth = @"Object with large depth";
+public const string TraceCodeReadObjectBegin = @"ReadObject begins";
+public const string TraceCodeReadObjectEnd = @"ReadObject ends";
+public const string TraceCodeWriteObjectBegin = @"WriteObject begins";
+public const string TraceCodeWriteObjectContentBegin = @"WriteObjectContent begins";
+public const string TraceCodeWriteObjectContentEnd = @"WriteObjectContent ends";
+public const string TraceCodeWriteObjectEnd = @"WriteObject ends";
+public const string TraceCodeXsdExportAnnotationFailed = @"XSD export annotation failed";
+public const string TraceCodeXsdExportBegin = @"XSD export begins";
+public const string TraceCodeXsdExportDupItems = @"XSD export duplicate items";
+public const string TraceCodeXsdExportEnd = @"XSD export ends";
+public const string TraceCodeXsdExportError = @"XSD export error";
+public const string TraceCodeXsdImportAnnotationFailed = @"XSD import annotation failed";
+public const string TraceCodeXsdImportBegin = @"XSD import begins";
+public const string TraceCodeXsdImportEnd = @"XSD import ends";
+public const string TraceCodeXsdImportError = @"XSD import error";
+public const string TypeCannotBeForwardedFrom = @"Type '{0}' in assembly '{1}' cannot be forwarded from assembly '{2}'.";
+public const string TypeCannotBeImported = @"Type '{0}' in '{1}' namespace cannot be imported: {2}";
+public const string TypeCannotBeImportedHowToFix = @"Type cannot be imported: {0}"; // I cannot see where HowToFix is given from...
+public const string TypeHasNotBeenImported = @"Type '{0}' in '{1}' namespace has not been imported.";
+public const string TypeMustBeIXmlSerializable = @"Type '{0}' must be IXmlSerializable. Contract type: '{1}', contract name: '{2}' in '{3}' namespace.";
+public const string TypeShouldNotContainAttributes = @"Type should not contain attributes. Serialization namespace: '{0}'.";
+public const string UnknownXmlType = @"Unknown XML type: '{0}'.";
+public const string WriteBufferOverflow = @"Write buffer overflow.";
+public const string WriteNotSupportedOnStream = @"Write operation is not supported on this '{0}' Stream.";
+public const string XmlCanonicalizationNotStarted = @"XML canonicalization was not started.";
+public const string XmlCanonicalizationStarted = @"XML canonicalization started";
+public const string XmlMaxArrayLengthOrMaxItemsQuotaExceeded = @"XML max array length or max items quota exceeded. It must be less than {0}.";
+public const string XmlMaxBytesPerReadExceeded = @"XML max bytes per read exceeded. It must be less than {0}.";
+public const string XmlMaxDepthExceeded = @"XML max depth exceeded. It must be less than {0}.";
+public const string XmlMaxStringContentLengthExceeded = @"XML max string content length exceeded. It must be less than {0}.";
+public const string XmlObjectAssignedToIncompatibleInterface = @"Object of type '{0}' is assigned to an incompatible interface '{1}'.";
+
+#endregion
+ }
+}
+++ /dev/null
-namespace System.Runtime.Serialization
-{
- static partial class SR
- {
-
-#region MissingInStrings.txt
-
-//
-// This was retrieved as follows:
-//
-// 1. mcs ReferenceSources/SR.cs -t:library -out:existing.dll
-// 2. mcs {https://raw.githubusercontent.com/mono/mono/wip-serialization-halfway/mcs/class/System.Runtime.Serialization/ReferenceSource/SR.cs} -t:library -out:full.dll
-// 3. csharp -e "System.IO.File.WriteAllLines ("existing.txt", System.Reflection.Assembly.ReflectionOnlyLoadFrom ("existing.dll").GetTypes ().SelectMany (t => t.GetFields ()).Select (f => f.Name).ToArray ())"
-// 4. csharp -e "System.IO.File.WriteAllLines ("full.txt", System.Reflection.Assembly.ReflectionOnlyLoadFrom ("full.dll").GetTypes ().SelectMany (t => t.GetFields ()).Select (f => f.Name).ToArray ())"
-// 5. csharp
-// var existing = System.IO.File.ReadAllLines ("existing.txt");
-// var full = System.IO.File.ReadAllLines ("full.txt");
-// var missing = full.Where (f => !existing.Contains (f));
-// System.IO.File.WriteAllLines ("missing.cs", missing.Select (m => "public const string " + m + " = @\"" + m + "\";").ToArray ())
-// 6. copy missing.cs contents here.
-//
-
-public const string AbstractElementNotSupported = @"Abstract element '{0}' is not supported.";
-public const string AbstractTypeNotSupported = @"Abstract type is not supported";
-public const string AmbiguousReferencedCollectionTypes1 = @"Ambiguous collection types were referenced: {0}";
-public const string AmbiguousReferencedCollectionTypes3 = @"In '{0}' element in '{1}' namespace, ambiguous collection types were referenced: {2}";
-public const string AmbiguousReferencedTypes1 = @"Ambiguous types were referenced: {0}";
-public const string AmbiguousReferencedTypes3 = @"In '{0}' element in '{1}' namespace, ambiguous types were referenced: {2}";
-public const string AnnotationAttributeNotFound = @"Annotation attribute was not found: default value annotation is '{0}', type is '{1}' in '{2}' namespace, emit default value is {3}.";
-public const string AnonymousTypeNotSupported = @"Anonymous type is not supported. Type is '{0}' in '{1}' namespace.";
-public const string AnyAttributeNotSupported = @"XML Schema 'any' attribute is not supported";
-public const string ArrayItemFormMustBe = @"For array item, element 'form' must be {0}.";
-public const string ArraySizeAttributeIncorrect = @"Array size attribute is incorrect; must be between {0} and {1}.";
-
-public const string ArrayTypeCannotBeImported = @"Array type cannot be imported for '{0}' in '{1}' namespace: {2}.";
-public const string AssemblyNotFound = @"Assembly '{0}' was not found.";
-public const string AttributeNotFound = @"Attribute was not found for CLR type '{1}' in namespace '{0}'. XML reader node is on {2}, '{4}' node in '{3}' namespace.";
-public const string BaseTypeNotISerializable = @"Base type '{0}' in '{1}' namespace is not ISerializable.";
-public const string CannotComputeUniqueName = @"Cannot compute unique name for '{0}'.";
-public const string CannotDeriveFromSealedReferenceType = @"Cannod drive from sealed reference type '{2}', for '{0}' element in '{1}' namespace.";
-public const string CannotDeserializeForwardedType = @"Cannot deserialize forwarded type '{0}'.";
-public const string CannotExportNullAssembly = @"Cannot export null assembly.";
-public const string CannotExportNullKnownType = @"Cannot export null known type.";
-public const string CannotExportNullType = @"Cannot export null type.";
-public const string CannotHaveDuplicateAttributeNames = @"Cannot have duplicate attribute names '{0}'.";
-public const string CannotHaveDuplicateElementNames = @"Cannot have duplicate element names '{0}'.";
-public const string CannotImportInvalidSchemas = @"Cannot import invalid schemas.";
-public const string CannotImportNullDataContractName = @"Cannot import data contract with null name.";
-public const string CannotImportNullSchema = @"Cannot import from schema list that contains null.";
-public const string CannotSetMembersForReferencedType = @"Cannot set members for already referenced type. Base type is '{0}'.";
-public const string CannotSetNamespaceForReferencedType = @"Cannot set namespace for already referenced type. Base type is '{0}'.";
-public const string CannotUseGenericTypeAsBase = @"For '{0}' in '{1}' namespace, generic type cannot be referenced as the base type.";
-public const string ChangingFullTypeNameNotSupported = @"Changing full type name is not supported. Serialization type name: '{0}', data contract type name: '{1}'.";
-public const string CircularTypeReference = @"Circular type reference was found for '{0}' in '{1}' namespace.";
-public const string ClassDataContractReturnedForGetOnlyCollection = @"For '{0}' type, class data contract was returned for get-only collection.";
-public const string CLRNamespaceMappedMultipleTimes = @"CLR namespace is mapped multiple times. Current data contract namespace is '{0}', found '{1}' for CLR namespace '{2}'.";
-public const string ClrTypeNotFound = @"CLR type '{1}' in assembly '{0}' is not found.";
-public const string CollectionAssignedToIncompatibleInterface = @"Collection of type '{0}' is assigned to an incompatible interface '{1}'";
-public const string ComplexTypeRestrictionNotSupported = @"XML schema complexType restriction is not supported.";
-public const string ConfigDataContractSerializerSectionLoadError = @"Failed to load configuration section for dataContractSerializer.";
-public const string ConfigIndexOutOfRange = @"For type '{0}', configuration index is out of range.";
-public const string ConfigMustOnlyAddParamsWithType = @"Configuration parameter element must only add params with type."; // huh? the code doesn't make a lot of sense to me...
-public const string ConfigMustOnlySetTypeOrIndex = @"Configuration parameter element can set only one of either type or index.";
-public const string ConfigMustSetTypeOrIndex = @"Configuration parameter element must set either type or index.";
-public const string CouldNotReadSerializationSchema = @"Could not read serialization schema for '{0}' namespace.";
-public const string DefaultOnElementNotSupported = @"On element '{0}', default value is not supported.";
-public const string DerivedTypeNotISerializable = @"On type '{0}' in '{1}' namespace, derived type is not ISerializable.";
-public const string DupContractInDataContractSet = @"Duplicate contract in data contract set was found, for '{0}' in '{1}' namespace.";
-public const string DuplicateExtensionDataSetMethod = @"Duplicate extension data set method was found, for method '{0}', existing method is '{1}', on data contract type '{2}'.";
-public const string DupTypeContractInDataContractSet = @"Duplicate type contract in data contract set. Type name '{0}', for data contract '{1}' in '{2}' namespace.";
-public const string ElementMaxOccursMustBe = @"On element '{0}', schema element maxOccurs must be 1.";
-public const string ElementMinOccursMustBe = @"On element '{0}', schema element minOccurs must be less or equal to 1.";
-public const string ElementRefOnLocalElementNotSupported = @"For local element, ref is not supported. The referenced name is '{0}' in '{1}' namespace.";
-public const string EnumEnumerationFacetsMustHaveValue = @"Schema enumeration facet must have values.";
-public const string EnumListInAnonymousTypeNotSupported = @"Enum list in anonymous type is not supported.";
-public const string EnumListMustContainAnonymousType = @"Enum list must contain an anonymous type.";
-public const string EnumOnlyEnumerationFacetsSupported = @"For schema facets, only enumeration is supported.";
-public const string EnumRestrictionInvalid = @"For simpleType restriction, only enum is supported and this type could not be convert to enum.";
-public const string EnumTypeCannotBeImported = @"For '{0}' in '{1}' namespace, enum type cannot be imported: {2}";
-public const string EnumTypeNotSupportedByDataContractJsonSerializer = @"Enum type is not supported by DataContractJsonSerializer. The underlying type is '{0}'.";
-public const string EnumUnionInAnonymousTypeNotSupported = @"Enum union in anonymous type is not supported.";
-public const string ExtensionDataSetMustReturnVoid = @"For type '{0}' method '{1}', extension data set method must return void.";
-public const string ExtensionDataSetParameterInvalid = @"For type '{0}' method '{1}', extension data set method has invalid type of parameter '{2}'.";
-public const string FactoryObjectContainsSelfReference = @"Factory object contains a reference to self. Old object is '{0}', new object is '{1}'.";
-public const string FactoryTypeNotISerializable = @"For data contract '{1}', factory type '{0}' is not ISerializable.";
-public const string FixedOnElementNotSupported = @"On schema element '{0}', fixed value is not supported.";
-public const string FlushBufferAlreadyInUse = @"Flush buffer is already in use.";
-public const string FormMustBeQualified = @"On schema element '{0}', form must be qualified.";
-public const string GenericAnnotationAttributeNotFound = @"On type '{0}' Generic annotation attribute '{1}' was not found.";
-public const string GenericAnnotationForNestedLevelMustBeIncreasing = @"On type '{2}', generic annotation for nested level must be increasing. Argument element is '{0}' in '{1}' namespace.";
-public const string GenericAnnotationHasInvalidAttributeValue = @"On type '{2}', generic annotation has invalid attribute value '{3}'. Argument element is '{0}' in '{1}' namespace. Nested level attribute attribute name is '{4}'. Type is '{5}'."; // dunno if this makes sense...
-public const string GenericAnnotationHasInvalidElement = @"On type '{2}', generic annotation has invalid element. Argument element is '{0}' in '{1}' namespace.";
-public const string GenericTypeNameMismatch = @"Generic type name mismatch. Expected '{0}' in '{1}' namespace, got '{2}' in '{3}' namespace instead.";
-public const string GenericTypeNotExportable = @"Generic type '{0}' is not exportable.";
-public const string GetOnlyCollectionMustHaveAddMethod = @"On type '{0}', get-only collection must have an Add method.";
-public const string GetRealObjectReturnedNull = @"On the surrogate data contract for '{0}', GetRealObject method returned null.";
-public const string InvalidAnnotationExpectingText = @"For annotation element '{0}' in namespace '{1}', expected text but got element '{2}' in '{3}' namespace.";
-public const string InvalidAssemblyFormat = @"'{0}': invalid assembly format.";
-public const string InvalidCharacterEncountered = @"Encountered an invalid character '{0}'.";
-public const string InvalidClassDerivation = @"Invalid class derivation from '{0}' in '{1}' namespace.";
-public const string InvalidClrNameGeneratedForISerializable = @"Invalid CLR name '{2}' is generated for ISerializable type '{0}' in '{1}' namespace.";
-public const string InvalidClrNamespaceGeneratedForISerializable = @"Invalid CLR namespace '{3}' is generated for ISerializable type '{0}' in '{1}' namespace. Data contract namespace from the URI would be generated as '{2}'.";
-public const string InvalidDataNode = @"Invalid data node for '{0}' type.";
-public const string InvalidEmitDefaultAnnotation = @"Invalid EmilDefault annotation for '{0}' in type '{1}' in '{2}' namespace.";
-public const string InvalidEnumBaseType = @"Invalid enum base type is specified for type '{0}' in '{1}' namespace, element name is '{2}' in '{3}' namespace.";
-public const string InvalidISerializableDerivation = @"Invalid ISerializable derivation from '{0}' in '{1}' namespace.";
-public const string InvalidKeyValueType = @"'{0}' is an invalid key value type.";
-public const string InvalidKeyValueTypeNamespace = @"'{0}' in '{1}' namespace is an invalid key value type.";
-public const string InvalidReturnSchemaOnGetSchemaMethod = @"On type '{0}', the return value from GetSchema method was invalid.";
-public const string InvalidStateInExtensionDataReader = @"Invalid state in extension data reader.";
-public const string InvalidXmlDeserializingExtensionData = @"Invalid XML while deserializing extension data.";
-public const string IsAnyNotSupportedByNetDataContractSerializer = @"For type '{0}', IsAny is not supported by NetDataContractSerializer.";
-public const string IsDictionaryFormattedIncorrectly = @"IsDictionary formatted value '{0}' is incorrect: {1}";
-public const string ISerializableAssemblyNameSetToZero = @"ISerializable AssemblyName is set to ""0"" for type '{0}'.";
-public const string ISerializableCannotHaveDataContract = @"ISerializable type '{0}' cannot have DataContract.";
-public const string ISerializableContainsMoreThanOneItems = @"ISerializable cannot contain more than one item.";
-public const string ISerializableDerivedContainsOneOrMoreItems = @"Type derived from ISerializable cannot contain more than one item.";
-public const string ISerializableDoesNotContainAny = @"ISerializable does not contain any element.";
-public const string ISerializableMustRefFactoryTypeAttribute = @"ISerializable must have ref attribute that points to its factory type.";
-public const string ISerializableTypeCannotBeImported = @"ISerializable type '{0}' in '{1}' namespace cannot be imported: {2}";
-public const string ISerializableWildcardMaxOccursMustBe = @"ISerializable wildcard maxOccurs must be '{0}'.";
-public const string ISerializableWildcardMinOccursMustBe = @"ISerializable wildcard maxOccurs must be '{0}'.";
-public const string ISerializableWildcardNamespaceInvalid = @"ISerializable wildcard namespace is invalid: '{0}'.";
-public const string ISerializableWildcardProcessContentsInvalid = @"ISerializable wildcard processContents is invalid: '{0}'.";
-public const string IsReferenceGetOnlyCollectionsNotSupported = @"On type '{1}', attribute '{0}' points to get-only collection, which is not supported.";
-public const string IsValueTypeFormattedIncorrectly = @"IsValueType is formatted incorrectly as '{0}': {1}";
-public const string JsonAttributeAlreadyWritten = @"JSON attribute '{0}' is already written.";
-public const string JsonAttributeMustHaveElement = @"JSON attribute must have an owner element.";
-public const string JsonCannotWriteStandaloneTextAfterQuotedText = @"JSON writer cannot write standalone text after quoted text.";
-public const string JsonCannotWriteTextAfterNonTextAttribute = @"JSON writer cannot write text after non-text attribute. Data type is '{0}'.";
-public const string JsonDateTimeOutOfRange = @"JSON DateTime is out of range.";
-public const string JsonDuplicateMemberInInput = @"Duplicate member '{0}' is found in JSON input.";
-public const string JsonDuplicateMemberNames = @"Duplicate member, including '{1}', is found in JSON input, in type '{0}'.";
-public const string JsonEncodingNotSupported = @"JSON Encoding is not supported.";
-public const string JsonEncounteredUnexpectedCharacter = @"Encountered an unexpected character '{0}' in JSON.";
-public const string JsonEndElementNoOpenNodes = @"Encountered an end element while there was no open element in JSON writer.";
-public const string JsonExpectedEncoding = @"Expected encoding '{0}', got '{1}' instead.";
-public const string JsonInvalidBytes = @"Invalid bytes in JSON.";
-public const string JsonInvalidDataTypeSpecifiedForServerType = @"The specified data type is invalid for server type. Type: '{0}', specified data type: '{1}', server type: '{2}', object '{3}'."; // I wonder if this makes sense...
-public const string JsonInvalidDateTimeString = @"Invalid JSON dateTime string is specified: original value '{0}', start guide writer: {1}, end guard writer: {2}.";
-public const string JsonInvalidFFFE = @"FFFE in JSON is invalid.";
-public const string JsonInvalidItemNameForArrayElement = @"Invalid JSON item name '{0}' for array element (item element is '{1}' in JSON).";
-public const string JsonInvalidLocalNameEmpty = @"Empty string is invalid as a local name.";
-public const string JsonInvalidMethodBetweenStartEndAttribute = @"Invalid method call state between start and end attribute.";
-public const string JsonInvalidRootElementName = @"Invalid root element name '{0}' (root element is '{1}' in JSON).";
-public const string JsonInvalidStartElementCall = @"Invalid call to JSON WriteStartElement method.";
-public const string JsonInvalidWriteState = @"Invalid write state {1} for '{0}' method.";
-public const string JsonMethodNotSupported = @"Method {0} is not supported in JSON.";
-public const string JsonMultipleRootElementsNotAllowedOnWriter = @"Multiple root element is not allowed on JSON writer.";
-public const string JsonMustSpecifyDataType = @"On JSON writer data type '{0}' must be specified. Object string is '{1}', server type string is '{2}'.";
-public const string JsonMustUseWriteStringForWritingAttributeValues = @"On JSON writer WriteString must be used for writing attribute values.";
-public const string JsonNamespaceMustBeEmpty = @"JSON namespace is specified as '{0}' but it must be empty.";
-public const string JsonNestedArraysNotSupported = @"Nested array is not supported in JSON: '{0}'";
-public const string JsonNodeTypeArrayOrObjectNotSpecified = @"Either Object or Array of JSON node type must be specified.";
-public const string JsonNoMatchingStartAttribute = @"WriteEndAttribute was called while there is no open attribute.";
-public const string JsonOffsetExceedsBufferSize = @"On JSON writer, offset exceeded buffer size {0}.";
-public const string JsonOneRequiredMemberNotFound = @"Required member {1} in type '{0}' is not found.";
-public const string JsonOnlyWhitespace = @"Only whitespace characters are allowed for {1} method. The specified value is '{0}'";
-public const string JsonOpenAttributeMustBeClosedFirst = @"JSON attribute must be closed first before calling {0} method.";
-public const string JsonPrefixMustBeNullOrEmpty = @"JSON prefix must be null or empty. '{0}' is specified instead.";
-public const string JsonRequiredMembersNotFound = @"Required members {0} in type '{1}' are not found.";
-public const string JsonServerTypeSpecifiedForInvalidDataType = @"Server type is specified for invalid data type in JSON. Server type: '{0}', type: '{1}', dataType: '{2}', object: '{3}'.";
-public const string JsonSizeExceedsRemainingBufferSpace = @"JSON size exceeded remaining buffer space, by {0} byte(s).";
-public const string JsonTypeNotSupportedByDataContractJsonSerializer = @"Type '{0}' is not suppotred by DataContractJsonSerializer.";
-public const string JsonUnexpectedAttributeLocalName = @"Unexpected attribute local name '{0}'.";
-public const string JsonUnexpectedAttributeValue = @"Unexpected attribute value '{0}'.";
-public const string JsonUnexpectedEndOfFile = @"Unexpected end of file in JSON.";
-public const string JsonUnsupportedForIsReference = @"Unsupported value for IsReference for type '{0}', IsReference value is {1}.";
-public const string JsonWriteArrayNotSupported = @"JSON WriteArray is not supported.";
-public const string JsonWriterClosed = @"JSON writer is already closed.";
-public const string JsonXmlInvalidDeclaration = @"Attempt to write invalid XML declration.";
-public const string JsonXmlProcessingInstructionNotSupported = @"processing instruction is not supported in JSON writer.";
-public const string KeyTypeCannotBeParsedInSimpleDictionary = @"Key type '{1}' for collection type '{0}' cannot be parsed in simple dictionary.";
-public const string KnownTypeConfigGenericParamMismatch = @"Generic parameter count do not match between known type and configuration. Type is '{0}', known type has {1} parameters, configuration has {2} parameters.";
-public const string KnownTypeConfigIndexOutOfBounds = @"For known type configuration, index is out of bound. Root type: '{0}' has {1} type arguments, and index was {2}.";
-public const string KnownTypeConfigIndexOutOfBoundsZero = @"For known type configuration, index is out of bound. Root type: '{0}' has {1} type arguments, and index was {2}.";
-public const string KnownTypeConfigObject = @"Known type configuration specifies System.Object.";
-public const string MaxMimePartsExceeded = @"MIME parts number exceeded the maximum settings. Must be less than {0}. Specified as '{1}'.";
-public const string MimeContentTypeHeaderInvalid = @"MIME content type header is invalid.";
-public const string MimeHeaderInvalidCharacter = @"MIME header has an invalid character ('{0}', {1} in hexadecimal value).";
-public const string MimeMessageGetContentStreamCalledAlready = @"On MimeMessage, GetContentStream method is already called.";
-public const string MimeReaderHeaderAlreadyExists = @"MIME header '{0}' already exists.";
-public const string MimeReaderMalformedHeader = @"Malformed MIME header.";
-public const string MimeReaderResetCalledBeforeEOF = @"On MimeReader, Reset method is called before EOF.";
-public const string MimeReaderTruncated = @"MIME parts are truncated.";
-public const string MimeVersionHeaderInvalid = @"MIME version header is invalid.";
-public const string MimeWriterInvalidStateForClose = @"MIME writer is at invalid state for closing.";
-public const string MimeWriterInvalidStateForContent = @"MIME writer is at invalid state for content.";
-public const string MimeWriterInvalidStateForHeader = @"MIME writer is at invalid state for header.";
-public const string MimeWriterInvalidStateForStartPart = @"MIME writer is at invalid state for starting a part.";
-public const string MimeWriterInvalidStateForStartPreface = @"MIME writer is at invalid state for starting preface.";
-public const string MissingSchemaType = @"Schema type '{0}' is missing and required for '{1}' type.";
-public const string MixedContentNotSupported = @"Mixed content is not supported.";
-public const string MtomBoundaryInvalid = @"MIME boundary is invalid: '{0}'.";
-public const string MtomBufferQuotaExceeded = @"MTOM buffer quota exceeded. The maximum size is {0}.";
-public const string MtomContentTransferEncodingNotPresent = @"MTOM content transfer encoding is not present. ContentTransferEncoding header is '{0}'.";
-public const string MtomContentTransferEncodingNotSupported = @"MTOM content transfer encoding value is not supported. Raw value is '{0}', '{1}' in 7bit encoding, '{2}' in 8bit encoding, and '{3}' in binary.";
-public const string MtomContentTypeInvalid = @"MTOM content type is invalid.";
-public const string MtomDataMustNotContainXopInclude = @"MTOM data must not contain xop:Include element. '{0}' element in '{1}' namespace.";
-public const string MtomExceededMaxSizeInBytes = @"MTOM exceeded max size in bytes. The maximum size is {0}.";
-public const string MtomInvalidCIDUri = @"Invalid MTOM CID URI: '{0}'.";
-public const string MtomInvalidEmptyURI = @"empty URI is invalid for MTOM MIME part.";
-public const string MtomInvalidStartUri = @"Invalid MTOM start URI: '{0}'.";
-public const string MtomInvalidTransferEncodingForMimePart = @"Invalid transfer encoding for MIME part: '{0}', in binary: '{1}'.";
-public const string MtomMessageContentTypeNotFound = @"MTOM message content type was not found.";
-public const string MtomMessageInvalidContent = @"MTOM message content is invalid.";
-public const string MtomMessageInvalidContentInMimePart = @"MTOM message content in MIME part is invalid.";
-public const string MtomMessageInvalidMimeVersion = @"MTOM message has invalid MIME version. Expected '{1}', got '{0}' instead.";
-public const string MtomMessageNotApplicationXopXml = @"MTOM msssage type is not '{0}'.";
-public const string MtomMessageNotMultipart = @"MTOM message is not multipart: media type should be '{0}', media subtype should be '{1}'.";
-public const string MtomMessageRequiredParamNotSpecified = @"Required MTOM parameter '{0}' is not specified.";
-public const string MtomMimePartReferencedMoreThanOnce = @"Specified MIME part '{0}' is referenced more than once.";
-public const string MtomPartNotFound = @"MTOM part with URI '{0}' is not found.";
-public const string MtomRootContentTypeNotFound = @"MTOM root content type is not found.";
-public const string MtomRootNotApplicationXopXml = @"MTOM root should have media type '{0}' and subtype '{1}'.";
-public const string MtomRootPartNotFound = @"MTOM root part is not found.";
-public const string MtomRootRequiredParamNotSpecified = @"Required MTOM root parameter '{0}' is not specified.";
-public const string MtomRootUnexpectedCharset = @"Unexpected charset on MTOM root. Expected '{1}', got '{0}' instead.";
-public const string MtomRootUnexpectedType = @"Unexpected type on MTOM root. Expected '{1}', got '{0}' instead.";
-public const string MtomXopIncludeHrefNotSpecified = @"xop Include element did not specify '{0}' attribute.";
-public const string MtomXopIncludeInvalidXopAttributes = @"xop Include element has invalid attribute: '{0}' in '{1}' namespace.";
-public const string MtomXopIncludeInvalidXopElement = @"xop Include element has invalid element: '{0}' in '{1}' namespace.";
-public const string MustContainOnlyLocalElements = @"Only local elements can be imported.";
-public const string NoAsyncWritePending = @"No async write operation is pending.";
-public const string NonOptionalFieldMemberOnIsReferenceSerializableType = @"For type '{0}', non-optional field member '{1}' is on the Serializable type that has IsReference as {2}.";
-public const string OnlyDataContractTypesCanHaveExtensionData = @"On '{0}' type, only DataContract types can have extension data.";
-public const string PartialTrustISerializableNoPublicConstructor = @"Partial trust access required for the constructor on the ISerializable type '{0}'";
-public const string QueryGeneratorPathToMemberNotFound = @"The path to member was not found for XPath query generator.";
-public const string ReadNotSupportedOnStream = @"Read operation is not supported on the Stream.";
-public const string ReadOnlyClassDeserialization = @"Error on deserializing read-only members in the class: {0}";
-public const string ReadOnlyCollectionDeserialization = @"Error on deserializing read-only collection: {0}";
-public const string RecursiveCollectionType = @"Type '{0}' involves recursive collection.";
-public const string RedefineNotSupported = @"XML Schema 'redefine' is not supported.";
-public const string ReferencedBaseTypeDoesNotExist = @"Referenced base type does not exist. Data contract name: '{0}' in '{1}' namespace, expected type: '{2}' in '{3}' namespace. Collection can be '{4}' or '{5}'."; // is it the expected message? I'm quite unsure.
-public const string ReferencedCollectionTypesCannotContainNull = @"Referenced collection types cannot contain null.";
-public const string ReferencedTypeDoesNotMatch = @"Referenced type '{0}' does not match the expected type '{1}' in '{2}' namespace.";
-public const string ReferencedTypeMatchingMessage = @"Reference type matches.";
-public const string ReferencedTypeNotMatchingMessage = @"Reference type does not match.";
-public const string ReferencedTypesCannotContainNull = @"Referenced types cannot contain null.";
-public const string RequiresClassDataContractToSetIsISerializable = @"To set IsISerializable, class data cotnract is required.";
-public const string RootParticleMustBeSequence = @"Root particle must be sequence to be imported.";
-public const string RootSequenceMaxOccursMustBe = @"On root sequence, maxOccurs must be 1.";
-public const string RootSequenceMustBeRequired = @"Root sequence must have an item and minOccurs must be 1.";
-public const string SeekNotSupportedOnStream = @"Seek operation is not supported on this Stream.";
-public const string SerializationInfo_ConstructorNotFound = @"Constructor that takes SerializationInfo and StreamingContext is not found for '{0}'.";
-public const string SimpleContentNotSupported = @"Simple content is not supported.";
-public const string SimpleTypeRestrictionDoesNotSpecifyBase = @"This simpleType restriction does not specify the base type.";
-public const string SimpleTypeUnionNotSupported = @"simpleType union is not supported.";
-public const string SpecifiedTypeNotFoundInSchema = @"Specified type '{0}' in '{1}' namespace is not found in the schemas.";
-public const string SubstitutionGroupOnElementNotSupported = @"substitutionGroups on elements are not supported.";
-public const string SurrogatesWithGetOnlyCollectionsNotSupported = @"Surrogates with get-only collections are not supported. Type '{1}' contains '{2}' which is of '{0}' type.";
-public const string SurrogatesWithGetOnlyCollectionsNotSupportedSerDeser = @"Surrogates with get-only collections are not supported. Found on type '{0}'.";
-public const string TopLevelElementRepresentsDifferentType = @"Top-level element represents a different type. Expected '{0}' type in '{1}' namespace.";
-public const string TraceCodeElementIgnored = @"Element ignored";
-public const string TraceCodeFactoryTypeNotFound = @"Factory type not found";
-public const string TraceCodeObjectWithLargeDepth = @"Object with large depth";
-public const string TraceCodeReadObjectBegin = @"ReadObject begins";
-public const string TraceCodeReadObjectEnd = @"ReadObject ends";
-public const string TraceCodeWriteObjectBegin = @"WriteObject begins";
-public const string TraceCodeWriteObjectContentBegin = @"WriteObjectContent begins";
-public const string TraceCodeWriteObjectContentEnd = @"WriteObjectContent ends";
-public const string TraceCodeWriteObjectEnd = @"WriteObject ends";
-public const string TraceCodeXsdExportAnnotationFailed = @"XSD export annotation failed";
-public const string TraceCodeXsdExportBegin = @"XSD export begins";
-public const string TraceCodeXsdExportDupItems = @"XSD export duplicate items";
-public const string TraceCodeXsdExportEnd = @"XSD export ends";
-public const string TraceCodeXsdExportError = @"XSD export error";
-public const string TraceCodeXsdImportAnnotationFailed = @"XSD import annotation failed";
-public const string TraceCodeXsdImportBegin = @"XSD import begins";
-public const string TraceCodeXsdImportEnd = @"XSD import ends";
-public const string TraceCodeXsdImportError = @"XSD import error";
-public const string TypeCannotBeForwardedFrom = @"Type '{0}' in assembly '{1}' cannot be forwarded from assembly '{2}'.";
-public const string TypeCannotBeImported = @"Type '{0}' in '{1}' namespace cannot be imported: {2}";
-public const string TypeCannotBeImportedHowToFix = @"Type cannot be imported: {0}"; // I cannot see where HowToFix is given from...
-public const string TypeHasNotBeenImported = @"Type '{0}' in '{1}' namespace has not been imported.";
-public const string TypeMustBeIXmlSerializable = @"Type '{0}' must be IXmlSerializable. Contract type: '{1}', contract name: '{2}' in '{3}' namespace.";
-public const string TypeShouldNotContainAttributes = @"Type should not contain attributes. Serialization namespace: '{0}'.";
-public const string UnknownXmlType = @"Unknown XML type: '{0}'.";
-public const string WriteBufferOverflow = @"Write buffer overflow.";
-public const string WriteNotSupportedOnStream = @"Write operation is not supported on this '{0}' Stream.";
-public const string XmlCanonicalizationNotStarted = @"XML canonicalization was not started.";
-public const string XmlCanonicalizationStarted = @"XML canonicalization started";
-public const string XmlMaxArrayLengthOrMaxItemsQuotaExceeded = @"XML max array length or max items quota exceeded. It must be less than {0}.";
-public const string XmlMaxBytesPerReadExceeded = @"XML max bytes per read exceeded. It must be less than {0}.";
-public const string XmlMaxDepthExceeded = @"XML max depth exceeded. It must be less than {0}.";
-public const string XmlMaxStringContentLengthExceeded = @"XML max string content length exceeded. It must be less than {0}.";
-public const string XmlObjectAssignedToIncompatibleInterface = @"Object of type '{0}' is assigned to an incompatible interface '{1}'.";
-
-#endregion
- }
-}
ReferenceSources/DiagnosticUtility.cs
ReferenceSources/FxTrace.cs
ReferenceSources/SR.cs
-ReferenceSources/SR_missing.cs
+ReferenceSources/SR.missing.cs
ReferenceSources/XmlExceptionHelper.cs
ReferenceSources/BitFlagsGenerator.cs
include ../../build/rules.make
LIBRARY = System.Security.dll
-LIB_REFS = System System.Xml Mono.Security
+LIB_REFS = secxml/System bare/System.Xml Mono.Security
LIB_MCS_FLAGS = -nowarn:618 \
-d:SECURITY_DEP \
- -r:$(corlib) \
-nowarn:414
LOCAL_MCS_FLAGS = -lib:$(secxml_libdir) -lib:$(bare_libdir)
LIBRARY = System.ServiceModel.Activation.dll
-LIB_REFS = System.Core System System.ServiceModel
+LIB_REFS = System.Core System plainservice/System.ServiceModel
LIB_MCS_FLAGS =
-TEST_MCS_FLAGS = -r:System.dll -r:System.Core.dll
+TEST_MCS_FLAGS =
+TEST_LIB_REFS = System System.Core
-plainservicemodel_dir = $(the_libdir_base)plainservice
-servicemodel = $(plainservicemodel_dir)/System.ServiceModel.dll
-LOCAL_MCS_FLAGS = -lib:$(plainservicemodel_dir)
+servicemodel = $(the_libdir_base)plainservice/System.ServiceModel.dll
include ../../build/library.make
ifneq (2.1, $(FRAMEWORK_VERSION))
LIB_REFS += System.Configuration
-LIB_MCS_FLAGS += -d:NET_3_5 -d:NET_3_0 \
- -r:System.Configuration.dll
+LIB_MCS_FLAGS += -d:NET_3_5 -d:NET_3_0
endif
TEST_MCS_FLAGS = $(LIB_MCS_FLAGS)
ifneq (2.1, $(FRAMEWORK_VERSION))
LIB_REFS += System.Configuration
-LIB_MCS_FLAGS += -d:NET_3_5 -d:NET_3_0 \
- -r:System.Configuration.dll
+LIB_MCS_FLAGS += -d:NET_3_5 -d:NET_3_0
endif
TEST_MCS_FLAGS = $(LIB_MCS_FLAGS)
servicemodel_deps = $(activation)
ifneq (plainservice/,$(intermediate))
-LIB_MCS_FLAGS += -define:HAS_ACTIVATION -r:System.ServiceModel.Activation.dll
+LIB_REFS += System.ServiceModel.Activation
+LIB_MCS_FLAGS += -define:HAS_ACTIVATION
endif
endif # NO_SYSTEM_SERVICEMODEL_ACTIVATION_DEPENDENCY
include ../../build/library.make
LIB_REFS += System.Core System
-LIB_MCS_FLAGS += -r:$(corlib) -d:CONCURRENT_COLLECTIONS
+LIB_MCS_FLAGS += -d:CONCURRENT_COLLECTIONS
-TEST_MCS_FLAGS = -r:System.Core.dll -r:System.dll
+TEST_MCS_FLAGS =
+TEST_LIB_REFS = System.Core System
EXTRA_DISTFILES=README.md
LIBRARY = System.Transactions.dll
ifdef MOBILE_PROFILE
LIB_REFS = System
-LIB_MCS_FLAGS = /r:$(corlib) /define:MOBILE
+LIB_MCS_FLAGS = /define:MOBILE
else
LIB_REFS = System System.Configuration
-LIB_MCS_FLAGS = /r:$(corlib)
+LIB_MCS_FLAGS =
endif
TEST_MCS_FLAGS = $(LIB_MCS_FLAGS)
NUNIT_RESOURCE_FILES = $(TEST_RESOURCE_FILES)
-TEST_MCS_FLAGS = $(LIB_MCS_FLAGS) -r:System.ComponentModel.DataAnnotations.dll -r:System.Configuration.dll \
- $(NUNIT_RESOURCE_FILES:%=/resource:%) -r:SystemWebTestShim.dll -r:System.Xml.dll
+TEST_LIB_REFS = System.ComponentModel.DataAnnotations System.Configuration SystemWebTestShim System.Xml
+TEST_MCS_FLAGS = $(LIB_MCS_FLAGS) $(NUNIT_RESOURCE_FILES:%=/resource:%)
ifeq (4, $(FRAMEWORK_VERSION_MAJOR))
-TEST_MCS_FLAGS += -r:System.Web.ApplicationServices.dll
+TEST_LIB_REFS += System.Web.ApplicationServices
endif
EXTRA_DISTFILES = $(foreach resource,$(TEST_RESOURCE_FILES), $(shell echo $(subst \`,\\\`,$(resource)) | cut -d ',' -f 1))
CLASSLIB_DIR = $(topdir)/class/lib/$(PROFILE)
STANDALONE_RUNNER_SUPPORT_ASSEMBLY = $(CLASSLIB_DIR)/standalone-runner-support.dll
-STANDALONE_TEST_MCS_FLAGS = $(LIB_MCS_FLAGS) $(PROFILE_MCS_FLAGS) -debug:full -r:$(STANDALONE_RUNNER_SUPPORT_ASSEMBLY) -r:System.Web.dll -r:System.Web.Extensions.dll -r:nunit.framework.dll
+STANDALONE_TEST_MCS_FLAGS = $(LIB_MCS_FLAGS) $(PROFILE_MCS_FLAGS) -r:$(STANDALONE_RUNNER_SUPPORT_ASSEMBLY) -r:$(topdir)/class/lib/$(PROFILE)/System.Web.dll -r:$(topdir)/class/lib/$(PROFILE)/System.Web.Extensions.dll -r:$(topdir)/class/lib/$(PROFILE)/nunit.framework.dll
STANDALONE_TEST_ASSEMBLY = System.Web.Extensions_standalone_test_$(PROFILE).dll
STANDALONE_TEST_MAKEFRAG = $(depsdir)/$(STANDALONE_TEST_ASSEMBLY).makefrag
RUN_STANDALONE += --test=$(TESTNAME)
endif
-ifeq (4, $(FRAMEWORK_VERSION_MAJOR))
-OTHER_LIB_MCS_FLAGS += -r:System.Web.ApplicationServices.dll
-endif
-
LIB_REFS = System System.Core System.Drawing System.Data System.Data.Linq System.Xml System.Web System.Web.Services System.Configuration System.EnterpriseServices System.ServiceModel
LIB_MCS_FLAGS = \
-unsafe \
-define:NET_3_5 \
-define:SYSTEM_WEB_EXTENSIONS \
- -r:$(corlib) \
$(OTHER_LIB_MCS_FLAGS) \
$(RESOURCE_FILES:%=/resource:%)
-TEST_MCS_FLAGS = $(LIB_MCS_FLAGS) -doc:$(test_lib:.dll=.xml) -nowarn:219,169,1591 $(NUNIT_RESOURCE_FILES:%=/resource:%) -r:SystemWebTestShim.dll -define:SYSTEM_WEB_EXTENSIONS
+ifeq (4, $(FRAMEWORK_VERSION_MAJOR))
+LIB_REFS += System.Web.ApplicationServices
+endif
+
+TEST_LIB_REFS = SystemWebTestShim
+TEST_MCS_FLAGS = $(LIB_MCS_FLAGS) -doc:$(test_lib:.dll=.xml) -nowarn:219,169,1591 $(NUNIT_RESOURCE_FILES:%=/resource:%) -define:SYSTEM_WEB_EXTENSIONS
EXTRA_DISTFILES = $(RESOURCE_FILES_DIST) $(NUNIT_RESOURCE_FILES) \
System.Web.Extensions_standalone_test.dll.sources \
case JsonType.INTEGER:
/* MS AJAX.NET JSON parser promotes big integers to double */
- if (Int32.TryParse (s, out intValue))
+ if (Int32.TryParse (s, NumberStyles.Integer, CultureInfo.InvariantCulture, out intValue))
result = intValue;
- else if (Int64.TryParse (s, out longValue))
+ else if (Int64.TryParse (s, NumberStyles.Integer, CultureInfo.InvariantCulture, out longValue))
result = longValue;
- else if (Decimal.TryParse (s, out decimalValue))
+ else if (Decimal.TryParse (s, NumberStyles.Integer, CultureInfo.InvariantCulture, out decimalValue))
result = decimalValue;
- else if (Double.TryParse (s, out doubleValue))
+ else if (Double.TryParse (s, NumberStyles.Integer, CultureInfo.InvariantCulture, out doubleValue))
result = doubleValue;
else
converted = false;
break;
case JsonType.FLOAT:
- if (Decimal.TryParse (s, out decimalValue))
+ if (Decimal.TryParse (s, NumberStyles.Float, CultureInfo.InvariantCulture, out decimalValue))
result = decimalValue;
- else if (Double.TryParse (s, out doubleValue))
+ else if (Double.TryParse (s, NumberStyles.Float, CultureInfo.InvariantCulture, out doubleValue))
result = doubleValue;
else
converted = false;
Assert.AreEqual (1337.0, obj.d);
Assert.AreEqual (null, obj.o);
}
+
+ [Test]
+ public void DeserializeInCultureWithCommaSeparator ()
+ {
+ var origCulture = Thread.CurrentThread.CurrentCulture;
+
+ try {
+ Thread.CurrentThread.CurrentCulture = new CultureInfo ("en-US");
+ CommaSeparatorTest ();
+
+ Thread.CurrentThread.CurrentCulture = new CultureInfo ("fi-FI");
+ CommaSeparatorTest ();
+ } finally {
+ Thread.CurrentThread.CurrentCulture = origCulture;
+ }
+ }
+
+ public class DoubleTest
+ {
+ public double[] value { get; set; }
+ }
+
+ void CommaSeparatorTest()
+ {
+ JavaScriptSerializer serializer = new JavaScriptSerializer ();
+
+ DoubleTest array = new DoubleTest ();
+ array.value = new[] { 123.345, 0.69 };
+
+ string arrayJson = serializer.Serialize (array);
+ Console.WriteLine (arrayJson);
+
+ // This throwed incorrectly a "System.ArgumentException: Invalid JSON primitive: 123.345" with a CurrentThread.CultureInfo that has a comma as the number separator.
+ DoubleTest obj = serializer.Deserialize<DoubleTest> (arrayJson);
+
+ Assert.AreEqual (123.345, obj.value[0], "#1");
+ Assert.AreEqual (0.69, obj.value[1], "#2");
+ }
}
}
LIB_REFS = System System.Xml
LIB_MCS_FLAGS = \
-nowarn:649 -nowarn:169 \
- -r:$(corlib) \
- -r:System.dll \
- -r:System.Xml.dll \
-resource:System.Web.Services.Description/wsdl-1.1.xsd,wsdl-1.1.xsd \
-resource:System.Web.Services.Description/wsdl-1.1-soap.xsd,wsdl-1.1-soap.xsd \
-resource:System.Web.Services.Description/web-reference.xsd,web-reference.xsd
LIB_MCS_FLAGS = -nowarn:168,169,219,414,612,649 -d:MONO_BROKEN_CONFIGURATION_DLL
ifndef NO_SYSTEM_WEB_DEPENDENCY
-LIB_REFS += System.Web
-plainweb_dir = $(the_libdir_base)plainweb
-plainweb = $(plainweb_dir)/System.Web.dll
-system_web_services_deps = $(plainweb)
-LOCAL_MCS_FLAGS += -lib:$(plainweb_dir)
+plainweb = $(the_libdir_base)plainweb/System.Web.dll
+system_web_deps = $(plainweb)
+LIB_REFS += plainweb/System.Web
endif
ifndef NO_SYSTEM_DESIGN_DEPENDENCY
-LIB_REFS += System.Design
-plaindesign_dir = $(the_libdir_base)plaindesign
-plaindesign = $(plaindesign_dir)/System.Design.dll
+plaindesign = $(the_libdir_base)plaindesign/System.Design.dll
system_design_deps = $(plaindesign)
-LOCAL_MCS_FLAGS += -lib:$(plaindesign_dir)
+LIB_REFS += plaindesign/System.Design
endif
ifndef NO_SYSTEM_DIRECTORY_SERVICES_DEPENDENCY
include ../../build/library.make
-$(the_libdir_base)$(LIBRARY): $(system_web_services_deps) $(system_design_deps)
+$(the_libdir_base)$(LIBRARY): $(system_web_deps) $(system_design_deps)
$(plainweb):
(cd ../System.Web; $(MAKE) $@)
NUNIT_APP_GLOBALRESOURCES_FILES = $(TEST_APP_GLOBALRESOURCES_FILES)
OTHER_RES += $(RESOURCE_FILES_2)
-OTHER_LIB_MCS_FLAGS = -d:INSIDE_SYSTEM_WEB -nowarn:618 -r:System.Configuration.dll -r:Mono.Data.Sqlite.dll
+OTHER_LIB_MCS_FLAGS = -d:INSIDE_SYSTEM_WEB -nowarn:618
ifeq (4, $(FRAMEWORK_VERSION_MAJOR))
-OTHER_LIB_MCS_FLAGS += -r:System.Web.ApplicationServices.dll
OTHER_RES += $(RESOURCE_FILES_4)
endif
TXT_RESOURCE_STRINGS = ../../../external/referencesource/System.Web/System.Web.txt
-LIB_REFS = System System.Core System.Drawing System.Data System.Xml System.EnterpriseServices System.Runtime.Serialization.Formatters.Soap System.ComponentModel.DataAnnotations
+LIB_REFS = System System.Core System.Drawing System.Data System.Xml System.EnterpriseServices System.Runtime.Serialization.Formatters.Soap \
+ System.ComponentModel.DataAnnotations System.Web.ApplicationServices System.Configuration Mono.Data.Sqlite
LIB_MCS_FLAGS = \
-unsafe \
-nowarn:612,618 \
- -r:$(corlib) \
$(OTHER_LIB_MCS_FLAGS) \
$(RESX_RES:%=/resource:%) \
$(OTHER_RES:%=/resource:%)
ifneq (plainweb/,$(intermediate))
-LIB_REFS += System.Web.Services System.Design
+LIB_REFS += System.Web.Services plaindesign/System.Design
LIB_MCS_FLAGS += -define:WEBSERVICES_DEP -lib:$(the_libdir_base)plaindesign
all-local: System.Web/UplevelHelper.cs resources/TranslationResources.resources
endif
-TEST_MCS_FLAGS = $(LIB_MCS_FLAGS) -doc:$(test_lib:.dll=.xml) -nowarn:219,169,1591 -r:SystemWebTestShim.dll \
+TEST_LIB_REFS = SystemWebTestShim
+TEST_MCS_FLAGS = $(LIB_MCS_FLAGS) -doc:$(test_lib:.dll=.xml) -nowarn:219,169,1591 \
$(NUNIT_RESOURCE_FILES:%=/resource:%) \
$(foreach file,$(NUNIT_APP_CODE_FILES),$(shell echo $(file) | sed -e 's;\(.*\)/\(.*\);/resource:\1/\2,App_Code/\2 ;g')) \
$(foreach file,$(NUNIT_APP_GLOBALRESOURCES_FILES),$(shell echo $(file) | sed -e 's;\(.*\)/\(.*\);/resource:\1/\2,App_GlobalResources/\2 ;g'))
CLASSLIB_DIR = $(topdir)/class/lib/$(PROFILE)
-STANDALONE_RUNNER_SUPPORT_MCS_FLAGS = $(LIB_MCS_FLAGS) $(PROFILE_MCS_FLAGS) -d:STANDALONE_TEST -debug:full -r:System.Web.dll -r:nunit.framework.dll
+STANDALONE_RUNNER_SUPPORT_MCS_FLAGS = $(LIB_MCS_FLAGS) $(PROFILE_MCS_FLAGS) -d:STANDALONE_TEST -r:$(topdir)/class/lib/$(PROFILE)/System.Web.dll -r:$(topdir)/class/lib/$(PROFILE)/nunit.framework.dll
STANDALONE_RUNNER_SUPPORT_ASSEMBLY = $(CLASSLIB_DIR)/standalone-runner-support.dll
STANDALONE_RUNNER_SUPPORT_MAKEFRAG = $(depsdir)/$(PROFILE)_standalone-runner-support.dll.makefrag
-STANDALONE_TEST_MCS_FLAGS = $(LIB_MCS_FLAGS) $(PROFILE_MCS_FLAGS) -debug:full -r:$(STANDALONE_RUNNER_SUPPORT_ASSEMBLY) -r:System.Web.dll -r:nunit.framework.dll
+STANDALONE_TEST_MCS_FLAGS = $(LIB_MCS_FLAGS) $(PROFILE_MCS_FLAGS) -r:$(STANDALONE_RUNNER_SUPPORT_ASSEMBLY) -r:$(topdir)/class/lib/$(PROFILE)/System.Web.dll -r:$(topdir)/class/lib/$(PROFILE)/nunit.framework.dll
STANDALONE_TEST_ASSEMBLY = System.Web_standalone_test_$(PROFILE).dll
STANDALONE_TEST_MAKEFRAG = $(depsdir)/$(STANDALONE_TEST_ASSEMBLY).makefrag
../../../Mono.Options/Mono.Options/Options.cs \
STANDALONE_RUNNER_REFERENCES = \
- -lib:$(CLASSLIB_DIR) \
-r:$(STANDALONE_RUNNER_SUPPORT_ASSEMBLY) \
- -r:System.Web.dll
+ -r:$(CLASSLIB_DIR)/System.Web.dll \
+ -r:$(CLASSLIB_DIR)/System.dll
CACHE_PQ_TEST_GENERATOR_SOURCES = \
CachePQTestGenerator/CacheItemComparer.cs \
../System.Web.Caching/CacheItemPriorityQueueTestSupport.cs
CACHE_PQ_TEST_GENERATOR_REFERENCES = \
- -lib:$(CLASSLIB_DIR) \
-pkg:dotnet
CACHE_PQ_TEST_SEQUENCES = $(wildcard ./CachePQTestGenerator/Sequences/*.seq)
all-local: HtmlWriter.dll standalone-runner.exe cache-pq-test-generator.exe
HtmlWriter.dll: HtmlWriter.cs
- $(MCS) -t:library -r:System.Web.dll $<
+ $(CSCOMPILE) -t:library -r:System.Web.dll $<
standalone-runner.exe: deps $(STANDALONE_RUNNER_SOURCES)
- $(MCS) -debug:full $(STANDALONE_RUNNER_REFERENCES) -out:$@ $(STANDALONE_RUNNER_SOURCES)
+ $(CSCOMPILE) $(STANDALONE_RUNNER_REFERENCES) -out:$@ $(STANDALONE_RUNNER_SOURCES)
cache-pq-test-generator.exe: $(CACHE_PQ_TEST_GENERATOR_SOURCES)
- $(MCS) -debug:full -d:DEBUG $(CACHE_PQ_TEST_GENERATOR_REFERENCES) -out:$@ $(CACHE_PQ_TEST_GENERATOR_SOURCES)
+ $(CSCOMPILE) -d:DEBUG $(CACHE_PQ_TEST_GENERATOR_REFERENCES) -out:$@ $(CACHE_PQ_TEST_GENERATOR_SOURCES)
generate-cache-pq-tests: cache-pq-test-generator.exe
for f in $(patsubst %.seq.gz,%.seq,$(CACHE_PQ_TEST_PACKED_SEQUENCES)); do \
LIB_REFS = System System.Xml System.Drawing Accessibility System.Data Mono.Posix Mono.WebBrowser System.Configuration System.Runtime.Serialization.Formatters.Soap
LIB_MCS_FLAGS = /unsafe \
- /r:$(corlib) \
@System.Windows.Forms.dll.resources \
-nowarn:618,612,809
$(IMAGES_RESOURCES) \
$(TEST_DISTFILES)
-TEST_MCS_FLAGS = /r:System.Data.dll /r:System.Drawing.dll /r:Accessibility.dll -r:System.dll -r:System.Xml.dll -r:System.Runtime.Serialization.Formatters.Soap\
+TEST_LIB_REFS = System.Data System.Drawing Accessibility System System.Xml System.Runtime.Serialization.Formatters.Soap
+TEST_MCS_FLAGS = \
-resource:Test/resources/a.cur,a.cur \
-resource:Test/resources/32x32.ico,32x32.ico \
-nowarn:618,612
DummyAssembly.dll:
- $(CSCOMPILE) /target:library /out:$@ Test/DummyAssembly/AnotherSerializable.cs Test/DummyAssembly/Convertable.cs Test/DummyAssembly/Properties/AssemblyInfo.cs
+ $(CSCOMPILE) /target:library /out:$@ Test/DummyAssembly/AnotherSerializable.cs Test/DummyAssembly/Convertable.cs Test/DummyAssembly/Properties/AssemblyInfo.cs \
+ -r:$(topdir)/class/lib/$(PROFILE)/System.dll
test-local: DummyAssembly.dll
../../../external/referencesource/System.Xml/System.Xml.txt \
../../../external/referencesource/System.Data.SqlXml/System.Xml.Utils.txt
-LIB_REFS = System
-LIB_MCS_FLAGS = -r:$(corlib) -nowarn:219,414,649,1717 -unsafe -d:ASYNC
+LIB_MCS_FLAGS = -nowarn:219,414,649,1717 -unsafe -d:ASYNC
ifeq (2.1, $(FRAMEWORK_VERSION))
LIB_MCS_FLAGS += -d:AGCLR -d:NET_2_1_HACK -d:DISABLE_XSLT_COMPILER -d:DISABLE_XSLT_SCRIPT,MONO_HYBRID_SYSTEM_XML -d:DISABLE_CAS_USE
endif
-TEST_MCS_FLAGS = $(LIB_MCS_FLAGS) -nowarn:0618 -nowarn:219 -nowarn:169 -r:System.Data.dll -r:System.Core.dll
-ifndef MOBILE_PROFILE
-FINAL_MCS_FLAGS = -r:System.Configuration.dll -d:CONFIGURATION_DEP
-endif
+TEST_LIB_REFS = System.Data System.Core
+TEST_MCS_FLAGS = $(LIB_MCS_FLAGS) -nowarn:0618 -nowarn:219 -nowarn:169
ifneq (bare/,$(intermediate))
-LIB_MCS_FLAGS += $(FINAL_MCS_FLAGS)
+LIB_REFS += secxml/System
+ifndef MOBILE_PROFILE
+LIB_REFS += System.Configuration
+LIB_MCS_FLAGS += -d:CONFIGURATION_DEP
+endif
+else
+LIB_REFS += $(intermediate)System
endif
-
-LOCAL_MCS_FLAGS += -lib:$(bare_libdir)
nist_dom_files = \
ITest.cs readme.txt util.cs \
[assembly: InternalsVisibleTo ("Mono.Security.Providers.NewTls, PublicKey=002400000480000094000000060200000024000052534131000400000100010079159977d2d03a8e6bea7a2e74e8d1afcc93e8851974952bb480a12c9134474d04062447c37e0e68c080536fcf3c3fbe2ff9c979ce998475e506e8ce82dd5b0f350dc10e93bf2eeecf874b24770c5081dbea7447fddafa277b22de47d6ffea449674a4f9fccf84d15069089380284dbdd35f46cdff12a1bd78e4ef0065d016df")]
[assembly: InternalsVisibleTo ("Mono.Security.Providers.DotNet, PublicKey=002400000480000094000000060200000024000052534131000400000100010079159977d2d03a8e6bea7a2e74e8d1afcc93e8851974952bb480a12c9134474d04062447c37e0e68c080536fcf3c3fbe2ff9c979ce998475e506e8ce82dd5b0f350dc10e93bf2eeecf874b24770c5081dbea7447fddafa277b22de47d6ffea449674a4f9fccf84d15069089380284dbdd35f46cdff12a1bd78e4ef0065d016df")]
[assembly: InternalsVisibleTo ("Mono.Security, PublicKey=002400000480000094000000060200000024000052534131000400000100010079159977d2d03a8e6bea7a2e74e8d1afcc93e8851974952bb480a12c9134474d04062447c37e0e68c080536fcf3c3fbe2ff9c979ce998475e506e8ce82dd5b0f350dc10e93bf2eeecf874b24770c5081dbea7447fddafa277b22de47d6ffea449674a4f9fccf84d15069089380284dbdd35f46cdff12a1bd78e4ef0065d016df")]
+
+ [assembly: InternalsVisibleTo ("Xamarin.BoringTls, PublicKey=002400000480000094000000060200000024000052534131000400001100000099dd12eda85767ae6f06023ee28e711c7e5a212462095c83868c29db75eddf6d8e296e03824c14fedd5f55553fed0b6173be3cc985a4b7f9fb7c83ccff8ba3938563b3d1f45a81122f12a1bcb73edcaad61a8456c7595a6da5184b4dd9d10f011b949ef1391fccfeab1ba62aa51c267ef8bd57ef1b6ba5a4c515d0badb81a78f")]
Test/System/test-uri-props-manual.txt \
Test/System/test-uri-relative-props.txt
-TEST_MCS_FLAGS = -r:System.Drawing.dll -r:Mono.Security.dll -r:System.Data.dll -r:System.Xml.dll -r:System.Core.dll -nowarn:618,672,219,67,169,612 \
+TEST_LIB_REFS = System.Drawing Mono.Security System.Data System.Xml System.Core System.Configuration
+
+TEST_MCS_FLAGS = -nowarn:618,672,219,67,169,612 \
$(foreach f, $(TEST_RESOURCES), -resource:$(f),$(notdir $(f)))
REFERENCE_SOURCES_FLAGS = -d:FEATURE_PAL,SYSTEM_NAMESPACE,MONO,PLATFORM_UNIX
endif
LIB_MCS_FLAGS = -nowarn:618 -d:CONFIGURATION_2_0 $(REFERENCE_SOURCES_FLAGS) -unsafe $(RESOURCE_FILES:%=-resource:%)
-TEST_MCS_FLAGS += -r:System.Configuration.dll
ifndef NO_THREAD_ABORT
REFERENCE_SOURCES_FLAGS += -d:MONO_FEATURE_THREAD_ABORT
LIB_MCS_FLAGS += -d:INSIDE_SYSTEM -d:SECURITY_DEP
else
EXTERN_ALIAS_FLAGS = -d:MONO_SECURITY_ALIAS -d:MONO_X509_ALIAS
-FINAL_MCS_FLAGS = -r:System.Configuration.dll -d:CONFIGURATION_DEP
endif
#
#
ifeq (secxml/, $(intermediate))
LOCAL_MCS_FLAGS = -lib:$(bare_libdir)
-LIB_REFS += System.Xml MonoSecurity=Mono.Security
+LIB_REFS += bare/System.Xml MonoSecurity=Mono.Security
LIB_MCS_FLAGS += -d:SECURITY_DEP -d:XML_DEP -r:PrebuiltSystem=$(bare_libdir)/System.dll $(EXTERN_ALIAS_FLAGS)
endif
#
ifndef intermediate
LIB_REFS += System.Xml MonoSecurity=Mono.Security
-LIB_MCS_FLAGS += -d:SECURITY_DEP -d:XML_DEP -r:PrebuiltSystem=$(secxml_libdir)/System.dll $(EXTERN_ALIAS_FLAGS) $(FINAL_MCS_FLAGS)
+LIB_MCS_FLAGS += -d:SECURITY_DEP -d:XML_DEP -r:PrebuiltSystem=$(secxml_libdir)/System.dll $(EXTERN_ALIAS_FLAGS)
+
+ifndef MOBILE_PROFILE
+LIB_REFS += System.Configuration
+LIB_MCS_FLAGS += -d:CONFIGURATION_DEP
+endif
+
endif
EXTRA_DISTFILES = \
}
}
+ args.Append ("/noconfig ");
+
args.Append (" -- ");
foreach (string source in fileNames)
args.AppendFormat("\"{0}\" ",source);
{
internal delegate bool ServerCertValidationCallbackWrapper (ServerCertValidationCallback callback, X509Certificate certificate, X509Chain chain, MonoSslPolicyErrors sslPolicyErrors);
- internal class ChainValidationHelper : ICertificateValidator
+ internal class ChainValidationHelper : ICertificateValidator2
{
readonly object sender;
readonly MonoTlsSettings settings;
var certs = new XX509CertificateCollection ();
certs.Add (new X509Certificate2 (certificate.GetRawCertData ()));
- var result = ValidateChain (string.Empty, true, certs, (SslPolicyErrors)errors);
+ var result = ValidateChain (string.Empty, true, certificate, null, certs, (SslPolicyErrors)errors);
if (result == null)
return false;
public ValidationResult ValidateCertificate (string host, bool serverMode, XX509CertificateCollection certs)
{
try {
- var result = ValidateChain (host, serverMode, certs, 0);
+ X509Certificate leaf;
+ if (certs != null && certs.Count != 0)
+ leaf = certs [0];
+ else
+ leaf = null;
+ var result = ValidateChain (host, serverMode, leaf, null, certs, 0);
+ if (tlsStream != null)
+ tlsStream.CertificateValidationFailed = result == null || !result.Trusted || result.UserDenied;
+ return result;
+ } catch {
+ if (tlsStream != null)
+ tlsStream.CertificateValidationFailed = true;
+ throw;
+ }
+ }
+
+ public ValidationResult ValidateCertificate (string host, bool serverMode, X509Certificate leaf, XX509Chain xchain)
+ {
+ try {
+ var chain = (X509Chain)(object)xchain;
+ var result = ValidateChain (host, serverMode, leaf, chain, null, 0);
if (tlsStream != null)
tlsStream.CertificateValidationFailed = result == null || !result.Trusted || result.UserDenied;
return result;
}
}
- ValidationResult ValidateChain (string host, bool server, XX509CertificateCollection certs, SslPolicyErrors errors)
+ ValidationResult ValidateChain (string host, bool server, X509Certificate leaf,
+ X509Chain chain, XX509CertificateCollection certs,
+ SslPolicyErrors errors)
+ {
+ var oldChain = chain;
+ var ownsChain = chain == null;
+ try {
+ var result = ValidateChain (host, server, leaf, ref chain, certs, errors);
+ if (chain != oldChain)
+ ownsChain = true;
+
+ return result;
+ } finally {
+ // If ValidateChain() changed the chain, then we need to free it.
+ if (ownsChain && chain != null)
+ chain.Dispose ();
+ }
+ }
+
+ ValidationResult ValidateChain (string host, bool server, X509Certificate leaf,
+ ref X509Chain chain, XX509CertificateCollection certs,
+ SslPolicyErrors errors)
{
// user_denied is true if the user callback is called and returns false
bool user_denied = false;
var hasCallback = certValidationCallback != null || callbackWrapper != null;
- X509Certificate leaf;
- if (certs == null || certs.Count == 0)
- leaf = null;
- else
- leaf = certs [0];
-
if (tlsStream != null)
request.ServicePoint.UpdateServerCertificate (leaf);
ICertificatePolicy policy = ServicePointManager.GetLegacyCertificatePolicy ();
int status11 = 0; // Error code passed to the obsolete ICertificatePolicy callback
- X509Chain chain = null;
bool wantsChain = SystemCertificateValidator.NeedsChain (settings);
if (!wantsChain && hasCallback) {
wantsChain = true;
}
- if (wantsChain)
- chain = SystemCertificateValidator.CreateX509Chain (certs);
-
bool providerValidated = false;
if (provider != null && provider.HasCustomSystemCertificateValidator) {
var xerrors = (MonoSslPolicyErrors)errors;
var xchain = (XX509Chain)(object)chain;
- providerValidated = provider.InvokeSystemCertificateValidator (this, host, server, certs, ref xchain, out result, ref xerrors, ref status11);
+ providerValidated = provider.InvokeSystemCertificateValidator (this, host, server, certs, wantsChain, ref xchain, out result, ref xerrors, ref status11);
chain = (X509Chain)(object)xchain;
errors = (SslPolicyErrors)xerrors;
+ } else if (wantsChain) {
+ chain = SystemCertificateValidator.CreateX509Chain (certs);
}
if (!providerValidated)
var eventBuffer = new kevent[0]; // we don't want to take any events from the queue at this point
var changes = CreateChangeList (ref initialFds);
- int numEvents = kevent (conn, changes, changes.Length, eventBuffer, eventBuffer.Length, ref immediate_timeout);
+ int numEvents;
+ int errno = 0;
+ do {
+ numEvents = kevent (conn, changes, changes.Length, eventBuffer, eventBuffer.Length, ref immediate_timeout);
+ if (numEvents == -1) {
+ errno = Marshal.GetLastWin32Error ();
+ }
+ } while (numEvents == -1 && errno == EINTR);
if (numEvents == -1) {
- var errMsg = String.Format ("kevent() error at initial event registration, error code = '{0}'", Marshal.GetLastWin32Error ());
+ var errMsg = String.Format ("kevent() error at initial event registration, error code = '{0}'", errno);
throw new IOException (errMsg);
}
}
// Stop () signals us to stop by closing the connection
if (requestStop)
break;
- if (++retries == 3)
+ int errno = Marshal.GetLastWin32Error ();
+ if (errno != EINTR && ++retries == 3)
throw new IOException (String.Format (
- "persistent kevent() error, error code = '{0}'", Marshal.GetLastWin32Error ()));
+ "persistent kevent() error, error code = '{0}'", errno));
continue;
}
const int O_EVTONLY = 0x8000;
const int F_GETPATH = 50;
const int __DARWIN_MAXPATHLEN = 1024;
+ const int EINTR = 4;
static readonly kevent[] emptyEventList = new System.IO.kevent[0];
int maxFds = Int32.MaxValue;
string fixupPath = null;
string fullPathNoLastSlash = null;
- [DllImport ("libc", EntryPoint="fcntl", CharSet=CharSet.Auto, SetLastError=true)]
+ [DllImport ("libc", CharSet=CharSet.Auto, SetLastError=true)]
static extern int fcntl (int file_names_by_descriptor, int cmd, StringBuilder sb);
- [DllImport ("libc")]
+ [DllImport ("libc", SetLastError=true)]
extern static int open (string path, int flags, int mode_t);
[DllImport ("libc")]
extern static int close (int fd);
- [DllImport ("libc")]
+ [DllImport ("libc", SetLastError=true)]
extern static int kqueue ();
- [DllImport ("libc")]
+ [DllImport ("libc", SetLastError=true)]
extern static int kevent (int kq, [In]kevent[] ev, int nchanges, [Out]kevent[] evtlist, int nevents, [In] ref timespec time);
[MethodImplAttribute(MethodImplOptions.InternalCall)]
SocketAsyncEventArgs args = new SocketAsyncEventArgs ();
args.UserToken = this;
args.Completed += OnAccept;
- sock.AcceptAsync (args);
+ Accept (sock, args);
prefixes = new Hashtable ();
unregistered = new Dictionary<HttpConnection, HttpConnection> ();
}
get { return listener; }
}
- static void OnAccept (object sender, EventArgs e)
+ static void Accept (Socket socket, SocketAsyncEventArgs e) {
+ e.AcceptSocket = null;
+ var asyn = socket.AcceptAsync(e);
+ if (!asyn) {
+ ProcessAccept(e);
+ }
+ }
+
+
+ static void ProcessAccept (SocketAsyncEventArgs args)
{
- SocketAsyncEventArgs args = (SocketAsyncEventArgs) e;
- EndPointListener epl = (EndPointListener) args.UserToken;
Socket accepted = null;
- if (args.SocketError == SocketError.Success) {
+ if (args.SocketError == SocketError.Success)
accepted = args.AcceptSocket;
- args.AcceptSocket = null;
- }
- try {
- if (epl.sock != null)
- epl.sock.AcceptAsync (args);
- } catch {
- if (accepted != null) {
- try {
- accepted.Close ();
- } catch {}
- accepted = null;
- }
- }
+ EndPointListener epl = (EndPointListener) args.UserToken;
+
+ Accept (epl.sock, args);
if (accepted == null)
return;
conn.BeginReadRequest ();
}
- internal void RemoveConnection (HttpConnection conn)
+ static void OnAccept (object sender, SocketAsyncEventArgs e)
+ {
+ ProcessAccept (e);
+ }
+
+ internal void RemoveConnection (HttpConnection conn)
{
lock (unregistered) {
unregistered.Remove (conn);
LIBRARY = WebMatrix.Data.dll
LIB_REFS = System System.Data System.Core System.Configuration
-LIB_MCS_FLAGS = -r:$(corlib)
-TEST_MCS_FLAGS = -r:System.dll -r:System.Core.dll -r:System.Data.dll -r:Mono.Data.Sqlite.dll -r:Microsoft.CSharp.dll
+LIB_MCS_FLAGS =
+TEST_MCS_FLAGS =
+TEST_LIB_REFS = System System.Core System.Data Mono.Data.Sqlite Microsoft.CSharp
include ../../build/library.make
LIB_REFS = System System.Xml
LIB_MCS_FLAGS = -unsafe
-TEST_MCS_FLAGS = -unsafe -r:WindowsBase.dll -r:System.dll -r:System.Xml.dll -r:System.Core.dll
+TEST_MCS_FLAGS = -unsafe
+TEST_LIB_REFS = WindowsBase System System.Xml System.Core
ifeq (2.0, $(FRAMEWORK_VERSION))
LIB_MCS_FLAGS += -d:NET_3_0
endif
ifeq (4, $(FRAMEWORK_VERSION_MAJOR))
LIB_REFS += System.Xaml
-TEST_MCS_FLAGS += -r:System.Xaml.dll
+TEST_LIB_REFS += System.Xaml
endif
include ../../build/library.make
[assembly: InternalsVisibleTo ("Xamarin.Mac, PublicKey=0024000004800000940000000602000000240000525341310004000011000000438ac2a5acfbf16cbd2b2b47a62762f273df9cb2795ceccdf77d10bf508e69e7a362ea7a45455bbf3ac955e1f2e2814f144e5d817efc4c6502cc012df310783348304e3ae38573c6d658c234025821fda87a0be8a0d504df564e2c93b2b878925f42503e9d54dfef9f9586d9e6f38a305769587b1de01f6c0410328b2c9733db")]
#endif
+[assembly: InternalsVisibleTo ("Xamarin.BoringTls, PublicKey=002400000480000094000000060200000024000052534131000400001100000099dd12eda85767ae6f06023ee28e711c7e5a212462095c83868c29db75eddf6d8e296e03824c14fedd5f55553fed0b6173be3cc985a4b7f9fb7c83ccff8ba3938563b3d1f45a81122f12a1bcb73edcaad61a8456c7595a6da5184b4dd9d10f011b949ef1391fccfeab1ba62aa51c267ef8bd57ef1b6ba5a4c515d0badb81a78f")]
[assembly: Guid ("BED7F4EA-1A96-11D2-8F08-00A0C9A6186D")]
LOCAL_MCS_FLAGS = -unsafe -nostdlib -nowarn:612,618,$(WARNING_ABOUT_DISABLED_WARNING) -d:INSIDE_CORLIB,MONO_CULTURE_DATA -d:LIBC $(REFERENCE_SOURCES_FLAGS)
DEFAULT_REFERENCES =
-ifdef MOBILE_STATIC
-CORLIB_MONO_POSIX_REF =
-else
-CORLIB_MONO_POSIX_REF = -r:Mono.Posix.dll
+TEST_LIB_REFS = System.Core System
+
+ifndef MOBILE_STATIC
+TEST_LIB_REFS += Mono.Posix
endif
# System.IO/DirectoryInfoTest.cs needs Mono.Posix
-TEST_MCS_FLAGS += -debug -nowarn:168,219,618,672 -unsafe $(CORLIB_MONO_POSIX_REF) -r:System.Core.dll -r:System.dll \
+TEST_MCS_FLAGS += -debug -nowarn:168,219,618,672 -unsafe \
-define:MONO_DATACONVERTER_STATIC_METHODS $(TEST_RESX_RESOURCES:%=-resource:%)
EXTRA_DISTFILES = \
$(satellite_assembly1): Test/resources/culture-es-ES.cs Test/resources/Resources.es-ES.resources
@mkdir -p es-ES
- $(CSCOMPILE) -target:library -r:$(corlib) Test/resources/culture-es-ES.cs -resource:Test/resources/Resources.es-ES.resources -out:$@
+ $(CSCOMPILE) -target:library -r:$(topdir)/class/lib/$(PROFILE)/mscorlib.dll Test/resources/culture-es-ES.cs -resource:Test/resources/Resources.es-ES.resources -out:$@
$(satellite_assembly2): Test/resources/culture-nn-NO.cs Test/resources/Resources.nn-NO.resources
@mkdir -p nn-NO
- $(CSCOMPILE) -target:library -r:$(corlib) Test/resources/culture-nn-NO.cs -resource:Test/resources/Resources.nn-NO.resources -out:$@
+ $(CSCOMPILE) -target:library -r:$(topdir)/class/lib/$(PROFILE)/mscorlib.dll Test/resources/culture-nn-NO.cs -resource:Test/resources/Resources.nn-NO.resources -out:$@
vtsdir = Test/System.Runtime.Serialization.Formatters.Binary/VersionTolerantSerialization
vtslibs = \
$(vtsdir)/$(PROFILE)_TestLib/%/Address.dll: $(vtsdir)/VersionTolerantSerializationTestLib/%/Address.cs
@mkdir -p $(dir $@)
- $(CSCOMPILE) -target:library -r:$(corlib) -warn:0 -out:$@ $^
+ $(CSCOMPILE) -target:library -warn:0 -r:$(topdir)/class/lib/$(PROFILE)/mscorlib.dll -out:$@ $^
$(vtsdir)/$(PROFILE)_TestLib/BinarySerializationOverVersions.exe: $(vtsdir)/BinarySerializationOverVersions.cs $(vtsdir)/$(PROFILE)_TestLib/1.0/Address.dll $(test_nunit_dep)
- $(CSCOMPILE) $(test_nunit_ref) -warn:0 -r:$(corlib) \
+ $(CSCOMPILE) $(test_nunit_ref) -warn:0 \
-r:$(vtsdir)/$(PROFILE)_TestLib/1.0/Address.dll \
+ -r:$(topdir)/class/lib/$(PROFILE)/mscorlib.dll \
+ -r:$(topdir)/class/lib/$(PROFILE)/System.dll \
$(vtsdir)/BinarySerializationOverVersions.cs -out:$@
@cp $(vtsdir)/$(PROFILE)_TestLib/1.0/Address.dll $(vtsdir)/$(PROFILE)_TestLib
$(vtsdir)/VersionTolerantSerializationTestLib/6.0/Address.cs \
$(vtsdir)/BinarySerializationOverVersions.cs
+EXTRA_DISTFILES += \
+ CommonCrypto/Makefile.include
+
#
# Android TimeZoneInfo testing....
#
{
// called from unmanaged code after .ctor is invoked
// we need .ctor to create unmanaged object and thus IUnknown property value
- if (FindProxy(com_object.IUnknown) == null)
+ if (FindProxy (com_object.IUnknown) == null)
AddProxy (com_object.IUnknown, this);
else
System.Threading.Interlocked.Increment (ref ref_count);
internal ComInteropProxy (IntPtr pUnk, Type t)
: base (t)
{
- com_object = new __ComObject (pUnk);
+ com_object = new __ComObject (pUnk, this);
CacheProxy ();
}
// already known, a cached proxy will be returned.
internal static ComInteropProxy CreateProxy (Type t)
{
- ComInteropProxy proxy = new ComInteropProxy (t);
- proxy.com_object.Initialize (t);
-
- ComInteropProxy cachedProxy = FindProxy (proxy.com_object.IUnknown);
+ IntPtr iunknown = __ComObject.CreateIUnknown (t);
+ ComInteropProxy proxy;
+ ComInteropProxy cachedProxy = FindProxy (iunknown);
if (cachedProxy != null) {
// check that the COM type of the cached proxy matches
// the requested type. See 2nd part of bug #520437.
Type cachedType = cachedProxy.com_object.GetType ();
if (cachedType != t)
throw new InvalidCastException (String.Format ("Unable to cast object of type '{0}' to type '{1}'.", cachedType, t));
- return cachedProxy;
+ proxy = cachedProxy;
+ Marshal.Release (iunknown);
+ } else {
+ proxy = new ComInteropProxy (t);
+ proxy.com_object.Initialize (iunknown, proxy);
}
return proxy;
}
}
}
- public override string GetSubjectSummary ()
+ public string GetSubjectSummary ()
{
ThrowIfContextInvalid ();
IntPtr cfstr = SecCertificateCopySubjectSummary (handle);
return FallbackImpl.GetIssuerName (legacyV1Mode);
}
- public override DateTime GetEffectiveDateString ()
+ public override DateTime GetValidFrom ()
{
- return FallbackImpl.GetEffectiveDateString ();
+ return FallbackImpl.GetValidFrom ();
}
- public override DateTime GetExpirationDateString ()
+ public override DateTime GetValidUntil ()
{
- return FallbackImpl.GetExpirationDateString ();
+ return FallbackImpl.GetValidUntil ();
}
public override string GetKeyAlgorithm ()
sb.AppendFormat ("[Subject]{0} {1}{0}{0}", nl, GetSubjectName (false));
sb.AppendFormat ("[Issuer]{0} {1}{0}{0}", nl, GetIssuerName (false));
- sb.AppendFormat ("[Not Before]{0} {1}{0}{0}", nl, GetEffectiveDateString ());
- sb.AppendFormat ("[Not After]{0} {1}{0}{0}", nl, GetExpirationDateString ());
+ sb.AppendFormat ("[Not Before]{0} {1}{0}{0}", nl, GetValidFrom ().ToLocalTime ());
+ sb.AppendFormat ("[Not After]{0} {1}{0}{0}", nl, GetValidUntil ().ToLocalTime ());
sb.AppendFormat ("[Thumbprint]{0} {1}{0}", nl, X509Helper.ToHexString (GetCertHash ()));
sb.Append (nl);
if (typeName == null)
throw new ArgumentNullException ("typeName");
- TypeSpec res = Parse (typeName, ref pos, false, false);
+ TypeSpec res = Parse (typeName, ref pos, false, true);
if (pos < typeName.Length)
throw new ArgumentException ("Count not parse the whole type name", "typeName");
return res;
{
Assembly asm = null;
if (assemblyResolver == null && typeResolver == null)
- return Type.GetType (name.DisplayName, throwOnError, ignoreCase);
+ return Type.GetType (DisplayFullName, throwOnError, ignoreCase);
if (assembly_name != null) {
if (assemblyResolver != null)
pos = p;
}
+ static void BoundCheck (int idx, string s)
+ {
+ if (idx >= s.Length)
+ throw new ArgumentException ("Invalid generic arguments spec", "typeName");
+ }
+
static TypeIdentifier ParsedTypeIdentifier (string displayName)
{
return TypeIdentifiers.FromDisplay(displayName);
static TypeSpec Parse (string name, ref int p, bool is_recurse, bool allow_aqn)
{
+ // Invariants:
+ // - On exit p, is updated to pos the current unconsumed character.
+ //
+ // - The callee peeks at but does not consume delimiters following
+ // recurisve parse (so for a recursive call like the args of "Foo[P,Q]"
+ // we'll return with p either on ',' or on ']'. If the name was aqn'd
+ // "Foo[[P,assmblystuff],Q]" on return p with be on the ']' just
+ // after the "assmblystuff")
+ //
+ // - If allow_aqn is True, assembly qualification is optional.
+ // If allow_aqn is False, assembly qualification is prohibited.
int pos = p;
int name_start;
bool in_modifiers = false;
data.AddModifier (new PointerSpec(pointer_level));
break;
case ',':
- if (is_recurse) {
+ if (is_recurse && allow_aqn) {
int end = pos;
while (end < name.Length && name [end] != ']')
++end;
if (end >= name.Length)
throw new ArgumentException ("Unmatched ']' while parsing generic argument assembly name");
data.assembly_name = name.Substring (pos + 1, end - pos - 1).Trim ();
- p = end + 1;
+ p = end;
return data;
}
- data.assembly_name = name.Substring (pos + 1).Trim ();
- pos = name.Length;
+ if (is_recurse) {
+ p = pos;
+ return data;
+ }
+ if (allow_aqn) {
+ data.assembly_name = name.Substring (pos + 1).Trim ();
+ pos = name.Length;
+ }
break;
case '[':
if (data.is_byref)
if (aqn)
++pos; //skip '[' to the start of the type
args.Add (Parse (name, ref pos, true, aqn));
- if (pos >= name.Length)
- throw new ArgumentException ("Invalid generic arguments spec", "typeName");
+ BoundCheck (pos, name);
+ if (aqn) {
+ if (name [pos] == ']')
+ ++pos;
+ else
+ throw new ArgumentException ("Unclosed assembly-qualified type name at " + name[pos], "typeName");
+ BoundCheck (pos, name);
+}
if (name [pos] == ']')
- break;
+ break;
if (name [pos] == ',')
++pos; // skip ',' to the start of the next arg
else
break;
case ']':
if (is_recurse) {
- p = pos + 1;
+ p = pos;
return data;
}
throw new ArgumentException ("Unmatched ']'", "typeName");
#endregion
#pragma warning restore 169
+ // keep a reference to the proxy so it doesn't get garbage collected before the RCW
+ ComInteropProxy proxy;
+
[MethodImplAttribute (MethodImplOptions.InternalCall)]
internal static extern __ComObject CreateRCW (Type t);
~__ComObject ()
{
- if (synchronization_context != null)
- synchronization_context.Post ((state) => ReleaseInterfaces (), this);
- else
- ReleaseInterfaces ();
+ if (hash_table != IntPtr.Zero) {
+ if (synchronization_context != null)
+ synchronization_context.Post ((state) => ReleaseInterfaces (), this);
+ else
+ ReleaseInterfaces ();
+ }
+ proxy = null;
}
public __ComObject ()
Initialize (t);
}
- internal __ComObject (IntPtr pItf)
+ internal __ComObject (IntPtr pItf, ComInteropProxy p)
{
+ proxy = p;
InitializeApartmentDetails ();
Guid iid = IID_IUnknown;
int hr = Marshal.QueryInterface (pItf, ref iid, out iunknown);
Marshal.ThrowExceptionForHR (hr);
}
+ internal void Initialize (IntPtr pUnk, ComInteropProxy p)
+ {
+ proxy = p;
+ InitializeApartmentDetails ();
+ iunknown = pUnk;
+ }
+
internal void Initialize (Type t)
{
InitializeApartmentDetails ();
if (iunknown != IntPtr.Zero)
return;
+ iunknown = CreateIUnknown (t);
+ }
+
+ internal static IntPtr CreateIUnknown(Type t)
+ {
System.Runtime.CompilerServices.RuntimeHelpers.RunClassConstructor (t.TypeHandle);
-
+
+ IntPtr iunknown;
ObjectCreationDelegate ocd = ExtensibleClassFactory.GetObjectCreationCallback (t);
if (ocd != null) {
iunknown = ocd (IntPtr.Zero);
int hr = CoCreateInstance (GetCLSID (t), IntPtr.Zero, 0x1 | 0x4 | 0x10, IID_IUnknown, out iunknown);
Marshal.ThrowExceptionForHR (hr);
}
+
+ return iunknown;
}
private void InitializeApartmentDetails ()
namespace MonoTests.System.Runtime.ExceptionServices
{
[TestFixture]
+ [Category ("BitcodeNotWorking")]
public class ExceptionDispatchInfoTest
{
[Test]
} catch (ArgumentNullException) {}
}
- void MustAE (string tname) {
+ void MustAE_general (string tname, Func<string,Type> getType) {
try {
- var res = Type.GetType (tname, name => {
- return Assembly.Load (name);
- },(asm,name,ignore) => {
- return (object)asm == null ? Type.GetType (name, false, ignore) : asm.GetType (name, false, ignore);
- }, true, false);
+ var res = getType (tname);
Assert.Fail (tname);
} catch (ArgumentException) {}
}
+ void MustAE (string typename) {
+ MustAE_general (typename, tname => {
+ return Type.GetType (tname, name => {
+ return Assembly.Load (name);
+ },(asm,name,ignore) => {
+ return (object)asm == null ? Type.GetType (name, false, ignore) : asm.GetType (name, false, ignore);
+ }, true, false);
+ });
+ }
+
+ void MustAEnn (string typename) {
+ MustAE_general (typename, tname => Type.GetType (tname, null, null));
+ }
+
void MustFNFE (string tname) {
try {
var res = Type.GetType (tname, name => {
Assert.AreEqual (Type.GetType ("MonoTests.System.Foo`1[System.Int32"), null, "#15");
}
+ [Test]
+ public void GetTypeNullDelegatesParseGenericCorrectly () {
+ Assert.AreEqual (Type.GetType ("MonoTests.System.Foo`1", null, null), typeof (Foo<>), "#1");
+ Assert.AreEqual (Type.GetType ("MonoTests.System.Foo`1[System.Int32]", null, null), typeof (Foo<int>), "#2");
+ Assert.AreEqual (Type.GetType ("MonoTests.System.Foo`1[[System.Int32]]", null, null), typeof (Foo<int>), "#3");
+ Assert.AreEqual (Type.GetType ("MonoTests.System.Foo`1[System.Int32][]", null, null), typeof (Foo<int>[]), "#4");
+ Assert.AreEqual (Type.GetType ("MonoTests.System.Foo`1[System.Int32][,]", null, null), typeof (Foo<int>[,]), "#5");
+ Assert.AreEqual (Type.GetType ("MonoTests.System.Foo`1[]", null, null), typeof (Foo<>).MakeArrayType(), "#6");
+ Assert.AreEqual (Type.GetType ("MonoTests.System.Foo`1[,]", null, null), typeof (Foo<>).MakeArrayType (2), "#7");
+ Assert.AreEqual (Type.GetType ("MonoTests.System.Foo`1[][]", null, null), typeof (Foo<>).MakeArrayType ().MakeArrayType (), "#8");
+
+ MustAEnn ("MonoTests.System.Foo`1[][System.Int32]");
+ MustAEnn ("MonoTests.System.Foo`1[");
+ MustAEnn ("MonoTests.System.Foo`1[[");
+ MustAEnn ("MonoTests.System.Foo`1[[]");
+ MustAEnn ("MonoTests.System.Foo`1[,");
+ MustAEnn ("MonoTests.System.Foo`1[*");
+ MustAEnn ("MonoTests.System.Foo`1[System.Int32");
+ }
+
+ Dictionary<int, T> MakeDictHelper<T> (T[] arr) {
+ return new Dictionary<int, T>();
+ }
+
+ [Test]
+ public void GetTypeAnonymousParseCorrectly () {
+ var x = new { X = 1 };
+ var a = new [] { x };
+ var d = MakeDictHelper (a);
+
+ var x_type = x.GetType ();
+ var a_type = a.GetType ();
+ var d_type = d.GetType ();
+
+ Assert.AreEqual (Type.GetType (x_type.ToString ()), x_type, "#1");
+ Assert.AreEqual (Type.GetType (x_type.ToString (), null, null), x_type, "#2");
+ Assert.AreEqual (Type.GetType (a_type.ToString ()), a_type, "#3");
+ Assert.AreEqual (Type.GetType (a_type.ToString (), null, null), a_type, "#4");
+ Assert.AreEqual (Type.GetType (d_type.ToString ()), d_type, "#5");
+ Assert.AreEqual (Type.GetType (d_type.ToString (), null, null), d_type, "#6");
+
+ Assert.AreEqual (Type.GetType (x_type.FullName), x_type, "#7");
+ Assert.AreEqual (Type.GetType (x_type.FullName, null, null), x_type, "#8");
+ Assert.AreEqual (Type.GetType (a_type.FullName), a_type, "#9");
+ Assert.AreEqual (Type.GetType (a_type.FullName, null, null), a_type, "#10");
+ Assert.AreEqual (Type.GetType (d_type.FullName), d_type, "#11");
+ Assert.AreEqual (Type.GetType (d_type.FullName, null, null), d_type, "#12");
+
+ }
+
#if !MONOTOUCH && !MOBILE_STATIC
[Test]
[Category ("AndroidNotWorking")] // requires symbol writer
#include corlib.dll.sources
+CommonCrypto/CommonCrypto.cs
+CommonCrypto/CryptorTransform.cs
+CommonCrypto/FastCryptorTransform.cs
+CommonCrypto/CorlibExtras.cs
+CommonCrypto/MD5CryptoServiceProvider.g.cs
+CommonCrypto/SHA1CryptoServiceProvider.g.cs
+CommonCrypto/SHA1CryptoServiceProvider.g.cs
+CommonCrypto/SHA1Managed.g.cs
+CommonCrypto/SHA256Managed.g.cs
+CommonCrypto/SHA384Managed.g.cs
+CommonCrypto/SHA512Managed.g.cs
+CommonCrypto/TripleDESCryptoServiceProvider.g.cs
+CommonCrypto/DESCryptoServiceProvider.g.cs
+CommonCrypto/RC2CryptoServiceProvider.g.cs
+CommonCrypto/RijndaelManaged.cs
+CommonCrypto/SecRandom.cs
+CommonCrypto/RC4CommonCrypto.cs
+CommonCrypto/MD2Managed.g.cs
+CommonCrypto/MD4Managed.g.cs
+System/Environment.iOS.cs
+System/Guid.MonoTouch.cs
+System/NotSupportedException.iOS.cs
+CoreFoundation/CFHelpers.cs
+System.Security.Cryptography.X509Certificates/X509CertificateImplApple.cs
+System.Security.Cryptography.X509Certificates/X509Helper.Apple.cs
+System.Text/EncodingHelper.MonoTouch.cs
#include corlib.dll.sources
+CommonCrypto/CommonCrypto.cs
+CommonCrypto/CryptorTransform.cs
+CommonCrypto/FastCryptorTransform.cs
+CommonCrypto/CorlibExtras.cs
+CommonCrypto/MD5CryptoServiceProvider.g.cs
+CommonCrypto/SHA1CryptoServiceProvider.g.cs
+CommonCrypto/SHA1CryptoServiceProvider.g.cs
+CommonCrypto/SHA1Managed.g.cs
+CommonCrypto/SHA256Managed.g.cs
+CommonCrypto/SHA384Managed.g.cs
+CommonCrypto/SHA512Managed.g.cs
+CommonCrypto/TripleDESCryptoServiceProvider.g.cs
+CommonCrypto/DESCryptoServiceProvider.g.cs
+CommonCrypto/RC2CryptoServiceProvider.g.cs
+CommonCrypto/RijndaelManaged.cs
+CommonCrypto/SecRandom.cs
+CommonCrypto/RC4CommonCrypto.cs
+CommonCrypto/MD2Managed.g.cs
+CommonCrypto/MD4Managed.g.cs
+System/Environment.iOS.cs
+System/Guid.MonoTouch.cs
+System/NotSupportedException.iOS.cs
+CoreFoundation/CFHelpers.cs
+System.Security.Cryptography.X509Certificates/X509CertificateImplApple.cs
+System.Security.Cryptography.X509Certificates/X509Helper.Apple.cs
+System.Text/EncodingHelper.MonoTouch.cs
/resource:Resources/mono-ecma.xsl,mono-ecma.xsl \
/resource:Resources/toc-html.xsl,toc-html.xsl \
$(IMAGE_RESOURCE_COMMAND) \
- /r:$(corlib)
+ /publicsign
CLEAN_FILES += $(the_lib).config
-TEST_MCS_FLAGS = /r:System.dll /r:System.Core.dll /r:System.Xml.dll
+TEST_MCS_FLAGS =
+TEST_LIB_REFS = System System.Core System.Xml
DOC_SOURCE_DIRS = \
../../docs \
csproj-local install-local uninstall-local:
+CS0029-26-lib.dll : CS0029-26-lib.cs
+ $(CSCOMPILE) /target:library /publicsign /out:$@ $<
+
+CS0266-25-lib.dll: CS0266-25-lib.cs
+ $(CSCOMPILE) /target:library /r:$(topdir)/class/lib/$(PROFILE)/System.Core.dll /out:$@ $<
+
+dlls/first/CS1701-lib.dll: dlls/first/CS1701-lib.cs
+ $(CSCOMPILE) /target:library /warn:0 /publicsign /out:$@ $<
+
+dlls/first/CS1702-lib.dll: dlls/first/CS1702-lib.cs
+ $(CSCOMPILE) /target:library /warn:0 /publicsign /out:$@ $<
+
+dlls/first/CS1703-lib.dll: dlls/first/CS1703-lib.cs
+ $(CSCOMPILE) /target:library /warn:0 /publicsign /out:$@ $<
+
+dlls/first/CS1705-lib.dll: dlls/first/CS1705-lib.cs
+ $(CSCOMPILE) /target:library /warn:0 /publicsign /out:$@ $<
+
+dlls/second/CS1701-lib.dll: dlls/second/CS1701-lib.cs
+ $(CSCOMPILE) /target:library /warn:0 /publicsign /out:$@ $<
+
+dlls/second/CS1702-lib.dll: dlls/second/CS1702-lib.cs
+ $(CSCOMPILE) /target:library /warn:0 /publicsign /out:$@ $<
+
+dlls/second/CS1703-lib.dll: dlls/second/CS1703-lib.cs
+ $(CSCOMPILE) /target:library /warn:0 /publicsign /out:$@ $<
+
+dlls/second/CS1705-lib.dll: dlls/second/CS1705-lib.cs
+ $(CSCOMPILE) /target:library /warn:0 /publicsign /out:$@ $<
+
CS1701-lib.dll : CS1701-lib.cs
$(CSCOMPILE) /target:library /warn:0 /r:dlls/first/CS1701-lib.dll /out:$@ $<
cs-parser.jay \
mcs.exe.sources
-LIB_REFS = System System.Core System.Xml
-
ifeq (basic, $(PROFILE))
+LOCAL_MCS_FLAGS += -r:System.dll -r:System.Core.dll -r:System.Xml.dll -debug
+
PROGRAM = basic.exe
sourcefile = mcs.exe.sources
else
+LIB_REFS = System System.Core System.Xml
+
PROGRAM_USE_INTERMEDIATE_FILE = true
PROGRAM = mcs.exe
the_libdir = $(topdir)/class/lib/build/
-LOCAL_MCS_FLAGS += -lib:$(topdir)/class/lib/build -debug
+LOCAL_MCS_FLAGS += -debug
endif
-LOCAL_MCS_FLAGS += -d:STATIC,NO_SYMBOL_WRITER,NO_AUTHENTICODE -r:System.Core.dll -r:System.Xml.dll
+LOCAL_MCS_FLAGS += -d:STATIC,NO_SYMBOL_WRITER,NO_AUTHENTICODE
ifndef NO_THREAD_ABORT
REFERENCE_SOURCES_FLAGS += -d:MONO_FEATURE_THREAD_ABORT
LIBRARY = nunit.util.dll
LIBRARY_SNK = $(topdir)/nunit24/nunit.snk
-LOCAL_MCS_FLAGS= \
- /resource:Transform.resources,NUnit.Util.Transform.resources \
- -r:nunit.core.dll -r:nunit.core.interfaces.dll -r:System.dll \
- -r:System.Xml.dll -r:System.Runtime.Remoting.dll \
- /d:MONO /d:StronglyNamedAssembly -warn:1
+LOCAL_MCS_FLAGS= /resource:Transform.resources,NUnit.Util.Transform.resources /d:MONO /d:StronglyNamedAssembly /publicsign -warn:1
+LIB_REFS = nunit.core nunit.core.interfaces System System.Xml System.Runtime.Remoting
NO_TEST = yo
RESX_RES = Transform.resources
include ../../../build/rules.make
PROGRAM = nunit-console.exe
-LOCAL_MCS_FLAGS = \
- /r:nunit.framework.dll /r:nunit.util.dll /r:nunit.core.dll \
- /r:nunit-console-runner.dll
+LOCAL_MCS_FLAGS =
+LIB_REFS = nunit.framework nunit.util nunit.core nunit-console-runner
+
EXTRA_DISTFILES = App.ico \
nunit-console.exe.csproj \
nunit-console.exe_VS2005.csproj \
LIBRARY = nunit-console-runner.dll
LIBRARY_SNK = $(topdir)/nunit24/nunit.snk
-LOCAL_MCS_FLAGS= \
- -r:nunit.core.dll -r:nunit.core.interfaces.dll -r:nunit.util.dll \
- -r:System.dll -r:System.Xml.dll \
- /d:MONO /d:StronglyNamedAssembly
+LOCAL_MCS_FLAGS= /d:MONO /d:StronglyNamedAssembly /publicsign
+LIB_REFS = nunit.core nunit.core.interfaces nunit.util System System.Xml
NO_TEST = yo
EXTRA_DISTFILES = nunit-console.csproj nunit-console_VS2005.csproj
LIBRARY = nunit.core.dll
LIBRARY_SNK = $(topdir)/nunit24/nunit.snk
-LOCAL_MCS_FLAGS= -r:nunit.framework.dll -r:nunit.core.interfaces.dll -r:System.dll /d:StronglyNamedAssembly -warn:1
+LOCAL_MCS_FLAGS = /d:StronglyNamedAssembly -warn:1 /publicsign
+LIB_REFS = nunit.framework nunit.core.interfaces System
NO_TEST = yo
EXTRA_DISTFILES = nunit.core.dll.csproj nunit.core.dll_VS2005.csproj
LIBRARY = nunit.core.interfaces.dll
LIBRARY_SNK = $(topdir)/nunit24/nunit.snk
-LOCAL_MCS_FLAGS= -debug -r:nunit.framework.dll -r:System.dll /d:StronglyNamedAssembly
+LOCAL_MCS_FLAGS= /d:StronglyNamedAssembly /publicsign
+LIB_REFS = nunit.framework System
NO_TEST = yo
EXTRA_DISTFILES = nunit.core.interfaces.dll.csproj nunit.core.interfaces.dll_VS2005.csproj
LIBRARY = nunit.core.extensions.dll
LIBRARY_SNK = $(topdir)/nunit24/nunit.snk
-LIB_MCS_FLAGS = \
- -debug \
- /r:nunit.core.dll /r:nunit.core.interfaces.dll \
- /r:System.Xml.dll /r:System.dll /d:StronglyNamedAssembly
+LIB_MCS_FLAGS = /d:StronglyNamedAssembly /publicsign
+LIB_REFS = nunit.core nunit.core.interfaces System.Xml System
NO_TEST = yo
EXTRA_DISTFILES = \
LIBRARY = nunit.framework.extensions.dll
LIBRARY_SNK = $(topdir)/nunit24/nunit.snk
-LIB_MCS_FLAGS = -debug /r:System.Xml.dll /r:System.dll /d:StronglyNamedAssembly
+LIB_MCS_FLAGS = /d:StronglyNamedAssembly /publicsign
+LIB_REFS = System.Xml System
NO_TEST = yo
EXTRA_DISTFILES = \
LIBRARY_NAME = nunit.framework.dll
LIBRARY_SNK = $(topdir)/nunit24/nunit.snk
-LIB_MCS_FLAGS = /r:System.Xml.dll /r:System.dll /d:StronglyNamedAssembly -warn:1
+LIB_MCS_FLAGS = /d:StronglyNamedAssembly -warn:1 /publicsign
+LIB_REFS = System.Xml System
NO_TEST = yo
EXTRA_DISTFILES = \
LIBRARY = nunit.mocks.dll
LIBRARY_SNK = $(topdir)/nunit24/nunit.snk
-LOCAL_MCS_FLAGS= -debug -r:nunit.framework.dll -r:System.dll /d:StronglyNamedAssembly
+LOCAL_MCS_FLAGS= /d:StronglyNamedAssembly /publicsign
+LIB_REFS = nunit.framework System
NO_TEST = yo
EXTRA_DISTFILES = \
xbuild \
csharp \
corcompare \
+ mono-api-html \
compiler-tester \
mono-xmltool \
mono-shlib-cop \
using System.Globalization;
using System.IO;
using System.Collections;
+using System.Collections.Generic;
using System.Reflection;
using System.Reflection.Emit;
using System.Security.Cryptography;
using System.Configuration.Assemblies;
using Mono.Security.Cryptography;
+using IKR = IKVM.Reflection;
namespace Mono.AssemblyLinker
{
* Emit Manifest
* */
- if (isTemplateFile) {
- // LAMESPEC: according to MSDN, the template assembly must have a
- // strong name but this is not enforced
- Assembly assembly = Assembly.LoadFrom (templateFile);
-
- // inherit signing related settings from template, but do not
- // override command-line options
- object [] attrs = assembly.GetCustomAttributes (true);
- foreach (object o in attrs) {
- if (o is AssemblyKeyFileAttribute) {
- if (keyfile != null)
- // ignore if specified on command line
- continue;
- AssemblyKeyFileAttribute keyFileAttr = (AssemblyKeyFileAttribute) o;
- // ignore null or zero-length keyfile
- if (keyFileAttr.KeyFile == null || keyFileAttr.KeyFile.Length == 0)
- continue;
- keyfile = Path.Combine (Path.GetDirectoryName(templateFile),
- keyFileAttr.KeyFile);
- } else if (o is AssemblyDelaySignAttribute) {
- if (delaysign != DelaySign.NotSet)
- // ignore if specified on command line
- continue;
- AssemblyDelaySignAttribute delaySignAttr = (AssemblyDelaySignAttribute) o;
- delaysign = delaySignAttr.DelaySign ? DelaySign.Yes :
- DelaySign.No;
- } else if (o is AssemblyKeyNameAttribute) {
- if (keyname != null)
- // ignore if specified on command line
- continue;
- AssemblyKeyNameAttribute keynameAttr = (AssemblyKeyNameAttribute) o;
- // ignore null or zero-length keyname
- if (keynameAttr.KeyName == null || keynameAttr.KeyName.Length == 0)
- continue;
- keyname = keynameAttr.KeyName;
- }
- }
- aname.Version = assembly.GetName().Version;
- aname.HashAlgorithm = assembly.GetName().HashAlgorithm;
- }
+ if (isTemplateFile)
+ aname = ReadCustomAttributesFromTemplateFile (templateFile, aname);
SetKeyPair (aname);
}
}
+ private AssemblyName ReadCustomAttributesFromTemplateFile (string templateFile, AssemblyName aname)
+ {
+ // LAMESPEC: according to MSDN, the template assembly must have a
+ // strong name but this is not enforced
+ const IKR.UniverseOptions options = IKR.UniverseOptions.MetadataOnly;
+
+ var universe = new IKR.Universe (options);
+ var asm = universe.LoadFile (templateFile);
+
+ // Create missing assemblies, we don't want to load them!
+ // Code taken from ikdasm
+ var names = new HashSet<string> ();
+ IKR.AssemblyName[] assembly_refs = asm.ManifestModule.__GetReferencedAssemblies ();
+
+ var resolved_assemblies = new IKR.Assembly [assembly_refs.Length];
+ for (int i = 0; i < resolved_assemblies.Length; i++) {
+ string name = assembly_refs [i].Name;
+
+ while (names.Contains (name)) {
+ name = name + "_" + i;
+ }
+ names.Add (name);
+ resolved_assemblies [i] = universe.CreateMissingAssembly (assembly_refs [i].FullName);
+ }
+ asm.ManifestModule.__ResolveReferencedAssemblies (resolved_assemblies);
+
+ foreach (var attr_data in asm.__GetCustomAttributes (null, false)) {
+ string asm_name = attr_data.AttributeType.Assembly.GetName ().Name;
+ if (asm_name != "mscorlib")
+ continue;
+
+ switch (attr_data.AttributeType.FullName) {
+ case "System.Reflection.AssemblyKeyFileAttribute": {
+ if (keyfile != null)
+ // ignore if specified on command line
+ continue;
+
+ // / AssemblyKeyFileAttribute .ctor(string keyFile)
+ string key_file_value = (string) attr_data.ConstructorArguments [0].Value;
+
+ if (!String.IsNullOrEmpty (key_file_value))
+ keyfile = Path.Combine (Path.GetDirectoryName (templateFile), key_file_value);
+ }
+ break;
+
+ case "System.Reflection.AssemblyDelaySignAttribute": {
+ if (delaysign != DelaySign.NotSet)
+ // ignore if specified on command line
+ continue;
+
+ // AssemblyDelaySignAttribute .ctor(bool delaySign)
+ bool delay_sign_value = (bool) attr_data.ConstructorArguments [0].Value;
+ delaysign = delay_sign_value ? DelaySign.Yes : DelaySign.No;
+ }
+ break;
+
+ case "System.Reflection.AssemblyKeyNameAttribute": {
+ if (keyname != null)
+ // ignore if specified on command line
+ continue;
+
+ // AssemblyKeyNameAttribute .ctor(string keyName)
+ string key_name_value = (string) attr_data.ConstructorArguments [0].Value;
+
+ // ignore null or zero-length keyname
+ if (!String.IsNullOrEmpty (key_name_value))
+ keyname = key_name_value;
+ }
+ break;
+ }
+ }
+
+ var asm_name_for_template_file = asm.GetName ();
+ aname.Version = asm_name_for_template_file.Version;
+ aname.HashAlgorithm = asm_name_for_template_file.HashAlgorithm;
+
+ return aname;
+ }
+
private void LoadArgs (string file, ArrayList args) {
StreamReader f = null;
string line;
SUBDIRS =
include ../../build/rules.make
-LOCAL_MCS_FLAGS = -r:Mono.Security.dll
+LOCAL_MCS_FLAGS =
+LIB_REFS = System System.Core Mono.Security System.Security Mono.CompilerServices.SymbolWriter
PROGRAM = al.exe
CLEAN_FILES = al.exe al.exe.mdb
Al.cs
../../build/common/Consts.cs
+../../../external/ikvm/reflect/*.cs
+../../../external/ikvm/reflect/Emit/*.cs
+../../../external/ikvm/reflect/Metadata/*.cs
+../../../external/ikvm/reflect/Reader/*.cs
+../../../external/ikvm/reflect/Writer/*.cs
+../../../external/ikvm/reflect/Impl/*.cs
+../../../external/ikvm/reflect/Properties/*.cs
SUBDIRS =
include ../../build/rules.make
-LOCAL_MCS_FLAGS = -r:System.dll
+LOCAL_MCS_FLAGS =
+LIB_REFS = System
PROGRAM = browsercaps-updater.exe
PROGRAM = cccheck.exe
-LOCAL_MCS_FLAGS = -r:Mono.CodeContracts.dll -r:System.dll
+LOCAL_MCS_FLAGS =
+LIB_REFS = Mono.CodeContracts System
include ../../build/executable.make
PROGRAM = ccrewrite.exe
-LOCAL_MCS_FLAGS = -r:Mono.CodeContracts.dll -r:System.dll -r:System.Core.dll
+LOCAL_MCS_FLAGS =
+LIB_REFS = Mono.CodeContracts System System.Core
include ../../build/executable.make
PROGRAM = cil-stringreplacer.exe
NO_INSTALL = yes
-LOCAL_MCS_FLAGS = -r:System.dll -r:Mono.Cecil.dll
+LIB_REFS = System Mono.Cecil
include ../../build/executable.make
SUBDIRS =
include ../../build/rules.make
-LOCAL_MCS_FLAGS = -r:System.dll
+LOCAL_MCS_FLAGS =
+LIB_REFS = System
PROGRAM = mono-cil-strip.exe
PROGRAM = compiler-tester.exe
NO_INSTALL = yes
-LOCAL_MCS_FLAGS = -r:System.dll -r:System.Core.dll -r:System.Xml.dll
+LOCAL_MCS_FLAGS =
+LIB_REFS = System System.Core System.Xml
include $(topdir)/build/executable.make
SUBDIRS =
include ../../build/rules.make
-ALL_PROGRAMS = mono-api-info.exe mono-api-html.exe
+LIB_REFS = Mono.Cecil System.Xml System.Core System
+LOCAL_MCS_FLAGS =
-PROGRAM_INSTALL_DIR = $(mono_libdir)/mono/$(FRAMEWORK_VERSION)
+PROGRAM = mono-api-info.exe
-APIINFO_SOURCES = \
- mono-api-info.cs \
- AssemblyResolver.cs \
- Util.cs \
- WellFormedXmlWriter.cs \
- ../../class/Mono.Options/Mono.Options/Options.cs
-
-APIHTML_SOURCES = \
- mono-api-html/ApiChange.cs \
- mono-api-html/ApiDiff.cs \
- mono-api-html/AssemblyComparer.cs \
- mono-api-html/ClassComparer.cs \
- mono-api-html/Comparer.cs \
- mono-api-html/ConstructorComparer.cs \
- mono-api-html/EventComparer.cs \
- mono-api-html/FieldComparer.cs \
- mono-api-html/Helpers.cs \
- mono-api-html/InterfaceComparer.cs \
- mono-api-html/MemberComparer.cs \
- mono-api-html/MethodComparer.cs \
- mono-api-html/NamespaceComparer.cs \
- mono-api-html/PropertyComparer.cs \
- ../../class/Mono.Options/Mono.Options/Options.cs
-
-
-DISTFILES= $(APIINFO_SOURCES) $(APIHTML_SOURCES)
-
-all-local: $(ALL_PROGRAMS)
-
-csproj-local doc-update-local:
-
-install-local: $(ALL_PROGRAMS)
- $(MKINSTALLDIRS) $(DESTDIR)$(PROGRAM_INSTALL_DIR)
- for i in $(ALL_PROGRAMS) ; do \
- $(INSTALL_BIN) $$i $(DESTDIR)$(PROGRAM_INSTALL_DIR) ; \
- done
-
-uninstall-local:
- for i in $(ALL_PROGRAMS) ; do \
- rm -f $(DESTDIR)$(PROGRAM_INSTALL_DIR)/`basename $$i` ; \
- done
-
-test-local:
-
-run-test-local run-test-ondotnet-local:
-
-clean-local:
- rm -f *.exe *.pdb
-
-dist-local: dist-default
-
-mono-api-info.exe: $(APIINFO_SOURCES)
- $(CSCOMPILE) -r:Mono.Cecil.dll -r:System.Xml.dll -r:System.Core.dll -r:System.dll -out:$@ $^
-
-mono-api-html.exe: $(APIHTML_SOURCES)
- $(CSCOMPILE) -r:Mono.Cecil.dll -r:System.Xml.dll -r:System.Core.dll -r:System.dll -r:System.Xml.Linq.dll -out:$@ $^
+include ../../build/executable.make
+++ /dev/null
-using System;
-using System.Collections.Generic;
-using System.Text;
-using System.Xml.Linq;
-
-namespace Xamarin.ApiDiff
-{
- public class ApiChange
- {
- public string Header;
- public StringBuilder Member = new StringBuilder ();
- public bool Breaking;
- public bool AnyChange;
- public bool HasIgnoredChanges;
-
- public ApiChange Append (string text)
- {
- Member.Append (text);
- return this;
- }
-
- public ApiChange AppendAdded (string text, bool breaking = false)
- {
- Member.Append ("<span class='added ").Append (breaking ? "added-breaking-inline" : string.Empty).Append ("'>");
- Member.Append (text);
- Member.Append ("</span>");
- Breaking |= breaking;
- AnyChange = true;
- return this;
- }
-
- public ApiChange AppendRemoved (string text, bool breaking = true)
- {
- Member.Append ("<span class='removed removed-inline ").Append (breaking ? "removed-breaking-inline" : string.Empty).Append ("'>");
- Member.Append (text);
- Member.Append ("</span>");
- Breaking |= breaking;
- AnyChange = true;
- return this;
- }
-
- public ApiChange AppendModified (string old, string @new, bool breaking = true)
- {
- if (old.Length > 0)
- AppendRemoved (old, breaking);
- if (old.Length > 0 && @new.Length > 0)
- Append (" ");
- if (@new.Length > 0)
- AppendAdded (@new);
- Breaking |= breaking;
- AnyChange = true;
- return this;
- }
- }
-
- public class ApiChanges : Dictionary<string, List<ApiChange>> {
- public void Add (XElement source, XElement target, ApiChange change)
- {
- if (!change.AnyChange) {
- // This is most likely because the rendering doesn't take into account something that's different (solution: fix rendering).
- if (!change.HasIgnoredChanges) {
- var isField = source.Name.LocalName == "field";
- if (isField) {
- Console.WriteLine ("Comparison resulting in no changes (src: {2} dst: {3}) :\n{0}\n{1}\n\n", source.ToString (), target.ToString (), source.GetFieldAttributes (), target.GetFieldAttributes ());
- } else {
- Console.WriteLine ("Comparison resulting in no changes (src: {2} dst: {3}) :\n{0}\n{1}\n\n", source.ToString (), target.ToString (), source.GetMethodAttributes (), target.GetMethodAttributes ());
- }
- }
- return;
- }
-
- List<ApiChange> list;
- if (!TryGetValue (change.Header, out list)) {
- list = new List<ApiChange> ();
- base.Add (change.Header, list);
- }
- list.Add (change);
- }
- }
-}
-
+++ /dev/null
-//
-// The main differences with mono-api-diff are:
-// * this tool directly produce HTML similar to gdiff.sh used for Xamarin.iOS
-// * this tool reports changes in an "evolutionary" way, not in a breaking way,
-// i.e. it does not assume the source assembly is right (but simply older)
-// * the diff .xml output was not easy to convert back into the HTML format
-// that gdiff.sh produced
-//
-// Authors
-// Sebastien Pouliot <sebastien@xamarin.com>
-//
-// Copyright 2013-2014 Xamarin Inc. http://www.xamarin.com
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-using System.IO;
-using System.Collections.Generic;
-using System.Text.RegularExpressions;
-
-using Mono.Options;
-
-namespace Xamarin.ApiDiff {
-
- public static class State {
- static TextWriter output;
-
- public static TextWriter Output {
- get {
- if (output == null)
- output = Console.Out;
- return output;
- }
- set { output = value; }
- }
-
- public static string Assembly { get; set; }
- public static string Namespace { get; set; }
- public static string Type { get; set; }
- public static string BaseType { get; set; }
-
- public static int Indent { get; set; }
-
- static List<Regex> ignoreAdded = new List<Regex> ();
- public static List<Regex> IgnoreAdded {
- get { return ignoreAdded; }
- }
-
- static List<Regex> ignoreNew = new List<Regex> ();
- public static List<Regex> IgnoreNew {
- get { return ignoreNew; }
- }
-
- static List<Regex> ignoreRemoved = new List<Regex> ();
- public static List<Regex> IgnoreRemoved {
- get { return ignoreRemoved; }
- }
-
- public static bool IgnoreParameterNameChanges { get; set; }
- public static bool IgnoreVirtualChanges { get; set; }
- public static bool IgnoreAddedPropertySetters { get; set; }
-
- public static bool Lax;
- public static bool Colorize = true;
- }
-
- class Program {
-
- public static int Main (string[] args)
- {
- var showHelp = false;
- string diff = null;
- List<string> extra = null;
-
- var options = new OptionSet {
- { "h|help", "Show this help", v => showHelp = true },
- { "d|diff=", "HTML diff file out output (omit for stdout)", v => diff = v },
- { "i|ignore=", "Ignore new, added, and removed members whose description matches a given C# regular expression (see below).",
- v => {
- var r = new Regex (v);
- State.IgnoreAdded.Add (r);
- State.IgnoreRemoved.Add (r);
- State.IgnoreNew.Add (r);
- }
- },
- { "a|ignore-added=", "Ignore added members whose description matches a given C# regular expression (see below).",
- v => State.IgnoreAdded.Add (new Regex (v))
- },
- { "r|ignore-removed=", "Ignore removed members whose description matches a given C# regular expression (see below).",
- v => State.IgnoreRemoved.Add (new Regex (v))
- },
- { "n|ignore-new=", "Ignore new namespaces and types whose description matches a given C# regular expression (see below).",
- v => State.IgnoreNew.Add (new Regex (v))
- },
- { "ignore-changes-parameter-names", "Ignore changes to parameter names for identically prototyped methods.",
- v => State.IgnoreParameterNameChanges = v != null
- },
- { "ignore-changes-property-setters", "Ignore adding setters to properties.",
- v => State.IgnoreAddedPropertySetters = v != null
- },
- { "ignore-changes-virtual", "Ignore changing non-`virtual` to `virtual` or adding `override`.",
- v => State.IgnoreVirtualChanges = v != null
- },
- { "c|colorize:", "Colorize HTML output", v => State.Colorize = string.IsNullOrEmpty (v) ? true : bool.Parse (v) },
- { "x|lax", "Ignore duplicate XML entries", v => State.Lax = true }
- };
-
- try {
- extra = options.Parse (args);
- } catch (OptionException e) {
- Console.WriteLine ("Option error: {0}", e.Message);
- showHelp = true;
- }
-
- if (showHelp || extra == null || extra.Count < 2 || extra.Count > 3) {
- Console.WriteLine (@"Usage: mono-api-html [options] <reference.xml> <assembly.xml> [diff.html]");
- Console.WriteLine ();
- Console.WriteLine ("Available options:");
- options.WriteOptionDescriptions (Console.Out);
- Console.WriteLine ();
- Console.WriteLine ("Ignoring Members:");
- Console.WriteLine ();
- Console.WriteLine (" Members that were added can be filtered out of the diff by using the");
- Console.WriteLine (" -i, --ignore-added option. The option takes a C# regular expression");
- Console.WriteLine (" to match against member descriptions. For example, to ignore the");
- Console.WriteLine (" introduction of the interfaces 'INSCopying' and 'INSCoding' on types");
- Console.WriteLine (" pass the following to mono-api-html:");
- Console.WriteLine ();
- Console.WriteLine (" mono-api-html ... -i 'INSCopying$' -i 'INSCoding$'");
- Console.WriteLine ();
- Console.WriteLine (" The regular expressions will match any member description ending with");
- Console.WriteLine (" 'INSCopying' or 'INSCoding'.");
- Console.WriteLine ();
- return 1;
- }
-
- var input = extra [0];
- var output = extra [1];
- if (extra.Count == 3 && diff == null)
- diff = extra [2];
-
- try {
- var ac = new AssemblyComparer (input, output);
- if (diff != null) {
- string diffHtml = String.Empty;
- using (var writer = new StringWriter ()) {
- State.Output = writer;
- ac.Compare ();
- diffHtml = State.Output.ToString ();
- }
- if (diffHtml.Length > 0) {
- using (var file = new StreamWriter (diff)) {
- file.WriteLine ("<div>");
- if (State.Colorize) {
- file.WriteLine ("<style scoped>");
- file.WriteLine ("\t.obsolete { color: gray; }");
- file.WriteLine ("\t.added { color: green; }");
- file.WriteLine ("\t.removed-inline { text-decoration: line-through; }");
- file.WriteLine ("\t.removed-breaking-inline { color: red;}");
- file.WriteLine ("\t.added-breaking-inline { text-decoration: underline; }");
- file.WriteLine ("\t.nonbreaking { color: black; }");
- file.WriteLine ("\t.breaking { color: red; }");
- file.WriteLine ("</style>");
- }
- file.WriteLine (
-@"<script type=""text/javascript"">
- // Only some elements have 'data-is-[non-]breaking' attributes. Here we
- // iterate over all descendents elements, and set 'data-is-[non-]breaking'
- // depending on whether there are any descendents with that attribute.
- function propagateDataAttribute (element)
- {
- if (element.hasAttribute ('data-is-propagated'))
- return;
-
- var i;
- var any_breaking = element.hasAttribute ('data-is-breaking');
- var any_non_breaking = element.hasAttribute ('data-is-non-breaking');
- for (i = 0; i < element.children.length; i++) {
- var el = element.children [i];
- propagateDataAttribute (el);
- any_breaking |= el.hasAttribute ('data-is-breaking');
- any_non_breaking |= el.hasAttribute ('data-is-non-breaking');
- }
-
- if (any_breaking)
- element.setAttribute ('data-is-breaking', null);
- else if (any_non_breaking)
- element.setAttribute ('data-is-non-breaking', null);
- element.setAttribute ('data-is-propagated', null);
- }
-
- function hideNonBreakingChanges ()
- {
- var topNodes = document.querySelectorAll ('[data-is-topmost]');
- var n;
- var i;
- for (n = 0; n < topNodes.length; n++) {
- propagateDataAttribute (topNodes [n]);
- var elements = topNodes [n].querySelectorAll ('[data-is-non-breaking]');
- for (i = 0; i < elements.length; i++) {
- var el = elements [i];
- if (!el.hasAttribute ('data-original-display'))
- el.setAttribute ('data-original-display', el.style.display);
- el.style.display = 'none';
- }
- }
-
- var links = document.getElementsByClassName ('hide-nonbreaking');
- for (i = 0; i < links.length; i++)
- links [i].style.display = 'none';
- links = document.getElementsByClassName ('restore-nonbreaking');
- for (i = 0; i < links.length; i++)
- links [i].style.display = '';
- }
-
- function showNonBreakingChanges ()
- {
- var elements = document.querySelectorAll ('[data-original-display]');
- var i;
- for (i = 0; i < elements.length; i++) {
- var el = elements [i];
- el.style.display = el.getAttribute ('data-original-display');
- }
-
- var links = document.getElementsByClassName ('hide-nonbreaking');
- for (i = 0; i < links.length; i++)
- links [i].style.display = '';
- links = document.getElementsByClassName ('restore-nonbreaking');
- for (i = 0; i < links.length; i++)
- links [i].style.display = 'none';
- }
-</script>");
- if (ac.SourceAssembly == ac.TargetAssembly) {
- file.WriteLine ("<h1>{0}.dll</h1>", ac.SourceAssembly);
- } else {
- file.WriteLine ("<h1>{0}.dll vs {1}.dll</h1>", ac.SourceAssembly, ac.TargetAssembly);
- }
- file.WriteLine ("<a href='javascript: hideNonBreakingChanges (); ' class='hide-nonbreaking'>Hide non-breaking changes</a>");
- file.WriteLine ("<a href='javascript: showNonBreakingChanges (); ' class='restore-nonbreaking' style='display: none;'>Show non-breaking changes</a>");
- file.WriteLine ("<br/>");
- file.WriteLine ("<div data-is-topmost>");
- file.Write (diffHtml);
- file.WriteLine ("</div> <!-- end topmost div -->");
- file.WriteLine ("</div>");
- }
- }
- } else {
- State.Output = Console.Out;
- ac.Compare ();
- }
- }
- catch (Exception e) {
- Console.WriteLine (e);
- return 1;
- }
- return 0;
- }
- }
-}
+++ /dev/null
-//
-// Authors
-// Sebastien Pouliot <sebastien@xamarin.com>
-//
-// Copyright 2013 Xamarin Inc. http://www.xamarin.com
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-using System.Collections.Generic;
-using System.Xml.Linq;
-
-namespace Xamarin.ApiDiff {
-
- public class AssemblyComparer : Comparer {
-
- XDocument source;
- XDocument target;
- NamespaceComparer comparer;
-
- public AssemblyComparer (string sourceFile, string targetFile)
- {
- source = XDocument.Load (sourceFile);
- target = XDocument.Load (targetFile);
- comparer = new NamespaceComparer ();
- }
-
- public string SourceAssembly { get; private set; }
- public string TargetAssembly { get; private set; }
-
- public void Compare ()
- {
- Compare (source.Element ("assemblies").Elements ("assembly"),
- target.Element ("assemblies").Elements ("assembly"));
- }
-
- public override void SetContext (XElement current)
- {
- State.Assembly = current.GetAttribute ("name");
- }
-
- public override void Added (XElement target, bool wasParentAdded)
- {
- // one assembly per xml file
- }
-
- public override void Modified (XElement source, XElement target, ApiChanges diff)
- {
- SourceAssembly = source.GetAttribute ("name");
- TargetAssembly = target.GetAttribute ("name");
- // TODO: version
- // ? custom attributes ?
- comparer.Compare (source, target);
- }
-
- public override void Removed (XElement source)
- {
- // one assembly per xml file
- }
- }
-}
\ No newline at end of file
+++ /dev/null
-//
-// Authors
-// Sebastien Pouliot <sebastien@xamarin.com>
-//
-// Copyright 2013 Xamarin Inc. http://www.xamarin.com
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-using System.Collections.Generic;
-using System.IO;
-using System.Linq;
-using System.Xml.Linq;
-
-namespace Xamarin.ApiDiff {
-
- public class ClassComparer : Comparer {
-
- InterfaceComparer icomparer;
- ConstructorComparer ccomparer;
- FieldComparer fcomparer;
- PropertyComparer pcomparer;
- EventComparer ecomparer;
- MethodComparer mcomparer;
- ClassComparer kcomparer;
-
- public ClassComparer ()
- {
- icomparer = new InterfaceComparer ();
- ccomparer = new ConstructorComparer ();
- fcomparer = new FieldComparer ();
- pcomparer = new PropertyComparer ();
- ecomparer = new EventComparer ();
- mcomparer = new MethodComparer ();
- }
-
- public override void SetContext (XElement current)
- {
- State.Type = current.GetAttribute ("name");
- State.BaseType = current.GetAttribute ("base");
- }
-
- public void Compare (XElement source, XElement target)
- {
- var s = source.Element ("classes");
- var t = target.Element ("classes");
- if (XNode.DeepEquals (s, t))
- return;
- Compare (s.Elements ("class"), t.Elements ("class"));
- }
-
- public override void Added (XElement target, bool wasParentAdded)
- {
- string name = target.Attribute ("name").Value;
- if (State.IgnoreNew.Any (re => re.IsMatch (name)))
- return;
- Output.WriteLine ("<div> <!-- start type {0} -->", name);
- Output.WriteLine ("<h3>New Type {0}.{1}</h3>", State.Namespace, name);
- Output.WriteLine ("<pre class='added' data-is-non-breaking>");
- State.Indent = 0;
- AddedInner (target);
- Output.WriteLine ("</pre>");
- Output.WriteLine ("</div> <!-- end type {0} -->", name);
- }
-
- public void AddedInner (XElement target)
- {
- SetContext (target);
- if (target.IsTrue ("serializable"))
- Indent ().WriteLine ("[Serializable]");
-
- var type = target.Attribute ("type").Value;
-
- if (type == "enum") {
- // check if [Flags] is present
- var cattrs = target.Element ("attributes");
- if (cattrs != null) {
- foreach (var ca in cattrs.Elements ("attribute")) {
- if (ca.GetAttribute ("name") == "System.FlagsAttribute") {
- Indent ().WriteLine ("[Flags]");
- break;
- }
- }
- }
- }
-
- Indent ().Write ("public");
-
- if (type != "enum") {
- bool seal = target.IsTrue ("sealed");
- bool abst = target.IsTrue ("abstract");
- if (seal && abst)
- Output.Write (" static");
- else if (seal && type != "struct")
- Output.Write (" sealed");
- else if (abst && type != "interface")
- Output.Write (" abstract");
- }
-
- Output.Write (' ');
- Output.Write (type);
- Output.Write (' ');
- Output.Write (target.GetAttribute ("name"));
-
- var baseclass = target.GetAttribute ("base");
- if ((type != "enum") && (type != "struct")) {
- if (baseclass != null) {
- if (baseclass == "System.Object") {
- // while true we do not need to be reminded every time...
- baseclass = null;
- } else {
- Output.Write (" : ");
- Output.Write (baseclass);
- }
- }
- }
-
- // interfaces on enums are "standard" not user provided - so we do not want to show them
- if (type != "enum") {
- var i = target.Element ("interfaces");
- if (i != null) {
- var interfaces = new List<string> ();
- foreach (var iface in i.Elements ("interface"))
- interfaces.Add (icomparer.GetDescription (iface));
- Output.Write ((baseclass == null) ? " : " : ", ");
- Output.Write (String.Join (", ", interfaces));
- }
- }
-
- Output.WriteLine (" {");
-
- var t = target.Element ("constructors");
- if (t != null) {
- Indent ().WriteLine ("\t// constructors");
- foreach (var ctor in t.Elements ("constructor"))
- ccomparer.Added (ctor, true);
- }
-
- t = target.Element ("fields");
- if (t != null) {
- if (type != "enum")
- Indent ().WriteLine ("\t// fields");
- else
- SetContext (target);
- foreach (var field in t.Elements ("field"))
- fcomparer.Added (field, true);
- }
-
- t = target.Element ("properties");
- if (t != null) {
- Indent ().WriteLine ("\t// properties");
- foreach (var property in t.Elements ("property"))
- pcomparer.Added (property, true);
- }
-
- t = target.Element ("events");
- if (t != null) {
- Indent ().WriteLine ("\t// events");
- foreach (var evnt in t.Elements ("event"))
- ecomparer.Added (evnt, true);
- }
-
- t = target.Element ("methods");
- if (t != null) {
- Indent ().WriteLine ("\t// methods");
- foreach (var method in t.Elements ("method"))
- mcomparer.Added (method, true);
- }
-
- t = target.Element ("classes");
- if (t != null) {
- Output.WriteLine ();
- Indent ().WriteLine ("\t// inner types");
- kcomparer = new NestedClassComparer ();
- State.Indent++;
- foreach (var inner in t.Elements ("class"))
- kcomparer.AddedInner (inner);
- State.Indent--;
- }
- Indent ().WriteLine ("}");
- }
-
- public override void Modified (XElement source, XElement target, ApiChanges diff)
- {
- // hack - there could be changes that we're not monitoring (e.g. attributes properties)
- var output = Output;
- State.Output = new StringWriter ();
-
- var sb = source.GetAttribute ("base");
- var tb = target.GetAttribute ("base");
- if (sb != tb) {
- Output.Write ("Modified base type: ");
- Output.WriteLine (new ApiChange ().AppendModified (sb, tb, true).Member.ToString ());
- }
-
- ccomparer.Compare (source, target);
- icomparer.Compare (source, target);
- fcomparer.Compare (source, target);
- pcomparer.Compare (source, target);
- ecomparer.Compare (source, target);
- mcomparer.Compare (source, target);
-
- var si = source.Element ("classes");
- if (si != null) {
- var ti = target.Element ("classes");
- kcomparer = new NestedClassComparer ();
- kcomparer.Compare (si.Elements ("class"), ti == null ? null : ti.Elements ("class"));
- }
-
- var s = (Output as StringWriter).ToString ();
- State.Output = output;
- if (s.Length > 0) {
- var tn = GetTypeName (target);
- Output.WriteLine ("<!-- start type {0} --> <div>", tn);
- Output.WriteLine ("<h3>Type Changed: {0}.{1}</h3>", State.Namespace, GetTypeName (target));
- Output.WriteLine (s);
- Output.WriteLine ("</div> <!-- end type {0} -->", tn);
- }
- }
-
- public override void Removed (XElement source)
- {
- Output.Write ("<h3>Removed Type <span class='breaking' data-is-breaking>{0}.{1}</span></h3>", State.Namespace, GetTypeName (source));
- }
-
- public virtual string GetTypeName (XElement type)
- {
- return type.GetAttribute ("name");
- }
- }
-
- public class NestedClassComparer : ClassComparer {
-
- public override void SetContext (XElement current)
- {
- }
-
- public override string GetTypeName (XElement type)
- {
- return State.Type + "." + base.GetTypeName (type);
- }
- }
-}
\ No newline at end of file
+++ /dev/null
-//
-// Authors
-// Sebastien Pouliot <sebastien@xamarin.com>
-//
-// Copyright 2013 Xamarin Inc. http://www.xamarin.com
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-using System.Collections.Generic;
-using System.IO;
-using System.Linq;
-using System.Xml.Linq;
-
-namespace Xamarin.ApiDiff {
-
- public abstract class Comparer {
-
- protected List<XElement> removed = new List<XElement> ();
- protected ApiChanges modified = new ApiChanges ();
-
- public TextWriter Output {
- get { return State.Output; }
- }
-
- protected TextWriter Indent ()
- {
- for (int i = 0; i < State.Indent; i++)
- State.Output.Write ("\t");
- return State.Output;
- }
-
- public abstract void Added (XElement target, bool wasParentAdded);
- public abstract void Modified (XElement source, XElement target, ApiChanges changes);
- public abstract void Removed (XElement source);
-
- public virtual bool Equals (XElement source, XElement target, ApiChanges changes)
- {
- return XNode.DeepEquals (source, target);
- }
-
- public abstract void SetContext (XElement current);
-
- public virtual void Compare (IEnumerable<XElement> source, IEnumerable<XElement> target)
- {
- removed.Clear ();
- modified.Clear ();
-
- foreach (var s in source) {
- SetContext (s);
- string sn = s.GetAttribute ("name");
- var t = target == null ? null : target.SingleOrDefault (x => x.GetAttribute ("name") == sn);
- if (t == null) {
- // not in target, it was removed
- removed.Add (s);
- } else {
- t.Remove ();
- // possibly modified
- if (Equals (s, t, modified))
- continue;
-
- // still in target so will be part of Added
- Modified (s, t, modified);
- }
- }
- // delayed, that way we show "Modified", "Added" and then "Removed"
- foreach (var item in removed) {
- SetContext (item);
- Removed (item);
- }
- // remaining == newly added in target
- if (target != null) {
- foreach (var item in target) {
- SetContext (item);
- Added (item, false);
- }
- }
- }
- }
-}
\ No newline at end of file
+++ /dev/null
-//
-// Authors
-// Sebastien Pouliot <sebastien@xamarin.com>
-//
-// Copyright 2013 Xamarin Inc. http://www.xamarin.com
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-using System.Collections.Generic;
-using System.Reflection;
-using System.Text;
-using System.Xml.Linq;
-
-namespace Xamarin.ApiDiff {
-
- // MethodComparer inherits from this one
- public class ConstructorComparer : MemberComparer {
-
- public override string GroupName {
- get { return "constructors"; }
- }
-
- public override string ElementName {
- get { return "constructor"; }
- }
-
- public override bool Find (XElement e)
- {
- return (e.Attribute ("name").Value == Source.Attribute ("name").Value);
- }
-
- void RenderReturnType (XElement source, XElement target, ApiChange change)
- {
- var srcType = source.GetTypeName ("returntype");
- var tgtType = target.GetTypeName ("returntype");
-
- if (srcType != tgtType) {
- change.AppendModified (srcType, tgtType, true);
- change.Append (" ");
- } else if (srcType != null) {
- // ctor don't have a return type
- change.Append (srcType);
- change.Append (" ");
- }
- }
-
- public override bool Equals (XElement source, XElement target, ApiChanges changes)
- {
- if (base.Equals (source, target, changes))
- return true;
-
- var change = new ApiChange ();
- change.Header = "Modified " + GroupName;
- RenderMethodAttributes (source, target, change);
- RenderReturnType (source, target, change);
- RenderName (source, target, change);
- RenderGenericParameters (source, target, change);
- RenderParameters (source, target, change);
-
- changes.Add (source, target, change);
-
- return false;
- }
-
- public override string GetDescription (XElement e)
- {
- var sb = new StringBuilder ();
-
- var attribs = e.Attribute ("attrib");
- if (attribs != null) {
- var attr = (MethodAttributes) Int32.Parse (attribs.Value);
- if ((attr & MethodAttributes.Public) != MethodAttributes.Public) {
- sb.Append ("protected ");
- } else {
- sb.Append ("public ");
- }
-
- if ((attr & MethodAttributes.Static) != 0) {
- sb.Append ("static ");
- } else if ((attr & MethodAttributes.Virtual) != 0) {
- if ((attr & MethodAttributes.VtableLayoutMask) == 0)
- sb.Append ("override ");
- else
- sb.Append ("virtual ");
- }
- }
-
- string name = e.GetAttribute ("name");
-
- var r = e.GetTypeName ("returntype");
- if (r != null) {
- // ctor dont' have a return type
- sb.Append (r).Append (' ');
- } else {
- // show the constructor as it would be defined in C#
- name = name.Replace (".ctor", State.Type);
- }
-
- // the XML file `name` does not contain parameter names, so we must process them ourselves
- // which gives us the opportunity to simplify type names
- sb.Append (name.Substring (0, name.IndexOf ('(')));
-
- var genericp = e.Element ("generic-parameters");
- if (genericp != null) {
- var list = new List<string> ();
- foreach (var p in genericp.Elements ("generic-parameter")) {
- list.Add (p.GetTypeName ("name"));
- }
- sb.Append ("<").Append (String.Join (", ", list)).Append (">");
- }
-
- sb.Append (" (");
- var parameters = e.Element ("parameters");
- if (parameters != null) {
- var list = new List<string> ();
- foreach (var p in parameters.Elements ("parameter")) {
- var pTypeName = p.GetTypeName ("type");
- list.Add (State.IgnoreParameterNameChanges
- ? pTypeName
- : pTypeName + " " + p.GetAttribute ("name"));
- }
- sb.Append (String.Join (", ", list));
- }
- sb.Append (");");
-
- return sb.ToString ();
- }
- }
-}
\ No newline at end of file
+++ /dev/null
-//
-// Authors
-// Sebastien Pouliot <sebastien@xamarin.com>
-//
-// Copyright 2013 Xamarin Inc. http://www.xamarin.com
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-using System.Text;
-using System.Xml.Linq;
-
-namespace Xamarin.ApiDiff {
-
- public class EventComparer : MemberComparer {
-
- public override string GroupName {
- get { return "events"; }
- }
-
- public override string ElementName {
- get { return "event"; }
- }
-
- public override bool Equals (XElement source, XElement target, ApiChanges changes)
- {
- if (base.Equals (source, target, changes))
- return true;
-
- var change = new ApiChange ();
- change.Header = "Modified " + GroupName;
- change.Append ("public event ");
-
- var srcEventType = source.GetTypeName ("eventtype");
- var tgtEventType = target.GetTypeName ("eventtype");
-
- if (srcEventType != tgtEventType) {
- change.AppendModified (srcEventType, tgtEventType, true);
- } else {
- change.Append (srcEventType);
- }
- change.Append (" ");
- change.Append (source.GetAttribute ("name")).Append (";");
- return false;
- }
-
- public override string GetDescription (XElement e)
- {
- StringBuilder sb = new StringBuilder ();
- // TODO: attribs
- sb.Append ("public event ");
- sb.Append (e.GetTypeName ("eventtype")).Append (' ');
- sb.Append (e.GetAttribute ("name")).Append (';');
- return sb.ToString ();
- }
- }
-}
\ No newline at end of file
+++ /dev/null
-//
-// Authors
-// Sebastien Pouliot <sebastien@xamarin.com>
-//
-// Copyright 2013-2014 Xamarin Inc. http://www.xamarin.com
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Reflection;
-using System.Text;
-using System.Xml.Linq;
-
-namespace Xamarin.ApiDiff {
-
- public class FieldComparer : MemberComparer {
-
- public override string GroupName {
- get { return "fields"; }
- }
-
- public override string ElementName {
- get { return "field"; }
- }
-
- void RenderFieldAttributes (FieldAttributes source, FieldAttributes target, ApiChange change)
- {
- var srcNotSerialized = (source & FieldAttributes.NotSerialized) == FieldAttributes.NotSerialized;
- var tgtNotSerialized = (target & FieldAttributes.NotSerialized) == FieldAttributes.NotSerialized;
- if (srcNotSerialized != tgtNotSerialized) {
- // this is not a breaking change, so only render it if it changed.
- if (srcNotSerialized) {
- change.AppendRemoved ("[NonSerialized]\n");
- } else {
- change.AppendAdded ("[NonSerialized]\n");
- }
- }
-
- // the visibility values are the same for MethodAttributes and FieldAttributes, so just use the same method.
- RenderVisibility ((MethodAttributes) source, (MethodAttributes) target, change);
- // same for the static flag
- RenderStatic ((MethodAttributes) source, (MethodAttributes) target, change);
-
- var srcLiteral = (source & FieldAttributes.Literal) != 0;
- var tgtLiteral = (target & FieldAttributes.Literal) != 0;
-
- if (srcLiteral) {
- if (tgtLiteral) {
- change.Append ("const ");
- } else {
- change.AppendRemoved ("const", true).Append (" ");
- }
- } else if (tgtLiteral) {
- change.AppendAdded ("const", true).Append (" ");
- }
-
- var srcInitOnly = (source & FieldAttributes.InitOnly) != 0;
- var tgtInitOnly = (target & FieldAttributes.InitOnly) != 0;
- if (srcInitOnly) {
- if (tgtInitOnly) {
- change.Append ("readonly ");
- } else {
- change.AppendRemoved ("readonly", false).Append (" ");
- }
- } else if (tgtInitOnly) {
- change.AppendAdded ("readonly", true).Append (" ");
- }
- }
-
- public override bool Equals (XElement source, XElement target, ApiChanges changes)
- {
- if (base.Equals (source, target, changes))
- return true;
-
- var name = source.GetAttribute ("name");
- var srcValue = source.GetAttribute ("value");
- var tgtValue = target.GetAttribute ("value");
- var change = new ApiChange ();
- change.Header = "Modified " + GroupName;
-
- if (State.BaseType == "System.Enum") {
- change.Append (name).Append (" = ");
- if (srcValue != tgtValue) {
- change.AppendModified (srcValue, tgtValue, true);
- } else {
- change.Append (srcValue);
- }
- } else {
- RenderFieldAttributes (source.GetFieldAttributes (), target.GetFieldAttributes (), change);
-
- var srcType = source.GetTypeName ("fieldtype");
- var tgtType = target.GetTypeName ("fieldtype");
-
- if (srcType != tgtType) {
- change.AppendModified (srcType, tgtType, true);
- } else {
- change.Append (srcType);
- }
- change.Append (" ");
- change.Append (name);
-
- if (srcType == "string" && srcValue != null)
- srcValue = "\"" + srcValue + "\"";
-
- if (tgtType == "string" && tgtValue != null)
- tgtValue = "\"" + tgtValue + "\"";
-
- if (srcValue != tgtValue) {
- change.Append (" = ");
- if (srcValue == null)
- srcValue = "null";
- if (tgtValue == null)
- tgtValue = "null";
- change.AppendModified (srcValue, tgtValue, true);
- } else if (srcValue != null) {
- change.Append (" = ");
- change.Append (srcValue);
- }
- change.Append (";");
- }
-
- changes.Add (source, target, change);
-
- return false;
- }
-
- public override string GetDescription (XElement e)
- {
- var sb = new StringBuilder ();
-
- string name = e.GetAttribute ("name");
- string value = e.GetAttribute ("value");
-
- if (State.BaseType == "System.Enum") {
- sb.Append (name).Append (" = ").Append (value).Append (',');
- } else {
- var attribs = e.Attribute ("attrib");
- if (attribs != null) {
- var attr = (FieldAttributes)Int32.Parse (attribs.Value);
- if ((attr & FieldAttributes.Public) != FieldAttributes.Public) {
- sb.Append ("protected ");
- } else {
- sb.Append ("public ");
- }
-
- if ((attr & FieldAttributes.Static) != 0)
- sb.Append ("static ");
-
- if ((attr & FieldAttributes.Literal) != 0)
- sb.Append ("const ");
- }
-
- string ftype = e.GetTypeName ("fieldtype");
- sb.Append (ftype).Append (' ');
- sb.Append (name);
- if (ftype == "string" && e.Attribute ("value") != null) {
- if (value == null)
- sb.Append (" = null");
- else
- sb.Append (" = \"").Append (value).Append ('"');
- }
- sb.Append (';');
- }
-
- return sb.ToString ();
- }
-
- public override void BeforeAdding (IEnumerable<XElement> list)
- {
- first = true;
- if (State.BaseType == "System.Enum") {
- Output.WriteLine ("<div>");
- Output.WriteLine ("<p>Added value{0}:</p>", list.Count () > 1 ? "s" : String.Empty);
- Output.WriteLine ("<pre class='added' data-is-non-breaking>");
- } else {
- base.BeforeAdding (list);
- }
- }
-
- public override void BeforeRemoving (IEnumerable<XElement> list)
- {
- first = true;
- if (State.BaseType == "System.Enum") {
- Output.WriteLine ("<p>Removed value{0}:</p>", list.Count () > 1 ? "s" : String.Empty);
- Output.WriteLine ("<pre class='removed' data-is-breaking>");
- } else {
- base.BeforeRemoving (list);
- }
- }
- }
-}
\ No newline at end of file
+++ /dev/null
-//
-// Authors
-// Sebastien Pouliot <sebastien@xamarin.com>
-//
-// Copyright 2013-2014 Xamarin Inc. http://www.xamarin.com
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Reflection;
-using System.Text;
-using System.Xml.Linq;
-
-namespace Xamarin.ApiDiff {
-
- public static class Helper {
- public static bool IsTrue (this XElement self, string name)
- {
- return (self.GetAttribute (name) == "true");
- }
-
- public static string GetAttribute (this XElement self, string name)
- {
- var n = self.Attribute (name);
- if (n == null)
- return null;
- return n.Value;
- }
-
- // null == no obsolete, String.Empty == no description
- public static string GetObsoleteMessage (this XElement self)
- {
- var cattrs = self.Element ("attributes");
- if (cattrs == null)
- return null;
-
- foreach (var ca in cattrs.Elements ("attribute")) {
- if (ca.GetAttribute ("name") != "System.ObsoleteAttribute")
- continue;
- var props = ca.Element ("properties");
- if (props == null)
- return String.Empty; // no description
- foreach (var p in props.Elements ("property")) {
- if (p.GetAttribute ("name") != "Message")
- continue;
- return p.GetAttribute ("value");
- }
- }
- return null;
- }
-
- public static IEnumerable<XElement> Descendants (this XElement self, params string[] names)
- {
- XElement el = self;
- if (el == null)
- return null;
-
- for (int i = 0; i < names.Length - 1; i++) {
- el = el.Element (names [i]);
- if (el == null)
- return null;
- }
- return el.Elements (names [names.Length - 1]);
- }
-
- public static List<XElement> DescendantList (this XElement self, params string[] names)
- {
- var descendants = self.Descendants (names);
- if (descendants == null)
- return null;
- return descendants.ToList ();
- }
-
- // make it beautiful (.NET -> C#)
- public static string GetTypeName (this XElement self, string name)
- {
- string type = self.GetAttribute (name);
- if (type == null)
- return null;
-
- StringBuilder sb = null;
- bool is_nullable = false;
- if (type.StartsWith ("System.Nullable`1[", StringComparison.Ordinal)) {
- is_nullable = true;
- sb = new StringBuilder (type, 18, type.Length - 19, 1024);
- } else {
- sb = new StringBuilder (type);
- }
-
- bool is_ref = (sb [sb.Length - 1] == '&');
- if (is_ref)
- sb.Remove (sb.Length - 1, 1);
-
- int array = 0;
- while ((sb [sb.Length - 1] == ']') && (sb [sb.Length - 2] == '[')) {
- sb.Remove (sb.Length - 2, 2);
- array++;
- }
-
- bool is_pointer = (sb [sb.Length - 1] == '*');
- if (is_pointer)
- sb.Remove (sb.Length - 1, 1);
-
- type = GetTypeName (sb.Replace ('+', '.').ToString ());
- sb.Length = 0;
- if (is_ref)
- sb.Append (self.GetAttribute ("direction")).Append (' ');
-
- sb.Append (type);
-
- while (array-- > 0)
- sb.Append ("[]");
- if (is_nullable)
- sb.Append ('?');
- if (is_pointer)
- sb.Append ('*');
- return sb.ToString ();
- }
-
- static string GetTypeName (string type)
- {
- int pos = type.IndexOf ('`');
- if (pos >= 0) {
- int end = type.LastIndexOf (']');
- string subtype = type.Substring (pos + 3, end - pos - 3);
- return type.Substring (0, pos) + "<" + GetTypeName (subtype) + ">";
- }
-
- switch (type) {
- case "System.String":
- return "string";
- case "System.Int32":
- return "int";
- case "System.UInt32":
- return "uint";
- case "System.Int64":
- return "long";
- case "System.UInt64":
- return "ulong";
- case "System.Void":
- return "void";
- case "System.Boolean":
- return "bool";
- case "System.Object":
- return "object";
- case "System.Single":
- return "float";
- case "System.Double":
- return "double";
- case "System.Byte":
- return "byte";
- case "System.SByte":
- return "sbyte";
- case "System.Int16":
- return "short";
- case "System.UInt16":
- return "ushort";
- case "System.Char":
- return "char";
- case "System.nint":
- return "nint";
- case "System.nuint":
- return "uint";
- case "System.nfloat":
- return "nfloat";
- case "System.IntPtr":
- return "IntPtr";
- default:
- if (type.StartsWith (State.Namespace, StringComparison.Ordinal))
- type = type.Substring (State.Namespace.Length + 1);
- return type;
- }
- }
-
- public static MethodAttributes GetMethodAttributes (this XElement element)
- {
- var srcAttribs = element.Attribute ("attrib");
- return (MethodAttributes) (srcAttribs != null ? Int32.Parse (srcAttribs.Value) : 0);
- }
-
- public static FieldAttributes GetFieldAttributes (this XElement element)
- {
- var srcAttribs = element.Attribute ("attrib");
- return (FieldAttributes) (srcAttribs != null ? Int32.Parse (srcAttribs.Value) : 0);
- }
- }
-}
\ No newline at end of file
+++ /dev/null
-//
-// Authors
-// Sebastien Pouliot <sebastien@xamarin.com>
-//
-// Copyright 2013 Xamarin Inc. http://www.xamarin.com
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-using System.Xml.Linq;
-
-namespace Xamarin.ApiDiff {
-
- public class InterfaceComparer : MemberComparer {
-
- public override string GroupName {
- get { return "interfaces"; }
- }
-
- public override string ElementName {
- get { return "interface"; }
- }
-
- public override string GetDescription (XElement e)
- {
- return e.GetTypeName ("name");
- }
- }
-}
\ No newline at end of file
+++ /dev/null
-//
-// Authors
-// Sebastien Pouliot <sebastien@xamarin.com>
-//
-// Copyright 2013-2014 Xamarin Inc. http://www.xamarin.com
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Reflection;
-using System.Text;
-using System.Xml.Linq;
-
-namespace Xamarin.ApiDiff {
-
- public abstract class MemberComparer : Comparer {
-
- // true if this is the first element being added or removed in the group being rendered
- protected bool first;
-
- public abstract string GroupName { get; }
- public abstract string ElementName { get; }
-
- protected virtual bool IsBreakingRemoval (XElement e)
- {
- return true;
- }
-
- public void Compare (XElement source, XElement target)
- {
- var s = source.Element (GroupName);
- var t = target.Element (GroupName);
- if (XNode.DeepEquals (s, t))
- return;
-
- if (s == null) {
- Add (t.Elements (ElementName));
- } else if (t == null) {
- Remove (s.Elements (ElementName));
- } else {
- Compare (s.Elements (ElementName), t.Elements (ElementName));
- }
- }
-
- public override void SetContext (XElement current)
- {
- }
-
- string GetContainingType (XElement el)
- {
- return el.Ancestors ("class").First ().Attribute ("type").Value;
- }
-
- bool IsInInterface (XElement el)
- {
- return GetContainingType (el) == "interface";
- }
-
- public XElement Source { get; set; }
-
- public virtual bool Find (XElement e)
- {
- return e.GetAttribute ("name") == Source.GetAttribute ("name");
- }
-
- XElement Find (IEnumerable<XElement> target)
- {
- return State.Lax ? target.FirstOrDefault (Find) : target.SingleOrDefault (Find);
- }
-
- public override void Compare (IEnumerable<XElement> source, IEnumerable<XElement> target)
- {
- removed.Clear ();
- modified.Clear ();
-
- foreach (var s in source) {
- SetContext (s);
- Source = s;
- var t = Find (target);
- if (t == null) {
- // not in target, it was removed
- removed.Add (s);
- } else {
- t.Remove ();
- // possibly modified
- if (Equals (s, t, modified))
- continue;
-
- Modified (s, t, modified);
- }
- }
- // delayed, that way we show "Modified", "Added" and then "Removed"
- Remove (removed);
-
- Modify (modified);
-
- // remaining == newly added in target
- Add (target);
- }
-
- void Add (IEnumerable<XElement> elements)
- {
- bool a = false;
- foreach (var item in elements) {
- SetContext (item);
- if (State.IgnoreAdded.Any (re => re.IsMatch (GetDescription (item))))
- continue;
- if (!a) {
- BeforeAdding (elements);
- a = true;
- }
- Added (item, false);
- }
- if (a)
- AfterAdding ();
- }
-
- void Modify (ApiChanges modified)
- {
- foreach (var changes in modified) {
- Output.WriteLine ("<p>{0}:</p>", changes.Key);
- Output.WriteLine ("<pre>");
- foreach (var element in changes.Value) {
- Output.Write ("<div {0}>", element.Breaking ? "data-is-breaking" : "data-is-non-breaking");
- foreach (var line in element.Member.ToString ().Split ('\n'))
- Output.WriteLine ("\t{0}", line);
- Output.Write ("</div>");
-
- }
- Output.WriteLine ("</pre>");
- }
- }
-
- void Remove (IEnumerable<XElement> elements)
- {
- bool r = false;
- foreach (var item in elements) {
- if (State.IgnoreRemoved.Any (re => re.IsMatch (GetDescription (item))))
- continue;
- SetContext (item);
- if (!r) {
- BeforeRemoving (elements);
- r = true;
- }
- Removed (item);
- }
- if (r)
- AfterRemoving ();
- }
-
- public abstract string GetDescription (XElement e);
-
- protected StringBuilder GetObsoleteMessage (XElement e)
- {
- var sb = new StringBuilder ();
- string o = e.GetObsoleteMessage ();
- if (o != null) {
- sb.Append ("[Obsolete");
- if (o.Length > 0)
- sb.Append (" (\"").Append (o).Append ("\")");
- sb.AppendLine ("]");
- for (int i = 0; i < State.Indent + 1; i++)
- sb.Append ('\t');
- }
- return sb;
- }
-
- public override bool Equals (XElement source, XElement target, ApiChanges changes)
- {
- RenderAttributes (source, target, changes);
-
- // We don't want to compare attributes.
- RemoveAttributes (source);
- RemoveAttributes (target);
-
- return base.Equals (source, target, changes);
- }
-
- public virtual void BeforeAdding (IEnumerable<XElement> list)
- {
- first = true;
- Output.WriteLine ("<div>");
- Output.WriteLine ("<p>Added {0}:</p>", list.Count () > 1 ? GroupName : ElementName);
- Output.WriteLine ("<pre>");
- }
-
- public override void Added (XElement target, bool wasParentAdded)
- {
- var o = GetObsoleteMessage (target);
- if (!first && (o.Length > 0))
- Output.WriteLine ();
- Indent ();
- bool isInterfaceBreakingChange = !wasParentAdded && IsInInterface (target);
- Output.Write ("\t<span class='added added-{0} {1}' {2}>", ElementName, isInterfaceBreakingChange ? "breaking" : string.Empty, isInterfaceBreakingChange ? "data-is-breaking" : "data-is-non-breaking");
- Output.Write ("{0}{1}", o, GetDescription (target));
- Output.WriteLine ("</span>");
- first = false;
- }
-
- public virtual void AfterAdding ()
- {
- Output.WriteLine ("</pre>");
- Output.WriteLine ("</div>");
- }
-
- public override void Modified (XElement source, XElement target, ApiChanges change)
- {
- }
-
- public virtual void BeforeRemoving (IEnumerable<XElement> list)
- {
- first = true;
- Output.WriteLine ("<p>Removed {0}:</p>\n", list.Count () > 1 ? GroupName : ElementName);
- Output.WriteLine ("<pre>");
- }
-
- public override void Removed (XElement source)
- {
- var o = GetObsoleteMessage (source);
- if (!first && (o.Length > 0))
- Output.WriteLine ();
-
- bool is_breaking = IsBreakingRemoval (source);
-
- Indent ();
- Output.Write ("\t<span class='removed removed-{0} {2}' {1}>", ElementName, is_breaking ? "data-is-breaking" : "data-is-non-breaking", is_breaking ? "breaking" : string.Empty);
- Output.Write ("{0}{1}", o, GetDescription (source));
- Output.WriteLine ("</span>");
- first = false;
- }
-
- public virtual void AfterRemoving ()
- {
- Output.WriteLine ("</pre>");;
- }
-
- string RenderGenericParameter (XElement gp)
- {
- var sb = new StringBuilder ();
- sb.Append (gp.GetTypeName ("name"));
-
- var constraints = gp.DescendantList ("generic-parameter-constraints", "generic-parameter-constraint");
- if (constraints != null && constraints.Count > 0) {
- sb.Append (" : ");
- for (int i = 0; i < constraints.Count; i++) {
- if (i > 0)
- sb.Append (", ");
- sb.Append (constraints [i].GetTypeName ("name"));
- }
- }
- return sb.ToString ();
- }
-
- protected void RenderGenericParameters (XElement source, XElement target, ApiChange change)
- {
- var src = source.DescendantList ("generic-parameters", "generic-parameter");
- var tgt = target.DescendantList ("generic-parameters", "generic-parameter");
- var srcCount = src == null ? 0 : src.Count;
- var tgtCount = tgt == null ? 0 : tgt.Count;
-
- if (srcCount == 0 && tgtCount == 0)
- return;
-
- change.Append ("<");
- for (int i = 0; i < Math.Max (srcCount, tgtCount); i++) {
- if (i > 0)
- change.Append (", ");
- if (i >= srcCount) {
- change.AppendAdded (RenderGenericParameter (tgt [i]), true);
- } else if (i >= tgtCount) {
- change.AppendRemoved (RenderGenericParameter (src [i]), true);
- } else {
- var srcName = RenderGenericParameter (src [i]);
- var tgtName = RenderGenericParameter (tgt [i]);
-
- if (srcName != tgtName) {
- change.AppendModified (srcName, tgtName, true);
- } else {
- change.Append (srcName);
- }
- }
- }
- change.Append (">");
- }
-
- protected string FormatValue (string type, string value)
- {
- if (value == null)
- return "null";
-
- if (type == "string")
- return "\"" + value + "\"";
- else if (type == "bool") {
- switch (value) {
- case "True":
- return "true";
- case "False":
- return "false";
- default:
- return value;
- }
- }
-
- return value;
- }
-
- protected void RenderParameters (XElement source, XElement target, ApiChange change)
- {
- var src = source.DescendantList ("parameters", "parameter");
- var tgt = target.DescendantList ("parameters", "parameter");
- var srcCount = src == null ? 0 : src.Count;
- var tgtCount = tgt == null ? 0 : tgt.Count;
-
- change.Append (" (");
- for (int i = 0; i < Math.Max (srcCount, tgtCount); i++) {
- if (i > 0)
- change.Append (", ");
-
- if (i >= srcCount) {
- change.AppendAdded (tgt [i].GetTypeName ("type") + " " + tgt [i].GetAttribute ("name"), true);
- } else if (i >= tgtCount) {
- change.AppendRemoved (src [i].GetTypeName ("type") + " " + src [i].GetAttribute ("name"), true);
- } else {
- var paramSourceType = src [i].GetTypeName ("type");
- var paramTargetType = tgt [i].GetTypeName ("type");
-
- var paramSourceName = src [i].GetAttribute ("name");
- var paramTargetName = tgt [i].GetAttribute ("name");
-
- if (paramSourceType != paramTargetType) {
- change.AppendModified (paramSourceType, paramTargetType, true);
- } else {
- change.Append (paramSourceType);
- }
- change.Append (" ");
- if (paramSourceName != paramTargetName) {
- change.AppendModified (paramSourceName, paramTargetName, false);
- } else {
- change.Append (paramSourceName);
- }
-
- var optSource = src [i].Attribute ("optional");
- var optTarget = tgt [i].Attribute ("optional");
- var srcValue = FormatValue (paramSourceType, src [i].GetAttribute ("defaultValue"));
- var tgtValue = FormatValue (paramTargetType, tgt [i].GetAttribute ("defaultValue"));
-
- if (optSource != null) {
- if (optTarget != null) {
- change.Append (" = ");
- if (srcValue != tgtValue) {
- change.AppendModified (srcValue, tgtValue, false);
- } else {
- change.Append (tgtValue);
- }
- } else {
- change.AppendRemoved (" = " + srcValue);
- }
- } else {
- if (optTarget != null)
- change.AppendAdded (" = " + tgtValue);
- }
- }
- }
-
- change.Append (")");
-
- // Ignore any parameter name changes if requested.
- if (State.IgnoreParameterNameChanges && !change.Breaking) {
- change.AnyChange = false;
- change.HasIgnoredChanges = true;
- }
- }
-
- void RenderVTable (MethodAttributes source, MethodAttributes target, ApiChange change)
- {
- var srcAbstract = (source & MethodAttributes.Abstract) == MethodAttributes.Abstract;
- var tgtAbstract = (target & MethodAttributes.Abstract) == MethodAttributes.Abstract;
- var srcFinal = (source & MethodAttributes.Final) == MethodAttributes.Final;
- var tgtFinal = (target & MethodAttributes.Final) == MethodAttributes.Final;
- var srcVirtual = (source & MethodAttributes.Virtual) == MethodAttributes.Virtual;
- var tgtVirtual = (target & MethodAttributes.Virtual) == MethodAttributes.Virtual;
- var srcOverride = (source & MethodAttributes.VtableLayoutMask) != MethodAttributes.NewSlot;
- var tgtOverride = (target & MethodAttributes.VtableLayoutMask) != MethodAttributes.NewSlot;
-
- var srcWord = srcVirtual ? (srcOverride ? "override" : "virtual") : string.Empty;
- var tgtWord = tgtVirtual ? (tgtOverride ? "override" : "virtual") : string.Empty;
- var breaking = srcWord.Length > 0 && tgtWord.Length == 0;
-
- if (srcAbstract) {
- if (tgtAbstract) {
- change.Append ("abstract ");
- } else if (tgtVirtual) {
- change.AppendModified ("abstract", tgtWord, false).Append (" ");
- } else {
- change.AppendRemoved ("abstract").Append (" ");
- }
- } else {
- if (tgtAbstract) {
- change.AppendAdded ("abstract", true).Append (" ");
- } else if (srcWord != tgtWord) {
- if (!tgtFinal)
- change.AppendModified (srcWord, tgtWord, breaking).Append (" ");
- } else if (tgtWord.Length > 0) {
- change.Append (tgtWord).Append (" ");
- } else if (srcWord.Length > 0) {
- change.AppendRemoved (srcWord, breaking).Append (" ");
- }
- }
-
- if (srcFinal) {
- if (tgtFinal) {
- change.Append ("final ");
- } else {
- change.AppendRemoved ("final", false).Append (" "); // removing 'final' is not a breaking change.
- }
- } else {
- if (tgtFinal && srcVirtual) {
- change.AppendModified ("virtual", "final", true).Append (" "); // adding 'final' is a breaking change if the member was virtual
- }
- }
-
- if (!srcVirtual && !srcFinal && tgtVirtual && tgtFinal) {
- // existing member implements a member from a new interface
- // this would show up as 'virtual final', which is redundant, so show nothing at all.
- change.HasIgnoredChanges = true;
- }
-
- // Ignore non-breaking virtual changes.
- if (State.IgnoreVirtualChanges && !change.Breaking) {
- change.AnyChange = false;
- change.HasIgnoredChanges = true;
- }
-
- var tgtSecurity = (source & MethodAttributes.HasSecurity) == MethodAttributes.HasSecurity;
- var srcSecurity = (target & MethodAttributes.HasSecurity) == MethodAttributes.HasSecurity;
-
- if (tgtSecurity != srcSecurity)
- change.HasIgnoredChanges = true;
-
- var srcPInvoke = (source & MethodAttributes.PinvokeImpl) == MethodAttributes.PinvokeImpl;
- var tgtPInvoke = (target & MethodAttributes.PinvokeImpl) == MethodAttributes.PinvokeImpl;
- if (srcPInvoke != tgtPInvoke)
- change.HasIgnoredChanges = true;
- }
-
- protected string GetVisibility (MethodAttributes attr)
- {
- switch (attr) {
- case MethodAttributes.Private:
- case MethodAttributes.PrivateScope:
- return "private";
- case MethodAttributes.Assembly:
- return "internal";
- case MethodAttributes.FamANDAssem:
- return "private internal";
- case MethodAttributes.FamORAssem:
- return "protected"; // customers don't care about 'internal';
- case MethodAttributes.Family:
- return "protected";
- case MethodAttributes.Public:
- return "public";
- default:
- throw new NotImplementedException ();
- }
- }
-
- protected void RenderVisibility (MethodAttributes source, MethodAttributes target, ApiChange diff)
- {
- source = source & MethodAttributes.MemberAccessMask;
- target = target & MethodAttributes.MemberAccessMask;
-
- if (source == target) {
- diff.Append (GetVisibility (target));
- } else {
- var breaking = false;
- switch (source) {
- case MethodAttributes.Private:
- case MethodAttributes.Assembly:
- case MethodAttributes.FamANDAssem:
- break; // these are not publicly visible, thus not breaking
- case MethodAttributes.FamORAssem:
- case MethodAttributes.Family:
- switch (target) {
- case MethodAttributes.Public:
- // to public is not a breaking change
- break;
- case MethodAttributes.Family:
- case MethodAttributes.FamORAssem:
- // not a breaking change, but should still show up in diff
- break;
- default:
- // anything else is a breaking change
- breaking = true;
- break;
- }
- break;
- case MethodAttributes.Public:
- default:
- // any change from public is breaking.
- breaking = true;
- break;
- }
-
- diff.AppendModified (GetVisibility (source), GetVisibility (target), breaking);
- }
- diff.Append (" ");
- }
-
- protected void RenderStatic (MethodAttributes src, MethodAttributes tgt, ApiChange diff)
- {
- var srcStatic = (src & MethodAttributes.Static) == MethodAttributes.Static;
- var tgtStatic = (tgt & MethodAttributes.Static) == MethodAttributes.Static;
-
- if (srcStatic != tgtStatic) {
- if (srcStatic) {
- diff.AppendRemoved ("static", true).Append (" ");
- } else {
- diff.AppendAdded ("static", true).Append (" ");
- }
- }
- }
-
- protected void RenderMethodAttributes (MethodAttributes src, MethodAttributes tgt, ApiChange diff)
- {
- RenderStatic (src, tgt, diff);
- RenderVisibility (src & MethodAttributes.MemberAccessMask, tgt & MethodAttributes.MemberAccessMask, diff);
- RenderVTable (src, tgt, diff);
- }
-
- protected void RenderMethodAttributes (XElement source, XElement target, ApiChange diff)
- {
- RenderMethodAttributes (source.GetMethodAttributes (), target.GetMethodAttributes (), diff);
- }
-
- protected void RemoveAttributes (XElement element)
- {
- var srcAttributes = element.Element ("attributes");
- if (srcAttributes != null)
- srcAttributes.Remove ();
-
- foreach (var el in element.Elements ())
- RemoveAttributes (el);
- }
-
- protected void RenderAttributes (XElement source, XElement target, ApiChanges changes)
- {
- var srcObsolete = source.GetObsoleteMessage ();
- var tgtObsolete = target.GetObsoleteMessage ();
-
- if (srcObsolete == tgtObsolete)
- return; // nothing changed
-
- if (srcObsolete == null) {
- if (tgtObsolete == null)
- return; // neither is obsolete
- var change = new ApiChange ();
- change.Header = "Obsoleted " + GroupName;
- change.Append (string.Format ("<span class='obsolete obsolete-{0}' data-is-non-breaking>", ElementName));
- change.Append ("[Obsolete (");
- if (tgtObsolete != string.Empty)
- change.Append ("\"").Append (tgtObsolete).Append ("\"");
- change.Append (")]\n");
- change.Append (GetDescription (target));
- change.Append ("</span>");
- change.AnyChange = true;
- changes.Add (source, target, change);
- } else if (tgtObsolete == null) {
- // Made non-obsolete. Do we care to report this?
- } else {
- // Obsolete message changed. Do we care to report this?
- }
- }
-
- protected void RenderName (XElement source, XElement target, ApiChange change)
- {
- var name = target.GetAttribute ("name");
- // show the constructor as it would be defined in C#
- name = name.Replace (".ctor", State.Type);
-
- var p = name.IndexOf ('(');
- if (p >= 0)
- name = name.Substring (0, p);
-
- change.Append (name);
- }
-
- }
-}
+++ /dev/null
-//
-// Authors
-// Sebastien Pouliot <sebastien@xamarin.com>
-//
-// Copyright 2013 Xamarin Inc. http://www.xamarin.com
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-using System.Linq;
-using System.Reflection;
-using System.Xml.Linq;
-
-namespace Xamarin.ApiDiff {
-
- public class MethodComparer : ConstructorComparer {
-
- public override string GroupName {
- get { return "methods"; }
- }
-
- public override string ElementName {
- get { return "method"; }
- }
-
- // operators have identical names but vary by return types
- public override bool Find (XElement e)
- {
- if (e.GetAttribute ("name") != Source.GetAttribute ("name"))
- return false;
-
- if (e.GetAttribute ("returntype") != Source.GetAttribute ("returntype"))
- return false;
-
- var eGP = e.Element ("generic-parameters");
- var sGP = Source.Element ("generic-parameters");
-
- if (eGP == null && sGP == null)
- return true;
- else if (eGP == null ^ sGP == null)
- return false;
- else {
- var eGPs = eGP.Elements ("generic-parameter");
- var sGPs = sGP.Elements ("generic-parameter");
- return eGPs.Count () == sGPs.Count ();
- }
- }
-
- protected override bool IsBreakingRemoval (XElement e)
- {
- // Removing virtual methods that override another method is not a breaking change.
- var is_override = e.Attribute ("is-override");
- if (is_override != null)
- return is_override.Value != "true";
-
- return true; // all other removals are breaking changes
- }
- }
-}
\ No newline at end of file
+++ /dev/null
-//
-// Authors
-// Sebastien Pouliot <sebastien@xamarin.com>
-//
-// Copyright 2013 Xamarin Inc. http://www.xamarin.com
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-using System.Collections.Generic;
-using System.IO;
-using System.Linq;
-using System.Xml.Linq;
-
-namespace Xamarin.ApiDiff {
-
- public class NamespaceComparer : Comparer {
-
- ClassComparer comparer;
-
- public NamespaceComparer ()
- {
- comparer = new ClassComparer ();
- }
-
- public void Compare (XElement source, XElement target)
- {
- var s = source.Element ("namespaces");
- var t = target.Element ("namespaces");
- if (XNode.DeepEquals (s, t))
- return;
- Compare (s.Elements ("namespace"), t.Elements ("namespace"));
- }
-
- public override void SetContext (XElement current)
- {
- State.Namespace = current.Attribute ("name").Value;
- }
-
- public override void Added (XElement target, bool wasParentAdded)
- {
- string name = target.Attribute ("name").Value;
- if (State.IgnoreNew.Any (re => re.IsMatch (name)))
- return;
-
- Output.WriteLine ("<!-- start namespace {0} --> <div> ", name);
- Output.WriteLine ("<h2>New Namespace {0}</h2>", name);
- Output.WriteLine ();
- // list all new types
- foreach (var addedType in target.Element ("classes").Elements ("class"))
- comparer.Added (addedType, true);
- Output.WriteLine ("</div> <!-- end namespace {0} -->", name);
- Output.WriteLine ();
- }
-
- public override void Modified (XElement source, XElement target, ApiChanges differences)
- {
- var output = Output;
- State.Output = new StringWriter ();
- comparer.Compare (source, target);
-
- var s = Output.ToString ();
- State.Output = output;
- if (s.Length > 0) {
- var name = target.Attribute ("name").Value;
- Output.WriteLine ("<!-- start namespace {0} --> <div> ", name);
- Output.WriteLine ("<h2>Namespace {0}</h2>", name);
- Output.WriteLine (s);
- Output.WriteLine ("</div> <!-- end namespace {0} -->", name);
- }
- }
-
- public override void Removed (XElement source)
- {
- var name = source.Attribute ("name").Value;
- Output.WriteLine ("<!-- start namespace {0} --> <div>", name);
- Output.WriteLine ("<h2>Removed Namespace {0}</h2>", name);
- Output.WriteLine ();
- // list all removed types
- foreach (var removedType in source.Element ("classes").Elements ("class"))
- comparer.Removed (removedType);
- Output.WriteLine ("</div> <!-- end namespace {0} -->", name);
- Output.WriteLine ();
- }
- }
-}
\ No newline at end of file
+++ /dev/null
-//
-// Authors
-// Sebastien Pouliot <sebastien@xamarin.com>
-//
-// Copyright 2013 Xamarin Inc. http://www.xamarin.com
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-using System.Collections.Generic;
-using System.Reflection;
-using System.Text;
-using System.Xml.Linq;
-
-namespace Xamarin.ApiDiff {
-
- public class PropertyComparer : MemberComparer {
-
- public override string GroupName {
- get { return "properties"; }
- }
-
- public override string ElementName {
- get { return "property"; }
- }
-
- public override bool Find (XElement e)
- {
- if (!base.Find (e))
- return false;
- // the same Item (indexer) property can have different parameters
- return e.GetAttribute ("params") == Source.GetAttribute ("params");
- }
-
- void GetAccessors (XElement element, out XElement getter, out XElement setter)
- {
- var methods = element.Element ("methods");
-
- getter = null;
- setter = null;
-
- if (methods == null)
- return;
-
- foreach (var m in methods.Elements ("method")) {
- var n = m.GetAttribute ("name");
- if (n.StartsWith ("get_", StringComparison.Ordinal)) {
- getter = m;
- } else if (n.StartsWith ("set_", StringComparison.Ordinal)) {
- setter = m;
- }
- }
- }
-
- MethodAttributes GetMethodAttributes (XElement getter, XElement setter)
- {
- if (getter == null)
- return setter.GetMethodAttributes ();
- else if (setter == null)
- return getter.GetMethodAttributes ();
-
- var gAttr = getter.GetMethodAttributes ();
- var sAttr = setter.GetMethodAttributes ();
- var g = gAttr & MethodAttributes.MemberAccessMask;
- var s = sAttr & MethodAttributes.MemberAccessMask;
- // Visibility is ordered numerically (higher value = more visible).
- // We want the most visible.
- var visibility = (MethodAttributes) Math.Max ((int) g, (int) s);
- // Do a bitwise or with the rest of the flags
- var g_no_visibility = gAttr & ~MethodAttributes.MemberAccessMask;
- var s_no_visibility = sAttr & ~MethodAttributes.MemberAccessMask;
- return g_no_visibility | s_no_visibility | visibility;
- }
-
- void RenderPropertyType (XElement source, XElement target, ApiChange change)
- {
- var srcType = source.GetTypeName ("ptype");
- var tgtType = target.GetTypeName ("ptype");
-
- if (srcType == tgtType) {
- change.Append (tgtType);
- } else {
- change.AppendModified (srcType, tgtType, true);
- }
- change.Append (" ");
- }
-
- void RenderAccessors (XElement srcGetter, XElement tgtGetter, XElement srcSetter, XElement tgtSetter, ApiChange change)
- {
- // FIXME: this doesn't render changes in the accessor visibility (a protected setter can become public for instance).
- change.Append (" {");
- if (tgtGetter != null) {
- if (srcGetter != null) {
- change.Append (" ").Append ("get;");
- } else {
- change.Append (" ").AppendAdded ("get;");
- }
- } else if (srcGetter != null) {
- change.Append (" ").AppendRemoved ("get;");
- }
-
- if (tgtSetter != null) {
- if (srcSetter != null) {
- change.Append (" ").Append ("set;");
- } else {
- change.Append (" ").AppendAdded ("set;");
- }
- } else if (srcSetter != null) {
- change.Append (" ").AppendRemoved ("set;");
- }
-
- change.Append (" }");
-
- // Ignore added property setters if asked to
- if (srcSetter == null && tgtSetter != null && State.IgnoreAddedPropertySetters && !change.Breaking) {
- change.AnyChange = false;
- change.HasIgnoredChanges = true;
- }
- }
-
- void RenderIndexers (List<XElement> srcIndexers, List<XElement> tgtIndexers, ApiChange change)
- {
- change.Append ("this [");
- for (int i = 0; i < srcIndexers.Count; i++) {
- var source = srcIndexers [i];
- var target = tgtIndexers [i];
-
- if (i > 0)
- change.Append (", ");
-
- var srcType = source.GetTypeName ("type");
- var tgtType = target.GetTypeName ("type");
- if (srcType == tgtType) {
- change.Append (tgtType);
- } else {
- change.AppendModified (srcType, tgtType, true);
- }
- change.Append (" ");
-
- var srcName = source.GetAttribute ("name");
- var tgtName = target.GetAttribute ("name");
- if (srcName == tgtName) {
- change.Append (tgtName);
- } else {
- change.AppendModified (srcName, tgtName, true);
- }
- }
- change.Append ("]");
- }
-
- public override bool Equals (XElement source, XElement target, ApiChanges changes)
- {
- if (base.Equals (source, target, changes))
- return true;
-
- XElement srcGetter, srcSetter;
- XElement tgtGetter, tgtSetter;
- GetAccessors (source, out srcGetter, out srcSetter);
- GetAccessors (target, out tgtGetter, out tgtSetter);
-
- List<XElement> srcIndexers = null;
- List<XElement> tgtIndexers = null;
- bool isIndexer = false;
- if (srcGetter != null) {
- srcIndexers = srcGetter.DescendantList ("parameters", "parameter");
- tgtIndexers = tgtGetter.DescendantList ("parameters", "parameter");
- isIndexer = srcIndexers != null && srcIndexers.Count > 0;
- }
-
- var change = new ApiChange ();
- change.Header = "Modified " + GroupName;
- RenderMethodAttributes (GetMethodAttributes (srcGetter, srcSetter), GetMethodAttributes (tgtGetter, tgtSetter), change);
- RenderPropertyType (source, target, change);
- if (isIndexer) {
- RenderIndexers (srcIndexers, tgtIndexers, change);
- } else {
- RenderName (source, target, change);
- }
- RenderGenericParameters (source, target, change);
- RenderAccessors (srcGetter, tgtGetter, srcSetter, tgtSetter, change);
-
- changes.Add (source, target, change);
-
- return false;
- }
-
- void GetProperties (XElement e, out bool @virtual, out bool @override, out bool @static, out bool getter, out bool setter, out bool family)
- {
- @virtual = @override = @static = getter = setter = family = false;
-
- var methods = e.Element ("methods");
- if (methods != null) {
- foreach (var m in methods.Elements ("method")) {
- @virtual |= m.IsTrue ("virtual");
- @static |= m.IsTrue ("static");
- var n = m.GetAttribute ("name");
- getter |= n.StartsWith ("get_", StringComparison.Ordinal);
- setter |= n.StartsWith ("set_", StringComparison.Ordinal);
- var attribs = (MethodAttributes) Int32.Parse (m.GetAttribute ("attrib"));
- family = ((attribs & MethodAttributes.Public) != MethodAttributes.Public);
- @override |= (attribs & MethodAttributes.NewSlot) == 0;
- }
- }
- }
-
- public override string GetDescription (XElement e)
- {
- string name = e.Attribute ("name").Value;
- string ptype = e.GetTypeName ("ptype");
-
- bool virt = false;
- bool over = false;
- bool stat = false;
- bool getter = false;
- bool setter = false;
- bool family = false;
- GetProperties (e, out virt, out over, out stat, out getter, out setter, out family);
-
- var sb = new StringBuilder ();
-
- sb.Append (family ? "protected " : "public ");
- if (virt && !State.IgnoreVirtualChanges)
- sb.Append (over ? "override " : "virtual ");
- else if (stat)
- sb.Append ("static ");
- sb.Append (ptype).Append (' ').Append (name).Append (" { ");
- if (getter)
- sb.Append ("get; ");
- if (setter)
- sb.Append ("set; ");
- sb.Append ("}");
-
- return sb.ToString ();
- }
- }
-}
\ No newline at end of file
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>
-<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
- <PropertyGroup>
- <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
- <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
- <ProductVersion>8.0.30703</ProductVersion>
- <SchemaVersion>2.0</SchemaVersion>
- <ProjectGuid>{D25986E2-7A41-4966-A26D-5614BAC7B8A7}</ProjectGuid>
- <OutputType>Exe</OutputType>
- <RootNamespace>Xamarin.ApiDiff</RootNamespace>
- <AssemblyName>mono-api-html</AssemblyName>
- </PropertyGroup>
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
- <DebugSymbols>true</DebugSymbols>
- <DebugType>full</DebugType>
- <Optimize>false</Optimize>
- <OutputPath>bin\Debug</OutputPath>
- <DefineConstants>DEBUG;</DefineConstants>
- <ErrorReport>prompt</ErrorReport>
- <WarningLevel>4</WarningLevel>
- <ConsolePause>false</ConsolePause>
- </PropertyGroup>
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
- <DebugType>full</DebugType>
- <Optimize>true</Optimize>
- <OutputPath>bin\Release</OutputPath>
- <ErrorReport>prompt</ErrorReport>
- <WarningLevel>4</WarningLevel>
- <Externalconsole>true</Externalconsole>
- </PropertyGroup>
- <ItemGroup>
- <Reference Include="System" />
- <Reference Include="System.Xml.Linq" />
- <Reference Include="System.Xml" />
- <Reference Include="System.Core" />
- </ItemGroup>
- <ItemGroup>
- <Compile Include="Helpers.cs" />
- <Compile Include="InterfaceComparer.cs" />
- <Compile Include="NamespaceComparer.cs" />
- <Compile Include="MemberComparer.cs" />
- <Compile Include="FieldComparer.cs" />
- <Compile Include="PropertyComparer.cs" />
- <Compile Include="EventComparer.cs" />
- <Compile Include="MethodComparer.cs" />
- <Compile Include="ConstructorComparer.cs" />
- <Compile Include="Comparer.cs" />
- <Compile Include="AssemblyComparer.cs" />
- <Compile Include="ClassComparer.cs" />
- <Compile Include="ApiDiff.cs" />
- <Compile Include="..\..\..\class\Mono.Options\Mono.Options\Options.cs">
- <Link>Options.cs</Link>
- </Compile>
- <Compile Include="ApiChange.cs" />
- </ItemGroup>
- <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
-</Project>
--- /dev/null
+AssemblyResolver.cs
+Util.cs
+WellFormedXmlWriter.cs
+mono-api-info.cs
+../../class/Mono.Options/Mono.Options/Options.cs
// 3021: CLS attribute not needed since assembly is not CLS compliant
NOWARNS = -nowarn:3021
-LOCAL_MCS_FLAGS = -r:$(topdir)/class/lib/$(PROFILE)/Mono.CSharp.dll -r:$(topdir)/class/lib/$(PROFILE)/Mono.Posix.dll -r:Mono.Management.dll -r:System.dll -unsafe $(NOWARNS)
+LOCAL_MCS_FLAGS = -unsafe $(NOWARNS)
+LIB_REFS = Mono.CSharp Mono.Posix Mono.Management System
PROGRAM = csharp.exe
SUBDIRS =
include ../../build/rules.make
-LOCAL_MCS_FLAGS = -r:System.dll -r:System.Xml.dll
+LIB_REFS = System System.Xml
PROGRAM = culevel.exe
CLEAN_FILES = culevel.exe culevel.exe.mdb
SUBDIRS =
include ../../build/rules.make
-LOCAL_MCS_FLAGS = -r:System.Xml.dll -r:System.Web.Services.dll -r:System.dll
+LOCAL_MCS_FLAGS =
+LIB_REFS = System.Xml System.Web.Services System
PROGRAM = disco.exe
include ../../build/executable.make
SUBDIRS =
include ../../build/rules.make
-LOCAL_MCS_FLAGS = -r:System.Xml.dll -r:Commons.Xml.Relaxng.dll
+LOCAL_MCS_FLAGS =
+LIB_REFS = System.Xml Commons.Xml.Relaxng
PROGRAM = dtd2rng.exe
include ../../build/executable.make
SUBDIRS =
include ../../build/rules.make
-LOCAL_MCS_FLAGS = -r:System.Xml.dll
+LOCAL_MCS_FLAGS =
+LIB_REFS = System.Xml
PROGRAM = dtd2xsd.exe
include ../../build/executable.make
SUBDIRS =
include ../../build/rules.make
-LOCAL_MCS_FLAGS = -r:Mono.Security.dll -unsafe
+LIB_REFS = Mono.Security
+LOCAL_MCS_FLAGS = -unsafe
PROGRAM = gacutil.exe
SUBDIRS =
include ../../build/rules.make
-LOCAL_MCS_FLAGS = -r:System.Xml.dll
+LOCAL_MCS_FLAGS =
+LIB_REFS = System.Xml
PROGRAM = genxs.exe
include ../../build/executable.make
SUBDIRS =
include ../../build/rules.make
-LOCAL_MCS_FLAGS = -r:System.Xml.dll
+LOCAL_MCS_FLAGS =
+LIB_REFS = System.Xml
PROGRAM = ictool.exe
EXTRA_DISTFILES = ictool-config.xml
include ../../build/rules.make
PROGRAM = ikdasm.exe
-
+LIB_REFS = System System.Core System.Security
LOCAL_MCS_FLAGS = \
- -d:NO_SYMBOL_WRITER /r:System.Security.dll /r:System.Core.dll /r:System.dll
+ -d:NO_SYMBOL_WRITER
#EXTRA_DISTFILES = LICENSE
SUBDIRS =
include ../../build/rules.make
-LOCAL_MCS_FLAGS = -r:System.Configuration.Install.dll -r:System.dll
+LOCAL_MCS_FLAGS =
+LIB_REFS = System.Configuration.Install System
PROGRAM = installutil.exe
SUBDIRS =
include ../../build/rules.make
-LOCAL_MCS_FLAGS = -r:System.Xml.dll
+LOCAL_MCS_FLAGS =
+LIB_REFS = System.Xml
PROGRAM = installvst.exe
include ../../build/executable.make
SUBDIRS =
include ../../build/rules.make
-LOCAL_MCS_FLAGS = -r:System.dll -r:System.Core.dll
+LOCAL_MCS_FLAGS =
+LIB_REFS = System System.Core
PROGRAM = lc.exe
CLEAN_FILES = lc.exe lc.exe.mdb
PROGRAM = linkeranalyzer.exe
-LOCAL_MCS_FLAGS = /r:System.dll /r:System.Xml.dll
+LIB_REFS = System System.Xml
+LOCAL_MCS_FLAGS =
include ../../build/executable.make
SUBDIRS =
include ../../build/rules.make
-PROGRAM_SNK = ../../class/mono.snk
-
-CECIL = $(topdir)/class/lib/$(PROFILE)/Mono.Cecil.dll
-
RESOURCES = \
Descriptors/mscorlib.xml \
Descriptors/System.xml \
$(PROGRAM): $(RESOURCES)
-LOCAL_MCS_FLAGS = /r:$(CECIL) /r:System.Xml.dll /r:System.Core.dll /r:System.dll $(RESOURCES:%=-resource:%)
+LIB_REFS = System System.Core System.Xml Mono.Cecil
+LOCAL_MCS_FLAGS = $(RESOURCES:%=-resource:%)
EXTRA_DISTFILES = $(RESOURCES)
SUBDIRS =
include ../../build/rules.make
-LOCAL_MCS_FLAGS = -r:System.Xml.dll -r:System.dll
+LOCAL_MCS_FLAGS =
+LIB_REFS = System.Xml System
PROGRAM = mconfig.exe
BUILT_SOURCES=Mono.MonoConfig/consts.cs
PROGRAM = mdbdump.exe
-LOCAL_MCS_FLAGS = \
- /r:System.Xml.dll \
- /r:Mono.Cecil.dll \
- /r:Mono.CompilerServices.SymbolWriter.dll
+LIB_REFS = Mono.Cecil System.Xml Mono.CompilerServices.SymbolWriter
+LOCAL_MCS_FLAGS =
include ../../build/executable.make
PROGRAM = mdbrebase.exe
-LOCAL_MCS_FLAGS = /r:Mono.CompilerServices.SymbolWriter.dll /r:System.dll
-
+LIB_REFS = System Mono.CompilerServices.SymbolWriter
+LOCAL_MCS_FLAGS =
include ../../build/executable.make
/resource:Resources/msitomsx.xsl,msitomsx.xsl \
/resource:Resources/overview.xsl,overview.xsl \
/resource:Resources/stylesheet.xsl,stylesheet.xsl \
- /r:System.Web.dll \
- /r:System.Xml.Linq.dll \
- /r:ICSharpCode.SharpZipLib.dll \
- /r:Mono.Cecil.dll \
- /r:System.dll \
- /r:System.Xml.dll \
- /r:System.Core.dll
-
-LOCAL_MCS_FLAGS = $(MDOC_COMMON_FLAGS) \
- /r:monodoc.dll
+
+LIB_REFS = monodoc System System.Xml System.Core Mono.Cecil ICSharpCode.SharpZipLib System.Xml.Linq System.Web
+
+LOCAL_MCS_FLAGS = $(MDOC_COMMON_FLAGS)
PROGRAM = mdoc.exe
PROGRAM_DEPS = $(topdir)/class/lib/$(PROFILE)/monodoc.dll
-rm -f monodocer1.exe*
Test/DocTest-addNonGeneric.dll:
- $(CSCOMPILE) $(TEST_CSCFLAGS) -debug -unsafe -target:library -out:$@ Test/DocTest-addNonGeneric.cs
+ $(CSCOMPILE) $(TEST_CSCFLAGS) -unsafe -target:library -out:$@ Test/DocTest-addNonGeneric.cs
Test/DocTest-addNonGeneric-v2.dll:
- $(CSCOMPILE) $(TEST_CSCFLAGS) -debug -unsafe -target:library -out:$@ Test/DocTest-addNonGeneric.cs /define:V2
+ $(CSCOMPILE) $(TEST_CSCFLAGS) -unsafe -target:library -out:$@ Test/DocTest-addNonGeneric.cs /define:V2
Test/DocTest-DropNS-classic-secondary.dll:
@echo $(value @)
- $(CSCOMPILE) $(TEST_CSCFLAGS) -debug -unsafe -target:library -out:$@ Test/DocTest-DropNS-classic-secondary.cs
+ $(CSCOMPILE) $(TEST_CSCFLAGS) -unsafe -target:library -out:$@ Test/DocTest-DropNS-classic-secondary.cs
Test/DocTest-DropNS-classic.dll:
@echo $(value @)
- $(CSCOMPILE) $(TEST_CSCFLAGS) -debug -unsafe -target:library -out:$@ Test/DocTest-DropNS-classic.cs
+ $(CSCOMPILE) $(TEST_CSCFLAGS) -unsafe -target:library -out:$@ Test/DocTest-DropNS-classic.cs
Test/DocTest-DropNS-unified.dll:
- $(CSCOMPILE) $(TEST_CSCFLAGS) -debug -unsafe -target:library -out:$@ Test/DocTest-DropNS-unified.cs
+ $(CSCOMPILE) $(TEST_CSCFLAGS) -unsafe -target:library -out:$@ Test/DocTest-DropNS-unified.cs
Test/DocTest-DropNS-unified-multitest.dll:
rm -f $@
- $(CSCOMPILE) $(TEST_CSCFLAGS) -debug -unsafe -target:library -out:$@ Test/DocTest-DropNS-unified.cs /define:MULTITEST
+ $(CSCOMPILE) $(TEST_CSCFLAGS) -unsafe -target:library -out:$@ Test/DocTest-DropNS-unified.cs /define:MULTITEST
Test/DocTest-DropNS-classic-multitest.dll:
rm -f $@
- $(CSCOMPILE) $(TEST_CSCFLAGS) -debug -unsafe -target:library -out:$@ Test/DocTest-DropNS-classic.cs /define:MULTITEST
+ $(CSCOMPILE) $(TEST_CSCFLAGS) -unsafe -target:library -out:$@ Test/DocTest-DropNS-classic.cs /define:MULTITEST
Test/DocTest-DropNS-unified-deletetest.dll:
rm -f Test/DocTest-DropNS-unified-deletetest.dll
- $(CSCOMPILE) $(TEST_CSCFLAGS) -debug -unsafe -target:library -out:$@ Test/DocTest-DropNS-unified.cs /define:DELETETEST
+ $(CSCOMPILE) $(TEST_CSCFLAGS) -unsafe -target:library -out:$@ Test/DocTest-DropNS-unified.cs /define:DELETETEST
Test/DocTest-DropNS-unified-deletetest-V2.dll:
rm -f Test/DocTest-DropNS-unified-deletetest.dll
- $(CSCOMPILE) $(TEST_CSCFLAGS) -debug -unsafe -target:library -out:Test/DocTest-DropNS-unified-deletetest.dll Test/DocTest-DropNS-unified.cs /define:DELETETEST,V2
+ $(CSCOMPILE) $(TEST_CSCFLAGS) -unsafe -target:library -out:Test/DocTest-DropNS-unified-deletetest.dll Test/DocTest-DropNS-unified.cs /define:DELETETEST,V2
Test/DocTest-DropNS-classic-deletetest.dll:
rm -f Test/DocTest-DropNS-classic-deletetest.dll
- $(CSCOMPILE) $(TEST_CSCFLAGS) -debug -unsafe -target:library -out:$@ Test/DocTest-DropNS-classic.cs /define:DELETETEST
+ $(CSCOMPILE) $(TEST_CSCFLAGS) -unsafe -target:library -out:$@ Test/DocTest-DropNS-classic.cs /define:DELETETEST
Test/DocTest-DropNS-classic-deletetest-V2.dll:
rm -f Test/DocTest-DropNS-classic-deletetest.dll
- $(CSCOMPILE) $(TEST_CSCFLAGS) -debug -unsafe -target:library -out:Test/DocTest-DropNS-classic-deletetest.dll Test/DocTest-DropNS-classic.cs /define:DELETETEST,V2
+ $(CSCOMPILE) $(TEST_CSCFLAGS) -unsafe -target:library -out:Test/DocTest-DropNS-classic-deletetest.dll Test/DocTest-DropNS-classic.cs /define:DELETETEST,V2
Test/DocTest.dll:
- $(CSCOMPILE) $(TEST_CSCFLAGS) -debug -unsafe -target:library -out:$@ Test/DocTest.cs
+ $(CSCOMPILE) $(TEST_CSCFLAGS) -unsafe -target:library -out:$@ Test/DocTest.cs -r:$(topdir)/class/lib/$(PROFILE)/System.Core.dll -r:$(topdir)/class/lib/$(PROFILE)/Microsoft.CSharp.dll
Test/DocTest-InternalInterface.dll:
- $(CSCOMPILE) $(TEST_CSCFLAGS) -debug -unsafe -target:library -out:$@ Test/DocTest-InternalInterface.cs
+ $(CSCOMPILE) $(TEST_CSCFLAGS) -unsafe -target:library -out:$@ Test/DocTest-InternalInterface.cs
Test/DocTest.dll-v1:
-rm -f Test/DocTest.cs
$(MAKE) TEST_CSCFLAGS=$(TEST_CSCFLAGS) Test/DocTest.dll
Test/DocTest-enumerations.dll:
- $(CSCOMPILE) $(TEST_CSCFLAGS) -debug -unsafe -target:library -out:$@ Test/DocTest-enumerations.cs
+ $(CSCOMPILE) $(TEST_CSCFLAGS) -unsafe -target:library -out:$@ Test/DocTest-enumerations.cs
check-monodocer-addNonGeneric: $(PROGRAM)
-rm -Rf Test/en.actual
LOCAL_MCS_FLAGS= $(OTHER_RES:%=-resource:%)
-LOCAL_MCS_FLAGS += -d:STATIC,NO_SYMBOL_WRITER,NO_AUTHENTICODE -r:System.Xml.dll -r:System.dll
+LOCAL_MCS_FLAGS += -d:STATIC,NO_SYMBOL_WRITER,NO_AUTHENTICODE
+LIB_REFS = System.Xml System
EXTRA_DISTFILES = $(RESOURCE_FILES)
SUBDIRS =
include ../../build/rules.make
-LOCAL_MCS_FLAGS = /r:monodoc.dll
+LIB_REFS = monodoc
+LOCAL_MCS_FLAGS =
PROGRAM = mod.exe
--- /dev/null
+using System;
+using System.Collections.Generic;
+using System.Text;
+using System.Xml.Linq;
+
+namespace Xamarin.ApiDiff
+{
+ public class ApiChange
+ {
+ public string Header;
+ public StringBuilder Member = new StringBuilder ();
+ public bool Breaking;
+ public bool AnyChange;
+ public bool HasIgnoredChanges;
+
+ public ApiChange Append (string text)
+ {
+ Member.Append (text);
+ return this;
+ }
+
+ public ApiChange AppendAdded (string text, bool breaking = false)
+ {
+ Member.Append ("<span class='added ").Append (breaking ? "added-breaking-inline" : string.Empty).Append ("'>");
+ Member.Append (text);
+ Member.Append ("</span>");
+ Breaking |= breaking;
+ AnyChange = true;
+ return this;
+ }
+
+ public ApiChange AppendRemoved (string text, bool breaking = true)
+ {
+ Member.Append ("<span class='removed removed-inline ").Append (breaking ? "removed-breaking-inline" : string.Empty).Append ("'>");
+ Member.Append (text);
+ Member.Append ("</span>");
+ Breaking |= breaking;
+ AnyChange = true;
+ return this;
+ }
+
+ public ApiChange AppendModified (string old, string @new, bool breaking = true)
+ {
+ if (old.Length > 0)
+ AppendRemoved (old, breaking);
+ if (old.Length > 0 && @new.Length > 0)
+ Append (" ");
+ if (@new.Length > 0)
+ AppendAdded (@new);
+ Breaking |= breaking;
+ AnyChange = true;
+ return this;
+ }
+ }
+
+ public class ApiChanges : Dictionary<string, List<ApiChange>> {
+ public void Add (XElement source, XElement target, ApiChange change)
+ {
+ if (!change.AnyChange) {
+ // This is most likely because the rendering doesn't take into account something that's different (solution: fix rendering).
+ if (!change.HasIgnoredChanges) {
+ var isField = source.Name.LocalName == "field";
+ if (isField) {
+ Console.WriteLine ("Comparison resulting in no changes (src: {2} dst: {3}) :\n{0}\n{1}\n\n", source.ToString (), target.ToString (), source.GetFieldAttributes (), target.GetFieldAttributes ());
+ } else {
+ Console.WriteLine ("Comparison resulting in no changes (src: {2} dst: {3}) :\n{0}\n{1}\n\n", source.ToString (), target.ToString (), source.GetMethodAttributes (), target.GetMethodAttributes ());
+ }
+ }
+ return;
+ }
+
+ List<ApiChange> list;
+ if (!TryGetValue (change.Header, out list)) {
+ list = new List<ApiChange> ();
+ base.Add (change.Header, list);
+ }
+ list.Add (change);
+ }
+ }
+}
+
--- /dev/null
+//
+// The main differences with mono-api-diff are:
+// * this tool directly produce HTML similar to gdiff.sh used for Xamarin.iOS
+// * this tool reports changes in an "evolutionary" way, not in a breaking way,
+// i.e. it does not assume the source assembly is right (but simply older)
+// * the diff .xml output was not easy to convert back into the HTML format
+// that gdiff.sh produced
+//
+// Authors
+// Sebastien Pouliot <sebastien@xamarin.com>
+//
+// Copyright 2013-2014 Xamarin Inc. http://www.xamarin.com
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+using System.IO;
+using System.Collections.Generic;
+using System.Text.RegularExpressions;
+
+using Mono.Options;
+
+namespace Xamarin.ApiDiff {
+
+ public static class State {
+ static TextWriter output;
+
+ public static TextWriter Output {
+ get {
+ if (output == null)
+ output = Console.Out;
+ return output;
+ }
+ set { output = value; }
+ }
+
+ public static string Assembly { get; set; }
+ public static string Namespace { get; set; }
+ public static string Type { get; set; }
+ public static string BaseType { get; set; }
+
+ public static int Indent { get; set; }
+
+ static List<Regex> ignoreAdded = new List<Regex> ();
+ public static List<Regex> IgnoreAdded {
+ get { return ignoreAdded; }
+ }
+
+ static List<Regex> ignoreNew = new List<Regex> ();
+ public static List<Regex> IgnoreNew {
+ get { return ignoreNew; }
+ }
+
+ static List<Regex> ignoreRemoved = new List<Regex> ();
+ public static List<Regex> IgnoreRemoved {
+ get { return ignoreRemoved; }
+ }
+
+ public static bool IgnoreParameterNameChanges { get; set; }
+ public static bool IgnoreVirtualChanges { get; set; }
+ public static bool IgnoreAddedPropertySetters { get; set; }
+
+ public static bool Lax;
+ public static bool Colorize = true;
+ }
+
+ class Program {
+
+ public static int Main (string[] args)
+ {
+ var showHelp = false;
+ string diff = null;
+ List<string> extra = null;
+
+ var options = new OptionSet {
+ { "h|help", "Show this help", v => showHelp = true },
+ { "d|diff=", "HTML diff file out output (omit for stdout)", v => diff = v },
+ { "i|ignore=", "Ignore new, added, and removed members whose description matches a given C# regular expression (see below).",
+ v => {
+ var r = new Regex (v);
+ State.IgnoreAdded.Add (r);
+ State.IgnoreRemoved.Add (r);
+ State.IgnoreNew.Add (r);
+ }
+ },
+ { "a|ignore-added=", "Ignore added members whose description matches a given C# regular expression (see below).",
+ v => State.IgnoreAdded.Add (new Regex (v))
+ },
+ { "r|ignore-removed=", "Ignore removed members whose description matches a given C# regular expression (see below).",
+ v => State.IgnoreRemoved.Add (new Regex (v))
+ },
+ { "n|ignore-new=", "Ignore new namespaces and types whose description matches a given C# regular expression (see below).",
+ v => State.IgnoreNew.Add (new Regex (v))
+ },
+ { "ignore-changes-parameter-names", "Ignore changes to parameter names for identically prototyped methods.",
+ v => State.IgnoreParameterNameChanges = v != null
+ },
+ { "ignore-changes-property-setters", "Ignore adding setters to properties.",
+ v => State.IgnoreAddedPropertySetters = v != null
+ },
+ { "ignore-changes-virtual", "Ignore changing non-`virtual` to `virtual` or adding `override`.",
+ v => State.IgnoreVirtualChanges = v != null
+ },
+ { "c|colorize:", "Colorize HTML output", v => State.Colorize = string.IsNullOrEmpty (v) ? true : bool.Parse (v) },
+ { "x|lax", "Ignore duplicate XML entries", v => State.Lax = true }
+ };
+
+ try {
+ extra = options.Parse (args);
+ } catch (OptionException e) {
+ Console.WriteLine ("Option error: {0}", e.Message);
+ showHelp = true;
+ }
+
+ if (showHelp || extra == null || extra.Count < 2 || extra.Count > 3) {
+ Console.WriteLine (@"Usage: mono-api-html [options] <reference.xml> <assembly.xml> [diff.html]");
+ Console.WriteLine ();
+ Console.WriteLine ("Available options:");
+ options.WriteOptionDescriptions (Console.Out);
+ Console.WriteLine ();
+ Console.WriteLine ("Ignoring Members:");
+ Console.WriteLine ();
+ Console.WriteLine (" Members that were added can be filtered out of the diff by using the");
+ Console.WriteLine (" -i, --ignore-added option. The option takes a C# regular expression");
+ Console.WriteLine (" to match against member descriptions. For example, to ignore the");
+ Console.WriteLine (" introduction of the interfaces 'INSCopying' and 'INSCoding' on types");
+ Console.WriteLine (" pass the following to mono-api-html:");
+ Console.WriteLine ();
+ Console.WriteLine (" mono-api-html ... -i 'INSCopying$' -i 'INSCoding$'");
+ Console.WriteLine ();
+ Console.WriteLine (" The regular expressions will match any member description ending with");
+ Console.WriteLine (" 'INSCopying' or 'INSCoding'.");
+ Console.WriteLine ();
+ return 1;
+ }
+
+ var input = extra [0];
+ var output = extra [1];
+ if (extra.Count == 3 && diff == null)
+ diff = extra [2];
+
+ try {
+ var ac = new AssemblyComparer (input, output);
+ if (diff != null) {
+ string diffHtml = String.Empty;
+ using (var writer = new StringWriter ()) {
+ State.Output = writer;
+ ac.Compare ();
+ diffHtml = State.Output.ToString ();
+ }
+ if (diffHtml.Length > 0) {
+ using (var file = new StreamWriter (diff)) {
+ file.WriteLine ("<div>");
+ if (State.Colorize) {
+ file.WriteLine ("<style scoped>");
+ file.WriteLine ("\t.obsolete { color: gray; }");
+ file.WriteLine ("\t.added { color: green; }");
+ file.WriteLine ("\t.removed-inline { text-decoration: line-through; }");
+ file.WriteLine ("\t.removed-breaking-inline { color: red;}");
+ file.WriteLine ("\t.added-breaking-inline { text-decoration: underline; }");
+ file.WriteLine ("\t.nonbreaking { color: black; }");
+ file.WriteLine ("\t.breaking { color: red; }");
+ file.WriteLine ("</style>");
+ }
+ file.WriteLine (
+@"<script type=""text/javascript"">
+ // Only some elements have 'data-is-[non-]breaking' attributes. Here we
+ // iterate over all descendents elements, and set 'data-is-[non-]breaking'
+ // depending on whether there are any descendents with that attribute.
+ function propagateDataAttribute (element)
+ {
+ if (element.hasAttribute ('data-is-propagated'))
+ return;
+
+ var i;
+ var any_breaking = element.hasAttribute ('data-is-breaking');
+ var any_non_breaking = element.hasAttribute ('data-is-non-breaking');
+ for (i = 0; i < element.children.length; i++) {
+ var el = element.children [i];
+ propagateDataAttribute (el);
+ any_breaking |= el.hasAttribute ('data-is-breaking');
+ any_non_breaking |= el.hasAttribute ('data-is-non-breaking');
+ }
+
+ if (any_breaking)
+ element.setAttribute ('data-is-breaking', null);
+ else if (any_non_breaking)
+ element.setAttribute ('data-is-non-breaking', null);
+ element.setAttribute ('data-is-propagated', null);
+ }
+
+ function hideNonBreakingChanges ()
+ {
+ var topNodes = document.querySelectorAll ('[data-is-topmost]');
+ var n;
+ var i;
+ for (n = 0; n < topNodes.length; n++) {
+ propagateDataAttribute (topNodes [n]);
+ var elements = topNodes [n].querySelectorAll ('[data-is-non-breaking]');
+ for (i = 0; i < elements.length; i++) {
+ var el = elements [i];
+ if (!el.hasAttribute ('data-original-display'))
+ el.setAttribute ('data-original-display', el.style.display);
+ el.style.display = 'none';
+ }
+ }
+
+ var links = document.getElementsByClassName ('hide-nonbreaking');
+ for (i = 0; i < links.length; i++)
+ links [i].style.display = 'none';
+ links = document.getElementsByClassName ('restore-nonbreaking');
+ for (i = 0; i < links.length; i++)
+ links [i].style.display = '';
+ }
+
+ function showNonBreakingChanges ()
+ {
+ var elements = document.querySelectorAll ('[data-original-display]');
+ var i;
+ for (i = 0; i < elements.length; i++) {
+ var el = elements [i];
+ el.style.display = el.getAttribute ('data-original-display');
+ }
+
+ var links = document.getElementsByClassName ('hide-nonbreaking');
+ for (i = 0; i < links.length; i++)
+ links [i].style.display = '';
+ links = document.getElementsByClassName ('restore-nonbreaking');
+ for (i = 0; i < links.length; i++)
+ links [i].style.display = 'none';
+ }
+</script>");
+ if (ac.SourceAssembly == ac.TargetAssembly) {
+ file.WriteLine ("<h1>{0}.dll</h1>", ac.SourceAssembly);
+ } else {
+ file.WriteLine ("<h1>{0}.dll vs {1}.dll</h1>", ac.SourceAssembly, ac.TargetAssembly);
+ }
+ file.WriteLine ("<a href='javascript: hideNonBreakingChanges (); ' class='hide-nonbreaking'>Hide non-breaking changes</a>");
+ file.WriteLine ("<a href='javascript: showNonBreakingChanges (); ' class='restore-nonbreaking' style='display: none;'>Show non-breaking changes</a>");
+ file.WriteLine ("<br/>");
+ file.WriteLine ("<div data-is-topmost>");
+ file.Write (diffHtml);
+ file.WriteLine ("</div> <!-- end topmost div -->");
+ file.WriteLine ("</div>");
+ }
+ }
+ } else {
+ State.Output = Console.Out;
+ ac.Compare ();
+ }
+ }
+ catch (Exception e) {
+ Console.WriteLine (e);
+ return 1;
+ }
+ return 0;
+ }
+ }
+}
--- /dev/null
+//
+// Authors
+// Sebastien Pouliot <sebastien@xamarin.com>
+//
+// Copyright 2013 Xamarin Inc. http://www.xamarin.com
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+using System.Collections.Generic;
+using System.Xml.Linq;
+
+namespace Xamarin.ApiDiff {
+
+ public class AssemblyComparer : Comparer {
+
+ XDocument source;
+ XDocument target;
+ NamespaceComparer comparer;
+
+ public AssemblyComparer (string sourceFile, string targetFile)
+ {
+ source = XDocument.Load (sourceFile);
+ target = XDocument.Load (targetFile);
+ comparer = new NamespaceComparer ();
+ }
+
+ public string SourceAssembly { get; private set; }
+ public string TargetAssembly { get; private set; }
+
+ public void Compare ()
+ {
+ Compare (source.Element ("assemblies").Elements ("assembly"),
+ target.Element ("assemblies").Elements ("assembly"));
+ }
+
+ public override void SetContext (XElement current)
+ {
+ State.Assembly = current.GetAttribute ("name");
+ }
+
+ public override void Added (XElement target, bool wasParentAdded)
+ {
+ // one assembly per xml file
+ }
+
+ public override void Modified (XElement source, XElement target, ApiChanges diff)
+ {
+ SourceAssembly = source.GetAttribute ("name");
+ TargetAssembly = target.GetAttribute ("name");
+ // TODO: version
+ // ? custom attributes ?
+ comparer.Compare (source, target);
+ }
+
+ public override void Removed (XElement source)
+ {
+ // one assembly per xml file
+ }
+ }
+}
\ No newline at end of file
--- /dev/null
+//
+// Authors
+// Sebastien Pouliot <sebastien@xamarin.com>
+//
+// Copyright 2013 Xamarin Inc. http://www.xamarin.com
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+using System.Collections.Generic;
+using System.IO;
+using System.Linq;
+using System.Xml.Linq;
+
+namespace Xamarin.ApiDiff {
+
+ public class ClassComparer : Comparer {
+
+ InterfaceComparer icomparer;
+ ConstructorComparer ccomparer;
+ FieldComparer fcomparer;
+ PropertyComparer pcomparer;
+ EventComparer ecomparer;
+ MethodComparer mcomparer;
+ ClassComparer kcomparer;
+
+ public ClassComparer ()
+ {
+ icomparer = new InterfaceComparer ();
+ ccomparer = new ConstructorComparer ();
+ fcomparer = new FieldComparer ();
+ pcomparer = new PropertyComparer ();
+ ecomparer = new EventComparer ();
+ mcomparer = new MethodComparer ();
+ }
+
+ public override void SetContext (XElement current)
+ {
+ State.Type = current.GetAttribute ("name");
+ State.BaseType = current.GetAttribute ("base");
+ }
+
+ public void Compare (XElement source, XElement target)
+ {
+ var s = source.Element ("classes");
+ var t = target.Element ("classes");
+ if (XNode.DeepEquals (s, t))
+ return;
+ Compare (s.Elements ("class"), t.Elements ("class"));
+ }
+
+ public override void Added (XElement target, bool wasParentAdded)
+ {
+ string name = target.Attribute ("name").Value;
+ if (State.IgnoreNew.Any (re => re.IsMatch (name)))
+ return;
+ Output.WriteLine ("<div> <!-- start type {0} -->", name);
+ Output.WriteLine ("<h3>New Type {0}.{1}</h3>", State.Namespace, name);
+ Output.WriteLine ("<pre class='added' data-is-non-breaking>");
+ State.Indent = 0;
+ AddedInner (target);
+ Output.WriteLine ("</pre>");
+ Output.WriteLine ("</div> <!-- end type {0} -->", name);
+ }
+
+ public void AddedInner (XElement target)
+ {
+ SetContext (target);
+ if (target.IsTrue ("serializable"))
+ Indent ().WriteLine ("[Serializable]");
+
+ var type = target.Attribute ("type").Value;
+
+ if (type == "enum") {
+ // check if [Flags] is present
+ var cattrs = target.Element ("attributes");
+ if (cattrs != null) {
+ foreach (var ca in cattrs.Elements ("attribute")) {
+ if (ca.GetAttribute ("name") == "System.FlagsAttribute") {
+ Indent ().WriteLine ("[Flags]");
+ break;
+ }
+ }
+ }
+ }
+
+ Indent ().Write ("public");
+
+ if (type != "enum") {
+ bool seal = target.IsTrue ("sealed");
+ bool abst = target.IsTrue ("abstract");
+ if (seal && abst)
+ Output.Write (" static");
+ else if (seal && type != "struct")
+ Output.Write (" sealed");
+ else if (abst && type != "interface")
+ Output.Write (" abstract");
+ }
+
+ Output.Write (' ');
+ Output.Write (type);
+ Output.Write (' ');
+ Output.Write (target.GetAttribute ("name"));
+
+ var baseclass = target.GetAttribute ("base");
+ if ((type != "enum") && (type != "struct")) {
+ if (baseclass != null) {
+ if (baseclass == "System.Object") {
+ // while true we do not need to be reminded every time...
+ baseclass = null;
+ } else {
+ Output.Write (" : ");
+ Output.Write (baseclass);
+ }
+ }
+ }
+
+ // interfaces on enums are "standard" not user provided - so we do not want to show them
+ if (type != "enum") {
+ var i = target.Element ("interfaces");
+ if (i != null) {
+ var interfaces = new List<string> ();
+ foreach (var iface in i.Elements ("interface"))
+ interfaces.Add (icomparer.GetDescription (iface));
+ Output.Write ((baseclass == null) ? " : " : ", ");
+ Output.Write (String.Join (", ", interfaces));
+ }
+ }
+
+ Output.WriteLine (" {");
+
+ var t = target.Element ("constructors");
+ if (t != null) {
+ Indent ().WriteLine ("\t// constructors");
+ foreach (var ctor in t.Elements ("constructor"))
+ ccomparer.Added (ctor, true);
+ }
+
+ t = target.Element ("fields");
+ if (t != null) {
+ if (type != "enum")
+ Indent ().WriteLine ("\t// fields");
+ else
+ SetContext (target);
+ foreach (var field in t.Elements ("field"))
+ fcomparer.Added (field, true);
+ }
+
+ t = target.Element ("properties");
+ if (t != null) {
+ Indent ().WriteLine ("\t// properties");
+ foreach (var property in t.Elements ("property"))
+ pcomparer.Added (property, true);
+ }
+
+ t = target.Element ("events");
+ if (t != null) {
+ Indent ().WriteLine ("\t// events");
+ foreach (var evnt in t.Elements ("event"))
+ ecomparer.Added (evnt, true);
+ }
+
+ t = target.Element ("methods");
+ if (t != null) {
+ Indent ().WriteLine ("\t// methods");
+ foreach (var method in t.Elements ("method"))
+ mcomparer.Added (method, true);
+ }
+
+ t = target.Element ("classes");
+ if (t != null) {
+ Output.WriteLine ();
+ Indent ().WriteLine ("\t// inner types");
+ kcomparer = new NestedClassComparer ();
+ State.Indent++;
+ foreach (var inner in t.Elements ("class"))
+ kcomparer.AddedInner (inner);
+ State.Indent--;
+ }
+ Indent ().WriteLine ("}");
+ }
+
+ public override void Modified (XElement source, XElement target, ApiChanges diff)
+ {
+ // hack - there could be changes that we're not monitoring (e.g. attributes properties)
+ var output = Output;
+ State.Output = new StringWriter ();
+
+ var sb = source.GetAttribute ("base");
+ var tb = target.GetAttribute ("base");
+ if (sb != tb) {
+ Output.Write ("Modified base type: ");
+ Output.WriteLine (new ApiChange ().AppendModified (sb, tb, true).Member.ToString ());
+ }
+
+ ccomparer.Compare (source, target);
+ icomparer.Compare (source, target);
+ fcomparer.Compare (source, target);
+ pcomparer.Compare (source, target);
+ ecomparer.Compare (source, target);
+ mcomparer.Compare (source, target);
+
+ var si = source.Element ("classes");
+ if (si != null) {
+ var ti = target.Element ("classes");
+ kcomparer = new NestedClassComparer ();
+ kcomparer.Compare (si.Elements ("class"), ti == null ? null : ti.Elements ("class"));
+ }
+
+ var s = (Output as StringWriter).ToString ();
+ State.Output = output;
+ if (s.Length > 0) {
+ var tn = GetTypeName (target);
+ Output.WriteLine ("<!-- start type {0} --> <div>", tn);
+ Output.WriteLine ("<h3>Type Changed: {0}.{1}</h3>", State.Namespace, GetTypeName (target));
+ Output.WriteLine (s);
+ Output.WriteLine ("</div> <!-- end type {0} -->", tn);
+ }
+ }
+
+ public override void Removed (XElement source)
+ {
+ Output.Write ("<h3>Removed Type <span class='breaking' data-is-breaking>{0}.{1}</span></h3>", State.Namespace, GetTypeName (source));
+ }
+
+ public virtual string GetTypeName (XElement type)
+ {
+ return type.GetAttribute ("name");
+ }
+ }
+
+ public class NestedClassComparer : ClassComparer {
+
+ public override void SetContext (XElement current)
+ {
+ }
+
+ public override string GetTypeName (XElement type)
+ {
+ return State.Type + "." + base.GetTypeName (type);
+ }
+ }
+}
\ No newline at end of file
--- /dev/null
+//
+// Authors
+// Sebastien Pouliot <sebastien@xamarin.com>
+//
+// Copyright 2013 Xamarin Inc. http://www.xamarin.com
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+using System.Collections.Generic;
+using System.IO;
+using System.Linq;
+using System.Xml.Linq;
+
+namespace Xamarin.ApiDiff {
+
+ public abstract class Comparer {
+
+ protected List<XElement> removed = new List<XElement> ();
+ protected ApiChanges modified = new ApiChanges ();
+
+ public TextWriter Output {
+ get { return State.Output; }
+ }
+
+ protected TextWriter Indent ()
+ {
+ for (int i = 0; i < State.Indent; i++)
+ State.Output.Write ("\t");
+ return State.Output;
+ }
+
+ public abstract void Added (XElement target, bool wasParentAdded);
+ public abstract void Modified (XElement source, XElement target, ApiChanges changes);
+ public abstract void Removed (XElement source);
+
+ public virtual bool Equals (XElement source, XElement target, ApiChanges changes)
+ {
+ return XNode.DeepEquals (source, target);
+ }
+
+ public abstract void SetContext (XElement current);
+
+ public virtual void Compare (IEnumerable<XElement> source, IEnumerable<XElement> target)
+ {
+ removed.Clear ();
+ modified.Clear ();
+
+ foreach (var s in source) {
+ SetContext (s);
+ string sn = s.GetAttribute ("name");
+ var t = target == null ? null : target.SingleOrDefault (x => x.GetAttribute ("name") == sn);
+ if (t == null) {
+ // not in target, it was removed
+ removed.Add (s);
+ } else {
+ t.Remove ();
+ // possibly modified
+ if (Equals (s, t, modified))
+ continue;
+
+ // still in target so will be part of Added
+ Modified (s, t, modified);
+ }
+ }
+ // delayed, that way we show "Modified", "Added" and then "Removed"
+ foreach (var item in removed) {
+ SetContext (item);
+ Removed (item);
+ }
+ // remaining == newly added in target
+ if (target != null) {
+ foreach (var item in target) {
+ SetContext (item);
+ Added (item, false);
+ }
+ }
+ }
+ }
+}
\ No newline at end of file
--- /dev/null
+//
+// Authors
+// Sebastien Pouliot <sebastien@xamarin.com>
+//
+// Copyright 2013 Xamarin Inc. http://www.xamarin.com
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+using System.Collections.Generic;
+using System.Reflection;
+using System.Text;
+using System.Xml.Linq;
+
+namespace Xamarin.ApiDiff {
+
+ // MethodComparer inherits from this one
+ public class ConstructorComparer : MemberComparer {
+
+ public override string GroupName {
+ get { return "constructors"; }
+ }
+
+ public override string ElementName {
+ get { return "constructor"; }
+ }
+
+ public override bool Find (XElement e)
+ {
+ return (e.Attribute ("name").Value == Source.Attribute ("name").Value);
+ }
+
+ void RenderReturnType (XElement source, XElement target, ApiChange change)
+ {
+ var srcType = source.GetTypeName ("returntype");
+ var tgtType = target.GetTypeName ("returntype");
+
+ if (srcType != tgtType) {
+ change.AppendModified (srcType, tgtType, true);
+ change.Append (" ");
+ } else if (srcType != null) {
+ // ctor don't have a return type
+ change.Append (srcType);
+ change.Append (" ");
+ }
+ }
+
+ public override bool Equals (XElement source, XElement target, ApiChanges changes)
+ {
+ if (base.Equals (source, target, changes))
+ return true;
+
+ var change = new ApiChange ();
+ change.Header = "Modified " + GroupName;
+ RenderMethodAttributes (source, target, change);
+ RenderReturnType (source, target, change);
+ RenderName (source, target, change);
+ RenderGenericParameters (source, target, change);
+ RenderParameters (source, target, change);
+
+ changes.Add (source, target, change);
+
+ return false;
+ }
+
+ public override string GetDescription (XElement e)
+ {
+ var sb = new StringBuilder ();
+
+ var attribs = e.Attribute ("attrib");
+ if (attribs != null) {
+ var attr = (MethodAttributes) Int32.Parse (attribs.Value);
+ if ((attr & MethodAttributes.Public) != MethodAttributes.Public) {
+ sb.Append ("protected ");
+ } else {
+ sb.Append ("public ");
+ }
+
+ if ((attr & MethodAttributes.Static) != 0) {
+ sb.Append ("static ");
+ } else if ((attr & MethodAttributes.Virtual) != 0) {
+ if ((attr & MethodAttributes.VtableLayoutMask) == 0)
+ sb.Append ("override ");
+ else
+ sb.Append ("virtual ");
+ }
+ }
+
+ string name = e.GetAttribute ("name");
+
+ var r = e.GetTypeName ("returntype");
+ if (r != null) {
+ // ctor dont' have a return type
+ sb.Append (r).Append (' ');
+ } else {
+ // show the constructor as it would be defined in C#
+ name = name.Replace (".ctor", State.Type);
+ }
+
+ // the XML file `name` does not contain parameter names, so we must process them ourselves
+ // which gives us the opportunity to simplify type names
+ sb.Append (name.Substring (0, name.IndexOf ('(')));
+
+ var genericp = e.Element ("generic-parameters");
+ if (genericp != null) {
+ var list = new List<string> ();
+ foreach (var p in genericp.Elements ("generic-parameter")) {
+ list.Add (p.GetTypeName ("name"));
+ }
+ sb.Append ("<").Append (String.Join (", ", list)).Append (">");
+ }
+
+ sb.Append (" (");
+ var parameters = e.Element ("parameters");
+ if (parameters != null) {
+ var list = new List<string> ();
+ foreach (var p in parameters.Elements ("parameter")) {
+ var pTypeName = p.GetTypeName ("type");
+ list.Add (State.IgnoreParameterNameChanges
+ ? pTypeName
+ : pTypeName + " " + p.GetAttribute ("name"));
+ }
+ sb.Append (String.Join (", ", list));
+ }
+ sb.Append (");");
+
+ return sb.ToString ();
+ }
+ }
+}
\ No newline at end of file
--- /dev/null
+//
+// Authors
+// Sebastien Pouliot <sebastien@xamarin.com>
+//
+// Copyright 2013 Xamarin Inc. http://www.xamarin.com
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+using System.Text;
+using System.Xml.Linq;
+
+namespace Xamarin.ApiDiff {
+
+ public class EventComparer : MemberComparer {
+
+ public override string GroupName {
+ get { return "events"; }
+ }
+
+ public override string ElementName {
+ get { return "event"; }
+ }
+
+ public override bool Equals (XElement source, XElement target, ApiChanges changes)
+ {
+ if (base.Equals (source, target, changes))
+ return true;
+
+ var change = new ApiChange ();
+ change.Header = "Modified " + GroupName;
+ change.Append ("public event ");
+
+ var srcEventType = source.GetTypeName ("eventtype");
+ var tgtEventType = target.GetTypeName ("eventtype");
+
+ if (srcEventType != tgtEventType) {
+ change.AppendModified (srcEventType, tgtEventType, true);
+ } else {
+ change.Append (srcEventType);
+ }
+ change.Append (" ");
+ change.Append (source.GetAttribute ("name")).Append (";");
+ return false;
+ }
+
+ public override string GetDescription (XElement e)
+ {
+ StringBuilder sb = new StringBuilder ();
+ // TODO: attribs
+ sb.Append ("public event ");
+ sb.Append (e.GetTypeName ("eventtype")).Append (' ');
+ sb.Append (e.GetAttribute ("name")).Append (';');
+ return sb.ToString ();
+ }
+ }
+}
\ No newline at end of file
--- /dev/null
+//
+// Authors
+// Sebastien Pouliot <sebastien@xamarin.com>
+//
+// Copyright 2013-2014 Xamarin Inc. http://www.xamarin.com
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Reflection;
+using System.Text;
+using System.Xml.Linq;
+
+namespace Xamarin.ApiDiff {
+
+ public class FieldComparer : MemberComparer {
+
+ public override string GroupName {
+ get { return "fields"; }
+ }
+
+ public override string ElementName {
+ get { return "field"; }
+ }
+
+ void RenderFieldAttributes (FieldAttributes source, FieldAttributes target, ApiChange change)
+ {
+ var srcNotSerialized = (source & FieldAttributes.NotSerialized) == FieldAttributes.NotSerialized;
+ var tgtNotSerialized = (target & FieldAttributes.NotSerialized) == FieldAttributes.NotSerialized;
+ if (srcNotSerialized != tgtNotSerialized) {
+ // this is not a breaking change, so only render it if it changed.
+ if (srcNotSerialized) {
+ change.AppendRemoved ("[NonSerialized]\n");
+ } else {
+ change.AppendAdded ("[NonSerialized]\n");
+ }
+ }
+
+ // the visibility values are the same for MethodAttributes and FieldAttributes, so just use the same method.
+ RenderVisibility ((MethodAttributes) source, (MethodAttributes) target, change);
+ // same for the static flag
+ RenderStatic ((MethodAttributes) source, (MethodAttributes) target, change);
+
+ var srcLiteral = (source & FieldAttributes.Literal) != 0;
+ var tgtLiteral = (target & FieldAttributes.Literal) != 0;
+
+ if (srcLiteral) {
+ if (tgtLiteral) {
+ change.Append ("const ");
+ } else {
+ change.AppendRemoved ("const", true).Append (" ");
+ }
+ } else if (tgtLiteral) {
+ change.AppendAdded ("const", true).Append (" ");
+ }
+
+ var srcInitOnly = (source & FieldAttributes.InitOnly) != 0;
+ var tgtInitOnly = (target & FieldAttributes.InitOnly) != 0;
+ if (srcInitOnly) {
+ if (tgtInitOnly) {
+ change.Append ("readonly ");
+ } else {
+ change.AppendRemoved ("readonly", false).Append (" ");
+ }
+ } else if (tgtInitOnly) {
+ change.AppendAdded ("readonly", true).Append (" ");
+ }
+ }
+
+ public override bool Equals (XElement source, XElement target, ApiChanges changes)
+ {
+ if (base.Equals (source, target, changes))
+ return true;
+
+ var name = source.GetAttribute ("name");
+ var srcValue = source.GetAttribute ("value");
+ var tgtValue = target.GetAttribute ("value");
+ var change = new ApiChange ();
+ change.Header = "Modified " + GroupName;
+
+ if (State.BaseType == "System.Enum") {
+ change.Append (name).Append (" = ");
+ if (srcValue != tgtValue) {
+ change.AppendModified (srcValue, tgtValue, true);
+ } else {
+ change.Append (srcValue);
+ }
+ } else {
+ RenderFieldAttributes (source.GetFieldAttributes (), target.GetFieldAttributes (), change);
+
+ var srcType = source.GetTypeName ("fieldtype");
+ var tgtType = target.GetTypeName ("fieldtype");
+
+ if (srcType != tgtType) {
+ change.AppendModified (srcType, tgtType, true);
+ } else {
+ change.Append (srcType);
+ }
+ change.Append (" ");
+ change.Append (name);
+
+ if (srcType == "string" && srcValue != null)
+ srcValue = "\"" + srcValue + "\"";
+
+ if (tgtType == "string" && tgtValue != null)
+ tgtValue = "\"" + tgtValue + "\"";
+
+ if (srcValue != tgtValue) {
+ change.Append (" = ");
+ if (srcValue == null)
+ srcValue = "null";
+ if (tgtValue == null)
+ tgtValue = "null";
+ change.AppendModified (srcValue, tgtValue, true);
+ } else if (srcValue != null) {
+ change.Append (" = ");
+ change.Append (srcValue);
+ }
+ change.Append (";");
+ }
+
+ changes.Add (source, target, change);
+
+ return false;
+ }
+
+ public override string GetDescription (XElement e)
+ {
+ var sb = new StringBuilder ();
+
+ string name = e.GetAttribute ("name");
+ string value = e.GetAttribute ("value");
+
+ if (State.BaseType == "System.Enum") {
+ sb.Append (name).Append (" = ").Append (value).Append (',');
+ } else {
+ var attribs = e.Attribute ("attrib");
+ if (attribs != null) {
+ var attr = (FieldAttributes)Int32.Parse (attribs.Value);
+ if ((attr & FieldAttributes.Public) != FieldAttributes.Public) {
+ sb.Append ("protected ");
+ } else {
+ sb.Append ("public ");
+ }
+
+ if ((attr & FieldAttributes.Static) != 0)
+ sb.Append ("static ");
+
+ if ((attr & FieldAttributes.Literal) != 0)
+ sb.Append ("const ");
+ }
+
+ string ftype = e.GetTypeName ("fieldtype");
+ sb.Append (ftype).Append (' ');
+ sb.Append (name);
+ if (ftype == "string" && e.Attribute ("value") != null) {
+ if (value == null)
+ sb.Append (" = null");
+ else
+ sb.Append (" = \"").Append (value).Append ('"');
+ }
+ sb.Append (';');
+ }
+
+ return sb.ToString ();
+ }
+
+ public override void BeforeAdding (IEnumerable<XElement> list)
+ {
+ first = true;
+ if (State.BaseType == "System.Enum") {
+ Output.WriteLine ("<div>");
+ Output.WriteLine ("<p>Added value{0}:</p>", list.Count () > 1 ? "s" : String.Empty);
+ Output.WriteLine ("<pre class='added' data-is-non-breaking>");
+ } else {
+ base.BeforeAdding (list);
+ }
+ }
+
+ public override void BeforeRemoving (IEnumerable<XElement> list)
+ {
+ first = true;
+ if (State.BaseType == "System.Enum") {
+ Output.WriteLine ("<p>Removed value{0}:</p>", list.Count () > 1 ? "s" : String.Empty);
+ Output.WriteLine ("<pre class='removed' data-is-breaking>");
+ } else {
+ base.BeforeRemoving (list);
+ }
+ }
+ }
+}
\ No newline at end of file
--- /dev/null
+//
+// Authors
+// Sebastien Pouliot <sebastien@xamarin.com>
+//
+// Copyright 2013-2014 Xamarin Inc. http://www.xamarin.com
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Reflection;
+using System.Text;
+using System.Xml.Linq;
+
+namespace Xamarin.ApiDiff {
+
+ public static class Helper {
+ public static bool IsTrue (this XElement self, string name)
+ {
+ return (self.GetAttribute (name) == "true");
+ }
+
+ public static string GetAttribute (this XElement self, string name)
+ {
+ var n = self.Attribute (name);
+ if (n == null)
+ return null;
+ return n.Value;
+ }
+
+ // null == no obsolete, String.Empty == no description
+ public static string GetObsoleteMessage (this XElement self)
+ {
+ var cattrs = self.Element ("attributes");
+ if (cattrs == null)
+ return null;
+
+ foreach (var ca in cattrs.Elements ("attribute")) {
+ if (ca.GetAttribute ("name") != "System.ObsoleteAttribute")
+ continue;
+ var props = ca.Element ("properties");
+ if (props == null)
+ return String.Empty; // no description
+ foreach (var p in props.Elements ("property")) {
+ if (p.GetAttribute ("name") != "Message")
+ continue;
+ return p.GetAttribute ("value");
+ }
+ }
+ return null;
+ }
+
+ public static IEnumerable<XElement> Descendants (this XElement self, params string[] names)
+ {
+ XElement el = self;
+ if (el == null)
+ return null;
+
+ for (int i = 0; i < names.Length - 1; i++) {
+ el = el.Element (names [i]);
+ if (el == null)
+ return null;
+ }
+ return el.Elements (names [names.Length - 1]);
+ }
+
+ public static List<XElement> DescendantList (this XElement self, params string[] names)
+ {
+ var descendants = self.Descendants (names);
+ if (descendants == null)
+ return null;
+ return descendants.ToList ();
+ }
+
+ // make it beautiful (.NET -> C#)
+ public static string GetTypeName (this XElement self, string name)
+ {
+ string type = self.GetAttribute (name);
+ if (type == null)
+ return null;
+
+ StringBuilder sb = null;
+ bool is_nullable = false;
+ if (type.StartsWith ("System.Nullable`1[", StringComparison.Ordinal)) {
+ is_nullable = true;
+ sb = new StringBuilder (type, 18, type.Length - 19, 1024);
+ } else {
+ sb = new StringBuilder (type);
+ }
+
+ bool is_ref = (sb [sb.Length - 1] == '&');
+ if (is_ref)
+ sb.Remove (sb.Length - 1, 1);
+
+ int array = 0;
+ while ((sb [sb.Length - 1] == ']') && (sb [sb.Length - 2] == '[')) {
+ sb.Remove (sb.Length - 2, 2);
+ array++;
+ }
+
+ bool is_pointer = (sb [sb.Length - 1] == '*');
+ if (is_pointer)
+ sb.Remove (sb.Length - 1, 1);
+
+ type = GetTypeName (sb.Replace ('+', '.').ToString ());
+ sb.Length = 0;
+ if (is_ref)
+ sb.Append (self.GetAttribute ("direction")).Append (' ');
+
+ sb.Append (type);
+
+ while (array-- > 0)
+ sb.Append ("[]");
+ if (is_nullable)
+ sb.Append ('?');
+ if (is_pointer)
+ sb.Append ('*');
+ return sb.ToString ();
+ }
+
+ static string GetTypeName (string type)
+ {
+ int pos = type.IndexOf ('`');
+ if (pos >= 0) {
+ int end = type.LastIndexOf (']');
+ string subtype = type.Substring (pos + 3, end - pos - 3);
+ return type.Substring (0, pos) + "<" + GetTypeName (subtype) + ">";
+ }
+
+ switch (type) {
+ case "System.String":
+ return "string";
+ case "System.Int32":
+ return "int";
+ case "System.UInt32":
+ return "uint";
+ case "System.Int64":
+ return "long";
+ case "System.UInt64":
+ return "ulong";
+ case "System.Void":
+ return "void";
+ case "System.Boolean":
+ return "bool";
+ case "System.Object":
+ return "object";
+ case "System.Single":
+ return "float";
+ case "System.Double":
+ return "double";
+ case "System.Byte":
+ return "byte";
+ case "System.SByte":
+ return "sbyte";
+ case "System.Int16":
+ return "short";
+ case "System.UInt16":
+ return "ushort";
+ case "System.Char":
+ return "char";
+ case "System.nint":
+ return "nint";
+ case "System.nuint":
+ return "uint";
+ case "System.nfloat":
+ return "nfloat";
+ case "System.IntPtr":
+ return "IntPtr";
+ default:
+ if (type.StartsWith (State.Namespace, StringComparison.Ordinal))
+ type = type.Substring (State.Namespace.Length + 1);
+ return type;
+ }
+ }
+
+ public static MethodAttributes GetMethodAttributes (this XElement element)
+ {
+ var srcAttribs = element.Attribute ("attrib");
+ return (MethodAttributes) (srcAttribs != null ? Int32.Parse (srcAttribs.Value) : 0);
+ }
+
+ public static FieldAttributes GetFieldAttributes (this XElement element)
+ {
+ var srcAttribs = element.Attribute ("attrib");
+ return (FieldAttributes) (srcAttribs != null ? Int32.Parse (srcAttribs.Value) : 0);
+ }
+ }
+}
\ No newline at end of file
--- /dev/null
+//
+// Authors
+// Sebastien Pouliot <sebastien@xamarin.com>
+//
+// Copyright 2013 Xamarin Inc. http://www.xamarin.com
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+using System.Xml.Linq;
+
+namespace Xamarin.ApiDiff {
+
+ public class InterfaceComparer : MemberComparer {
+
+ public override string GroupName {
+ get { return "interfaces"; }
+ }
+
+ public override string ElementName {
+ get { return "interface"; }
+ }
+
+ public override string GetDescription (XElement e)
+ {
+ return e.GetTypeName ("name");
+ }
+ }
+}
\ No newline at end of file
--- /dev/null
+thisdir = tools/mono-api-html
+SUBDIRS =
+include ../../build/rules.make
+
+LIB_REFS = Mono.Cecil System.Xml System.Core System System.Xml.Linq
+LOCAL_MCS_FLAGS =
+
+PROGRAM = mono-api-html.exe
+
+include ../../build/executable.make
--- /dev/null
+//
+// Authors
+// Sebastien Pouliot <sebastien@xamarin.com>
+//
+// Copyright 2013-2014 Xamarin Inc. http://www.xamarin.com
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Reflection;
+using System.Text;
+using System.Xml.Linq;
+
+namespace Xamarin.ApiDiff {
+
+ public abstract class MemberComparer : Comparer {
+
+ // true if this is the first element being added or removed in the group being rendered
+ protected bool first;
+
+ public abstract string GroupName { get; }
+ public abstract string ElementName { get; }
+
+ protected virtual bool IsBreakingRemoval (XElement e)
+ {
+ return true;
+ }
+
+ public void Compare (XElement source, XElement target)
+ {
+ var s = source.Element (GroupName);
+ var t = target.Element (GroupName);
+ if (XNode.DeepEquals (s, t))
+ return;
+
+ if (s == null) {
+ Add (t.Elements (ElementName));
+ } else if (t == null) {
+ Remove (s.Elements (ElementName));
+ } else {
+ Compare (s.Elements (ElementName), t.Elements (ElementName));
+ }
+ }
+
+ public override void SetContext (XElement current)
+ {
+ }
+
+ string GetContainingType (XElement el)
+ {
+ return el.Ancestors ("class").First ().Attribute ("type").Value;
+ }
+
+ bool IsInInterface (XElement el)
+ {
+ return GetContainingType (el) == "interface";
+ }
+
+ public XElement Source { get; set; }
+
+ public virtual bool Find (XElement e)
+ {
+ return e.GetAttribute ("name") == Source.GetAttribute ("name");
+ }
+
+ XElement Find (IEnumerable<XElement> target)
+ {
+ return State.Lax ? target.FirstOrDefault (Find) : target.SingleOrDefault (Find);
+ }
+
+ public override void Compare (IEnumerable<XElement> source, IEnumerable<XElement> target)
+ {
+ removed.Clear ();
+ modified.Clear ();
+
+ foreach (var s in source) {
+ SetContext (s);
+ Source = s;
+ var t = Find (target);
+ if (t == null) {
+ // not in target, it was removed
+ removed.Add (s);
+ } else {
+ t.Remove ();
+ // possibly modified
+ if (Equals (s, t, modified))
+ continue;
+
+ Modified (s, t, modified);
+ }
+ }
+ // delayed, that way we show "Modified", "Added" and then "Removed"
+ Remove (removed);
+
+ Modify (modified);
+
+ // remaining == newly added in target
+ Add (target);
+ }
+
+ void Add (IEnumerable<XElement> elements)
+ {
+ bool a = false;
+ foreach (var item in elements) {
+ SetContext (item);
+ if (State.IgnoreAdded.Any (re => re.IsMatch (GetDescription (item))))
+ continue;
+ if (!a) {
+ BeforeAdding (elements);
+ a = true;
+ }
+ Added (item, false);
+ }
+ if (a)
+ AfterAdding ();
+ }
+
+ void Modify (ApiChanges modified)
+ {
+ foreach (var changes in modified) {
+ Output.WriteLine ("<p>{0}:</p>", changes.Key);
+ Output.WriteLine ("<pre>");
+ foreach (var element in changes.Value) {
+ Output.Write ("<div {0}>", element.Breaking ? "data-is-breaking" : "data-is-non-breaking");
+ foreach (var line in element.Member.ToString ().Split ('\n'))
+ Output.WriteLine ("\t{0}", line);
+ Output.Write ("</div>");
+
+ }
+ Output.WriteLine ("</pre>");
+ }
+ }
+
+ void Remove (IEnumerable<XElement> elements)
+ {
+ bool r = false;
+ foreach (var item in elements) {
+ if (State.IgnoreRemoved.Any (re => re.IsMatch (GetDescription (item))))
+ continue;
+ SetContext (item);
+ if (!r) {
+ BeforeRemoving (elements);
+ r = true;
+ }
+ Removed (item);
+ }
+ if (r)
+ AfterRemoving ();
+ }
+
+ public abstract string GetDescription (XElement e);
+
+ protected StringBuilder GetObsoleteMessage (XElement e)
+ {
+ var sb = new StringBuilder ();
+ string o = e.GetObsoleteMessage ();
+ if (o != null) {
+ sb.Append ("[Obsolete");
+ if (o.Length > 0)
+ sb.Append (" (\"").Append (o).Append ("\")");
+ sb.AppendLine ("]");
+ for (int i = 0; i < State.Indent + 1; i++)
+ sb.Append ('\t');
+ }
+ return sb;
+ }
+
+ public override bool Equals (XElement source, XElement target, ApiChanges changes)
+ {
+ RenderAttributes (source, target, changes);
+
+ // We don't want to compare attributes.
+ RemoveAttributes (source);
+ RemoveAttributes (target);
+
+ return base.Equals (source, target, changes);
+ }
+
+ public virtual void BeforeAdding (IEnumerable<XElement> list)
+ {
+ first = true;
+ Output.WriteLine ("<div>");
+ Output.WriteLine ("<p>Added {0}:</p>", list.Count () > 1 ? GroupName : ElementName);
+ Output.WriteLine ("<pre>");
+ }
+
+ public override void Added (XElement target, bool wasParentAdded)
+ {
+ var o = GetObsoleteMessage (target);
+ if (!first && (o.Length > 0))
+ Output.WriteLine ();
+ Indent ();
+ bool isInterfaceBreakingChange = !wasParentAdded && IsInInterface (target);
+ Output.Write ("\t<span class='added added-{0} {1}' {2}>", ElementName, isInterfaceBreakingChange ? "breaking" : string.Empty, isInterfaceBreakingChange ? "data-is-breaking" : "data-is-non-breaking");
+ Output.Write ("{0}{1}", o, GetDescription (target));
+ Output.WriteLine ("</span>");
+ first = false;
+ }
+
+ public virtual void AfterAdding ()
+ {
+ Output.WriteLine ("</pre>");
+ Output.WriteLine ("</div>");
+ }
+
+ public override void Modified (XElement source, XElement target, ApiChanges change)
+ {
+ }
+
+ public virtual void BeforeRemoving (IEnumerable<XElement> list)
+ {
+ first = true;
+ Output.WriteLine ("<p>Removed {0}:</p>\n", list.Count () > 1 ? GroupName : ElementName);
+ Output.WriteLine ("<pre>");
+ }
+
+ public override void Removed (XElement source)
+ {
+ var o = GetObsoleteMessage (source);
+ if (!first && (o.Length > 0))
+ Output.WriteLine ();
+
+ bool is_breaking = IsBreakingRemoval (source);
+
+ Indent ();
+ Output.Write ("\t<span class='removed removed-{0} {2}' {1}>", ElementName, is_breaking ? "data-is-breaking" : "data-is-non-breaking", is_breaking ? "breaking" : string.Empty);
+ Output.Write ("{0}{1}", o, GetDescription (source));
+ Output.WriteLine ("</span>");
+ first = false;
+ }
+
+ public virtual void AfterRemoving ()
+ {
+ Output.WriteLine ("</pre>");;
+ }
+
+ string RenderGenericParameter (XElement gp)
+ {
+ var sb = new StringBuilder ();
+ sb.Append (gp.GetTypeName ("name"));
+
+ var constraints = gp.DescendantList ("generic-parameter-constraints", "generic-parameter-constraint");
+ if (constraints != null && constraints.Count > 0) {
+ sb.Append (" : ");
+ for (int i = 0; i < constraints.Count; i++) {
+ if (i > 0)
+ sb.Append (", ");
+ sb.Append (constraints [i].GetTypeName ("name"));
+ }
+ }
+ return sb.ToString ();
+ }
+
+ protected void RenderGenericParameters (XElement source, XElement target, ApiChange change)
+ {
+ var src = source.DescendantList ("generic-parameters", "generic-parameter");
+ var tgt = target.DescendantList ("generic-parameters", "generic-parameter");
+ var srcCount = src == null ? 0 : src.Count;
+ var tgtCount = tgt == null ? 0 : tgt.Count;
+
+ if (srcCount == 0 && tgtCount == 0)
+ return;
+
+ change.Append ("<");
+ for (int i = 0; i < Math.Max (srcCount, tgtCount); i++) {
+ if (i > 0)
+ change.Append (", ");
+ if (i >= srcCount) {
+ change.AppendAdded (RenderGenericParameter (tgt [i]), true);
+ } else if (i >= tgtCount) {
+ change.AppendRemoved (RenderGenericParameter (src [i]), true);
+ } else {
+ var srcName = RenderGenericParameter (src [i]);
+ var tgtName = RenderGenericParameter (tgt [i]);
+
+ if (srcName != tgtName) {
+ change.AppendModified (srcName, tgtName, true);
+ } else {
+ change.Append (srcName);
+ }
+ }
+ }
+ change.Append (">");
+ }
+
+ protected string FormatValue (string type, string value)
+ {
+ if (value == null)
+ return "null";
+
+ if (type == "string")
+ return "\"" + value + "\"";
+ else if (type == "bool") {
+ switch (value) {
+ case "True":
+ return "true";
+ case "False":
+ return "false";
+ default:
+ return value;
+ }
+ }
+
+ return value;
+ }
+
+ protected void RenderParameters (XElement source, XElement target, ApiChange change)
+ {
+ var src = source.DescendantList ("parameters", "parameter");
+ var tgt = target.DescendantList ("parameters", "parameter");
+ var srcCount = src == null ? 0 : src.Count;
+ var tgtCount = tgt == null ? 0 : tgt.Count;
+
+ change.Append (" (");
+ for (int i = 0; i < Math.Max (srcCount, tgtCount); i++) {
+ if (i > 0)
+ change.Append (", ");
+
+ if (i >= srcCount) {
+ change.AppendAdded (tgt [i].GetTypeName ("type") + " " + tgt [i].GetAttribute ("name"), true);
+ } else if (i >= tgtCount) {
+ change.AppendRemoved (src [i].GetTypeName ("type") + " " + src [i].GetAttribute ("name"), true);
+ } else {
+ var paramSourceType = src [i].GetTypeName ("type");
+ var paramTargetType = tgt [i].GetTypeName ("type");
+
+ var paramSourceName = src [i].GetAttribute ("name");
+ var paramTargetName = tgt [i].GetAttribute ("name");
+
+ if (paramSourceType != paramTargetType) {
+ change.AppendModified (paramSourceType, paramTargetType, true);
+ } else {
+ change.Append (paramSourceType);
+ }
+ change.Append (" ");
+ if (paramSourceName != paramTargetName) {
+ change.AppendModified (paramSourceName, paramTargetName, false);
+ } else {
+ change.Append (paramSourceName);
+ }
+
+ var optSource = src [i].Attribute ("optional");
+ var optTarget = tgt [i].Attribute ("optional");
+ var srcValue = FormatValue (paramSourceType, src [i].GetAttribute ("defaultValue"));
+ var tgtValue = FormatValue (paramTargetType, tgt [i].GetAttribute ("defaultValue"));
+
+ if (optSource != null) {
+ if (optTarget != null) {
+ change.Append (" = ");
+ if (srcValue != tgtValue) {
+ change.AppendModified (srcValue, tgtValue, false);
+ } else {
+ change.Append (tgtValue);
+ }
+ } else {
+ change.AppendRemoved (" = " + srcValue);
+ }
+ } else {
+ if (optTarget != null)
+ change.AppendAdded (" = " + tgtValue);
+ }
+ }
+ }
+
+ change.Append (")");
+
+ // Ignore any parameter name changes if requested.
+ if (State.IgnoreParameterNameChanges && !change.Breaking) {
+ change.AnyChange = false;
+ change.HasIgnoredChanges = true;
+ }
+ }
+
+ void RenderVTable (MethodAttributes source, MethodAttributes target, ApiChange change)
+ {
+ var srcAbstract = (source & MethodAttributes.Abstract) == MethodAttributes.Abstract;
+ var tgtAbstract = (target & MethodAttributes.Abstract) == MethodAttributes.Abstract;
+ var srcFinal = (source & MethodAttributes.Final) == MethodAttributes.Final;
+ var tgtFinal = (target & MethodAttributes.Final) == MethodAttributes.Final;
+ var srcVirtual = (source & MethodAttributes.Virtual) == MethodAttributes.Virtual;
+ var tgtVirtual = (target & MethodAttributes.Virtual) == MethodAttributes.Virtual;
+ var srcOverride = (source & MethodAttributes.VtableLayoutMask) != MethodAttributes.NewSlot;
+ var tgtOverride = (target & MethodAttributes.VtableLayoutMask) != MethodAttributes.NewSlot;
+
+ var srcWord = srcVirtual ? (srcOverride ? "override" : "virtual") : string.Empty;
+ var tgtWord = tgtVirtual ? (tgtOverride ? "override" : "virtual") : string.Empty;
+ var breaking = srcWord.Length > 0 && tgtWord.Length == 0;
+
+ if (srcAbstract) {
+ if (tgtAbstract) {
+ change.Append ("abstract ");
+ } else if (tgtVirtual) {
+ change.AppendModified ("abstract", tgtWord, false).Append (" ");
+ } else {
+ change.AppendRemoved ("abstract").Append (" ");
+ }
+ } else {
+ if (tgtAbstract) {
+ change.AppendAdded ("abstract", true).Append (" ");
+ } else if (srcWord != tgtWord) {
+ if (!tgtFinal)
+ change.AppendModified (srcWord, tgtWord, breaking).Append (" ");
+ } else if (tgtWord.Length > 0) {
+ change.Append (tgtWord).Append (" ");
+ } else if (srcWord.Length > 0) {
+ change.AppendRemoved (srcWord, breaking).Append (" ");
+ }
+ }
+
+ if (srcFinal) {
+ if (tgtFinal) {
+ change.Append ("final ");
+ } else {
+ change.AppendRemoved ("final", false).Append (" "); // removing 'final' is not a breaking change.
+ }
+ } else {
+ if (tgtFinal && srcVirtual) {
+ change.AppendModified ("virtual", "final", true).Append (" "); // adding 'final' is a breaking change if the member was virtual
+ }
+ }
+
+ if (!srcVirtual && !srcFinal && tgtVirtual && tgtFinal) {
+ // existing member implements a member from a new interface
+ // this would show up as 'virtual final', which is redundant, so show nothing at all.
+ change.HasIgnoredChanges = true;
+ }
+
+ // Ignore non-breaking virtual changes.
+ if (State.IgnoreVirtualChanges && !change.Breaking) {
+ change.AnyChange = false;
+ change.HasIgnoredChanges = true;
+ }
+
+ var tgtSecurity = (source & MethodAttributes.HasSecurity) == MethodAttributes.HasSecurity;
+ var srcSecurity = (target & MethodAttributes.HasSecurity) == MethodAttributes.HasSecurity;
+
+ if (tgtSecurity != srcSecurity)
+ change.HasIgnoredChanges = true;
+
+ var srcPInvoke = (source & MethodAttributes.PinvokeImpl) == MethodAttributes.PinvokeImpl;
+ var tgtPInvoke = (target & MethodAttributes.PinvokeImpl) == MethodAttributes.PinvokeImpl;
+ if (srcPInvoke != tgtPInvoke)
+ change.HasIgnoredChanges = true;
+ }
+
+ protected string GetVisibility (MethodAttributes attr)
+ {
+ switch (attr) {
+ case MethodAttributes.Private:
+ case MethodAttributes.PrivateScope:
+ return "private";
+ case MethodAttributes.Assembly:
+ return "internal";
+ case MethodAttributes.FamANDAssem:
+ return "private internal";
+ case MethodAttributes.FamORAssem:
+ return "protected"; // customers don't care about 'internal';
+ case MethodAttributes.Family:
+ return "protected";
+ case MethodAttributes.Public:
+ return "public";
+ default:
+ throw new NotImplementedException ();
+ }
+ }
+
+ protected void RenderVisibility (MethodAttributes source, MethodAttributes target, ApiChange diff)
+ {
+ source = source & MethodAttributes.MemberAccessMask;
+ target = target & MethodAttributes.MemberAccessMask;
+
+ if (source == target) {
+ diff.Append (GetVisibility (target));
+ } else {
+ var breaking = false;
+ switch (source) {
+ case MethodAttributes.Private:
+ case MethodAttributes.Assembly:
+ case MethodAttributes.FamANDAssem:
+ break; // these are not publicly visible, thus not breaking
+ case MethodAttributes.FamORAssem:
+ case MethodAttributes.Family:
+ switch (target) {
+ case MethodAttributes.Public:
+ // to public is not a breaking change
+ break;
+ case MethodAttributes.Family:
+ case MethodAttributes.FamORAssem:
+ // not a breaking change, but should still show up in diff
+ break;
+ default:
+ // anything else is a breaking change
+ breaking = true;
+ break;
+ }
+ break;
+ case MethodAttributes.Public:
+ default:
+ // any change from public is breaking.
+ breaking = true;
+ break;
+ }
+
+ diff.AppendModified (GetVisibility (source), GetVisibility (target), breaking);
+ }
+ diff.Append (" ");
+ }
+
+ protected void RenderStatic (MethodAttributes src, MethodAttributes tgt, ApiChange diff)
+ {
+ var srcStatic = (src & MethodAttributes.Static) == MethodAttributes.Static;
+ var tgtStatic = (tgt & MethodAttributes.Static) == MethodAttributes.Static;
+
+ if (srcStatic != tgtStatic) {
+ if (srcStatic) {
+ diff.AppendRemoved ("static", true).Append (" ");
+ } else {
+ diff.AppendAdded ("static", true).Append (" ");
+ }
+ }
+ }
+
+ protected void RenderMethodAttributes (MethodAttributes src, MethodAttributes tgt, ApiChange diff)
+ {
+ RenderStatic (src, tgt, diff);
+ RenderVisibility (src & MethodAttributes.MemberAccessMask, tgt & MethodAttributes.MemberAccessMask, diff);
+ RenderVTable (src, tgt, diff);
+ }
+
+ protected void RenderMethodAttributes (XElement source, XElement target, ApiChange diff)
+ {
+ RenderMethodAttributes (source.GetMethodAttributes (), target.GetMethodAttributes (), diff);
+ }
+
+ protected void RemoveAttributes (XElement element)
+ {
+ var srcAttributes = element.Element ("attributes");
+ if (srcAttributes != null)
+ srcAttributes.Remove ();
+
+ foreach (var el in element.Elements ())
+ RemoveAttributes (el);
+ }
+
+ protected void RenderAttributes (XElement source, XElement target, ApiChanges changes)
+ {
+ var srcObsolete = source.GetObsoleteMessage ();
+ var tgtObsolete = target.GetObsoleteMessage ();
+
+ if (srcObsolete == tgtObsolete)
+ return; // nothing changed
+
+ if (srcObsolete == null) {
+ if (tgtObsolete == null)
+ return; // neither is obsolete
+ var change = new ApiChange ();
+ change.Header = "Obsoleted " + GroupName;
+ change.Append (string.Format ("<span class='obsolete obsolete-{0}' data-is-non-breaking>", ElementName));
+ change.Append ("[Obsolete (");
+ if (tgtObsolete != string.Empty)
+ change.Append ("\"").Append (tgtObsolete).Append ("\"");
+ change.Append (")]\n");
+ change.Append (GetDescription (target));
+ change.Append ("</span>");
+ change.AnyChange = true;
+ changes.Add (source, target, change);
+ } else if (tgtObsolete == null) {
+ // Made non-obsolete. Do we care to report this?
+ } else {
+ // Obsolete message changed. Do we care to report this?
+ }
+ }
+
+ protected void RenderName (XElement source, XElement target, ApiChange change)
+ {
+ var name = target.GetAttribute ("name");
+ // show the constructor as it would be defined in C#
+ name = name.Replace (".ctor", State.Type);
+
+ var p = name.IndexOf ('(');
+ if (p >= 0)
+ name = name.Substring (0, p);
+
+ change.Append (name);
+ }
+
+ }
+}
--- /dev/null
+//
+// Authors
+// Sebastien Pouliot <sebastien@xamarin.com>
+//
+// Copyright 2013 Xamarin Inc. http://www.xamarin.com
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+using System.Linq;
+using System.Reflection;
+using System.Xml.Linq;
+
+namespace Xamarin.ApiDiff {
+
+ public class MethodComparer : ConstructorComparer {
+
+ public override string GroupName {
+ get { return "methods"; }
+ }
+
+ public override string ElementName {
+ get { return "method"; }
+ }
+
+ // operators have identical names but vary by return types
+ public override bool Find (XElement e)
+ {
+ if (e.GetAttribute ("name") != Source.GetAttribute ("name"))
+ return false;
+
+ if (e.GetAttribute ("returntype") != Source.GetAttribute ("returntype"))
+ return false;
+
+ var eGP = e.Element ("generic-parameters");
+ var sGP = Source.Element ("generic-parameters");
+
+ if (eGP == null && sGP == null)
+ return true;
+ else if (eGP == null ^ sGP == null)
+ return false;
+ else {
+ var eGPs = eGP.Elements ("generic-parameter");
+ var sGPs = sGP.Elements ("generic-parameter");
+ return eGPs.Count () == sGPs.Count ();
+ }
+ }
+
+ protected override bool IsBreakingRemoval (XElement e)
+ {
+ // Removing virtual methods that override another method is not a breaking change.
+ var is_override = e.Attribute ("is-override");
+ if (is_override != null)
+ return is_override.Value != "true";
+
+ return true; // all other removals are breaking changes
+ }
+ }
+}
\ No newline at end of file
--- /dev/null
+//
+// Authors
+// Sebastien Pouliot <sebastien@xamarin.com>
+//
+// Copyright 2013 Xamarin Inc. http://www.xamarin.com
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+using System.Collections.Generic;
+using System.IO;
+using System.Linq;
+using System.Xml.Linq;
+
+namespace Xamarin.ApiDiff {
+
+ public class NamespaceComparer : Comparer {
+
+ ClassComparer comparer;
+
+ public NamespaceComparer ()
+ {
+ comparer = new ClassComparer ();
+ }
+
+ public void Compare (XElement source, XElement target)
+ {
+ var s = source.Element ("namespaces");
+ var t = target.Element ("namespaces");
+ if (XNode.DeepEquals (s, t))
+ return;
+ Compare (s.Elements ("namespace"), t.Elements ("namespace"));
+ }
+
+ public override void SetContext (XElement current)
+ {
+ State.Namespace = current.Attribute ("name").Value;
+ }
+
+ public override void Added (XElement target, bool wasParentAdded)
+ {
+ string name = target.Attribute ("name").Value;
+ if (State.IgnoreNew.Any (re => re.IsMatch (name)))
+ return;
+
+ Output.WriteLine ("<!-- start namespace {0} --> <div> ", name);
+ Output.WriteLine ("<h2>New Namespace {0}</h2>", name);
+ Output.WriteLine ();
+ // list all new types
+ foreach (var addedType in target.Element ("classes").Elements ("class"))
+ comparer.Added (addedType, true);
+ Output.WriteLine ("</div> <!-- end namespace {0} -->", name);
+ Output.WriteLine ();
+ }
+
+ public override void Modified (XElement source, XElement target, ApiChanges differences)
+ {
+ var output = Output;
+ State.Output = new StringWriter ();
+ comparer.Compare (source, target);
+
+ var s = Output.ToString ();
+ State.Output = output;
+ if (s.Length > 0) {
+ var name = target.Attribute ("name").Value;
+ Output.WriteLine ("<!-- start namespace {0} --> <div> ", name);
+ Output.WriteLine ("<h2>Namespace {0}</h2>", name);
+ Output.WriteLine (s);
+ Output.WriteLine ("</div> <!-- end namespace {0} -->", name);
+ }
+ }
+
+ public override void Removed (XElement source)
+ {
+ var name = source.Attribute ("name").Value;
+ Output.WriteLine ("<!-- start namespace {0} --> <div>", name);
+ Output.WriteLine ("<h2>Removed Namespace {0}</h2>", name);
+ Output.WriteLine ();
+ // list all removed types
+ foreach (var removedType in source.Element ("classes").Elements ("class"))
+ comparer.Removed (removedType);
+ Output.WriteLine ("</div> <!-- end namespace {0} -->", name);
+ Output.WriteLine ();
+ }
+ }
+}
\ No newline at end of file
--- /dev/null
+//
+// Authors
+// Sebastien Pouliot <sebastien@xamarin.com>
+//
+// Copyright 2013 Xamarin Inc. http://www.xamarin.com
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+using System.Collections.Generic;
+using System.Reflection;
+using System.Text;
+using System.Xml.Linq;
+
+namespace Xamarin.ApiDiff {
+
+ public class PropertyComparer : MemberComparer {
+
+ public override string GroupName {
+ get { return "properties"; }
+ }
+
+ public override string ElementName {
+ get { return "property"; }
+ }
+
+ public override bool Find (XElement e)
+ {
+ if (!base.Find (e))
+ return false;
+ // the same Item (indexer) property can have different parameters
+ return e.GetAttribute ("params") == Source.GetAttribute ("params");
+ }
+
+ void GetAccessors (XElement element, out XElement getter, out XElement setter)
+ {
+ var methods = element.Element ("methods");
+
+ getter = null;
+ setter = null;
+
+ if (methods == null)
+ return;
+
+ foreach (var m in methods.Elements ("method")) {
+ var n = m.GetAttribute ("name");
+ if (n.StartsWith ("get_", StringComparison.Ordinal)) {
+ getter = m;
+ } else if (n.StartsWith ("set_", StringComparison.Ordinal)) {
+ setter = m;
+ }
+ }
+ }
+
+ MethodAttributes GetMethodAttributes (XElement getter, XElement setter)
+ {
+ if (getter == null)
+ return setter.GetMethodAttributes ();
+ else if (setter == null)
+ return getter.GetMethodAttributes ();
+
+ var gAttr = getter.GetMethodAttributes ();
+ var sAttr = setter.GetMethodAttributes ();
+ var g = gAttr & MethodAttributes.MemberAccessMask;
+ var s = sAttr & MethodAttributes.MemberAccessMask;
+ // Visibility is ordered numerically (higher value = more visible).
+ // We want the most visible.
+ var visibility = (MethodAttributes) Math.Max ((int) g, (int) s);
+ // Do a bitwise or with the rest of the flags
+ var g_no_visibility = gAttr & ~MethodAttributes.MemberAccessMask;
+ var s_no_visibility = sAttr & ~MethodAttributes.MemberAccessMask;
+ return g_no_visibility | s_no_visibility | visibility;
+ }
+
+ void RenderPropertyType (XElement source, XElement target, ApiChange change)
+ {
+ var srcType = source.GetTypeName ("ptype");
+ var tgtType = target.GetTypeName ("ptype");
+
+ if (srcType == tgtType) {
+ change.Append (tgtType);
+ } else {
+ change.AppendModified (srcType, tgtType, true);
+ }
+ change.Append (" ");
+ }
+
+ void RenderAccessors (XElement srcGetter, XElement tgtGetter, XElement srcSetter, XElement tgtSetter, ApiChange change)
+ {
+ // FIXME: this doesn't render changes in the accessor visibility (a protected setter can become public for instance).
+ change.Append (" {");
+ if (tgtGetter != null) {
+ if (srcGetter != null) {
+ change.Append (" ").Append ("get;");
+ } else {
+ change.Append (" ").AppendAdded ("get;");
+ }
+ } else if (srcGetter != null) {
+ change.Append (" ").AppendRemoved ("get;");
+ }
+
+ if (tgtSetter != null) {
+ if (srcSetter != null) {
+ change.Append (" ").Append ("set;");
+ } else {
+ change.Append (" ").AppendAdded ("set;");
+ }
+ } else if (srcSetter != null) {
+ change.Append (" ").AppendRemoved ("set;");
+ }
+
+ change.Append (" }");
+
+ // Ignore added property setters if asked to
+ if (srcSetter == null && tgtSetter != null && State.IgnoreAddedPropertySetters && !change.Breaking) {
+ change.AnyChange = false;
+ change.HasIgnoredChanges = true;
+ }
+ }
+
+ void RenderIndexers (List<XElement> srcIndexers, List<XElement> tgtIndexers, ApiChange change)
+ {
+ change.Append ("this [");
+ for (int i = 0; i < srcIndexers.Count; i++) {
+ var source = srcIndexers [i];
+ var target = tgtIndexers [i];
+
+ if (i > 0)
+ change.Append (", ");
+
+ var srcType = source.GetTypeName ("type");
+ var tgtType = target.GetTypeName ("type");
+ if (srcType == tgtType) {
+ change.Append (tgtType);
+ } else {
+ change.AppendModified (srcType, tgtType, true);
+ }
+ change.Append (" ");
+
+ var srcName = source.GetAttribute ("name");
+ var tgtName = target.GetAttribute ("name");
+ if (srcName == tgtName) {
+ change.Append (tgtName);
+ } else {
+ change.AppendModified (srcName, tgtName, true);
+ }
+ }
+ change.Append ("]");
+ }
+
+ public override bool Equals (XElement source, XElement target, ApiChanges changes)
+ {
+ if (base.Equals (source, target, changes))
+ return true;
+
+ XElement srcGetter, srcSetter;
+ XElement tgtGetter, tgtSetter;
+ GetAccessors (source, out srcGetter, out srcSetter);
+ GetAccessors (target, out tgtGetter, out tgtSetter);
+
+ List<XElement> srcIndexers = null;
+ List<XElement> tgtIndexers = null;
+ bool isIndexer = false;
+ if (srcGetter != null) {
+ srcIndexers = srcGetter.DescendantList ("parameters", "parameter");
+ tgtIndexers = tgtGetter.DescendantList ("parameters", "parameter");
+ isIndexer = srcIndexers != null && srcIndexers.Count > 0;
+ }
+
+ var change = new ApiChange ();
+ change.Header = "Modified " + GroupName;
+ RenderMethodAttributes (GetMethodAttributes (srcGetter, srcSetter), GetMethodAttributes (tgtGetter, tgtSetter), change);
+ RenderPropertyType (source, target, change);
+ if (isIndexer) {
+ RenderIndexers (srcIndexers, tgtIndexers, change);
+ } else {
+ RenderName (source, target, change);
+ }
+ RenderGenericParameters (source, target, change);
+ RenderAccessors (srcGetter, tgtGetter, srcSetter, tgtSetter, change);
+
+ changes.Add (source, target, change);
+
+ return false;
+ }
+
+ void GetProperties (XElement e, out bool @virtual, out bool @override, out bool @static, out bool getter, out bool setter, out bool family)
+ {
+ @virtual = @override = @static = getter = setter = family = false;
+
+ var methods = e.Element ("methods");
+ if (methods != null) {
+ foreach (var m in methods.Elements ("method")) {
+ @virtual |= m.IsTrue ("virtual");
+ @static |= m.IsTrue ("static");
+ var n = m.GetAttribute ("name");
+ getter |= n.StartsWith ("get_", StringComparison.Ordinal);
+ setter |= n.StartsWith ("set_", StringComparison.Ordinal);
+ var attribs = (MethodAttributes) Int32.Parse (m.GetAttribute ("attrib"));
+ family = ((attribs & MethodAttributes.Public) != MethodAttributes.Public);
+ @override |= (attribs & MethodAttributes.NewSlot) == 0;
+ }
+ }
+ }
+
+ public override string GetDescription (XElement e)
+ {
+ string name = e.Attribute ("name").Value;
+ string ptype = e.GetTypeName ("ptype");
+
+ bool virt = false;
+ bool over = false;
+ bool stat = false;
+ bool getter = false;
+ bool setter = false;
+ bool family = false;
+ GetProperties (e, out virt, out over, out stat, out getter, out setter, out family);
+
+ var sb = new StringBuilder ();
+
+ sb.Append (family ? "protected " : "public ");
+ if (virt && !State.IgnoreVirtualChanges)
+ sb.Append (over ? "override " : "virtual ");
+ else if (stat)
+ sb.Append ("static ");
+ sb.Append (ptype).Append (' ').Append (name).Append (" { ");
+ if (getter)
+ sb.Append ("get; ");
+ if (setter)
+ sb.Append ("set; ");
+ sb.Append ("}");
+
+ return sb.ToString ();
+ }
+ }
+}
\ No newline at end of file
--- /dev/null
+<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <PropertyGroup>
+ <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+ <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+ <ProductVersion>8.0.30703</ProductVersion>
+ <SchemaVersion>2.0</SchemaVersion>
+ <ProjectGuid>{D25986E2-7A41-4966-A26D-5614BAC7B8A7}</ProjectGuid>
+ <OutputType>Exe</OutputType>
+ <RootNamespace>Xamarin.ApiDiff</RootNamespace>
+ <AssemblyName>mono-api-html</AssemblyName>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+ <DebugSymbols>true</DebugSymbols>
+ <DebugType>full</DebugType>
+ <Optimize>false</Optimize>
+ <OutputPath>bin\Debug</OutputPath>
+ <DefineConstants>DEBUG;</DefineConstants>
+ <ErrorReport>prompt</ErrorReport>
+ <WarningLevel>4</WarningLevel>
+ <ConsolePause>false</ConsolePause>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+ <DebugType>full</DebugType>
+ <Optimize>true</Optimize>
+ <OutputPath>bin\Release</OutputPath>
+ <ErrorReport>prompt</ErrorReport>
+ <WarningLevel>4</WarningLevel>
+ <Externalconsole>true</Externalconsole>
+ </PropertyGroup>
+ <ItemGroup>
+ <Reference Include="System" />
+ <Reference Include="System.Xml.Linq" />
+ <Reference Include="System.Xml" />
+ <Reference Include="System.Core" />
+ </ItemGroup>
+ <ItemGroup>
+ <Compile Include="Helpers.cs" />
+ <Compile Include="InterfaceComparer.cs" />
+ <Compile Include="NamespaceComparer.cs" />
+ <Compile Include="MemberComparer.cs" />
+ <Compile Include="FieldComparer.cs" />
+ <Compile Include="PropertyComparer.cs" />
+ <Compile Include="EventComparer.cs" />
+ <Compile Include="MethodComparer.cs" />
+ <Compile Include="ConstructorComparer.cs" />
+ <Compile Include="Comparer.cs" />
+ <Compile Include="AssemblyComparer.cs" />
+ <Compile Include="ClassComparer.cs" />
+ <Compile Include="ApiDiff.cs" />
+ <Compile Include="..\..\..\class\Mono.Options\Mono.Options\Options.cs">
+ <Link>Options.cs</Link>
+ </Compile>
+ <Compile Include="ApiChange.cs" />
+ </ItemGroup>
+ <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
+</Project>
--- /dev/null
+ApiChange.cs
+ApiDiff.cs
+AssemblyComparer.cs
+ClassComparer.cs
+Comparer.cs
+ConstructorComparer.cs
+EventComparer.cs
+FieldComparer.cs
+Helpers.cs
+InterfaceComparer.cs
+MemberComparer.cs
+MethodComparer.cs
+NamespaceComparer.cs
+PropertyComparer.cs
+../../class/Mono.Options/Mono.Options/Options.cs
SUBDIRS =
include ../../../build/rules.make
-LOCAL_MCS_FLAGS = -r:Mono.Security.dll \
- -r:System.Security.dll \
- -r:System.Configuration.dll \
- -r:System.dll \
- -r:$(topdir)/class/lib/$(PROFILE)/Mono.Configuration.Crypto.dll
+LOCAL_MCS_FLAGS =
+LIB_REFS = Mono.Security System.Security System.Configuration System Mono.Configuration.Crypto
PROGRAM = mono-configuration-crypto.exe
PROGRAM_INSTALL_DIR = $(mono_libdir)/mono/mono-configuration-crypto/$(FRAMEWORK_VERSION)
SUBDIRS =
include ../../../build/rules.make
-LOCAL_MCS_FLAGS = -r:System.dll -r:Mono.Security.dll -r:System.Security.dll -r:System.Configuration.dll -r:System.Xml.dll
+LOCAL_MCS_FLAGS =
+LIB_REFS = System Mono.Security System.Security System.Configuration System.Xml
LIBRARY = Mono.Configuration.Crypto.dll
LIBRARY_INSTALL_DIR = $(mono_libdir)/mono/mono-configuration-crypto/$(FRAMEWORK_VERSION)
PROGRAM = mono-service.exe
+PROGRAM_SNK = ../../class/mono.snk
+
include ../../build/executable.make
-LOCAL_MCS_FLAGS = -r:System.ServiceProcess.dll -r:Mono.Posix.dll -r:System.dll -unsafe
+LOCAL_MCS_FLAGS = -unsafe -publicsign
+LIB_REFS = System.ServiceProcess Mono.Posix System
# Copied from library.make
SUBDIRS =
include ../../build/rules.make
-LOCAL_MCS_FLAGS = -r:Mono.Posix.dll -r:System.dll -r:System.Xml.dll
+LOCAL_MCS_FLAGS =
+LIB_REFS = Mono.Posix System System.Xml
PROGRAM = mono-shlib-cop.exe
PROGRAM = mono-symbolicate.exe
-LOCAL_MCS_FLAGS = \
- /r:Mono.Cecil.dll \
- /r:Mono.CompilerServices.SymbolWriter.dll \
- /r:System.Xml.dll \
- /r:System.Core.dll \
- /r:System.dll
+LOCAL_MCS_FLAGS =
+
+LIB_REFS = Mono.Cecil Mono.CompilerServices.SymbolWriter System.Xml System.Core System
include ../../build/executable.make
exit 1; \
fi
-BUILD_TEST_EXE = @\
+BUILD_TEST_EXE = \
rm -rf $(OUT_DIR); \
mkdir -p $(OUT_DIR); \
- $(MCS) -debug $(TEST_CS) -out:$(TEST_EXE)
+ $(CSCOMPILE) $(TEST_CS) -out:$(TEST_EXE)
check: test-local
SUBDIRS =
include ../../build/rules.make
-LOCAL_MCS_FLAGS = -r:System.Xml.dll -r:Commons.Xml.Relaxng.dll
+LOCAL_MCS_FLAGS =
+LIB_REFS = System.Xml Commons.Xml.Relaxng
PROGRAM = mono-xmltool.exe
include ../../build/executable.make
SUBDIRS =
include ../../build/rules.make
-LOCAL_MCS_FLAGS = -r:System.Xml.dll -r:System.Data.dll -r:System.dll
+LOCAL_MCS_FLAGS =
+LIB_REFS = System.Xml System.Data System
PROGRAM = xsd.exe
include ../../build/executable.make
include ../../build/rules.make
PROGRAM = monop.exe
-LOCAL_MCS_FLAGS += -d:NO_AUTHENTICODE,STATIC,NO_SYMBOL_WRITER -r:System.dll
+LOCAL_MCS_FLAGS += -d:NO_AUTHENTICODE,STATIC,NO_SYMBOL_WRITER
+LIB_REFS = System
CLEAN_FILES = monop.exe monop2.exe *.mdb
include ../../build/rules.make
NO_TESTS = yes
-BUILD_FRAMEWORK = Microsoft.Build.Framework.dll
-BUILD_NEW_ENGINE = Microsoft.Build.dll
+BUILD_FRAMEWORK = Microsoft.Build.Framework
+BUILD_NEW_ENGINE = Microsoft.Build
INSTALL_FRAMEWORK_VERSION = $(FRAMEWORK_VERSION)
include ../xbuild/xbuild.make
ifeq (4, $(FRAMEWORK_VERSION_MAJOR))
NAME_SUFFIX = .v4.0
ASSEMBLY_VERSION = 4.0.0.0
-BUILD_FRAMEWORK := $(topdir)/class/lib/$(PROFILE)/$(BUILD_FRAMEWORK)
-BUILD_NEW_ENGINE := $(topdir)/class/lib/$(PROFILE)/$(BUILD_NEW_ENGINE)
INSTALL_FRAMEWORK_VERSION = 4.0
endif
endif
-LOCAL_MCS_FLAGS = -r:$(BUILD_FRAMEWORK) -r:$(BUILD_NEW_ENGINE)
+LOCAL_MCS_FLAGS =
+LIB_REFS = $(BUILD_FRAMEWORK) $(BUILD_NEW_ENGINE)
PROGRAM = msbuild.exe
include ../../build/executable.make
LIBRARY = nunitlite.dll
LIBRARY_SNK = ../../../../external/nunit-lite/NUnitLite-1.0.0/src/framework/nunit.snk
-LOCAL_MCS_FLAGS= /target:library /define:"__MOBILE__;TRACE;DEBUG;NET_4_0;CLR_4_0,NUNITLITE" /nostdlib -r:System.dll -r:System.Xml.dll -r:System.Core.dll -r:mscorlib.dll /warn:4 /noconfig /debug:full /debug+ /keyfile:$(LIBRARY_SNK) /optimize
+LOCAL_MCS_FLAGS= /target:library /define:"__MOBILE__;TRACE;DEBUG;NET_4_0;CLR_4_0,NUNITLITE" /warn:4 /keyfile:$(LIBRARY_SNK)
+LIB_REFS = System System.Xml System.Core
NO_TEST = yes
include ../../../build/rules.make
PROGRAM = nunit-lite-console.exe
-LOCAL_MCS_FLAGS = /r:nunitlite.dll
+LIB_REFS = nunitlite
+LOCAL_MCS_FLAGS =
include ../../../build/executable.make
NO_INSTALL = 1
include ../../build/rules.make
-LOCAL_MCS_FLAGS = -r:System.Xml.dll
+LOCAL_MCS_FLAGS =
+LIB_REFS = System.Xml
EXTRA_DISTFILES = \
Media/*.png \
PROGRAM = pdb2mdb.exe
-LOCAL_MCS_FLAGS = \
- /r:Mono.Cecil.dll \
- /r:Mono.CompilerServices.SymbolWriter.dll \
- /r:System.Core.dll
+LOCAL_MCS_FLAGS =
+LIB_REFS = Mono.Cecil Mono.CompilerServices.SymbolWriter System.Core
EXTRA_DISTFILES = LICENSE
CLEAN_FILES = resgen.exe
-LOCAL_MCS_FLAGS = -r:System.dll -r:System.Xml.dll -r:System.Core.dll
+LIB_REFS = System System.Xml System.Core
INSTALL_PROFILE := $(filter $(DEFAULT_PROFILE), $(PROFILE))
ifndef INSTALL_PROFILE
DIST_ONLY_SUBDIRS = certview
include ../../build/rules.make
-LOCAL_MCS_FLAGS = /lib:$(topdir)/class/lib/$(PROFILE) -r:Mono.Security.dll -r:System.dll
+LOCAL_MCS_FLAGS =
+LIB_REFS = Mono.Security System
SECURITY_PROGRAMS = secutil.exe cert2spc.exe sn.exe makecert.exe chktrust.exe crlupdate.exe \
signcode.exe setreg.exe certmgr.exe caspol.exe permview.exe mozroots.exe cert-sync.exe
dist-local: dist-default
sn.exe $(topdir)/class/lib/$(PROFILE)/sn.exe: $(SN_SOURCES)
- $(CSCOMPILE) /out:$@ $(SN_SOURCES)
+ $(CSCOMPILE) -r:$(topdir)/class/lib/$(PROFILE)/Mono.Security.dll /out:$@ $(SN_SOURCES)
permview.exe: permview.cs
- $(CSCOMPILE) $^ $(HELPER_SOURCES) -r:Mono.Cecil.dll
+ $(CSCOMPILE) $^ $(HELPER_SOURCES) -r:$(topdir)/class/lib/$(PROFILE)/Mono.Cecil.dll
%.exe: %.cs $(HELPER_SOURCES)
- $(CSCOMPILE) $^
+ $(CSCOMPILE) -r:$(topdir)/class/lib/$(PROFILE)/Mono.Security.dll -r:$(topdir)/class/lib/$(PROFILE)/System.dll $^
include ../../../build/rules.make
RESGEN = resgen
-LOCAL_MCS_FLAGS = /lib:$(topdir)/class/lib /r:Mono.Security.dll /r:System.Xml.dll /win32icon:mono.ico
+LIB_REFS = Mono.Security System.Xml
+LOCAL_MCS_FLAGS = /win32icon:mono.ico
# SWF isn't quite good enough to build this yet.
SUBDIRS =
include ../../build/rules.make
-LOCAL_MCS_FLAGS = -r:System.Xml.dll -r:System.dll
+LOCAL_MCS_FLAGS =
+LIB_REFS = System.Xml System
PROGRAM = sgen.exe
include ../../build/executable.make
SUBDIRS =
include ../../build/rules.make
-LOCAL_MCS_FLAGS = -r:System.Runtime.Remoting.dll -r:System.dll
+LOCAL_MCS_FLAGS =
+LIB_REFS = System.Runtime.Remoting System
PROGRAM = soapsuds.exe
include ../../build/executable.make
-resource:$(dbmetal_src)/Language/EnglishWords.txt,$(ns).EnglishWords.txt \
-resource:$(dbmetal_src)/Language/FrenchWords.txt,$(ns).FrenchWords.txt \
-resource:$(dbmetal_src)/Language/GermanWords.txt,$(ns).GermanWords.txt \
- -r:System.Configuration.dll \
- -r:System.Core.dll \
- -r:System.Data.dll \
- -r:System.Data.Linq.dll \
- -r:System.Xml.dll \
- -r:System.dll
+ -publicsign
+LIB_REFS = System.Configuration System.Core System.Data System.Data.Linq System.Xml System
+
SQLMETAL_RESOURCES = \
$(dbmetal_src)/Language/EnglishWords.txt \
$(dbmetal_src)/Language/FrenchWords.txt \
$(dbmetal_src)/Language/GermanWords.txt
-SQLMETAL_TEST_FILES = \
- Test/AssemblyInfo.cs
-
EXTRA_DISTFILES = \
- $(SQLMETAL_RESOURCES) \
- $(SQLMETAL_TEST_FILES)
+ $(SQLMETAL_RESOURCES)
PROGRAM = sqlmetal.exe
$(PROGRAM) : Makefile $(SQLMETAL_RESOURCES)
-HAS_NUNIT_TEST = yes
-
include ../../build/executable.make
+++ /dev/null
-/AssemblyInfo.cs -crlf
+++ /dev/null
-//\r
-// AssemblyInfo.cs\r
-//\r
-// Author:\r
-// Jonathan Pryor <jpryor@novell.com>\r
-//\r
-// Copyright (C) 2009 Novell, Inc.\r
-//\r
-\r
-//\r
-// Permission is hereby granted, free of charge, to any person obtaining\r
-// a copy of this software and associated documentation files (the\r
-// "Software"), to deal in the Software without restriction, including\r
-// without limitation the rights to use, copy, modify, merge, publish,\r
-// distribute, sublicense, and/or sell copies of the Software, and to\r
-// permit persons to whom the Software is furnished to do so, subject to\r
-// the following conditions:\r
-// \r
-// The above copyright notice and this permission notice shall be\r
-// included in all copies or substantial portions of the Software.\r
-// \r
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,\r
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\r
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\r
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\r
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\r
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\r
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r
-//\r
-\r
-using System;\r
-using System.Reflection;\r
-using System.Runtime.CompilerServices;\r
-\r
-[assembly: AssemblyTitle ("sqlmetal_test")]\r
-[assembly: AssemblyDescription ("sqlmetal.exe Unit Tests")]\r
-[assembly: AssemblyDefaultAlias ("SqlMetal_test.dll")]\r
-\r
-[assembly: CLSCompliant (true)]\r
-\r
-// Unit tests needs access to the DbLinq internals\r
-\r
SUBDIRS =
include ../../build/rules.make
-LOCAL_MCS_FLAGS = -r:System.dll -r:System.Xml.dll -r:System.Data.dll
+LOCAL_MCS_FLAGS =
+LIB_REFS = System System.Xml System.Data
PROGRAM = sqlsharp.exe
EXTRA_DISTFILES = README
SUBDIRS =
include ../../build/rules.make
-LOCAL_MCS_FLAGS = \
- -r:System.Core.dll \
- -r:System.Runtime.Serialization.dll \
- -r:System.ServiceModel.dll \
- -r:System.Web.Services.dll \
- -r:System.Configuration.dll \
- -r:System.dll \
- -r:System.Xml.dll
+LOCAL_MCS_FLAGS =
+LIB_REFS = System.Core System.Runtime.Serialization System.ServiceModel System.Web.Services System.Configuration System System.Xml
PROGRAM = svcutil.exe
DEP_DIRS = linker
include ../../build/rules.make
-CECIL = $(topdir)/class/lib/$(PROFILE)/Mono.Cecil.dll
-LINKER = $(topdir)/class/lib/$(PROFILE)/monolinker.exe
-
-LOCAL_MCS_FLAGS = -r:System.dll -r:System.Core.dll -r:System.Xml.dll -r:$(LINKER) -r:$(CECIL)
+LOCAL_MCS_FLAGS = -r:$(topdir)/class/lib/$(PROFILE)/monolinker.exe
+LIB_REFS = System System.Core System.Xml Mono.Cecil
LIBRARY = Mono.Tuner.dll
PROGRAM = txt2sr.exe
+LIB_REFS = System
LOCAL_MCS_FLAGS =
include ../../build/executable.make
public bool ShowHelp { get; set; }
public bool Verbose { get; set; }
public List<string> ResourcesStrings { get; }
+ public bool IgnoreSemicolon { get; set; }
public CmdOptions ()
{
{ "h|help", "Display available options",
v => options.ShowHelp = v != null },
{ "v|verbose", "Use verbose output",
- v => options.Verbose = v != null },
+ v => options.Verbose = v != null },
+ { "ignore-semicolon", "Reads lines starting with semicolon",
+ v => options.IgnoreSemicolon = v != null },
};
List<string> extra;
foreach (var l in File.ReadLines (fileName)) {
var line = l.Trim ();
- if (line.Length == 0 || line [0] == '#' || line [0] == ';')
+ if (line.Length == 0 || line [0] == '#')
continue;
+ int start = 0;
+ if (line [0] == ';') {
+ if (!options.IgnoreSemicolon)
+ continue;
+
+ start = 1;
+ }
+
var epos = line.IndexOf ('=');
if (epos < 0)
continue;
- var key = line.Substring (0, epos).Trim ();
+ var key = line.Substring (start, epos - start).Trim ();
if (key.Contains (" "))
continue;
SUBDIRS =
include ../../build/rules.make
-LOCAL_MCS_FLAGS = -r:System.Xml.dll -r:System.Web.Services.dll -r:System.dll
+LOCAL_MCS_FLAGS =
+LIB_REFS = System.Xml System.Web.Services System
PROGRAM = wsdl.exe
include xbuild.make
-LOCAL_MCS_FLAGS = -r:$(XBUILD_FRAMEWORK) -r:$(XBUILD_UTILITIES) -r:$(XBUILD_ENGINE) -r:$(XBUILD_MSTASKS) -r:System.dll -r:System.Core.dll
+LOCAL_MCS_FLAGS =
+LIB_REFS = $(XBUILD_FRAMEWORK) $(XBUILD_UTILITIES) $(XBUILD_ENGINE) $(XBUILD_MSTASKS) $(PARENT_PROFILE)System $(PARENT_PROFILE)System.Core
PROGRAM = xbuild.exe
include ../../build/executable.make
if (solutionTarget.Configuration == targetInfo.Key.Configuration &&
solutionTarget.Platform == targetInfo.Key.Platform) {
solutionConfigurationContents.AppendFormat (
- "<ProjectConfiguration Project=\"{0}\">{1}|{2}</ProjectConfiguration>",
- guid.ToString ("B").ToUpper (), targetInfo.Value.Configuration, targetInfo.Value.Platform);
+ "<ProjectConfiguration Project=\"{0}\" AbsolutePath=\"{1}\">{2}|{3}</ProjectConfiguration>",
+ guid.ToString ("B").ToUpper (), projectInfo.FileName, targetInfo.Value.Configuration, targetInfo.Value.Platform);
}
}
}
NAME_SUFFIX = .Core
endif
-XBUILD_FRAMEWORK := $(topdir)/class/lib/$(PROFILE)/Microsoft.Build.Framework.dll
-XBUILD_ENGINE := $(topdir)/class/lib/$(PROFILE)/Microsoft.Build.Engine.dll
-XBUILD_UTILITIES := $(topdir)/class/lib/$(PROFILE)/Microsoft.Build.Utilities$(NAME_SUFFIX).dll
-XBUILD_TASKS := $(topdir)/class/lib/$(PROFILE)/Mono.XBuild.Tasks.dll
-XBUILD_MSTASKS := $(topdir)/class/lib/$(PROFILE)/Microsoft.Build.Tasks$(NAME_SUFFIX).dll
+XBUILD_FRAMEWORK := Microsoft.Build.Framework
+XBUILD_ENGINE := Microsoft.Build.Engine
+XBUILD_UTILITIES := Microsoft.Build.Utilities$(NAME_SUFFIX)
+XBUILD_TASKS := Mono.XBuild.Tasks
+XBUILD_MSTASKS := Microsoft.Build.Tasks$(NAME_SUFFIX)
ifeq (14.0, $(XBUILD_VERSION))
-XBUILD_MSTASKS := $(topdir)/class/lib/$(PROFILE)/Microsoft.Build.Tasks.Core.dll
+XBUILD_MSTASKS := Microsoft.Build.Tasks.Core
endif
XBUILD_ASSEMBLY_VERSION = $(XBUILD_VERSION).0.0
/* Force it to be attached to avoid racing during shutdown. */
thread = mono_thread_attach_full (mono_get_root_domain (), TRUE, &error);
mono_error_raise_exception (&error); /* FIXME don't raise here */
+ mono_thread_set_name_internal (thread->internal_thread, mono_string_new (mono_get_root_domain (), "Domain unloader"), TRUE, &error);
+ mono_error_raise_exception (&error); /* FIXME don't raise here */
/*
* FIXME: Abort our parent thread last, so we can return a failure
static guint32 WINAPI
receiver_thread (void *arg)
{
+ MonoError error;
int res, content_len;
guint8 buffer [256];
guint8 *p, *p_end;
MonoObject *exc;
+ mono_thread_info_set_name (mono_native_thread_id_get (), "Attach receiver");
+
printf ("attach: Listening on '%s'...\n", server_uri);
while (TRUE) {
printf ("attach: Connected.\n");
- mono_thread_attach (mono_get_root_domain ());
+ MonoThread *thread = mono_thread_attach (mono_get_root_domain ());
+ mono_thread_set_name_internal (thread->internal_thread, mono_string_new (mono_get_root_domain (), "Attach receiver"), TRUE, &error);
+ mono_error_assert_ok (&error);
/* Ask the runtime to not abort this thread */
//mono_thread_current ()->flags |= MONO_THREAD_FLAG_DONT_MANAGE;
/* Ask the runtime to not wait for this thread */
- mono_thread_internal_current ()->state |= ThreadState_Background;
+ thread->internal_thread->state |= ThreadState_Background;
while (TRUE) {
char *cmd, *agent_name, *agent_args;
gboolean no_raise;
} MonoJitICallInfo;
-typedef struct {
- guint8 exception_type;
- char *class_name; /* If kind == TYPE */
- char *assembly_name; /* If kind == TYPE or ASSEMBLY */
- MonoClass *klass; /* If kind != TYPE */
- const char *member_name; /* If kind != TYPE */
- gboolean ref_only; /* If kind == ASSEMBLY */
- char *msg; /* If kind == BAD_IMAGE */
-} MonoLoaderError;
-
void
mono_class_setup_supertypes (MonoClass *klass);
void
mono_loader_unlock_if_inited (void);
-void
-mono_loader_set_error_assembly_load (const char *assembly_name, gboolean ref_only);
-
-void
-mono_loader_set_error_type_load (const char *class_name, const char *assembly_name);
-
-void
-mono_loader_set_error_method_load (const char *class_name, const char *member_name);
-
-void
-mono_loader_set_error_field_load (MonoClass *klass, const char *member_name);
-void
-mono_loader_set_error_bad_image (char *msg);
-
-MonoException *
-mono_loader_error_prepare_exception (MonoLoaderError *error);
-
-MonoLoaderError *
-mono_loader_get_last_error (void);
-
-void
-mono_loader_clear_error (void);
-
-void
-mono_loader_assert_no_error (void);
-
void
mono_reflection_init (void);
done:
/* Generic case, should be avoided for when a better error is possible. */
if (!res && mono_error_ok (error)) {
- if (mono_loader_get_last_error ()) { /*FIXME plug the above to not leak errors*/
- mono_error_set_from_loader_error (error);
- } else {
- char *name = mono_class_name_from_token (image, type_token);
- char *assembly = mono_assembly_name_from_token (image, type_token);
- mono_error_set_type_load_name (error, name, assembly, "Could not resolve type with token %08x", type_token);
- }
+ char *name = mono_class_name_from_token (image, type_token);
+ char *assembly = mono_assembly_name_from_token (image, type_token);
+ mono_error_set_type_load_name (error, name, assembly, "Could not resolve type with token %08x", type_token);
}
- mono_loader_assert_no_error ();
return res;
}
mono_error_set_type_load_class (error, klass, "Could not find base type");
fail:
- mono_loader_assert_no_error ();
return NULL;
}
return s;
}
-static void
-set_failure_from_loader_error (MonoClass *klass, MonoLoaderError *error)
-{
- gpointer exception_data = NULL;
-
- switch (error->exception_type) {
- case MONO_EXCEPTION_TYPE_LOAD:
- exception_data = concat_two_strings_with_zero (klass->image, error->class_name, error->assembly_name);
- break;
-
- case MONO_EXCEPTION_MISSING_METHOD:
- exception_data = concat_two_strings_with_zero (klass->image, error->class_name, error->member_name);
- break;
-
- case MONO_EXCEPTION_MISSING_FIELD: {
- const char *name_space = error->klass->name_space ? error->klass->name_space : NULL;
- const char *class_name;
-
- if (name_space)
- class_name = g_strdup_printf ("%s.%s", name_space, error->klass->name);
- else
- class_name = error->klass->name;
-
- exception_data = concat_two_strings_with_zero (klass->image, class_name, error->member_name);
-
- if (name_space)
- g_free ((void*)class_name);
- break;
- }
-
- case MONO_EXCEPTION_FILE_NOT_FOUND: {
- const char *msg;
-
- if (error->ref_only)
- msg = "Cannot resolve dependency to assembly '%s' because it has not been preloaded. When using the ReflectionOnly APIs, dependent assemblies must be pre-loaded or loaded on demand through the ReflectionOnlyAssemblyResolve event.";
- else
- msg = "Could not load file or assembly '%s' or one of its dependencies.";
-
- exception_data = concat_two_strings_with_zero (klass->image, msg, error->assembly_name);
- break;
- }
-
- case MONO_EXCEPTION_BAD_IMAGE:
- exception_data = error->msg;
- break;
-
- default :
- g_assert_not_reached ();
- }
-
- mono_class_set_failure (klass, error->exception_type, exception_data);
-}
-
/**
* mono_class_init:
* @class: the class to initialize
else
if (!klass->size_inited){
mono_class_setup_fields (klass);
- if (mono_class_has_failure (klass) || mono_loader_get_last_error ())
+ if (mono_class_has_failure (klass))
goto leave;
}
mono_class_set_failure (klass, MONO_EXCEPTION_TYPE_LOAD, NULL);
goto leave;
}
- if (mono_loader_get_last_error ())
- goto leave;
if (!klass->parent->vtable_size) {
/* FIXME: Get rid of this somehow */
mono_class_setup_vtable (klass->parent);
mono_class_set_failure (klass, MONO_EXCEPTION_TYPE_LOAD, NULL);
goto leave;
}
- if (mono_loader_get_last_error ())
- goto leave;
}
first_iface_slot = klass->parent->vtable_size;
if (mono_class_need_stelemref_method (klass))
if (mono_security_core_clr_enabled ())
mono_security_core_clr_check_inheritance (klass);
- if (mono_loader_get_last_error ()) {
- if (!mono_class_has_failure (klass)) {
- set_failure_from_loader_error (klass, mono_loader_get_last_error ());
- }
- mono_loader_clear_error ();
- }
-
if (klass->generic_class && !mono_verifier_class_is_valid_generic_instantiation (klass))
mono_class_set_failure (klass, MONO_EXCEPTION_TYPE_LOAD, g_strdup ("Invalid generic instantiation"));
* ignores overrides.
*/
mono_class_setup_vtable (klass);
- if (mono_class_has_failure (klass) || mono_loader_get_last_error ())
+ if (mono_class_has_failure (klass))
cmethod = NULL;
else
cmethod = klass->vtable [finalize_slot];
if (mono_metadata_token_table (type_token) != MONO_TABLE_TYPEDEF || tidx > tt->rows) {
mono_error_set_bad_image (error, image, "Invalid typedef token %x", type_token);
- mono_loader_assert_no_error ();
return NULL;
}
if ((klass = (MonoClass *)mono_internal_hash_table_lookup (&image->class_cache, GUINT_TO_POINTER (type_token)))) {
mono_loader_unlock ();
- mono_loader_assert_no_error ();
return klass;
}
mono_class_set_failure (klass, MONO_EXCEPTION_TYPE_LOAD, g_strdup (mono_error_get_message (error)));
mono_loader_unlock ();
mono_profiler_class_loaded (klass, MONO_PROFILE_FAILED);
- mono_loader_assert_no_error ();
return NULL;
}
}
mono_class_set_failure (klass, MONO_EXCEPTION_TYPE_LOAD, g_strdup (mono_error_get_message (error)));
mono_loader_unlock ();
mono_profiler_class_loaded (klass, MONO_PROFILE_FAILED);
- mono_loader_assert_no_error ();
return NULL;
}
klass->cast_class = klass->element_class = mono_class_from_mono_type (enum_basetype);
mono_class_set_failure (klass, MONO_EXCEPTION_TYPE_LOAD, g_strdup_printf ("Could not load generic parameter constrains due to %s", mono_error_get_message (error)));
mono_loader_unlock ();
mono_profiler_class_loaded (klass, MONO_PROFILE_FAILED);
- mono_loader_assert_no_error ();
return NULL;
}
mono_loader_unlock ();
mono_profiler_class_loaded (klass, MONO_PROFILE_OK);
- mono_loader_assert_no_error ();
return klass;
mono_class_setup_mono_type (klass);
mono_loader_unlock ();
mono_profiler_class_loaded (klass, MONO_PROFILE_FAILED);
- mono_loader_assert_no_error ();
return NULL;
}
MonoType *inflated = inflate_generic_type (NULL, t, context, error);
if (!mono_error_ok (error)) {
- mono_loader_assert_no_error ();
return NULL;
}
MonoClass *klass = mono_class_get_checked (image, type_token, error);
if (!klass) {
- mono_loader_assert_no_error ();
return NULL;
}
type = mono_type_retrieve_from_typespec (image, type_token, context, &inflated, error);
if (!type) {
- mono_loader_assert_no_error ();
return NULL;
}
return mono_exception_from_name_msg (mono_defaults.corlib, "System", "InvalidProgramException", "");
}
default: {
- MonoLoaderError *error;
- MonoException *ex;
-
- error = mono_loader_get_last_error ();
- if (error != NULL){
- ex = mono_loader_error_prepare_exception (error);
- return ex;
- }
-
/* TODO - handle other class related failures */
- return NULL;
+ return mono_get_exception_execution_engine ("Unknown class failure");
}
}
}
static GENERATE_GET_CLASS_WITH_CACHE (interface_type_attribute, System.Runtime.InteropServices, InterfaceTypeAttribute)
static GENERATE_GET_CLASS_WITH_CACHE (guid_attribute, System.Runtime.InteropServices, GuidAttribute)
-static GENERATE_GET_CLASS_WITH_CACHE (com_visible_attribute, System.Runtime.InteropServices, ComVisibleAttribute)
/* Upon creation of a CCW, only allocate a weak handle and set the
* reference count to 0. If the unmanaged client code decides to addref and
{
char *trace;
MonoString *res;
- if (!exc)
- mono_raise_exception (mono_get_exception_argument_null ("exception"));
+ if (!exc) {
+ mono_set_pending_exception (mono_get_exception_argument_null ("exception"));
+ return NULL;
+ }
trace = mono_exception_get_native_backtrace (exc);
res = mono_string_new (mono_domain_get (), trace);
static guint32
finalizer_thread (gpointer unused)
{
+ MonoError error;
+ mono_thread_set_name_internal (mono_thread_internal_current (), mono_string_new (mono_get_root_domain (), "Finalizer"), FALSE, &error);
+ mono_error_assert_ok (&error);
+
gboolean wait = TRUE;
/* Register a hazard free queue pump callback */
mono_gc_init_finalizer_thread (void)
{
gc_thread = mono_thread_create_internal (mono_domain_get (), finalizer_thread, NULL, FALSE, 0);
- ves_icall_System_Threading_Thread_SetName_internal (gc_thread, mono_string_new (mono_domain_get (), "Finalizer"));
}
void
}
static gboolean
-get_caller (MonoMethod *m, gint32 no, gint32 ilo, gboolean managed, gpointer data)
+get_executing (MonoMethod *m, gint32 no, gint32 ilo, gboolean managed, gpointer data)
{
MonoMethod **dest = (MonoMethod **)data;
if (!managed)
return FALSE;
- if (m == *dest) {
- *dest = NULL;
- return FALSE;
- }
if (!(*dest)) {
+ if (!strcmp (m->klass->name_space, "System.Reflection"))
+ return FALSE;
*dest = m;
return TRUE;
}
}
static gboolean
-get_executing (MonoMethod *m, gint32 no, gint32 ilo, gboolean managed, gpointer data)
+get_caller_no_reflection (MonoMethod *m, gint32 no, gint32 ilo, gboolean managed, gpointer data)
{
MonoMethod **dest = (MonoMethod **)data;
if (!managed)
return FALSE;
+ if (m->wrapper_type != MONO_WRAPPER_NONE)
+ return FALSE;
+
+ if (m == *dest) {
+ *dest = NULL;
+ return FALSE;
+ }
+
+ if (m->klass->image == mono_defaults.corlib && !strcmp (m->klass->name_space, "System.Reflection"))
+ return FALSE;
+
if (!(*dest)) {
- if (!strcmp (m->klass->name_space, "System.Reflection"))
- return FALSE;
*dest = m;
return TRUE;
}
}
static gboolean
-get_caller_no_reflection (MonoMethod *m, gint32 no, gint32 ilo, gboolean managed, gpointer data)
+get_caller_no_system_or_reflection (MonoMethod *m, gint32 no, gint32 ilo, gboolean managed, gpointer data)
{
MonoMethod **dest = (MonoMethod **)data;
if (m->wrapper_type != MONO_WRAPPER_NONE)
return FALSE;
- if (m->klass->image == mono_defaults.corlib && !strcmp (m->klass->name_space, "System.Reflection"))
- return FALSE;
-
if (m == *dest) {
*dest = NULL;
return FALSE;
}
+
+ if (m->klass->image == mono_defaults.corlib && ((!strcmp (m->klass->name_space, "System.Reflection"))
+ || (!strcmp (m->klass->name_space, "System"))))
+ return FALSE;
+
if (!(*dest)) {
*dest = m;
return TRUE;
MonoType *type = NULL;
MonoAssembly *assembly = NULL;
gboolean type_resolve = FALSE;
+ MonoImage *rootimage = NULL;
mono_error_init (error);
*/
m = mono_method_get_last_managed ();
dest = m;
-
- mono_stack_walk_no_il (get_caller_no_reflection, &dest);
- if (!dest)
- dest = m;
+ if (m && m->klass->image != mono_defaults.corlib) {
+ /* Happens with inlining */
+ } else {
+ /* Ugly hack: type_from_parsed_name is called from
+ * System.Type.internal_from_name, which is called most
+ * directly from System.Type.GetType(string,bool,bool) but
+ * also indirectly from places such as
+ * System.Type.GetType(string,func,func) (via
+ * System.TypeNameParser.GetType and System.TypeSpec.Resolve)
+ * so we need to skip over all of those to find the true caller.
+ *
+ * It would be nice if we had stack marks.
+ */
+ mono_stack_walk_no_il (get_caller_no_system_or_reflection, &dest);
+ if (!dest)
+ dest = m;
+ }
/*
* FIXME: mono_method_get_last_managed() sometimes returns NULL, thus
if (dest) {
assembly = dest->klass->image->assembly;
type_resolve = TRUE;
+ rootimage = assembly->image;
} else {
g_warning (G_STRLOC);
}
if (info->assembly.name)
assembly = mono_assembly_load (&info->assembly, assembly ? assembly->basedir : NULL, NULL);
-
if (assembly) {
/* When loading from the current assembly, AppDomain.TypeResolve will not be called yet */
- type = mono_reflection_get_type_checked (assembly->image, info, ignoreCase, &type_resolve, error);
+ type = mono_reflection_get_type_checked (rootimage, assembly->image, info, ignoreCase, &type_resolve, error);
return_val_if_nok (error, NULL);
}
+ // XXXX - aleksey -
+ // Say we're looking for System.Generic.Dict<int, Local>
+ // we FAIL the get type above, because S.G.Dict isn't in assembly->image. So we drop down here.
+ // but then we FAIL AGAIN because now we pass null as the image and the rootimage and everything
+ // is messed up when we go to construct the Local as the type arg...
+ //
+ // By contrast, if we started with Mine<System.Generic.Dict<int, Local>> we'd go in with assembly->image
+ // as the root and then even the detour into generics would still not screw us when we went to load Local.
if (!info->assembly.name && !type) {
/* try mscorlib */
- type = mono_reflection_get_type_checked (NULL, info, ignoreCase, &type_resolve, error);
+ type = mono_reflection_get_type_checked (rootimage, NULL, info, ignoreCase, &type_resolve, error);
return_val_if_nok (error, NULL);
}
if (assembly && !type && type_resolve) {
type_resolve = FALSE; /* This will invoke TypeResolve if not done in the first 'if' */
- type = mono_reflection_get_type_checked (assembly->image, info, ignoreCase, &type_resolve, error);
+ type = mono_reflection_get_type_checked (rootimage, assembly->image, info, ignoreCase, &type_resolve, error);
return_val_if_nok (error, NULL);
}
/* mono_reflection_parse_type() mangles the string */
if (!parsedOk) {
mono_reflection_free_type_info (&info);
- g_free (str);
if (throwOnError) {
- mono_set_pending_exception (mono_get_exception_argument("typeName", "failed parse"));
+ mono_error_init (&error);
+ mono_error_set_argument (&error, "typeName", "failed parse: %s", str);
+ mono_error_set_pending_exception (&error);
}
+ g_free (str);
return NULL;
}
if (throwOnError)
e = mono_get_exception_type_load (name, NULL);
- mono_loader_clear_error ();
if (e) {
mono_set_pending_exception (e);
return NULL;
/* An optimization for calls made from Delegate:CreateDelegate () */
if (klass->delegate && name && !strcmp (name, "Invoke") && (bflags == (BFLAGS_Public | BFLAGS_Static | BFLAGS_Instance))) {
method = mono_get_delegate_invoke (klass);
- if (mono_loader_get_last_error ())
- goto loader_error;
+ g_assert (method);
g_ptr_array_add (array, method);
return array;
mono_class_setup_methods (klass);
mono_class_setup_vtable (klass);
- if (mono_class_has_failure (klass) || mono_loader_get_last_error ())
+ if (mono_class_has_failure (klass))
goto loader_error;
if (is_generic_parameter (&klass->byval_arg))
handle_parent:
mono_class_setup_methods (klass);
mono_class_setup_vtable (klass);
- if (mono_class_has_failure (klass) || mono_loader_get_last_error ())
+ if (mono_class_has_failure (klass))
goto loader_error;
iter = NULL;
if (mono_class_has_failure (klass)) {
*ex = mono_class_get_exception_for_failure (klass);
} else {
- *ex = mono_loader_error_prepare_exception (mono_loader_get_last_error ());
- mono_loader_clear_error ();
+ *ex = mono_get_exception_execution_engine ("Unknown error");
}
return NULL;
}
handle_parent:
mono_class_setup_methods (klass);
mono_class_setup_vtable (klass);
- if (mono_class_has_failure (klass) || mono_loader_get_last_error ())
+ if (mono_class_has_failure (klass))
goto loader_error;
iter = NULL;
loader_error:
if (mono_class_has_failure (klass)) {
mono_error_set_exception_instance (&error, mono_class_get_exception_for_failure (klass));
- } else {
- mono_error_set_from_loader_error (&error);
- mono_loader_clear_error ();
}
failure:
handle_parent:
mono_class_setup_methods (klass);
mono_class_setup_vtable (klass);
- if (mono_class_has_failure (klass) || mono_loader_get_last_error ())
+ if (mono_class_has_failure (klass))
goto loader_error;
iter = NULL;
loader_error:
if (mono_class_has_failure (klass)) {
mono_error_set_exception_instance (&error, mono_class_get_exception_for_failure (klass));
- } else {
- mono_error_set_from_loader_error (&error);
- mono_loader_clear_error ();
}
failure:
if (module != NULL) {
if (module->image) {
- type = mono_reflection_get_type_checked (module->image, &info, ignoreCase, &type_resolve, &error);
+ type = mono_reflection_get_type_checked (module->image, module->image, &info, ignoreCase, &type_resolve, &error);
if (!is_ok (&error)) {
g_free (str);
mono_reflection_free_type_info (&info);
if (abuilder->modules) {
for (i = 0; i < mono_array_length (abuilder->modules); ++i) {
MonoReflectionModuleBuilder *mb = mono_array_get (abuilder->modules, MonoReflectionModuleBuilder*, i);
- type = mono_reflection_get_type_checked (&mb->dynamic_image->image, &info, ignoreCase, &type_resolve, &error);
+ type = mono_reflection_get_type_checked (&mb->dynamic_image->image, &mb->dynamic_image->image, &info, ignoreCase, &type_resolve, &error);
if (!is_ok (&error)) {
g_free (str);
mono_reflection_free_type_info (&info);
if (!type && abuilder->loaded_modules) {
for (i = 0; i < mono_array_length (abuilder->loaded_modules); ++i) {
MonoReflectionModule *mod = mono_array_get (abuilder->loaded_modules, MonoReflectionModule*, i);
- type = mono_reflection_get_type_checked (mod->image, &info, ignoreCase, &type_resolve, &error);
+ type = mono_reflection_get_type_checked (mod->image, mod->image, &info, ignoreCase, &type_resolve, &error);
if (!is_ok (&error)) {
g_free (str);
mono_reflection_free_type_info (&info);
}
}
else {
- type = mono_reflection_get_type_checked (assembly->assembly->image, &info, ignoreCase, &type_resolve, &error);
+ type = mono_reflection_get_type_checked (assembly->assembly->image, assembly->assembly->image, &info, ignoreCase, &type_resolve, &error);
if (!is_ok (&error)) {
g_free (str);
mono_reflection_free_type_info (&info);
if (throwOnError)
e = mono_get_exception_type_load (name, NULL);
- if (mono_loader_get_last_error () && mono_defaults.generic_ilist_class)
- e = mono_loader_error_prepare_exception (mono_loader_get_last_error ());
-
- mono_loader_clear_error ();
-
if (e != NULL)
mono_set_pending_exception (e);
return NULL;
- } else if (mono_loader_get_last_error ()) {
- if (throwOnError) {
- mono_set_pending_exception (mono_loader_error_prepare_exception (mono_loader_get_last_error ()));
- return NULL;
- }
- mono_loader_clear_error ();
}
if (type->type == MONO_TYPE_CLASS) {
if (throwOnError && mono_class_has_failure (klass)) {
/* report SecurityException (or others) that occured when loading the assembly */
MonoException *exc = mono_class_get_exception_for_failure (klass);
- mono_loader_clear_error ();
mono_set_pending_exception (exc);
return NULL;
}
for (i = 1; i < tdef->rows; ++i) {
if (!exportedOnly || mono_module_type_is_visible (tdef, image, i + 1)) {
klass = mono_class_get_checked (image, (i + 1) | MONO_TOKEN_TYPE_DEF, error);
- mono_loader_assert_no_error (); /* Plug any leaks */
if (klass) {
rt = mono_type_get_object_checked (domain, &klass->byval_arg, error);
MonoArray *exl = NULL;
int j, length = g_list_length (list) + ex_count;
- mono_loader_clear_error ();
-
exl = mono_array_new (domain, mono_defaults.exception_class, length);
/* Types for which mono_class_get_checked () succeeded */
for (i = 0, tmp = list; tmp; i++, tmp = tmp->next) {
mono_error_set_pending_exception (&error);
return NULL;
}
- mono_loader_clear_error ();
mono_set_pending_exception (exc);
return NULL;
}
return NULL;
}
- if (mono_loader_get_last_error ()) {
- mono_set_pending_exception (mono_loader_error_prepare_exception (mono_loader_get_last_error ()));
- return NULL;
- } else {
- return res;
- }
+ return res;
}
ICALL_EXPORT MonoArray*
static guint32 methods_size;
static guint32 signatures_size;
-/*
- * This TLS variable contains the last type load error encountered by the loader.
- */
-MonoNativeTlsKey loader_error_thread_id;
-
/*
* This TLS variable holds how many times the current thread has acquired the loader
* lock.
mono_os_mutex_init_recursive (&global_loader_data_mutex);
loader_lock_inited = TRUE;
- mono_native_tls_alloc (&loader_error_thread_id, NULL);
mono_native_tls_alloc (&loader_lock_nest_id, NULL);
mono_counters_init ();
{
dllmap_cleanup ();
- mono_native_tls_free (loader_error_thread_id);
mono_native_tls_free (loader_lock_nest_id);
mono_coop_mutex_destroy (&loader_mutex);
loader_lock_inited = FALSE;
}
-/*
- * Handling of type load errors should be done as follows:
- *
- * If something could not be loaded, the loader should call one of the
- * mono_loader_set_error_XXX functions ()
- * with the appropriate arguments, then return NULL to report the failure. The error
- * should be propagated until it reaches code which can throw managed exceptions. At that
- * point, an exception should be thrown based on the information returned by
- * mono_loader_get_last_error (). Then the error should be cleared by calling
- * mono_loader_clear_error ().
- */
-
-static void
-set_loader_error (MonoLoaderError *error)
-{
- mono_loader_clear_error ();
- mono_native_tls_set_value (loader_error_thread_id, error);
-}
-
-/**
- * mono_loader_set_error_assembly_load:
- *
- * Set the loader error for this thread.
- */
-void
-mono_loader_set_error_assembly_load (const char *assembly_name, gboolean ref_only)
-{
- MonoLoaderError *error;
-
- if (mono_loader_get_last_error ())
- return;
-
- error = g_new0 (MonoLoaderError, 1);
- error->exception_type = MONO_EXCEPTION_FILE_NOT_FOUND;
- error->assembly_name = g_strdup (assembly_name);
- error->ref_only = ref_only;
-
- /*
- * This is not strictly needed, but some (most) of the loader code still
- * can't deal with load errors, and this message is more helpful than an
- * assert.
- */
- if (ref_only)
- mono_trace (G_LOG_LEVEL_WARNING, MONO_TRACE_ASSEMBLY, "Cannot resolve dependency to assembly '%s' because it has not been preloaded. When using the ReflectionOnly APIs, dependent assemblies must be pre-loaded or loaded on demand through the ReflectionOnlyAssemblyResolve event.", assembly_name);
- else
- mono_trace (G_LOG_LEVEL_WARNING, MONO_TRACE_ASSEMBLY, "Could not load file or assembly '%s' or one of its dependencies.", assembly_name);
-
- set_loader_error (error);
-}
-
-/**
- * mono_loader_set_error_type_load:
- *
- * Set the loader error for this thread.
- */
-void
-mono_loader_set_error_type_load (const char *class_name, const char *assembly_name)
-{
- MonoLoaderError *error;
-
- if (mono_loader_get_last_error ())
- return;
-
- error = g_new0 (MonoLoaderError, 1);
- error->exception_type = MONO_EXCEPTION_TYPE_LOAD;
- error->class_name = g_strdup (class_name);
- error->assembly_name = g_strdup (assembly_name);
-
- /*
- * This is not strictly needed, but some (most) of the loader code still
- * can't deal with load errors, and this message is more helpful than an
- * assert.
- */
- mono_trace_warning (MONO_TRACE_TYPE, "The class %s could not be loaded, used in %s", class_name, assembly_name);
-
- set_loader_error (error);
-}
-
-/*
- * mono_loader_set_error_method_load:
- *
- * Set the loader error for this thread. MEMBER_NAME should point to a string
- * inside metadata.
- */
-void
-mono_loader_set_error_method_load (const char *class_name, const char *member_name)
-{
- MonoLoaderError *error;
-
- /* FIXME: Store the signature as well */
- if (mono_loader_get_last_error ())
- return;
-
- error = g_new0 (MonoLoaderError, 1);
- error->exception_type = MONO_EXCEPTION_MISSING_METHOD;
- error->class_name = g_strdup (class_name);
- error->member_name = member_name;
-
- set_loader_error (error);
-}
-
-/*
- * mono_loader_set_error_field_load:
- *
- * Set the loader error for this thread. MEMBER_NAME should point to a string
- * inside metadata.
- */
-void
-mono_loader_set_error_field_load (MonoClass *klass, const char *member_name)
-{
- MonoLoaderError *error;
-
- /* FIXME: Store the signature as well */
- if (mono_loader_get_last_error ())
- return;
-
- error = g_new0 (MonoLoaderError, 1);
- error->exception_type = MONO_EXCEPTION_MISSING_FIELD;
- error->klass = klass;
- error->member_name = member_name;
-
- set_loader_error (error);
-}
-
-/*
- * mono_loader_set_error_bad_image:
- *
- * Set the loader error for this thread.
- */
-void
-mono_loader_set_error_bad_image (char *msg)
-{
- MonoLoaderError *error;
-
- if (mono_loader_get_last_error ())
- return;
-
- error = g_new0 (MonoLoaderError, 1);
- error->exception_type = MONO_EXCEPTION_BAD_IMAGE;
- error->msg = msg;
-
- set_loader_error (error);
-}
-
-
-/*
- * mono_loader_get_last_error:
- *
- * Returns information about the last type load exception encountered by the loader, or
- * NULL. After use, the exception should be cleared by calling mono_loader_clear_error.
- */
-MonoLoaderError*
-mono_loader_get_last_error (void)
-{
- return (MonoLoaderError*)mono_native_tls_get_value (loader_error_thread_id);
-}
-
-void
-mono_loader_assert_no_error (void)
-{
- MonoLoaderError *error = mono_loader_get_last_error ();
-
- if (error) {
- g_print ("Unhandled loader error: %x, %s %s %s\n", error->exception_type, error->msg, error->assembly_name, error->class_name);
- g_assert_not_reached ();
- }
-}
-
-/**
- * mono_loader_clear_error:
- *
- * Disposes any loader error messages on this thread
- */
-void
-mono_loader_clear_error (void)
-{
- MonoLoaderError *ex = (MonoLoaderError*)mono_native_tls_get_value (loader_error_thread_id);
-
- if (ex) {
- g_free (ex->class_name);
- g_free (ex->assembly_name);
- g_free (ex->msg);
- g_free (ex);
-
- mono_native_tls_set_value (loader_error_thread_id, NULL);
- }
-}
-
-/**
- * mono_loader_error_prepare_exception:
- * @error: The MonoLoaderError to turn into an exception
- *
- * This turns a MonoLoaderError into an exception that can be thrown
- * and resets the Mono Loader Error state during this process.
- *
- */
-MonoException *
-mono_loader_error_prepare_exception (MonoLoaderError *error)
-{
- MonoException *ex = NULL;
-
- switch (error->exception_type) {
- case MONO_EXCEPTION_TYPE_LOAD: {
- char *cname = g_strdup (error->class_name);
- char *aname = g_strdup (error->assembly_name);
- MonoString *class_name;
-
- mono_loader_clear_error ();
-
- class_name = mono_string_new (mono_domain_get (), cname);
-
- ex = mono_get_exception_type_load (class_name, aname);
- g_free (cname);
- g_free (aname);
- break;
- }
- case MONO_EXCEPTION_MISSING_METHOD: {
- char *cname = g_strdup (error->class_name);
- char *aname = g_strdup (error->member_name);
-
- mono_loader_clear_error ();
- ex = mono_get_exception_missing_method (cname, aname);
- g_free (cname);
- g_free (aname);
- break;
- }
-
- case MONO_EXCEPTION_MISSING_FIELD: {
- char *class_name;
- char *cmembername = g_strdup (error->member_name);
- if (error->klass)
- class_name = mono_type_get_full_name (error->klass);
- else
- class_name = g_strdup ("");
-
- mono_loader_clear_error ();
-
- ex = mono_get_exception_missing_field (class_name, cmembername);
- g_free (class_name);
- g_free (cmembername);
- break;
- }
-
- case MONO_EXCEPTION_FILE_NOT_FOUND: {
- char *msg;
- char *filename;
-
- if (error->ref_only)
- msg = g_strdup_printf ("Cannot resolve dependency to assembly '%s' because it has not been preloaded. When using the ReflectionOnly APIs, dependent assemblies must be pre-loaded or loaded on demand through the ReflectionOnlyAssemblyResolve event.", error->assembly_name);
- else
- msg = g_strdup_printf ("Could not load file or assembly '%s' or one of its dependencies.", error->assembly_name);
- filename = g_strdup (error->assembly_name);
- /* Has to call this before calling anything which might call mono_class_init () */
- mono_loader_clear_error ();
- ex = mono_get_exception_file_not_found2 (msg, mono_string_new (mono_domain_get (), filename));
- g_free (msg);
- g_free (filename);
- break;
- }
-
- case MONO_EXCEPTION_BAD_IMAGE: {
- char *msg = g_strdup (error->msg);
- mono_loader_clear_error ();
- ex = mono_get_exception_bad_image_format (msg);
- g_free (msg);
- break;
- }
-
- default:
- g_assert_not_reached ();
- }
-
- return ex;
-}
-
/*
* find_cached_memberref_sig:
*
field = mono_class_get_field_from_name_full (klass, fname, sig_type);
if (!field) {
- mono_loader_assert_no_error ();
mono_error_set_field_load (error, klass, fname, "Could not find field '%s'", fname);
}
if (mono_metadata_token_table (token) == MONO_TABLE_MEMBERREF) {
field = field_from_memberref (image, token, retklass, context, error);
- mono_loader_assert_no_error ();
} else {
type = mono_metadata_typedef_from_field (image, mono_metadata_token_index (token));
if (!type) {
*retklass = k;
field = mono_class_get_field (k, token);
if (!field) {
- if (mono_loader_get_last_error ())
- mono_error_set_from_loader_error (error);
- else
- mono_error_set_bad_image (error, image, "Could not resolve field token 0x%08x", token);
+ mono_error_set_bad_image (error, image, "Could not resolve field token 0x%08x", token);
}
}
mono_image_unlock (image);
}
- mono_loader_assert_no_error ();
return field;
}
g_free (msig);
msig = g_string_free (s, FALSE);
- if (mono_loader_get_last_error ()) /* FIXME find_method and mono_method_search_in_array_class can leak a loader error */
- mono_error_set_from_loader_error (error);
- else
- mono_error_set_method_load (error, klass, mname, "Could not find method %s", msig);
+ mono_error_set_method_load (error, klass, mname, "Could not find method %s", msig);
g_free (msig);
}
- mono_loader_assert_no_error ();
return method;
fail:
- mono_loader_assert_no_error ();
g_assert (!mono_error_ok (error));
return NULL;
}
new_context.method_inst = inst;
method = mono_class_inflate_generic_method_full_checked (method, klass, &new_context, error);
- mono_loader_assert_no_error ();
return method;
}
result = (MonoMethod *)mono_lookup_dynamic_token_class (image, token, TRUE, &handle_class, context, error);
mono_error_assert_ok (error);
- mono_loader_assert_no_error ();
// This checks the memberref type as well
if (result && handle_class != mono_defaults.methodhandle_class) {
*/
if (*sig & 0x10) {
generic_container = mono_metadata_load_generic_params (image, token, container);
- mono_loader_assert_no_error (); /* FIXME don't swallow this error. */
}
if (generic_container) {
result->is_generic = TRUE;
if (generic_container)
mono_method_set_generic_container (result, generic_container);
- mono_loader_assert_no_error ();
return result;
}
case MONO_NATIVE_BSTR:
return MONO_MARSHAL_CONV_STR_BSTR;
default:
- return (MonoMarshalConv)-1;
+ return MONO_MARSHAL_CONV_INVALID;
}
}
return MONO_MARSHAL_CONV_SB_LPTSTR;
break;
default:
- return (MonoMarshalConv)-1;
+ return MONO_MARSHAL_CONV_INVALID;
}
}
case MONO_NATIVE_BSTR:
return MONO_MARSHAL_CONV_BSTR_STR;
default:
- return (MonoMarshalConv)-1;
+ return MONO_MARSHAL_CONV_INVALID;
}
}
return MONO_MARSHAL_CONV_LPTSTR_SB;
break;
default:
- return (MonoMarshalConv)-1;
+ return MONO_MARSHAL_CONV_INVALID;
}
}
mono_mb_emit_ldarg (mb, argnum);
}
- if (conv == -1) {
+ if (conv == MONO_MARSHAL_CONV_INVALID) {
char *msg = g_strdup_printf ("string marshalling conversion %d not implemented", encoding);
mono_mb_emit_exception_marshal_directive (mb, msg);
} else {
case MARSHAL_ACTION_CONV_OUT:
conv = mono_marshal_get_ptr_to_string_conv (m->piinfo, spec, &need_free);
- if (conv == -1) {
+ if (conv == MONO_MARSHAL_CONV_INVALID) {
char *msg = g_strdup_printf ("string marshalling conversion %d not implemented", encoding);
mono_mb_emit_exception_marshal_directive (mb, msg);
break;
mono_mb_emit_stloc (mb, 0);
conv = mono_marshal_get_ptr_to_string_conv (m->piinfo, spec, &need_free);
- if (conv == -1) {
+ if (conv == MONO_MARSHAL_CONV_INVALID) {
char *msg = g_strdup_printf ("string marshalling conversion %d not implemented", encoding);
mono_mb_emit_exception_marshal_directive (mb, msg);
break;
}
conv = mono_marshal_get_ptr_to_string_conv (m->piinfo, spec, &need_free);
- if (conv == -1) {
+ if (conv == MONO_MARSHAL_CONV_INVALID) {
char *msg = g_strdup_printf ("string marshalling conversion %d not implemented", encoding);
mono_mb_emit_exception_marshal_directive (mb, msg);
break;
if (t->byref && !(t->attrs & PARAM_ATTRIBUTE_IN) && (t->attrs & PARAM_ATTRIBUTE_OUT))
break;
- if (conv == -1) {
+ if (conv == MONO_MARSHAL_CONV_INVALID) {
char *msg = g_strdup_printf ("stringbuilder marshalling conversion %d not implemented", encoding);
mono_mb_emit_exception_marshal_directive (mb, msg);
break;
conv = mono_marshal_get_stringbuilder_to_ptr_conv (m->piinfo, spec);
}
else
- conv = (MonoMarshalConv)-1;
+ conv = MONO_MARSHAL_CONV_INVALID;
- if (is_string && conv == -1) {
+ if (is_string && conv == MONO_MARSHAL_CONV_INVALID) {
char *msg = g_strdup_printf ("string/stringbuilder marshalling conversion %d not implemented", encoding);
mono_mb_emit_exception_marshal_directive (mb, msg);
break;
gboolean need_free2;
MonoMarshalConv conv = mono_marshal_get_ptr_to_stringbuilder_conv (m->piinfo, spec, &need_free2);
- g_assert (conv != -1);
+ g_assert (conv != MONO_MARSHAL_CONV_INVALID);
/* dest */
mono_mb_emit_ldarg (mb, argnum);
conv = mono_marshal_get_ptr_to_stringbuilder_conv (m->piinfo, spec, &need_free);
}
else
- conv = (MonoMarshalConv)-1;
+ conv = MONO_MARSHAL_CONV_INVALID;
mono_marshal_load_type_info (eklass);
/* Emit marshalling code */
if (is_string) {
- g_assert (conv != -1);
+ g_assert (conv != MONO_MARSHAL_CONV_INVALID);
mono_mb_emit_ldloc (mb, conv_arg);
mono_mb_emit_ldloc (mb, index_var);
conv = mono_marshal_get_stringbuilder_to_ptr_conv (m->piinfo, spec);
}
else
- conv = (MonoMarshalConv)-1;
+ conv = MONO_MARSHAL_CONV_INVALID;
mono_marshal_load_type_info (eklass);
/* Emit marshalling code */
if (is_string) {
- g_assert (conv != -1);
+ g_assert (conv != MONO_MARSHAL_CONV_INVALID);
/* dest */
mono_mb_emit_ldloc (mb, dest_ptr);
MonoClass *eklass;
guint32 label1, label2, label3;
int index_var, src, dest, esize;
- MonoMarshalConv conv = (MonoMarshalConv)-1;
+ MonoMarshalConv conv = MONO_MARSHAL_CONV_INVALID;
gboolean is_string = FALSE;
g_assert (!t->byref);
/* Emit marshalling code */
if (is_string) {
- g_assert (conv != -1);
+ g_assert (conv != MONO_MARSHAL_CONV_INVALID);
/* dest */
mono_mb_emit_ldloc (mb, dest);
mono_metadata_generic_param_equal (MonoGenericParam *p1, MonoGenericParam *p2);
void mono_dynamic_stream_reset (MonoDynamicStream* stream);
-void mono_assembly_addref (MonoAssembly *assembly);
+MONO_API void mono_assembly_addref (MonoAssembly *assembly);
void mono_assembly_load_friends (MonoAssembly* ass);
gboolean mono_assembly_has_skip_verification (MonoAssembly* ass);
for (i = 0; i < method->param_count; ++i) {
if (*ptr == MONO_TYPE_SENTINEL) {
if (method->call_convention != MONO_CALL_VARARG || def) {
- mono_loader_assert_no_error ();
mono_error_set_bad_image (error, m, "Found sentinel for methoddef or no vararg");
g_free (pattrs);
return NULL;
}
if (method->sentinelpos >= 0) {
- mono_loader_assert_no_error ();
mono_error_set_bad_image (error, m, "Found sentinel twice in the same signature.");
g_free (pattrs);
return NULL;
* Add signature to a cache and increase ref count...
*/
- mono_loader_assert_no_error ();
return method;
}
return TRUE;
for (i = 0; i < container->type_argc; i++) {
if (!get_constraints (image, start_row + i, &mono_generic_container_get_param_info (container, i)->constraints, container, error)) {
- mono_loader_assert_no_error ();
return FALSE;
}
}
MONO_BEGIN_DECLS
-/*
- * When embedding, you have to define MONO_ZERO_LEN_ARRAY before including any
- * other Mono header file if you use a different compiler from the one used to
- * build Mono.
- */
-#ifndef MONO_ZERO_LEN_ARRAY
-#ifdef __GNUC__
-#define MONO_ZERO_LEN_ARRAY 0
-#else
-#define MONO_ZERO_LEN_ARRAY 1
-#endif
-#endif
-
#define MONO_TYPE_ISSTRUCT(t) mono_type_is_struct (t)
#define MONO_TYPE_IS_VOID(t) mono_type_is_void (t)
#define MONO_TYPE_IS_POINTER(t) mono_type_is_pointer (t)
MONO_MARSHAL_CONV_HANDLEREF
} MonoMarshalConv;
+#define MONO_MARSHAL_CONV_INVALID ((MonoMarshalConv)-1)
+
typedef struct {
MonoMarshalNative native;
union {
mono_mb_free (MonoMethodBuilder *mb)
{
#ifndef DISABLE_JIT
+ GList *l;
+
+ for (l = mb->locals_list; l; l = l->next) {
+ /* Allocated in mono_mb_add_local () */
+ g_free (l->data);
+ }
g_list_free (mb->locals_list);
if (!mb->dynamic) {
g_free (mb->method);
header->code = mb->code;
for (i = 0, l = mb->locals_list; l; l = l->next, i++) {
- header->locals [i] = mono_metadata_type_dup (NULL, (MonoType*)l->data);
+ header->locals [i] = (MonoType*)l->data;
}
} else
#endif
memcpy ((char*)header->code, mb->code, mb->pos);
for (i = 0, l = mb->locals_list; l; l = l->next, i++) {
- header->locals [i] = mono_metadata_type_dup (NULL, (MonoType*)l->data);
+ header->locals [i] = (MonoType*)l->data;
}
#endif
}
+ /* Free the locals list so mono_mb_free () doesn't free the types twice */
+ g_list_free (mb->locals_list);
+ mb->locals_list = NULL;
+
method->signature = signature;
if (!signature->hasthis)
method->flags |= METHOD_ATTRIBUTE_STATIC;
mono_mb_add_local (MonoMethodBuilder *mb, MonoType *type)
{
int res;
+ MonoType *t;
+
+ /*
+ * Have to make a copy early since type might be sig->ret,
+ * which is transient, see mono_metadata_signature_dup_internal_with_padding ().
+ */
+ t = mono_metadata_type_dup (NULL, type);
g_assert (mb != NULL);
g_assert (type != NULL);
res = mb->locals;
- mb->locals_list = g_list_append (mb->locals_list, type);
+ mb->locals_list = g_list_append (mb->locals_list, t);
mb->locals++;
return res;
{
MonoSimpleBasicBlock *res, *bb = first;
+ mono_error_init (error);
+
if (bb_idx_is_contained (hint, target)) {
first = hint;
} else if (hint->next && bb_idx_is_contained (hint->next, target)) {
MonoSimpleBasicBlock *branch, *next, *current;
const MonoOpcode *opcode;
+ mono_error_init (error);
+
current = bb;
while (ip < end) {
{
int i;
int end = header->code_size;
+
+ mono_error_init (error);
+
/*We must split at all points to verify for targets in the middle of an instruction*/
for (i = 0; i < header->num_clauses; ++i) {
MonoExceptionClause *clause = header->clauses + i;
MonoSimpleBasicBlock *bb, *root;
const unsigned char *start, *end;
+ mono_error_init (error);
+
start = header->code;
end = start + header->code_size;
DECL_OFFSET(MonoContext, gregs)
DECL_OFFSET(MonoContext, fregs)
-#ifdef TARGET_WIN32
-DECL_OFFSET(MonoLMF, lmf_addr)
-#endif
-
DECL_OFFSET(MonoLMF, rsp)
DECL_OFFSET(MonoLMF, rbp)
DECL_OFFSET(MonoLMF, rip)
for (i = 0; i < m->rows; ++i) {
MonoMethod *method;
MonoError error;
- mono_loader_clear_error ();
method = mono_get_method_checked (image, MONO_TOKEN_METHOD_DEF | (i+1), NULL, NULL, &error);
if (!method) {
continue;
}
mono_class_init (klass);
- if (mono_class_has_failure (klass) || mono_loader_get_last_error ()) {
+ if (mono_class_has_failure (klass)) {
printf ("Error verifying class(0x%08x) %s.%s a type load error happened\n", token, klass->name_space, klass->name);
- mono_loader_clear_error ();
++count;
}
mono_class_setup_vtable (klass);
- if (mono_class_has_failure (klass) || mono_loader_get_last_error ()) {
+ if (mono_class_has_failure (klass)) {
printf ("Error verifying class(0x%08x) %s.%s a type load error happened\n", token, klass->name_space, klass->name);
- mono_loader_clear_error ();
++count;
}
}
return result;
}
+// TODO: Much of the library loading code here is custom. It would be better to merge this with mono-dl
static gboolean
load_profiler_from_directory (const char *directory, const char *libname, const char *desc)
{
char *err;
void *iter;
- mono_trace (G_LOG_LEVEL_INFO, MONO_TRACE_ASSEMBLY, "Attempting to load profiler %s from %s (desc %s)", libname, directory, desc);
+ mono_trace (G_LOG_LEVEL_INFO, MONO_TRACE_DLLIMPORT, "Attempting to load profiler %s from %s (desc %s)", libname, directory, desc);
iter = NULL;
err = NULL;
while ((path = mono_dl_build_path (directory, libname, &iter))) {
pmodule = mono_dl_open (path, MONO_DL_LAZY, &err);
- mono_trace (G_LOG_LEVEL_INFO, MONO_TRACE_ASSEMBLY, "Attempting to load profiler: %s %ssuccessful, err: %s", path, pmodule?"":"not ", err);
+ mono_trace (G_LOG_LEVEL_INFO, MONO_TRACE_DLLIMPORT, "Attempting to load profiler: %s, %ssuccessful, err: %s", path, pmodule?"":"not ", err);
g_free (path);
g_free (err);
if (pmodule)
}
static gboolean
-load_profiler_from_mono_instalation (const char *libname, const char *desc)
+load_profiler_from_mono_installation (const char *libname, const char *desc)
{
char *err = NULL;
MonoDl *pmodule = mono_dl_open_runtime_lib (libname, MONO_DL_LAZY, &err);
+ mono_trace (G_LOG_LEVEL_INFO, MONO_TRACE_DLLIMPORT, "Attempting to load profiler from runtime libs: %s, %ssuccessful, err: %s", libname, pmodule?"":"not ", err);
g_free (err);
if (pmodule)
return load_profiler (pmodule, desc, INITIALIZER_NAME);
}
if (!load_embedded_profiler (desc, mname)) {
libname = g_strdup_printf ("mono-profiler-%s", mname);
- char *profiler_lib_dir = getenv ("MONO_PROFILER_LIB_DIR");
- if (profiler_lib_dir)
- res = load_profiler_from_directory (profiler_lib_dir, libname, desc);
+ res = load_profiler_from_mono_installation (libname, desc);
if (!res && mono_config_get_assemblies_dir ())
res = load_profiler_from_directory (mono_assembly_getrootdir (), libname, desc);
if (!res)
res = load_profiler_from_directory (NULL, libname, desc);
- if (!res)
- res = load_profiler_from_mono_instalation (libname, desc);
if (!res)
g_warning ("The '%s' profiler wasn't found in the main executable nor could it be loaded from '%s'.", mname, libname);
g_free (libname);
#include <mono/utils/mono-error.h>
MonoType*
-mono_reflection_get_type_checked (MonoImage* image, MonoTypeNameParse *info, mono_bool ignorecase, mono_bool *type_resolve, MonoError *error);
+mono_reflection_get_type_checked (MonoImage *rootimage, MonoImage* image, MonoTypeNameParse *info, mono_bool ignorecase, mono_bool *type_resolve, MonoError *error);
MonoType*
mono_reflection_type_from_name_checked (char *name, MonoImage *image, MonoError *error);
/**
* mono_reflection_get_type_checked:
+ * @rootimage: the image of the currently active managed caller
* @image: a metadata context
* @info: type description structure
* @ignorecase: flag for case-insensitive string compares
*
*/
MonoType*
-mono_reflection_get_type_checked (MonoImage* image, MonoTypeNameParse *info, gboolean ignorecase, gboolean *type_resolve, MonoError *error) {
+mono_reflection_get_type_checked (MonoImage *rootimage, MonoImage* image, MonoTypeNameParse *info, gboolean ignorecase, gboolean *type_resolve, MonoError *error) {
mono_error_init (error);
- return mono_reflection_get_type_with_rootimage (image, image, info, ignorecase, type_resolve, error);
+ return mono_reflection_get_type_with_rootimage (rootimage, image, info, ignorecase, type_resolve, error);
}
if (!mono_error_ok (&error))
goto leave;
- if (mono_loader_get_last_error ()) {
- mono_error_set_from_loader_error (&error);
- goto leave;
- }
-
if (!typedargs || !namedargs)
goto leave;
if (!result)
return NULL;
} else {
- mono_loader_assert_no_error ();
result = mono_array_new_cached (mono_domain_get (), mono_defaults.attribute_class, 0);
}
} else
result = mono_array_new (mono_domain_get (), mono_defaults.customattribute_data_class, 0);
- if (mono_loader_get_last_error ())
- mono_error_set_from_loader_error (error);
-
return result;
}
#ifndef __METADATA_REFLECTION_H__
#define __METADATA_REFLECTION_H__
+#include <mono/utils/mono-compiler.h>
#include <mono/metadata/object.h>
MONO_BEGIN_DECLS
sgen_client_thread_register_worker (void)
{
mono_thread_info_register_small_id ();
+ mono_thread_info_set_name (mono_native_thread_id_get (), "SGen worker");
}
/* Variables holding start/end nursery so it won't have to be passed at every call */
sgen_bridge_describe_pointer (ptr);
}
+static gboolean gc_inited;
+
void
mono_gc_base_init (void)
{
+ if (gc_inited)
+ return;
+
mono_counters_init ();
#ifdef HEAVY_STATISTICS
if (mono_tls_key_get_offset (TLS_KEY_SGEN_TLAB_NEXT_ADDR) == -1)
sgen_set_use_managed_allocator (FALSE);
#endif
+
+ gc_inited = TRUE;
}
void
g_assert (handle >= 0);
- g_assert (job->operation == EVENT_IN ^ job->operation == EVENT_OUT);
+ g_assert ((job->operation == EVENT_IN) ^ (job->operation == EVENT_OUT));
g_assert (job->callback);
if (mono_runtime_is_shutting_down ())
thread = mono_thread_internal_current ();
g_assert (thread);
- mono_thread_set_name_internal (thread, mono_string_new (mono_domain_get (), "Threadpool worker"), FALSE);
+ mono_thread_set_name_internal (thread, mono_string_new (mono_get_root_domain (), "Threadpool worker"), FALSE, &error);
+ mono_error_assert_ok (&error);
mono_coop_mutex_lock (&threadpool->active_threads_lock);
g_ptr_array_add (threadpool->working_threads, thread);
MonoException* mono_thread_get_and_clear_pending_exception (void);
-void mono_thread_set_name_internal (MonoInternalThread *this_obj, MonoString *name, gboolean managed);
+void mono_thread_set_name_internal (MonoInternalThread *this_obj, MonoString *name, gboolean managed, MonoError *error);
void mono_runtime_set_has_tls_get (gboolean val);
gboolean mono_runtime_has_tls_get (void);
}
mono_release_type_locks (thread);
- mono_profiler_thread_end (thread->tid);
+ /* Can happen when we attach the profiler helper thread in order to heapshot. */
+ if (!mono_thread_info_lookup (thread->tid)->tools_thread)
+ mono_profiler_thread_end (thread->tid);
if (thread == mono_thread_internal_current ()) {
/*
return thread;
}
-static void
-init_root_domain_thread (MonoInternalThread *thread, MonoThread *candidate)
+static gboolean
+init_root_domain_thread (MonoInternalThread *thread, MonoThread *candidate, MonoError *error)
{
- MonoError error;
MonoDomain *domain = mono_get_root_domain ();
+ mono_error_init (error);
if (!candidate || candidate->obj.vtable->domain != domain) {
- candidate = new_thread_with_internal (domain, thread, &error);
- mono_error_raise_exception (&error); /* FIXME don't raise here */
+ candidate = new_thread_with_internal (domain, thread, error);
+ return_val_if_nok (error, FALSE);
}
set_current_thread_for_domain (domain, thread, candidate);
g_assert (!thread->root_domain_thread);
MONO_OBJECT_SETREF (thread, root_domain_thread, candidate);
+ return TRUE;
}
static guint32 WINAPI start_wrapper_internal(void *data)
{
+ MonoError error;
MonoThreadInfo *info;
StartInfo *start_info = (StartInfo *)data;
guint32 (*start_func)(void *);
/* We have to do this here because mono_thread_new_init()
requires that root_domain_thread is set up. */
thread_adjust_static_data (internal);
- init_root_domain_thread (internal, start_info->obj);
+ init_root_domain_thread (internal, start_info->obj, &error);
+ mono_error_raise_exception (&error); /* FIXME don't raise here */
/* This MUST be called before any managed code can be
* executed, as it calls the callback function that (for the
if (internal->name && (internal->flags & MONO_THREAD_FLAG_NAME_SET)) {
char *tname = g_utf16_to_utf8 (internal->name, internal->name_len, NULL, NULL, NULL);
mono_profiler_thread_name (internal->tid, tname);
+ mono_thread_info_set_name (internal->tid, tname);
g_free (tname);
}
/* start_func is set only for unmanaged start functions */
*/
static gboolean
create_thread (MonoThread *thread, MonoInternalThread *internal, StartInfo *start_info, gboolean threadpool_thread, guint32 stack_size,
- gboolean throw_on_failure)
+ MonoError *error)
{
HANDLE thread_handle;
MonoNativeThreadId tid;
*/
mono_threads_join_threads ();
+ mono_error_init (error);
+
mono_threads_lock ();
if (shutting_down) {
g_free (start_info);
stack_size, create_flags, &tid);
if (thread_handle == NULL) {
- /* The thread couldn't be created, so throw an exception */
+ /* The thread couldn't be created, so set an exception */
mono_threads_lock ();
mono_g_hash_table_remove (threads_starting_up, thread);
mono_threads_unlock ();
g_free (start_info);
- if (throw_on_failure)
- mono_raise_exception (mono_get_exception_execution_engine ("Couldn't create thread"));
- else
- g_warning ("%s: CreateThread error 0x%x", __func__, GetLastError ());
+ mono_error_set_execution_engine (error, "Couldn't create thread. Error 0x%x", GetLastError());
return FALSE;
}
THREAD_DEBUG (g_message ("%s: Started thread ID %"G_GSIZE_FORMAT" (handle %p)", __func__, tid, thread_handle));
start_info->obj = thread;
start_info->start_arg = arg;
- res = create_thread (thread, internal, start_info, threadpool_thread, stack_size, TRUE);
- if (!res)
+ res = create_thread (thread, internal, start_info, threadpool_thread, stack_size, &error);
+ if (!res) {
+ mono_error_raise_exception (&error); /* FIXME don't raise here */
return NULL;
+ }
/* Check that the managed and unmanaged layout of MonoInternalThread matches */
#ifndef MONO_CROSS_COMPILE
thread_adjust_static_data (thread);
- init_root_domain_thread (thread, current_thread);
+ init_root_domain_thread (thread, current_thread, error);
+ return_val_if_nok (error, NULL);
+
if (domain != mono_get_root_domain ())
set_current_thread_for_domain (domain, thread, current_thread);
mono_thread_attach_cb (MONO_NATIVE_THREAD_ID_TO_UINT (tid), staddr + stsize);
}
- // FIXME: Need a separate callback
- mono_profiler_thread_start (MONO_NATIVE_THREAD_ID_TO_UINT (tid));
+ /* Can happen when we attach the profiler helper thread in order to heapshot. */
+ if (!info->tools_thread)
+ // FIXME: Need a separate callback
+ mono_profiler_thread_start (MONO_NATIVE_THREAD_ID_TO_UINT (tid));
return current_thread;
}
ves_icall_System_Threading_Thread_Thread_internal (MonoThread *this_obj,
MonoObject *start)
{
+ MonoError error;
StartInfo *start_info;
MonoInternalThread *internal;
gboolean res;
start_info->obj = this_obj;
g_assert (this_obj->obj.vtable->domain == mono_domain_get ());
- res = create_thread (this_obj, internal, start_info, FALSE, 0, FALSE);
+ res = create_thread (this_obj, internal, start_info, FALSE, 0, &error);
if (!res) {
+ mono_error_cleanup (&error);
UNLOCK_THREAD (internal);
return NULL;
}
}
void
-mono_thread_set_name_internal (MonoInternalThread *this_obj, MonoString *name, gboolean managed)
+mono_thread_set_name_internal (MonoInternalThread *this_obj, MonoString *name, gboolean managed, MonoError *error)
{
LOCK_THREAD (this_obj);
+ mono_error_init (error);
+
if ((this_obj->flags & MONO_THREAD_FLAG_NAME_SET) && !this_obj->threadpool_thread) {
UNLOCK_THREAD (this_obj);
- mono_raise_exception (mono_get_exception_invalid_operation ("Thread.Name can only be set once."));
+ mono_error_set_invalid_operation (error, "Thread.Name can only be set once.");
return;
}
if (this_obj->name) {
void
ves_icall_System_Threading_Thread_SetName_internal (MonoInternalThread *this_obj, MonoString *name)
{
- mono_thread_set_name_internal (this_obj, name, TRUE);
+ MonoError error;
+ mono_thread_set_name_internal (this_obj, name, TRUE, &error);
+ mono_error_set_pending_exception (&error);
}
/*
klass = mono_class_from_mono_type (type);
mono_class_init (klass);
- if (mono_loader_get_last_error () || mono_class_has_failure (klass)) {
+ if (mono_class_has_failure (klass)) {
if (klass->generic_class && !mono_class_is_valid_generic_instantiation (NULL, klass))
ADD_VERIFY_ERROR2 (ctx, g_strdup_printf ("Invalid generic instantiation of type %s.%s at 0x%04x", klass->name_space, klass->name, ctx->ip_offset), MONO_EXCEPTION_TYPE_LOAD);
else
ADD_VERIFY_ERROR2 (ctx, g_strdup_printf ("Could not load type %s.%s at 0x%04x", klass->name_space, klass->name, ctx->ip_offset), MONO_EXCEPTION_TYPE_LOAD);
- mono_loader_clear_error ();
return FALSE;
}
mono_error_cleanup (&error); /*FIXME don't swallow the error */
}
- if (!type || mono_loader_get_last_error ()) {
+ if (!type) {
ADD_VERIFY_ERROR2 (ctx, g_strdup_printf ("Cannot load type from token 0x%08x for %s at 0x%04x", token, opcode, ctx->ip_offset), MONO_EXCEPTION_BAD_IMAGE);
- mono_loader_clear_error ();
return NULL;
}
MINI_RUNTIME = MONO_PATH=$(CLASS) $(RUNTIME_EXECUTABLE)
RUNTIME_AOTCHECK = MONO_PATH="$(CLASS)$(PLATFORM_PATH_SEPARATOR)." $(RUNTIME_EXECUTABLE)
-MCS = $(MINI_RUNTIME) $(mcs_topdir)/class/lib/build/mcs.exe -unsafe -nowarn:0162
+CSC = $(mcs_topdir)/class/lib/build/mcs.exe
+MCS = CSC_SDK_PATH_DISABLED= $(MINI_RUNTIME) $(CSC) -unsafe -nowarn:0162 -nologo -noconfig -r:$(CLASS)/mscorlib.dll -r:$(CLASS)/System.dll
ILASM = $(MINI_RUNTIME) $(CLASS)/ilasm.exe
AM_CFLAGS = \
CSFLAGS = -unsafe -nowarn:0219,0169,0414,0649
basic-simd.exe: basic-simd.cs TestDriver.dll
- $(MCS) -out:$@ $(CSFLAGS) $< -r:TestDriver.dll -r:Mono.Simd.dll
+ $(MCS) -out:$@ $(CSFLAGS) $< -r:TestDriver.dll -r:$(CLASS)/Mono.Simd.dll
nacl.exe: nacl.cs TestDriver.dll
- $(MCS) -out:$@ $(CSFLAGS) $< -r:TestDriver.dll -r:Mono.Simd.dll
+ $(MCS) -out:$@ $(CSFLAGS) $< -r:TestDriver.dll -r:$(CLASS)/Mono.Simd.dll
generics.exe: generics.cs TestDriver.dll generics-variant-types.dll
- $(MCS) -out:$@ $(CSFLAGS) $< -r:TestDriver.dll -r:generics-variant-types.dll
+ $(MCS) -out:$@ $(CSFLAGS) $< -r:TestDriver.dll -r:generics-variant-types.dll -r:$(CLASS)/System.Core.dll
%.exe: %.cs TestDriver.dll
$(MCS) -out:$@ $(CSFLAGS) $< -r:TestDriver.dll
/* Similar to the specific trampolines, but use the rgctx reg instead of ip1 */
/* Load argument from first GOT slot */
- g_assert (MONO_ARCH_RGCTX_REG == 27);
- arm64_emit_load_got_slot (acfg, ARMREG_R27, offset);
+ arm64_emit_load_got_slot (acfg, MONO_ARCH_RGCTX_REG, offset);
/* Load generic trampoline address from second GOT slot */
arm64_emit_load_got_slot (acfg, ARMREG_R16, offset + 1);
fprintf (acfg->fp, "br x16\n");
cfg = mini_method_compile (method, acfg->opts, mono_get_root_domain (), flags, 0, index);
mono_time_track_end (&mono_jit_stats.jit_time, jit_timer);
- mono_loader_clear_error ();
-
if (cfg->exception_type == MONO_EXCEPTION_GENERIC_SHARING_FAILED) {
if (acfg->aot_opts.print_skipped_methods)
printf ("Skip (gshared failure): %s (%s)\n", mono_method_get_full_name (method), cfg->exception_message);
GPtrArray *methods = (GPtrArray *)user_data [2];
int i;
- mono_thread_attach (domain);
+ MonoError error;
+ MonoThread *thread = mono_thread_attach (domain);
+ mono_thread_set_name_internal (thread->internal_thread, mono_string_new (mono_get_root_domain (), "AOT compiler"), TRUE, &error);
+ mono_error_assert_ok (&error);
for (i = 0; i < methods->len; ++i)
compile_method (acfg, (MonoMethod *)g_ptr_array_index (methods, i));
MonoError error;
type_resolve = TRUE;
/* FIXME really okay to call while holding locks? */
- t = mono_reflection_get_type_checked (ass->image, &info, ignore_case, &type_resolve, &error);
+ t = mono_reflection_get_type_checked (ass->image, ass->image, &info, ignore_case, &type_resolve, &error);
mono_error_cleanup (&error);
if (t) {
g_ptr_array_add (res_classes, mono_type_get_class (t));
} else {
if (info.assembly.name)
NOT_IMPLEMENTED;
- t = mono_reflection_get_type_checked (ass->image, &info, ignorecase, &type_resolve, &error);
+ t = mono_reflection_get_type_checked (ass->image, ass->image, &info, ignorecase, &type_resolve, &error);
if (!is_ok (&error)) {
mono_error_cleanup (&error); /* FIXME don't swallow the error */
mono_reflection_free_type_info (&info);
static guint32 WINAPI
debugger_thread (void *arg)
{
+ MonoError error;
int res, len, id, flags, command = 0;
CommandSet command_set = (CommandSet)0;
guint8 header [HEADER_LENGTH];
debugger_thread_id = mono_native_thread_id_get ();
attach_cookie = mono_jit_thread_attach (mono_get_root_domain (), &attach_dummy);
+ MonoInternalThread *thread = mono_thread_internal_current ();
+ mono_thread_set_name_internal (thread, mono_string_new (mono_get_root_domain (), "Debugger agent"), TRUE, &error);
+ mono_error_assert_ok (&error);
- mono_thread_internal_current ()->flags |= MONO_THREAD_FLAG_DONT_MANAGE;
+ thread->flags |= MONO_THREAD_FLAG_DONT_MANAGE;
mono_set_is_debugger_attached (TRUE);
" --agent=ASSEMBLY[:ARG] Loads the specific agent assembly and executes its Main method with the given argument before loading the main assembly.\n"
" --no-x86-stack-align Don't align stack on x86\n"
"\n"
+ "The options supported by MONO_DEBUG can also be passed on the command line.\n"
+ "\n"
"Other options:\n"
" --graph[=TYPE] METHOD Draws a graph of the specified method:\n");
#else
mono_use_llvm = TRUE;
#endif
+ } else if (argv [i][0] == '-' && argv [i][1] == '-' && mini_parse_debug_option (argv [i] + 2)) {
} else {
fprintf (stderr, "Unsupported command line option: '%s'\n", argv [i]);
exit (1);
} else if (strcmp (argv [i], "--nacl-null-checks-off") == 0){
nacl_null_checks_off = TRUE;
#endif
+ } else if (argv [i][0] == '-' && argv [i][1] == '-' && mini_parse_debug_option (argv [i] + 2)) {
} else {
fprintf (stderr, "Unknown command line option: '%s'\n", argv [i]);
return 1;
/* Set rootdir before loading config */
mono_set_rootdir ();
- if (enable_profile)
+ /*
+ * We only set the native name of the thread since MS.NET leaves the
+ * managed thread name for the main thread as null.
+ */
+ mono_thread_info_set_name (mono_native_thread_id_get (), "Main");
+
+ if (enable_profile) {
mono_profiler_load (profile_options);
+ mono_profiler_thread_name (mono_native_thread_id_get (), "Main");
+ }
mono_attach_parse_options (attach_options);
#define LINE_BASE -5
#define LINE_RANGE 14
-/* Subsections of the .debug_line section */
-#define LINE_SUBSECTION_HEADER 1
-#define LINE_SUBSECTION_INCLUDES 2
-#define LINE_SUBSECTION_FILES 3
-#define LINE_SUBSECTION_DATA 4
-#define LINE_SUBSECTION_END 5
-
-static int
-emit_line_number_file_name (MonoDwarfWriter *w, const char *name,
- gint64 last_mod_time, gint64 file_size)
-{
- int index;
- int dir_index;
- char *basename = NULL;
-
- if (!w->file_to_index)
- w->file_to_index = g_hash_table_new (g_str_hash, g_str_equal);
-
- index = GPOINTER_TO_UINT (g_hash_table_lookup (w->file_to_index, name));
- if (index > 0)
- return index;
-
- if (g_path_is_absolute (name)) {
- char *dir = g_path_get_dirname (name);
-
- if (!w->dir_to_index)
- w->dir_to_index = g_hash_table_new (g_str_hash, g_str_equal);
-
- dir_index = GPOINTER_TO_UINT (g_hash_table_lookup (w->dir_to_index, dir));
- if (dir_index == 0) {
- emit_section_change (w, ".debug_line", LINE_SUBSECTION_INCLUDES);
- emit_string (w, dir);
-
- dir_index = ++ w->line_number_dir_index;
- g_hash_table_insert (w->dir_to_index, g_strdup (dir), GUINT_TO_POINTER (dir_index));
- }
-
- g_free (dir);
-
- basename = g_path_get_basename (name);
- } else {
- dir_index = 0;
- }
-
- emit_section_change (w, ".debug_line", LINE_SUBSECTION_FILES);
-
- if (basename)
- emit_string (w, basename);
- else
- emit_string (w, name);
- emit_uleb128 (w, dir_index);
- emit_byte (w, 0);
- emit_byte (w, 0);
-
- emit_section_change (w, ".debug_line", LINE_SUBSECTION_DATA);
-
- if (basename)
- g_free (basename);
-
- index = ++ w->line_number_file_index;
- g_hash_table_insert (w->file_to_index, g_strdup (name), GUINT_TO_POINTER (index));
-
- return index;
-}
-
static int
get_line_number_file_name (MonoDwarfWriter *w, const char *name)
{
addr_diff = i - prev_native_offset;
if (first) {
- emit_section_change (w, ".debug_line", LINE_SUBSECTION_DATA);
+ emit_section_change (w, ".debug_line", 0);
emit_byte (w, 0);
emit_byte (w, sizeof (gpointer) + 1);
il_to_line = g_new0 (int, header->code_size);
- emit_section_change (w, ".debug_line", LINE_SUBSECTION_DATA);
+ emit_section_change (w, ".debug_line", 0);
emit_byte (w, 0);
emit_byte (w, sizeof (gpointer) + 1);
emit_byte (w, DW_LNE_set_address);
if (mono_object_isinst_checked (exc, mono_defaults.exception_class, &error)) {
MonoException *mono_ex = (MonoException*)exc;
- if (!rethrow)
+ if (!rethrow) {
mono_ex->stack_trace = NULL;
+ mono_ex->trace_ips = NULL;
+ }
}
mono_error_assert_ok (&error);
return FALSE;
}
-void
-mono_arch_sigctx_to_monoctx (void *sigctx, MonoContext *mctx)
-{
- mono_sigctx_to_monoctx (sigctx, mctx);
-}
-
-void
-mono_arch_monoctx_to_sigctx (MonoContext *mctx, void *sigctx)
-{
- mono_monoctx_to_sigctx (mctx, sigctx);
-}
-
/*
* handle_exception:
*
jit_tls = mono_native_tls_get_value (mono_jit_tls_id);
/* Pass the ctx parameter in TLS */
- mono_arch_sigctx_to_monoctx (sigctx, &jit_tls->ex_ctx);
+ mono_sigctx_to_monoctx (sigctx, &jit_tls->ex_ctx);
/* The others in registers */
UCONTEXT_REG_R0 (sigctx) = (gsize)obj;
if (cfg->verbose_level > 2)
printf ("INLINE ABORTED %s (cost %d)\n", mono_method_full_name (cmethod, TRUE), costs);
cfg->exception_type = MONO_EXCEPTION_NONE;
- mono_loader_clear_error ();
/* This gets rid of the newly added bblocks */
cfg->cbb = prev_cbb;
DEBUG_AMD64_GSHAREDVT_PRINT ("source sig: (%s) return (%s)\n", mono_signature_get_desc (caller_sig, FALSE), mono_type_full_name (mono_signature_get_return_type (caller_sig))); // Leak
DEBUG_AMD64_GSHAREDVT_PRINT ("dest sig: (%s) return (%s)\n", mono_signature_get_desc (callee_sig, FALSE), mono_type_full_name (mono_signature_get_return_type (callee_sig)));
- if (gcinfo->ret.is_gsharedvt_return_value) {
+ if (gcinfo->ret.storage == ArgGsharedvtVariableInReg) {
/*
* The return type is gsharedvt
*/
if (cinfo->ret.storage == ArgValuetypeAddrInIReg) {
/* Both the caller and the callee pass the vtype ret address in r8 */
- g_assert (cinfo->ret.storage == gcinfo->ret.storage);
+ g_assert (gcinfo->ret.storage == ArgValuetypeAddrInIReg || gcinfo->ret.storage == ArgGsharedvtVariableInReg);
add_to_map (map, map_reg (cinfo->ret.reg), map_reg (cinfo->ret.reg));
}
info->calli = calli;
if (var_ret) {
- g_assert (gcinfo->ret.is_gsharedvt_return_value);
+ g_assert (gcinfo->ret.storage == ArgGsharedvtVariableInReg);
info->vret_arg_reg = map_reg (gcinfo->ret.reg);
DEBUG_AMD64_GSHAREDVT_PRINT ("mapping vreg_arg_reg to %d in reg %s\n", info->vret_arg_reg, mono_arch_regname (gcinfo->ret.reg));
} else {
return info;
}
-#endif
\ No newline at end of file
+#endif
cinfo = (CallInfo *)g_malloc0 (sizeof (CallInfo) + (sizeof (ArgInfo) * n));
cinfo->nargs = n;
+ cinfo->gsharedvt = mini_is_gsharedvt_variable_signature (sig);
gr = 0;
fr = 0;
break;
}
if (mini_is_gsharedvt_type (ret_type)) {
- cinfo->ret.storage = ArgValuetypeAddrInIReg;
- cinfo->ret.is_gsharedvt_return_value = 1;
+ cinfo->ret.storage = ArgGsharedvtVariableInReg;
break;
}
/* fall through */
case MONO_TYPE_VAR:
case MONO_TYPE_MVAR:
g_assert (mini_is_gsharedvt_type (ret_type));
- cinfo->ret.storage = ArgValuetypeAddrInIReg;
- cinfo->ret.is_gsharedvt_return_value = 1;
+ cinfo->ret.storage = ArgGsharedvtVariableInReg;
break;
case MONO_TYPE_VOID:
break;
* are sometimes made using calli without sig->hasthis set, like in the delegate
* invoke wrappers.
*/
- if (cinfo->ret.storage == ArgValuetypeAddrInIReg && !is_pinvoke && (sig->hasthis || (sig->param_count > 0 && MONO_TYPE_IS_REFERENCE (mini_get_underlying_type (sig->params [0]))))) {
+ ArgStorage ret_storage = cinfo->ret.storage;
+ if ((ret_storage == ArgValuetypeAddrInIReg || ret_storage == ArgGsharedvtVariableInReg) && !is_pinvoke && (sig->hasthis || (sig->param_count > 0 && MONO_TYPE_IS_REFERENCE (mini_get_underlying_type (sig->params [0]))))) {
if (sig->hasthis) {
add_general (&gr, &stack_size, cinfo->args + 0);
} else {
pstart = 1;
}
add_general (&gr, &stack_size, &cinfo->ret);
- cinfo->ret.storage = ArgValuetypeAddrInIReg;
+ cinfo->ret.storage = ret_storage;
cinfo->vret_arg_index = 1;
} else {
/* this */
if (sig->hasthis)
add_general (&gr, &stack_size, cinfo->args + 0);
- if (cinfo->ret.storage == ArgValuetypeAddrInIReg) {
+ if (ret_storage == ArgValuetypeAddrInIReg || ret_storage == ArgGsharedvtVariableInReg) {
add_general (&gr, &stack_size, &cinfo->ret);
- cinfo->ret.storage = ArgValuetypeAddrInIReg;
+ cinfo->ret.storage = ret_storage;
}
}
cfg->ret->dreg = cinfo->ret.reg;
break;
case ArgValuetypeAddrInIReg:
+ case ArgGsharedvtVariableInReg:
/* The register is volatile */
cfg->vret_addr->opcode = OP_REGOFFSET;
cfg->vret_addr->inst_basereg = cfg->frame_reg;
cfg->ret_var_is_local = TRUE;
sig_ret = mini_get_underlying_type (sig->ret);
- if (cinfo->ret.storage == ArgValuetypeAddrInIReg) {
+ if (cinfo->ret.storage == ArgValuetypeAddrInIReg || cinfo->ret.storage == ArgGsharedvtVariableInReg) {
cfg->vret_addr = mono_compile_create_var (cfg, &mono_defaults.int_class->byval_arg, OP_ARG);
if (G_UNLIKELY (cfg->verbose_level > 1)) {
printf ("vret_addr = ");
break;
}
case ArgValuetypeAddrInIReg:
+ case ArgGsharedvtVariableInReg:
/* Vtype returned using a hidden argument */
linfo->ret.storage = LLVMArgVtypeRetAddr;
linfo->vret_arg_index = cinfo->vret_arg_index;
MONO_EMIT_NEW_UNALU (cfg, OP_MOVE, ((MonoInst*)cfg->arch.vret_addr_loc)->dreg, call->vret_var->dreg);
}
break;
- case ArgValuetypeAddrInIReg: {
+ case ArgValuetypeAddrInIReg:
+ case ArgGsharedvtVariableInReg: {
MonoInst *vtarg;
MONO_INST_NEW (cfg, vtarg, OP_MOVE);
vtarg->sreg1 = call->vret_var->dreg;
pindex = 1;
}
- if (dinfo->cinfo->ret.storage == ArgValuetypeAddrInIReg)
+ if (dinfo->cinfo->ret.storage == ArgValuetypeAddrInIReg || dinfo->cinfo->ret.storage == ArgGsharedvtVariableInReg)
p->regs [greg ++] = PTR_TO_GREG(ret);
for (i = pindex; i < sig->param_count; i++) {
/* Fall through */
}
case MONO_TYPE_VALUETYPE:
- if (dinfo->cinfo->ret.storage == ArgValuetypeAddrInIReg) {
+ if (dinfo->cinfo->ret.storage == ArgValuetypeAddrInIReg || dinfo->cinfo->ret.storage == ArgGsharedvtVariableInReg) {
/* Nothing to do */
} else {
ArgInfo *ainfo = &dinfo->cinfo->ret;
/* gsharedvt argument passed by addr */
ArgGSharedVtInReg,
ArgGSharedVtOnStack,
+ /* Variable sized gsharedvt argument passed/returned by addr */
+ ArgGsharedvtVariableInReg,
ArgNone /* only in pair_storage */
} ArgStorage;
gint16 offset;
gint8 reg;
ArgStorage storage : 8;
- gboolean is_gsharedvt_return_value : 1;
/* Only if storage == ArgValuetypeInReg */
ArgStorage pair_storage [2];
guint32 reg_usage;
guint32 freg_usage;
gboolean need_stack_align;
+ gboolean gsharedvt;
/* The index of the vret arg in the argument list */
int vret_arg_index;
ArgInfo ret;
.align 4
DECLARE_GLOBAL_SYMBOL mono_fast_get_tls_key2
bic r0, r0, #0x80000000
- mrc 15, 0, r1, cr13, cr0, #3
+ mrc p15, 0, r1, cr13, cr0, #3
lsls r0, r0, #3
ldr r1, [r1, #4]
add r0, r1
.align 4
DECLARE_GLOBAL_SYMBOL mono_fast_set_tls_key2
bic r0, r0, #0x80000000
- mrc 15, 0, r2, cr13, cr0, #3
+ mrc p15, 0, r2, cr13, cr0, #3
lsls r0, r0, #3
ldr r2, [r2, #4]
add r0, r2
/*
* GSHAREDVT
*/
-#ifdef MONO_ARCH_GSHARED_SUPPORTED
+#ifdef MONO_ARCH_GSHAREDVT_SUPPORTED
#define ALIGN_TO(val,align) ((((guint64)val) + ((align) - 1)) & ~((align) - 1))
{
}
-#endif /* MONO_ARCH_GSHARED_SUPPORTED */
\ No newline at end of file
+#endif /* MONO_ARCH_GSHAREDVT_SUPPORTED */
int field_offsets [16];
guint32 align;
- size = mini_type_stack_size_full (t, &align, FALSE);
+ size = mini_type_stack_size_full (t, &align, cinfo->pinvoke);
align_size = ALIGN_TO (size, 8);
- nregs = size / 8;
+ nregs = align_size / 8;
if (is_hfa (t, &nfields, &esize, field_offsets)) {
/*
* The struct might include nested float structs aligned at 8,
cinfo = g_malloc0 (sizeof (CallInfo) + (sizeof (ArgInfo) * n));
cinfo->nargs = n;
+ cinfo->pinvoke = sig->pinvoke;
/* Return value */
add_param (cinfo, &cinfo->ret, sig->ret);
return get_call_info (mp, sig);
}
+gpointer
+mono_arch_install_handler_block_guard (MonoJitInfo *ji, MonoJitExceptionInfo *clause, MonoContext *ctx, gpointer new_value)
+{
+ gpointer *lr_loc;
+ char *old_value;
+ char *bp;
+
+ /*Load the spvar*/
+ bp = MONO_CONTEXT_GET_BP (ctx);
+ lr_loc = (gpointer*)(bp + clause->exvar_offset);
+
+ old_value = *lr_loc;
+ if ((char*)old_value < (char*)ji->code_start || (char*)old_value > ((char*)ji->code_start + ji->code_size))
+ return old_value;
+
+ *lr_loc = new_value;
+
+ return old_value;
+}
#define MONO_ARCH_HAVE_OP_GENERIC_CLASS_INIT 1
#define MONO_ARCH_HAVE_OPCODE_NEEDS_EMULATION 1
#define MONO_ARCH_HAVE_DECOMPOSE_LONG_OPTS 1
+#define MONO_ARCH_HAVE_HANDLER_BLOCK_GUARD 1
#ifdef TARGET_IOS
#endif
-#if defined(TARGET_APPLETVOS)
+#if defined(TARGET_APPLETVOS) || defined(TARGET_IOS)
#define MONO_ARCH_HAVE_UNWIND_BACKTRACE 1
#endif
typedef struct {
int nargs;
int gr, fr, stack_usage;
+ gboolean pinvoke;
ArgInfo ret;
ArgInfo sig_cookie;
ArgInfo args [1];
*/
#include <config.h>
+#include <mono/utils/mono-logger-internals.h>
+
/*
* Attempt to handle native SIGSEGVs with libunwind or libcorkscrew.
*/
#define UNW_LOCAL_ONLY
#undef _U /* ctype.h apparently defines this and it screws up the libunwind headers. */
-#include "android-libunwind/libunwind.h"
+#include "../../external/android-libunwind/include/libunwind.h"
#define _U 0x01
#define FUNC_NAME_LENGTH 512
/* Lazy class loading functions */
static GENERATE_TRY_GET_CLASS_WITH_CACHE (iasync_state_machine, System.Runtime.CompilerServices, IAsyncStateMachine)
-static GENERATE_TRY_GET_CLASS_WITH_CACHE (async_state_machine_attribute, System.Runtime.CompilerServices, AsyncStateMachineAttribute)
-
static G_GNUC_UNUSED gboolean
is_async_state_machine_class (MonoClass *klass)
gboolean is_virtual, calli, preserveall;
LLVMBuilderRef builder = *builder_ref;
- if (call->signature->call_convention != MONO_CALL_DEFAULT) {
+ if ((call->signature->call_convention != MONO_CALL_DEFAULT) && !((call->signature->call_convention == MONO_CALL_C) && ctx->llvm_only)) {
set_failure (ctx, "non-default callconv");
return;
}
#include <sys/syscall.h>
#endif
#include <errno.h>
-
+#include <sched.h>
#include <mono/metadata/assembly.h>
#include <mono/metadata/loader.h>
#include <mono/utils/dtrace.h>
#include <mono/utils/mono-signal-handler.h>
#include <mono/utils/mono-threads.h>
+#include <mono/utils/mono-threads-posix-signals.h>
#include "mini.h"
#include <string.h>
#include "jit-icalls.h"
+#ifdef PLATFORM_MACOSX
+#include <mach/mach.h>
+#include <mach/mach_time.h>
+#include <mach/clock.h>
+#endif
+
#if defined(__native_client__) || defined(HOST_WATCHOS)
void
#define FULL_STAT_PROFILER_BACKTRACE 0
#endif
-#ifdef SIGPROF
-
-static int profiling_signal_in_use;
-
-#if defined(__ia64__) || defined(__sparc__) || defined(sparc)
-
-MONO_SIG_HANDLER_FUNC (static, sigprof_signal_handler)
-{
- if (mono_chain_signal (MONO_SIG_HANDLER_PARAMS))
- return;
-
- NOT_IMPLEMENTED;
-}
+#if (defined (USE_POSIX_BACKEND) && defined (SIGRTMIN)) || defined (SIGPROF)
+#define HAVE_PROFILER_SIGNAL
+#endif
-#else
+#ifdef HAVE_PROFILER_SIGNAL
static void
per_thread_profiler_hit (void *ctx)
}
}
-MONO_SIG_HANDLER_FUNC (static, sigprof_signal_handler)
+MONO_SIG_HANDLER_FUNC (static, profiler_signal_handler)
{
int old_errno = errno;
int hp_save_index;
hp_save_index = mono_hazard_pointer_save_for_signal_handler ();
- /* If we can't consume a profiling request it means we're the initiator. */
- if (!(mono_threads_consume_async_jobs () & MONO_SERVICE_REQUEST_SAMPLE)) {
- FOREACH_THREAD_SAFE (info) {
- if (mono_thread_info_get_tid (info) == mono_native_thread_id_get () ||
- !mono_thread_info_is_live (info))
- continue;
-
- mono_threads_add_async_job (info, MONO_SERVICE_REQUEST_SAMPLE);
- mono_threads_pthread_kill (info, profiling_signal_in_use);
- } FOREACH_THREAD_SAFE_END
- }
-
mono_thread_info_set_is_async_context (TRUE);
per_thread_profiler_hit (ctx);
mono_thread_info_set_is_async_context (FALSE);
mono_chain_signal (MONO_SIG_HANDLER_PARAMS);
}
-#endif
#endif
MONO_SIG_HANDLER_FUNC (static, sigquit_signal_handler)
free_saved_signal_handlers ();
}
-#ifdef HAVE_LINUX_RTC_H
-#include <linux/rtc.h>
-#include <sys/ioctl.h>
-#include <fcntl.h>
-static int rtc_fd = -1;
+#ifdef HAVE_PROFILER_SIGNAL
+
+#ifdef PLATFORM_MACOSX
+
+static clock_serv_t sampling_clock_service;
-static int
-enable_rtc_timer (gboolean enable)
+static void
+clock_init (void)
{
- int flags;
- flags = fcntl (rtc_fd, F_GETFL);
- if (flags < 0) {
- perror ("getflags");
- return 0;
- }
- if (enable)
- flags |= FASYNC;
- else
- flags &= ~FASYNC;
- if (fcntl (rtc_fd, F_SETFL, flags) == -1) {
- perror ("setflags");
- return 0;
- }
- return 1;
+ kern_return_t ret;
+
+ if ((ret = host_get_clock_service (mach_host_self (), SYSTEM_CLOCK, &sampling_clock_service)) != KERN_SUCCESS)
+ g_error ("%s: host_get_clock_service () returned %d", __func__, ret);
}
-#endif
-void
-mono_runtime_shutdown_stat_profiler (void)
+static void
+clock_cleanup (void)
{
-#ifdef HAVE_LINUX_RTC_H
- if (rtc_fd >= 0)
- enable_rtc_timer (FALSE);
-#endif
+ kern_return_t ret;
+
+ if ((ret = mach_port_deallocate (mach_task_self (), sampling_clock_service)) != KERN_SUCCESS)
+ g_error ("%s: mach_port_deallocate () returned %d", __func__, ret);
}
-#ifdef ITIMER_PROF
-static int
-get_itimer_mode (void)
+static guint64
+clock_get_time_ns (void)
{
- switch (mono_profiler_get_sampling_mode ()) {
- case MONO_PROFILER_STAT_MODE_PROCESS: return ITIMER_PROF;
- case MONO_PROFILER_STAT_MODE_REAL: return ITIMER_REAL;
- }
- g_assert_not_reached ();
- return 0;
+ kern_return_t ret;
+ mach_timespec_t mach_ts;
+
+ if ((ret = clock_get_time (sampling_clock_service, &mach_ts)) != KERN_SUCCESS)
+ g_error ("%s: clock_get_time () returned %d", __func__, ret);
+
+ return ((guint64) mach_ts.tv_sec * 1000000000) + (guint64) mach_ts.tv_nsec;
}
-static int
-get_itimer_signal (void)
+static void
+clock_sleep_ns_abs (guint64 ns_abs)
+{
+ kern_return_t ret;
+ mach_timespec_t then, remain_unused;
+
+ then.tv_sec = ns_abs / 1000000000;
+ then.tv_nsec = ns_abs % 1000000000;
+
+ do {
+ ret = clock_sleep (sampling_clock_service, TIME_ABSOLUTE, then, &remain_unused);
+
+ if (ret != KERN_SUCCESS && ret != KERN_ABORTED)
+ g_error ("%s: clock_sleep () returned %d", __func__, ret);
+ } while (ret == KERN_ABORTED);
+}
+
+#else
+
+clockid_t sampling_posix_clock;
+
+static void
+clock_init (void)
{
switch (mono_profiler_get_sampling_mode ()) {
- case MONO_PROFILER_STAT_MODE_PROCESS: return SIGPROF;
- case MONO_PROFILER_STAT_MODE_REAL: return SIGALRM;
+ case MONO_PROFILER_STAT_MODE_PROCESS:
+#ifdef HAVE_CLOCK_NANOSLEEP
+ /*
+ * If we don't have clock_nanosleep (), measuring the process time
+ * makes very little sense as we can only use nanosleep () to sleep on
+ * real time.
+ */
+ sampling_posix_clock = CLOCK_PROCESS_CPUTIME_ID;
+ break;
+#endif
+ case MONO_PROFILER_STAT_MODE_REAL: sampling_posix_clock = CLOCK_MONOTONIC; break;
+ default: g_assert_not_reached (); break;
}
- g_assert_not_reached ();
- return 0;
}
+
+static void
+clock_cleanup (void)
+{
+}
+
+static guint64
+clock_get_time_ns (void)
+{
+ struct timespec ts;
+
+ if (clock_gettime (sampling_posix_clock, &ts) == -1)
+ g_error ("%s: clock_gettime () returned -1, errno = %d", __func__, errno);
+
+ return ((guint64) ts.tv_sec * 1000000000) + (guint64) ts.tv_nsec;
+}
+
+static void
+clock_sleep_ns_abs (guint64 ns_abs)
+{
+#ifdef HAVE_CLOCK_NANOSLEEP
+ int ret;
+ struct timespec then;
+
+ then.tv_sec = ns_abs / 1000000000;
+ then.tv_nsec = ns_abs % 1000000000;
+
+ do {
+ ret = clock_nanosleep (sampling_posix_clock, TIMER_ABSTIME, &then, NULL);
+
+ if (ret != 0 && ret != EINTR)
+ g_error ("%s: clock_nanosleep () returned %d", __func__, ret);
+ } while (ret == EINTR);
+#else
+ int ret;
+ gint64 diff;
+ struct timespec req;
+
+ /*
+ * What follows is a crude attempt at emulating clock_nanosleep () on OSs
+ * which don't provide it (e.g. FreeBSD).
+ *
+ * The problem with nanosleep () is that if it is interrupted by a signal,
+ * time will drift as a result of having to restart the call after the
+ * signal handler has finished. For this reason, we avoid using the rem
+ * argument of nanosleep (). Instead, before every nanosleep () call, we
+ * check if enough time has passed to satisfy the sleep request. If yes, we
+ * simply return. If not, we calculate the difference and do another sleep.
+ *
+ * This should reduce the amount of drift that happens because we account
+ * for the time spent executing the signal handler, which nanosleep () is
+ * not guaranteed to do for the rem argument.
+ *
+ * The downside to this approach is that it is slightly expensive: We have
+ * to make an extra system call to retrieve the current time whenever we're
+ * going to restart a nanosleep () call. This is unlikely to be a problem
+ * in practice since the sampling thread won't be receiving many signals in
+ * the first place (it's a tools thread, so no STW), and because typical
+ * sleep periods for the thread are many orders of magnitude bigger than
+ * the time it takes to actually perform that system call (just a few
+ * nanoseconds).
+ */
+ do {
+ diff = (gint64) ns_abs - (gint64) clock_get_time_ns ();
+
+ if (diff <= 0)
+ break;
+
+ req.tv_sec = diff / 1000000000;
+ req.tv_nsec = diff % 1000000000;
+
+ if ((ret = nanosleep (&req, NULL)) == -1 && errno != EINTR)
+ g_error ("%s: nanosleep () returned -1, errno = %d", __func__, errno);
+ } while (ret == -1);
+#endif
+}
+
#endif
+static int profiler_signal;
+static MonoNativeThreadId sampling_thread;
+static volatile gint32 sampling_thread_running;
+
+static mono_native_thread_return_t
+sampling_thread_func (void *data)
+{
+ mono_threads_attach_tools_thread ();
+ mono_thread_info_set_name (mono_native_thread_id_get (), "Profiler sampler");
+
+ gint64 rate = 1000000000 / mono_profiler_get_sampling_rate ();
+
+ int old_policy;
+ struct sched_param old_sched;
+ pthread_getschedparam (pthread_self (), &old_policy, &old_sched);
+
+ /*
+ * Attempt to switch the thread to real time scheduling. This will not
+ * necessarily work on all OSs; for example, most Linux systems will give
+ * us EPERM here unless configured to allow this.
+ *
+ * TODO: This does not work on Mac (and maybe some other OSs). On Mac, we
+ * have to use the Mach thread policy routines to switch to real-time
+ * scheduling. This is quite tricky as we need to specify how often we'll
+ * be doing work (easy), the normal processing time needed (also easy),
+ * and the maximum amount of processing time needed (hard). This is
+ * further complicated by the fact that if we misbehave and take too long
+ * to do our work, the kernel may knock us back down to the normal thread
+ * scheduling policy without telling us.
+ */
+ struct sched_param sched = { .sched_priority = sched_get_priority_max (SCHED_FIFO) };
+ pthread_setschedparam (pthread_self (), SCHED_FIFO, &sched);
+
+ clock_init ();
+
+ guint64 sleep = clock_get_time_ns ();
+
+ while (InterlockedRead (&sampling_thread_running)) {
+ sleep += rate;
+
+ FOREACH_THREAD_SAFE (info) {
+ /* info should never be this thread as we're a tools thread. */
+ g_assert (mono_thread_info_get_tid (info) != mono_native_thread_id_get ());
+
+ mono_threads_pthread_kill (info, profiler_signal);
+ } FOREACH_THREAD_SAFE_END
+
+ clock_sleep_ns_abs (sleep);
+ }
+
+ clock_cleanup ();
+
+ pthread_setschedparam (pthread_self (), old_policy, &old_sched);
+
+ mono_thread_info_detach ();
+
+ return NULL;
+}
+
+void
+mono_runtime_shutdown_stat_profiler (void)
+{
+ InterlockedWrite (&sampling_thread_running, 0);
+ pthread_join (sampling_thread, NULL);
+
+ /*
+ * We can't safely remove the signal handler because we have no guarantee
+ * that all pending signals have been delivered at this point. This should
+ * not really be a problem anyway.
+ */
+ //remove_signal_handler (profiler_signal);
+}
+
void
mono_runtime_setup_stat_profiler (void)
{
-#ifdef ITIMER_PROF
- struct itimerval itval;
- static int inited = 0;
-#ifdef HAVE_LINUX_RTC_H
- const char *rtc_freq;
- if (!inited && (rtc_freq = g_getenv ("MONO_RTC"))) {
- int freq = 0;
- inited = 1;
- if (*rtc_freq)
- freq = atoi (rtc_freq);
- if (!freq)
- freq = 1024;
- rtc_fd = open ("/dev/rtc", O_RDONLY);
- if (rtc_fd == -1) {
- perror ("open /dev/rtc");
- return;
- }
- profiling_signal_in_use = SIGPROF;
- add_signal_handler (profiling_signal_in_use, sigprof_signal_handler, SA_RESTART);
- if (ioctl (rtc_fd, RTC_IRQP_SET, freq) == -1) {
- perror ("set rtc freq");
- return;
- }
- if (ioctl (rtc_fd, RTC_PIE_ON, 0) == -1) {
- perror ("start rtc");
- return;
- }
- if (fcntl (rtc_fd, F_SETSIG, SIGPROF) == -1) {
- perror ("setsig");
- return;
- }
- if (fcntl (rtc_fd, F_SETOWN, getpid ()) == -1) {
- perror ("setown");
- return;
- }
- enable_rtc_timer (TRUE);
- return;
- }
- if (rtc_fd >= 0)
- return;
+ /*
+ * Use a real-time signal when possible. This gives us roughly a 99% signal
+ * delivery rate in all cases. On the other hand, using a regular signal
+ * tends to result in awful delivery rates when the application is heavily
+ * loaded.
+ *
+ * TODO: On Mac, we should explore using the Mach thread suspend/resume
+ * functions and doing the stack walk from the sampling thread. This would
+ * get us a 100% sampling rate. However, this may interfere with the GC's
+ * STW logic. Could perhaps be solved by taking the suspend lock.
+ */
+#if defined (USE_POSIX_BACKEND) && defined (SIGRTMIN)
+ /* Just take the first real-time signal we can get. */
+ profiler_signal = mono_threads_posix_signal_search_alternative (-1);
+#else
+ profiler_signal = SIGPROF;
#endif
- itval.it_interval.tv_usec = (1000000 / mono_profiler_get_sampling_rate ()) - 1;
- itval.it_interval.tv_sec = 0;
- itval.it_value = itval.it_interval;
- if (inited)
- return;
- inited = 1;
- profiling_signal_in_use = get_itimer_signal ();
- add_signal_handler (profiling_signal_in_use, sigprof_signal_handler, SA_RESTART);
- setitimer (get_itimer_mode (), &itval, NULL);
-#endif
+ add_signal_handler (profiler_signal, profiler_signal_handler, SA_RESTART);
+
+ InterlockedWrite (&sampling_thread_running, 1);
+ mono_native_thread_create (&sampling_thread, sampling_thread_func, NULL);
+}
+
+#else
+
+void
+mono_runtime_shutdown_stat_profiler (void)
+{
+}
+
+void
+mono_runtime_setup_stat_profiler (void)
+{
}
+#endif
+
#if !defined(PLATFORM_MACOSX)
pid_t
mono_runtime_syscall_fork ()
}
#endif
-static void
+static G_GNUC_UNUSED void
no_imt_trampoline (void)
{
g_assert_not_reached ();
}
-static void
+static G_GNUC_UNUSED void
no_vcall_trampoline (void)
{
g_assert_not_reached ();
void
mini_cleanup (MonoDomain *domain)
{
- mono_runtime_shutdown_stat_profiler ();
+ if (mono_profiler_get_events () & MONO_PROFILE_STATISTICAL)
+ mono_runtime_shutdown_stat_profiler ();
#ifndef DISABLE_COM
cominterop_release_all_rcws ();
/* This accesses metadata so needs to be called before runtime shutdown */
print_jit_stats ();
- mono_profiler_shutdown ();
-
#ifndef MONO_CROSS_COMPILE
mono_runtime_cleanup (domain);
#endif
+ mono_profiler_shutdown ();
+
free_jit_tls_data ((MonoJitTlsData *)mono_native_tls_get_value (mono_jit_tls_id));
mono_icall_cleanup ();
res = mono_method_verify_with_current_settings (method, cfg->skip_visibility, is_fulltrust);
- if (mono_loader_get_last_error ()) {
- if (fail_compile) {
- mono_cfg_set_exception (cfg, MONO_EXCEPTION_MONO_ERROR);
- mono_error_set_from_loader_error (&cfg->error);
- } else {
- mono_loader_clear_error ();
- }
- if (res)
- mono_free_verify_list (res);
- return TRUE;
- }
-
if (res) {
for (tmp = res; tmp; tmp = tmp->next) {
MonoVerifyInfoExtended *info = (MonoVerifyInfoExtended *)tmp->data;
case MONO_EXCEPTION_MISSING_FIELD:
case MONO_EXCEPTION_MISSING_METHOD:
case MONO_EXCEPTION_FILE_NOT_FOUND:
- case MONO_EXCEPTION_BAD_IMAGE: {
+ case MONO_EXCEPTION_BAD_IMAGE:
+ case MONO_EXCEPTION_INVALID_PROGRAM: {
/* Throw a type load exception if needed */
if (cfg->exception_ptr) {
ex = mono_class_get_exception_for_failure ((MonoClass *)cfg->exception_ptr);
ex = mono_exception_from_name_msg (mono_defaults.corlib, "System.IO", "FileNotFoundException", cfg->exception_message);
else if (cfg->exception_type == MONO_EXCEPTION_BAD_IMAGE)
ex = mono_get_exception_bad_image_format (cfg->exception_message);
+ else if (cfg->exception_type == MONO_EXCEPTION_INVALID_PROGRAM)
+ ex = mono_exception_from_name_msg (mono_defaults.corlib, "System", "InvalidProgramException", cfg->exception_message);
else
g_assert_not_reached ();
}
return buf;
}
-#else
-
-gpointer
-mono_arch_get_gsharedvt_arg_trampoline (MonoDomain *domain, gpointer arg, gpointer addr)
-{
- g_assert_not_reached ();
- return NULL;
-}
-
-gpointer
-mono_arch_get_gsharedvt_trampoline (MonoTrampInfo **info, gboolean aot)
-{
- g_assert_not_reached ();
- return NULL;
-}
-
#endif
#else
return NULL;
}
-gpointer
-mono_arch_get_gsharedvt_arg_trampoline (MonoDomain *domain, gpointer arg, gpointer addr)
-{
- g_assert_not_reached ();
- return NULL;
-}
-
-gpointer
-mono_arch_get_gsharedvt_trampoline (MonoTrampInfo **info, gboolean aot)
-{
- *info = NULL;
- return NULL;
-}
-
#endif
\ No newline at end of file
/*
* GSHAREDVT
*/
-#ifdef MONO_ARCH_GSHARED_SUPPORTED
+#ifdef MONO_ARCH_GSHAREDVT_SUPPORTED
/*
* mono_arch_get_gsharedvt_arg_trampoline:
#endif
-#else
-
-gpointer
-mono_arch_get_gsharedvt_trampoline (MonoTrampInfo **info, gboolean aot)
-{
- if (info)
- *info = NULL;
- return NULL;
-}
-
-gpointer
-mono_arch_get_gsharedvt_arg_trampoline (MonoDomain *domain, gpointer arg, gpointer addr)
-{
- g_assert_not_reached ();
- return NULL;
-}
-
-#endif /* MONO_ARCH_GSHARED_SUPPORTED */
\ No newline at end of file
+#endif /* MONO_ARCH_GSHAREDVT_SUPPORTED */
guchar*
mono_arch_create_generic_trampoline (MonoTrampolineType tramp_type, MonoTrampInfo **info, gboolean aot)
{
- guint8 *code, *buf, *tramp;
+ guint8 *code, *buf, *tramp, *labels [16];
int i, buf_len, imm;
- int frame_size, offset, gregs_offset, num_fregs, fregs_offset, arg_offset, lmf_offset;
+ int frame_size, offset, gregs_offset, num_fregs, fregs_offset, arg_offset, lmf_offset, res_offset;
guint64 gregs_regset;
GSList *unwind_ops = NULL;
MonoJumpInfo *ji = NULL;
/* arg */
arg_offset = offset;
offset += 8;
+ /* result */
+ res_offset = offset;
+ offset += 8;
/* LMF */
lmf_offset = offset;
offset += sizeof (MonoLMF);
}
arm_blrx (code, ARMREG_IP0);
+ /* Save the result */
+ arm_strx (code, ARMREG_R0, ARMREG_FP, res_offset);
+
/* Restore LMF */
/* Similar to emit_restore_lmf () */
/* Clobbers ip0/ip1 */
/* *lmf_addr = previous_lmf */
arm_strx (code, ARMREG_IP1, ARMREG_IP0, 0);
- /* Save the result to ip1 */
- arm_movx (code, ARMREG_IP1, ARMREG_R0);
+ /* Check for thread interruption */
+ /* This is not perf critical code so no need to check the interrupt flag */
+ if (aot) {
+ code = mono_arm_emit_aotconst (&ji, code, buf, ARMREG_IP0, MONO_PATCH_INFO_JIT_ICALL_ADDR, "mono_thread_force_interruption_checkpoint_noraise");
+ } else {
+ code = mono_arm_emit_imm64 (code, ARMREG_IP0, (guint64)mono_thread_force_interruption_checkpoint_noraise);
+ }
+ arm_blrx (code, ARMREG_IP0);
+ /* Check whenever there is an exception to be thrown */
+ labels [0] = code;
+ arm_cbnzx (code, ARMREG_R0, 0);
+
+ /* Normal case */
/* Restore gregs */
/* Only have to load the argument regs (r0..r8) and the rgctx reg */
for (i = 0; i < num_fregs; ++i)
arm_ldrfpx (code, i, ARMREG_FP, fregs_offset + (i * 8));
+ /* Load the result */
+ arm_ldrx (code, ARMREG_IP1, ARMREG_FP, res_offset);
+
/* These trampolines return a value */
if (tramp_type == MONO_TRAMPOLINE_RGCTX_LAZY_FETCH)
arm_movx (code, ARMREG_R0, ARMREG_IP1);
else
arm_brx (code, ARMREG_IP1);
+ /* Exception case */
+ mono_arm_patch (labels [0], code, MONO_R_ARM64_CBZ);
+
+ /*
+ * We have an exception we want to throw in the caller's frame, so pop
+ * the trampoline frame and throw from the caller.
+ */
+ code = mono_arm_emit_destroy_frame (code, frame_size, ((1 << ARMREG_IP0)));
+ /* We are in the parent frame, the exception is in x0 */
+ /*
+ * EH is initialized after trampolines, so get the address of the variable
+ * which contains throw_exception, and load it from there.
+ */
+ if (aot) {
+ /* Not really a jit icall */
+ code = mono_arm_emit_aotconst (&ji, code, buf, ARMREG_IP0, MONO_PATCH_INFO_JIT_ICALL_ADDR, "throw_exception_addr");
+ } else {
+ code = mono_arm_emit_imm64 (code, ARMREG_IP0, (guint64)mono_get_throw_exception_addr ());
+ }
+ arm_ldrx (code, ARMREG_IP0, ARMREG_IP0, 0);
+ /* lr contains the return address, the trampoline will use it as the throw site */
+ arm_brx (code, ARMREG_IP0);
+
g_assert ((code - buf) < buf_len);
mono_arch_flush_icache (buf, code - buf);
return buf;
}
+static gpointer
+handler_block_trampoline_helper (gpointer *ptr)
+{
+ MonoJitTlsData *jit_tls = mono_native_tls_get_value (mono_jit_tls_id);
+ return jit_tls->handler_block_return_address;
+}
+
+gpointer
+mono_arch_create_handler_block_trampoline (MonoTrampInfo **info, gboolean aot)
+{
+ guint8 *tramp;
+ guint8 *code, *buf;
+ int tramp_size = 64;
+ MonoJumpInfo *ji = NULL;
+ GSList *unwind_ops = NULL;
+
+ g_assert (!aot);
+
+ code = buf = mono_global_codeman_reserve (tramp_size);
+
+ unwind_ops = NULL;
+
+ tramp = mono_arch_create_specific_trampoline (NULL, MONO_TRAMPOLINE_HANDLER_BLOCK_GUARD, NULL, NULL);
+
+ /*
+ This trampoline restore the call chain of the handler block then jumps into the code that deals with it.
+ */
+
+ /*
+ * We are in a method frame after the call emitted by OP_CALL_HANDLER.
+ */
+ code = mono_arm_emit_imm64 (code, ARMREG_IP0, (guint64)handler_block_trampoline_helper);
+ /* Set it as the return address so the trampoline will return to it */
+ arm_movx (code, ARMREG_LR, ARMREG_IP0);
+
+ /* Call the trampoline */
+ code = mono_arm_emit_imm64 (code, ARMREG_IP0, (guint64)tramp);
+ arm_brx (code, ARMREG_IP0);
+
+ mono_arch_flush_icache (buf, code - buf);
+ mono_profiler_code_buffer_new (buf, code - buf, MONO_PROFILER_CODE_BUFFER_HELPER, NULL);
+ g_assert (code - buf <= tramp_size);
+
+ *info = mono_tramp_info_create ("handler_block_trampoline", buf, code - buf, ji, unwind_ops);
+
+ return buf;
+}
+
/*
* mono_arch_create_sdb_trampoline:
*
return buf;
}
-#else
-
-gpointer
-mono_arch_get_gsharedvt_trampoline (MonoTrampInfo **info, gboolean aot)
-{
- *info = NULL;
- return NULL;
-}
-
#endif /* MONO_ARCH_GSHAREDVT_SUPPORTED */
time_from += startup_time;
time_to += startup_time;
}
- if (!thread->name)
- thread->name = pstrdup ("Main");
}
for (i = 0; i < thread->stack_id; ++i)
thread->stack [i]->recurse_count++;
ThreadContext *thread;
fprintf (outfile, "\nThread summary\n");
for (thread = ctx->threads; thread; thread = thread->next) {
- fprintf (outfile, "\tThread: %p, name: \"%s\"\n", (void*)thread->thread_id, thread->name? thread->name: "");
+ if (thread->thread_id) {
+ fprintf (outfile, "\tThread: %p, name: \"%s\"\n", (void*)thread->thread_id, thread->name? thread->name: "");
+ }
}
}
#include <config.h>
#include "../mini/jit.h"
+#include "../metadata/metadata-internals.h"
#include <mono/metadata/profiler.h>
#include <mono/metadata/threads.h>
#include <mono/metadata/mono-gc.h>
#endif
volatile gint32 run_writer_thread;
MonoLockFreeQueue writer_queue;
+ MonoSemType writer_queue_sem;
MonoConcurrentHashTable *method_table;
mono_mutex_t method_table_mutex;
BinaryObject *binary_objects;
entry->methods = methods;
entry->buffer = buffer;
mono_lock_free_queue_enqueue (&prof->writer_queue, &entry->node);
+ mono_os_sem_post (&prof->writer_queue_sem);
}
static void
}
static void counters_init (MonoProfiler *profiler);
-static void counters_sample (MonoProfiler *profiler, uint64_t timestamp);
+static void counters_sample (MonoProfiler *profiler, uint64_t timestamp, gboolean threadless);
/*
* Can be called only at safe callback locations.
TLS_GET (LogBuffer, tlsbuffer)->call_depth = cd;
}
+static void
+safe_send_threadless (MonoProfiler *prof, LogBuffer *buf)
+{
+ for (LogBuffer *iter = buf; iter; iter = iter->next)
+ iter->thread_id = 0;
+
+ safe_send (prof, buf);
+}
+
static int
gc_reference (MonoObject *obj, MonoClass *klass, uintptr_t size, uintptr_t num, MonoObject **refs, uintptr_t *offsets, void *data)
{
}
static void
-counters_emit (MonoProfiler *profiler)
+counters_emit (MonoProfiler *profiler, gboolean threadless)
{
MonoCounterAgent *agent;
LogBuffer *logbuffer;
}
EXIT_LOG (logbuffer);
- safe_send (profiler, logbuffer);
+ if (threadless)
+ safe_send_threadless (profiler, logbuffer);
+ else
+ safe_send (profiler, logbuffer);
mono_os_mutex_unlock (&counters_mutex);
}
static void
-counters_sample (MonoProfiler *profiler, uint64_t timestamp)
+counters_sample (MonoProfiler *profiler, uint64_t timestamp, gboolean threadless)
{
MonoCounterAgent *agent;
MonoCounter *counter;
if (!counters_initialized)
return;
- counters_emit (profiler);
+ counters_emit (profiler, threadless);
buffer_size = 8;
buffer = calloc (1, buffer_size);
emit_value (logbuffer, 0);
EXIT_LOG (logbuffer);
- safe_send (profiler, logbuffer);
+ if (threadless)
+ safe_send_threadless (profiler, logbuffer);
+ else
+ safe_send (profiler, logbuffer);
mono_os_mutex_unlock (&counters_mutex);
}
static PerfCounterAgent *perfcounters = NULL;
static void
-perfcounters_emit (MonoProfiler *profiler)
+perfcounters_emit (MonoProfiler *profiler, gboolean threadless)
{
PerfCounterAgent *pcagent;
LogBuffer *logbuffer;
}
EXIT_LOG (logbuffer);
- safe_send (profiler, logbuffer);
+ if (threadless)
+ safe_send_threadless (profiler, logbuffer);
+ else
+ safe_send (profiler, logbuffer);
}
static gboolean
}
static void
-perfcounters_sample (MonoProfiler *profiler, uint64_t timestamp)
+perfcounters_sample (MonoProfiler *profiler, uint64_t timestamp, gboolean threadless)
{
PerfCounterAgent *pcagent;
LogBuffer *logbuffer;
mono_perfcounter_foreach (perfcounters_foreach, perfcounters);
- perfcounters_emit (profiler);
+ perfcounters_emit (profiler, threadless);
size =
EVENT_SIZE /* event */ +
emit_value (logbuffer, 0);
EXIT_LOG (logbuffer);
- safe_send (profiler, logbuffer);
+ if (threadless)
+ safe_send_threadless (profiler, logbuffer);
+ else
+ safe_send (profiler, logbuffer);
mono_os_mutex_unlock (&counters_mutex);
}
static void
-counters_and_perfcounters_sample (MonoProfiler *prof)
+counters_and_perfcounters_sample (MonoProfiler *prof, gboolean threadless)
{
static uint64_t start = -1;
uint64_t now;
start = current_time ();
now = current_time ();
- counters_sample (prof, (now - start) / 1000/ 1000);
- perfcounters_sample (prof, (now - start) / 1000/ 1000);
+ counters_sample (prof, (now - start) / 1000/ 1000, threadless);
+ perfcounters_sample (prof, (now - start) / 1000/ 1000, threadless);
}
#define COVERAGE_DEBUG(x) if (debug_coverage) {x}
assembly = mono_image_get_assembly (image);
+ // Need to keep the assemblies around for as long as they are kept in the hashtable
+ // Nunit, for example, has a habit of unloading them before the coverage statistics are
+ // generated causing a crash. See https://bugzilla.xamarin.com/show_bug.cgi?id=39325
+ mono_assembly_addref (assembly);
+
mono_os_mutex_lock (&coverage_mutex);
mono_conc_hashtable_insert (coverage_methods, method, method);
mono_conc_hashtable_insert (coverage_assemblies, assembly, assembly);
#endif /* DISABLE_HELPER_THREAD */
}
+static void
+unref_coverage_assemblies (gpointer key, gpointer value, gpointer userdata)
+{
+ MonoAssembly *assembly = (MonoAssembly *)value;
+ mono_assembly_close (assembly);
+}
+
static void
log_shutdown (MonoProfiler *prof)
{
in_shutdown = 1;
#ifndef DISABLE_HELPER_THREAD
- counters_and_perfcounters_sample (prof);
+ counters_and_perfcounters_sample (prof, FALSE);
dump_coverage (prof);
TLS_SET (tlsmethodlist, NULL);
InterlockedWrite (&prof->run_writer_thread, 0);
+ mono_os_sem_post (&prof->writer_queue_sem);
pthread_join (prof->writer_thread, &res);
+ mono_os_sem_destroy (&prof->writer_queue_sem);
+
#if defined (HAVE_SYS_ZLIB)
if (prof->gzfile)
gzclose (prof->gzfile);
mono_os_mutex_destroy (&prof->method_table_mutex);
if (coverage_initialized) {
+ mono_os_mutex_lock (&coverage_mutex);
+ mono_conc_hashtable_foreach (coverage_assemblies, unref_coverage_assemblies, prof);
+ mono_os_mutex_unlock (&coverage_mutex);
+
mono_conc_hashtable_destroy (coverage_methods);
mono_conc_hashtable_destroy (coverage_assemblies);
mono_conc_hashtable_destroy (coverage_classes);
MonoThread *thread = NULL;
mono_threads_attach_tools_thread ();
+ mono_thread_info_set_name (mono_native_thread_id_get (), "Profiler helper");
+
//fprintf (stderr, "Server listening\n");
command_socket = -1;
while (1) {
}
#endif
- counters_and_perfcounters_sample (prof);
+ counters_and_perfcounters_sample (prof, TRUE);
tv.tv_sec = 1;
tv.tv_usec = 0;
if (sbuf) {
dump_sample_hits (prof, sbuf);
free_buffer (sbuf, sbuf->size);
- safe_send (prof, ensure_logbuf (0));
+ safe_send_threadless (prof, ensure_logbuf (0));
}
continue;
}
}
}
#endif
- safe_send (prof, ensure_logbuf (0));
+ safe_send_threadless (prof, ensure_logbuf (0));
return NULL;
}
#if USE_PERF_EVENTS
continue;
if (FD_ISSET (perf_data [i].perf_fd, &rfds)) {
read_perf_mmap (prof, i);
- safe_send (prof, ensure_logbuf (0));
+ safe_send_threadless (prof, ensure_logbuf (0));
}
}
}
continue;
//fprintf (stderr, "Accepted connection\n");
}
+
+ mono_thread_info_detach ();
+
return NULL;
}
}
#endif
-static void *
-writer_thread (void *arg)
+static gboolean
+handle_writer_queue_entry (MonoProfiler *prof)
{
- MonoProfiler *prof = (MonoProfiler *)arg;
+ WriterQueueEntry *entry;
- mono_threads_attach_tools_thread ();
+ if ((entry = (WriterQueueEntry *) mono_lock_free_queue_dequeue (&prof->writer_queue))) {
+ LogBuffer *method_buffer = NULL;
+ gboolean new_methods = FALSE;
- dump_header (prof);
+ if (entry->methods->len)
+ method_buffer = create_buffer ();
- while (InterlockedRead (&prof->run_writer_thread)) {
- WriterQueueEntry *entry;
+ /*
+ * Encode the method events in a temporary log buffer that we
+ * flush to disk before the main buffer, ensuring that all
+ * methods have metadata emitted before they're referenced.
+ */
+ for (guint i = 0; i < entry->methods->len; i++) {
+ MethodInfo *info = (MethodInfo *)g_ptr_array_index (entry->methods, i);
- while ((entry = (WriterQueueEntry *) mono_lock_free_queue_dequeue (&prof->writer_queue))) {
- LogBuffer *method_buffer = NULL;
- gboolean new_methods = FALSE;
+ if (mono_conc_hashtable_lookup (prof->method_table, info->method))
+ continue;
- if (entry->methods->len)
- method_buffer = create_buffer ();
+ new_methods = TRUE;
/*
- * Encode the method events in a temporary log buffer that we
- * flush to disk before the main buffer, ensuring that all
- * methods have metadata emitted before they're referenced.
+ * Other threads use this hash table to get a general
+ * idea of whether a method has already been emitted to
+ * the stream. Due to the way we add to this table, it
+ * can easily happen that multiple threads queue up the
+ * same methods, but that's OK since eventually all
+ * methods will be in this table and the thread-local
+ * method lists will just be empty for the rest of the
+ * app's lifetime.
*/
- for (guint i = 0; i < entry->methods->len; i++) {
- MethodInfo *info = (MethodInfo *)g_ptr_array_index (entry->methods, i);
+ mono_os_mutex_lock (&prof->method_table_mutex);
+ mono_conc_hashtable_insert (prof->method_table, info->method, info->method);
+ mono_os_mutex_unlock (&prof->method_table_mutex);
+
+ char *name = mono_method_full_name (info->method, 1);
+ int nlen = strlen (name) + 1;
+ void *cstart = info->ji ? mono_jit_info_get_code_start (info->ji) : NULL;
+ int csize = info->ji ? mono_jit_info_get_code_size (info->ji) : 0;
+
+ method_buffer = ensure_logbuf_inner (method_buffer,
+ EVENT_SIZE /* event */ +
+ LEB128_SIZE /* time */ +
+ LEB128_SIZE /* method */ +
+ LEB128_SIZE /* start */ +
+ LEB128_SIZE /* size */ +
+ nlen /* name */
+ );
+
+ emit_byte (method_buffer, TYPE_JIT | TYPE_METHOD);
+ emit_time (method_buffer, info->time);
+ emit_method_inner (method_buffer, info->method);
+ emit_ptr (method_buffer, cstart);
+ emit_value (method_buffer, csize);
+
+ memcpy (method_buffer->cursor, name, nlen);
+ method_buffer->cursor += nlen;
+
+ mono_free (name);
+ free (info);
+ }
- if (mono_conc_hashtable_lookup (prof->method_table, info->method))
- continue;
+ g_ptr_array_free (entry->methods, TRUE);
- new_methods = TRUE;
-
- /*
- * Other threads use this hash table to get a general
- * idea of whether a method has already been emitted to
- * the stream. Due to the way we add to this table, it
- * can easily happen that multiple threads queue up the
- * same methods, but that's OK since eventually all
- * methods will be in this table and the thread-local
- * method lists will just be empty for the rest of the
- * app's lifetime.
- */
- mono_os_mutex_lock (&prof->method_table_mutex);
- mono_conc_hashtable_insert (prof->method_table, info->method, info->method);
- mono_os_mutex_unlock (&prof->method_table_mutex);
-
- char *name = mono_method_full_name (info->method, 1);
- int nlen = strlen (name) + 1;
- void *cstart = info->ji ? mono_jit_info_get_code_start (info->ji) : NULL;
- int csize = info->ji ? mono_jit_info_get_code_size (info->ji) : 0;
-
- method_buffer = ensure_logbuf_inner (method_buffer,
- EVENT_SIZE /* event */ +
- LEB128_SIZE /* time */ +
- LEB128_SIZE /* method */ +
- LEB128_SIZE /* start */ +
- LEB128_SIZE /* size */ +
- nlen /* name */
- );
-
- emit_byte (method_buffer, TYPE_JIT | TYPE_METHOD);
- emit_time (method_buffer, info->time);
- emit_method_inner (method_buffer, info->method);
- emit_ptr (method_buffer, cstart);
- emit_value (method_buffer, csize);
-
- memcpy (method_buffer->cursor, name, nlen);
- method_buffer->cursor += nlen;
-
- mono_free (name);
- free (info);
- }
+ if (new_methods) {
+ for (LogBuffer *iter = method_buffer; iter; iter = iter->next)
+ iter->thread_id = 0;
- g_ptr_array_free (entry->methods, TRUE);
+ dump_buffer (prof, method_buffer);
+ } else if (method_buffer)
+ free_buffer (method_buffer, method_buffer->size);
- if (new_methods)
- dump_buffer (prof, method_buffer);
- else if (method_buffer)
- free_buffer (method_buffer, method_buffer->size);
+ dump_buffer (prof, entry->buffer);
- dump_buffer (prof, entry->buffer);
+ free (entry);
- free (entry);
- }
+ return TRUE;
}
+ return FALSE;
+}
+
+static void *
+writer_thread (void *arg)
+{
+ MonoProfiler *prof = (MonoProfiler *)arg;
+ WriterQueueEntry *entry;
+
+ mono_threads_attach_tools_thread ();
+ mono_thread_info_set_name (mono_native_thread_id_get (), "Profiler writer");
+
+ dump_header (prof);
+
+ while (InterlockedRead (&prof->run_writer_thread)) {
+ mono_os_sem_wait (&prof->writer_queue_sem, MONO_SEM_FLAGS_NONE);
+ handle_writer_queue_entry (prof);
+ }
+
+ /* Drain any remaining entries on shutdown. */
+ while (handle_writer_queue_entry (prof));
+
+ mono_thread_info_detach ();
+
return NULL;
}
InterlockedWrite (&runtime_inited, 1);
#ifndef DISABLE_HELPER_THREAD
counters_init (profiler);
- counters_sample (profiler, 0);
+ counters_sample (profiler, 0, FALSE);
#endif
/* ensure the main thread data and startup are available soon */
safe_send (profiler, ensure_logbuf (0));
#endif
mono_lock_free_queue_init (&prof->writer_queue);
+ mono_os_sem_init (&prof->writer_queue_sem, 1);
+
mono_os_mutex_init (&prof->method_table_mutex);
prof->method_table = mono_conc_hashtable_new (NULL, NULL);
# Setup the execution environment
# for the profiler module
-append_path ("MONO_PROFILER_LIB_DIR", $profbuilddir . "/.libs");
append_path ("DYLD_LIBRARY_PATH", $minibuilddir . "/.libs");
# for mprof-report
append_path ("PATH", $profbuilddir);
if (sgen_client_bridge_need_processing ())
sgen_client_bridge_reset_data ();
+ /*
+ * Mark all strong toggleref objects. This must be done before we walk ephemerons or finalizers
+ * to ensure they see the full set of live objects.
+ */
+ sgen_client_mark_togglerefs (start_addr, end_addr, ctx);
+
/*
* Walk the ephemeron tables marking all values with reachable keys. This must be completely done
* before processing finalizable objects and non-tracking weak links to avoid finalizing/clearing
++ephemeron_rounds;
} while (!done_with_ephemerons);
- sgen_client_mark_togglerefs (start_addr, end_addr, ctx);
-
if (sgen_client_bridge_need_processing ()) {
/*Make sure the gray stack is empty before we process bridge objects so we get liveness right*/
sgen_drain_gray_stack (ctx);
runtest-managed: test-runner.exe $(TESTSI_CS) $(TESTSI_IL) $(TESTBS) libtest.la $(PREREQSI_IL) $(PREREQSI_CS)
@if [ "x$$CI" = "x1" ]; then disabled_tests="$(DISABLED_TESTS_WRENCH)"; else disabled_tests="$(DISABLED_TESTS)"; fi; \
- $(RUNTIME) --debug ./test-runner.exe -j a --testsuite-name "runtime" --disabled "$${disabled_tests}" $(TESTSI_CS) $(TESTBS) $(TESTSI_IL)
+ $(RUNTIME) --debug ./test-runner.exe -j a --testsuite-name "runtime" --timeout 300 --disabled "$${disabled_tests}" $(TESTSI_CS) $(TESTBS) $(TESTSI_IL)
runtest-managed-serial: test-runner.exe $(TESTSI_CS) $(TESTSI_IL) $(TESTBS) libtest.la $(PREREQSI_IL) $(PREREQSI_CS)
@if [ "x$$CI" = "x1" ]; then disabled_tests="$(DISABLED_TESTS_WRENCH)"; else disabled_tests="$(DISABLED_TESTS)"; fi; \
using System.Collections.Generic;
using System.Threading;
using System.Runtime.InteropServices;
+using System.Runtime.CompilerServices;
public class Toggleref {
public int __test;
mono_gc_toggleref_add (Helper.ObjToPtr (obj), true);
}
+ static Toggleref a, b;
+
static void SetupLinks () {
- var a = new Toggleref () { id = "root" };
- var b = new Toggleref () { id = "child" };
- a.link.Add (b);
- a.__test = Toggleref.STRONG;
- b.__test = Toggleref.WEAK;
- Register (a);
- Register (b);
- root = new WeakReference<Toggleref> (a, false);
- child = new WeakReference<Toggleref> (b, false);
+ var r = new Toggleref () { id = "root" };
+ var c = new Toggleref () { id = "child" };
+ r.link.Add (c);
+ r.__test = Toggleref.STRONG;
+ c.__test = Toggleref.WEAK;
+ Register (r);
+ Register (c);
+ root = new WeakReference<Toggleref> (r, false);
+ child = new WeakReference<Toggleref> (c, false);
}
- static Toggleref a, b;
-
- static int Main ()
+ static int test_0_root_keeps_child ()
{
-
+ Console.WriteLine ("test_0_root_keeps_child");
var t = new Thread (SetupLinks);
t.Start ();
t.Join ();
return 0;
+ }
+
+ static void SetupLinks2 () {
+ var r = new Toggleref () { id = "root" };
+ var c = new Toggleref () { id = "child" };
+
+ r.__test = Toggleref.STRONG;
+ c.__test = Toggleref.WEAK;
+ Register (r);
+ Register (c);
+ root = new WeakReference<Toggleref> (r, false);
+ child = new WeakReference<Toggleref> (c, false);
+ }
+
+ static int test_0_child_goes_away ()
+ {
+ Console.WriteLine ("test_0_child_goes_away");
+
+ var t = new Thread (SetupLinks2);
+ t.Start ();
+ t.Join ();
+
+ GC.Collect ();
+ GC.WaitForPendingFinalizers ();
+
+ Console.WriteLine ("try get A {0}", root.TryGetTarget (out a));
+ Console.WriteLine ("try get B {0}", child.TryGetTarget (out b));
+ Console.WriteLine ("a is null {0}", a == null);
+ Console.WriteLine ("b is null {0}", b == null);
+ if (a == null || b != null)
+ return 1;
+ Console.WriteLine ("a test {0}", a.__test);
+
+ return 0;
+ }
+
+ static ConditionalWeakTable<Toggleref, object> cwt = new ConditionalWeakTable<Toggleref, object> ();
+ static WeakReference<object> root_value, child_value;
+ static object a_val, b_val;
+
+
+ static void SetupLinks3 () {
+ var r = new Toggleref () { id = "root" };
+ var c = new Toggleref () { id = "child" };
+
+ r.__test = Toggleref.STRONG;
+ c.__test = Toggleref.WEAK;
+ Register (r);
+ Register (c);
+ root = new WeakReference<Toggleref> (r, false);
+ child = new WeakReference<Toggleref> (c, false);
+
+ var root_val = new object ();
+ var child_val = new object ();
+
+ cwt.Add (r, root_val);
+ cwt.Add (c, child_val);
+
+ root_value = new WeakReference<object> (root_val, false);
+ child_value = new WeakReference<object> (child_val, false);
+ }
+
+ static int test_0_CWT_keep_child_alive ()
+ {
+ Console.WriteLine ("test_0_CWT_keep_child_alive");
+
+ var t = new Thread (SetupLinks3);
+ t.Start ();
+ t.Join ();
+
+ GC.Collect ();
+ GC.WaitForPendingFinalizers ();
+
+ Console.WriteLine ("try get A {0}", root.TryGetTarget (out a));
+ Console.WriteLine ("try get B {0}", child.TryGetTarget (out b));
+ Console.WriteLine ("a is null {0}", a == null);
+ Console.WriteLine ("b is null {0}", b == null);
+ if (a == null || b != null)
+ return 1;
+ Console.WriteLine ("a test {0}", a.__test);
+
+ Console.WriteLine ("try get a_val {0}", root_value.TryGetTarget (out a_val));
+ Console.WriteLine ("try get v_val {0}", child_value.TryGetTarget (out b_val));
+
+ //the strong toggleref must keep the CWT value to remains alive
+ if (a_val == null)
+ return 2;
+
+ //the weak toggleref should allow the CWT value to go away
+ if (b_val != null)
+ return 3;
+
+ object res_value = null;
+ bool res = cwt.TryGetValue (a, out res_value);
+ Console.WriteLine ("CWT result {0} -> {1}", res, res_value == a_val);
+
+ //the strong val is not on the CWT
+ if (!res)
+ return 4;
+
+ //for some reason the value is not the right one
+ if (res_value != a_val)
+ return 5;
+
+ return 0;
+ }
+ static int Main (string[] args)
+ {
+ return TestDriver.RunTests (typeof (Driver), args);
}
+
}
\ No newline at end of file
output.Write ("timed out");
- p.Kill ();
+ try {
+ p.Kill ();
+ } catch {
+ }
} else if (p.ExitCode != expectedExitCode) {
var end = DateTime.UtcNow;
return __sync_val_compare_and_swap (dest, comp, exch);
}
-#elif defined (HAVE_64BIT_CMPXCHG_FALLBACK)
+#elif defined (__arm__) && defined (HAVE_ARMV7) && (defined(TARGET_IOS) || defined(TARGET_WATCHOS) || defined(TARGET_ANDROID))
#if defined (TARGET_IOS) || defined (TARGET_WATCHOS)
Apple targets have historically being problematic, xcode 4.6 would miscompile the intrinsic.
*/
-#if defined (__arm__) && defined (HAVE_ARMV7)
-#define HAVE_64BIT_CMPXCHG_FALLBACK /* See atomic.c in this directory. */
-#endif
-
/* On Windows, we always use the functions provided by the Windows API. */
#if defined(__WIN32__) || defined(_WIN32)
*/
#include <config.h>
+/*
+ * When embedding, you have to define MONO_ZERO_LEN_ARRAY before including any
+ * other Mono header file if you use a different compiler from the one used to
+ * build Mono.
+ */
+#ifndef MONO_ZERO_LEN_ARRAY
+#ifdef __GNUC__
+#define MONO_ZERO_LEN_ARRAY 0
+#else
+#define MONO_ZERO_LEN_ARRAY 1
+#endif
+#endif
+
#ifdef __GNUC__
#define MONO_ATTR_USED __attribute__ ((used))
#else
if (binl != -1) {
char *base;
char *resolvedname, *name;
+ char *baseparent = NULL;
buf [binl] = 0;
resolvedname = mono_path_resolve_symlinks (buf);
base = g_path_get_dirname (resolvedname);
name = g_strdup_printf ("%s/.libs", base);
runtime_lib = try_load (lib_name, name, flags, error_msg);
g_free (name);
+ if (!runtime_lib)
+ baseparent = g_path_get_dirname (base);
if (!runtime_lib) {
- char *newbase = g_path_get_dirname (base);
- name = g_strdup_printf ("%s/lib", newbase);
+ name = g_strdup_printf ("%s/lib", baseparent);
runtime_lib = try_load (lib_name, name, flags, error_msg);
g_free (name);
}
#ifdef __MACH__
if (!runtime_lib) {
- char *newbase = g_path_get_dirname (base);
- name = g_strdup_printf ("%s/Libraries", newbase);
+ name = g_strdup_printf ("%s/Libraries", baseparent);
runtime_lib = try_load (lib_name, name, flags, error_msg);
g_free (name);
}
#endif
+ if (!runtime_lib) {
+ name = g_strdup_printf ("%s/profiler/.libs", baseparent);
+ runtime_lib = try_load (lib_name, name, flags, error_msg);
+ g_free (name);
+ }
g_free (base);
g_free (resolvedname);
+ g_free (baseparent);
}
if (!runtime_lib)
runtime_lib = try_load (lib_name, NULL, flags, error_msg);
#define __MONO_ERROR_INTERNALS_H__
#include "mono/utils/mono-compiler.h"
-#include "mono/metadata/object-internals.h"
+#include "mono/metadata/class-internals.h"
/*Keep in sync with MonoError*/
typedef struct {
mono_error_set_not_supported (MonoError *error, const char *msg_format, ...);
void
-mono_error_set_exception_instance (MonoError *error, MonoException *exc);
+mono_error_set_invalid_operation (MonoError *error, const char *msg_format, ...);
void
-mono_error_set_from_loader_error (MonoError *error);
+mono_error_set_exception_instance (MonoError *error, MonoException *exc);
MonoException*
mono_error_prepare_exception (MonoError *error, MonoError *error_out);
void
mono_error_raise_exception (MonoError *error);
-void
-mono_loader_set_error_from_mono_error (MonoError *oerror);
-
void
mono_error_move (MonoError *dest, MonoError *src);
#include "mono-error-internals.h"
#include <mono/metadata/exception.h>
-#include <mono/metadata/class-internals.h>
#include <mono/metadata/debug-helpers.h>
-#include <mono/metadata/object.h>
#include <mono/metadata/object-internals.h>
#define set_error_messagev() do { \
error->flags = flags;
}
+/**
+ * mono_error_init:
+ * @error: Pointer to MonoError struct to initialize
+ *
+ * Any function which takes a MonoError for purposes of reporting an error
+ * is required to call either this or mono_error_init_flags on entry.
+ */
void
mono_error_init (MonoError *error)
{
}
/**
- * mono_error_set_execution_engine:
+ * mono_error_set_not_supported:
*
* System.NotSupportedException
*/
va_end (args);
}
+/**
+ * mono_error_set_invalid_operation:
+ *
+ * System.InvalidOperationException
+ */
void
-mono_error_set_exception_instance (MonoError *oerror, MonoException *exc)
+mono_error_set_invalid_operation (MonoError *oerror, const char *msg_format, ...)
{
- MonoErrorInternal *error = (MonoErrorInternal*)oerror;
-
- mono_error_prepare (error);
- error->error_code = MONO_ERROR_EXCEPTION_INSTANCE;
- error->exn.instance_handle = mono_gchandle_new (exc ? &exc->object : NULL, FALSE);
+ va_list args;
+ va_start (args, msg_format);
+ mono_error_set_generic_errorv (oerror, "System", "InvalidOperationException", msg_format, args);
+ va_end (args);
}
void
-mono_error_set_from_loader_error (MonoError *oerror)
+mono_error_set_exception_instance (MonoError *oerror, MonoException *exc)
{
- MonoLoaderError *loader_error = mono_loader_get_last_error ();
MonoErrorInternal *error = (MonoErrorInternal*)oerror;
- gboolean dup_strings = TRUE;
mono_error_prepare (error);
-
- if (!loader_error) {
- mono_error_set_execution_engine (oerror, "Runtime tried to produce a mono-error from an empty loader-error");
- return;
- }
-
- switch (loader_error->exception_type) {
- case MONO_EXCEPTION_NONE:
- mono_error_set_execution_engine (oerror, "Runtime tried to produce a mono-error from a non-error loader-error");
- break;
-
- case MONO_EXCEPTION_INVALID_PROGRAM:
- mono_error_set_generic_error (oerror, "System", "InvalidProgramException", "Failed for unknown reasons.");
- break;
-
- case MONO_EXCEPTION_UNVERIFIABLE_IL:
- mono_error_set_generic_error (oerror, "System.Security", "VerificationException", "Failed for unknown reasons.");
- break;
-
- case MONO_EXCEPTION_MISSING_METHOD:
- error->error_code = MONO_ERROR_MISSING_METHOD;
- mono_error_set_type_name (oerror, loader_error->class_name);
- mono_error_set_member_name (oerror, loader_error->member_name);
- error->full_message = g_strdup ("Failed for unknown reasons.");
- break;
-
- case MONO_EXCEPTION_MISSING_FIELD:
- mono_error_set_field_load (oerror, loader_error->klass, loader_error->member_name, "Failed for unknown reasons.");
- break;
-
- case MONO_EXCEPTION_TYPE_LOAD:
- mono_error_set_type_load_name (oerror, g_strdup (loader_error->class_name), g_strdup (loader_error->assembly_name), "Failed for unknown reasons.");
- dup_strings = FALSE;
- break;
-
- case MONO_EXCEPTION_FILE_NOT_FOUND:
- mono_error_set_assembly_load_simple (oerror, loader_error->assembly_name, loader_error->ref_only);
- break;
-
- case MONO_EXCEPTION_METHOD_ACCESS:
- mono_error_set_generic_error (oerror, "System", "MethodAccessException", "Failed for unknown reasons.");
- break;
-
- case MONO_EXCEPTION_FIELD_ACCESS:
- mono_error_set_generic_error (oerror, "System", "FieldAccessException", "Failed for unknown reasons.");
- break;
-
- case MONO_EXCEPTION_OBJECT_SUPPLIED:
- case MONO_EXCEPTION_GENERIC_SHARING_FAILED:
- mono_error_set_execution_engine (oerror, "Runtime tried to produce a mono-error from JIT internal error %d", loader_error->exception_type);
- break;
-
- case MONO_EXCEPTION_BAD_IMAGE:
- mono_error_set_bad_image_name (oerror, "<unknown>", "%s", loader_error->msg);
- break;
-
- case MONO_EXCEPTION_OUT_OF_MEMORY:
- mono_error_set_out_of_memory (oerror, "Failed for unknown reasons.");
- break;
-
- default:
- mono_error_set_execution_engine (oerror, "Runtime tried to produce an unknown loader-error %d", loader_error->exception_type);
- break;
- }
-
- mono_error_dup_strings (oerror, dup_strings);
- mono_loader_clear_error ();
-}
-
-void
-mono_loader_set_error_from_mono_error (MonoError *oerror)
-{
- MonoErrorInternal *error = (MonoErrorInternal*)oerror;
-
- switch (error->error_code) {
- case MONO_ERROR_MISSING_METHOD:
- mono_loader_set_error_method_load (get_type_name (error), error->member_name);
- break;
- case MONO_ERROR_MISSING_FIELD:
- mono_loader_set_error_field_load (error->exn.klass, error->member_name);
- break;
- case MONO_ERROR_TYPE_LOAD:
- mono_loader_set_error_type_load (get_type_name (error), get_assembly_name (error));
- break;
- case MONO_ERROR_FILE_NOT_FOUND:
- /* XXX can't recover if it's ref only or not */
- mono_loader_set_error_assembly_load (get_assembly_name (error), FALSE);
- break;
- case MONO_ERROR_BAD_IMAGE:
- mono_loader_set_error_bad_image (g_strdup (error->full_message));
- break;
- case MONO_ERROR_EXCEPTION_INSTANCE:
- mono_loader_set_error_bad_image (g_strdup_printf ("Non translatable error"));
- default:
- mono_loader_set_error_bad_image (g_strdup_printf ("Non translatable error: %s", error->full_message));
- }
+ error->error_code = MONO_ERROR_EXCEPTION_INSTANCE;
+ error->exn.instance_handle = mono_gchandle_new (exc ? &exc->object : NULL, FALSE);
}
void
//Can't avoid the circular dep on this. Will be gone pretty soon
extern int mono_gc_get_suspend_signal (void);
-static int
-signal_search_alternative (int min_signal)
+int
+mono_threads_posix_signal_search_alternative (int min_signal)
{
#if !defined (SIGRTMIN)
g_error ("signal search only works with RTMIN");
#else
static int suspend_signum = -1;
if (suspend_signum == -1)
- suspend_signum = signal_search_alternative (-1);
+ suspend_signum = mono_threads_posix_signal_search_alternative (-1);
return suspend_signum;
#endif /* SIGRTMIN */
}
#else
static int resume_signum = -1;
if (resume_signum == -1)
- resume_signum = signal_search_alternative (suspend_signal_get () + 1);
+ resume_signum = mono_threads_posix_signal_search_alternative (suspend_signal_get () + 1);
return resume_signum;
#endif /* SIGRTMIN */
}
#else
static int abort_signum = -1;
if (abort_signum == -1)
- abort_signum = signal_search_alternative (restart_signal_get () + 1);
+ abort_signum = mono_threads_posix_signal_search_alternative (restart_signal_get () + 1);
return abort_signum;
#endif /* SIGRTMIN */
}
MONO_THREADS_POSIX_INIT_SIGNALS_ABORT,
} MonoThreadPosixInitSignals;
+int
+mono_threads_posix_signal_search_alternative (int min_signal);
+
void
mono_threads_posix_init_signals (MonoThreadPosixInitSignals signals);
#endif /* defined(USE_POSIX_BACKEND) || defined(USE_POSIX_SYSCALL_ABORT) */
-#endif /* __MONO_THREADS_POSIX_SIGNALS_H__ */
\ No newline at end of file
+#endif /* __MONO_THREADS_POSIX_SIGNALS_H__ */
void
mono_threads_core_set_name (MonoNativeThreadId tid, const char *name)
{
-#if defined (HAVE_PTHREAD_SETNAME_NP) && !defined (__MACH__)
+#ifdef __MACH__
+ /*
+ * We can't set the thread name for other threads, but we can at least make
+ * it work for threads that try to change their own name.
+ */
+ if (tid != mono_native_thread_id_get ())
+ return;
+
+ if (!name) {
+ pthread_setname_np ("");
+ } else {
+ char n [63];
+
+ strncpy (n, name, 63);
+ n [62] = '\0';
+ pthread_setname_np (n);
+ }
+#elif defined (HAVE_PTHREAD_SETNAME_NP)
if (!name) {
pthread_setname_np (tid, "");
} else {
else
g_string_append_printf (text, "waiting");
}
-
-/* info must be self or be held in a hazard pointer. */
-gboolean
-mono_threads_add_async_job (MonoThreadInfo *info, MonoAsyncJob job)
-{
- MonoAsyncJob old_job;
- do {
- old_job = (MonoAsyncJob) info->service_requests;
- if (old_job & job)
- return FALSE;
- } while (InterlockedCompareExchange (&info->service_requests, old_job | job, old_job) != old_job);
- return TRUE;
-}
-
-MonoAsyncJob
-mono_threads_consume_async_jobs (void)
-{
- MonoThreadInfo *info = (MonoThreadInfo*)mono_native_tls_get_value (thread_info_key);
-
- if (!info)
- return (MonoAsyncJob) 0;
-
- return (MonoAsyncJob) InterlockedExchange (&info->service_requests, 0);
-}
ASYNC_SUSPEND_STATE_INDEX = 1,
};
-/*
- * This enum tells which async thread service corresponds to which bit.
- */
-typedef enum {
- MONO_SERVICE_REQUEST_SAMPLE = 1,
-} MonoAsyncJob;
-
typedef struct _MonoThreadInfoInterruptToken MonoThreadInfoInterruptToken;
typedef struct {
/* Set when the thread is started, or in _wapi_thread_duplicate () */
HANDLE handle;
- /* Asynchronous service request. This flag is meant to be consumed by the multiplexing signal handlers to discover what sort of work they need to do.
- * Use the mono_threads_add_async_job and mono_threads_consume_async_jobs APIs to modify this flag.
- * In the future the signaling should be part of the API, but for now, it's only for massaging the bits.
- */
- volatile gint32 service_requests;
-
void *jit_data;
MonoThreadInfoInterruptToken *interrupt_token;
THREAD_INFO_TYPE *
mono_thread_info_attach (void *baseptr);
-void
+MONO_API void
mono_thread_info_detach (void);
gboolean
gboolean
mono_thread_info_resume (MonoNativeThreadId tid);
-void
+MONO_API void
mono_thread_info_set_name (MonoNativeThreadId tid, const char *name);
void
HANDLE
mono_threads_open_thread_handle (HANDLE handle, MonoNativeThreadId tid);
-/*
-This is the async job submission/consumption API.
-XXX: This is a PROVISIONAL API only meant to be used by the statistical profiler.
-If you want to use/extend it anywhere else, understand that you'll have to do some API design work to better fit this puppy.
-*/
-gboolean
-mono_threads_add_async_job (THREAD_INFO_TYPE *info, MonoAsyncJob job);
-
-MonoAsyncJob
-mono_threads_consume_async_jobs (void);
-
MONO_API void
mono_threads_attach_tools_thread (void);
void mono_threads_coop_begin_global_suspend (void);
void mono_threads_coop_end_global_suspend (void);
-MonoNativeThreadId
+MONO_API MonoNativeThreadId
mono_native_thread_id_get (void);
gboolean
#define __MONO_BITSET_H__
#include <glib.h>
+#include <mono/utils/mono-compiler.h>
+
#ifdef SGEN_WITHOUT_MONO
-#include "mono/utils/mono-compiler.h"
#define MONO_API
#else
#include <mono/utils/mono-publib.h>
#endif
-/*
- * When embedding, you have to define MONO_ZERO_LEN_ARRAY before including any
- * other Mono header file if you use a different compiler from the one used to
- * build Mono.
- */
-#ifndef MONO_ZERO_LEN_ARRAY
-#ifdef __GNUC__
-#define MONO_ZERO_LEN_ARRAY 0
-#else
-#define MONO_ZERO_LEN_ARRAY 1
-#endif
-#endif
-
#define MONO_BITSET_BITS_PER_CHUNK (8 * sizeof (gsize))
typedef struct {
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>\r
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release_SGen|Win32'">true</ExcludedFromBuild>\r
</ClCompile>\r
+ <ClCompile Include="..\mono\mini\mini-amd64-gsharedvt.c">\r
+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>\r
+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug_SGen|Win32'">true</ExcludedFromBuild>\r
+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>\r
+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release_SGen|Win32'">true</ExcludedFromBuild>\r
+ </ClCompile>\r
<ClCompile Include="..\mono\mini\mini-runtime.c" />\r
<ClCompile Include="..\mono\mini\mini-windows.c" />\r
<ClCompile Include="..\mono\mini\mini-x86.c">\r
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>\r
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release_SGen|x64'">true</ExcludedFromBuild>\r
</ClCompile>\r
+ <ClCompile Include="..\mono\mini\mini-x86-gsharedvt.c">\r
+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>\r
+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug_SGen|x64'">true</ExcludedFromBuild>\r
+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>\r
+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release_SGen|x64'">true</ExcludedFromBuild>\r
+ </ClCompile>\r
<ClCompile Include="..\mono\mini\mini.c" />\r
<ClInclude Include="..\mono\metadata\remoting.h" />\r
<ClInclude Include="..\mono\mini\ir-emit.h" />\r
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>\r
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release_SGen|Win32'">true</ExcludedFromBuild>\r
</ClInclude>\r
+ <ClInclude Include="..\mono\mini\mini-amd64-gsharedvt.h">\r
+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>\r
+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug_SGen|Win32'">true</ExcludedFromBuild>\r
+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>\r
+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release_SGen|Win32'">true</ExcludedFromBuild>\r
+ </ClInclude>\r
<ClInclude Include="..\mono\mini\mini-x86.h">\r
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>\r
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug_SGen|x64'">true</ExcludedFromBuild>\r
<ClCompile Include="..\mono\mini\aot-runtime.c" />\r
<ClCompile Include="..\mono\mini\graph.c" />\r
<ClCompile Include="..\mono\mini\mini-codegen.c" />\r
+ <ClCompile Include="..\mono\mini\mini-cross-helpers.c" />\r
<ClCompile Include="..\mono\mini\mini-exceptions.c" />\r
+ <ClCompile Include="..\mono\mini\mini-exceptions-native-unwinder.c" />\r
<ClCompile Include="..\mono\mini\mini-trampolines.c " />\r
<ClCompile Include="..\mono\mini\tramp-amd64.c">\r
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>\r
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>\r
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release_SGen|Win32'">true</ExcludedFromBuild>\r
</ClCompile>\r
+ <ClCompile Include="..\mono\mini\tramp-amd64-gsharedvt.c">\r
+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>\r
+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug_SGen|Win32'">true</ExcludedFromBuild>\r
+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>\r
+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release_SGen|Win32'">true</ExcludedFromBuild>\r
+ </ClCompile>\r
<ClCompile Include="..\mono\mini\tramp-x86.c">\r
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>\r
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug_SGen|x64'">true</ExcludedFromBuild>\r
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>\r
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release_SGen|x64'">true</ExcludedFromBuild>\r
</ClCompile>\r
+ <ClCompile Include="..\mono\mini\tramp-x86-gsharedvt.c">\r
+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>\r
+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug_SGen|x64'">true</ExcludedFromBuild>\r
+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>\r
+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release_SGen|x64'">true</ExcludedFromBuild>\r
+ </ClCompile>\r
<ClCompile Include="..\mono\mini\branch-opts.c" />\r
<ClCompile Include="..\mono\mini\mini-generic-sharing.c" />\r
<ClInclude Include="..\mono\mini\simd-methods.h" />\r
<ClCompile Include="..\mono\metadata\mempool.c" />\r
<ClCompile Include="..\mono\metadata\metadata-verify.c" />\r
<ClCompile Include="..\mono\metadata\metadata.c" />\r
+ <ClCompile Include="..\mono\metadata\metadata-cross-helpers.c" />\r
<ClCompile Include="..\mono\metadata\method-builder.c" />\r
<ClCompile Include="..\mono\metadata\monitor.c" />\r
<ClCompile Include="..\mono\metadata\mono-basic-block.c" />\r
<ClCompile Include="..\mono\metadata\sysmath.c" />\r
<ClCompile Include="..\mono\metadata\threads.c" />\r
<ClCompile Include="..\mono\metadata\verify.c" />\r
- <ClCompile Include="..\mono\mini\mini-cross-helpers.c" />\r
</ItemGroup>\r
<ItemGroup>\r
<ClInclude Include="..\mono\metadata\appdomain.h" />\r
+++ /dev/null
-#!/usr/bin/env python
-
-# Mimics GNU timeout, but does some fancy tracking based on custom features in mono nunit24.
-
-import argparse
-import subprocess
-import re
-import signal
-import time
-import sys
-import os.path
-import copy
-import tempfile
-import calendar
-import json
-
-### Constants
-
-# Here is how the communication with nunit works. It has to work with two constraints:
-# - We don't invoke nunit directly. We invoke some Makefile which invokes some other Makefile
-# and at some point down the line someone calls nunit.
-# - nunit has to be able to report back to us even if (especially if) it terminates improperly.
-# To deal with all this, communication babysitter->nunit is done by environment variables,
-# and communication nunit->babysitter is done by leaving behind files in known locations.
-
-# Filenames
-
-CURRENT_TEST_FILE = "babysitter_report_current_test_file.txt"
-RAN_TEST_FILE = "babysitter_report_ran_test_file.txt"
-FAILED_TEST_FILE = "babysitter_report_failed_test_file.txt"
-LOGGING_FILE = "babysitter_report.json_lines"
-
-# Environment keys
-
-# Keys used for Babysitter<->Nunit IPC
-CURRENT_TEST_KEY = 'MONO_BABYSITTER_NUNIT_CURRENT_TEST_FILE' # Tell nunit where to leave files
-RAN_TEST_KEY = 'MONO_BABYSITTER_NUNIT_RAN_TEST_FILE'
-FAILED_TEST_KEY = 'MONO_BABYSITTER_NUNIT_FAILED_TEST_FILE'
-RUN_KEY = 'MONO_BABYSITTER_NUNIT_RUN_TEST' # Semicolon-separated list of test names
-RUN_MODE_KEY = 'MONO_BABYSITTER_NUNIT_RUN_MODE' # Equal to either RUN or AFTER
-
-# Keys used for script configuration (see --help text)
-LOG_FILE_KEY = 'MONO_BABYSITTER_LOG_FILE' # Path
-RETRY_KEY = 'MONO_BABYSITTER_RETRY' # Equal to an integer
-VERBOSE_KEY = 'MONO_BABYSITTER_VERBOSE' # "Undocumented"-- used for debugging babysitter
-
-# JSON keys
-
-DATE_JSON = 'date' # POSIX timestamp of test suite run
-INVOKE_JSON = 'invocation'
-COUNT_JSON = 'iteration' # How many times was command executed?
-LIMIT_JSON = 'failure_max'
-SUPPORT_JSON = 'babysitter_protocol' # Was the test suite running with a babysitter-aware nunit?
-FINAL_CODE_JSON = 'final_code'
-TESTS_JSON = 'tests' # Holds dictionary of (test case name)->(dict with TEST_ keys below)
-TEST_FAILURES = 'normal_failures'
-TEST_CRASH_FAILURES = 'crash_failures'
-TEST_TIMEOUT_FAILURES = 'timeout_failures'
-
-### Interpret arguments
-
-scriptname = sys.argv[0]
-
-# This is very silly: This program needs to switch from argparse to manual parsing
-# after the second positional argument, but argparse doesn't let you do this.
-# I work around this with a custom subclass which can selectively swallow errors:
-class Hesitate(Exception):
- pass
-class HesitantParser(argparse.ArgumentParser):
- def __init__(s, *args, **kwargs):
- s.hesitating = True # Errors will be swallowed until this is set false
- argparse.ArgumentParser.__init__(s, *args, **kwargs)
- def error(s, *args, **kwargs):
- if s.hesitating:
- raise Hesitate() # Bail out before errors are printed.
- argparse.ArgumentParser.error(s, *args, **kwargs)
-
-# Define args
-argparser = HesitantParser(description="""\
-Run a test suite with a timeout.\n
-Durations are floating point numbers followed by an optional unit:\n
-'s' for seconds (the default)
-'m' for minutes
-'h' for hours
-'d' for days\n
-supported environment variables:
- %s: File to write logs to (as line-delimited JSON)
- %s: If set to a number, failed test cases will be rerun this many times (NUnit test suites only)""" %
- (LOG_FILE_KEY, RETRY_KEY),
- formatter_class=argparse.RawTextHelpFormatter)
-argparser.add_argument('-s', '--signal', dest='signal', metavar='signal', default='TERM',
- help="Send this signal to the command on timeout, instead of TERM.")
-argparser.add_argument('-k', '--kill-after-duration', dest='kill_after', metavar='duration',
- help="If process continues running after signal, send KILL after this duration.")
-argparser.add_argument('duration',
- help="Time to run before sending signal.")
-argparser.add_argument('command', nargs="+", help="Command+args to run.")
-
-# Repeatedly parse the given args until we find the shortest prefix for which parsing succeeds.
-argc = len(sys.argv)
-extra_args = []
-for limit in range(1,argc+1):
- try:
- if limit == argc: # On the final pass, parse for real
- argparser.hesitating = False
- args = argparser.parse_args(sys.argv[1:limit])
- # If we're still here, parse_args succeeded.
- # The final parsed arg is the command; remaining argv items are its args.
- extra_args = sys.argv[limit:]
- break
- except Hesitate: # Before the final pass, if parse_args fails, skip
- pass
-
-argparser.hesitating = False # Just act like a normal argparser from here
-
-durationre = re.compile(r'(\d+)([smhd]?)')
-def parse_duration(duration): # Accept units
- match = durationre.match(duration)
- if not match:
- argparser.error("Could not understand duration %s" % duration)
- time, units = match.group(1), match.group(2)
- time = int(time)
- if units == 'm':
- time *= 60
- elif units == 'h':
- time *= 60*60
- elif units == 'd':
- time *= 60*60*24
- return time
-
-def parse_signal(sig): # Accept names
- if sig.isdigit():
- return int(sig)
- for k,v in signal.__dict__.iteritems():
- if k == ("SIG%s" % sig):
- return v
- argparser.error("Could not understand signal name %s" % sig)
-
-# Final interpretation of arguments
-duration = parse_duration(args.duration)
-kill_after = parse_duration(args.kill_after) if args.kill_after is not None else None
-timeout_signal = parse_signal(args.signal)
-command = args.command + extra_args
-
-# Process environment
-global_env = copy.deepcopy( os.environ )
-
-verbose = VERBOSE_KEY in global_env
-logging = LOG_FILE_KEY in global_env
-logfile = global_env[LOG_FILE_KEY] if logging else None
-crash_resuming = True # TODO: Consider exposing this option, or adding a retry_on_crash option.
-failmax = int(global_env[RETRY_KEY]) if RETRY_KEY in global_env else 0
-babysitting = True # If false, babysitter becomes a timeout clone with no env manipulation or anything.
-if babysitting:
- babysitter_dir = tempfile.mkdtemp()
- global_env[CURRENT_TEST_KEY] = os.path.join(babysitter_dir, CURRENT_TEST_FILE)
- global_env[RAN_TEST_KEY] = os.path.join(babysitter_dir, RAN_TEST_FILE)
- global_env[FAILED_TEST_KEY] = os.path.join(babysitter_dir, FAILED_TEST_FILE)
-
-have_unix_process_groups = 'killpg' in os.__dict__
-have_windows_process_groups = 'CREATE_NEW_PROCESS_GROUP' in subprocess.__dict__
-
-### Timeout implementation
-
-def wait(proc, duration):
- # TODO: If we detect Python 3.3, Popen objects have a wait(timeout) method we can use
- start = time.time()
- while True:
- code = proc.poll()
- if code is not None:
- return code
- if time.time()-start > duration:
- return None
- time.sleep(0.05)
-
-# Popen and send_signal can't be called in their basic forms because we want to
-# send signals to all children, not just to the immediately spawned process.
-# Unfortunately the way to do this varies by operating system.
-def popen(*args, **kwargs):
- if have_unix_process_groups: # Call function on spawn to become process group leader
- kwargs['preexec_fn'] = os.setsid
- elif have_windows_process_groups: # Set magic flag for Windows process groups
- kwargs['creationflags'] = subprocess.CREATE_NEW_PROCESS_GROUP
- return subprocess.Popen(*args, **kwargs)
-
-def send_signal(proc, sig):
- if have_unix_process_groups: # UNIX
- # For compatibility with GNU timeout, pre-send the signal to just the monitored process
- os.kill(proc.pid, sig)
- # Send signal to entire group
- os.killpg(proc.pid, sig)
- # For compatibility with GNU Timeout, send a SIGCONT after the signal
- # (so delivery has a chance to occur even for stopped processes)
- if sig != signal.SIGKILL and sig != signal.SIGCONT:
- os.kill(proc.pid, signal.SIGCONT)
- elif have_windows_process_groups: # Windows with Python 2.7 or better
- os.kill(proc.pid, sig) # Becuase CREATE_NEW_PROCESS_GROUP, will go to entire group
- else: # Windows with Python 2.6-- CREATE_NEW_PROCESS_GROUP not supported
- proc.send_signal(sig) # No way to contact group, just kill process
-
-### Utility functions
-
-def attemptDelete(path):
- try:
- os.remove(path)
- except OSError:
- pass
-
-def attemptLines(path):
- try:
- with open(path) as f:
- return map(lambda s: s.strip('\r\n'), f.readlines())
- except (OSError, IOError):
- return []
-
-def attemptFirstLine(path):
- lines = attemptLines(path)
- if lines:
- return lines[0]
- return None
-
-def posixtime(): # Amazingly, time.time() does not guarantee an epoch in the docs. However this does:
- return calendar.timegm(time.gmtime())
-
-failcount = {}
-def failure_may_retry(test):
- if test not in failcount:
- failcount[test] = 0
- failcount[test] += 1
- return failcount[test] < failmax
-
-def verbose_print(arg):
- if (verbose):
- print(arg)
-
-def failure_annotate(test):
- return "%s (failure #%d of %d allowed)" % (test, failcount[test], failmax)
-
-def pluralize(lst):
- return "s" if len(lst) > 1 else ""
-
-### Run command
-
-def run(): # Returns exit code
- resume_after = []
- retry_these = []
- ever_completed = False
- died_politely = False
- proc = None
- code = None
-
- # Set up logging
- log = {DATE_JSON: posixtime(), COUNT_JSON:0, LIMIT_JSON:failmax, SUPPORT_JSON:False,
- INVOKE_JSON: " ".join(command)}
-
- def log_value(key, set=None, add=None, target=log): # Call to add toplevel value to log
- if add is not None:
- if key not in target:
- target[key] = 0
- target[key] += add
- else:
- target[key] = set
-
- def log_test(testname, key, set=None, add=None): # Call to add test-case-level value to log
- if TESTS_JSON not in log:
- log[TESTS_JSON] = {}
- if testname not in log[TESTS_JSON]:
- log[TESTS_JSON][testname] = {}
- log_value(key, set=set, add=add, target=log[TESTS_JSON][testname])
-
- # Ready to run tests
- try:
- while True:
- env = copy.copy(global_env)
- if ever_completed:
- retry_next = []
- else: # Persist reported failures list until first non-crash run
- retry_next = retry_these
-
- log_value(COUNT_JSON, add=1)
-
- # Prepare environment/filesystem
- if babysitting:
- for key in [CURRENT_TEST_KEY, RAN_TEST_KEY, FAILED_TEST_KEY]:
- attemptDelete(env[key])
- if resume_after:
- env[RUN_KEY] = ";".join(resume_after)
- env[RUN_MODE_KEY] = "EXCLUDE"
- elif retry_these:
- env[RUN_KEY] = ";".join(retry_these)
- env[RUN_MODE_KEY] = "RUN"
-
- # Run test suite
- try:
- proc = popen(command, env=env)
- except OSError:
- died_politely = True
- sys.stderr.write("%s: Could not execute command `%s`\n" % (scriptname, command[0]))
- sys.exit(127)
-
- code = wait(proc, duration)
- timed_out = code is None
- if timed_out: # Initial timeout
- send_signal(proc, timeout_signal)
- if kill_after is not None: # Kill-after timeout
- code = wait(proc, kill_after)
- if code is None:
- send_signal(proc, signal.SIGKILL)
- code = proc.wait() # Waits forever
- sys.stderr.write("%s: Command `%s` timed out\n" % (scriptname, command[0]))
- died_politely = True
-
- # The test suite has now run, and what happens next varies:
- # 1. The suite either completed fully without failures, or timed out: Just quit.
- # 2. The suite crashed (halted without completing):
- # Remember any failures for later and rerun, using a blacklist of testcases we have completed.
- # 3. The suite completed, but there were failures reported:
- # Rerun, using a whitelist of only reported-failed testcases.
- # 4. The suite crashed partway through a run with a whitelist:
- # Rerun, using a whitelist consisting of the previous whitelist minus successful testcases.
-
- crashed_at = attemptFirstLine(env[CURRENT_TEST_KEY])
- failed_tests = attemptLines(env[FAILED_TEST_KEY])
- ran_tests = attemptLines(env[RAN_TEST_KEY])
- bailout = False
-
- if crashed_at or failed_tests or ran_tests: # Test suite follows the babysitter protocol
- log_value(SUPPORT_JSON, True)
-
- if not crashed_at and not ever_completed: # The resume_after whitelist is only
- resume_after = [] # used before the first noncrashing run
- ever_completed = True
-
- if timed_out: # Currently no retries after timeout
- bailout = True
- code = 124 # See GNU timeout manpage
-
- if code or crashed_at: # Process failures
- # Handle crash failures
- if crashed_at and not timed_out:
- log_test(crashed_at, TEST_CRASH_FAILURES, add=1)
- if not crash_resuming:
- bailout = True
-
- if failure_may_retry(crashed_at):
- if ever_completed: # Rerun with whitelist next time
- for test in retry_these: # Prepopulate with last whitelist minus run testcases
- if test == crashed_at or test not in ran_tests: # (plus crashed testcase)
- retry_next.append(test)
- else: # Rerun with blacklist next time
- for test in ran_tests: # Add testcases we just ran to blacklist
- if test != crashed_at: # (except for the crashed testcase)
- resume_after.append(test)
- else:
- bailout = True
-
- # Handle reported failures
- for test in failed_tests:
- log_test(test, TEST_FAILURES, add=1)
- if failure_may_retry(test):
- retry_next.append(test)
- else:
- bailout = True
-
- # Report human-readable failures for stdout log.
- message = "%s:" % (scriptname)
- if timed_out:
- message += " Saw timeout in test case %s (never allowed)." % (crashed_at)
- elif crashed_at:
- message += " Saw crash in test case %s." % (failure_annotate(crashed_at))
- if failed_tests:
- message += " Saw test failure in test case%s %s." % (pluralize(failed_tests), "; ".join(map(failure_annotate, failed_tests)))
- if not (timed_out or crashed_at or failed_tests):
- message += " Test suite terminated with code %d, " % (code)
- if log[SUPPORT_JSON]:
- message += "but failure did not occur during a test case. Halting."
- else:
- message += "and suite cannot report test case data. Halting."
- elif bailout:
- message += " Will halt testing."
- print(message)
-
- if bailout or not (resume_after or retry_next): # If not retrying
- return code
-
- # If we got here, a retry is occurring
- retry_these = retry_next
-
- # Report human-readable retry notice for stdout log.
- message = "%s: Will rerun test suite" % (scriptname)
- if log[COUNT_JSON] > 1:
- message += " (iteration #%d)" % (log[COUNT_JSON])
- if resume_after:
- message += ", resuming at crashed testcase %s." % (crashed_at)
- else:
- message += ", running previously failed testcase%s: %s." % (pluralize(retry_these), "; ".join(retry_these))
- print(message)
- finally:
- # Emergency: Ensure command does not outlive this script
- if proc is not None and not died_politely:
- send_signal(proc, signal.SIGKILL)
-
- # Write out logs
- log_value(FINAL_CODE_JSON, "EXCEPTION" if code is None else code)
- if logging:
- with open(logfile, "a") as f:
- f.write(json.dumps(log) + os.linesep)
-
-sys.exit( run() )
--- /dev/null
+#!/usr/bin/env python
+
+# Mimics GNU timeout, but does some fancy tracking based on custom features in mono nunit24.
+
+import argparse
+import subprocess
+import re
+import signal
+import time
+import sys
+import os.path
+import copy
+import tempfile
+import calendar
+import json
+
+### Constants
+
+# Here is how the communication with nunit works. It has to work with two constraints:
+# - We don't invoke nunit directly. We invoke some Makefile which invokes some other Makefile
+# and at some point down the line someone calls nunit.
+# - nunit has to be able to report back to us even if (especially if) it terminates improperly.
+# To deal with all this, communication babysitter->nunit is done by environment variables,
+# and communication nunit->babysitter is done by leaving behind files in known locations.
+
+# Filenames
+
+CURRENT_TEST_FILE = "babysitter_report_current_test_file.txt"
+RAN_TEST_FILE = "babysitter_report_ran_test_file.txt"
+FAILED_TEST_FILE = "babysitter_report_failed_test_file.txt"
+LOGGING_FILE = "babysitter_report.json_lines"
+
+# Environment keys
+
+# Keys used for Babysitter<->Nunit IPC
+CURRENT_TEST_KEY = 'MONO_BABYSITTER_NUNIT_CURRENT_TEST_FILE' # Tell nunit where to leave files
+RAN_TEST_KEY = 'MONO_BABYSITTER_NUNIT_RAN_TEST_FILE'
+FAILED_TEST_KEY = 'MONO_BABYSITTER_NUNIT_FAILED_TEST_FILE'
+RUN_KEY = 'MONO_BABYSITTER_NUNIT_RUN_TEST' # Semicolon-separated list of test names
+RUN_MODE_KEY = 'MONO_BABYSITTER_NUNIT_RUN_MODE' # Equal to either RUN or AFTER
+
+# Keys used for script configuration (see --help text)
+LOG_FILE_KEY = 'MONO_BABYSITTER_LOG_FILE' # Path
+RETRY_KEY = 'MONO_BABYSITTER_RETRY' # Equal to an integer
+VERBOSE_KEY = 'MONO_BABYSITTER_VERBOSE' # "Undocumented"-- used for debugging babysitter
+
+# JSON keys
+
+DATE_JSON = 'date' # POSIX timestamp of test suite run
+INVOKE_JSON = 'invocation'
+COUNT_JSON = 'iteration' # How many times was command executed?
+LIMIT_JSON = 'failure_max'
+SUPPORT_JSON = 'babysitter_protocol' # Was the test suite running with a babysitter-aware nunit?
+FINAL_CODE_JSON = 'final_code'
+TESTS_JSON = 'tests' # Holds dictionary of (test case name)->(dict with TEST_ keys below)
+TEST_FAILURES = 'normal_failures'
+TEST_CRASH_FAILURES = 'crash_failures'
+TEST_TIMEOUT_FAILURES = 'timeout_failures'
+
+### Interpret arguments
+
+scriptname = sys.argv[0]
+
+# This is very silly: This program needs to switch from argparse to manual parsing
+# after the second positional argument, but argparse doesn't let you do this.
+# I work around this with a custom subclass which can selectively swallow errors:
+class Hesitate(Exception):
+ pass
+class HesitantParser(argparse.ArgumentParser):
+ def __init__(s, *args, **kwargs):
+ s.hesitating = True # Errors will be swallowed until this is set false
+ argparse.ArgumentParser.__init__(s, *args, **kwargs)
+ def error(s, *args, **kwargs):
+ if s.hesitating:
+ raise Hesitate() # Bail out before errors are printed.
+ argparse.ArgumentParser.error(s, *args, **kwargs)
+
+# Define args
+argparser = HesitantParser(description="""\
+Run a test suite with a timeout.\n
+Durations are floating point numbers followed by an optional unit:\n
+'s' for seconds (the default)
+'m' for minutes
+'h' for hours
+'d' for days\n
+supported environment variables:
+ %s: File to write logs to (as line-delimited JSON)
+ %s: If set to a number, failed test cases will be rerun this many times (NUnit test suites only)""" %
+ (LOG_FILE_KEY, RETRY_KEY),
+ formatter_class=argparse.RawTextHelpFormatter)
+argparser.add_argument('-s', '--signal', dest='signal', metavar='signal', default='TERM',
+ help="Send this signal to the command on timeout, instead of TERM.")
+argparser.add_argument('-k', '--kill-after-duration', dest='kill_after', metavar='duration',
+ help="If process continues running after signal, send KILL after this duration.")
+argparser.add_argument('duration',
+ help="Time to run before sending signal.")
+argparser.add_argument('command', nargs="+", help="Command+args to run.")
+
+# Repeatedly parse the given args until we find the shortest prefix for which parsing succeeds.
+argc = len(sys.argv)
+extra_args = []
+for limit in range(1,argc+1):
+ try:
+ if limit == argc: # On the final pass, parse for real
+ argparser.hesitating = False
+ args = argparser.parse_args(sys.argv[1:limit])
+ # If we're still here, parse_args succeeded.
+ # The final parsed arg is the command; remaining argv items are its args.
+ extra_args = sys.argv[limit:]
+ break
+ except Hesitate: # Before the final pass, if parse_args fails, skip
+ pass
+
+argparser.hesitating = False # Just act like a normal argparser from here
+
+durationre = re.compile(r'(\d+)([smhd]?)')
+def parse_duration(duration): # Accept units
+ match = durationre.match(duration)
+ if not match:
+ argparser.error("Could not understand duration %s" % duration)
+ time, units = match.group(1), match.group(2)
+ time = int(time)
+ if units == 'm':
+ time *= 60
+ elif units == 'h':
+ time *= 60*60
+ elif units == 'd':
+ time *= 60*60*24
+ return time
+
+def parse_signal(sig): # Accept names
+ if sig.isdigit():
+ return int(sig)
+ for k,v in signal.__dict__.iteritems():
+ if k == ("SIG%s" % sig):
+ return v
+ argparser.error("Could not understand signal name %s" % sig)
+
+# Final interpretation of arguments
+duration = parse_duration(args.duration)
+kill_after = parse_duration(args.kill_after) if args.kill_after is not None else None
+timeout_signal = parse_signal(args.signal)
+command = args.command + extra_args
+
+# Process environment
+global_env = copy.deepcopy( os.environ )
+
+verbose = VERBOSE_KEY in global_env
+logging = LOG_FILE_KEY in global_env
+logfile = global_env[LOG_FILE_KEY] if logging else None
+crash_resuming = True # TODO: Consider exposing this option, or adding a retry_on_crash option.
+failmax = int(global_env[RETRY_KEY]) if RETRY_KEY in global_env else 0
+babysitting = True # If false, babysitter becomes a timeout clone with no env manipulation or anything.
+if babysitting:
+ babysitter_dir = tempfile.mkdtemp()
+ global_env[CURRENT_TEST_KEY] = os.path.join(babysitter_dir, CURRENT_TEST_FILE)
+ global_env[RAN_TEST_KEY] = os.path.join(babysitter_dir, RAN_TEST_FILE)
+ global_env[FAILED_TEST_KEY] = os.path.join(babysitter_dir, FAILED_TEST_FILE)
+
+have_unix_process_groups = 'killpg' in os.__dict__
+have_windows_process_groups = 'CREATE_NEW_PROCESS_GROUP' in subprocess.__dict__
+
+### Timeout implementation
+
+def wait(proc, duration):
+ # TODO: If we detect Python 3.3, Popen objects have a wait(timeout) method we can use
+ start = time.time()
+ while True:
+ code = proc.poll()
+ if code is not None:
+ return code
+ if time.time()-start > duration:
+ return None
+ time.sleep(0.05)
+
+# Popen and send_signal can't be called in their basic forms because we want to
+# send signals to all children, not just to the immediately spawned process.
+# Unfortunately the way to do this varies by operating system.
+def popen(*args, **kwargs):
+ if have_unix_process_groups: # Call function on spawn to become process group leader
+ kwargs['preexec_fn'] = os.setsid
+ elif have_windows_process_groups: # Set magic flag for Windows process groups
+ kwargs['creationflags'] = subprocess.CREATE_NEW_PROCESS_GROUP
+ return subprocess.Popen(*args, **kwargs)
+
+def send_signal(proc, sig):
+ if have_unix_process_groups: # UNIX
+ # For compatibility with GNU timeout, pre-send the signal to just the monitored process
+ os.kill(proc.pid, sig)
+ # Send signal to entire group
+ os.killpg(proc.pid, sig)
+ # For compatibility with GNU Timeout, send a SIGCONT after the signal
+ # (so delivery has a chance to occur even for stopped processes)
+ if sig != signal.SIGKILL and sig != signal.SIGCONT:
+ os.kill(proc.pid, signal.SIGCONT)
+ elif have_windows_process_groups: # Windows with Python 2.7 or better
+ os.kill(proc.pid, sig) # Becuase CREATE_NEW_PROCESS_GROUP, will go to entire group
+ else: # Windows with Python 2.6-- CREATE_NEW_PROCESS_GROUP not supported
+ proc.send_signal(sig) # No way to contact group, just kill process
+
+### Utility functions
+
+def attemptDelete(path):
+ try:
+ os.remove(path)
+ except OSError:
+ pass
+
+def attemptLines(path):
+ try:
+ with open(path) as f:
+ return map(lambda s: s.strip('\r\n'), f.readlines())
+ except (OSError, IOError):
+ return []
+
+def attemptFirstLine(path):
+ lines = attemptLines(path)
+ if lines:
+ return lines[0]
+ return None
+
+def posixtime(): # Amazingly, time.time() does not guarantee an epoch in the docs. However this does:
+ return calendar.timegm(time.gmtime())
+
+failcount = {}
+def failure_may_retry(test):
+ if test not in failcount:
+ failcount[test] = 0
+ failcount[test] += 1
+ return failcount[test] < failmax
+
+def verbose_print(arg):
+ if (verbose):
+ print(arg)
+
+def failure_annotate(test):
+ return "%s (failure #%d of %d allowed)" % (test, failcount[test], failmax)
+
+def pluralize(lst):
+ return "s" if len(lst) > 1 else ""
+
+### Run command
+
+def run(): # Returns exit code
+ resume_after = []
+ retry_these = []
+ ever_completed = False
+ died_politely = False
+ proc = None
+ code = None
+
+ # Set up logging
+ log = {DATE_JSON: posixtime(), COUNT_JSON:0, LIMIT_JSON:failmax, SUPPORT_JSON:False,
+ INVOKE_JSON: " ".join(command)}
+
+ def log_value(key, set=None, add=None, target=log): # Call to add toplevel value to log
+ if add is not None:
+ if key not in target:
+ target[key] = 0
+ target[key] += add
+ else:
+ target[key] = set
+
+ def log_test(testname, key, set=None, add=None): # Call to add test-case-level value to log
+ if TESTS_JSON not in log:
+ log[TESTS_JSON] = {}
+ if testname not in log[TESTS_JSON]:
+ log[TESTS_JSON][testname] = {}
+ log_value(key, set=set, add=add, target=log[TESTS_JSON][testname])
+
+ # Ready to run tests
+ try:
+ while True:
+ env = copy.copy(global_env)
+ if ever_completed:
+ retry_next = []
+ else: # Persist reported failures list until first non-crash run
+ retry_next = retry_these
+
+ log_value(COUNT_JSON, add=1)
+
+ # Prepare environment/filesystem
+ if babysitting:
+ for key in [CURRENT_TEST_KEY, RAN_TEST_KEY, FAILED_TEST_KEY]:
+ attemptDelete(env[key])
+ if resume_after:
+ env[RUN_KEY] = ";".join(resume_after)
+ env[RUN_MODE_KEY] = "EXCLUDE"
+ elif retry_these:
+ env[RUN_KEY] = ";".join(retry_these)
+ env[RUN_MODE_KEY] = "RUN"
+
+ # Run test suite
+ try:
+ proc = popen(command, env=env)
+ except OSError:
+ died_politely = True
+ sys.stderr.write("%s: Could not execute command `%s`\n" % (scriptname, command[0]))
+ sys.exit(127)
+
+ code = wait(proc, duration)
+ timed_out = code is None
+ if timed_out: # Initial timeout
+ send_signal(proc, timeout_signal)
+ if kill_after is not None: # Kill-after timeout
+ code = wait(proc, kill_after)
+ if code is None:
+ send_signal(proc, signal.SIGKILL)
+ code = proc.wait() # Waits forever
+ sys.stderr.write("%s: Command `%s` timed out\n" % (scriptname, command[0]))
+ died_politely = True
+
+ # The test suite has now run, and what happens next varies:
+ # 1. The suite either completed fully without failures, or timed out: Just quit.
+ # 2. The suite crashed (halted without completing):
+ # Remember any failures for later and rerun, using a blacklist of testcases we have completed.
+ # 3. The suite completed, but there were failures reported:
+ # Rerun, using a whitelist of only reported-failed testcases.
+ # 4. The suite crashed partway through a run with a whitelist:
+ # Rerun, using a whitelist consisting of the previous whitelist minus successful testcases.
+
+ crashed_at = attemptFirstLine(env[CURRENT_TEST_KEY])
+ failed_tests = attemptLines(env[FAILED_TEST_KEY])
+ ran_tests = attemptLines(env[RAN_TEST_KEY])
+ bailout = False
+
+ if crashed_at or failed_tests or ran_tests: # Test suite follows the babysitter protocol
+ log_value(SUPPORT_JSON, True)
+
+ if not crashed_at and not ever_completed: # The resume_after whitelist is only
+ resume_after = [] # used before the first noncrashing run
+ ever_completed = True
+
+ if timed_out: # Currently no retries after timeout
+ bailout = True
+ code = 124 # See GNU timeout manpage
+
+ if code or crashed_at: # Process failures
+ # Handle crash failures
+ if crashed_at and not timed_out:
+ log_test(crashed_at, TEST_CRASH_FAILURES, add=1)
+ if not crash_resuming:
+ bailout = True
+
+ if failure_may_retry(crashed_at):
+ if ever_completed: # Rerun with whitelist next time
+ for test in retry_these: # Prepopulate with last whitelist minus run testcases
+ if test == crashed_at or test not in ran_tests: # (plus crashed testcase)
+ retry_next.append(test)
+ else: # Rerun with blacklist next time
+ for test in ran_tests: # Add testcases we just ran to blacklist
+ if test != crashed_at: # (except for the crashed testcase)
+ resume_after.append(test)
+ else:
+ bailout = True
+
+ # Handle reported failures
+ for test in failed_tests:
+ log_test(test, TEST_FAILURES, add=1)
+ if failure_may_retry(test):
+ retry_next.append(test)
+ else:
+ bailout = True
+
+ # Report human-readable failures for stdout log.
+ message = "%s:" % (scriptname)
+ if timed_out:
+ message += " Saw timeout in test case %s (never allowed)." % (crashed_at)
+ elif crashed_at:
+ message += " Saw crash in test case %s." % (failure_annotate(crashed_at))
+ if failed_tests:
+ message += " Saw test failure in test case%s %s." % (pluralize(failed_tests), "; ".join(map(failure_annotate, failed_tests)))
+ if not (timed_out or crashed_at or failed_tests):
+ message += " Test suite terminated with code %d, " % (code)
+ if log[SUPPORT_JSON]:
+ message += "but failure did not occur during a test case. Halting."
+ else:
+ message += "and suite cannot report test case data. Halting."
+ elif bailout:
+ message += " Will halt testing."
+ print(message)
+
+ if bailout or not (resume_after or retry_next): # If not retrying
+ return code
+
+ # If we got here, a retry is occurring
+ retry_these = retry_next
+
+ # Report human-readable retry notice for stdout log.
+ message = "%s: Will rerun test suite" % (scriptname)
+ if log[COUNT_JSON] > 1:
+ message += " (iteration #%d)" % (log[COUNT_JSON])
+ if resume_after:
+ message += ", resuming at crashed testcase %s." % (crashed_at)
+ else:
+ message += ", running previously failed testcase%s: %s." % (pluralize(retry_these), "; ".join(retry_these))
+ print(message)
+ finally:
+ # Emergency: Ensure command does not outlive this script
+ if proc is not None and not died_politely:
+ send_signal(proc, signal.SIGKILL)
+
+ # Write out logs
+ log_value(FINAL_CODE_JSON, "EXCEPTION" if code is None else code)
+ if logging:
+ with open(logfile, "a") as f:
+ f.write(json.dumps(log) + os.linesep)
+
+sys.exit( run() )
--- /dev/null
+#!/bin/bash -e
+
+TESTCMD=`dirname "${BASH_SOURCE[0]}"`/run-step.sh
+
+export TEST_HARNESS_VERBOSE=1
+
+if [[ ${label} == 'osx-i386' ]]; then EXTRA_CONF_FLAGS="--with-libgdiplus=/Library/Frameworks/Mono.framework/Versions/Current/lib/libgdiplus.dylib --enable-nls=no --build=i386-apple-darwin11.2.0"; fi
+if [[ ${label} == 'osx-amd64' ]]; then EXTRA_CONF_FLAGS="--with-libgdiplus=/Library/Frameworks/Mono.framework/Versions/Current/lib/libgdiplus.dylib --enable-nls=no"; fi
+if [[ ${label} == 'w32' ]]; then PLATFORM=Win32; EXTRA_CONF_FLAGS="--host=i686-pc-mingw32"; export MONO_EXECUTABLE="`cygpath -u ${WORKSPACE}\\\msvc\\\Win32\\\bin\\\Release_SGen\\\mono-sgen.exe`";fi
+if [[ ${label} == 'w64' ]]; then PLATFORM=x64; EXTRA_CONF_FLAGS="--host=i686-pc-mingw32"; export MONO_EXECUTABLE="`cygpath -u ${WORKSPACE}\\\msvc\\\x64\\\bin\\\Release_SGen\\\mono-sgen.exe`"; fi
+
+${TESTCMD} --label=configure --timeout=60m --fatal ./autogen.sh --with-monodroid --with-monotouch --with-monotouch_watch --with-monotouch_tv --with-xammac --with-mobile_static $EXTRA_CONF_FLAGS
+if [[ ${label} == w* ]];
+ then
+ ${TESTCMD} --label=make-msvc --timeout=60m --fatal "/cygdrive/c/Program\ Files\ \(x86\)/MSBuild/12.0/Bin/MSBuild.exe" /p:Platform=${PLATFORM} /p:Configuration=Release msvc/mono.sln
+ ${TESTCMD} --label=make-msvc-sgen --timeout=60m --fatal "/cygdrive/c/Program\ Files\ \(x86\)/MSBuild/12.0/Bin/MSBuild.exe" /p:Platform=${PLATFORM} /p:Configuration=Release_SGen msvc/mono.sln
+fi
+${TESTCMD} --label=make --timeout=300m --fatal make -w V=1
+if [[ -n "${ghprbPullId}" ]] && [[ ${label} == w* ]];
+ then
+ exit 0
+ # we don't run the test suite on Windows PRs, we just ensure the build succeeds, so end here
+fi
+${TESTCMD} --label=mini --timeout=5m make -w -C mono/mini -k check
+${TESTCMD} --label=runtime --timeout=120m make -w -C mono/tests -k test-wrench V=1 CI=1
+${TESTCMD} --label=corlib --timeout=30m make -w -C mcs/class/corlib run-test
+${TESTCMD} --label=verify --timeout=15m make -w -C runtime mcs-compileall
+${TESTCMD} --label=profiler --timeout=30m make -w -C mono/profiler -k check
+${TESTCMD} --label=compiler --timeout=30m make -w -C mcs/tests run-test
+${TESTCMD} --label=compiler-errors --timeout=30m make -w -C mcs/errors run-test
+${TESTCMD} --label=System --timeout=10m make -w -C mcs/class/System run-test
+${TESTCMD} --label=System.XML --timeout=5m make -w -C mcs/class/System.XML run-test
+${TESTCMD} --label=Mono.Security --timeout=5m make -w -C mcs/class/Mono.Security run-test
+${TESTCMD} --label=System.Security --timeout=5m make -w -C mcs/class/System.Security run-test
+${TESTCMD} --label=System.Drawing --timeout=5m make -w -C mcs/class/System.Drawing run-test
+if [[ ${label} == osx-* ]]
+then ${TESTCMD} --label=Windows.Forms --skip
+else ${TESTCMD} --label=Windows.Forms --timeout=5m make -w -C mcs/class/System.Windows.Forms run-test
+fi
+${TESTCMD} --label=System.Data --timeout=5m make -w -C mcs/class/System.Data run-test
+${TESTCMD} --label=System.Data.OracleClient --timeout=5m make -w -C mcs/class/System.Data.OracleClient run-test
+${TESTCMD} --label=System.Design --timeout=5m make -w -C mcs/class/System.Design run-test
+${TESTCMD} --label=Mono.Posix --timeout=5m make -w -C mcs/class/Mono.Posix run-test
+${TESTCMD} --label=System.Web --timeout=30m make -w -C mcs/class/System.Web run-test
+${TESTCMD} --label=System.Web.Services --timeout=5m make -w -C mcs/class/System.Web.Services run-test
+${TESTCMD} --label=System.Runtime.SFS --timeout=5m make -w -C mcs/class/System.Runtime.Serialization.Formatters.Soap run-test
+${TESTCMD} --label=System.Runtime.Remoting --timeout=5m make -w -C mcs/class/System.Runtime.Remoting run-test
+${TESTCMD} --label=Cscompmgd --timeout=5m make -w -C mcs/class/Cscompmgd run-test
+${TESTCMD} --label=Commons.Xml.Relaxng --timeout=5m make -w -C mcs/class/Commons.Xml.Relaxng run-test
+${TESTCMD} --label=System.ServiceProcess --timeout=5m make -w -C mcs/class/System.ServiceProcess run-test
+${TESTCMD} --label=I18N.CJK --timeout=5m make -w -C mcs/class/I18N/CJK run-test
+${TESTCMD} --label=I18N.West --timeout=5m make -w -C mcs/class/I18N/West run-test
+${TESTCMD} --label=I18N.MidEast --timeout=5m make -w -C mcs/class/I18N/MidEast run-test
+${TESTCMD} --label=System.DirectoryServices --timeout=5m make -w -C mcs/class/System.DirectoryServices run-test
+${TESTCMD} --label=Microsoft.Build.Engine --timeout=5m make -w -C mcs/class/Microsoft.Build.Engine run-test
+${TESTCMD} --label=Microsoft.Build.Framework --timeout=5m make -w -C mcs/class/Microsoft.Build.Framework run-test
+${TESTCMD} --label=Microsoft.Build.Tasks --timeout=5m make -w -C mcs/class/Microsoft.Build.Tasks run-test
+${TESTCMD} --label=Microsoft.Build.Utilities --timeout=5m make -w -C mcs/class/Microsoft.Build.Utilities run-test
+${TESTCMD} --label=Mono.C5 --timeout=5m make -w -C mcs/class/Mono.C5 run-test
+${TESTCMD} --label=System.Configuration --timeout=5m make -w -C mcs/class/System.Configuration run-test
+${TESTCMD} --label=System.Transactions --timeout=5m make -w -C mcs/class/System.Transactions run-test
+${TESTCMD} --label=System.Web.Extensions --timeout=5m make -w -C mcs/class/System.Web.Extensions run-test
+${TESTCMD} --label=System.Core --timeout=15m make -w -C mcs/class/System.Core run-test
+${TESTCMD} --label=symbolicate --timeout=60m make -w -C mcs/tools/mono-symbolicate check
+${TESTCMD} --label=System.Xml.Linq --timeout=5m make -w -C mcs/class/System.Xml.Linq run-test
+${TESTCMD} --label=System.Data.DSE --timeout=5m make -w -C mcs/class/System.Data.DataSetExtensions run-test
+${TESTCMD} --label=System.Web.Abstractions --timeout=5m make -w -C mcs/class/System.Web.Abstractions run-test
+${TESTCMD} --label=System.Web.Routing --timeout=5m make -w -C mcs/class/System.Web.Routing run-test
+${TESTCMD} --label=System.Runtime.Serialization --timeout=5m make -w -C mcs/class/System.Runtime.Serialization run-test
+${TESTCMD} --label=System.IdentityModel --timeout=5m make -w -C mcs/class/System.IdentityModel run-test
+${TESTCMD} --label=System.ServiceModel --timeout=15m make -w -C mcs/class/System.ServiceModel run-test
+${TESTCMD} --label=System.ServiceModel.Web --timeout=5m make -w -C mcs/class/System.ServiceModel.Web run-test
+${TESTCMD} --label=System.Web.Extensions-standalone --timeout=5m make -w -C mcs/class/System.Web.Extensions run-standalone-test
+${TESTCMD} --label=System.ComponentModel.DataAnnotations --timeout=5m make -w -C mcs/class/System.ComponentModel.DataAnnotations run-test
+${TESTCMD} --label=Mono.CodeContracts --timeout=5m make -w -C mcs/class/Mono.CodeContracts run-test
+${TESTCMD} --label=System.Runtime.Caching --timeout=5m make -w -C mcs/class/System.Runtime.Caching run-test
+${TESTCMD} --label=System.Data.Services --timeout=5m make -w -C mcs/class/System.Data.Services run-test
+${TESTCMD} --label=System.Web.DynamicData --timeout=5m make -w -C mcs/class/System.Web.DynamicData run-test
+${TESTCMD} --label=Mono.CSharp --timeout=5m make -w -C mcs/class/Mono.CSharp run-test
+${TESTCMD} --label=WindowsBase --timeout=5m make -w -C mcs/class/WindowsBase run-test
+${TESTCMD} --label=System.Numerics --timeout=5m make -w -C mcs/class/System.Numerics run-test
+${TESTCMD} --label=System.Runtime.DurableInstancing --timeout=5m make -w -C mcs/class/System.Runtime.DurableInstancing run-test
+${TESTCMD} --label=System.ServiceModel.Discovery --timeout=5m make -w -C mcs/class/System.ServiceModel.Discovery run-test
+${TESTCMD} --label=System.Xaml --timeout=5m make -w -C mcs/class/System.Xaml run-test
+${TESTCMD} --label=System.Net.Http --timeout=5m make -w -C mcs/class/System.Net.Http run-test
+${TESTCMD} --label=System.Json --timeout=5m make -w -C mcs/class/System.Json run-test
+${TESTCMD} --label=System.Threading.Tasks.Dataflow --timeout=5m make -w -C mcs/class/System.Threading.Tasks.Dataflow run-test
+${TESTCMD} --label=Mono.Debugger.Soft --timeout=5m make -w -C mcs/class/Mono.Debugger.Soft run-test
+${TESTCMD} --label=Microsoft.Build --timeout=5m make -w -C mcs/class/Microsoft.Build run-test
+${TESTCMD} --label=monodoc --timeout=10m make -w -C mcs/tools/mdoc run-test
+${TESTCMD} --label=Microsoft.Build-12 --timeout=10m make -w -C mcs/class/Microsoft.Build run-test PROFILE=xbuild_12
+${TESTCMD} --label=Microsoft.Build.Engine-12 --timeout=60m make -w -C mcs/class/Microsoft.Build.Engine run-test PROFILE=xbuild_12
+${TESTCMD} --label=Microsoft.Build.Framework-12 --timeout=60m make -w -C mcs/class/Microsoft.Build.Framework run-test PROFILE=xbuild_12
+${TESTCMD} --label=Microsoft.Build.Tasks-12 --timeout=60m make -w -C mcs/class/Microsoft.Build.Tasks run-test PROFILE=xbuild_12
+${TESTCMD} --label=Microsoft.Build.Utilities-12 --timeout=60m make -w -C mcs/class/Microsoft.Build.Utilities run-test PROFILE=xbuild_12
+${TESTCMD} --label=Microsoft.Build-14 --timeout=60m make -w -C mcs/class/Microsoft.Build run-test PROFILE=xbuild_14
+${TESTCMD} --label=Microsoft.Build.Engine-14 --timeout=60m make -w -C mcs/class/Microsoft.Build.Engine run-test PROFILE=xbuild_14
+${TESTCMD} --label=Microsoft.Build.Framework-14 --timeout=60m make -w -C mcs/class/Microsoft.Build.Framework run-test PROFILE=xbuild_14
+${TESTCMD} --label=Microsoft.Build.Tasks-14 --timeout=60m make -w -C mcs/class/Microsoft.Build.Tasks run-test PROFILE=xbuild_14
+${TESTCMD} --label=Microsoft.Build.Utilities-14 --timeout=60m make -w -C mcs/class/Microsoft.Build.Utilities run-test PROFILE=xbuild_14
+rm -fr /tmp/jenkins-temp-aspnet*
--- /dev/null
+#!/bin/bash -e
+TIMEOUTCMD=`dirname "${BASH_SOURCE[0]}"`/babysitter
+if ! ${TIMEOUTCMD} -h >/dev/null 2>&1; then
+ TIMEOUTCMD=timeout # fall back to timeout if babysitter doesn't work (e.g. python not installed or wrong version)
+fi
+
+export MONO_BABYSITTER_LOG_FILE=babysitter_report.json_lines
+
+helptext ()
+{
+ echo "run-step.sh {--label=LABEL} {--skip|--timeout=TIMEOUT [--fatal]} command to run with arguments"
+}
+
+for i in "$@"
+do
+case $i in
+ --help)
+ helptext
+ exit 0
+ ;;
+ --label=*)
+ LABEL="${i#*=}"
+ shift # past argument=value
+ ;;
+ --timeout=*)
+ TIMEOUT="${i#*=}"
+ shift # past argument=value
+ ;;
+ --fatal)
+ FATAL="true"
+ shift # past argument
+ ;;
+ --skip)
+ SKIP="true"
+ shift # past argument
+ ;;
+ *)
+ # unknown option, assume just part of cmdline
+ ;;
+esac
+done
+if [ -n "${SKIP}" ] && [ -z "${LABEL}" ]
+ then helptext
+ exit 1
+fi
+if [ -n "${SKIP}" ]
+ then echo -e "*** start: ${LABEL}\n*** end(0): ${LABEL}: \e[45mSkipped\e[0m"
+ exit 0
+fi
+if [ -z "${LABEL}" ] || [ -z "${TIMEOUT}" ]
+ then helptext
+ exit 1
+fi
+STARTTIME=`date +%s`
+echo "*** start: ${LABEL}"
+if [ -n "${FATAL}" ]; then
+ ${TIMEOUTCMD} --signal=ABRT --kill-after=60s ${TIMEOUT} "$@" && echo -e "*** end($(echo $(date +%s) - ${STARTTIME} | bc)): ${LABEL}: \e[42mPassed\e[0m" || (echo -e "*** end($(echo $(date +%s) - ${STARTTIME} | bc)): ${LABEL}: \e[41mFailed\e[0m" && exit 1)
+else
+ ${TIMEOUTCMD} --signal=ABRT --kill-after=60s ${TIMEOUT} "$@" && echo -e "*** end($(echo $(date +%s) - ${STARTTIME} | bc)): ${LABEL}: \e[42mPassed\e[0m" || echo -e "*** end($(echo $(date +%s) - ${STARTTIME} | bc)): ${LABEL}: \e[43mUnstable\e[0m"
+fi