Compare commits

..
1 Commits
Author SHA1 Message Date
Wade Berrier d0f800d5aa configure.in: version bump to 1.2
svn path=/branches/mono-1-2/mono/; revision=67284
2006-11-02 17:41:22 +00:00
23897 changed files with 445739 additions and 3827394 deletions

No files matched your search

-1301
View File
File diff suppressed because it is too large. Load diff
+6 -21
View File
@@ -22,7 +22,7 @@ For comments, corrections and updates, please contact [email protected]
Contributions for other modules should be under the same license
terms as the rest of the module, or under MIT X11 terms.
If you need further information, please contact [email protected]
If you ned further information, please contact [email protected]
* The Modules
@@ -30,21 +30,10 @@ For comments, corrections and updates, please contact [email protected]
This code is dual licensed under the LGPL or commercial licenses.
The LGPL ensures that Mono can be used in most scenarios, but
gives Novell the flexibility to relicense the code for
embedded systems, static linking or commercial settings where
the LGPL can not be used.
The LGPL ensures that Mono can be used in most scenarios, but
gives Novell the flexibility to relicense the code for embedded
systems or commercial settings where the LGPL can not be used.
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
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
on the distribution and access to the code, a phone platform
that prevents end users from upgrading Moonlight).
Contact [email protected] for details on obtaining the Mono
runtime under other terms.
@@ -58,8 +47,8 @@ For comments, corrections and updates, please contact [email protected]
The C# Compilers (1.0 and 2.0)
These compilers are dual licensed under the GPL and MIT X11
license terms.
These compilers are dual licensed under the GPL and commercial
terms.
** tests
@@ -101,10 +90,6 @@ For comments, corrections and updates, please contact [email protected]
Manual pages and Mono documentation are covered by the MIT X11 license.
* samples
The code in the "samples" directory is released under the MIT X11 license.
* The Licenses
These are the licenses used in Mono, the files are located:
+17 -13
View File
@@ -1,38 +1,46 @@
AUTOMAKE_OPTIONS = foreign
ACLOCAL_AMFLAGS = -I .
SUBDIRS = po $(libgc_dir) $(eglib_dir) mono $(ikvm_native_dir) support data runtime scripts man samples web msvc docs
SUBDIRS = $(libgc_dir) mono $(ikvm_native_dir) support docs data runtime scripts man samples web
# Keep in sync with SUBDIRS
## 'tools' is not normally built
DIST_SUBDIRS = po libgc $(eglib_dir) mono ikvm-native support data runtime scripts man samples web tools msvc docs
DIST_SUBDIRS = libgc mono ikvm-native support docs data runtime scripts man samples web tools
EXTRA_DIST= nls.m4 po.m4 progtest.m4 mono-uninstalled.pc.in build-mingw32.sh LICENSE mkinstalldirs
vs_files = genmdesc.vcproj libmono.vcproj mono.vcproj mono.sln
EXTRA_DIST= mono.pc.in mint.pc.in mono-uninstalled.pc.in dotnet.pc.in mono-cairo.pc.in LICENSE $(vs_files)
DISTCHECK_CONFIGURE_FLAGS = EXTERNAL_MCS=false EXTERNAL_RUNTIME=false
# Distribute the 'mcs' tree too
dist-hook:
test -d $(distdir)/mcs || mkdir $(distdir)/mcs
d=`cd $(distdir)/mcs && pwd`; cd $(mcs_topdir) && $(MAKE) PROFILE=net_1_1 distdir=$$d dist-recursive
d=`cd $(distdir)/mcs && pwd`; cd $(mcs_topdir) && $(MAKE) PROFILE=net_2_0 distdir=$$d dist-recursive
d=`cd $(distdir)/mcs && pwd`; cd $(mcs_topdir) && $(MAKE) PROFILE=default distdir=$$d dist-recursive
pkgconfigdir = $(libdir)/pkgconfig
if JIT_SUPPORTED
if INTERP_SUPPORTED
pkgconfig_DATA= mono.pc mint.pc dotnet.pc mono-cairo.pc
else
pkgconfig_DATA= mono.pc dotnet.pc mono-cairo.pc
endif
else
pkgconfig_DATA= mint.pc mono-cairo.pc
endif
noinst_DATA = mono-uninstalled.pc
DISTCLEANFILES= mono-uninstalled.pc
DISTCLEANFILES= mono.pc mint.pc mono-uninstalled.pc dotnet.pc mono-cairo.pc
.PHONY: get-monolite-latest mcs-do-compiler-tests compiler-tests bootstrap-world
# building with monolite
mcslib = $(mcs_topdir)/class/lib
monolite = $(mcslib)/monolite
monolite_url = http://mono.ximian.com/daily/monolite-latest.tar.gz
get-monolite-latest:
-rm -fr $(mcslib)/monolite-*
-mkdir -p $(mcslib)
test ! -d $(monolite) || test ! -d $(monolite).old || rm -fr $(monolite).old
test ! -d $(monolite) || mv -f $(monolite) $(monolite).old
cd $(mcslib) && { (wget -O- $(monolite_url) || curl $(monolite_url)) | gzip -d | tar xf - ; }
cd $(mcslib) && { wget -O- http://www.go-mono.com/daily/monolite-latest.tar.gz | gzip -d | tar xf - ; }
cd $(mcslib) && mv -f monolite-* monolite
compiler-tests: mcs-do-clean
@@ -82,7 +90,3 @@ win32setup:
bootstrap: all
@echo "*** 'make bootstrap' is obsolete. Just run 'make' to perform a combined mono+mcs build"
exit 1
patch-quiet:
find mono -name Makefile -exec scripts/patch-quiet.sh {} \;
find libgc -name Makefile -exec scripts/patch-quiet.sh {} \;
+22 -129
View File
@@ -52,8 +52,8 @@ This is Mono.
make
make install
Mono supports a JIT engine on x86, SPARC, SPARCv9, S/390,
S/390x, AMD64, ARM and PowerPC systems.
Mono supports a JIT engine on x86, SPARC, SPARCv9, S/390, AMD64, ARM
and PowerPC systems.
If you obtained this as a snapshot, you will need an existing
Mono installation. To upgrade your installation, unpack both
@@ -67,14 +67,6 @@ This is Mono.
./autogen.sh --prefix=/usr/local
make
The Mono build system is silent for most compilation commands.
To enable a more verbose compile (for example, to pinpoint
problems in your makefiles or your system) pass the V=1 flag to make, like this:
make V=1
c. Building the software from SVN
---------------------------------
@@ -90,19 +82,6 @@ This is Mono.
./autogen.sh --prefix=/usr/local
make
For people with non-standard installations of the auto* utils and of
pkg-config (common on misconfigured OSX and windows boxes), you could get
an error like this:
./configure: line 19176: syntax error near unexpected token `PKG_CHECK_MODULES(BASE_DEPENDENCIES,' ...
This means that you need to set the ACLOCAL_FLAGS environment var
when invoking autogen.sh, like this:
ACLOCAL_FLAGS="-I $acprefix/share/aclocal" ./autogen.sh --prefix=/usr/loca
where $acprefix is the prefix where aclocal has been installed.
This will automatically go into the mcs/ tree and build the
binaries there.
@@ -141,7 +120,7 @@ This is Mono.
also try passing EXTERNAL_MCS=false on the make command-line.
Testing and Installation
------------------------
------------------------
You can run (part of) the mono and mcs testsuites with the command:
@@ -216,10 +195,6 @@ This is Mono.
--with-sigaltstack=yes,no
Experimental: Use at your own risk, it is known to
cause problems with garbage collection and is hard to
reproduce those bugs.
This controls whether Mono will install a special
signal handler to handle stack overflows. If set to
"yes", it will turn stack overflows into the
@@ -232,7 +207,7 @@ This is Mono.
systems do not support this feature, or you might want
to override the auto-detection.
--with-static_mono=yes,no
--with-static-mono=yes,no
This controls whether `mono' should link against a
static library (libmono.a) or a shared library
@@ -272,19 +247,6 @@ This is Mono.
Whether you want to build libraries that are still not
completed (The 2.0 APIs). It defaults to `yes'.
--with-moonlight=yes,no
Whether you want to generate the Silverlight/Moonlight
libraries and toolchain in addition to the default
(1.1 and 2.0 APIs).
This will produce the `smcs' compiler which will reference
the Silvelright modified assemblies (mscorlib.dll,
System.dll, System.Code.dll and System.Xml.Core.dll) and turn
on the LINQ extensions for the compiler.
This option defaults to `no' and it is considered pre-alpha.
--with-libgdiplus=installed,sibling,<path>
This is used to configure where should Mono look for
@@ -300,16 +262,6 @@ This is Mono.
Or you can specify a path to a libgdiplus.
--disable-shared-memory
Use this option to disable the use of shared memory in
Mono (this is equivalent to setting the MONO_DISABLE_SHM
environment variable, although this removes the feature
completely).
Disabling the shared memory support will disable certain
features like cross-process named mutexes.
--enable-minimal=LIST
Use this feature to specify optional runtime
@@ -324,25 +276,22 @@ This is Mono.
Disables support for the Ahead of Time
compilation.
com:
Disables COM support.
debug:
Drop debugging support.
profiler:
Disables support for the default profiler.
decimal:
Disables support for System.Decimal.
generics:
Generics support. Disabling this will not
allow Mono to run any 2.0 libraries or
code that contains generics.
pinvoke:
Support for Platform Invocation services,
disabling this will drop support for any
libraries using DllImport.
jit:
Removes the JIT engine from the build, this reduces
the executable size, and requires that all code
executed by the virtual machine be compiled with
Full AOT before execution.
debug:
Drop debugging support.
reflection_emit:
Drop System.Reflection.Emit support
large_code:
Disables support for large assemblies.
@@ -350,64 +299,19 @@ This is Mono.
logging:
Disables support for debug logging.
pinvoke:
Support for Platform Invocation services,
disabling this will drop support for any
libraries using DllImport.
profiler:
Disables support for the default profiler.
reflection_emit:
Drop System.Reflection.Emit support
reflection_emit_save:
Drop support for saving dynamically created
assemblies (AssemblyBuilderAccess.Save) in
System.Reflection.Emit.
simd:
Disables support for the Mono.SIMD intrinsics
library.
com:
Disables COM support.
ssa:
Disables compilation for the SSA optimization
framework, and the various SSA-based
optimizations.
--enable-big-arrays
This enables the use arrays whose indexes are larger
than Int32.MaxValue.
By default Mono has the same limitation as .NET on
Win32 and Win64 and limits array indexes to 32-bit
values (even on 64-bit systems).
In certain scenarios where large arrays are required,
you can pass this flag and Mono will be built to
support 64-bit arrays.
This is not the default as it breaks the C embedding
ABI that we have exposed through the Mono development
cycle.
--enable-parallel-mark
Use this option to enable the garbage collector to use
multiple CPUs to do its work. This helps performance
on multi-CPU machines as the work is divided across CPUS.
This option is not currently the default as we have
not done much testing with Mono.
--enable-dtrace
On Solaris and MacOS X builds a version of the Mono
runtime that contains DTrace probes and can
participate in the system profiling using DTrace.
generics:
Generics support. Disabling this will not
allow Mono to run any 2.0 libraries or
code that contains generics.
--disable-dev-random
Mono uses /dev/random to obtain good random data for
@@ -481,11 +385,6 @@ This is Mono.
Manual pages for the various Mono commands and programs.
samples/
Some simple sample programs on uses of the Mono
runtime as an embedded library.
scripts/
Scripts used to invoke Mono and the corresponding program.
@@ -495,9 +394,3 @@ This is Mono.
A directory that contains the Makefiles that link the
mono/ and mcs/ build systems.
../olive/
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.
+38
View File
@@ -0,0 +1,38 @@
#undef HAVE_INET_PTON
#undef HAVE_INET_ATON
#undef HAVE_MSG_NOSIGNAL
#undef HAVE_SOL_IP
#undef HAVE_SOL_TCP
#undef HAVE_SOL_IPV6
#undef HAVE_IP_PKTINFO
#undef HAVE_IPV6_PKTINFO
#undef HAVE_STRUCT_IP_MREQN
#undef HAVE_STRUCT_IP_MREQ
#undef HAVE_PTHREAD_MUTEX_TIMEDLOCK
#undef USE_MONO_MUTEX
#undef HAVE_LARGE_FILE_SUPPORT
#undef HAVE_NEW_ICONV
#undef NAME_DEV_RANDOM
#undef HAVE_CRYPT_RNG
#undef HAVE_BOEHM_GC
#undef USE_INCLUDED_LIBGC
#undef DISABLE_SHARED_HANDLES
#undef HAVE_TIMEZONE
#undef HAVE_TM_GMTOFF
#undef MONO_SIZEOF_SUNPATH
#undef MONO_ZERO_ARRAY_LENGTH
#undef PTHREAD_POINTER_ID
#undef HAVE_GC_H
#undef HAVE_GC_GCJ_MALLOC
#undef HAVE_GC_ENABLE
#undef WITH_BUNDLE
#undef HAVE_GETHOSTBYNAME2_R
#undef HAVE_ICU
#undef HAVE_KW_THREAD
#undef HAVE_SIGNBIT
#undef USE_MACH_SEMA
#undef HAVE_SOCKLEN_T
#undef HAVE_TRUNCL
#undef HAVE_AINTL
#undef HAVE_SCANDIR
#undef HAVE_WORKING_SIGALTSTACK
-178
View File
@@ -1,178 +0,0 @@
dnl dolt, a replacement for libtool
dnl Copyright © 2007-2008 Josh Triplett <[email protected]>
dnl Copying and distribution of this file, with or without modification,
dnl are permitted in any medium without royalty provided the copyright
dnl notice and this notice are preserved.
dnl
dnl To use dolt, invoke the DOLT macro immediately after the libtool macros.
dnl Optionally, copy this file into acinclude.m4, to avoid the need to have it
dnl installed when running autoconf on your project.
AC_DEFUN([DOLT], [
AC_REQUIRE([AC_CANONICAL_HOST])
# dolt, a replacement for libtool
# Josh Triplett <[email protected]>
AC_PATH_PROG(DOLT_BASH, bash)
AC_MSG_CHECKING([if dolt supports this host])
dolt_supported=yes
if test x$DOLT_BASH = x; then
dolt_supported=no
fi
if test x$GCC != xyes; then
dolt_supported=no
fi
case $host in
i?86-*-linux*|x86_64-*-linux*|powerpc-*-linux* \
|amd64-*-freebsd*|i?86-*-freebsd*|ia64-*-freebsd*|arm*-*-linux*)
pic_options='-fPIC'
;;
i?86-apple-darwin*)
pic_options='-fno-common'
;;
*)
dolt_supported=no
;;
esac
if test x$dolt_supported = xno ; then
AC_MSG_RESULT([no, falling back to libtool])
LTCOMPILE='$(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(COMPILE)'
LTCXXCOMPILE='$(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXXCOMPILE)'
else
AC_MSG_RESULT([yes, replacing libtool])
dnl Start writing out doltcompile.
cat <<__DOLTCOMPILE__EOF__ >doltcompile
#!$DOLT_BASH
__DOLTCOMPILE__EOF__
cat <<'__DOLTCOMPILE__EOF__' >>doltcompile
args=("$[]@")
for ((arg=0; arg<${#args@<:@@@:>@}; arg++)) ; do
if test x"${args@<:@$arg@:>@}" = x-o ; then
objarg=$((arg+1))
break
fi
done
if test x$objarg = x ; then
echo 'Error: no -o on compiler command line' 1>&2
exit 1
fi
lo="${args@<:@$objarg@:>@}"
obj="${lo%.lo}"
if test x"$lo" = x"$obj" ; then
echo "Error: libtool object file name \"$lo\" does not end in .lo" 1>&2
exit 1
fi
objbase="${obj##*/}"
__DOLTCOMPILE__EOF__
dnl Write out shared compilation code.
if test x$enable_shared = xyes; then
cat <<'__DOLTCOMPILE__EOF__' >>doltcompile
libobjdir="${obj%$objbase}.libs"
if test ! -d "$libobjdir" ; then
mkdir_out="$(mkdir "$libobjdir" 2>&1)"
mkdir_ret=$?
if test "$mkdir_ret" -ne 0 && test ! -d "$libobjdir" ; then
echo "$mkdir_out" 1>&2
exit $mkdir_ret
fi
fi
pic_object="$libobjdir/$objbase.o"
args@<:@$objarg@:>@="$pic_object"
__DOLTCOMPILE__EOF__
cat <<__DOLTCOMPILE__EOF__ >>doltcompile
"\${args@<:@@@:>@}" $pic_options -DPIC || exit \$?
__DOLTCOMPILE__EOF__
fi
dnl Write out static compilation code.
dnl Avoid duplicate compiler output if also building shared objects.
if test x$enable_static = xyes; then
cat <<'__DOLTCOMPILE__EOF__' >>doltcompile
non_pic_object="$obj.o"
args@<:@$objarg@:>@="$non_pic_object"
__DOLTCOMPILE__EOF__
if test x$enable_shared = xyes; then
cat <<'__DOLTCOMPILE__EOF__' >>doltcompile
"${args@<:@@@:>@}" >/dev/null 2>&1 || exit $?
__DOLTCOMPILE__EOF__
else
cat <<'__DOLTCOMPILE__EOF__' >>doltcompile
"${args@<:@@@:>@}" || exit $?
__DOLTCOMPILE__EOF__
fi
fi
dnl Write out the code to write the .lo file.
dnl The second line of the .lo file must match "^# Generated by .*libtool"
cat <<'__DOLTCOMPILE__EOF__' >>doltcompile
{
echo "# $lo - a libtool object file"
echo "# Generated by doltcompile, not libtool"
__DOLTCOMPILE__EOF__
if test x$enable_shared = xyes; then
cat <<'__DOLTCOMPILE__EOF__' >>doltcompile
echo "pic_object='.libs/${objbase}.o'"
__DOLTCOMPILE__EOF__
else
cat <<'__DOLTCOMPILE__EOF__' >>doltcompile
echo pic_object=none
__DOLTCOMPILE__EOF__
fi
if test x$enable_static = xyes; then
cat <<'__DOLTCOMPILE__EOF__' >>doltcompile
echo "non_pic_object='${objbase}.o'"
__DOLTCOMPILE__EOF__
else
cat <<'__DOLTCOMPILE__EOF__' >>doltcompile
echo non_pic_object=none
__DOLTCOMPILE__EOF__
fi
cat <<'__DOLTCOMPILE__EOF__' >>doltcompile
} > "$lo"
__DOLTCOMPILE__EOF__
dnl Done writing out doltcompile; substitute it for libtool compilation.
chmod +x doltcompile
LTCOMPILE='$(top_builddir)/doltcompile $(COMPILE)'
LTCXXCOMPILE='$(top_builddir)/doltcompile $(CXXCOMPILE)'
dnl automake ignores LTCOMPILE and LTCXXCOMPILE when it has separate CFLAGS for
dnl a target, so write out a libtool wrapper to handle that case.
dnl Note that doltlibtool does not handle inferred tags or option arguments
dnl without '=', because automake does not use them.
cat <<__DOLTLIBTOOL__EOF__ > doltlibtool
#!$DOLT_BASH
__DOLTLIBTOOL__EOF__
cat <<'__DOLTLIBTOOL__EOF__' >>doltlibtool
top_builddir_slash="${0%%doltlibtool}"
: ${top_builddir_slash:=./}
args=()
modeok=false
tagok=false
for arg in "$[]@"; do
case "$arg" in
--mode=compile) modeok=true ;;
--tag=CC|--tag=CXX) tagok=true ;;
--quiet) ;;
*) args@<:@${#args[@]}@:>@="$arg" ;;
esac
done
if $modeok && $tagok ; then
. ${top_builddir_slash}doltcompile "${args@<:@@@:>@}"
else
exec ${top_builddir_slash}libtool "$[]@"
fi
__DOLTLIBTOOL__EOF__
dnl Done writing out doltlibtool; substitute it for libtool.
chmod +x doltlibtool
LIBTOOL='$(top_builddir)/doltlibtool'
fi
AC_SUBST(LTCOMPILE)
AC_SUBST(LTCXXCOMPILE)
# end dolt
])
+3 -3
View File
@@ -82,7 +82,7 @@ if test "$DIE" -eq 1; then
exit 1
fi
if test x$NOCONFIGURE = x && test -z "$*"; then
if test -z "$*"; then
echo "**Warning**: I am going to run \`configure' with no arguments."
echo "If you wish to pass any to it, please specify them on the"
echo \`$0\'" command line."
@@ -102,8 +102,8 @@ if grep "^AM_PROG_LIBTOOL" configure.in >/dev/null; then
fi
fi
echo "Running aclocal -I . $ACLOCAL_FLAGS ..."
aclocal -I . $ACLOCAL_FLAGS || {
echo "Running aclocal $ACLOCAL_FLAGS ..."
aclocal $ACLOCAL_FLAGS || {
echo
echo "**Error**: aclocal failed. This may mean that you have not"
echo "installed all of the packages you need, or you may need to"
-64
View File
@@ -1,64 +0,0 @@
#!/bin/sh
ASPEN_ROOT=/Developer/Platforms/iPhoneOS.platform/Developer
ASPEN_SDK=$ASPEN_ROOT/SDKs/iPhoneOS2.0.sdk/
ORIG_PATH=$PATH
GLIB_FLAGS=`pkg-config --cflags --libs glib-2.0`
if [ -z "$GLIB_FLAGS" ]; then
echo "pkg-config could not locate glib-2.0 needed for the monoburg step"
exit;
fi
setenv () {
export PATH=$ASPEN_ROOT/usr/bin:$PATH
export C_INCLUDE_PATH="$ASPEN_SDK/usr/lib/gcc/arm-apple-darwin9/4.0.1/include:$ASPEN_SDK/usr/include"
export CPLUS_INCLUDE_PATH="$ASPEN_SDK/usr/lib/gcc/arm-apple-darwin9/4.0.1/include:$ASPEN_SDK/usr/include"
export CC=arm-apple-darwin9-gcc-4.0.1
export CXX=arm-apple-darwin9-g++-4.0.1
export CPP="cpp-4.0 -nostdinc -U__powerpc__ -U__i386__ -D__arm__"
export CXXPP="cpp-4.0 -nostdinc -U__powerpc__ -U__i386__ -D__arm__"
export LD=$CC
export LDFLAGS="-liconv -Wl,-syslibroot,$ASPEN_SDK"
}
unsetenv () {
export PATH=$ORIG_PATH
unset C_INCLUDE_PATH
unset CPLUS_INCLUDE_PATH
unset CC
unset CXX
unset CPP
unset CXXPP
unset LD
unset LDFLAGS
}
export mono_cv_uscore=yes
export cv_mono_sizeof_sunpath=104
export ac_cv_func_posix_getpwuid_r=yes
export ac_cv_func_backtrace_symbols=no
setenv
pushd eglib
./autogen.sh --host=arm-apple-darwin9
popd
./autogen.sh --disable-mcs-build --host=arm-apple-darwin9 --disable-shared-handles --with-tls=pthread --with-sigaltstack=no --with-glib=embedded $@
perl -pi -e 's/MONO_SIZEOF_SUNPATH 0/MONO_SIZEOF_SUNPATH 104/' config.h
perl -pi -e 's/#define HAVE_FINITE 1//' config.h
perl -pi -e 's/#define HAVE_MMAP 1//' config.h
make
unsetenv
pushd mono/monoburg
/usr/bin/gcc -o monoburg ./monoburg.c parser.c -I../.. -pthread -lm $GLIB_FLAGS
make
popd
setenv
make
-110
View File
@@ -1,110 +0,0 @@
#!/bin/bash -e
CURDIR="`pwd`"
CROSS_DIR=${1:-/opt/cross/}
MINGW=${1:-i386-mingw32msvc}
CROSS_BIN_DIR="$CROSS_DIR/bin"
CROSS_DLL_DIR="$CROSS_DIR/$MINGW/bin"
CROSS_PKG_CONFIG_DIR=$CROSS_DIR/$MINGW/lib/pkgconfig
COPY_DLLS="libgio*.dll libglib*.dll libgmodule*.dll libgthread*.dll libgobject*.dll"
PATH=$CROSS_BIN_DIR:$PATH
INSTALL_DESTDIR="$CURDIR/mono-win32"
PROFILES="default net_2_0 net_2_1 net_3_5"
export PATH
function setup ()
{
if [ -d ./.git/svn ]; then
SVN_INFO='git svn info'
elif [ -d ./.svn ]; then
SVN_INFO='svn info'
else
SVN_INFO=""
fi
if [ -n "$SVN_INFO" ]; then
MONO_SVN_REVISION=`$SVN_INFO | grep Revision | sed 's/.*: //'`
MONO_BRANCH=`$SVN_INFO | grep URL | sed -e 's;.*source/;;g' -e 's;/mono;;g'`
else
MONO_SVN_REVISION="rUNKNOWN"
MONO_BRANCH="tarball"
fi
MONO_VERSION=`grep AM_INIT_AUTOMAKE configure.in | cut -d ',' -f 2|tr -d '\)'`
MONO_RELEASE="$MONO_VERSION-$MONO_BRANCH-r$MONO_SVN_REVISION"
MONO_PREFIX="/mono-$MONO_RELEASE"
NOCONFIGURE=yes
export NOCONFIGURE
echo Mono Win32 installation prefix: $MONO_PREFIX
}
function build ()
{
./autogen.sh
if [ -f ./Makefile ]; then
make distclean
fi
if [ ! -d "$CURDIR/build-cross-windows" ]; then
mkdir "$CURDIR/build-cross-windows"
fi
cd "$CURDIR/build-cross-windows"
rm -rf *
../configure --prefix=$MONO_PREFIX --with-crosspkgdir=$CROSS_PKG_CONFIG_DIR --target=$MINGW --host=$MINGW --enable-parallel-mark --program-transform-name=""
make
cd "$CURDIR"
if [ ! -d "$CURDIR/build-cross-windows-mcs" ]; then
mkdir "$CURDIR/build-cross-windows-mcs"
fi
cd "$CURDIR/build-cross-windows-mcs"
rm -rf *
../configure --prefix=$MONO_PREFIX --enable-parallel-mark
make
}
function doinstall ()
{
if [ -d "$INSTALL_DIR" ]; then
rm -rf "$INSTALL_DIR"
fi
cd "$CURDIR/build-cross-windows"
make DESTDIR="$INSTALL_DESTDIR" USE_BATCH_FILES=yes install
cd "$CURDIR/../mcs/mcs"
for p in $PROFILES; do
make DESTDIR="$INSTALL_DESTDIR" PROFILE=$p install || echo "mcs profile $p installation failed"
done
cd "$CURDIR/../mcs/class"
for p in $PROFILES; do
make DESTDIR="$INSTALL_DESTDIR" PROFILE=$p install || echo "class library profile $p installation failed"
done
cd "$CURDIR/../mcs/tools"
for p in $PROFILES; do
make DESTDIR="$INSTALL_DESTDIR" PROFILE=$p install || echo "tools profile $p installation failed"
done
cd "$CURDIR/mono-win32"
for dll in $COPY_DLLS; do
cp -ap "$CROSS_DLL_DIR"/$dll "$INSTALL_DESTDIR/$MONO_PREFIX/bin"
done
rm -f "$CURDIR/mono-win32-$MONO_RELEASE".zip
zip -9r "$CURDIR/mono-win32-$MONO_RELEASE".zip .
}
pushd . > /dev/null
setup
build
doinstall
popd > /dev/null
+207 -688
View File
File diff suppressed because it is too large. Load diff
+2 -24
View File
@@ -2,30 +2,8 @@ SUBDIRS = net_1_1 net_2_0
monodir = $(sysconfdir)/mono
EXTRA_DIST = \
config.in \
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
pkgconfigdir = $(libdir)/pkgconfig
if JIT_SUPPORTED
if INTERP_SUPPORTED
pkgconfig_DATA= mono.pc mint.pc dotnet.pc dotnet35.pc wcf.pc mono-nunit.pc mono-cairo.pc mono-options.pc cecil.pc smcs.pc monodoc.pc mono-lineeditor.pc system.web.extensions_1.0.pc \
system.web.extensions.design_1.0.pc
else
pkgconfig_DATA= mono.pc dotnet.pc dotnet35.pc wcf.pc mono-nunit.pc mono-cairo.pc mono-options.pc cecil.pc smcs.pc monodoc.pc mono-lineeditor.pc system.web.extensions_1.0.pc \
system.web.extensions.design_1.0.pc
endif
else
pkgconfig_DATA= mint.pc mono-nunit.pc mono-cairo.pc mono-options.pc cecil.pc smcs.pc monodoc.pc mono-lineeditor.pc
endif
DISTCLEANFILES= mono.pc mint.pc dotnet.pc dotnet35.pc wcf.pc mono-nunit.pc mono-cairo.pc mono-options.pc cecil.pc smcs.pc monodoc.pc mono-lineeditor.pc system.web.extensions_1.0.pc \
system.web.extensions.design_1.0.pc
EXTRA_DIST = config.in \
browscap.ini mono.supp README
mono_DATA = config \
browscap.ini
-5
View File
@@ -11,11 +11,6 @@ Files in this directory:
basis what kind of features it can depend on when
producing the HTML code.
mono.d
This is a DTrace file listing available probes.
This is used by dtrace to generate a C header file,
and on Solaris for postprocessing object files.
mono.supp
This is a valgrind data file, it lists the warnings
that should be supressed when reporting Mono-related
+12383 -16312
View File
File diff suppressed because it is too large. Load diff
-7
View File
@@ -1,7 +0,0 @@
assemblies_dir=@prefix@/lib/mono
Libraries=${assemblies_dir}/gac/Mono.Cecil/0.6.9.0__0738eb9f132ed756/Mono.Cecil.dll
Name: Mono Internal -- Do not use.
Description: Mono Internal Libraries -- Do not use
Version: @VERSION@
Libs: -r:Mono.Cecil.dll
+15 -23
View File
@@ -1,26 +1,18 @@
<configuration>
<dllmap dll="i:cygwin1.dll" target="@LIBC@" os="!windows" />
<dllmap dll="libc" target="@LIBC@" os="!windows"/>
<dllmap dll="intl" target="@INTL@" os="!windows"/>
<dllmap dll="intl" name="bind_textdomain_codeset" target="@LIBC@" os="solaris"/>
<dllmap dll="libintl" name="bind_textdomain_codeset" target="@LIBC@" os="solaris"/>
<dllmap dll="libintl" target="@INTL@" os="!windows"/>
<dllmap dll="i:libxslt.dll" target="libxslt@libsuffix@" os="!windows"/>
<dllmap dll="i:odbc32.dll" target="libodbc@libsuffix@" os="!windows"/>
<dllmap dll="i:odbc32.dll" target="libiodbc.dylib" os="osx"/>
<dllmap dll="cygwin1.dll" target="@LIBC@" />
<dllmap dll="libc" target="@LIBC@" />
<dllmap dll="intl" target="@INTL@" />
<dllmap dll="libintl" target="@INTL@" />
<dllmap dll="libxslt.dll" target="libxslt@libsuffix@" />
<dllmap dll="libmySQL.dll" target="libmysqlclient@libsuffix@" />
<dllmap dll="odbc32.dll" target="libodbc@libsuffix@" />
<dllmap os="osx" dll="odbc32.dll" target="libiodbc.dylib" />
<dllmap dll="oci" target="libclntsh@libsuffix@" os="!windows"/>
<dllmap dll="db2cli" target="libdb2_36@libsuffix@" os="!windows"/>
<dllmap dll="MonoPosixHelper" target="libMonoPosixHelper@libsuffix@" os="!windows" />
<dllmap dll="i:msvcrt" target="@LIBC@" os="!windows"/>
<dllmap dll="i:msvcrt.dll" target="@LIBC@" os="!windows"/>
<dllmap dll="sqlite" target="@SQLITE@" os="!windows"/>
<dllmap dll="sqlite3" target="@SQLITE3@" os="!windows"/>
<dllmap dll="libX11" target="@X11@" os="!windows" />
<dllmap dll="libcairo-2.dll" target="libcairo.so.2" os="!windows"/>
<dllmap dll="i:kernel32.dll">
<dllentry dll="__Internal" name="CopyMemory" target="mono_win32_compat_CopyMemory"/>
<dllentry dll="__Internal" name="FillMemory" target="mono_win32_compat_FillMemory"/>
<dllentry dll="__Internal" name="MoveMemory" target="mono_win32_compat_MoveMemory"/>
<dllentry dll="__Internal" name="ZeroMemory" target="mono_win32_compat_ZeroMemory"/>
</dllmap>
<dllmap dll="db2cli" target="libdb2_36@libsuffix@" />
<dllmap dll="msvcrt" target="@LIBC@" />
<dllmap dll="MonoPosixHelper" target="libMonoPosixHelper@libsuffix@" />
<dllmap dll="sqlite" target="@SQLITE@" />
<dllmap dll="sqlite3" target="@SQLITE3@" />
<dllmap dll="libX11" target="@X11@" />
<dllmap dll="libcairo-2.dll" target="libcairo.so.2" />
</configuration>
-5
View File
@@ -1,5 +0,0 @@
Name: Standard libraries in a .NET setup
Description: References all the standard .NET libraries for compilation (.NET Framework 3.5 compatibility)
Version: @VERSION@
Libs: -r:Accessibility.dll -r:cscompmgd.dll -r:Microsoft.JScript.dll -r:Microsoft.VisualC.dll -r:Microsoft.Vsa.dll -r:System.Configuration.Install.dll -r:System.Data.dll -r:System.Data.OracleClient.dll -r:System.Design.dll -r:System.DirectoryServices.dll -r:System.dll -r:System.Drawing.Design.dll -r:System.Drawing.dll -r:System.EnterpriseServices.dll -r:System.Management.dll -r:System.Messaging.dll -r:System.Runtime.Remoting.dll -r:System.Runtime.Serialization.Formatters.Soap.dll -r:System.Security.dll -r:System.ServiceProcess.dll -r:System.Web.dll -r:System.Web.Services.dll -r:System.Windows.Forms.dll -r:System.Xml.dll -r:System.Configuration.dll -r:System.Core.dll -r:System.Xml.Linq.dll -r:System.Data.DataSetExtensions.dll -r:System.Data.Linq.dll -r:System.Web.Abstractions.dll -r:System.Web.Routing.dll -r:System.Web.DynamicData.dll -r:System.ComponentModel.DataAnnotations.dll
-74
View File
@@ -1,74 +0,0 @@
#!/bin/sh
#
# dtrace-prelink.sh: DTrace helper script for Mono
#
# Authors:
# Andreas Faerber <[email protected]>
#
# Assume that PIC object files live in .libs/, non-PIC code in ./
PIC=no
if test "$1" = "--pic"; then
PIC=yes
shift
fi
OBJ="$1"
PROV="$2"
shift
shift
FILES="$*"
OBJS=
TMPDIR=.dtrace
mkdir -p "${TMPDIR}"
# Extract relevant object files to temporary directories
for FILE in ${FILES}; do
if echo "${FILE}" | grep .la > /dev/null; then
LIBDIR=`dirname ${FILE}`
LIB=".libs/`basename ${FILE} .la`.a"
DIR="${TMPDIR}/`basename ${FILE}`"
mkdir -p ${DIR}
(cd "${DIR}" && ${AR} x "../../${LIBDIR}/${LIB}")
TMPOBJS=`ls -1 "${DIR}"`
for TMPOBJ in ${TMPOBJS}; do
LO=`basename "${TMPOBJ}" .o`.lo
SRCOBJ="${TMPOBJ}"
if test x${PIC} = xyes; then
SRCOBJ=".libs/${SRCOBJ}"
fi
# Overwrite with original version
cp "${LIBDIR}/${SRCOBJ}" "${DIR}/${TMPOBJ}" || cp "${LIBDIR}/${TMPOBJ}" "${DIR}/${TMPOBJ}" || exit
# Add to list
OBJS="${OBJS} ${DIR}/${TMPOBJ}"
done
fi
if echo "${FILE}" | grep .lo > /dev/null; then
DIR=`dirname ${FILE}`
SRCOBJ=`basename ${FILE} .lo`.o
if test x${PIC} = xyes; then
SRCOBJ=".libs/${SRCOBJ}"
fi
OBJS="${OBJS} ${DIR}/${SRCOBJ}"
fi
done
# Run dtrace -G over the temporary objects
${DTRACE} -G ${DTRACEFLAGS} -s "${PROV}" -o "${OBJ}" ${OBJS} || exit
# Update the archives with the temporary, modified object files so that they are linked in
for FILE in ${FILES}; do
if echo "${FILE}" | grep .la > /dev/null; then
LIBDIR=`dirname ${FILE}`
LIB=".libs/`basename ${FILE} .la`.a"
DIR="${TMPDIR}/`basename ${FILE}`"
(cd "${DIR}" && ${AR} r "../../${LIBDIR}/${LIB}" *.o)
fi
# .lo files were modified in-place
done
rm -rf "${TMPDIR}"
-22
View File
@@ -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.
-163
View File
@@ -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
-181
View File
@@ -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)))
-20
View 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
-12
View File
@@ -1,12 +0,0 @@
prefix=${pcfiledir}/../..
exec_prefix=${pcfiledir}/../..
libdir=${prefix}/lib
includedir=${prefix}/include/mono-@API_VER@
Name: Mono Interpreter
Description: Mono Interpreter Runtime
Version: @VERSION@
Requires: glib-2.0 gthread-2.0
Libs: -L${libdir} @export_ldflags@ -lmint @libmono_ldflags@
Cflags: -I${includedir} @libmono_cflags@
-7
View File
@@ -1,7 +0,0 @@
prefix=${pcfiledir}/../..
assemblies_dir=${prefix}/lib/mono-source-libs
Sources=${assemblies_dir}/getline.cs
Name: Mono.Terminal.LineEditor
Description: Terminal text entry editor using System.Console.
Version: 0.2.1
-9
View File
@@ -1,9 +0,0 @@
prefix=${pcfiledir}/../..
exec_prefix=${prefix}
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
-7
View File
@@ -1,7 +0,0 @@
prefix=${pcfiledir}/../..
assemblies_dir=${prefix}/lib/mono-source-libs
Sources=${assemblies_dir}/Options.cs
Name: Mono.Options
Description: Command Line Parsing Library
Version: 0.2.1
-28
View File
@@ -1,28 +0,0 @@
/*
* mono.d: DTrace provider for Mono
*
* Authors:
* Andreas Faerber <[email protected]>
*
*/
provider mono {
/* Virtual Execution System (VES) */
probe ves__init__begin ();
probe ves__init__end ();
/* Just-in-time compiler (JIT) */
probe method__compile__begin (char* class_name, char* method_name, char* signature);
probe method__compile__end (char* class_name, char* method_name, char* signature, int success);
/* Garbage Collector (GC) */
probe gc__begin (int generation);
probe gc__end (int generation);
};
#pragma D attributes Evolving/Evolving/Common provider mono provider
#pragma D attributes Private/Private/Unknown provider mono module
#pragma D attributes Private/Private/Unknown provider mono function
#pragma D attributes Evolving/Evolving/Common provider mono name
#pragma D attributes Evolving/Evolving/Common provider mono args
-12
View File
@@ -1,12 +0,0 @@
prefix=${pcfiledir}/../..
exec_prefix=${pcfiledir}/../..
libdir=${prefix}/@reloc_libdir@
includedir=${prefix}/include/mono-@API_VER@
sysconfdir=@sysconfdir@
Name: Mono
Description: Mono Runtime
Version: @VERSION@
Requires: glib-2.0 gthread-2.0
Libs: -L${libdir} @export_ldflags@ -lmono @libmono_ldflags@
Cflags: -I${includedir} @libmono_cflags@
-9
View File
@@ -1,9 +0,0 @@
prefix=@prefix@
exec_prefix=@exec_prefix@
libdir=@prefix@/lib
sourcesdir=${libdir}/monodoc/sources
Name: Monodoc
Description: Monodoc - Mono Documentation Tools
Version: @VERSION@
Libs: /r:${prefix}/lib/mono/monodoc/monodoc.dll
+1 -25
View File
@@ -24,9 +24,7 @@
<%@ Import Namespace="System.CodeDom.Compiler" %>
<%@ Import Namespace="Microsoft.CSharp" %>
<%@ Import Namespace="Microsoft.VisualBasic" %>
<%@ Import Namespace="System.Text" %>
<%@ Import Namespace="System.Text.RegularExpressions" %>
<%@ Import Namespace="System.Security.Cryptography.X509Certificates" %>
<%@ Assembly name="System.Web.Services" %>
<%@ Page debug="true" %>
@@ -308,13 +306,6 @@ bool HasFormResult
get { return Request.QueryString ["ext"] == "testform"; }
}
class NoCheckCertificatePolicy : ICertificatePolicy {
public bool CheckValidationResult (ServicePoint a, X509Certificate b, WebRequest c, int d)
{
return true;
}
}
string GetTestResult ()
{
if (!HasFormResult) return null;
@@ -348,22 +339,7 @@ string GetTestResult ()
{
string url = location + "/" + CurrentOperationName;
Uri uri = new Uri (url);
WebRequest req;
if (CurrentOperationProtocols.IndexOf ("HttpGet") < 0) {
req = WebRequest.Create (url);
req.Method = "POST";
if (qs != null && qs.Length > 0) {
req.ContentType = "application/x-www-form-urlencoded";
byte [] postBuffer = Encoding.UTF8.GetBytes (qs);
req.ContentLength = postBuffer.Length;
using (Stream requestStream = req.GetRequestStream ())
requestStream.Write (postBuffer, 0, postBuffer.Length);
}
}
else
req = WebRequest.Create (url + "?" + qs);
if (url.StartsWith ("https:"))
ServicePointManager.CertificatePolicy = new NoCheckCertificatePolicy ();
WebRequest req = WebRequest.Create (url + "?" + qs);
HttpCookieCollection cookies = Request.Cookies;
int last = cookies.Count;
if (last > 0) {
-4
View File
@@ -6,7 +6,6 @@
<section name="appSettings" type="System.Configuration.NameValueFileSectionHandler, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<section name="system.diagnostics" type="System.Diagnostics.DiagnosticsConfigurationHandler, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<section name="system.runtime.remoting" type="System.Configuration.IgnoreSectionHandler, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowLocation="false"/>
<section name="system.windows.forms" type="System.Configuration.IgnoreSectionHandler, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<sectionGroup name="system.web">
<section name="httpHandlers"
type="System.Web.Configuration.HttpHandlersSectionHandler, System.Web, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
@@ -219,7 +218,6 @@
</cryptoNameMapping>
<oidMap>
<oidEntry OID="1.2.840.113549.2.2" name="MD2" />
<oidEntry OID="1.2.840.113549.2.2" name="Mono.Security.Cryptography.MD2Managed" />
</oidMap>
</cryptographySettings>
</mscorlib>
@@ -234,8 +232,6 @@
<map Token="31bf3856ad364e35" PublicKey="002400000480000094000000060200000024000052534131000400000100010079159977d2d03a8e6bea7a2e74e8d1afcc93e8851974952bb480a12c9134474d04062447c37e0e68c080536fcf3c3fbe2ff9c979ce998475e506e8ce82dd5b0f350dc10e93bf2eeecf874b24770c5081dbea7447fddafa277b22de47d6ffea449674a4f9fccf84d15069089380284dbdd35f46cdff12a1bd78e4ef0065d016df" />
<!-- IBM (DB2 Data Provider) key -->
<map Token="7c307b91aa13d208" PublicKey="002400000480000094000000060200000024000052534131000400000100010079159977d2d03a8e6bea7a2e74e8d1afcc93e8851974952bb480a12c9134474d04062447c37e0e68c080536fcf3c3fbe2ff9c979ce998475e506e8ce82dd5b0f350dc10e93bf2eeecf874b24770c5081dbea7447fddafa277b22de47d6ffea449674a4f9fccf84d15069089380284dbdd35f46cdff12a1bd78e4ef0065d016df" />
<!-- Silverlight 2.0 key -->
<map Token="7cec85d7bea7798e" PublicKey="002400000480000094000000060200000024000052534131000400000100010079159977d2d03a8e6bea7a2e74e8d1afcc93e8851974952bb480a12c9134474d04062447c37e0e68c080536fcf3c3fbe2ff9c979ce998475e506e8ce82dd5b0f350dc10e93bf2eeecf874b24770c5081dbea7447fddafa277b22de47d6ffea449674a4f9fccf84d15069089380284dbdd35f46cdff12a1bd78e4ef0065d016df" />
</pubTokenMapping>
</strongNames>
</configuration>
-6
View File
@@ -1,6 +0,0 @@
2008-03-23 Dean Brettle <[email protected]>
* Compat.browser: added. Provides browser definitions with
compatible IDs.
-42
View File
@@ -1,42 +0,0 @@
<!--
This file defines some of the browsers that Microsoft's implementation provides in
<windir>\Microsoft.NET\Framework\<ver>\CONFIG\Browsers\*.browser
It is not derived from any file distributed with Microsoft's implementation. Since
we can't distribute MS's browser files, we use browscap.ini to determine
browser capabilities. Then, if and only if the application contains App_Browser/*.browser
files and we are using .NET 2.0 or higher, we supplement the capabilities with the
information in those files and the files in this directory. The primary goal of this file
is provide browser definitions that might be referenced in App_Browser/*.browser files.
-->
<browsers>
<defaultBrowser id="Default">
</defaultBrowser>
<browser id="Default">
<identification>
<userAgent match="." />
</identification>
</browser>
<browser id="IE6to9" parentID="Default">
<identification>
<capability name="majorver" match="^[6-9]" />
<capability name="browser" match="^(IE|AOL)$" />
</identification>
</browser>
<browser id="Opera8to9" parentID="Default">
<identification>
<capability name="majorver" match="^[8-9]" />
<capability name="browser" match="^Opera$" />
</identification>
</browser>
<browser id="Safari" parentID="Default">
<identification>
<capability name="browser" match="^Safari$" />
</identification>
</browser>
<browser id="Mozilla" parentID="Default">
<identification>
<capability name="browser" match="^Mozilla" />
</identification>
</browser>
</browsers>
-6
View File
@@ -1,6 +0,0 @@
monodir = $(sysconfdir)/mono/2.0/Browsers
EXTRA_DIST = Compat.browser
mono_DATA = Compat.browser
-120
View File
@@ -1,120 +0,0 @@
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.
2008-10-09 Gonzalo Paniagua Javier <[email protected]>
* web.config: default values for httpRuntime are different in 2.0
2008-10-09 Marek Habersack <[email protected]>
* web.config: added the default monoSettings section which works around
an incompatibility between mcs and csc, mentioned in bug #433806
* machine.config: added definition of the monoSettings section to
the system.web group
2008-10-06 Marek Habersack <[email protected]>
* machine.config: added entries to ignore the mobileControls and
deviceFilters sections.
2008-09-02 Marek Habersack <[email protected]>
* web.config: removed System.Web.Extensions.dll from the assemblies
(reverting r112073) - it would break all the ASP.NET applications
which use System.Web.Extensions other than 3.5.0.0
2008-09-06 Daniel Morgan <[email protected]>
* machine.config: added Mono.Data.SybaseClient
to DbProviderFactories section.
2008-09-02 Atsushi Enomoto <[email protected]>
* web.config: added System.Web.Extensions.dll to assemblies.
2008-08-28 Zoltan Varga <[email protected]>
* machine.config: Fix syntax error.
2008-03-23 Dean Brettle <[email protected]>
* Makefile.am: added Browsers/Compat.browser
2008-02-29 Marek Habersack <[email protected]>
* machine.config: added an entry to ignore the browserCaps section.
2007-12-15 Marek Habersack <[email protected]>
* web.config: compilation/compilers are no longer necessary.
2007-12-08 Marek Habersack <[email protected]>
* machine.config: updated the LocalSqlServer connection string to
match MS.NET and added a new connection string, LocalSqliteServer,
to be used by default on Unix.
Updated the AspNetSqlMembershipProvider definition to match
MS.NET.
* settings.map: added
* Makefile.am: added settings.map
2007-10-17 Atsushi Enomoto <[email protected]>
* web.config, machine.config: moved webSerices section from former
to latter.
2007-09-05 Atsushi Enomoto <[email protected]>
* machine.config : added WCF sectionGroups.
2007-09-04 Marek Habersack <[email protected]>
* machine.config: added an entry to ignore the <system.webServer>
section. Fixes bug #82535
2007-07-03 Marek Habersack <[email protected]>
* DefaultWsdlHelpGenerator.aspx: make head server-side, for the
service generator to run on sites which use stylesheet themes
configured in web.config. Fixes bug #81994
2007-05-01 Marek Habersack <[email protected]>
* machine.config: added standard data provider factories, or
otherwise the SqlDataSource tests will fail.
2007-04-27 Atsushi Enomoto <[email protected]>
* DefaultWsdlHelpGenerator.aspx :
ProfileViolations could be null, when there is no Binding. So,
don't omit null check.
Stop your bad habit of missing ChangeLog. Former changes (as long
as logged) can be seen in ../../ChangeLog.
+54 -113
View File
@@ -16,8 +16,6 @@
<%@ Import Namespace="System.Xml.Schema" %>
<%@ Import Namespace="System.Web.Services" %>
<%@ Import Namespace="System.Web.Services.Description" %>
<%@ Import Namespace="System.Web.Services.Configuration" %>
<%@ Import Namespace="System.Web.Configuration" %>
<%@ Import Namespace="System" %>
<%@ Import Namespace="System.Net" %>
<%@ Import Namespace="System.Globalization" %>
@@ -27,9 +25,7 @@
<%@ Import Namespace="System.CodeDom.Compiler" %>
<%@ Import Namespace="Microsoft.CSharp" %>
<%@ Import Namespace="Microsoft.VisualBasic" %>
<%@ Import Namespace="System.Text" %>
<%@ Import Namespace="System.Text.RegularExpressions" %>
<%@ Import Namespace="System.Security.Cryptography.X509Certificates" %>
<%@ Assembly name="System.Web.Services" %>
<%@ Page debug="true" %>
@@ -92,9 +88,7 @@ void Page_Load(object sender, EventArgs e)
Page.DataBind();
ProfileViolations = new BasicProfileViolationCollection ();
foreach (WsiProfilesElement claims in ((WebServicesSection) WebConfigurationManager.GetSection("system.web/webServices")).ConformanceWarnings)
if (claims.Name != WsiProfiles.None)
WebServicesInteroperability.CheckConformance (claims.Name, descriptions, ProfileViolations);
WebServicesInteroperability.CheckConformance (WsiClaims.BP10, descriptions, ProfileViolations);
}
void BuildOperationInfo ()
@@ -128,10 +122,7 @@ void BuildOperationInfo ()
CurrentOperationProtocols += (string) prots[n];
}
WebServiceProtocols testProtocols = WebServiceProtocols.HttpGet | WebServiceProtocols.HttpPost;
if (Context.Request.IsLocal)
testProtocols |= WebServiceProtocols.HttpPostLocalhost;
CurrentOperationSupportsTest = (WebServicesSection.Current.EnabledProtocols & testProtocols) != 0;
CurrentOperationSupportsTest = prots.Contains ("HttpGet") || prots.Contains ("HttpPost");
// Operation format
OperationBinding obin = FindOperation (binding, CurrentOperationName);
@@ -322,38 +313,21 @@ bool HasFormResult
get { return Request.QueryString ["ext"] == "testform"; }
}
class NoCheckCertificatePolicy : ICertificatePolicy {
public bool CheckValidationResult (ServicePoint a, X509Certificate b, WebRequest c, int d)
{
return true;
}
}
string GetOrPost ()
{
return (CurrentOperationProtocols.IndexOf ("HttpGet") >= 0) ? "GET" : "POST";
}
string GetQS ()
{
string GetTestResult ()
{
if (!HasFormResult) return null;
bool fill = false;
string qs = "";
NameValueCollection query_string = Request.QueryString;
for (int n = 0; n < query_string.Count; n++) {
for (int n=0; n<Request.QueryString.Count; n++)
{
if (fill) {
if (qs != "") qs += "&";
qs += query_string.GetKey(n) + "=" + Server.UrlEncode (query_string [n]);
qs += Request.QueryString.GetKey(n) + "=" + Server.UrlEncode (Request.QueryString [n]);
}
if (query_string.GetKey(n) == "ext") fill = true;
if (Request.QueryString.GetKey(n) == "ext") fill = true;
}
return qs;
}
string GetTestResultUrl ()
{
if (!HasFormResult) return "";
string location = null;
ServiceDescription desc = descriptions [0];
Service service = desc.Services[0];
@@ -368,7 +342,44 @@ string GetTestResultUrl ()
if (location == null)
return "Could not locate web service";
return location + "/" + CurrentOperationName;
try
{
string url = location + "/" + CurrentOperationName;
Uri uri = new Uri (url);
WebRequest req = WebRequest.Create (url + "?" + qs);
HttpCookieCollection cookies = Request.Cookies;
int last = cookies.Count;
if (last > 0) {
CookieContainer container = new CookieContainer ();
for (int i = 0; i < last; i++) {
HttpCookie hcookie = cookies [i];
Cookie cookie = new Cookie (hcookie.Name, hcookie.Value, hcookie.Path, hcookie.Domain);
container.Add (uri, cookie);
}
((HttpWebRequest) req).CookieContainer = container;
}
WebResponse resp = req.GetResponse();
StreamReader sr = new StreamReader (resp.GetResponseStream());
string s = sr.ReadToEnd ();
sr.Close ();
return "<div class='code-xml'>" + ColorizeXml(WrapText(s,CodeTextColumns)) + "</div>";
}
catch (Exception ex)
{
string res = "<b style='color:red'>" + ex.Message + "</b>";
WebException wex = ex as WebException;
if (wex != null)
{
WebResponse resp = wex.Response;
if (resp != null) {
StreamReader sr = new StreamReader (resp.GetResponseStream());
string s = sr.ReadToEnd ();
sr.Close ();
res += "<div class='code-xml'>" + ColorizeXml(WrapText(s,CodeTextColumns)) + "</div>";
}
}
return res;
}
}
string GenerateOperationMessages (string protocol, bool generateInput)
@@ -1515,7 +1526,7 @@ public class HtmlSampleGenerator: SampleGenerator
</script>
<head runat="server">
<head>
<link rel="alternate" type="text/xml" href="<%=Request.FilePath%>?disco"/>
<title><%=WebServiceName%> Web Service</title>
@@ -1548,73 +1559,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, "&nbsp;");
re = /\t/g;
text = text.replace (re, "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;");
re = /\<\s*(\/?)\s*(.*?)\s*(\/?)\s*\>/g;
text = text.replace (re,"{blue:&lt;$1}{maroon:$2}{blue:$3&gt;}");
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";
@@ -1668,9 +1613,9 @@ function clearForm ()
<p class="label">Web Service Overview</p>
<%=WebServiceDescription%>
<br/><br/>
<% if (ProfileViolations != null && ProfileViolations.Count > 0) { %>
<% if (ProfileViolations.Count > 0) { %>
<p class="label">Basic Profile Conformance</p>
This web service does not conform to WS-I Basic Profile v1.1
This web service does not conform to WS-I Basic Profile v1.0
<%
Response.Write ("<ul>");
foreach (BasicProfileViolation vio in ProfileViolations) {
@@ -1771,11 +1716,7 @@ This service does not contain any public web method.
</form>
<div id="testFormResult" style="display:<%= (HasFormResult?"block":"none") %>">
The web service returned the following result:<br/><br/>
<div class="codePanel" id="testresult_div">
</div>
<script language="javascript">
getXML ("<%= GetOrPost () %>", "<%= GetTestResultUrl () %>", "<%= GetQS () %>");
</script>
<div class="codePanel"><%=GetTestResult()%></div>
</div>
<% } else {%>
The test form is not available for this operation because it has parameters with a complex structure.
+8 -35
View File
@@ -16,8 +16,6 @@
<%@ Import Namespace="System.Xml.Schema" %>
<%@ Import Namespace="System.Web.Services" %>
<%@ Import Namespace="System.Web.Services.Description" %>
<%@ Import Namespace="System.Web.Services.Configuration" %>
<%@ Import Namespace="System.Web.Configuration" %>
<%@ Import Namespace="System" %>
<%@ Import Namespace="System.Net" %>
<%@ Import Namespace="System.Globalization" %>
@@ -27,7 +25,6 @@
<%@ Import Namespace="System.CodeDom.Compiler" %>
<%@ Import Namespace="Microsoft.CSharp" %>
<%@ Import Namespace="Microsoft.VisualBasic" %>
<%@ Import Namespace="System.Text" %>
<%@ Import Namespace="System.Text.RegularExpressions" %>
<%@ Assembly name="System.Web.Services" %>
<%@ Page debug="true" %>
@@ -91,9 +88,7 @@ void Page_Load(object sender, EventArgs e)
Page.DataBind();
ProfileViolations = new BasicProfileViolationCollection ();
foreach (WsiProfilesElement claims in ((WebServicesSection) WebConfigurationManager.GetSection("system.web/webServices")).ConformanceWarnings)
if (claims.Name != WsiProfiles.None)
WebServicesInteroperability.CheckConformance (claims.Name, descriptions, ProfileViolations);
//WebServicesInteroperability.CheckConformance (WsiClaims.BP10, descriptions, ProfileViolations);
}
void BuildOperationInfo ()
@@ -127,10 +122,7 @@ void BuildOperationInfo ()
CurrentOperationProtocols += (string) prots[n];
}
WebServiceProtocols testProtocols = WebServiceProtocols.HttpGet | WebServiceProtocols.HttpPost;
if (Context.Request.IsLocal)
testProtocols |= WebServiceProtocols.HttpPostLocalhost;
CurrentOperationSupportsTest = (WebServicesSection.Current.EnabledProtocols & testProtocols) != 0;
CurrentOperationSupportsTest = prots.Contains ("HttpGet") || prots.Contains ("HttpPost");
// Operation format
OperationBinding obin = FindOperation (binding, CurrentOperationName);
@@ -304,8 +296,7 @@ OperationBinding FindOperation (Binding binding, string name)
string FormatBindingName (string name)
{
if (name.EndsWith("Soap")) return "Soap 1.1";
else if (name.EndsWith("Soap12")) return "Soap 1.2";
if (name == DefaultBinding) return "Methods";
else return "Methods for binding<br>" + name;
}
@@ -355,20 +346,7 @@ string GetTestResult ()
{
string url = location + "/" + CurrentOperationName;
Uri uri = new Uri (url);
WebRequest req;
if (CurrentOperationProtocols.IndexOf ("HttpGet") < 0) {
req = WebRequest.Create (url + ".invoke");
req.Method="POST";
if (!String.IsNullOrEmpty (qs)) {
req.ContentType = "application/x-www-form-urlencoded";
byte [] postBuffer = Encoding.UTF8.GetBytes (qs);
req.ContentLength = postBuffer.Length;
using (Stream requestStream = req.GetRequestStream())
requestStream.Write (postBuffer, 0, postBuffer.Length);
}
}
else
req = WebRequest.Create (url + ".invoke?" + qs);
WebRequest req = WebRequest.Create (url + ".invoke?" + qs);
HttpCookieCollection cookies = Request.Cookies;
int last = cookies.Count;
if (last > 0) {
@@ -388,7 +366,7 @@ string GetTestResult ()
}
catch (Exception ex)
{
string res = "<b style='color:red'>" + ex.Message + "</b>";
string res = "<b style='color:red'>" + ex.Message + "<br/>" + ex.StackTrace.Replace("\n", "<br/>") + "</b>";
WebException wex = ex as WebException;
if (wex != null)
{
@@ -779,6 +757,7 @@ public class HtmlSampleGenerator: SampleGenerator
static readonly XmlQualifiedName anyType = new XmlQualifiedName ("anyType",XmlSchema.Namespace);
static readonly XmlQualifiedName arrayType = new XmlQualifiedName ("Array","http://schemas.xmlsoap.org/soap/encoding/");
static readonly XmlQualifiedName arrayTypeRefName = new XmlQualifiedName ("arrayType","http://schemas.xmlsoap.org/soap/encoding/");
const string SoapEnvelopeNamespace = "http://schemas.xmlsoap.org/soap/envelope/";
const string WsdlNamespace = "http://schemas.xmlsoap.org/wsdl/";
const string SoapEncodingNamespace = "http://schemas.xmlsoap.org/soap/encoding/";
@@ -913,10 +892,6 @@ public class HtmlSampleGenerator: SampleGenerator
public string GenerateSoapMessage (OperationBinding obin, Operation oper, OperationMessage msg)
{
string SoapEnvelopeNamespace = "http://schemas.xmlsoap.org/soap/envelope/";
if(obin.Binding.Name.EndsWith("Soap12"))
SoapEnvelopeNamespace = "http://www.w3.org/2003/05/soap-envelope";
SoapOperationBinding sob = obin.Extensions.Find (typeof(SoapOperationBinding)) as SoapOperationBinding;
SoapBindingStyle style = (sob != null) ? sob.Style : SoapBindingStyle.Document;
@@ -1527,7 +1502,7 @@ public class HtmlSampleGenerator: SampleGenerator
.title { color:dimgray; font-family: Arial; font-size:20pt; font-weight:900}
.operationTitle { color:dimgray; font-family: Arial; font-size:15pt; font-weight:900}
.method { font-size: x-small }
.bindingLabel { font-size: medium; font-weight:bold; color:darkgray; line-height:8pt; display:block; margin-bottom:3px }
.bindingLabel { font-size: x-small; font-weight:bold; color:darkgray; line-height:8pt; display:block; margin-bottom:3px }
.label { font-size: small; font-weight:bold; color:darkgray }
.paramTable { font-size: x-small }
.paramTable TR { background-color: gainsboro }
@@ -1576,10 +1551,8 @@ function clearForm ()
<a class="method" href='<%=PageName%>'>Overview</a><br>
<div class="smallSeparator"></div>
<a class="method" href='<%=PageName + "?" + GetPageContext("wsdl")%>'>Service Description</a>
<!--
<div class="smallSeparator"></div>
<a class="method" href='<%=PageName + "?" + GetPageContext("proxy")%>'>Client proxy</a>
-->
<br><br>
<asp:repeater id="BindingsRepeater" runat=server>
<itemtemplate>
@@ -1608,7 +1581,7 @@ function clearForm ()
<br/><br/>
<% if (ProfileViolations.Count > 0) { %>
<p class="label">Basic Profile Conformance</p>
This web service does not conform to WS-I Basic Profile v1.1
This web service does not conform to WS-I Basic Profile v1.0
<%
Response.Write ("<ul>");
foreach (BasicProfileViolation vio in ProfileViolations) {
+2 -6
View File
@@ -1,14 +1,10 @@
SUBDIRS = Browsers
monodir = $(sysconfdir)/mono/2.0
EXTRA_DIST = machine.config \
web.config \
DefaultWsdlHelpGenerator.aspx \
settings.map
DefaultWsdlHelpGenerator.aspx
mono_DATA = machine.config \
web.config \
DefaultWsdlHelpGenerator.aspx \
settings.map
DefaultWsdlHelpGenerator.aspx
+29 -111
View File
@@ -6,92 +6,58 @@
<section name="configProtectedData" type="System.Configuration.ProtectedConfigurationSection, System.Configuration, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<section name="appSettings" type="System.Configuration.AppSettingsSection, System.Configuration, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<section name="connectionStrings" type="System.Configuration.ConnectionStringsSection, System.Configuration, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<section name="mscorlib" type="System.Configuration.IgnoreSection, System.Configuration, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" allowLocation="false"/>
<section name="runtime" type="System.Configuration.IgnoreSection, System.Configuration, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" allowLocation="false"/>
<section name="assemblyBinding" type="System.Configuration.IgnoreSection, System.Configuration, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" allowLocation="false" />
<section name="satelliteassemblies" type="System.Configuration.IgnoreSection, System.Configuration, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" allowLocation="false" />
<section name="startup" type="System.Configuration.IgnoreSection, System.Configuration, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" allowLocation="false"/>
<section name="mscorlib" type="System.Configuration.IgnoreSection, System.Configuration, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<section name="runtime" type="System.Configuration.IgnoreSection, System.Configuration, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<section name="startup" type="System.Configuration.IgnoreSection, System.Configuration, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<section name="system.codedom" type="System.CodeDom.Compiler.CodeDomConfigurationHandler, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<section name="system.data" type="System.Data.Common.DbProviderFactoriesConfigurationHandler, System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<section name="system.diagnostics" type="System.Diagnostics.DiagnosticsConfigurationHandler, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<section name="system.runtime.remoting" type="System.Configuration.IgnoreSection, System.Configuration, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowLocation="false"/>
<section name="system.windows.forms" type="System.Windows.Forms.WindowsFormsSection, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<section name="windows" type="System.Configuration.IgnoreSection, System.Configuration, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" allowLocation="false" />
<section name="strongNames" type="System.Configuration.IgnoreSection, System.Configuration, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowLocation="false"/>
<sectionGroup name="system.web" type="System.Web.Configuration.SystemWebSectionGroup, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<section name="anonymousIdentification" type="System.Web.Configuration.AnonymousIdentificationSection, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" allowDefinition="MachineToApplication"/>
<section name="authentication" type="System.Web.Configuration.AuthenticationSection, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" allowDefinition="MachineToApplication"/>
<section name="anonymousIdentification" type="System.Web.Configuration.AnonymousIdentificationSection, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<section name="authentication" type="System.Web.Configuration.AuthenticationSection, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<section name="authorization" type="System.Web.Configuration.AuthorizationSection, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<section name="browserCaps" type="System.Configuration.IgnoreSection, System.Configuration, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<section name="clientTarget" type="System.Web.Configuration.ClientTargetSection, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<section name="compilation" type="System.Web.Configuration.CompilationSection, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<section name="customErrors" type="System.Web.Configuration.CustomErrorsSection, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<section name="deployment" type="System.Web.Configuration.DeploymentSection, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" allowDefinition="MachineOnly" />
<section name="globalization" type="System.Web.Configuration.GlobalizationSection, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<section name="healthMonitoring" type="System.Web.Configuration.HealthMonitoringSection, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" allowDefinition="MachineToApplication"/>
<section name="hostingEnvironment" type="System.Web.Configuration.HostingEnvironmentSection, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" allowDefinition="MachineToApplication" />
<section name="httpCookies" type="System.Web.Configuration.HttpCookiesSection, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<section name="httpHandlers" type="System.Web.Configuration.HttpHandlersSection, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<section name="httpModules" type="System.Web.Configuration.HttpModulesSection, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<section name="httpRuntime" type="System.Web.Configuration.HttpRuntimeSection, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<section name="identity" type="System.Web.Configuration.IdentitySection, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<section name="machineKey" type="System.Web.Configuration.MachineKeySection, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<section name="membership" type="System.Web.Configuration.MembershipSection, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<section name="mobileControls" type="System.Configuration.IgnoreSection, System.Configuration, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<section name="deviceFilters" type="System.Configuration.IgnoreSection, System.Configuration, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<section name="pages" type="System.Web.Configuration.PagesSection, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<section name="processModel" type="System.Web.Configuration.ProcessModelSection, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" allowDefinition="MachineOnly" allowLocation="false" />
<section name="profile" type="System.Web.Configuration.ProfileSection, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" allowDefinition="MachineToApplication"/>
<section name="roleManager" type="System.Web.Configuration.RoleManagerSection, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" allowDefinition="MachineToApplication"/>
<section name="securityPolicy" type="System.Web.Configuration.SecurityPolicySection, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" allowDefinition="MachineToApplication" />
<section name="sessionPageState" type="System.Web.Configuration.SessionPageStateSection, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<section name="sessionState" type="System.Web.Configuration.SessionStateSection, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" allowDefinition="MachineToApplication"/>
<section name="siteMap" type="System.Web.Configuration.SiteMapSection, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" allowDefinition="MachineToApplication"/>
<section name="profile" type="System.Web.Configuration.ProfileSection, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<section name="roleManager" type="System.Web.Configuration.RoleManagerSection, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<section name="sessionState" type="System.Web.Configuration.SessionStateSection, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<section name="siteMap" type="System.Web.Configuration.SiteMapSection, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<section name="trace" type="System.Web.Configuration.TraceSection, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<section name="trust" type="System.Web.Configuration.TrustSection, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" allowDefinition="MachineToApplication" />
<section name="urlMappings" type="System.Web.Configuration.UrlMappingsSection, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" allowDefinition="MachineToApplication"/>
<section name="webControls" type="System.Web.Configuration.WebControlsSection, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<section name="webParts" type="System.Web.Configuration.WebPartsSection, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<section name="webServices" type="System.Web.Services.Configuration.WebServicesSection, System.Web.Services, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<section name="xhtmlConformance" type="System.Web.Configuration.XhtmlConformanceSection, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<section name="xhtmlConformance" type="System.Web.Services.Configuration.XhtmlConformanceSection, System.Web.Services, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<sectionGroup name="caching" type="System.Web.Configuration.SystemWebCachingSectionGroup, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<section name="cache" type="System.Web.Configuration.CacheSection, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" allowDefinition="MachineToApplication"/>
<section name="outputCache" type="System.Web.Configuration.OutputCacheSection, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" allowDefinition="MachineToApplication"/>
<section name="outputCacheSettings" type="System.Web.Configuration.OutputCacheSettingsSection, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" allowDefinition="MachineToApplication"/>
<section name="sqlCacheDependency" type="System.Web.Configuration.OutputCacheSettingsSection, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" allowDefinition="MachineToApplication"/>
<section name="cache" type="System.Web.Configuration.CacheSection, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<section name="outputCache" type="System.Web.Configuration.OutputCacheSection, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<section name="outputCacheSettings" type="System.Web.Configuration.OutputCacheSettingsSection, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<section name="sqlCacheDependency" type="System.Web.Configuration.OutputCacheSettingsSection, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
</sectionGroup>
<section name="monoSettings" type="System.Web.Configuration.MonoSettingsSection, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
</sectionGroup>
<sectionGroup name="system.net" type="System.Net.Configuration.NetSectionGroup, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<section name="authenticationModules" type="System.Net.Configuration.AuthenticationModulesSection, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<section name="connectionManagement" type="System.Net.Configuration.ConnectionManagementSection, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<section name="defaultProxy" type="System.Net.Configuration.DefaultProxySection, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<sectionGroup name="mailSettings" type="System.Net.Configuration.MailSettingsSectionGroup, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<section name="smtp" type="System.Net.Configuration.SmtpSection, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
</sectionGroup>
<section name="requestCaching" type="System.Net.Configuration.RequestCachingSection, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<section name="settings" type="System.Net.Configuration.SettingsSection, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<section name="webRequestModules" type="System.Net.Configuration.WebRequestModulesSection, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<sectionGroup name="system.net">
<section name="settings"
type="System.Net.Configuration.SettingsSection, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<section name="connectionManagement"
type="System.Net.Configuration.ConnectionManagementSection, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<section name="authenticationModules"
type="System.Net.Configuration.NetAuthenticationModuleHandler, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<section name="defaultProxy"
type="System.Net.Configuration.DefaultProxySection, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<section name="webRequestModules"
type="System.Net.Configuration.WebRequestModulesSection, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
</sectionGroup>
<section name="system.drawing" type="System.Configuration.NameValueSectionHandler, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<sectionGroup name="system.serviceModel" type="System.ServiceModel.Configuration.ServiceModelSectionGroup, System.ServiceModel, Version=3.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<section name="behaviors" type="System.ServiceModel.Configuration.BehaviorsSection, System.ServiceModel, Version=3.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<section name="bindings" type="System.ServiceModel.Configuration.BindingsSection, System.ServiceModel, Version=3.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<section name="client" type="System.ServiceModel.Configuration.ClientSection, System.ServiceModel, Version=3.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<section name="commonBehaviors" type="System.ServiceModel.Configuration.CommonBehaviorsSection, System.ServiceModel, Version=3.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<section name="diagnostic" type="System.ServiceModel.Configuration.DiagnosticSection, System.ServiceModel, Version=3.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<section name="extensions" type="System.ServiceModel.Configuration.ExtensionsSection, System.ServiceModel, Version=3.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<section name="serviceHostingEnvironment" type="System.ServiceModel.Configuration.ServiceHostingEnvironmentSection, System.ServiceModel, Version=3.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<section name="services" type="System.ServiceModel.Configuration.ServicesSection, System.ServiceModel, Version=3.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
</sectionGroup>
<section name="system.webServer" type="System.Configuration.IgnoreSection, System.Configuration, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
</configSections>
<connectionStrings>
<add name="LocalSqlServer" connectionString="data source=.\SQLEXPRESS;Integrated Security=SSPI;AttachDBFilename=|DataDirectory|aspnetdb.mdf;User Instance=true" providerName="System.Data.SqlClient"/>
<add name="LocalSqliteServer" connectionString="Data Source=|DataDirectory|/aspnetdb.sqlite;version=3" providerName="Mono.Data.Sqlite"/>
</connectionStrings>
<configProtectedData defaultProvider="RsaProtectedConfigurationProvider">
<providers>
<add name="RsaProtectedConfigurationProvider" type="System.Configuration.RsaProtectedConfigurationProvider, System.Configuration, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"
@@ -102,6 +68,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" />
@@ -161,32 +130,6 @@
<system.drawing>
</system.drawing>
<system.data>
<DbProviderFactories>
<add name="Mono Sqlite Data Provider" invariant="Mono.Data.SqliteClient"
description="Mono Framework Data Provider for SQLite (old version)"
type="Mono.Data.SqliteClient.SqliteFactory, Mono.Data.SqliteClient, Version=2.0.0.0, Culture=neutral, PublicKeyToken=0738eb9f132ed756"/>
<add name="Mono Sqlite Provider" invariant="Mono.Data.Sqlite"
description="Mono Framework Data Provider for SQLite (new version)"
type="Mono.Data.Sqlite.SqliteFactory, Mono.Data.Sqlite, Version=2.0.0.0, Culture=neutral, PublicKeyToken=0738eb9f132ed756"/>
<add name="Odbc Data Provider" invariant="System.Data.Odbc"
description=".Net Framework Data Provider for Odbc"
type="System.Data.Odbc.OdbcFactory, System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"/>
<add name="OleDb Data Provider" invariant="System.Data.OleDb"
description=".Net Framework Data Provider for OleDb"
type="System.Data.OleDb.OleDbFactory, System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"/>
<add name="OracleClient Data Provider" invariant="System.Data.OracleClient"
description=".Net Framework Data Provider for Oracle"
type="System.Data.OracleClient.OracleClientFactory, System.Data.OracleClient, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"/>
<add name="SqlClient Data Provider" invariant="System.Data.SqlClient"
description=".Net Framework Data Provider for SqlServer"
type="System.Data.SqlClient.SqlClientFactory, System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"/>
<add name="Sybase Data Provider" invariant="Mono.Data.SybaseClient"
description=".Net Framework Data Provider for Sybase"
type="Mono.Data.SybaseClient.SybaseClientFactory, Mono.Data.SybaseClient, Version=2.0.0.0, Culture=neutral, PublicKeyToken=0738eb9f132ed756"/>
</DbProviderFactories>
</system.data>
<mscorlib>
<cryptographySettings>
<cryptoNameMapping>
@@ -197,7 +140,6 @@
</cryptoNameMapping>
<oidMap>
<oidEntry OID="1.2.840.113549.2.2" name="MD2" />
<oidEntry OID="1.2.840.113549.2.2" name="Mono.Security.Cryptography.MD2Managed" />
</oidMap>
</cryptographySettings>
</mscorlib>
@@ -212,45 +154,21 @@
<map Token="31bf3856ad364e35" PublicKey="002400000480000094000000060200000024000052534131000400000100010079159977d2d03a8e6bea7a2e74e8d1afcc93e8851974952bb480a12c9134474d04062447c37e0e68c080536fcf3c3fbe2ff9c979ce998475e506e8ce82dd5b0f350dc10e93bf2eeecf874b24770c5081dbea7447fddafa277b22de47d6ffea449674a4f9fccf84d15069089380284dbdd35f46cdff12a1bd78e4ef0065d016df" />
<!-- IBM (DB2 Data Provider) key -->
<map Token="7c307b91aa13d208" PublicKey="002400000480000094000000060200000024000052534131000400000100010079159977d2d03a8e6bea7a2e74e8d1afcc93e8851974952bb480a12c9134474d04062447c37e0e68c080536fcf3c3fbe2ff9c979ce998475e506e8ce82dd5b0f350dc10e93bf2eeecf874b24770c5081dbea7447fddafa277b22de47d6ffea449674a4f9fccf84d15069089380284dbdd35f46cdff12a1bd78e4ef0065d016df" />
<!-- Silverlight 2.0 key -->
<map Token="7cec85d7bea7798e" PublicKey="002400000480000094000000060200000024000052534131000400000100010079159977d2d03a8e6bea7a2e74e8d1afcc93e8851974952bb480a12c9134474d04062447c37e0e68c080536fcf3c3fbe2ff9c979ce998475e506e8ce82dd5b0f350dc10e93bf2eeecf874b24770c5081dbea7447fddafa277b22de47d6ffea449674a4f9fccf84d15069089380284dbdd35f46cdff12a1bd78e4ef0065d016df" />
</pubTokenMapping>
</strongNames>
<system.web>
<webServices>
<protocols>
<add name="HttpSoap"/>
<add name="HttpSoap12"/>
<add name="HttpPost"/>
<add name="HttpGet"/>
<add name="Documentation"/>
</protocols>
<conformanceWarnings>
<add name="BasicProfile1_1"/>
</conformanceWarnings>
<wsdlHelpGenerator href="DefaultWsdlHelpGenerator.aspx" />
</webServices>
<membership>
<providers>
<add name="AspNetSqlMembershipProvider" type="System.Web.Security.SqlMembershipProvider, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" connectionStringName="LocalSqlServer" enablePasswordRetrieval="false" enablePasswordReset="true" requiresQuestionAndAnswer="true" applicationName="/" requiresUniqueEmail="false" passwordFormat="Hashed" maxInvalidPasswordAttempts="5" minRequiredPasswordLength="7" minRequiredNonalphanumericCharacters="1" passwordAttemptWindow="10" passwordStrengthRegularExpression=""/>
<!-- <add name="AspNetSqlMembershipProvider" type="Mainsoft.Web.Security.GenericMembershipProvider, Mainsoft.Web.Security" applicationName="/" connectionStringName="LocalSqlServer" /> -->
<add name="AspNetSqlMembershipProvider" type="System.Web.Security.SqlMembershipProvider, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" applicationName="/" connectionStringName="LocalSqlServer" />
</providers>
</membership>
<roleManager>
<providers>
<add name="AspNetSqlRoleProvider" type="System.Web.Security.SqlRoleProvider, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" applicationName="/" connectionStringName="LocalSqlServer" />
<!-- <add name="AspNetSqlRoleProvider" type="Mainsoft.Web.Security.GenericRoleProvider, Mainsoft.Web.Security" applicationName="/" connectionStringName="LocalSqlServer" /> -->
</providers>
</roleManager>
<profile>
<providers>
<add name="AspNetSqlProfileProvider" connectionStringName="LocalSqlServer" applicationName="/" type="System.Web.Profile.SqlProfileProvider, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
</providers>
</profile>
</system.web>
</configuration>
-517
View File
@@ -1,517 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<configSections>
<section name="assemblyBinding" type="System.Configuration.IgnoreSection, System.Configuration, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" allowLocation="false" />
<section name="satelliteassemblies" type="System.Configuration.IgnoreSection, System.Configuration, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" allowLocation="false" />
<section name="configProtectedData" type="System.Configuration.ProtectedConfigurationSection, System.Configuration, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<section name="appSettings" type="System.Configuration.AppSettingsSection, System.Configuration, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<section name="connectionStrings" type="System.Configuration.ConnectionStringsSection, System.Configuration, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<section name="mscorlib" type="System.Configuration.IgnoreSection, System.Configuration, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<section name="runtime" type="System.Configuration.IgnoreSection, System.Configuration, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<section name="startup" type="System.Configuration.IgnoreSection, System.Configuration, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<section name="system.codedom" type="System.Configuration.IgnoreSection, System.Configuration, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<section name="system.data.dataset" type="System.Configuration.IgnoreSection, System.Configuration, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<section name="system.data.odbc" type="System.Configuration.IgnoreSection, System.Configuration, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<section name="system.data.oledb" type="System.Configuration.IgnoreSection, System.Configuration, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<section name="system.data.oracleclient" type="System.Configuration.IgnoreSection, System.Configuration, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<section name="system.data.sqlclient" type="System.Configuration.IgnoreSection, System.Configuration, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<section name="system.windows.forms" type="System.Configuration.IgnoreSection, System.Configuration, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<section name="windows" type="System.Configuration.IgnoreSection, System.Configuration, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" allowLocation="false" />
<section name="system.data" type="System.Data.Common.DbProviderFactoriesConfigurationHandler, System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<section name="system.diagnostics" type="System.Diagnostics.DiagnosticsConfigurationHandler, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<section name="system.runtime.remoting" type="System.Configuration.IgnoreSection, System.Configuration, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowLocation="false"/>
<section name="strongNames" type="System.Configuration.IgnoreSection, System.Configuration, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowLocation="false"/>
<sectionGroup name="system.web" type="System.Web.Configuration.SystemWebSectionGroup, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<section name="anonymousIdentification" type="System.Web.Configuration.AnonymousIdentificationSection, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" allowDefinition="MachineToApplication" />
<section name="authentication" type="System.Web.Configuration.AuthenticationSection, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" allowDefinition="MachineToApplication" />
<section name="authorization" type="System.Web.Configuration.AuthorizationSection, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<section name="clientTarget" type="System.Web.Configuration.ClientTargetSection, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<section name="compilation" type="System.Web.Configuration.CompilationSection, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<section name="customErrors" type="System.Web.Configuration.CustomErrorsSection, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<section name="globalization" type="System.Web.Configuration.GlobalizationSection, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<section name="httpHandlers" type="System.Web.Configuration.HttpHandlersSection, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<section name="httpModules" type="System.Web.Configuration.HttpModulesSection, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<section name="httpRuntime" type="System.Web.Configuration.HttpRuntimeSection, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<section name="machineKey" type="System.Web.Configuration.MachineKeySection, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" allowDefinition="MachineToApplication" />
<section name="membership" type="System.Web.Configuration.MembershipSection, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" allowDefinition="MachineToApplication" />
<section name="mobileControls" type="System.Configuration.IgnoreSection, System.Configuration, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<section name="deviceFilters" type="System.Configuration.IgnoreSection, System.Configuration, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<section name="pages" type="System.Web.Configuration.PagesSection, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<section name="profile" type="System.Web.Configuration.ProfileSection, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" allowDefinition="MachineToApplication" />
<section name="roleManager" type="System.Web.Configuration.RoleManagerSection, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" allowDefinition="MachineToApplication" />
<section name="sessionState" type="System.Web.Configuration.SessionStateSection, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" allowDefinition="MachineToApplication" />
<section name="siteMap" type="System.Web.Configuration.SiteMapSection, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" allowDefinition="MachineToApplication" />
<section name="trace" type="System.Web.Configuration.TraceSection, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<section name="urlMappings" type="System.Web.Configuration.UrlMappingsSection, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" allowDefinition="MachineToApplication" />
<section name="webControls" type="System.Web.Configuration.WebControlsSection, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<section name="webServices" type="System.Web.Services.Configuration.WebServicesSection, System.Web.Services, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<section name="xhtmlConformance" type="System.Web.Configuration.XhtmlConformanceSection, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<section name="browserCaps" type="System.Configuration.IgnoreSection, System.Configuration, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<section name="deployment" type="System.Configuration.IgnoreSection, System.Configuration, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" allowDefinition="MachineOnly" />
<section name="healthMonitoring" type="System.Configuration.IgnoreSection, System.Configuration, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" allowDefinition="MachineToApplication" />
<section name="hostingEnvironment" type="System.Configuration.IgnoreSection, System.Configuration, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" allowDefinition="MachineToApplication" />
<section name="httpCookies" type="System.Configuration.IgnoreSection, System.Configuration, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<section name="identity" type="System.Configuration.IgnoreSection, System.Configuration, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<section name="processModel" type="System.Configuration.IgnoreSection, System.Configuration, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" allowDefinition="MachineOnly" allowLocation="false" />
<section name="securityPolicy" type="System.Configuration.IgnoreSection, System.Configuration, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" allowDefinition="MachineToApplication" />
<section name="sessionPageState" type="System.Configuration.IgnoreSection, System.Configuration, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<section name="trust" type="System.Configuration.IgnoreSection, System.Configuration, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" allowDefinition="MachineToApplication" />
<section name="webParts" type="System.Configuration.IgnoreSection, System.Configuration, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<section name="system.webServer" type="System.Configuration.IgnoreSection, System.Configuration, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<sectionGroup name="caching" type="System.Web.Configuration.SystemWebCachingSectionGroup, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<section name="cache" type="System.Web.Configuration.CacheSection, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" allowDefinition="MachineToApplication" />
<section name="outputCache" type="System.Web.Configuration.OutputCacheSection, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" allowDefinition="MachineToApplication" />
<section name="outputCacheSettings" type="System.Web.Configuration.OutputCacheSettingsSection, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" allowDefinition="MachineToApplication" />
<section name="sqlCacheDependency" type="System.Web.Configuration.OutputCacheSettingsSection, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" allowDefinition="MachineToApplication" />
</sectionGroup>
</sectionGroup>
<sectionGroup name="system.xml.serialization" type="System.Configuration.IgnoreSection, System.Configuration, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<section name="schemaImporterExtensions" type="System.Configuration.IgnoreSection, System.Configuration, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<section name="dateTimeSerialization" type="System.Configuration.IgnoreSection, System.Configuration, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<section name="xmlSerializer" type="System.Configuration.IgnoreSection, System.Configuration, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" requirePermission="false" />
</sectionGroup>
<sectionGroup name="system.net" type="System.Net.Configuration.NetSectionGroup, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<section name="authenticationModules" type="System.Net.Configuration.AuthenticationModulesSection, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<section name="connectionManagement" type="System.Net.Configuration.ConnectionManagementSection, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<section name="defaultProxy" type="System.Net.Configuration.DefaultProxySection, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<sectionGroup name="mailSettings" type="System.Net.Configuration.MailSettingsSectionGroup, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<section name="smtp" type="System.Net.Configuration.SmtpSection, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
</sectionGroup>
<section name="requestCaching" type="System.Net.Configuration.RequestCachingSection, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<section name="settings" type="System.Net.Configuration.SettingsSection, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<section name="webRequestModules" type="System.Net.Configuration.WebRequestModulesSection, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
</sectionGroup>
<sectionGroup name="system.transactions" type="System.Configuration.IgnoreSection, System.Configuration, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<section name="defaultSettings" type="System.Configuration.IgnoreSection, System.Configuration, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<section name="machineSettings" type="System.Configuration.IgnoreSection, System.Configuration, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" allowDefinition="MachineOnly" />
</sectionGroup>
<section name="system.drawing" type="System.Configuration.NameValueSectionHandler, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<sectionGroup name="mainsoft.drawing">
<section name="icons" type="System.Configuration.NameValueSectionHandler, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<section name="codecs" type="System.Configuration.NameValueSectionHandler, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<section name="codecsmetadata" type="Mainsoft.Drawing.Configuration.ResolutionConfigurationHandler" />
</sectionGroup>
<sectionGroup name="mainsoft.directoryservices">
<section name="settings" type="System.Configuration.NameValueSectionHandler, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"/>
</sectionGroup>
<sectionGroup name="Mainsoft.Data.Configuration">
<section name="objectnameresolution"
type="System.Data.Configuration.ObjectNameResolutionSectionHandler, System.Data" />
<section name="switches"
type="System.Configuration.NameValueSectionHandler, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<section name="OleDbProviders"
type="Mainsoft.Data.Configuration.ProvidersSectionHandler, System.Data" />
<section name="SqlClientProviders"
type="Mainsoft.Data.Configuration.ProvidersSectionHandler, System.Data" />
<section name="OracleClientProviders"
type="Mainsoft.Data.Configuration.ProvidersSectionHandler, System.Data" />
</sectionGroup>
</configSections>
<configProtectedData defaultProvider="RsaProtectedConfigurationProvider">
<providers>
<add name="RsaProtectedConfigurationProvider" type="System.Configuration.RsaProtectedConfigurationProvider, System.Configuration, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"
description="" keyContainerName="MonoFrameworkConfigurationKey" cspProviderName="" useMachineContainer="true" useOAEP="false" />
<add name="DataProtectionConfigurationProvider" type="System.Configuration.DpapiProtectedConfigurationProvider, System.Configuration, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"
description="" useMachineProtection="true" keyEntropy="" />
</providers>
</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" />
<!-- <add type="System.Net.NtlmClient, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" /> -->
</authenticationModules>
<webRequestModules>
<add prefix="http" type="System.Net.HttpRequestCreator, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<add prefix="https" type="System.Net.HttpRequestCreator, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<add prefix="file" type="System.Net.FileWebRequestCreator, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<add prefix="ftp" type="System.Net.FtpRequestCreator, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
</webRequestModules>
<settings>
<ipv6 enabled="false"/>
</settings>
</system.net>
<system.runtime.remoting>
<application>
<channels>
<channel ref="http client" displayName="http client (delay loaded)" delayLoadAsClientChannel="true" />
<channel ref="tcp client" displayName="tcp client (delay loaded)" delayLoadAsClientChannel="true" />
<!-- <channel ref="ipc client" displayName="ipc client (delay loaded)" delayLoadAsClientChannel="true" /> -->
</channels>
</application>
<channels>
<channel id="http" type="System.Runtime.Remoting.Channels.Http.HttpChannel, System.Runtime.Remoting, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<channel id="http client" type="System.Runtime.Remoting.Channels.Http.HttpClientChannel, System.Runtime.Remoting, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<channel id="http server" type="System.Runtime.Remoting.Channels.Http.HttpServerChannel, System.Runtime.Remoting, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<channel id="tcp" type="System.Runtime.Remoting.Channels.Tcp.TcpChannel, System.Runtime.Remoting, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<channel id="tcp client" type="System.Runtime.Remoting.Channels.Tcp.TcpClientChannel, System.Runtime.Remoting, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<channel id="tcp server" type="System.Runtime.Remoting.Channels.Tcp.TcpServerChannel, System.Runtime.Remoting, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<!-- <channel id="ipc" type="System.Runtime.Remoting.Channels.Ipc.IpcChannel, System.Runtime.Remoting, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<channel id="ipc client" type="System.Runtime.Remoting.Channels.Ipc.IpcClientChannel, System.Runtime.Remoting, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<channel id="ipc server" type="System.Runtime.Remoting.Channels.Ipc.IpcServerChannel, System.Runtime.Remoting, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" /> -->
</channels>
<channelSinkProviders>
<clientProviders>
<formatter id="soap" type="System.Runtime.Remoting.Channels.SoapClientFormatterSinkProvider, System.Runtime.Remoting, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<formatter id="binary" type="System.Runtime.Remoting.Channels.BinaryClientFormatterSinkProvider, System.Runtime.Remoting, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
</clientProviders>
<serverProviders>
<formatter id="soap" type="System.Runtime.Remoting.Channels.SoapServerFormatterSinkProvider, System.Runtime.Remoting, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<formatter id="binary" type="System.Runtime.Remoting.Channels.BinaryServerFormatterSinkProvider, System.Runtime.Remoting, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<provider id="wsdl" type="System.Runtime.Remoting.MetadataServices.SdlChannelSinkProvider, System.Runtime.Remoting, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
</serverProviders>
</channelSinkProviders>
</system.runtime.remoting>
<appSettings>
<!--<add key="yourkey" value="your value" /> -->
<!--<remove key="a key defined higher in the hierarchy" /> -->
<!--<clear/> Removes all defined settings -->
</appSettings>
<system.diagnostics>
<trace autoflush="false" indentsize="4" />
</system.diagnostics>
<system.drawing>
</system.drawing>
<connectionStrings>
<add name="EmbeddedDerby" connectionString="JdbcDriverClassName=org.apache.derby.jdbc.EmbeddedDriver;JdbcURL=jdbc:derby:|DataDirectory|aspnetdb;create=true" providerName="System.Data.OleDb" />
</connectionStrings>
<system.data>
<DbProviderFactories>
<add name="OleDb Data Provider" support="2" invariant="System.Data.OleDb" description=".Net Framework Data Provider for OleDb" type="System.Data.OleDb.OleDbFactory, System.Data" />
<add name="OracleClient Data Provider" support="2" invariant="System.Data.OracleClient" description=".Net Framework Data Provider for Oracle" type="System.Data.OracleClient.OracleClientFactory, System.Data.OracleClient" />
<add name="SqlClient Data Provider" support="2" invariant="System.Data.SqlClient" description=".Net Framework Data Provider for SqlServer" type="System.Data.SqlClient.SqlClientFactory, System.Data" />
</DbProviderFactories>
</system.data>
<system.web>
<authorization>
<allow users="*" />
</authorization>
<httpHandlers>
<add verb="*" path="Trace.axd" type="System.Web.Handlers.TraceHandler, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<add verb="*" path="trace.axd" type="System.Web.Handlers.TraceHandler, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<add verb="*" path="*.aspx" type="Mainsoft.Web.Hosting.ServletFacesPageHandlerFactory, Mainsoft.Web" />
<add verb="*" path="*.asmx" validate="false" type="System.Web.Services.Protocols.WebServiceHandlerFactory, System.Web.Services, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<!-- <add verb="*" path="*.ashx" type="System.Web.UI.SimpleHandlerFactory, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" /> -->
<add verb="*" path="*.ashx" type="System.Web.UI.PageHandlerFactory, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<add verb="GET" path="WebResource.axd" type="System.Web.Handlers.AssemblyResourceLoader, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<add verb="*" path="*.master" type="System.Web.HttpForbiddenHandler, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<add verb="*" path="*.resources" type="System.Web.HttpForbiddenHandler, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<add verb="*" path="*.skin" type="System.Web.HttpForbiddenHandler, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<add verb="*" path="*.browser" type="System.Web.HttpForbiddenHandler, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<add verb="*" path="*.sitemap" type="System.Web.HttpForbiddenHandler, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<add verb="*" path="*.webinfo" type="System.Web.HttpForbiddenHandler, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<add verb="*" path="*.resx" type="System.Web.HttpForbiddenHandler, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<add verb="*" path="*.asax" type="System.Web.HttpForbiddenHandler, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<add verb="*" path="*.ascx" type="System.Web.HttpForbiddenHandler, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<add verb="*" path="*.config" type="System.Web.HttpForbiddenHandler, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<add verb="*" path="*.cs" type="System.Web.HttpForbiddenHandler, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<add verb="*" path="*.vb" type="System.Web.HttpForbiddenHandler, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<add verb="*" path="*.csproj" type="System.Web.HttpForbiddenHandler, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<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="*.java" type="System.Web.HttpForbiddenHandler, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<add verb="*" path="*.class" type="System.Web.HttpForbiddenHandler, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<add verb="*" path="*.jar" type="System.Web.HttpForbiddenHandler, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<add verb="*" path="*.exclude" type="System.Web.HttpForbiddenHandler" validate="True" />
<add verb="*" path="*.refresh" type="System.Web.HttpForbiddenHandler" validate="True" />
<add verb="*" path="*.mdf" type="System.Web.HttpForbiddenHandler" validate="True" />
<add verb="*" path="*.ldf" type="System.Web.HttpForbiddenHandler" validate="True" />
<add verb="*" path="*.lck" type="System.Web.HttpForbiddenHandler" validate="True" />
<add verb="*" path="*.properties" type="System.Web.HttpForbiddenHandler" validate="True" />
<add verb="*" path="*.dat" type="System.Web.HttpForbiddenHandler" validate="True" />
<add verb="*" path="*.ctrl" type="System.Web.HttpForbiddenHandler" validate="True" />
<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>
<httpModules>
<add name="OutputCache" type="System.Web.Caching.OutputCacheModule" />
<add name="Session" type="System.Web.SessionState.SessionStateModule" />
<!--add name="WindowsAuthentication" type="System.Web.Security.WindowsAuthenticationModule" /-->
<add name="ServletAuthentication" type="Mainsoft.Web.Security.SevletAuthenticationModule" />
<add name="FormsAuthentication" type="System.Web.Security.FormsAuthenticationModule" />
<!--add name="PassportAuthentication" type="System.Web.Security.PassportAuthenticationModule" /-->
<add name="RoleManager" type="System.Web.Security.RoleManagerModule" />
<add name="UrlAuthorization" type="System.Web.Security.UrlAuthorizationModule" />
<!--add name="FileAuthorization" type="System.Web.Security.FileAuthorizationModule" /-->
<add name="AnonymousIdentification" type="System.Web.Security.AnonymousIdentificationModule" />
<add name="Profile" type="System.Web.Profile.ProfileModule" />
</httpModules>
<machineKey validationKey="AutoGenerate" decryptionKey="AutoGenerate" validation="SHA1" />
<globalization requestEncoding="utf-8"
responseEncoding="utf-8"
fileEncoding="utf-8"/>
<!--
culture="en-US"
uiculture="en-US" />
-->
<sessionState
mode="Custom"
customProvider="ServletSessionStateStore"
sessionIDManagerType="Mainsoft.Web.SessionState.ServletSessionIDManager">
<providers>
<add name="ServletSessionStateStore"
type="Mainsoft.Web.SessionState.ServletSessionStateStoreProvider" />
</providers>
</sessionState>
<webServices>
<protocols>
<add name="HttpSoap"/>
<add name="HttpSoap12"/>
<add name="HttpPostLocalhost"/>
<add name="Documentation"/>
</protocols>
<conformanceWarnings>
<add name="BasicProfile1_1"/>
</conformanceWarnings>
<wsdlHelpGenerator href="DefaultWsdlHelpGenerator.aspx" />
</webServices>
<webControls clientScriptsLocation="/web_scripts" />
<compilation debug="false" defaultLanguage="c#" explicit="true" strict="false" >
<compilers>
<compiler language="cs;c#;csharp" extension=".cs" warningLevel="1" compilerOptions=""
type="Microsoft.CSharp.CSharpCodeProvider, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<compiler language="vb;vbs;visualbasic;vbscript" extension=".vb"
warningLevel="1" compilerOptions=""
type="Microsoft.VisualBasic.VBCodeProvider, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
</compilers>
<assemblies>
<!--<add assembly="mscorlib" /> -->
<add assembly="System" />
<add assembly="System.Xml" />
<add assembly="System.Configuration" />
<add assembly="System.Data" />
<add assembly="System.Web" />
<add assembly="System.Web.Services" />
<add assembly="System.Drawing" />
<add assembly="*" /> <!-- Add assemblies in bin directory -->
</assemblies>
</compilation>
<httpRuntime executionTimeout="90"
maxRequestLength="4096"
useFullyQualifiedRedirectUrl="false"
minFreeThreads="8"
minLocalRequestFreeThreads="4"
appRequestQueueLimit="100" />
<clientTarget>
<add alias="ie5" userAgent="Mozilla/4.0 (compatible; MSIE 5.5; Windows NT 4.0)" />
<add alias="ie4" userAgent="Mozilla/4.0 (compatible; MSIE 4.0; Windows NT 4.0)" />
<add alias="uplevel" userAgent="Mozilla/4.0 (compatible; MSIE 4.0; Windows NT 4.0)" />
<add alias="downlevel" userAgent="Unknown" />
</clientTarget>
<siteMap defaultProvider="AspNetXmlSiteMapProvider">
<providers>
<add name="AspNetXmlSiteMapProvider"
description="Default site map provider that reads in .sitemap xml files."
type="System.Web.XmlSiteMapProvider, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"
siteMapFile="Web.sitemap" />
</providers>
</siteMap>
<membership defaultProvider="AspNetDerbyMembershipProvider">
<providers>
<add name="AspNetDerbyMembershipProvider" connectionStringName="EmbeddedDerby" applicationName="/" type="Mainsoft.Web.Security.DerbyMembershipProvider, Mainsoft.Web" enablePasswordRetrieval="false" enablePasswordReset="true" requiresQuestionAndAnswer="true" requiresUniqueEmail="false" passwordFormat="Hashed" maxInvalidPasswordAttempts="5" minRequiredPasswordLength="7" minRequiredNonalphanumericCharacters="1" passwordAttemptWindow="10" passwordStrengthRegularExpression="" />
<!-- add name="WPSMembershipProvider" applicationName="/" type="Mainsoft.Web.Security.WPSMembershipProvider, Mainsoft.Web.WAS" enablePasswordRetrieval="false" enablePasswordReset="false" requiresQuestionAndAnswer="false" requiresUniqueEmail="false" passwordFormat="Hashed" maxInvalidPasswordAttempts="5" minRequiredPasswordLength="7" minRequiredNonalphanumericCharacters="1" passwordAttemptWindow="10" passwordStrengthRegularExpression="" / -->
</providers>
</membership>
<profile defaultProvider="AspNetDerbyProfileProvider">
<providers>
<add name="AspNetDerbyProfileProvider" connectionStringName="EmbeddedDerby" applicationName="/" type="Mainsoft.Web.Profile.DerbyProfileProvider, Mainsoft.Web" />
</providers>
</profile>
<roleManager defaultProvider="AspNetDerbyRoleProvider">
<providers>
<add name="AspNetDerbyRoleProvider" connectionStringName="EmbeddedDerby" applicationName="/" type="Mainsoft.Web.Security.DerbyRoleProvider, Mainsoft.Web" />
</providers>
</roleManager>
</system.web>
<Mainsoft.Data.Configuration>
<objectnameresolution>
<!-- CATALOG.SCHEMA.NAME-->
<!-- "^\s*((((\[\s*(?<CATALOG>(\s*[^\[\]\s])+)\s*\])|(?<CATALOG>(\w|!|\#|\$)*(\s*(\w|!|\#|\$)+)*))\s*\.\s*)?((\[(?<SCHEMA>(\s*[^\[\]\s])+)\s*\])|(?<SCHEMA>(\w|!|\#|\$)*(\s*(\w|!|\#|\$)+)*))\s*\.\s*)?((\[(?<NAME>(\s*[^\[\]\s])+)\s*\])|(?<NAME>(\w|!|\#|\$)+(\s*(\w|!|\#|\$)+)*))\s*$" -->
<!-- <add dbname="<name returned by server>" match="^\s*((((\[\s*(?&lt;CATALOG&gt;(\s*[^\[\]\s])+)\s*\])|(?&lt;CATALOG&gt;(\w|!|\#|\$)*(\s*(\w|!|\#|\$)+)*))\s*\.\s*)?((\[(?&lt;SCHEMA&gt;(\s*[^\[\]\s])+)\s*\])|(?&lt;SCHEMA&gt;(\w|!|\#|\$)*(\s*(\w|!|\#|\$)+)*))\s*\.\s*)?((\[(?&lt;NAME&gt;(\s*[^\[\]\s])+)\s*\])|(?&lt;NAME&gt;(\w|!|\#|\$)+(\s*(\w|!|\#|\$)+)*))\s*$" priority="1"/> -->
</objectnameresolution>
<OleDbProviders>
<!-- Microsoft SQLServer driver 2000 -->
<provider>
<add key="url" value = "jdbc:microsoft:sqlserver://${servername}:${port};DatabaseName=${database}" />
<add key="driverClassName" value = "com.microsoft.jdbc.sqlserver.SQLServerDriver" />
<add key="id" value = "SQLJDBC2000" />
<add key="type" value = "Mainsoft.Data.Jdbc.Providers.OleDbSqlServerProvider2000, System.Data" />
<add key="keyMapping" value = "serverName=data source,server,address,addr;user=user id,user,uid;password=password,pwd;database=initial catalog,database;loginTimeout=connect timeout,connection timeout;" />
<add key="keyExclude" value="provider,jndi-datasource-name,naming-provider-url,naming-factory-initial,jdbcdriverclassname,jdbcurl" />
</provider>
<!-- Microsoft SQLServer driver 2005 -->
<provider>
<add key="url" value = "jdbc:sqlserver://${servername}" />
<add key="driverClassName" value = "com.microsoft.sqlserver.jdbc.SQLServerDriver" />
<add key="id" value = "SQLJDBC2005" />
<add key="type" value = "Mainsoft.Data.Jdbc.Providers.OleDbSqlServerProvider2005, System.Data" />
<add key="keyMapping" value = "serverName=data source,server,address,addr;user=user id,user,uid;password=password,pwd;database=initial catalog,database;loginTimeout=connect timeout,connection timeout;" />
<add key="keyExclude" value="provider,jndi-datasource-name,naming-provider-url,naming-factory-initial,jdbcdriverclassname,jdbcurl" />
<add key="keyUnsupported" value="AttachDBFilename" />
</provider>
<!-- Microsoft SQLServer driver 2005 (default) -->
<provider>
<add key="url" value = "jdbc:sqlserver://${servername}" />
<add key="driverClassName" value = "com.microsoft.sqlserver.jdbc.SQLServerDriver" />
<add key="id" value = "SQLOLEDB.1" />
<add key="type" value = "Mainsoft.Data.Jdbc.Providers.OleDbSqlServerProvider2005, System.Data" />
<add key="keyMapping" value = "serverName=data source,server,address,addr;user=user id,user,uid;password=password,pwd;database=initial catalog,database;loginTimeout=connect timeout,connection timeout;" />
<add key="keyExclude" value="provider,jndi-datasource-name,naming-provider-url,naming-factory-initial,jdbcdriverclassname,jdbcurl" />
<add key="keyUnsupported" value="AttachDBFilename" />
</provider>
<!-- Oracle driver -->
<provider>
<add key="url" value = "jdbc:oracle:thin:@//${servername}:${port}/${servicename}" />
<add key="driverClassName" value = "oracle.jdbc.OracleDriver" />
<add key="port" value = "1521" />
<add key="id" value = "MSDAORA.1" />
<add key="type" value = "Mainsoft.Data.Jdbc.Providers.OleDbOracleProvider, System.Data" />
<add key="keyMapping" value = "servername=hostname;user=user id,user,uid;password=password,pwd;servicename=data source,sid;loginTimeout=connect timeout,connection timeout" />
<add key="keyExclude" value="provider,jndi-datasource-name,naming-provider-url,naming-factory-initial,jdbcdriverclassname,jdbcurl" />
</provider>
<!-- IMB DB2 driver -->
<provider>
<add key="url" value = "jdbc:db2://${servername}:${port}/${database}" />
<add key="driverClassName" value = "com.ibm.db2.jcc.DB2Driver" />
<add key="port" value = "50000" />
<add key="id" value = "IBMDADB2.1" />
<add key="type" value = "Mainsoft.Data.Jdbc.Providers.OleDbDB2Provider, System.Data" />
<add key="keyMapping" value = "servername=hostname;user=user id,user,uid;password=password,pwd;database=data source;loginTimeout=connect timeout,connection timeout;" />
<add key="keyExclude" value="provider,jndi-datasource-name,naming-provider-url,naming-factory-initial,jdbcdriverclassname,jdbcurl" />
</provider>
</OleDbProviders>
<SqlClientProviders>
<!-- Microsoft SQLServer driver 2000 -->
<provider>
<add key="url" value = "jdbc:microsoft:sqlserver://${servername}:${port};DatabaseName=${database}" />
<add key="driverClassName" value = "com.microsoft.jdbc.sqlserver.SQLServerDriver" />
<add key="id" value = "SQLJDBC2000" />
<add key="type" value = "Mainsoft.Data.Jdbc.Providers.OleDbSqlServerProvider2000, System.Data" />
<add key="keyMapping" value = "serverName=data source,server,address,addr;user=user id,user,uid;password=password,pwd;database=initial catalog,database;loginTimeout=connect timeout,connection timeout;" />
<add key="keyExclude" value="provider,jndi-datasource-name,naming-provider-url,naming-factory-initial,jdbcdriverclassname,jdbcurl" />
</provider>
<!-- Microsoft SQLServer driver 2005 -->
<provider>
<add key="url" value = "jdbc:sqlserver://${servername}" />
<add key="driverClassName" value = "com.microsoft.sqlserver.jdbc.SQLServerDriver" />
<add key="id" value = "SQLJDBC2005" />
<add key="type" value = "Mainsoft.Data.Jdbc.Providers.OleDbSqlServerProvider2005, System.Data" />
<add key="keyMapping" value = "serverName=data source,server,address,addr;user=user id,user,uid;password=password,pwd;database=initial catalog,database;loginTimeout=connect timeout,connection timeout;" />
<add key="keyExclude" value="provider,jndi-datasource-name,naming-provider-url,naming-factory-initial,jdbcdriverclassname,jdbcurl" />
<add key="keyUnsupported" value="AttachDBFilename" />
</provider>
<!-- Microsoft SQLServer driver 2005 (default) -->
<provider>
<add key="url" value = "jdbc:sqlserver://${servername}" />
<add key="driverClassName" value = "com.microsoft.sqlserver.jdbc.SQLServerDriver" />
<add key="id" value = "SQLCLIENT" />
<add key="type" value = "Mainsoft.Data.Jdbc.Providers.OleDbSqlServerProvider2005, System.Data" />
<add key="keyMapping" value = "serverName=data source,server,address,addr;user=user id,user,uid;password=password,pwd;database=initial catalog,database;loginTimeout=connect timeout,connection timeout;" />
<add key="keyExclude" value="provider,jndi-datasource-name,naming-provider-url,naming-factory-initial,jdbcdriverclassname,jdbcurl" />
<add key="keyUnsupported" value="AttachDBFilename" />
</provider>
</SqlClientProviders>
<OracleClientProviders>
<!-- Oracle driver -->
<provider>
<add key="url" value = "jdbc:oracle:thin:@//${servername}:${port}/${servicename}" />
<add key="driverClassName" value = "oracle.jdbc.OracleDriver" />
<add key="port" value = "1521" />
<add key="id" value = "ORACLECLIENT" />
<add key="type" value = "Mainsoft.Data.Jdbc.Providers.OracleProvider, System.Data.OracleClient" />
<add key="keyMapping" value = "servername=hostname;user=user id,user,uid;password=password,pwd;servicename=data source,sid;loginTimeout=connect timeout,connection timeout" />
<add key="keyExclude" value="provider,jndi-datasource-name,naming-provider-url,naming-factory-initial,jdbcdriverclassname,jdbcurl" />
</provider>
</OracleClientProviders>
</Mainsoft.Data.Configuration>
<mainsoft.directoryservices>
<settings>
<add key="servername" value="localhost"/>
<add key="port" value="389"/>
<add key="securitymech" value="1.2.840.113554.1.2.2"/>
<add key="securityappname" value="com.mainsoft.system.directoryservices"/>
<add key="authenticationmech" value="GSSAPI"/>
</settings>
</mainsoft.directoryservices>
<mainsoft.drawing>
<icons>
<add key="Application" value="System.Drawing.resources.icons.application.png"/>
<add key="Asterisk" value="System.Drawing.resources.icons.asterisk.png"/>
<add key="Error" value="System.Drawing.resources.icons.error.png"/>
<add key="Exclamation" value="System.Drawing.resources.icons.exclamation.png"/>
<add key="Hand" value="System.Drawing.resources.icons.hand.png"/>
<add key="Information" value="System.Drawing.resources.icons.information.png"/>
<add key="Question" value="System.Drawing.resources.icons.question.png"/>
<add key="Warning" value="System.Drawing.resources.icons.warning.png"/>
<add key="WinLogo" value="System.Drawing.resources.icons.winlogo.png"/>
</icons>
<codecs>
<!-- This mimetypes are plugin depenand, for now jai_imageio.jar -->
<!-- and java built in imageio specified -->
<add key="557cf400-1a04-11d3-9a73-0000f81ef32e" value="image/bmp, image/x-bmp, image/x-windows-bmp"/>
<add key="557cf406-1a04-11d3-9a73-0000f81ef32e" value="image/png"/>
<add key="557cf402-1a04-11d3-9a73-0000f81ef32e" value="image/gif"/>
<add key="557cf401-1a04-11d3-9a73-0000f81ef32e" value="image/jpeg"/>
<add key="557cf405-1a04-11d3-9a73-0000f81ef32e" value="image/tiff"/>
</codecs>
<codecsmetadata>
<imageformat name="Bmp">
<xresolution default="96">//PixelsPerMeter/X</xresolution>
<yresolution default="96">//PixelsPerMeter/Y</yresolution>
<unitstype default="meter"></unitstype>
<unitscale value="meter" name="meter">.0254</unitscale>
</imageformat>
<imageformat name="Jpeg">
<xresolution default="96">//JPEGvariety/app0JFIF/@Xdensity</xresolution>
<yresolution default="96">//JPEGvariety/app0JFIF/@Ydensity</yresolution>
<unitstype default="1">//JPEGvariety/app0JFIF/@resUnits</unitstype>
<unitscale value="0" name="na">1.0</unitscale>
<unitscale value="1" name="inch">1.0</unitscale>
<unitscale value="2" name="cm">25.4</unitscale>
</imageformat>
<imageformat name="Png">
<xresolution default="96">//pHYs/@pixelsPerUnitXAxis</xresolution>
<yresolution default="96">//pHYs/@pixelsPerUnitYAxis</yresolution>
<unitstype default="inch">//pHYs/@unitSpecifier</unitstype>
<unitscale value="meter" name="meter">.0254</unitscale>
<unitscale value="inch" name="inch">1.0</unitscale>
<unitscale value="unknown" name="na">1.0</unitscale>
</imageformat>
<imageformat name="Tiff">
<xresolution default="96">//TIFFField[@name='XResolution']/TIFFRationals/TIFFRational/@value</xresolution>
<yresolution default="96">//TIFFField[@name='YResolution']/TIFFRationals/TIFFRational/@value</yresolution>
<unitstype default="2">//TIFFField[@name='ResolutionUnit']/TIFFShorts/TIFFShort/@value</unitstype>
<unitscale value="1" name="na">1.0</unitscale>
<unitscale value="2" name="inch">1.0</unitscale>
<unitscale value="3" name="cm">25.4</unitscale>
</imageformat>
</codecsmetadata>
</mainsoft.drawing>
</configuration>
-48
View File
@@ -1,48 +0,0 @@
<?xml version="1.0" encoding="utf-8" ?>
<settingsMap>
<map sectionType="System.Web.Configuration.MembershipSection, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"
mapperType="Mono.Web.Util.MembershipSectionMapper, Mono.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=0738eb9f132ed756"
platform="Unix">
<!-- The 'what' tag specifies which region of the section to modify. The 'value' attribute value is mapper-specific and is not defined here. It can be
any expression understood by the mapper to designate the section region to modify.
-->
<what value="providers">
<!-- 'what' can contain any number of occurrences of any three elements:
replace - replace the designated region
add - add a new entry to the region
clear - clear the region
remove - remove the designatedregion
The attributes to any of the above are freeform and are not processed by the mapper manager. They are stored verbatim for the
mapper to peruse.
-->
<replace name="AspNetSqlMembershipProvider"
type="System.Web.Security.SqliteMembershipProvider, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"
connectionStringName="LocalSqliteServer" />
</what>
</map>
<map sectionType="System.Web.Configuration.RoleManagerSection, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"
mapperType="Mono.Web.Util.RoleManagerSectionMapper, Mono.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=0738eb9f132ed756"
platform="Unix">
<!-- The 'what' tag specifies which region of the section to modify. The 'value' attribute value is mapper-specific and is not defined here. It can be
any expression understood by the mapper to designate the section region to modify.
-->
<what value="providers">
<!-- 'what' can contain any number of occurrences of any three elements:
replace - replace the designated region
add - add a new entry to the region
clear - clear the region
remove - remove the designatedregion
The attributes to any of the above are freeform and are not processed by the mapper manager. They are stored verbatim for the
mapper to peruse.
-->
<replace name="AspNetSqlRoleProvider"
type="System.Web.Security.SqliteRoleProvider, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"
connectionStringName="LocalSqliteServer" />
</what>
</map>
</settingsMap>
+28 -57
View File
@@ -3,19 +3,11 @@
<configuration>
<system.web>
<monoSettings>
<compilersCompatibility>
<compiler language="c#;cs;csharp" extension=".cs" compilerOptions="/nowarn:0169"
type="Microsoft.CSharp.CSharpCodeProvider, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
</compilersCompatibility>
</monoSettings>
<authorization>
<allow users="*" />
</authorization>
<httpHandlers>
<add verb="*" path="Trace.axd" type="System.Web.Handlers.TraceHandler, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<add verb="*" path="UrlRouting.axd" type="System.Web.HttpForbiddenHandler, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<add verb="*" path="*.aspx" type="System.Web.UI.PageHandlerFactory, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<add verb="*" path="*.asmx" validate="false" type="System.Web.Services.Protocols.WebServiceHandlerFactory, System.Web.Services, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<add verb="*" path="*.ashx" type="System.Web.UI.SimpleHandlerFactory, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
@@ -37,9 +29,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>
@@ -66,36 +57,33 @@
uiculture="en-US" />
-->
<sessionState mode="InProc" />
<pages>
<namespaces>
<add namespace="System" />
<add namespace="System.Collections" />
<add namespace="System.Collections.Specialized" />
<add namespace="System.Configuration" />
<add namespace="System.Text" />
<add namespace="System.Text.RegularExpressions" />
<add namespace="System.Web" />
<add namespace="System.Web.Caching" />
<add namespace="System.Web.SessionState" />
<add namespace="System.Web.Security" />
<add namespace="System.Web.Profile" />
<add namespace="System.Web.UI" />
<add namespace="System.Web.UI.WebControls" />
<!-- <add namespace="System.Web.UI.WebControls.WebParts" /> -->
<add namespace="System.Web.UI.HtmlControls" />
</namespaces>
</pages>
<webServices>
<protocols>
<add name="HttpSoap"/>
<add name="HttpPost"/>
<add name="HttpGet"/>
<add name="Documentation"/>
</protocols>
<wsdlHelpGenerator href="DefaultWsdlHelpGenerator.aspx" />
</webServices>
<webControls clientScriptsLocation="/web_scripts" />
<compilation debug="false" defaultLanguage="c#" explicit="true" strict="false" >
<compilers>
<compiler language="cs;c#;csharp" extension=".cs" warningLevel="1" compilerOptions=""
type="Microsoft.CSharp.CSharpCodeProvider, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<compiler language="vb;vbs;visualbasic;vbscript" extension=".vb"
warningLevel="1" compilerOptions=""
type="Microsoft.VisualBasic.VBCodeProvider, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
</compilers>
<assemblies>
<!--<add assembly="mscorlib" /> -->
<add assembly="System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<add assembly="System.Configuration, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<add assembly="System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<add assembly="System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<add assembly="System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<add assembly="System.Web.Services, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<add assembly="System.Xml, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<add assembly="System" />
<add assembly="System.Xml" />
<add assembly="System.Configuration" />
<add assembly="System.Data" />
<add assembly="System.Web" />
<add assembly="System.Web.Services" />
<add assembly="System.Drawing" />
<add assembly="*" /> <!-- Add assemblies in bin directory -->
</assemblies>
<expressionBuilders>
@@ -106,30 +94,13 @@
<add expressionPrefix="AppSettings"
type="System.Web.Compilation.AppSettingsExpressionBuilder, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
</expressionBuilders>
<buildProviders>
<add extension=".aspx" type="System.Web.Compilation.PageBuildProvider" />
<add extension=".ascx" type="System.Web.Compilation.UserControlBuildProvider" />
<add extension=".master" type="System.Web.Compilation.MasterPageBuildProvider" />
<add extension=".asmx" type="System.Web.Compilation.WebServiceBuildProvider" />
<add extension=".ashx" type="System.Web.Compilation.WebHandlerBuildProvider" />
<add extension=".soap" type="System.Web.Compilation.WebServiceBuildProvider" />
<add extension=".resx" type="System.Web.Compilation.ResXBuildProvider" />
<add extension=".resources" type="System.Web.Compilation.ResourcesBuildProvider" />
<add extension=".wsdl" type="System.Web.Compilation.WsdlBuildProvider" />
<add extension=".xsd" type="System.Web.Compilation.XsdBuildProvider" />
<add extension=".js" type="System.Web.Compilation.ForceCopyBuildProvider" />
<add extension=".lic" type="System.Web.Compilation.IgnoreFileBuildProvider" />
<add extension=".licx" type="System.Web.Compilation.IgnoreFileBuildProvider" />
<add extension=".exclude" type="System.Web.Compilation.IgnoreFileBuildProvider" />
<add extension=".refresh" type="System.Web.Compilation.IgnoreFileBuildProvider" />
</buildProviders>
</compilation>
<httpRuntime executionTimeout="110"
<httpRuntime executionTimeout="90"
maxRequestLength="4096"
useFullyQualifiedRedirectUrl="false"
minFreeThreads="8"
minLocalRequestFreeThreads="4"
appRequestQueueLimit="5000" />
appRequestQueueLimit="100" />
<clientTarget>
<add alias="ie5" userAgent="Mozilla/4.0 (compatible; MSIE 5.5; Windows NT 4.0)" />
<add alias="ie4" userAgent="Mozilla/4.0 (compatible; MSIE 4.0; Windows NT 4.0)" />
@@ -137,7 +108,7 @@
<add alias="downlevel" userAgent="Unknown" />
</clientTarget>
<siteMap>
<siteMap enabled="false">
<providers>
<add name="AspNetXmlSiteMapProvider"
description="Default site map provider that reads in .sitemap xml files."
-7
View File
@@ -1,7 +0,0 @@
assemblies_dir=@prefix@/lib/mono
Libraries=${assemblies_dir}/2.1/smcs.exe
Name: Mono Internal -- Do not use.
Description: Mono Internal Libraries -- Do not use
Version: @VERSION@
Libs: -r:smcs.exe
@@ -1,4 +0,0 @@
Name: System.Web.Extensions.Design
Description: System.Web.Extensions.Design ASP.NET 2.0 add-on
Version: 1.0.61025.0
Libs: -r:@prefix@/lib/mono/gac/System.Web.Extensions.Design/1.0.61025.0__31bf3856ad364e35/System.Web.Extensions.Design.dll
-4
View File
@@ -1,4 +0,0 @@
Name: System.Web.Extensions
Description: System.Web.Extensions ASP.NET 2.0 add-on
Version: 1.0.61025.0
Libs: -r:@prefix@/lib/mono/gac/System.Web.Extensions/1.0.61025.0__31bf3856ad364e35/System.Web.Extensions.dll
-5
View File
@@ -1,5 +0,0 @@
Name: WCF
Description: References WCF for compilation
Version: @VERSION@
Libs: -r:System.Runtime.Serialization.dll -r:System.IdentityModel.dll -r:System.IdentityModel.Selectors.dll -r:System.ServiceModel.dll -r:System.ServiceModel.Web.dll
-114
View File
@@ -1,114 +0,0 @@
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
mono-tools{.config,.source} (fixes the build).
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.
(deploy/.stamp): Compute location of 'mono-wrapper' and pass to exdoc.
* exdoc (mono-wrapper): Use $runtimedir to look for 'mono-wrapper'.
2008-10-31 Jonathan Pryor <[email protected]>
* check, Makefile.am (EXTRA_DIST): Rename to check-exports. This was
needed to fix `make distdir...`, because (1) with a file named
`check` which (2) was listed in $(EXTRA_DIST), while (3) `check` is
ALSO a .PHONY target, this caused make to look for the `check` file,
not find it due to (3), and then proceed to try to build convert.exe
from convert.cs...for reasons I don't care about. This obviously
can't work during `make distdir`, as mcs hasn't been built yet, thus
leading to pain, suffering, and a broken build.
2008-10-30 Jonathan Pryor <[email protected]>
* . (svn:ignore), deploy (svn:ignore): Ignore generated files.
* AgilityPack.dll, api-style.css, ChangeLog, check, check-coverage,
convert.cs, current-api, deploy, documented, exdoc, ignore,
mono-api-metadata.html, monoapi.source, produce-lists, public,
public-api, README, sources, toc.xml, TODO, wapi: Copy from
../mono/docscripts.
* exdoc: Use the in-tree mono program to run convert.exe.
* Makefile.am: Mention files to clean/distribute; extract
documentation (with exdoc) and then assemble documentation (with
monoapi.make's assemble target) for use by monodoc.
* monoapi.make: Added; Makefile to use mcs' buid/rules.make to compile
convert.cs and assemble documentation. (This is a separate file so
that we can include mcs' build/rules.make, which needs topdir set to
behave properly BUT must be $(mcs_topdir) from Makefile.am's
perspective.)
* monoapi.source: Add a /monodoc/node element for use with monodoc 2.2.
2006-11-19 Miguel de Icaza <[email protected]>
* exdoc: Move to use CSS instead of tables, this will break
GtkHTML rendering.
* ignore: Updated with more hidden APIs.
* Bunch of documentation work.
+7 -98
View File
@@ -1,106 +1,15 @@
sourcesdir = $(prefix)/lib/monodoc/sources
sources_DATA = \
mono-file-formats.source \
mono-tools.source \
monoapi.source \
$(ASSEMBLED_DOCS)
ASSEMBLED_DOCS = \
mono-file-formats.tree mono-file-formats.zip \
mono-tools.tree mono-tools.zip \
monoapi.tree monoapi.zip
EXTRA_DIST = \
abc-removal.txt \
AgilityPack.dll \
api-style.css \
aot-compiler.txt \
assembly-bundle \
check-exports \
check-coverage \
convert.cs \
current-api \
deploy \
docs.make \
documented \
embedded-api \
exceptions \
exdoc \
file-share-modes \
gc-issues \
gc-variables-in-c \
glossary.txt \
ignore \
internal-calls \
ir-desc \
jit-imt \
embedded-api \
exceptions \
gc-issues \
jit-thoughts \
jit-trampolines \
local-regalloc.txt \
magic.diff \
mini-doc.txt \
mini-porting.txt \
mono-api-metadata.html \
mono-file-formats.config\
mono-file-formats.source\
mono_handle_d \
mono-tools.config \
mono-tools.source \
monoapi.source \
new-regalloc \
object-layout \
opcode-decomp.txt \
precise-gc \
produce-lists \
public \
public-api \
README \
release-notes-1.0.html \
remoting \
ssapre.txt \
stack-alignment \
stack-overflow.txt \
threading \
toc.xml \
TODO \
tree-mover.txt \
unmanaged-calls
dist-hook:
$(mkdir_p) $(distdir)/sources
$(mkdir_p) $(distdir)/svgs
cp sources/* $(distdir)/sources
cp svgs/* $(distdir)/svgs
clean-local:
-rm -Rf $(srcdir)/html
-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) $@
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-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) $@
$(srcdir)/deploy/.stamp: convert.exe Makefile.am
$(mkdir_p) $(srcdir)/html
runtimedir=`cd ../runtime && pwd`; export runtimedir; \
cd $(srcdir) && MONO_PATH=$(mcs_topdir_from_srcdir)/class/lib/net_2_0 perl ./exdoc -h . ../mono/*/*.c
touch $@
extract: $(srcdir)/deploy/.stamp
convert.exe: convert.cs AgilityPack.dll
cd $(srcdir) && $(MAKE) -f docs.make topdir=$(mcs_topdir_from_srcdir) convert.exe
object-layout \
unmanaged-calls \
stack-alignment
-87
View File
@@ -1,87 +0,0 @@
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
------
sources/
mono-api-*.html
Contains the various source files, each source file
contains HTML, and a line for each API call like this:
<h4><a name="api:mono_something">mono_something</a></h4>
The format is static, notice that the tools actually search
for the above format and process that (both the tools here,
as well as the upcoming Monodoc tools and index creation
tools).
The files can contain any ammount of extra information.
The documentation from the source code is then merged with
these files and the header/footer information to produce
the deploy directory.
deploy/
Scripts produce a ready-to-use set of XHTML files that can
be either fed into a monodoc XHTML provider or can be published
directly on the web.
PROGRAMS
--------
* check-coverage
Run this script every once in a while to make sure that a
public symbol that has been added to Mono has a corresponding
section on the mono-vm-api.html
This works by looking for the <h4>APICALL</h4> pattern on the
HTML file.
* produce-lists
Produces the public-api and wapi files that contain the public
libmono API.
* exdoc
Extracts the embedded documentation from the sources.
* check
This script is used to verify which routines are missing inline
documentation, usage:
check mono/metadata/*.c
* convert.cs
Converts an HTML file into a valid XML document, uses the
AgilityPack.dll. The sources to this DLL live in GNOME CVS
module beagle/Filters/AgilityPack.
A binary is shipped for our convenience.
DATAFILES:
---------
ignore
Contains the list of public symbols that should be
ignored, they come from tests for example, or are known
to be exposed.
This is consumed by produce-lists
public-api
wapi
These two are produced by the produce-lists script
and it documents all the public methods.
+266 -337
View File
@@ -1,373 +1,302 @@
Arrays Bounds Check Elimination (ABC)
in the Mono Runtime
Massimiliano Mantione ([email protected])
Here "abc" stays for "array bounds check", or "array bound checks", or
some combination of the two.
some combination of the two...
* Usage
------------------------------------------------------------------------------
USAGE
Simply use the "abcrem" optimization invoking mono.
Simply use the "abcrem" optimization invoking mono.
To see if bound checks are actually removed, use "mono -v" and
grep for "ARRAY-ACCESS" in the output, there should be a
message for each check that has been removed.
To trace the algorithm execution, use "-v -v -v", and be
prepared to be totally submersed by debugging messages...
To see if bound checks are actually removed, use "mono -v" and grep for
"ARRAY-ACCESS" in the output, there should be a message for each check
that has been removed.
* Effectiveness
To trace the algorithm execution, use "-v -v -v", and be prepared to be
totally submersed by debugging messages...
The abc removal code can now always remove bound checks from
"clean" array scans in loops, and generally anyway there are
clear conditions that already state that the index is "safe".
To be clearer, and give an idea of what the algorithm can and
cannot do without describing it in detail... keep in mind that
only "redunant" checks cannot be removed. By "redundant", I
mean "already explicitly checked" in the method code.
Unfortunately, analyzing complex expressions is not so easy
(see below for details), so the capabilities of this "abc
remover" are limited.
These are simple guidelines:
------------------------------------------------------------------------------
EFFECTIVENESS
- Only expressions of the following kinds are handled:
- constant
- variable [+/- constant]
- Only comparisons between "handled" expressions are understood.
- "switch" statements are not yet handled.
This means that code like this will be handled well:
for (int i = 0; i < a.Length; i++) {
a [i] = .....
}
The "i" variable could be declared out of the "for", the "for"
could be a "while", and maybe even implemented with "goto",
the array could be scanned in reverse order, and everything
would still work.
The abc removal code can now always remove bound checks from "clean"
array scans in loops, and generally anyway there are clear conditions that
already state that the index is "safe".
I could have a temporary variable storing the array length,
and check on it inside the loop, and the abc removal would
still occurr, like this:
int i = 0;
int l = a.Length;
while ( i < l ) {
a [i] ......
}
or this:
int l = a.Length;
for (int i = l; i > 0; i--) {
a [i] = .....
}
The following two examples would work:
for (int i = 0; i < (a.Length -1); i++) .....
for (int i = 0; i < a.Length; i += 2) .....
But just something like this
int delta = -1;
for (int i = 0; i < (a.Length + delta); i++) .....
or like this
int delta = +2;
for (int i = 0; i < a.Length; i += delta) .....
would not work, the check would stay there. (unless
a combination of cfold, consprop and copyprop is used, too,
which would make the constant value of "delta" explicit).
Just to make you understand how things are tricky... this would work!
int limit = a.Length - 1;
for (int i = 0; i < limit; i++) {
a [i] = .....
}
A detailed explanation of the reason why things are done like
this is given below.
* The Algorithm
To be clearer, and give an idea of what the algorithm can and cannot do
without describing it in detail... keep in mind that only "redunant" checks
cannot be removed. By "redundant", I mean "already explicitly checked" in
the method code.
This array bound check removal (abc removal) algorithm is
based on symbolic execution concepts. I handle the removal
like an "unreachable code elimination" (and in fact the
optimization could be extended to remove also other
unreachable sections of code, due to branches that "always go
the same way").
In symbolic execution, variables do not have actual (numeric)
values, but instead symbolic expressions (like "a", or "x+y").
Also, branch conditions are handled like symbolic conditions
(like "i<k"), which state relations between variable values.
The SSA representation inside mini is somewhat close to a
symbolic representation of the execution of the compiled
method.
Particularly, the representation of variable values is exactly
a symbolic one. It is enough to find all CEE_STIND_*
instructions which store to a local variable, and their second
argument is exactly the variable value. Actually, "cfg->vars
[<variable-index>]->def" should contain exactly those store
instructions, and the "get_variable_value_from_ssa_store"
function extracts the variable value from there.
On the other hand, the conditions under which each basic block
is executed are not made fully explicit.
However, it is not difficult to make them so.
Unfortunately, analyzing complex expressions is not so easy (see below for
details), so the capabilities of this "abc remover" are limited.
Each BB that has more than one exit BB, in practice must end
either with a conditional branch instruction or with a switch
instruction.
In the first case, the BB has exactly two exit BBs, and their
execution conditions are easy to get from the condition of the
branch (see the "get_relation_from_branch_instruction"
function, and expecially the end of "analyze_block" in
abcremoval.c.
These are simple guidelines:
- Only expressions of the following kinds are handled:
- constant
- variable [+/- constant]
- Only comparisons between "handled" expressions are understood.
- "switch" statements are not yet handled.
If there is a switch, the jump condition of every exit BB is
the equality of the switch argument with the particular index
associated with its case (but the current implementation does
not handle switch statements yet).
These individual conditions are in practice associated to each
arc that connects BBs in the CFG (with the simple case that
unconditional branches have a "TRUE" condition, because they
always happen).
So, for each BB, its *proper* entry condition is the union of
all the conditions associated to arcs that enter the BB. The
"union" is like a logical "or", in the sense that either of
the condition could be true, they are not necessarily all
true. This means that if I can enter a BB in two ways, and in
one case I know that "x>0", and in the other that "x==0",
actually in the BB I know that "x>=0", which is a weaker
condition (the union of the two).
Also, the *complete* entry condition for a BB is the
"intersection" of all the entry conditions of its
dominators. This is true because each dominator is the only
way to reach the BB, so the entry condition of each dominator
must be true if the control flow reached the BB. This
translates to the logical "and" of all the "proper" conditions
of the BBs met walking up in the dominator tree. So, if one
says "x>0", and another "x==1", then I know that "x==1", which
is a stronger condition (the intersection of the two).
This means that code like this will be handled well:
Note that, if the two conditions were "x>0" and "x==0", then
the block would be unreachable (the intersection is empty),
because some branch is impossible.
Another observation is that, inside each BB, every variable is
subject to the complete entry condition of that very same BB,
and not the one in which it is defined (with the "complete
entry condition" being the thing I defined before, sorry if
these terms "proper" and "complete" are strange, I found
nothing better).
for (int i = 0; i < a.Length; i++) {
a [i] = .....
}
This happens because the branch conditions are related to the
control flow. I can define "i=a", and if I am in a BB where
"a>0", then "i>0", but not otherwise.
So, intuitively, if the available conditions say "i>=0", and i
is used as an index in an array access, then the lower bound
check can be omitted. If the condition also says
"(i>=0)&&(i<array.length)", the abc removal can occur.
So, a complete solution to the problem of abc removal would be
the following: for each array access, build a system of
equations containing:
The "i" variable could be declared out of the "for", the "for" could be a
"while", and maybe even implemented with "goto", the array could be scanned
in reverse order, and everything would still work.
I could have a temporary variable storing the array length, and check on
it inside the loop, and the abc removal would still occurr, like this:
[1] all the symbolic variable definitions
[2] the complete entry condition of the BB in which
the array access occurs
[3] the two "goal functions" ("index >=0" and "index <
array.length")
If the system is valid for *each possible* variable value, then the goal
functions are always true, and the abc can be removed.
All this discussion is useful to give a precise specification
to the problem we are trying to solve.
int i = 0;
int l = a.Length;
while ( i < l ) {
a [i] ......
}
The trouble is that, in the general case, the resulting system
of equations is like a predicate in first order logic, which
is semi-decidable, and its general solution is anyway too
complex to be attempted in a JIT compiler (which should not
contain a full fledged theorem prover).
Therefore, we must cut some corner.
There is also another big problem, which is caused by
"recursive" symbolic definitions. These definition can (and
generally do) happen every time there is a loop. For instance,
in the following piece of code:
for ( int i = 0; i < array.length; i++ ) {
Console.WriteLine( "array [i] = " + array [i] );
}
one of the definitions of i is a PHI that can be either 0 or
"i + 1".
Now, we know that mathematically "i = i + 1" does not make
sense, and in fact symbolic values are not "equations", they
are "symbolic definitions".
The actual symbolic value of i is a generic "n", where "n" is
the number of iterations of the loop, but this is terrible to
handle (and in more complex examples the symbolic value of i
simply cannot be written, because i is calculated in an
iterative way).
However, the definition "i = i + 1" tells us something about
i: it tells us that i "grows". So (from the PHI definition) we
know that i is either 0, or "grows". This is enough to tell
that "i>=0", which is what we want! It is important to note
that recursive definitions can only occurr inside PHI
definitions, because actually a variable cannot be defined
*only* in terms of itself!
At this point, I can explain which corners I want to cut to
make the problem solvable. It will not remove all the abc that
could theoretically be removed, but at least it will work.
The easiest way to cut corners is to only handle expressions
which are "reasonably simple", and ignore the rest.
or this:
Keep in mind that ignoring an expression is not harmful in
itself. The algorithm will be simply "less powerful", because
it will ignore conditions that could have caused to the
removal of an abc, but will not remove checks "by mistake" (so
the resulting code will be in any case correct).
The expressions we handle are the following (all of integer
type):
int l = a.Length;
for (int i = l; i > 0; i--) {
a [i] = .....
}
- constant
- variable
- variable + constant
- constant + variable
- variable - constant
And, of course, PHI definitions.
The following two examples would work:
Any other expression causes the introduction of an "any" value
in the evaluation, which makes all values that depend from it
unknown as well.
We will call these kind of definitions "summarizable"
definitions.
In a first attempt, we can consider only branch conditions
that have the simplest possible form (the comparison of two
summarizable expressions).
We can also simplify the effect of variable definitions,
keeping only what is relevant to know: their value range with
respect to zero and with respect to the length of the array we
are currently handling.
One particular note on PHI functions: they work (obviously)
like the logical "or" of their definitions, and therefore are
equivalent to the "logical or" of the summarization of their
definitions.
About recursive definitions (which, believe me, are the worst
thing in all this mess), we handle only "monotonic" ones. That
is, we try to understand if the recursive definition (which,
as we said above, must happen because of a loop) always
"grows" or "gets smaller". In all other cases, we decide we
cannot handle it.
One critical thing, once we have defined all these data
structures, is how the evaluation is actually performed.
In a first attempt I coded a "brute force" approach, which for
each BB tried to examine all possible conditions between all
variables, filling a sort of "evaluation matrix". The problem
was that the complexity of this evaluation was quadratic (or
worse) on the number of variables, and that many wariables
were examined even if they were not involved in any array
access.
Following the ABCD paper:
for (int i = 0; i < (a.Length -1); i++) .....
for (int i = 0; i < a.Length; i += 2) .....
http://citeseer.ist.psu.edu/bodik00abcd.html
But just something like this
I rewrote the algorithm in a more "sparse" way.
int delta = -1;
for (int i = 0; i < (a.Length + delta); i++) .....
Now, the main data structure is a graph of relations between
variables, and each attempt to remove a check performs a
traversal of the graph, looking for a path from the index to
the array length that satisfies the properties "index >= 0"
and "index < length". If such a path is found, the check is
removed. It is true that in theory *each* traversal has a
complexity which is exponential on the number of variables,
but in practice the graph is not very connected, so the
traversal terminates quickly.
Then, the algorithm to optimize one method looks like this:
or like this
[1] Preparation:
int delta = +2;
for (int i = 0; i < a.Length; i += delta) .....
[1a] Build the SSA representation.
would not work, the check would stay there, sorry :-(
(unless a combination of cfold, consprop and copyprop is used, too, which
would make the constant value of "delta" explicit).
[1b] Prepare the evaluation graph (empty)
Just to make you understand how things are tricky... this would work!
[1b] Summarize each varible definition, and put
the resulting relations in the evaluation
graph
int limit = a.Length - 1;
for (int i = 0; i < limit; i++) {
a [i] = .....
}
[2] Analyze each BB, starting from the entry point and
following the dominator tree:
[2a] Summarize its entry condition, and put the resulting relations
in the evaluation graph (this is the reason
why the BBs are examined following the
dominator tree, so that conditions are added
to the graph in a "cumulative" way)
A detailed explanation of the reason why things are done like this is given
below...
[2b] Scan the BB instructions, and for each array
access perform step [3]
------------------------------------------------------------------------------
THE ALGORITHM
[2c] Process children BBs following the dominator
tree (step [2])
This array bound check removal (abc removal) algorithm is based on
symbolic execution concepts. I handle the removal like an "unreachable
code elimination" (and in fact the optimization could be extended to remove
also other unreachable sections of code, due to branches that "always go the
same way").
[2d] Remove from the evaluation area the conditions added at step [2a]
(so that backtracking along the tree the area
is properly cleared)
In symbolic execution, variables do not have actual (numeric) values, but
instead symbolic expressions (like "a", or "x+y").
Also, branch conditions are handled like symbolic conditions (like "i<k"),
which state relations between variable values.
[3] Attempt the removal:
The SSA representation inside mini is somewhat close to a symbolic
representation of the execution of the compiled method.
Particularly, the representation of variable values is exactly a symbolic
one. It is enough to find all CEE_STIND_* instructions which store to a
local variable, and their second argument is exactly the variable value.
Actually, "cfg->vars [<variable-index>]->def" should contain exactly
those store instructions, and the "get_variable_value_from_ssa_store"
function extracts the variable value from there.
[3a] Summarize the index expression, to see if we can handle it; there
are three cases: the index is either a
constant, or a variable (with an optional
delta) or cannot be handled (is a "any")
On the other hand, the conditions under which each basic block is
executed are not made fully explicit.
[3b] If the index can be handled, traverse the evaluation area searching
a path from the index variable to the array
length (if the index is a constant, just
examine the array length to see if it has
some relation with this constant)
However, it is not difficult to make them so.
Each BB that has more than one exit BB, in practice must end either with
a conditional branch instruction or with a switch instruction.
In the first case, the BB has exactly two exit BBs, and their execution
conditions are easy to get from the condition of the branch (see the
"get_relation_from_branch_instruction" function, and expecially the end of
"analyze_block" in abcremoval.c.
If there is a switch, the jump condition of every exit BB is the equality
of the switch argument with the particular index associated with its case
(but the current implementation does not handle switch statements yet).
These individual conditions are in practice associated to each arc that
connects BBs in the CFG (with the simple case that unconditional branches
have a "TRUE" condition, because they always happen).
So, for each BB, its *proper* entry condition is the union of all the
conditions associated to arcs that enter the BB. The "union" is like a
logical "or", in the sense that either of the condition could be true,
they are not necessarily all true. This means that if I can enter a BB
in two ways, and in one case I know that "x>0", and in the other that
"x==0", actually in the BB I know that "x>=0", which is a weaker
condition (the union of the two).
Also, the *complete* entry condition for a BB is the "intersection" of all
the entry conditions of its dominators. This is true because each dominator
is the only way to reach the BB, so the entry condition of each dominator
must be true if the control flow reached the BB. This translates to the
logical "and" of all the "proper" conditions of the BBs met walking up in the
dominator tree. So, if one says "x>0", and another "x==1", then I know
that "x==1", which is a stronger condition (the intersection of the two).
Note that, if the two conditions were "x>0" and "x==0", then the block would
be unreachable (the intersection is empty), because some branch is impossible.
Another observation is that, inside each BB, every variable is subject to the
complete entry condition of that very same BB, and not the one in which it is
defined (with the "complete entry condition" being the thing I defined before,
sorry if these terms "proper" and "complete" are strange, I found nothing
better).
This happens because the branch conditions are related to the control flow.
I can define "i=a", and if I am in a BB where "a>0", then "i>0", but not
otherwise.
So, intuitively, if the available conditions say "i>=0", and i is used as an
index in an array access, then the lower bound check can be omitted.
If the condition also says "(i>=0)&&(i<array.length)", the abc removal can
occur.
So, a complete solution to the problem of abc removal would be the following:
for each array access, build a system of equations containing:
[1] all the symbolic variable definitions
[2] the complete entry condition of the BB in which the array access occurs
[3] the two "goal functions" ("index >=0" and "index < array.length")
If the system is valid for *each possible* variable value, then the goal
functions are always true, and the abc can be removed.
All this discussion is useful to give a precise specification to the problem
we are trying to solve.
The trouble is that, in the general case, the resulting system of equations
is like a predicate in first order logic, which is semi-decidable, and its
general solution is anyway too complex to be attempted in a JIT compiler
(which should not contain a full fledged theorem prover).
Therefore, we must cut some corner.
By the way, there is also another big problem, which is caused by "recursive"
symbolic definitions. These definition can (and generally do) happen every
time there is a loop. For instance, in the following piece of code
for ( int i = 0; i < array.length; i++ ) {
Console.WriteLine( "array [i] = " + array [i] );
}
one of the definitions of i is a PHI that can be either 0 or "i + 1".
Now, we know that mathematically "i = i + 1" does not make sense, and in
fact symbolic values are not "equations", they are "symbolic definitions".
The actual symbolic value of i is a generic "n", where "n" is the number of
iterations of the loop, but this is terrible to handle (and in more complex
examples the symbolic value of i simply cannot be written, because i is
calculated in an iterative way).
However, the definition "i = i + 1" tells us something about i: it tells us
that i "grows". So (from the PHI definition) we know that i is either 0, or
"grows". This is enough to tell that "i>=0", which is what we want!
It is important to note that recursive definitions can only occurr inside
PHI definitions, because actually a variable cannot be defined *only* in terms
of itself!
At this point, I can explain which corners I want to cut to make the
problem solvable. It will not remove all the abc that could theoretically
be removed, but at least it will work.
The easiest way to cut corners is to only handle expressions which are
"reasonably simple", and ignore the rest.
Keep in mind that ignoring an expression is not harmful in itself.
The algorithm will be simply "less powerful", because it will ignore
conditions that could have caused to the removal of an abc, but will
not remove checks "by mistake" (so the resulting code will be in any case
correct).
The expressions we handle are the following (all of integer type):
- constant
- variable
- variable + constant
- constant + variable
- variable - constant
And, of course, PHI definitions.
Any other expression causes the introduction of an "any" value in the
evaluation, which makes all values that depend from it unknown as well.
We will call these kind of definitions "summarizable" definitions.
In a first attempt, we can consider only branch conditions that have the
simplest possible form (the comparison of two summarizable expressions).
We can also simplify the effect of variable definitions, keeping only
what is relevant to know: their value range with respect to zero and with
respect to the length of the array we are currently handling.
One particular note on PHI functions: they work (obviously) like the logical
"or" of their definitions, and therefore are equivalent to the "logical or"
of the summarization of their definitions.
About recursive definitions (which, believe me, are the worst thing in all
this mess), we handle only "monotonic" ones. That is, we try to understand
if the recursive definition (which, as we said above, must happen because
of a loop) always "grows" or "gets smaller". In all other cases, we decide
we cannot handle it.
One critical thing, once we have defined all these data structures, is how
the evaluation is actually performed.
In a first attempt I coded a "brute force" approach, which for each BB
tried to examine all possible conditions between all variables, filling
a sort of "evaluation matrix". The problem was that the complexity of this
evaluation was quadratic (or worse) on the number of variables, and that
many wariables were examined even if they were not involved in any array
access.
Following the ABCD paper (http://citeseer.ist.psu.edu/bodik00abcd.html),
I rewrote the algorithm in a more "sparse" way.
Now, the main data structure is a graph of relations between variables, and
each attempt to remove a check performs a traversal of the graph, looking
for a path from the index to the array length that satisfies the properties
"index >= 0" and "index < length". If such a path is found, the check is
removed. It is true that in theory *each* traversal has a complexity which
is exponential on the number of variables, but in practice the graph is not
very connected, so the traversal terminates quickly.
Then, the algorithm to optimize one method looks like this:
[1] Preparation:
[1a] Build the SSA representation.
[1b] Prepare the evaluation graph (empty)
[1b] Summarize each varible definition, and put the resulting relations
in the evaluation graph
[2] Analyze each BB, starting from the entry point and following the
dominator tree:
[2a] Summarize its entry condition, and put the resulting relations
in the evaluation graph (this is the reason why the BBs are examined
following the dominator tree, so that conditions are added to the
graph in a "cumulative" way)
[2b] Scan the BB instructions, and for each array access perform step [3]
[2c] Process children BBs following the dominator tree (step [2])
[2d] Remove from the evaluation area the conditions added at step [2a]
(so that backtracking along the tree the area is properly cleared)
[3] Attempt the removal:
[3a] Summarize the index expression, to see if we can handle it; there
are three cases: the index is either a constant, or a variable (with
an optional delta) or cannot be handled (is a "any")
[3b] If the index can be handled, traverse the evaluation area searching
a path from the index variable to the array length (if the index is
a constant, just examine the array length to see if it has some
relation with this constant)
[3c] Use the results of step [3b] to decide if the check is redundant
[3c] Use the results of step [3b] to decide if the check is redundant
+173
View File
@@ -0,0 +1,173 @@
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.
* 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 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
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.
method_offsets
The equivalent to a procedure linkage table.
* 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, the runtime needs to setup some data structures and fill out
GOT entries before a method is first called. This means that even calls to
a method whose code is in the same AOT image need to go through the GOT,
instead of using a direct call.
- 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.
-40
View File
@@ -1,40 +0,0 @@
h3 {
font-size: 18px;
padding-bottom: 4pt;
border-bottom: 2px solid #dddddd;
}
.api {
border: 1px solid;
padding: 10pt;
margin: 10pt;
}
.api-entry {
border-bottom: none;
font-size: 18px;
}
.prototype {
border: 1px solid;
background-color: #f2f2f2;
padding: 5pt;
margin-top: 5pt;
margin-bottom: 5pt;
}
.header {
border: 1px solid;
padding: 0 0 5pt 5pt;
margin: 10pt;
white-space: pre;
font-family: monospace;
}
.code {
border: 1px solid;
padding: 0 0 5pt 5pt;
margin: 10pt;
white-space: pre;
font-family: monospace;
}
-29
View File
@@ -1,29 +0,0 @@
thisdir = docs
SUBDIRS =
include $(topdir)/build/rules.make
ASSEMBLED_DOCS = \
mono-file-formats.tree mono-file-formats.zip \
mono-tools.tree mono-tools.zip \
monoapi.tree monoapi.zip
convert.exe: convert.cs AgilityPack.dll
$(CSCOMPILE) -out:$@ $< -r:AgilityPack.dll
monoapi.zip: monoapi.tree
@test -f $@ || { rm -f $< && $(MAKE) $<; }
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.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.tree: mono-file-formats.config docs.make
$(MDOC) assemble -o mono-file-formats -f man $<
.doc-stamp:
+253
View File
@@ -0,0 +1,253 @@
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.
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/
-293
View File
@@ -1,293 +0,0 @@
#!/usr/bin/perl
if ($ARGV[0] eq "-h"){
$dir = $ARGV[1];
$html = 1;
shift @ARGV;
shift @ARGV;
}
if ($html){
opendir (D, "$dir/sources/") || die "Can not open $dir";
while ($n = readdir (D)){
if ($n =~ /mono-api-.*\.html$/){
open (IN, "$dir/sources/$n") || die "Can not open $n";
$files[$filecount] = $n;
while (<IN>){
@files_content[$filecount] .= $_;
if (/name="api:(.*?)"/){
$_ =~ s/.*name="api:(\w+?)".*/\1/;
$apis[$filecount] .= "$_";
}
}
$filecount++;
close IN;
}
}
}
while (<ARGV>){
if (/\/\*\* *\n/){
&process_doc;
} else {
#print "IGNORING: $_";
}
}
if ($html){
for ($f = 0; $f < $filecount; $f++){
$name = $files[$f];
open (OUT, "> $dir/html/$name") || die "Can not create $dir/html/$name";
print "Merging: $name\n";
print OUT<<EOF;
<?xml version="1.0" encoding="utf-8"?>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>$name</title>
<style type="text/css">
h3 {
font-size: 18px;
padding-bottom: 4pt;
border-bottom: 2px solid #dddddd;
}
.api {
border: 1px solid;
padding: 10pt;
margin: 10pt;
}
.api-entry {
border-bottom: none;
font-size: 18px;
}
.prototype {
border: 1px solid;
background-color: #f2f2f2;
padding: 5pt;
margin-top: 5pt;
margin-bottom: 5pt;
}
.header {
border: 1px solid;
padding: 0 0 5pt 5pt;
margin: 10pt;
white-space: pre;
font-family: monospace;
}
.code {
border: 1px solid;
padding: 0 0 5pt 5pt;
margin: 10pt;
white-space: pre;
font-family: monospace;
}
</style>
</head>
<body>
EOF
@a = split (/\n/, $files_content[$f]);
for ($ai = 0; $ai < $#a; $ai++){
$line = $a[$ai];
($api,$caption) = $line =~ /<h4><a name=\"api:(\w+)\">(\w+)<\/a><\/h4>/;
if ($api ne ""){
if ($api_shown == 1){
print OUT "</div>";
}
$api_shown = 1;
$proto = $prototype{$api};
if ($proto eq ""){
$proto = "Prototype: $api";
}
print OUT<<EOF;
<a name="api:$api"></a>
<div class="api">
<div class="api-entry">$api</div>
<div class="prototype">$proto</div>
<p>
EOF
&opt_print ("Parameters", $arguments{$api}, 1);
&opt_print ("Returns", $returns{$api}, 1);
&opt_print ("Remarks", $bodies{$api}, 0);
print OUT "\n";
} else {
if ($line =~ /@API_IDX@/){
$apis_toc = &create_toc ($apis[$f]);
$line =~ s/\@API_IDX\@/$apis_toc/;
}
if ($line =~ /^<h/){
print OUT "</div>";
$api_shown = 0;
}
print OUT "$line\n";
}
}
print OUT<<EOF;
</body>
</html>
EOF
close OUT;
system ("$ENV{runtimedir}/mono-wrapper convert.exe $dir/html/$name $dir/html/x-$name");
# clean up the mess that AgilityPack does, it CDATAs our CSS
open HACK, "$dir/html/x-$name" || die "Could not open $dir/html/x-$name";
open HACKOUT, ">$dir/deploy/$name" || die "Could not open output";
while (<HACK>){
s/^\/\/<!\[CDATA\[//;
s/^\/\/\]\]>\/\///;
print HACKOUT $_;
}
#system ("cp.exe $dir/html/$name $dir/deploy/$name");
}
}
sub process_doc {
$doc = "";
$func = <>;
chop $func;
$func =~ s/^ \* //;
$func =~ s/:$//;
print "Function: $func\n" if (!$html);
$args = "";
$inbody = 0;
$returns = "";
$body = "";
$functions[$fn++] = $func;
# Process arguments
while (<>){
if (/^ \*\*?\//){
$body =~ s/[@#](\w+)/<i>\1<\/i>/g;
$returns =~ s/[@#](\w+)/<i>\1<\/i>/g;
$args =~ s/@(\w+)/<i>\1<\/i>/g;
$body =~ s/\n/ /;
$bodies{$func} = $body;
$arguments{$func} = $args;
$returns{$func} = $returns;
$proto = "";
while (<>){
$proto .= $_;
last if (/\{/);
}
$proto =~ s/{//;
# clean it up a little, remove newlines, empty space at end
$proto =~ s/ +$//;
# Turn "Type * xxx" into "Type* xxx"
$proto =~ s/^(\w+)\W+\*/\1\*/;
$prototype{$func} = $proto;
return;
}
chop;
s/^\ \*//;
$_ = "\n<p>" if (/^\s+$/);
if ($inbody == 0){
if (/\s*(\w+):(.*)/){
$args .= "<dt><i>$1:</i></dt><dd>$2</dd>";
} else {
$body = "\t$_\n";
$inbody = 1;
}
} elsif ($inbody == 1) {
if (/Returns?:/){
s/Returns?://;
$returns = "\t$_\n";
$inbody = 2;
} else {
$body .= "\n\t$_";
}
} else {
$returns .= "\n\t$_";
}
}
}
sub create_toc {
my ($apis_listed) = @_;
my $type_size = 0;
my $name_size = 0;
my $ret, $xname, $args, $line;
$apis_toc = "";
# Try to align things, so compute type size, method size, and arguments
foreach $line (split /\n/, $apis_listed){
$p = $prototype{$line};
($ret, $xname, $args) = $p =~ /(.*)\n(\w+)[ \t](.*)/;
$tl = length ($ret);
$pl = length ($xname);
$type_size = $tl if ($tl > $type_size);
$name_size = $pl if ($pl > $name_size);
}
$type_size++;
$name_size++;
foreach $line (split /\n/, $apis_listed){
chop;
$p = $prototype{$line};
($ret, $xname, $args) = $p =~ /(.*)\n(\w+)[ \t](.*)/;
$rspace = " " x ($type_size - length ($ret));
$nspace = " " x ($name_size - length ($xname));
$args = &format ($args, length ($ret . $rspace . $xname . $nspace), 60);
$apis_toc .= "$ret$rspace<a href=\"\#api:$line\">$xname</a>$nspace$args\n";
}
return $apis_toc;
}
#
# Formats the rest of the arguments in a way that will fit in N columns
#
sub format {
my ($args, $size, $limit) = @_;
my $sret = "";
# return $args if ((length (args) + size) < $limit);
$remain = $limit - $size;
@sa = split /,/, $args;
$linelen = $size;
foreach $arg (@sa){
if ($sret eq ""){
$sret = $arg . ", ";
$linelen += length ($sret);
} else {
if ($linelen + length ($arg) < $limit){
$sret .= "FITS" . $arg . ", ";
} else {
$newline = " " x ($size) . $arg . ", ";
$linelen = length ($newline);
$sret .= "\n" . $newline;
}
}
}
$sret =~ s/, $/;/;
return $sret;
}
sub opt_print {
my ($caption, $opttext, $quote) = @_;
if ($opttext ne "" && (!($opttext =~ /^[ \t]+$/))){
print OUT "<b>$caption</b>\n";
if ($quote == 1){
print OUT "<blockquote>$opttext</blockquote>\n";
} else {
print OUT "<p>$opttext\n";
}
}
}
-223
View File
@@ -1,223 +0,0 @@
-*- outline -*-
Generic code sharing
====================
* Porting
** Generic class init trampoline
The generic class init trampoline is very similar to the class init
trampoline, with the exception that the VTable of the class to be
inited is passed in a register, MONO_ARCH_VTABLE_REG. That register
can be the same as the IMT register.
The call to the generic class init trampoline is never patched because
the VTable is not constant - it depends on the type arguments of the
class/method doing the call to the trampoline. For that reason, the
trampoline needs a fast path for the case that the class is already
inited, i.e. the trampoline needs to check the initialized bit of the
MonoVTable and immediately return if it is set. See tramp-x86.c for
how to portably figure out the number of the bit in the bit-field that
needs to be checked.
Since the MONO_ARCH_VTABLE_REG is needed by the generic class init
trampoline function (in mini-trampolines.c) it needs to be saved by
the generic trampoline code in the register save block which is passed
to the trampoline. This also applies to the RGCTX fetch trampoline
(see below).
Like the normal class init trampoline, the result of the generic class
init trampoline function is not a pointer to code that needs to be
jumped to. Instead, just like for the class init trampoline, the
generic trampoline code must return to the caller instead of jumping
to the returned value. The same applies for the RGCTX fetch
trampoline (see below).
** RGCTX register
Generic shared code needs access to type information. This
information is contained in a RGCTX for non-generic methods and in an
MRGCTX for generic methods. It is passed in one of several ways,
depending on the type of the called method:
1. Non-generic non-static methods of reference types have access to
the RGCTX via the "this" argument (this->vtable->rgctx).
2. Non-generic static methods of reference types and non-generic
methods of value types need to be passed a pointer to the
caller's class's VTable in the MONO_ARCH_RGCTX_REG register.
3. Generic methods need to be passed a pointer to the MRGCTX in the
MONO_ARCH_RGCTX_REG register.
The MONO_ARCH_RGCTX_REG must not be clobbered by trampolines.
MONO_ARCH_RGCTX_REG can be the same as the IMT register for now, but
this might change in the future when we implement virtual generic
method calls (more) efficiently.
This register lifetime starts at the call site that loads it and
ends in the callee prologue when it is either discarded or stored
into a local variable.
It's better to avoid registers used for argument passing for the RGCTX
as it would make the code dealing with calling conventions code a lot
harder.
** Method prologue
Generic shared code that have a RGCTX receive it in RGCTX_REG. There
must be a check in mono_arch_emit_prolog for MonoCompile::rgctx_var
and if set store it. See mini-x86.c for reference.
** Dealing with types
Types passed to arch functions might be type parameters
(MONO_TYPE_(M)VAR) if the MonoGenericSharingContext* argument is
non-NULL. For example, an argument or return type in a method passed
to mono_arch_find_this_argument() could be a MONO_TYPE_VAR. To guard
for that case use mini_get_basic_type_from_generic() on the type. See
get_call_info() in mini-x86.c, for example.
** (M)RGCTX lazy fetch trampoline
The purpose of the lazy fetch trampoline is to fetch a slot from an
(M)RGCTX which might not be inited, yet. In the latter case, it needs
to go make a transition to unmanaged code to fill the slot. This is
the layout of a RGCTX:
+---------------------------------+
| next | slot 0 | slot 1 | slot 2 |
+--|------------------------------+
|
+-----+
| +---------------------------------
+->| next | slot 3 | slot 4 | slot 5 ....
+--|------------------------------
|
+-----+
| +------------------------------------
+->| next | slot 10 | slot 11 | slot 12 ....
+--|---------------------------------
.
.
.
For fetching a slot from a RGCTX the trampoline is passed a pointer
(as a normal integer argument) to the VTable. From there it has to
fetch the pointer to the RGCTX, which might be null. Then it has to
traverse the correct number of "next" links, each of which might be
NULL. Arriving at the right array it needs to fetch the slot, which
might also be NULL. If any of the NULL cases, the trampoline must
transition to unmanaged code to potentially setup the RGCTX and fill
the slot. Here is pseudo-code for fetching slot 11:
; vtable ptr in r1
; fetch RGCTX array 0
r2 = *(r1 + offsetof(MonoVTable, runtime_generic_context))
if r2 == NULL goto unmanaged
; fetch RGCTX array 1
r2 = *r2
if r2 == NULL goto unmanaged
; fetch RGCTX array 2
r2 = *r2
if r2 == NULL goto unmanaged
; fetch slot 11
r2 = *(r2 + 2 * sizeof (gpointer))
if r2 == NULL goto unmanaged
return r2
unmanaged:
jump unmanaged_fetch_code
The number of slots in the arrays must be obtained from the function
mono_class_rgctx_get_array_size().
The MRGCTX case is different in two aspects. First, the trampoline is
not passed a pointer to a VTable, but a pointer directly to the
MRGCTX, which is guaranteed not to be NULL (any of the next pointers
and any of the slots can be NULL, though). Second, the layout of the
first array is slightly different, in that the first two slots are
occupied by a pointers to the class's VTable and to the method's
method_inst. The next pointer is in the third slot and the first
actual slot, "slot 0", in the fourth:
+--------------------------------------------------------+
| vtable | method_inst | next | slot 0 | slot 1 | slot 2 |
+-------------------------|------------------------------+
.
.
All other arrays have the same layout as the RGCTX ones, except
possibly for their length.
The function to create the trampoline,
mono_arch_create_rgctx_lazy_fetch_trampoline(), gets passed an encoded
slot number. Use the macro MONO_RGCTX_SLOT_IS_MRGCTX to query whether
a trampoline for an MRGCTX is needed, as opposed to one for a RGCTX.
Use MONO_RGCTX_SLOT_INDEX to get the index of the slot (like 2 for
"slot 2" as above).
The unmanaged fetch code is yet another trampoline created via
mono_arch_create_specific_trampoline(), of type
MONO_TRAMPOLINE_RGCTX_LAZY_FETCH. It's given the slot number as the
trampoline argument. In addition, the pointer to the VTable/MRGCTX is
passed in MONO_ARCH_VTABLE_REG (like the VTable to the generic class
init trampoline - see above).
Like the class init and generic class init trampolines, the RGCTX
fetch trampoline code doesn't return code that must be jumped to, so,
like for those trampolines (see above), the generic trampoline code
must do a normal return instead.
* Getting generics information about a stack frame
If a method is compiled with generic sharing, its MonoJitInfo has
has_generic_jit_info set. In that case, the MonoJitInfo is followed
(after the MonoJitExceptionInfo array) by a MonoGenericJitInfo.
The MonoGenericJitInfo contains information about the location of the
this/vtable/MRGCTX variable, if the has_this flag is set. If that is
the case, there are two possibilities:
1. this_in_reg is set. this_reg is the number of the register where
the variable is stored.
2. this_in_reg is not set. The variable is stored at offset
this_offset from the address in the register with number
this_reg.
The variable can either point to the "this" object, to a vtable or to
an MRGCTX:
1. If the method is a non-generic non-static method of a reference
type, the variable points to the "this" object.
2. If the method is a non-generic static method or a non-generic
method of a value type, the variable points to the vtable of the
class.
3. If the method is a generic method, the variable points to the
MRGCTX of the method.
* Layout of the MRGCTX
The MRGCTX is a structure that starts with
MonoMethodRuntimeGenericContext, which contains a pointer to the
vtable of the class and a pointer to the MonoGenericInst with the type
arguments for the method.
* Blog posts about generic code sharing
http://schani.wordpress.com/2007/09/22/generics-sharing-in-mono/
http://schani.wordpress.com/2007/10/12/the-trouble-with-shared-generics/
http://schani.wordpress.com/2007/10/15/a-quick-generics-sharing-update/
http://schani.wordpress.com/2008/01/29/other-types/
http://schani.wordpress.com/2008/02/25/generic-types-are-lazy/
http://schani.wordpress.com/2008/03/10/sharing-static-methods/
http://schani.wordpress.com/2008/04/22/sharing-everything-and-saving-memory/
http://schani.wordpress.com/2008/06/02/sharing-generic-methods/
http://schani.wordpress.com/2008/06/27/another-generic-sharing-update/
-23
View File
@@ -1,23 +0,0 @@
Based on some Q&A:
Global Register Allocation: This is about placing in registers values
that are used a lot in performance-critical code: local variables and
method arguments if possible will be placed in the callee-saved
registers that are returned by th arch-specific code in the function:
mono_arch_get_global_int_regs().
Stack Unwinding: is the process that happens during exception
handling: when an exception is thrown in a called method and caught in
a caller method, me need to put the processor registers in the state
they were in the caller, at the point where the catch handler can run.
This happens in the mono_handle_exception_internal() and
mono_arch_find_jit_info(): see the other architectures implementations
for ideas: they basically need to know how big was the stack allocated
in each call frame and they need to restore the callee-save registers
that were saved in the stack in the prolog in the called functions (
during stack unwindong the epilog of a method is not executed and the
register restoration needs to be done manually in the above
functions).
-139
View File
@@ -1,139 +0,0 @@
IMT-based interface invocation support
The mono JIT can use an IMT-style invocation system to call interface methods.
This considerably reduces the runtime memory usage when many interface types
are loaded, because the old system required an array in MonoVTable indexed
by the interface id, which grows linearly as more interfaces are loaded.
In some cases there are also speedups, since an interface call can reduce to
a virtual call automatically.
IMT instead uses a fixed-size table and hashes each method in the implemented
interfaces to a slot in the IMT table. To be able to resolve collisions, at each
callsite we store the interface MonoMethod to be called in a well-known register and
the IMT table will contain a snippet of code that uses it to jump to the
proper vtable slot. The interface invocation sequence becomes (in pseudo-code):
mov magic_reg, interface_monomethod
call vtable [imt_slot]
The IMT table is stored at negative addresses in the vtable, like the old
interface array used to be.
A small note on the choice of magic_reg for different JIT backends: the IMT
method identifier doesn't necessarily need to be stored in a register, though
doing so is fast and the JIT code has already the infrastructure to handle this
case in an arch-independent way. A JIT porter just needs to #define
MONO_ARCH_IMT_REG to the choosen register. Note that this register should be
part of the MONO_ARCH_CALLEE_REGS set as it will be handled by the local register
allocator (see mini/inssel.brg) and it must not be part of the registers used for
argument passing as you'd overwrite an argument in that case.
Also note that the method-specific trampoline code should make sure to preserve
this register (but it should already if it's in MONO_ARCH_CALLEE_REGS as
it could have been used for a vtable indirect call).
Note that in the case of a nono-colliding IMT slot, the interface call
instruction sequence becomes equivalent to a virtual call, as the IMT slot
will contain the direct trampoline for the method and the magic trampoline will
set the slot to the method's native code address once it is compiled.
In case of collisions in the IMT slot, the JIT performs a linear search if
the colliding methods are few or a binary search otherwise.
To make this easier for each JIT port, a sort of internal representation
of the code is created: this is an array of MonoIMTCheckItem structures
built in a way to allow easy generation of a bsearch, when the list of colliding
methods becomes large.
Each item in the array represents either a direct check for a method to be invoked
or a bisection check in the bsearch algorithm.
struct _MonoIMTCheckItem {
MonoMethod *method;
int check_target_idx;
int vtable_slot;
guint8 *jmp_code;
guint8 *code_target;
guint8 is_equals;
guint8 compare_done;
guint8 chunk_size;
guint8 short_branch;
};
For a direct check, the is_equals value is non-zero and the emitted code
should be equivalent to:
if (magic_reg != item->method)
jump_to_item (array [item->check_target_idx]);
jump_to_vtable (item->vtable_slot);
Note that if item->check_target_idx is 0, the jump should be omitted
since this is the end of a linear sequence (you might want to insert a jump to
a breakpoint, though, for debugging) and this would mean that we have an error:
the IMT slot was asked to execute an interface method that the type doesn't implement.
In the future we might want to handle this case not with a breakpoint or assert, but
by either throwing an InvalidCast exception or by going into the runtime and
adding support for the interface automagically to the type/vtable: this could be used
both for tranparent proxies and for the implicit interfaces that vectors in 2.0
provide.
For a bisect check the code is even simpler:
if (magic_reg >= item->method)
jump_to_item (array [item->check_target_idx]);
In this case item->check_target_idx is always non-zero.
Note that in both cases item->method becomes an immediate constant in the
jitted code.
The other fields in the structure are there to provide to the backend
common storage for data needed during emission.
As each item's code is emitted, the start of it is stored in the code_target
field. At the same time when a conditional branch is inserted, its address
is stored in jmp_code: this way with a single forward pass on the array at
the end of the emission phase the branches can be patched to point to the
proper target item's code (this process would patch the jump_to_item pseudo
instructions described above).
chunk_size can be used to store the size of the code generated for the item: this
can be used to optimize the short/long branch instructions, together with
info stored in short_branch. It is also used to calculate the size of the
code to allocate for the whole IMT thunk.
The compare_done field can be used to avoid doing an additional compare
in a is_equals item for the same MonoMethod that was just compared in a
bisecting item. Suppose we have 4 methods colliding in a slot, A, B, C and D.
The arch-independent code already took care of sorting them, so that:
A < B < C < D
The generated code will look like (M is the method to call):
compare (C, M)
goto upper_sequence if bigger_equals
/* linear sequence */
compare (M, A)
goto B_found if not_equals
jump to A's slot
B_found:
jump to B's slot
upper_sequence:
/* we just did a compare against C, no need to compare again */
goto D_found if not_equals
jump to C's slot
D_found:
jump to D's slot
This optimization is of course valid for architectures with flags registers.
As a further optimization to reduce memory usage, the Mono runtime sets the
IMT slots initially to a single-instance magic trampoline so there is actually no
memory used up by the thunks in the case of collisions. When an interface method is
called the magic trampoline will fill-in the IMT slot with the proper thunk or
trampoline, so later calls will use the fast path.
This single-instance trampoline will use MONO_FAKE_IMT_METHOD as the method
it's asking to be compiled and executed: the trampoline code does recognize
this special value and retrives the interface method to call from the usual
MONO_ARCH_IMT_REG saved by the trampoline code.
Given that only the IMT slots that are actually used will be initialized, this saves
quite a bit of memory, as it's unlikely that all the interface methods are called on
all the different types.
+283
View File
@@ -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)
+2 -156
View File
@@ -1,9 +1,6 @@
Author: Dietmar Maurer ([email protected])
(C) 2001 Ximian, Inc.
(C) 2007 Novell, Inc.
[ 2007 extensions based on posts from Paolo Molaro ]
Howto trigger JIT compilation
=============================
@@ -42,134 +39,9 @@ where it is called. It is then possible for the JIT to patch the call
instruction in the caller, so that it directly calls the JIT compiled code
next time.
Implementation Details
Implementation for x86
======================
Mono 1.2.6 has quite a few improvements in this area compared to mono
1.2.5 which was released just a few weeks ago. I'll try to detail the
major changes below.
The first change is related to how the memory for the specific
trampolines is allocated: this is executable memory so it is not
allocated with malloc, but with a custom allocator, called Mono Code
Manager. Since the code manager is used primarily for methods, it
allocates chunks of memory that are aligned to multiples of 8 or 16
bytes depending on the architecture: this allows the cpu to fetch the
instructions faster. But the specific trampolines are not performance
critical (we'll spend lots of time JITting the method anyway), so they
can tolerate a smaller alignment. Considering the fact that most
trampolines are allocated one after the other and that in most
architectures they are 10 or 12 bytes, this change alone saved about
25% of the memory used (they used to be aligned up to 16 bytes).
To give a rough idea of how many trampolines are generated I'll give a
few examples:
* MonoDevelop startup creates about 21 thousand trampolines
* IronPython 2.0 running a benchmark creates about 17 thousand trampolines
* an "hello, world" style program about 800
This change in the first case saved more than 80 KB of memory (plus
about the same because reviewing the code allowed me to fix also a
related overallocation issue).
So reducing the size of the trampolines is great, but it's really not
possible to reduce them much further in size, if at all. The next step
is trying just not to create them.
There are two primary ways a trampoline is generated: a direct call to
the method is made or a virtual table slot is filled with a trampoline
for the case when the method is invoked using a virtual call. I'll
note here than in both cases, after compiling the method, the magic
trampoline will do the needed changes so that the trampoline is not
executed again, but execution goes directly to the newly compiled
code. In one case the callsite is changed so that the branch or call
instruction will transfer control to the new address. In the virtual
call case the magic trampoline will change the virtual table slot
directly.
The sequence of instructions used by the JIT to implement a virtual
call are well-known and the magic trampoline (inspecting the registers
and the code sequence) can easily get the virtual table slot that was
used for the invocation. The idea here then is: if we know the virtual
table slot we know also the method that is supposed to be compiled and
executed, since each vtable slot is assigned a unique method by the
class loader. This simple fact allows us to use a completely generic
trampoline in the virtual table slots, avoiding the creation of many
method-specific trampolines.
In the cases above, the number of generated trampolines goes from
21000 to 7700 for MonoDevelop (saving 160 KB of memory), from 17000 to
5400 for the IronPython case and from 800 to 150 for the hello world
case.
Kinds of Trampolines and Thunks
===============================
This is a list of the trampolines and thunks used in Mono:
- create_fnptr
- load_aot_method
- imt thunk
Interface Method Table, this is used to dispatch calls to
interface methods.
- jump table
- debugger code
- exception call filter
- trampoline (various types)
- throw corlib exception
- restore context
- throw exception by name
- handle stack overflow
- throw exception
- delegate invoke implementation
- cpuid code
Implementation for x86/x86-64
=============================
Usually code looks like this:
mov <some address>, %r11
call *0xfffffffc(%rax)
First, the first call instruction can go directly to the compiled
address or to a trampoline.
If it goes to a trampoline, on amd64 it looks as the one above (on x86
it is different). Currently the trampoline is not modified, but it will
be in the future. On x86 the trampoline looks like:
push constant
jmp generic_trampoline
Note that constant can be a MonoMethod*, but it's not necessarily so
(these are the recent changes: this constant can be -1 or -2, the first
for the case of interface calls, the second for virtual calls).
Other architectures are similar in the semantics, but different in the
details.
The above is what happens for virtual calls.
For interfaces call 3 things can happen:
1) the calls goes directly to the method address.
2) it goes to a trampoline as described above.
3) it goes into an IMT collision resolution stub: this is a
chunk of code that, based on the constant put inside the
imt_register above, will perform a jump to the correct
vtable slot for the interface method.
Note that the vtable slot itself could then contain a trampoline.
Some functions that are used here:
emit-x86.c (arch_create_jit_trampoline): return the JIT trampoline function
emit-x86.c (x86_magic_trampoline): contains the code to detect the caller and
@@ -177,30 +49,4 @@ patch the call instruction.
emit-x86.c (arch_compile_method): JIT compile a method
Call Sites
==========
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.
+1 -71
View File
@@ -415,30 +415,6 @@
*) mono_arch_instrument_epilog ()
Functions needed to implement the profiling interface.
* 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:
./mono --regression <exe file name>
The suggested order for working through these tests is the
following:
- basic.exe
- basic-long.exe
- basic-float.exe
- basic-calls.exe
- objects.exe
- arrays.exe
- exceptions.exe
- iltests.exe
- generics.exe
* Writing regression tests
@@ -480,52 +456,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.
-5
View File
@@ -1,5 +0,0 @@
<?xml version="1.0"?>
<manpages>
<manpage name="mdoc(5)" page="../man/mdoc.5" />
<manpage name="mono-config(5)" page="../man/mono-config.5" />
</manpages>
-4
View File
@@ -1,4 +0,0 @@
<?xml version="1.0"?>
<monodoc>
<source provider="man" basefile="mono-file-formats" path="man"/>
</monodoc>
-55
View File
@@ -1,55 +0,0 @@
<?xml version="1.0"?>
<manpages>
<manpage name="al(1)" page="../man/al.1" />
<manpage name="caspol(1)" page="../man/caspol.1" />
<manpage name="cert2spc(1)" page="../man/cert2spc.1" />
<manpage name="certmgr(1)" page="../man/certmgr.1" />
<manpage name="chktrust(1)" page="../man/chktrust.1" />
<manpage name="cilc(1)" page="../man/cilc.1" />
<manpage name="disco(1)" page="../man/disco.1" />
<manpage name="dtd2xsd(1)" page="../man/dtd2xsd.1" />
<manpage name="gacutil(1)" page="../man/gacutil.1" />
<manpage name="genxs(1)" page="../man/genxs.1" />
<manpage name="httpcfg(1)" page="../man/httpcfg.1" />
<manpage name="ilasm(1)" page="../man/ilasm.1" />
<manpage name="macpack(1)" page="../man/macpack.1" />
<manpage name="makecert(1)" page="../man/makecert.1" />
<manpage name="mconfig(1)" page="../man/mconfig.1" />
<manpage name="mcs(1)" page="../man/mcs.1" />
<manpage name="mdassembler(1)" page="../man/mdassembler.1" />
<manpage name="mdcs2ecma(1)" page="../man/mdcs2ecma.1" />
<manpage name="mdnormalizer(1)" page="../man/mdnormalizer.1" />
<manpage name="mdoc(1)" page="../man/mdoc.1" />
<manpage name="mdoc-assemble(1)" page="../man/mdoc-assemble.1" />
<manpage name="mdoc-export-html(1)" page="../man/mdoc-export-html.1" />
<manpage name="mdoc-export-msxdoc(1)" page="../man/mdoc-export-msxdoc.1" />
<manpage name="mdoc-update(1)" page="../man/mdoc-update.1" />
<manpage name="mdoc-validate(1)" page="../man/mdoc-validate.1" />
<manpage name="mdvalidator(1)" page="../man/mdvalidator.1" />
<manpage name="mkbundle(1)" page="../man/mkbundle.1" />
<manpage name="mono(1)" page="../man/mono.1" />
<manpage name="mono-service(1)" page="../man/mono-service.1" />
<manpage name="mono-shlib-cop(1)" page="../man/mono-shlib-cop.1" />
<manpage name="monodocer(1)" page="../man/monodocer.1" />
<manpage name="monodocs2html(1)" page="../man/monodocs2html.1" />
<manpage name="monolinker(1)" page="../man/monolinker.1" />
<manpage name="monop(1)" page="../man/monop.1" />
<manpage name="monostyle(1)" page="../man/monostyle.1" />
<manpage name="mono-xmltool(1)" page="../man/mono-xmltool.1" />
<manpage name="mozroots(1)" page="../man/mozroots.1" />
<manpage name="oldmono(1)" page="../man/oldmono.1" />
<manpage name="permview(1)" page="../man/permview.1" />
<manpage name="prj2make(1)" page="../man/prj2make.1" />
<manpage name="resgen(1)" page="../man/resgen.1" />
<manpage name="secutil(1)" page="../man/secutil.1" />
<manpage name="setreg(1)" page="../man/setreg.1" />
<manpage name="sgen(1)" page="../man/sgen.1" />
<manpage name="signcode(1)" page="../man/signcode.1" />
<manpage name="sn(1)" page="../man/sn.1" />
<manpage name="soapsuds(1)" page="../man/soapsuds.1" />
<manpage name="sqlsharp(1)" page="../man/sqlsharp.1" />
<manpage name="vbnc(1)" page="../man/vbnc.1" />
<manpage name="wsdl(1)" page="../man/wsdl.1" />
<manpage name="wsdl2(1)" page="../man/wsdl2.1" />
<manpage name="xsd(1)" page="../man/xsd.1" />
</manpages>
-4
View File
@@ -1,4 +0,0 @@
<?xml version="1.0"?>
<monodoc>
<source provider="man" basefile="mono-tools" path="man"/>
</monodoc>
-5
View File
@@ -1,5 +0,0 @@
<?xml version="1.0"?>
<monodoc>
<node label="Mono Embedding" name="embed" parent="libraries"/>
<source provider="xhtml" basefile="monoapi" path="embed"/>
</monodoc>
-56
View File
@@ -1,56 +0,0 @@
<h2>Assemblies</h2>
<h3>Synopsis</h3>
<div class="header">
#include &lt;metadata/assembly.h&gt;
typedef struct _MonoImage MonoImage;
typedef struct _MonoAssembly MonoAssembly;
typedef struct {
const char *name;
const char *culture;
const char *hash_value;
const guint8* public_key;
guchar public_key_token [MONO_PUBLIC_KEY_TOKEN_LENGTH];
guint32 hash_alg;
guint32 hash_len;
guint32 flags;
guint16 major, minor, build, revision;
} MonoAssemblyName;
@API_IDX@
</div>
<a name="cil_assembly_load"/>
<h3>Assembly Loading</h3>
<h4><a name="api:mono_assembly_open">mono_assembly_open</a></h4>
<h4><a name="api:mono_assembly_close">mono_assembly_close</a></h4>
<h4><a name="api:mono_assembly_load">mono_assembly_load</a></h4>
<h4><a name="api:mono_assembly_load_full">mono_assembly_load_full</a></h4>
<h4><a name="api:mono_assembly_loaded">mono_assembly_loaded</a></h4>
<h3>Working with Assemblies</h3>
<h4><a name="api:mono_assembly_get_image">mono_assembly_get_image</a></h4>
<h4><a name="api:mono_assembly_get_main">mono_assembly_get_main</a></h4>
<h4><a name="api:mono_assembly_getrootdir">mono_assembly_getrootdir</a></h4>
<h4><a name="api:mono_assembly_addref">mono_assembly_addref</a></h4>
<h3>Assembly Names</h3>
<p>The MonoAssemblyName contains the full identity of an
assembly (name, culture, public key, public key token,
version and any other flags).
<p>These unmanaged objects represent the <a
href="http://www.mono-project.com/monodoc/T:System.Reflection.AssemblyName">System.Reflection.AssemblyName</a>
managed type.
<h4><a name="api:mono_assembly_name_parse">mono_assembly_name_parse</a></h4>
<h4><a name="api:mono_assembly_name_free">mono_assembly_name_free</a></h4>
<h4><a name="api:mono_stringify_assembly_name">mono_stringify_assembly_name</a></h4>
<h4><a name="api:mono_assembly_names_equal">mono_assembly_names_equal</a></h4>
-55
View File
@@ -1,55 +0,0 @@
<h2>Application Domains</h2>
<h3>Synopsis</h3>
<div class="header">
#include &lt;metadata/appdomain.h&gt;
/* Managed AppDomain */
typedef struct _MonoAppDomain MonoAppDomain;
/* Unmanaged representation */
typedef struct _MonoDomain MonoDomain;
/* Represents System.Runtime.Remoting.Contexts.Context */
typedef struct _MonoAppContext MonoAppContext
@API_IDX@
</div>
<p>Application domains are used to isolate multiple
applications on a single Mono virtual machine. They are
conceptually similiar to processes, the difference is that
processes are managed by the operating system, while
application domains are managed by the Mono virtual machine.
<p>For more information on applications domains see the <a
href="http://www.gotdotnet.com/team/clr/AppdomainFAQ.aspx">AppDomain FAQ</a>.
<p>The <tt>MonoDomain</tt> is the unmanaged representation of
the <a
href="http://www.mono-project.com/monodoc/T:System.AppDomain">System.AppDomain</a>
managed type, while the <tt>MonoAppDomain</tt> type represents
the managed version (<tt>MonoAppDomain</tt> has a pointer to
a <tt>MonoDomain</tt>).
<h4><a name="api:mono_domain_assembly_open">mono_domain_assembly_open</a></h4>
<h4><a name="api:mono_domain_create">mono_domain_create</a></h4>
<h4><a name="api:mono_domain_finalize">mono_domain_finalize</a></h4>
<h4><a name="api:mono_domain_foreach">mono_domain_foreach</a></h4>
<h4><a name="api:mono_domain_free">mono_domain_free</a></h4>
<h4><a name="api:mono_domain_get_by_id">mono_domain_get_by_id</a></h4>
<h4><a name="api:mono_domain_get_id">mono_domain_get_id</a></h4>
<h4><a name="api:mono_domain_get">mono_domain_get</a></h4>
<h4><a name="api:mono_domain_has_type_resolve">mono_domain_has_type_resolve</a></h4>
<h4><a name="api:mono_domain_is_unloading">mono_domain_is_unloading</a></h4>
<h4><a name="api:mono_domain_set_internal">mono_domain_set_internal</a></h4>
<h4><a name="api:mono_domain_set">mono_domain_set</a></h4>
<h4><a name="api:mono_domain_try_type_resolve">mono_domain_try_type_resolve</a></h4>
<h4><a name="api:mono_domain_get_tls_key">mono_domain_get_tls_key</a></h4>
<h4><a name="api:mono_domain_owns_vtable_slot">mono_domain_owns_vtable_slot</a></h4>
<h3>Contexts</h3>
<h4><a name="api:mono_context_get">mono_context_get</a></h4>
<h4><a name="api:mono_context_set">mono_context_set</a></h4>
-78
View File
@@ -1,78 +0,0 @@
<h2>Embedding Mono</h2>
<h4><a name="api:mono_jit_init">mono_jit_init</a></h4>
<h4><a name="api:mono_set_dirs">mono_set_dirs</a></h4>
<h4><a name="api:mono_runtime_exec_main">mono_runtime_exec_main</a></h4>
<h4><a name="api:mono_runtime_exec_managed_code">mono_runtime_exec_managed_code</a></h4>
<h4><a name="api:mono_jit_cleanup">mono_jit_cleanup</a></h4>
<h4><a name="api:mono_set_defaults">mono_set_defaults</a></h4>
<h3>Internal Calls</h3>
<p>The Mono runtime provides two mechanisms to expose C code
to the CIL universe: internal calls and native C
code. Internal calls are tightly integrated with the runtime,
and have the least overhead, as they use the same data types
that the runtime uses.
<p>The other option is to use the Platform Invoke (P/Invoke)
to call C code from the CIL universe, using the standard
P/Invoke mechanisms.
<p>To register an internal call, use this call you use the
<tt>mono_add_internal_call</tt> routine.
<h4>Data Marshalling</h4>
<p>Managed objects are represented as <tt>MonoObject*</tt>
types. Those objects that the runtime consumes directly have
more specific C definitions (for example strings are of type
<tt>MonoString *</tt>, delegates are of type
<tt>MonoDelegate*</tt> but they are still <tt>MonoObject
*</tt>s).
<p>As of Mono 1.2.x types defined in mscorlib.dll do not have
their fields reordered in any way. But other libraries might
have their fields reordered. In these cases, Managed
structures and objects have the same layout in the C# code as
they do in the unmanaged world.
<p>Structures defined outside corlib must have a specific
StructLayout definition, and have it set as sequential if you
plan on accessing these fields directly from C code.
<p><b>Important</B> Internal calls do not provide support for
marshalling structures. This means that any API calls that
take a structure (excluding the system types like int32,
int64, etc) must be passed as a pointer, in C# this means
passing the value as a "ref" or "out" parameter.
<h4><a name="api:mono_add_internal_call">mono_add_internal_call</a></h4>
<h3>Mono Runtime Configuration</h3>
<p>Certain features of the Mono runtime, like DLL mapping, are
available through a configuration file that is loaded at
runtime. The default Mono implementation loads the
configuration file from <tt>$sysconfig/mono/config</tt>
(typically this is <tt>/etc/mono/config</tt>).
<p>See the <tt>mono-config(5)</tt> man page for more details
on what goes in this file.
<p>The following APIs expose this functionality:
<h4><a name="api:mono_config_parse">mono_config_parse</a></h4>
<h4><a name="api:mono_config_parse_memory">mono_config_parse_memory</a></h4>
<h3>Function Pointers</h3>
<p>To wrap a function pointer into something that the Mono
runtime can consume, you should use the mono_create_ftnptr.
This is only important if you plan on running on the IA64
architecture. Otherwise you can just use the function
pointer address.
<h4><a name="api:mono_create_ftnptr">mono_create_ftnptr</a></h4>
-66
View File
@@ -1,66 +0,0 @@
<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.
<h3>Synopsis</h3>
<div class="header">
#include &lt;metadata/image.h&gt;
typedef struct _MonoImage MonoImage;
typedef enum {
MONO_IMAGE_OK,
MONO_IMAGE_ERROR_ERRNO,
MONO_IMAGE_MISSING_ASSEMBLYREF,
MONO_IMAGE_IMAGE_INVALID
} MonoImageOpenStatus;
@API_IDX@
</div>
<h3>Image APIs</h3>
<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>
<h4><a name="api:mono_image_open_full">mono_image_open_full</a></h4>
<h4><a name="api:mono_image_open_from_data">mono_image_open_from_data</a></h4>
<h4><a name="api:mono_image_open_from_data_full">mono_image_open_from_data_full</a></h4>
<h4><a name="api:mono_image_close">mono_image_close</a></h4>
<h4><a name="api:mono_image_addref">mono_image_addref</a></h4>
<h4><a name="api:mono_image_load_file_for_image">mono_image_load_file_for_image</a></h4>
<h3>Image Information</h3>
<h4><a name="api:mono_image_get_guid">mono_image_get_guid</a></h4>
<h4><a name="api:mono_image_get_assembly">mono_image_get_assembly</a></h4>
<h4><a name="api:mono_image_get_entry_point">mono_image_get_entry_point</a></h4>
<h4><a name="api:mono_image_get_filename">mono_image_get_filename</a></h4>
<h4><a name="api:mono_image_get_name">mono_image_get_name</a></h4>
<h4><a name="api:mono_image_get_resource">mono_image_get_resource</a></h4>
<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_image_is_dynamic">mono_image_is_dynamic</a></h4>
<h4><a name="api:mono_image_loaded_by_guid">mono_image_loaded_by_guid</a></h4>
<h4><a name="api:mono_image_loaded">mono_image_loaded</a></h4>
<h4><a name="api:mono_image_lookup_resource">mono_image_lookup_resource</a></h4>
<h4><a name="api:mono_image_strerror">mono_image_strerror</a></h4>
<h3>Public Keys, Strong Names and Certificates</h3>
<h4><a name="api:mono_image_strong_name_position">mono_image_strong_name_position</a></h4>
<h4><a name="api:mono_image_get_public_key">mono_image_get_public_key</a></h4>
<h4><a name="api:mono_image_get_strong_name">mono_image_get_strong_name</a></h4>
<h4><a name="api:mono_image_has_authenticode_entry">mono_image_has_authenticode_entry</a></h4>
<h3>Low-level features</h3>
<h4><a name="api:mono_image_rva_map">mono_image_rva_map</a></h4>
<h4><a name="api:mono_image_ensure_section_idx">mono_image_ensure_section_idx</a></h4>
<h4><a name="api:mono_image_ensure_section">mono_image_ensure_section</a></h4>
-20
View File
@@ -1,20 +0,0 @@
<h2>Synopsis</h2>
<div class="header">
@API_IDX@
</div>
<h3>Useful Debugging Functions</h3>
<p>These functions are useful when running the Mono VM inside
a debugger.
<h4><a name="api:mono_pmip">mono_pmip</a></h4>
<h4><a name="api:mono_print_method_from_ip">mono_print_method_from_ip</a></h4>
<h4><a name="api:mono_print_thread_dump">mono_print_thread_dump</a></h4>
<h4><a name="api:mono_threads_request_thread_dump">mono_threads_request_thread_dump</a></h4>
<h3>Helper Tools For Native Ports</h3>
<h4><a name="api:mono_inst_name">mono_inst_name</a></h4>
-749
View File
@@ -1,749 +0,0 @@
<h1>Metadata Reading</h1>
<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>.
</ul>
<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 &lt; 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>
<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_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_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_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_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>
<h4><a name="api:mono_metadata_methods_from_property">mono_metadata_methods_from_property</a></h4>
<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_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>
<h4><a name="api:mono_metadata_parse_method_signature_full">mono_metadata_parse_method_signature_full</a></h4>
<h4><a name="api:mono_metadata_parse_method_signature">mono_metadata_parse_method_signature</a></h4>
<h4><a name="api:mono_metadata_parse_mh_full">mono_metadata_parse_mh_full</a></h4>
<h4><a name="api:mono_metadata_parse_mh">mono_metadata_parse_mh</a></h4>
<h4><a name="api:mono_metadata_parse_param">mono_metadata_parse_param</a></h4>
<h4><a name="api:mono_metadata_parse_signature_full">mono_metadata_parse_signature_full</a></h4>
<h4><a name="api:mono_metadata_parse_signature">mono_metadata_parse_signature</a></h4>
<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>
<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>
<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>
<h4><a name="api:mono_ldtoken">mono_ldtoken</a></h4>
<h4><a name="api:mono_lookup_dynamic_token">mono_lookup_dynamic_token</a></h4>
<h4><a name="api:mono_ldstr">mono_ldstr</a></h4>
<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>
<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>
<p>The routines in this section are used to cope with errors
during metadata loading. Errors in metadata handling can
happen for many reason, and these include (this is not an
exhaustive list).
<ul>
<li>An assembly referenced is missing.
<li>Fields referenced are missing.
<li>Methods referenced are missing.
</ul>
<p>The <tt>mono_loader_set_*</tt> routines are invoked during
metadata loading to flag that an error has happened. The
class loading errros are flagged in a per-thread basis.
<P>In various spots in the runtime the
<tt>mono_loader_get_last_error</tt> routine is called to check
if there was a problem, and then errors are propagated upwards
on the stack until we reach a point where an exception can be
raised and no runtime locks are held.
<p>The <tt>mono_loader_error_prepare_exception</tt> takes a
<tt>MonoLoaderError</tt> structure (the value returned from
<tt>mono_loader_get_last_error</tt>), turns that into an
exception and clears the error condition from the current
thread.
<h4><a name="api:mono_loader_set_error_field_load">mono_loader_set_error_field_load</a></h4>
<h4><a name="api:mono_loader_set_error_method_load">mono_loader_set_error_method_load</a></h4>
<h4><a name="api:mono_loader_set_error_type_load">mono_loader_set_error_type_load</a></h4>
<h4><a name="api:mono_loader_get_last_error">mono_loader_get_last_error</a></h4>
<h4><a name="api:mono_loader_clear_error">mono_loader_clear_error</a></h4>
<h4><a name="api:mono_loader_error_prepare_exception">mono_loader_error_prepare_exception</a></h4>
-78
View File
@@ -1,78 +0,0 @@
<h3>Methods</h3>
<h3>Invoking Methods</h3>
<h4><a name="api:mono_runtime_invoke">mono_runtime_invoke</a></h4>
If you want to invoke generic methods, you must call the method on the
"inflated" class, which you can obtain from the
<tt>mono_object_get_class()</tt>
<div class="code">
MonoClass *clazz;
MonoMethod *method;
clazz = mono_object_get_class (obj);
/*
* If there are more Add methods declared, you
* may use mono_method_desc_search_in_class (clazz, ":Add(T)"),
* you must substitute ":Add(T)" with the correct type, for example
* for List&lt;int&gt;, you would use ":Add(int)".
*/
method = mono_class_get_method_from_name (clazz, "Add", 1);
mono_runtime_invoke (method, obj, args, &amp;exception);
</div>
<h4><a name="api:mono_runtime_invoke_array">mono_runtime_invoke_array</a></h4>
<h4><a name="api:mono_remoting_invoke">mono_remoting_invoke</a></h4>
<h4><a name="api:mono_runtime_delegate_invoke">mono_runtime_delegate_invoke</a></h4>
<h4><a name="api:mono_method_call_message_new">mono_method_call_message_new</a></h4>
<h4><a name="api:mono_method_desc_free">mono_method_desc_free</a></h4>
<h4><a name="api:mono_method_desc_from_method">mono_method_desc_from_method</a></h4>
<h4><a name="api:mono_method_desc_full_match">mono_method_desc_full_match</a></h4>
<h4><a name="api:mono_method_desc_match">mono_method_desc_match</a></h4>
<h4><a name="api:mono_method_desc_new">mono_method_desc_new</a></h4>
<h4><a name="api:mono_method_desc_search_in_class">mono_method_desc_search_in_class</a></h4>
<h4><a name="api:mono_method_desc_search_in_image">mono_method_desc_search_in_image</a></h4>
<h4><a name="api:mono_method_full_name">mono_method_full_name</a></h4>
<h4><a name="api:mono_method_get_class">mono_method_get_class</a></h4>
<h4><a name="api:mono_method_get_flags">mono_method_get_flags</a></h4>
<h4><a name="api:mono_method_get_last_managed">mono_method_get_last_managed</a></h4>
<h4><a name="api:mono_method_get_marshal_info">mono_method_get_marshal_info</a></h4>
<h4><a name="api:mono_method_get_name">mono_method_get_name</a></h4>
<h4><a name="api:mono_method_get_object">mono_method_get_object</a></h4>
<h4><a name="api:mono_method_get_param_names">mono_method_get_param_names</a></h4>
<h4><a name="api:mono_method_get_param_token">mono_method_get_param_token</a></h4>
<h4><a name="api:mono_method_get_signature">mono_method_get_signature</a></h4>
<h4><a name="api:mono_method_get_index">mono_method_get_index</a></h4>
<h4><a name="api:mono_method_get_signature_full">mono_method_get_signature_full</a></h4>
<h4><a name="api:mono_method_get_token">mono_method_get_token</a></h4>
<h4><a name="api:mono_method_get_wrapper_data">mono_method_get_wrapper_data</a></h4>
<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>
<h3>Methods Header Operations</h3>
<h4><a name="api:mono_method_get_header">mono_method_get_header</a></h4>
<h4><a name="api:mono_method_header_get_clauses">mono_method_header_get_clauses</a></h4>
<h4><a name="api:mono_method_header_get_code">mono_method_header_get_code</a></h4>
<h4><a name="api:mono_method_header_get_locals">mono_method_header_get_locals</a></h4>
<h4><a name="api:mono_method_header_get_num_clauses">mono_method_header_get_num_clauses</a></h4>
-214
View File
@@ -1,214 +0,0 @@
<h1>Object API</h1>
<p>The object API deals with all the operations shared by
<a href="#objects">objects</a>, <a href="#valuetypes">value
types</a>, <a href="#arrays">arrays</a> and <a
href="#nullable">nullable types</a>.
<p>The object API has methods for accessing <a
href="#fields">fields</a>, <a
href="#properties">properties</a>, <a
href="#events">events</a>, <a href="#delegates">delegates</a>.
<p>There are some advanced uses that are useful to document
here dealing with <a href="#async">AsyncResults</a> and <a
href="#remote">remote fields</a>.
<h2>Synopsis</h2>
<div class="header">
#include &lt;metadata/object.h&gt;
typedef struct MonoVTable MonoVTable;
typedef struct _MonoThreadsSync MonoThreadsSync;
typedef struct {
MonoVTable *vtable;
MonoThreadsSync *synchronisation;
} MonoObject;
typedef struct {
guint32 length;
guint32 lower_bound;
} MonoArrayBounds;
typedef struct {
MonoObject obj;
/* bounds is NULL for szarrays */
MonoArrayBounds *bounds;
/* total number of elements of the array */
guint32 max_length;
/* we use double to ensure proper alignment on platforms that need it */
double vector [MONO_ZERO_LEN_ARRAY];
} MonoArray;
@API_IDX@
</div>
<p>MonoObject is the base definition for all managed objects
in the Mono runtime, it represents the <a
href="http://www.mono-project.com/monodoc/T:System.Object">System.Object</a>
managed type.
<p>All objects that derive from <a
href="http://www.mono-project.com/monodoc/T:System.Object">System.Object</a>
do have this base definition. Derived objects are declared
following the pattern where the parent class is the first
field of a structure definition, for example:
<div class="code">
typedef struct {
MonoObject parent;
int my_new_field;
} MyNewObject
</div>
<a name="objects"></a>
<h2>Core Object Methods</h2>
<h4><a name="api:mono_object_new">mono_object_new</a></h4>
<p>For example, if you wanted to create an object of type
System.Version, you would use a piece of code like this:
<div class="code">
MonoClass *version_class;
MonoObject *result;
/* Get the class from mscorlib */
version_class = mono_class_from_name (mono_get_corlib (),
"System", "Version");
/* Create an object of that class */
result = mono_object_new (mono_domain_get (), version_class);
</div>
<h4><a name="api:mono_object_new_alloc_specific">mono_object_new_alloc_specific</a></h4>
<h4><a name="api:mono_object_new_fast">mono_object_new_fast</a></h4>
<h4><a name="api:mono_object_new_from_token">mono_object_new_from_token</a></h4>
<h4><a name="api:mono_object_new_specific">mono_object_new_specific</a></h4>
<h4><a name="api:mono_object_clone">mono_object_clone</a></h4>
<h4><a name="api:mono_object_get_class">mono_object_get_class</a></h4>
<h4><a name="api:mono_object_get_domain">mono_object_get_domain</a></h4>
<h4><a name="api:mono_object_get_virtual_method">mono_object_get_virtual_method</a></h4>
<h4><a name="api:mono_object_isinst_mbyref">mono_object_isinst_mbyref</a></h4>
<h4><a name="api:mono_object_isinst">mono_object_isinst</a></h4>
<h4><a name="api:mono_object_register_finalizer">mono_object_register_finalizer</a></h4>
<h4><a name="api:mono_object_unbox">mono_object_unbox</a></h4>
<h4><a name="api:mono_object_castclass_mbyref">mono_object_castclass_mbyref</a></h4>
<h4><a name="api:mono_object_is_alive">mono_object_is_alive</a></h4>
<h4><a name="api:mono_object_get_size">mono_object_get_size</a></h4>
<a name="valuetypes"></a>
<h2>Value Types</h2>
<h4><a name="api:mono_value_box">mono_value_box</a></h4>
<h4><a name="api:mono_value_copy">mono_value_copy</a></h4>
<h4><a name="api:mono_value_copy_array">mono_value_copy_array</a></h4>
<a name="arrays"></a>
<h2>Array Methods</h2>
<p>Use the <tt>mono_array_new_*</tt> methods to create arrays
of a given type.
<p>For example, the following code creates an array with two
elements of type <tt>System.Byte</tt>, and sets the values
0xca and 0xfe on it:
<pre class="code">
MonoArray *CreateByteArray (MonoDomain *domain)
{
MonoArray *data;
data = mono_array_new (domain, mono_get_byte_class (), 2);
mono_array_set (data, guint8, 0, 0xca);
mono_array_set (data, guint8, 0, 0xfe);
return data;
}
</pre>
<h3>Creating Arrays</h3>
<h4><a name="api:mono_array_new">mono_array_new</a></h4>
<h4><a name="api:mono_array_new_full">mono_array_new_full</a></h4>
<h4><a name="api:mono_array_new_specific">mono_array_new_specific</a></h4>
<h4><a name="api:mono_array_class_get">mono_array_class_get</a></h4>
<h4><a name="api:mono_array_clone_in_domain">mono_array_clone_in_domain</a></h4>
<h4><a name="api:mono_array_clone">mono_array_clone</a></h4>
<h4><a name="api:mono_array_full_copy">mono_array_full_copy</a></h4>
<h4><a name="api:mono_array_to_lparray">mono_array_to_lparray</a></h4>
<h4><a name="api:mono_array_to_savearray">mono_array_to_savearray</a></h4>
<h4><a name="api:mono_dup_array_type">mono_dup_array_type</a></h4>
<h3>Using Arrays</h3>
<h4><a name="api:mono_array_set">mono_array_set</a></h4>
<h4><a name="api:mono_array_setref">mono_array_setref</a></h4>
<h4><a name="api:mono_array_length">mono_array_length</a></h4>
<h4><a name="api:mono_array_addr">mono_array_addr</a></h4>
<h4><a name="api:mono_array_addr_with_size">mono_array_addr_with_size</a></h4>
<h4><a name="api:mono_array_get">mono_array_get</a></h4>
<h4><a name="api:mono_array_element_size">mono_array_element_size</a></h4>
<a name="fields"></a>
<h2>Fields</h2>
<h4><a name="api:mono_field_from_token">mono_field_from_token</a></h4>
<h4><a name="api:mono_field_get_flags">mono_field_get_flags</a></h4>
<h4><a name="api:mono_field_get_name">mono_field_get_name</a></h4>
<h4><a name="api:mono_field_get_parent">mono_field_get_parent</a></h4>
<h4><a name="api:mono_field_get_type">mono_field_get_type</a></h4>
<h4><a name="api:mono_field_get_value">mono_field_get_value</a></h4>
<h4><a name="api:mono_field_get_value_object">mono_field_get_value_object</a></h4>
<h4><a name="api:mono_field_set_value">mono_field_set_value</a></h4>
<h4><a name="api:mono_field_static_get_value">mono_field_static_get_value</a></h4>
<h4><a name="api:mono_field_static_set_value">mono_field_static_set_value</a></h4>
<a name="properties"></a>
<h2>Properties</h2>
<h4><a name="api:mono_property_get_flags">mono_property_get_flags</a></h4>
<h4><a name="api:mono_property_get_get_method">mono_property_get_get_method</a></h4>
<h4><a name="api:mono_property_get_name">mono_property_get_name</a></h4>
<h4><a name="api:mono_property_get_parent">mono_property_get_parent</a></h4>
<h4><a name="api:mono_property_get_set_method">mono_property_get_set_method</a></h4>
<h4><a name="api:mono_property_get_value">mono_property_get_value</a></h4>
<h4><a name="api:mono_property_set_value">mono_property_set_value</a></h4>
<a name="events"></a>
<h2>Events</h2>
<h4><a name="api:mono_event_get_add_method">mono_event_get_add_method</a></h4>
<h4><a name="api:mono_event_get_flags">mono_event_get_flags</a></h4>
<h4><a name="api:mono_event_get_name">mono_event_get_name</a></h4>
<h4><a name="api:mono_event_get_parent">mono_event_get_parent</a></h4>
<h4><a name="api:mono_event_get_raise_method">mono_event_get_raise_method</a></h4>
<h4><a name="api:mono_event_get_remove_method">mono_event_get_remove_method</a></h4>
<a name="delegates"></a>
<h2>Delegates</h2>
<h4><a name="api:mono_delegate_ctor">mono_delegate_ctor</a></h4>
<a name="async"></a>
<h2>AsyncResults</h2>
<h4><a name="api:mono_async_result_new">mono_async_result_new</a></h4>
<a name="remote"></a>
<h2>Remote Fields</h2>
<h4><a name="api:mono_load_remote_field">mono_load_remote_field</a></h4>
<h4><a name="api:mono_load_remote_field_new">mono_load_remote_field_new</a></h4>
<h4><a name="api:mono_store_remote_field">mono_store_remote_field</a></h4>
<h4><a name="api:mono_store_remote_field_new">mono_store_remote_field_new</a></h4>
<a name="nullable"></a>
<h2>Nullable Objects</h2>
<p>These methods are used to manipulate objects of type
System.Nullable&lt;T&gt;
<h4><a name="api:mono_nullable_box">mono_nullable_box</a></h4>
<h4><a name="api:mono_nullable_init">mono_nullable_init</a></h4>
-89
View File
@@ -1,89 +0,0 @@
<h2>Strings</h2>
<p>Strings representation inside the Mono runtime.
<h3>Synopsis</h3>
<div class="header">
#include &lt;metadata/object.h&gt;
typedef struct {
MonoObject object;
gint32 length;
gunichar2 chars [0];
} MonoString;
@API_IDX@
</div>
<p>All of the operations on strings are done on pointers to
MonoString objects, like this:
<div class="code">
MonoString *hello = mono_string_new (mono_domain_get (), "hello, world");
</div>
<p>Strings are bound to a particular application domain, which
is why it is necessary to pass a MonoDomain argument as the
first parameter to all the constructor functions.
<p>Typically, you want to create the strings on the current
application domain, so a call to <tt>mono_domain_get()</tt> is
sufficient.
<h3>Constructors</h3>
<h4><a name="api:mono_string_new">mono_string_new</a></h4>
<h4><a name="api:mono_string_new_len">mono_string_new_len</a></h4>
<h4><a name="api:mono_string_new_size">mono_string_new_size</a></h4>
<h4><a name="api:mono_string_new_utf16">mono_string_new_utf16</a></h4>
<h4><a name="api:mono_string_from_utf16">mono_string_from_utf16</a></h4>
<h3>Conversions</h3>
<h4><a name="api:mono_string_to_byvalstr">mono_string_to_byvalstr</a></h4>
<h4><a name="api:mono_string_to_byvalwstr">mono_string_to_byvalwstr</a></h4>
<h4><a name="api:mono_string_to_utf16">mono_string_to_utf16</a></h4>
<h4><a name="api:mono_string_to_utf8">mono_string_to_utf8</a></h4>
<h4><a name="api:mono_string_utf16_to_builder">mono_string_utf16_to_builder</a></h4>
<h4><a name="api:mono_string_utf8_to_builder">mono_string_utf8_to_builder</a></h4>
<h3>Methods</h3>
<h4><a name="api:mono_string_equal">mono_string_equal</a></h4>
<h4><a name="api:mono_string_hash">mono_string_hash</a></h4>
<h4><a name="api:mono_string_intern">mono_string_intern</a></h4>
<h4><a name="api:mono_string_is_interned">mono_string_is_interned</a></h4>
<h4><a name="api:mono_string_new_wrapper">mono_string_new_wrapper</a></h4>
<h4><a name="api:mono_string_chars">mono_string_chars</a></h4>
<h4><a name="api:mono_string_length">mono_string_length</a></h4>
<h3>String Builders</h3>
<p>These routines are used to work with the managed types
<tt>System.Text.StringBuilder</tt>.
<h4><a name="api:mono_string_builder_to_utf16">mono_string_builder_to_utf16</a></h4>
<h4><a name="api:mono_string_builder_to_utf8">mono_string_builder_to_utf8</a></h4>
<h3>Other Encodings</h3>
<p>These routines are used when coping with strings that come
from Mono's environment, and might be encoded in one or more
of the external encodings.
<p>For example, some file systems might historically contain a
mix of file names with both old and new encodings, typically
UTF8 for new files, and the old files would be encoded in an 8
bit character set (ISO-8859-1 for example).
<p>These routines try a number of encodings, those specified
in the <tt>MONO_ENCODINGS</tt> environment variable and return
unicode strings that can be used internally.
<p>See the mono(1) man page for more details.
<h4><a name="api:mono_unicode_from_external">mono_unicode_from_external</a></h4>
<h4><a name="api:mono_unicode_to_external">mono_unicode_to_external</a></h4>
<h4><a name="api:mono_utf8_from_external">mono_utf8_from_external</a></h4>
-17
View File
@@ -1,17 +0,0 @@
Stack Overflow Detection
Mono supports converting a stack overflow into a
StackOverflowException that the user can use to
pinpoint problems in his software.
The detection works by:
* Setting up a number of guard pages below a certain
point in the thread stack and unprotect them if we get a
segv there.
* If a segv is caught on those pages, control is
transfered to the standard exception handling code.
* During the unwinding, the stack pages are protected
again.
+113
View File
@@ -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
-193
View File
@@ -1,193 +0,0 @@
<?xml version="1.0"?>
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:monodoc="http://www.go-mono.org/xml/monodoc">
<head/>
<body>
<object type="text/site properties">
<param name="Auto Generated" value="No"/>
</object>
<ul>
<li>
<object type="text/sitemap">
<param name="Name" value="Mono Runtime API"/>
<param name="Local" value="DoesNotExist"/>
</object>
</li>
<ul>
<li>
<object type="text/sitemap">
<param name="Name" value="Assemblies"/>
<param name="Local" value="deploy/mono-api-assembly.html"/>
</object>
</li>
<li>
<object type="text/sitemap">
<param name="Name" value="Images"/>
<param name="Local" value="deploy/mono-api-image.html"/>
</object>
</li>
<li>
<object type="text/sitemap">
<param name="Name" value="Objects"/>
<param name="Local" value="deploy/mono-api-object.html"/>
</object>
</li>
<li>
<object type="text/sitemap">
<param name="Name" value="Strings"/>
<param name="Local" value="deploy/mono-api-string.html"/>
</object>
</li>
<li>
<object type="text/sitemap">
<param name="Name" value="Methods"/>
<param name="Local" value="deploy/mono-api-methods.html"/>
</object>
</li>
<li>
<object type="text/sitemap">
<param name="Name" value="Classes"/>
<param name="Local" value="deploy/mono-api-class.html"/>
</object>
</li>
<li>
<object type="text/sitemap">
<param name="Name" value="Code Generation"/>
<param name="Local" value="deploy/mono-api-codegen.html"/>
</object>
</li>
<li>
<object type="text/sitemap">
<param name="Name" value="Decimal Representation"/>
<param name="Local" value="deploy/mono-api-decimal.html"/>
</object>
</li>
<li>
<object type="text/sitemap">
<param name="Name" value="Application Domains"/>
<param name="Local" value="deploy/mono-api-domains.html"/>
</object>
</li>
<li>
<object type="text/sitemap">
<param name="Name" value="Dynamic Code Generation"/>
<param name="Local" value="deploy/mono-api-dynamic-codegen.html"/>
</object>
</li>
<li>
<object type="text/sitemap">
<param name="Name" value="Exceptions"/>
<param name="Local" value="deploy/mono-api-exc.html"/>
</object>
</li>
<li>
<object type="text/sitemap">
<param name="Name" value="GC Handles"/>
<param name="Local" value="deploy/mono-api-gchandle.html"/>
</object>
</li>
<li>
<object type="text/sitemap">
<param name="Name" value="Garbage Collection"/>
<param name="Local" value="deploy/mono-api-gc.html"/>
</object>
</li>
<li>
<object type="text/sitemap">
<param name="Name" value="Embedding Mono"/>
<param name="Local" value="deploy/mono-api-embedding.html"/>
</object>
</li>
<li>
<object type="text/sitemap">
<param name="Name" value="Just in Time Compiler"/>
<param name="Local" value="deploy/mono-api-jit.html"/>
</object>
</li>
<li>
<object type="text/sitemap">
<param name="Name" value="Marshalling"/>
<param name="Local" value="deploy/mono-api-marshal.html"/>
</object>
</li>
<li>
<object type="text/sitemap">
<param name="Name" value="Metadata access"/>
<param name="Local" value="deploy/mono-api-metadata.html"/>
</object>
</li>
<li>
<object type="text/sitemap">
<param name="Name" value="Profiler"/>
<param name="Local" value="deploy/mono-api-profiler.html"/>
</object>
</li>
<li>
<object type="text/sitemap">
<param name="Name" value="Reflection"/>
<param name="Local" value="deploy/mono-api-reflection.html"/>
</object>
</li>
<li>
<object type="text/sitemap">
<param name="Name" value="Threading API"/>
<param name="Local" value="deploy/mono-api-threads.html"/>
</object>
</li>
<li>
<object type="text/sitemap">
<param name="Name" value="Tracing"/>
<param name="Local" value="deploy/mono-api-trace.html"/>
</object>
</li>
<li>
<object type="text/sitemap">
<param name="Name" value="JIT Counters"/>
<param name="Local" value="deploy/mono-api-counters.html"/>
</object>
</li>
<li>
<object type="text/sitemap">
<param name="Name" value="Types"/>
<param name="Local" value="deploy/mono-api-type.html"/>
</object>
</li>
<li>
<object type="text/sitemap">
<param name="Name" value="Common Types"/>
<param name="Local" value="deploy/mono-api-types.html"/>
</object>
</li>
<li>
<object type="text/sitemap">
<param name="Name" value="Security API calls"/>
<param name="Local" value="deploy/mono-api-security.html"/>
</object>
</li>
<li>
<object type="text/sitemap">
<param name="Name" value="Portable Windows Layer"/>
<param name="Local" value="deploy/mono-api-wapi.html"/>
</object>
</li>
<li>
<object type="text/sitemap">
<param name="Name" value="Debugging API"/>
<param name="Local" value="deploy/mono-api-debug.html"/>
</object>
</li>
<li>
<object type="text/sitemap">
<param name="Name" value="Utility Functions"/>
<param name="Local" value="deploy/mono-api-utils.html"/>
</object>
</li>
<li>
<object type="text/sitemap">
<param name="Name" value="Unsorted"/>
<param name="Local" value="deploy/mono-api-unsorted.html"/>
</object>
</li>
</ul>
</ul>
</body>
</html>
View File
File renamed without changes.
-425
View File
@@ -1,426 +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 :
Fixing the MSVC builds.
Contributed under MIT/X11 license.
2008-11-04 Atsushi Enomoto <[email protected]>
* src/gutf8.c, src/gunicode.c, src/glib.h:
implemented g_unichar_type(), g_unichar_toupper(),
g_unichar_tolower(), g_unichar_totitle(), g_utf8_strup()
and g_utf8_strdown(). Fixed some surrogate pair bugs.
* TODO : removed implemented things.
* test/unicode.c, test/tests.h, test/utf8.c, test/Makefile.am:
added new tests.
2008-11-04 Atsushi Enomoto <[email protected]>
* src/unicode-data.h : new header for some new unicode manipulation
functions.
2008-10-17 Miguel de Icaza <[email protected]>
* Allow types to be defined on the eglib-config.h file, that could
be a platform specific generated type file.
* gtimer.c: split functionality in platforms.
2008-10-13 Bill Holmes <[email protected]>
* src/gdate-win32.c : Fix compiler errors for MSVC.
* src/gpath.c : Fix compiler errors for MSVC.
* src/gfile-posix.c : Adding declaration for mkstemp for the win 32
implementation in gfile-win32.c.
Contributed under MIT/X11 license.
2008-10-11 Miguel de Icaza <[email protected]>
* gtimer.c: Same process.
* src/glib.h: Move g_strdup here, to consolidate all allocations
in this header, will help for merging the allocation work later.
* src/gpattern.c (compile_pattern): From Unity, use -1 in the enum
for MatchType.
* src/gpath.c: Split this one as well.
* src/gmodule-win32.c, src/gmisc-unix.c, src/gmisc-win32.c,
src/gmodule-unix.c: split functionality in platforms.
* src/goutput.c (g_logv): On some platforms, before we abort we
want to flush the stdout/stderr.
2008-10-10 Miguel de Icaza <[email protected]>
* Split functionality that is operating system specific into
-win32.c, -unix.c and -posix.c
* Use g_malloc everywhere, and g_free, so that these can be easily
overwritten consistently.
2008-09-16 Bill Holmes <[email protected]>
* src/gunicode.c : Fix a warning.
Contributed under MIT/X11 license.
2008-08-28 Bill Holmes <[email protected]>
* src/glib.h : Adding a c++ definition for G_BEGIN_DECLS.
Contributed under MIT/X11 license.
2008-08-27 Bill Holmes <[email protected]>
* glib.h, gunicode.c : Fixing some compiler errors.
Contributed under MIT/X11 license.
2008-08-20 Mike Voorhees <[email protected]>
* Patch from Mike Voorhees to fix various problems with
g_utf8_validate compared to the glib implementation and unit tests
to ensure that there are no regressions.
From a mailing list post to mono-devel-list on August 19th, 2008
[Mono-dev] utf8 related patches. Please review.
2008-08-20 Mike Voorhees <[email protected]>
* src/glib.h : Adding declarations for g_utf8_strlen, g_utf8_get_char,
and g_utf8_next_char.
* src/gunicode.c : Adding implementation for g_utf8_strlen, g_utf8_get_char,
and g_utf8_next_char.
* src/gunicode.c : Rewrote g_utf8_validate.
* test/utf8.c Adding tests for g_utf8_strlen, g_utf8_get_char,
g_utf8_next_char, and g_utf8_validate.
Contributed under MIT/X11 license.
2008-08-05 Andreas Faerber <[email protected]>
* autogen.sh: Suppress arguments warning for NOCONFIGURE.
Contributed under MIT/X11 license.
2008-08-04 Bill Holmes <[email protected]>
* test/tests.h, test/Makefile.am, test/memory.c : Adding memory tests to test
allocation routines return NULL when 0 size is passed in.
Contributed under MIT/X11 license.
2008-08-04 Bill Holmes <[email protected]>
* src/glib.h : Changing the allocation routines to return null if 0 size is
passed in.
Contributed under MIT/X11 license.
2008-06-16 Zoltan Varga <[email protected]>
* src/vasprintf.c (vasprintf): Applied patch from Michail Ushakov
<[email protected]>. Workaround broken vsnprintf on windows. Fixes
#400445.
2008-06-11 Zoltan Varga <[email protected]>
* src/goutput.c (g_log): Remove unnecessary and incorrect call to
g_strdup_printf (). Fixes #398918.
2008-05-01 Bill Holmes <[email protected]>
* src/glib.h : Adding declarations for g_ucs4_to_utf16 and g_utf16_to_ucs4.
* src/gutf8.c : Adding implementation for g_ucs4_to_utf16 and g_utf16_to_ucs4.
* test/utf8.c Adding tests for g_ucs4_to_utf16 and g_utf16_to_ucs4.
Contributed under MIT/X11 license.
2008-04-20 Geoff Norton <[email protected]>
* src/gspan.c: Fix the _NSGetEnviron define to prevent an impropoer
pointer dereference.
2008-03-19 Bill Holmes <[email protected]>
* src/gpath.c (g_path_is_absolute) : Adding a case for '/'
on Windows.
* src/gpath.c (g_get_user_name) : On Windows add a check for %USERNAME%
when %USER% fails.
* src/gstr.c (g_strsplit, g_strsplit_set): Change to remove truncation
errors with MSVC build.
* src/gstr.c (g_filename_to_uri, g_filename_from_uri): Fixes to handle
Windows paths.
* src/gstr.c (g_ascii_strncasecmp): Convert each character to lower case
before comparing.
* src/gunicode.c (g_get_charset): Implement for Windows.
Contributed under MIT/X11 license.
2008-03-12 Geoff Norton <[email protected]>
* src/gutf8.c: Implement g_ucs4_to_utf16 and g_utf16_to_ucs4 as
asserts. They're needed to build mono with eglib.
* src/gutil.h: Add a few missing function declarations to the header.
* src/gspawn.c: Some darwin implementations don't have crt_externs.h
So we'll just define _NSGetEnviron() ourselves.
* Makefile.am: Dont build test when cross compiling.
* configure.ac: Define CROSS_COMPILING when cross compiling.
Undefine _FORTIFY_SOURCE on arm-apple-darwin as the headers it
requires are not available.
2008-01-15 Andreas Faerber <[email protected]>
* configure.ac: Add default G_BREAKPOINT implementation.
Fix typo in breakpoint CPU output.
2007-12-23 Zoltan Varga <[email protected]>
* src/glib.h: Include <limits.h>. Fixes #350482.
2007-11-21 Dick Porter <[email protected]>
* src/gslist.c (g_slist_find_custom): Implement
* src/glist.c (g_list_find_custom): Implement
* test/list.c: Test g_list_find_custom()
* test/slist.c: Test g_slist_find_custom()
2007-11-20 Dick Porter <[email protected]>
* src/gstr.c: Implement g_strsplit_set() and re-implement
g_strsplit() so it passes the additional tests. (g_strsplit()
should treat multi-char delimiters as just a single token, rather
than a set of delimiters.)
* src/gslist.c: Implement g_slist_index(), g_slist_nth() and
g_slist_nth_data().
* test/string-util.c: Test g_strsplit_set() and more tests for
g_strsplit().
* test/slist.c: Test g_slist_nth() and
g_slist_index().
2007-11-06 Geoff Norton <[email protected]>
* configure.ac: Check for libiconv_open as the previous check was failing against
some versions of libiconv.
2007-11-06 Andreas Faerber <[email protected]>
* test/Makefile.am: Fix noinst_PROGRAMS for automake 1.6.3
Add support for VPATH
2007-11-06 Geoff Norton <[email protected]>
* configure.ac: Determing if glib-2.0 is installed and set HAVE_GLIB appropriately
* test/Makefile.am: Only build test-glib if glib-2.0 is available
2007-11-05 Geoff Norton <[email protected]>
* configure.ac: Check for getpwent_r and wether libiconv is needed to be linked.
Also look to see if we can use export-dynamic in the test suite.
* test/Makefile.am: Get LDFLAGS from configure instead of setting them.
* src/gerror.c: Implement g_clear_error.
* src/glib.h: Only use the format, ... convention is HAVE_C99_SUPPORT is available.
* src/gpath.c: Only use the getpwent_r codepath if getpwent_r is available.
* src/gspawn.c: Define environ to call _NSGetEnviron() on Apple.
* src/Makefile.am: Remove -Werror so we dont fail on different function declarations.
Portions of all of the above are from Andreas Faerber & Jonathan Chambers
2007-10-31 Jonathan Chambers <[email protected]>
* src/ghashtable.c: Add g_hash_table_foreach_steal.
* src/garray.c: Add g_array_remove_index_fast.
* src/gpath.c (g_path_is_absolute): Handle windows paths.
* src/glib.h: Add g_hash_table_foreach_steal and g_array_remove_index_fast
Contribution is licensed as MIT/X11.
2007-06-13 Jonathan Chambers <[email protected]>
* src/gunicode.c: Add g_unichar_isxdigit and g_unichar_xdigit_value.
* src/gmisc.c: Add g_win32_getlocale stub.
* src/glib.h: Add declarations of above functions,
GFreeFunc typedef, and CLAMP, GUINT_TO_LE, and threading
macros.
* test/string-util.c: Fix warning.
* test/utf8.c: Add test for g_unichar_xdigit_value.
Contribution is licensed as MIT/X11.
2007-05-05 Aaron Bockover <[email protected]>
* src/gstr.c:
* src/glib.h: Added g_ascii_tolower implementation; make g_ascii_strdown
use it to do the transformation
* test/string-util.c: Added a test for g_ascii_strdown
2007-04-27 Jonathan Chambers <[email protected]>
* src/gstr.c: Fix off by one error in g_strdup allocation.
2007-04-27 Jonathan Chambers <[email protected]>
* src/eglib-config.hw: Forgot to add for msvc build.
* src/vasprintf: Forgot to add for msvc build.
2007-04-27 Jonathan Chambers <[email protected]>
* src/gstr.c: Fix off by one error for NULL terminator.
2007-04-27 Jonathan Chambers <[email protected]>
Combined patch from Michael Jerris <[email protected]> and me.
* winconfig.h: Config file for msvc builds.
* configure.ac: Add AC_CHECK_HEADERS for getopt.h, sys/time.h,
sys/wait.h, and pwd.h.
* src/gspawn.c: Include config.h and use HAVE_* macros.
* src/eglib-config.h.in: Add inclusion guards.
* src/ghashtable.c: Fix warnings.
* src/gmisc.c: Windows implementation of g_getenv, g_setenv,
and g_unsetenv.
* src/gpath.c: Include config.h and use HAVE_* macros.
* src/gmarkup.c: Fix warnings.
* src/gptrarray.c: Fix warnings.
* src/gstr.c: Fix warnings and use HAVE_* macros.
* src/glib.h: Move macros to eglib-config.h and include it.
* src/gdate.c: Implement g_get_current_time on windows.
* src/gpattern.c: Fix warnings.
* src/gdir.c: Implement g_dir on windows.
* src/gfile.c: Implement mkstemp and g_file_test on windows.
* src/gtimer.c: Implement g_timer on windows.
* src/gmodule.c: Fix warnings.
* src/gunicode.c: Fix warnings.
* src/gutf8.c: Fix warnings.
* test/ptrarray.c: Fix warnings.
* test/string.c: Fix warnings.
* test/list.c: Fix warnings.
* test/pattern.c: Use HAVE_* macros.
* test/dir.c: Use HAVE_* macros.
* test/file.c: Use HAVE_* macros and use system specific files for tests.
* test/test.c: Fix warnings and use HAVE_* macros.
* test/timer.c: Use HAVE_* macros.
* test/string-util.c: Fix warnings.
* test/test.h: Supress warnings on msvc.
* test/module.c: Use HAVE_* macros.
* test/utf8.c: Fix warnings.
* test/spawn.c: Use HAVE_* macros.
* test/driver.c: Fix warnings and use HAVE_* macros.
* test/path.c: Use HAVE_* macros and use system specific files for tests.
* test/sizes.c: Fix warnings.
2007-04-24 Jonathan Chambers <[email protected]>
Patch from Michael Jerris <[email protected]>
* src/gspawn.c: Start msvc build.
* src/gpath.c: Start msvc build.
* src/gmarkup.c: Start msvc build.
* src/gshell.c: Start msvc build.
* src/gstr.c: Start msvc build.
* src/glist.c: Start msvc build.
* src/glib.h: Start msvc build.
* src/gdate.c: Start msvc build.
* src/gpattern.c: Start msvc build.
* src/gdir.c: Start msvc build.
* src/gfile.c: Start msvc build.
* src/gtimer.c: Start msvc build.
* src/gmodule.c: Start msvc build.
* src/gunicode.c: Start msvc build.
2007-01-27 Robert Jordan <[email protected]>
* test/Makefile.am: Add linker option to be able to
load symbols from the main program.
* test/module.c: Clean-ups.
2007-01-26 Robert Jordan <[email protected]>
* configure.ac: Add PLATFORM_WIN32 conditional.
* src/Makefile.ac: Use PLATFORM_WIN32 conditional for psapi, iconv
* test/module.c, test/tests.h, test/Makefile.am: New test for gmodule.
* src/gmodule.h: Add G_MODULE_{IMPORT|EXPORT} defines.
* src/gmodule.c (g_module_symbol): Implement in-proc symbol lookup
for Win32.
* src/gmodule.c: Add GModule.main_module, consider it in
g_module_close ().
* src/gpath.c (g_get_home_dir): Add dummy Win32 implementation to
fix the build.
2006-11-03 Miguel de Icaza <[email protected]>
* src/gpath.c (g_path_get_dirname): If the pathname starts with a
"/", return the "/".
* test/string-util.c (test_strlcpy): Add new test.
* src/gunicode.c (g_filename_from_utf8): g_strlcpy needs the full
size, with the extra zero at the end; Fixes the stack trace
issue.
2006-10-30 Miguel de Icaza <[email protected]>
* test/utf8.c (test_utf8_seq): Add new failing test.
2006-10-30 Atsushi Enomoto <[email protected]>
* src/gutf8.c : several fixes:
@@ -1296,5 +873,3 @@ Mon Oct 9 12:59:16 CEST 2006 Paolo Molaro <[email protected]>
* src/ghashtable.c: Implement most of this, it is completely
untested at this point.
-4
View File
@@ -1,8 +1,4 @@
if CROSS_COMPILING
SUBDIRS = src
else
SUBDIRS = src test
endif
EXTRA_DIST = autogen.sh README NEWS AUTHORS ChangeLog
+5 -19
View File
@@ -18,31 +18,17 @@ no separate files, please try to follow the convetions in the source code
Please read the README in tests/
* Features
The source code is designed to allow for different operating
system builds of the eglib code.
Files in src that:
* Have a plain name: are cross platform, and should work on
every operating system.
* That end in -unix.c: These files contain Unix specific code.
* That end in -win32.c: These files contain Win32 specific code.
* That end in -posix.c: Will work on both Windows and Unix,
but should not be included for other operating systems.
* Plans: short and long term.
The short term plans for eglib is to allow Mono to optionally
build with it instead of using glib, gmodule and gthread, but
the default build will continue to be done against glib 2.0.
In the long-term we are considering dropping glib as a
dependency, considering that Mono requires a modern Unix
Our first target is to make this work with Linux, other
platforms will follow after that.
In the long-term (Mono 2.0) we are considering dropping glib
as a dependency, considering that Mono requires a modern Unix
system to run anyways (for its thread support) it would allow
us to fix some of the glib API limitations we have to live
with (explicit thread support for example), rework the API to
+2 -1
View File
@@ -14,7 +14,8 @@ Macros:
* Unimplemented, not supported currently:
(none as yet.)
g_unichar_tolower Used for deprecated unmanaged string collation
g_unichar_type Used for deprecated unmanaged string collation
* Dead Code
+1 -1
View File
@@ -82,7 +82,7 @@ if test "$DIE" -eq 1; then
exit 1
fi
if test x$NOCONFIGURE = x && test -z "$*"; then
if test -z "$*"; then
echo "**Warning**: I am going to run \`configure' with no arguments."
echo "If you wish to pass any to it, please specify them on the"
echo \`$0\'" command line."
+4 -26
View File
@@ -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.1)
AM_MAINTAINER_MODE
AC_PROG_CC
@@ -11,11 +11,11 @@ CFLAGS='-g -O0 -D_GNU_SOURCE'
AC_SUBST(CFLAGS)
GNUC_PRETTY=
GNUC_UNUSED=
BREAKPOINT="G_STMT_START { raise (SIGTRAP); } G_STMT_END"
BREAKPOINT="G_STMT_START { } G_STMT_END"
if test x$GCC = xyes; then
GNUC_UNUSED='__attribute__((__unused__))'
GNUC_NORETURN='__attribute__((__noreturn__))'
echo target_cpu=$target_cpu
echo targte_cpu=$target_cpu
case $target_cpu in
i*86) BREAKPOINT="G_STMT_START { __asm__ (\"int \$03\"); } G_STMT_END" ;;
esac
@@ -25,7 +25,6 @@ AC_SUBST(GNUC_UNUSED)
AC_SUBST(GNUC_NORETURN)
AC_SUBST(BREAKPOINT)
AM_CONDITIONAL(CROSS_COMPILING, [test x$cross_compiling = xyes])
AC_C_BIGENDIAN([ORDER=G_BIG_ENDIAN],[ORDER=G_LITTLE_ENDIAN])
AC_SUBST(ORDER)
@@ -42,29 +41,13 @@ case $host in
;;
esac
case $target in
arm*-darwin*)
CFLAGS="$CLAFGS -U_FORTIFY_SOURCE"
;;
esac
AC_SUBST(PATHSEP)
AC_SUBST(SEARCHSEP)
AC_SUBST(OS)
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_LIB(iconv, libiconv_open, LIBS="$LIBS -liconv")
old_ldflags="${LDFLAGS}"
LDFLAGS="${LDFLAGS} -Wl,-export-dynamic"
AC_TRY_LINK(, [int i;], found_export_dynamic=yes, found_export_dynamic=no)
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_FUNCS(strlcpy)
if test $ac_cv_sizeof_void_p != $ac_cv_sizeof_int; then
GPOINTER_TO_INT="((gint)(long) (ptr))"
@@ -83,11 +66,6 @@ else
GSIZE_FORMAT='"u"'
G_GUINT64_FORMAT='"llu"'
fi
PKG_CHECK_MODULES(GLIB, glib-2.0,
[AM_CONDITIONAL(HAVE_GLIB, test x = x)],
[AM_CONDITIONAL(HAVE_GLIB, test x = y)]
)
AC_SUBST(GPOINTER_TO_INT)
AC_SUBST(GPOINTER_TO_UINT)
AC_SUBST(GINT_TO_POINTER)
+8 -24
View File
@@ -1,19 +1,5 @@
noinst_LTLIBRARIES = libeglib.la
win_files = \
gdate-win32.c gdir-win32.c gfile-win32.c gmisc-win32.c \
gmodule-win32.c gtimer-win32.c
unix_files = \
gdate-unix.c gdir-unix.c gfile-unix.c gmisc-unix.c \
gmodule-unix.c gtimer-unix.c
if PLATFORM_WIN32
os_files = $(win_files)
else
os_files = $(unix_files)
endif
libeglib_la_SOURCES = \
eglib-config.h \
sort.frag.h \
@@ -22,6 +8,7 @@ libeglib_la_SOURCES = \
gerror.c \
ghashtable.c \
gmem.c \
gmodule.c \
gmodule.h \
goutput.c \
gstr.c \
@@ -29,29 +16,26 @@ libeglib_la_SOURCES = \
gstring.c \
gptrarray.c \
glist.c \
gmisc.c \
gqueue.c \
gpath.c \
gshell.c \
gspawn.c \
gtimer.c \
gdate.c \
gfile.c \
gfile-posix.c \
gpattern.c \
gdir.c \
gmarkup.c \
gutf8.c \
gunicode.c \
unicode-data.h \
$(os_files)
gunicode.c
libeglib_la_CFLAGS = -Wall -D_FORTIFY_SOURCE=2
libeglib_la_CFLAGS = -Wall -Werror -D_FORTIFY_SOURCE=2
INCLUDES = -I$(srcdir)
if PLATFORM_WIN32
libeglib_la_LIBADD = -lm -liconv -lpsapi
else
libeglib_la_LIBADD = -lm
endif
MAINTAINERCLEANFILES = Makefile.in
EXTRA_DIST = eglib-config.h.in $(win_files) $(unix_files)
EXTRA_DIST = eglib-config.h.in
-5
View File
@@ -1,6 +1,3 @@
#ifndef __EGLIB_CONFIG_H
#define __EGLIB_CONFIG_H
/*
* System-dependent settings
*/
@@ -24,5 +21,3 @@ typedef signed @GSIZE@ gssize;
#define G_GSIZE_FORMAT @GSIZE_FORMAT@
#define G_GUINT64_FORMAT @G_GUINT64_FORMAT@
#endif
-72
View File
@@ -1,72 +0,0 @@
#ifndef __EGLIB_CONFIG_H
#define __EGLIB_CONFIG_H
/*
* System-dependent settings
*/
#define G_OS_WIN32 1
#ifdef _MSC_VER
#include <io.h>
#define G_GNUC_PRETTY_FUNCTION __FUNCTION__
#define G_GNUC_UNUSED
#define G_BYTE_ORDER 1234
#define G_GNUC_NORETURN
#define G_BREAKPOINT() __debugbreak()
#define MAXPATHLEN 242
typedef uintptr_t gsize;
typedef intptr_t gssize;
typedef int pid_t;
#define G_DIR_SEPARATOR '\\'
#define G_DIR_SEPARATOR_S "\\"
#define G_SEARCHPATH_SEPARATOR_S ";"
#define G_SEARCHPATH_SEPARATOR ';'
#define G_GSIZE_FORMAT "d"
#define G_GUINT64_FORMAT "d"
#define GPOINTER_TO_INT(ptr) ((gint)(intptr_t) (ptr))
#define GPOINTER_TO_UINT(ptr) ((guint)(intptr_t) (ptr))
#define GINT_TO_POINTER(v) ((gpointer)(intptr_t) (v))
#define GUINT_TO_POINTER(v) ((gpointer)(intptr_t) (v))
#define INT32_MAX 2147483647
#define INT32_MIN (~ INT32_MAX)
#define INT64_MAX 9223372036854775807i64
#define INT64_MIN (~INT64_MAX)
#define UINT32_MAX 0xffffffffU
#define STDOUT_FILENO (int)(intptr_t)stdout
#define STDERR_FILENO (int)(intptr_t)stderr
/* FIXME: what should this be ?*/
#define X_OK 4 /* This is really read */
#define WNOHANG 1
#define F_SETFD 1
#define FD_CLOEXEC 1
#undef inline
#define inline __inline
#define strtok_r strtok_s
#undef G_HAVE_UNISTD_H
#undef G_HAVE_SYS_TIME_H
#undef G_HAVE_SYS_WAIT_H
#undef G_HAVE_PWD_H
#undef G_HAVE_STRNDUP
#define G_HAVE_GETOPT_H 1
int vasprintf(char **ret, const char *fmt, va_list ap);
/* disable the following warnings
* C4100: The formal parameter is not referenced in the body of the function. The unreferenced parameter is ignored.
* C4127: conditional expression is constant
*/
#pragma warning(disable:4100 4127)
#endif
#endif
-23
View File
@@ -181,26 +181,3 @@ g_array_remove_index (GArray *array,
return array;
}
GArray*
g_array_remove_index_fast (GArray *array,
guint index_)
{
GArrayPriv *priv = (GArrayPriv*)array;
g_return_val_if_fail (array != NULL, NULL);
memmove (element_offset (priv, index_),
element_offset (priv, array->len - 1),
element_length (priv, array->len - index_));
array->len --;
if (priv->zero_terminated) {
memset (element_offset (priv, priv->array.len),
0,
priv->element_size);
}
return array;
}
-42
View File
@@ -1,42 +0,0 @@
/*
* gdate-unix.c: Date and time utility functions.
*
* Author:
* Gonzalo Paniagua Javier ([email protected]
*
* (C) 2006 Novell, Inc.
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
* LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
* OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
#include <stdio.h>
#include <glib.h>
#include <sys/time.h>
void
g_get_current_time (GTimeVal *result)
{
struct timeval tv;
g_return_if_fail (result != NULL);
gettimeofday (&tv, NULL);
result->tv_sec = tv.tv_sec;
result->tv_usec = tv.tv_usec;
}
-44
View File
@@ -1,44 +0,0 @@
/*
* gdate-win32.c: Date and time utility functions.
*
* Author:
* Gonzalo Paniagua Javier ([email protected]
*
* (C) 2006 Novell, Inc.
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
* LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
* OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
#include <stdio.h>
#include <glib.h>
#include <winsock2.h>
void
g_get_current_time (GTimeVal *result)
{
long int l;
g_return_if_fail (result != NULL);
l = GetTickCount();
result->tv_sec = l / 1000;
result->tv_usec = (l % 1000) * 1000;
}
+42
View File
@@ -0,0 +1,42 @@
/*
* Date and time utility functions.
*
* Author:
* Gonzalo Paniagua Javier ([email protected]
*
* (C) 2006 Novell, Inc.
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
* LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
* OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
#include <stdio.h>
#include <glib.h>
#include <sys/time.h>
void
g_get_current_time (GTimeVal *result)
{
struct timeval tv;
g_return_if_fail (result != NULL);
gettimeofday (&tv, NULL);
result->tv_sec = tv.tv_sec;
result->tv_usec = tv.tv_usec;
}
-94
View File
@@ -1,94 +0,0 @@
/*
* Directory utility functions.
*
* Author:
* Gonzalo Paniagua Javier ([email protected])
*
* (C) 2006 Novell, Inc.
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
* LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
* OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
#include <glib.h>
#include <stdio.h>
#include <stdlib.h>
#include <errno.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
#include <dirent.h>
struct _GDir {
DIR *dir;
};
GDir *
g_dir_open (const gchar *path, guint flags, GError **error)
{
GDir *dir;
g_return_val_if_fail (path != NULL, NULL);
g_return_val_if_fail (error == NULL || *error == NULL, NULL);
(void) flags; /* this is not used */
dir = g_new (GDir, 1);
dir->dir = opendir (path);
if (dir->dir == NULL) {
if (error) {
gint err = errno;
*error = g_error_new (G_LOG_DOMAIN, g_file_error_from_errno (err), strerror (err));
}
g_free (dir);
return NULL;
}
return dir;
}
const gchar *
g_dir_read_name (GDir *dir)
{
struct dirent *entry;
g_return_val_if_fail (dir != NULL && dir->dir != NULL, NULL);
do {
entry = readdir (dir->dir);
if (entry == NULL)
return NULL;
} while ((strcmp (entry->d_name, ".") == 0) || (strcmp (entry->d_name, "..") == 0));
return entry->d_name;
}
void
g_dir_rewind (GDir *dir)
{
g_return_if_fail (dir != NULL && dir->dir != NULL);
rewinddir (dir->dir);
}
void
g_dir_close (GDir *dir)
{
g_return_if_fail (dir != NULL && dir->dir != 0);
closedir (dir->dir);
dir->dir = NULL;
g_free (dir);
}
-147
View File
@@ -1,147 +0,0 @@
/*
* Directory utility functions.
*
* Author:
* Gonzalo Paniagua Javier ([email protected])
*
* (C) 2006 Novell, Inc.
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
* LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
* OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
#include <glib.h>
#include <stdio.h>
#include <stdlib.h>
#include <errno.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <io.h>
#include <winsock2.h>
struct _GDir {
HANDLE handle;
gchar* current;
gchar* next;
};
GDir *
g_dir_open (const gchar *path, guint flags, GError **error)
{
GDir *dir;
gunichar2* path_utf16;
gunichar2* path_utf16_search;
WIN32_FIND_DATA find_data;
g_return_val_if_fail (path != NULL, NULL);
g_return_val_if_fail (error == NULL || *error == NULL, NULL);
dir = g_new0 (GDir, 1);
path_utf16 = u8to16 (path);
dir->handle = FindFirstFile (path_utf16, &find_data);
if (dir->handle == INVALID_HANDLE_VALUE) {
if (error) {
gint err = errno;
*error = g_error_new (G_LOG_DOMAIN, g_file_error_from_errno (err), strerror (err));
}
g_free (dir);
g_free (path_utf16);
return NULL;
}
/* now get files */
FindClose (dir->handle);
path_utf16_search = g_malloc ((wcslen(path_utf16) + 3)*sizeof(gunichar2));
wcscpy (path_utf16_search, path_utf16);
wcscat (path_utf16_search, L"\\*");
dir->handle = FindFirstFile (path_utf16_search, &find_data);
g_free (path_utf16_search);
while ((wcscmp (find_data.cFileName, L".") == 0) || (wcscmp (find_data.cFileName, L"..") == 0)) {
if (!FindNextFile (dir->handle, &find_data)) {
if (error) {
gint err = errno;
*error = g_error_new (G_LOG_DOMAIN, g_file_error_from_errno (err), strerror (err));
}
g_free (dir);
g_free (path_utf16);
return NULL;
}
}
dir->current = NULL;
dir->next = u16to8 (find_data.cFileName);
g_free (path_utf16);
return dir;
}
const gchar *
g_dir_read_name (GDir *dir)
{
WIN32_FIND_DATA find_data;
g_return_val_if_fail (dir != NULL && dir->handle != 0, NULL);
if (dir->current)
g_free (dir->current);
dir->current = NULL;
dir->current = dir->next;
if (!dir->current)
return NULL;
dir->next = NULL;
do {
if (!FindNextFile (dir->handle, &find_data)) {
dir->next = NULL;
return dir->current;
}
} while ((wcscmp (find_data.cFileName, L".") == 0) || (wcscmp (find_data.cFileName, L"..") == 0));
dir->next = u16to8 (find_data.cFileName);
return dir->current;
}
void
g_dir_rewind (GDir *dir)
{
}
void
g_dir_close (GDir *dir)
{
g_return_if_fail (dir != NULL && dir->handle != 0);
if (dir->current)
g_free (dir->current);
dir->current = NULL;
if (dir->next)
g_free (dir->next);
dir->next = NULL;
FindClose (dir->handle);
dir->handle = 0;
g_free (dir);
}
+110
View File
@@ -0,0 +1,110 @@
/*
* Directory utility functions.
*
* Author:
* Gonzalo Paniagua Javier ([email protected])
*
* (C) 2006 Novell, Inc.
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
* LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
* OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
#include <glib.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <errno.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <dirent.h>
struct _GDir {
#ifdef G_OS_WIN32
#else
DIR *dir;
#endif
};
GDir *
g_dir_open (const gchar *path, guint flags, GError **error)
{
#ifdef G_OS_WIN32
return NULL;
#else
GDir *dir;
g_return_val_if_fail (path != NULL, NULL);
g_return_val_if_fail (error == NULL || *error == NULL, NULL);
(void) flags; /* this is not used */
dir = g_new (GDir, 1);
dir->dir = opendir (path);
if (dir->dir == NULL) {
if (error) {
gint err = errno;
*error = g_error_new (G_LOG_DOMAIN, g_file_error_from_errno (err), strerror (err));
}
g_free (dir);
return NULL;
}
return dir;
#endif
}
const gchar *
g_dir_read_name (GDir *dir)
{
#ifdef G_OS_WIN32
return NULL;
#else
struct dirent *entry;
g_return_val_if_fail (dir != NULL && dir->dir != NULL, NULL);
do {
entry = readdir (dir->dir);
if (entry == NULL)
return NULL;
} while ((strcmp (entry->d_name, ".") == 0) || (strcmp (entry->d_name, "..") == 0));
return entry->d_name;
#endif
}
void
g_dir_rewind (GDir *dir)
{
#ifdef G_OS_WIN32
#else
g_return_if_fail (dir != NULL && dir->dir != NULL);
rewinddir (dir->dir);
#endif
}
void
g_dir_close (GDir *dir)
{
#ifdef G_OS_WIN32
#else
g_return_if_fail (dir != NULL && dir->dir != NULL);
closedir (dir->dir);
dir->dir = NULL;
g_free (dir);
#endif
}
-9
View File
@@ -47,15 +47,6 @@ g_error_new (gpointer domain, gint code, const char *format, ...)
return err;
}
void
g_clear_error (GError **error)
{
if (error && *error) {
g_error_free (*error);
*error = NULL;
}
}
void
g_error_free (GError *error)
{
-167
View File
@@ -1,167 +0,0 @@
/*
* File utility functions.
*
* Author:
* Gonzalo Paniagua Javier ([email protected])
*
* (C) 2006 Novell, Inc.
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
* LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
* OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
#include <config.h>
#include <glib.h>
#include <stdio.h>
#include <stdlib.h>
#include <errno.h>
#include <fcntl.h>
#include <sys/stat.h>
#include <sys/types.h>
#ifdef _MSC_VER
#include <direct.h>
int mkstemp (char *tmp_template);
#endif
#ifndef O_LARGEFILE
#define OPEN_FLAGS (O_RDONLY)
#else
#define OPEN_FLAGS (O_RDONLY | O_LARGEFILE)
#endif
gboolean
g_file_get_contents (const gchar *filename, gchar **contents, gsize *length, GError **error)
{
gchar *str;
int fd;
struct stat st;
long offset;
int nread;
g_return_val_if_fail (filename != NULL, FALSE);
g_return_val_if_fail (contents != NULL, FALSE);
g_return_val_if_fail (error == NULL || *error == NULL, FALSE);
*contents = NULL;
if (length)
*length = 0;
fd = open (filename, OPEN_FLAGS);
if (fd == -1) {
if (error != NULL) {
int err = errno;
*error = g_error_new (G_LOG_DOMAIN, g_file_error_from_errno (err), "Error opening file");
}
return FALSE;
}
if (fstat (fd, &st) != 0) {
if (error != NULL) {
int err = errno;
*error = g_error_new (G_LOG_DOMAIN, g_file_error_from_errno (err), "Error in fstat()");
}
close (fd);
return FALSE;
}
str = g_malloc (st.st_size + 1);
offset = 0;
do {
nread = read (fd, str + offset, st.st_size - offset);
if (nread > 0) {
offset += nread;
}
} while ((nread > 0 && offset < st.st_size) || (nread == -1 && errno == EINTR));
close (fd);
str [st.st_size] = '\0';
if (length) {
*length = st.st_size;
}
*contents = str;
return TRUE;
}
gint
g_file_open_tmp (const gchar *tmpl, gchar **name_used, GError **error)
{
const static gchar *default_tmpl = ".XXXXXX";
gchar *t;
gint fd;
size_t len;
g_return_val_if_fail (error == NULL || *error == NULL, -1);
if (tmpl == NULL)
tmpl = default_tmpl;
if (strchr (tmpl, G_DIR_SEPARATOR) != NULL) {
if (error) {
*error = g_error_new (G_LOG_DOMAIN, 24, "Template should not have any " G_DIR_SEPARATOR_S);
}
return -1;
}
len = strlen (tmpl);
if (len < 6 || strcmp (tmpl + len - 6, "XXXXXX")) {
if (error) {
*error = g_error_new (G_LOG_DOMAIN, 24, "Template should end with XXXXXX");
}
return -1;
}
t = g_build_filename (g_get_tmp_dir (), tmpl, NULL);
fd = mkstemp (t);
if (fd == -1) {
if (error) {
int err = errno;
*error = g_error_new (G_LOG_DOMAIN, g_file_error_from_errno (err), "Error in mkstemp()");
}
g_free (t);
return -1;
}
if (name_used) {
*name_used = t;
} else {
g_free (t);
}
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;
}
-84
View File
@@ -1,84 +0,0 @@
/*
* File utility functions.
*
* Author:
* Gonzalo Paniagua Javier ([email protected])
*
* (C) 2006 Novell, Inc.
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
* LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
* OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
#include <config.h>
#include <glib.h>
#include <stdio.h>
#include <stdlib.h>
#include <errno.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <sys/types.h>
#include <sys/stat.h>
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
gboolean
g_file_test (const gchar *filename, GFileTest test)
{
struct stat st;
gboolean have_stat;
if (filename == NULL || test == 0)
return FALSE;
have_stat = FALSE;
if ((test & G_FILE_TEST_EXISTS) != 0) {
if (access (filename, F_OK) == 0)
return TRUE;
}
if ((test & G_FILE_TEST_IS_EXECUTABLE) != 0) {
if (access (filename, X_OK) == 0)
return TRUE;
}
if ((test & G_FILE_TEST_IS_SYMLINK) != 0) {
have_stat = (lstat (filename, &st) == 0);
if (have_stat && S_ISLNK (st.st_mode))
return TRUE;
}
if ((test & G_FILE_TEST_IS_REGULAR) != 0) {
if (!have_stat)
have_stat = (stat (filename, &st) == 0);
if (have_stat && S_ISREG (st.st_mode))
return TRUE;
}
if ((test & G_FILE_TEST_IS_DIR) != 0) {
if (!have_stat)
have_stat = (stat (filename, &st) == 0);
if (have_stat && S_ISDIR (st.st_mode))
return TRUE;
}
return FALSE;
}
-113
View File
@@ -1,113 +0,0 @@
/*
* File utility functions.
*
* Author:
* Gonzalo Paniagua Javier ([email protected])
*
* (C) 2006 Novell, Inc.
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
* LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
* OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
#include <config.h>
#include <glib.h>
#include <stdio.h>
#include <stdlib.h>
#include <errno.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <sys/types.h>
#include <sys/stat.h>
#ifdef G_OS_WIN32
#include <io.h>
#define open _open
#define S_ISREG(x) ((x & _S_IFMT) == _S_IFREG)
#define S_ISDIR(x) ((x & _S_IFMT) == _S_IFDIR)
#endif
int mkstemp (char *tmp_template)
{
int fd;
gunichar2* utf16_template;
utf16_template = u8to16 (tmp_template);
fd = -1;
utf16_template = _wmktemp( utf16_template);
if (utf16_template && *utf16_template) {
/* FIXME: _O_TEMPORARY causes file to disappear on close causing a test to fail */
fd = _wopen( utf16_template, _O_BINARY | _O_CREAT /*| _O_TEMPORARY*/ | _O_EXCL, _S_IREAD | _S_IWRITE);
}
sprintf (tmp_template + strlen (tmp_template) - 6, "%S", utf16_template + wcslen (utf16_template) - 6);
g_free (utf16_template);
return fd;
}
#ifdef _MSC_VER
#pragma warning(disable:4701)
#endif
gboolean
g_file_test (const gchar *filename, GFileTest test)
{
struct _stat64 stat;
int ret = 0;
gunichar2* utf16_filename = NULL;
if (filename == NULL || test == 0)
return FALSE;
utf16_filename = u8to16 (filename);
ret = _wstati64 (utf16_filename, &stat);
g_free (utf16_filename);
if ((test & G_FILE_TEST_EXISTS) != 0) {
if (ret == 0)
return TRUE;
}
if (ret != 0)
return FALSE;
if ((test & G_FILE_TEST_IS_EXECUTABLE) != 0) {
if (stat.st_mode & _S_IEXEC)
return TRUE;
}
if ((test & G_FILE_TEST_IS_REGULAR) != 0) {
if (stat.st_mode & _S_IFREG)
return TRUE;
}
if ((test & G_FILE_TEST_IS_DIR) != 0) {
if (stat.st_mode & _S_IFDIR)
return TRUE;
}
/* make this last in case it is OR'd with something else */
if ((test & G_FILE_TEST_IS_SYMLINK) != 0) {
return FALSE;
}
return FALSE;
}
+152 -1
View File
@@ -25,10 +25,14 @@
* OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
#include <config.h>
#include <glib.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <errno.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
GFileError
g_file_error_from_errno (gint err_no)
@@ -91,4 +95,151 @@ g_file_error_from_errno (gint err_no)
}
}
#ifndef O_LARGEFILE
#define OPEN_FLAGS (O_RDONLY)
#else
#define OPEN_FLAGS (O_RDONLY | O_LARGEFILE)
#endif
gboolean
g_file_get_contents (const gchar *filename, gchar **contents, gsize *length, GError **error)
{
gchar *str;
int fd;
struct stat st;
long offset;
int nread;
g_return_val_if_fail (filename != NULL, FALSE);
g_return_val_if_fail (contents != NULL, FALSE);
g_return_val_if_fail (error == NULL || *error == NULL, FALSE);
*contents = NULL;
if (length)
*length = 0;
fd = open (filename, OPEN_FLAGS);
if (fd == -1) {
if (error != NULL) {
int err = errno;
*error = g_error_new (G_LOG_DOMAIN, g_file_error_from_errno (err), "Error opening file");
}
return FALSE;
}
if (fstat (fd, &st) != 0) {
if (error != NULL) {
int err = errno;
*error = g_error_new (G_LOG_DOMAIN, g_file_error_from_errno (err), "Error in fstat()");
}
close (fd);
return FALSE;
}
str = g_malloc (st.st_size + 1);
offset = 0;
do {
nread = read (fd, str + offset, st.st_size - offset);
if (nread > 0) {
offset += nread;
}
} while ((nread > 0 && offset < st.st_size) || (nread == -1 && errno == EINTR));
close (fd);
str [st.st_size] = '\0';
if (length) {
*length = st.st_size;
}
*contents = str;
return TRUE;
}
gint
g_file_open_tmp (const gchar *tmpl, gchar **name_used, GError **error)
{
const static gchar *default_tmpl = ".XXXXXX";
gchar *t;
gint fd;
gint len;
g_return_val_if_fail (error == NULL || *error == NULL, -1);
if (tmpl == NULL)
tmpl = default_tmpl;
if (strchr (tmpl, G_DIR_SEPARATOR) != NULL) {
if (error) {
*error = g_error_new (G_LOG_DOMAIN, 24, "Template should not have any " G_DIR_SEPARATOR_S);
}
return -1;
}
len = strlen (tmpl);
if (len < 6 || strcmp (tmpl + len - 6, "XXXXXX")) {
if (error) {
*error = g_error_new (G_LOG_DOMAIN, 24, "Template should end with XXXXXX");
}
return -1;
}
t = g_build_filename (g_get_tmp_dir (), tmpl, NULL);
fd = mkstemp (t);
if (fd == -1) {
if (error) {
int err = errno;
*error = g_error_new (G_LOG_DOMAIN, g_file_error_from_errno (err), "Error in mkstemp()");
}
g_free (t);
return -1;
}
if (name_used) {
*name_used = t;
} else {
g_free (t);
}
return fd;
}
gboolean
g_file_test (const gchar *filename, GFileTest test)
{
struct stat st;
gboolean have_stat;
if (filename == NULL || test == 0)
return FALSE;
have_stat = FALSE;
#ifdef G_OS_WIN32
#else
if ((test & G_FILE_TEST_EXISTS) != 0) {
if (access (filename, F_OK) == 0)
return TRUE;
}
if ((test & G_FILE_TEST_IS_EXECUTABLE) != 0) {
if (access (filename, X_OK) == 0)
return TRUE;
}
if ((test & G_FILE_TEST_IS_SYMLINK) != 0) {
have_stat = (lstat (filename, &st) == 0);
if (have_stat && S_ISLNK (st.st_mode))
return TRUE;
}
#endif
if ((test & G_FILE_TEST_IS_REGULAR) != 0) {
if (!have_stat)
have_stat = (stat (filename, &st) == 0);
if (have_stat && S_ISREG (st.st_mode))
return TRUE;
}
if ((test & G_FILE_TEST_IS_DIR) != 0) {
if (!have_stat)
have_stat = (stat (filename, &st) == 0);
if (have_stat && S_ISDIR (st.st_mode))
return TRUE;
}
return FALSE;
}
+2 -41
View File
@@ -51,7 +51,7 @@ struct _GHashTable {
GDestroyNotify value_destroy_func, key_destroy_func;
};
static const guint prime_tbl[] = {
static const int prime_tbl[] = {
11, 19, 37, 73, 109, 163, 251, 367, 557, 823, 1237,
1861, 2777, 4177, 6247, 9371, 14057, 21089, 31627,
47431, 71143, 106721, 160073, 240101, 360163,
@@ -164,7 +164,7 @@ do_rehash (GHashTable *hash)
static void
rehash (GHashTable *hash)
{
int diff = ABS (hash->last_rehash - hash->in_use);
int diff = ABS (hash->last_rehash, hash->in_use);
/* These are the factors to play with to change the rehashing strategy */
/* I played with them with a large range, and could not really get */
@@ -358,45 +358,6 @@ g_hash_table_foreach_remove (GHashTable *hash, GHRFunc func, gpointer user_data)
return count;
}
guint
g_hash_table_foreach_steal (GHashTable *hash, GHRFunc func, gpointer user_data)
{
int i;
int count = 0;
g_return_val_if_fail (hash != NULL, 0);
g_return_val_if_fail (func != NULL, 0);
for (i = 0; i < hash->table_size; i++){
Slot *s, *last;
last = NULL;
for (s = hash->table [i]; s != NULL; ){
if ((*func)(s->key, s->value, user_data)){
Slot *n;
if (last == NULL){
hash->table [i] = s->next;
n = s->next;
} else {
last->next = s->next;
n = last->next;
}
g_free (s);
hash->in_use--;
count++;
s = n;
} else {
last = s;
s = s->next;
}
}
}
if (count > 0)
rehash (hash);
return count;
}
void
g_hash_table_destroy (GHashTable *hash)
{
Loaded 100 of 23897 files, more files were not shown because too many files have changed in this diff. Show more