mirror of
https://github.com/BepInEx/mono.git
synced 2026-11-17 19:10:23 -10:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
852c512d41 | ||
|
|
1b70679e3e | ||
|
|
73d9bb32a6 | ||
|
|
c67ee64dbc | ||
|
|
86356a38e9 | ||
|
|
32221b04b3 | ||
|
|
356450cc39 | ||
|
|
a0c3015347 | ||
|
|
537966c822 | ||
|
|
abb91fa21b | ||
|
|
963ad4c4e6 | ||
|
|
ef98b2ea25 | ||
|
|
93fcd7a7f4 | ||
|
|
ea1e9c57b3 | ||
|
|
94b968af6d | ||
|
|
3d34404a43 | ||
|
|
86d332be05 | ||
|
|
ecb00b219a | ||
|
|
6a6444c9c9 | ||
|
|
e737e00b1a | ||
|
|
bcf8b5091d | ||
|
|
053c79514a | ||
|
|
9d06cece5e | ||
|
|
096ffd7c34 | ||
|
|
6696bf386c | ||
|
|
70748269a9 | ||
|
|
30032b29cd | ||
|
|
933e43a263 | ||
|
|
6492b054d6 | ||
|
|
25af8d5d73 | ||
|
|
85c4ae8316 | ||
|
|
3cb0fc7f4d | ||
|
|
c63dbe44a0 | ||
|
|
68603e532d | ||
|
|
7b5c17946a | ||
|
|
e0a84ddbdb | ||
|
|
846a52cd5c | ||
|
|
68e00cea15 | ||
|
|
54da54bb00 | ||
|
|
32663e9c0e | ||
|
|
b8610e3e69 | ||
|
|
e7cedf88ca | ||
|
|
d97de79bed | ||
|
|
5f5755c06d | ||
|
|
ed9b8414df | ||
|
|
8d47eeeaa1 | ||
|
|
d8a160b7a4 | ||
|
|
6e8c67a141 | ||
|
|
3c838b72eb | ||
|
|
a21f9bf1d7 | ||
|
|
bc979a3e55 | ||
|
|
74a8df7e80 | ||
|
|
9daea760e4 | ||
|
|
6caf03c5f6 | ||
|
|
47a9b8fe75 | ||
|
|
e6a5c4fec1 | ||
|
|
4462c4c8cf | ||
|
|
208db37519 | ||
|
|
470791b186 | ||
|
|
3887d81f8e | ||
|
|
11072be5ed | ||
|
|
4291f2a73b | ||
|
|
5b8bf83ccd | ||
|
|
1fd0386f87 | ||
|
|
9de1e8b272 | ||
|
|
c02bd27e8f | ||
|
|
c146e4e4fd | ||
|
|
331427f067 | ||
|
|
37bbac467f | ||
|
|
5161c62e10 | ||
|
|
9458c03da1 | ||
|
|
6179d4a924 | ||
|
|
58216b41fb | ||
|
|
30a744498e | ||
|
|
c253f26bc3 | ||
|
|
6017bcd4ae | ||
|
|
561cb241d9 | ||
|
|
1fcf34271b | ||
|
|
f2de867101 | ||
|
|
992e22f306 | ||
|
|
0c65fe81ed | ||
|
|
6887168dc2 | ||
|
|
87b0e91eff | ||
|
|
883c60f9a9 | ||
|
|
1fc3eea4d1 | ||
|
|
ce5e64372c | ||
|
|
eb766b843d | ||
|
|
dbb88b930b | ||
|
|
701ec25f87 | ||
|
|
56157b091b | ||
|
|
91506c541c | ||
|
|
5deb2e0f97 | ||
|
|
f0bac9e0b7 | ||
|
|
6d9fa806ea | ||
|
|
2ee594eee6 | ||
|
|
fd92d87ed0 | ||
|
|
2bc209f4f4 | ||
|
|
f73e839351 | ||
|
|
f6e12de276 | ||
|
|
e5af45cdb3 | ||
|
|
2491b3dbb2 | ||
|
|
ef11247772 | ||
|
|
370bf41989 | ||
|
|
9e79a22008 | ||
|
|
da54730380 | ||
|
|
3a433af16e | ||
|
|
6fdda55b42 | ||
|
|
cdc69e8e9e | ||
|
|
d67fd7ce3a | ||
|
|
d195b62b9d | ||
|
|
3e90298aa1 | ||
|
|
8ae9f4eace | ||
|
|
08038cbf3b | ||
|
|
7e7c65d58f | ||
|
|
4bf06608d3 | ||
|
|
3aad6c2f07 | ||
|
|
26f04c283d | ||
|
|
e03981495b | ||
|
|
0f766fceaf | ||
|
|
cd51852dd8 | ||
|
|
0a5a292db4 | ||
|
|
b3c5bdfa7f | ||
|
|
fc77b903af | ||
|
|
ff74079dc1 | ||
|
|
ed3174a8b7 | ||
|
|
4485172658 | ||
|
|
7ca53d801a | ||
|
|
b34dcd83c4 | ||
|
|
07d8da1481 | ||
|
|
ae5b023940 | ||
|
|
9fa4d42782 | ||
|
|
98bcd46dd1 | ||
|
|
c373ddd111 | ||
|
|
b93c12250d | ||
|
|
67a9b038c5 | ||
|
|
dc330f3d57 | ||
|
|
9fe47f55e3 | ||
|
|
657e5df419 | ||
|
|
1511ce89c6 | ||
|
|
05e0f11430 | ||
|
|
06cddce9b0 | ||
|
|
3e3c9edc91 | ||
|
|
24d7fea4ca | ||
|
|
691a2cf225 | ||
|
|
296607e9b1 | ||
|
|
ee79b6f908 | ||
|
|
9844a237ea | ||
|
|
9a817effa9 | ||
|
|
9a2e1ccef4 | ||
|
|
fbfb1742ed | ||
|
|
547f83ca27 | ||
|
|
73bd2d2941 | ||
|
|
e6a317bc40 | ||
|
|
bfdcf61509 | ||
|
|
a1f8c0800d | ||
|
|
861c4f8f12 | ||
|
|
7af8c9351d | ||
|
|
7155c65bfd | ||
|
|
f20c4ece0c | ||
|
|
45efaf51b3 | ||
|
|
de0321f109 | ||
|
|
71864e55c4 | ||
|
|
92aa367629 | ||
|
|
a7e3109c66 | ||
|
|
0c68cd806a | ||
|
|
8098dbe758 | ||
|
|
50619fe4f4 | ||
|
|
b4c5181a77 | ||
|
|
f20b93ecf7 | ||
|
|
2023460027 | ||
|
|
d44a27c9e1 | ||
|
|
cf1ccdc254 | ||
|
|
ce427d5af1 | ||
|
|
a78027248b | ||
|
|
7d3335da20 | ||
|
|
a21f8151eb | ||
|
|
ddb21259f1 | ||
|
|
2664cc24dc | ||
|
|
f445544ba8 | ||
|
|
fe7bbc9da1 | ||
|
|
1b3d62f26e | ||
|
|
1b578615c6 | ||
|
|
54c0e1e47f | ||
|
|
cd105f51c1 | ||
|
|
af1e7f3096 | ||
|
|
544c381f9f | ||
|
|
64c2b9fea8 | ||
|
|
ad443c3edf | ||
|
|
f83478e9f0 | ||
|
|
6ff666ba9f | ||
|
|
5a4faa0dbe | ||
|
|
560afb2c8c | ||
|
|
df6dcb4bc3 | ||
|
|
ae55ffa9b3 | ||
|
|
3fd6b5713d | ||
|
|
71fbfc7a0a | ||
|
|
2d97201acc | ||
|
|
d6717fd548 | ||
|
|
4e17e21b2a | ||
|
|
3dc556e23b | ||
|
|
24b03dbeb3 | ||
|
|
ce37fb5dfb | ||
|
|
f4bb6280cd | ||
|
|
bc76b7d785 | ||
|
|
e538bc771d | ||
|
|
5334d00d47 | ||
|
|
e43c207e12 | ||
|
|
ea6508481f | ||
|
|
6ed0b0bd5d | ||
|
|
2514e975c3 | ||
|
|
882ffb10b4 | ||
|
|
a1a664dbcd | ||
|
|
9ff5304841 | ||
|
|
bac3152d94 | ||
|
|
02f76440bb | ||
|
|
bb0e7fc708 | ||
|
|
800ae747f2 | ||
|
|
6d986cfd7a | ||
|
|
88068708ab | ||
|
|
7a9e96f166 | ||
|
|
e7ec701595 | ||
|
|
eed1a21d6d | ||
|
|
7246c849af | ||
|
|
d39d766bf9 | ||
|
|
3a2bd00f10 | ||
|
|
9341400101 | ||
|
|
42b1712b66 | ||
|
|
1f16a62cf9 | ||
|
|
7f4be72fcc | ||
|
|
e521732831 | ||
|
|
fc81aabdab | ||
|
|
fcfc9108ba | ||
|
|
b462d915a2 | ||
|
|
e8d73281a2 | ||
|
|
ff0399cfbe | ||
|
|
a30aa5462d |
No files matched your search
@@ -1,100 +1,14 @@
|
||||
2009-02-07 Gonzalo Paniagua Javier <[email protected]>
|
||||
|
||||
* configure.in: include stdio so that NULL is defined when checking
|
||||
for ifreq.
|
||||
|
||||
2009-02-06 Miguel De Icaza <[email protected]>
|
||||
|
||||
* Disable parallel marking on OSX as it hangs during collections
|
||||
in the bootstrap stage of Mono.
|
||||
|
||||
As we find more platforms that hang, we should disable it there as
|
||||
well.
|
||||
|
||||
2009-02-03 Miguel de Icaza <[email protected]>
|
||||
|
||||
* configure.in (PLATFORM_NO_SYMLINKS): New define that replaces
|
||||
PLATFORM_WIN32.
|
||||
|
||||
2009-02-02 Rodrigo Kumpera <[email protected]>
|
||||
|
||||
* configure.in: Add --with-mcs-docs to make it possible to disable building of documentation under mcs.
|
||||
|
||||
2009-01-29 Zoltan Varga <[email protected]>
|
||||
|
||||
* configure.in: Remove -Wcast-align from the warning list, it leads to a lot of
|
||||
useless warnings which can only be fixed by casting a pointer to (void*).
|
||||
|
||||
2009-01-29 Miguel de Icaza <[email protected]>
|
||||
|
||||
* configure.in: Add a couple of new AM conditionals for POSIX and
|
||||
DARWIN, these are used to conditionally include some files in
|
||||
mono/mini.
|
||||
|
||||
2009-01-27 Jb Evain <[email protected]>
|
||||
|
||||
* configure.in: bump Mono's version to 2.5 now that 2.4
|
||||
has been branched.
|
||||
|
||||
2009-01-25 Zoltan Varga <[email protected]>
|
||||
|
||||
* acinclude.m4 (dolt_supported): Handle ARM as well.
|
||||
|
||||
2009-01-23 Zoltan Varga <[email protected]>
|
||||
|
||||
* configure.in: Make --enable-parallel-mark=yes the default.
|
||||
|
||||
2009-01-17 Zoltan Varga <[email protected]>
|
||||
|
||||
* configure.in: Complete the OPROFILE checks.
|
||||
|
||||
2009-01-16 Zoltan Varga <[email protected]>
|
||||
|
||||
Backport of r123612.
|
||||
|
||||
* configure.in: Avoid error messages in the quiet code if libgc/Makefile
|
||||
does not exist yet. Fixes #466814.
|
||||
|
||||
2009-01-09 Zoltan Varga <[email protected]>
|
||||
|
||||
* configure.in: Check for the existence of the gettext executables.
|
||||
|
||||
2008-01-08 Christian Prochnow <[email protected]>
|
||||
|
||||
* configure.in: Check for sys/statfs.h and sys/mount.h
|
||||
|
||||
2009-01-07 Geoff Norton <[email protected]>
|
||||
|
||||
* configure.in: Provide platform information to the mcs build tree
|
||||
|
||||
2009-01-06 Jb Evain <[email protected]>
|
||||
|
||||
* scripts/Makefile.am: don't generate a script for the now
|
||||
dead mono-api-diff.
|
||||
|
||||
2008-12-05 Jonathan Pryor <[email protected]>
|
||||
|
||||
* man/mdoc-update.1: Document -fno-assembly-versions.
|
||||
|
||||
2009-01-05 Zoltan Varga <[email protected]>
|
||||
|
||||
* configure.in: Disable sigaltstack on freebsd as it doesn't seem to work.
|
||||
|
||||
2008-12-16 Marek Habersack <[email protected]>
|
||||
|
||||
* data/system.web.extensions.design_1.0.pc.in: added
|
||||
|
||||
* data/Makefile.am (EXTRA_DIST): added
|
||||
system.web.extensions.design_1.0.pc.in. Also added to
|
||||
pkgconfig_DATA
|
||||
|
||||
* configure.in: added data/system.web.extensions_1.0.pc to
|
||||
AC_OUTPUT
|
||||
|
||||
2008-12-16 Bill Holmes <[email protected]>
|
||||
|
||||
* winconfig.h : Defining the SIZEOF_REGISTER variable for the MSVC builds.
|
||||
|
||||
Code is contributed under MIT/X11 license.
|
||||
|
||||
2008-12-15 Marek Habersack <[email protected]>
|
||||
|
||||
* data/Makefile.am (EXTRA_DIST): added
|
||||
@@ -109,62 +23,11 @@
|
||||
|
||||
* configure.in: added data/system.web.extensions_1.0.pc to AC_OUTPUT
|
||||
|
||||
2008-12-11 Mark Mason <[email protected]>
|
||||
|
||||
* configure.in: introduce SIZEOF_REGISTER - usually ==SIZEOF_VOID_P, except on mips/n32
|
||||
|
||||
2008-12-05 Marek Habersack <[email protected]>
|
||||
|
||||
|
||||
* configure.in: check whether round (3) and rint (3) are present
|
||||
in the C library.
|
||||
|
||||
2008-12-05 Jonathan Pryor <[email protected]>
|
||||
|
||||
* man/mdoc-update.1: Document new parameters such as --exceptions.
|
||||
|
||||
2008-12-04 Mark Probst <[email protected]>
|
||||
|
||||
* configure.in: Disabling the sibling call optimization doesn't
|
||||
work, so we're using -mminimal-toc.
|
||||
|
||||
2008-12-03 Mark Probst <[email protected]>
|
||||
|
||||
* configure.in: Disable sibling call optimization on PPC64 as it
|
||||
seems to trip up GCC on the build bot.
|
||||
|
||||
2008-11-28 Atsushi Enomoto <[email protected]>
|
||||
|
||||
* data/mono-nunit.pc.in : add new 2.4.8 files.
|
||||
|
||||
2008-11-21 Jb Evain <[email protected]>
|
||||
|
||||
* scripts/Makefile.am: use only one mono-api-info pointing to the cecil one
|
||||
which is mscorlib agnostic.
|
||||
|
||||
2008-11-21 Zoltan Varga <[email protected]>
|
||||
|
||||
* configure.in: Only enable AOT on linux. Fixes #447265.
|
||||
|
||||
2008-11-19 Jonathan Pryor <[email protected]>
|
||||
|
||||
* configure.in: Remove mono/monoburg/Makefile; fixes the build.
|
||||
|
||||
2008-11-14 Andreas Färber <[email protected]>
|
||||
|
||||
* configure.in: Add preprocessor defines for ppc(64).
|
||||
Suggested by Paolo and Mark.
|
||||
|
||||
Contributed under MIT/X11 license.
|
||||
|
||||
2008-11-12 Zoltan Varga <[email protected]>
|
||||
|
||||
* configure.in: Add an ENABLE_AOT variable to config.make, currently only
|
||||
enabled for AMD64.
|
||||
|
||||
2008-11-11 Zoltan Varga <[email protected]>
|
||||
|
||||
* configure.in: Bump version to 2.3.
|
||||
|
||||
Mon Nov 10 17:37:08 CET 2008 Paolo Molaro <[email protected]>
|
||||
|
||||
* configure.in: check for sys/user.h and struct kinfo_proc members.
|
||||
|
||||
@@ -37,8 +37,8 @@ For comments, corrections and updates, please contact [email protected]
|
||||
|
||||
We consider non-LGPL use instances where you use this on an
|
||||
embedded system where the end user is not able to upgrade the
|
||||
Mono VM or Moonlight installation or distribution that is part
|
||||
of your product (Section 6 and 7), you would have to obtain a
|
||||
Moonlight installation or distribution that is part of your
|
||||
product (Section 6 and 7), you would have to obtain a
|
||||
commercial license from Novell (consider software burned into
|
||||
a ROM, systems where end users would not be able to upgrade,
|
||||
an embedded console, a game console that imposes limitations
|
||||
|
||||
+1
-1
@@ -7,7 +7,7 @@ SUBDIRS = po $(libgc_dir) $(eglib_dir) mono $(ikvm_native_dir) support data runt
|
||||
## 'tools' is not normally built
|
||||
DIST_SUBDIRS = po libgc $(eglib_dir) mono ikvm-native support data runtime scripts man samples web tools msvc docs
|
||||
|
||||
EXTRA_DIST= nls.m4 po.m4 progtest.m4 mono-uninstalled.pc.in build-mingw32.sh LICENSE mkinstalldirs
|
||||
EXTRA_DIST= nls.m4 po.m4 progtest.m4 mono-uninstalled.pc.in dtrace-prelink.sh build-mingw32.sh LICENSE mkinstalldirs
|
||||
|
||||
DISTCHECK_CONFIGURE_FLAGS = EXTERNAL_MCS=false EXTERNAL_RUNTIME=false
|
||||
|
||||
|
||||
@@ -500,4 +500,5 @@ This is Mono.
|
||||
If the directory ../olive is present (as an
|
||||
independent checkout) from the Mono module, that
|
||||
directory is automatically configured to share the
|
||||
same prefix than this module gets.
|
||||
same prefix than this module gets
|
||||
|
||||
+1
-1
@@ -23,7 +23,7 @@ if test x$GCC != xyes; then
|
||||
fi
|
||||
case $host in
|
||||
i?86-*-linux*|x86_64-*-linux*|powerpc-*-linux* \
|
||||
|amd64-*-freebsd*|i?86-*-freebsd*|ia64-*-freebsd*|arm*-*-linux*)
|
||||
|amd64-*-freebsd*|i?86-*-freebsd*|ia64-*-freebsd*)
|
||||
pic_options='-fPIC'
|
||||
;;
|
||||
i?86-apple-darwin*)
|
||||
|
||||
+25
-102
@@ -6,7 +6,7 @@ AC_CANONICAL_SYSTEM
|
||||
m4_ifdef([_A][M_PROG_TAR],[_A][M_SET_OPTION([tar-ustar])])
|
||||
|
||||
AM_CONFIG_HEADER(config.h)
|
||||
AM_INIT_AUTOMAKE(mono,2.5)
|
||||
AM_INIT_AUTOMAKE(mono,2.2)
|
||||
AM_MAINTAINER_MODE
|
||||
|
||||
API_VER=1.0
|
||||
@@ -64,13 +64,10 @@ need_link_unlink=no
|
||||
AC_MSG_CHECKING([host platform characteristics])
|
||||
libgc_threads=no
|
||||
has_dtrace=no
|
||||
parallel_mark=yes
|
||||
case "$host" in
|
||||
*-*-mingw*|*-*-cygwin*)
|
||||
platform_win32=yes
|
||||
AC_DEFINE(PLATFORM_WIN32,1,[Platform is Win32])
|
||||
AC_DEFINE(DISABLE_PORTABILITY,1,[Disable the io-portability layer])
|
||||
AC_DEFINE(PLATFORM_NO_SYMLINKS,1,[This platform does not support symlinks])
|
||||
if test "x$cross_compiling" = "xno"; then
|
||||
CC="gcc -mno-cygwin -g"
|
||||
# So libgc configure gets -mno-cygwin
|
||||
@@ -100,7 +97,6 @@ case "$host" in
|
||||
libdl="-ldl"
|
||||
libgc_threads=pthreads
|
||||
with_sigaltstack=no
|
||||
use_sigposix=yes
|
||||
;;
|
||||
*-*-*freebsd*)
|
||||
platform_win32=no
|
||||
@@ -129,11 +125,10 @@ case "$host" in
|
||||
# but NOT library support)
|
||||
#
|
||||
with_tls=pthread
|
||||
use_sigposix=yes
|
||||
;;
|
||||
*-*-*openbsd*)
|
||||
platform_win32=no
|
||||
CPPFLAGS="$CPPFLAGS -D_THREAD_SAFE -DGC_FREEBSD_THREADS -DPLATFORM_BSD"
|
||||
CPPFLAGS="$CPPFLAGS -D_THREAD_SAFE -DGC_FREEBSD_THREADS"
|
||||
libmono_cflags="-D_THREAD_SAFE"
|
||||
LDFLAGS="$LDFLAGS -pthread"
|
||||
libmono_ldflags="-pthread"
|
||||
@@ -141,7 +136,6 @@ case "$host" in
|
||||
AC_DEFINE(PTHREAD_POINTER_ID)
|
||||
libdl=
|
||||
libgc_threads=pthreads
|
||||
use_sigposix=yes
|
||||
;;
|
||||
*-*-linux*)
|
||||
platform_win32=no
|
||||
@@ -150,11 +144,9 @@ case "$host" in
|
||||
libmono_ldflags="-lpthread"
|
||||
libdl="-ldl"
|
||||
libgc_threads=pthreads
|
||||
AOT_SUPPORTED="yes"
|
||||
use_sigposix=yes
|
||||
;;
|
||||
*-*-hpux*)
|
||||
platform_win32=no
|
||||
platform_win32=no
|
||||
CPPFLAGS="$CPPFLAGS -DGC_HPUX_THREADS -D_HPUX_SOURCE -D_XOPEN_SOURCE_EXTENDED -D_REENTRANT"
|
||||
# +ESdbgasm only valid on bundled cc on RISC
|
||||
# silently ignored for ia64
|
||||
@@ -170,7 +162,6 @@ case "$host" in
|
||||
libmono_ldflags="-lpthread"
|
||||
libgc_threads=pthreads
|
||||
need_link_unlink=yes
|
||||
use_sigposix=yes
|
||||
;;
|
||||
*-*-solaris*)
|
||||
platform_win32=no
|
||||
@@ -181,12 +172,9 @@ case "$host" in
|
||||
# This doesn't seem to work on solaris/x86, but the configure test runs
|
||||
with_tls=pthread
|
||||
has_dtrace=yes
|
||||
use_sigposix=yes
|
||||
;;
|
||||
*-*-darwin*)
|
||||
parallel_mark="Disabled_Currently_Hangs_On_MacOSX"
|
||||
platform_win32=no
|
||||
platform_darwin=yes
|
||||
CPPFLAGS="$CPPFLAGS -no-cpp-precomp -D_THREAD_SAFE -DGC_MACOSX_THREADS -DPLATFORM_MACOSX -DUSE_MMAP -DUSE_MUNMAP"
|
||||
CPPFLAGS="$CPPFLAGS -DGetCurrentProcess=MonoGetCurrentProcess -DGetCurrentThread=MonoGetCurrentThread -DCreateEvent=MonoCreateEvent"
|
||||
libmono_cflags="-D_THREAD_SAFE"
|
||||
@@ -217,8 +205,6 @@ fi
|
||||
|
||||
AM_CONDITIONAL(PLATFORM_WIN32, test x$platform_win32 = xyes)
|
||||
AM_CONDITIONAL(PLATFORM_LINUX, echo x$target_os | grep -q linux)
|
||||
AM_CONDITIONAL(PLATFORM_DARWIN, test x$platform_darwin = xyes)
|
||||
AM_CONDITIONAL(PLATFORM_SIGPOSIX, test x$use_sigposix = xyes)
|
||||
|
||||
AC_CHECK_TOOL(CC, gcc, gcc)
|
||||
AC_PROG_CC
|
||||
@@ -280,7 +266,7 @@ fi
|
||||
AM_CONDITIONAL(NO_VERSION_SCRIPT, test x$no_version_script = xyes)
|
||||
|
||||
AC_CHECK_HEADERS(sys/filio.h sys/sockio.h netdb.h utime.h sys/utime.h semaphore.h sys/un.h linux/rtc.h sys/syscall.h sys/mkdev.h)
|
||||
AC_CHECK_HEADERS(sys/user.h sys/socket.h sys/ipc.h sys/sem.h sys/utsname.h alloca.h ucontext.h pwd.h)
|
||||
AC_CHECK_HEADERS(sys/user.h)
|
||||
|
||||
AC_CHECK_HEADER(zlib.h, [have_zlib=yes], [have_zlib=no])
|
||||
if test x$have_zlib = xyes; then
|
||||
@@ -334,7 +320,7 @@ AC_CHECK_SIZEOF(void *, 4)
|
||||
|
||||
WARN=''
|
||||
if test x"$GCC" = xyes; then
|
||||
WARN='-Wall -Wunused -Wmissing-prototypes -Wmissing-declarations -Wstrict-prototypes -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wno-cast-qual -Wwrite-strings'
|
||||
WARN='-Wall -Wunused -Wmissing-prototypes -Wmissing-declarations -Wstrict-prototypes -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wno-cast-qual -Wcast-align -Wwrite-strings'
|
||||
# The runtime code does not respect ANSI C strict aliasing rules
|
||||
CFLAGS="$CFLAGS -fno-strict-aliasing"
|
||||
|
||||
@@ -405,14 +391,6 @@ fi
|
||||
# we do not configure the full gettext, as we consume it dynamically from C#
|
||||
AM_PO_SUBDIRS
|
||||
|
||||
if test "x$USE_NLS" = "xyes"; then
|
||||
AC_CHECK_PROG(HAVE_MSGFMT, msgfmt,yes,no)
|
||||
|
||||
if test "x$HAVE_MSGFMT" = "xno"; then
|
||||
AC_MSG_ERROR([msgfmt not found. You need to install the 'gettext' package, or pass --enable-nls=no to configure.])
|
||||
fi
|
||||
fi
|
||||
|
||||
AC_ARG_WITH([libgdiplus],
|
||||
[ --with-libgdiplus=installed|sibling|<path> Override the libgdiplus used for System.Drawing tests (defaults to NO)],
|
||||
[], [with_libgdiplus=installed])
|
||||
@@ -652,7 +630,7 @@ AC_TRY_COMPILE([], [
|
||||
AC_MSG_RESULT(no)
|
||||
])
|
||||
|
||||
AC_ARG_ENABLE(parallel-mark, [ --enable-parallel-mark Enables GC Parallel Marking], enable_parallel_mark=$enableval, enable_parallel_mark=$parallel_mark)
|
||||
AC_ARG_ENABLE(parallel-mark, [ --enable-parallel-mark Enables GC Parallel Marking])
|
||||
if test x$enable_parallel_mark = xyes; then
|
||||
libgc_configure_args="$libgc_configure_args --enable-parallel-mark"
|
||||
fi
|
||||
@@ -1373,7 +1351,6 @@ if test x$platform_win32 = xno; then
|
||||
AC_CHECK_HEADERS(net/if.h)
|
||||
AC_MSG_CHECKING(for ifreq)
|
||||
AC_TRY_COMPILE([
|
||||
#include <stdio.h>
|
||||
#include <sys/ioctl.h>
|
||||
#include <net/if.h>
|
||||
], [
|
||||
@@ -1428,12 +1405,9 @@ if test x$platform_win32 = xno; then
|
||||
AC_CHECK_HEADERS(sys/extattr.h)
|
||||
AC_CHECK_HEADERS(sys/sendfile.h)
|
||||
AC_CHECK_HEADERS(sys/statvfs.h)
|
||||
AC_CHECK_HEADERS(sys/statfs.h)
|
||||
AC_CHECK_HEADERS(sys/vfstab.h)
|
||||
AC_CHECK_HEADERS(sys/xattr.h)
|
||||
AC_CHECK_HEADERS(sys/mman.h)
|
||||
AC_CHECK_HEADERS(sys/param.h)
|
||||
AC_CHECK_HEADERS(sys/mount.h)
|
||||
AC_CHECK_FUNCS(getdomainname)
|
||||
AC_CHECK_FUNCS(setdomainname)
|
||||
AC_CHECK_FUNCS(fgetgrent)
|
||||
@@ -1774,8 +1748,6 @@ SQLITE="libsqlite.so.0"
|
||||
SQLITE3="libsqlite3.so.0"
|
||||
X11="libX11.so"
|
||||
|
||||
sizeof_register="SIZEOF_VOID_P"
|
||||
|
||||
jit_wanted=false
|
||||
interp_wanted=false
|
||||
case "$host" in
|
||||
@@ -1789,20 +1761,6 @@ case "$host" in
|
||||
ACCESS_UNALIGNED="no"
|
||||
JIT_SUPPORTED=yes
|
||||
jit_wanted=true
|
||||
|
||||
AC_MSG_CHECKING(for mips n32)
|
||||
AC_TRY_COMPILE([], [
|
||||
void main () {
|
||||
#if _MIPS_SIM != _ABIN32
|
||||
#error Not mips n32
|
||||
#endif
|
||||
}
|
||||
],[
|
||||
AC_MSG_RESULT(yes)
|
||||
sizeof_register=8
|
||||
],[
|
||||
AC_MSG_RESULT(no)
|
||||
])
|
||||
;;
|
||||
i*86-*-*)
|
||||
TARGET=X86;
|
||||
@@ -1911,11 +1869,8 @@ case "$host" in
|
||||
powerpc-*-sysv* | powerpc-*-darwin* | powerpc-*-netbsd* )
|
||||
if test "x$ac_cv_sizeof_void_p" = "x8"; then
|
||||
TARGET=POWERPC64;
|
||||
CPPFLAGS="$CPPFLAGS -D__mono_ppc__ -D__mono_ppc64__"
|
||||
CFLAGS="$CFLAGS -mminimal-toc"
|
||||
else
|
||||
TARGET=POWERPC;
|
||||
CPPFLAGS="$CPPFLAGS -D__mono_ppc__"
|
||||
fi
|
||||
AC_DEFINE(MONO_ARCH_REGPARMS,1,[Architecture uses registers for Parameters])
|
||||
arch_target=ppc;
|
||||
@@ -1958,14 +1913,6 @@ case "$host" in
|
||||
;;
|
||||
esac
|
||||
|
||||
if test "x$sizeof_register" = "x4"; then
|
||||
AC_DEFINE(SIZEOF_REGISTER,4,[size of machine integer registers])
|
||||
elif test "x$sizeof_register" = "x8"; then
|
||||
AC_DEFINE(SIZEOF_REGISTER,8,[size of machine integer registers])
|
||||
else
|
||||
AC_DEFINE(SIZEOF_REGISTER,SIZEOF_VOID_P,[size of machine integer registers])
|
||||
fi
|
||||
|
||||
if test "x$have_visibility_hidden" = "xyes"; then
|
||||
AC_DEFINE(HAVE_VISIBILITY_HIDDEN, 1, [Support for the visibility ("hidden") attribute])
|
||||
fi
|
||||
@@ -2162,16 +2109,12 @@ AC_ARG_WITH(moonlight,[ --with-moonlight=yes,no If you want to build the Moonl
|
||||
])
|
||||
|
||||
OPROFILE=no
|
||||
AC_ARG_WITH(oprofile,[ --with-oprofile=no,<oprofile install dir> Enable oprofile support (defaults to NO)],[
|
||||
AC_ARG_WITH(oprofile,[ --with-oprofile=no,<path> Enable oprofile support (defaults to NO)],[
|
||||
if test x$with_oprofile != xno; then
|
||||
oprofile_include=$with_oprofile/include
|
||||
if test ! -f $oprofile_include/opagent.h; then
|
||||
AC_MSG_ERROR([oprofile include file not found at $oprofile_include/opagent.h])
|
||||
fi
|
||||
OPROFILE=yes
|
||||
OPROFILE_CFLAGS="-I$oprofile_include"
|
||||
OPROFILE_LIBS="-L$with_oprofile/lib/oprofile -lopagent"
|
||||
AC_DEFINE(HAVE_OPROFILE,1,[Have oprofile support])
|
||||
OPROFILE=yes
|
||||
OPROFILE_CFLAGS="-I$with_oprofile/include"
|
||||
OPROFILE_LIBS=
|
||||
AC_DEFINE(HAVE_OPROFILE,1,[Have oprofile support])
|
||||
fi
|
||||
])
|
||||
|
||||
@@ -2183,14 +2126,6 @@ AC_ARG_WITH(malloc_mempools,[ --with-malloc-mempools=yes,no Use malloc for each
|
||||
fi
|
||||
])
|
||||
|
||||
|
||||
DISABLE_MCS_DOCS=no
|
||||
AC_ARG_WITH(mcs_docs,[ --with-mcs-docs=yes,no If you want to build the documentation under mcs (defaults to YES)],[
|
||||
if test x$with_mcs_docs != xyes; then
|
||||
DISABLE_MCS_DOCS=yes
|
||||
fi
|
||||
])
|
||||
|
||||
AM_CONDITIONAL(HAVE_OPROFILE, test x$OPROFILE = xyes)
|
||||
AC_SUBST(OPROFILE_CFLAGS)
|
||||
AC_SUBST(OPROFILE_LIBS)
|
||||
@@ -2368,6 +2303,7 @@ mono/tests/cas/inheritance/Makefile
|
||||
mono/tests/cas/linkdemand/Makefile
|
||||
mono/tests/cas/threads/Makefile
|
||||
mono/benchmark/Makefile
|
||||
mono/monoburg/Makefile
|
||||
mono/monograph/Makefile
|
||||
mono/io-layer/Makefile
|
||||
mono/mini/Makefile
|
||||
@@ -2457,14 +2393,6 @@ fi
|
||||
echo "MONO_VERSION = $myver" >> $srcdir/$mcsdir/build/config.make
|
||||
fi
|
||||
|
||||
if test x$platform_darwin = xyes; then
|
||||
echo "PLATFORM = darwin" >> $srcdir/$mcsdir/build/config.make
|
||||
fi
|
||||
|
||||
if test x$TARGET = xAMD64 -a x$platform_win32 = xno -a "x$AOT_SUPPORTED" = "xyes"; then
|
||||
echo "ENABLE_AOT = 1" >> $srcdir/$mcsdir/build/config.make
|
||||
fi
|
||||
|
||||
# if we have an olive folder, override the default settings
|
||||
if test -d $olivedir; then
|
||||
|
||||
@@ -2482,10 +2410,6 @@ fi
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
if test x$DISABLE_MCS_DOCS = xyes; then
|
||||
echo "DISABLE_MCS_DOCS = yes" >> $srcdir/$mcsdir/build/config.make
|
||||
fi
|
||||
)
|
||||
|
||||
libgdiplus_msg=${libgdiplus_loc:-assumed to be installed}
|
||||
@@ -2494,24 +2418,23 @@ echo "
|
||||
mcs source: $mcs_topdir
|
||||
olive source: $olive_topdir
|
||||
|
||||
GC: $gc
|
||||
TLS: $with_tls
|
||||
SIGALTSTACK: $with_sigaltstack
|
||||
Engine: $jit_status
|
||||
2.0 Beta: $PREVIEW
|
||||
2.1 Alpha: $MOONLIGHT
|
||||
JNI support: $jdk_headers_found
|
||||
libgdiplus: $libgdiplus_msg
|
||||
zlib: $zlib_msg
|
||||
oprofile: $OPROFILE
|
||||
BigArrays: $enable_big_arrays
|
||||
DTrace: $enable_dtrace
|
||||
Parallel Mark: $enable_parallel_mark
|
||||
GC: $gc
|
||||
TLS: $with_tls
|
||||
SIGALTSTACK: $with_sigaltstack
|
||||
Engine: $jit_status
|
||||
2.0 Beta: $PREVIEW
|
||||
2.1 Alpha: $MOONLIGHT
|
||||
JNI support: $jdk_headers_found
|
||||
libgdiplus: $libgdiplus_msg
|
||||
zlib: $zlib_msg
|
||||
oprofile: $OPROFILE
|
||||
BigArrays: $enable_big_arrays
|
||||
DTrace: $enable_dtrace
|
||||
$disabled
|
||||
|
||||
"
|
||||
if test x$with_static_mono = xno -a "x$platform_win32" != "xyes"; then
|
||||
AC_MSG_WARN(Turning off static Mono is a risk, you might run into unexpected bugs)
|
||||
AC_MSG_WARN(Turning off static Mono is a risk, you might run into unexepcted bugs)
|
||||
fi
|
||||
|
||||
if test x$gc = xsgen; then
|
||||
|
||||
+1
-2
@@ -7,8 +7,7 @@ EXTRA_DIST = \
|
||||
browscap.ini mono.supp mono.d README \
|
||||
mono.pc.in mint.pc.in dotnet.pc.in dotnet35.pc.in wcf.pc.in monodoc.pc.in \
|
||||
mono-nunit.pc.in mono-cairo.pc.in mono-options.pc.in cecil.pc.in smcs.pc.in \
|
||||
mono-lineeditor.pc.in system.web.extensions_1.0.pc.in system.web.extensions.design_1.0.pc.in\
|
||||
dtrace-prelink.sh
|
||||
mono-lineeditor.pc.in system.web.extensions_1.0.pc.in system.web.extensions.design_1.0.pc.in
|
||||
|
||||
pkgconfigdir = $(libdir)/pkgconfig
|
||||
|
||||
|
||||
@@ -1,22 +0,0 @@
|
||||
2009-02-03 Zoltan Varga <[email protected]>
|
||||
|
||||
* mono-gdb.py: Remove the --64 argument to as, it is not needed.
|
||||
|
||||
* mono-gdb.py (stringify_class_name): Helper function to print base types
|
||||
using their short name. Also add a prototype implementation of registering
|
||||
the hooks from python code instead of needing the mono-gdbinit file.
|
||||
|
||||
* gdb-python.diff: Changes against the gdb archer branch at
|
||||
http://sourceware.org/gdb/wiki/PythonGdb to fix some problems/add functionality.
|
||||
|
||||
2009-02-03 Geoff Norton <[email protected]>
|
||||
|
||||
* mono-gdbinit: Hook into backtrace as hook-stop seems to crash gdb
|
||||
* mono-gdb.py: Find the gdbinit name from the executable name instead of
|
||||
hardcoding mono
|
||||
|
||||
2009-01-29 Zoltan Varga <[email protected]>
|
||||
|
||||
* mono-gdb.py mono-gdbinit: Support files to help debugging mono/mono apps
|
||||
using a python enabled gdb.
|
||||
|
||||
@@ -1,163 +0,0 @@
|
||||
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
|
||||
index 640998b..fb73e9d 100644
|
||||
--- a/gdb/ChangeLog
|
||||
+++ b/gdb/ChangeLog
|
||||
@@ -1,3 +1,10 @@
|
||||
+2009-02-03 Zoltan Varga <[email protected]>
|
||||
+
|
||||
+ * cil-script.c python/python-cmd.c: Allow registration of pre/post hooks from
|
||||
+ python.
|
||||
+
|
||||
+ * symfile.c (add_symbol_file_command): Comment out verbose messages.
|
||||
+
|
||||
2009-02-03 Thiago Jung Bauermann <[email protected]>
|
||||
|
||||
* gdb/c-lang.c (c_get_string): Remove superfluous parenthesis from
|
||||
diff --git a/gdb/cli/cli-script.c b/gdb/cli/cli-script.c
|
||||
index 835d29c..3941aa5 100644
|
||||
--- a/gdb/cli/cli-script.c
|
||||
+++ b/gdb/cli/cli-script.c
|
||||
@@ -299,6 +299,13 @@ execute_user_command (struct cmd_list_element *c, char *args)
|
||||
static int user_call_depth = 0;
|
||||
extern int max_user_call_depth;
|
||||
|
||||
+ /* Might be a user defined command implemented in Python */
|
||||
+ if (!c->user_commands && c->func)
|
||||
+ {
|
||||
+ (*c->func) (c, args, FALSE);
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
old_chain = setup_user_args (args);
|
||||
|
||||
cmdlines = c->user_commands;
|
||||
diff --git a/gdb/python/python-cmd.c b/gdb/python/python-cmd.c
|
||||
index 61d5e5d..a3fbc08 100644
|
||||
--- a/gdb/python/python-cmd.c
|
||||
+++ b/gdb/python/python-cmd.c
|
||||
@@ -339,7 +339,8 @@ gdbpy_parse_command_name (char *text, struct cmd_list_element ***base_list,
|
||||
|
||||
/* Object initializer; sets up gdb-side structures for command.
|
||||
|
||||
- Use: __init__(NAME, CMDCLASS, [COMPLETERCLASS, [PREFIX]]).
|
||||
+ Use: __init__(NAME, CMDCLASS, [completerclass=COMPLETERCLASS, prefix=PREFIX,
|
||||
+ pre_hook_of=PREHOOK_OF, post_hook_of=POSTHOOK_OF]).
|
||||
|
||||
NAME is the name of the command. It may consist of multiple words,
|
||||
in which case the final word is the name of the new command, and
|
||||
@@ -354,6 +355,11 @@ gdbpy_parse_command_name (char *text, struct cmd_list_element ***base_list,
|
||||
|
||||
If PREFIX is True, then this command is a prefix command.
|
||||
|
||||
+ PREHOOK_OF is the name of a gdb command this command becomes a
|
||||
+ pre-execution hook of, same as if this command was defined using
|
||||
+ "define hook-<cmdname>"
|
||||
+ POSTHOOK_OF is the same for post-execution hooks.
|
||||
+
|
||||
The documentation for the command is taken from the doc string for
|
||||
the python class.
|
||||
|
||||
@@ -362,15 +368,18 @@ static int
|
||||
cmdpy_init (PyObject *self, PyObject *args, PyObject *kwds)
|
||||
{
|
||||
cmdpy_object *obj = (cmdpy_object *) self;
|
||||
- char *name;
|
||||
+ char *name, *pre_hook_of = NULL, *post_hook_of = NULL;
|
||||
int cmdtype;
|
||||
int completetype = -1;
|
||||
char *docstring = NULL;
|
||||
volatile struct gdb_exception except;
|
||||
struct cmd_list_element **cmd_list;
|
||||
+ struct cmd_list_element *pre_hookc = NULL, *post_hookc = NULL;
|
||||
char *cmd_name, *pfx_name;
|
||||
PyObject *is_prefix = NULL;
|
||||
int cmp;
|
||||
+ static char *kwlist[] = {"name", "cmdclass", "completerclass", "prefix",
|
||||
+ "pre_hook_of", "post_hook_of", NULL};
|
||||
|
||||
if (obj->command)
|
||||
{
|
||||
@@ -381,8 +390,9 @@ cmdpy_init (PyObject *self, PyObject *args, PyObject *kwds)
|
||||
return -1;
|
||||
}
|
||||
|
||||
- if (! PyArg_ParseTuple (args, "si|iO", &name, &cmdtype,
|
||||
- &completetype, &is_prefix))
|
||||
+ if (! PyArg_ParseTupleAndKeywords (args, kwds, "si|iOss", kwlist, &name, &cmdtype,
|
||||
+ &completetype, &is_prefix, &pre_hook_of,
|
||||
+ &post_hook_of))
|
||||
return -1;
|
||||
|
||||
if (cmdtype != no_class && cmdtype != class_run
|
||||
@@ -402,6 +412,30 @@ cmdpy_init (PyObject *self, PyObject *args, PyObject *kwds)
|
||||
return -1;
|
||||
}
|
||||
|
||||
+ if (pre_hook_of)
|
||||
+ {
|
||||
+ char *text = pre_hook_of;
|
||||
+
|
||||
+ pre_hookc = lookup_cmd_1 (&text, cmdlist, NULL, 1);
|
||||
+ if (! pre_hookc)
|
||||
+ {
|
||||
+ PyErr_Format (PyExc_RuntimeError, _("command name given by pre_hook argument not found"));
|
||||
+ return -1;
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ if (post_hook_of)
|
||||
+ {
|
||||
+ char *text = post_hook_of;
|
||||
+
|
||||
+ post_hookc = lookup_cmd_1 (&text, cmdlist, NULL, 1);
|
||||
+ if (! post_hookc)
|
||||
+ {
|
||||
+ PyErr_Format (PyExc_RuntimeError, _("command name given by post_hook argument not found"));
|
||||
+ return -1;
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
cmd_name = gdbpy_parse_command_name (name, &cmd_list, &cmdlist);
|
||||
if (! cmd_name)
|
||||
return -1;
|
||||
@@ -470,6 +504,18 @@ cmdpy_init (PyObject *self, PyObject *args, PyObject *kwds)
|
||||
cmd->func = cmdpy_function;
|
||||
cmd->destroyer = cmdpy_destroyer;
|
||||
|
||||
+ if (pre_hookc)
|
||||
+ {
|
||||
+ pre_hookc->hook_pre = cmd;
|
||||
+ cmd->hookee_pre = pre_hookc;
|
||||
+ }
|
||||
+
|
||||
+ if (post_hookc)
|
||||
+ {
|
||||
+ post_hookc->hook_post = cmd;
|
||||
+ cmd->hookee_post = post_hookc;
|
||||
+ }
|
||||
+
|
||||
obj->command = cmd;
|
||||
set_cmd_context (cmd, self);
|
||||
set_cmd_completer (cmd, ((completetype == -1) ? cmdpy_completer
|
||||
diff --git a/gdb/symfile.c b/gdb/symfile.c
|
||||
index 14cb7b8..6d0bb40 100644
|
||||
--- a/gdb/symfile.c
|
||||
+++ b/gdb/symfile.c
|
||||
@@ -2196,7 +2196,7 @@ add_symbol_file_command (char *args, int from_tty)
|
||||
statements because hex_string returns a local static
|
||||
string. */
|
||||
|
||||
- printf_unfiltered (_("add symbol table from file \"%s\" at\n"), filename);
|
||||
+ /* printf_unfiltered (_("add symbol table from file \"%s\" at\n"), filename); */
|
||||
section_addrs = alloc_section_addr_info (section_index);
|
||||
make_cleanup (xfree, section_addrs);
|
||||
for (i = 0; i < section_index; i++)
|
||||
@@ -2211,7 +2211,7 @@ add_symbol_file_command (char *args, int from_tty)
|
||||
entered on the command line. */
|
||||
section_addrs->other[sec_num].name = sec;
|
||||
section_addrs->other[sec_num].addr = addr;
|
||||
- printf_unfiltered ("\t%s_addr = %s\n", sec, paddress (addr));
|
||||
+ /* printf_unfiltered ("\t%s_addr = %s\n", sec, paddress (addr)); */
|
||||
sec_num++;
|
||||
|
||||
/* The object's sections are initialized when a
|
||||
@@ -1,181 +0,0 @@
|
||||
#
|
||||
# Author: Zoltan Varga ([email protected])
|
||||
# License: MIT/X11
|
||||
#
|
||||
|
||||
#
|
||||
# This is a mono support mode for a python-enabled gdb:
|
||||
# http://sourceware.org/gdb/wiki/PythonGdb
|
||||
# Usage:
|
||||
# - copy/symlink this file, plus mono-gdbinit to the directory where the mono
|
||||
# executable lives.
|
||||
# - run mono under gdb, or attach to a mono process using gdb
|
||||
# - Type 'xdb' in gdb to load/reload the debugging info emitted by the runtime.
|
||||
# - The debug info is emitted to a file called xdb.s in the current working directory.
|
||||
# When attaching to a mono process, make sure you are in the same directory.
|
||||
#
|
||||
|
||||
import os
|
||||
|
||||
class StringPrinter:
|
||||
"Print a C# string"
|
||||
|
||||
def __init__(self, val):
|
||||
self.val = val
|
||||
|
||||
def to_string(self):
|
||||
if int(self.val.cast (gdb.Type ("guint64"))) == 0:
|
||||
return "null"
|
||||
|
||||
obj = self.val.cast (gdb.Type ("MonoString").pointer ()).dereference ()
|
||||
len = obj ['length']
|
||||
chars = obj ['chars']
|
||||
i = 0
|
||||
res = ['"']
|
||||
while i < len:
|
||||
c = chr ((chars.cast(gdb.Type ("gint64")) + (i * 2)).cast(gdb.Type ("gunichar2").pointer ()).dereference ())
|
||||
res.append (c)
|
||||
i = i + 1
|
||||
res.append ('"')
|
||||
return ''.join (res)
|
||||
|
||||
def stringify_class_name(ns, name):
|
||||
if ns == "System":
|
||||
if name == "Byte":
|
||||
return "byte"
|
||||
if name == "String":
|
||||
return "string"
|
||||
return "%s.%s" % (ns, name)
|
||||
|
||||
class ArrayPrinter:
|
||||
"Print a C# array"
|
||||
|
||||
def __init__(self, val, class_ns, class_name):
|
||||
self.val = val
|
||||
self.class_ns = class_ns
|
||||
self.class_name = class_name
|
||||
|
||||
def to_string(self):
|
||||
obj = self.val.cast (gdb.Type ("MonoArray").pointer ()).dereference ()
|
||||
length = obj ['max_length']
|
||||
return "%s [%d]" % (stringify_class_name (self.class_ns, self.class_name [0:len(self.class_name) - 2]), int(length))
|
||||
|
||||
class ObjectPrinter:
|
||||
"Print a C# object"
|
||||
|
||||
def __init__(self, val):
|
||||
self.val = val
|
||||
|
||||
class _iterator:
|
||||
def __init__(self,obj):
|
||||
self.obj = obj
|
||||
self.iter = self.obj.type ().fields ().__iter__ ()
|
||||
pass
|
||||
|
||||
def __iter__(self):
|
||||
return self
|
||||
|
||||
def next(self):
|
||||
field = self.iter.next ()
|
||||
return (field.name, self.obj [field.name])
|
||||
|
||||
def children(self):
|
||||
# FIXME: It would be easier if gdb.Value would support iteration itself
|
||||
# It would also be better if we could return None
|
||||
if int(self.val.cast (gdb.Type ("guint64"))) == 0:
|
||||
return {}.__iter__ ()
|
||||
try:
|
||||
obj = self.val.cast (gdb.Type ("MonoObject").pointer ()).dereference ()
|
||||
class_ns = obj ['vtable'].dereference ()['klass'].dereference ()['name_space'].string ()
|
||||
class_name = obj ['vtable'].dereference ()['klass'].dereference ()['name'].string ()
|
||||
gdb_type = gdb.Type ("struct %s.%s" % (class_ns, class_name))
|
||||
return self._iterator(obj.cast (gdb_type))
|
||||
except:
|
||||
return {}.__iter__ ()
|
||||
|
||||
def to_string(self):
|
||||
if int(self.val.cast (gdb.Type ("guint64"))) == 0:
|
||||
return "null"
|
||||
try:
|
||||
obj = self.val.cast (gdb.Type ("MonoObject").pointer ()).dereference ()
|
||||
class_ns = obj ['vtable'].dereference ()['klass'].dereference ()['name_space'].string ()
|
||||
class_name = obj ['vtable'].dereference ()['klass'].dereference ()['name'].string ()
|
||||
if class_ns == "System" and class_name == "String":
|
||||
return StringPrinter (self.val).to_string ()
|
||||
if class_name [-2:len(class_name)] == "[]":
|
||||
return ArrayPrinter (self.val,class_ns,class_name).to_string ()
|
||||
if class_ns != "":
|
||||
try:
|
||||
gdb_type = gdb.Type ("struct %s.%s" % (class_ns, class_name))
|
||||
except:
|
||||
# Maybe there is no debug info for that type
|
||||
return "%s.%s" % (class_ns, class_name)
|
||||
#return obj.cast (gdb_type)
|
||||
return "%s.%s" % (class_ns, class_name)
|
||||
return class_name
|
||||
except:
|
||||
print sys.exc_info ()[0]
|
||||
print sys.exc_info ()[1]
|
||||
# FIXME: This can happen because we don't have liveness information
|
||||
return self.val.cast (gdb.Type ("guint64"))
|
||||
|
||||
def register_csharp_printers(obj):
|
||||
"Register C# pretty-printers with objfile Obj."
|
||||
|
||||
if obj == None:
|
||||
obj = gdb
|
||||
|
||||
obj.pretty_printers['object'] = ObjectPrinter
|
||||
obj.pretty_printers['string'] = StringPrinter
|
||||
|
||||
register_csharp_printers (gdb.current_objfile())
|
||||
|
||||
class MonoSupport(object):
|
||||
|
||||
def __init__(self):
|
||||
self.s_size = 0
|
||||
|
||||
def run_hook(self):
|
||||
if os.access ("xdb.s", os.F_OK):
|
||||
os.remove ("xdb.s")
|
||||
gdb.execute ("set environment MONO_XDEBUG 1")
|
||||
|
||||
def stop_hook(self):
|
||||
# Called when the program is stopped
|
||||
# Need to recompile+reload the xdb.s file if needed
|
||||
# FIXME: Need to detect half-written files created when the child is
|
||||
# interrupted while executing the xdb.s writing code
|
||||
# FIXME: Handle appdomain unload
|
||||
if os.access ("xdb.s", os.F_OK):
|
||||
new_size = os.stat ("xdb.s").st_size
|
||||
if new_size > self.s_size:
|
||||
sofile = "xdb.so"
|
||||
gdb.execute ("shell as -o xdb.o xdb.s && ld -shared -o %s xdb.o" % sofile)
|
||||
# FIXME: This prints messages which couldn't be turned off
|
||||
gdb.execute ("add-symbol-file %s 0" % sofile)
|
||||
self.s_size = new_size
|
||||
|
||||
class RunHook (gdb.Command):
|
||||
def __init__ (self):
|
||||
super (RunHook, self).__init__ ("hook-run", gdb.COMMAND_NONE,
|
||||
gdb.COMPLETE_COMMAND, pre_hook_of="run")
|
||||
|
||||
def invoke(self, arg, from_tty):
|
||||
mono_support.run_hook ()
|
||||
|
||||
print "Mono support loaded."
|
||||
|
||||
mono_support = MonoSupport ()
|
||||
|
||||
# This depends on the changes in gdb-python.diff to work
|
||||
#RunHook ()
|
||||
|
||||
# Register our hooks
|
||||
# This currently cannot be done from python code
|
||||
|
||||
exec_file = gdb.current_objfile ().filename
|
||||
# FIXME: Is there a way to detect symbolic links ?
|
||||
if os.stat (exec_file).st_size != os.lstat (exec_file).st_size:
|
||||
exec_file = os.readlink (exec_file)
|
||||
exec_dir = os.path.dirname (exec_file)
|
||||
gdb.execute ("source %s/%s-gdbinit" % (exec_dir, os.path.basename (exec_file)))
|
||||
@@ -1,20 +0,0 @@
|
||||
# Loaded by mono-gdb.py
|
||||
|
||||
# FIXME: According to gdb docs, this is called _before_ anything is printed
|
||||
# Got broken by this patch:
|
||||
# http://sourceware.org/ml/gdb-patches/2008-09/msg00193.html
|
||||
# FIXME: This seems to cause crashes inside gdb
|
||||
#define hook-stop
|
||||
# python mono_support.stop_hook ()
|
||||
#end
|
||||
define hook-backtrace
|
||||
python mono_support.stop_hook ()
|
||||
end
|
||||
|
||||
define hook-run
|
||||
python mono_support.run_hook ()
|
||||
end
|
||||
|
||||
define xdb
|
||||
python mono_support.stop_hook ()
|
||||
end
|
||||
@@ -6,4 +6,4 @@ libdir=${exec_prefix}/lib
|
||||
Name: Mono NUnit
|
||||
Description: Mono's version of NUnit
|
||||
Version: @VERSION@
|
||||
Libs: -r:${libdir}/mono/1.0/nunit.core.dll -r:${libdir}/mono/1.0/nunit.core.interfaces.dll -r:${libdir}/mono/1.0/nunit.core.extensions.dll -r:${libdir}/mono/1.0/nunit.framework.dll -r:${libdir}/mono/1.0/nunit.framework.extensions.dll -r:${libdir}/mono/1.0/nunit.mocks.dll -r:${libdir}/mono/1.0/nunit.util.dll -r:${libdir}/mono/1.0/nunit-console-runner.dll
|
||||
Libs: -r:${libdir}/mono/1.0/nunit.core.dll -r:${libdir}/mono/1.0/nunit.framework.dll -r:${libdir}/mono/1.0/nunit.util.dll
|
||||
+1
-16
@@ -1,29 +1,14 @@
|
||||
2009-01-23 Atsushi Enomoto <[email protected]>
|
||||
|
||||
* web.config : added .svc handler.
|
||||
|
||||
2009-01-07 Kornél Pál <[email protected]>
|
||||
|
||||
* DefaultWsdlHelpGenerator.aspx: Move <script> at the end of <head> that
|
||||
will make Visual Studio recognize the web service disco reference.
|
||||
|
||||
Contributed under MIT/X11 license.
|
||||
|
||||
2008-12-03 Marek Habersack <[email protected]>
|
||||
|
||||
* machine.config: rename serviceModelHostingEnvironment to
|
||||
serviceHostingEnvironment.
|
||||
|
||||
2008-11-20 Gonzalo Paniagua Javier <[email protected]>
|
||||
|
||||
* machine.config: in 2.0, there's no <connectionManagement> section
|
||||
here. Bug #445991 fixed.
|
||||
|
||||
2008-11-14 Gonzalo Paniagua Javier <[email protected]>
|
||||
|
||||
* DefaultWsdlHelpGenerator.aspx: use javascript instead of
|
||||
HttpWebRequest to avoid a deadlock if the web service uses Session.
|
||||
Bug #444343 fixed.
|
||||
re: miguel
|
||||
|
||||
2008-10-09 Gonzalo Paniagua Javier <[email protected]>
|
||||
|
||||
|
||||
@@ -34,6 +34,73 @@
|
||||
<%@ Page debug="true" %>
|
||||
|
||||
<html>
|
||||
<script language="javascript" type="text/javascript">
|
||||
var req;
|
||||
function getXML (command, url, qs) {
|
||||
if (url == "" || url.substring (0, 4) != "http")
|
||||
return;
|
||||
|
||||
var post_data = null;
|
||||
req = getReq ();
|
||||
req.onreadystatechange = stateChange;
|
||||
if (command == "GET") {
|
||||
url = url + "?" + qs;
|
||||
} else {
|
||||
post_data = qs;
|
||||
}
|
||||
req.open (command, url, true);
|
||||
if (command == "POST")
|
||||
req.setRequestHeader ("Content-Type", "application/x-www-form-urlencoded");
|
||||
req.send (post_data);
|
||||
}
|
||||
|
||||
function stateChange () {
|
||||
if (req.readyState == 4) {
|
||||
var node = document.getElementById("testresult_div");
|
||||
var text = "";
|
||||
if (req.status == 200) {
|
||||
node.innerHTML = "<div class='code-xml'>" + formatXml (req.responseText) + "</div>";
|
||||
} else {
|
||||
var ht = "<b style='color: red'>" + formatXml (req.status + " - " + req.statusText) + "</b>";
|
||||
if (req.responseText != "")
|
||||
ht = ht + "\n<div class='code-xml'>" + formatXml (req.responseText) + "</div>";
|
||||
node.innerHTML = ht;
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function formatXml (text)
|
||||
{
|
||||
var re = / /g;
|
||||
text = text.replace (re, " ");
|
||||
|
||||
re = /\t/g;
|
||||
text = text.replace (re, " ");
|
||||
|
||||
re = /\<\s*(\/?)\s*(.*?)\s*(\/?)\s*\>/g;
|
||||
text = text.replace (re,"{blue:<$1}{maroon:$2}{blue:$3>}");
|
||||
|
||||
re = /{(\w*):(.*?)}/g;
|
||||
text = text.replace (re,"<span style='color:$1'>$2</span>");
|
||||
|
||||
re = /"(.*?)"/g;
|
||||
text = text.replace (re,"\"<span style='color:purple'>$1</span>\"");
|
||||
|
||||
re = /\r\n|\r|\n/g;
|
||||
text = text.replace (re, "<br/>");
|
||||
|
||||
return text;
|
||||
}
|
||||
|
||||
function getReq () {
|
||||
if (window.XMLHttpRequest) {
|
||||
return new XMLHttpRequest(); // Firefox, Safari, ...
|
||||
} else if (window.ActiveXObject) {
|
||||
return new ActiveXObject("Microsoft.XMLHTTP");
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<script language="C#" runat="server">
|
||||
|
||||
ServiceDescriptionCollection descriptions;
|
||||
@@ -1548,73 +1615,7 @@ public class HtmlSampleGenerator: SampleGenerator
|
||||
A:hover { color: blue }
|
||||
</style>
|
||||
|
||||
<script language="javascript" type="text/javascript">
|
||||
var req;
|
||||
function getXML (command, url, qs) {
|
||||
if (url == "" || url.substring (0, 4) != "http")
|
||||
return;
|
||||
|
||||
var post_data = null;
|
||||
req = getReq ();
|
||||
req.onreadystatechange = stateChange;
|
||||
if (command == "GET") {
|
||||
url = url + "?" + qs;
|
||||
} else {
|
||||
post_data = qs;
|
||||
}
|
||||
req.open (command, url, true);
|
||||
if (command == "POST")
|
||||
req.setRequestHeader ("Content-Type", "application/x-www-form-urlencoded");
|
||||
req.send (post_data);
|
||||
}
|
||||
|
||||
function stateChange () {
|
||||
if (req.readyState == 4) {
|
||||
var node = document.getElementById("testresult_div");
|
||||
var text = "";
|
||||
if (req.status == 200) {
|
||||
node.innerHTML = "<div class='code-xml'>" + formatXml (req.responseText) + "</div>";
|
||||
} else {
|
||||
var ht = "<b style='color: red'>" + formatXml (req.status + " - " + req.statusText) + "</b>";
|
||||
if (req.responseText != "")
|
||||
ht = ht + "\n<div class='code-xml'>" + formatXml (req.responseText) + "</div>";
|
||||
node.innerHTML = ht;
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function formatXml (text)
|
||||
{
|
||||
var re = / /g;
|
||||
text = text.replace (re, " ");
|
||||
|
||||
re = /\t/g;
|
||||
text = text.replace (re, " ");
|
||||
|
||||
re = /\<\s*(\/?)\s*(.*?)\s*(\/?)\s*\>/g;
|
||||
text = text.replace (re,"{blue:<$1}{maroon:$2}{blue:$3>}");
|
||||
|
||||
re = /{(\w*):(.*?)}/g;
|
||||
text = text.replace (re,"<span style='color:$1'>$2</span>");
|
||||
|
||||
re = /"(.*?)"/g;
|
||||
text = text.replace (re,"\"<span style='color:purple'>$1</span>\"");
|
||||
|
||||
re = /\r\n|\r|\n/g;
|
||||
text = text.replace (re, "<br/>");
|
||||
|
||||
return text;
|
||||
}
|
||||
|
||||
function getReq () {
|
||||
if (window.XMLHttpRequest) {
|
||||
return new XMLHttpRequest(); // Firefox, Safari, ...
|
||||
} else if (window.ActiveXObject) {
|
||||
return new ActiveXObject("Microsoft.XMLHTTP");
|
||||
}
|
||||
}
|
||||
|
||||
<script>
|
||||
function clearForm ()
|
||||
{
|
||||
document.getElementById("testFormResult").style.display="none";
|
||||
|
||||
@@ -102,6 +102,9 @@
|
||||
</configProtectedData>
|
||||
|
||||
<system.net>
|
||||
<connectionManagement>
|
||||
<add address="*" maxconnection="2" />
|
||||
</connectionManagement>
|
||||
<authenticationModules>
|
||||
<add type="System.Net.BasicClient, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
|
||||
<add type="System.Net.DigestClient, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
|
||||
|
||||
@@ -37,9 +37,8 @@
|
||||
<add verb="*" path="*.vbproj" type="System.Web.HttpForbiddenHandler, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
|
||||
<add verb="*" path="*.licx" type="System.Web.HttpForbiddenHandler, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
|
||||
<add verb="*" path="*.dll" type="System.Web.HttpForbiddenHandler, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
|
||||
<add verb="*" path="*.rem" type="System.Runtime.Remoting.Channels.Http.HttpRemotingHandlerFactory, System.Runtime.Remoting, Culture=neutral, PublicKeyToken=b77a5c561934e089" validate="false" />
|
||||
<add verb="*" path="*.soap" type="System.Runtime.Remoting.Channels.Http.HttpRemotingHandlerFactory, System.Runtime.Remoting, Culture=neutral, PublicKeyToken=b77a5c561934e089" validate="false" />
|
||||
<add verb="*" path="*.svc" type="System.ServiceModel.Channels.SvcHttpHandlerFactory, System.ServiceModel, Version=3.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
|
||||
<add verb="*" path="*.rem" type="System.Runtime.Remoting.Channels.Http.HttpRemotingHandlerFactory, System.Runtime.Remoting, Culture=neutral, PublicKeyToken=b77a5c561934e089" validate="false" />
|
||||
<add verb="*" path="*.soap" type="System.Runtime.Remoting.Channels.Http.HttpRemotingHandlerFactory, System.Runtime.Remoting, Culture=neutral, PublicKeyToken=b77a5c561934e089" validate="false" />
|
||||
<add verb="GET,HEAD" path="*" type="System.Web.StaticFileHandler, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
|
||||
<add verb="*" path="*" type="System.Web.HttpMethodNotAllowedHandler, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
|
||||
</httpHandlers>
|
||||
|
||||
+8
-56
@@ -1,59 +1,3 @@
|
||||
2009-02-12 Zoltan Varga <[email protected]>
|
||||
|
||||
* Makefile.am (EXTRA_DIST): Remove removed files.
|
||||
|
||||
* README: Point to the documentation on the wiki.
|
||||
|
||||
* call-sites.txt: Remove this, its contents is in jit-trampolines.
|
||||
|
||||
* memory-management.txt thread-safety.txt aot-compiler.txt jit-regalloc
|
||||
exception-handling.txt: Remove documents which are now on the wiki.
|
||||
|
||||
2009-02-11 Rodrigo Kumpera <[email protected]>
|
||||
|
||||
* thread-safety.txt: Improve the docs about image lock.
|
||||
|
||||
2009-02-11 Rodrigo Kumpera <[email protected]>
|
||||
|
||||
* thread-safety.txt: Document the new image lock.
|
||||
|
||||
2008-12-12 Mark Probst <[email protected]>
|
||||
|
||||
* mini-porting.txt: Added some details about function descriptors
|
||||
and emulated opcodes.
|
||||
|
||||
2008-12-08 Jonathan Pryor <[email protected]>
|
||||
|
||||
* mono-file-formats.source, mono-tools.source: Place these under the
|
||||
new "Commands and Files" node, and remove nay intermediate nodes.
|
||||
|
||||
2008-11-20 Jonathan Pryor <[email protected]>
|
||||
|
||||
* Makefile.am (sources_DATA): Add mono-file-formats.source,
|
||||
mono-tools.source.
|
||||
|
||||
2008-11-20 Raja R Harinath <[email protected]>
|
||||
|
||||
Remove unnecessary rebuilds of the html directory
|
||||
* docs.make (monoapi.zip): Make slightly more unforgiving, by
|
||||
using '&&' instead of ';' to sequence commands.
|
||||
(mono-tools.zip, mono-file-formats.zip): Likewise.
|
||||
* Makefile.am (monoapi.zip, mono-tools.zip, mono-fileformats.zip):
|
||||
Likewise.
|
||||
(convert.exe): Don't depend on Makefile.am or docs.make.
|
||||
|
||||
2008-11-19 Raja R Harinath <[email protected]>
|
||||
|
||||
Fix srcdir != builddir, and add idiom for multi-output commands
|
||||
* docs.make (monoapi.zip): Handle the case where 'monoapi.tree'
|
||||
exists but 'monoapi.zip' doesn't. IOW, we should rebuild
|
||||
monoapi.zip with 'rm monoapi.zip; make'.
|
||||
(mono-tools.zip, mono-file-formats.zip): Likewise.
|
||||
* Makefile.am (monoapi.zip, mono-tools.zip, mono-fileformats.zip):
|
||||
Likewise.
|
||||
(monoapi.tree): Don't use $< in an explicit rule.
|
||||
(mono-tools.tree, mono-file-formats.tree): Likewise.
|
||||
|
||||
2008-11-18 Jonathan Pryor <[email protected]>
|
||||
|
||||
* Makefile.am (EXTRA_DIST): Add mono-file-formats{.config,.source} and
|
||||
@@ -67,6 +11,14 @@
|
||||
pages so that they're valid for building from mono/docs.
|
||||
* monoapi.make: Rename to docs.make.
|
||||
|
||||
2008-11-18 Jonathan Pryor <[email protected]>
|
||||
|
||||
* docs.make, Makefile.am: Build mono-file-formats{.tree,.zip},
|
||||
mono-tool{.tree,.zip} files.
|
||||
* mono-file-formats.config, mono-tools.config: Alter paths to man
|
||||
pages so that they're valid for building from mono/docs.
|
||||
* monoapi.make: Rename to docs.make.
|
||||
|
||||
2008-11-01 Raja R Harinath <[email protected]>
|
||||
|
||||
* Makefile.am: Clean up for srcdir != builddir.
|
||||
|
||||
+15
-16
@@ -1,8 +1,6 @@
|
||||
sourcesdir = $(prefix)/lib/monodoc/sources
|
||||
|
||||
sources_DATA = \
|
||||
mono-file-formats.source \
|
||||
mono-tools.source \
|
||||
monoapi.source \
|
||||
$(ASSEMBLED_DOCS)
|
||||
|
||||
@@ -14,6 +12,7 @@ ASSEMBLED_DOCS = \
|
||||
EXTRA_DIST = \
|
||||
abc-removal.txt \
|
||||
AgilityPack.dll \
|
||||
aot-compiler.txt \
|
||||
api-style.css \
|
||||
assembly-bundle \
|
||||
check-exports \
|
||||
@@ -24,6 +23,7 @@ EXTRA_DIST = \
|
||||
docs.make \
|
||||
documented \
|
||||
embedded-api \
|
||||
exception-handling.txt \
|
||||
exceptions \
|
||||
exdoc \
|
||||
file-share-modes \
|
||||
@@ -34,6 +34,7 @@ EXTRA_DIST = \
|
||||
internal-calls \
|
||||
ir-desc \
|
||||
jit-imt \
|
||||
jit-regalloc \
|
||||
jit-thoughts \
|
||||
jit-trampolines \
|
||||
local-regalloc.txt \
|
||||
@@ -60,6 +61,7 @@ EXTRA_DIST = \
|
||||
ssapre.txt \
|
||||
stack-alignment \
|
||||
stack-overflow.txt \
|
||||
thread-safety.txt \
|
||||
threading \
|
||||
toc.xml \
|
||||
TODO \
|
||||
@@ -77,21 +79,18 @@ clean-local:
|
||||
-rm -f $(srcdir)/deploy/* $(srcdir)/convert.exe*
|
||||
-cd $(srcdir) && rm -f $(ASSEMBLED_DOCS)
|
||||
|
||||
monoapi.zip: monoapi.tree
|
||||
@test -f $@ || { rm -f $(srcdir)/monoapi.tree && $(MAKE) monoapi.tree; }
|
||||
monoapi.tree: docs.make Makefile.am toc.xml $(srcdir)/deploy/.stamp
|
||||
cd $(srcdir) && cp api-style.css deploy
|
||||
cd $(srcdir) && $(MAKE) -f docs.make topdir=$(mcs_topdir_from_srcdir) $@
|
||||
monoapi.zip : monoapi.tree
|
||||
monoapi.tree: docs.make Makefile.am toc.xml deploy/.stamp
|
||||
cp api-style.css deploy
|
||||
cd $(srcdir) && $(MAKE) -f $< topdir=$(mcs_topdir_from_srcdir) $@
|
||||
|
||||
mono-tools.zip: mono-tools.tree
|
||||
@test -f $@ || { rm -f $(srcdir)/mono-tools.tree && $(MAKE) mono-tools.tree; }
|
||||
mono-tools.tree: docs.make Makefile.am $(srcdir)/deploy/.stamp
|
||||
cd $(srcdir) && $(MAKE) -f docs.make topdir=$(mcs_topdir_from_srcdir) $@
|
||||
mono-tools.zip : mono-tools.tree
|
||||
mono-tools.tree: docs.make Makefile.am deploy/.stamp
|
||||
cd $(srcdir) && $(MAKE) -f $< topdir=$(mcs_topdir_from_srcdir) $@
|
||||
|
||||
mono-file-formats.zip: mono-file-formats.tree
|
||||
@test -f $@ || { rm -f $(srcdir)/mono-file-formats.tree && $(MAKE) mono-file-formats.tree; }
|
||||
mono-file-formats.tree: docs.make Makefile.am $(srcdir)/deploy/.stamp
|
||||
cd $(srcdir) && $(MAKE) -f docs.make topdir=$(mcs_topdir_from_srcdir) $@
|
||||
mono-file-formats.zip : mono-file-formats.tree
|
||||
mono-file-formats.tree: docs.make Makefile.am deploy/.stamp
|
||||
cd $(srcdir) && $(MAKE) -f $< topdir=$(mcs_topdir_from_srcdir) $@
|
||||
|
||||
$(srcdir)/deploy/.stamp: convert.exe Makefile.am
|
||||
$(mkdir_p) $(srcdir)/html
|
||||
@@ -101,6 +100,6 @@ $(srcdir)/deploy/.stamp: convert.exe Makefile.am
|
||||
|
||||
extract: $(srcdir)/deploy/.stamp
|
||||
|
||||
convert.exe: convert.cs AgilityPack.dll
|
||||
convert.exe: docs.make convert.cs Makefile.am
|
||||
cd $(srcdir) && $(MAKE) -f docs.make topdir=$(mcs_topdir_from_srcdir) convert.exe
|
||||
|
||||
@@ -1,9 +1,3 @@
|
||||
Documentation is now maintained on the mono wiki:
|
||||
|
||||
http://www.mono-project.com/Mono:Runtime:Documentation
|
||||
|
||||
Older documents or documents which were not yet migrated to the wiki are kept here.
|
||||
|
||||
* Scripts to maintain the Mono VM internal API
|
||||
|
||||
Layout
|
||||
|
||||
@@ -0,0 +1,393 @@
|
||||
Mono Ahead Of Time Compiler
|
||||
===========================
|
||||
|
||||
The Ahead of Time compilation feature in Mono allows Mono to
|
||||
precompile assemblies to minimize JIT time, reduce memory
|
||||
usage at runtime and increase the code sharing across multiple
|
||||
running Mono application.
|
||||
|
||||
To precompile an assembly use the following command:
|
||||
|
||||
mono --aot -O=all assembly.exe
|
||||
|
||||
The `--aot' flag instructs Mono to ahead-of-time compile your
|
||||
assembly, while the -O=all flag instructs Mono to use all the
|
||||
available optimizations.
|
||||
|
||||
* Caching metadata
|
||||
------------------
|
||||
|
||||
Besides code, the AOT file also contains cached metadata information which allows
|
||||
the runtime to avoid certain computations at runtime, like the computation of
|
||||
generic vtables. This reduces both startup time, and memory usage. It is possible
|
||||
to create an AOT image which contains only this cached information and no code by
|
||||
using the 'metadata-only' option during compilation:
|
||||
|
||||
mono --aot=metadata-only assembly.exe
|
||||
|
||||
This works even on platforms where AOT is not normally supported.
|
||||
|
||||
* Position Independent Code
|
||||
---------------------------
|
||||
|
||||
On x86 and x86-64 the code generated by Ahead-of-Time compiled
|
||||
images is position-independent code. This allows the same
|
||||
precompiled image to be reused across multiple applications
|
||||
without having different copies: this is the same way in which
|
||||
ELF shared libraries work: the code produced can be relocated
|
||||
to any address.
|
||||
|
||||
The implementation of Position Independent Code had a
|
||||
performance impact on Ahead-of-Time compiled images but
|
||||
compiler bootstraps are still faster than JIT-compiled images,
|
||||
specially with all the new optimizations provided by the Mono
|
||||
engine.
|
||||
|
||||
* How to support Position Independent Code in new Mono Ports
|
||||
------------------------------------------------------------
|
||||
|
||||
Generated native code needs to reference various runtime
|
||||
structures/functions whose address is only known at run
|
||||
time. JITted code can simple embed the address into the native
|
||||
code, but AOT code needs to do an indirection. This
|
||||
indirection is done through a table called the Global Offset
|
||||
Table (GOT), which is similar to the GOT table in the Elf
|
||||
spec. When the runtime saves the AOT image, it saves some
|
||||
information for each method describing the GOT table entries
|
||||
used by that method. When loading a method from an AOT image,
|
||||
the runtime will fill out the GOT entries needed by the
|
||||
method.
|
||||
|
||||
* Computing the address of the GOT
|
||||
|
||||
Methods which need to access the GOT first need to compute its
|
||||
address. On the x86 it is done by code like this:
|
||||
|
||||
call <IP + 5>
|
||||
pop ebx
|
||||
add <OFFSET TO GOT>, ebx
|
||||
<save got addr to a register>
|
||||
|
||||
The variable representing the got is stored in
|
||||
cfg->got_var. It is allways allocated to a global register to
|
||||
prevent some problems with branches + basic blocks.
|
||||
|
||||
* Referencing GOT entries
|
||||
|
||||
Any time the native code needs to access some other runtime
|
||||
structure/function (i.e. any time the backend calls
|
||||
mono_add_patch_info ()), the code pointed by the patch needs
|
||||
to load the value from the got. For example, instead of:
|
||||
|
||||
call <ABSOLUTE ADDR>
|
||||
it needs to do:
|
||||
call *<OFFSET>(<GOT REG>)
|
||||
|
||||
Here, the <OFFSET> can be 0, it will be fixed up by the AOT compiler.
|
||||
|
||||
For more examples on the changes required, see
|
||||
|
||||
svn diff -r 37739:38213 mini-x86.c
|
||||
|
||||
* The Program Linkage Table
|
||||
|
||||
As in ELF, calls made from AOT code do not go through the GOT. Instead, a direct call is
|
||||
made to an entry in the Program Linkage Table (PLT). This is based on the fact that on
|
||||
most architectures, call instructions use a displacement instead of an absolute address, so
|
||||
they are already position independent. An PLT entry is usually a jump instruction, which
|
||||
initially points to some trampoline code which transfers control to the AOT loader, which
|
||||
will compile the called method, and patch the PLT entry so that further calls are made
|
||||
directly to the called method.
|
||||
If the called method is in the same assembly, and does not need initialization (i.e. it
|
||||
doesn't have GOT slots etc), then the call is made directly, bypassing the PLT.
|
||||
|
||||
* Implementation
|
||||
----------------
|
||||
|
||||
** The Precompiled File Format
|
||||
-----------------------------
|
||||
|
||||
We use the native object format of the platform. That way it
|
||||
is possible to reuse existing tools like objdump and the
|
||||
dynamic loader. All we need is a working assembler, i.e. we
|
||||
write out a text file which is then passed to gas (the gnu
|
||||
assembler) to generate the object file.
|
||||
|
||||
The precompiled image is stored in a file next to the original
|
||||
assembly that is precompiled with the native extension for a shared
|
||||
library (on Linux its ".so" to the generated file).
|
||||
|
||||
For example: basic.exe -> basic.exe.so; corlib.dll -> corlib.dll.so
|
||||
|
||||
To avoid symbol lookup overhead and to save space, some things like the
|
||||
compiled code of the individual methods are not identified by specific symbols
|
||||
like method_code_1234. Instead, they are stored in one big array and the
|
||||
offsets inside this array are stored in another array, requiring just two
|
||||
symbols. The offsets array is usually named 'FOO_offsets', where FOO is the
|
||||
array the offsets refer to, like 'methods', and 'method_offsets'.
|
||||
|
||||
Generating code using an assembler and linker has some disadvantages:
|
||||
- it requires GNU binutils or an equivalent package to be installed on the
|
||||
machine running the aot compilation.
|
||||
- it is slow.
|
||||
|
||||
There is some support in the aot compiler for directly emitting elf files, but
|
||||
its not complete (yet).
|
||||
|
||||
The following things are saved in the object file and can be
|
||||
looked up using the equivalent to dlsym:
|
||||
|
||||
mono_assembly_guid
|
||||
|
||||
A copy of the assembly GUID.
|
||||
|
||||
mono_aot_version
|
||||
|
||||
The format of the AOT file format.
|
||||
|
||||
mono_aot_opt_flags
|
||||
|
||||
The optimizations flags used to build this
|
||||
precompiled image.
|
||||
|
||||
method_infos
|
||||
|
||||
Contains additional information needed by the runtime for using the
|
||||
precompiled method, like the GOT entries it uses.
|
||||
|
||||
method_info_offsets
|
||||
|
||||
Maps method indexes to offsets in the method_infos array.
|
||||
|
||||
mono_icall_table
|
||||
|
||||
A table that lists all the internal calls
|
||||
references by the precompiled image.
|
||||
|
||||
mono_image_table
|
||||
|
||||
A list of assemblies referenced by this AOT
|
||||
module.
|
||||
|
||||
methods
|
||||
|
||||
The precompiled code itself.
|
||||
|
||||
method_offsets
|
||||
|
||||
Maps method indexes to offsets in the methods array.
|
||||
|
||||
ex_info
|
||||
|
||||
Contains information about methods which is rarely used during normal execution,
|
||||
like exception and debug info.
|
||||
|
||||
ex_info_offsets
|
||||
|
||||
Maps method indexes to offsets in the ex_info array.
|
||||
|
||||
class_info
|
||||
|
||||
Contains precomputed metadata used to speed up various runtime functions.
|
||||
|
||||
class_info_offsets
|
||||
|
||||
Maps class indexes to offsets in the class_info array.
|
||||
|
||||
class_name_table
|
||||
|
||||
A hash table mapping class names to class indexes. Used to speed up
|
||||
mono_class_from_name ().
|
||||
|
||||
plt
|
||||
|
||||
The Program Linkage Table
|
||||
|
||||
plt_info
|
||||
|
||||
Contains information needed to find the method belonging to a given PLT entry.
|
||||
|
||||
** Source file structure
|
||||
-----------------------------
|
||||
|
||||
The AOT infrastructure is split into two files, aot-compiler.c and
|
||||
aot-runtime.c. aot-compiler.c contains the AOT compiler which is invoked by
|
||||
--aot, while aot-runtime.c contains the runtime support needed for loading
|
||||
code and other things from the aot files.
|
||||
|
||||
** Compilation process
|
||||
----------------------------
|
||||
|
||||
AOT compilation consists of the following stages:
|
||||
- collecting the methods to be compiled.
|
||||
- compiling them using the JIT.
|
||||
- emitting the JITted code and other information into an assembly file (.s).
|
||||
- assembling the file using the system assembler.
|
||||
- linking the resulting object file into a shared library using the system
|
||||
linker.
|
||||
|
||||
** Handling compiled code
|
||||
----------------------------
|
||||
|
||||
Each method is identified by a method index. For normal methods, this is
|
||||
equivalent to its index in the METHOD metadata table. For runtime generated
|
||||
methods (wrappers), it is an arbitrary number.
|
||||
Compiled code is created by invoking the JIT, requesting it to created AOT
|
||||
code instead of normal code. This is done by the compile_method () function.
|
||||
The output of the JIT is compiled code and a set of patches (relocations). Each
|
||||
relocation specifies an offset inside the compiled code, and a runtime object
|
||||
whose address is accessed at that offset.
|
||||
Patches are described by a MonoJumpInfo structure. From the perspective
|
||||
of the AOT compiler, there are two kinds of patches:
|
||||
- calls, which require an entry in the PLT table.
|
||||
- everything else, which require an entry in the GOT table.
|
||||
How patches is handled is described in the next section.
|
||||
After all the method are compiled, they are emitted into the output file into
|
||||
a byte array called 'methods', The emission
|
||||
is done by the emit_method_code () and emit_and_reloc_code () functions. Each
|
||||
piece of compiled code is identified by the local symbol .Lm_<method index>.
|
||||
While compiled code is emitted, all the locations which have an associated patch
|
||||
are rewritten using a platform specific process so the final generated code will
|
||||
refer to the plt and got entries belonging to the patches.
|
||||
The compiled code array
|
||||
can be accessed using the 'methods' global symbol.
|
||||
|
||||
** Handling patches
|
||||
----------------------------
|
||||
|
||||
Before a piece of AOTed code can be used, the GOT entries used by it must be
|
||||
filled out with the addresses of runtime objects. Those objects are identified
|
||||
by MonoJumpInfo structures. These stuctures are saved in a serialized form in
|
||||
the AOT file, so the AOT loader can deconstruct them. The serialization is done
|
||||
by the encode_patch () function, while the deserialization is done by the
|
||||
decode_patch_info () function.
|
||||
Every method has an associated method info blob inside the 'method_info' byte
|
||||
array in the AOT file. This contains all the information required to load the
|
||||
method at runtime:
|
||||
- the first got entry used by the method.
|
||||
- the number of got entries used by the method.
|
||||
- the serialized patch info for the got entries.
|
||||
Some patches, like vtables, icalls are very common, so instead of emitting their
|
||||
info every time they are used by a method, we emit the info only once into a
|
||||
byte array named 'got_info', and only emit an index into this array for every
|
||||
access.
|
||||
|
||||
** The Procedure Linkage Table (PLT)
|
||||
------------------------------------
|
||||
|
||||
Our PLT is similar to the elf PLT, it is used to handle calls between methods.
|
||||
If method A needs to call method B, then an entry is allocated in the PLT for
|
||||
method B, and A calls that entry instead of B directly. This is useful because
|
||||
in some cases the runtime needs to do some processing the first time B is
|
||||
called.
|
||||
There are two cases:
|
||||
- if B is in another assembly, then it needs to be looked up, then JITted or the
|
||||
corresponding AOT code needs to be found.
|
||||
- if B is in the same assembly, but has got slots, then the got slots need to be
|
||||
initialized.
|
||||
If none of these cases is true, then the PLT is not used, and the call is made
|
||||
directly to the native code of the target method.
|
||||
A PLT entry is usually implemented by a jump though a jump table, where the
|
||||
jump table entries are initially filled up with the address of a trampoline so
|
||||
the runtime can get control, and after the native code of the called method is
|
||||
created/found, the jump table entry is changed to point to the native code.
|
||||
All PLT entries also embed a integer offset after the jump which indexes into
|
||||
the 'plt_info' table, which stores the information required to find the called
|
||||
method. The PLT is emitted by the emit_plt () function.
|
||||
|
||||
** Exception/Debug info
|
||||
----------------------------
|
||||
|
||||
Each compiled method has some additional info generated by the JIT, usable
|
||||
for debugging (IL offset-native offset maps) and exception handling
|
||||
(saved registers, native offsets of try/catch clauses). Since this info is
|
||||
rarely needed, it is saved into a separate byte array called 'ex_info'.
|
||||
|
||||
** Cached metadata
|
||||
---------------------------
|
||||
|
||||
When the runtime loads a class, it needs to compute a variety of information
|
||||
which is not readily available in the metadata, like the instance size,
|
||||
vtable, whenever the class has a finalizer/type initializer etc. Computing this
|
||||
information requires a lot of time, causes the loading of lots of metadata,
|
||||
and it usually involves the creation of many runtime data structures
|
||||
(MonoMethod/MonoMethodSignature etc), which are long living, and usually persist
|
||||
for the lifetime of the app. To avoid this, we compute the required information
|
||||
at aot compilation time, and save it into the aot image, into an array called
|
||||
'class_info'. The runtime can query this information using the
|
||||
mono_aot_get_cached_class_info () function, and if the information is available,
|
||||
it can avoid computing it.
|
||||
|
||||
** Full AOT mode
|
||||
-------------------------
|
||||
|
||||
Some platforms like the iphone prohibit JITted code, using technical and/or
|
||||
legal means. This is a significant problem for the mono runtime, since it
|
||||
generates a lot of code dynamically, using either the JIT or more low-level
|
||||
code generation macros. To solve this, the AOT compiler is able to function in
|
||||
full-aot or aot-only mode, where it generates and saves all the neccesary code
|
||||
in the aot image, so at runtime, no code needs to be generated.
|
||||
There are two kinds of code which needs to be considered:
|
||||
- wrapper methods, that is methods whose IL is generated dynamically by the
|
||||
runtime. They are handled by generating them in the add_wrappers () function,
|
||||
then emitting them the same way as the 'normal' methods. The only problem is
|
||||
that these methods do not have a methoddef token, so we need a separate table
|
||||
in the aot image ('wrapper_info') to find their method index.
|
||||
- trampolines and other small hand generated pieces of code. They are handled
|
||||
in an ad-hoc way in the emit_trampolines () function.
|
||||
|
||||
* Performance considerations
|
||||
----------------------------
|
||||
|
||||
Using AOT code is a trade-off which might lead to higher or
|
||||
slower performance, depending on a lot of circumstances. Some
|
||||
of these are:
|
||||
|
||||
- AOT code needs to be loaded from disk before being used, so
|
||||
cold startup of an application using AOT code MIGHT be
|
||||
slower than using JITed code. Warm startup (when the code is
|
||||
already in the machines cache) should be faster. Also,
|
||||
JITing code takes time, and the JIT compiler also need to
|
||||
load additional metadata for the method from the disk, so
|
||||
startup can be faster even in the cold startup case.
|
||||
|
||||
- AOT code is usually compiled with all optimizations turned
|
||||
on, while JITted code is usually compiled with default
|
||||
optimizations, so the generated code in the AOT case should
|
||||
be faster.
|
||||
|
||||
- JITted code can directly access runtime data structures and
|
||||
helper functions, while AOT code needs to go through an
|
||||
indirection (the GOT) to access them, so it will be slower
|
||||
and somewhat bigger as well.
|
||||
|
||||
- When JITting code, the JIT compiler needs to load a lot of
|
||||
metadata about methods and types into memory.
|
||||
|
||||
- JITted code has better locality, meaning that if A method
|
||||
calls B, then the native code for A and B is usually quite
|
||||
close in memory, leading to better cache behaviour thus
|
||||
improved performance. In contrast, the native code of
|
||||
methods inside the AOT file is in a somewhat random order.
|
||||
|
||||
* Future Work
|
||||
-------------
|
||||
|
||||
- Currently, when an AOT module is loaded, all of its
|
||||
dependent assemblies are also loaded eagerly, and these
|
||||
assemblies need to be exactly the same as the ones loaded
|
||||
when the AOT module was created ('hard binding'). Non-hard
|
||||
binding should be allowed.
|
||||
|
||||
- On x86, the generated code uses call 0, pop REG, add
|
||||
GOTOFFSET, REG to materialize the GOT address. Newer
|
||||
versions of gcc use a separate function to do this, maybe we
|
||||
need to do the same.
|
||||
|
||||
- Currently, we get vtable addresses from the GOT. Another
|
||||
solution would be to store the data from the vtables in the
|
||||
.bss section, so accessing them would involve less
|
||||
indirection.
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,27 @@
|
||||
Call Sites
|
||||
Extracted from emails from Paolo Molaro
|
||||
|
||||
|
||||
There are 3 basic different kinds of call sites:
|
||||
|
||||
1) normal calls:
|
||||
call relative_displacement
|
||||
|
||||
2) virtual calls:
|
||||
call *positive_offset(%register)
|
||||
|
||||
3) interface calls:
|
||||
mov constant, %imt_register
|
||||
call *negative_offset(%register)
|
||||
|
||||
The above is what happens on x86 and amd64, with different values of
|
||||
%imt_register for each arch (this register is a constant, but it could
|
||||
change with different mono builds, it should be likely one of
|
||||
constants the runtime comunicates to the debugger). %register can
|
||||
change depending on the callsite based on the register allocator
|
||||
choices. Note that the constant for the interface calls won't
|
||||
necessarily be a MonoMethod address: this could change in the future
|
||||
to a simple number.
|
||||
|
||||
In all the 3 cases the JIT trampolines will need to inspect the call
|
||||
site, but only in the first case the call site will be changed.
|
||||
+4
-7
@@ -10,20 +10,17 @@ ASSEMBLED_DOCS = \
|
||||
convert.exe: convert.cs AgilityPack.dll
|
||||
$(CSCOMPILE) -out:$@ $< -r:AgilityPack.dll
|
||||
|
||||
monoapi.zip: monoapi.tree
|
||||
@test -f $@ || { rm -f $< && $(MAKE) $<; }
|
||||
monoapi.zip : monoapi.tree
|
||||
monoapi.tree: toc.xml docs.make
|
||||
$(MDOC) assemble -o monoapi -f hb $<
|
||||
|
||||
mono-tools.zip: mono-tools.tree
|
||||
@test -f $@ || { rm -f $< && $(MAKE) $<; }
|
||||
mono-tools.zip : mono-tools.tree
|
||||
mono-tools.tree: mono-tools.config docs.make
|
||||
$(MDOC) assemble -o mono-tools -f man $<
|
||||
|
||||
mono-file-formats.zip: mono-file-formats.tree
|
||||
@test -f $@ || { rm -f $< && $(MAKE) $<; }
|
||||
mono-file-formats.zip : mono-file-formats.tree
|
||||
mono-file-formats.tree: mono-file-formats.config docs.make
|
||||
$(MDOC) assemble -o mono-file-formats -f man $<
|
||||
|
||||
.doc-stamp:
|
||||
|
||||
|
||||
@@ -0,0 +1,330 @@
|
||||
|
||||
Exception Handling In the Mono Runtime
|
||||
--------------------------------------
|
||||
|
||||
* Introduction
|
||||
--------------
|
||||
|
||||
There are many types of exceptions which the runtime needs to
|
||||
handle. These are:
|
||||
|
||||
- exceptions thrown from managed code using the 'throw' or 'rethrow' CIL
|
||||
instructions.
|
||||
|
||||
- exceptions thrown by some IL instructions like InvalidCastException thrown
|
||||
by the 'castclass' CIL instruction.
|
||||
|
||||
- exceptions thrown by runtime code
|
||||
|
||||
- synchronous signals received while in managed code
|
||||
|
||||
- synchronous signals received while in native code
|
||||
|
||||
- asynchronous signals
|
||||
|
||||
Since exception handling is very arch dependent, parts of the
|
||||
exception handling code reside in the arch specific
|
||||
exceptions-<ARCH>.c files. The architecture independent parts
|
||||
are in mini-exceptions.c. The different exception types listed
|
||||
above are generated in different parts of the runtime, but
|
||||
ultimately, they all end up in the mono_handle_exception ()
|
||||
function in mini-exceptions.c.
|
||||
|
||||
* Exceptions throw programmatically from managed code
|
||||
-----------------------------------------------------
|
||||
|
||||
These exceptions are thrown from managed code using 'throw' or
|
||||
'rethrow' CIL instructions. The JIT compiler will translate
|
||||
them to a call to a helper function called
|
||||
'mono_arch_throw/rethrow_exception'.
|
||||
|
||||
These helper functions do not exist at compile time, they are
|
||||
created dynamically at run time by the code in the
|
||||
exceptions-<ARCH>.c files.
|
||||
|
||||
They perform various stack manipulation magic, then call a
|
||||
helper function usually named throw_exception (), which does
|
||||
further processing in C code, then calls
|
||||
mono_handle_exception() to do the rest.
|
||||
|
||||
* Exceptions thrown implicitly from managed code
|
||||
------------------------------------------------
|
||||
|
||||
These exceptions are thrown by some IL instructions when
|
||||
something goes wrong. When the JIT needs to throw such an
|
||||
exception, it emits a forward conditional branch and remembers
|
||||
its position, along with the exception which needs to be
|
||||
emitted. This is usually done in macros named
|
||||
EMIT_COND_SYSTEM_EXCEPTION in the mini-<ARCH>.c files.
|
||||
|
||||
After the machine code for the method is emitted, the JIT
|
||||
calls the arch dependent mono_arch_emit_exceptions () function
|
||||
which will add the exception throwing code to the end of the
|
||||
method, and patches up the previous forward branches so they
|
||||
will point to this code.
|
||||
|
||||
This has the advantage that the rarely-executed exception
|
||||
throwing code is kept separate from the method body, leading
|
||||
to better icache performance.
|
||||
|
||||
The exception throwing code braches to the dynamically
|
||||
generated mono_arch_throw_corlib_exception helper function,
|
||||
which will create the proper exception object, does some stack
|
||||
manipulation, then calls throw_exception ().
|
||||
|
||||
* Exceptions thrown by runtime code
|
||||
-----------------------------------
|
||||
|
||||
These exceptions are usually thrown by the implementations of
|
||||
InternalCalls (icalls). First an appropriate exception object
|
||||
is created with the help of various helper functions in
|
||||
metadata/exception.c, which has a separate helper function for
|
||||
allocating each kind of exception object used by the runtime
|
||||
code. Then the mono_raise_exception () function is called to
|
||||
actually throw the exception. That function never returns.
|
||||
|
||||
An example:
|
||||
|
||||
if (something_is_wrong)
|
||||
mono_raise_exception (mono_get_exception_index_out_of_range ());
|
||||
|
||||
mono_raise_exception () simply passes the exception to the JIT
|
||||
side through an API, where it will be received by helper
|
||||
created by mono_arch_throw_exception (). From now on, it is
|
||||
treated as an exception thrown from managed code.
|
||||
|
||||
* Synchronous signals
|
||||
---------------------
|
||||
|
||||
For performance reasons, the runtime does not do same checks
|
||||
required by the CLI spec. Instead, it relies on the CPU to do
|
||||
them. The two main checks which are omitted are null-pointer
|
||||
checks, and arithmetic checks. When a null pointer is
|
||||
dereferenced by JITted code, the CPU will notify the kernel
|
||||
through an interrupt, and the kernel will send a SIGSEGV
|
||||
signal to the process. The runtime installs a signal handler
|
||||
for SIGSEGV, which is sigsegv_signal_handler () in mini.c. The
|
||||
signal handler creates the appropriate exception object and
|
||||
calls mono_handle_exception () with it. Arithmetic exceptions
|
||||
like division by zero are handled similarly.
|
||||
|
||||
* Synchronous signals in native code
|
||||
------------------------------------
|
||||
|
||||
Receiving a signal such as SIGSEGV while in native code means
|
||||
something very bad has happened. Because of this, the runtime
|
||||
will abort after trying to print a managed plus a native stack
|
||||
trace. The logic is in the mono_handle_native_sigsegv ()
|
||||
function.
|
||||
|
||||
Note that there are two kinds of native code which can be the
|
||||
source of the signal:
|
||||
|
||||
- code inside the runtime
|
||||
- code inside a native library loaded by an application, ie. libgtk+
|
||||
|
||||
* Stack overflow checking
|
||||
-------------------------
|
||||
|
||||
Stack overflow exceptions need special handling. When a thread
|
||||
overflows its stack, the kernel sends it a normal SIGSEGV
|
||||
signal, but the signal handler tries to execute on the same as
|
||||
the thread leading to a further SIGSEGV which will terminate
|
||||
the thread. A solution is to use an alternative signal stack
|
||||
supported by UNIX operating systems through the sigaltstack
|
||||
(2) system call. When a thread starts up, the runtime will
|
||||
install an altstack using the mono_setup_altstack () function
|
||||
in mini-exceptions.c. When a SIGSEGV is received, the signal
|
||||
handler checks whenever the fault address is near the bottom
|
||||
of the threads normal stack. If it is, a
|
||||
StackOverflowException is created instead of a
|
||||
NullPointerException. This exception is handled like any other
|
||||
exception, with some minor differences.
|
||||
|
||||
There are two reasons why sigaltstack is disabled by default:
|
||||
|
||||
* The main problem with sigaltstack() is that the stack
|
||||
employed by it is not visible to the GC and it is possible
|
||||
that the GC will miss it.
|
||||
|
||||
* Working sigaltstack support is very much os/kernel/libc
|
||||
dependent, so it is disabled by default.
|
||||
|
||||
|
||||
* Asynchronous signals
|
||||
----------------------
|
||||
|
||||
Async signals are used by the runtime to notify a thread that
|
||||
it needs to change its state somehow. Currently, it is used
|
||||
for implementing thread abort/suspend/resume.
|
||||
|
||||
Handling async signals correctly is a very hard problem,
|
||||
since the receiving thread can be in basically any state upon
|
||||
receipt of the signal. It can execute managed code, native
|
||||
code, it can hold various managed/native locks, or it can be
|
||||
in a process of acquiring them, it can be starting up,
|
||||
shutting down etc. Most of the C APIs used by the runtime are
|
||||
not asynch-signal safe, meaning it is not safe to call them
|
||||
from an async signal handler. In particular, the pthread
|
||||
locking functions are not async-safe, so if a signal handler
|
||||
interrupted code which was in the process of acquiring a lock,
|
||||
and the signal handler tries to acquire a lock, the thread
|
||||
will deadlock. Unfortunately, the current signal handling
|
||||
code does acquire locks, so sometimes it does deadlock.
|
||||
|
||||
When receiving an async signal, the signal handler first tries
|
||||
to determine whenever the thread was executing managed code
|
||||
when it was interrupted. If it did, then it is safe to
|
||||
interrupt it, so a ThreadAbortException is constructed and
|
||||
thrown. If the thread was executing native code, then it is
|
||||
generally not safe to interrupt it. In this case, the runtime
|
||||
sets a flag then returns from the signal handler. That flag is
|
||||
checked every time the runtime returns from native code to
|
||||
managed code, and the exception is thrown then. Also, a
|
||||
platform specific mechanism is used to cause the thread to
|
||||
interrupt any blocking operation it might be doing.
|
||||
|
||||
The async signal handler is in sigusr1_signal_handler () in
|
||||
mini.c, while the logic which determines whenever an exception
|
||||
is safe to be thrown is in mono_thread_request_interruption
|
||||
().
|
||||
|
||||
* Stack unwinding during exception handling
|
||||
-------------------------------------------
|
||||
|
||||
The execution state of a thread during exception handling is
|
||||
stored in an arch-specific structure called MonoContext. This
|
||||
structure contains the values of all the CPU registers
|
||||
relevant during exception handling, which usually means:
|
||||
|
||||
- IP (instruction pointer)
|
||||
- SP (stack pointer)
|
||||
- FP (frame pointer)
|
||||
- callee saved registers
|
||||
|
||||
Callee saved registers are the registers which are required by
|
||||
any procedure to be saved/restored before/after using
|
||||
them. They are usually defined by each platforms ABI
|
||||
(Application Binary Interface). For example, on x86, they are
|
||||
EBX, ESI and EDI.
|
||||
|
||||
The code which calls mono_handle_exception () is required to
|
||||
construct the initial MonoContext. How this is done depends on
|
||||
the caller. For exceptions thrown from managed code, the
|
||||
mono_arch_throw_exception helper function saves the values of
|
||||
the required registers and passes them to throw_exception (),
|
||||
which will save them in the MonoContext structure. For
|
||||
exceptions thrown from signal handlers, the MonoContext
|
||||
stucture is initialized from the signal info received from the
|
||||
kernel.
|
||||
|
||||
During exception handling, the runtime needs to 'unwind' the
|
||||
stack, i.e. given the state of the thread at a stack frame,
|
||||
construct the state at its callers. Since this is platform
|
||||
specific, it is done by a platform specific function called
|
||||
mono_arch_find_jit_info ().
|
||||
|
||||
Two kinds of stack frames need handling:
|
||||
|
||||
- Managed frames are easier. The JIT will store some
|
||||
information about each managed method, like which
|
||||
callee-saved registers it uses. Based on this information,
|
||||
mono_arch_find_jit_info () can find the values of the
|
||||
registers on the thread stack, and restore them.
|
||||
|
||||
- Native frames are problematic, since we have no information
|
||||
about how to unwind through them. Some compilers generate
|
||||
unwind information for code, some don't. Also, there is no
|
||||
general purpose library to obtain and decode this unwind
|
||||
information. So the runtime uses a different solution. When
|
||||
managed code needs to call into native code, it does through
|
||||
a managed->native wrapper function, which is generated by
|
||||
the JIT. This function is responsible for saving the machine
|
||||
state into a per-thread structure called MonoLMF (Last
|
||||
Managed Frame). These LMF structures are stored on the
|
||||
threads stack, and are linked together using one of their
|
||||
fields. When the unwinder encounters a native frame, it
|
||||
simply pops one entry of the LMF 'stack', and uses it to
|
||||
restore the frame state to the moment before control passed
|
||||
to native code. In effect, all successive native frames are
|
||||
skipped together.
|
||||
|
||||
Problems/future work
|
||||
--------------------
|
||||
|
||||
1. Async signal safety
|
||||
----------------------
|
||||
|
||||
The current async signal handling code is not async safe, so
|
||||
it can and does deadlock in practice. It needs to be rewritten
|
||||
to avoid taking locks at least until it can determine that it
|
||||
was interrupting managed code.
|
||||
|
||||
Another problem is the managed stack frame unwinding code. It
|
||||
blindly assumes that if the IP points into a managed frame,
|
||||
then all the callee saved registers + the stack pointer are
|
||||
saved on the stack. This is not true if the thread was
|
||||
interrupted while executing the method prolog/epilog.
|
||||
|
||||
2. Raising exceptions from native code
|
||||
--------------------------------------
|
||||
|
||||
Currently, exceptions are raised by calling
|
||||
mono_raise_exception () in the middle of runtime code. This
|
||||
has two problems:
|
||||
|
||||
- No cleanup is done, ie. if the caller of the function which
|
||||
throws an exception has taken locks, or allocated memory,
|
||||
that is not cleaned up. For this reason, it is only safe to
|
||||
call mono_raise_exception () 'very close' to managed code,
|
||||
ie. in the icall functions themselves.
|
||||
|
||||
- To allow mono_raise_exception () to unwind through native
|
||||
code, we need to save the LMF structures which can add a lot
|
||||
of overhead even in the common case when no exception is
|
||||
thrown. So this is not zero-cost exception handling.
|
||||
|
||||
An alternative might be to use a JNI style
|
||||
set-pending-exception API. Runtime code could call
|
||||
mono_set_pending_exception (), then return to its caller with
|
||||
an error indication allowing the caller to clean up. When
|
||||
execution returns to managed code, then managed->native
|
||||
wrapper could check whenever there is a pending exception and
|
||||
throw it if neccesary. Since we already check for pending
|
||||
thread interruption, this would have no overhead, allowing us
|
||||
to drop the LMF saving/restoring code, or significant parts of
|
||||
it.
|
||||
|
||||
4. libunwind
|
||||
------------
|
||||
|
||||
There is an OSS project called libunwind which is a standalone
|
||||
stack unwinding library. It is currently in development, but
|
||||
it is used by default by gcc on ia64 for its stack
|
||||
unwinding. The mono runtime also uses it on ia64. It has
|
||||
several advantages in relation to our current unwinding code:
|
||||
|
||||
- it has a platform independent API, i.e. the same unwinding
|
||||
code can be used on multiple platforms.
|
||||
|
||||
- it can generate unwind tables which are correct at every
|
||||
instruction, i.e. can be used for unwinding from async
|
||||
signals.
|
||||
|
||||
- given sufficient unwind info generated by a C compiler, it
|
||||
can unwind through C code.
|
||||
|
||||
- most of its API is async-safe
|
||||
|
||||
- it implements the gcc C++ exception handling API, so in
|
||||
theory it can be used to implement mixed-language exception
|
||||
handling (i.e. C++ exception caught in mono, mono exception
|
||||
caught in C++).
|
||||
|
||||
- it is MIT licensed
|
||||
|
||||
The biggest problem with libuwind is its platform support. ia64 support is
|
||||
complete/well tested, while support for other platforms is missing/incomplete.
|
||||
|
||||
http://www.hpl.hp.com/research/linux/libunwind/
|
||||
|
||||
@@ -0,0 +1,283 @@
|
||||
Register Allocation
|
||||
===================
|
||||
|
||||
The current JIT implementation uses a tree matcher to generate code. We use a
|
||||
simple algorithm to allocate registers in trees, and limit the number of used
|
||||
temporary register to 4 when evaluating trees. So we can use 2 registers for
|
||||
global register allocation.
|
||||
|
||||
Register Allocation for Trees
|
||||
=============================
|
||||
|
||||
We always evaluate trees from left to right. When there are no more registers
|
||||
available we need to spill values to memory. Here is the simplified algorithm.
|
||||
|
||||
gboolean
|
||||
tree_allocate_regs (tree, exclude_reg)
|
||||
{
|
||||
if (!tree_allocate_regs (tree->left, -1))
|
||||
return FALSE;
|
||||
|
||||
if (!tree_allocate_regs (tree->right, -1)) {
|
||||
|
||||
tree->left->spilled == TRUE;
|
||||
|
||||
free_used_regs (tree->left);
|
||||
|
||||
if (!tree_allocate_regs (tree->right, tree->left->reg))
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
free_used_regs (tree->left);
|
||||
free_used_regs (tree->right);
|
||||
|
||||
/* try to allocate a register (reg != exclude_reg) */
|
||||
if ((tree->reg = next_free_reg (exclude_reg)) != -1)
|
||||
return TRUE;
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
The emit routing actually spills the registers:
|
||||
|
||||
tree_emit (tree)
|
||||
{
|
||||
|
||||
tree_emit (tree->left);
|
||||
|
||||
if (tree->left->spilled)
|
||||
save_reg (tree->left->reg);
|
||||
|
||||
tree_emit (tree->right);
|
||||
|
||||
if (tree->left->spilled)
|
||||
restore_reg (tree->left->reg);
|
||||
|
||||
|
||||
emit_code (tree);
|
||||
}
|
||||
|
||||
|
||||
Global Register Allocation
|
||||
==========================
|
||||
|
||||
TODO.
|
||||
|
||||
Local Register Allocation
|
||||
=========================
|
||||
|
||||
This section describes the cross-platform local register allocator which is
|
||||
in the file mini-codegen.c.
|
||||
|
||||
The input to the allocator is a basic block which contains linear IL, ie.
|
||||
instructions of the form:
|
||||
|
||||
DEST <- SRC1 OP SRC2
|
||||
|
||||
where DEST, SRC1, and SRC2 are virtual registers (vregs). The job of the
|
||||
allocator is to assign hard or physical registers (hregs) to each virtual
|
||||
registers so the vreg references in the instructions can be replaced with their
|
||||
assigned hreg, allowing machine code to be generated later.
|
||||
|
||||
The allocator needs information about the number and types of arguments of
|
||||
instructions. It takes this information from the machine description files. It
|
||||
also needs arch specific information, like the number and type of the hard
|
||||
registers. It gets this information from arch-specific macros.
|
||||
|
||||
Currently, the vregs and hregs are partitioned into two classes: integer and
|
||||
floating point.
|
||||
|
||||
The allocator consists of two phases: In the first phase, a forward pass is
|
||||
made over the instructions, collecting liveness information for vregs. In the
|
||||
second phase, a backward pass is made over the instructions, assigning
|
||||
registers. This backward mode of operation makes understanding the allocator
|
||||
somewhat difficult to understand, but leads to better code in most cases.
|
||||
|
||||
Allocator state
|
||||
===============
|
||||
|
||||
The state of the allocator is stored in two arrays: iassign and isymbolic.
|
||||
iassign maps vregs to hregs, while isymbolic is the opposite.
|
||||
For a vreg, iassign [vreg] can contain the following values:
|
||||
|
||||
* -1 vreg has no assigned hreg
|
||||
|
||||
* hreg index (>= 0) vreg is assigned to the given hreg. This means
|
||||
later instructions (which we have already
|
||||
processed due to the backward direction) expect
|
||||
the value of vreg to be found in hreg.
|
||||
|
||||
* spill slot index (< -1) vreg is spilled to the given spill slot. This
|
||||
means later instructions expect the value of
|
||||
vreg to be found on the stack in the given
|
||||
spill slot.
|
||||
|
||||
Also, the allocator keeps track of which hregs are free and which are used.
|
||||
This information is stored in a bitmask called ifree_mask.
|
||||
|
||||
There is a similar set of data structures for floating point registers.
|
||||
|
||||
Spilling
|
||||
========
|
||||
|
||||
When an allocator needs a free hreg, but all of them are assigned, it needs to
|
||||
free up one of them. It does this by spilling the contents of the vreg which
|
||||
is currently assigned to the selected hreg. Since later instructions expect
|
||||
the vreg to be found in the selected hreg, the allocator emits a spill-load
|
||||
instruction to load the value from the spill slot into the hreg after the
|
||||
currently processed instruction. When the vreg which is spilled is a
|
||||
destination in an instruction, the allocator will emit a spill-store to store
|
||||
the value into the spill slot.
|
||||
|
||||
Fixed registers
|
||||
===============
|
||||
|
||||
Some architectures, notably x86/amd64 require that the arguments/results of
|
||||
some instructions be assigned to specific hregs. An example is the shift
|
||||
opcodes on x86, where the second argument must be in ECX. The allocator
|
||||
has support for this. It tries to allocate the vreg to the required hreg. If
|
||||
thats not possible, then it will emit compensation code which moves values to
|
||||
the correct registers before/after the instruction.
|
||||
|
||||
Fixed registers are mainly used on x86, but they are useful on more regular
|
||||
architectures on well, for example to model that after a call instruction, the
|
||||
return of the call is in a specific register.
|
||||
|
||||
A special case of fixed registers is two address architectures, like the x86,
|
||||
where the instructions place their results into their first argument. This is
|
||||
modelled in the allocator by allocating SRC1 and DEST to the same hreg.
|
||||
|
||||
Global registers
|
||||
================
|
||||
|
||||
Some variables might already be allocated to hardware registers during the
|
||||
global allocation phase. In this case, SRC1, SRC2 and DEST might already be
|
||||
a hardware register. The allocator needs to do nothing in this case, except
|
||||
when the architecture uses fixed registers, in which case it needs to emit
|
||||
compensation code.
|
||||
|
||||
Register pairs
|
||||
==============
|
||||
|
||||
64 bit arithmetic on 32 bit machines requires instructions whose arguments are
|
||||
not registers, but register pairs. The allocator has support for this, both
|
||||
for freely allocatable register pairs, and for register pairs which are
|
||||
constrained to specific hregs (EDX:EAX on x86).
|
||||
|
||||
Floating point stack
|
||||
====================
|
||||
|
||||
The x86 architecture uses a floating point register stack instead of a set of
|
||||
fp registers. The allocator supports this by keeping track of the height of the
|
||||
fp stack, and spilling/loading values from the stack as neccesary.
|
||||
|
||||
Calls
|
||||
=====
|
||||
|
||||
Calls need special handling for two reasons: first, they will clobber all
|
||||
caller-save registers, meaning their contents will need to be spilled. Also,
|
||||
some architectures pass arguments in registers. The registers used for
|
||||
passing arguments are usually the same as the ones used for local allocation,
|
||||
so the allocator needs to handle them specially. This is done as follows:
|
||||
the MonoInst for the call instruction contains a map mapping vregs which
|
||||
contain the argument values to hregs where the argument needs to be placed,
|
||||
like this (on amd64):
|
||||
|
||||
R33 -> RDI
|
||||
R34 -> RSI
|
||||
...
|
||||
|
||||
When the allocator processes the call instruction, it allocates the vregs
|
||||
in the map to their associated hregs. So the call instruction is processed as
|
||||
if having a variable number of arguments which fixed register assignments.
|
||||
|
||||
An example:
|
||||
|
||||
R33 <- 1
|
||||
R34 <- 2
|
||||
call
|
||||
|
||||
When the call instruction is processed, R33 is assigned to RDI, and R34 is
|
||||
assigned to RSI. Later, when the two assignment instructions are processed,
|
||||
R33 and R34 are already assigned to a hreg, so they are replaced with the
|
||||
associated hreg leading to the following final code:
|
||||
|
||||
RDI <- 1
|
||||
RSI <- 1
|
||||
call
|
||||
|
||||
Machine description files
|
||||
=========================
|
||||
|
||||
A typical entry in the machine description files looks like this:
|
||||
|
||||
shl: dest:i src1:i src2:s clob:1 len:2
|
||||
|
||||
The allocator is only interested in the dest,src1,src2 and clob fields.
|
||||
It understands the following values for the dest, src1, src2 fields:
|
||||
|
||||
i - integer register
|
||||
f - fp register
|
||||
b - base register (same as i, but the instruction does not modify the reg)
|
||||
m - fp register, even if an fp stack is used (no fp stack tracking)
|
||||
|
||||
It understands the following values for the clob field:
|
||||
|
||||
1 - sreg1 needs to be the same as dreg
|
||||
c - instruction clobbers the caller-save registers
|
||||
|
||||
Beside these values, an architecture can define additional values (like the 's'
|
||||
in the example). The allocator depends on a set of arch-specific macros to
|
||||
convert these values to information it needs during allocation.
|
||||
|
||||
Arch specific macros
|
||||
====================
|
||||
|
||||
These macros usually receive a value from the machine description file (like
|
||||
the 's' in the example). The examples below are for x86.
|
||||
|
||||
/*
|
||||
* A bitmask selecting the caller-save registers (these are used for local
|
||||
* allocation).
|
||||
*/
|
||||
#define MONO_ARCH_CALLEE_REGS X86_CALLEE_REGS
|
||||
|
||||
/*
|
||||
* A bitmask selecting the callee-saved registers (these are usually used for
|
||||
* global allocation).
|
||||
*/
|
||||
#define MONO_ARCH_CALLEE_SAVED_REGS X86_CALLER_REGS
|
||||
|
||||
/* Same for the floating point registers */
|
||||
#define MONO_ARCH_CALLEE_FREGS 0
|
||||
#define MONO_ARCH_CALLEE_SAVED_FREGS 0
|
||||
|
||||
/* Whenever the target uses a floating point stack */
|
||||
#define MONO_ARCH_USE_FPSTACK TRUE
|
||||
|
||||
/* The size of the floating point stack */
|
||||
#define MONO_ARCH_FPSTACK_SIZE 6
|
||||
|
||||
/*
|
||||
* Given a descriptor value from the machine description file, return the fixed
|
||||
* hard reg corresponding to that value.
|
||||
*/
|
||||
#define MONO_ARCH_INST_FIXED_REG(desc) ((desc == 's') ? X86_ECX : ((desc == 'a') ? X86_EAX : ((desc == 'd') ? X86_EDX : ((desc == 'y') ? X86_EAX : ((desc == 'l') ? X86_EAX : -1)))))
|
||||
|
||||
/*
|
||||
* A bitmask selecting the hregs which can be used for allocating sreg2 for
|
||||
* a given instruction.
|
||||
*/
|
||||
#define MONO_ARCH_INST_SREG2_MASK(ins) (((ins [MONO_INST_CLOB] == 'a') || (ins [MONO_INST_CLOB] == 'd')) ? (1 << X86_EDX) : 0)
|
||||
|
||||
/*
|
||||
* Given a descriptor value, return whenever it denotes a register pair.
|
||||
*/
|
||||
#define MONO_ARCH_INST_IS_REGPAIR(desc) (desc == 'l' || desc == 'L')
|
||||
|
||||
/*
|
||||
* Given a descriptor value, and the first register of a regpair, return a
|
||||
* bitmask selecting the hregs which can be used for allocating the second
|
||||
* register of the regpair.
|
||||
*/
|
||||
#define MONO_ARCH_INST_REGPAIR_REG2(desc,hreg1) (desc == 'l' ? X86_EDX : -1)
|
||||
@@ -0,0 +1,32 @@
|
||||
Metadata memory management
|
||||
--------------------------
|
||||
|
||||
Most metadata structures have a lifetime which is equal to the MonoImage where they are
|
||||
loaded from. These structures should be allocated from the memory pool of the
|
||||
corresponding MonoImage. The memory pool is protected by the loader lock.
|
||||
Examples of metadata structures in this category:
|
||||
- MonoClass
|
||||
- MonoMethod
|
||||
- MonoType
|
||||
Memory owned by these structures should be allocated from the image mempool as well.
|
||||
Examples include: klass->methods, klass->fields, method->signature etc.
|
||||
|
||||
Generics complicates things. A generic class could have many instantinations where the
|
||||
generic arguments are from different assemblies. Where should we allocate memory for
|
||||
instantinations ? We can allocate from the mempool of the image which contains the
|
||||
generic type definition, but that would mean that the instantinations would remain in
|
||||
memory even after the assemblies containing their type arguments are unloaded, leading
|
||||
to a memory leak. Therefore, we do the following:
|
||||
- data structures representing the generic definitions are allocated from the image
|
||||
mempool as usual. These include:
|
||||
- generic class definition (MonoGenericClass->container_class)
|
||||
- generic method definitions
|
||||
- type parameters (MonoGenericParam)
|
||||
- data structures representing inflated classes/images are allocated from the heap. These
|
||||
structures are kept in a cache, indexed by type arguments of the instantinations. When
|
||||
an assembly is unloaded, this cache is searched and all instantinations referencing
|
||||
types from the assembly are freed. This is done by mono_metadata_clean_for_image ()
|
||||
in metadata.c. The structures handled this way include:
|
||||
- MonoGenericClass
|
||||
- MonoGenericInst
|
||||
- inflated MonoMethods
|
||||
+6
-59
@@ -417,19 +417,12 @@
|
||||
|
||||
* Testing the port
|
||||
|
||||
The JIT has a set of regression tests in *.cs files inside the
|
||||
mini directory.
|
||||
|
||||
The usual method of testing a port is by compiling these tests on
|
||||
another machine with a working runtime by typing 'make rcheck',
|
||||
then copying TestDriver.dll and *.exe to the mini directory. The
|
||||
tests can be run by typing:
|
||||
|
||||
The JIT has a set of regression tests in *.cs files inside the mini directory.
|
||||
The usual method of testing a port is by compiling these tests on another machine
|
||||
with a working runtime by typing 'make rcheck', then copying TestDriver.dll and
|
||||
*.exe to the mini directory. The tests can be run by typing:
|
||||
./mono --regression <exe file name>
|
||||
|
||||
The suggested order for working through these tests is the
|
||||
following:
|
||||
|
||||
The suggested order for working through these tests is the following:
|
||||
- basic.exe
|
||||
- basic-long.exe
|
||||
- basic-float.exe
|
||||
@@ -480,52 +473,6 @@
|
||||
at this point, so the only parts which require changing are
|
||||
the arch dependent files.
|
||||
|
||||
* Function descriptors
|
||||
|
||||
Some ABIs, like those for IA64 and PPC64, don't use direct
|
||||
function pointers, but so called function descriptors. A
|
||||
function descriptor is a short data structure which contains
|
||||
at least a pointer to the code of the function and a pointer
|
||||
to a GOT/TOC, which needs to be loaded into a specific
|
||||
register prior to jumping to the function. Global variables
|
||||
and large constants are accessed through that register.
|
||||
|
||||
Mono does not need function descriptors for the JITted code,
|
||||
but we need to handle them when calling unmanaged code and we
|
||||
need to create them when passing managed code to unmanaged
|
||||
code.
|
||||
|
||||
mono_create_ftnptr() creates a function descriptor for a piece
|
||||
of generated code within a specific domain.
|
||||
|
||||
mono_get_addr_from_ftnptr() returns the pointer to the native
|
||||
code in a function descriptor. Never use this function to
|
||||
generate a jump to a function without loading the GOT/TOC
|
||||
register unless the function descriptor was created by
|
||||
mono_create_ftnptr().
|
||||
|
||||
See the sources for IA64 and PPC64 on when to create and when
|
||||
to dereference function descriptors. On PPC64 function
|
||||
descriptors for various generated helper functions (in
|
||||
exceptions-ppc.c and tramp-ppc.c) are generated in front of
|
||||
the code they refer to (see ppc_create_pre_code_ftnptr()). On
|
||||
IA64 they are created separately.
|
||||
|
||||
* Emulated opcodes
|
||||
|
||||
Mini has code for emulating quite a few opcodes, most notably
|
||||
operations on longs, int/float conversions and atomic
|
||||
operations. If an architecture wishes such an opcode to be
|
||||
emulated, mini produces icalls instead of those opcodes. This
|
||||
should only be considered when the operation cannot be
|
||||
implemented efficiently and thus the overhead occured by the
|
||||
icall is not relatively large. Emulation of operations is
|
||||
controlled by #defines in the arch header, but the naming is
|
||||
not consistent. They usually start with MONO_ARCH_EMULATE_,
|
||||
MONO_ARCH_NO_EMULATE_ and MONO_ARCH_HAVE_.
|
||||
|
||||
* Generic code sharing
|
||||
|
||||
Generic code sharing is optional. See the file
|
||||
"generic-sharing" for information on how to support it on an
|
||||
architecture.
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
<?xml version="1.0"?>
|
||||
<monodoc>
|
||||
<source provider="man" basefile="mono-file-formats" path="man"/>
|
||||
<node label="Mono File Formats" name="mono-formats" parent="formats" />
|
||||
<source provider="man" basefile="mono-file-formats" path="mono-formats"/>
|
||||
</monodoc>
|
||||
@@ -1,4 +1,5 @@
|
||||
<?xml version="1.0"?>
|
||||
<monodoc>
|
||||
<source provider="man" basefile="mono-tools" path="man"/>
|
||||
<node label="Mono Development Tools" name="dev-tools" parent="tools" />
|
||||
<source provider="man" basefile="mono-tools" path="dev-tools"/>
|
||||
</monodoc>
|
||||
@@ -23,8 +23,7 @@ typedef struct {
|
||||
@API_IDX@
|
||||
|
||||
</div>
|
||||
|
||||
<a name="cil_assembly_load"/>
|
||||
|
||||
<h3>Assembly Loading</h3>
|
||||
|
||||
<h4><a name="api:mono_assembly_open">mono_assembly_open</a></h4>
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
<h2>Image Manipulation</h2>
|
||||
|
||||
<p>Images are the component of assemblies that actually hold
|
||||
the CIL code and <a href="mono-api-metadata.html">metadata</a>
|
||||
in the extended PE/COFF file.
|
||||
the CIL code in the extended PE/COFF file.
|
||||
|
||||
<h3>Synopsis</h3>
|
||||
|
||||
@@ -24,8 +23,7 @@ typedef enum {
|
||||
|
||||
<p>Images are the actual elements in the runtime that contain
|
||||
the actual code being executed.
|
||||
|
||||
<a name="cil_image_open"/>
|
||||
|
||||
<h3>Opening and closing MonoImages</h3>
|
||||
|
||||
<h4><a name="api:mono_image_open">mono_image_open</a></h4>
|
||||
|
||||
@@ -1,650 +1,47 @@
|
||||
<h1>Metadata Reading</h1>
|
||||
<h3>Metadata Loader Locking</h3>
|
||||
|
||||
<p>The Metadata API gives developers low-level access to the
|
||||
information encoded in CLI modules: type and
|
||||
methods definitions encoded in metadata as well as access to
|
||||
the CIL code and embedded resources.
|
||||
|
||||
<p>Managed developers access this information using either the
|
||||
System.Reflection API or a library
|
||||
like <a href="http://www.mono-project.com/Cecil">Cecil</a>.
|
||||
|
||||
<p>To start using the Metadata API it is necessary
|
||||
to <a href="mono-api-assembly.html#cil_assembly_load">open an
|
||||
assembly</a> or a CIL image (a .dll or .exe file) using one of
|
||||
the
|
||||
<a href="mono-api-image.html#cil_image_open">CIL image
|
||||
opening</a> API calls.
|
||||
|
||||
<h2>Metadata Heaps</h2>
|
||||
|
||||
<p>ECMA CLI images contain four heaps that store different
|
||||
kinds of information, these are:
|
||||
|
||||
<ul>
|
||||
<li>GUID heap (called #GUID) contains 128-bit GUIDs,
|
||||
you can get pointer to a GUID value by
|
||||
calling <a href="#api:mono_metadata_guid_heap">mono_metadata_guid_heap</a>.
|
||||
|
||||
<li>User string heap (called #US), it contains user
|
||||
visible strings, you can fetch a string from this heap
|
||||
by calling
|
||||
<a href="#api:mono_metadata_user_string">mono_metadata_user_string</a>.
|
||||
|
||||
<li>Blob heap (called #blob), it contains binary
|
||||
blobs of data, you can get a blob
|
||||
by <a href="#api:mono_metadata_blob_heap">mono_metadata_blob_heap</a>.
|
||||
You can determine the size of the blob using
|
||||
the <a href="#api:mono_metadata_decode_blob_size">mono_metadata_decode_blob_size</a>.
|
||||
<p>The locking functions here are used by code in class.c and
|
||||
metadata.c to lock access to the shared hashtables inside the
|
||||
MonoImage
|
||||
|
||||
</ul>
|
||||
<h4><a name="api:mono_loader_lock">mono_loader_lock</a></h4>
|
||||
<h4><a name="api:mono_loader_unlock">mono_loader_unlock</a></h4>
|
||||
|
||||
<p>The ECMA file format also has an extra section called the
|
||||
"#~" stream, this stream is the one that holds the metadata
|
||||
tables. There is a high-level API to get access to the
|
||||
contents of this API, described in the
|
||||
section <a href="#metadata-tables">Metadata Tables</a>.
|
||||
|
||||
<h4><a name="api:mono_metadata_guid_heap">mono_metadata_guid_heap</a></h4>
|
||||
<h4><a name="api:mono_metadata_string_heap">mono_metadata_string_heap</a></h4>
|
||||
<h4><a name="api:mono_metadata_blob_heap">mono_metadata_blob_heap</a></h4>
|
||||
<h4><a name="api:mono_metadata_user_string">mono_metadata_user_string</a></h4>
|
||||
<h4><a name="api:mono_metadata_decode_blob_size">mono_metadata_decode_blob_size</a></h4>
|
||||
|
||||
<a name="metadata-tables"/>
|
||||
<h2>Metadata Tables</h2>
|
||||
|
||||
<p>Metadata is encoded in a number of tables included on every
|
||||
CIL image. These tables contain type definitions, member
|
||||
definitions and so on, these constants are defined in the ECMA 335
|
||||
specification Partition II section 22. The following table
|
||||
shows the C constants defined in the Mono runtime and how they
|
||||
map to the equivalent ECMA CLI metadata table:
|
||||
|
||||
<center>
|
||||
<table border=1>
|
||||
<thead>
|
||||
<td>
|
||||
<b>ECMA CLI Table Name</b>
|
||||
</td>
|
||||
<td>
|
||||
<b>C Constant Name</b>
|
||||
</td>
|
||||
<td>
|
||||
<b>Table Schema (Array Size + Columns Constants)</b>
|
||||
</td>
|
||||
</thead>
|
||||
<td>Assembly</td><td>MONO_TABLE_ASSEMBLY</td><td>
|
||||
Array size:
|
||||
MONO_ASSEMBLY_SIZE
|
||||
<ul>
|
||||
<li>MONO_ASSEMBLY_HASH_ALG
|
||||
<li>MONO_ASSEMBLY_MAJOR_VERSION
|
||||
<li>MONO_ASSEMBLY_MINOR_VERSION
|
||||
<li>MONO_ASSEMBLY_BUILD_NUMBER
|
||||
<li>MONO_ASSEMBLY_REV_NUMBER
|
||||
<li>MONO_ASSEMBLY_FLAGS
|
||||
<li>MONO_ASSEMBLY_PUBLIC_KEY
|
||||
<li>MONO_ASSEMBLY_NAME
|
||||
<li>MONO_ASSEMBLY_CULTURE
|
||||
</ul>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<td>AssemblyOS</td><td>MONO_TABLE_ASSEMBLYOS</td><td>
|
||||
Array size:
|
||||
MONO_ASSEMBLYOS_SIZE
|
||||
<ul>
|
||||
<li>MONO_ASSEMBLYOS_PLATFORM
|
||||
<li>MONO_ASSEMBLYOS_MAJOR_VERSION
|
||||
<li>MONO_ASSEMBLYOS_MINOR_VERSION
|
||||
</ul>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<td>AssemblyProcessor</td><td>MONO_TABLE_ASSEMBLYPROCESSOR</td><td>Array
|
||||
size: MONO_ASSEMBLYPROCESSOR_SIZE
|
||||
<ul>
|
||||
<li>MONO_ASSEMBLY_PROCESSOR
|
||||
</ul>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<td>AssemblyRef</td><td>MONO_TABLE_ASSEMBLYREF</td><td>
|
||||
Array size:
|
||||
MONO_ASSEMBLYREF_SIZE
|
||||
<ul>
|
||||
<li>MONO_ASSEMBLYREF_MAJOR_VERSION
|
||||
<li>MONO_ASSEMBLYREF_MINOR_VERSION
|
||||
<li>MONO_ASSEMBLYREF_BUILD_NUMBER
|
||||
<li>MONO_ASSEMBLYREF_REV_NUMBER
|
||||
<li>MONO_ASSEMBLYREF_FLAGS
|
||||
<li>MONO_ASSEMBLYREF_PUBLIC_KEY
|
||||
<li>MONO_ASSEMBLYREF_NAME
|
||||
<li>MONO_ASSEMBLYREF_CULTURE
|
||||
<li>MONO_ASSEMBLYREF_HASH_VALUE
|
||||
</ul>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<td>AssemblyRefProcessor</td><td>MONO_TABLE_ASSEMBLYREFPROCESSOR</td><td>Array
|
||||
size: MONO_ASSEMBLYREFPROC_SIZE
|
||||
<ul>
|
||||
<li>MONO_ASSEMBLYREFPROC_PROCESSOR
|
||||
<li>MONO_ASSEMBLYREFPROC_ASSEMBLYREF
|
||||
</ul>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<td>AssemblyRefOS</td><td>MONO_TABLE_ASSEMBLYREFOS</td><td>
|
||||
Array size:
|
||||
<li>MONO_ASSEMBLYREFOS_SIZE
|
||||
<ul>
|
||||
<li>MONO_ASSEMBLYREFOS_PLATFORM
|
||||
<li>MONO_ASSEMBLYREFOS_MAJOR_VERSION
|
||||
<li>MONO_ASSEMBLYREFOS_MINOR_VERSION
|
||||
<li>MONO_ASSEMBLYREFOS_ASSEMBLYREF
|
||||
</ul>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<td>ClassLayout</td><td>MONO_TABLE_CLASSLAYOUT</td><td>
|
||||
Array size:
|
||||
MONO_CLASSLAYOUT_SIZE
|
||||
<ul>
|
||||
<li>MONO_CLASS_LAYOUT_PACKING_SIZE
|
||||
<li>MONO_CLASS_LAYOUT_CLASS_SIZE
|
||||
<li>MONO_CLASS_LAYOUT_PARENT
|
||||
</ul>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<td>Constant</td><td>MONO_TABLE_CONSTANT</td><td>
|
||||
Array size:
|
||||
MONO_CONSTANT_SIZE
|
||||
<ul>
|
||||
<li>MONO_CONSTANT_TYPE
|
||||
<li>MONO_CONSTANT_PADDING
|
||||
<li>MONO_CONSTANT_PARENT
|
||||
<li>MONO_CONSTANT_VALUE
|
||||
</ul>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<td>CustomAttribute</td><td>MONO_TABLE_CUSTOMATTRIBUTE</td><td>
|
||||
Array size:
|
||||
MONO_CUSTOM_ATTR_SIZE
|
||||
<ul>
|
||||
<li>MONO_CUSTOM_ATTR_PARENT
|
||||
<li>MONO_CUSTOM_ATTR_TYPE
|
||||
<li>MONO_CUSTOM_ATTR_VALUE
|
||||
</ul>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<td>DeclSecurity</td><td>MONO_TABLE_DECLSECURITY</td><td>
|
||||
Array size:
|
||||
MONO_DECL_SECURITY_SIZE
|
||||
<ul>
|
||||
<li>MONO_DECL_SECURITY_ACTION
|
||||
<li>MONO_DECL_SECURITY_PARENT
|
||||
<li>MONO_DECL_SECURITY_PERMISSIONSET
|
||||
</ul>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<td>EventMap</td><td>MONO_TABLE_EVENTMAP</td><td>
|
||||
Array size:
|
||||
MONO_EVENT_MAP_SIZE
|
||||
<ul>
|
||||
<li>MONO_EVENT_MAP_PARENT
|
||||
<li>MONO_EVENT_MAP_EVENTLIST
|
||||
</ul>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<td>EventPtr</td><td>MONO_TABLE_EVENT_POINTER</td><td>
|
||||
Array size:
|
||||
MONO_EVENT_POINTER_SIZE
|
||||
<ul>
|
||||
<li>MONO_EVENT_POINTER_EVENT
|
||||
</ul>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<td>Event</td><td>MONO_TABLE_EVENT</td><td>
|
||||
Array size: MONO_EVENT_SIZE
|
||||
<ul>
|
||||
<li>MONO_EVENT_FLAGS
|
||||
<li>MONO_EVENT_NAME
|
||||
<li>MONO_EVENT_TYPE
|
||||
</ul>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<td>ExportedType</td><td>MONO_TABLE_EXPORTEDTYPE</td><td>
|
||||
Array size:
|
||||
MONO_EXPORTEDTYPE_SIZE
|
||||
<ul>
|
||||
<li>MONO_EXP_TYPE_FLAGS
|
||||
<li>MONO_EXP_TYPE_TYPEDEF
|
||||
<li>MONO_EXP_TYPE_NAME
|
||||
<li>MONO_EXP_TYPE_NAMESPACE
|
||||
<li>MONO_EXP_TYPE_IMPLEMENTATION
|
||||
</ul>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<td>Field</td><td>MONO_TABLE_FIELD</td><td>
|
||||
Array size: MONO_FIELD_SIZE
|
||||
<ul>
|
||||
<li>MONO_FIELD_FLAGS
|
||||
<li>MONO_FIELD_NAME
|
||||
<li>MONO_FIELD_SIGNATURE
|
||||
</ul>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<td>FieldLayoutt</td><td>MONO_TABLE_FIELDLAYOUT</td><td>
|
||||
Array size:
|
||||
MONO_FIELDLAYOUT_SIZE
|
||||
<ul>
|
||||
<li>MONO_FIELD_LAYOUT_OFFSET
|
||||
<li>MONO_FIELD_LAYOUT_FIELD
|
||||
</ul>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<td>FieldMarshal</td><td>MONO_TABLE_FIELDMARSHAL</td><td>
|
||||
Array size:
|
||||
MONO_FIELD_MARSHAL_SIZE
|
||||
<ul>
|
||||
<li>MONO_FIELD_MARSHAL_PARENT
|
||||
<li>MONO_FIELD_MARSHAL_NATIVE_TYPE
|
||||
</ul>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<td>FieldPtr</td><td>MONO_TABLE_FIELD_POINTER</td><td>
|
||||
Array size:
|
||||
MONO_FIELD_POINTER_SIZE
|
||||
<ul>
|
||||
<li>MONO_FIELD_POINTER_FIELD
|
||||
</ul>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<td>FieldRVA</td><td>MONO_TABLE_FIELDRVA</td><td>
|
||||
Array size:
|
||||
MONO_FIELDRVA_SIZE
|
||||
<ul>
|
||||
<li>MONO_FIELD_RVA_RVA
|
||||
<li>MONO_FIELD_RVA_FIELD
|
||||
</ul>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<td>File</td><td>MONO_TABLE_FILE</td><td>
|
||||
Array size: MONO_FILE_SIZE
|
||||
<ul>
|
||||
<li>MONO_FILE_FLAGS
|
||||
<li>MONO_FILE_NAME
|
||||
<li>MONO_FILE_HASH_VALUE
|
||||
</ul>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<td>GenericParam</td><td>MONO_TABLE_GENERICPARAM</td><td>
|
||||
Array size:
|
||||
MONO_GENERICPARAM_SIZE
|
||||
<ul>
|
||||
<li>MONO_GENERICPARAM_NUMBER
|
||||
<li>MONO_GENERICPARAM_FLAGS
|
||||
<li>MONO_GENERICPARAM_OWNER
|
||||
<li>MONO_GENERICPARAM_NAME
|
||||
</ul>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<td>GenericParamConstraint</td><td>MONO_TABLE_GENERICPARAMCONSTRAINT</td><td>Array
|
||||
size: MONO_GENERICPARAMCONSTRAINT_SIZE
|
||||
<ul>
|
||||
<li>MONO_GENPARCONSTRAINT_GENERICPAR
|
||||
<li>MONO_GENPARCONSTRAINT_CONSTRAINT
|
||||
</ul>
|
||||
</td>
|
||||
|
||||
<tr>
|
||||
<td>ImplMap</td><td>MONO_TABLE_IMPLMAP</td><td>
|
||||
Array size:
|
||||
MONO_IMPLMAP_SIZE
|
||||
<ul>
|
||||
<li>MONO_IMPLMAP_FLAGS
|
||||
<li>MONO_IMPLMAP_MEMBER
|
||||
<li>MONO_IMPLMAP_NAME
|
||||
<li>MONO_IMPLMAP_SCOPE
|
||||
</ul>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
|
||||
<td>InterfaceImpl</td><td>MONO_TABLE_INTERFACEIMPL</td><td>
|
||||
Array size:
|
||||
<li>MONO_INTERFACEIMPL_SIZE
|
||||
<ul>
|
||||
<li>MONO_INTERFACEIMPL_CLASS
|
||||
<li>MONO_INTERFACEIMPL_INTERFACE
|
||||
</ul>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
|
||||
<td>ManifestResource</td><td>MONO_TABLE_MANIFESTRESOURCE</td><td>Array
|
||||
size: MONO_MANIFESTRESOURCE_SIZE
|
||||
<ul>
|
||||
<li>MONO_MANIFEST_OFFSET
|
||||
<li>MONO_MANIFEST_FLAGS
|
||||
<li>MONO_MANIFEST_NAME
|
||||
<li>MONO_MANIFEST_IMPLEMENTATION
|
||||
</ul>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>MemberRef</td><td>MONO_TABLE_MEMBERREF</td><td>
|
||||
Array size:
|
||||
MONO_MEMBERREF_SIZE
|
||||
<ul>
|
||||
<li>MONO_MEMBERREF_CLASS
|
||||
<li>MONO_MEMBERREF_NAME
|
||||
<li>MONO_MEMBERREF_SIGNATURE
|
||||
</ul>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<td>MethodImpl</td><td>MONO_TABLE_METHODIMPL</td><td>
|
||||
Array size:
|
||||
MONO_METHODIMPL_SIZE
|
||||
<ul>
|
||||
<li>MONO_METHODIMPL_CLASS
|
||||
<li>MONO_METHODIMPL_BODY
|
||||
<li>MONO_METHODIMPL_DECLARATION
|
||||
</ul>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
|
||||
<td>MethodSpec</td><td>MONO_TABLE_METHODSPEC</td><td>
|
||||
Array size:
|
||||
MONO_METHODSPEC_SIZE
|
||||
<ul>
|
||||
<li>MONO_METHODSPEC_METHOD
|
||||
<li>MONO_METHODSPEC_SIGNATURE
|
||||
</ul>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>MethodSemantics</td><td>MONO_TABLE_METHODSEMANTICS</td><td>Array
|
||||
size: MONO_METHOD_SEMA_SIZE
|
||||
<ul>
|
||||
<li>MONO_METHOD_SEMA_SEMANTICS
|
||||
<li>MONO_METHOD_SEMA_METHOD
|
||||
<li>MONO_METHOD_SEMA_ASSOCIATION
|
||||
</ul>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<td>Moduleref</td><td>MONO_TABLE_MODULEREF</td><td>
|
||||
Array size:
|
||||
MONO_MODULEREF_SIZE
|
||||
<ul>
|
||||
<li>MONO_MODULEREF_NAME
|
||||
</ul>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>Module</td><td>MONO_TABLE_MODULE</td><td>
|
||||
Array size:
|
||||
MONO_MODULE_SIZE
|
||||
<br>
|
||||
Columns:
|
||||
<ul>
|
||||
<li>MONO_MODULE_GENERATION
|
||||
<li>MONO_MODULE_NAME
|
||||
<li>MONO_MODULE_MVID
|
||||
<li>MONO_MODULE_ENC
|
||||
<li>MONO_MODULE_ENCBASE
|
||||
</ul>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<td>TypeRef</td><td>MONO_TABLE_TYPEREF</td><td>
|
||||
Array size:
|
||||
MONO_TYPEREF_SIZE
|
||||
<ul>
|
||||
<li>MONO_TYPEREF_SCOPE
|
||||
<li>MONO_TYPEREF_NAME
|
||||
<li>MONO_TYPEREF_NAMESPACE
|
||||
</ul>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>MethodPtr</td><td>MONO_TABLE_METHOD_POINTER</td><td>
|
||||
Array size:
|
||||
MONO_METHOD_POINTER_SIZE
|
||||
<ul>
|
||||
<li>MONO_METHOD_POINTER_METHOD
|
||||
</ul>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<td>Method</td><td>MONO_TABLE_METHOD</td><td>
|
||||
Array size:
|
||||
MONO_METHOD_SIZE
|
||||
<ul>
|
||||
<li>MONO_METHOD_RVA
|
||||
<li>MONO_METHOD_IMPLFLAGS
|
||||
<li>MONO_METHOD_FLAGS
|
||||
<li>MONO_METHOD_NAME
|
||||
<li>MONO_METHOD_SIGNATURE
|
||||
<li>MONO_METHOD_PARAMLIST
|
||||
</ul>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>NestedClass</td><td>MONO_TABLE_NESTEDCLASS</td><td>
|
||||
Array size:
|
||||
MONO_NESTEDCLASS_SIZE
|
||||
<ul>
|
||||
<li>MONO_NESTED_CLASS_NESTED
|
||||
<li>MONO_NESTED_CLASS_ENCLOSING
|
||||
</ul>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>ParamPtr</td><td>MONO_TABLE_PARAM_POINTER</td><td>
|
||||
Array size:
|
||||
MONO_PARAM_POINTER_SIZE
|
||||
<ul>
|
||||
<li>MONO_PARAM_POINTER_PARAM
|
||||
</ul>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<td>Param</td><td>MONO_TABLE_PARAM</td><td>
|
||||
Array size: MONO_PARAM_SIZE
|
||||
<ul>
|
||||
<li>MONO_PARAM_FLAGS
|
||||
<li>MONO_PARAM_SEQUENCE
|
||||
<li>MONO_PARAM_NAME
|
||||
</ul>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<td>PropertyMap</td><td>MONO_TABLE_PROPERTYMAP</td><td>
|
||||
Array size:
|
||||
MONO_PROPERTY_MAP_SIZE
|
||||
<ul>
|
||||
<li>MONO_PROPERTY_MAP_PARENT
|
||||
<li>MONO_PROPERTY_MAP_PROPERTY_LIST
|
||||
</ul>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<td>PropertyPtr</td><td>MONO_TABLE_PROPERTY_POINTER</td><td>Array
|
||||
size: MONO_PROPERTY_POINTER_SIZE
|
||||
<ul>
|
||||
<li>MONO_PROPERTY_POINTER_PROPERTY
|
||||
</ul>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<td>Property</td><td>MONO_TABLE_PROPERTY</td><td>
|
||||
Array size:
|
||||
MONO_PROPERTY_SIZE
|
||||
<ul>
|
||||
<li>MONO_PROPERTY_FLAGS
|
||||
<li>MONO_PROPERTY_NAME
|
||||
<li>MONO_PROPERTY_TYPE
|
||||
</ul>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>StandaloneSig</td><td>MONO_TABLE_STANDALONESIG</td><td>
|
||||
Array size:
|
||||
<li>MONO_STAND_ALONE_SIGNATURE_SIZE
|
||||
<ul>
|
||||
<li>MONO_STAND_ALONE_SIGNATURE
|
||||
</ul>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>TypeDef</td><td>MONO_TABLE_TYPEDEF</td><td>
|
||||
Array size:
|
||||
MONO_TYPEDEF_SIZE
|
||||
<ul>
|
||||
<li>MONO_TYPEDEF_FLAGS
|
||||
<li>MONO_TYPEDEF_NAME
|
||||
<li>MONO_TYPEDEF_NAMESPACE
|
||||
<li>MONO_TYPEDEF_EXTENDS
|
||||
<li>MONO_TYPEDEF_FIELD_LIST
|
||||
<li>MONO_TYPEDEF_METHOD_LIST
|
||||
</ul>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>TypeSpec</td><td>MONO_TABLE_TYPESPEC</td><td>
|
||||
Array size:
|
||||
MONO_TYPESPEC_SIZE
|
||||
<ul>
|
||||
<li>MONO_TYPESPEC_SIGNATURE
|
||||
</ul>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
</table>
|
||||
</center>
|
||||
|
||||
<p>Each table can contain zero or more rows, you must call the
|
||||
<a href="#api:mono_metadata_table_rows">mono_metadata_table_rows</a>
|
||||
to obtain the number of rows in a table, and then you can
|
||||
extract individual row values by using
|
||||
the <a href="#api:mono_metadata_decode_row">mono_metadata_decode_row</a>
|
||||
or
|
||||
the <a href="#api:mono_metadata_decode_row_col">mono_metadata_decode_row_col</a>.
|
||||
When decoding rows you must provide an guint32 array large
|
||||
enough to hold as many columns as the table contains.
|
||||
|
||||
<p>The metadata tables are stored in the MonoImage, you obtain
|
||||
a pointer to the MonoTableInfo by calling
|
||||
the <a href="#api:mono_image_get_table_info">mono_image_get_table_info</a>
|
||||
and then you can scan those tables, for example:
|
||||
|
||||
<pre class="prettyprint">
|
||||
/*
|
||||
* Dumps a few fields from the AssemblyRef table
|
||||
*/
|
||||
void DumpAssemblyRefs (MonoImage *image)
|
||||
{
|
||||
/* Get a pointer to the AssemblyRef metadata table */
|
||||
MonoTableInfo *t = mono_image_get_table_info (image, MONO_TABLE_ASSEMBLYREF);
|
||||
|
||||
/* Fetch the number of rows available in the table */
|
||||
int rows = mono_table_info_get_rows (t);
|
||||
int i;
|
||||
|
||||
/* For each row, print some of its values */
|
||||
for (i = 0; i < rows; i++){
|
||||
/* Space where we extract one row from the metadata table */
|
||||
guint32 cols [MONO_ASSEMBLYREF_SIZE];
|
||||
|
||||
/* Extract the row into the array cols */
|
||||
mono_metadata_decode_row (t, i, cols, MONO_ASSEMBLYREF_SIZE);
|
||||
|
||||
fprintf (output, "%d: Version=%d.%d.%d.%d\n\tName=%s\n", i + 1,
|
||||
cols [MONO_ASSEMBLYREF_MAJOR_VERSION],
|
||||
cols [MONO_ASSEMBLYREF_MINOR_VERSION],
|
||||
cols [MONO_ASSEMBLYREF_BUILD_NUMBER],
|
||||
cols [MONO_ASSEMBLYREF_REV_NUMBER],
|
||||
mono_metadata_string_heap (image, cols [MONO_ASSEMBLYREF_NAME]));
|
||||
}
|
||||
}
|
||||
</pre>
|
||||
|
||||
<p>The above program shows the following output when ran on
|
||||
the C# compiler:
|
||||
|
||||
<pre>
|
||||
1: Version=1.0.5000.0
|
||||
Name=mscorlib
|
||||
2: Version=1.0.5000.0
|
||||
Name=System
|
||||
3: Version=1.0.5000.0
|
||||
Name=System.Xml
|
||||
</pre>
|
||||
|
||||
<p>
|
||||
|
||||
<h3>Metadata Tables API</h3>
|
||||
|
||||
<p>These are the APIs for dealing with tables:
|
||||
|
||||
<h4><a name="api:mono_image_get_table_info">mono_image_get_table_info</a></h4>
|
||||
<h4><a name="api:mono_image_get_table_rows">mono_image_get_table_rows</a></h4>
|
||||
<h4><a name="api:mono_metadata_get_table">mono_metadata_get_table</a></h4>
|
||||
<h4><a name="api:mono_meta_table_name">mono_meta_table_name</a></h4>
|
||||
<h4><a name="api:mono_metadata_decode_row_col">mono_metadata_decode_row_col</a></h4>
|
||||
<h4><a name="api:mono_metadata_decode_row">mono_metadata_decode_row</a></h4>
|
||||
<h4><a name="api:mono_metadata_compute_size">mono_metadata_compute_size</a></h4>
|
||||
<h4><a name="api:mono_metadata_custom_attrs_from_index">mono_metadata_custom_attrs_from_index</a></h4>
|
||||
<h4><a name="api:mono_metadata_decode_signed_value">mono_metadata_decode_signed_value</a></h4>
|
||||
<h4><a name="api:mono_metadata_decode_value">mono_metadata_decode_value</a></h4>
|
||||
<h4><a name="api:mono_metadata_encode_value">mono_metadata_encode_value</a></h4>
|
||||
|
||||
<h2>Metadata access API</h2>
|
||||
<h3>Metadata access API</h3>
|
||||
|
||||
<p>This is the low-level API for accessing the metadata
|
||||
images.
|
||||
|
||||
<h4><a name="api:mono_cli_rva_image_map">mono_cli_rva_image_map</a></h4>
|
||||
<h4><a name="api:mono_pe_file_open">mono_pe_file_open</a></h4>
|
||||
<h4><a name="api:mono_meta_table_name">mono_meta_table_name</a></h4>
|
||||
<h4><a name="api:mono_metadata_blob_heap">mono_metadata_blob_heap</a></h4>
|
||||
<h4><a name="api:mono_metadata_compute_size">mono_metadata_compute_size</a></h4>
|
||||
<h4><a name="api:mono_metadata_custom_attrs_from_index">mono_metadata_custom_attrs_from_index</a></h4>
|
||||
<h4><a name="api:mono_metadata_decode_blob_size">mono_metadata_decode_blob_size</a></h4>
|
||||
<h4><a name="api:mono_metadata_decode_row_col">mono_metadata_decode_row_col</a></h4>
|
||||
<h4><a name="api:mono_metadata_decode_row">mono_metadata_decode_row</a></h4>
|
||||
<h4><a name="api:mono_metadata_decode_signed_value">mono_metadata_decode_signed_value</a></h4>
|
||||
<h4><a name="api:mono_metadata_decode_value">mono_metadata_decode_value</a></h4>
|
||||
<h4><a name="api:mono_metadata_encode_value">mono_metadata_encode_value</a></h4>
|
||||
<h4><a name="api:mono_metadata_events_from_typedef">mono_metadata_events_from_typedef</a></h4>
|
||||
<h4><a name="api:mono_metadata_field_info">mono_metadata_field_info</a></h4>
|
||||
<h4><a name="api:mono_metadata_free_array">mono_metadata_free_array</a></h4>
|
||||
<h4><a name="api:mono_metadata_free_marshal_spec">mono_metadata_free_marshal_spec</a></h4>
|
||||
<h4><a name="api:mono_metadata_free_mh">mono_metadata_free_mh</a></h4>
|
||||
<h4><a name="api:mono_metadata_free_type">mono_metadata_free_type</a></h4>
|
||||
<h4><a name="api:mono_metadata_generic_inst_equal">mono_metadata_generic_inst_equal</a></h4>
|
||||
<h4><a name="api:mono_metadata_generic_inst_hash">mono_metadata_generic_inst_hash</a></h4>
|
||||
<h4><a name="api:mono_metadata_generic_inst_is_valuetype">mono_metadata_generic_inst_is_valuetype</a></h4>
|
||||
<h4><a name="api:mono_metadata_generic_method_equal">mono_metadata_generic_method_equal</a></h4>
|
||||
<h4><a name="api:mono_metadata_get_constant_index">mono_metadata_get_constant_index</a></h4>
|
||||
<h4><a name="api:mono_metadata_get_marshal_info">mono_metadata_get_marshal_info</a></h4>
|
||||
<h4><a name="api:mono_metadata_get_table">mono_metadata_get_table</a></h4>
|
||||
<h4><a name="api:mono_metadata_guid_heap">mono_metadata_guid_heap</a></h4>
|
||||
<h4><a name="api:mono_metadata_implmap_from_method">mono_metadata_implmap_from_method</a></h4>
|
||||
<h4><a name="api:mono_metadata_interfaces_from_typedef_full">mono_metadata_interfaces_from_typedef_full</a></h4>
|
||||
<h4><a name="api:mono_metadata_interfaces_from_typedef">mono_metadata_interfaces_from_typedef</a></h4>
|
||||
<h4><a name="api:mono_metadata_load_generic_params">mono_metadata_load_generic_params</a></h4>
|
||||
<h4><a name="api:mono_metadata_locate">mono_metadata_locate</a></h4>
|
||||
<h4><a name="api:mono_metadata_locate_token">mono_metadata_locate_token</a></h4>
|
||||
<h4><a name="api:mono_metadata_methods_from_event">mono_metadata_methods_from_event</a></h4>
|
||||
@@ -652,17 +49,8 @@ MONO_TYPESPEC_SIZE
|
||||
<h4><a name="api:mono_metadata_nested_in_typedef">mono_metadata_nested_in_typedef</a></h4>
|
||||
<h4><a name="api:mono_metadata_nesting_typedef">mono_metadata_nesting_typedef</a></h4>
|
||||
<h4><a name="api:mono_metadata_packing_from_typedef">mono_metadata_packing_from_typedef</a></h4>
|
||||
<h4><a name="api:mono_metadata_properties_from_typedef">mono_metadata_properties_from_typedef</a></h4>
|
||||
<h4><a name="api:mono_metadata_token_from_dor">mono_metadata_token_from_dor</a></h4>
|
||||
<h4><a name="api:mono_metadata_typedef_from_field">mono_metadata_typedef_from_field</a></h4>
|
||||
<h4><a name="api:mono_metadata_typedef_from_method">mono_metadata_typedef_from_method</a></h4>
|
||||
<h4><a name="api:mono_metadata_type_equal">mono_metadata_type_equal</a></h4>
|
||||
<h4><a name="api:mono_metadata_type_hash">mono_metadata_type_hash</a></h4>
|
||||
<h4><a name="api:mono_metadata_declsec_from_index">mono_metadata_declsec_from_index</a></h4>
|
||||
<h4><a name="api:mono_metadata_free_method_signature">mono_metadata_free_method_signature</a></h4>
|
||||
|
||||
<h3>Retrieving Objects from Tokens</h3>
|
||||
|
||||
<h4><a name="api:mono_metadata_parse_array_full">mono_metadata_parse_array_full</a></h4>
|
||||
<h4><a name="api:mono_metadata_parse_array">mono_metadata_parse_array</a></h4>
|
||||
<h4><a name="api:mono_metadata_parse_custom_mod">mono_metadata_parse_custom_mod</a></h4>
|
||||
<h4><a name="api:mono_metadata_parse_field_type">mono_metadata_parse_field_type</a></h4>
|
||||
<h4><a name="api:mono_metadata_parse_marshal_spec">mono_metadata_parse_marshal_spec</a></h4>
|
||||
@@ -676,29 +64,25 @@ MONO_TYPESPEC_SIZE
|
||||
<h4><a name="api:mono_metadata_parse_typedef_or_ref">mono_metadata_parse_typedef_or_ref</a></h4>
|
||||
<h4><a name="api:mono_metadata_parse_type_full">mono_metadata_parse_type_full</a></h4>
|
||||
<h4><a name="api:mono_metadata_parse_type">mono_metadata_parse_type</a></h4>
|
||||
<h4><a name="api:mono_metadata_properties_from_typedef">mono_metadata_properties_from_typedef</a></h4>
|
||||
<h4><a name="api:mono_metadata_string_heap">mono_metadata_string_heap</a></h4>
|
||||
<h4><a name="api:mono_metadata_token_from_dor">mono_metadata_token_from_dor</a></h4>
|
||||
<h4><a name="api:mono_metadata_typedef_from_field">mono_metadata_typedef_from_field</a></h4>
|
||||
<h4><a name="api:mono_metadata_typedef_from_method">mono_metadata_typedef_from_method</a></h4>
|
||||
<h4><a name="api:mono_metadata_type_equal">mono_metadata_type_equal</a></h4>
|
||||
<h4><a name="api:mono_metadata_type_hash">mono_metadata_type_hash</a></h4>
|
||||
<h4><a name="api:mono_metadata_user_string">mono_metadata_user_string</a></h4>
|
||||
<h4><a name="api:mono_metadata_declsec_from_index">mono_metadata_declsec_from_index</a></h4>
|
||||
<h4><a name="api:mono_metadata_free_method_signature">mono_metadata_free_method_signature</a></h4>
|
||||
|
||||
<h2>Metadata Loader Locking</h2>
|
||||
|
||||
<p>The locking functions here are used by code in class.c and
|
||||
metadata.c to lock access to the shared hashtables inside the
|
||||
MonoImage.
|
||||
|
||||
<h4><a name="api:mono_loader_lock">mono_loader_lock</a></h4>
|
||||
<h4><a name="api:mono_loader_unlock">mono_loader_unlock</a></h4>
|
||||
|
||||
<h2>Generics Support</h2>
|
||||
<h3>Generics Support</h3>
|
||||
|
||||
<h4><a name="api:mono_metadata_generic_class_is_valuetype">mono_metadata_generic_class_is_valuetype</a></h4>
|
||||
<h4><a name="api:mono_metadata_has_generic_params">mono_metadata_has_generic_params</a></h4>
|
||||
<h4><a name="api:mono_metadata_inflate_generic_inst">mono_metadata_inflate_generic_inst</a></h4>
|
||||
<h4><a name="api:mono_metadata_parse_generic_inst">mono_metadata_parse_generic_inst</a></h4>
|
||||
<h4><a name="api:mono_metadata_generic_inst_equal">mono_metadata_generic_inst_equal</a></h4>
|
||||
<h4><a name="api:mono_metadata_generic_inst_hash">mono_metadata_generic_inst_hash</a></h4>
|
||||
<h4><a name="api:mono_metadata_load_generic_params">mono_metadata_load_generic_params</a></h4>
|
||||
<h4><a name="api:mono_metadata_generic_inst_is_valuetype">mono_metadata_generic_inst_is_valuetype</a></h4>
|
||||
<h4><a name="api:mono_metadata_generic_method_equal">mono_metadata_generic_method_equal</a></h4>
|
||||
|
||||
<h2>Tokens</h2>
|
||||
<h3>Tokens</h3>
|
||||
|
||||
<h4><a name="api:mono_ldtoken">mono_ldtoken</a></h4>
|
||||
<h4><a name="api:mono_lookup_dynamic_token">mono_lookup_dynamic_token</a></h4>
|
||||
@@ -706,12 +90,25 @@ MONO_TYPESPEC_SIZE
|
||||
<h4><a name="api:mono_exception_from_token">mono_exception_from_token</a></h4>
|
||||
<h4><a name="api:mono_create_jit_trampoline_from_token">mono_create_jit_trampoline_from_token</a></h4>
|
||||
|
||||
<h2>OpCodes</h2>
|
||||
<h3>Working with signatures</h3>
|
||||
|
||||
<h4><a name="api:mono_signature_explicit_this">mono_signature_explicit_this</a></h4>
|
||||
<h4><a name="api:mono_signature_get_call_conv">mono_signature_get_call_conv</a></h4>
|
||||
<h4><a name="api:mono_signature_get_desc">mono_signature_get_desc</a></h4>
|
||||
<h4><a name="api:mono_signature_get_param_count">mono_signature_get_param_count</a></h4>
|
||||
<h4><a name="api:mono_signature_get_params">mono_signature_get_params</a></h4>
|
||||
<h4><a name="api:mono_signature_get_return_type">mono_signature_get_return_type</a></h4>
|
||||
<h4><a name="api:mono_signature_hash">mono_signature_hash</a></h4>
|
||||
<h4><a name="api:mono_signature_is_instance">mono_signature_is_instance</a></h4>
|
||||
<h4><a name="api:mono_signature_vararg_start">mono_signature_vararg_start</a></h4>
|
||||
|
||||
|
||||
<h3>OpCodes</h3>
|
||||
|
||||
<h4><a name="api:mono_opcode_name">mono_opcode_name</a></h4>
|
||||
<h4><a name="api:mono_opcode_value">mono_opcode_value</a></h4>
|
||||
|
||||
<h2>Metadata Loading Errors</h2>
|
||||
<h3>Metadata Loading Errors</h3>
|
||||
|
||||
<p>The routines in this section are used to cope with errors
|
||||
during metadata loading. Errors in metadata handling can
|
||||
|
||||
@@ -54,20 +54,8 @@ mono_runtime_invoke (method, obj, args, &exception);
|
||||
<h4><a name="api:mono_method_has_marshal_info">mono_method_has_marshal_info</a></h4>
|
||||
<h4><a name="api:mono_method_return_message_restore">mono_method_return_message_restore</a></h4>
|
||||
<h4><a name="api:mono_method_same_domain">mono_method_same_domain</a></h4>
|
||||
<h4><a name="api:mono_method_verify">mono_method_verify</a></h4>
|
||||
|
||||
<h3>Method Signatures</h3>
|
||||
|
||||
<h4><a name="api:mono_method_signature">mono_method_signature</a></h4>
|
||||
<h4><a name="api:mono_signature_explicit_this">mono_signature_explicit_this</a></h4>
|
||||
<h4><a name="api:mono_signature_get_call_conv">mono_signature_get_call_conv</a></h4>
|
||||
<h4><a name="api:mono_signature_get_desc">mono_signature_get_desc</a></h4>
|
||||
<h4><a name="api:mono_signature_get_param_count">mono_signature_get_param_count</a></h4>
|
||||
<h4><a name="api:mono_signature_get_params">mono_signature_get_params</a></h4>
|
||||
<h4><a name="api:mono_signature_get_return_type">mono_signature_get_return_type</a></h4>
|
||||
<h4><a name="api:mono_signature_hash">mono_signature_hash</a></h4>
|
||||
<h4><a name="api:mono_signature_is_instance">mono_signature_is_instance</a></h4>
|
||||
<h4><a name="api:mono_signature_vararg_start">mono_signature_vararg_start</a></h4>
|
||||
<h4><a name="api:mono_method_verify">mono_method_verify</a></h4>
|
||||
|
||||
<h3>Methods Header Operations</h3>
|
||||
|
||||
|
||||
@@ -0,0 +1,113 @@
|
||||
|
||||
1. Thread safety of metadata structures
|
||||
----------------------------------------
|
||||
|
||||
1.1 Synchronization of read-only data
|
||||
-------------------------------------
|
||||
|
||||
Read-only data is data which is not modified after creation, like the
|
||||
actual binary metadata in the metadata tables.
|
||||
|
||||
There are three kinds of threads with regards to read-only data:
|
||||
- readers
|
||||
- the creator of the data
|
||||
- the destroyer of the data
|
||||
|
||||
Most threads are readers.
|
||||
|
||||
- synchronization between readers is not neccesary
|
||||
- synchronization between the writers is done using locks.
|
||||
- synchronization between the readers and the creator is done by not exposing
|
||||
the data to readers before it is fully constructed.
|
||||
- synchronization between the readers and the destroyer: TBD.
|
||||
|
||||
1.2 Deadlock prevention plan
|
||||
----------------------------
|
||||
|
||||
Hold locks for the shortest time possible. Avoid calling functions inside
|
||||
locks which might obtain global locks (i.e. locks known outside this module).
|
||||
|
||||
1.3 Locks
|
||||
----------
|
||||
|
||||
1.3.1 Simple locks
|
||||
------------------
|
||||
|
||||
There are a lot of global data structures which can be protected by a 'simple' lock. Simple means:
|
||||
- the lock protects only this data structure or it only protects the data structures in a given C module.
|
||||
An example would be the appdomains list in domain.c
|
||||
- the lock is only held for a short amount of time, and no other lock is acquired inside this simple lock. Thus there is
|
||||
no possibility of deadlock.
|
||||
|
||||
1.3.2 The class loader lock
|
||||
---------------------------
|
||||
|
||||
This locks is held by the class loading routines in class.c and loader.c. It
|
||||
protects the various caches inside MonoImage which are used by these modules.
|
||||
|
||||
1.3.3 The domain lock
|
||||
---------------------
|
||||
|
||||
Each appdomain has a lock which protects the per-domain data structures.
|
||||
|
||||
1.3.4 The locking hierarchy
|
||||
---------------------------
|
||||
|
||||
It is useful to model locks by a locking hierarchy, which is a relation between locks, which is reflexive, transitive,
|
||||
and antisymmetric, in other words, a lattice. If a thread wants to acquire a lock B, while already holding A, it can only
|
||||
do it if A < B. If all threads work this way, then no deadlocks can occur.
|
||||
|
||||
Our locking hierarchy so far looks like this:
|
||||
<DOMAIN LOCK>
|
||||
\
|
||||
<CLASS LOADER LOCK>
|
||||
\ \
|
||||
<SIMPLE LOCK 1> <SIMPLE LOCK 2>
|
||||
|
||||
1.4 Notes
|
||||
----------
|
||||
|
||||
Some common scenarios:
|
||||
- if a function needs to access a data structure, then it should lock it itself, and do not count on its caller locking it.
|
||||
So for example, the image->class_cache hash table would be locked by mono_class_get().
|
||||
|
||||
- there are lots of places where a runtime data structure is created and stored in a cache. In these places, care must be
|
||||
taken to avoid multiple threads creating the same runtime structure, for example, two threads might call mono_class_get ()
|
||||
with the same class name. There are two choices here:
|
||||
|
||||
<enter mutex>
|
||||
<check that item is created>
|
||||
if (created) {
|
||||
<leave mutex>
|
||||
return item
|
||||
}
|
||||
<create item>
|
||||
<store it in cache>
|
||||
<leave mutex>
|
||||
|
||||
This is the easiest solution, but it requires holding the lock for the whole time which might create a scalability problem, and could also lead to deadlock.
|
||||
|
||||
<enter mutex>
|
||||
<check that item is created>
|
||||
<leave mutex>
|
||||
if (created) {
|
||||
return item
|
||||
}
|
||||
<create item>
|
||||
<enter mutex>
|
||||
<check that item is created>
|
||||
if (created) {
|
||||
/* Another thread already created and stored the same item */
|
||||
<free our item>
|
||||
<leave mutex>
|
||||
return orig item
|
||||
}
|
||||
else {
|
||||
<store item in cache>
|
||||
<leave mutex>
|
||||
return item
|
||||
}
|
||||
|
||||
This solution does not present scalability problems, but the created item might be hard to destroy (like a MonoClass).
|
||||
|
||||
- lazy initialization of hashtables etc. is not thread safe
|
||||
File renamed without changes.
@@ -1,38 +1,3 @@
|
||||
2009-02-05 Miguel de Icaza <[email protected]>
|
||||
|
||||
* src/gstr.c: Add g_strnfill
|
||||
|
||||
* src/glib.h: Add g_list_previous
|
||||
|
||||
2009-01-19 Bill Holmes <[email protected]>
|
||||
|
||||
* gmisc-win32.c (g_path_is_absolute): Adding support for UNC
|
||||
paths on Windows.
|
||||
|
||||
Contributed under MIT/X11 license.
|
||||
|
||||
2009-01-08 Bill Holmes <[email protected]>
|
||||
|
||||
* winconfig.h, src/gfile-posix.c :
|
||||
Fixing the MSVC builds.
|
||||
|
||||
Contributed under MIT/X11 license.
|
||||
|
||||
2009-01-07 Miguel de Icaza <[email protected]>
|
||||
|
||||
* src/gfile-posix.c: Move g_get_current_dir, as it is a
|
||||
POSIX-esque feature, and some other systems do not have current
|
||||
directories.
|
||||
|
||||
* src/glib.h (G_LOCK_DEFINE, G_LOCK_DEFINE_STATIC):
|
||||
|
||||
Embedded support from Paolo's work on quack.
|
||||
|
||||
* configure.ac: check for strtok_r, langinfo.h and iconv.h
|
||||
|
||||
* src/gpath.c (strtok_r): Add a strtok_r implementation if it is
|
||||
not available on the target system.
|
||||
|
||||
2008-11-05 Bill Holmes <[email protected]>
|
||||
|
||||
* src/gutf8.c, src/unicode-data.h, src/gunicode.c :
|
||||
|
||||
+3
-3
@@ -2,7 +2,7 @@ AC_INIT(README)
|
||||
AC_CANONICAL_SYSTEM
|
||||
|
||||
AM_CONFIG_HEADER(config.h)
|
||||
AM_INIT_AUTOMAKE(eglib,0.3)
|
||||
AM_INIT_AUTOMAKE(eglib,0.2)
|
||||
AM_MAINTAINER_MODE
|
||||
|
||||
AC_PROG_CC
|
||||
@@ -55,7 +55,7 @@ AM_CONDITIONAL(PLATFORM_WIN32, test x$OS = xWIN32)
|
||||
|
||||
AC_CHECK_SIZEOF(int)
|
||||
AC_CHECK_SIZEOF(void *)
|
||||
AC_CHECK_FUNCS(strndup strlcpy getpwent_r strtok_r)
|
||||
AC_CHECK_FUNCS(strndup strlcpy getpwent_r)
|
||||
AC_CHECK_LIB(iconv, libiconv_open, LIBS="$LIBS -liconv")
|
||||
old_ldflags="${LDFLAGS}"
|
||||
LDFLAGS="${LDFLAGS} -Wl,-export-dynamic"
|
||||
@@ -64,7 +64,7 @@ if test $found_export_dynamic = no; then
|
||||
LDFLAGS="${old_ldflags}"
|
||||
fi
|
||||
|
||||
AC_CHECK_HEADERS(getopt.h sys/time.h sys/wait.h pwd.h langinfo.h iconv.h)
|
||||
AC_CHECK_HEADERS(getopt.h sys/time.h sys/wait.h pwd.h)
|
||||
|
||||
if test $ac_cv_sizeof_void_p != $ac_cv_sizeof_int; then
|
||||
GPOINTER_TO_INT="((gint)(long) (ptr))"
|
||||
|
||||
@@ -39,7 +39,6 @@ libeglib_la_SOURCES = \
|
||||
gmarkup.c \
|
||||
gutf8.c \
|
||||
gunicode.c \
|
||||
unicode-data.h \
|
||||
$(os_files)
|
||||
|
||||
libeglib_la_CFLAGS = -Wall -D_FORTIFY_SOURCE=2
|
||||
|
||||
@@ -35,7 +35,6 @@
|
||||
#include <sys/types.h>
|
||||
|
||||
#ifdef _MSC_VER
|
||||
#include <direct.h>
|
||||
int mkstemp (char *tmp_template);
|
||||
#endif
|
||||
|
||||
@@ -145,23 +144,3 @@ g_file_open_tmp (const gchar *tmpl, gchar **name_used, GError **error)
|
||||
}
|
||||
return fd;
|
||||
}
|
||||
|
||||
gchar *
|
||||
g_get_current_dir (void)
|
||||
{
|
||||
int s = 32;
|
||||
char *buffer = NULL, *r;
|
||||
gboolean fail;
|
||||
|
||||
do {
|
||||
buffer = g_realloc (buffer, s);
|
||||
r = getcwd (buffer, s);
|
||||
fail = (r == NULL && errno == ERANGE);
|
||||
if (fail) {
|
||||
s <<= 1;
|
||||
}
|
||||
} while (fail);
|
||||
|
||||
return r;
|
||||
}
|
||||
|
||||
+2
-6
@@ -234,7 +234,6 @@ gchar *g_strjoinv (const gchar *separator, gchar **str_array);
|
||||
gchar *g_strchug (gchar *str);
|
||||
gchar *g_strchomp (gchar *str);
|
||||
void g_strdown (gchar *string);
|
||||
gchar *g_strnfill (gsize length, gchar fill_char);
|
||||
|
||||
gchar *g_strdelimit (gchar *string, const gchar *delimiters, gchar new_delimiter);
|
||||
gchar *g_strescape (const gchar *source, const gchar *exceptions);
|
||||
@@ -367,7 +366,6 @@ struct _GList {
|
||||
};
|
||||
|
||||
#define g_list_next(list) ((list) ? (((GList *) (list))->next) : NULL)
|
||||
#define g_list_previous(list) ((list) ? (((GList *) (list))->prev) : NULL)
|
||||
|
||||
GList *g_list_alloc (void);
|
||||
GList *g_list_append (GList *list,
|
||||
@@ -834,15 +832,13 @@ glong g_utf8_strlen (const gchar *str, gssize max);
|
||||
#define g_thread_supported() TRUE
|
||||
#define g_thread_init(x) G_STMT_START { if (x != NULL) { g_error ("No vtable supported in g_thread_init"); } } G_STMT_END
|
||||
|
||||
#define G_LOCK_DEFINE(name) int name;
|
||||
#define G_LOCK_DEFINE_STATIC(name) static int name;
|
||||
#define G_LOCK_DEFINE(name)
|
||||
#define G_LOCK_DEFINE_STATIC(name)
|
||||
#define G_LOCK_EXTERN(name)
|
||||
#define G_LOCK(name)
|
||||
#define G_TRYLOCK(name)
|
||||
#define G_UNLOCK(name)
|
||||
|
||||
#define GUINT16_SWAP_LE_BE_CONSTANT(x) ((((guint16) x) >> 8) | ((((guint16) x) << 8)))
|
||||
|
||||
#define GUINT16_SWAP_LE_BE(x) ((guint16) (((guint16) x) >> 8) | ((((guint16)(x)) & 0xff) << 8))
|
||||
#define GUINT32_SWAP_LE_BE(x) ((guint32) \
|
||||
( (((guint32) (x)) << 24)| \
|
||||
|
||||
+6
-34
@@ -40,7 +40,6 @@
|
||||
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
#include <stdio.h>
|
||||
#include <ctype.h>
|
||||
#include <glib.h>
|
||||
|
||||
#define set_error(msg, ...) do { if (error != NULL) *error = g_error_new (GINT_TO_POINTER (1), 1, msg, __VA_ARGS__); } while (0);
|
||||
@@ -100,37 +99,10 @@ g_markup_parse_context_free (GMarkupParseContext *context)
|
||||
g_free (context);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
my_isspace (char c)
|
||||
{
|
||||
if (c == ' ' || c == '\t' || c == '\r' || c == '\n' || c == '\v')
|
||||
return TRUE;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
my_isalnum (char c)
|
||||
{
|
||||
if ((c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z'))
|
||||
return TRUE;
|
||||
if (c >= '0' && c <= '9')
|
||||
return TRUE;
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
my_isalpha (char c)
|
||||
{
|
||||
if ((c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z'))
|
||||
return TRUE;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static const char *
|
||||
skip_space (const char *p, const char *end)
|
||||
{
|
||||
for (; p < end && my_isspace (*p); p++)
|
||||
for (; p < end && isspace (*p); p++)
|
||||
;
|
||||
return p;
|
||||
}
|
||||
@@ -166,7 +138,7 @@ parse_name (const char *p, const char *end, char **value)
|
||||
const char *start = p;
|
||||
int l;
|
||||
|
||||
for (; p < end && my_isalnum (*p); p++)
|
||||
for (; p < end && isalnum (*p); p++)
|
||||
;
|
||||
if (p == end)
|
||||
return end;
|
||||
@@ -296,7 +268,7 @@ g_markup_parse_context_parse (GMarkupParseContext *context,
|
||||
int full_stop = 0, l;
|
||||
gchar **names = NULL, **values = NULL;
|
||||
|
||||
for (; p < end && my_isspace (*p); p++)
|
||||
for (; p < end && isspace (*p); p++)
|
||||
;
|
||||
if (p == end){
|
||||
set_error ("%s", "Unfinished element");
|
||||
@@ -309,12 +281,12 @@ g_markup_parse_context_parse (GMarkupParseContext *context,
|
||||
break;
|
||||
}
|
||||
|
||||
if (!my_isalpha (*p)){
|
||||
if (!(isascii (*p) && isalpha (*p))){
|
||||
set_error ("%s", "Expected an element name");
|
||||
goto fail;
|
||||
}
|
||||
|
||||
for (++p; p < end && (my_isalnum (*p) || (*p == '.')); p++)
|
||||
for (++p; p < end && (isalnum (*p) || (*p == '.')); p++)
|
||||
;
|
||||
if (p == end){
|
||||
set_error ("%s", "Expected an element");
|
||||
@@ -322,7 +294,7 @@ g_markup_parse_context_parse (GMarkupParseContext *context,
|
||||
}
|
||||
element_end = p;
|
||||
|
||||
for (; p < end && my_isspace (*p); p++)
|
||||
for (; p < end && isspace (*p); p++)
|
||||
;
|
||||
if (p == end){
|
||||
set_error ("%s", "Unfinished element");
|
||||
|
||||
+5
-10
@@ -93,16 +93,11 @@ g_path_is_absolute (const char *filename)
|
||||
{
|
||||
g_return_val_if_fail (filename != NULL, FALSE);
|
||||
|
||||
if (filename[0] != '\0' && filename[1] != '\0')
|
||||
if (filename[1] == ':' && filename[2] != '\0' &&
|
||||
(filename[2] == '\\' || filename[2] == '/'))
|
||||
return TRUE;
|
||||
/* UNC paths */
|
||||
else if (filename[0] == '\\' && filename[1] == '\\' &&
|
||||
filename[2] != '\0')
|
||||
return TRUE;
|
||||
|
||||
return FALSE;
|
||||
if (filename[0] != '\0' && filename[1] != '\0' && filename[1] == ':' &&
|
||||
filename[2] != '\0' && (filename[2] == '\\' || filename[2] == '/'))
|
||||
return TRUE;
|
||||
else
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
const gchar *
|
||||
|
||||
+21
-59
@@ -47,9 +47,7 @@ g_build_path (const gchar *separator, const gchar *first_element, ...)
|
||||
va_list args;
|
||||
|
||||
g_return_val_if_fail (separator != NULL, NULL);
|
||||
|
||||
if (first_element == NULL)
|
||||
return g_strdup ("");
|
||||
g_return_val_if_fail (first_element != NULL, NULL);
|
||||
|
||||
result = g_string_sized_new (48);
|
||||
|
||||
@@ -68,8 +66,7 @@ g_build_path (const gchar *separator, const gchar *first_element, ...)
|
||||
g_string_append_len (result, s, p - s);
|
||||
|
||||
if (next && *next){
|
||||
if (strncmp (separator, result->str + strlen (result->str) - slen, slen))
|
||||
g_string_append (result, separator);
|
||||
g_string_append (result, separator);
|
||||
|
||||
for (; strncmp (next, separator, slen) == 0; )
|
||||
next += slen;
|
||||
@@ -134,60 +131,6 @@ g_path_get_basename (const char *filename)
|
||||
return g_strdup (&r[1]);
|
||||
}
|
||||
|
||||
#ifndef HAVE_STRTOK_R
|
||||
// This is from BSD's strtok_r
|
||||
|
||||
char *
|
||||
strtok_r(char *s, const char *delim, char **last)
|
||||
{
|
||||
char *spanp;
|
||||
int c, sc;
|
||||
char *tok;
|
||||
|
||||
if (s == NULL && (s = *last) == NULL)
|
||||
return NULL;
|
||||
|
||||
/*
|
||||
* Skip (span) leading delimiters (s += strspn(s, delim), sort of).
|
||||
*/
|
||||
cont:
|
||||
c = *s++;
|
||||
for (spanp = (char *)delim; (sc = *spanp++) != 0; ){
|
||||
if (c == sc)
|
||||
goto cont;
|
||||
}
|
||||
|
||||
if (c == 0){ /* no non-delimiter characters */
|
||||
*last = NULL;
|
||||
return NULL;
|
||||
}
|
||||
tok = s - 1;
|
||||
|
||||
/*
|
||||
* Scan token (scan for delimiters: s += strcspn(s, delim), sort of).
|
||||
* Note that delim must have one NUL; we stop if we see that, too.
|
||||
*/
|
||||
for (;;){
|
||||
c = *s++;
|
||||
spanp = (char *)delim;
|
||||
do {
|
||||
if ((sc = *spanp++) == c) {
|
||||
if (c == 0)
|
||||
s = NULL;
|
||||
else {
|
||||
char *w = s - 1;
|
||||
*w = '\0';
|
||||
}
|
||||
*last = s;
|
||||
return tok;
|
||||
}
|
||||
}
|
||||
while (sc != 0);
|
||||
}
|
||||
/* NOTREACHED */
|
||||
}
|
||||
#endif
|
||||
|
||||
gchar *
|
||||
g_find_program_in_path (const gchar *program)
|
||||
{
|
||||
@@ -220,6 +163,25 @@ g_find_program_in_path (const gchar *program)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
gchar *
|
||||
g_get_current_dir (void)
|
||||
{
|
||||
int s = 32;
|
||||
char *buffer = NULL, *r;
|
||||
gboolean fail;
|
||||
|
||||
do {
|
||||
buffer = g_realloc (buffer, s);
|
||||
r = getcwd (buffer, s);
|
||||
fail = (r == NULL && errno == ERANGE);
|
||||
if (fail) {
|
||||
s <<= 1;
|
||||
}
|
||||
} while (fail);
|
||||
|
||||
return r;
|
||||
}
|
||||
|
||||
static char *name;
|
||||
|
||||
void
|
||||
|
||||
+2
-11
@@ -826,15 +826,6 @@ g_ascii_xdigit_value (gchar c)
|
||||
(c - 'A' + 10))));
|
||||
}
|
||||
|
||||
gchar *
|
||||
g_strnfill (gsize length, gchar fill_char)
|
||||
{
|
||||
gchar *ret = g_new (gchar, length + 1);
|
||||
int i;
|
||||
|
||||
for (i = 0; i < length; i++)
|
||||
ret [i] = fill_char;
|
||||
|
||||
ret [length] = 0;
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
+1
-10
@@ -33,7 +33,6 @@
|
||||
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
*
|
||||
*/
|
||||
#include <config.h>
|
||||
#include <stdio.h>
|
||||
#include <glib.h>
|
||||
#include <unicode-data.h>
|
||||
@@ -45,13 +44,9 @@
|
||||
|
||||
typedef int iconv_t;
|
||||
#else
|
||||
#ifdef HAVE_LANGINFO_H
|
||||
#include <langinfo.h>
|
||||
#endif
|
||||
#ifdef HAVE_ICONV_H
|
||||
#include <iconv.h>
|
||||
#endif
|
||||
#endif
|
||||
|
||||
static char *my_charset;
|
||||
static gboolean is_utf8;
|
||||
@@ -205,7 +200,7 @@ g_convert (const gchar *str, gssize len,
|
||||
{
|
||||
char *result = NULL;
|
||||
#ifdef G_OS_WIN32
|
||||
#elif HAVE_ICONV_H
|
||||
#else
|
||||
iconv_t convertor;
|
||||
char *buffer, *output;
|
||||
const char *strptr = (const char *) str;
|
||||
@@ -300,11 +295,7 @@ g_get_charset (G_CONST_RETURN char **charset)
|
||||
is_utf8 = FALSE;
|
||||
#else
|
||||
if (my_charset == NULL){
|
||||
#if HAVE_LANGINFO_H
|
||||
my_charset = g_strdup (nl_langinfo (CODESET));
|
||||
#else
|
||||
my_charset = g_strdup ("UTF-8");
|
||||
#endif
|
||||
is_utf8 = strcmp (my_charset, "UTF-8") == 0;
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -238,7 +238,7 @@ gint main(gint argc, gchar **argv)
|
||||
string_array_free(tests_to_run);
|
||||
}
|
||||
|
||||
return global_tests - global_passed;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
+2
-23
@@ -92,14 +92,7 @@ test_buildpath ()
|
||||
if (strcmp (s, "/a/c/") != 0)
|
||||
return FAILED ("14 Got wrong result, got: %s", s);
|
||||
g_free (s);
|
||||
|
||||
/* Null */
|
||||
s = g_build_path ("/", NULL);
|
||||
if (s == NULL)
|
||||
return FAILED ("must get a non-NULL return");
|
||||
if (s [0] != 0)
|
||||
return FAILED ("must get an empty string");
|
||||
g_free (s);
|
||||
|
||||
return OK;
|
||||
}
|
||||
|
||||
@@ -116,20 +109,6 @@ test_buildfname ()
|
||||
#endif
|
||||
return FAILED ("1 Got wrong result, got: %s", s);
|
||||
g_free (s);
|
||||
|
||||
s = g_build_filename ("/", "a", NULL);
|
||||
#ifdef G_OS_WIN32
|
||||
if (strcmp (s, "\\a") != 0)
|
||||
#else
|
||||
if (strcmp (s, "/a") != 0)
|
||||
#endif
|
||||
return FAILED ("1 Got wrong result, got: %s", s);
|
||||
|
||||
#ifndef OS_WIN32
|
||||
s = g_build_filename ("/", "foo", "/bar", "tolo/", "/meo/", NULL);
|
||||
if (strcmp (s, "/foo/bar/tolo/meo/") != 0)
|
||||
return FAILED ("1 Got wrong result, got: %s", s);
|
||||
#endif
|
||||
|
||||
return OK;
|
||||
}
|
||||
@@ -305,8 +284,8 @@ test_misc ()
|
||||
}
|
||||
|
||||
static Test path_tests [] = {
|
||||
{"g_build_filename", test_buildfname},
|
||||
{"g_buildpath", test_buildpath},
|
||||
{"g_build_filename", test_buildfname},
|
||||
{"g_path_get_dirname", test_dirname},
|
||||
{"g_path_get_basename", test_basename},
|
||||
{"g_find_program_in_path", test_ppath},
|
||||
|
||||
@@ -72,5 +72,3 @@
|
||||
|
||||
/* Version number of package */
|
||||
#define VERSION "0.1"
|
||||
|
||||
#define HAVE_STRTOK_R 1
|
||||
+1
-1
@@ -28,7 +28,7 @@
|
||||
#include <malloc.h>
|
||||
#define ALLOCA _alloca
|
||||
#else
|
||||
#if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__)
|
||||
#if defined(__FreeBSD__) || defined(__NetBSD__)
|
||||
#include <stdlib.h>
|
||||
#else
|
||||
#include <alloca.h>
|
||||
|
||||
@@ -1,14 +1,3 @@
|
||||
2009-01-18 Zoltan Varga <[email protected]>
|
||||
|
||||
* include/private/gcconfig.h: Applied patch from Koushik Dutta
|
||||
([email protected]). Define SEARCH_FOR_DATA_START for android.
|
||||
|
||||
2008-11-18 Mark Probst <[email protected]>
|
||||
|
||||
* include/private/gc_locks.h (test_and_set): The PPC64 case is
|
||||
wrong, as it operates on 64 bit values, not on 32 bit ones as the
|
||||
function requires. The PPC32 case is sufficient.
|
||||
|
||||
2008-09-29 Geoff Norton <[email protected]>
|
||||
|
||||
* include/private/gcconfig.h: Make Darwin/ARM use mmap() instead of
|
||||
|
||||
@@ -155,6 +155,25 @@
|
||||
# define GC_TEST_AND_SET_DEFINED
|
||||
# endif
|
||||
# if defined(POWERPC)
|
||||
# if CPP_WORDSZ == 64
|
||||
inline static int GC_test_and_set(volatile unsigned int *addr) {
|
||||
unsigned long oldval;
|
||||
unsigned long temp = 1; /* locked value */
|
||||
|
||||
__asm__ __volatile__(
|
||||
"1:\tldarx %0,0,%3\n" /* load and reserve */
|
||||
"\tcmpdi %0, 0\n" /* if load is */
|
||||
"\tbne 2f\n" /* non-zero, return already set */
|
||||
"\tstdcx. %2,0,%1\n" /* else store conditional */
|
||||
"\tbne- 1b\n" /* retry if lost reservation */
|
||||
"\tsync\n" /* import barrier */
|
||||
"2:\t\n" /* oldval is zero if we set */
|
||||
: "=&r"(oldval), "=p"(addr)
|
||||
: "r"(temp), "1"(addr)
|
||||
: "cr0","memory");
|
||||
return (int)oldval;
|
||||
}
|
||||
# else
|
||||
inline static int GC_test_and_set(volatile unsigned int *addr) {
|
||||
int oldval;
|
||||
int temp = 1; /* locked value */
|
||||
@@ -172,6 +191,7 @@
|
||||
: "cr0","memory");
|
||||
return oldval;
|
||||
}
|
||||
# endif
|
||||
# define GC_TEST_AND_SET_DEFINED
|
||||
inline static void GC_clear(volatile unsigned int *addr) {
|
||||
__asm__ __volatile__("lwsync" : : : "memory");
|
||||
|
||||
@@ -1868,8 +1868,6 @@
|
||||
# include <features.h>
|
||||
# if defined(__GLIBC__) && __GLIBC__ >= 2
|
||||
# define SEARCH_FOR_DATA_START
|
||||
# elif defined(PLATFORM_ANDROID)
|
||||
# define SEARCH_FOR_DATA_START
|
||||
# else
|
||||
extern char **__environ;
|
||||
# define DATASTART ((ptr_t)(&__environ))
|
||||
|
||||
+4
-6
@@ -1,17 +1,15 @@
|
||||
2008-12-31 Massimiliano Mantione <[email protected]>
|
||||
|
||||
* mono.1: Updated the profiler documentation, removing the "ts"
|
||||
option (it does not exist anymore) and explaining the defaults for
|
||||
allocation and heap profiling.
|
||||
* mono.1: Merged the profiler documentation from trunk (r122288),
|
||||
removing the "ts" option (it does not exist anymore) and explaining
|
||||
the defaults for allocation and heap profiling.
|
||||
|
||||
2008-12-12 Rolf Bjarne Kvinge <[email protected]>
|
||||
|
||||
* Makefile.am, vbnc.1: Remove vbnc.1. It's living in the
|
||||
mono-basic module now.
|
||||
|
||||
2008-11-20 Rodrigo Kumpera <[email protected]>
|
||||
|
||||
* mono.1: Document env vars MONO_XDEBUG and MONO_VERBOSE_METHOD.
|
||||
[Backport of r121406.]
|
||||
|
||||
2008-10-18 Jonathan Pryor <[email protected]>
|
||||
|
||||
|
||||
@@ -51,121 +51,6 @@ are no \fI//AssemblyVersion\fR elements for a given \fI<Type>\fR or
|
||||
\fI<Member/>\fR, then the \fI<Type>\fR will be renamed and/or the
|
||||
\fI<Member/>\fR will be removed.
|
||||
.TP
|
||||
\fB\-\-exceptions\fR[=\fISOURCES\fR]
|
||||
EXPERIMENTAL. This is not 100% reliable, but is intended to serve as an aid
|
||||
for documentation writers.
|
||||
.Sp
|
||||
Inspect member bodies to determine what exceptions can be generated from the
|
||||
member.
|
||||
.Sp
|
||||
\fISOURCES\fR is an optional comma-separated list of the following sources
|
||||
that should be searched for exceptions:
|
||||
.Sp
|
||||
.nf
|
||||
all Find exceptions created in the member itself,
|
||||
references to members in the same assembly,
|
||||
and references to members in dependent
|
||||
assemblies.
|
||||
asm Find exceptions created in the member itself and
|
||||
references to members within the same assembly
|
||||
as the member.
|
||||
depasm Find exceptions created in the member itself and
|
||||
references to members within dependent
|
||||
assemblies.
|
||||
.fi
|
||||
.Sp
|
||||
If \fISOURCES\fR isn't provided (the default), then only exceptions created
|
||||
within the member itself will be documented.
|
||||
.Sp
|
||||
LIMITATIONS: Exception searching is currently implemented by looking for the
|
||||
exception types that are explicitly created based on the known compile-time
|
||||
types. This has the following limitations:
|
||||
.RS
|
||||
.ne 8
|
||||
.TP
|
||||
.B *
|
||||
This will not find exceptions which are implicit to the IL, such as
|
||||
NullReferenceException and IndexOutOfRangeException.
|
||||
.TP
|
||||
.B *
|
||||
This will find exceptions which are \fInot\fR thrown, e.g.
|
||||
.nf
|
||||
|
||||
public void CreateAnException ()
|
||||
{
|
||||
Exception e = new Exception ();
|
||||
}
|
||||
|
||||
.fi
|
||||
.TP
|
||||
.B *
|
||||
This will not "follow" delegate and interface calls:
|
||||
.nf
|
||||
|
||||
public void UsesDelegates ()
|
||||
{
|
||||
Func<int, int> a = x => {throw new Exception ();};
|
||||
a (4);
|
||||
}
|
||||
|
||||
.fi
|
||||
The function \fIUsesDelegates()\fR won't have any exceptions documented.
|
||||
.TP
|
||||
.B *
|
||||
This will find exceptions which "cannot happen", such as
|
||||
ArgumentNullExceptions for arguments which are "known" to be non-null:
|
||||
.nf
|
||||
|
||||
public void A ()
|
||||
{
|
||||
B ("this parameter isn't null");
|
||||
}
|
||||
|
||||
public void B (string s)
|
||||
{
|
||||
if (s == null)
|
||||
throw new ArgumentNullException ("s");
|
||||
}
|
||||
|
||||
.fi
|
||||
For the above, if \fB--exceptions=asm\fR is provided then \fIA()\fR will be
|
||||
documented as throwing an ArgumentNullException, which cannot happen.
|
||||
.ne
|
||||
.RE
|
||||
.TP
|
||||
\fB\-f\fR=\fIFLAG\fR
|
||||
Specify a flag to alter behavior. Valid flags include:
|
||||
.RS
|
||||
.ne 8
|
||||
.TP
|
||||
.B no-assembly-versions
|
||||
See the \fB-fno-assembly-versions\fR documentation, below.
|
||||
.ne
|
||||
.RE
|
||||
.TP
|
||||
\fB\-fno-assembly-versions\fR
|
||||
Do not generate \fI/Type/AssemblyInfo/AssemblyVersion\fR and
|
||||
\fI/Type/Members/Member/AssemblyInfo\fR elements.
|
||||
.Sp
|
||||
This is useful to prevent "churn" during updates. Normally, if a type or
|
||||
member hasn't changed but the assembly version has changed, then all types and
|
||||
members will be updated to include a new \fI//AssemblyVersion\fR element, thus
|
||||
increasing the amount of changes that need review before committing (assuming
|
||||
all changes are actually reviewed before commit).
|
||||
.Sp
|
||||
WARNING: This \fIwill\fR interact badly with the \fB--delete\fR option, as
|
||||
\fB--delete\fR uses the \fI//AssemblyVersion\fR elements to track version
|
||||
changes. Thus, if you have a member which is present in an early assembly
|
||||
version and is removed in a subsequent assembly version, such as
|
||||
\fISystem.Text.UTF8Encoding.GetBytes(string)\fR (which is present in .NET 1.0
|
||||
but not in .NET 2.0), then the member will be removed when the
|
||||
\fB--delete -fno-assembly-versions\fR options are specified, the member was
|
||||
present in an earlier version of the assembly, and the current version of the
|
||||
assembly does not contain the member.
|
||||
.Sp
|
||||
Consequently, this option should \fIonly\fR be specified if types and members
|
||||
will \fInever\fR be removed from an assembly.
|
||||
.TP
|
||||
\fB\-i\fR, \fB\-\-import\fR=\fIFILE\fR
|
||||
Import documentation found within \fIFILE\fR.
|
||||
.Sp
|
||||
@@ -175,15 +60,6 @@ Import documentation found within \fIFILE\fR.
|
||||
Place the generated stubs into \fIDIRECTORY\fR.
|
||||
.Sp
|
||||
When updating documentation, \fIDIRECTORY\fR is also the source directory.
|
||||
.TP
|
||||
\fB\-\-since\fR=\fIVERSION\fR
|
||||
When \fIupdating\fR documentation for an assembly, if a type or member is
|
||||
encountered which didn't exist in the previous version of the assembly a
|
||||
\fB<since version="\fR\fIVERSION\fR\fB"/>\fR element will be inserted.
|
||||
.TP
|
||||
\fB\-\-type\fR=\fITYPE\fR
|
||||
Only update documentation for the type \fITYPE\fR.
|
||||
.TP
|
||||
.B \-h, \-?, \-\-help
|
||||
Display a help message and exit.
|
||||
.SH SEE ALSO
|
||||
|
||||
+5
-10
@@ -642,6 +642,11 @@ This can be a time consuming operation.
|
||||
\fIjit\fR, \fIj\fR
|
||||
Collect information about time spent by the JIT engine compiling
|
||||
methods.
|
||||
.TP
|
||||
\fItrack-stack\fR, \fIts\fR
|
||||
Track the execution stack. By itself this option does nothing, but it
|
||||
enables more detailed reporting in other options (because the profiler
|
||||
will use the stack data).
|
||||
.ne
|
||||
.RE
|
||||
.PP
|
||||
@@ -1399,16 +1404,6 @@ No generic code sharing will be performed.
|
||||
.Sp
|
||||
Generic code sharing by default only applies to collections. The
|
||||
Mono JIT by default turns this on.
|
||||
.TP
|
||||
\fBMONO_XDEBUG\fR
|
||||
When the the MONO_XDEBUG env var is set, debugging info for JITted
|
||||
code is emitted into a shared library, loadable into gdb. This enables,
|
||||
for example, to see managed frame names on gdb backtraces.
|
||||
.TP
|
||||
\fBMONO_VERBOSE_METHOD\fR
|
||||
Enables the maximum JIT verbosity for the specified method. This is
|
||||
very helpfull to diagnose a miscompilation problems of a specific
|
||||
method.
|
||||
.SH VALGRIND
|
||||
If you want to use Valgrind, you will find the file `mono.supp'
|
||||
useful, it contains the suppressions for the GC which trigger
|
||||
|
||||
@@ -1,51 +1,3 @@
|
||||
2009-02-03 Rodrigo Kumpera <[email protected]>
|
||||
|
||||
* docs/Makefile: Fix install-local and uninstall-local if
|
||||
DISABLE_MCS_DOCS is defined.
|
||||
|
||||
2009-02-02 Rodrigo Kumpera <[email protected]>
|
||||
|
||||
* docs/Makefile: Don't build build-documentation if DISABLE_MCS_DOCS
|
||||
is defined.
|
||||
|
||||
2009-01-31 Rodrigo Kumpera <[email protected]>
|
||||
|
||||
* docs/Makefile: use -f with rm on the clean target so
|
||||
rm doesn't complain about missing files.
|
||||
|
||||
2008-12-10 Atsushi Enomoto <[email protected]>
|
||||
|
||||
* Makefile : remove sys.messaging from CENTUM_TESTS. It has never
|
||||
been supported, and now, it's heavily developed.
|
||||
|
||||
2008-12-08 Jonathan Pryor <[email protected]>
|
||||
|
||||
* docs/monodoc.xml: Rename the "File Formats" node to "Commands and
|
||||
Files", so that ~all man pages can be under the same node.
|
||||
* docs/lang-csharp.source: Since C# is the only current language, move
|
||||
the child nodes "up" a node so we have "Languages/C# Compiler Error
|
||||
Reference" and "Languages/C# Language Specification" nodes.
|
||||
|
||||
2008-12-02 Jonathan Pryor <[email protected]>
|
||||
|
||||
* docs/Makefile: Build additional directories (Npgsql,
|
||||
System.Configuration.Install, System.Design, System.Runtime.Remoting,
|
||||
System.Runtime.Serialization.Formatters.Soap); shorten entries.
|
||||
|
||||
2008-11-26 Atsushi Enomoto <[email protected]>
|
||||
|
||||
* docs/Makefile: remove nunit docs that do not exist (and I don't
|
||||
think such docs for private mono use should be provided).
|
||||
|
||||
2008-11-26 Atsushi Enomoto <[email protected]>
|
||||
|
||||
* Makefile : I happened to remove errors and docs which
|
||||
used to be broken.
|
||||
|
||||
2008-11-25 Atsushi Enomoto <[email protected]>
|
||||
|
||||
* Makefile : replace nunit20 with nunit24.
|
||||
|
||||
2008-11-18 Jonathan Pryor <[email protected]>
|
||||
|
||||
* docs/Makefile: Don't build mono-file-formats.*, mono-tools.*
|
||||
|
||||
+3
-2
@@ -1,11 +1,11 @@
|
||||
thisdir := .
|
||||
|
||||
SUBDIRS := build jay mcs class nunit24 ilasm tools tests errors docs
|
||||
SUBDIRS := build jay mcs class nunit20 ilasm tools tests errors docs
|
||||
|
||||
basic_SUBDIRS := build jay mcs class
|
||||
net_1_1_bootstrap_SUBDIRS := build jay mcs class ilasm tools
|
||||
net_2_0_bootstrap_SUBDIRS := build jay mcs class ilasm tools
|
||||
net_2_0_SUBDIRS := build jay mcs class nunit24 ilasm tools tests errors docs
|
||||
net_2_0_SUBDIRS := build jay mcs class nunit20 ilasm tools tests errors docs
|
||||
net_2_1_bootstrap_SUBDIRS := build mcs class
|
||||
net_2_1_raw_SUBDIRS := build mcs class tools
|
||||
net_2_1_SUBDIRS := tools tests errors
|
||||
@@ -24,6 +24,7 @@ centum_tests := \
|
||||
class/System.Design \
|
||||
class/System.DirectoryServices \
|
||||
class/System.Drawing \
|
||||
class/System.Messaging \
|
||||
class/System.Runtime.Remoting \
|
||||
class/System.Runtime.Serialization.Formatters.Soap \
|
||||
class/System.Security \
|
||||
|
||||
@@ -1,63 +1,3 @@
|
||||
2009-01-08 Geoff Norton <[email protected]>
|
||||
|
||||
* Makefile: Add darwin.make to the make dist target as well
|
||||
|
||||
2009-01-07 Geoff Norton <[email protected]>
|
||||
|
||||
* library.make: Allow platform specific exclude tags from the
|
||||
test harness suite.
|
||||
* darwin.make: Add to the build and add a new NotOnMac test
|
||||
category
|
||||
|
||||
2008-12-30 Ankit Jain <[email protected]>
|
||||
|
||||
* library.make (TEST_HARNESS_OUTPUT*): Fix /labels switch.
|
||||
|
||||
2008-12-12 Raja R Harinath <[email protected]>
|
||||
|
||||
* rules.make (topdir): Don't use $(shell ...).
|
||||
Reported by Jonathan Chambers.
|
||||
|
||||
2008-12-10 Atsushi Enomoto <[email protected]>
|
||||
|
||||
* library.make : enable FIXTURE and TESTNAME on run-test-ondotnet.
|
||||
|
||||
2008-11-28 Atsushi Enomoto <[email protected]>
|
||||
|
||||
* Makefile : ugh, ok another dist pain.
|
||||
|
||||
2008-11-28 Atsushi Enomoto <[email protected]>
|
||||
|
||||
* nunit-summary.xsl : copied from nunit resource (summary.xslt)
|
||||
* library.make : put transformation result from TestResult-*.xml
|
||||
into TestResult-*.log as we used to do.
|
||||
|
||||
2008-11-28 Marek Habersack <[email protected]>
|
||||
|
||||
* library.make (FIXTURE_ARG): /parameter:value syntax is not
|
||||
supported in nunit 2.4
|
||||
(TESTNAME_ARG): added support for the nunit-console -run
|
||||
parameter, so that individual tests can be ran.
|
||||
|
||||
2008-11-26 Atsushi Enomoto <[email protected]>
|
||||
|
||||
* library.make : another nunit20 to kill :(
|
||||
|
||||
2008-11-25 Atsushi Enomoto <[email protected]>
|
||||
|
||||
* library.make : update nunit options that break upgrade to 2.4.
|
||||
|
||||
2008-11-18 Raja R Harinath <[email protected]>
|
||||
|
||||
* library.make (TEST_FILES): Notice filenames with ../ in the test
|
||||
sources file, and handle them in a way suitable for the 'make
|
||||
dist' handling of such files.
|
||||
|
||||
2008-11-12 Zoltan Varga <[email protected]>
|
||||
|
||||
* library.make: AOT the library after compilation if the AOT_IN_PROFILES
|
||||
variable is defined and it contains the current profile.
|
||||
|
||||
2008-10-18 Jonathan Pryor <[email protected]>
|
||||
|
||||
* rules.make (dist-default): Distribute the Documentation directory,
|
||||
|
||||
+1
-2
@@ -14,7 +14,7 @@ common/Consts.cs: common/Consts.cs.in $(wildcard config.make)
|
||||
test -n '$(MONO_VERSION)'
|
||||
sed -e 's,@''MONO_VERSION@,$(MONO_VERSION),' $< > $@
|
||||
|
||||
PLATFORMS = darwin linux win32
|
||||
PLATFORMS = linux win32
|
||||
PROFILES = \
|
||||
basic \
|
||||
net_1_1_bootstrap \
|
||||
@@ -41,7 +41,6 @@ DISTFILES = \
|
||||
corcompare-api.xsl \
|
||||
executable.make \
|
||||
library.make \
|
||||
nunit-summary.xsl \
|
||||
rules.make \
|
||||
$(COMMON_SRCS:%=common/%) \
|
||||
$(PLATFORMS:%=platforms/%.make) $(PROFILES:%=profiles/%.make)
|
||||
|
||||
@@ -1,8 +1,3 @@
|
||||
2008-11-25 Rolf Bjarne Kvinge <[email protected]>
|
||||
|
||||
* Consts.cs.in: Update Silverlight's FxFileVersion to final
|
||||
version number of Silverlight 2.
|
||||
|
||||
2008-08-20 Jb Evain <[email protected]>
|
||||
|
||||
* Consts.cs.in: add NET_3_0 case for wcf.
|
||||
|
||||
@@ -66,7 +66,7 @@ internal
|
||||
// Versions of .NET Framework for SilverLight
|
||||
public const string FxVersion = "2.0.5.0";
|
||||
public const string VsVersion = "9.0.0.0"; // TODO:
|
||||
public const string FxFileVersion = "2.0.31005.0";
|
||||
public const string FxFileVersion = "2.0.30226.2";
|
||||
public const string VsFileVersion = "9.0.50727.42"; // TODO:
|
||||
#elif NET_2_0 || BOOTSTRAP_NET_2_0
|
||||
// Versions of .NET Framework 2.0 RTM
|
||||
|
||||
+15
-26
@@ -49,7 +49,7 @@ the_libdir = $(topdir)/class/$(lib_dir)/$(PROFILE)/
|
||||
the_lib = $(the_libdir)$(LIBRARY_NAME)
|
||||
the_pdb = $(the_lib:.dll=.pdb)
|
||||
the_mdb = $(the_lib).mdb
|
||||
library_CLEAN_FILES += $(makefrag) $(the_lib) $(the_lib).so $(the_pdb) $(the_mdb)
|
||||
library_CLEAN_FILES += $(makefrag) $(the_lib) $(the_pdb) $(the_mdb)
|
||||
|
||||
ifdef LIBRARY_NEEDS_POSTPROCESSING
|
||||
build_libdir = fixup/$(PROFILE)/
|
||||
@@ -174,7 +174,7 @@ ifndef NO_TEST
|
||||
$(test_nunit_dep): $(topdir)/build/deps/nunit-$(PROFILE).stamp
|
||||
@if test -f $@; then :; else rm -f $<; $(MAKE) $<; fi
|
||||
$(topdir)/build/deps/nunit-$(PROFILE).stamp:
|
||||
cd ${topdir}/nunit24 && $(MAKE)
|
||||
cd ${topdir}/nunit20 && $(MAKE)
|
||||
echo "stamp" >$@
|
||||
library_CLEAN_FILES += $(topdir)/build/deps/nunit-$(PROFILE).stamp
|
||||
endif
|
||||
@@ -195,38 +195,34 @@ test-local: $(test_assemblies)
|
||||
run-test-local: run-test-lib
|
||||
run-test-ondotnet-local: run-test-ondotnet-lib
|
||||
|
||||
TEST_HARNESS_EXCLUDES = -exclude=$(PLATFORM_TEST_HARNESS_EXCLUDES)NotWorking,ValueAdd,CAS,InetAccess
|
||||
TEST_HARNESS_EXCLUDES_ONDOTNET = /exclude:$(PLATFORM_TEST_HARNESS_EXCLUDES)NotDotNet,CAS
|
||||
TEST_HARNESS_EXCLUDES = /exclude:NotWorking,ValueAdd,CAS,InetAccess
|
||||
TEST_HARNESS_EXCLUDES_ONDOTNET = /exclude:NotDotNet,CAS
|
||||
|
||||
ifdef TEST_HARNESS_VERBOSE
|
||||
TEST_HARNESS_OUTPUT = -labels
|
||||
TEST_HARNESS_OUTPUT_ONDOTNET = -labels
|
||||
TEST_HARNESS_OUTPUT = /labels
|
||||
TEST_HARNESS_OUTPUT_ONDOTNET = /labels
|
||||
TEST_HARNESS_POSTPROC = :
|
||||
TEST_HARNESS_POSTPROC_ONDOTNET = :
|
||||
else
|
||||
TEST_HARNESS_OUTPUT = -output=TestResult-$(PROFILE).log
|
||||
TEST_HARNESS_OUTPUT_ONDOTNET = -output=TestResult-ondotnet-$(PROFILE).log
|
||||
TEST_HARNESS_POSTPROC = (echo ''; cat TestResult-$(PROFILE).log) | sed '1,/^Tests run: /d'; xsltproc $(topdir)/build/nunit-summary.xsl TestResult-$(PROFILE).xml >> TestResult-$(PROFILE).log
|
||||
TEST_HARNESS_POSTPROC_ONDOTNET = (echo ''; cat TestResult-ondotnet-$(PROFILE).log) | sed '1,/^Tests run: /d'; xsltproc $(topdir)/build/nunit-summary.xsl TestResult-ondotnet-$(PROFILE).xml >> TestResult-ondotnet-$(PROFILE).log
|
||||
TEST_HARNESS_OUTPUT = /output:TestResult-$(PROFILE).log
|
||||
TEST_HARNESS_OUTPUT_ONDOTNET = /output:TestResult-ondotnet-$(PROFILE).log
|
||||
TEST_HARNESS_POSTPROC = (echo ''; cat TestResult-$(PROFILE).log) | sed '1,/^Tests run: /d'
|
||||
TEST_HARNESS_POSTPROC_ONDOTNET = (echo ''; cat TestResult-ondotnet-$(PROFILE).log) | sed '1,/^Tests run: /d'
|
||||
endif
|
||||
|
||||
ifdef FIXTURE
|
||||
FIXTURE_ARG = -fixture=MonoTests.$(FIXTURE)
|
||||
endif
|
||||
|
||||
ifdef TESTNAME
|
||||
TESTNAME_ARG = -run=MonoTests.$(TESTNAME)
|
||||
FIXTURE_ARG = /fixture:MonoTests.$(FIXTURE)
|
||||
endif
|
||||
|
||||
## FIXME: i18n problem in the 'sed' command below
|
||||
run-test-lib: test-local
|
||||
ok=:; \
|
||||
MONO_REGISTRY_PATH="$(HOME)/.mono/registry" $(TEST_RUNTIME) $(RUNTIME_FLAGS) $(TEST_HARNESS) $(test_assemblies) -noshadow $(TEST_HARNESS_FLAGS) $(LOCAL_TEST_HARNESS_FLAGS) $(TEST_HARNESS_EXCLUDES) $(TEST_HARNESS_OUTPUT) -xml=TestResult-$(PROFILE).xml $(FIXTURE_ARG) $(TESTNAME_ARG)|| ok=false; \
|
||||
MONO_REGISTRY_PATH="$(HOME)/.mono/registry" $(TEST_RUNTIME) $(RUNTIME_FLAGS) $(TEST_HARNESS) $(TEST_HARNESS_FLAGS) $(LOCAL_TEST_HARNESS_FLAGS) $(TEST_HARNESS_EXCLUDES) $(TEST_HARNESS_OUTPUT) /xml:TestResult-$(PROFILE).xml $(test_assemblies) $(FIXTURE_ARG) || ok=false; \
|
||||
$(TEST_HARNESS_POSTPROC) ; $$ok
|
||||
|
||||
run-test-ondotnet-lib: test-local
|
||||
ok=:; \
|
||||
$(TEST_HARNESS) $(test_assemblies) -noshadow $(TEST_HARNESS_FLAGS) $(LOCAL_TEST_HARNESS_ONDOTNET_FLAGS) $(TEST_HARNESS_EXCLUDES_ONDOTNET) $(TEST_HARNESS_OUTPUT_ONDOTNET) -xml=TestResult-ondotnet-$(PROFILE).xml $(FIXTURE_ARG) $(TESTNAME_ARG) || ok=false; \
|
||||
$(TEST_HARNESS) $(TEST_HARNESS_FLAGS) $(LOCAL_TEST_HARNESS_ONDOTNET_FLAGS) $(TEST_HARNESS_EXCLUDES_ONDOTNET) $(TEST_HARNESS_OUTPUT_ONDOTNET) /xml:TestResult-ondotnet-$(PROFILE).xml $(test_assemblies) || ok=false; \
|
||||
$(TEST_HARNESS_POSTPROC_ONDOTNET) ; $$ok
|
||||
endif
|
||||
|
||||
@@ -235,11 +231,11 @@ DISTFILES = $(wildcard *$(LIBRARY)*.sources) $(EXTRA_DISTFILES)
|
||||
TEST_FILES =
|
||||
|
||||
ifdef HAVE_CS_TESTS
|
||||
TEST_FILES += `sed -e '/^$$/d' -e 's,^../,,' -et -e 's,^,Test/,' $(test_sourcefile)`
|
||||
TEST_FILES += `sed -e '/^$$/d' -e 's,^,Test/,' $(test_sourcefile)`
|
||||
DISTFILES += $(test_sourcefile)
|
||||
endif
|
||||
ifdef HAVE_VB_TESTS
|
||||
TEST_FILES += `sed -e '/^$$/d' -e 's,^../,,' -et -e 's,^,Test/,' $(btest_sourcefile)`
|
||||
TEST_FILES += `sed -e '/^$$/d' -e 's,^,Test/,' $(btest_sourcefile)`
|
||||
DISTFILES += $(btest_sourcefile)
|
||||
endif
|
||||
|
||||
@@ -297,8 +293,6 @@ BUILT_SOURCES_cmdline = `echo $(BUILT_SOURCES) | $(PLATFORM_CHANGE_SEPARATOR_CMD
|
||||
endif
|
||||
endif
|
||||
|
||||
Q_AOT=$(if $(V),,@echo "AOT [$(PROFILE)] $(notdir $(@))";)
|
||||
|
||||
# The library
|
||||
|
||||
$(the_lib): $(the_libdir)/.stamp
|
||||
@@ -314,11 +308,6 @@ else
|
||||
$(LIBRARY_COMPILE) $(LIBRARY_FLAGS) $(LIB_MCS_FLAGS) -target:library -out:$@ $(BUILT_SOURCES_cmdline) @$(response)
|
||||
$(SN) $(SNFLAGS) $@ $(LIBRARY_SNK)
|
||||
endif
|
||||
ifdef ENABLE_AOT
|
||||
ifneq (,$(filter $(AOT_IN_PROFILES), $(PROFILE)))
|
||||
$(Q_AOT) MONO_PATH=$(the_libdir) $(RUNTIME) --aot=bind-to-runtime-version $@ > $(PROFILE)_aot.log 2>&1
|
||||
endif
|
||||
endif
|
||||
|
||||
$(makefrag): $(sourcefile)
|
||||
@echo Creating $@ ...
|
||||
|
||||
@@ -1,48 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
|
||||
<xsl:output method='text'/>
|
||||
|
||||
<xsl:template match="/">
|
||||
<xsl:apply-templates/>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="test-results">
|
||||
<xsl:text>Tests run: </xsl:text>
|
||||
<xsl:value-of select="@total"/>
|
||||
<xsl:text>, Failures: </xsl:text>
|
||||
<xsl:value-of select="@failures"/>
|
||||
<xsl:text>, Not run: </xsl:text>
|
||||
<xsl:value-of select="@not-run"/>
|
||||
<xsl:text>, Time: </xsl:text>
|
||||
<xsl:value-of select="test-suite/@time"/>
|
||||
<xsl:text> seconds
|
||||
</xsl:text>
|
||||
<xsl:text>
|
||||
</xsl:text>
|
||||
|
||||
<xsl:if test="//test-suite[failure]"><xsl:text>Test Fixture SetUp Failures:
|
||||
</xsl:text></xsl:if>
|
||||
<xsl:apply-templates select="//test-suite[failure]"/>
|
||||
<xsl:if test="//test-case[failure]"><xsl:text>Test Case Failures:
|
||||
</xsl:text></xsl:if>
|
||||
<xsl:apply-templates select="//test-case[failure]"/>
|
||||
<xsl:if test="//test-case[@executed='False']"><xsl:text>Tests not run:
|
||||
</xsl:text></xsl:if>
|
||||
<xsl:apply-templates select="//test-case[@executed='False']"/>
|
||||
<xsl:text disable-output-escaping='yes'>
</xsl:text>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="test-case|test-suite">
|
||||
<xsl:value-of select="position()"/><xsl:text>) </xsl:text>
|
||||
<xsl:value-of select="@name"/>
|
||||
<xsl:text> : </xsl:text>
|
||||
<xsl:value-of select="child::node()/message"/>
|
||||
<xsl:text disable-output-escaping='yes'>
</xsl:text>
|
||||
<xsl:if test="failure">
|
||||
<xsl:value-of select="failure/stack-trace"/>
|
||||
<xsl:text>
|
||||
</xsl:text>
|
||||
</xsl:if>
|
||||
</xsl:template>
|
||||
|
||||
</xsl:stylesheet>
|
||||
@@ -1,38 +0,0 @@
|
||||
# -*- makefile -*-
|
||||
#
|
||||
# Platform-specific makefile rules. This one's for linux.
|
||||
#
|
||||
|
||||
PLATFORM_DEBUG_FLAGS = -debug
|
||||
PLATFORM_MCS_FLAGS = -optimize
|
||||
PLATFORM_RUNTIME = $(RUNTIME)
|
||||
PLATFORM_CORLIB = mscorlib.dll
|
||||
PLATFORM_TEST_HARNESS_EXCLUDES = NotOnMac,
|
||||
|
||||
EXTERNAL_MCS = mcs
|
||||
EXTERNAL_MBAS = mbas
|
||||
EXTERNAL_RUNTIME = mono
|
||||
RESGEN = MONO_PATH="$(topdir)/class/lib/$(PROFILE)$(PLATFORM_PATH_SEPARATOR)$$MONO_PATH" $(INTERNAL_RESGEN)
|
||||
#ILDISASM = monodis
|
||||
ILDISASM = false
|
||||
|
||||
PLATFORM_PATH_SEPARATOR = :
|
||||
|
||||
# Define this if this ever will work on Linux
|
||||
# PLATFORM_MAKE_CORLIB_CMP = yes
|
||||
|
||||
# This is for changing / to \ on windows
|
||||
PLATFORM_CHANGE_SEPARATOR_CMD = cat
|
||||
|
||||
hidden_prefix = .
|
||||
hidden_suffix =
|
||||
|
||||
platform-check:
|
||||
@:
|
||||
# I tried this but apparently Make's version strings aren't that
|
||||
# ... consistent between releases. Whatever.
|
||||
#
|
||||
# @if ! $(MAKE) --version |grep '^GNU Make version 3' 1>/dev/null 2>&1 ; then \
|
||||
# echo "*** You need to build MCS with GNU make. Try \`gmake'" ; \
|
||||
# exit 1 ; \
|
||||
# fi
|
||||
@@ -7,7 +7,6 @@ PLATFORM_DEBUG_FLAGS = -debug
|
||||
PLATFORM_MCS_FLAGS = -optimize
|
||||
PLATFORM_RUNTIME = $(RUNTIME)
|
||||
PLATFORM_CORLIB = mscorlib.dll
|
||||
PLATFORM_TEST_HARNESS_EXCLUDES =
|
||||
|
||||
EXTERNAL_MCS = mcs
|
||||
EXTERNAL_MBAS = mbas
|
||||
|
||||
@@ -7,7 +7,6 @@ PLATFORM_DEBUG_FLAGS = /debug+ /debug:full
|
||||
PLATFORM_MCS_FLAGS = /nologo /optimize
|
||||
PLATFORM_RUNTIME =
|
||||
PLATFORM_CORLIB = mscorlib.dll
|
||||
PLATFORM_TEST_HARNESS_EXCLUDES =
|
||||
|
||||
EXTERNAL_MCS = mcs
|
||||
EXTERNAL_MBAS = vbc.exe
|
||||
|
||||
@@ -7,16 +7,11 @@
|
||||
# If you need to edit this file, that's a bug; email
|
||||
# [email protected] about it.
|
||||
|
||||
empty :=
|
||||
space := $(empty) $(empty)
|
||||
# Some more variables. The leading period in the sed expression prevents
|
||||
# thisdir = . from being changed into '..' for the toplevel directory.
|
||||
|
||||
# given $(thisdir), we compute the path to the top directory
|
||||
#
|
||||
# split_path = $(filter-out .,$(subst /,$(space),$(1)))
|
||||
# make_path = ./$(subst $(space),/,$(1))
|
||||
# dotdottify = $(patsubst %,..,$(1))
|
||||
# topdir = $(call make_path,$(call dotdottify,$(call split_path,$(thisdir))))
|
||||
topdir := ./$(subst $(space),/,$(patsubst %,..,$(filter-out .,$(subst /,$(space),$(thisdir)))))
|
||||
dots := $(shell echo $(thisdir) |sed -e 's,[^./][^/]*,..,g')
|
||||
topdir := $(dots)
|
||||
|
||||
VERSION = 0.93
|
||||
|
||||
|
||||
@@ -1,25 +1,3 @@
|
||||
2009-01-22 Marek Habersack <[email protected]>
|
||||
|
||||
* Makefile (net_2_0_dirs): added System.Web - it now depends on
|
||||
System.Core, so it needs to be recompiled one more time after
|
||||
System.Core is done.
|
||||
|
||||
2008-12-08 Atsushi Enomoto <[email protected]>
|
||||
|
||||
* Makefile : revert previous one and retry before I revert everything.
|
||||
|
||||
2008-12-08 Atsushi Enomoto <[email protected]>
|
||||
|
||||
* Makefile : actually RabbitMQ.Client is under wrong build practice :(
|
||||
|
||||
2008-12-08 Atsushi Enomoto <[email protected]>
|
||||
|
||||
* Makefile : add new sys.messaging implementation.
|
||||
|
||||
2008-11-20 Jb Evain <[email protected]>
|
||||
|
||||
* Makefile: add System.Xml.Linq to the net_2_1 build.
|
||||
|
||||
2008-11-05 Marek Habersack <[email protected]>
|
||||
|
||||
* Makefile (net_2_0_dirs): Npgsql requires .NET 2.0+ now.
|
||||
|
||||
@@ -1,12 +1,3 @@
|
||||
2009-01-20 Atsushi Enomoto <[email protected]>
|
||||
|
||||
* Commons.Xml.Relaxng_test.dll.sources : forgot to add
|
||||
RelaxngDatatypeProviderTests.cs.
|
||||
|
||||
2008-11-11 Atsushi Enomoto <[email protected]>
|
||||
|
||||
* Makefile: what a messy EXTRA_DISTFILES.
|
||||
|
||||
2007-04-18 Atsushi Enomoto <[email protected]>
|
||||
|
||||
* Makefile (EXTRA_DISTFILES) :
|
||||
|
||||
@@ -1,8 +1,3 @@
|
||||
2008-11-11 Atsushi Enomoto <[email protected]>
|
||||
|
||||
* RncParser.jay : handle inherited default namespace as expected.
|
||||
This should fix HTML5 compact syntax grammar.
|
||||
|
||||
2007-12-27 Atsushi Enomoto <[email protected]>
|
||||
|
||||
* RncParser.jay, RncTokenizer.cs : some changes to fill element
|
||||
|
||||
@@ -56,17 +56,12 @@ namespace Commons.Xml.Relaxng.Rnc
|
||||
|
||||
public static RelaxngPattern ParseRnc (TextReader reader, XmlNameTable nameTable, string baseUri)
|
||||
{
|
||||
return ParseRnc (reader, nameTable, baseUri, null);
|
||||
}
|
||||
|
||||
public static RelaxngPattern ParseRnc (TextReader reader, XmlNameTable nameTable, string baseUri, string defaultNamespace)
|
||||
{
|
||||
return new RncParser (nameTable).Parse (reader, baseUri, defaultNamespace);
|
||||
return new RncParser (nameTable).Parse (reader, baseUri);
|
||||
}
|
||||
|
||||
XmlNamespaceManager nsmgr;
|
||||
XmlNamespaceManager dtnsmgr;
|
||||
string defaultNamespace;
|
||||
string defaultNamespace = String.Empty;
|
||||
static int yacc_verbose_flag;
|
||||
|
||||
RncTokenizer tokenizer;
|
||||
@@ -94,6 +89,9 @@ namespace Commons.Xml.Relaxng.Rnc
|
||||
}
|
||||
|
||||
// note that this is different notion than that of xmlns.
|
||||
public string DefaultNamespace {
|
||||
get { return defaultNamespace; }
|
||||
}
|
||||
|
||||
public RelaxngPattern Parse (TextReader source)
|
||||
{
|
||||
@@ -102,14 +100,6 @@ namespace Commons.Xml.Relaxng.Rnc
|
||||
|
||||
public RelaxngPattern Parse (TextReader source, string baseUri)
|
||||
{
|
||||
return Parse (source, baseUri, null);
|
||||
}
|
||||
|
||||
public RelaxngPattern Parse (TextReader source, string baseUri, string defaultNamespace)
|
||||
{
|
||||
this.defaultNamespace = defaultNamespace;
|
||||
if (defaultNamespace != null && defaultNamespace.Length != 0)
|
||||
nsmgr.AddNamespace (String.Empty, defaultNamespace);
|
||||
try {
|
||||
if (Environment.GetEnvironmentVariable ("MONO_RELAXNG_COMPACT_DEBUG") == "yes")
|
||||
debug = new yydebug.yyDebugSimple ();
|
||||
@@ -161,7 +151,7 @@ namespace Commons.Xml.Relaxng.Rnc
|
||||
RelaxngName name = nc as RelaxngName;
|
||||
if (name != null) {
|
||||
if (name.Namespace == null)
|
||||
name.Namespace = defaultNamespace;
|
||||
name.Namespace = this.DefaultNamespace;
|
||||
return;
|
||||
}
|
||||
RelaxngNameChoice choice = nc as RelaxngNameChoice;
|
||||
@@ -282,7 +272,6 @@ Decl /* returns null */
|
||||
// TODO: constraints
|
||||
string ns = (string) $4;
|
||||
defaultNamespace = ns;
|
||||
nsmgr.AddNamespace (String.Empty, ns);
|
||||
$$ = null;
|
||||
}
|
||||
| KeywordDefault KeywordNamespace NamespacePrefix Equal NamespaceURILiteral
|
||||
@@ -291,7 +280,6 @@ Decl /* returns null */
|
||||
string prefix = (string) $3;
|
||||
string ns = (string) $5;
|
||||
defaultNamespace = ns;
|
||||
nsmgr.AddNamespace (String.Empty, ns);
|
||||
nsmgr.AddNamespace (prefix, ns);
|
||||
$$ = null;
|
||||
}
|
||||
@@ -326,7 +314,7 @@ NamespaceURILiteral /* returns string */
|
||||
}
|
||||
| KeywordInherit
|
||||
{
|
||||
$$ = defaultNamespace;
|
||||
$$ = (string) $1;
|
||||
}
|
||||
;
|
||||
|
||||
@@ -344,8 +332,8 @@ TopLevelBody /* returns RelaxngPattern */
|
||||
{
|
||||
RelaxngGrammar g = new RelaxngGrammar ();
|
||||
FillLocation (g);
|
||||
if (defaultNamespace != null)
|
||||
g.DefaultNamespace = defaultNamespace;
|
||||
if (nsmgr.DefaultNamespace != String.Empty)
|
||||
g.DefaultNamespace = nsmgr.DefaultNamespace;
|
||||
RelaxngGrammarContentList list = (RelaxngGrammarContentList) $1;
|
||||
FillGrammarContent (list, g.Starts, g.Defines, g.Divs, g.Includes);
|
||||
$$ = g;
|
||||
@@ -464,11 +452,11 @@ AnyURILiteral /* returns string */
|
||||
;
|
||||
|
||||
OptInherit /* returns string */
|
||||
/* The empty value will be handled at Compile() time. */
|
||||
/* FIXME: It is not handled properly. */
|
||||
: /* empty */
|
||||
{
|
||||
// MakeNsAttribute (LookupDefault (environment));
|
||||
$$ = defaultNamespace;
|
||||
$$ = nsmgr.DefaultNamespace;
|
||||
}
|
||||
| KeywordInherit Equal IdentifierOrKeyword
|
||||
{
|
||||
|
||||
@@ -1,23 +1,3 @@
|
||||
2009-02-17 Atsushi Enomoto <[email protected]>
|
||||
|
||||
* XsdDatatypeProvider.cs : workaround .NET/Mono Regex bug that
|
||||
does not handle \p{Latin-1Supplement} to work with OOXML grammar.
|
||||
|
||||
2009-01-20 Atsushi Enomoto <[email protected]>
|
||||
|
||||
* RelaxngReader.cs : fixed wrong text skip and ns/datatypeLibrary
|
||||
stack pop. Fixed bug #463267.
|
||||
|
||||
2009-01-20 Atsushi Enomoto <[email protected]>
|
||||
|
||||
* RelaxngGrammar.cs : fix confused use of datatype provider property.
|
||||
Fixed bug #463264. Based on the patch by Mark Junker.
|
||||
|
||||
2008-11-11 Atsushi Enomoto <[email protected]>
|
||||
|
||||
* RelaxngPattern.cs : handle inherited default namespace in compact
|
||||
syntax as expected.
|
||||
|
||||
2008-08-25 Atsushi Enomoto <[email protected]>
|
||||
|
||||
* RelaxngPattern.cs : unlike "include" element, "external" element
|
||||
|
||||
@@ -56,6 +56,8 @@ namespace Commons.Xml.Relaxng
|
||||
RelaxngGrammarContentList includes = new RelaxngGrammarContentList ();
|
||||
RelaxngGrammarContentList divs = new RelaxngGrammarContentList ();
|
||||
|
||||
RelaxngDatatypeProvider provider;
|
||||
|
||||
// compiled fields.
|
||||
RdpPattern startPattern;
|
||||
|
||||
@@ -112,8 +114,8 @@ namespace Commons.Xml.Relaxng
|
||||
}
|
||||
|
||||
internal RelaxngDatatypeProvider Provider {
|
||||
get { return (base.DataProvider == null) ? (parentGrammar != null ? parentGrammar.Provider : base.DataProvider) : base.DataProvider; }
|
||||
set { base.DataProvider = value; }
|
||||
get { return parentGrammar != null ? parentGrammar.Provider : provider; }
|
||||
set { provider = value; }
|
||||
}
|
||||
|
||||
public override RelaxngPatternType PatternType {
|
||||
|
||||
@@ -83,7 +83,7 @@ namespace Commons.Xml.Relaxng
|
||||
RelaxngGrammar g = null;
|
||||
try {
|
||||
if (grammar.IsSourceCompactSyntax) {
|
||||
return RncParser.ParseRnc (new StreamReader ((Stream) grammar.Resolver.GetEntity (uri, null, typeof (Stream))), null, BaseUri, nsContext);
|
||||
return RncParser.ParseRnc (new StreamReader ((Stream) grammar.Resolver.GetEntity (uri, null, typeof (Stream))), null, BaseUri);
|
||||
} else {
|
||||
xtr = new XmlTextReader (uri.AbsoluteUri, (Stream) grammar.Resolver.GetEntity (uri, null, typeof (Stream)));
|
||||
RelaxngReader r = new RelaxngReader (xtr, nsContext, grammar.Resolver);
|
||||
@@ -343,16 +343,15 @@ namespace Commons.Xml.Relaxng
|
||||
if (BaseUri != null && BaseUri != String.Empty)
|
||||
baseUri = new Uri (BaseUri);
|
||||
} catch (UriFormatException) {
|
||||
if (File.Exists (BaseUri))
|
||||
if (Path.IsPathRooted (BaseUri))
|
||||
baseUri = new Uri (Path.GetFullPath (BaseUri));
|
||||
}
|
||||
Uri uri = grammar.Resolver.ResolveUri (baseUri, Href);
|
||||
|
||||
RelaxngGrammar g = ReadExternalResource (grammar, uri, (ns != null && ns.Length != 0) || !grammar.IsSourceCompactSyntax ? ns : grammar.DefaultNamespace) as RelaxngGrammar;
|
||||
RelaxngGrammar g = ReadExternalResource (grammar, uri, ns) as RelaxngGrammar;
|
||||
if (g == null)
|
||||
throw new RelaxngException (this, "Included syntax must start with \"grammar\" element.");
|
||||
g.DataProvider = grammar.Provider;
|
||||
g.IsSourceCompactSyntax = grammar.IsSourceCompactSyntax;
|
||||
|
||||
// process recursive inclusions.
|
||||
foreach (RelaxngInclude inc in g.Includes)
|
||||
|
||||
@@ -60,7 +60,6 @@ namespace Commons.Xml.Relaxng
|
||||
Stack nsStack = new Stack ();
|
||||
Stack datatypeLibraryStack = new Stack ();
|
||||
XmlResolver resolver;
|
||||
bool skipExternal = true;
|
||||
// ArrayList annotationNamespaces = new ArrayList ();
|
||||
|
||||
// ctor
|
||||
@@ -121,14 +120,13 @@ namespace Commons.Xml.Relaxng
|
||||
bool skipRead = false;
|
||||
bool b = false;
|
||||
bool loop = true;
|
||||
MoveToElement ();
|
||||
if (IsEmptyElement || NodeType == XmlNodeType.EndElement) { // this should be done here
|
||||
if (IsEmptyElement) { // this should be done here
|
||||
nsStack.Pop ();
|
||||
datatypeLibraryStack.Pop ();
|
||||
}
|
||||
do {
|
||||
if (!skipRead)
|
||||
b = Reader.Read ();
|
||||
Reader.Read ();
|
||||
else
|
||||
skipRead = false;
|
||||
switch (NodeType) {
|
||||
@@ -145,10 +143,7 @@ namespace Commons.Xml.Relaxng
|
||||
else
|
||||
loop = false;
|
||||
break;
|
||||
case XmlNodeType.Element:
|
||||
case XmlNodeType.EndElement:
|
||||
if (!skipExternal)
|
||||
goto default;
|
||||
default:
|
||||
if (NamespaceURI != RelaxngGrammar.NamespaceURI) {
|
||||
Reader.Skip ();
|
||||
skipRead = true;
|
||||
@@ -156,9 +151,6 @@ namespace Commons.Xml.Relaxng
|
||||
else
|
||||
loop = false;
|
||||
break;
|
||||
default:
|
||||
loop = false;
|
||||
break;
|
||||
}
|
||||
} while (!Reader.EOF && loop);
|
||||
|
||||
@@ -189,6 +181,11 @@ namespace Commons.Xml.Relaxng
|
||||
else
|
||||
datatypeLibraryStack.Push (DatatypeLibrary);
|
||||
break;
|
||||
|
||||
case XmlNodeType.EndElement:
|
||||
nsStack.Pop ();
|
||||
datatypeLibraryStack.Pop ();
|
||||
break;
|
||||
}
|
||||
|
||||
return b;
|
||||
@@ -960,13 +957,5 @@ namespace Commons.Xml.Relaxng
|
||||
FillLocation (na);
|
||||
return na;
|
||||
}
|
||||
|
||||
public override string ReadString ()
|
||||
{
|
||||
skipExternal = false;
|
||||
string s = base.ReadString ();
|
||||
skipExternal = true;
|
||||
return s;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -138,7 +138,6 @@ namespace Commons.Xml.Relaxng.XmlSchema
|
||||
r.BaseTypeName = new XmlQualifiedName (primitive.Name, ns);
|
||||
foreach (RelaxngParam p in parameters) {
|
||||
XmlSchemaFacet f = null;
|
||||
string value = p.Value;
|
||||
switch (p.Name) {
|
||||
case "maxExclusive":
|
||||
f = new XmlSchemaMaxExclusiveFacet ();
|
||||
@@ -154,9 +153,6 @@ namespace Commons.Xml.Relaxng.XmlSchema
|
||||
break;
|
||||
case "pattern":
|
||||
f = new XmlSchemaPatternFacet ();
|
||||
// .NET/Mono Regex has a bug that it does not support "IsLatin-1Supplement"
|
||||
// (it somehow breaks at '-').
|
||||
value = value.Replace ("\\p{IsLatin-1Supplement}", "[\\x80-\\xFF]");
|
||||
break;
|
||||
case "whiteSpace":
|
||||
f = new XmlSchemaWhiteSpaceFacet ();
|
||||
@@ -179,7 +175,7 @@ namespace Commons.Xml.Relaxng.XmlSchema
|
||||
default:
|
||||
throw new RelaxngException (String.Format ("XML Schema facet {0} is not recognized or not supported.", p.Name));
|
||||
}
|
||||
f.Value = value;
|
||||
f.Value = p.Value;
|
||||
r.Facets.Add (f);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
RdpPatternTests.cs
|
||||
RelaxngDatatypeProviderTests.cs
|
||||
RelaxngReaderTests.cs
|
||||
RelaxngValidatingReaderTests.cs
|
||||
XsdDatatypeTests.cs
|
||||
|
||||
@@ -1,8 +1,3 @@
|
||||
2009-01-20 Atsushi Enomoto <[email protected]>
|
||||
|
||||
* XmlDefaultReader.cs : remove bogus overrides that blocks normal
|
||||
Read(). It was a design flaw in .NET.
|
||||
|
||||
2004-06-25 Atsushi Enomoto <[email protected]>
|
||||
|
||||
* XmlDefaultReader.cs : Added novell's license (avoid confusion).
|
||||
|
||||
@@ -211,7 +211,6 @@ namespace Commons.Xml
|
||||
return Reader.Read ();
|
||||
}
|
||||
|
||||
/*
|
||||
public override string ReadString ()
|
||||
{
|
||||
return reader.ReadString ();
|
||||
@@ -226,7 +225,6 @@ namespace Commons.Xml
|
||||
{
|
||||
return reader.ReadOuterXml ();
|
||||
}
|
||||
*/
|
||||
|
||||
public override string LookupNamespace (string prefix)
|
||||
{
|
||||
|
||||
@@ -14,10 +14,18 @@ EXTRA_DISTFILES = \
|
||||
Commons.Xml.Relaxng.Rnc/RncParser.jay \
|
||||
Test/ChangeLog \
|
||||
Test/XmlFiles/ChangeLog \
|
||||
$(wildcard Test/XmlFiles/*.rng) \
|
||||
$(wildcard Test/XmlFiles/*.rnc) \
|
||||
$(wildcard Test/XmlFiles/*.nvdl) \
|
||||
$(wildcard Test/XmlFiles/*.xml) \
|
||||
Test/XmlFiles/SimpleElementPattern1.xml \
|
||||
Test/XmlFiles/SimpleElementPattern1.rng \
|
||||
Test/XmlFiles/SimpleElementPattern2.xml \
|
||||
Test/XmlFiles/SimpleElementPattern2.rng \
|
||||
Test/XmlFiles/team.xml \
|
||||
Test/XmlFiles/team.rng \
|
||||
Test/XmlFiles/relaxng.rng \
|
||||
Test/XmlFiles/relaxng.rnc \
|
||||
Test/XmlFiles/atom.rnc \
|
||||
Test/XmlFiles/schemas-xmlsoap-or-ws-2005-05-identity.rnc \
|
||||
Test/XmlFiles/nvdl.nvdl \
|
||||
Test/XmlFiles/nvdl.rng \
|
||||
$(wildcard Test/standalone_tests/*.cs) \
|
||||
$(RESOURCE_FILES)
|
||||
|
||||
|
||||
@@ -1,17 +1,3 @@
|
||||
2009-01-20 Atsushi Enomoto <[email protected]>
|
||||
|
||||
* RelaxngDatatypeProviderTests.cs : new test, based on bug #463267
|
||||
by Mark Junker.
|
||||
|
||||
2009-01-20 Atsushi Enomoto <[email protected]>
|
||||
|
||||
* RelaxngDatatypeProviderTests.cs : new test, based on bug #463264
|
||||
by Mark Junker.
|
||||
|
||||
2008-11-11 Atsushi Enomoto <[email protected]>
|
||||
|
||||
* RncTests.cs : added InheritDefaultNamespace().
|
||||
|
||||
2007-12-14 Atsushi Enomoto <[email protected]>
|
||||
|
||||
* RelaxngReaderTests.cs : added test for bug #347945.
|
||||
|
||||
@@ -1,98 +0,0 @@
|
||||
//
|
||||
// RelaxngDatatypeProviderTest.cs
|
||||
//
|
||||
// Authors:
|
||||
// Atsushi Enomoto <[email protected]>
|
||||
//
|
||||
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Xml;
|
||||
using Commons.Xml.Relaxng;
|
||||
using Commons.Xml.Relaxng.XmlSchema;
|
||||
using NUnit.Framework;
|
||||
|
||||
namespace MonoTests.Commons.Xml.Relaxng
|
||||
{
|
||||
[TestFixture]
|
||||
public class RelaxngDatatypeProviderTests
|
||||
{
|
||||
[Test]
|
||||
public void CustomTypeProvider ()
|
||||
{
|
||||
var datatypeLibrary = SetupMyDataProvider ();
|
||||
XmlDocument xml = new XmlDocument ();
|
||||
xml.LoadXml ("<root> <v1>mytype</v1> <v2>1</v2> </root>");
|
||||
XmlDocument schemaXml = ReadDoc ("Test/XmlFiles/463264.rng");
|
||||
XmlReader reader = new RelaxngValidatingReader (new XmlNodeReader (xml), new XmlNodeReader (schemaXml), datatypeLibrary);
|
||||
while (reader.Read ())
|
||||
;
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void Bug463267 ()
|
||||
{
|
||||
var datatypeLibrary = SetupMyDataProvider ();
|
||||
XmlDocument xml = new XmlDocument ();
|
||||
xml.LoadXml ("<root> <v2>1</v2> <v1>mytype</v1> </root>");
|
||||
XmlDocument schemaXml = ReadDoc ("Test/XmlFiles/463267.rng");
|
||||
XmlReader reader = new RelaxngValidatingReader (new XmlNodeReader (xml), new XmlNodeReader (schemaXml), datatypeLibrary);
|
||||
while (reader.Read ())
|
||||
;
|
||||
}
|
||||
|
||||
RelaxngDatatypeProvider SetupMyDataProvider ()
|
||||
{
|
||||
var datatypeLibrary = new RelaxngMergedProvider ();
|
||||
|
||||
datatypeLibrary [MyRngTypeProvider.Namespace] = new MyRngTypeProvider();
|
||||
datatypeLibrary ["http://www.w3.org/2001/XMLSchema-datatypes"] = XsdDatatypeProvider.Instance;
|
||||
datatypeLibrary [System.Xml.Schema.XmlSchema.Namespace] = XsdDatatypeProvider.Instance;
|
||||
datatypeLibrary [String.Empty] = RelaxngMergedProvider.DefaultProvider [string.Empty];
|
||||
return datatypeLibrary;
|
||||
}
|
||||
|
||||
XmlDocument ReadDoc (string s)
|
||||
{
|
||||
var d = new XmlDocument ();
|
||||
d.Load (s);
|
||||
return d;
|
||||
}
|
||||
}
|
||||
|
||||
class MyRngTypeProvider : RelaxngDatatypeProvider
|
||||
{
|
||||
public static readonly string Namespace = "http://tempuri.org/mytypes";
|
||||
|
||||
public override RelaxngDatatype GetDatatype(string name, string ns, RelaxngParamList parameters)
|
||||
{
|
||||
switch (name)
|
||||
{
|
||||
case "mytype":
|
||||
return new MyType();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
class MyType : RelaxngDatatype
|
||||
{
|
||||
public override string Name {
|
||||
get { return "mytype"; }
|
||||
}
|
||||
|
||||
public override string NamespaceURI {
|
||||
get { return MyRngTypeProvider.Namespace; }
|
||||
}
|
||||
|
||||
public override object Parse (string text, System.Xml.XmlReader reader)
|
||||
{
|
||||
return text;
|
||||
}
|
||||
|
||||
public override bool IsValid (string text, System.Xml.XmlReader reader)
|
||||
{
|
||||
return ((string) Parse (text, reader)) == "mytype";
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -20,24 +20,18 @@ namespace MonoTests.Commons.Xml.Relaxng
|
||||
[TestFixture]
|
||||
public class RncTests
|
||||
{
|
||||
RelaxngPattern Compile (string file)
|
||||
void Compile (string file)
|
||||
{
|
||||
using (StreamReader sr = new StreamReader (file)) {
|
||||
return Compile (sr, file);
|
||||
Compile (sr);
|
||||
}
|
||||
}
|
||||
|
||||
RelaxngPattern Compile (TextReader reader)
|
||||
{
|
||||
return Compile (reader, null);
|
||||
}
|
||||
|
||||
RelaxngPattern Compile (TextReader reader, string baseUri)
|
||||
void Compile (TextReader reader)
|
||||
{
|
||||
RncParser parser = new RncParser (new NameTable ());
|
||||
RelaxngPattern g = parser.Parse (reader, baseUri);
|
||||
RelaxngPattern g = parser.Parse (reader);
|
||||
g.Compile ();
|
||||
return g;
|
||||
}
|
||||
|
||||
[Test]
|
||||
@@ -81,19 +75,5 @@ start = mine";
|
||||
{
|
||||
Compile (new StringReader ("element foo { \"\\x{10FFFF}\" }"));
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void InheritDefaultNamespace ()
|
||||
{
|
||||
RelaxngPattern g = Compile ("Test/XmlFiles/include-default-namespace.rnc");
|
||||
XmlReader xtr = new XmlTextReader ("Test/XmlFiles/include-default-namespace.xml");
|
||||
RelaxngValidatingReader r = new RelaxngValidatingReader (xtr, g);
|
||||
try {
|
||||
while (!r.EOF)
|
||||
r.Read ();
|
||||
} finally {
|
||||
r.Close ();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,14 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<grammar xmlns="http://relaxng.org/ns/structure/1.0" datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes">
|
||||
<start>
|
||||
<element name="root">
|
||||
<element name="v1">
|
||||
<data type="mytype" datatypeLibrary="http://tempuri.org/mytypes" />
|
||||
</element>
|
||||
<element name="v2">
|
||||
<data type="int" />
|
||||
</element>
|
||||
</element>
|
||||
</start>
|
||||
</grammar>
|
||||
|
||||
@@ -1,16 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<grammar xmlns="http://relaxng.org/ns/structure/1.0" datatypeLibrary="http://tempuri.org/mytypes">
|
||||
<start>
|
||||
<element name="root">
|
||||
<element name="v2">
|
||||
<data type="int" datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes">
|
||||
<param name="minExclusive">0</param>
|
||||
<param name="maxExclusive">10</param>
|
||||
</data>
|
||||
</element>
|
||||
<element name="v1">
|
||||
<data type="mytype" />
|
||||
</element>
|
||||
</element>
|
||||
</start>
|
||||
</grammar>
|
||||
@@ -1,17 +1,3 @@
|
||||
2009-01-20 Atsushi Enomoto <[email protected]>
|
||||
|
||||
* 463267.rng : new test file.
|
||||
|
||||
2009-01-20 Atsushi Enomoto <[email protected]>
|
||||
|
||||
* 463264.rng : new test file.
|
||||
|
||||
2008-11-11 Atsushi Enomoto <[email protected]>
|
||||
|
||||
* include-default-namespace.rnc,
|
||||
include-default-namespace-included.rnc,
|
||||
include-default-namespace.xml : new test files.
|
||||
|
||||
2007-04-18 Atsushi Enomoto <[email protected]>
|
||||
|
||||
* schemas-xmlsoap-or-ws-2005-05-identity.rnc : new test schema.
|
||||
|
||||
@@ -1,5 +0,0 @@
|
||||
grammar {
|
||||
start = root
|
||||
root = element root { empty }
|
||||
}
|
||||
|
||||
@@ -1,4 +0,0 @@
|
||||
default namespace = "urn:foo"
|
||||
|
||||
include "include-default-namespace-included.rnc"
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
<root xmlns="urn:foo" />
|
||||
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0"?>
|
||||
<!-- RELAX NG for RELAX NG -->
|
||||
<!-- $Id$ -->
|
||||
<!-- $Id: relaxng.rng,v 1.1 2004/03/17 19:27:34 atsushi Exp $ -->
|
||||
<grammar datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes"
|
||||
ns="http://relaxng.org/ns/structure/1.0"
|
||||
xmlns="http://relaxng.org/ns/structure/1.0">
|
||||
|
||||
@@ -77,10 +77,7 @@ common_dirs := \
|
||||
Novell.Directory.Ldap \
|
||||
Mono.Security.Win32 \
|
||||
System.DirectoryServices \
|
||||
RabbitMQ.Client \
|
||||
Mono.Messaging \
|
||||
System.Messaging \
|
||||
Mono.Messaging.RabbitMQ \
|
||||
System.ServiceProcess \
|
||||
System.Drawing.Design \
|
||||
System.Design \
|
||||
@@ -106,7 +103,6 @@ net_2_0_dirs := \
|
||||
System.Xml.Linq \
|
||||
System.Data.DataSetExtensions \
|
||||
System.Data.Linq \
|
||||
System.Web \
|
||||
System.Web.Abstractions \
|
||||
System.Web.Routing \
|
||||
System.Web.Extensions_1.0 \
|
||||
@@ -131,7 +127,6 @@ net_2_1_dirs := \
|
||||
System.Net \
|
||||
System.XML \
|
||||
System.Core \
|
||||
System.Xml.Linq \
|
||||
System.Runtime.Serialization \
|
||||
System.ServiceModel \
|
||||
System.ServiceModel.Web
|
||||
|
||||
@@ -1,16 +1,3 @@
|
||||
2009-01-16 Carlos Alberto Cortez <[email protected]>
|
||||
|
||||
* System.Windows.Forms_test.dll.sources: Add ClipboardTest.cs.
|
||||
|
||||
2008-11-27 Atsushi Enomoto <[email protected]>
|
||||
|
||||
* Makefile: here is another nunit24 option breakage.
|
||||
|
||||
2008-11-11 Andrés G. Aragoneses <[email protected]>
|
||||
|
||||
* Application.cs: After UIA assembly is successfully loaded,
|
||||
dump any exception that happens on initialization to stderr.
|
||||
|
||||
2008-11-08 Andreia Gaita <[email protected]>
|
||||
|
||||
* SWF2k5-tests.csproj: Fix the previous ChangeLog entry (bad merge). Update
|
||||
@@ -35,7 +22,7 @@
|
||||
|
||||
* System.Windows.Forms.dll.resources: Removed unused dialog-*.png images.
|
||||
|
||||
2008-09-18 Mike Gorse <<[email protected]>
|
||||
2008-09-18 Mike Gorse <[email protected]>
|
||||
|
||||
* System.Windows.Forms.dll.sources: Added IKeyFilter.cs.
|
||||
|
||||
@@ -858,7 +845,7 @@
|
||||
* resources/, System.Windows.Forms.dll.resources, Makefile:
|
||||
Add user-home Tango icon in various sizes.
|
||||
|
||||
2006-09-05 KornAcl PA!l <[email protected]>
|
||||
2006-09-05 Kornél Pál <[email protected]>
|
||||
|
||||
* Makefile: Removed CODEPAGE as now UTF-8 is the default.
|
||||
|
||||
@@ -1021,7 +1008,7 @@
|
||||
|
||||
* System.Windows.Forms_test.dll.sources: Added System.Resources/CultureTest.cs
|
||||
|
||||
2005-11-12 Pedro MartA-nez JuliA! <[email protected]>
|
||||
2005-11-12 Pedro MartÃnez Juliá <[email protected]>
|
||||
|
||||
* System.Windows.Forms_test.dll.sources: Added DataGridViewElementTest.cs
|
||||
DataGridViewBandTest.cs DataGridViewCellTest.cs
|
||||
@@ -1069,7 +1056,7 @@
|
||||
|
||||
* System.Windows.Forms_test.dll.sources : Added Common.cs
|
||||
|
||||
2005-09-27 KornAcl PA!l <[email protected]>
|
||||
2005-09-27 Kornél Pál <[email protected]>
|
||||
|
||||
* Makefile: Replaced /codepage with CODEPAGE.
|
||||
|
||||
|
||||
@@ -106,12 +106,18 @@ TEST_MCS_FLAGS = /r:System.Data.dll /r:System.Drawing.dll \
|
||||
-resource:Test/resources/32x32.ico,32x32.ico \
|
||||
-nowarn:618,612
|
||||
|
||||
SWF.csproj: System.Windows.Forms.dll.sources System.Windows.Forms.dll.resources build-csproj
|
||||
./build-csproj
|
||||
|
||||
SWF2k5.csproj: System.Windows.Forms.dll.sources System.Windows.Forms.dll.resources build-csproj2k5
|
||||
./build-csproj2k5
|
||||
|
||||
include ../../build/library.make
|
||||
|
||||
TEST_HARNESS_EXCLUDES = -exclude=Interactive,NotWorking,ValueAdd,CAS,InetAccess
|
||||
TEST_HARNESS_EXCLUDES_ONDOTNET = -exclude=Interactive,NotDotNet,CAS
|
||||
TEST_HARNESS_EXCLUDES = /exclude:Interactive,NotWorking,ValueAdd,CAS,InetAccess
|
||||
TEST_HARNESS_EXCLUDES_ONDOTNET = /exclude:Interactive,NotDotNet,CAS
|
||||
|
||||
$(the_lib): $(RESOURCES)
|
||||
$(the_lib): $(RESOURCES) SWF.csproj SWF2k5.csproj
|
||||
|
||||
$(RESX_RESOURCES): %.resources: %.resx
|
||||
$(RESGEN) $< || cp $@.prebuilt $@
|
||||
|
||||
@@ -1,8 +1,3 @@
|
||||
2009-01-07 Geoff Norton <[email protected]>
|
||||
|
||||
* WindowHandler.cs: Don't attempt to activate a disposed Form.
|
||||
Fixes several of the nunit winforms crashes on Mac.
|
||||
|
||||
2008-08-14 Geoff Norton <[email protected]>
|
||||
|
||||
* WindowHandler.cs: Revert the change which didn't set ActiveWindow
|
||||
|
||||
+1
-1
@@ -119,7 +119,7 @@ namespace System.Windows.Forms.CarbonInternal {
|
||||
Control c = Control.FromHandle (hwnd.client_window);
|
||||
if (c != null) {
|
||||
Form form = c.FindForm ();
|
||||
if (form != null && !form.IsDisposed) {
|
||||
if (form != null) {
|
||||
Driver.SendMessage (form.Handle, Msg.WM_ACTIVATE, (IntPtr) WindowActiveFlags.WA_ACTIVE, IntPtr.Zero);
|
||||
XplatUICarbon.ActiveWindow = hwnd.client_window;
|
||||
}
|
||||
|
||||
@@ -1,9 +1,3 @@
|
||||
2009-02-04 Jonathan Pobst <[email protected]>
|
||||
|
||||
* FlowLayout.cs: When laying out ToolStripItems, they should be
|
||||
the height of the ToolStrip, not their preferred height.
|
||||
[Fixes bug #469196]
|
||||
|
||||
2008-11-07 Jonathan Pobst <[email protected]>
|
||||
|
||||
* DefaultLayout.cs: Apply patch from Jonathan Anderson that keeps
|
||||
|
||||
@@ -358,13 +358,9 @@ namespace System.Windows.Forms.Layout
|
||||
// Only apply layout to visible controls.
|
||||
if (!c.Available) { continue; }
|
||||
|
||||
// Resize any AutoSize controls to their preferred width
|
||||
// (the height should fill the ToolStrip)
|
||||
if (c.AutoSize == true) {
|
||||
Size preferred_size = c.GetPreferredSize (c.Size);
|
||||
preferred_size.Height = parentDisplayRectangle.Height;
|
||||
c.SetBounds (new Rectangle (c.Location, preferred_size));
|
||||
}
|
||||
// Resize any AutoSize controls to their preferred size
|
||||
if (c.AutoSize == true)
|
||||
c.SetBounds (new Rectangle (c.Location, c.GetPreferredSize (c.Size)));
|
||||
|
||||
switch (settings.FlowDirection) {
|
||||
case FlowDirection.BottomUp:
|
||||
|
||||
@@ -1,9 +1,3 @@
|
||||
2008-12-30 Jonathan Pobst <[email protected]>
|
||||
|
||||
* IVisualStyle.cs, VisualStylesGtkPlus.cs, VisualStylesNative.cs:
|
||||
Add way to get style filename.
|
||||
[Fixes bug #462766]
|
||||
|
||||
2008-09-16 Jonathan Pobst <[email protected]>
|
||||
|
||||
* VisualStyleElement.cs: Fixed Header.Item.Normal value.
|
||||
|
||||
@@ -71,7 +71,6 @@ namespace System.Windows.Forms.VisualStyles
|
||||
string VisualStyleInformationCopyright { get; }
|
||||
string VisualStyleInformationDescription { get; }
|
||||
string VisualStyleInformationDisplayName { get; }
|
||||
string VisualStyleInformationFileName { get; }
|
||||
bool VisualStyleInformationIsSupportedByOS { get; }
|
||||
int VisualStyleInformationMinimumColorDepth { get; }
|
||||
string VisualStyleInformationSize { get; }
|
||||
|
||||
+1
-7
@@ -1128,13 +1128,7 @@ namespace System.Windows.Forms.VisualStyles
|
||||
return null;
|
||||
}
|
||||
}
|
||||
public string VisualStyleInformationFileName {
|
||||
get {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
public bool VisualStyleInformationIsSupportedByOS
|
||||
{
|
||||
public bool VisualStyleInformationIsSupportedByOS {
|
||||
get {
|
||||
return true;
|
||||
}
|
||||
|
||||
-10
@@ -343,16 +343,6 @@ namespace System.Windows.Forms.VisualStyles
|
||||
return GetData ("DISPLAYNAME");
|
||||
}
|
||||
}
|
||||
public string VisualStyleInformationFileName {
|
||||
get {
|
||||
Text.StringBuilder ThemeName = new Text.StringBuilder (260);
|
||||
Text.StringBuilder ColorName = new Text.StringBuilder (260);
|
||||
Text.StringBuilder SizeName = new Text.StringBuilder (260);
|
||||
UXTheme.GetCurrentThemeName (ThemeName, ThemeName.Capacity, ColorName, ColorName.Capacity, SizeName, SizeName.Capacity);
|
||||
|
||||
return ThemeName.ToString ();
|
||||
}
|
||||
}
|
||||
static string GetData (string propertyName)
|
||||
{
|
||||
Text.StringBuilder ThemeName = new Text.StringBuilder (260);
|
||||
|
||||
Loaded 100 of 3589 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user