mirror of
https://github.com/BepInEx/mono.git
synced 2026-11-17 11:21:39 -10:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1bce5f4a2a | ||
|
|
4e4824afab | ||
|
|
7f0542b133 | ||
|
|
9f187b5dd0 |
No files matched your search
@@ -1,101 +1,3 @@
|
||||
2003-02-17 Daniel Morgan <[email protected]>
|
||||
|
||||
* doc/provider-factory: add new web page
|
||||
about Mono.Data's ProviderFactory
|
||||
|
||||
* doc/web/commands
|
||||
* doc/web/makefile: add provider-factory web page to build
|
||||
|
||||
* doc/ado-net
|
||||
* doc/ibmdb2
|
||||
* doc/postgresql
|
||||
* doc/sqlclient
|
||||
* doc/tdsclient
|
||||
* doc/sybase
|
||||
* doc/mysql
|
||||
* doc/firebird
|
||||
* doc/oracle
|
||||
* doc/oledb
|
||||
* doc/odbc
|
||||
* doc/sqlite: updated web pages
|
||||
|
||||
2003-02-16 Martin Baulig <[email protected]>
|
||||
|
||||
* doc/jit-debug-sample
|
||||
* doc/jit-debug-sample2: Removed.
|
||||
|
||||
* doc/jit-debug: Updated.
|
||||
|
||||
2003-02-13 Daniel Morgan <[email protected]>
|
||||
|
||||
* doc/screenshots
|
||||
* doc/ado-net
|
||||
* doc/oracle
|
||||
* doc/gtk-sharp: update web pages
|
||||
|
||||
2003-02-13 Gonzalo Paniagua Javier <[email protected]>
|
||||
|
||||
* data/machine.config: added sample globalization section.
|
||||
|
||||
2003-02-12 Gonzalo Paniagua Javier <[email protected]>
|
||||
|
||||
* data/machine.config: added UrlAuthorizationModule and
|
||||
AuthenticationConfigHandler.
|
||||
|
||||
2003-02-11 Tim Coleman <[email protected]>
|
||||
* data/config.in: Add mapping for Oracle call interface
|
||||
(OCI) native libraries.
|
||||
|
||||
2003-02-04 Gonzalo Paniagua Javier <[email protected]>
|
||||
|
||||
* configure.in: added check for sys/un.h.
|
||||
|
||||
2003-01-29 Daniel Morgan <[email protected]>
|
||||
|
||||
* doc/postgresql
|
||||
* doc/mysql
|
||||
* doc/ado-net: updates to web pages
|
||||
|
||||
* man/sqlsharp.1: update to man page
|
||||
|
||||
2003-01-28 Gonzalo Paniagua Javier <[email protected]>
|
||||
|
||||
* configure.in: added WIN32_THREADS flag when building under windows.
|
||||
It seems that the header files of the gc do not always define it when
|
||||
GC_WIN32_THREADS is defined.
|
||||
|
||||
2003-01-26 Daniel Morgan <[email protected]>
|
||||
|
||||
* doc/index
|
||||
* doc/ado-net
|
||||
* doc/firebird
|
||||
* doc/ibmdb2
|
||||
* doc/mysql
|
||||
* doc/odbc
|
||||
* doc/oledb
|
||||
* doc/oracle
|
||||
* doc/postgresql
|
||||
* doc/sqlclient
|
||||
* doc/sqlite
|
||||
* doc/sybase
|
||||
* doc/tdsclient: corrections
|
||||
|
||||
2003-01-26 Duncan Mak <[email protected]>
|
||||
|
||||
* doc/jit-debug: Update the links. Thanks for Andy Oliver for the report.
|
||||
|
||||
2003-01-22 Martin Baulig <[email protected]>
|
||||
|
||||
* configure.in: Set version number to 0.19.1.
|
||||
|
||||
Heads up: I'm going to commit some changes to the debugger
|
||||
which'll require you to use this new runtime, so if you update the
|
||||
debugger from CVS, you also need this new runtime.
|
||||
|
||||
2003-01-20 Duncan Mak <[email protected]>
|
||||
|
||||
* configure.in: Bump the release number to 0.19.
|
||||
|
||||
2003-01-19 Daniel Morgan <[email protected]>
|
||||
|
||||
* doc/ibmdb2: added file which is new web page
|
||||
|
||||
@@ -1,92 +1,3 @@
|
||||
Hello everyone!
|
||||
|
||||
We have made a new release of Mono available. Despite the fact
|
||||
that we just did Mono 0.18, this release is packed with new features.
|
||||
|
||||
* Availability.
|
||||
|
||||
Mono 0.19 is available in package format from:
|
||||
|
||||
http://www.go-mono.com/download.html
|
||||
|
||||
We released packages for SuSE 8.0, Mandrake 8.2, Debian and various
|
||||
Red Hat releases. It is also available from Red Carpet on the Mono
|
||||
channel.
|
||||
|
||||
Source code for Mono, MCS, the Mono Debugger, XSP is available as
|
||||
well from that web page.
|
||||
|
||||
* New in this release
|
||||
|
||||
* Remoting news:
|
||||
|
||||
Lluis has implemented and documented the Binary formatter
|
||||
Woohoo! He has done a lot of work as well to support
|
||||
remoting.
|
||||
|
||||
Patrik has also been working heavily on fixing a
|
||||
number of remoting related bugs and missing features.
|
||||
|
||||
Ajay also implemented 1-d array serialization in System.Xml
|
||||
|
||||
* New database provider: IBM DB2
|
||||
|
||||
Christopher Bockner has contributed a DB2 data
|
||||
provider for System.Data. We have a very complete
|
||||
range of data providers.
|
||||
|
||||
* System.Web.Mobile
|
||||
|
||||
Gaurav has started work on this assembly, this will
|
||||
allow us to run the unmodified reference ASP.NET
|
||||
applications that were designed to support Mobile
|
||||
browsing.
|
||||
|
||||
* System.Data and System.XML:
|
||||
|
||||
More implementation work on XmlDataDocument from Ville
|
||||
and plenty of fixes from Atsushi.
|
||||
|
||||
* MacOS patches:
|
||||
|
||||
Paolo integrated John Duncan's and Benjamin Reed
|
||||
patches to make Mono run on MacOS X out of the box.
|
||||
|
||||
* IsolatedStorage
|
||||
|
||||
The initial implementation of it was done by Jonathan
|
||||
Pryor and included in this release.
|
||||
|
||||
* Compilers:
|
||||
|
||||
More work on the Mono Visual Basic compiler (it is now
|
||||
included in the packages).
|
||||
|
||||
Plenty of bug fixes from Jackson, Miguel to the C#
|
||||
compiler.
|
||||
|
||||
Patches from Francesco and Daniel to the VB.NET
|
||||
support runtime.
|
||||
|
||||
* Debugger support
|
||||
|
||||
Plenty of updates to run the new Mono Debugger from Martin.
|
||||
|
||||
* Main missing bits:
|
||||
|
||||
Some of everyone's favorite patches or code chunks have not yet
|
||||
been integrated, hopefully Mono 0.20 will have them:
|
||||
|
||||
* Zoltan's patch to run IKVM is not yet on this release
|
||||
|
||||
* Some parts of Patrik's remoting code did not make it to the
|
||||
release either.
|
||||
|
||||
* Reggie's MySQL native provider is also missing.
|
||||
|
||||
Enjoy!
|
||||
Miguel.
|
||||
------------------------------------------------------------------------------
|
||||
Happy new year!
|
||||
|
||||
The Mono team is proud to release Mono 0.18, with plenty of bug
|
||||
|
||||
+51
@@ -0,0 +1,51 @@
|
||||
/* config.h.in. Generated automatically from configure.in by autoheader 2.13. */
|
||||
|
||||
/* Define if you have the ANSI C header files. */
|
||||
#undef STDC_HEADERS
|
||||
|
||||
#undef HAVE_INET_PTON
|
||||
#undef HAVE_INET_ATON
|
||||
#undef HAVE_SOL_IP
|
||||
#undef HAVE_SOL_TCP
|
||||
#undef HAVE_IP_PKTINFO
|
||||
#undef HAVE_STRUCT_IP_MREQN
|
||||
#undef HAVE_PTHREAD
|
||||
#undef HAVE_PTHREAD_MUTEX_TIMEDLOCK
|
||||
#undef USE_MONO_MUTEX
|
||||
#undef HAVE_LARGE_FILE_SUPPORT
|
||||
#undef PLATFORM_WIN32
|
||||
#undef HAVE_NEW_ICONV
|
||||
#undef NAME_DEV_RANDOM
|
||||
#undef HAVE_CRYPT_RNG
|
||||
#undef HAVE_BOEHM_GC
|
||||
|
||||
/* The number of bytes in a void *. */
|
||||
#undef SIZEOF_VOID_P
|
||||
|
||||
/* Define if you have the inet_aton function. */
|
||||
#undef HAVE_INET_ATON
|
||||
|
||||
/* Define if you have the inet_pton function. */
|
||||
#undef HAVE_INET_PTON
|
||||
|
||||
/* Define if you have the <dlfcn.h> header file. */
|
||||
#undef HAVE_DLFCN_H
|
||||
|
||||
/* Define if you have the <netdb.h> header file. */
|
||||
#undef HAVE_NETDB_H
|
||||
|
||||
/* Define if you have the <sys/filio.h> header file. */
|
||||
#undef HAVE_SYS_FILIO_H
|
||||
|
||||
/* Define if you have the <sys/sockio.h> header file. */
|
||||
#undef HAVE_SYS_SOCKIO_H
|
||||
|
||||
/* Define if you have the <utime.h> header file. */
|
||||
#undef HAVE_UTIME_H
|
||||
|
||||
/* Name of package */
|
||||
#undef PACKAGE
|
||||
|
||||
/* Version number of package */
|
||||
#undef VERSION
|
||||
|
||||
+3
-10
@@ -1,7 +1,7 @@
|
||||
AC_INIT(README)
|
||||
AC_CANONICAL_SYSTEM
|
||||
AM_CONFIG_HEADER(config.h)
|
||||
AM_INIT_AUTOMAKE(mono, 0.20)
|
||||
AM_INIT_AUTOMAKE(mono, 0.18)
|
||||
AM_MAINTAINER_MODE
|
||||
|
||||
#
|
||||
@@ -9,9 +9,7 @@ AM_MAINTAINER_MODE
|
||||
# compiling code that will embed Mono
|
||||
#
|
||||
libmono_cflags=""
|
||||
libmono_ldflags=""
|
||||
AC_SUBST(libmono_cflags)
|
||||
AC_SUBST(libmono_ldflags)
|
||||
|
||||
# Thread configuration inspired by sleepycat's db
|
||||
AC_MSG_CHECKING([host platform characteristics])
|
||||
@@ -21,7 +19,7 @@ case "$host" in
|
||||
AC_DEFINE(PLATFORM_WIN32)
|
||||
CC="gcc -mno-cygwin"
|
||||
HOST_CC="gcc"
|
||||
CPPFLAGS="$CPPFLAGS -DGC_WIN32_THREADS -DWIN32_THREADS"
|
||||
CPPFLAGS="$CPPFLAGS -DGC_WIN32_THREADS"
|
||||
libdl=
|
||||
;;
|
||||
*-*-*bsd*)
|
||||
@@ -29,7 +27,6 @@ case "$host" in
|
||||
CPPFLAGS="$CPPFLAGS -D_THREAD_SAFE"
|
||||
libmono_cflags="-D_THREAD_SAFE"
|
||||
LDFLAGS="$LDFLAGS -pthread"
|
||||
libmono_ldflags="-pthread"
|
||||
AC_DEFINE(NEED_LINK_UNLINK)
|
||||
AC_DEFINE(PTHREAD_POINTER_ID)
|
||||
libdl=
|
||||
@@ -38,7 +35,6 @@ case "$host" in
|
||||
platform_win32=no
|
||||
CPPFLAGS="$CPPFLAGS -DGC_LINUX_THREADS -DMONO_USE_EXC_TABLES -D_GNU_SOURCE -D_REENTRANT -fexceptions"
|
||||
libmono_cflags="-DMONO_USE_EXC_TABLES -fexceptions -D_REENTRANT"
|
||||
libmono_ldflags="-lpthread"
|
||||
libdl="-ldl"
|
||||
;;
|
||||
*-*-solaris*)
|
||||
@@ -52,7 +48,6 @@ case "$host" in
|
||||
CPPFLAGS="$CPPFLAGS -no-cpp-precomp -D_THREAD_SAFE"
|
||||
libmono_cflags="-D_THREAD_SAFE"
|
||||
LDFLAGS="$LDFLAGS -pthread"
|
||||
libmono_ldflags="-pthread"
|
||||
AC_DEFINE(NEED_LINK_UNLINK)
|
||||
AC_DEFINE(PTHREAD_POINTER_ID)
|
||||
libdl=
|
||||
@@ -95,7 +90,7 @@ AC_HEADER_STDC
|
||||
AC_LIBTOOL_WIN32_DLL
|
||||
AM_PROG_LIBTOOL
|
||||
|
||||
AC_CHECK_HEADERS(sys/filio.h sys/sockio.h netdb.h utime.h semaphore.h sys/un.h)
|
||||
AC_CHECK_HEADERS(sys/filio.h sys/sockio.h netdb.h utime.h semaphore.h)
|
||||
|
||||
# for mono/metadata/debug-symfile.c
|
||||
AC_CHECK_HEADERS(elf.h)
|
||||
@@ -531,7 +526,6 @@ AC_SUBST(LIBC)
|
||||
AC_SUBST(arch_target)
|
||||
AC_SUBST(CFLAGS)
|
||||
AC_SUBST(CPPFLAGS)
|
||||
AC_SUBST(LDFLAGS)
|
||||
|
||||
AC_OUTPUT([
|
||||
Makefile
|
||||
@@ -550,7 +544,6 @@ mono/arch/ppc/Makefile
|
||||
mono/arch/sparc/Makefile
|
||||
mono/arch/s390/Makefile
|
||||
mono/arch/arm/Makefile
|
||||
mono/arch/alpha/Makefile
|
||||
mono/interpreter/Makefile
|
||||
mono/tests/Makefile
|
||||
mono/benchmark/Makefile
|
||||
|
||||
+1
-3
@@ -9,8 +9,6 @@
|
||||
<dllmap dll="libpango-1.0-0.dll" target="libpango-1.0.so" />
|
||||
<dllmap dll="libatk-1.0-0.dll" target="libatk-1.0.so" />
|
||||
<dllmap dll="libgdk-win32-2.0-0.dll" target="libgdk-x11-2.0.so" />
|
||||
<dllmap dll="libgdk_pixbuf-2.0-0.dll" target="libgdk_pixbuf-2.0.so" />
|
||||
<dllmap dll="libgdk_pixbuf-2.0-0.dll" target="libgdk-pixbuf-2.0.so" />
|
||||
<dllmap dll="libgtk-win32-2.0-0.dll" target="libgtk-x11-2.0.so" />
|
||||
<dllmap dll="libgtk-win32-2.0-0.dll" target="libgtk-x11-2.0.so" />
|
||||
<dllmap dll="oci" target="clntsh" />
|
||||
</configuration>
|
||||
+4
-20
@@ -7,18 +7,10 @@
|
||||
|
||||
<section name="system.diagnostics" type="System.Diagnostics.DiagnosticsConfigurationHandler, System" />
|
||||
<sectionGroup name="system.web">
|
||||
<section name="httpHandlers"
|
||||
type="System.Web.Configuration.HttpHandlersSectionHandler, System.Web" />
|
||||
<section name="httpModules"
|
||||
type="System.Web.Configuration.HttpModulesConfigurationHandler, System.Web" />
|
||||
<section name="machineKey"
|
||||
type="System.Web.Configuration.MachineKeyConfigHandler, System.Web" />
|
||||
<section name="authentication"
|
||||
type="System.Web.Configuration.AuthenticationConfigHandler, System.Web" />
|
||||
<section name="authorization"
|
||||
type="System.Web.Configuration.AuthorizationConfigHandler, System.Web" />
|
||||
<section name="globalization"
|
||||
type="System.Web.Configuration.GlobalizationConfigurationHandler, System.Web" />
|
||||
<section name="httpHandlers" type="System.Web.Configuration.HttpHandlersSectionHandler, System.Web" />
|
||||
<section name="httpModules" type="System.Web.Configuration.HttpModulesConfigurationHandler, System.Web" />
|
||||
<section name="machineKey" type="System.Web.Configuration.MachineKeyConfigHandler, System.Web" />
|
||||
<section name="authentication" type="System.Web.Configuration.AuthenticationConfigHandler, System.Web" />
|
||||
</sectionGroup>
|
||||
</configSections>
|
||||
<system.web>
|
||||
@@ -32,7 +24,6 @@
|
||||
</httpHandlers>
|
||||
<httpModules>
|
||||
<add name="FormsAuthentication" type="System.Web.Security.FormsAuthenticationModule, System.Web" />
|
||||
<add name="UrlAuthorization" type="System.Web.Security.UrlAuthorizationModule, System.Web" />
|
||||
</httpModules>
|
||||
<authentication mode="Forms">
|
||||
<forms name=".MONOAUTH" loginUrl="login.aspx" protection="All" timeout="30" path="/">
|
||||
@@ -42,13 +33,6 @@
|
||||
</forms>
|
||||
</authentication>
|
||||
<machineKey validationKey="AutoGenerate" decryptionKey="AutoGenerate" validation="SHA1" />
|
||||
<!-- Sample globalization settings
|
||||
<globalization requestEncoding="iso-8859-1"
|
||||
responseEncoding="iso-8859-1"
|
||||
fileEncoding="iso-8859-1"
|
||||
culture="en-US"
|
||||
uiculture="en-US" />
|
||||
-->
|
||||
</system.web>
|
||||
|
||||
<appSettings>
|
||||
|
||||
-30
@@ -15,33 +15,3 @@ To publish changes:
|
||||
|
||||
cd web
|
||||
make push
|
||||
|
||||
############## Samples
|
||||
|
||||
|
||||
If you want to add a new item in the left menu
|
||||
you have to edit mono/doc/web/commands and add
|
||||
the entry there.
|
||||
|
||||
For new files you can add something as:
|
||||
level,entry,path_to_the_file,file.src
|
||||
|
||||
ex: 1,COBOL#,cobol.html,cobol.src
|
||||
|
||||
If you just want to add a link to the menu:
|
||||
1,MyEntry,URL
|
||||
|
||||
ex: 1,About Linux,http://www.linux.org
|
||||
|
||||
To test the results under Linux:
|
||||
1. Edit mono/doc/web/makefile
|
||||
|
||||
Delete all the references to class status
|
||||
and the deploy/index.rss as well as the
|
||||
mono.exe commands.
|
||||
|
||||
2. make
|
||||
3. Open your browser and point to the
|
||||
file:///(YOUR PATH HERE)mono/doc/web/deploy/index.html
|
||||
|
||||
|
||||
+109
-315
@@ -1,235 +1,96 @@
|
||||
* ADO.NET
|
||||
|
||||
<p>Mono's ADO.NET Developers:
|
||||
|
||||
<table border=1>
|
||||
|
||||
<tr>
|
||||
<td><b>Developer</b></td>
|
||||
<td><b>Email</b></td>
|
||||
<td><b>Contribution</b></td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>Rodrigo Moya</td>
|
||||
<td>rodrigo -AT-<br> ximian.comNOSPAM</td>
|
||||
<td>ADO.NET coordinator,<br> OLE DB provider,<br> and tests</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>Daniel Morgan</td>
|
||||
<td>danmorg -AT-<br> sc.rr.comNOSPAM</td>
|
||||
<td>MySQL, PostgreSQL, <br>Oracle providers,<br> and tests</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>Tim Coleman</td>
|
||||
<td>tim -AT- <br>timcoleman.comNOSPAM</td>
|
||||
<td>Microsoft SQL Server, <br>Sybase, <br>TDS providers,<br> Oracle,
|
||||
<br>and tests.<br>
|
||||
He has
|
||||
contributed <br>to other parts <br>of Mono too, <br>such as,
|
||||
<br>EnterpriseServices,
|
||||
XML, <br>and WebServices.</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>Brian Ritchie</td>
|
||||
<td>brianlritchie -AT-<br> hotmail.comNOSPAM</td>
|
||||
<td>ODBC provider <br>and the ProviderFactory <br>in Mono.Data</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>Vladimir Vukicevic</td>
|
||||
<td>vladimir -AT-<br> pobox.comNOSPAM</td>
|
||||
<td>SQL Lite provider. <br> He has contributed to GTK# <br>and mPhoto too.</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>Christopher Bockner</td>
|
||||
<td>cleared -AT-<br> rogers.comNOSPAM</td>
|
||||
<td>IBM DB2 Universal <br>Database provider</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>Ville Palo</td>
|
||||
<td>vi64pa -AT-<br> koti.soon.fiNOSPAM</td>
|
||||
<td>XML stuff <br>in System.Data <br>including DataSet <br>
|
||||
and XmlDataDocument, <br>and tests</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>Gonzalo Paniagua Javier</td>
|
||||
<td>gonzalo -AT-<br> ximian.comNOSPAM</td>
|
||||
<td>Integration between <br>System.Web and <br>System.Data</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>Gaurav Vaish</td>
|
||||
<td>gvaish -AT-<br> iitk.ac.inNOSPAM</td>
|
||||
<td>Web controls</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>Phillip Jerkins</td>
|
||||
<td>Phillip.Jerkins -AT-<br> morgankeegan.comNOSPAM</td>
|
||||
<td>Named Instance support <br>in System.Data.SqlClient</td>
|
||||
</tr>
|
||||
|
||||
</table>
|
||||
|
||||
** Bugs and Feature Requests
|
||||
|
||||
<ul>
|
||||
|
||||
<li>Bugs with Mono or any data provider in Mono should be reported
|
||||
in Mono's Bugzilla <a href="http://bugzilla.ximian.com/">here</a>. If you
|
||||
do not have a Bugzilla user account, it is free
|
||||
and easy to create
|
||||
one <a href="http://bugzilla.ximian.com/createaccount.cgi">here</a>.</li>
|
||||
<p>Mono's ADO.NET Developers:
|
||||
<ul>
|
||||
<li>rodrigo -AT- ximian.comNOSPAM - <b>Rodrigo Moya</b> - coordinator
|
||||
for the ADO.NET implementation and works on the OLE DB provider</li>
|
||||
<li>danmorg -AT- sc.rr.comNOSPAM - <b>Daniel Morgan</b> - works on
|
||||
the MySQL, PostgreSQL, and Oracle providers</li>
|
||||
<li>tim -AT- timcoleman.comNOSPAM - <b>Tim Coleman</b> - works on
|
||||
the Microsoft SQL Server, Sybase, and TDS providers</li>
|
||||
<li>brianlritchie -AT- hotmail.comNOSPAM - <b>Brian Ritchie</b> - works on
|
||||
the ODBC provider and the ProviderFactory</li>
|
||||
<li>vladimir -AT- pobox.comNOSPAM - <b>Vladimir Vukicevic</b> - works on
|
||||
the SQL Lite provider</li>
|
||||
<li>cleared -AT- rogers.comNOSPAM - <b>Christopher Bockner</b> - works on
|
||||
the IBM DB2 provider</li>
|
||||
<li>vi64pa -AT- koti.soon.fiNOSPAM - <b>Ville Palo</b> - works on XML stuff in System.Data
|
||||
including DataSet, XmlDataDocument, and has done lots of testing</li>
|
||||
</ul>
|
||||
|
||||
<li>Any RFE (Request For Enhancement) for features missing or new functionality
|
||||
should be entered as a bug in Bugzilla too</li>
|
||||
* Action plan
|
||||
|
||||
</ul>
|
||||
|
||||
** ADO.NET Data Providers
|
||||
|
||||
<p>List of ADO.NET Data Providers working in Mono:
|
||||
|
||||
<ul>
|
||||
<li><a href="http://www.go-mono.com/ibmdb2.html">IBM DB2 Universal Database</a></li>
|
||||
<li><a href="http://www.go-mono.com/mysql.html">MySQL</a></li>
|
||||
<li><a href="http://www.go-mono.com/odbc.html">ODBC</a></li>
|
||||
<li><a href="http://www.go-mono.com/oracle.html">Oracle</a></li>
|
||||
<li><a href="http://www.go-mono.com/oledb.html">OLE DB</a></li>
|
||||
<li><a href="http://www.go-mono.com/postgresql.html">PostgreSQL</a></li>
|
||||
<li><a href="http://www.go-mono.com/sqlclient.html">Microsoft SQL Server</a></li>
|
||||
<li><a href="http://www.go-mono.com/sqlite.html">SQL Lite</a></li>
|
||||
<li><a href="http://www.go-mono.com/sybase.html">Sybase</a></li>
|
||||
<li><a href="http://www.go-mono.com/tdsclient.html">TDS Generic</a></li>
|
||||
</ul>
|
||||
<p>The current plan to implement ADO.NET is as follows:
|
||||
|
||||
<p>Providers which we do not have, but we would like to have. Currently,
|
||||
some of these databases are supported via the ODBC or OLE DB providers.
|
||||
|
||||
<ul>
|
||||
<li><a href="http://msdn.microsoft.com/library/en-us/dnsql2k/html/sqlxml_intromanagedclasses.asp?frame=true">Managed Classes for SqlXml</a> which is
|
||||
a .NET data provider for retrieving XML data from a Microsoft SQL Server 2000 database. The System.Data.SqlClient provider
|
||||
in Mono can be used as a starting point at mcs/class/System.Data/System.Data.SqlClient.</li>
|
||||
<li><a href="http://www.hughes.com.au/">miniSQL</a></li>
|
||||
<li><a href="http://www.sleepycat.com/">BerkeleyDB (Sleepycat)</a></li>
|
||||
<li><a href="http://www.sapdb.org/">SapDB</a></li>
|
||||
<li><a href="http://www-3.ibm.com/software/data/informix/">Informix</a></li>
|
||||
<li><a href="http://msdn.microsoft.com/vfoxpro/">Foxpro</a></li>
|
||||
<li>Microsoft Access - could be done by creating C# bindings to <a href="http://mdbtools.sourceforge.net">MDB Tools</a></li>
|
||||
<li>dbase or xbase type database files</li>
|
||||
<li>Others are welcome</li>
|
||||
</ul>
|
||||
|
||||
<p>External Projects that have created ADO.NET Providers that work on Mono:
|
||||
|
||||
<ul>
|
||||
|
||||
<li><a href="http://www.go-mono.com/firebird.html">Firebird Interbase</a></li> is a
|
||||
Firebird SQL Managed data provider. It can be used with Interbase databases too. It
|
||||
is written in 100%C# and does not require a client library. Works on .NET and Mono.</a>
|
||||
<li><a href="http://gborg.postgresql.org/project/npgsql/projdisplay.php">Npgsql</a> is a
|
||||
PostgreSQL Managed data provider written
|
||||
in 100% C#, does not require a client library, and works on .NET and Mono</li>
|
||||
<li><a href="http://sourceforge.net/projects/mysqlnet/">MySQLNet</a> is a
|
||||
MySQL Managed data provider written in 100% C#, does not
|
||||
require a client library, and works on .NET and Mono</li>
|
||||
</ul>
|
||||
|
||||
** Tools
|
||||
|
||||
<p>Some tools that can be used for ADO.NET and other technologies (ASP.NET, XML, etc).
|
||||
|
||||
<ul>
|
||||
<li><b>SQL# CLI</b> - a SQL query tool with a command-line interface.
|
||||
It can be used to enter and execute SQL statements or
|
||||
execute a batch of SQL commands from a file. It can
|
||||
be used to test connection strings, connect to various ADO.NET
|
||||
providers, save output to text, html, or xml. It is a work-in-progress.
|
||||
The SQL# CLI is distributed with the
|
||||
Mono runtime and class libraries as an executable assembly sqlsharp.exe.
|
||||
The source to SQL# CLI can be found in the mcs source at
|
||||
mcs/tools/SqlSharp/SqlSharpCli.cs
|
||||
</li>
|
||||
|
||||
<li><p><b>SQL# GUI - a graphical SQL query tool</b> allows a user
|
||||
to enter SQL commands in a top panel which is a text editor. It
|
||||
has a toolbar and menu for various tasks, such as, executing
|
||||
SQL commands one-at-a-time or in a batch. The results would appear
|
||||
in a bottom panel in a grid or could be saved to a file (xml, html, csv).
|
||||
Also, the bottom panel would allow logging of SQL command executed.
|
||||
Currently, there is a <a href="http://go-mono.com/images/sqlsharp.png">SQL# For GTK#</a> which
|
||||
provides a GUI interface using the <a href="http://gtk-sharp.sourceforge.net">Gtk#</a> toolkit. SQL# For GTK#
|
||||
is a work-in-progress and can be found in the mcs source at
|
||||
mcs/tools/SqlSharp/gui/gtk-sharp</li>
|
||||
</ul>
|
||||
|
||||
<p>Tools we would like to have, but they have not been created yet:
|
||||
|
||||
<ul>
|
||||
<li><b>XML Schema Definition tool</b> <a href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cptools/html/cpconxmlschemadefinitiontoolxsdexe.asp">xsd.exe</a> needs
|
||||
to be created. Maybe this TODO item should be at the System.XML web page instead.
|
||||
<ul>
|
||||
<li>Either create ADO.NET providers or modify pre-exiting ADO.NET providers to
|
||||
work with Mono</li>
|
||||
|
||||
<ul>
|
||||
<li>Create ADO.NET Providers
|
||||
|
||||
<ul>
|
||||
<li>This tool
|
||||
would work like the xsd.exe tool included with
|
||||
the .NET Framework. The Xsd.exe tools has the
|
||||
following uses:
|
||||
<ul>
|
||||
<li><b>XDR to XSD</b> - used to generate an XML schema from an XDR (XML Data Reduced schema) file.
|
||||
XDR was used by Microsoft prior to XSD becoming a W3C recommendation. So, this needs
|
||||
to be supported for legacy reasons</li>
|
||||
<li><b>XML to XSD</b> - used to generate an XML schema from an XML file</li>
|
||||
<li><b>XSD to DataSet</b> - used to generate DataSet classes from an XSD schema file. The
|
||||
DataSet classes created can then be used with XML data</li>
|
||||
<li><b>XSD to Classes</b> - used to generate classes from an XSD schema file. The
|
||||
classes created can be used with System.XML.Serialization.XMLSerializer
|
||||
to read and write XML code that follows the schema</li>
|
||||
<li><b>Classes to XSD</b> - used to generate an XML schema
|
||||
from type(s) in a assembly file. The
|
||||
XML schema created by the tool defines the XML format used
|
||||
by System.XML.Serialization.XMLSerializer</li>
|
||||
</ul>
|
||||
<li>Xsd.exe is used to manipulate XML schemas that
|
||||
follow the http://www.w3.org/XML/Schema">XML Schema Definition (XSD)</a> language
|
||||
recommended by the <a href="http://w3.org/">World Wide Web Consortium (W3C)</a></li>
|
||||
|
||||
<li>How this tool could be created:
|
||||
<ul>
|
||||
<li>Write xsd.exe in C# and run on Mono</li>
|
||||
<li>Make sure we have XML Schema support in System.Xml.Schema. Currently,
|
||||
it is wrapped around libxlst</li>
|
||||
<li>XML serialization support in System.Data classes</li>
|
||||
<li>Create the TypedDataSetGenerator class in System.Data</li>
|
||||
<li>Using CodeDOM or Reflection.Emit to create code</li>
|
||||
<li>Make sure DataSet, XmlDataDocument, and related classes
|
||||
are implemented fully</li>
|
||||
</ul>
|
||||
</li>
|
||||
|
||||
<li><a href="http://www.go-mono.com/ibmdb2.html">IBM DB2 Universal Database</a></li>
|
||||
<li><a href="http://www.go-mono.com/mysql.html">MySQL</a></li>
|
||||
<li><a href="http://www.go-mono.com/odbc.html">ODBC</a></li>
|
||||
<li><a href="http://www.go-mono.com/oracle.html">Oracle</a></li>
|
||||
<li><a href="http://www.go-mono.com/oledb.html">OLE DB</a></li>
|
||||
<li><a href="http://www.go-mono.com/postgresql.html">PostgreSQL</a></li>
|
||||
<li><a href="http://www.go-mono.com/sqlclient.html">Microsoft SQL Server</a></li>
|
||||
<li><a href="http://www.go-mono.com/sqlite.html">SQL Lite</a></li>
|
||||
<li><a href="http://www.go-mono.com/sybase.html">Sybase</a></li>
|
||||
<li><a href="http://www.go-mono.com/tdsclient.html">TDS Generic</a></li>
|
||||
<li>Providers which we do not have, but we would like to have. Currently,
|
||||
some of these databases are supported via the ODBC or OLEDB providers.</li>
|
||||
<ul>
|
||||
<li><a href="http://msdn.microsoft.com/library/en-us/dnsql2k/html/sqlxml_intromanagedclasses.asp?frame=true">Managed Classes for SqlXml</a> which is
|
||||
a .NET data provider for retrieving XML data from a Microsoft SQL Server 2000 database. The System.Data.SqlClient provider
|
||||
in Mono can be used as a starting point at mcs/class/System.Data/System.Data.SqlClient.</li>
|
||||
<li><a href="http://www.hughes.com.au/">miniSQL</a></li>
|
||||
<li><a href="http://www.sleepycat.com/">BerkeleyDB (Sleepycat)</a></li>
|
||||
<li><a href="http://www.sapdb.org/">SapDB</a></li>
|
||||
<li>Microsoft Access - could be done by creating C# bindings to <a href="http://mdbtools.sourceforge.net">MDB Tools</a></li>
|
||||
<li>dbase or xbase type database files</li>
|
||||
<li>Others are welcome</li>
|
||||
</ul>
|
||||
</ul></li>
|
||||
<br>
|
||||
<li>Modify Pre-existing ADO.NET Providers to work with Mono. This may
|
||||
require fixing or implementing areas of Mono too.
|
||||
<ul>
|
||||
<li><a href="http://www.go-mono.com/firebird.html">Firebird Interbase</a></li>
|
||||
<li><a href="http://gborg.postgresql.org/project/npgsql/projdisplay.php">Npgsql</a> is a
|
||||
PostgreSQL Managed data provider written
|
||||
in 100% C#, does not require a client library, and works on Mono</li>
|
||||
<li><a href="http://sourceforge.net/projects/mysqlnet/">MySQLNet</a> is a
|
||||
MySQL Manager data provider written in 100% C#, does not
|
||||
require a client library, and works on Mono</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
|
||||
<li><b>Application XML Configuration File Editor</b> - a tool
|
||||
to create and edit an application configuration file, such as,
|
||||
we have a .net application named Accouting.exe, the tool could edit
|
||||
the application configuration file Accounting.exe.config so a user could
|
||||
connect to the database used by the program. This tool has not
|
||||
been created.</li>
|
||||
|
||||
</ul>
|
||||
<br>
|
||||
<li>Create Tools for Configuration, Testing, and Entering SQL Queries
|
||||
<ul>
|
||||
<li><b>SQL# CLI - a command-line tool</b> written in C# to
|
||||
execute SQL commands,
|
||||
test connection strings, and connect to various ADO.NET
|
||||
providers in Mono. The SQL# CLI can be found in
|
||||
mcs/tools/SqlSharp/SqlSharpCli.cs</li>
|
||||
|
||||
<li><p><b>SQL# GUI - a GUI tool</b> written in C# to
|
||||
execute SQL commands.
|
||||
Currently, there is SQL# For GTK# which
|
||||
can be found at
|
||||
mcs/tools/SqlSharp/gui/gtk-sharp
|
||||
It has a SQL editor with
|
||||
syntax hi lighting of SQL keywords. This will be
|
||||
moving to its own cvs modeul sqlsharpgtk.</li>
|
||||
|
||||
<li><b>Configuration Command-Line and GUI Tools for ADO.NET</b>.
|
||||
These tools have not been started. The tools would be written in
|
||||
C# and run on Mono. The
|
||||
configuration tool can be used to do the following:
|
||||
<ul>
|
||||
<li>bebased on the Application XML Configuration File Editor</li>
|
||||
<li>setup DSNs for the ODBC and OLE-DB
|
||||
providers and configurations for
|
||||
their underlying libraries (unixODBC and libgda)</li>
|
||||
@@ -239,39 +100,22 @@
|
||||
freetds.conf for Microsoft SQL Server and Sybase</li>
|
||||
</ul>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
</ul>
|
||||
|
||||
* Current Status
|
||||
|
||||
** Extra Classes in Mono ADO.NET
|
||||
|
||||
<p>An ADO.NET <a href="http://www.go-mono.com/provider-factory.html">Provider Factory</a>
|
||||
was created by Brian Ritchie. The
|
||||
Provider Factory is a way to dynamically create
|
||||
connections, commands, parameters, and data adapters based on configuration
|
||||
information.
|
||||
<p>Variouls ADO.NET Providers have been created: PostgreSQL, MySQL, Sybase, SQL Lite,
|
||||
Microsoft SQL Server, OLE DB, ODBC, and TDS Generic. See their respective web page for
|
||||
more information.
|
||||
|
||||
** Current Status
|
||||
|
||||
<p>Various ADO.NET Providers have been created at various stages of
|
||||
development including:
|
||||
Firebird/Interbase, IBM DB2 Universal Database, MySQL, ODBC, OLE DB, Oracle,
|
||||
PostgreSQL, SQL Lite, Sybase, Microsoft SQL Server, and TDS Generic.
|
||||
See their respective web page for more information.
|
||||
<p>Constraints need lots of work
|
||||
|
||||
<p><b>Data Relations</b> via DataRelation, DataRelationCollection, and
|
||||
other classes have not been implemented
|
||||
|
||||
<p><b>Constraints</b> need lots of work
|
||||
|
||||
<p><b>XML Schema Definition tool</b> xsd.exe that is included
|
||||
in the .NET Framework has not been created for Mono
|
||||
|
||||
<p><b>TypeDataSetGenerator</b> needs to be stubbed and implemented.
|
||||
<p>TypeDataSetGenerator needs to be stubbed and implemented.
|
||||
|
||||
<p><b>DataSet, DataAdaptor, DataTable, DataRelation, DataRow, DataColumn,
|
||||
DataColumnCollection, DataRowCollection, and others</b> need more work. There are
|
||||
many classes that are just stubs and need to be implemented. Ville Palo has been
|
||||
doing much testing here.
|
||||
many classes that are just stubs and need to be implemented.
|
||||
|
||||
<p><b>XML support in System.Data</b> needs work. This involves working on
|
||||
the classes: DataSet, XmlDataDocument, and the method ExecuteXmlReader() that
|
||||
@@ -279,13 +123,22 @@
|
||||
Stuart Caborn has started the XML support in a DataSet. Tim Coleman started
|
||||
XML support in the ExecuteXmlReader() in a SqlCommand. Ville Palo has been
|
||||
heavily modifying DataSet, XmlDataDocument, and other classes for reading
|
||||
and writing XML. XML Serialization support in DataSet needs to be implemented.
|
||||
|
||||
<p><b>Integration with ASP.NET</b> has been created. Data binding of
|
||||
a DataTable in a DataSet to a System.Web.UI.WebControls.DataGrid works. Data binding
|
||||
of other types works too.
|
||||
and writing XML.
|
||||
|
||||
<p><b>Database Access from ASP.NET</b>:
|
||||
<p><b>ADO.NET Provider Factory</b> has been started by Brian Ritchie. The
|
||||
Provider Factory is way to dynamically create
|
||||
connections, commands, parameters, and data adapters based on configuration information. The
|
||||
provider factory also provides utility functions needed by a lot of
|
||||
providers but are not exposed via the provider. The ProviderFactory
|
||||
is found at mcs/class/Mono.Data and includes a test named test.cs for it in
|
||||
mcs/class/Mono.Data/Test. Also, take a look at the sample .config file for the
|
||||
test.exe application named test.exe.config. The .config file is automatically
|
||||
read when you use the Mono.Data.ProviderFactory or Mono.Data.DataTools.
|
||||
|
||||
<p><b>Integration with ASP.NET</b> has not been started, such as, data binding
|
||||
to a System.Web.UI.WebControls.DataGrid. This may involve implementing many classes
|
||||
in System.Web and System.Data. If you want to help,
|
||||
contact Gonzalo Paniagua Javier. Here is information about using ADO.NET in ASP.NET:
|
||||
<ul>
|
||||
<li>Take a look at xsp in cvs and look at the examples in test: dbpage1.aspx
|
||||
and dbpage2.aspx:
|
||||
@@ -327,7 +180,7 @@
|
||||
has not been started, such as, data binding
|
||||
to a GtkTreeView. This may involve creating new classes
|
||||
to go between the glist data model and the ADO.NET data model.
|
||||
Mike Kestner or Rachel Hestilov would be the best people to ask for help on GTK#.
|
||||
Mike Kestner would be the best person to ask for help on GTK#.
|
||||
|
||||
<p><b>Integration with QT#</b> has not been started. Any information on
|
||||
how this can be done is appreciated. Adam Treat would be the best
|
||||
@@ -376,71 +229,12 @@
|
||||
</pre>
|
||||
</ul>
|
||||
|
||||
** Testing
|
||||
* Testing
|
||||
|
||||
<ul>
|
||||
<li>Testing connection-oriented classes are done
|
||||
via the provider specific tests
|
||||
found in the mcs source at mcs/class</br>
|
||||
<table border=1>
|
||||
<tr>
|
||||
<td><b>Name</b></td>
|
||||
<td><b>Assembly /</br> Namespace</b></td>
|
||||
<td><b>Test</b></td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>Microsoft</br> SQL</br> Server</br></td>
|
||||
<td>System.Data /</br> System.Data.SqlClient</td>
|
||||
<td>SqlTest.cs at</br> System.Data/Test</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>PostgreSQL</br> (Mono)</td>
|
||||
<td>Mono.Data.PostgreSqlClient /</br> Mono.Data.PostgreSqlClient</td>
|
||||
<td>PostgresTest.cs at</br> System.Data/Test</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>MySQL</br> (Mono)</td>
|
||||
<td>Mono.Data.MySql /</br> Mono.Data.MySql</td>
|
||||
<td>MySqlTest.cs at</br> Mono.Data.MySql/Test</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>Oracle</br> (Mono)</td>
|
||||
<td>System.Data.OracleClient /</br> System.Data.OracleClient</td>
|
||||
<td>TestOracleClient.cs at</br> System.Data.OracleClient</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>ODBC</br> (Mono)</td>
|
||||
<td>System.Data.OracleClient /</br> System.Data.OracleClient</td>
|
||||
<td>TestOracleClient.cs at</br> System.Data.OracleClient</td>
|
||||
</tr>
|
||||
|
||||
</table>
|
||||
|
||||
<li>Testing connection-oriented classes are done via the provider specific tests
|
||||
|
||||
<li><a href="http://www.go-mono.com/testing.html">Testing non-connection classes</a> are
|
||||
done via mono's modified version of NUnit.
|
||||
<ul>
|
||||
<li>To run all the NUnit tests for Mono, you need the mcs source. cd to the root
|
||||
of the mcs source. To run it:
|
||||
<ul>
|
||||
<li>On Linux: make -f makefile test</li>
|
||||
<li>On Windows: make test</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li>If you just want to run the NUnit tests for System.Data, you would cd into
|
||||
the mcs source at class/System.Data/Test and run it:
|
||||
<ul>
|
||||
<li>On Linux: make -f makefile test</li>
|
||||
<li>On Windows: make test</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
done via mono's modified version of NUnit.</li>
|
||||
|
||||
</ul>
|
||||
@@ -19,10 +19,6 @@
|
||||
A Retargetable C Compiler - Design and Implementation: C. Fraser, David
|
||||
Hanson
|
||||
|
||||
* Threading
|
||||
|
||||
.NET Multithreading: Alan L. Dennis (ISBN 1-930110-54-5)
|
||||
|
||||
* Reference Manuals
|
||||
|
||||
<a
|
||||
@@ -38,4 +34,4 @@
|
||||
MIPS Processor supplement</a>
|
||||
|
||||
<a href="http://www.sparc.org/standards/V8.pdf">The SPARC Architecture
|
||||
Manual Version 8</a>
|
||||
Manual Version 8</a>
|
||||
@@ -35,9 +35,6 @@
|
||||
<li><a
|
||||
href="http://www.go-mono.com/class-status-System.Runtime.Serialization.Formatters.Soap.html">System.Runtime.Serialization.Formatters.Soap</a>.
|
||||
|
||||
<li><a
|
||||
href="http://www.go-mono.com/class-status-System.Security.html">System.Security</a>:
|
||||
Xml Signature Security classes, also check the <a href="crypto.html">Cryptography status pages</a>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
+33
-11
@@ -8,31 +8,53 @@
|
||||
multilingual documentation makes for significant additional text.
|
||||
|
||||
With these considerations in mind, Mono will use external XML files
|
||||
for type documentation, rather than documenting the source
|
||||
inline. The XML file format used is inspired by the XML format used
|
||||
to document the ECMA APIs.
|
||||
|
||||
for type documentation, rather than documenting the source inline.
|
||||
|
||||
Several tools will be created for managing, verifying, generating,
|
||||
and updating class library documentation, including:
|
||||
|
||||
<ul>
|
||||
<li><a href="#monodoc">monodoc - A graphical documentation viewer.</a></li>
|
||||
<li>xmllint: a tool used to validate a proper XML document.
|
||||
<li><a href="#monodoc">MonoDoc - A graphical documentation editor and viewer.</a></li>
|
||||
<li><a href="#mkmaster">MkMaster - A command line tool to feed stub information to MonoDoc.</a></li>
|
||||
<li><a href="#aspnet">An ASP.NET documentation editor.</a></li>
|
||||
<li><a href="#xsltool">An xsl tool to convert monodoc xml to html documentation.</a></li>
|
||||
</ul>
|
||||
|
||||
You can download the tools to document Mono from the CVS
|
||||
repository from module `monodoc'.
|
||||
** XML Documentation Files and Formats
|
||||
|
||||
|
||||
*** Monodoc XML
|
||||
This XML is Mono's documentation format. Documentation and a DTD/Schema
|
||||
for Monodoc XML is located in cvs and can be found <a href="http://go-mono.org/monodoc.dtd">here</a>.
|
||||
|
||||
This XML could be generated by MonoDoc or the ASP.NET client.
|
||||
|
||||
More about the XML format <a href="http://go-mono.org/monodoc-xml.html">here</a>.
|
||||
** Documentation Tools
|
||||
|
||||
*** <a name="monodoc">MonoDoc</a>
|
||||
A graphical documentation editor and viewer. Currently, MonoDoc
|
||||
consists of a Qt# application and is in heavy development.
|
||||
|
||||
A graphical documentation viewer written in Gtk#. In the
|
||||
future we will have an ASP.NET front-end to present the
|
||||
documentation on the web as well.
|
||||
*** <a name="mkmaster">MkMaster</a>
|
||||
This tool creates the Master.xml file that MonoDoc uses as a reference
|
||||
for documentation generation. This is a reflection engine that is used
|
||||
to gather metadata from assemblies and create an xml representation.
|
||||
|
||||
*** <a name="aspnet">ASP.NET</a>
|
||||
This tool is planned.
|
||||
|
||||
*** <a name="xsltool">An XSL converter</a>
|
||||
This tool is planned. If someone wants to step forward and adopt this
|
||||
project, it would be very helpful ;)
|
||||
|
||||
** Status and Roadmap
|
||||
|
||||
*** 16, September 2002
|
||||
|
||||
A preliminary version of MonoDoc is in Mono's cvs. It is under heavy development.
|
||||
Once this is complete we will start documenting the API!
|
||||
|
||||
** Get Involved
|
||||
|
||||
Help us develop Mono's documentation tools! Subscribe to
|
||||
|
||||
+29
-44
@@ -20,25 +20,23 @@
|
||||
|
||||
**** TODO
|
||||
<ul>
|
||||
* Support for adding/modifying OID using the
|
||||
<code>machine.config</code> configuration file (algorithms
|
||||
are done).
|
||||
* Support for adding/modifying algorithms and OID using the
|
||||
<code>machine.config</code> configuration file (in progress).
|
||||
|
||||
* RNGCryptoServiceProvider is currently only working on Linux.
|
||||
The current implementation reside in Mono's runtime and use
|
||||
the <code>/dev/[u]random</code> device (which do not exists
|
||||
under Windows). A Windows alternative is in the work (see
|
||||
Mono.Security.Win32 assembly section).
|
||||
under Windows). A Windows alternative is in the work...
|
||||
|
||||
* Keypair persistance for RSA and DSA. This persistance must
|
||||
somehow be linked with X509 certificate stores (in planning).
|
||||
|
||||
* <code>PasswordDeriveBytes.CryptDeriveKey</code> is included
|
||||
in the BCL to provide compatibility with existing Windows
|
||||
applications. The main problem is that the key derivation
|
||||
algorithm can be different for every CSP (Crypto Service
|
||||
Provider). However for compatibility we should provide an
|
||||
implementation compatible with the MS CSP (most likely used).
|
||||
* <code>PasswordDeriveBytes</code> is currently limited to
|
||||
generating keys with the maximum length equals to the hash
|
||||
output (as specified in PKCS #5). However the framework
|
||||
implementation allows for longer keys to be generated. Also
|
||||
the algorithms used by CryptDeriveKey (used by Windows
|
||||
applications) are unknown.
|
||||
|
||||
* Analyse the current coverage of the unit tests on the
|
||||
cryptographic classes and complete the unit tests.
|
||||
@@ -61,8 +59,7 @@
|
||||
|
||||
**** Status
|
||||
<ul>
|
||||
* X.509 certificates are parsed using 100% managed code
|
||||
(using an internal ASN.1 class).
|
||||
* X.509 certificates are parsed using 100% managed code.
|
||||
|
||||
* Software Publisher Certificates (SPC) used by Authenticode
|
||||
(tm) to sign assemblies are supported (extraction from PE
|
||||
@@ -80,7 +77,7 @@
|
||||
* Authenticode(tm) support is incomplete. We can extract the
|
||||
certificates from PE files but cannot validate the signature
|
||||
nor the certificate chain (and we're still missing some trust
|
||||
anchors). See Tools section for more information.
|
||||
anchors).
|
||||
|
||||
* Integration with CryptoAPI (on Windows) isn't possible as
|
||||
long as the <code>X509Certificate(IntPtr)</code> constructor
|
||||
@@ -92,16 +89,15 @@
|
||||
* <b>There's no validation of the certificates</b> done in this
|
||||
class (this isn't a restriction of Mono!). This means that
|
||||
certificate signatures and validity dates are <b>never</b>
|
||||
checked (except when used for Authenticode, i.e.
|
||||
<code>CreateFromSignedFile</code>).
|
||||
checked!
|
||||
|
||||
* The newer X509Certificate class included in Microsoft's Web
|
||||
Service Enhancement (WSE) is a little better (as it includes
|
||||
CryptoAPI's validation) when <code>IsCurrent</code> is called.
|
||||
|
||||
* Microsoft implementation of <code>X509Certificate</code> is
|
||||
done by using CryptoAPI (unmanaged). From the exceptions
|
||||
thrown Authenticode(tm) support is done via COM.
|
||||
done by using CryptoAPI. From the exceptions thrown
|
||||
Authenticode(tm) support is done via COM.
|
||||
</ul>
|
||||
|
||||
<hr>
|
||||
@@ -115,8 +111,7 @@
|
||||
|
||||
**** Status
|
||||
<ul>
|
||||
* All classes are present but some (Transforms) are only
|
||||
stubbed.
|
||||
* All classes are present but some are only stubbed.
|
||||
|
||||
* Most classes have their unit tests.
|
||||
|
||||
@@ -129,9 +124,7 @@
|
||||
* All the transforms needs to be done. But this requires far
|
||||
more XML knowledge than crypto. Note: Most tests runs because
|
||||
the feeded XML is pre-c14n (by hand in the code) before
|
||||
signing (not because the transforms works). In the short
|
||||
term <code>libxml2</code> could be used to provide C14N, but
|
||||
in the long term a fully managed class would be much better.
|
||||
signing (not because the transforms works).
|
||||
|
||||
* Makefile for building under non-Windows operating systems.
|
||||
</ul>
|
||||
@@ -154,22 +147,17 @@
|
||||
<ul>
|
||||
* A RNGCryptoServiceProvider built on top of CryptoAPI.
|
||||
|
||||
* Wrapper classes for unmanaged versions of hash algorithms:
|
||||
MD2, MD4, MD5 and SHA1 are supported. <b>note</b>: some
|
||||
algorithms shouldn't be used in new design (MD4 is broken and
|
||||
MD2 isn't considered safe). They are included to preserve
|
||||
interoperability with older applications (e.g. some old, but
|
||||
still valid, X.509 certificates use MD2).
|
||||
* Not (yet) commited in CVS - i'm still playing with the base
|
||||
classes so I can easily add other CryptoAPI-based algorithms.
|
||||
</ul>
|
||||
|
||||
**** TODO
|
||||
<ul>
|
||||
* Wrapper classes for unmanaged versions of symmetric
|
||||
encryption algorithms (like DES, TripleDES, RC2 and others
|
||||
present in default CSP).
|
||||
* Wrapper classes for unmanaged versions of asymmetric
|
||||
algorithms (like DSA and RSA) which persist their keypair
|
||||
into the specified CSP.
|
||||
* Unmanaged versions of hash algorithms (SHA1 and MD5).
|
||||
* Unmanaged versions of symmetric encryption algorithms
|
||||
(like DES, TripleDES, RC2 and others present in CryptoAPI).
|
||||
* Unmanaged versions of asymmetric algorithms (like DSA and
|
||||
RSA) which persist their keypair into the specified CSP.
|
||||
</ul>
|
||||
|
||||
<hr>
|
||||
@@ -231,8 +219,6 @@
|
||||
|
||||
There are many tools in the .NET framework that indirectly interacts
|
||||
with some cryptographic classes. Mono will eventually need these tools.
|
||||
Unless noted the tools should work on any CLR (tested with both Mono
|
||||
and Microsoft).
|
||||
|
||||
**** Status
|
||||
|
||||
@@ -243,8 +229,8 @@
|
||||
re-used in source code (C# or VB.NET syntax).
|
||||
|
||||
* <code>cert2spc</code> is a tool to transform multiple X.509
|
||||
certificates and CRLs into a Software Publisher Certificate
|
||||
(SPC) file - which is a long name for a simple PKCS#7 file.
|
||||
certificates (a chain) into a Software Publisher Certificate
|
||||
(SPC) - which is a long name for a simple PKCS#7 file.
|
||||
</ul>
|
||||
|
||||
**** TODO
|
||||
@@ -252,11 +238,10 @@
|
||||
<ul>
|
||||
* <code>monosn</code> is a clone of the <code>sn</code> to manage
|
||||
strongnames. This tools is part of the runtime (not the class
|
||||
library) and as such is written in C and won't run without Mono.
|
||||
library) and as such is written in C.
|
||||
|
||||
* <code>signcode</code> and <code>chktrust</code> (in progress)
|
||||
for signing and validating Authenticode(tm) signatures on
|
||||
assemblies (or any PE file).
|
||||
* <code>signcode</code> and <code>chktrust</code> for signing
|
||||
and validating Authenticode(tm) signatures on assemblies.
|
||||
|
||||
* <code>makecert</code> to create X.509 test certificates that
|
||||
can be used (once transformed in SPC) to sign assemblies.
|
||||
@@ -287,4 +272,4 @@
|
||||
informations about the status of the cryptographic classes.
|
||||
|
||||
<hr>
|
||||
Last reviewed: February 5, 2003 (post mono 0.19)
|
||||
Last reviewed: January 19, 2003 (post mono 0.18)
|
||||
+3
-192
@@ -14,16 +14,13 @@
|
||||
<ul>
|
||||
|
||||
* The development tools (compilers, assembler tools,
|
||||
language reference, design time features): these
|
||||
live in the `monodoc' CVS module.
|
||||
language reference, design time features).
|
||||
|
||||
* Frequently Asked Question compilations.
|
||||
|
||||
* HOWTO documents.
|
||||
|
||||
* The Class Libraries (Both the original .NET class
|
||||
libraries as well as the class libraries produced by
|
||||
the project).
|
||||
* The Class Libraries
|
||||
|
||||
* Tutorials on Mono and the specifics of running it.
|
||||
|
||||
@@ -32,197 +29,11 @@
|
||||
|
||||
</ul>
|
||||
|
||||
* Class Library documentation
|
||||
** Class Library documentation
|
||||
|
||||
We are moving to a new setup for documenting the class libraries,
|
||||
and you can read about it <a href="classlib-doc.html">here</a>.
|
||||
|
||||
There are two classes of documentation: free documentation for
|
||||
existing .NET classes and documentation for the classes that
|
||||
we have developed on top of .NET.
|
||||
|
||||
There is a large body of documentation that came from the ECMA
|
||||
standarization effort that has been checked into CVS. It does
|
||||
not contain everything Mono and .NET have, so they need to be
|
||||
updated and augmented.
|
||||
|
||||
** Gtk# documentation
|
||||
|
||||
We also have a large body of class libraries that are specific
|
||||
to Mono, for example the documentation for Gtk#.
|
||||
|
||||
We have checked in stub documentation for Gtk# into the CVS
|
||||
repository (on gtk-sharp/doc) and we need volunteers to help
|
||||
populate the documentation for it. Since Gtk# is a wrapper
|
||||
for Gtk, plenty of documentation exists in the <a
|
||||
href="http://developer.gnome.org/doc/API">Gnome developer
|
||||
site</a>.
|
||||
|
||||
To get started:
|
||||
|
||||
You need to download Gtk# from the CVS repository. The module
|
||||
name is `gtk-sharp'. You can obtain a copy from both the CVS
|
||||
repository or the anonymous CVS repository.
|
||||
|
||||
To pull your copy type:
|
||||
|
||||
<pre>
|
||||
cvs co gtk-sharp
|
||||
</pre>
|
||||
Documentation lives in gtk-sharp/doc/en. The "en" indicates the
|
||||
English language, the first one we are targeting. We can later
|
||||
do translations, but for now we are focusing on a single
|
||||
language.
|
||||
|
||||
In that directory you will find the documentation organized by
|
||||
namespaces. One directory per namespace. In the directories
|
||||
you will find one XML file per class that needs to be
|
||||
documented. The mission is to fill in the data with useful
|
||||
information. Feel free to grab liberally information from the
|
||||
Gtk documentation from:
|
||||
|
||||
<a href="http://developer.gnome.org/doc/API/">http://developer.gnome.org/doc/API/</a>
|
||||
|
||||
Of course, the API does not apply directly. It only applies at
|
||||
a foundational level, so you can not really just copy and
|
||||
paste. Summaries, and remarks sections can probably be lifted
|
||||
with little or no effort.
|
||||
|
||||
Gtk# uses properties to represent get/set operations in the C
|
||||
API, so you can also use some bits from there.
|
||||
|
||||
Most of the documentation contains already place holders for
|
||||
text, we use the internationally approved phrase for this
|
||||
purpose, `To be added'. So the quest is to remove all of the
|
||||
"To be added" strings with information with resembles as closely
|
||||
as possible the toolkit reality.
|
||||
|
||||
*** The pieces to be filled.
|
||||
|
||||
Summaries are one or two line descriptions of the element
|
||||
(class, struct, interface, method, field, event, delegate), and
|
||||
its used to render summary pages. So it has to be short.
|
||||
|
||||
The "remarks" section is used to describe in detail the element.
|
||||
|
||||
**** Tags.
|
||||
|
||||
As you document Gtk# you will have a number of tags that you can
|
||||
use inside the summary and remarks sections, these are:
|
||||
|
||||
<pre>
|
||||
<para> </para>
|
||||
</pre>
|
||||
Used to separate paragraphs.
|
||||
|
||||
<pre>
|
||||
<paramref name="param_name"/>
|
||||
</pre>
|
||||
Used to reference a formal parameter to a function.
|
||||
|
||||
<pre>
|
||||
<see cref="T:SomeTypeName"/>
|
||||
</pre>
|
||||
Use this to reference a type, this will include an hyper
|
||||
link to the page for type SomeTypeName.
|
||||
|
||||
For example, to reference "System.Enum", do:
|
||||
|
||||
<pre>
|
||||
<see cref="T:System.Enum"/>
|
||||
</pre>
|
||||
|
||||
<pre>
|
||||
<see cref="P:SomeTypeName.Property"/>
|
||||
</pre>
|
||||
Use this to reference a property, this will include an hyper
|
||||
link to the page for the property `Property' of type `SomeTypeName'.
|
||||
|
||||
For example, to reference the BaseType property in System.Type, do:
|
||||
|
||||
<pre>
|
||||
<see cref="P:System.Type.BaseType"/>
|
||||
</pre>
|
||||
|
||||
<pre>
|
||||
<see cref="M:SomeTypeName.Method(type,type)"/>
|
||||
</pre>
|
||||
Use this to reference a method, this will include an hyper
|
||||
link to the page for the method `Method' of type `SomeTypeName'.
|
||||
|
||||
For example, to reference the ToString method in System.Object, do:
|
||||
|
||||
<pre>
|
||||
<see cref="M:System.Object.ToString()"/>
|
||||
</pre>
|
||||
|
||||
<pre>
|
||||
<see langword="keyword"/>
|
||||
</pre>
|
||||
Use this to link to a keyword in the C# language, for
|
||||
example to link to `true', do:
|
||||
|
||||
<pre>
|
||||
<see langword="true"/>
|
||||
</pre>
|
||||
|
||||
<pre>
|
||||
<example> ... </example>
|
||||
</pre>
|
||||
Use example to insert an example. The example can
|
||||
contain explanatory text and code.
|
||||
|
||||
<pre>
|
||||
<code lang="C#">.. </code>
|
||||
</pre>
|
||||
|
||||
Use this to provide a sample C# program, typically used
|
||||
within the <example> tags.
|
||||
|
||||
When providing examples, try to provide a full example,
|
||||
we would like to be able to have a button to compile and
|
||||
run samples embedded into the documentation, or pop up
|
||||
an editor to let the user play with the sample.
|
||||
|
||||
You can link to an example like this:
|
||||
|
||||
<pre>
|
||||
<code lang="C#" source="file.cs"> </code>
|
||||
</pre>
|
||||
|
||||
<pre>
|
||||
<item>
|
||||
</pre>
|
||||
|
||||
<pre>
|
||||
<list type="bullet"> </list>
|
||||
</pre>
|
||||
|
||||
Use this to create lists. Lists contains <item>
|
||||
elements
|
||||
|
||||
<pre>
|
||||
<list type="table"> </lits>
|
||||
<listheader>
|
||||
<term>YOUR FIRST COLUMN</term>
|
||||
<description>YOUR DESCRIPTION</description>
|
||||
</listheader>
|
||||
</pre>
|
||||
For two-column tables. Inside use:
|
||||
|
||||
<pre>
|
||||
<item>
|
||||
<term>First</term>
|
||||
<description>First descritpion</description>
|
||||
</item>
|
||||
<item>
|
||||
<term>Second</term>
|
||||
<description>Second descirption</description>
|
||||
</item>
|
||||
</pre>
|
||||
|
||||
** Words of warning.
|
||||
|
||||
A few words of warning and advice for class documentors:
|
||||
|
||||
A well-documented API can ease hours of frustration; as Mono
|
||||
|
||||
+92
-137
@@ -13,142 +13,6 @@
|
||||
section</a>, the <a
|
||||
href="http://www.go-mono.org/faq.html">FAQ</a>.
|
||||
|
||||
<table>
|
||||
<tbody>
|
||||
<tr bgcolor="#DDDDDD">
|
||||
<td>
|
||||
<b>Release 0.19</b><br>
|
||||
<a href="archive/mono-0.19">Release notes</a><br>
|
||||
Jan 20th, 2003
|
||||
</td>
|
||||
<td>
|
||||
<table cellspacing="1" cellpadding="3">
|
||||
<tr bgcolor="#BBBBBB">
|
||||
<td>
|
||||
<b>Source Code</b>
|
||||
</td>
|
||||
<td>
|
||||
<ul>
|
||||
<li><a href="archive/mcs-0.19.tar.gz">Mono Class Libraries and C# Compiler.</a>
|
||||
<li><a href="archive/mono-0.19.tar.gz">Mono Runtime</a>
|
||||
<li><a href="archive/gc6.1.tar.gz">Boehm GC 6.1</a>
|
||||
<li><a href="archive/xsp-0.2.tar.gz">XSP web server</a> <b><font color="#dd0000">New!</font></b>
|
||||
<li><a href="archive/mono-debugger-0.2.0.tar.gz">Mono Debugger 0.2.0</a> <b><font color="#dd0000">New!</font></b>
|
||||
</ul>
|
||||
</td>
|
||||
</tr>
|
||||
<tr bgcolor="#BBBBBB">
|
||||
<td>
|
||||
<b>Source RPMs</b><br>
|
||||
(No RPMS for XSP).
|
||||
</td>
|
||||
<td>
|
||||
<ul>
|
||||
<li><a href="archive/libgc-6.1-1.src.rpm">libgc-6.1-1.src.rpm</a>
|
||||
<li><a href="archive/mono-0.19-1.src.rpm">mono-0.19-1.src.rpm</a>
|
||||
</ul>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td bgcolor="#999999">
|
||||
<b>Red Hat 7.3/x86</b>
|
||||
<ul>
|
||||
<li><a href="archive/redhat-73-i386/libgc-6.1-1.i386.rpm">libgc-6.1-1.i386.rpm</a>
|
||||
<li><a href="archive/redhat-73-i386/libgc-devel-6.1-1.i386.rpm">libgc-devel-6.1-1.i386.rpm</a>
|
||||
<li><a href="archive/redhat-73-i386/mono-0.19-1.i386.rpm">mono-0.19-1.i386.rpm</a>
|
||||
<li><a href="archive/redhat-73-i386/mono-devel-0.19-1.i386.rpm">mono-devel-0.19-1.i386.rpm</a>
|
||||
</ul>
|
||||
</td>
|
||||
<td bgcolor="#999999">
|
||||
<b>Red Hat 7.2/x86</b>
|
||||
<ul>
|
||||
<li><a href="archive/redhat-72-i386/libgc-6.1-1.i386.rpm">libgc-6.1-1.i386.rpm</a>
|
||||
<li><a href="archive/redhat-72-i386/libgc-devel-6.1-1.i386.rpm">libgc-devel-6.1-1.i386.rpm</a>
|
||||
<li><a href="archive/redhat-72-i386/mono-0.19-1.i386.rpm">mono-0.19-1.i386.rpm</a>
|
||||
<li><a href="archive/redhat-72-i386/mono-devel-0.19-1.i386.rpm">mono-devel-0.19-1.i386.rpm</a>
|
||||
</ul>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td bgcolor="#999999">
|
||||
<b>Red Hat 7.1/x86</b>
|
||||
<ul>
|
||||
<li><a href="archive/redhat-71-i386/libgc-6.1-1.i386.rpm">libgc-6.1-1.i386.rpm</a>
|
||||
<li><a href="archive/redhat-71-i386/libgc-devel-6.1-1.i386.rpm">libgc-devel-6.1-1.i386.rpm</a>
|
||||
<li><a href="archive/redhat-71-i386/mono-0.19-1.i386.rpm">mono-0.19-1.i386.rpm</a>
|
||||
<li><a href="archive/redhat-71-i386/mono-devel-0.19-1.i386.rpm">mono-devel-0.19-1.i386.rpm</a>
|
||||
</ul>
|
||||
</td>
|
||||
<td bgcolor="#999999">
|
||||
<b>Mandrake 8.2/x86</b>
|
||||
<ul>
|
||||
<li><a href="archive/mandrake-82-i386/libgc-6.1-1.i586.rpm">libgc-6.1-1.i586.rpm</a>
|
||||
<li><a href="archive/mandrake-82-i386/libgc-devel-6.1-1.i586.rpm">libgc-devel-6.1-1.i586.rpm</a>
|
||||
<li><a href="archive/mandrake-82-i386/mono-0.19-1.i586.rpm">mono-0.19-1.i586.rpm</a>
|
||||
<li><a href="archive/mandrake-82-i386/mono-devel-0.19-1.i586.rpm">mono-devel-0.19-1.i586.rpm</a>
|
||||
</ul>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td bgcolor="#999999">
|
||||
<b>SuSE 8.0/x86</b>
|
||||
<ul>
|
||||
<li><a href="archive/suse-80-i386/libgc-6.1-1.i386.rpm">libgc-6.1-1.i386.rpm</a>
|
||||
<li><a href="archive/suse-80-i386/libgc-devel-6.1-1.i386.rpm">libgc-devel-6.1-1.i386.rpm</a>
|
||||
<li><a href="archive/suse-80-i386/mono-0.19-1.i386.rpm">mono-0.19-1.i386.rpm</a>
|
||||
<li><a href="archive/suse-80-i386/mono-devel-0.19-1.i386.rpm">mono-devel-0.19-1.i386.rpm</a>
|
||||
</ul>
|
||||
</td>
|
||||
<td bgcolor="#999999">
|
||||
<b>Red Hat 8.0/x86</b>
|
||||
<ul>
|
||||
<li><a href="archive/redhat-80-i386/libgc-6.1-1.i386.rpm">libgc-6.1-1.i386.rpm</a>
|
||||
<li><a href="archive/redhat-80-i386/libgc-devel-6.1-1.i386.rpm">libgc-devel-6.1-1.i386.rpm</a>
|
||||
<li><a href="archive/redhat-80-i386/mono-0.19-1.i386.rpm">mono-0.19-1.i386.rpm</a>
|
||||
<li><a href="archive/redhat-80-i386/mono-devel-0.19-1.i386.rpm">mono-devel-0.19-1.i386.rpm</a>
|
||||
</ul>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td bgcolor="#999999">
|
||||
<!-- <b>Windows Setup Wizard (NT/2000/XP)</b>␍ -->
|
||||
<!-- <ul>␍ -->
|
||||
<!-- <li><a href="archive/mono-0.19-stable.exe">Mono-Setup</a>␍ -->
|
||||
<!-- </ul>␍ -->
|
||||
<!-- </td>␍ -->
|
||||
<td bgcolor="#999999">
|
||||
<b>Debian packages</b>
|
||||
<ul>
|
||||
<li><a href="http://www.atoker.com/mono/">Alp's web site</a>
|
||||
</ul>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<tr bgcolor="#CCCCC">
|
||||
<td>
|
||||
<b>Regression Tests</b><br>
|
||||
</td>
|
||||
<td>
|
||||
You can get binaries for the Mono Regression Test
|
||||
Suite <a href="archive/mono-tests.tar.gz">here</a>
|
||||
</td>
|
||||
</tr>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
|
||||
<br>
|
||||
* Older Releases:
|
||||
|
||||
We provide binaries for older releases until we have packages for the new release.
|
||||
|
||||
<table>
|
||||
<tbody>
|
||||
<tr bgcolor="#DDDDDD">
|
||||
@@ -187,12 +51,103 @@
|
||||
<tr>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td bgcolor="#999999">
|
||||
<b>Red Hat 7.3/x86</b>
|
||||
<ul>
|
||||
<li><a href="archive/redhat-73-i386/libgc-6.1-1.i386.rpm">libgc-6.1-1.i386.rpm</a>
|
||||
<li><a href="archive/redhat-73-i386/libgc-devel-6.1-1.i386.rpm">libgc-devel-6.1-1.i386.rpm</a>
|
||||
<li><a href="archive/redhat-73-i386/mono-0.18-1.i386.rpm">mono-0.18-1.i386.rpm</a>
|
||||
<li><a href="archive/redhat-73-i386/mono-devel-0.18-1.i386.rpm">mono-devel-0.18-1.i386.rpm</a>
|
||||
</ul>
|
||||
</td>
|
||||
<td bgcolor="#999999">
|
||||
<b>Red Hat 7.2/x86</b>
|
||||
<ul>
|
||||
<li><a href="archive/redhat-72-i386/libgc-6.1-1.i386.rpm">libgc-6.1-1.i386.rpm</a>
|
||||
<li><a href="archive/redhat-72-i386/libgc-devel-6.1-1.i386.rpm">libgc-devel-6.1-1.i386.rpm</a>
|
||||
<li><a href="archive/redhat-72-i386/mono-0.18-1.i386.rpm">mono-0.18-1.i386.rpm</a>
|
||||
<li><a href="archive/redhat-72-i386/mono-devel-0.18-1.i386.rpm">mono-devel-0.18-1.i386.rpm</a>
|
||||
</ul>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td bgcolor="#999999">
|
||||
<b>Red Hat 7.1/x86</b>
|
||||
<ul>
|
||||
<li><a href="archive/redhat-71-i386/libgc-6.1-1.i386.rpm">libgc-6.1-1.i386.rpm</a>
|
||||
<li><a href="archive/redhat-71-i386/libgc-devel-6.1-1.i386.rpm">libgc-devel-6.1-1.i386.rpm</a>
|
||||
<li><a href="archive/redhat-71-i386/mono-0.18-1.i386.rpm">mono-0.18-1.i386.rpm</a>
|
||||
<li><a href="archive/redhat-71-i386/mono-devel-0.18-1.i386.rpm">mono-devel-0.18-1.i386.rpm</a>
|
||||
</ul>
|
||||
</td>
|
||||
<td bgcolor="#999999">
|
||||
<b>Mandrake 8.2/x86</b>
|
||||
<ul>
|
||||
<li><a href="archive/mandrake-82-i386/libgc-6.1-1.i586.rpm">libgc-6.1-1.i586.rpm</a>
|
||||
<li><a href="archive/mandrake-82-i386/libgc-devel-6.1-1.i586.rpm">libgc-devel-6.1-1.i586.rpm</a>
|
||||
<li><a href="archive/mandrake-82-i386/mono-0.18-1.i586.rpm">mono-0.18-1.i586.rpm</a>
|
||||
<li><a href="archive/mandrake-82-i386/mono-devel-0.18-1.i586.rpm">mono-devel-0.18-1.i586.rpm</a>
|
||||
</ul>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<!-- <td bgcolor="#999999"> -->
|
||||
<!-- <b>SuSE 8.0/x86</b> -->
|
||||
<!-- <ul> -->
|
||||
<!-- <li><a href="archive/suse-80-i386/libgc-6.1-1.i386.rpm">libgc-6.1-1.i386.rpm</a> -->
|
||||
<!-- <li><a href="archive/suse-80-i386/libgc-devel-6.1-1.i386.rpm">libgc-devel-6.1-1.i386.rpm</a> -->
|
||||
<!-- <li><a href="archive/suse-80-i386/mono-0.17-1.i386.rpm">mono-0.17-1.i386.rpm</a> -->
|
||||
<!-- <li><a href="archive/suse-80-i386/mono-devel-0.17-1.i386.rpm">mono-devel-0.17-1.i386.rpm</a> -->
|
||||
<!-- </ul> -->
|
||||
<!-- </td> -->
|
||||
<td bgcolor="#999999">
|
||||
<b>Red Hat 8.0/x86</b>
|
||||
<ul>
|
||||
<li><a href="archive/redhat-80-i386/libgc-6.1-1.i386.rpm">libgc-6.1-1.i386.rpm</a>
|
||||
<li><a href="archive/redhat-80-i386/libgc-devel-6.1-1.i386.rpm">libgc-devel-6.1-1.i386.rpm</a>
|
||||
<li><a href="archive/redhat-80-i386/mono-0.18-1.i386.rpm">mono-0.18-1.i386.rpm</a>
|
||||
<li><a href="archive/redhat-80-i386/mono-devel-0.18-1.i386.rpm">mono-devel-0.18-1.i386.rpm</a>
|
||||
</ul>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td bgcolor="#999999">
|
||||
<!-- <b>Windows Setup Wizard (NT/2000/XP)</b>␍ -->
|
||||
<!-- <ul>␍ -->
|
||||
<!-- <li><a href="archive/mono-0.17-stable.exe">Mono-Setup</a>␍ -->
|
||||
<!-- </ul>␍ -->
|
||||
<!-- </td>␍ -->
|
||||
<td bgcolor="#999999">
|
||||
<b>Debian packages</b>
|
||||
<ul>
|
||||
<li><a href="http://www.atoker.com/mono/">Alp's web site</a>
|
||||
</ul>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<tr bgcolor="#CCCCC">
|
||||
<td>
|
||||
<b>Regression Tests</b><br>
|
||||
</td>
|
||||
<td>
|
||||
You can get binaries for the Mono Regression Test
|
||||
Suite <a href="archive/mono-tests.tar.gz">here</a>
|
||||
</td>
|
||||
</tr>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
|
||||
<br>
|
||||
* Older Releases:
|
||||
|
||||
We provide binaries for older releases until we have packages for the new release.
|
||||
|
||||
<table>
|
||||
<tbody>
|
||||
<tr bgcolor="#DDDDDD">
|
||||
@@ -290,7 +245,7 @@
|
||||
<ul>
|
||||
<li><a href="archive/s390/glib2-2.0.6-13.s390.rpm">glib2-2.0.6-13.s390.rpm</a>
|
||||
<li><a href="archive/s390/glib2-devel-2.0.6-13.s390.rpm">glib2-devel-2.0.6-13.s390.rpm</a>
|
||||
<li><a href="archive/s390/libgc-6.1alpha5-1.s390.rpm">libgc-6.1alpha5-1.s390.rpm</a>
|
||||
p <li><a href="archive/s390/libgc-6.1alpha5-1.s390.rpm">libgc-6.1alpha5-1.s390.rpm</a>
|
||||
<li><a href="archive/s390/libgc-devel-6.1alpha5-1.s390.rpm">libgc-devel-6.1alpha5-1.s390.rpm</a>
|
||||
<li><a href="archive/s390/mono-0.16-1.s390.rpm">mono-0.16-1.s390.rpm</a>
|
||||
<li><a href="archive/s390/mono-devel-0.16-1.s390.rpm">mono-devel-0.16-1.s390.rpm</a>
|
||||
|
||||
+6
-27
@@ -1,26 +1,18 @@
|
||||
* Firebird and Interbase Data Provider
|
||||
|
||||
<ul>
|
||||
<li>ADO.NET Data Provider for Firebird and Interbase databases</li>
|
||||
|
||||
<li>Does not exist in Mono, but is a separate project</li>
|
||||
|
||||
<li>The <a href="http://firebird.sourceforge.net/index.php">Firebird Relational Database</a> is
|
||||
is an independent project which uses source code based on the Interbase source code released
|
||||
<li><a href="http://firebird.sourceforge.net/index.php">Firebird Relational Database</a> is
|
||||
an independent project which uses source code based on the Interbase source code released
|
||||
by Borland under the Interbase Public License</li>
|
||||
|
||||
<li>Both the Firebird Relational Database and the Firebird .NET Data Provider can be
|
||||
downloaded from <a href="http://sourceforge.net/projects/firebird/">here</a></li>
|
||||
|
||||
<li>The Firebird .NET Data provider has been made
|
||||
available by Carlos Guzmán Álvarez (aka "Carlos G.A."), who has also made a
|
||||
number of contributions to the OdbcJdbc code</li>
|
||||
|
||||
<li>Bugs with Mono or the data provider should be reported
|
||||
in Mono's Bugzilla <a href="http://bugzilla.ximian.com/">here</a>. If you
|
||||
do not have Bugzilla user account, it is free
|
||||
and easy to
|
||||
create one <a href="http://bugzilla.ximian.com/createaccount.cgi">here</a>.</li>
|
||||
available by Carlos Guzmán Álvarez (aka "Carlos G.A."), who has also made a
|
||||
number of contributions to the OdbcJdbc code</li>
|
||||
|
||||
</ul>
|
||||
|
||||
@@ -110,26 +102,14 @@
|
||||
** Testing
|
||||
|
||||
<ul>
|
||||
|
||||
<li>Need a working mono and mcs</li>
|
||||
|
||||
<li>Need access to a Firebird Relational Database or you can download
|
||||
it from <a href="http://firebird.sourceforge.net">here</a></li>
|
||||
|
||||
<li>Get the Firebird .NET data provider from here as
|
||||
<a href="http://lists.sourceforge.net/lists/listinfo/firebird-net-provider">firebird-net-provider</a>. Make
|
||||
sure the Firebird .NET data provider binary assembly FirebirdSql.Data.Firebird.dll is
|
||||
installed in the same place as the mono class libraries.</li>
|
||||
|
||||
<li>Has a ConnectionString format:
|
||||
<pre>
|
||||
"Database=databasefile.gdb;User=user;Password=pass;Dialect=3;Server=hostname"
|
||||
</pre>
|
||||
|
||||
</li>
|
||||
|
||||
<li>C# Example:
|
||||
|
||||
<li>C# Example for Mono's System.Data.OleDb:
|
||||
<pre>
|
||||
using System;
|
||||
using System.Data;
|
||||
@@ -146,10 +126,9 @@
|
||||
"Dialect=3;" +
|
||||
"Server=localhost";
|
||||
IDbConnection dbcon = new FbConnection(connectionString);
|
||||
dbcon.Open();
|
||||
IDbCommand dbcmd = dbcon.CreateCommand();
|
||||
string sql = "SELECT * FROM employee";
|
||||
dbcmd.CommandText = sql;
|
||||
dbcmd.ConnectionString = sql;
|
||||
IDataReader reader = dbcmd.ExecuteReader();
|
||||
while(reader.Read()) {
|
||||
object dataValue = myReader.GetValue(0);
|
||||
|
||||
+6
-4
@@ -1,7 +1,9 @@
|
||||
* The GCC front-end
|
||||
|
||||
Jeremy Singer has developed a .NET backend for GCC, his
|
||||
research work is available <a
|
||||
href="http://www.cl.cam.ac.uk/~jds31/research/gccnet/">here</a>.
|
||||
The GCC front-end will accept input in a binary file with
|
||||
codes in the Common Intermediate Language (CIL), and generate
|
||||
native code.
|
||||
|
||||
This will allow pre-compilation and full optimization to take
|
||||
place before a program is executed.
|
||||
|
||||
|
||||
+3
-10
@@ -19,11 +19,7 @@
|
||||
|
||||
** GTK# On Linux
|
||||
|
||||
<p>Where to get distributions of GTK# for Linux:
|
||||
<ul>
|
||||
<li><a href="http://gtk-sharp.sourceforge.net">RPMs</a></li>
|
||||
<li><a href="http://www.debianplanet.org/mono/">Debs</a></li>
|
||||
</ul>
|
||||
<p>Where to get distributions of GTK# for Linux: TODO
|
||||
|
||||
<p>Buidling on Linux:
|
||||
|
||||
@@ -141,14 +137,11 @@ you will need to create them. Or get them from somewhere like the dev
|
||||
packages at
|
||||
<a href="http://www.gimp.org/~tml/gimp/win32/downloads.html">here</a>
|
||||
|
||||
** GTK# On FreeBSD
|
||||
|
||||
TODO. Any volunteers?
|
||||
|
||||
** GTK# On Solaris
|
||||
|
||||
TODO. Any volunteers?
|
||||
TODO
|
||||
|
||||
** GTK# On AIX
|
||||
|
||||
TODO. Any volunteers?
|
||||
TODO
|
||||
+5
-30
@@ -1,24 +1,17 @@
|
||||
* IBM DB2 Data Provider
|
||||
<ul>
|
||||
<li>ADO.NET Data Provider for <a href="http://www-3.ibm.com/software/data/db2/">IBM DB2 Universal Database</a></li>
|
||||
|
||||
<li>Exists in namespace DB2ClientCS and assembly Mono.Data.DB2Client</li>
|
||||
|
||||
<li>The source code exists at mcs/class/Mono.Data.DB2Client</li>
|
||||
|
||||
<li>Requires the Call Level Interface to IBM DB2 shared library. This
|
||||
is db2cli.dll on Windows. The IBM DB2 CLI API is very similar to the ODBC API. If
|
||||
you take a look at Mono's <a href="http://www.go-mono.com/odbc.html">System.Data.Odbc</a> ODBC provider, you will see the
|
||||
you take a look at Mono's System.Data.Odbc ODBC provider, you will see the
|
||||
DllImport's have similiar function names.</li>
|
||||
|
||||
|
||||
<li><a href="http://www-3.ibm.com/software/data/db2/">IBM DB2 Universal Database</a> can be downloaded from IBM.</li>
|
||||
|
||||
<li>IBM DB2 Provider created by Christopher Bockner.</li>
|
||||
|
||||
<li>Bugs with Mono or the data provider should be reported
|
||||
in Mono's Bugzilla <a href="http://bugzilla.ximian.com/">here</a>. If you
|
||||
do not have Bugzilla user account, it is free
|
||||
and easy to
|
||||
create one <a href="http://bugzilla.ximian.com/createaccount.cgi">here</a>.</li>
|
||||
|
||||
</ul>
|
||||
|
||||
** Current Status
|
||||
@@ -29,8 +22,6 @@
|
||||
<li>Able to connect to IBM DB2</li>
|
||||
|
||||
<li>Able to execute DML, such as, CREATE TABLE via ExecuteNonQuery()</li>
|
||||
|
||||
<li>Christopher says it can retrieve data via the DB2ClientDataReader</li>
|
||||
|
||||
</ul>
|
||||
|
||||
@@ -58,21 +49,6 @@ In order to test.
|
||||
<li>If you do not have the source to mcs, get the source from
|
||||
<a href="http://www.go-mono.com/download">here</a></li>
|
||||
|
||||
<li>Has a ConnectionString format like ODBC</li>
|
||||
|
||||
<li>Here is a ConnectionString format if you have a DSN setup:
|
||||
<pre>
|
||||
"DSN=dataSetName;UID=myuserid;PWD=mypassword"
|
||||
</pre>
|
||||
</li>
|
||||
|
||||
<li>Here is a ConnectionString format if you do not have a DSN (have not
|
||||
gotten this to work though, so, I am open to suggestions):
|
||||
<pre>
|
||||
"DRIVER={DB2 Driver};SERVER=localhost;DATABASE=test;UID=myuserid;PASSWORD=mypassword"
|
||||
</pre>
|
||||
</li>
|
||||
|
||||
<li>In mcs/class/Mono.Data.DB2Client/Test/DBConnTest, you will find
|
||||
a DBConnTest.cs.</li>
|
||||
|
||||
@@ -111,14 +87,13 @@ mono DBConnTest.exe database userid password
|
||||
string connectionString =
|
||||
"DSN=sample;UID=db2admin;PWD=mypass";
|
||||
IDbConnection dbcon = new DB2ClientConnection(connectionString);
|
||||
dbcon.Open();
|
||||
IDbCommand dbcmd = dbcon.CreateCommand();
|
||||
string sql =
|
||||
"CREATE TABLE mono_db2_test1 ( " +
|
||||
" testid varchar(2), " +
|
||||
" testdesc varchar(16) " +
|
||||
")";
|
||||
dbcmd.CommandText = sql;
|
||||
dbcmd.ConnectionString = sql;
|
||||
dbcmd.ExecuteNonQuery();
|
||||
dbcmd.Dispose();
|
||||
dbcmd = null;
|
||||
|
||||
@@ -56,6 +56,11 @@ TODO=multimedia
|
||||
<a name="projects">
|
||||
** Projects
|
||||
|
||||
<ul>
|
||||
TODO=xmlStorage,
|
||||
* Implement an xmlStorageSystem for the CLI:
|
||||
<a href="http://www.soapware.org/xmlStorageSystem">
|
||||
http://www.soapware.org/xmlStorageSystem</a>
|
||||
|
||||
TODO=guavac,Java compiler for .NET
|
||||
* You could take one of the existing Java compilers
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
You might also want to <a href="download.html">Download the
|
||||
source</a> for our work so far. Grab a <a
|
||||
href="snapshots">snapshot</a> of our current work, or <a
|
||||
href="http://cvs.hispalinux.es/cgi-bin/cvsweb/?hidenonreadable=1&f=u&logsort=date&sortby=file&hideattic=1&cvsroot=mono">browse
|
||||
href="http://cvs.hispalinux.es/cgi-bin/cvsweb/?hidenonreadable=1&f=u&logsort=date&sortby=file&hideattic=1&cvsroot=Mono">browse
|
||||
the sources</a>
|
||||
|
||||
You might want to <a
|
||||
@@ -34,12 +34,6 @@
|
||||
|
||||
You can contact the team at: <a
|
||||
href="mailto:[email protected]">[email protected]</a>
|
||||
|
||||
In order to follow the process of the project and to learn more
|
||||
about the team members we have created the <a
|
||||
href="http://monoevo.sf.net/mwn/index.html">Mono Weekly News letter</a>.
|
||||
Which archives can be found <a
|
||||
href="http://monoevo.sf.net/mwn/archives.html">here</a>.
|
||||
</td>
|
||||
<td>
|
||||
<table border=1>
|
||||
@@ -92,138 +86,12 @@
|
||||
<a href="index.rss"><img src="images/xml.gif"></a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<a href="screenshots.html">Screenshots</a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<b>Upcoming presentations</b>
|
||||
|
||||
Paolo Molaro, core Mono architect and developer will be
|
||||
talking about Mono on Florence on Saturday 22nd, February at
|
||||
the the Italian <a
|
||||
href="http://http://www.it.gnome.org/GUADIC">Guadic</a> Conference.
|
||||
|
||||
Gonzalo Paniagua, core Mono developer (responsible for ASP.NET
|
||||
in Mono) is doing a talk on Thursday in Badajoz, Spain.
|
||||
Details are <a href="http://www.gulex.org/actividades.htm">here</a>
|
||||
|
||||
@item Feb 18th, 2003: Volunteers to document Gtk#
|
||||
|
||||
With the availability of a documentation browser, we are
|
||||
looking for volunteers to help us complete the documentation
|
||||
of the Gtk# binding for Mono.
|
||||
|
||||
Experience with Gtk is useful, but not mandatory. We have
|
||||
checked in stubs, and we have instructions, and resources to
|
||||
how to complete this process <a
|
||||
href="documentation.html">here</a>. Mail the <a
|
||||
href="mailto:[email protected]">[email protected]</a>
|
||||
for further discussion.
|
||||
|
||||
@item Feb 14th, 2003: OpenGL# bindings for Mono; Mono Basic updates.
|
||||
|
||||
Mark Crichton has completed his OpenGL/GLUT bindings for
|
||||
Gnome. A screenshot can be seen <a
|
||||
href="sshots/oglcs.png">here</a>. The bindings are available
|
||||
on the Mono CVS repository on the module `glgen'. This is a
|
||||
straight binding to the C API.
|
||||
|
||||
Marco has <a
|
||||
href="http://lists.ximian.com/archives/public/mono-list/2003-February/011752.html">posted
|
||||
an update</a> on the current state of the free VB.NET compiler
|
||||
for Mono.
|
||||
|
||||
We are looking for contributors and maintainers to the
|
||||
JavaScript compiler as well (Janet)
|
||||
|
||||
@item Feb 12th, 2003: New assemblies, Gtk# stub documentation, Authenticode, Polish site
|
||||
|
||||
Mono now distributes a few new assemblies: Mono.Security.Win32
|
||||
as a layer to use the crypto functionality on Win32. The
|
||||
Mono.Posix assembly which contains functionality for taking
|
||||
advantage of Unix facilities.
|
||||
|
||||
A <a href="http://www.go-mono.pl/">Mono site in Poland</a>.
|
||||
|
||||
Stubs for the Gtk# documentation have been checked into CVS.
|
||||
If you want to contribute please read <a
|
||||
href="http://lists.ximian.com/archives/public/mono-list/2003-February/012108.html">this
|
||||
message</a>
|
||||
|
||||
Mono development is moving quickly: Tim and Daniel have been
|
||||
improving the Oracle database provider and Sebastien Pouliot
|
||||
has got code signing to work using Authenticode with pure open
|
||||
source and managed code. Plenty of new VB.NET work from Marco
|
||||
(compiler) and Daniel (runtime). Also Jackson has resumed
|
||||
work on the IL assembler and the fully managed library to
|
||||
generate CIL images (Sergey wrote the first Mono.PEToolkit).
|
||||
|
||||
@item Feb 11th, 2003: Mono Weekly News, New assemblies.
|
||||
|
||||
<a href="http://monoevo.sourceforge.net/mwn/index.html">Mono
|
||||
Weekly News</a>: Includes a new interview, software
|
||||
announcements and the PHP/Mono integration.
|
||||
|
||||
@item Feb 5th, 2003: MonoDoc 0.1
|
||||
|
||||
A <a
|
||||
href="http://www.go-mono.com/archive/monodoc-0.1.tar.gz">preliminary
|
||||
release</a> of the Mono Documentation Browser is now availble.
|
||||
Release <a
|
||||
href="http://lists.ximian.com/archives/public/mono-list/2003-February/011935.html">notes</a>
|
||||
|
||||
@item Jan, 22th, 2003: Mono wins award, OpenLink releases Virtuoso.
|
||||
|
||||
Mono won the `Best Open Source Project' award at the Linux
|
||||
World Expo. A description is <a
|
||||
href="http://linuxtoday.com/news_story.php3?ltsn=2003-01-23-024-26-OP-EV">here</a>
|
||||
|
||||
Open Link has a <a
|
||||
href="http://biz.yahoo.com/prnews/030123/neth013_1.html">press
|
||||
release</a> about Virtuoso 3.0: the first commercial product
|
||||
shipping that uses Mono.
|
||||
|
||||
@item Jan, 20th, 2003: Mono 0.19 released; Screenshots page; Gtk# 0.7
|
||||
|
||||
Mono 0.19 has been released. Check out the <a
|
||||
href="archive/mono-0.19">release notes</a> for an overview of
|
||||
the changes. You can get it <a href="download.html">here</a>.
|
||||
There are no major features in this release, mostly bug fixes
|
||||
and performance improvements.
|
||||
|
||||
We have now a new section <a href="screenshots.html">with
|
||||
screenshots</a> of various Mono applications. You can see
|
||||
there the new released Debugger, as well as the work in
|
||||
progress on the documentation browser.
|
||||
|
||||
<a href="http://gtk-sharp.sf.net">Gtk# 0.7</a> has been <a
|
||||
href="http://lists.ximian.com/archives/public/mono-list/2003-January/005222.html">released</a>
|
||||
|
||||
@item Jan, 19th, 2003: Mono Debugger released.
|
||||
|
||||
After six month of extensive development, Martin Baulig has
|
||||
released the first version of the Mono debugger. The Mono
|
||||
debugger is written in C# and can debug both managed and
|
||||
unmanaged applications, support for multiple-threaded
|
||||
applications and should be relatively easy to port to new
|
||||
platforms.
|
||||
|
||||
Details of the release are available in <a
|
||||
href="http://lists.ximian.com/archives/public/mono-list/2003-January/005192.html">post</a>.
|
||||
|
||||
The debugger contains both Gtk# and command line interfaces.
|
||||
The debugging file format used in Dwarf (its already supported
|
||||
by our class libraries and the Mono C# compiler; To debug C
|
||||
applications, you need a recent GCC, or to pass the -gdwarf-2
|
||||
flag to gcc).
|
||||
|
||||
@item Jan, 17th, 2003: DB2 provider, MacOS X
|
||||
@item Jan, 17th: DB2 provider, MacOS X
|
||||
|
||||
Christopher Bockner has contributed a DB2 System.Data client.
|
||||
|
||||
|
||||
+5
-23
@@ -1,7 +1,7 @@
|
||||
* Debugging information
|
||||
|
||||
Compile your programs using the `-g' flag in MCS, that will all a special
|
||||
resource containing debugging information to your executable.
|
||||
Compile your programs using the `-g' flag in MCS, that will generate a file
|
||||
with the extension .dbg containing the dwarf symbols for your executable.
|
||||
|
||||
To get stack traces with line number information, you need to run your
|
||||
program like this:
|
||||
@@ -15,27 +15,9 @@
|
||||
|
||||
* Mono Debugger
|
||||
|
||||
The Mono debugger is written in C# and can debug both managed
|
||||
and unmanaged applications, support for multiple-threaded
|
||||
applications and should be relatively easy to port to new
|
||||
platforms.
|
||||
A new debugger has been created in C# and using Gtk# for its
|
||||
user interface, this will simplify the debugging of CLI applications.
|
||||
|
||||
Details of the release are available in <a
|
||||
href="http://lists.ximian.com/archives/public/mono-list/2003-January/011415.html">post</a>.
|
||||
|
||||
The debugger contains both Gtk# and command line interfaces.
|
||||
The debugging file format used in Dwarf (its already supported
|
||||
by our class libraries and the Mono C# compiler; To debug C
|
||||
applications, you need a recent GCC, or to pass the -gdwarf-2
|
||||
flag to gcc).
|
||||
|
||||
The debugger is available now, you can get it from <a
|
||||
href="http://primates.ximian.com/~martin/debugger/mono-debugger-0.2.0.tar.gz">here</a>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Stay turned for its first public release.
|
||||
|
||||
|
||||
@@ -0,0 +1,86 @@
|
||||
* A debugging session using a dynamically generated symbol file.
|
||||
|
||||
Let's assume we have the following C# application which we want to debug:
|
||||
|
||||
<pre>
|
||||
using System;
|
||||
|
||||
public class Foo
|
||||
{
|
||||
public struct MyStruct {
|
||||
int a;
|
||||
long b;
|
||||
double c;
|
||||
}
|
||||
|
||||
public static void Main ()
|
||||
{
|
||||
Int32 value = 5;
|
||||
long test = 512;
|
||||
|
||||
MyStruct my_struct;
|
||||
my_struct.a = 5;
|
||||
my_struct.b = test;
|
||||
my_struct.c = 23323.5235;
|
||||
}
|
||||
}
|
||||
</pre>
|
||||
|
||||
First of all, we need to compile it and create the .il files:
|
||||
|
||||
<pre>
|
||||
$ mcs ./Foo.cs
|
||||
$ monodis /home/export/martin/MONO-LINUX/lib/corlib.dll > corlib.il
|
||||
$ monodis Foo.exe > Foo.il
|
||||
</pre>
|
||||
|
||||
Now we can start the JIT in the debugger:
|
||||
|
||||
<pre>
|
||||
$ gdb ~/monocvs/mono/mono/jit/mono
|
||||
(gdb) r --debug=dwarf --break Foo:Main ./Foo.exe
|
||||
Starting program: /home/martin/monocvs/mono/mono/jit/mono --debug=dwarf --break Foo:Main ./Foo.exe
|
||||
0x081e8911 in ?? ()
|
||||
(gdb) call mono_debug_make_symbols ()
|
||||
(gdb) add-symbol-file /tmp/Foo.o
|
||||
Reading symbols from /tmp/Foo.o...done.
|
||||
Current language: auto; currently c++
|
||||
(gdb) frame
|
||||
#0 Foo.Main () at Foo.il:26
|
||||
26 // method line 2
|
||||
(gdb) n
|
||||
Foo.Main () at Foo.il:38
|
||||
38 IL_0000: ldc.i4.5
|
||||
(gdb) list
|
||||
33 .maxstack 2
|
||||
34 .locals (
|
||||
35 int32 V_0,
|
||||
36 int64 V_1,
|
||||
37 valuetype MyStruct V_2)
|
||||
38 IL_0000: ldc.i4.5
|
||||
39 IL_0001: stloc.0
|
||||
40 IL_0002: ldc.i4 512
|
||||
41 IL_0007: conv.i8
|
||||
42 IL_0008: stloc.1
|
||||
43 IL_0009: ldloca.s 2
|
||||
44 IL_000b: ldc.i4.5
|
||||
45 IL_000c: stfld int32 .MyStruct::a
|
||||
46 IL_0011: ldloca.s 2
|
||||
47 IL_0013: ldloc.1
|
||||
48 IL_0014: stfld int64 .MyStruct::b
|
||||
49 IL_0019: ldloca.s 2
|
||||
50 IL_001b: ldc.r8 23323.5
|
||||
51 IL_0024: stfld float64 .MyStruct::c
|
||||
52 IL_0029: ret
|
||||
(gdb) until 52
|
||||
Foo.Main () at Foo.il:53
|
||||
53 }
|
||||
(gdb) info locals
|
||||
V_0 = 5
|
||||
V_1 = 512
|
||||
V_2 = {a = 5, b = 512, c = 23323.523499999999}
|
||||
</pre>
|
||||
|
||||
As you see in this example, you need to know IL code to use this debugging method - but
|
||||
it may be the only way to debug a library.
|
||||
|
||||
@@ -0,0 +1,70 @@
|
||||
* A debugging session using a symbol file which has been created by MCS.
|
||||
|
||||
Let's assume we have the following C# application which we want to debug:
|
||||
|
||||
<pre>
|
||||
using System;
|
||||
|
||||
public class Foo
|
||||
{
|
||||
public struct MyStruct {
|
||||
int a;
|
||||
long b;
|
||||
double c;
|
||||
}
|
||||
|
||||
public static void Main ()
|
||||
{
|
||||
Int32 value = 5;
|
||||
long test = 512;
|
||||
|
||||
MyStruct my_struct;
|
||||
my_struct.a = 5;
|
||||
my_struct.b = test;
|
||||
my_struct.c = 23323.5235;
|
||||
}
|
||||
}
|
||||
</pre>
|
||||
|
||||
First of all, we need to compile it with MCS, assemble the generated .s file and
|
||||
create the .il files for all referenced assemblies which were not compiled with MCS:
|
||||
|
||||
<pre>
|
||||
$ mcs -g ./Foo.cs
|
||||
$ as -o Foo-debug.o Foo-debug.s
|
||||
$ monodis /home/export/martin/MONO-LINUX/lib/corlib.dll > corlib.il
|
||||
</pre>
|
||||
|
||||
Now we can start the JIT in the debugger:
|
||||
|
||||
<pre>
|
||||
$ gdb ~/monocvs/mono/mono/jit/mono
|
||||
(gdb) r --debug=dwarf-plus --break Foo:Main ./Foo.exe
|
||||
Starting program: /home/martin/monocvs/mono/mono/jit/mono --debug=dwarf-plus --break Foo:Main ./Foo.exe
|
||||
Program received signal SIGTRAP, Trace/breakpoint trap.
|
||||
0x081e8681 in ?? ()
|
||||
(gdb) call mono_debug_make_symbols ()
|
||||
(gdb) add-symbol-file Foo-debug.o
|
||||
(gdb) add-symbol-file /tmp/corlib.o
|
||||
` (gdb) frame
|
||||
#0 Main () at ./Foo.cs:11
|
||||
11 public static void Main ()
|
||||
(gdb) n
|
||||
Main () at ./Foo.cs:13
|
||||
13 Int32 value = 5;
|
||||
(gdb)
|
||||
14 long test = 512;
|
||||
(gdb)
|
||||
17 my_struct.a = 5;
|
||||
(gdb)
|
||||
18 my_struct.b = test;
|
||||
(gdb)
|
||||
19 my_struct.c = 23323.5235;
|
||||
(gdb)
|
||||
20 }
|
||||
(gdb) info locals
|
||||
value = 5
|
||||
test = 512
|
||||
my_struct = { a = 5, b = 512, c = 23323.5235 }
|
||||
</pre>
|
||||
|
||||
+3
-7
@@ -37,14 +37,10 @@
|
||||
|
||||
There is a very interesting project to make a JavaVM for .NET
|
||||
<a href="http://radio.weblogs.com/0109845/">here</a>.
|
||||
Currently this will not work with Mono, as they use some
|
||||
pieces of Managed C++ to implement the JNI interface.
|
||||
|
||||
Zoltan has got IKVM to work with Mono.
|
||||
|
||||
<a name="PHP">
|
||||
** PHP
|
||||
|
||||
Sterling has code to allow PHP developers to use Mono code, in
|
||||
his <a href="http://www.php.net/~sterling/mono/">site</a>
|
||||
A workaround has been discussed, contact the author if you want to contribute.
|
||||
|
||||
<a name="MonoLogo">
|
||||
** MonoLogo
|
||||
|
||||
@@ -92,11 +92,6 @@
|
||||
</ul>
|
||||
</ul>
|
||||
|
||||
* Alternative archive site
|
||||
|
||||
An alternate site that archives Mono List is available <a
|
||||
href="http://archive.neotonic.com/archive/mono-list">http://archive.neotonic.com/archive/mono-list</a>
|
||||
|
||||
* Google search of the archives
|
||||
|
||||
<!-- Google Search with mods -->
|
||||
|
||||
+2
-14
@@ -155,20 +155,8 @@ export PKG_CONFIG_PATH
|
||||
# /usr/local/include and /usr/local/lib to CPPFLAGS and LDFLAGS. We could
|
||||
# skip this if it would add /usr/include and /usr/lib, but leaving it
|
||||
# shouldnt break anything.
|
||||
iconvdirs="/usr/include /usr/local/include"
|
||||
for i in $iconvdirs
|
||||
do
|
||||
if [ -f $i/iconv.h ]; then
|
||||
iconvh_dir=$i
|
||||
break
|
||||
fi
|
||||
done
|
||||
|
||||
if [ -z "$iconvh_dir" ]; then
|
||||
echo "Can't find iconv headers (looked in $iconvdirs)"
|
||||
exit -1
|
||||
fi
|
||||
|
||||
iconvh=`locate include/iconv.h`
|
||||
iconvh_dir=`dirname $iconvh`
|
||||
iconvlib_dir=`echo $iconvh_dir | sed -e 's/include/lib/'`
|
||||
|
||||
echo "Adding $iconvh_dir to CPPFLAGS"
|
||||
|
||||
@@ -1,237 +1,74 @@
|
||||
* MySQL Data Provider
|
||||
|
||||
<p>There are two ADO.NET providers in Mono
|
||||
for a <a href="http://www.mysql.com/">MySQL</a> database:
|
||||
|
||||
<ul>
|
||||
<li><a href="http://sourceforge.net/projects/mysqlnet/">ByteFX.Data.MySQLClient</a>
|
||||
<ul>
|
||||
<li>Written in 100% C#</li>
|
||||
<li>Does not require a client library</li>
|
||||
<li>Works on Mono and Microsoft .NET</li>
|
||||
<li>Requires at least Mono 0.18 and MySQLNet 0.65 for it to work on Mono</li>
|
||||
<li>Works in the SQL# command-line and GTK# GUI version</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li>MySQL Data Provider for
|
||||
<a href="http://www.mysql.com/">MySQL</a> databases. It is written in C# and uses
|
||||
the MySQL C Client Library</li>
|
||||
|
||||
<li>Mono.Data.MySql (deprecated)
|
||||
<ul>
|
||||
<li>Deprecated in favor of ByteFX.Data.MySQLClient
|
||||
|
||||
<li>Written in C# and uses
|
||||
the MySQL C Client Library</li>
|
||||
|
||||
<li>Exists in namespace Mono.Data.MySql and assembly Mono.Data.MySql</li>
|
||||
<li>Exists in namespace Mono.Data.MySql and assembly Mono.Data.MySql</li>
|
||||
|
||||
<li>Works on Windows and Linux via the MySQL client shared library
|
||||
(libmySQL.dll on Windows and libmysqlclient.so on Linux).</li>
|
||||
<li>Works on Windows and Linux via the MySQL client shared library
|
||||
(libmySQL.dll on Windows and libmysqlclient.so on Linux).</li>
|
||||
|
||||
<li>Started by Daniel Morgan using
|
||||
<a href="http://www.cybercom.net/~zbrad/DotNet/MySql/">C# Bindings to MySQL</a> from <a href="mailto:[email protected]">Brad Merill</a></li>
|
||||
<li>Started by Daniel Morgan using
|
||||
<a href="http://www.cybercom.net/~zbrad/DotNet/MySql/">C# Bindings to MySQL</a> from <a href="mailto:[email protected]">Brad Merill</a>
|
||||
|
||||
<li><a href="http://www.mysql.com/articles/dotnet/">Exploring MySQL in the Microsoft .NET Environment</a> is an article
|
||||
by Mr. Venu who is a MySQL AB developer.</li>
|
||||
|
||||
<li>There is a good alternative to the provider in Mono:
|
||||
<ul>
|
||||
<li><a href="http://sourceforge.net/projects/mysqlnet/">MySQLNet</a> from ByteFX
|
||||
is a MySQL Managed provider written in 100% C#,
|
||||
does not require a client library, and works on Microsoft .NET and Mono. You
|
||||
need at least Mono 0.18 and MySQLNet 0.65 for it to work on Mono.</li>
|
||||
|
||||
</ul>
|
||||
</li>
|
||||
|
||||
<li>Bugs with Mono or the data provider should be reported
|
||||
in Mono's Bugzilla <a href="http://bugzilla.ximian.com/">here</a>. If you
|
||||
do not have Bugzilla user account, it is free
|
||||
and easy to
|
||||
create one <a href="http://bugzilla.ximian.com/createaccount.cgi">here</a>.</li>
|
||||
|
||||
</li>
|
||||
<li>Testing for Mono's Mono.Data.MySql and ByteFX's ByteFX.Data.MySQLClient is below...</li>
|
||||
</ul>
|
||||
|
||||
<p><a href="http://www.mysql.com/articles/dotnet/">Exploring MySQL
|
||||
in the Microsoft .NET Environment</a> is an article
|
||||
by Mr. Venu who is a MySQL AB developer.</li>
|
||||
|
||||
<p>Testing for Mono's Mono.Data.MySql and ByteFX's ByteFX.Data.MySQLClient is below.
|
||||
|
||||
** Current Status
|
||||
|
||||
Current Status of the MySQL providers:
|
||||
|
||||
<ul>
|
||||
|
||||
<li>ByteFX.Data.MySQLClient
|
||||
<ul>
|
||||
<li>Build and Runs on Microsoft .NET and Mono</li>
|
||||
<li>Works with SQL# (command-line and GTK# GUI versions)</li>
|
||||
<li>MySQLCommandBuilder now implemented</li>
|
||||
<li>Transaction support now implemented (not all table types support this)</li>
|
||||
<li>GetSchemaTable fixed to not use xsd (for Mono)</li>
|
||||
<li>Driver is now Mono-compatible</li>
|
||||
<li>TIME data type now supported</li>
|
||||
<li>More work to improve Timestamp data type handling</li>
|
||||
<li>Changed signatures of all classes to match corresponding SqlClient classes</li>
|
||||
<li>Protocol compression using <a href="http://www.icsharpcode.net/OpenSource/SharpZipLib/default.asp">SharpZipLib</a></li>
|
||||
<li>Named pipes on Windows now working properly</li>
|
||||
<li>Work done to improve Timestamp data type handling</li>
|
||||
<li>Implemented IEnumerable on DataReader so DataGrid would work</li>
|
||||
<li>Speed increased dramatically by removing bugging network sync code</li>
|
||||
<li>Driver no longer buffers rows of data (more ADO.Net compliant)</li>
|
||||
<li>Conversion bugs related to TIMESTAMP and DATETIME fields fixed</li>
|
||||
|
||||
</ul>
|
||||
</li>
|
||||
<li>can connect
|
||||
|
||||
<li>Mono.Data.MySql (deprecated)
|
||||
<ul>
|
||||
<li>Currently, only works with version 3.23.x of MySQL</li>
|
||||
<li>can execute non-queries via ExecuteNonQuery()
|
||||
|
||||
<li>can execute aggregates via ExecuteScalar() and retrieve the
|
||||
single row/single column result
|
||||
|
||||
<li>can execute queries and retrieve results using a data reader.
|
||||
|
||||
<li>a schema DataTable has been partially
|
||||
implemented which is returned from GetSchemaTable() in MySqlDataReader.
|
||||
|
||||
<li>a DataTable in a DataSet can be filled via a MySqlDataAdapter
|
||||
|
||||
<li>can connect</li>
|
||||
|
||||
<li>can execute non-queries via ExecuteNonQuery()</li>
|
||||
|
||||
<li>can execute aggregates via ExecuteScalar() and retrieve the
|
||||
single row/single column result</li>
|
||||
|
||||
<li>can execute queries and retrieve results using a data reader.</li>
|
||||
|
||||
<li>a schema DataTable has been partially
|
||||
implemented which is returned from GetSchemaTable() in MySqlDataReader.</li>
|
||||
|
||||
<li>a DataTable in a DataSet can be filled via a MySqlDataAdapter</li>
|
||||
|
||||
<li>The shared client libraries
|
||||
between windows version and linux are different: windows has libmySQL.dll
|
||||
while linux has libmysqlclient.so. This is handled by the
|
||||
file etc/mono/config which is mapped by the mono runtime in knowing
|
||||
which native shared library to load. In cvs, this file is mono/config.in and
|
||||
can be modified with a text editor.</li>
|
||||
|
||||
<li>Works in the SQL# command-line and GTK# GUI version</li>
|
||||
</ul>
|
||||
</li>
|
||||
|
||||
<li>The shared client libraries
|
||||
between windows version and linux are different: windows has libmySQL.dll
|
||||
while linux has libmysqlclient.so. This is handled by the
|
||||
file etc/mono/config which is mapped by the mono runtime in knowing
|
||||
which native shared library to load. In cvs, this file is mono/config.in and
|
||||
can be modified with a text editor.
|
||||
</ul>
|
||||
|
||||
** Action plan
|
||||
|
||||
The current plan for the MySQL data providers:
|
||||
|
||||
<ul>
|
||||
<li>ByteFX.Data.MySQLClient
|
||||
<ul>
|
||||
<li>Testing and fixes</li>
|
||||
<li>Implement missing features</li>
|
||||
<li>Only fixes for bugs to build and run MySQLClient on Mono
|
||||
will be accepted in mono-cvs. Most bugs and any new features will
|
||||
go into sourceforge cvs. Anytime there is a release of MySQLClient,
|
||||
the source code will be copied from sourceforge cvs to mono-cvs</li>
|
||||
<li>Releases of MySQLClient are determined by Reggie Burnett and releases
|
||||
of Mono are determined by Miguel de Icaza</li>
|
||||
<li>Implement any missing features or fix any bugs in Mono to get new
|
||||
features all of MySQLClient to work on Mono</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li>Mono.Data.MySql (deprecated)
|
||||
<ul>
|
||||
<li>Testing and bug fixes</li>
|
||||
<li>Mono.Data.MySql is deprecated and therefore maybe removed
|
||||
at a later date. It will stay in Mono for now because other
|
||||
programs maybe using it now.</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
** Testing for MySQLNet provider (ByteFX.Data.MySQLClient)
|
||||
|
||||
<ul>
|
||||
<li>Have access to a MySQL database or download it from
|
||||
<ul>
|
||||
<li><a href="http://www.mysql.com/downloads/index.html">MySQL AB</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
The current plan to work on the MySQL data provider:
|
||||
|
||||
<li>MySQLNet can be gotten from <a href="http://sourceforge.net/projects/mysqlnet/">here</a> and the
|
||||
binary assembly ByteFX.Data.dll needs to be installed
|
||||
in the same place as the mono class libraries.</li>
|
||||
|
||||
<li>MySQLNet requires <a href="http://www.icsharpcode.net/OpenSource/SharpZipLib/default.asp">SharpZipLib</a> which is
|
||||
a Zip Library written in 100% C#. This is used for compression/decompression of data
|
||||
sent/received over the network. The SharpZipLib binary assembly SharpZipLib.dll should
|
||||
be installed in the same place as the mono class libraries.</li>
|
||||
|
||||
<li>Has a ConnectionString format:
|
||||
<pre>
|
||||
"Server=hostname;" +
|
||||
"Database=database;" +
|
||||
"User ID=username;" +
|
||||
"Password=password"
|
||||
</pre>
|
||||
</li>
|
||||
<li>C# Example:
|
||||
<pre>
|
||||
using System;
|
||||
using System.Data;
|
||||
using ByteFX.Data.MySQLClient;
|
||||
|
||||
public class Test
|
||||
{
|
||||
public static void Main(string[] args)
|
||||
{
|
||||
string connectionString =
|
||||
"Server=localhost;" +
|
||||
"Database=test;" +
|
||||
"User ID=myuserid;" +
|
||||
"Password=mypassword;";
|
||||
IDbConnection dbcon;
|
||||
dbcon = new MySQLConnection(connectionString);
|
||||
dbcon.Open();
|
||||
IDbCommand dbcmd = dbcon.CreateCommand();
|
||||
// requires a table to be created named employee
|
||||
// with columns firstname and lastname
|
||||
// such as,
|
||||
// CREATE TABLE employee (
|
||||
// firstname varchar(32),
|
||||
// lastname varchar(32));
|
||||
string sql =
|
||||
"SELECT firstname, lastname " +
|
||||
"FROM employee";
|
||||
dbcmd.CommandText = sql;
|
||||
IDataReader reader = dbcmd.ExecuteReader();
|
||||
while(reader.Read()) {
|
||||
string FirstName = reader["firstname"];
|
||||
string LastName = reader["lastname"];
|
||||
Console.WriteLine("Name: " +
|
||||
FirstName + " " + LastName);
|
||||
}
|
||||
// clean up
|
||||
reader.Close();
|
||||
reader = null;
|
||||
dbcmd.Dispose();
|
||||
dbcmd = null;
|
||||
dbcon.Close();
|
||||
dbcon = null;
|
||||
}
|
||||
}
|
||||
</pre>
|
||||
</li>
|
||||
<li>Building C# Example:
|
||||
<ul>
|
||||
<li>Save the example to a file, such as, TestExample.cs</li>
|
||||
<li>Build on Linux:
|
||||
<pre>
|
||||
mcs TestExample.cs -r System.Data.dll \
|
||||
-r ByteFX.Data.dll
|
||||
</pre>
|
||||
</li>
|
||||
<li>Build on Windows via Cygwin:
|
||||
<pre>
|
||||
mono C:/cygwin/home/MyHome/mono/install/bin/mcs.exe \
|
||||
TestExample.cs \
|
||||
-lib:C:/cygwin/home/MyHome/mono/install/lib \
|
||||
-r System.Data.dll -r ByteFX.Data.dll
|
||||
</pre>
|
||||
</li>
|
||||
<li>Parameters support via MySqlParameter and MySqlParameterCollection
|
||||
|
||||
<li>Support LOBs (Large Object)
|
||||
|
||||
<li>Change the MySQL provider to not be dependent on a client library and
|
||||
be written in 100% C#
|
||||
|
||||
<li>Connection pooling
|
||||
|
||||
<li>Get the provider to work like other data providers
|
||||
</ul>
|
||||
</li>
|
||||
<li>Running the Example:
|
||||
<pre>
|
||||
mono TestExample.exe
|
||||
</pre>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
** Testing for Mono's MySQL provider (Mono.Data.MySql)
|
||||
|
||||
@@ -243,13 +80,18 @@ mono TestExample.exe
|
||||
</li>
|
||||
|
||||
<li>Take a look at MySqlTest.cs in mcs/class/Mono.Data.MySql/Test</li>
|
||||
<li>On Linux, you may need to make a symbolic link from libmySQL.dll to libmysqlclient.dll</li>
|
||||
|
||||
<li>Has a ConnectionString format:
|
||||
<pre>
|
||||
"Server=hostname;Database=database;User ID=username;Password=password"
|
||||
"Server=hostname;" +
|
||||
"Database=database;" +
|
||||
"User ID=username;" +
|
||||
"Password=password"
|
||||
(or)
|
||||
"Host=hostname;Dbname=database;User=username;Passwd=password"
|
||||
"host=hostname;" +
|
||||
"dbname=database;" +
|
||||
"user=username;" +
|
||||
"passwd=password"
|
||||
</pre>
|
||||
|
||||
<li>C# Example:
|
||||
@@ -265,11 +107,10 @@ mono TestExample.exe
|
||||
string connectionString =
|
||||
"Server=localhost;" +
|
||||
"Database=test;" +
|
||||
"User ID=myuserid;" +
|
||||
"Password=mypassword;";
|
||||
"User ID=mysql;" +
|
||||
"Password=;";
|
||||
IDbConnection dbcon;
|
||||
dbcon = new MySqlConnection(connectionString);
|
||||
dbcon.Open();
|
||||
IDbCommand dbcmd = dbcon.CreateCommand();
|
||||
// requires a table to be created named employee
|
||||
// with columns firstname and lastname
|
||||
@@ -280,7 +121,7 @@ mono TestExample.exe
|
||||
string sql =
|
||||
"SELECT firstname, lastname " +
|
||||
"FROM employee";
|
||||
dbcmd.CommandText = sql;
|
||||
dbcmd.ConnectionString = sql;
|
||||
IDataReader reader = dbcmd.ExecuteReader();
|
||||
while(reader.Read()) {
|
||||
string FirstName = reader["firstname"];
|
||||
@@ -327,3 +168,103 @@ mono TestExample.exe
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
** Testing for MySQLNet provider (ByteFX.Data.MySQLClient)
|
||||
|
||||
<ul>
|
||||
<li>Have access to a MySQL database or download it from
|
||||
<ul>
|
||||
<li><a href="http://www.mysql.com/downloads/index.html">MySQL AB</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
|
||||
<li>MySQLNet can be gotten from <a href="http://sourceforge.net/projects/mysqlnet/">here</a> and the
|
||||
binary assembly ByteFX.Data.dll needs to be installed
|
||||
in the same place as the mono class libraries.</li>
|
||||
|
||||
<li>MySQLNet requires <a href="http://www.icsharpcode.net/OpenSource/SharpZipLib/default.asp">SharpZipLib</a> which is
|
||||
a Zip Library written in 100% C#. This is used for compression/decompression of data
|
||||
sent/received over the network. The SharpZipLib binary assembly SharpZipLib.dll should
|
||||
be installed in the same place as the mono class libraries.</li>
|
||||
|
||||
<li>Has a ConnectionString format:
|
||||
<pre>
|
||||
"Server=hostname;" +
|
||||
"Database=database;" +
|
||||
"User ID=username;" +
|
||||
"Password=password"
|
||||
</pre>
|
||||
</li>
|
||||
<li>C# Example:
|
||||
<pre>
|
||||
using System;
|
||||
using System.Data;
|
||||
using ByteFX.Data.MySQLClient;
|
||||
|
||||
public class Test
|
||||
{
|
||||
public static void Main(string[] args)
|
||||
{
|
||||
string connectionString =
|
||||
"Server=localhost;" +
|
||||
"Database=test;" +
|
||||
"User ID=mysql;" +
|
||||
"Password=;";
|
||||
IDbConnection dbcon;
|
||||
dbcon = new MySQLConnection(connectionString);
|
||||
IDbCommand dbcmd = dbcon.CreateCommand();
|
||||
// requires a table to be created named employee
|
||||
// with columns firstname and lastname
|
||||
// such as,
|
||||
// CREATE TABLE employee (
|
||||
// firstname varchar(32),
|
||||
// lastname varchar(32));
|
||||
string sql =
|
||||
"SELECT firstname, lastname " +
|
||||
"FROM employee";
|
||||
dbcmd.ConnectionString = sql;
|
||||
IDataReader reader = dbcmd.ExecuteReader();
|
||||
while(reader.Read()) {
|
||||
string FirstName = reader["firstname"];
|
||||
string LastName = reader["lastname"];
|
||||
Console.WriteLine("Name: " +
|
||||
FirstName + " " + LastName);
|
||||
}
|
||||
// clean up
|
||||
reader.Close();
|
||||
reader = null;
|
||||
dbcmd.Dispose();
|
||||
dbcmd = null;
|
||||
dbcon.Close();
|
||||
dbcon = null;
|
||||
}
|
||||
}
|
||||
</pre>
|
||||
</li>
|
||||
<li>Building C# Example:
|
||||
<ul>
|
||||
<li>Save the example to a file, such as, TestExample.cs</li>
|
||||
<li>Build on Linux:
|
||||
<pre>
|
||||
mcs TestExample.cs -r System.Data.dll \
|
||||
-r ByteFX.Data.dll
|
||||
</pre>
|
||||
</li>
|
||||
<li>Build on Windows via Cygwin:
|
||||
<pre>
|
||||
mono C:/cygwin/home/MyHome/mono/install/bin/mcs.exe \
|
||||
TestExample.cs \
|
||||
-lib:C:/cygwin/home/MyHome/mono/install/lib \
|
||||
-r System.Data.dll -r ByteFX.Data.dll
|
||||
</pre>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li>Running the Example:
|
||||
<pre>
|
||||
mono TestExample.exe
|
||||
</pre>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
@@ -1,15 +1,10 @@
|
||||
* ODBC Data Provider
|
||||
|
||||
<ul>
|
||||
|
||||
<li>ADO.NET Data Provider for Data Sources
|
||||
that have <a href="http://www.microsoft.com/data/odbc/">ODBC</a> support.</li>
|
||||
|
||||
<li>Exists in namespace System.Data.Odbc and assembly System.Data</li>
|
||||
<li>Exists in namespace System.Data.Odbc and assembly System.Data
|
||||
|
||||
<li>Works on Windows and Linux. Should have no problems working on UNIX too.</li>
|
||||
<li>Works on Windows and Linux. Should have no problems working on UNIX too.
|
||||
|
||||
<li>Works on Windows via the native Windows odbc32.dll</li>
|
||||
<li>Works on Windows via the native Windows odbc32.dll
|
||||
|
||||
<li>Works on Linux via:
|
||||
|
||||
@@ -19,7 +14,7 @@
|
||||
from <a href="http://www.easysoft.com/">Easysoft</a></li>
|
||||
|
||||
<li><a href="http://www.iodbc.org/">iODBC</a> which has
|
||||
commercial support
|
||||
a commercial support
|
||||
from <a href="http://oplweb.openlinksw.com:8080/download/">OpenLink Software</a></li>
|
||||
</ul>
|
||||
|
||||
@@ -29,23 +24,21 @@
|
||||
|
||||
<li>ODBC can connect to various databases which has an ODBC driver installed:
|
||||
<ul>
|
||||
<li><a href="http://www.mysql.com/">MySQL</a></li>
|
||||
<li><a href="http://www.postgresql.org/">PostgreSQL</a></li>
|
||||
<li><a href="http://www.oracle.com/">Oracle</a></li>
|
||||
<li><a href="http://www.borland.com/products/downloads/download_interbase.html">Interbase</a></li>
|
||||
<li><a href="http://www.sybase.com/downloads">Sybase</a> (
|
||||
via <a href="http://www.freetds.org/">FreeTDS</a> on UNIX)</li>
|
||||
<li><a href="http://www.mysql.com/">MySQL</a>
|
||||
<li><a href="http://www.postgresql.org/">PostgreSQL</a>
|
||||
<li><a href="http://www.oracle.com/">Oracle</a>
|
||||
<li><a href="http://www.borland.com/products/downloads/download_interbase.html">Interbase</a>
|
||||
<li><a href="http://www.sybase.com/downloads">Sybase</a> and
|
||||
<li><a href="http://www.microsoft.com/sql/default.asp">Microsoft SQL Server</a> (
|
||||
via <a href="http://www.freetds.org/">FreeTDS</a> on UNIX)</li>
|
||||
<li><a href="http://www-3.ibm.com/software/data/db2/">IBM DB2 Universal Database</a></li>
|
||||
<li><a href="http://www.microsoft.com/office/access/default.asp">MS Access</a>
|
||||
(via <a href="http://mdbtools.sourceforge.net/">MDB Tools</a> on UNIX)</li>
|
||||
via <a href="http://www.freetds.org/">FreeTDS</a> on UNIX)
|
||||
<li><a href="http://www-3.ibm.com/software/data/db2/">IBM DB2 Universal Database</a>
|
||||
<li><a href="http://www.microsoft.com/office/access/default.asp">MS Access</a>
|
||||
(via <a href="http://mdbtools.sourceforge.net/">MDB Tools</a> on UNIX)
|
||||
</ul>
|
||||
|
||||
<li>ODBC Provider created by Brian Ritchie.</li>
|
||||
|
||||
<li>Does not support trusted connections</li>
|
||||
|
||||
</ul>
|
||||
|
||||
** Current Status
|
||||
@@ -77,16 +70,6 @@
|
||||
<li>Can get a DataTable containing schema info via GetSchemaTable() in a OdbcDataReader</li>
|
||||
|
||||
<li>Can Fill a DataTable in a DataSet via an OdbcDataAdapter</li>
|
||||
|
||||
<li>Works in SQL#, but Column names don't show up correctly.</li>
|
||||
|
||||
<li>Bugs with Mono or the data provider should be reported
|
||||
in Mono's Bugzilla <a href="http://bugzilla.ximian.com/">here</a>. If you
|
||||
do not have Bugzilla user account, it is free
|
||||
and easy to
|
||||
create one <a href="http://bugzilla.ximian.com/createaccount.cgi">here</a>.</li>
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
** Action Plan
|
||||
@@ -98,47 +81,22 @@
|
||||
<li>Testing with other setups
|
||||
</ul>
|
||||
|
||||
** Testing ODBC provider with IBM DB2 Universal Database
|
||||
** Testing ODBC provider
|
||||
|
||||
<ul>
|
||||
<li>You need a working mono and mcs</li>
|
||||
|
||||
<li>For Unix, you will need unixODBC or iODBC installed</li>
|
||||
|
||||
<li>Have acess to a <a href="http://www-3.ibm.com/software/data/db2/">IBM DB2 Universal Database</a> or
|
||||
you can download from IBM</li>
|
||||
|
||||
<li>Read these web pages about Unix, ODBC, and IBM DB2
|
||||
<p>Test Mono's ODBC provider System.Data.Odbc with the MySQL ODBC driver MyODBC
|
||||
|
||||
<ul>
|
||||
<li><a href="http://www.unixodbc.com/doc/db2.html">unixODBC web page about IBM DB2</a></li>
|
||||
<li><a href="http://www-3.ibm.com/software/data/db2/udb/ad/v8/cli/t0010406">IBM web page about unixODBC and DB2</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
|
||||
<li>The ODBC provider is similar to the <a href="http://www.go-mono.com/ibmdb2.html">IBM DB2</a> provider.</li>
|
||||
</ul>
|
||||
|
||||
** Testing ODBC provider with MySQL
|
||||
|
||||
<p>You can test Mono's ODBC provider System.Data.Odbc with the MySQL ODBC driver MyODBC
|
||||
|
||||
<p><ul>
|
||||
<li>Take a look at OdbcTest.cs in mcs/class/System.Data/Test</li>
|
||||
|
||||
<li>Here is a ConnectionString format if you have a DSN setup:
|
||||
<pre>
|
||||
"DSN=dataSetName;UID=myuserid;PWD=mypassword"
|
||||
"DSN=dataSetName;UID=username;PWD=password"
|
||||
</pre>
|
||||
</li>
|
||||
<li>Here is a ConnectionString format if you do not have a DSN (have not
|
||||
gotten this to work though):
|
||||
<li>Here is a ConnectionString format if you do not have DSN (have not
|
||||
gotten this to work):
|
||||
<pre>
|
||||
"DRIVER={MySQL ODBC 3.51 Driver};" +
|
||||
"SERVER=localhost;DATABASE=test;" +
|
||||
"UID=myuserid;PASSWORD=mypassword;" +
|
||||
"OPTION=3";
|
||||
|
||||
"DRIVER={SQL Server};SERVER=(local);UID=sa;PWD=;DATABASE=pubs"
|
||||
</pre>
|
||||
</li>
|
||||
<li>C# Example:
|
||||
@@ -157,10 +115,9 @@
|
||||
// hostname of localhost and database test
|
||||
string connectionString =
|
||||
"DSN=MYSQLDSN;" +
|
||||
"UID=myuserid;" +
|
||||
"PWD=mypassword";
|
||||
"UID=mysql;" +
|
||||
"PWD=;";
|
||||
IDbConnection dbcon;
|
||||
dbcon.Open();
|
||||
dbcon = new OdbcConnection(connectionString);
|
||||
IDbCommand dbcmd = dbcon.CreateCommand();
|
||||
// requires a table to be created named employee
|
||||
@@ -172,7 +129,7 @@
|
||||
string sql =
|
||||
"SELECT firstname, lastname " +
|
||||
"FROM employee";
|
||||
dbcmd.CommandText = sql;
|
||||
dbcmd.ConnectionString = sql;
|
||||
IDataReader reader = dbcmd.ExecuteReader();
|
||||
while(reader.Read()) {
|
||||
string FirstName = reader["firstname"];
|
||||
|
||||
@@ -27,14 +27,6 @@
|
||||
</li>
|
||||
|
||||
<li>Does not support trusted connections</li>
|
||||
|
||||
<li>Bugs with Mono or the data provider should be reported
|
||||
in Mono's Bugzilla <a href="http://bugzilla.ximian.com/">here</a>. If you
|
||||
do not have Bugzilla user account, it is free
|
||||
and easy to
|
||||
create one <a href="http://bugzilla.ximian.com/createaccount.cgi">here</a>.</li>
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
** Current Status
|
||||
@@ -90,12 +82,9 @@
|
||||
string connectionString =
|
||||
"Provider=PostgreSQL;" +
|
||||
"Addr=127.0.0.1;" +
|
||||
"Database=test;" +
|
||||
"User ID=postgres;" +
|
||||
"Password=fun2db";
|
||||
"Database=rodrigo";
|
||||
IDbConnection dbcon;
|
||||
dbcon = new OleDbConnection(connectionString);
|
||||
dbcon.Open();
|
||||
IDbCommand dbcmd = dbcon.CreateCommand();
|
||||
// requires a table to be created named employee
|
||||
// with columns firstname and lastname
|
||||
@@ -106,7 +95,7 @@
|
||||
string sql =
|
||||
"SELECT firstname, lastname " +
|
||||
"FROM employee";
|
||||
dbcmd.CommandText = sql;
|
||||
dbcmd.ConnectionString = sql;
|
||||
IDataReader reader = dbcmd.ExecuteReader();
|
||||
while(reader.Read()) {
|
||||
string FirstName = reader["firstname"];
|
||||
|
||||
+56
-94
@@ -1,115 +1,82 @@
|
||||
* Oracle Data Provider
|
||||
|
||||
<ul>
|
||||
|
||||
<li>ADO.NET Data Provider for <a href="http://www.oracle.com/">Oracle</a> databases</li>
|
||||
|
||||
<li>Exists in namespace System.Data.OracleClient and assembly System.Data.OracleClient</li>
|
||||
|
||||
<li>Works on Windows and Linux</li>
|
||||
|
||||
<li>Works on Windows</li>
|
||||
|
||||
<li>Works with Oracle 8i</li>
|
||||
|
||||
<li>Untested, but should work with Oracle 9i</li>
|
||||
|
||||
<li>Uses the Oracle CLI (Call Level Interface) which is a C library (API) for the Oracle Client
|
||||
software</li>
|
||||
|
||||
<li>Internally, the OracleClient provider has OCI abstracted to an object-oriented programming model</li>
|
||||
|
||||
<li>Created by Daniel Morgan and Tim Coleman</li>
|
||||
|
||||
|
||||
<li>More information about Oracle can be found at <a href="http://www.oracle.com/"/>here</a></li>
|
||||
|
||||
<li>Created by Daniel Morgan.</li>
|
||||
|
||||
<li>Does not support trusted connections</li>
|
||||
|
||||
<li>Bugs with Mono or the data provider should be reported
|
||||
in Mono's Bugzilla <a href="http://bugzilla.ximian.com/">here</a>. If you
|
||||
do not have Bugzilla user account, it is free
|
||||
and easy to
|
||||
create one <a href="http://bugzilla.ximian.com/createaccount.cgi">here</a>.</li>
|
||||
|
||||
</ul>
|
||||
|
||||
** Current Status
|
||||
|
||||
<ul>
|
||||
<li>OracleConnection can connect and disconnect to an Oracle 8i database on
|
||||
Windows and Linux via OCI (Oracle Call-level Interface)</li>
|
||||
<li>OracleConnection can connect to an Oracle 8i database on
|
||||
Windows via oci.dll</li>
|
||||
|
||||
<li>No longer uses a glue library (a library between the System.Data.OracleClient.dll
|
||||
assembly and the oci library). In Current Mono cvs, System.Data.OracleClient
|
||||
directly platform invokes into the oci library thanks to Tim Coleman.</li>
|
||||
|
||||
<li>Can have multiple connections with different transactions where each transaction is
|
||||
separated from the others, so a rollback or commit in one transaction
|
||||
does not affect the other.</li>
|
||||
<li>The native glue library only has makefiles for Borland C++ and
|
||||
Microsoft Visual C++ command line compilers. Only the makefile for
|
||||
Microsoft Visual C++ command-line compiler has been tested.</li>
|
||||
|
||||
<li>Can execute simple DML SQL statements, such as,
|
||||
INSERT a row into the EMP table via the OracleCommand's ExecuteNonQuery method</li>
|
||||
|
||||
|
||||
<li>The System.Data.OracleClient.dll assembly can be built with mcs/mono via
|
||||
the makefile.gnu for System.Data.OracleClient or csc/.net via the
|
||||
System.Data.OracleClient.build nant build file.</li>
|
||||
|
||||
<li>Can retrieve data via ExecuteReader and OracleDataReader. Currently,
|
||||
supports character, numeric, some date data types. ExecuteScalar
|
||||
also works.</li>
|
||||
|
||||
<li>Simple input parameters (character and numeric data) can now
|
||||
be used in SQL queries. Output parameters do not yet work.</li>
|
||||
|
||||
<li>OracleException and Error handling exists now.</li>
|
||||
|
||||
<li>Message handling needs to be added for non-critical messages
|
||||
received from Oracle</li>
|
||||
|
||||
<li>Handling of various data types need to be added.</li>
|
||||
|
||||
<li>Data Adapter exists, and a DataSet can be filled using it. The
|
||||
Data Adapter is abstract enough that it should work as expected.</li>
|
||||
|
||||
<li>Lots of missing functionality and bugs.</li>
|
||||
|
||||
<li>Works with SQL# command-line and GTK# versions in cvs. Only works with
|
||||
simple character data though. SQL# For GTK# can only show the results to
|
||||
the TextView because the Data Adapter is not yet available</li>
|
||||
System.Data.OracleClient.build nant build file. There is also a Visual Studio.NET
|
||||
solution it too.
|
||||
|
||||
</ul>
|
||||
|
||||
** Action Plan
|
||||
|
||||
<ul>
|
||||
<li>Be able to retrieve results via a data reader (WORKING)</li>
|
||||
<li>Parameters support (IN PROGRESS)</li>
|
||||
<li>transactions (WORKING)</li>
|
||||
<li>Get the makefile for the Borland C++ compiler to work
|
||||
since the <a href="http://www.borland.com/">Borland</a> C++ compiler is
|
||||
a free download</li>
|
||||
<li>Get the native glue lib System.Data.OracleClient.ocigule.dll to be built
|
||||
using gcc on Linux. This would require that Oracle 8i client software be installed
|
||||
on Linux with the oci headers and shared libraries</li>
|
||||
<li>Be able to retrieve results via a data reader</li>
|
||||
<li>Parameters support</li>
|
||||
<li>Stored Procedures, Functions, and Packages support</li>
|
||||
<li>Be able to fill a DataTable in a DataSet via a data adapter (IN PROGRESS)</li>
|
||||
<li>Support for Oracle 8i and 9i (UNKNOWN)</li>
|
||||
<li>Support LOBs</li>
|
||||
<li>Support all the data types</li>
|
||||
<li>Implement Connection pooling</li>
|
||||
<li>Security</li>
|
||||
<li>Be able to fill a DataTable in a DataSet via a data adapter</li>
|
||||
<li>Support for Oracle 9i</li>
|
||||
<li>Figure out how to move the unmanaged OCI handling code in
|
||||
the oci glue C library to the managed C# assembly. I have been unable
|
||||
to successfully connect to an Oracle 8i database by using Platform Invoke and
|
||||
Marshalling in C# to the oci shared library (oci.dll on Windows)</li>
|
||||
|
||||
</ul>
|
||||
|
||||
** Testing System.Data.OracleClient
|
||||
** Testing Mono.Data.OracleClient
|
||||
|
||||
<ul>
|
||||
<li>Have a working mono and mcs</li>
|
||||
|
||||
<li>Have access to an Oracle 8i database or download it from
|
||||
<a href="http://www.oracle.com/">Oracle</a>. If you are connecting
|
||||
remotely to an Oracle database, you need the Oracle client software.
|
||||
Registration to the <a href="http://technet.oracle.com/">Oracle Technology Network</a> is free. If installing on Linux,
|
||||
I suggest you do a lot of searching to see how others installed Oracle on Linux.</li>
|
||||
<a href="http://www.oracle.com/">Oracle</a>. Registration to the
|
||||
Oracle Technology Network is free. If installing on Linux, I suggest you
|
||||
do a lot of searching to see how others installed Oracle on Linux.</li>
|
||||
|
||||
<li>Make sure System.Data.OracleClient.dll assembly is built, if not, go
|
||||
into System.Data.OracleClient and do a make -f makefile.gnu (on Linux) or
|
||||
../../nant/NAnt.exe (on Windows using Cygwin).</li>
|
||||
<li>Make sure Mono.Data.OracleClient.dll assembly is built, if not, go
|
||||
into Mono.Data.OracleClient and do a make -f makefile.gnu (on Linux) or
|
||||
../../nant/NAnt.exe (on Cygwin).</li>
|
||||
|
||||
<li>The OCI Glue Library Mono.Data.OracleClient.ociglue.dll will need to be
|
||||
created as well. Has only been tested with lc (Microsoft Visual C++ command-line compiler).
|
||||
There is a make file for Microsoft C++ and Borland C++. I'm sure it wouldn't be hard
|
||||
to create a makefile for gcc if installing on Linux.</li>
|
||||
|
||||
<li>Take a look at TestOracleClient.cs found at mcs/class/System.Data.OracleClient/Test</li>
|
||||
|
||||
<li>The Data Source is an Oracle TNSNAME</li>
|
||||
|
||||
<li>Has a connection string format:
|
||||
<pre>
|
||||
"Data Source=tnsname;User ID=userid;Password=password"
|
||||
@@ -123,33 +90,28 @@
|
||||
|
||||
public class Test
|
||||
{
|
||||
public static void Main (string[] args)
|
||||
public static void Main(string[] args)
|
||||
{
|
||||
string connectionString =
|
||||
"Data Source=testdb;" +
|
||||
"User ID=scott;" +
|
||||
"Password=tiger;";
|
||||
IDbConnection dbcon;
|
||||
dbcon = new OracleConnection (connectionString);
|
||||
dbcon.Open ();
|
||||
IDbCommand dbcmd = dbcon.CreateCommand ();
|
||||
string sql = "SELECT ename, job FROM scott.emp";
|
||||
dbcmd.CommandText = sql;
|
||||
IDataReader reader = dbcmd.ExecuteReader ();
|
||||
while (reader.Read ()) {
|
||||
string employeeName = reader["ename"];
|
||||
string job = reader["job"];
|
||||
Console.WriteLine ("Employee Name: {0} Job: {1}",
|
||||
employeeName, job);
|
||||
}
|
||||
// clean up
|
||||
reader.Close ();
|
||||
reader = null;
|
||||
dbcmd.CommandText = sql;
|
||||
dbcmd.ExecuteNonQuery ();
|
||||
dbcmd.Dispose ();
|
||||
dbcon = new OracleConnection(connectionString);
|
||||
IDbCommand dbcmd = dbcon.CreateCommand();
|
||||
string sql =
|
||||
"insert into scott.emp " +
|
||||
"(empno, ename, job, sal, deptno) " +
|
||||
"values(123," +
|
||||
"'Don Smith'," +
|
||||
"'Cook'," +
|
||||
"23021," +
|
||||
"20)";
|
||||
dbcmd.ConnectionString = sql;
|
||||
dbcmd.ExecuteNonQuery();
|
||||
dbcmd.Dispose();
|
||||
dbcmd = null;
|
||||
dbcon.Close ();
|
||||
dbcon.Close();
|
||||
dbcon = null;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,34 +0,0 @@
|
||||
* International sites
|
||||
|
||||
<ul>
|
||||
|
||||
<li><a href="http://mono.es.gnome.org">Mono
|
||||
Hispano</a>: The spanish-speaking community of Mono
|
||||
developers and users. They have quite a number of
|
||||
unique documents and tutorials.
|
||||
|
||||
<li><a href="http://www.go-mono.pl">Mono Poland</a>:
|
||||
Mono site for polish users.
|
||||
|
||||
</ul>
|
||||
|
||||
* User sites
|
||||
|
||||
<ul>
|
||||
|
||||
<li>Alp Toker's <a
|
||||
href="http://www.atoker.com/mono/">site</a>: He is an
|
||||
active Mono developer (gsirc, platano) and produces
|
||||
very nice Debian packages of Mono.
|
||||
|
||||
<li>Brian Ritchie's <a
|
||||
href="http://www12.brinkster.com/brianr/">site</a>:
|
||||
Brian is a contributor to Mono's class library (ODBC
|
||||
provider and the database multiplexing assembly), and
|
||||
has built an application server for .NET and Mono.
|
||||
His site contains news, software, as well as his
|
||||
weblog.
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
@@ -0,0 +1,246 @@
|
||||
System.Object
|
||||
System.Exception
|
||||
System.ValueType
|
||||
System.Delegate
|
||||
System.MulticastDelegate
|
||||
System.Enum
|
||||
System.Activator
|
||||
System.ArgIterator
|
||||
System.__ComObject
|
||||
System.TypedReference
|
||||
System.Security.AllowPartiallyTrustedCallersAttribute
|
||||
System.Runtime.Serialization.Formatter
|
||||
System.Runtime.Serialization.FormatterConverter
|
||||
System.Runtime.Serialization.FormatterServices
|
||||
System.Runtime.Serialization.ObjectIDGenerator
|
||||
System.Runtime.Serialization.ObjectManager
|
||||
System.Reflection.ModuleResolveEventHandler
|
||||
System.Reflection.Pointer
|
||||
System.Globalization.CompareInfo
|
||||
System.Globalization.HebrewCalendar
|
||||
System.Globalization.HijriCalendar
|
||||
System.Globalization.JapaneseCalendar
|
||||
System.Globalization.KoreanCalendar
|
||||
System.Globalization.SortKey
|
||||
System.Globalization.StringInfo
|
||||
System.Globalization.TaiwanCalendar
|
||||
System.Globalization.TextElementEnumerator
|
||||
System.Globalization.TextInfo
|
||||
System.Globalization.ThaiBuddhistCalendar
|
||||
System.IO.IsolatedStorage.IsolatedStorageFile
|
||||
System.Reflection.Emit.MethodRental
|
||||
System.Runtime.CompilerServices.AccessedThroughPropertyAttribute
|
||||
System.Runtime.CompilerServices.CallConvCdecl
|
||||
System.Runtime.CompilerServices.CallConvStdcall
|
||||
System.Runtime.CompilerServices.CallConvThiscall
|
||||
System.Runtime.CompilerServices.CallConvFastcall
|
||||
System.Runtime.CompilerServices.CustomConstantAttribute
|
||||
System.Runtime.CompilerServices.DateTimeConstantAttribute
|
||||
System.Runtime.CompilerServices.DiscardableAttribute
|
||||
System.Runtime.CompilerServices.DecimalConstantAttribute
|
||||
System.Runtime.CompilerServices.CompilationRelaxationsAttribute
|
||||
System.Runtime.CompilerServices.CompilerGlobalScopeAttribute
|
||||
System.Runtime.CompilerServices.IDispatchConstantAttribute
|
||||
System.Runtime.CompilerServices.IsVolatile
|
||||
System.Runtime.CompilerServices.IUnknownConstantAttribute
|
||||
System.Runtime.CompilerServices.RequiredAttributeAttribute
|
||||
System.Runtime.InteropServices.ArrayWithOffset
|
||||
System.Runtime.InteropServices.DispIdAttribute
|
||||
System.Runtime.InteropServices.ClassInterfaceType
|
||||
System.Runtime.InteropServices.ClassInterfaceAttribute
|
||||
System.Runtime.InteropServices.ComVisibleAttribute
|
||||
System.Runtime.InteropServices.LCIDConversionAttribute
|
||||
System.Runtime.InteropServices.ComRegisterFunctionAttribute
|
||||
System.Runtime.InteropServices.ComUnregisterFunctionAttribute
|
||||
System.Runtime.InteropServices.ProgIdAttribute
|
||||
System.Runtime.InteropServices.ImportedFromTypeLibAttribute
|
||||
System.Runtime.InteropServices.IDispatchImplType
|
||||
System.Runtime.InteropServices.IDispatchImplAttribute
|
||||
System.Runtime.InteropServices.ComSourceInterfacesAttribute
|
||||
System.Runtime.InteropServices.ComConversionLossAttribute
|
||||
System.Runtime.InteropServices.TypeLibTypeFlags
|
||||
System.Runtime.InteropServices.TypeLibFuncFlags
|
||||
System.Runtime.InteropServices.TypeLibVarFlags
|
||||
System.Runtime.InteropServices.TypeLibTypeAttribute
|
||||
System.Runtime.InteropServices.TypeLibFuncAttribute
|
||||
System.Runtime.InteropServices.TypeLibVarAttribute
|
||||
System.Runtime.InteropServices.ComImportAttribute
|
||||
System.Runtime.InteropServices.PreserveSigAttribute
|
||||
System.Runtime.InteropServices.ComAliasNameAttribute
|
||||
System.Runtime.InteropServices.AutomationProxyAttribute
|
||||
System.Runtime.InteropServices.PrimaryInteropAssemblyAttribute
|
||||
System.Runtime.InteropServices.CoClassAttribute
|
||||
System.Runtime.InteropServices.ComEventInterfaceAttribute
|
||||
System.Runtime.InteropServices.COMException
|
||||
System.Runtime.InteropServices.ComMemberType
|
||||
System.Runtime.InteropServices.CurrencyWrapper
|
||||
System.Runtime.InteropServices.DispatchWrapper
|
||||
System.Runtime.InteropServices.ErrorWrapper
|
||||
System.Runtime.InteropServices.ExtensibleClassFactory
|
||||
System.Runtime.InteropServices.HandleRef
|
||||
System.Runtime.InteropServices.InvalidComObjectException
|
||||
System.Runtime.InteropServices.InvalidOleVariantTypeException
|
||||
System.Runtime.InteropServices.TypeLibImporterFlags
|
||||
System.Runtime.InteropServices.ExporterEventKind
|
||||
System.Runtime.InteropServices.ITypeLibExporterNotifySink
|
||||
System.Runtime.InteropServices.ITypeLibConverter
|
||||
System.Runtime.InteropServices.MarshalDirectiveException
|
||||
System.Runtime.InteropServices.ObjectCreationDelegate
|
||||
System.Runtime.InteropServices.RuntimeEnvironment
|
||||
System.Runtime.InteropServices.RegistrationServices
|
||||
System.Runtime.InteropServices.SafeArrayRankMismatchException
|
||||
System.Runtime.InteropServices.SafeArrayTypeMismatchException
|
||||
System.Runtime.InteropServices.SEHException
|
||||
System.Runtime.InteropServices.TypeLibConverter
|
||||
System.Runtime.InteropServices.BIND_OPTS
|
||||
System.Runtime.InteropServices.UCOMIBindCtx
|
||||
System.Runtime.InteropServices.UCOMIConnectionPointContainer
|
||||
System.Runtime.InteropServices.UCOMIConnectionPoint
|
||||
System.Runtime.InteropServices.UCOMIEnumMoniker
|
||||
System.Runtime.InteropServices.CONNECTDATA
|
||||
System.Runtime.InteropServices.UCOMIEnumConnections
|
||||
System.Runtime.InteropServices.UCOMIEnumConnectionPoints
|
||||
System.Runtime.InteropServices.UCOMIEnumString
|
||||
System.Runtime.InteropServices.UCOMIEnumVARIANT
|
||||
System.Runtime.InteropServices.FILETIME
|
||||
System.Runtime.InteropServices.UCOMIMoniker
|
||||
System.Runtime.InteropServices.UCOMIPersistFile
|
||||
System.Runtime.InteropServices.UCOMIRunningObjectTable
|
||||
System.Runtime.InteropServices.STATSTG
|
||||
System.Runtime.InteropServices.UCOMIStream
|
||||
System.Runtime.InteropServices.DESCKIND
|
||||
System.Runtime.InteropServices.BINDPTR
|
||||
System.Runtime.InteropServices.UCOMITypeComp
|
||||
System.Runtime.InteropServices.TYPEKIND
|
||||
System.Runtime.InteropServices.TYPEFLAGS
|
||||
System.Runtime.InteropServices.IMPLTYPEFLAGS
|
||||
System.Runtime.InteropServices.TYPEATTR
|
||||
System.Runtime.InteropServices.FUNCDESC
|
||||
System.Runtime.InteropServices.IDLFLAG
|
||||
System.Runtime.InteropServices.IDLDESC
|
||||
System.Runtime.InteropServices.PARAMFLAG
|
||||
System.Runtime.InteropServices.PARAMDESC
|
||||
System.Runtime.InteropServices.TYPEDESC
|
||||
System.Runtime.InteropServices.ELEMDESC
|
||||
System.Runtime.InteropServices.VARDESC
|
||||
System.Runtime.InteropServices.DISPPARAMS
|
||||
System.Runtime.InteropServices.EXCEPINFO
|
||||
System.Runtime.InteropServices.FUNCKIND
|
||||
System.Runtime.InteropServices.INVOKEKIND
|
||||
System.Runtime.InteropServices.CALLCONV
|
||||
System.Runtime.InteropServices.FUNCFLAGS
|
||||
System.Runtime.InteropServices.VARFLAGS
|
||||
System.Runtime.InteropServices.UCOMITypeInfo
|
||||
System.Runtime.InteropServices.SYSKIND
|
||||
System.Runtime.InteropServices.LIBFLAGS
|
||||
System.Runtime.InteropServices.TYPELIBATTR
|
||||
System.Runtime.InteropServices.UCOMITypeLib
|
||||
System.Runtime.InteropServices.UnknownWrapper
|
||||
System.Runtime.Remoting.IObjectHandle
|
||||
System.Runtime.Remoting.IRemotingTypeInfo
|
||||
System.Runtime.Remoting.IChannelInfo
|
||||
System.Runtime.Remoting.IEnvoyInfo
|
||||
System.Runtime.Remoting.RemotingConfiguration
|
||||
System.Runtime.Remoting.TypeEntry
|
||||
System.Runtime.Remoting.ActivatedClientTypeEntry
|
||||
System.Runtime.Remoting.ActivatedServiceTypeEntry
|
||||
System.Runtime.Remoting.WellKnownClientTypeEntry
|
||||
System.Runtime.Remoting.WellKnownServiceTypeEntry
|
||||
System.Runtime.Remoting.RemotingException
|
||||
System.Runtime.Remoting.ServerException
|
||||
System.Runtime.Remoting.RemotingTimeoutException
|
||||
System.Runtime.Remoting.RemotingServices
|
||||
System.Runtime.Remoting.InternalRemotingServices
|
||||
System.Runtime.Remoting.SoapServices
|
||||
System.Runtime.Remoting.Activation.UrlAttribute
|
||||
System.Runtime.Remoting.Messaging.IMessageSink
|
||||
System.Runtime.Remoting.Messaging.AsyncResult
|
||||
System.Runtime.Remoting.Messaging.CallContext
|
||||
System.Runtime.Remoting.Messaging.ILogicalThreadAffinative
|
||||
System.Runtime.Remoting.Messaging.InternalMessageWrapper
|
||||
System.Runtime.Remoting.Messaging.IMethodCallMessage
|
||||
System.Runtime.Remoting.Messaging.MethodCallMessageWrapper
|
||||
System.Runtime.Remoting.Messaging.HeaderHandler
|
||||
System.Runtime.Remoting.Messaging.IMessageCtrl
|
||||
System.Runtime.Remoting.Messaging.IRemotingFormatter
|
||||
System.Runtime.Remoting.Messaging.ReturnMessage
|
||||
System.Runtime.Remoting.Messaging.MethodCall
|
||||
System.Runtime.Remoting.Messaging.ConstructionCall
|
||||
System.Runtime.Remoting.Messaging.MethodResponse
|
||||
System.Runtime.Remoting.Messaging.ConstructionResponse
|
||||
System.Runtime.Remoting.Messaging.MethodReturnMessageWrapper
|
||||
System.Runtime.Remoting.Messaging.OneWayAttribute
|
||||
System.Runtime.Remoting.Messaging.MessageSurrogateFilter
|
||||
System.Runtime.Remoting.Messaging.RemotingSurrogateSelector
|
||||
System.Runtime.Remoting.Contexts.CrossContextDelegate
|
||||
System.Runtime.Remoting.Contexts.ContextProperty
|
||||
System.Runtime.Remoting.Contexts.IContextPropertyActivator
|
||||
System.Runtime.Remoting.Contexts.IContributeClientContextSink
|
||||
System.Runtime.Remoting.Contexts.IContributeDynamicSink
|
||||
System.Runtime.Remoting.Contexts.IContributeEnvoySink
|
||||
System.Runtime.Remoting.Contexts.IContributeObjectSink
|
||||
System.Runtime.Remoting.Contexts.IContributeServerContextSink
|
||||
System.Runtime.Serialization.Formatters.InternalRM
|
||||
System.Runtime.Serialization.Formatters.InternalST
|
||||
System.Runtime.Serialization.Formatters.SoapMessage
|
||||
System.Runtime.Serialization.Formatters.SoapFault
|
||||
System.Runtime.Serialization.Formatters.ServerFault
|
||||
System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||
System.Security.Cryptography.CryptoConfig
|
||||
System.Security.Cryptography.KeyedHashAlgorithm
|
||||
System.Security.Cryptography.HMACSHA1
|
||||
System.Security.Cryptography.MACTripleDES
|
||||
System.Security.Cryptography.MaskGenerationMethod
|
||||
System.Security.Cryptography.PasswordDeriveBytes
|
||||
System.Security.Cryptography.PKCS1MaskGenerationMethod
|
||||
System.Security.Cryptography.RC2
|
||||
System.Security.Cryptography.RC2CryptoServiceProvider
|
||||
System.Security.Cryptography.RSACryptoServiceProvider
|
||||
System.Security.Cryptography.RSAOAEPKeyExchangeDeformatter
|
||||
System.Security.Cryptography.RSAOAEPKeyExchangeFormatter
|
||||
System.Security.Cryptography.RSAPKCS1KeyExchangeDeformatter
|
||||
System.Security.Cryptography.RSAPKCS1KeyExchangeFormatter
|
||||
System.Security.Cryptography.RSAPKCS1SignatureDeformatter
|
||||
System.Security.Cryptography.RSAPKCS1SignatureFormatter
|
||||
System.Security.Cryptography.SHA1Managed
|
||||
System.Security.Cryptography.TripleDES
|
||||
System.Security.Cryptography.TripleDESCryptoServiceProvider
|
||||
System.Security.Permissions.EnvironmentPermission
|
||||
System.Security.Permissions.FileDialogPermission
|
||||
System.Security.Permissions.IsolatedStorageFilePermission
|
||||
System.Security.Permissions.PrincipalPermissionAttribute
|
||||
System.Security.Permissions.SecurityPermissionAttribute
|
||||
System.Security.Permissions.PublisherIdentityPermissionAttribute
|
||||
System.Security.Permissions.PublisherIdentityPermission
|
||||
System.Security.Permissions.ReflectionPermission
|
||||
System.Security.Permissions.RegistryPermission
|
||||
System.Security.Permissions.PrincipalPermission
|
||||
System.Security.Permissions.SiteIdentityPermission
|
||||
System.Security.Permissions.StrongNameIdentityPermission
|
||||
System.Security.Permissions.StrongNamePublicKeyBlob
|
||||
System.Security.Permissions.UIPermission
|
||||
System.Security.Permissions.UrlIdentityPermission
|
||||
System.Security.Permissions.ZoneIdentityPermission
|
||||
System.Security.Policy.ApplicationDirectory
|
||||
System.Security.Policy.ApplicationDirectoryMembershipCondition
|
||||
System.Security.Policy.FirstMatchCodeGroup
|
||||
System.Security.Policy.Hash
|
||||
System.Security.Policy.HashMembershipCondition
|
||||
System.Security.Policy.NetCodeGroup
|
||||
System.Security.Policy.PermissionRequestEvidence
|
||||
System.Security.Policy.Publisher
|
||||
System.Security.Policy.PublisherMembershipCondition
|
||||
System.Security.Policy.Site
|
||||
System.Security.Policy.SiteMembershipCondition
|
||||
System.Security.Policy.StrongName
|
||||
System.Security.Policy.StrongNameMembershipCondition
|
||||
System.Security.Policy.UnionCodeGroup
|
||||
System.Security.Policy.Url
|
||||
System.Security.Policy.UrlMembershipCondition
|
||||
System.Security.Policy.Zone
|
||||
System.Security.Policy.ZoneMembershipCondition
|
||||
System.Security.Principal.WindowsIdentity
|
||||
System.Security.Principal.WindowsImpersonationContext
|
||||
System.Security.Principal.WindowsPrincipal
|
||||
System.Threading.CompressedStack
|
||||
|
||||
+40
-126
@@ -1,182 +1,98 @@
|
||||
* PostgreSQL Data Provider
|
||||
|
||||
There are two ADO.NET data providers for <a href="http://www.postgresql.org/">PostgreSQL</a> in Mono:
|
||||
|
||||
<ul>
|
||||
|
||||
<li><a href="http://gborg.postgresql.org/project/npgsql/projdisplay.php">Npgsql</a>
|
||||
<li>Exists in namespace Mono.Data.PostgreSql and assembly Mono.Data.PostgreSql</li>
|
||||
|
||||
<li>Is a Mono Data Provider for the <a href="http://www.postgresql.org/">PostgreSQL</a>
|
||||
client/server database management system.</li>
|
||||
|
||||
<li>Written in C# and has C# bindings to the PostgreSQL C Client library pq.dll on Windows
|
||||
and libpq.so on Linux.</li>
|
||||
|
||||
<li>Alternative to the PostgreSQL provider in Mono:
|
||||
<ul>
|
||||
<li>a .NET Managed Data Provider for PostgreSQL
|
||||
|
||||
<li>Written in 100% C#</li>
|
||||
|
||||
<li>does not require a client library</li>
|
||||
|
||||
<li>works on Mono and Microsoft .NET</li>
|
||||
|
||||
<li>created by Francisco Figueiredo jr. and has many developers working on it
|
||||
|
||||
<li>works in the SQL# (command-line and GTK# GUI versions)</li>
|
||||
|
||||
<li>in namespace Npgsql and assembly Npgsql and is found in mcs
|
||||
at mcs/class/Npgsql</li>
|
||||
<li><a href="http://gborg.postgresql.org/project/npgsql/projdisplay.php">Npgsql</a>
|
||||
is a Managed PostgreSQL provider written in 100% C#, does not require a client library,
|
||||
and works on Microsoft .NET and Mono.
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
|
||||
<li>Mono.Data.PostgreSQL (deprecated)
|
||||
<ul>
|
||||
<li>Deprecated in favor of Npgsql</li>
|
||||
|
||||
<li>Exists in namespace Mono.Data.PostgreSql and assembly Mono.Data.PostgreSql</li>
|
||||
|
||||
<li>Is a Mono Data Provider for the <a href="http://www.postgresql.org/">PostgreSQL</a>
|
||||
client/server database management system.</li>
|
||||
|
||||
<li>Written in C# and has C# bindings to the PostgreSQL C Client library pq.dll on Windows
|
||||
and libpq.so on Linux.</li>
|
||||
</ul>
|
||||
</li>
|
||||
|
||||
<li>Bugs with Mono or the data provider should be reported
|
||||
in Mono's Bugzilla <a href="http://bugzilla.ximian.com/">here</a>. If you
|
||||
do not have Bugzilla user account, it is free
|
||||
and easy to
|
||||
create one <a href="http://bugzilla.ximian.com/createaccount.cgi">here</a>.</li>
|
||||
|
||||
|
||||
<li>See Testing for both Mono's Mono.Data.PostgreSqlClient and Npgsql.</li>
|
||||
</ul>
|
||||
|
||||
Below, see separate Testing sections for Npgsql and Mono.Data.PostgreSqlClient.
|
||||
|
||||
** Current Status
|
||||
|
||||
<ul>
|
||||
<li>Npgsql
|
||||
<ul>
|
||||
<li>Builds and Runs on both Microsoft .NET and Mono.</li>
|
||||
<li>Works using SQL# (command-line and GTK# versions)</li>
|
||||
<li>You can send insert, update, delete queries
|
||||
through NpgsqlCommand.ExecuteNonQuery() method.</li>
|
||||
<li>You can send queries like, select count(*) from table, select version()
|
||||
with NpgsqlCommand.ExecuteScalar() method.</li>
|
||||
<li>There is logging support. (Thanks Dave Page)
|
||||
To use it, place code like that in your program:</li>
|
||||
|
||||
<pre>
|
||||
// Enable logging.
|
||||
NpgsqlEventLog.Level = LogLevel.Debug; // LogLevel.
|
||||
NpgsqlEventLog.LogName = "NpgsqlTests.LogFile"; // LogFile.
|
||||
</pre>
|
||||
|
||||
<li>You can use Npgsql with Mono (Thanks Kristis Makris). It is not working perfectly.</li>
|
||||
<li>There is a winforms test suite (Thanks Dave Page).</li>
|
||||
<li>Clearer code in NpgsqlConnection removing *magic* numbers and constants. (Thanks Kristis Makris)</li>
|
||||
<li>Better support of ODBC-like ConnectionString in NpgsqlConnection (Thanks Dave Page)</li>
|
||||
<li>Thanks Ulrich Sprick for all discussion and ideas.</li>
|
||||
|
||||
</ul>
|
||||
</li>
|
||||
<li>Mono.Data.PostgreSQL status
|
||||
<ul>
|
||||
|
||||
<li>Deprecated in favor of Npgsql</li>
|
||||
|
||||
<li>We are able to do simple CREATE TABLE, DROP TABLE, UPDATE, INSERT, and
|
||||
DELETE SQL commands using the ExecuteNonQuery method in PgSqlCommand.</li>
|
||||
DELETE SQL commands using the ExecuteNonQuery method in PgSqlCommand.
|
||||
|
||||
<li>We can execute multiple queries and do a NextResult() in PgSqlDataReader()
|
||||
to get the next result set.</li>
|
||||
to get the next result set.
|
||||
|
||||
<li>We are also able to do simple aggregate functions,
|
||||
ie, count(), sum(), min(), and max()
|
||||
in a simple SELECT SQL query using the ExecuteScalar() now.</li>
|
||||
in a simple SELECT SQL query using the ExecuteScalar() now.
|
||||
|
||||
<li>We are also able to retrieve data with a simple SELECT SQL query
|
||||
using ExecuteReader() which returns a PgSqlDataReader. We are able to
|
||||
use GetSchemaTable() to get the meta data about the table columns.
|
||||
We are able to Read() to get each row from the result set.</li>
|
||||
We are able to Read() to get each row from the result set.
|
||||
|
||||
<li>We are able to get
|
||||
String data (char, character, text, varchar), Int16 (smallint),
|
||||
Int32 (integer), Int64 (bigint), DateTime (time, date, timestamp),
|
||||
Boolean (boolean), Single (float), and Double (double).
|
||||
More data types will come later. Note, the types that do work still
|
||||
need thorough testing.</li>
|
||||
need thorough testing.
|
||||
|
||||
<li>Rows that are returned which contain columns that are NULL are handled now.
|
||||
The PgSqlDataReader method IsDBNull() needs to be called to determine
|
||||
if a field IS NULL before trying to read data from that field.</li>
|
||||
if a field IS NULL before trying to read data from that field.
|
||||
|
||||
<li>Calling PostgreSQL stored procedures works. It does not work perfectly.
|
||||
It may not
|
||||
even work to specification - yet. If you want to test it yourself, look at
|
||||
TestSqlDataReader.cs or PostgresTest.cs in
|
||||
mcs/class/System.Data/Test.</li>
|
||||
mcs/class/System.Data/Test.
|
||||
|
||||
<li>Below, I have some sample code you can
|
||||
use to call a PostgreSQL stored procedure named "version". This stored
|
||||
procedure returns a string containing the PostgreSQL server version. Notice
|
||||
the CommandType is StoredProcedure and the method ExecuteScalar() is called.</li>
|
||||
the CommandType is StoredProcedure and the method ExecuteScalar() is called.
|
||||
|
||||
<li>ExecuteScalar() is a lightweight method in class PgSqlCommand that only returns
|
||||
one row and one column as one object - even if there is more than row or column.</li>
|
||||
one row and one column as one object - even if there is more than row or column.
|
||||
|
||||
<li>We have the beginnings of Parameters support PostgreSQL. Only
|
||||
Input Parameters are currently supported. Output, Input/Output,
|
||||
and Return parameters still need to be done.</li>
|
||||
and Return parameters still need to be done.
|
||||
|
||||
<li>A lot of functionality in System.Data is missing, but the
|
||||
infrastructure is starting to come together.
|
||||
|
||||
<li>A lot of Exceptions need to be thrown for various exceptions. However,
|
||||
PgSqlException, PgSqlErrorCollection, and PgSqlError have been partially
|
||||
implemented.</li>
|
||||
implemented.
|
||||
|
||||
<li>Tim Coleman and Rodrigo Moya got the beginnings of the
|
||||
PgSqlDataAdapter/DataSet/DataTable/DataRow to work. Currently,
|
||||
the PgSqlDataAdapter can Fill() relational data into a DataTable in a DataSet.
|
||||
See the test mcs/class/System.Data/Test/TestSqlDataAdapter.cs to see it in action.</li>
|
||||
|
||||
<li>Works in the SQL# command-line version
|
||||
and the GTK# version on Linux. It only works in SQL# command-line version
|
||||
on Windows.</li>
|
||||
|
||||
</ul>
|
||||
</li>
|
||||
|
||||
See the test mcs/class/System.Data/Test/TestSqlDataAdapter.cs to see it in action.
|
||||
</ul>
|
||||
|
||||
** Action Plan
|
||||
<ul>
|
||||
<li>More testing and fixing bugs</li>
|
||||
|
||||
<li>Better error handling</li>
|
||||
|
||||
<li>More Data Types to use</li>
|
||||
|
||||
<li>Any features for Npgsql should be implemented in Npgsql's main cvs repository at
|
||||
gborg.postgresql.org. Most bugs should be fixed in gborg.postgresql.org's cvs.
|
||||
Only bugs neccessary for building and running of Npgsql on Mono can be done in Mono cvs,
|
||||
but once applied they should be sent to Npgsql's mailing list
|
||||
at gborg.postgresql.org for inclusion into cvs there. Whenever there is
|
||||
a release of Npgsql (determined by Francisco Figueiredo jr. or a release
|
||||
of Mono (determined by Miguel de Icaza), then the Npgsql source
|
||||
in gborg.postgresql.org's cvs will be used to update the Npgsql source in
|
||||
Mono's cvs.
|
||||
</li>
|
||||
|
||||
<li>Mono.Data.PostgreSqlClient even though deprecated can still
|
||||
accept bug fixes. This is because other areas, such as, ASP.NET examples
|
||||
may still use this provider.</li>
|
||||
|
||||
<li>Add any missing functionality to Npgsql. If this funtionality works on
|
||||
.NET but not on Mono, implement the missing features or fix the bugs in Mono</li>
|
||||
|
||||
<li>Npgsql has replaced Mono.Data.PostgreSqlClient as the provider of
|
||||
choice to use. However, Mono.Data.PostgreSqlClient will remain in a
|
||||
deprecated state until nobody uses it anymore - then it can be removed</li>
|
||||
|
||||
<li>Implement more of PostgreSQL 7.3 features in Npgsql</li>
|
||||
</ul>
|
||||
<p>More testing and fixing bugs...
|
||||
|
||||
** Testing Mono.Data.PostgreSqlClient
|
||||
<p>Eventually replace the PostgreSQL data provider in Mono
|
||||
with <a href="http://gborg.postgresql.org/project/npgsql/projdisplay.php">Npgsql</a>.
|
||||
Npgsql is a .Net Data Provider for PostgreSQL which implements
|
||||
the <a href="http://developer.postgresql.org/docs/postgres/protocol.html">PostgreSQL Frontend/Backend Protocol</a>.
|
||||
Npgsql is implemented in 100% C#. This provider was created by Francisco Figueiredo jr.
|
||||
and has many programmers developing the provider.
|
||||
|
||||
** Testing Mono's Mono.Data.PostgreSqlClient
|
||||
|
||||
<ul>
|
||||
* <p>In order to test Mono.Data.PostgreSqlClient, you will need to have
|
||||
@@ -436,7 +352,6 @@ mono PostgresTest.exe
|
||||
"Password=fun2db;";
|
||||
IDbConnection dbcon;
|
||||
dbcon = new PgConnection(connectionString);
|
||||
dbcon.Open();
|
||||
IDbCommand dbcmd = dbcon.CreateCommand();
|
||||
// requires a table to be created named employee
|
||||
// with columns firstname and lastname
|
||||
@@ -447,7 +362,7 @@ mono PostgresTest.exe
|
||||
string sql =
|
||||
"SELECT firstname, lastname" +
|
||||
"FROM employee";
|
||||
dbcmd.CommandText = sql;
|
||||
dbcmd.ConnectionString = sql;
|
||||
IDataReader reader = dbcmd.ExecuteReader();
|
||||
while(reader.Read()) {
|
||||
string FirstName = reader["firstname"];
|
||||
@@ -519,7 +434,6 @@ mono TestExample.exe
|
||||
"User ID=postgres;" +
|
||||
"Password=fun2db;";
|
||||
IDbConnection dbcon;
|
||||
dbcon.Open();
|
||||
dbcon = new NpgsqlConnection(connectionString);
|
||||
IDbCommand dbcmd = dbcon.CreateCommand();
|
||||
// requires a table to be created named employee
|
||||
@@ -531,7 +445,7 @@ mono TestExample.exe
|
||||
string sql =
|
||||
"SELECT firstname, lastname " +
|
||||
"FROM employee";
|
||||
dbcmd.CommandText = sql;
|
||||
dbcmd.ConnectionString = sql;
|
||||
IDataReader reader = dbcmd.ExecuteReader();
|
||||
while(reader.Read()) {
|
||||
string FirstName = reader["firstname"];
|
||||
|
||||
@@ -1,156 +0,0 @@
|
||||
* Provider Factory
|
||||
|
||||
<p>Brian Ritchie contributed a Provider Factory and Data Tools for Mono ADO.NET<br>
|
||||
which gives us a foundation for abstract data provider access within Mono
|
||||
|
||||
** Here are the deails:
|
||||
|
||||
<ul>
|
||||
<li>The Provider information is seperate from the connection string information.<br>
|
||||
This allows the list of providers to be stored in the machine.config file.</li>
|
||||
<li>Provider and ProviderCollection objects are available to access <br>
|
||||
the list of providers and modify them at runtime.</li>
|
||||
<li>The ProviderFactory object is used to create new connections, commands,<br>
|
||||
dataadapters, parameters, etc.</li>
|
||||
</ul>
|
||||
|
||||
** Overview of the ProviderFactory object model:
|
||||
|
||||
<ul>
|
||||
<li><b>ProviderFactory</b>: used to create new Connections, Commands,<br>
|
||||
DataAdapters, or Commands. All objects are returned using <br>
|
||||
the provider interfaces such as IDbConnection, IDbCommand,<br>
|
||||
IDbDataAdapter, or IDataParamter</li>
|
||||
|
||||
<li><b>DataTools</b>: static methods for doing <br>
|
||||
common tasks like filling a DataSet <br>
|
||||
with the contents of a select statement.</li>
|
||||
|
||||
<li><b>ProviderCollection</b>: list of providers configured <br>
|
||||
in the system. Initially loaded from app.config, but can <br>
|
||||
be modified at run-time.</li>
|
||||
|
||||
<li><b>Provider</b>: represents a given provider (factory) <br>
|
||||
and holds information needed to <br>
|
||||
create the types.</li>
|
||||
|
||||
<li><b>ProviderSectionHandler</b>: works behind the <br>
|
||||
scenes to load the list of <br>
|
||||
providers from the app.config into a ProviderCollection.</li>
|
||||
</ul>
|
||||
|
||||
** C# source code samples for creating a connection:
|
||||
|
||||
<pre>
|
||||
// Create connection using enhanced connection string
|
||||
// The factory attribute specifies which provider
|
||||
// to use. The factory attribute is parsed out, the
|
||||
// object is created, and then the rest of the
|
||||
// connection string is passed into the provider. The
|
||||
// providers are defined in
|
||||
// the app.config (or machine.config).
|
||||
IDbConnection conn;
|
||||
string connectionString =
|
||||
"factory=System.Data.SqlClient;" +
|
||||
"server=speedy;database=pubs;uid=sa";
|
||||
conn = ProviderFactory.CreateConnection(connectionString);
|
||||
|
||||
// Create connection specifying provider
|
||||
// and standard connection string
|
||||
IDbConnection conn;
|
||||
string provider = "System.Data.SqlClient";
|
||||
string connectionString = "server=speedy;database=pubs;uid=sa";
|
||||
conn = ProviderFactory.CreateConnection(provider,connectionString);
|
||||
|
||||
// Create connection using connection string stored
|
||||
// in app.config under <appSettings>
|
||||
IDbConnection conn;
|
||||
string appSetting = "PubsConnStr";
|
||||
conn = ProviderFactory.CreateConnectionFromConfig(appSetting);
|
||||
</pre>
|
||||
|
||||
|
||||
<p>C# Sample for Creating a DataAdapter and filling a DataSet.
|
||||
|
||||
<pre>
|
||||
// Create Connection
|
||||
IDbConnection conn =
|
||||
ProviderFactory.CreateConnectionFromConfig("PubsConnStr");
|
||||
|
||||
// Select command
|
||||
IDbCommand cmd=conn.CreateCommand();
|
||||
cmd.Text="select * from author";
|
||||
|
||||
// Data Adapter
|
||||
DataSet ds=new DataSet();
|
||||
IDbDataAdapter adapter=ProviderFactory.CreateDataAdapter(cmd);
|
||||
adapter.Fill(ds, "Table1");
|
||||
</pre>
|
||||
|
||||
<p>Creating a DataAdapter and filling a DataSet. <br>
|
||||
The super lazy method for people like me.
|
||||
<pre>
|
||||
// Create Connection
|
||||
IDbConnection conn =
|
||||
ProviderFactory.CreateConnectionFromConfig("TdsPubsConnStr");
|
||||
|
||||
// Data Adapter
|
||||
DataSet ds=DataTools.FillDataSet(conn, "select * from author");
|
||||
</pre>
|
||||
|
||||
|
||||
<p>Here's some sample code on displaying a list <br>
|
||||
of configured ADO.NET providers:
|
||||
<pre>
|
||||
Console.WriteLine("Configured Providers:");
|
||||
foreach (Provider p in ProviderFactory.Providers)
|
||||
Console.WriteLine(p.Description);
|
||||
</pre>
|
||||
|
||||
<p>A Super lazy overload to the FillDataSet method (in <br>
|
||||
DataTools.cs) that will fill a dataset in one line of code.
|
||||
|
||||
<pre>
|
||||
DataSet ds=DataTools.FillDataSet("PubsConnStr", "select * from authors");
|
||||
</pre>
|
||||
|
||||
** About Configuration Files
|
||||
|
||||
<p>Information about <a href="http://msdn.microsoft.com/library/en-us/vbcon/html/vboriintroductiontoapplicationsettingstorage.asp?frame=true">app.config</a> files
|
||||
can be found at <a href="http://msdn.microsoft.com/">MSDN</a>.
|
||||
|
||||
<p>See the mcs/class/Mono.Data/app.config for sample configuration file in<br>
|
||||
mcs source. Basically, if your application is named blah.exe, <br>
|
||||
you would create an app.config file named blah.exe.config
|
||||
|
||||
<p>Here's a sample app.config file showing the provider <br>
|
||||
declarations along with sample connection strings:
|
||||
|
||||
<pre>
|
||||
|
||||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<configuration>
|
||||
<configSections>
|
||||
<sectionGroup name="mono.data">
|
||||
<section name="providers" type="Mono.Data.ProviderSectionHandler,Mono.Data" />
|
||||
</sectionGroup>
|
||||
</configSections>
|
||||
<appSettings>
|
||||
<add key="PubsConnStr" value="factory=System.Data.SqlClient;server=speedy;database=pubs;uid=sa;pwd=" />
|
||||
</appSettings>
|
||||
<mono.data>
|
||||
<providers>
|
||||
<provider name="System.Data.SqlClient" connection="System.Data.SqlClient.SqlConnection" adapter="System.Data.SqlClient.SqlDataAdapter" assembly="System.Data, Version=1.0.3300.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"/>
|
||||
<provider name="System.Data.OleDb" connection="System.Data.OleDb.OleDbConnection" adapter="System.Data.OleDb.OleDbDataAdapter" assembly="System.Data, Version=1.0.3300.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"/>
|
||||
<provider name="System.Data.Odbc" connection="System.Data.Odbc.OdbcConnection" adapter="System.Data.OleDb.OdbcDataAdapter" assembly="System.Data, Version=1.0.3300.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"/>
|
||||
<provider name="Mono.Data.TdsClient" connection="Mono.Data.TdsClient.TdsConnection" adapter="Mono.Data.TdsClient.TdsDataAdapter" assembly="Mono.Data.TdsClient" />
|
||||
<provider name="Mono.Data.MySql" connection="Mono.Data.MySql.MySqlConnection" adapter="Mono.Data.MySql.MySqlDataAdapter" assembly="Mono.Data.MySql" />
|
||||
<provider name="Mono.Data.PostgreSqlClient" connection="Mono.Data.PostgreSqlClient.PgSqlConnection" adapter="Mono.Data.PostgreSqlClient.PgSqlDataAdapter" assembly="Mono.Data.PostgreSqlClient" />
|
||||
<provider name="Mono.Data.SqliteClient" connection="Mono.Data.SqliteClient.SqliteConnection" adapter="Mono.Data.SqliteClient.SqliteDataAdapter" assembly="Mono.Data.SqliteClient" />
|
||||
<provider name="Mono.Data.SybaseClient" connection="Mono.Data.SybaseClient.SybaseConnection" adapter="Mono.Data.SybaseClient.SybaseDataAdapter" assembly="Mono.Data.SybaseClient" />
|
||||
</providers>
|
||||
</mono.data>
|
||||
</configuration>
|
||||
|
||||
</pre>
|
||||
|
||||
-141
@@ -1,141 +0,0 @@
|
||||
* Screenshots
|
||||
|
||||
** Mono Debugger
|
||||
|
||||
Some shots of the <a href="jit-debug.html">Mono Debugger</a>
|
||||
|
||||
<table border=1>
|
||||
<tr>
|
||||
<td>
|
||||
<a href="images/Screenshot-Debugger-1.png"><img src="images/Screenshot-Debugger-1-thumb.png"></a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
Debugger showing the source code view.
|
||||
</tr>
|
||||
</table>
|
||||
<table>
|
||||
<tr>
|
||||
<td>
|
||||
<a href="images/Screenshot-Debugger-2.png"><img src="images/Screenshot-Debugger-2-thumb.png"></a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
Debugger showing the CPU view.
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
** Mono Documentation Browser
|
||||
|
||||
The Mono Documentation Browser is available from <a
|
||||
href="anoncvs.html">CVS</a>, module `monodoc'.
|
||||
|
||||
<table border=1>
|
||||
<tr>
|
||||
<td>
|
||||
<a href="images/Screenshot-B2.png"><img src="images/Screenshot-B2-thumb.png"></a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
Mono Documentation Browser rendering a method description.
|
||||
</tr>
|
||||
</table>
|
||||
<table>
|
||||
<tr>
|
||||
<td>
|
||||
<a href="images/Screenshot-MethodSummary.png"><img src="images/Screenshot-MethodSummary-thumb.png"></a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
Mono Documentation Browser rendering the class method summary
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
** Mono Basic
|
||||
|
||||
The Mono Basic compiler ships with the Mono distribution.
|
||||
|
||||
<table border=1>
|
||||
<tr>
|
||||
<td>
|
||||
<a href="images/gtk-vb.png"><img src="images/gtk-vb-thumb.png"></a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
Mono Basic running a sample Gtk# application.
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
** Platano Media Player
|
||||
|
||||
Alp's <a href="http://www.atoker.com/platano/">Platano</a>
|
||||
Media Player is written with Gtk# (with GStreamer support):
|
||||
|
||||
<table border=1>
|
||||
<tr>
|
||||
<td>
|
||||
<img src="images/platano_s.png"></a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
Platano startup.
|
||||
</tr>
|
||||
</table>
|
||||
<table>
|
||||
<tr>
|
||||
<td>
|
||||
<img src="images/platano-playing_s.png">
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
Platano playing the <a
|
||||
href="http://developer.ximian.com/projects/third_party/codemonkey/index.html">Code
|
||||
Monkey At Work</a> video.
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
** GSIRC
|
||||
|
||||
Alp's <a href="http://www.atoker.com/gsirc/">GSIRC</a>
|
||||
Gtk-Sharp IRC written with Gtk#
|
||||
|
||||
<table border=1>
|
||||
<tr>
|
||||
<td>
|
||||
<a href="http://go-mono.com/images/gsirc-0.2a_overview.jpg"><img src="images/gsirc-0.2a_overview-thumb.jpg"></a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
GSIRC is shown with the preferences dialog and chatting on some channels (rooms).
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
** SQL# For GTK#
|
||||
|
||||
Daniel Morgan's SQL query tool that runs on Mono on Linux and Windows. It is
|
||||
written in C# and allows you to connect to various Mono ADO.NET providers and
|
||||
enter SQL commands.
|
||||
|
||||
<table border=1>
|
||||
<tr>
|
||||
<td>
|
||||
<img src="http://go-mono.com/images/sqlsharp.png"></a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
SQL# For GTK# is shown retrieving data from a Microsoft SQL Server 2000 database.
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
** SkyNET
|
||||
|
||||
SkyNET is written in C# and uses GTK# for displaying a star chart.
|
||||
|
||||
<table border=1>
|
||||
<tr>
|
||||
<td>
|
||||
<img src="http://go-mono.com/images/skynet.png"></a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
+7
-74
@@ -18,12 +18,7 @@
|
||||
|
||||
<li>Uses TDS Protocol Version 7.0</li>
|
||||
|
||||
<li>Bugs with Mono or the data provider should be reported
|
||||
in Mono's Bugzilla <a href="http://bugzilla.ximian.com/">here</a>. If you
|
||||
do not have Bugzilla user account, it is free
|
||||
and easy to
|
||||
create one <a href="http://bugzilla.ximian.com/createaccount.cgi">here</a>.</li>
|
||||
|
||||
<li>Does not support trusted connections</li>
|
||||
</ul>
|
||||
|
||||
|
||||
@@ -60,20 +55,14 @@
|
||||
<li>Uses TDS Protocol Version 7.0</li>
|
||||
|
||||
<li><a href="http://www.go-mono.com/tds-providers.html">Design of the Microsoft SQL Server, Sybase, and TDS Providers in Mono</a></li>
|
||||
|
||||
<li>Works in the SQL# command-line and GTK# GUI version</li>
|
||||
</ul>
|
||||
|
||||
** Action plan
|
||||
|
||||
<ul>
|
||||
<li>Connection timeouts is being developed now</li>
|
||||
|
||||
<li>Needs more testing</li>
|
||||
|
||||
<li>Would like to figure out how to connect via Trusted_Connection or Integrated Security</li>
|
||||
|
||||
<li>Start work on TDS Protocol Version 8.0 support</li>
|
||||
<li>Connection timeouts is being developed now.
|
||||
|
||||
<li>Needs more testing...
|
||||
|
||||
</ul>
|
||||
|
||||
@@ -89,64 +78,9 @@
|
||||
</ul>
|
||||
</li>
|
||||
|
||||
<li>If using Microsoft SQL Server 2000, make sure
|
||||
you are using at least Service Pack 3 for Microsoft SQL Server 2000. If using
|
||||
MSDE 2000, make sure you have the special Service Pack 3 for MSDE 2000.</li>
|
||||
|
||||
<li>For those that only have MSDE installed. You can change the authentication mode
|
||||
from Windows Only Authentication to SQL Server and Windows Authentications (also knows as Mixed-mode authentication)
|
||||
via the <a href="http://support.microsoft.com/default.aspx?scid=kb;en-us;Q322336&sd=tech#4">registry</a></li>. It is
|
||||
the LoginMode you need to change. By default,
|
||||
MSDE is installed with Windows Only Authentication. For SqlClient to work with MSDE, you will
|
||||
need to change the setting.</a>
|
||||
|
||||
<li>If using MSDE, you might need to create a new user with password. Give
|
||||
this user access to various databases in this MSDE instance. Also, for each
|
||||
database, give this new user at least SELECT access to the various tables you want
|
||||
to retrieve data from.</li>
|
||||
|
||||
<li>If you have Enterprise Manager, you can easily change the authentication mode
|
||||
for both MSDE and Microsoft SQL Server. To change the authentication mode in
|
||||
Enterprise Mananger, select the instance, right-click on it, and select properites.
|
||||
The SQL Server properties dialog for that instance will pop up. Choose the Security
|
||||
tab. Change the authentication from Windows Only to SQL Server and Windows. If
|
||||
the instance of your database does not show up in Enterprise Manager, Register first
|
||||
by selecting the Action menu and choosing New SQL Server Registration.</li>
|
||||
|
||||
<li>Located at mcs/class/System.Data/Test is a test for System.Data.SqlClient
|
||||
named SqlTest.cs and you could use this as a basis for your test.</li>
|
||||
|
||||
<li>Mono's SqlClient does not support trusted connections
|
||||
nor integrated security. You can not use this when connecting. You need
|
||||
to explicitly use a User ID and Password
|
||||
authenticated by SQL Server.</li>
|
||||
|
||||
<li>Has a connection string format:
|
||||
<pre>
|
||||
Server=hostname;Database=databaseName;User ID=userid;Password=password
|
||||
</pre>
|
||||
</li>
|
||||
<li>The Server part can be used three ways:
|
||||
|
||||
<table border=1>
|
||||
<tr>
|
||||
<td><b>Server Definition</b></td> <td><b>Example</b></td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>hostname</td> <td>Server=MYHOST</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>hostname,port</td> <td>Server=MYHOST,1433</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>hostname\\instance</td> <td>Server=MYHOST\\NETSDK</td>
|
||||
</tr>
|
||||
</table>
|
||||
</li>
|
||||
|
||||
<li>C# Example:
|
||||
<pre>
|
||||
using System;
|
||||
@@ -160,16 +94,15 @@
|
||||
string connectionString =
|
||||
"Server=localhost;" +
|
||||
"Database=pubs;" +
|
||||
"User ID=myuserid;" +
|
||||
"Password=mypassword;";
|
||||
"User ID=sa;" +
|
||||
"Password=;";
|
||||
IDbConnection dbcon;
|
||||
dbcon = new SqlConnection(connectionString);
|
||||
dbcon.Open();
|
||||
IDbCommand dbcmd = dbcon.CreateCommand();
|
||||
string sql =
|
||||
"SELECT fname, lname " +
|
||||
"FROM employee";
|
||||
dbcmd.CommandText = sql;
|
||||
dbcmd.ConnectionString = sql;
|
||||
IDataReader reader = dbcmd.ExecuteReader();
|
||||
while(reader.Read()) {
|
||||
string FirstName = reader["fname"];
|
||||
|
||||
+6
-37
@@ -1,38 +1,13 @@
|
||||
* SQL Lite Data Provider
|
||||
|
||||
<ul>
|
||||
<li>ADO.NET Data Provider for
|
||||
the <a href"http://www.hwaci.com/sw/sqlite/">SQL Lite</a> which
|
||||
is an embeddable SQL database engine</li>
|
||||
|
||||
<li>From the SQL Lite web page: SQLite is a C library that
|
||||
implements an embeddable SQL database engine. Programs that link with
|
||||
the SQLite library can have SQL database access without
|
||||
running a separate RDBMS process. The distribution
|
||||
comes with a standalone command-line access program (sqlite) that
|
||||
can be used to administer an SQLite database and which serves
|
||||
as an example of how to use the SQLite library. SQLite is not a client library
|
||||
used to connect to a big database server. SQLite is the server. The SQLite
|
||||
library reads and writes directly to and from the database files on disk.</li>
|
||||
|
||||
<li>SQL Lite can be downloaded
|
||||
from <a href"http://www.hwaci.com/sw/sqlite/download.html">here</a>.
|
||||
binaries exist for Linux and Windows. sqlite.dll on Windows
|
||||
and sqlite.so on Linux. The source code is available too.</li>
|
||||
|
||||
<li>Exists in namespace and assembly Mono.Data.SqliteClient</li>
|
||||
|
||||
<li>Created by Vladimir Vukicevic so he could have a database of
|
||||
thumbnail images for mPhoto. mPhoto is GUI application
|
||||
for cataloging images. mPhoto runs on Mono
|
||||
and uses <a href="http:www.go-mono.com/gtk-sharp.html">GTK#</a> for its GUI.</li>
|
||||
|
||||
<li>Bugs with Mono or the data provider should be reported
|
||||
in Mono's Bugzilla <a href="http://bugzilla.ximian.com/">here</a>. If you
|
||||
do not have Bugzilla user account, it is free
|
||||
and easy to
|
||||
create one <a href="http://bugzilla.ximian.com/createaccount.cgi">here</a>.</li>
|
||||
|
||||
<li>Created by Vladimir Vukicevic</li>
|
||||
|
||||
<li><a href"http://www.hwaci.com/sw/sqlite/download.html">SQL Lite</a>
|
||||
binaries exist for Linux and Windows. sqlite.dll on Windows
|
||||
and sqlite.so on Linux.</li>
|
||||
</ul>
|
||||
|
||||
** Current Status
|
||||
@@ -57,19 +32,14 @@
|
||||
|
||||
<ul>
|
||||
<li>Have a working mcs and mono</li>
|
||||
|
||||
<li>Make sure Mono.Data.SqliteClient.dll was built and is installed
|
||||
in the same place as the mono class libraries.</li>
|
||||
|
||||
<li>If you do not have <a href"http://www.hwaci.com/sw/sqlite/download.html">SQL Lite</a>,
|
||||
download it. There are binaries for Windows and Linux.</li>
|
||||
|
||||
<li>There is a test named SqliteTest.cs found at mcs/class/Mono.Data.SqliteTest/Test</li>
|
||||
|
||||
<li>Has a connection string format of "URI=file:some/path". For example,
|
||||
the connection string "URI=file:SqliteTest.db" will use the database file
|
||||
named SqliteTest.db, if it does not exist, the file will be created.</li>
|
||||
|
||||
<li>C# Example:
|
||||
<pre>
|
||||
using System;
|
||||
@@ -83,7 +53,6 @@
|
||||
string connectionString = "URI=file:SqliteTest.db";
|
||||
IDbConnection dbcon;
|
||||
dbcon = new MySQLConnection(connectionString);
|
||||
dbcon.Open();
|
||||
IDbCommand dbcmd = dbcon.CreateCommand();
|
||||
// requires a table to be created named employee
|
||||
// with columns firstname and lastname
|
||||
@@ -94,7 +63,7 @@
|
||||
string sql =
|
||||
"SELECT firstname, lastname " +
|
||||
"FROM employee";
|
||||
dbcmd.CommandText = sql;
|
||||
dbcmd.ConnectionString = sql;
|
||||
IDataReader reader = dbcmd.ExecuteReader();
|
||||
while(reader.Read()) {
|
||||
string FirstName = reader[0];
|
||||
|
||||
+3
-24
@@ -19,14 +19,6 @@
|
||||
<li>Uses TDS Protocol Version 5.0</li>
|
||||
|
||||
<li>Does not support trusted connections</li>
|
||||
|
||||
<li>Bugs with Mono or the data provider should be reported
|
||||
in Mono's Bugzilla <a href="http://bugzilla.ximian.com/">here</a>. If you
|
||||
do not have Bugzilla user account, it is free
|
||||
and easy to
|
||||
create one <a href="http://bugzilla.ximian.com/createaccount.cgi">here</a>.</li>
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
** Current Status
|
||||
@@ -73,18 +65,6 @@
|
||||
<li>Located at mcs/class/System.Data/Test is a test for System.Data.SqlClient
|
||||
named SqlTest.cs and you could use this as a basis for your test.</li>
|
||||
|
||||
<li>Has a connection string format:
|
||||
<pre>
|
||||
Server=hostname;Database=databaseName;User ID=userid;Password=password
|
||||
</pre>
|
||||
</li>
|
||||
<li>The Server part can be used two ways:
|
||||
<ul>
|
||||
<li>hostname - "Server=MYHOST"</li>
|
||||
<li>hostname,port - "Server=MYHOST,1533"</li>
|
||||
</ul>
|
||||
</li>
|
||||
|
||||
<li>C# Example:
|
||||
<pre>
|
||||
using System;
|
||||
@@ -98,16 +78,15 @@
|
||||
string connectionString =
|
||||
"Server=localhost;" +
|
||||
"Database=pubs;" +
|
||||
"User ID=myuserid;" +
|
||||
"Password=mypassword;";
|
||||
"User ID=sa;" +
|
||||
"Password=;";
|
||||
IDbConnection dbcon;
|
||||
dbcon = new SybaseConnection(connectionString);
|
||||
dbcon.Open();
|
||||
IDbCommand dbcmd = dbcon.CreateCommand();
|
||||
string sql =
|
||||
"SELECT fname, lname " +
|
||||
"FROM employee";
|
||||
dbcmd.CommandText = sql;
|
||||
dbcmd.ConnectionString = sql;
|
||||
IDataReader reader = dbcmd.ExecuteReader();
|
||||
while(reader.Read()) {
|
||||
string FirstName = reader["fname"];
|
||||
|
||||
+3
-25
@@ -19,13 +19,6 @@
|
||||
<li>Uses TDS Protocol Version 4.2 by default</li>
|
||||
|
||||
<li>Does not support trusted connections</li>
|
||||
|
||||
<li>Bugs with Mono or the data provider should be reported
|
||||
in Mono's Bugzilla <a href="http://bugzilla.ximian.com/">here</a>. If you
|
||||
do not have Bugzilla user account, it is free
|
||||
and easy to
|
||||
create one <a href="http://bugzilla.ximian.com/createaccount.cgi">here</a>.</li>
|
||||
|
||||
</ul>
|
||||
|
||||
** Current Status
|
||||
@@ -72,24 +65,10 @@
|
||||
<li><a href="http://www.sybase.com/downloads">Sybase</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li>If using Microsoft SQL Server 2000, make sure
|
||||
you are using at least Service Pack 3 for Microsoft SQL Server 2000</li>
|
||||
|
||||
<li>Located at mcs/class/System.Data/Test is a test for System.Data.SqlClient
|
||||
named SqlTest.cs and you could use this as a basis for your test.</li>
|
||||
|
||||
<li>Has a connection string format:
|
||||
<pre>
|
||||
Server=hostname;Database=databaseName;User ID=userid;Password=password
|
||||
</pre>
|
||||
</li>
|
||||
<li>The Server part can be used two ways:
|
||||
<ul>
|
||||
<li>hostname - "Server=MYHOST"</li>
|
||||
<li>hostname,port - "Server=MYHOST,1533"</li>
|
||||
</ul>
|
||||
</li>
|
||||
|
||||
<li>C# Example:
|
||||
<pre>
|
||||
using System;
|
||||
@@ -103,16 +82,15 @@
|
||||
string connectionString =
|
||||
"Server=localhost;" +
|
||||
"Database=pubs;" +
|
||||
"User ID=myuserid;" +
|
||||
"Password=mypassword;";
|
||||
"User ID=sa;" +
|
||||
"Password=;";
|
||||
IDbConnection dbcon;
|
||||
dbcon = new TdsConnection(connectionString);
|
||||
dbcon.Open();
|
||||
IDbCommand dbcmd = dbcon.CreateCommand();
|
||||
string sql =
|
||||
"SELECT fname, lname " +
|
||||
"FROM employee";
|
||||
dbcmd.CommandText = sql;
|
||||
dbcmd.ConnectionString = sql;
|
||||
IDataReader reader = dbcmd.ExecuteReader();
|
||||
while(reader.Read()) {
|
||||
string FirstName = reader["fname"];
|
||||
|
||||
@@ -1,8 +1,5 @@
|
||||
0,Home,index.html,index.src
|
||||
1,FAQ,faq.html,faq.src
|
||||
1,News archive,http://monoevo.sf.net/mwn/archives.html
|
||||
1,Screenshots,screenshots.html,screenshots.src
|
||||
1,Other sites,other.html,other.src
|
||||
0,Mono,rationale.html,rationale.src
|
||||
1,Runtime,runtime.html,runtime.src
|
||||
2,Embedding,embedded-api.html,embedded-api.src
|
||||
@@ -36,7 +33,6 @@
|
||||
1,Debugging,jit-debug.html,jit-debug.src
|
||||
0,Plans,plans.html,plans.src
|
||||
1,ADO.NET,ado-net.html,ado-net.src
|
||||
2,ProviderFactory,provider-factory.html,provider-factory.src
|
||||
2,Firebird Interbase,firebird.html,firebird.src
|
||||
2,IBM DB2,ibmdb2.html,ibmdb2.src
|
||||
2,Microsft SQL Server,sqlclient.html,sqlclient.src
|
||||
@@ -64,5 +60,4 @@
|
||||
1,EnterpriseServices,class-status-System.EnterpriseServices.html,class-status-System.EnterpriseServices.src,cm/cormissing.css,cm/cormissing.js
|
||||
1,Formatters.Soap,class-status-System.Runtime.Serialization.Formatters.Soap.html,class-status-System.Runtime.Serialization.Formatters.Soap.src,cm/cormissing.css,cm/cormissing.js
|
||||
1,Cscompmgd,class-status-Cscompmgd.html,class-status-Cscompmgd.src,cm/cormissing.css,cm/cormissing.js
|
||||
1,System.Security,class-status-System.Security.html,class-status-System.Security.src,cm/cormissing.css,cm/cormissing.js
|
||||
0,Contact,contact.html,contact.src
|
||||
+38
-42
@@ -5,7 +5,8 @@ CORCOMPARE=../../../mcs/tools/corcompare
|
||||
|
||||
OBJECTS= \
|
||||
deploy/ado-net.html \
|
||||
deploy/provider-factory.html \
|
||||
deploy/firebird.html \
|
||||
deploy/ibmdb2.html \
|
||||
deploy/mysql.html \
|
||||
deploy/odbc.html \
|
||||
deploy/oledb.html \
|
||||
@@ -19,44 +20,6 @@ OBJECTS= \
|
||||
deploy/asp-net.html \
|
||||
deploy/books.html \
|
||||
deploy/contributing.html \
|
||||
deploy/contact.html \
|
||||
deploy/c-sharp.html \
|
||||
deploy/ccvs.html \
|
||||
deploy/documentation.html \
|
||||
deploy/download.html \
|
||||
deploy/crypto.html \
|
||||
deploy/embedded-api.html \
|
||||
deploy/faq.html \
|
||||
deploy/firebird.html \
|
||||
deploy/gcc-frontend.html \
|
||||
deploy/gtk-sharp.html \
|
||||
deploy/hackers.html \
|
||||
deploy/ideas.html \
|
||||
deploy/ibmdb2.html \
|
||||
deploy/index.html \
|
||||
deploy/java.html \
|
||||
deploy/jit-debug.html \
|
||||
deploy/languages.html \
|
||||
deploy/mailing-lists.html \
|
||||
deploy/mbas.html \
|
||||
deploy/mono-beginning.html \
|
||||
deploy/mono-contribution-howto.html \
|
||||
deploy/monodoc-xml.html \
|
||||
deploy/other.html \
|
||||
deploy/papers.html \
|
||||
deploy/passport.html \
|
||||
deploy/plans.html \
|
||||
deploy/porting.html \
|
||||
deploy/ppc.html \
|
||||
deploy/rationale.html \
|
||||
deploy/resources.html \
|
||||
deploy/roadmap.html \
|
||||
deploy/runtime.html \
|
||||
deploy/screenshots.html \
|
||||
deploy/status.html \
|
||||
deploy/testing.html \
|
||||
deploy/tools.html \
|
||||
deploy/winforms.html \
|
||||
deploy/class-status.html \
|
||||
deploy/class-status-corlib.html \
|
||||
deploy/class-status-System.html \
|
||||
@@ -68,12 +31,45 @@ OBJECTS= \
|
||||
deploy/class-status-Microsoft.VisualBasic.html \
|
||||
deploy/class-status-System.EnterpriseServices.html \
|
||||
deploy/class-status-System.Runtime.Serialization.Formatters.Soap.html \
|
||||
deploy/class-status-System.Security.html \
|
||||
deploy/class-status-System.Windows.Forms.html \
|
||||
deploy/class-status-Cscompmgd.html \
|
||||
deploy/class-library.html \
|
||||
deploy/classlib-doc.html
|
||||
|
||||
deploy/classlib-doc.html \
|
||||
deploy/contact.html \
|
||||
deploy/c-sharp.html \
|
||||
deploy/mbas.html \
|
||||
deploy/ccvs.html \
|
||||
deploy/documentation.html \
|
||||
deploy/download.html \
|
||||
deploy/crypto.html \
|
||||
deploy/embedded-api.html \
|
||||
deploy/faq.html \
|
||||
deploy/gcc-frontend.html \
|
||||
deploy/hackers.html \
|
||||
deploy/index.html \
|
||||
deploy/ideas.html \
|
||||
deploy/java.html \
|
||||
deploy/jit-debug.html \
|
||||
deploy/jit-debug-sample.html \
|
||||
deploy/jit-debug-sample2.html \
|
||||
deploy/languages.html \
|
||||
deploy/mailing-lists.html \
|
||||
deploy/mono-beginning.html \
|
||||
deploy/mono-contribution-howto.html \
|
||||
deploy/monodoc-xml.html \
|
||||
deploy/papers.html \
|
||||
deploy/passport.html \
|
||||
deploy/plans.html \
|
||||
deploy/porting.html \
|
||||
deploy/ppc.html \
|
||||
deploy/rationale.html \
|
||||
deploy/resources.html \
|
||||
deploy/roadmap.html \
|
||||
deploy/runtime.html \
|
||||
deploy/status.html \
|
||||
deploy/testing.html \
|
||||
deploy/tools.html \
|
||||
deploy/winforms.html
|
||||
#2,Configuration.Install,class-status-System.Configuration.Install.html,class-status-System.Configuration.Install.src,cm/cormissing.css,cm/cormissing.js
|
||||
#2,Runtime.Remoting,class-status-System.Runtime.Remoting.html,class-status-System.Runtime.Remoting.src,cm/cormissing.css,cm/cormissing.js
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
<!--
|
||||
body { font-family: "trebuchet ms", lucida, verdana, helvetica;
|
||||
|
||||
}
|
||||
background-attachment: fixed; }
|
||||
body, td, table { font-family: "trebuchet ms", lucida, verdana, helvetica;
|
||||
font-size: 14px; }
|
||||
|
||||
|
||||
@@ -225,15 +225,6 @@
|
||||
It may not be possible to manage exceptions in that case,
|
||||
though. I need to think more about it.
|
||||
|
||||
** Threading issues
|
||||
|
||||
If your application creates threads on its own, and you want them to
|
||||
be able to call code into the CIL universe with Mono, you have to
|
||||
register the thread with Mono before issuing the call.
|
||||
|
||||
To do so, call the mono_thread_attach() function before you execute
|
||||
any managed code from the thread
|
||||
|
||||
* Samples
|
||||
|
||||
See the sample programs inmono/sample/embed for examples of
|
||||
|
||||
@@ -1,42 +0,0 @@
|
||||
.\"
|
||||
.\" cert2spc manual page.
|
||||
.\" Copyright 2002, 2003 Motus Technologies
|
||||
.\" Author:
|
||||
.\" Sebastien Pouliot ([email protected])
|
||||
.\"
|
||||
.TH Mono "cert2spc"
|
||||
.SH NAME
|
||||
cert2spc \- Transform multiple X.509 certificates to a Software
|
||||
Publisher Certificate
|
||||
.SH SYNOPSIS
|
||||
.PP
|
||||
.B cert2spc certificate|crl [certificate|crl ...] outputfile.spc
|
||||
.SH DESCRIPTION
|
||||
Combine a list of X.509 certificates or X.509 CRL (Certificate
|
||||
Revocation List) into a Software Publisher Certificate (PKCS#7
|
||||
file). The SPC file is required for signing a PE file (like an
|
||||
assembly) using signcode.
|
||||
.SH PARAMETERS
|
||||
.TP
|
||||
.I "certificate"
|
||||
One (or more) X.509 certificate to add (space separated).
|
||||
.TP
|
||||
.I "crl"
|
||||
One (or more) X.509 CRL to add (space separated).
|
||||
.TP
|
||||
.I "output.spc"
|
||||
Software Publisher Certificate to output. If the specified file
|
||||
exists it will be overwritten.
|
||||
.SH AUTHOR
|
||||
Written by Sebastien Pouliot
|
||||
.SH COPYRIGHT
|
||||
Copyright (C) 2002, 2003 Motus Technologies.
|
||||
Released under BSD license.
|
||||
.SH MAILING LISTS
|
||||
Visit http://mail.ximian.com/mailman/mono-list for details.
|
||||
.SH WEB SITE
|
||||
Visit: http://www.go-mono.com for details
|
||||
.SH SEE ALSO
|
||||
.BR makecert(1), signcode(1)
|
||||
|
||||
|
||||
@@ -1,45 +0,0 @@
|
||||
.\"
|
||||
.\" secutil manual page.
|
||||
.\" Copyright 2002, 2003 Motus Technologies
|
||||
.\" Author:
|
||||
.\" Sebastien Pouliot ([email protected])
|
||||
.\"
|
||||
.TH Mono "secutil"
|
||||
.SH NAME
|
||||
secutil \- Extract X.509 certificates and strongnames from assemblies.
|
||||
.SH SYNOPSIS
|
||||
.PP
|
||||
.B secutil [options] filename
|
||||
.SH DESCRIPTION
|
||||
Extract X.509 certificates and strongnames from assemblies in a
|
||||
format that can be easily re-used in source code (C# or VB.NET syntax).
|
||||
.SH OPTIONS
|
||||
.TP
|
||||
.I "-s assembly", "-strongname assembly"
|
||||
Display strongname informations about the assembly.
|
||||
.TP
|
||||
.I "-x assembly", "-x509certificate assembly"
|
||||
Display the X509 Authenticode certificate for the assembly.
|
||||
.TP
|
||||
.I "-a", "-array"
|
||||
Display data in a decimal array (default).
|
||||
.TP
|
||||
.I "-v", "-vbmode"
|
||||
Display data in a VisualBasic friendly format.
|
||||
.TP
|
||||
.I "-c", "-cmode"
|
||||
Display data in a C/C++/C# friendly format (default).
|
||||
.TP
|
||||
.I "-help", "-h", "-?"
|
||||
Display help about this tool.
|
||||
.SH AUTHOR
|
||||
Written by Sebastien Pouliot
|
||||
.SH COPYRIGHT
|
||||
Copyright (C) 2002, 2003 Motus Technologies.
|
||||
Released under BSD license.
|
||||
.SH MAILING LISTS
|
||||
Visit http://mail.ximian.com/mailman/mono-list for details.
|
||||
.SH WEB SITE
|
||||
Visit: http://www.go-mono.com for details
|
||||
.SH SEE ALSO
|
||||
.BR sn(1), signcode(1)
|
||||
+5
-29
@@ -352,19 +352,17 @@ SqlClient MS SQL 7/2000 System.Data.SqlClient System.Data
|
||||
Odbc ODBC System.Data.Odbc System.Data
|
||||
|
||||
External to System.Data
|
||||
-----------------------
|
||||
----------------------
|
||||
MySql MySQL Mono.Data.MySql Mono.Data.MySql
|
||||
Sqlite SQL Lite Mono.Data.SqliteClient Mono.Data.SqliteClient
|
||||
Sybase Sybase Mono.Data.SybaseClient Mono.Data.SybaseClient
|
||||
Tds TDS Generic Mono.Data.TdsClient Mono.Data.TdsClient
|
||||
PostgreSql M PostgreSQL Mono.Data.PostgreSqlClient Mono.Data.PostgreSqlClient
|
||||
DB2 IBM DB2 Mono.Data.DB2Client Mono.Data.DB2Client
|
||||
Oracle Oracle 8i System.Data.OracleClient System.Data.OracleClient
|
||||
PostgreSql MonoPostgreSQL Mono.Data.PostgreSqlClient Mono.Data.PostgreSqlClient
|
||||
|
||||
External to Mono
|
||||
----------------
|
||||
|
||||
Npgsql NetPostgreSQL Npgsql Npgsql
|
||||
Npgsql PostgreSQL.NET Npgsql Npgsql
|
||||
MySQLNet ByteFX MySQL ByteFX.Data.MySQL ByteFX.Data
|
||||
|
||||
.fi
|
||||
@@ -421,32 +419,10 @@ which connects to a PostgreSQL database:
|
||||
|
||||
Provider=PostgreSQL;Addr=127.0.0.1;Database=rodrigo
|
||||
|
||||
|
||||
Oracle via System.Data.OracleClient
|
||||
|
||||
Data Source=testdb;User ID=scott;Password=tiger
|
||||
|
||||
|
||||
IBM DB2 Universal Database via Mono.Data.DB2Client
|
||||
|
||||
DSN=sample;User ID=db2admin;Password=mysecret
|
||||
|
||||
|
||||
Npgsql (.NET PostgreSQL) from
|
||||
http://gborg.postgresql.org/project/npgsql/projdisplay.php
|
||||
|
||||
Server=localhost;Database=test;User ID=postgres;Password=fun2db
|
||||
|
||||
|
||||
MySQLNet (ByteFX MySQL) from
|
||||
http://sourceforge.net/projects/mysqlnet/
|
||||
|
||||
Server=localhost;Database=test;User ID=mysql;Password=
|
||||
|
||||
|
||||
.fi
|
||||
.SH TRACING SUPPORT
|
||||
No support for tracing right now.
|
||||
.SH DEBUGGING SUPPORT
|
||||
No debugging support.
|
||||
.SH AUTHORS
|
||||
The Mono SQL# Tool was written
|
||||
.nf
|
||||
|
||||
@@ -1,15 +1,3 @@
|
||||
2003-02-16 Martin Baulig <[email protected]>
|
||||
|
||||
* docs/compiler: Added a few works about the new `Location' code.
|
||||
|
||||
2003-02-15 Nick Drochak <[email protected]>
|
||||
|
||||
* makefile.gnu: Add testcorlib target to run just the corlib unit tests.
|
||||
|
||||
2003-02-10 Nick Drochak <[email protected]>
|
||||
|
||||
* makefile: Add testcorlib target to run just the corlib unit tests.
|
||||
|
||||
2003-01-16 Nick Drochak <[email protected]>
|
||||
|
||||
* makefile.gnu: Add corlib target to just build that.
|
||||
|
||||
@@ -1,30 +1,3 @@
|
||||
2003-02-22 Martin Baulig <[email protected]>
|
||||
|
||||
* library.make: Pass `MCS_FLAGS' to MCS.
|
||||
|
||||
2003-02-15 Zoltan Varga <[email protected]>
|
||||
|
||||
* makefile.gnu (test): do not install .dbg files since mcs no longer
|
||||
generates them.
|
||||
|
||||
2003-02-13 Tim Coleman <[email protected]>
|
||||
* makefile.gnu: Add System.Data.OracleClient to linux build.
|
||||
|
||||
2003-02-10 Nick Drochak <[email protected]>
|
||||
|
||||
* library.build:
|
||||
* makefile: add testcorlib target to run unit tests just for corlib.
|
||||
|
||||
2003-02-05 Sebastien Pouliot <[email protected]>
|
||||
|
||||
* library.build: added Mono.Security.Win32 to build, test and
|
||||
clean. There's no makefile.gnu for this assembly as it is
|
||||
specific to Win32.
|
||||
|
||||
2003-01-23 Nick Drochak <[email protected]>
|
||||
|
||||
* makefile: install the .dbg files too so the debugger can use them.
|
||||
|
||||
2003-01-17 Sebastien Pouliot <[email protected]>
|
||||
|
||||
* library.build: added System.Security to build, test and clean.
|
||||
|
||||
@@ -1,7 +1,3 @@
|
||||
2003-02-23 Jackson Harper <[email protected]>
|
||||
|
||||
* CompilerError.cs: Use fields not properties, and remove unneeded finalizer
|
||||
|
||||
2002-12-15 Jackson Harper <[email protected]>
|
||||
|
||||
* CompilerError.cs ErrorLevel.cs: Moved ErrorLevel enum into its own file
|
||||
|
||||
@@ -13,23 +13,64 @@ namespace Microsoft.CSharp {
|
||||
|
||||
public class CompilerError {
|
||||
|
||||
public ErrorLevel ErrorLevel;
|
||||
public string ErrorMessage;
|
||||
public string SourceFile;
|
||||
public int ErrorNumber;
|
||||
public int SourceColumn;
|
||||
public int SourceLine;
|
||||
private ErrorLevel level = ErrorLevel.None;
|
||||
private string message = null;
|
||||
private string file = null;
|
||||
private int number = 0;
|
||||
private int column = 0;
|
||||
private int line = 0;
|
||||
|
||||
public CompilerError ()
|
||||
public CompilerError()
|
||||
{
|
||||
ErrorLevel = ErrorLevel.None;
|
||||
ErrorMessage = String.Empty;
|
||||
SourceFile = String.Empty;
|
||||
ErrorNumber = 0;
|
||||
SourceColumn = 0;
|
||||
SourceLine = 0;
|
||||
}
|
||||
|
||||
~CompilerError()
|
||||
{
|
||||
message = null;
|
||||
file = null;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// Public Properties
|
||||
//
|
||||
|
||||
public ErrorLevel ErrorLevel {
|
||||
get { return level; }
|
||||
set { level = value; }
|
||||
}
|
||||
|
||||
public string ErrorMessage {
|
||||
get {
|
||||
return (null == message ? String.Empty : message);
|
||||
}
|
||||
set {
|
||||
message = value;
|
||||
}
|
||||
}
|
||||
|
||||
public int ErrorNumber {
|
||||
get { return number; }
|
||||
set { number = value; }
|
||||
}
|
||||
|
||||
public int SourceColumn {
|
||||
get { return column; }
|
||||
set { column = value; }
|
||||
}
|
||||
|
||||
public string SourceFile {
|
||||
get {
|
||||
return (null == file ? String.Empty : file);
|
||||
}
|
||||
set { file = value; }
|
||||
}
|
||||
|
||||
public int SourceLine {
|
||||
get { return line; }
|
||||
set { line = value; }
|
||||
}
|
||||
|
||||
//
|
||||
// Public Methods
|
||||
//
|
||||
@@ -51,7 +92,6 @@ namespace Microsoft.CSharp {
|
||||
return builder.ToString ();
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// Private Properties
|
||||
//
|
||||
|
||||
File diff suppressed because it is too large.
Load diff
@@ -1,3 +0,0 @@
|
||||
2002-02-19 Carsten Hess
|
||||
* Created
|
||||
|
||||
@@ -1,40 +0,0 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
|
||||
<!-- NAnt build file for Microsoft.VisualC.dll -->
|
||||
|
||||
<project name="System" default="build">
|
||||
<property name="debug" value="false"/>
|
||||
|
||||
<target name="build">
|
||||
<mkdir dir="../lib"/>
|
||||
<csc target="library" output="../lib/Microsoft.VisualC.dll" debug="${debug}">
|
||||
<arg value="/nowarn:1595"/>
|
||||
<arg value="/noconfig"/> <!-- don't reference ms assemblies -->
|
||||
|
||||
<!-- cor compare dies with these currently -->
|
||||
<!--<arg value="/nostdlib"/>--> <!-- don't reference mscorlib -->
|
||||
<!--<arg value="/lib:../lib/"/>-->
|
||||
<!--<arg value="/r:..\lib\corlib.dll"/>-->
|
||||
<!--<arg value="/r:..\lib\System.dll"/>-->
|
||||
<arg value="/r:System.dll"/>
|
||||
<sources>
|
||||
<includes name="**/*.cs"/>
|
||||
<excludes name="Test/**"/>
|
||||
</sources>
|
||||
<references>
|
||||
<!--<includes name="../lib/corlib.dll"/>-->
|
||||
<!--<includes name="../lib/System.dll"/>-->
|
||||
</references>
|
||||
</csc>
|
||||
<copy file="../lib/Microsoft.VisualC.dll" tofile="Test/Microsoft.VisualC.dll"/>
|
||||
</target>
|
||||
|
||||
<target name="test" depends="build">
|
||||
<nant basedir="Test" target="test"/>
|
||||
</target>
|
||||
|
||||
<target name="clean">
|
||||
<nant basedir="Test" target="clean"/>
|
||||
<delete file="../lib/Microsoft.VisualC.dll" failonerror="false"/>
|
||||
</target>
|
||||
</project>
|
||||
@@ -1,8 +0,0 @@
|
||||
using System;
|
||||
|
||||
namespace Microsoft.VisualC
|
||||
{
|
||||
public sealed class DebugInfoInPDBAttribute:System.Attribute
|
||||
{
|
||||
}
|
||||
}
|
||||
@@ -1,8 +0,0 @@
|
||||
using System;
|
||||
|
||||
namespace Microsoft.VisualC
|
||||
{
|
||||
public sealed class DecoratedNameAttribute:System.Attribute
|
||||
{
|
||||
}
|
||||
}
|
||||
@@ -1,8 +0,0 @@
|
||||
using System;
|
||||
|
||||
namespace Microsoft.VisualC
|
||||
{
|
||||
public sealed class IsCXXReferenceModifier:System.Attribute
|
||||
{
|
||||
}
|
||||
}
|
||||
@@ -1,8 +0,0 @@
|
||||
using System;
|
||||
|
||||
namespace Microsoft.VisualC
|
||||
{
|
||||
public sealed class IsConstModifier:System.Attribute
|
||||
{
|
||||
}
|
||||
}
|
||||
@@ -1,8 +0,0 @@
|
||||
using System;
|
||||
|
||||
namespace Microsoft.VisualC
|
||||
{
|
||||
public sealed class IsLongModifier:System.Attribute
|
||||
{
|
||||
}
|
||||
}
|
||||
@@ -1,8 +0,0 @@
|
||||
using System;
|
||||
|
||||
namespace Microsoft.VisualC
|
||||
{
|
||||
public sealed class IsSignedModifier:System.Attribute
|
||||
{
|
||||
}
|
||||
}
|
||||
@@ -1,8 +0,0 @@
|
||||
using System;
|
||||
|
||||
namespace Microsoft.VisualC
|
||||
{
|
||||
public sealed class IsVolatileModifier:System.Attribute
|
||||
{
|
||||
}
|
||||
}
|
||||
@@ -1,9 +0,0 @@
|
||||
using System;
|
||||
|
||||
namespace Microsoft.VisualC
|
||||
{
|
||||
|
||||
public sealed class MiscellaneousBitsAttribute:System.Attribute
|
||||
{
|
||||
}
|
||||
}
|
||||
@@ -1,8 +0,0 @@
|
||||
using System;
|
||||
|
||||
namespace Microsoft.VisualC
|
||||
{
|
||||
public sealed class NeedsCopyConstructorModifier:System.Attribute
|
||||
{
|
||||
}
|
||||
}
|
||||
@@ -1,8 +0,0 @@
|
||||
using System;
|
||||
|
||||
namespace Microsoft.VisualC
|
||||
{
|
||||
public sealed class NoSignSpecifiedModifier:System.Attribute
|
||||
{
|
||||
}
|
||||
}
|
||||
@@ -1,10 +0,0 @@
|
||||
Microsoft.VisualC/DebugInfoInPDBAttribute.cs
|
||||
Microsoft.VisualC/DecoratedNameAttribute.cs
|
||||
Microsoft.VisualC/IsCXXReferenceModifier.cs
|
||||
Microsoft.VisualC/IsConstModifier.cs
|
||||
Microsoft.VisualC/IsLongModifier.cs
|
||||
Microsoft.VisualC/IsSignedModifier.cs
|
||||
Microsoft.VisualC/IsVolatileModifier.cs
|
||||
Microsoft.VisualC/MiscellaneousBitsAttribute.cs
|
||||
Microsoft.VisualC/NeedsCopyConstructorModifier.cs
|
||||
Microsoft.VisualC/NoSignSpecifiedModifier.cs
|
||||
@@ -1,13 +0,0 @@
|
||||
topdir = ../..
|
||||
|
||||
LIBRARY = $(topdir)/class/lib/Microsoft.VisualC.dll
|
||||
|
||||
LIB_LIST = list
|
||||
LIB_FLAGS = -r corlib -r System
|
||||
|
||||
SOURCES_INCLUDE=*.cs
|
||||
SOURCES_EXCLUDE=./Test*
|
||||
|
||||
export MONO_PATH_PREFIX = $(topdir)/class/lib:
|
||||
|
||||
include $(topdir)/class/library.make
|
||||
@@ -1,115 +1,3 @@
|
||||
2003-02-22 Martin Baulig <[email protected]>
|
||||
|
||||
* MonoSymbolTable.cs: Incremented version number.
|
||||
|
||||
2003-02-22 Martin Baulig <[email protected]>
|
||||
|
||||
* MonoSymbolFile.cs (MonoSymbolFile.FindMethod): Fixed a bug.
|
||||
(MonoSymbolFile.MethodLookup): New method.
|
||||
|
||||
2003-02-18 Martin Baulig <[email protected]>
|
||||
|
||||
* MonoSymbolFile.cs (MonoSymbolFile.GetMethod): Added overloaded
|
||||
version which takes a MethodBase.
|
||||
|
||||
2003-02-18 Martin Baulig <[email protected]>
|
||||
|
||||
* MonoSymbolTable.cs (MethodIndexEntry): New public struct.
|
||||
|
||||
* MonoSymbolFile.cs (MonoSymbolFile.GetMethodByToken): New method.
|
||||
|
||||
2003-02-18 Martin Baulig <[email protected]>
|
||||
|
||||
* MonoSymbolFile.cs (MonoSymbolFile.Assembly): New public property.
|
||||
|
||||
* MonoSymbolTable.cs (MethodEntry.MethodBase): New public property.
|
||||
(MethodEntry.LocalTypes): New public variable.
|
||||
|
||||
2003-02-18 Martin Baulig <[email protected]>
|
||||
|
||||
* MonoSymbolFile.cs (MethodEntry.ThisTypeIndex): Renamed to
|
||||
ClassTypeIndex; provide this for all methods so we can get the
|
||||
class of static methods.
|
||||
|
||||
2003-02-10 Nick Drochak <[email protected]>
|
||||
|
||||
* Mono.CSharp.Debugger.build: passing the /r using an 'arg' node works.
|
||||
The <include> node wasn't getting to the compiler. This fixes build
|
||||
breakage on cygwin.
|
||||
|
||||
* MonoSymbolFile.cs: Qualify which Min method. Fixes build breakage
|
||||
on cygwin.
|
||||
|
||||
2003-02-09 Martin Baulig <[email protected]>
|
||||
|
||||
* MonoSymbolWriter.cs (MonoSymbolWriter.ctor): We don't need the
|
||||
`mbuilder_array' anymore.
|
||||
|
||||
2003-02-09 Martin Baulig <[email protected]>
|
||||
|
||||
* MonoSymbolWriter.cs (SourceFile): Derive from SourceFileEntry.
|
||||
(SourceBlock): We don't need source lines here.
|
||||
(SourceMethod): We're always constructed with source info.
|
||||
|
||||
* MonoSymbolTable.cs: Added support for namespaces.
|
||||
(NamespaceEntry): New struct.
|
||||
(SourceFileEntry.DefineNamespace): New method.
|
||||
(MethodEntry.BuildLineNumberTable): The table is already sorted,
|
||||
so we don't need to do this here.
|
||||
|
||||
2003-02-09 Martin Baulig <[email protected]>
|
||||
|
||||
* IMonoSymbolWriter.cs: Ooops, I forgot to remove this.
|
||||
|
||||
2003-02-08 Martin Baulig <[email protected]>
|
||||
|
||||
* MonoSymbolDocumentWriter.cs: Removed.
|
||||
|
||||
* MonoSymbolWriter.cs (SourceFile): Implement ISymbolDocumentWriter.
|
||||
|
||||
2003-02-08 Martin Baulig <[email protected]>
|
||||
|
||||
* MonoSymbolFile.cs (GetMethodSource): New public method.
|
||||
(FindMethod): Return the correct index.
|
||||
|
||||
2003-02-07 Martin Baulig <[email protected]>
|
||||
|
||||
* MonoSymbolFile.cs (Methods, Sources): New public properties.
|
||||
|
||||
2003-02-07 Martin Baulig <[email protected]>
|
||||
|
||||
* MonoSymbolFile.cs (MonoSymbolFile.ReadSymbolFile): New public
|
||||
static method, returns null (without throwing an exception) if the
|
||||
assembly doesn't have any debugging info.
|
||||
|
||||
2003-02-07 Martin Baulig <[email protected]>
|
||||
|
||||
* MonoSymbolWriter.cs (MonoSymbolWriter.Initialize): Removed the
|
||||
custom initialization function.
|
||||
|
||||
* MonoSymbolTableWriter.cs: Removed; the code is now in
|
||||
MonoSymbolFile.cs and MonoSymbolWriter.cs.
|
||||
|
||||
2003-02-07 Martin Baulig <[email protected]>
|
||||
|
||||
* MonoSymbolFile.cs: The symbol file is now a resource in the
|
||||
assembly instead of a separate file.
|
||||
|
||||
* MonoSymbolTable.cs: Did a few more cleanups, sort the line
|
||||
number table and remove duplicate line numbers.
|
||||
|
||||
2003-02-05 Martin Baulig <[email protected]>
|
||||
|
||||
Modified the symbol file format to speed up method looks by name
|
||||
and cleaned this up a lot.
|
||||
|
||||
* MonoSymbolFile.cs: New public class. This is now a public class
|
||||
and writes and reads the symbol file.
|
||||
|
||||
* IMonoBinaryReader.cs: Removed.
|
||||
|
||||
* MonoSymbolTable.cs: Set version number to 29.
|
||||
|
||||
2003-01-17 Zoltan Varga <[email protected]>
|
||||
|
||||
* MonoSymbolWriter.cs (OpenMethod): Make it work on constructors.
|
||||
|
||||
@@ -0,0 +1,26 @@
|
||||
//
|
||||
// System.Diagnostics.SymbolStore/IMonoBinaryReader.cs
|
||||
//
|
||||
// Author:
|
||||
// Martin Baulig ([email protected])
|
||||
//
|
||||
// (C) 2002 Ximian, Inc. http://www.ximian.com
|
||||
//
|
||||
|
||||
using System;
|
||||
|
||||
namespace Mono.CSharp.Debugger
|
||||
{
|
||||
public interface IMonoBinaryReader
|
||||
{
|
||||
long Position {
|
||||
get; set;
|
||||
}
|
||||
|
||||
int ReadInt32 ();
|
||||
|
||||
long ReadInt64 ();
|
||||
|
||||
byte[] ReadBuffer (int size);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,47 @@
|
||||
//
|
||||
// System.Diagnostics.SymbolStore/IMonoSymbolWriter.cs
|
||||
//
|
||||
// Author:
|
||||
// Martin Baulig ([email protected])
|
||||
//
|
||||
// This interface is derived from System.Diagnostics.SymbolStore.ISymbolWriter.
|
||||
//
|
||||
// (C) 2002 Ximian, Inc. http://www.ximian.com
|
||||
//
|
||||
|
||||
using System;
|
||||
using System.Reflection;
|
||||
using System.Reflection.Emit;
|
||||
using System.Collections;
|
||||
using System.IO;
|
||||
|
||||
namespace Mono.CSharp.Debugger
|
||||
{
|
||||
public interface IMonoSymbolWriter : System.Diagnostics.SymbolStore.ISymbolWriter
|
||||
{
|
||||
void Initialize (string assembly_filename, string filename, string[] args);
|
||||
}
|
||||
|
||||
internal enum SourceOffsetType
|
||||
{
|
||||
OFFSET_NONE,
|
||||
OFFSET_IL,
|
||||
OFFSET_LOCAL,
|
||||
OFFSET_PARAMETER
|
||||
}
|
||||
|
||||
internal interface ITypeHandle
|
||||
{
|
||||
string Name {
|
||||
get;
|
||||
}
|
||||
|
||||
Type Type {
|
||||
get;
|
||||
}
|
||||
|
||||
int Token {
|
||||
get;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -9,11 +9,13 @@
|
||||
<csc target="library" output="../lib/Mono.CSharp.Debugger.dll" debug="${debug}">
|
||||
<arg value="/nowarn:1595"/>
|
||||
<arg value="/unsafe"/>
|
||||
<arg value="/r:../lib/corlib.dll"/>
|
||||
<sources>
|
||||
<includes name="**/*.cs"/>
|
||||
<excludes name="Test/**"/>
|
||||
</sources>
|
||||
<references>
|
||||
<includes name="../lib/corlib.dll"/>
|
||||
</references>
|
||||
</csc>
|
||||
</target>
|
||||
<target name="clean">
|
||||
|
||||
@@ -0,0 +1,60 @@
|
||||
//
|
||||
// System.Diagnostics.SymbolStore/MonoSymbolDocumentWriter.cs
|
||||
//
|
||||
// Author:
|
||||
// Martin Baulig ([email protected])
|
||||
//
|
||||
// This is the default implementation of the
|
||||
// System.Diagnostics.SymbolStore.ISymbolDocumentWriter interface.
|
||||
//
|
||||
// (C) 2002 Ximian, Inc. http://www.ximian.com
|
||||
//
|
||||
|
||||
using System;
|
||||
using System.Reflection;
|
||||
using System.Reflection.Emit;
|
||||
using System.Diagnostics.SymbolStore;
|
||||
using System.IO;
|
||||
|
||||
namespace Mono.CSharp.Debugger
|
||||
{
|
||||
|
||||
public class MonoSymbolDocumentWriter : ISymbolDocumentWriter
|
||||
{
|
||||
protected string url;
|
||||
|
||||
//
|
||||
// Constructor
|
||||
//
|
||||
public MonoSymbolDocumentWriter (string url)
|
||||
{
|
||||
this.url = url;
|
||||
}
|
||||
|
||||
public string FileName {
|
||||
get {
|
||||
return url;
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
// Interface ISymbolDocumentWriter
|
||||
//
|
||||
|
||||
//
|
||||
// MonoSymbolWriter creates a DWARF 2 debugging file and DWARF operates
|
||||
// on file names, but has no way to include a whole source file in the
|
||||
// symbol file.
|
||||
//
|
||||
|
||||
public void SetCheckSum (Guid algorithmId, byte[] checkSum)
|
||||
{
|
||||
throw new NotSupportedException ();
|
||||
}
|
||||
|
||||
public void SetSource (byte[] source)
|
||||
{
|
||||
throw new NotSupportedException ();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,607 +0,0 @@
|
||||
//
|
||||
// System.Diagnostics.SymbolStore/MonoSymbolFile.cs
|
||||
//
|
||||
// Author:
|
||||
// Martin Baulig ([email protected])
|
||||
//
|
||||
// (C) 2003 Ximian, Inc. http://www.ximian.com
|
||||
//
|
||||
|
||||
using System;
|
||||
using System.Reflection;
|
||||
using System.Reflection.Emit;
|
||||
using System.Collections;
|
||||
using System.Text;
|
||||
using System.IO;
|
||||
|
||||
namespace Mono.CSharp.Debugger
|
||||
{
|
||||
public class MonoSymbolFileException : Exception
|
||||
{
|
||||
public MonoSymbolFileException ()
|
||||
: base ()
|
||||
{ }
|
||||
|
||||
public MonoSymbolFileException (string message, params object[] args)
|
||||
: base (String.Format (message, args))
|
||||
{ }
|
||||
}
|
||||
|
||||
internal class MyMemoryStream : Stream
|
||||
{
|
||||
int length;
|
||||
int real_length;
|
||||
int position;
|
||||
|
||||
int chunk_size = 4096;
|
||||
ArrayList chunks = new ArrayList ();
|
||||
|
||||
private struct Chunk {
|
||||
public readonly int Offset;
|
||||
public readonly int Length;
|
||||
public byte[] Buffer;
|
||||
|
||||
public Chunk (int offset, int length)
|
||||
{
|
||||
this.Offset = offset;
|
||||
this.Length = length;
|
||||
this.Buffer = new Byte [length];
|
||||
}
|
||||
}
|
||||
|
||||
public override long Position {
|
||||
get { return position; }
|
||||
|
||||
set {
|
||||
if (value > length)
|
||||
throw new ArgumentOutOfRangeException ();
|
||||
|
||||
position = (int) value;
|
||||
}
|
||||
}
|
||||
|
||||
public override long Length {
|
||||
get { return length; }
|
||||
}
|
||||
|
||||
public override bool CanRead {
|
||||
get { return true; }
|
||||
}
|
||||
|
||||
public override bool CanWrite {
|
||||
get { return true; }
|
||||
}
|
||||
|
||||
public override bool CanSeek {
|
||||
get { return true; }
|
||||
}
|
||||
|
||||
public override void SetLength (long new_length)
|
||||
{
|
||||
if (new_length < length)
|
||||
throw new ArgumentException ();
|
||||
|
||||
while (new_length >= real_length) {
|
||||
Chunk new_chunk = new Chunk (real_length, chunk_size);
|
||||
chunks.Add (new_chunk);
|
||||
real_length += chunk_size;
|
||||
}
|
||||
|
||||
length = (int) new_length;
|
||||
}
|
||||
|
||||
public override void Flush ()
|
||||
{ }
|
||||
|
||||
public override long Seek (long offset, SeekOrigin origin)
|
||||
{
|
||||
int ref_point;
|
||||
|
||||
switch (origin) {
|
||||
case SeekOrigin.Begin:
|
||||
ref_point = 0;
|
||||
break;
|
||||
case SeekOrigin.Current:
|
||||
ref_point = position;
|
||||
break;
|
||||
case SeekOrigin.End:
|
||||
ref_point = length;
|
||||
break;
|
||||
default:
|
||||
throw new ArgumentException ("Invalid SeekOrigin");
|
||||
}
|
||||
|
||||
if ((ref_point + offset < 0) || (offset > real_length))
|
||||
throw new ArgumentOutOfRangeException ();
|
||||
|
||||
position = ref_point + (int) offset;
|
||||
|
||||
return position;
|
||||
}
|
||||
|
||||
Chunk FindChunk (int offset)
|
||||
{
|
||||
return (Chunk) chunks [offset / chunk_size];
|
||||
}
|
||||
|
||||
public override int Read (byte[] buffer, int offset, int count)
|
||||
{
|
||||
int old_count = count;
|
||||
|
||||
while (count > 0) {
|
||||
Chunk chunk = FindChunk (position);
|
||||
int coffset = position - chunk.Offset;
|
||||
int rest = chunk.Length - coffset;
|
||||
int size = System.Math.Min (count, rest);
|
||||
|
||||
Array.Copy (chunk.Buffer, coffset, buffer, offset, size);
|
||||
position += size;
|
||||
offset += size;
|
||||
count -= size;
|
||||
}
|
||||
|
||||
return old_count;
|
||||
}
|
||||
|
||||
public override void Write (byte[] buffer, int offset, int count)
|
||||
{
|
||||
if (position + count > length)
|
||||
SetLength (position + count);
|
||||
|
||||
while (count > 0) {
|
||||
Chunk chunk = FindChunk (position);
|
||||
int coffset = position - chunk.Offset;
|
||||
int rest = chunk.Length - coffset;
|
||||
int size = System.Math.Min (count, rest);
|
||||
|
||||
Array.Copy (buffer, offset, chunk.Buffer, coffset, size);
|
||||
position += size;
|
||||
offset += size;
|
||||
count -= size;
|
||||
}
|
||||
}
|
||||
|
||||
public byte[] GetContents ()
|
||||
{
|
||||
byte[] retval = new byte [length];
|
||||
position = 0;
|
||||
Read (retval, 0, length);
|
||||
return retval;
|
||||
}
|
||||
}
|
||||
|
||||
public class MonoSymbolFile : IDisposable
|
||||
{
|
||||
ArrayList methods = new ArrayList ();
|
||||
ArrayList sources = new ArrayList ();
|
||||
Hashtable method_source_hash = new Hashtable ();
|
||||
Hashtable type_hash = new Hashtable ();
|
||||
|
||||
OffsetTable ot;
|
||||
int last_type_index;
|
||||
int last_method_index;
|
||||
int last_source_index;
|
||||
int last_namespace_index;
|
||||
|
||||
public MonoSymbolFile ()
|
||||
{ }
|
||||
|
||||
internal int AddSource (SourceFileEntry source)
|
||||
{
|
||||
sources.Add (source);
|
||||
return ++last_source_index;
|
||||
}
|
||||
|
||||
internal int DefineType (Type type)
|
||||
{
|
||||
if (type_hash.Contains (type))
|
||||
return (int) type_hash [type];
|
||||
|
||||
int index = ++last_type_index;
|
||||
type_hash.Add (type, index);
|
||||
return index;
|
||||
}
|
||||
|
||||
internal void AddMethod (MethodEntry entry)
|
||||
{
|
||||
methods.Add (entry);
|
||||
}
|
||||
|
||||
internal int GetNextTypeIndex ()
|
||||
{
|
||||
return ++last_type_index;
|
||||
}
|
||||
|
||||
internal int GetNextMethodIndex ()
|
||||
{
|
||||
return ++last_method_index;
|
||||
}
|
||||
|
||||
internal int GetNextNamespaceIndex ()
|
||||
{
|
||||
return ++last_namespace_index;
|
||||
}
|
||||
|
||||
internal void WriteString (BinaryWriter bw, string text)
|
||||
{
|
||||
byte[] data = Encoding.UTF8.GetBytes (text);
|
||||
bw.Write ((int) data.Length);
|
||||
bw.Write (data);
|
||||
StringSize += data.Length;
|
||||
}
|
||||
|
||||
internal string ReadString (int offset)
|
||||
{
|
||||
int old_pos = (int) reader.BaseStream.Position;
|
||||
reader.BaseStream.Position = offset;
|
||||
int length = reader.ReadInt32 ();
|
||||
|
||||
byte[] data = reader.ReadBytes (length);
|
||||
string text = Encoding.UTF8.GetString (data);
|
||||
reader.BaseStream.Position = old_pos;
|
||||
return text;
|
||||
}
|
||||
|
||||
void Write (BinaryWriter bw)
|
||||
{
|
||||
// Magic number and file version.
|
||||
bw.Write (OffsetTable.Magic);
|
||||
bw.Write (OffsetTable.Version);
|
||||
|
||||
//
|
||||
// Offsets of file sections; we must write this after we're done
|
||||
// writing the whole file, so we just reserve the space for it here.
|
||||
//
|
||||
long offset_table_offset = bw.BaseStream.Position;
|
||||
ot.Write (bw);
|
||||
|
||||
//
|
||||
// Write data sections.
|
||||
//
|
||||
ot.DataSectionOffset = (int) bw.BaseStream.Position;
|
||||
foreach (SourceFileEntry source in sources)
|
||||
source.WriteData (bw);
|
||||
ot.DataSectionSize = (int) bw.BaseStream.Position - ot.DataSectionOffset;
|
||||
|
||||
//
|
||||
// Write method table.
|
||||
//
|
||||
ot.MethodTableOffset = (int) bw.BaseStream.Position;
|
||||
for (int i = 0; i < methods.Count; i++) {
|
||||
MethodEntry entry = (MethodEntry) methods [i];
|
||||
entry.WriteIndex (bw);
|
||||
}
|
||||
ot.MethodTableSize = (int) bw.BaseStream.Position - ot.MethodTableOffset;
|
||||
|
||||
//
|
||||
// Write source table.
|
||||
//
|
||||
ot.SourceTableOffset = (int) bw.BaseStream.Position;
|
||||
for (int i = 0; i < sources.Count; i++) {
|
||||
SourceFileEntry source = (SourceFileEntry) sources [i];
|
||||
source.Write (bw);
|
||||
}
|
||||
ot.SourceTableSize = (int) bw.BaseStream.Position - ot.SourceTableOffset;
|
||||
|
||||
//
|
||||
// Fixup offset table.
|
||||
//
|
||||
ot.TypeCount = last_type_index;
|
||||
ot.MethodCount = methods.Count;
|
||||
ot.SourceCount = sources.Count;
|
||||
|
||||
//
|
||||
// Write offset table.
|
||||
//
|
||||
ot.TotalFileSize = (int) bw.BaseStream.Position;
|
||||
bw.Seek ((int) offset_table_offset, SeekOrigin.Begin);
|
||||
ot.Write (bw);
|
||||
bw.Seek (0, SeekOrigin.End);
|
||||
}
|
||||
|
||||
public byte[] CreateSymbolFile ()
|
||||
{
|
||||
if (reader != null)
|
||||
throw new InvalidOperationException ();
|
||||
|
||||
using (MyMemoryStream stream = new MyMemoryStream ()) {
|
||||
Write (new BinaryWriter (stream));
|
||||
Console.WriteLine ("WROTE SYMFILE: {0} sources, {1} methods, {2} types, " +
|
||||
"{3} line numbers, {4} locals, {5} namespaces, " +
|
||||
"{6} bytes of string data",
|
||||
SourceCount, MethodCount, TypeCount, LineNumberCount,
|
||||
LocalCount, NamespaceCount, StringSize);
|
||||
Console.WriteLine (ot);
|
||||
return stream.GetContents ();
|
||||
}
|
||||
}
|
||||
|
||||
Assembly assembly;
|
||||
BinaryReader reader;
|
||||
Hashtable method_hash;
|
||||
Hashtable source_file_hash;
|
||||
|
||||
Hashtable method_token_hash;
|
||||
Hashtable method_name_hash;
|
||||
Hashtable method_full_name_hash;
|
||||
Hashtable source_name_hash;
|
||||
|
||||
protected MonoSymbolFile (Assembly assembly, Stream stream)
|
||||
{
|
||||
this.assembly = assembly;
|
||||
|
||||
reader = new BinaryReader (stream);
|
||||
|
||||
try {
|
||||
long magic = reader.ReadInt64 ();
|
||||
long version = reader.ReadInt32 ();
|
||||
if ((magic != OffsetTable.Magic) || (version != OffsetTable.Version))
|
||||
throw new MonoSymbolFileException ();
|
||||
ot = new OffsetTable (reader);
|
||||
} catch {
|
||||
throw new MonoSymbolFileException ();
|
||||
}
|
||||
|
||||
method_hash = new Hashtable ();
|
||||
source_file_hash = new Hashtable ();
|
||||
}
|
||||
|
||||
public static MonoSymbolFile ReadSymbolFile (Assembly assembly)
|
||||
{
|
||||
Stream stream = assembly.GetManifestResourceStream ("MonoSymbolFile");
|
||||
if (stream == null)
|
||||
return null;
|
||||
|
||||
return new MonoSymbolFile (assembly, stream);
|
||||
}
|
||||
|
||||
public Assembly Assembly {
|
||||
get { return assembly; }
|
||||
}
|
||||
|
||||
public int SourceCount {
|
||||
get { return ot.SourceCount; }
|
||||
}
|
||||
|
||||
public int MethodCount {
|
||||
get { return ot.MethodCount; }
|
||||
}
|
||||
|
||||
public int TypeCount {
|
||||
get { return ot.TypeCount; }
|
||||
}
|
||||
|
||||
public int NamespaceCount {
|
||||
get { return last_namespace_index; }
|
||||
}
|
||||
|
||||
internal int LineNumberCount = 0;
|
||||
internal int LocalCount = 0;
|
||||
internal int StringSize = 0;
|
||||
|
||||
public SourceFileEntry GetSourceFile (int index)
|
||||
{
|
||||
if ((index < 1) || (index > ot.SourceCount))
|
||||
throw new ArgumentException ();
|
||||
if (reader == null)
|
||||
throw new InvalidOperationException ();
|
||||
|
||||
SourceFileEntry source = (SourceFileEntry) source_file_hash [index];
|
||||
if (source != null)
|
||||
return source;
|
||||
|
||||
reader.BaseStream.Position = ot.SourceTableOffset +
|
||||
SourceFileEntry.Size * (index - 1);
|
||||
source = new SourceFileEntry (this, reader);
|
||||
source_file_hash.Add (index, source);
|
||||
return source;
|
||||
}
|
||||
|
||||
public SourceFileEntry[] Sources {
|
||||
get {
|
||||
if (reader == null)
|
||||
throw new InvalidOperationException ();
|
||||
|
||||
SourceFileEntry[] retval = new SourceFileEntry [SourceCount];
|
||||
for (int i = 0; i < SourceCount; i++)
|
||||
retval [i] = GetSourceFile (i + 1);
|
||||
return retval;
|
||||
}
|
||||
}
|
||||
|
||||
public MethodIndexEntry GetMethodIndexEntry (int index)
|
||||
{
|
||||
int old_pos = (int) reader.BaseStream.Position;
|
||||
reader.BaseStream.Position = ot.MethodTableOffset +
|
||||
MethodIndexEntry.Size * (index - 1);
|
||||
MethodIndexEntry ie = new MethodIndexEntry (reader);
|
||||
reader.BaseStream.Position = old_pos;
|
||||
return ie;
|
||||
}
|
||||
|
||||
public MethodEntry GetMethodByToken (int token)
|
||||
{
|
||||
if (reader == null)
|
||||
throw new InvalidOperationException ();
|
||||
|
||||
if (method_token_hash == null) {
|
||||
method_token_hash = new Hashtable ();
|
||||
|
||||
for (int i = 0; i < MethodCount; i++) {
|
||||
MethodIndexEntry ie = GetMethodIndexEntry (i + 1);
|
||||
|
||||
method_token_hash.Add (ie.Token, i);
|
||||
}
|
||||
}
|
||||
|
||||
object value = method_token_hash [token];
|
||||
if (value == null)
|
||||
return null;
|
||||
|
||||
return GetMethod ((int) value);
|
||||
}
|
||||
|
||||
public MethodEntry GetMethod (MethodBase method)
|
||||
{
|
||||
if (reader == null)
|
||||
throw new InvalidOperationException ();
|
||||
int token = assembly.MonoDebugger_GetMethodToken (method);
|
||||
return GetMethodByToken (token);
|
||||
}
|
||||
|
||||
public MethodEntry GetMethod (int index)
|
||||
{
|
||||
if ((index < 1) || (index > ot.MethodCount))
|
||||
throw new ArgumentException ();
|
||||
if (reader == null)
|
||||
throw new InvalidOperationException ();
|
||||
|
||||
MethodEntry entry = (MethodEntry) method_hash [index];
|
||||
if (entry != null)
|
||||
return entry;
|
||||
|
||||
MethodIndexEntry ie = GetMethodIndexEntry (index);
|
||||
reader.BaseStream.Position = ie.FileOffset;
|
||||
|
||||
entry = new MethodEntry (this, reader, index);
|
||||
method_hash.Add (index, entry);
|
||||
return entry;
|
||||
}
|
||||
|
||||
public MethodEntry[] Methods {
|
||||
get {
|
||||
if (reader == null)
|
||||
throw new InvalidOperationException ();
|
||||
|
||||
MethodEntry[] retval = new MethodEntry [MethodCount];
|
||||
for (int i = 0; i < MethodCount; i++)
|
||||
retval [i] = GetMethod (i + 1);
|
||||
return retval;
|
||||
}
|
||||
}
|
||||
|
||||
public MethodSourceEntry GetMethodSource (int index)
|
||||
{
|
||||
if ((index < 1) || (index > ot.MethodCount))
|
||||
throw new ArgumentException ();
|
||||
if (reader == null)
|
||||
throw new InvalidOperationException ();
|
||||
|
||||
object entry = method_source_hash [index];
|
||||
if (entry != null)
|
||||
return (MethodSourceEntry) entry;
|
||||
|
||||
MethodEntry method = GetMethod (index);
|
||||
foreach (MethodSourceEntry source in method.SourceFile.Methods) {
|
||||
if (source.Index == index) {
|
||||
method_source_hash.Add (index, source);
|
||||
return source;
|
||||
}
|
||||
}
|
||||
|
||||
throw new MonoSymbolFileException ("Internal error.");
|
||||
}
|
||||
|
||||
public int FindMethod (string full_name)
|
||||
{
|
||||
if (reader == null)
|
||||
throw new InvalidOperationException ();
|
||||
|
||||
if (method_full_name_hash == null) {
|
||||
method_full_name_hash = new Hashtable ();
|
||||
|
||||
for (int i = 0; i < ot.MethodCount; i++) {
|
||||
MethodIndexEntry ie = GetMethodIndexEntry (i + 1);
|
||||
string name = ReadString (ie.FullNameOffset);
|
||||
|
||||
method_full_name_hash.Add (name, i + 1);
|
||||
}
|
||||
}
|
||||
|
||||
object value = method_full_name_hash [full_name];
|
||||
if (value == null)
|
||||
return -1;
|
||||
return (int) value;
|
||||
}
|
||||
|
||||
public int[] MethodLookup (string query)
|
||||
{
|
||||
if (reader == null)
|
||||
throw new InvalidOperationException ();
|
||||
|
||||
ArrayList list;
|
||||
if (method_name_hash == null) {
|
||||
method_name_hash = new Hashtable ();
|
||||
|
||||
for (int i = 0; i < ot.MethodCount; i++) {
|
||||
MethodIndexEntry ie = GetMethodIndexEntry (i + 1);
|
||||
string full_name = ReadString (ie.FullNameOffset);
|
||||
|
||||
int pos = full_name.IndexOf ('(');
|
||||
string name = full_name.Substring (0, pos);
|
||||
|
||||
list = method_name_hash [name] as ArrayList;
|
||||
if (list == null) {
|
||||
list = new ArrayList ();
|
||||
method_name_hash.Add (name, list);
|
||||
}
|
||||
|
||||
list.Add (i + 1);
|
||||
}
|
||||
}
|
||||
|
||||
list = method_name_hash [query] as ArrayList;
|
||||
if (list == null)
|
||||
return new int [0];
|
||||
|
||||
int[] retval = new int [list.Count];
|
||||
list.CopyTo (retval, 0);
|
||||
return retval;
|
||||
}
|
||||
|
||||
public int FindSource (string file_name)
|
||||
{
|
||||
if (reader == null)
|
||||
throw new InvalidOperationException ();
|
||||
|
||||
if (source_name_hash == null) {
|
||||
source_name_hash = new Hashtable ();
|
||||
|
||||
for (int i = 0; i < ot.SourceCount; i++) {
|
||||
SourceFileEntry source = GetSourceFile (i + 1);
|
||||
|
||||
source_name_hash.Add (source.FileName, i);
|
||||
}
|
||||
}
|
||||
|
||||
object value = source_name_hash [file_name];
|
||||
if (value == null)
|
||||
return -1;
|
||||
return (int) value;
|
||||
}
|
||||
|
||||
internal BinaryReader BinaryReader {
|
||||
get {
|
||||
if (reader == null)
|
||||
throw new InvalidOperationException ();
|
||||
|
||||
return reader;
|
||||
}
|
||||
}
|
||||
|
||||
void IDisposable.Dispose ()
|
||||
{
|
||||
Dispose (true);
|
||||
}
|
||||
|
||||
protected virtual void Dispose (bool disposing)
|
||||
{
|
||||
if (disposing) {
|
||||
if (reader != null) {
|
||||
reader.Close ();
|
||||
reader = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -18,55 +18,64 @@ namespace Mono.CSharp.Debugger
|
||||
{
|
||||
public struct OffsetTable
|
||||
{
|
||||
public const int Version = 33;
|
||||
public const int Version = 28;
|
||||
public const long Magic = 0x45e82623fd7fa614;
|
||||
|
||||
public int TotalFileSize;
|
||||
public int DataSectionOffset;
|
||||
public int DataSectionSize;
|
||||
public int SourceCount;
|
||||
public int SourceTableOffset;
|
||||
public int SourceTableSize;
|
||||
public int MethodCount;
|
||||
public int MethodTableOffset;
|
||||
public int MethodTableSize;
|
||||
public int TypeCount;
|
||||
public int total_file_size;
|
||||
public int source_table_offset;
|
||||
public int source_table_size;
|
||||
public int method_count;
|
||||
public int method_table_offset;
|
||||
public int method_table_size;
|
||||
public int line_number_table_offset;
|
||||
public int line_number_table_size;
|
||||
public int local_variable_table_offset;
|
||||
public int local_variable_table_size;
|
||||
public int source_file_table_offset;
|
||||
public int source_file_table_size;
|
||||
public int source_file_count;
|
||||
public int type_count;
|
||||
public int type_index_table_offset;
|
||||
public int type_index_table_size;
|
||||
|
||||
internal OffsetTable (BinaryReader reader)
|
||||
public OffsetTable (IMonoBinaryReader reader)
|
||||
{
|
||||
TotalFileSize = reader.ReadInt32 ();
|
||||
DataSectionOffset = reader.ReadInt32 ();
|
||||
DataSectionSize = reader.ReadInt32 ();
|
||||
SourceCount = reader.ReadInt32 ();
|
||||
SourceTableOffset = reader.ReadInt32 ();
|
||||
SourceTableSize = reader.ReadInt32 ();
|
||||
MethodCount = reader.ReadInt32 ();
|
||||
MethodTableOffset = reader.ReadInt32 ();
|
||||
MethodTableSize = reader.ReadInt32 ();
|
||||
TypeCount = reader.ReadInt32 ();
|
||||
total_file_size = reader.ReadInt32 ();
|
||||
source_table_offset = reader.ReadInt32 ();
|
||||
source_table_size = reader.ReadInt32 ();
|
||||
method_count = reader.ReadInt32 ();
|
||||
method_table_offset = reader.ReadInt32 ();
|
||||
method_table_size = reader.ReadInt32 ();
|
||||
line_number_table_offset = reader.ReadInt32 ();
|
||||
line_number_table_size = reader.ReadInt32 ();
|
||||
local_variable_table_offset = reader.ReadInt32 ();
|
||||
local_variable_table_size = reader.ReadInt32 ();
|
||||
source_file_table_offset = reader.ReadInt32 ();
|
||||
source_file_table_size = reader.ReadInt32 ();
|
||||
source_file_count = reader.ReadInt32 ();
|
||||
type_count = reader.ReadInt32 ();
|
||||
type_index_table_offset = reader.ReadInt32 ();
|
||||
type_index_table_size = reader.ReadInt32 ();
|
||||
}
|
||||
|
||||
internal void Write (BinaryWriter bw)
|
||||
public void Write (BinaryWriter bw)
|
||||
{
|
||||
bw.Write (TotalFileSize);
|
||||
bw.Write (DataSectionOffset);
|
||||
bw.Write (DataSectionSize);
|
||||
bw.Write (SourceCount);
|
||||
bw.Write (SourceTableOffset);
|
||||
bw.Write (SourceTableSize);
|
||||
bw.Write (MethodCount);
|
||||
bw.Write (MethodTableOffset);
|
||||
bw.Write (MethodTableSize);
|
||||
bw.Write (TypeCount);
|
||||
}
|
||||
|
||||
public override string ToString ()
|
||||
{
|
||||
return String.Format (
|
||||
"OffsetTable [{0} - {1}:{2} - {3}:{4}:{5} - {6}:{7}:{8} - {9}]",
|
||||
TotalFileSize, DataSectionOffset, DataSectionSize, SourceCount,
|
||||
SourceTableOffset, SourceTableSize, MethodCount, MethodTableOffset,
|
||||
MethodTableSize, TypeCount);
|
||||
bw.Write (total_file_size);
|
||||
bw.Write (source_table_offset);
|
||||
bw.Write (source_table_size);
|
||||
bw.Write (method_count);
|
||||
bw.Write (method_table_offset);
|
||||
bw.Write (method_table_size);
|
||||
bw.Write (line_number_table_offset);
|
||||
bw.Write (line_number_table_size);
|
||||
bw.Write (local_variable_table_offset);
|
||||
bw.Write (local_variable_table_size);
|
||||
bw.Write (source_file_table_offset);
|
||||
bw.Write (source_file_table_size);
|
||||
bw.Write (source_file_count);
|
||||
bw.Write (type_count);
|
||||
bw.Write (type_index_table_offset);
|
||||
bw.Write (type_index_table_size);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -81,9 +90,11 @@ namespace Mono.CSharp.Debugger
|
||||
this.Offset = offset;
|
||||
}
|
||||
|
||||
public static LineNumberEntry Null = new LineNumberEntry (0, 0);
|
||||
internal LineNumberEntry (SourceLine line)
|
||||
: this (line.Row, line.Offset)
|
||||
{ }
|
||||
|
||||
internal LineNumberEntry (BinaryReader reader)
|
||||
public LineNumberEntry (IMonoBinaryReader reader)
|
||||
{
|
||||
Row = reader.ReadInt32 ();
|
||||
Offset = reader.ReadInt32 ();
|
||||
@@ -95,41 +106,6 @@ namespace Mono.CSharp.Debugger
|
||||
bw.Write (Offset);
|
||||
}
|
||||
|
||||
private class OffsetComparerClass : IComparer
|
||||
{
|
||||
public int Compare (object a, object b)
|
||||
{
|
||||
LineNumberEntry l1 = (LineNumberEntry) a;
|
||||
LineNumberEntry l2 = (LineNumberEntry) b;
|
||||
|
||||
if (l1.Offset < l2.Offset)
|
||||
return -1;
|
||||
else if (l1.Offset > l2.Offset)
|
||||
return 1;
|
||||
else
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
private class RowComparerClass : IComparer
|
||||
{
|
||||
public int Compare (object a, object b)
|
||||
{
|
||||
LineNumberEntry l1 = (LineNumberEntry) a;
|
||||
LineNumberEntry l2 = (LineNumberEntry) b;
|
||||
|
||||
if (l1.Row < l2.Row)
|
||||
return -1;
|
||||
else if (l1.Row > l2.Row)
|
||||
return 1;
|
||||
else
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
public static readonly IComparer OffsetComparer = new OffsetComparerClass ();
|
||||
public static readonly IComparer RowComparer = new RowComparerClass ();
|
||||
|
||||
public override string ToString ()
|
||||
{
|
||||
return String.Format ("[Line {0}:{1}]", Row, Offset);
|
||||
@@ -149,19 +125,21 @@ namespace Mono.CSharp.Debugger
|
||||
this.Signature = Signature;
|
||||
}
|
||||
|
||||
internal LocalVariableEntry (BinaryReader reader)
|
||||
public LocalVariableEntry (IMonoBinaryReader reader)
|
||||
{
|
||||
int name_length = reader.ReadInt32 ();
|
||||
byte[] name = reader.ReadBytes (name_length);
|
||||
byte[] name = reader.ReadBuffer (name_length);
|
||||
Name = Encoding.UTF8.GetString (name);
|
||||
Attributes = (FieldAttributes) reader.ReadInt32 ();
|
||||
int sig_length = reader.ReadInt32 ();
|
||||
Signature = reader.ReadBytes (sig_length);
|
||||
Signature = reader.ReadBuffer (sig_length);
|
||||
}
|
||||
|
||||
internal void Write (MonoSymbolFile file, BinaryWriter bw)
|
||||
internal void Write (BinaryWriter bw)
|
||||
{
|
||||
file.WriteString (bw, Name);
|
||||
byte[] name = Encoding.UTF8.GetBytes (Name);
|
||||
bw.Write ((int) name.Length);
|
||||
bw.Write (name);
|
||||
bw.Write ((int) Attributes);
|
||||
bw.Write ((int) Signature.Length);
|
||||
bw.Write (Signature);
|
||||
@@ -175,129 +153,74 @@ namespace Mono.CSharp.Debugger
|
||||
|
||||
public class SourceFileEntry
|
||||
{
|
||||
MonoSymbolFile file;
|
||||
string file_name;
|
||||
public readonly string SourceFile;
|
||||
|
||||
IMonoBinaryReader reader;
|
||||
long method_position;
|
||||
ArrayList methods;
|
||||
ArrayList namespaces;
|
||||
int index, count, name_offset, method_offset;
|
||||
int namespace_count, nstable_offset;
|
||||
bool creating;
|
||||
int count;
|
||||
|
||||
public static int Size {
|
||||
get { return 24; }
|
||||
internal SourceFileEntry (string source_file)
|
||||
{
|
||||
this.SourceFile = source_file;
|
||||
this.methods = new ArrayList ();
|
||||
this.count = 0;
|
||||
}
|
||||
|
||||
internal SourceFileEntry (MonoSymbolFile file, string file_name)
|
||||
internal void AddMethod (MethodSourceEntry method)
|
||||
{
|
||||
this.file = file;
|
||||
this.file_name = file_name;
|
||||
this.index = file.AddSource (this);
|
||||
|
||||
creating = true;
|
||||
methods = new ArrayList ();
|
||||
namespaces = new ArrayList ();
|
||||
}
|
||||
|
||||
public void DefineMethod (MethodBase method, int token, LocalVariableEntry[] locals,
|
||||
LineNumberEntry[] lines, int start, int end, int namespace_id)
|
||||
{
|
||||
if (!creating)
|
||||
throw new InvalidOperationException ();
|
||||
|
||||
MethodEntry entry = new MethodEntry (
|
||||
file, this, method, token, locals, lines, start, end, namespace_id);
|
||||
|
||||
methods.Add (entry);
|
||||
file.AddMethod (entry);
|
||||
}
|
||||
|
||||
public int DefineNamespace (string name, string[] using_clauses, int parent)
|
||||
{
|
||||
if (!creating)
|
||||
throw new InvalidOperationException ();
|
||||
|
||||
int index = file.GetNextNamespaceIndex ();
|
||||
NamespaceEntry ns = new NamespaceEntry (name, index, using_clauses, parent);
|
||||
namespaces.Add (ns);
|
||||
return index;
|
||||
}
|
||||
|
||||
internal void WriteData (BinaryWriter bw)
|
||||
{
|
||||
name_offset = (int) bw.BaseStream.Position;
|
||||
file.WriteString (bw, file_name);
|
||||
|
||||
ArrayList list = new ArrayList ();
|
||||
foreach (MethodEntry entry in methods)
|
||||
list.Add (entry.Write (file, bw));
|
||||
list.Sort ();
|
||||
count = list.Count;
|
||||
|
||||
method_offset = (int) bw.BaseStream.Position;
|
||||
foreach (MethodSourceEntry method in list)
|
||||
method.Write (bw);
|
||||
|
||||
namespace_count = namespaces.Count;
|
||||
nstable_offset = (int) bw.BaseStream.Position;
|
||||
foreach (NamespaceEntry ns in namespaces)
|
||||
ns.Write (file, bw);
|
||||
methods.Add (method);
|
||||
count++;
|
||||
}
|
||||
|
||||
internal void Write (BinaryWriter bw)
|
||||
{
|
||||
bw.Write (index);
|
||||
bw.Write (count);
|
||||
bw.Write (namespace_count);
|
||||
bw.Write (name_offset);
|
||||
bw.Write (method_offset);
|
||||
bw.Write (nstable_offset);
|
||||
byte[] name = Encoding.UTF8.GetBytes (SourceFile);
|
||||
bw.Write ((int) name.Length);
|
||||
bw.Write (name);
|
||||
|
||||
methods.Sort ();
|
||||
bw.Write (methods.Count);
|
||||
foreach (MethodSourceEntry method in methods)
|
||||
method.Write (bw);
|
||||
}
|
||||
|
||||
internal SourceFileEntry (MonoSymbolFile file, BinaryReader reader)
|
||||
public SourceFileEntry (IMonoBinaryReader reader)
|
||||
{
|
||||
this.file = file;
|
||||
int name_length = reader.ReadInt32 ();
|
||||
byte[] name = reader.ReadBuffer (name_length);
|
||||
SourceFile = Encoding.UTF8.GetString (name);
|
||||
|
||||
index = reader.ReadInt32 ();
|
||||
count = reader.ReadInt32 ();
|
||||
namespace_count = reader.ReadInt32 ();
|
||||
name_offset = reader.ReadInt32 ();
|
||||
method_offset = reader.ReadInt32 ();
|
||||
nstable_offset = reader.ReadInt32 ();
|
||||
this.reader = reader;
|
||||
this.method_position = reader.Position;
|
||||
|
||||
file_name = file.ReadString (name_offset);
|
||||
}
|
||||
|
||||
public int Index {
|
||||
get { return index; }
|
||||
}
|
||||
|
||||
public string FileName {
|
||||
get { return file_name; }
|
||||
reader.Position += count * MethodSourceEntry.Size;
|
||||
}
|
||||
|
||||
public MethodSourceEntry[] Methods {
|
||||
get {
|
||||
if (creating)
|
||||
throw new InvalidOperationException ();
|
||||
|
||||
BinaryReader reader = file.BinaryReader;
|
||||
int old_pos = (int) reader.BaseStream.Position;
|
||||
|
||||
reader.BaseStream.Position = method_offset;
|
||||
ArrayList list = new ArrayList ();
|
||||
for (int i = 0; i < count; i ++)
|
||||
list.Add (new MethodSourceEntry (reader));
|
||||
reader.BaseStream.Position = old_pos;
|
||||
|
||||
MethodSourceEntry[] retval = new MethodSourceEntry [count];
|
||||
list.CopyTo (retval, 0);
|
||||
read_methods ();
|
||||
MethodSourceEntry[] retval = new MethodSourceEntry [methods.Count];
|
||||
methods.CopyTo (retval, 0);
|
||||
return retval;
|
||||
}
|
||||
}
|
||||
|
||||
void read_methods ()
|
||||
{
|
||||
if (methods != null)
|
||||
return;
|
||||
|
||||
reader.Position = method_position;
|
||||
methods = new ArrayList ();
|
||||
for (int i = 0; i < count; i++)
|
||||
methods.Add (new MethodSourceEntry (reader));
|
||||
}
|
||||
|
||||
public override string ToString ()
|
||||
{
|
||||
return String.Format ("SourceFileEntry ({0}:{1}:{2})", index, file_name, count);
|
||||
return String.Format ("SourceFileEntry ({0}:{1})", SourceFile, count);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -316,7 +239,7 @@ namespace Mono.CSharp.Debugger
|
||||
this.EndRow = end;
|
||||
}
|
||||
|
||||
internal MethodSourceEntry (BinaryReader reader)
|
||||
public MethodSourceEntry (IMonoBinaryReader reader)
|
||||
{
|
||||
Index = reader.ReadInt32 ();
|
||||
FileOffset = reader.ReadInt32 ();
|
||||
@@ -324,8 +247,11 @@ namespace Mono.CSharp.Debugger
|
||||
EndRow = reader.ReadInt32 ();
|
||||
}
|
||||
|
||||
public static int Size {
|
||||
get { return 16; }
|
||||
public static int Size
|
||||
{
|
||||
get {
|
||||
return 16;
|
||||
}
|
||||
}
|
||||
|
||||
internal void Write (BinaryWriter bw)
|
||||
@@ -355,152 +281,84 @@ namespace Mono.CSharp.Debugger
|
||||
}
|
||||
}
|
||||
|
||||
public struct MethodIndexEntry
|
||||
{
|
||||
public readonly int FileOffset;
|
||||
public readonly int FullNameOffset;
|
||||
public readonly int Token;
|
||||
|
||||
public static int Size {
|
||||
get { return 12; }
|
||||
}
|
||||
|
||||
public MethodIndexEntry (int offset, int name_offset, int token)
|
||||
{
|
||||
this.FileOffset = offset;
|
||||
this.FullNameOffset = name_offset;
|
||||
this.Token = token;
|
||||
}
|
||||
|
||||
internal MethodIndexEntry (BinaryReader reader)
|
||||
{
|
||||
FileOffset = reader.ReadInt32 ();
|
||||
FullNameOffset = reader.ReadInt32 ();
|
||||
Token = reader.ReadInt32 ();
|
||||
}
|
||||
|
||||
internal void Write (BinaryWriter bw)
|
||||
{
|
||||
bw.Write (FileOffset);
|
||||
bw.Write (FullNameOffset);
|
||||
bw.Write (Token);
|
||||
}
|
||||
|
||||
public override string ToString ()
|
||||
{
|
||||
return String.Format ("MethodIndexEntry ({0}:{1}:{2:x})",
|
||||
FileOffset, FullNameOffset, Token);
|
||||
}
|
||||
}
|
||||
|
||||
public class MethodEntry
|
||||
{
|
||||
#region This is actually written to the symbol file
|
||||
public readonly int SourceFileIndex;
|
||||
public readonly int Token;
|
||||
public readonly int StartRow;
|
||||
public readonly int EndRow;
|
||||
public readonly int ClassTypeIndex;
|
||||
public readonly int NumLineNumbers;
|
||||
public readonly int ThisTypeIndex;
|
||||
public readonly int NumParameters;
|
||||
public readonly int NumLocals;
|
||||
public readonly int NumLineNumbers;
|
||||
public readonly int NamespaceID;
|
||||
|
||||
int NameOffset;
|
||||
int FullNameOffset;
|
||||
int TypeIndexTableOffset;
|
||||
int LocalVariableTableOffset;
|
||||
int LineNumberTableOffset;
|
||||
#endregion
|
||||
public int TypeIndexTableOffset;
|
||||
public int LocalVariableTableOffset;
|
||||
public readonly int SourceFileOffset;
|
||||
public readonly int LineNumberTableOffset;
|
||||
|
||||
int index;
|
||||
int file_offset;
|
||||
string name;
|
||||
string full_name;
|
||||
MethodIndexEntry index_entry;
|
||||
public readonly string SourceFile = null;
|
||||
public readonly LineNumberEntry[] LineNumbers = null;
|
||||
public readonly int[] ParamTypeIndices = null;
|
||||
public readonly int[] LocalTypeIndices = null;
|
||||
public readonly LocalVariableEntry[] Locals = null;
|
||||
|
||||
public readonly SourceFileEntry SourceFile;
|
||||
public readonly LineNumberEntry[] LineNumbers;
|
||||
public readonly int[] ParamTypeIndices;
|
||||
public readonly int[] LocalTypeIndices;
|
||||
public readonly LocalVariableEntry[] Locals;
|
||||
public readonly Type[] LocalTypes;
|
||||
|
||||
public readonly MonoSymbolFile SymbolFile;
|
||||
|
||||
public static int Size {
|
||||
get { return 52; }
|
||||
}
|
||||
|
||||
public string Name {
|
||||
get { return name; }
|
||||
}
|
||||
|
||||
public string FullName {
|
||||
get { return full_name; }
|
||||
}
|
||||
|
||||
public MethodBase MethodBase {
|
||||
get { return SymbolFile.Assembly.MonoDebugger_GetMethod (Token); }
|
||||
public static int Size
|
||||
{
|
||||
get {
|
||||
return 44;
|
||||
}
|
||||
}
|
||||
|
||||
internal MethodEntry (MonoSymbolFile file, BinaryReader reader, int index)
|
||||
public MethodEntry (IMonoBinaryReader reader)
|
||||
{
|
||||
this.SymbolFile = file;
|
||||
this.index = index;
|
||||
SourceFileIndex = reader.ReadInt32 ();
|
||||
Token = reader.ReadInt32 ();
|
||||
StartRow = reader.ReadInt32 ();
|
||||
EndRow = reader.ReadInt32 ();
|
||||
ClassTypeIndex = reader.ReadInt32 ();
|
||||
ThisTypeIndex = reader.ReadInt32 ();
|
||||
NumParameters = reader.ReadInt32 ();
|
||||
NumLocals = reader.ReadInt32 ();
|
||||
NumLineNumbers = reader.ReadInt32 ();
|
||||
NameOffset = reader.ReadInt32 ();
|
||||
FullNameOffset = reader.ReadInt32 ();
|
||||
TypeIndexTableOffset = reader.ReadInt32 ();
|
||||
LocalVariableTableOffset = reader.ReadInt32 ();
|
||||
SourceFileOffset = reader.ReadInt32 ();
|
||||
LineNumberTableOffset = reader.ReadInt32 ();
|
||||
NamespaceID = reader.ReadInt32 ();
|
||||
|
||||
name = file.ReadString (NameOffset);
|
||||
full_name = file.ReadString (FullNameOffset);
|
||||
|
||||
SourceFile = file.GetSourceFile (SourceFileIndex);
|
||||
if (SourceFileOffset != 0) {
|
||||
long old_pos = reader.Position;
|
||||
reader.Position = SourceFileOffset;
|
||||
int source_file_length = reader.ReadInt32 ();
|
||||
byte[] source_file = reader.ReadBuffer (source_file_length);
|
||||
SourceFile = Encoding.UTF8.GetString (source_file);
|
||||
reader.Position = old_pos;
|
||||
}
|
||||
|
||||
if (LineNumberTableOffset != 0) {
|
||||
long old_pos = reader.BaseStream.Position;
|
||||
reader.BaseStream.Position = LineNumberTableOffset;
|
||||
long old_pos = reader.Position;
|
||||
reader.Position = LineNumberTableOffset;
|
||||
|
||||
LineNumbers = new LineNumberEntry [NumLineNumbers];
|
||||
|
||||
for (int i = 0; i < NumLineNumbers; i++)
|
||||
LineNumbers [i] = new LineNumberEntry (reader);
|
||||
|
||||
reader.BaseStream.Position = old_pos;
|
||||
reader.Position = old_pos;
|
||||
}
|
||||
|
||||
if (LocalVariableTableOffset != 0) {
|
||||
long old_pos = reader.BaseStream.Position;
|
||||
reader.BaseStream.Position = LocalVariableTableOffset;
|
||||
long old_pos = reader.Position;
|
||||
reader.Position = LocalVariableTableOffset;
|
||||
|
||||
Locals = new LocalVariableEntry [NumLocals];
|
||||
LocalTypes = new Type [NumLocals];
|
||||
|
||||
Assembly ass = file.Assembly;
|
||||
|
||||
for (int i = 0; i < NumLocals; i++) {
|
||||
for (int i = 0; i < NumLocals; i++)
|
||||
Locals [i] = new LocalVariableEntry (reader);
|
||||
LocalTypes [i] = ass.MonoDebugger_GetLocalTypeFromSignature (
|
||||
Locals [i].Signature);
|
||||
}
|
||||
|
||||
reader.BaseStream.Position = old_pos;
|
||||
reader.Position = old_pos;
|
||||
}
|
||||
|
||||
if (TypeIndexTableOffset != 0) {
|
||||
long old_pos = reader.BaseStream.Position;
|
||||
reader.BaseStream.Position = TypeIndexTableOffset;
|
||||
long old_pos = reader.Position;
|
||||
reader.Position = TypeIndexTableOffset;
|
||||
|
||||
ParamTypeIndices = new int [NumParameters];
|
||||
LocalTypeIndices = new int [NumLocals];
|
||||
@@ -510,180 +368,52 @@ namespace Mono.CSharp.Debugger
|
||||
for (int i = 0; i < NumLocals; i++)
|
||||
LocalTypeIndices [i] = reader.ReadInt32 ();
|
||||
|
||||
reader.BaseStream.Position = old_pos;
|
||||
reader.Position = old_pos;
|
||||
}
|
||||
}
|
||||
|
||||
internal MethodEntry (MonoSymbolFile file, SourceFileEntry source, MethodBase method,
|
||||
int token, LocalVariableEntry[] locals, LineNumberEntry[] lines,
|
||||
int start_row, int end_row, int namespace_id)
|
||||
internal MethodEntry (int token, int sf_offset, string source_file,
|
||||
int this_type_index, int[] param_type_indices,
|
||||
int[] local_type_indices, LocalVariableEntry[] locals,
|
||||
LineNumberEntry[] lines, int lnt_offset,
|
||||
int start_row, int end_row)
|
||||
{
|
||||
this.SymbolFile = file;
|
||||
index = file.GetNextMethodIndex ();
|
||||
|
||||
Token = token;
|
||||
SourceFileIndex = source.Index;
|
||||
SourceFile = source;
|
||||
StartRow = start_row;
|
||||
EndRow = end_row;
|
||||
NamespaceID = namespace_id;
|
||||
|
||||
LineNumbers = BuildLineNumberTable (lines);
|
||||
NumLineNumbers = LineNumbers.Length;
|
||||
|
||||
ParameterInfo[] parameters = method.GetParameters ();
|
||||
if (parameters == null)
|
||||
parameters = new ParameterInfo [0];
|
||||
|
||||
StringBuilder sb = new StringBuilder ();
|
||||
sb.Append (method.DeclaringType.FullName);
|
||||
sb.Append (".");
|
||||
sb.Append (method.Name);
|
||||
sb.Append ("(");
|
||||
for (int i = 0; i < parameters.Length; i++) {
|
||||
if (i > 0)
|
||||
sb.Append (",");
|
||||
sb.Append (parameters [i].ParameterType.FullName);
|
||||
}
|
||||
sb.Append (")");
|
||||
|
||||
name = method.Name;
|
||||
full_name = sb.ToString ();
|
||||
|
||||
NumParameters = parameters.Length;
|
||||
ParamTypeIndices = new int [NumParameters];
|
||||
for (int i = 0; i < NumParameters; i++)
|
||||
ParamTypeIndices [i] = file.DefineType (parameters [i].ParameterType);
|
||||
|
||||
NumLocals = locals.Length;
|
||||
Locals = locals;
|
||||
|
||||
LocalTypeIndices = new int [NumLocals];
|
||||
for (int i = 0; i < NumLocals; i++)
|
||||
LocalTypeIndices [i] = file.GetNextTypeIndex ();
|
||||
|
||||
ClassTypeIndex = file.DefineType (method.ReflectedType);
|
||||
this.Token = token;
|
||||
this.StartRow = start_row;
|
||||
this.EndRow = end_row;
|
||||
this.NumLineNumbers = lines.Length;
|
||||
this.ThisTypeIndex = this_type_index;
|
||||
this.NumParameters = param_type_indices.Length;
|
||||
this.NumLocals = local_type_indices.Length;
|
||||
this.ParamTypeIndices = param_type_indices;
|
||||
this.LocalTypeIndices = local_type_indices;
|
||||
this.Locals = locals;
|
||||
this.SourceFileOffset = sf_offset;
|
||||
this.LineNumberTableOffset = lnt_offset;
|
||||
this.SourceFile = source_file;
|
||||
this.LineNumbers = lines;
|
||||
}
|
||||
|
||||
LineNumberEntry[] BuildLineNumberTable (LineNumberEntry[] line_numbers)
|
||||
internal void Write (BinaryWriter bw)
|
||||
{
|
||||
ArrayList list = new ArrayList ();
|
||||
int last_offset = -1;
|
||||
int last_row = -1;
|
||||
|
||||
for (int i = 0; i < line_numbers.Length; i++) {
|
||||
LineNumberEntry line = (LineNumberEntry) line_numbers [i];
|
||||
|
||||
if (line.Offset > last_offset) {
|
||||
if (last_row >= 0)
|
||||
list.Add (new LineNumberEntry (last_row, last_offset));
|
||||
last_row = line.Row;
|
||||
last_offset = line.Offset;
|
||||
} else if (line.Row > last_row) {
|
||||
last_row = line.Row;
|
||||
}
|
||||
}
|
||||
|
||||
if (last_row >= 0)
|
||||
list.Add (new LineNumberEntry (last_row, last_offset));
|
||||
|
||||
LineNumberEntry[] retval = new LineNumberEntry [list.Count];
|
||||
list.CopyTo (retval, 0);
|
||||
return retval;
|
||||
}
|
||||
|
||||
internal MethodSourceEntry Write (MonoSymbolFile file, BinaryWriter bw)
|
||||
{
|
||||
NameOffset = (int) bw.BaseStream.Position;
|
||||
file.WriteString (bw, name);
|
||||
|
||||
FullNameOffset = (int) bw.BaseStream.Position;
|
||||
file.WriteString (bw, full_name);
|
||||
|
||||
TypeIndexTableOffset = (int) bw.BaseStream.Position;
|
||||
|
||||
for (int i = 0; i < NumParameters; i++)
|
||||
bw.Write (ParamTypeIndices [i]);
|
||||
for (int i = 0; i < NumLocals; i++)
|
||||
bw.Write (LocalTypeIndices [i]);
|
||||
|
||||
LocalVariableTableOffset = (int) bw.BaseStream.Position;
|
||||
|
||||
for (int i = 0; i < NumLocals; i++)
|
||||
Locals [i].Write (file, bw);
|
||||
|
||||
LineNumberTableOffset = (int) bw.BaseStream.Position;
|
||||
|
||||
for (int i = 0; i < NumLineNumbers; i++)
|
||||
LineNumbers [i].Write (bw);
|
||||
|
||||
file.LineNumberCount += NumLineNumbers;
|
||||
file.LocalCount += NumLocals;
|
||||
|
||||
file_offset = (int) bw.BaseStream.Position;
|
||||
|
||||
index_entry = new MethodIndexEntry (file_offset, FullNameOffset, Token);
|
||||
|
||||
bw.Write (SourceFileIndex);
|
||||
bw.Write (Token);
|
||||
bw.Write (StartRow);
|
||||
bw.Write (EndRow);
|
||||
bw.Write (ClassTypeIndex);
|
||||
bw.Write (ThisTypeIndex);
|
||||
bw.Write (NumParameters);
|
||||
bw.Write (NumLocals);
|
||||
bw.Write (NumLineNumbers);
|
||||
bw.Write (NameOffset);
|
||||
bw.Write (FullNameOffset);
|
||||
bw.Write (TypeIndexTableOffset);
|
||||
bw.Write (LocalVariableTableOffset);
|
||||
bw.Write (SourceFileOffset);
|
||||
bw.Write (LineNumberTableOffset);
|
||||
bw.Write (NamespaceID);
|
||||
|
||||
return new MethodSourceEntry (index, file_offset, StartRow, EndRow);
|
||||
}
|
||||
|
||||
internal void WriteIndex (BinaryWriter bw)
|
||||
{
|
||||
index_entry.Write (bw);
|
||||
}
|
||||
|
||||
public override string ToString ()
|
||||
{
|
||||
return String.Format ("[Method {0}:{1}:{2}:{3}:{4} - {7}:{8}:{9}:{10} - {5} - {6}]",
|
||||
index, Token, SourceFileIndex, StartRow, EndRow,
|
||||
SourceFile, FullName, ClassTypeIndex, NumParameters,
|
||||
NumLocals, NumLineNumbers);
|
||||
}
|
||||
}
|
||||
|
||||
public struct NamespaceEntry
|
||||
{
|
||||
public readonly string Name;
|
||||
public readonly int Index;
|
||||
public readonly int Parent;
|
||||
public readonly string[] UsingClauses;
|
||||
|
||||
public NamespaceEntry (string name, int index, string[] using_clauses, int parent)
|
||||
{
|
||||
this.Name = name;
|
||||
this.Index = index;
|
||||
this.Parent = parent;
|
||||
this.UsingClauses = using_clauses != null ? using_clauses : new string [0];
|
||||
}
|
||||
|
||||
internal void Write (MonoSymbolFile file, BinaryWriter bw)
|
||||
{
|
||||
file.WriteString (bw, Name);
|
||||
bw.Write (Index);
|
||||
bw.Write (Parent);
|
||||
bw.Write (UsingClauses.Length);
|
||||
foreach (string uc in UsingClauses)
|
||||
file.WriteString (bw, uc);
|
||||
}
|
||||
|
||||
public override string ToString ()
|
||||
{
|
||||
return String.Format ("[Namespace {0}:{1}:{2}]", Name, Index, Parent);
|
||||
return String.Format ("[Method {0}:{1}:{2}:{3}:{4} - {5}:{6}]",
|
||||
Token, SourceFile, StartRow, EndRow,
|
||||
NumLineNumbers, SourceFileOffset, LineNumberTableOffset);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,213 @@
|
||||
//
|
||||
// System.Diagnostics.SymbolStore/MonoSymbolTableWriter.cs
|
||||
//
|
||||
// Author:
|
||||
// Martin Baulig ([email protected])
|
||||
//
|
||||
// (C) 2002 Ximian, Inc. http://www.ximian.com
|
||||
//
|
||||
|
||||
using System;
|
||||
using System.Reflection;
|
||||
using System.Reflection.Emit;
|
||||
using System.Collections;
|
||||
using System.Text;
|
||||
using System.IO;
|
||||
|
||||
namespace Mono.CSharp.Debugger
|
||||
{
|
||||
internal class MonoSymbolTableWriter : IDisposable
|
||||
{
|
||||
BinaryWriter bw;
|
||||
Hashtable type_hash;
|
||||
int last_type_index;
|
||||
|
||||
public MonoSymbolTableWriter (string output_filename)
|
||||
{
|
||||
FileStream stream = new FileStream (output_filename, FileMode.Create);
|
||||
bw = new BinaryWriter (stream);
|
||||
type_hash = new Hashtable ();
|
||||
}
|
||||
|
||||
int GetTypeIndex (Type type)
|
||||
{
|
||||
if (type_hash.Contains (type))
|
||||
return (int) type_hash [type];
|
||||
|
||||
int index = ++last_type_index;
|
||||
type_hash.Add (type, index);
|
||||
return index;
|
||||
}
|
||||
|
||||
public void WriteSymbolTable (MonoSymbolWriter symwriter)
|
||||
{
|
||||
// Magic number and file version.
|
||||
bw.Write (OffsetTable.Magic);
|
||||
bw.Write (OffsetTable.Version);
|
||||
|
||||
OffsetTable ot = new OffsetTable ();
|
||||
|
||||
//
|
||||
// Offsets of file sections; we must write this after we're done
|
||||
// writing the whole file, so we just reserve the space for it here.
|
||||
//
|
||||
long offset_table_offset = bw.BaseStream.Position;
|
||||
ot.Write (bw);
|
||||
|
||||
//
|
||||
// Write source file table.
|
||||
//
|
||||
Hashtable sources = new Hashtable ();
|
||||
|
||||
ot.source_table_offset = (int) bw.BaseStream.Position;
|
||||
foreach (SourceFile source in symwriter.Sources) {
|
||||
if (sources.ContainsKey (source))
|
||||
continue;
|
||||
|
||||
sources.Add (source, (int) bw.BaseStream.Position);
|
||||
byte[] file_name = Encoding.UTF8.GetBytes (source.FileName);
|
||||
bw.Write ((int) file_name.Length);
|
||||
bw.Write (file_name);
|
||||
}
|
||||
ot.source_table_size = (int) bw.BaseStream.Position - ot.source_table_offset;
|
||||
|
||||
Hashtable source_table = new Hashtable ();
|
||||
|
||||
//
|
||||
// Write line number table
|
||||
//
|
||||
ArrayList methods = new ArrayList ();
|
||||
|
||||
int num_methods = 0;
|
||||
|
||||
ot.line_number_table_offset = (int) bw.BaseStream.Position;
|
||||
foreach (SourceMethod method in symwriter.Methods) {
|
||||
if (method.Start == null || method.Start.Row == 0)
|
||||
continue;
|
||||
|
||||
int count = method.Lines.Length;
|
||||
LineNumberEntry[] lines = new LineNumberEntry [count];
|
||||
|
||||
int pos = (int) bw.BaseStream.Position;
|
||||
|
||||
int num_params = method.Parameters.Length;
|
||||
int[] param_type_indices = new int [num_params];
|
||||
for (int i = 0; i < num_params; i++) {
|
||||
Type type = method.Parameters [i].ParameterType;
|
||||
param_type_indices [i] = GetTypeIndex (type);
|
||||
}
|
||||
|
||||
int num_locals = method.Locals.Length;
|
||||
int[] local_type_indices = new int [num_locals];
|
||||
for (int i = 0; i < num_locals; i++)
|
||||
local_type_indices [i] = ++last_type_index;
|
||||
|
||||
int type_index_table_offset = ot.type_index_table_size;
|
||||
ot.type_index_table_size += 4 * (num_params + num_locals);
|
||||
|
||||
int this_type_index = 0;
|
||||
if (!method.MethodBase.IsStatic)
|
||||
this_type_index = GetTypeIndex (method.MethodBase.ReflectedType);
|
||||
|
||||
for (int i = 0; i < count; i++) {
|
||||
lines [i] = new LineNumberEntry (method.Lines [i]);
|
||||
lines [i].Write (bw);
|
||||
}
|
||||
|
||||
MethodEntry entry = new MethodEntry (
|
||||
(int) method.Token, (int) sources [method.SourceFile],
|
||||
method.SourceFile.FileName, this_type_index,
|
||||
param_type_indices, local_type_indices, method.Locals, lines, pos,
|
||||
(int) method.Start.Row, (int) method.End.Row);
|
||||
|
||||
methods.Add (entry);
|
||||
}
|
||||
ot.line_number_table_size = (int) bw.BaseStream.Position -
|
||||
ot.line_number_table_offset;
|
||||
|
||||
//
|
||||
// Write type index table.
|
||||
//
|
||||
|
||||
ot.type_index_table_offset = (int) bw.BaseStream.Position;
|
||||
for (int i = 0; i < methods.Count; i++) {
|
||||
MethodEntry entry = (MethodEntry) methods [i];
|
||||
|
||||
entry.TypeIndexTableOffset = (int) bw.BaseStream.Position;
|
||||
|
||||
for (int j = 0; j < entry.NumParameters; j++)
|
||||
bw.Write (entry.ParamTypeIndices [j]);
|
||||
for (int j = 0; j < entry.NumLocals; j++)
|
||||
bw.Write (entry.LocalTypeIndices [j]);
|
||||
}
|
||||
ot.type_index_table_size = (int) bw.BaseStream.Position -
|
||||
ot.type_index_table_offset;
|
||||
|
||||
//
|
||||
// Write local variable table.
|
||||
//
|
||||
|
||||
ot.local_variable_table_offset = (int) bw.BaseStream.Position;
|
||||
for (int i = 0; i < methods.Count; i++) {
|
||||
MethodEntry entry = (MethodEntry) methods [i];
|
||||
|
||||
entry.LocalVariableTableOffset = (int) bw.BaseStream.Position;
|
||||
|
||||
for (int j = 0; j < entry.NumLocals; j++)
|
||||
entry.Locals [j].Write (bw);
|
||||
}
|
||||
ot.local_variable_table_size = (int) bw.BaseStream.Position -
|
||||
ot.local_variable_table_offset;
|
||||
|
||||
//
|
||||
// Write method table
|
||||
//
|
||||
ot.method_count = methods.Count;
|
||||
ot.method_table_offset = (int) bw.BaseStream.Position;
|
||||
for (int i = 0; i < methods.Count; i++) {
|
||||
MethodEntry entry = (MethodEntry) methods [i];
|
||||
SourceFileEntry source = (SourceFileEntry) source_table [entry.SourceFileOffset];
|
||||
if (source == null) {
|
||||
source = new SourceFileEntry (entry.SourceFile);
|
||||
source_table.Add (entry.SourceFileOffset, source);
|
||||
}
|
||||
|
||||
source.AddMethod (new MethodSourceEntry (
|
||||
i, (int) bw.BaseStream.Position, entry.StartRow, entry.EndRow));
|
||||
|
||||
entry.Write (bw);
|
||||
}
|
||||
ot.method_table_size = (int) bw.BaseStream.Position - ot.method_table_offset;
|
||||
|
||||
//
|
||||
// Write source file table.
|
||||
//
|
||||
ot.source_file_count = source_table.Count;
|
||||
ot.source_file_table_offset = (int) bw.BaseStream.Position;
|
||||
foreach (SourceFileEntry source in source_table.Values)
|
||||
source.Write (bw);
|
||||
ot.source_file_table_size = (int) bw.BaseStream.Position - ot.source_file_table_offset;
|
||||
|
||||
//
|
||||
// Write offset table
|
||||
//
|
||||
ot.type_count = last_type_index;
|
||||
ot.total_file_size = (int) bw.BaseStream.Position;
|
||||
bw.Seek ((int) offset_table_offset, SeekOrigin.Begin);
|
||||
ot.Write (bw);
|
||||
bw.Seek (0, SeekOrigin.End);
|
||||
}
|
||||
|
||||
void IDisposable.Dispose() {
|
||||
Dispose (true);
|
||||
}
|
||||
|
||||
protected virtual void Dispose (bool disposing)
|
||||
{
|
||||
if (disposing)
|
||||
{
|
||||
bw.Close ();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -20,15 +20,28 @@ using System.IO;
|
||||
|
||||
namespace Mono.CSharp.Debugger
|
||||
{
|
||||
internal class SourceFile : SourceFileEntry, ISymbolDocumentWriter
|
||||
internal class SourceFile
|
||||
{
|
||||
private ArrayList _methods = new ArrayList ();
|
||||
private string _file_name;
|
||||
|
||||
public SourceFile (MonoSymbolFile file, string filename)
|
||||
: base (file, filename)
|
||||
{ }
|
||||
public SourceFile (string filename)
|
||||
{
|
||||
this._file_name = filename;
|
||||
}
|
||||
|
||||
public new SourceMethod[] Methods {
|
||||
public override string ToString ()
|
||||
{
|
||||
return _file_name;
|
||||
}
|
||||
|
||||
public string FileName {
|
||||
get {
|
||||
return _file_name;
|
||||
}
|
||||
}
|
||||
|
||||
public SourceMethod[] Methods {
|
||||
get {
|
||||
SourceMethod[] retval = new SourceMethod [_methods.Count];
|
||||
_methods.CopyTo (retval);
|
||||
@@ -40,16 +53,6 @@ namespace Mono.CSharp.Debugger
|
||||
{
|
||||
_methods.Add (method);
|
||||
}
|
||||
|
||||
void ISymbolDocumentWriter.SetCheckSum (Guid algorithmId, byte[] checkSum)
|
||||
{
|
||||
throw new NotSupportedException ();
|
||||
}
|
||||
|
||||
void ISymbolDocumentWriter.SetSource (byte[] source)
|
||||
{
|
||||
throw new NotSupportedException ();
|
||||
}
|
||||
}
|
||||
|
||||
internal class SourceBlock
|
||||
@@ -57,21 +60,30 @@ namespace Mono.CSharp.Debugger
|
||||
static private int next_index;
|
||||
private readonly int _index;
|
||||
|
||||
public SourceBlock (SourceMethod method, SourceLine start, SourceLine end)
|
||||
{
|
||||
this._method = method;
|
||||
this._start = start;
|
||||
this._end = end;
|
||||
this._index = ++next_index;
|
||||
}
|
||||
|
||||
internal SourceBlock (SourceMethod method, int startOffset)
|
||||
{
|
||||
this._method = method;
|
||||
this._start_offset = startOffset;
|
||||
this._start = new SourceLine (startOffset);
|
||||
this._index = ++next_index;
|
||||
}
|
||||
|
||||
public override string ToString ()
|
||||
{
|
||||
return "SourceBlock #" + ID;
|
||||
return "SourceBlock #" + ID + " (" + Start + " - " + End + ")";
|
||||
}
|
||||
|
||||
private readonly SourceMethod _method;
|
||||
private ArrayList _blocks = new ArrayList ();
|
||||
internal int _start_offset, _end_offset;
|
||||
internal SourceLine _start;
|
||||
internal SourceLine _end;
|
||||
|
||||
private ArrayList _locals = new ArrayList ();
|
||||
|
||||
@@ -94,6 +106,18 @@ namespace Mono.CSharp.Debugger
|
||||
_blocks.Add (block);
|
||||
}
|
||||
|
||||
public SourceLine Start {
|
||||
get {
|
||||
return _start;
|
||||
}
|
||||
}
|
||||
|
||||
public SourceLine End {
|
||||
get {
|
||||
return _end;
|
||||
}
|
||||
}
|
||||
|
||||
public int ID {
|
||||
get {
|
||||
return _index;
|
||||
@@ -114,6 +138,63 @@ namespace Mono.CSharp.Debugger
|
||||
}
|
||||
}
|
||||
|
||||
internal class SourceLine
|
||||
{
|
||||
public SourceLine (int row, int column)
|
||||
: this (0, row, column)
|
||||
{
|
||||
this._type = SourceOffsetType.OFFSET_NONE;
|
||||
}
|
||||
|
||||
public SourceLine (int offset, int row, int column)
|
||||
{
|
||||
this._offset = offset;
|
||||
this._row = row;
|
||||
this._column = column;
|
||||
this._type = SourceOffsetType.OFFSET_IL;
|
||||
}
|
||||
|
||||
internal SourceLine (int offset)
|
||||
: this (offset, 0, 0)
|
||||
{ }
|
||||
|
||||
public override string ToString ()
|
||||
{
|
||||
return "SourceLine (" + _offset + "@" + _row + ":" + _column + ")";
|
||||
}
|
||||
|
||||
internal SourceOffsetType _type;
|
||||
internal int _offset;
|
||||
internal int _row;
|
||||
internal int _column;
|
||||
|
||||
// interface SourceLine
|
||||
|
||||
public SourceOffsetType OffsetType {
|
||||
get {
|
||||
return _type;
|
||||
}
|
||||
}
|
||||
|
||||
public int Offset {
|
||||
get {
|
||||
return _offset;
|
||||
}
|
||||
}
|
||||
|
||||
public int Row {
|
||||
get {
|
||||
return _row;
|
||||
}
|
||||
}
|
||||
|
||||
public int Column {
|
||||
get {
|
||||
return _column;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
internal class SourceMethod
|
||||
{
|
||||
private ArrayList _lines = new ArrayList ();
|
||||
@@ -124,25 +205,32 @@ namespace Mono.CSharp.Debugger
|
||||
internal readonly MethodBase _method_base;
|
||||
internal SourceFile _source_file;
|
||||
internal int _token;
|
||||
private int _namespace_id;
|
||||
private LineNumberEntry _start, _end;
|
||||
|
||||
private SourceBlock _implicit_block;
|
||||
|
||||
internal SourceMethod (SourceFile source_file, int startLine, int startColumn,
|
||||
int endLine, int endColumn, MethodBase method_base,
|
||||
int namespace_id)
|
||||
public SourceMethod (MethodBase method_base, SourceFile source_file)
|
||||
: this (method_base)
|
||||
{
|
||||
this._source_file = source_file;
|
||||
}
|
||||
|
||||
internal SourceMethod (MethodBase method_base)
|
||||
{
|
||||
this._method_base = method_base;
|
||||
this._source_file = source_file;
|
||||
this._namespace_id = namespace_id;
|
||||
|
||||
this._start = new LineNumberEntry (startLine, 0);
|
||||
this._end = new LineNumberEntry (endLine, 0);
|
||||
|
||||
this._implicit_block = new SourceBlock (this, 0);
|
||||
}
|
||||
|
||||
public void SetSourceRange (SourceFile sourceFile,
|
||||
int startLine, int startColumn,
|
||||
int endLine, int endColumn)
|
||||
{
|
||||
_source_file = sourceFile;
|
||||
_implicit_block._start = new SourceLine (startLine, startColumn);
|
||||
_implicit_block._end = new SourceLine (endLine, endColumn);
|
||||
}
|
||||
|
||||
|
||||
public void StartBlock (SourceBlock block)
|
||||
{
|
||||
_block_stack.Push (block);
|
||||
@@ -151,7 +239,7 @@ namespace Mono.CSharp.Debugger
|
||||
public void EndBlock (int endOffset) {
|
||||
SourceBlock block = (SourceBlock) _block_stack.Pop ();
|
||||
|
||||
block._end_offset = endOffset;
|
||||
block._end = new SourceLine (endOffset);
|
||||
|
||||
if (_block_stack.Count > 0) {
|
||||
SourceBlock parent = (SourceBlock) _block_stack.Peek ();
|
||||
@@ -166,8 +254,8 @@ namespace Mono.CSharp.Debugger
|
||||
public void SetBlockRange (int BlockID, int startOffset, int endOffset)
|
||||
{
|
||||
SourceBlock block = (SourceBlock) _block_hash [BlockID];
|
||||
block._start_offset = startOffset;
|
||||
block._end_offset = endOffset;
|
||||
((SourceLine) block.Start)._offset = startOffset;
|
||||
((SourceLine) block.End)._offset = endOffset;
|
||||
}
|
||||
|
||||
public SourceBlock CurrentBlock {
|
||||
@@ -179,15 +267,15 @@ namespace Mono.CSharp.Debugger
|
||||
}
|
||||
}
|
||||
|
||||
public LineNumberEntry[] Lines {
|
||||
public SourceLine[] Lines {
|
||||
get {
|
||||
LineNumberEntry[] retval = new LineNumberEntry [_lines.Count];
|
||||
SourceLine[] retval = new SourceLine [_lines.Count];
|
||||
_lines.CopyTo (retval);
|
||||
return retval;
|
||||
}
|
||||
}
|
||||
|
||||
public void AddLine (LineNumberEntry line)
|
||||
public void AddLine (SourceLine line)
|
||||
{
|
||||
_lines.Add (line);
|
||||
}
|
||||
@@ -262,39 +350,28 @@ namespace Mono.CSharp.Debugger
|
||||
}
|
||||
}
|
||||
|
||||
public bool HasSource {
|
||||
public SourceLine Start {
|
||||
get {
|
||||
return _source_file != null;
|
||||
return _implicit_block.Start;
|
||||
}
|
||||
}
|
||||
|
||||
public LineNumberEntry Start {
|
||||
public SourceLine End {
|
||||
get {
|
||||
return _start;
|
||||
}
|
||||
}
|
||||
|
||||
public LineNumberEntry End {
|
||||
get {
|
||||
return _end;
|
||||
}
|
||||
}
|
||||
|
||||
public int NamespaceID {
|
||||
get {
|
||||
return _namespace_id;
|
||||
return _implicit_block.End;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public class MonoSymbolWriter : IMonoSymbolWriter
|
||||
{
|
||||
protected Assembly assembly;
|
||||
protected ModuleBuilder module_builder;
|
||||
protected ArrayList locals = null;
|
||||
protected ArrayList orphant_methods = null;
|
||||
protected ArrayList methods = null;
|
||||
protected Hashtable sources = null;
|
||||
private MonoSymbolFile file = null;
|
||||
private ArrayList mbuilder_array = null;
|
||||
|
||||
internal SourceMethod[] Methods {
|
||||
get {
|
||||
@@ -313,31 +390,31 @@ namespace Mono.CSharp.Debugger
|
||||
}
|
||||
|
||||
private SourceMethod current_method = null;
|
||||
private string assembly_filename = null;
|
||||
private string output_filename = null;
|
||||
|
||||
//
|
||||
// Interface IMonoSymbolWriter
|
||||
//
|
||||
|
||||
public MonoSymbolWriter (ModuleBuilder mb)
|
||||
public MonoSymbolWriter (ModuleBuilder mb, string filename, ArrayList mbuilder_array)
|
||||
{
|
||||
this.assembly_filename = filename;
|
||||
this.module_builder = mb;
|
||||
this.methods = new ArrayList ();
|
||||
this.sources = new Hashtable ();
|
||||
this.orphant_methods = new ArrayList ();
|
||||
this.locals = new ArrayList ();
|
||||
this.file = new MonoSymbolFile ();
|
||||
this.mbuilder_array = mbuilder_array;
|
||||
}
|
||||
|
||||
public void Close ()
|
||||
{
|
||||
throw new InvalidOperationException ();
|
||||
}
|
||||
public void Close () {
|
||||
if (assembly == null)
|
||||
assembly = Assembly.LoadFrom (assembly_filename);
|
||||
|
||||
public byte[] CreateSymbolFile (AssemblyBuilder assembly_builder)
|
||||
{
|
||||
DoFixups (assembly_builder);
|
||||
DoFixups (assembly);
|
||||
|
||||
return CreateOutput (assembly_builder);
|
||||
CreateOutput (assembly);
|
||||
}
|
||||
|
||||
public void CloseNamespace () {
|
||||
@@ -349,9 +426,7 @@ namespace Mono.CSharp.Debugger
|
||||
Guid languageVendor,
|
||||
Guid documentType)
|
||||
{
|
||||
SourceFile source_info = new SourceFile (file, url);
|
||||
sources.Add (url, source_info);
|
||||
return source_info;
|
||||
return new MonoSymbolDocumentWriter (url);
|
||||
}
|
||||
|
||||
public void DefineField (
|
||||
@@ -412,17 +487,14 @@ namespace Mono.CSharp.Debugger
|
||||
int[] columns,
|
||||
int[] endLines,
|
||||
int[] endColumns)
|
||||
{
|
||||
throw new NotSupportedException ();
|
||||
}
|
||||
|
||||
public void MarkSequencePoint (int offset, int line, int column)
|
||||
{
|
||||
if (current_method == null)
|
||||
return;
|
||||
|
||||
LineNumberEntry source_line = new LineNumberEntry (line, offset);
|
||||
current_method.AddLine (source_line);
|
||||
SourceLine source_line = new SourceLine (offsets [0], lines [0], columns [0]);
|
||||
|
||||
if (current_method != null)
|
||||
current_method.AddLine (source_line);
|
||||
}
|
||||
|
||||
public void Initialize (IntPtr emitter, string filename, bool fFullBuild)
|
||||
@@ -430,9 +502,26 @@ namespace Mono.CSharp.Debugger
|
||||
throw new NotSupportedException ();
|
||||
}
|
||||
|
||||
public void Initialize (string assembly_filename, string filename, string[] args)
|
||||
{
|
||||
this.output_filename = filename;
|
||||
this.assembly_filename = assembly_filename;
|
||||
}
|
||||
|
||||
public void OpenMethod (SymbolToken symbol_token)
|
||||
{
|
||||
throw new NotSupportedException ();
|
||||
int token = symbol_token.GetToken ();
|
||||
|
||||
if ((token & 0xff000000) != 0x06000000)
|
||||
throw new ArgumentException ();
|
||||
|
||||
int index = (token & 0xffffff) - 1;
|
||||
|
||||
MethodBase mb = (MethodBase) mbuilder_array [index];
|
||||
|
||||
current_method = new SourceMethod (mb);
|
||||
|
||||
methods.Add (current_method);
|
||||
}
|
||||
|
||||
public void SetMethodSourceRange (ISymbolDocumentWriter startDoc,
|
||||
@@ -440,21 +529,32 @@ namespace Mono.CSharp.Debugger
|
||||
ISymbolDocumentWriter endDoc,
|
||||
int endLine, int endColumn)
|
||||
{
|
||||
throw new NotSupportedException ();
|
||||
}
|
||||
if (current_method == null)
|
||||
return;
|
||||
|
||||
public void OpenMethod (ISymbolDocumentWriter document, int startLine, int startColumn,
|
||||
int endLine, int endColumn, MethodBase method, int namespace_id)
|
||||
{
|
||||
SourceFile source_info = document as SourceFile;
|
||||
|
||||
if ((source_info == null) || (method == null))
|
||||
if ((startDoc == null) || (endDoc == null))
|
||||
throw new NullReferenceException ();
|
||||
|
||||
current_method = new SourceMethod (source_info, startLine, startColumn,
|
||||
endLine, endColumn, method, namespace_id);
|
||||
if (!(startDoc is MonoSymbolDocumentWriter) || !(endDoc is MonoSymbolDocumentWriter))
|
||||
throw new NotSupportedException ("both startDoc and endDoc must be of type "
|
||||
+ "MonoSymbolDocumentWriter");
|
||||
|
||||
if (!startDoc.Equals (endDoc))
|
||||
throw new NotSupportedException ("startDoc and endDoc must be the same");
|
||||
|
||||
string source_file = ((MonoSymbolDocumentWriter) startDoc).FileName;
|
||||
SourceFile source_info;
|
||||
|
||||
if (sources.ContainsKey (source_file))
|
||||
source_info = (SourceFile) sources [source_file];
|
||||
else {
|
||||
source_info = new SourceFile (source_file);
|
||||
sources.Add (source_file, source_info);
|
||||
}
|
||||
|
||||
current_method.SetSourceRange (source_info, startLine, startColumn,
|
||||
endLine, endColumn);
|
||||
|
||||
methods.Add (current_method);
|
||||
source_info.AddMethod (current_method);
|
||||
}
|
||||
|
||||
@@ -462,19 +562,6 @@ namespace Mono.CSharp.Debugger
|
||||
current_method = null;
|
||||
}
|
||||
|
||||
public int DefineNamespace (string name, ISymbolDocumentWriter document,
|
||||
string[] using_clauses, int parent)
|
||||
{
|
||||
if ((document == null) || (using_clauses == null))
|
||||
throw new NullReferenceException ();
|
||||
if (!(document is SourceFile))
|
||||
throw new ArgumentException ();
|
||||
|
||||
SourceFile source_info = (SourceFile) document;
|
||||
|
||||
return source_info.DefineNamespace (name, using_clauses, parent);
|
||||
}
|
||||
|
||||
public void OpenNamespace (string name)
|
||||
{
|
||||
throw new NotSupportedException ();
|
||||
@@ -546,21 +633,10 @@ namespace Mono.CSharp.Debugger
|
||||
}
|
||||
}
|
||||
|
||||
protected byte[] CreateOutput (Assembly assembly)
|
||||
protected void CreateOutput (Assembly assembly)
|
||||
{
|
||||
foreach (SourceMethod method in Methods) {
|
||||
if (!method.HasSource) {
|
||||
Console.WriteLine ("INGORING METHOD: {0}", method);
|
||||
continue;
|
||||
}
|
||||
|
||||
method.SourceFile.DefineMethod (
|
||||
method.MethodBase, method.Token, method.Locals,
|
||||
method.Lines, method.Start.Row, method.End.Row,
|
||||
method.NamespaceID);
|
||||
}
|
||||
|
||||
return file.CreateSymbolFile ();
|
||||
using (MonoSymbolTableWriter writer = new MonoSymbolTableWriter (output_filename))
|
||||
writer.WriteSymbolTable (this);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
IMonoSymbolWriter.cs
|
||||
MonoSymbolDocumentWriter.cs
|
||||
MonoSymbolWriter.cs
|
||||
MonoSymbolTable.cs
|
||||
MonoSymbolFile.cs
|
||||
MonoSymbolTableWriter.cs
|
||||
IMonoBinaryReader.cs
|
||||
@@ -25,7 +25,6 @@ namespace DB2ClientCS
|
||||
private int commandTimeout;
|
||||
private bool prepared = false;
|
||||
private IntPtr hwndStmt; //Our statement handle
|
||||
private DB2ClientParameterCollection parameters = new DB2ClientParameterCollection();
|
||||
|
||||
#endregion
|
||||
|
||||
@@ -66,27 +65,9 @@ namespace DB2ClientCS
|
||||
{
|
||||
}
|
||||
#endregion
|
||||
#region SelfDescribe property
|
||||
///
|
||||
/// Property dictates whether or not any paramter markers will get their describe info
|
||||
/// from the database, or if the user will supply the information
|
||||
///
|
||||
bool selfDescribe = false;
|
||||
public bool SelfDescribe
|
||||
{
|
||||
get
|
||||
{
|
||||
return selfDescribe;
|
||||
}
|
||||
set
|
||||
{
|
||||
selfDescribe = value;
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
#region CommandText property
|
||||
///
|
||||
///The query; If it gets set, reset the prepared property
|
||||
///The query
|
||||
///
|
||||
public string CommandText
|
||||
{
|
||||
@@ -96,7 +77,6 @@ namespace DB2ClientCS
|
||||
}
|
||||
set
|
||||
{
|
||||
prepared = false;
|
||||
commandText = value;
|
||||
}
|
||||
}
|
||||
@@ -153,27 +133,19 @@ namespace DB2ClientCS
|
||||
///
|
||||
/// Parameter list, Not yet implemented
|
||||
///
|
||||
public DB2ClientParameterCollection Parameters
|
||||
public IDataParameterCollection Parameters
|
||||
{
|
||||
get
|
||||
{
|
||||
return parameters;
|
||||
}
|
||||
}
|
||||
IDataParameterCollection IDbCommand.Parameters
|
||||
{
|
||||
get
|
||||
{
|
||||
return parameters;
|
||||
throw new DB2ClientException("TBD");
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Transaction property
|
||||
///
|
||||
/// The transaction this command is associated with
|
||||
///
|
||||
public IDbTransaction Transaction
|
||||
///
|
||||
/// The transaction this command is associated with
|
||||
///
|
||||
public IDbTransaction Transaction
|
||||
{
|
||||
get
|
||||
{
|
||||
@@ -243,7 +215,9 @@ namespace DB2ClientCS
|
||||
///
|
||||
public IDbDataParameter CreateParameter()
|
||||
{
|
||||
throw new DB2ClientException("TBD");
|
||||
//Will wait until I get deeper into the DB2/.Net interface. I'm not sure how
|
||||
//.Net and DB2 parameters talk to each other
|
||||
throw new DB2ClientException("Parameters not yet supported in this driver.");
|
||||
}
|
||||
#endregion
|
||||
#region ExecuteNonQuery
|
||||
@@ -271,16 +245,9 @@ namespace DB2ClientCS
|
||||
///
|
||||
public IDataReader ExecuteReader()
|
||||
{
|
||||
DB2ClientDataReader reader;
|
||||
|
||||
if (!prepared)
|
||||
{
|
||||
ExecuteNonQuery();
|
||||
reader = new DB2ClientDataReader(db2Conn, this);
|
||||
}
|
||||
else
|
||||
reader = new DB2ClientDataReader(db2Conn, this, true);
|
||||
|
||||
|
||||
ExecuteNonQuery();
|
||||
DB2ClientDataReader reader = new DB2ClientDataReader(db2Conn, this);
|
||||
return reader;
|
||||
|
||||
}
|
||||
@@ -299,32 +266,13 @@ namespace DB2ClientCS
|
||||
}
|
||||
#endregion
|
||||
|
||||
|
||||
#region Prepare ()
|
||||
#region Prepare
|
||||
///
|
||||
/// Prepare a statement against the database
|
||||
/// Prepare
|
||||
///
|
||||
public void Prepare ()
|
||||
public void Prepare()
|
||||
{
|
||||
DB2ClientUtils util = new DB2ClientUtils();
|
||||
short sqlRet = 0;
|
||||
|
||||
IntPtr numParams = IntPtr.Zero;
|
||||
sqlRet = DB2ClientPrototypes.SQLPrepare(hwndStmt, commandText, commandText.Length);
|
||||
util.DB2CheckReturn(sqlRet, DB2ClientConstants.SQL_HANDLE_STMT, hwndStmt, "SQLPrepare error.");
|
||||
short i=1;
|
||||
foreach ( DB2ClientParameter param in parameters)
|
||||
{
|
||||
if (selfDescribe)
|
||||
{
|
||||
sqlRet = param.Describe(this.hwndStmt, i);
|
||||
util.DB2CheckReturn(sqlRet, DB2ClientConstants.SQL_HANDLE_STMT, hwndStmt, "Error binding parameter in DB2ClientCommand: ");
|
||||
}
|
||||
sqlRet = param.Bind(this.hwndStmt, i);
|
||||
util.DB2CheckReturn(sqlRet, DB2ClientConstants.SQL_HANDLE_STMT, hwndStmt, "Error binding parameter in DB2ClientCommand: ");
|
||||
i++;
|
||||
}
|
||||
prepared=true;
|
||||
throw new DB2ClientException("TBD");
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
|
||||
@@ -149,11 +149,7 @@ namespace DB2ClientCS
|
||||
///
|
||||
unsafe public void Close()
|
||||
{
|
||||
short sqlRet = 0;
|
||||
// DB2ClientUtils util = new DB2ClientUtils();
|
||||
|
||||
sqlRet = DB2ClientPrototypes.SQLDisconnect(dbHandle);
|
||||
// util.DB2CheckReturn(sqlRet, DB2ClientConstants.SQL_HANDLE_DBC, dbHandle, "Error in Connection->Close: ");
|
||||
DB2ClientPrototypes.SQLDisconnect(dbHandle);
|
||||
dbHandle = new IntPtr(DB2ClientConstants.SQL_NULL_HANDLE);
|
||||
}
|
||||
#endregion
|
||||
|
||||
@@ -35,7 +35,6 @@ namespace DB2ClientCS
|
||||
public const long SQL_STILL_EXECUTING = 2;
|
||||
public const long SQL_ERROR = -1;
|
||||
public const long SQL_INVALID_HANDLE = -2;
|
||||
public const int SQL_NTS = -3;
|
||||
public const long SQL_NULL_HANDLE = 0L;
|
||||
public const short SQL_COMMIT = 0;
|
||||
public const short SQL_ROLLBACK = 1;
|
||||
@@ -56,28 +55,14 @@ namespace DB2ClientCS
|
||||
public const long SQL_AUTOCOMMIT_ON = 1L;
|
||||
|
||||
/* Data Types */
|
||||
public const int SQL_UNKNOWN_TYPE = 0;
|
||||
public const int SQL_CHAR = 1;
|
||||
public const int SQL_NUMERIC = 2;
|
||||
public const int SQL_DECIMAL = 3;
|
||||
public const int SQL_INTEGER = 4;
|
||||
public const int SQL_SMALLINT = 5;
|
||||
public const int SQL_FLOAT = 6;
|
||||
public const int SQL_REAL = 7;
|
||||
public const int SQL_DOUBLE = 8;
|
||||
public const int SQL_DATETIME = 9;
|
||||
public const int SQL_VARCHAR = 12;
|
||||
public const int SQL_WCHAR = (-8);
|
||||
public const int SQL_WVARCHAR = (-9);
|
||||
public const int SQL_WLONGVARCHAR = (-10);
|
||||
public const int SQL_TYPE_DATE = 91;
|
||||
public const int SQL_TYPE_TIME = 92;
|
||||
public const int SQL_TYPE_TIMESTAMP = 93;
|
||||
|
||||
public const int SQL_C_CHAR = SQL_CHAR;
|
||||
public const int SQL_C_DEFAULT = 99;
|
||||
|
||||
public const int SQL_USER_DEFINED_TYPE = (-450);
|
||||
|
||||
/* SQLDriverConnect Options */
|
||||
public const int SQL_DRIVER_NOPROMPT = 0;
|
||||
@@ -85,17 +70,6 @@ namespace DB2ClientCS
|
||||
public const int SQL_DRIVER_PROMPT = 2;
|
||||
public const int SQL_DRIVER_COMPLETE_REQUIRED = 3;
|
||||
|
||||
/* Null settings */
|
||||
public const int SQL_NO_NULLS = 0;
|
||||
public const int SQL_NULLABLE = 1;
|
||||
public const int SQL_NULLABLE_UNKNOWN = 2;
|
||||
|
||||
/* Defines for SQLBindParameter and SQLProcedureColumns */
|
||||
public const int SQL_PARAM_TYPE_UNKNOWN = 0;
|
||||
public const int SQL_PARAM_INPUT = 1;
|
||||
public const int SQL_PARAM_INPUT_OUTPUT = 2;
|
||||
public const int SQL_RESULT_COL = 3;
|
||||
public const int SQL_PARAM_OUTPUT = 4;
|
||||
public const int SQL_RETURN_VALUE = 5;
|
||||
|
||||
}
|
||||
}
|
||||
@@ -25,7 +25,7 @@ namespace DB2ClientCS
|
||||
internal IntPtr hwndStmt; //The statement handle returning the results
|
||||
private int row=-1; //Row pointer
|
||||
private int numCols=0;
|
||||
|
||||
|
||||
#region Constructors and destructors
|
||||
/// <summary>
|
||||
///
|
||||
@@ -38,45 +38,72 @@ namespace DB2ClientCS
|
||||
hwndStmt = com.statementHandle; //We have access to the results through the statement handle
|
||||
|
||||
short sqlRet;
|
||||
|
||||
StringBuilder colName = new StringBuilder(18);
|
||||
short colNameMaxLength=18;
|
||||
IntPtr colNameLength=IntPtr.Zero;
|
||||
IntPtr sqlDataType=IntPtr.Zero;
|
||||
IntPtr colSize=IntPtr.Zero;
|
||||
IntPtr scale=IntPtr.Zero;
|
||||
IntPtr nullable=IntPtr.Zero;
|
||||
DB2ClientUtils util = new DB2ClientUtils();
|
||||
rs = new DataTable();
|
||||
|
||||
sqlRet = DB2ClientPrototypes.SQLNumResultCols(hwndStmt, ref numCols);
|
||||
util.DB2CheckReturn(sqlRet, DB2ClientConstants.SQL_HANDLE_STMT, hwndStmt, "DB2ClientDataReader - SQLNumResultCols");
|
||||
|
||||
IntPtr[] dbVals = new IntPtr[numCols];
|
||||
IntPtr[] sqlLen_or_IndPtr = new IntPtr[numCols];
|
||||
for (ushort i=1; i<=numCols; i++)
|
||||
{
|
||||
sqlRet = DB2ClientPrototypes.SQLDescribeCol(hwndStmt, i, colName, colNameMaxLength, colNameLength, ref sqlDataType, ref colSize, ref scale, ref nullable);
|
||||
util.DB2CheckReturn(sqlRet, DB2ClientConstants.SQL_HANDLE_STMT, hwndStmt, "DB2ClientDataReader - SQLDescribeCol");
|
||||
///At this point I have the data type information as well, but for now I will insert the data as
|
||||
///Ansi strings and see how it goes. Maybe we can speed things up later...
|
||||
///
|
||||
rs.Columns.Add(colName.ToString());
|
||||
|
||||
PrepareResults(dbVals, sqlLen_or_IndPtr);
|
||||
FetchResults(dbVals, sqlLen_or_IndPtr, rs);
|
||||
isClosed = false;
|
||||
sqlLen_or_IndPtr[i-1] = new IntPtr();
|
||||
dbVals[i-1] = Marshal.AllocHGlobal(colSize.ToInt32()+1);
|
||||
|
||||
try
|
||||
{
|
||||
switch (sqlDataType.ToInt32())
|
||||
{
|
||||
case DB2ClientConstants.SQL_DECIMAL: //These types are treated as SQL_C_CHAR for binding purposes
|
||||
case DB2ClientConstants.SQL_TYPE_DATE:
|
||||
case DB2ClientConstants.SQL_TYPE_TIME:
|
||||
case DB2ClientConstants.SQL_TYPE_TIMESTAMP:
|
||||
case DB2ClientConstants.SQL_VARCHAR:
|
||||
sqlRet = DB2ClientPrototypes.SQLBindCol(hwndStmt, i, DB2ClientConstants.SQL_C_CHAR, dbVals[i-1],(short)colSize.ToInt32()+1, ref sqlLen_or_IndPtr[i-1]);
|
||||
break;
|
||||
default:
|
||||
sqlRet = DB2ClientPrototypes.SQLBindCol(hwndStmt, i, (short)sqlDataType.ToInt32(), dbVals[i-1],(short)colSize.ToInt32()+1, ref sqlLen_or_IndPtr[i-1]);
|
||||
break;
|
||||
}
|
||||
util.DB2CheckReturn(sqlRet, DB2ClientConstants.SQL_HANDLE_STMT, hwndStmt, "DB2ClientDataReader - SQLBindCol");
|
||||
}
|
||||
catch(DB2ClientException e)
|
||||
{
|
||||
System.Console.Write(e.Message);
|
||||
}
|
||||
isClosed = false;
|
||||
}
|
||||
sqlRet = DB2ClientPrototypes.SQLFetch(hwndStmt);
|
||||
util.DB2CheckReturn(sqlRet, DB2ClientConstants.SQL_HANDLE_STMT, hwndStmt, "DB2ClientDataReader - SQLFetch 1");
|
||||
while(sqlRet != DB2ClientConstants.SQL_NO_DATA_FOUND)
|
||||
{
|
||||
DataRow newRow = rs.NewRow();
|
||||
for (short y=1;y<=numCols;y++)
|
||||
{
|
||||
newRow[y-1] = Marshal.PtrToStringAnsi(dbVals[y-1]);
|
||||
util.DB2CheckReturn(sqlRet, DB2ClientConstants.SQL_HANDLE_STMT, hwndStmt, "DB2ClientDataReader - SQLFetch 2");
|
||||
}
|
||||
rs.Rows.Add(newRow);
|
||||
|
||||
sqlRet = DB2ClientPrototypes.SQLFetch(hwndStmt);
|
||||
}
|
||||
for (int n=0;n<numCols;n++)
|
||||
Marshal.FreeHGlobal(dbVals[n]);
|
||||
}
|
||||
/// <summary>
|
||||
/// Constructor for use with prepared statements
|
||||
/// </summary>
|
||||
///
|
||||
internal DB2ClientDataReader(DB2ClientConnection con, DB2ClientCommand com, bool prepared)
|
||||
{
|
||||
db2Conn = con;
|
||||
hwndStmt = com.statementHandle; //We have access to the results through the statement handle
|
||||
|
||||
short sqlRet;
|
||||
|
||||
DB2ClientUtils util = new DB2ClientUtils();
|
||||
rs = new DataTable();
|
||||
|
||||
sqlRet = DB2ClientPrototypes.SQLNumResultCols(hwndStmt, ref numCols);
|
||||
util.DB2CheckReturn(sqlRet, DB2ClientConstants.SQL_HANDLE_STMT, hwndStmt, "DB2ClientDataReader - SQLNumResultCols");
|
||||
|
||||
IntPtr[] dbVals = new IntPtr[numCols];
|
||||
IntPtr[] sqlLen_or_IndPtr = new IntPtr[numCols];
|
||||
|
||||
PrepareResults(dbVals, sqlLen_or_IndPtr);
|
||||
FetchResults(dbVals, sqlLen_or_IndPtr, rs);
|
||||
isClosed = false;
|
||||
}
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
Close();
|
||||
@@ -177,87 +204,6 @@ namespace DB2ClientCS
|
||||
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Describe/Bind/Fetch functions
|
||||
///
|
||||
///Broke these out so that we can use different paths for Immediate executions and Prepared executions
|
||||
/// <summary>
|
||||
/// Does the describe and bind steps for the query result set. Called for both immediate and prepared queries.
|
||||
/// </summary>
|
||||
private void PrepareResults(IntPtr[] dbVals, IntPtr[] sqlLen_or_IndPtr)
|
||||
{
|
||||
short sqlRet;
|
||||
StringBuilder colName = new StringBuilder(18);
|
||||
short colNameMaxLength=18;
|
||||
IntPtr colNameLength=IntPtr.Zero;
|
||||
IntPtr sqlDataType=IntPtr.Zero;
|
||||
IntPtr colSize=IntPtr.Zero;
|
||||
IntPtr scale=IntPtr.Zero;
|
||||
IntPtr nullable=IntPtr.Zero;
|
||||
DB2ClientUtils util = new DB2ClientUtils();
|
||||
for (ushort i=1; i<=numCols; i++)
|
||||
{
|
||||
sqlRet = DB2ClientPrototypes.SQLDescribeCol(hwndStmt, i, colName, colNameMaxLength, colNameLength, ref sqlDataType, ref colSize, ref scale, ref nullable);
|
||||
util.DB2CheckReturn(sqlRet, DB2ClientConstants.SQL_HANDLE_STMT, hwndStmt, "DB2ClientDataReader - SQLDescribeCol");
|
||||
///At this point I have the data type information as well, but for now I will insert the data as
|
||||
///Ansi strings and see how it goes. Maybe we can speed things up later...
|
||||
///
|
||||
rs.Columns.Add(colName.ToString());
|
||||
|
||||
sqlLen_or_IndPtr[i-1] = new IntPtr();
|
||||
dbVals[i-1] = Marshal.AllocHGlobal((int)colSize+1);
|
||||
|
||||
try
|
||||
{
|
||||
switch ((int)sqlDataType)
|
||||
{
|
||||
case DB2ClientConstants.SQL_DECIMAL: //These types are treated as SQL_C_CHAR for binding purposes
|
||||
case DB2ClientConstants.SQL_TYPE_DATE:
|
||||
case DB2ClientConstants.SQL_TYPE_TIME:
|
||||
case DB2ClientConstants.SQL_TYPE_TIMESTAMP:
|
||||
case DB2ClientConstants.SQL_VARCHAR:
|
||||
sqlRet = DB2ClientPrototypes.SQLBindCol(hwndStmt, i, DB2ClientConstants.SQL_C_CHAR, dbVals[i-1],(short)colSize+1, ref sqlLen_or_IndPtr[i-1]);
|
||||
break;
|
||||
default:
|
||||
sqlRet = DB2ClientPrototypes.SQLBindCol(hwndStmt, i, (short)sqlDataType, dbVals[i-1],(short)colSize+1, ref sqlLen_or_IndPtr[i-1]);
|
||||
break;
|
||||
}
|
||||
util.DB2CheckReturn(sqlRet, DB2ClientConstants.SQL_HANDLE_STMT, hwndStmt, "DB2ClientDataReader - SQLBindCol");
|
||||
}
|
||||
catch(DB2ClientException e)
|
||||
{
|
||||
System.Console.Write(e.Message);
|
||||
}
|
||||
isClosed = false;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// FetchResults does what it says.
|
||||
/// </summary>
|
||||
/// <param name="dbVals"></param>
|
||||
/// <param name="sqlLen_or_IndPtr"></param>
|
||||
/// <param name="rs"></param>
|
||||
private void FetchResults(IntPtr[] dbVals, IntPtr[] sqlLen_or_IndPtr, DataTable rs)
|
||||
{
|
||||
short sqlRet = 0;
|
||||
DB2ClientUtils util = new DB2ClientUtils();
|
||||
|
||||
sqlRet = DB2ClientPrototypes.SQLFetch(hwndStmt);
|
||||
util.DB2CheckReturn(sqlRet, DB2ClientConstants.SQL_HANDLE_STMT, hwndStmt, "DB2ClientDataReader - SQLFetch 1");
|
||||
|
||||
while(sqlRet != DB2ClientConstants.SQL_NO_DATA_FOUND)
|
||||
{
|
||||
DataRow newRow = rs.NewRow();
|
||||
for (short y=1;y<=numCols;y++)
|
||||
newRow[y-1] = Marshal.PtrToStringAnsi(dbVals[y-1]);
|
||||
|
||||
rs.Rows.Add(newRow);
|
||||
sqlRet = DB2ClientPrototypes.SQLFetch(hwndStmt);
|
||||
util.DB2CheckReturn(sqlRet, DB2ClientConstants.SQL_HANDLE_STMT, hwndStmt, "DB2ClientDataReader - SQLFetch 2");
|
||||
}
|
||||
for (int n=0;n<numCols;n++)
|
||||
Marshal.FreeHGlobal(dbVals[n]);
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region IDataRecord Interface
|
||||
@@ -510,4 +456,3 @@ namespace DB2ClientCS
|
||||
}
|
||||
|
||||
}
|
||||
#endregion
|
||||
@@ -1,365 +0,0 @@
|
||||
#region Licence
|
||||
/// DB2DriverCS - A DB2 driver for .Net
|
||||
/// Copyright 2003 By Christopher Bockner
|
||||
/// Released under the terms of the MIT/X11 Licence
|
||||
/// Please refer to the Licence.txt file that should be distributed with this package
|
||||
/// This software requires that DB2 client software be installed correctly on the machine
|
||||
/// (or instance) on which the driver is running.
|
||||
#endregion
|
||||
using System;
|
||||
using System.Data;
|
||||
|
||||
namespace DB2ClientCS
|
||||
{
|
||||
/// <summary>
|
||||
/// Parameter object for DB2 client
|
||||
/// </summary>
|
||||
public sealed class DB2ClientParameter : MarshalByRefObject, IDbDataParameter, IDataParameter, ICloneable
|
||||
{
|
||||
private DbType dbType;
|
||||
private IntPtr db2DataType;
|
||||
private ParameterDirection direction;
|
||||
private bool nullable;
|
||||
private string parameterName;
|
||||
private string sourceColumn;
|
||||
private IntPtr paramSize;
|
||||
private IntPtr decimalDigits;
|
||||
private DataRowVersion sourceVersion;
|
||||
object dataVal;
|
||||
byte[] bDataVal;
|
||||
private int iDataVal;
|
||||
private byte scale, precision;
|
||||
private int size;
|
||||
bool selfDescribe = false;
|
||||
|
||||
#region Contructors and destructors
|
||||
public DB2ClientParameter()
|
||||
{
|
||||
}
|
||||
public DB2ClientParameter (string name)
|
||||
{
|
||||
parameterName = name;
|
||||
}
|
||||
|
||||
public DB2ClientParameter(string name, DbType type)
|
||||
{
|
||||
parameterName = name;
|
||||
dbType = type;
|
||||
}
|
||||
public DB2ClientParameter(string name, object data)
|
||||
{
|
||||
parameterName = name;
|
||||
this.Value = data;
|
||||
}
|
||||
public DB2ClientParameter(string name, DbType type, string columnName)
|
||||
{
|
||||
parameterName = name;
|
||||
dbType = type;
|
||||
sourceColumn = columnName;
|
||||
}
|
||||
public DB2ClientParameter(string name, int db2Type)
|
||||
{
|
||||
parameterName = name;
|
||||
dbType = inferTypeFromDB2Type(db2Type);
|
||||
db2DataType = new IntPtr(db2Type);
|
||||
}
|
||||
#endregion
|
||||
#region Properties
|
||||
#region DbType Property
|
||||
///
|
||||
/// Parameter data type
|
||||
///
|
||||
public DbType DbType
|
||||
{
|
||||
get
|
||||
{
|
||||
return dbType;
|
||||
}
|
||||
set
|
||||
{
|
||||
dbType = value;
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
#region Direction
|
||||
///
|
||||
/// In or out parameter, or both
|
||||
///
|
||||
public ParameterDirection Direction
|
||||
{
|
||||
get
|
||||
{
|
||||
return direction;
|
||||
}
|
||||
set
|
||||
{
|
||||
direction = value;
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
#region IsNullable
|
||||
///
|
||||
/// Does this parameter support a null value
|
||||
///
|
||||
public bool IsNullable
|
||||
{
|
||||
get
|
||||
{
|
||||
return nullable;
|
||||
}
|
||||
set
|
||||
{
|
||||
nullable = value;
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
#region ParameterName
|
||||
public string ParameterName
|
||||
{
|
||||
get
|
||||
{
|
||||
return parameterName;
|
||||
}
|
||||
set
|
||||
{
|
||||
parameterName = value;
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
#region SourceColumn
|
||||
///
|
||||
/// Gets or sets the name of the source column that is mapped to the DataSet
|
||||
///
|
||||
public string SourceColumn
|
||||
{
|
||||
get
|
||||
{
|
||||
return sourceColumn;
|
||||
}
|
||||
set
|
||||
{
|
||||
sourceColumn = value;
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
#region SourceVersion
|
||||
///
|
||||
/// DataRowVersion property
|
||||
///
|
||||
public DataRowVersion SourceVersion
|
||||
{
|
||||
get
|
||||
{
|
||||
return sourceVersion;
|
||||
}
|
||||
set
|
||||
{
|
||||
sourceVersion = value;
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
#region IDbDataParameter properties
|
||||
public byte Precision
|
||||
{
|
||||
get
|
||||
{
|
||||
return precision;
|
||||
}
|
||||
set
|
||||
{
|
||||
precision = value;
|
||||
}
|
||||
}
|
||||
|
||||
public byte Scale
|
||||
{
|
||||
get
|
||||
{
|
||||
return scale;
|
||||
}
|
||||
set
|
||||
{
|
||||
scale = value;
|
||||
}
|
||||
}
|
||||
|
||||
public int Size
|
||||
{
|
||||
get
|
||||
{
|
||||
return size;
|
||||
}
|
||||
set
|
||||
{
|
||||
size = value;
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
#region Value
|
||||
///
|
||||
/// The actual parameter data
|
||||
///
|
||||
public object Value
|
||||
{
|
||||
get
|
||||
{
|
||||
return Value;
|
||||
}
|
||||
set
|
||||
{
|
||||
this.dataVal = value;
|
||||
DbType = inferType(dataVal);
|
||||
// Load buffer with new value
|
||||
if (dbType==DbType.Int32)
|
||||
iDataVal=(int) value;
|
||||
else
|
||||
{
|
||||
// Treat everything else as a string
|
||||
// Init string buffer
|
||||
if (bDataVal==null || bDataVal.Length< (((int)paramSize>20)?(int)paramSize:20) )
|
||||
bDataVal=new byte[((int)paramSize>20)?(int)paramSize:20];
|
||||
else
|
||||
bDataVal.Initialize();
|
||||
// Convert value into string and store into buffer
|
||||
byte[] strValueBuffer=System.Text.Encoding.ASCII.GetBytes(dataVal.ToString());
|
||||
strValueBuffer.CopyTo(bDataVal,0);
|
||||
}
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
#endregion
|
||||
#region inferType Method
|
||||
/// <summary>
|
||||
/// Determine the data type based on the value
|
||||
/// </summary>
|
||||
private DbType inferType (object Data)
|
||||
{
|
||||
switch (Type.GetTypeCode(Data.GetType()))
|
||||
{
|
||||
case TypeCode.Empty:
|
||||
throw new SystemException("Invalid data type");
|
||||
|
||||
case TypeCode.Object:
|
||||
return DbType.Object;
|
||||
|
||||
case TypeCode.DBNull:
|
||||
case TypeCode.Char:
|
||||
case TypeCode.SByte:
|
||||
case TypeCode.UInt16:
|
||||
case TypeCode.UInt32:
|
||||
case TypeCode.UInt64:
|
||||
// Throw a SystemException for unsupported data types.
|
||||
throw new SystemException("Invalid data type");
|
||||
|
||||
case TypeCode.Boolean:
|
||||
return DbType.Boolean;
|
||||
|
||||
case TypeCode.Byte:
|
||||
return DbType.Byte;
|
||||
|
||||
case TypeCode.Int16:
|
||||
return DbType.Int16;
|
||||
|
||||
case TypeCode.Int32:
|
||||
return DbType.Int32;
|
||||
|
||||
case TypeCode.Int64:
|
||||
return DbType.Int64;
|
||||
|
||||
case TypeCode.Single:
|
||||
return DbType.Single;
|
||||
|
||||
case TypeCode.Double:
|
||||
return DbType.Double;
|
||||
|
||||
case TypeCode.Decimal:
|
||||
return DbType.Decimal;
|
||||
|
||||
case TypeCode.DateTime:
|
||||
return DbType.DateTime;
|
||||
|
||||
case TypeCode.String:
|
||||
return DbType.String;
|
||||
|
||||
default:
|
||||
throw new SystemException("Value is of unknown data type");
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
#region inferTypeFromDB2Type
|
||||
///
|
||||
/// Determine the DbType from the SQL type returned by SQLDescribeParam
|
||||
///
|
||||
private DbType inferTypeFromDB2Type(int db2Type)
|
||||
{
|
||||
switch (db2Type)
|
||||
{
|
||||
case DB2ClientConstants.SQL_CHAR:
|
||||
return DbType.AnsiString;
|
||||
case DB2ClientConstants.SQL_NUMERIC:
|
||||
case DB2ClientConstants.SQL_DECIMAL:
|
||||
return DbType.Decimal;
|
||||
case DB2ClientConstants.SQL_DATETIME:
|
||||
return DbType.DateTime;
|
||||
case DB2ClientConstants.SQL_FLOAT:
|
||||
case DB2ClientConstants.SQL_DOUBLE:
|
||||
return DbType.Double;
|
||||
case DB2ClientConstants.SQL_INTEGER:
|
||||
return DbType.Int32;
|
||||
case DB2ClientConstants.SQL_SMALLINT:
|
||||
return DbType.Int16;
|
||||
case DB2ClientConstants.SQL_VARCHAR:
|
||||
return DbType.String;
|
||||
case DB2ClientConstants.SQL_USER_DEFINED_TYPE:
|
||||
return DbType.Object;
|
||||
default:
|
||||
throw new SystemException("DB2 Data type is unknown.");
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
#region Describe
|
||||
///
|
||||
/// Describe the parameter. Use at the caller's discretion
|
||||
///
|
||||
public short Describe(IntPtr hwndStmt, short paramNum)
|
||||
{
|
||||
IntPtr nullable = IntPtr.Zero;
|
||||
paramSize = IntPtr.Zero;
|
||||
decimalDigits = IntPtr.Zero;
|
||||
short sqlRet = 0;
|
||||
|
||||
sqlRet = DB2ClientPrototypes.SQLDescribeParam(hwndStmt, paramNum, ref db2DataType, ref paramSize, ref decimalDigits, ref nullable);
|
||||
return sqlRet;
|
||||
}
|
||||
#endregion
|
||||
#region Bind
|
||||
///
|
||||
/// Bind this parameter
|
||||
///
|
||||
public short Bind(IntPtr hwndStmt, short paramNum)
|
||||
{
|
||||
short sqlRet = 0;
|
||||
|
||||
switch ((int)db2DataType)
|
||||
{
|
||||
case DB2ClientConstants.SQL_DECIMAL: //These types are treated as SQL_C_CHAR for binding purposes
|
||||
case DB2ClientConstants.SQL_TYPE_DATE:
|
||||
case DB2ClientConstants.SQL_TYPE_TIME:
|
||||
case DB2ClientConstants.SQL_TYPE_TIMESTAMP:
|
||||
case DB2ClientConstants.SQL_VARCHAR:
|
||||
case DB2ClientConstants.SQL_CHAR:
|
||||
sqlRet = DB2ClientPrototypes.SQLBindParameter(hwndStmt, (ushort)paramNum, DB2ClientConstants.SQL_PARAM_INPUT, DB2ClientConstants.SQL_C_DEFAULT, (short)db2DataType, Convert.ToUInt32((int)paramSize) , (short) decimalDigits, bDataVal, 0, 0);
|
||||
break;
|
||||
default:
|
||||
sqlRet = DB2ClientPrototypes.SQLBindParameter(hwndStmt, (ushort)paramNum, DB2ClientConstants.SQL_PARAM_INPUT, DB2ClientConstants.SQL_C_DEFAULT, (short)db2DataType, Convert.ToUInt32((int)paramSize) , 0, ref iDataVal, 0, 0);
|
||||
break;
|
||||
}
|
||||
return sqlRet;
|
||||
}
|
||||
#endregion
|
||||
object ICloneable.Clone ()
|
||||
{
|
||||
throw new NotImplementedException ();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,93 +0,0 @@
|
||||
#region Licence
|
||||
/// DB2DriverCS - A DB2 driver for .Net
|
||||
/// Copyright 2003 By Christopher Bockner
|
||||
/// Released under the terms of the MIT/X11 Licence
|
||||
/// Please refer to the Licence.txt file that should be distributed with this package
|
||||
/// This software requires that DB2 client software be installed correctly on the machine
|
||||
/// (or instance) on which the driver is running.
|
||||
#endregion
|
||||
using System;
|
||||
using System.Data;
|
||||
using System.Collections;
|
||||
using System.Globalization;
|
||||
|
||||
|
||||
namespace DB2ClientCS
|
||||
{
|
||||
/// <summary>
|
||||
/// Summary description for DB2ClientParameterCollection.
|
||||
/// </summary>
|
||||
public class DB2ClientParameterCollection : ArrayList, IDataParameterCollection
|
||||
{
|
||||
public object this[string index]
|
||||
{
|
||||
get
|
||||
{
|
||||
return this[IndexOf(index)];
|
||||
}
|
||||
set
|
||||
{
|
||||
this[IndexOf(index)] = value;
|
||||
}
|
||||
}
|
||||
public bool Contains(string paramName)
|
||||
{
|
||||
return(-1 != IndexOf(paramName));
|
||||
}
|
||||
|
||||
public int IndexOf(string paramName)
|
||||
{
|
||||
int index = 0;
|
||||
foreach(DB2ClientParameter item in this)
|
||||
{
|
||||
if (0 == _cultureAwareCompare(item.ParameterName, paramName))
|
||||
{
|
||||
return index;
|
||||
}
|
||||
index++;
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
public void RemoveAt(string paramName)
|
||||
{
|
||||
RemoveAt(IndexOf(paramName));
|
||||
}
|
||||
|
||||
public override int Add(object value)
|
||||
{
|
||||
return Add((DB2ClientParameter)value);
|
||||
}
|
||||
|
||||
public int Add(DB2ClientParameter value)
|
||||
{
|
||||
if (((DB2ClientParameter)value).ParameterName != null)
|
||||
{
|
||||
return base.Add(value);
|
||||
}
|
||||
else
|
||||
throw new ArgumentException("parameter must be named");
|
||||
}
|
||||
|
||||
public int Add(string paramName, DbType type)
|
||||
{
|
||||
return Add(new DB2ClientParameter(paramName, type));
|
||||
}
|
||||
|
||||
public int Add(string paramName, object value)
|
||||
{
|
||||
return Add(new DB2ClientParameter(paramName, value));
|
||||
}
|
||||
|
||||
public int Add(string paramName, DbType dbType, string sourceColumn)
|
||||
{
|
||||
return Add(new DB2ClientParameter(paramName, dbType, sourceColumn));
|
||||
}
|
||||
|
||||
private int _cultureAwareCompare(string strA, string strB)
|
||||
{
|
||||
return CultureInfo.CurrentCulture.CompareInfo.Compare(strA, strB, CompareOptions.IgnoreKanaType | CompareOptions.IgnoreWidth | CompareOptions.IgnoreCase);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -17,7 +17,7 @@ namespace DB2ClientCS
|
||||
/// <summary>
|
||||
/// DB2CLIPrototypes class is a wrapper for the db2cli.lib, IBM's Call Level Interface to DB2
|
||||
/// </summary>
|
||||
internal class DB2ClientPrototypes
|
||||
unsafe internal class DB2ClientPrototypes
|
||||
{
|
||||
[DllImport("db2cli.dll", EntryPoint = "SQLAllocHandle")]
|
||||
unsafe public static extern short SQLAllocHandle(short handleType, IntPtr inputHandle, ref IntPtr outputHandle);
|
||||
@@ -28,7 +28,7 @@ namespace DB2ClientCS
|
||||
[DllImport("db2cli.dll", EntryPoint = "SQLGetDiagRec")]
|
||||
unsafe public static extern short SQLGetDiagRec( short handleType, IntPtr handle, short recNum, [Out] StringBuilder sqlState, ref IntPtr nativeErrorPtr, [Out] StringBuilder errorMessage, short bufferLength, ref IntPtr shortTextLengthPtr);
|
||||
[DllImport("db2cli.Dll", EntryPoint = "SQLSetConnectAttr")]
|
||||
unsafe public static extern short SQLSetConnectAttr(IntPtr sqlHdbc, long sqlAttr, [In] IntPtr sqlValuePtr, long sqlValueLength);
|
||||
unsafe public static extern short SQLSetConnectAttr(IntPtr sqlHdbc, long sqlAttr, IntPtr sqlValuePtr, long sqlStrLength);
|
||||
[DllImport("db2cli.Dll", EntryPoint = "SQLEndTran")]
|
||||
unsafe public static extern short SQLEndTran (short handleType, IntPtr handle, short fType);
|
||||
[DllImport("db2cli.Dll", EntryPoint = "SQLCancel")]
|
||||
@@ -49,20 +49,5 @@ namespace DB2ClientCS
|
||||
unsafe public static extern short SQLBindCol(IntPtr stmtHandle, ushort colNum, int dataType,[In][Out] IntPtr dataBufferPtr, int dataBufferLength, ref IntPtr StrLen_or_IndPtr);
|
||||
[DllImport("db2cli.dll", EntryPoint = "SQLDriverConnect")]
|
||||
unsafe public static extern short SQLDriverConnect(IntPtr hdbc, int centered, [In] string inConnectStr, [In] int inStrLength, [Out] StringBuilder outConnectStr, [Out] int outStrCapacity, [Out] IntPtr outStrLengthReturned, [In] int completion);
|
||||
[DllImport("db2cli.dll", EntryPoint = "SQLPrepare")]
|
||||
unsafe public static extern short SQLPrepare(IntPtr stmtHandle, string stmt, int length);
|
||||
[DllImport("db2cli.dll", EntryPoint = "SQLDescribeParam")]
|
||||
unsafe public static extern short SQLDescribeParam(IntPtr stmtHandle, short paramNumber,ref IntPtr dataType, ref IntPtr paramSize, ref IntPtr decimalDigits, ref IntPtr nullable);
|
||||
[DllImport("db2cli.dll", EntryPoint = "SQLNumParams")]
|
||||
unsafe public static extern short SQLNumParams(IntPtr stmtHandle, ref IntPtr numParams);
|
||||
[DllImport("db2cli.dll")]
|
||||
internal static extern short SQLBindParameter(IntPtr stmtHandle, ushort paramNumber,
|
||||
short dataType, short valueType, short paramType, uint colSize, short decDigits,
|
||||
byte[] dataBufferPtr, int dataBufferLength, int StrLen_or_IndPtr);
|
||||
[DllImport("db2cli.dll", EntryPoint = "SQLBindParameter")]
|
||||
unsafe public static extern short SQLBindParameter(IntPtr stmtHandle, ushort paramNumber,
|
||||
short dataType, short valueType, short paramType, uint colSize, short decDigits,
|
||||
ref int dataBufferPtr, int dataBufferLength, int StrLen_or_IndPtr);
|
||||
|
||||
}
|
||||
}
|
||||
@@ -8,7 +8,6 @@
|
||||
#endregion
|
||||
using System;
|
||||
using System.Data;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace DB2ClientCS
|
||||
{
|
||||
@@ -16,22 +15,21 @@ namespace DB2ClientCS
|
||||
/// DB2ClientTransaction. DB2 requires nothing specific to be done to open a transaction, so we set the
|
||||
/// isolation level, make sure AUTOCOMMIT is off. DB2 Also allows you to set transaction isolation
|
||||
/// at the statement level, but I haven't worked that in here yet.
|
||||
/// NOTE: AT THE MOMENT, SETTING OF THE ISOLATION LEVEL IS NOT WORKING
|
||||
/// </summary>
|
||||
unsafe public class DB2ClientTransaction : IDbTransaction
|
||||
public class DB2ClientTransaction : IDbTransaction
|
||||
{
|
||||
DB2ClientUtils util = new DB2ClientUtils();
|
||||
IsolationLevel IL = IsolationLevel.Unspecified;
|
||||
DB2ClientConnection db2Conn;
|
||||
public DB2ClientTransaction(DB2ClientConnection con, IsolationLevel isoL)
|
||||
{
|
||||
IL = isoL;
|
||||
long db2IsoL = DB2ClientConstants.SQL_TXN_READ_COMMITTED;
|
||||
db2Conn = con;
|
||||
short sqlRet;
|
||||
|
||||
switch (isoL)
|
||||
{
|
||||
case System.Data.IsolationLevel.Chaos: //No DB2equivalent, default to SQL_TXN_READ_COMMITTED
|
||||
case System.Data.IsolationLevel.Chaos:
|
||||
break;
|
||||
case System.Data.IsolationLevel.ReadCommitted: //SQL_TXN_READ_COMMITTED
|
||||
db2IsoL = DB2ClientConstants.SQL_TXN_READ_COMMITTED;
|
||||
@@ -47,13 +45,10 @@ namespace DB2ClientCS
|
||||
break;
|
||||
}
|
||||
|
||||
IL = isoL;
|
||||
IntPtr iso = new IntPtr(db2IsoL);
|
||||
IntPtr attr = new IntPtr(DB2ClientConstants.SQL_AUTOCOMMIT_OFF);
|
||||
sqlRet = DB2ClientPrototypes.SQLSetConnectAttr(db2Conn.DBHandle, DB2ClientConstants.SQL_AUTOCOMMIT, attr, 0);
|
||||
util.DB2CheckReturn(sqlRet, DB2ClientConstants.SQL_HANDLE_DBC, db2Conn.DBHandle, "Error setting AUTOCOMMIT OFF in transaction CTOR.");
|
||||
// sqlRet = DB2ClientPrototypes.SQLSetConnectAttr(db2Conn.DBHandle, DB2ClientConstants.SQL_TXN_ISOLATION, iso, 0);
|
||||
// util.DB2CheckReturn(sqlRet, DB2ClientConstants.SQL_HANDLE_DBC, db2Conn.DBHandle, "Error setting TRANSCTION ISOLATION in transaction CTOR.");
|
||||
sqlRet = DB2ClientPrototypes.SQLSetConnectAttr(db2Conn.DBHandle, DB2ClientConstants.SQL_TXN_ISOLATION, iso, 0);
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -7,5 +7,3 @@ Mono.Data.Db2Client/DB2ClientException.cs
|
||||
Mono.Data.Db2Client/DB2ClientPrototypes.cs
|
||||
Mono.Data.Db2Client/DB2ClientTransaction.cs
|
||||
Mono.Data.Db2Client/DB2ClientUtils.cs
|
||||
Mono.Data.Db2Client/DB2ClientParameter.cs
|
||||
Mono.Data.Db2Client/DB2ClientParameterCollection.cs
|
||||
@@ -1,10 +1,3 @@
|
||||
2003-02-16 Daniel Morgan <[email protected]>
|
||||
|
||||
* SybaseConnection.cs: - parse data source for 2 possible uses:
|
||||
"Server=hostname",
|
||||
"Server=hostname,port" and open the connection based on the
|
||||
resulting server name and port.
|
||||
|
||||
2002-12-01 Tim Coleman <[email protected]>
|
||||
* Mono.Data.SybaseClient/SybaseDataReader.cs:
|
||||
Change to reflect TdsSchemaInfo -> TdsDataColumnCollection
|
||||
|
||||
@@ -3,10 +3,8 @@
|
||||
//
|
||||
// Author:
|
||||
// Tim Coleman ([email protected])
|
||||
// Daniel Morgan ([email protected])
|
||||
//
|
||||
// Copyright (C) Tim Coleman, 2002, 2003
|
||||
// Copyright (C) Daniel Morgan, 2003
|
||||
// Copyright (C) Tim Coleman, 2002
|
||||
//
|
||||
|
||||
using Mono.Data.Tds.Protocol;
|
||||
@@ -18,7 +16,6 @@ using System.Data;
|
||||
using System.Data.Common;
|
||||
using System.EnterpriseServices;
|
||||
using System.Net;
|
||||
using System.Net.Sockets;
|
||||
using System.Text;
|
||||
|
||||
namespace Mono.Data.SybaseClient {
|
||||
@@ -285,20 +282,16 @@ namespace Mono.Data.SybaseClient {
|
||||
[MonoTODO ("Figure out the Sybase way to reset the connection.")]
|
||||
public void Open ()
|
||||
{
|
||||
string serverName = "";
|
||||
if (connectionString == null)
|
||||
throw new InvalidOperationException ("Connection string has not been initialized.");
|
||||
|
||||
try {
|
||||
if (!pooling) {
|
||||
ParseDataSource (dataSource, out port, out serverName);
|
||||
tds = new Tds50 (serverName, port, PacketSize, ConnectionTimeout);
|
||||
}
|
||||
if (!pooling)
|
||||
tds = new Tds50 (DataSource, port, PacketSize, ConnectionTimeout);
|
||||
else {
|
||||
pool = (SybaseConnectionPool) SybaseConnectionPools [connectionString];
|
||||
if (pool == null) {
|
||||
ParseDataSource (dataSource, out port, out serverName);
|
||||
pool = new SybaseConnectionPool (serverName, port, packetSize, ConnectionTimeout, minPoolSize, maxPoolSize);
|
||||
pool = new SybaseConnectionPool (dataSource, port, packetSize, ConnectionTimeout, minPoolSize, maxPoolSize);
|
||||
SybaseConnectionPools [connectionString] = pool;
|
||||
}
|
||||
tds = pool.AllocateConnection ();
|
||||
@@ -322,22 +315,6 @@ namespace Mono.Data.SybaseClient {
|
||||
}
|
||||
}
|
||||
|
||||
private void ParseDataSource (string theDataSource, out int thePort, out string theServerName)
|
||||
{
|
||||
theServerName = "";
|
||||
thePort = 1433; // default TCP port for SQL Server
|
||||
|
||||
int idx = 0;
|
||||
if ((idx = theDataSource.IndexOf (",")) > -1) {
|
||||
theServerName = theDataSource.Substring (0, idx);
|
||||
string p = theDataSource.Substring (idx + 1);
|
||||
thePort = Int32.Parse (p);
|
||||
}
|
||||
else {
|
||||
theServerName = theDataSource;
|
||||
}
|
||||
}
|
||||
|
||||
void SetConnectionString (string connectionString)
|
||||
{
|
||||
connectionString += ";";
|
||||
|
||||
@@ -1,10 +1,3 @@
|
||||
2003-01-20 Gonzalo Paniagua Javier <[email protected]>
|
||||
|
||||
* Tds70.cs:
|
||||
(FormatParameter): send input/output parameter names. This way we don't
|
||||
depend on the parameter position being different of the index in the
|
||||
parameter collection.
|
||||
|
||||
2002-12-10 Gonzalo Paniagua Javier <[email protected]>
|
||||
|
||||
* Tds.cs:
|
||||
|
||||
@@ -268,12 +268,11 @@ namespace Mono.Data.Tds.Protocol {
|
||||
private string FormatParameter (TdsMetaParameter parameter)
|
||||
{
|
||||
if (parameter.Direction == TdsParameterDirection.Output)
|
||||
return String.Format ("{0}={0} output", parameter.ParameterName);
|
||||
return String.Format ("{0} output", parameter.ParameterName);
|
||||
|
||||
if (parameter.Value == null)
|
||||
return parameter.ParameterName + "=NULL";
|
||||
return "NULL";
|
||||
|
||||
string value = null;
|
||||
switch (parameter.TypeName) {
|
||||
case "bigint":
|
||||
case "decimal":
|
||||
@@ -284,33 +283,23 @@ namespace Mono.Data.Tds.Protocol {
|
||||
case "smallint":
|
||||
case "smallmoney":
|
||||
case "tinyint":
|
||||
value = parameter.Value.ToString ();
|
||||
break;
|
||||
return parameter.Value.ToString ();
|
||||
case "nvarchar":
|
||||
case "nchar":
|
||||
value = String.Format ("N'{0}'", parameter.Value.ToString ().Replace ("'", "''"));
|
||||
break;
|
||||
return String.Format ("N'{0}'", parameter.Value.ToString ().Replace ("'", "''"));
|
||||
case "uniqueidentifier":
|
||||
value = String.Format ("0x{0}", ((Guid) parameter.Value).ToString ("N"));
|
||||
break;
|
||||
return String.Format ("0x{0}", ((Guid) parameter.Value).ToString ("N"));
|
||||
case "bit":
|
||||
if (parameter.Value.GetType () == typeof (bool))
|
||||
value = (((bool) parameter.Value) ? "0x1" : "0x0");
|
||||
else
|
||||
value = parameter.Value.ToString ();
|
||||
|
||||
break;
|
||||
return (((bool) parameter.Value) ? "0x1" : "0x0");
|
||||
return parameter.Value.ToString ();
|
||||
case "image":
|
||||
case "binary":
|
||||
case "varbinary":
|
||||
value = String.Format ("0x{0}", BitConverter.ToString ((byte[]) parameter.Value).Replace ("-", "").ToLower ());
|
||||
break;
|
||||
return String.Format ("0x{0}", BitConverter.ToString ((byte[]) parameter.Value).Replace ("-", "").ToLower ());
|
||||
default:
|
||||
value = String.Format ("'{0}'", parameter.Value.ToString ().Replace ("'", "''"));
|
||||
break;
|
||||
return String.Format ("'{0}'", parameter.Value.ToString ().Replace ("'", "''"));
|
||||
}
|
||||
|
||||
return parameter.ParameterName + "=" + value;
|
||||
}
|
||||
|
||||
public override string Prepare (string commandText, TdsMetaParameterCollection parameters)
|
||||
|
||||
@@ -1,10 +1,3 @@
|
||||
2003-02-16 Daniel Morgan <[email protected]>
|
||||
|
||||
* TdsConnection.cs: - parse data source for 2 possible uses:
|
||||
"Server=hostname",
|
||||
"Server=hostname,port" and open the connection based on the
|
||||
resulting server name and port.
|
||||
|
||||
2002-12-01 Tim Coleman <[email protected]>
|
||||
* Mono.Data.TdsClient/TdsDataReader.cs:
|
||||
Change to reflect TdsSchemaInfo -> TdsDataColumnCollection
|
||||
|
||||
@@ -1,12 +1,10 @@
|
||||
//
|
||||
// Mono.Data.TdsClient.TdsConnection.cs
|
||||
//
|
||||
// Authors:
|
||||
// Author:
|
||||
// Tim Coleman ([email protected])
|
||||
// Daniel Morgan ([email protected])
|
||||
//
|
||||
// Copyright (C) Tim Coleman, 2002, 2003
|
||||
// Copyright (C) Daniel Morgan, 2003
|
||||
// Copyright (C) Tim Coleman, 2002
|
||||
//
|
||||
|
||||
using Mono.Data.Tds.Protocol;
|
||||
@@ -18,7 +16,6 @@ using System.Data;
|
||||
using System.Data.Common;
|
||||
using System.EnterpriseServices;
|
||||
using System.Net;
|
||||
using System.Net.Sockets;
|
||||
using System.Text;
|
||||
|
||||
namespace Mono.Data.TdsClient {
|
||||
@@ -285,20 +282,16 @@ namespace Mono.Data.TdsClient {
|
||||
[MonoTODO ("Figure out the Tds way to reset the connection.")]
|
||||
public void Open ()
|
||||
{
|
||||
string serverName = "";
|
||||
if (connectionString == null)
|
||||
throw new InvalidOperationException ("Connection string has not been initialized.");
|
||||
|
||||
try {
|
||||
if (!pooling) {
|
||||
ParseDataSource (dataSource, out port, out serverName);
|
||||
tds = new Tds42 (serverName, port, PacketSize, ConnectionTimeout);
|
||||
}
|
||||
if (!pooling)
|
||||
tds = new Tds42 (DataSource, port, PacketSize, ConnectionTimeout);
|
||||
else {
|
||||
pool = (TdsConnectionPool) TdsConnectionPools [connectionString];
|
||||
if (pool == null) {
|
||||
ParseDataSource (dataSource, out port, out serverName);
|
||||
pool = new TdsConnectionPool (serverName, port, packetSize, ConnectionTimeout, minPoolSize, maxPoolSize);
|
||||
pool = new TdsConnectionPool (dataSource, port, packetSize, ConnectionTimeout, minPoolSize, maxPoolSize);
|
||||
TdsConnectionPools [connectionString] = pool;
|
||||
}
|
||||
tds = pool.AllocateConnection ();
|
||||
@@ -322,22 +315,6 @@ namespace Mono.Data.TdsClient {
|
||||
}
|
||||
}
|
||||
|
||||
private void ParseDataSource (string theDataSource, out int thePort, out string theServerName)
|
||||
{
|
||||
theServerName = "";
|
||||
thePort = 1433; // default TCP port for SQL Server
|
||||
|
||||
int idx = 0;
|
||||
if ((idx = theDataSource.IndexOf (",")) > -1) {
|
||||
theServerName = theDataSource.Substring (0, idx);
|
||||
string p = theDataSource.Substring (idx + 1);
|
||||
thePort = Int32.Parse (p);
|
||||
}
|
||||
else {
|
||||
theServerName = theDataSource;
|
||||
}
|
||||
}
|
||||
|
||||
void SetConnectionString (string connectionString)
|
||||
{
|
||||
connectionString += ";";
|
||||
|
||||
@@ -1,6 +1,4 @@
|
||||
*.pdb
|
||||
*.dll
|
||||
*.csproj.user
|
||||
.makefrag
|
||||
.response
|
||||
library-deps.stamp
|
||||
|
||||
@@ -1,18 +1,14 @@
|
||||
2003-01-30 Rafael Teixeira <[email protected]>
|
||||
|
||||
* OptionDetails.cs : now handle composite arguments '/option:suboption'
|
||||
|
||||
2003-01-20 Duncan Mak <[email protected]>
|
||||
|
||||
* list.unix: Remove the extra reference to ArgumentProcessorAttribute.cs
|
||||
* list.unix: Remove the extra reference to ArgumentProcessorAttribute.cs
|
||||
|
||||
2002-09-03 Rafael Teixeira <[email protected]>
|
||||
|
||||
* added AboutAttribute.cs, AuthorAttribute.cs, OptionAttribute.cs,
|
||||
UsageComplementAttribute.cs, OptionDetails.cs, Options.cs.
|
||||
Now reflection is used to drive the options processing.
|
||||
UsageComplementAttribute.cs, OptionDetails.cs, Options.cs.
|
||||
Now reflection is used to drive de options processing.
|
||||
|
||||
* added GetOptTest test subproject
|
||||
* added GetOptTest test subproject
|
||||
|
||||
2002-08-30 Juli Mallett <[email protected]>
|
||||
|
||||
|
||||
@@ -31,7 +31,6 @@ namespace Mono.GetOptions
|
||||
public MemberInfo MemberInfo;
|
||||
public ArrayList Values;
|
||||
public System.Type ParameterType;
|
||||
public string ParamName = "PARAM"; // TODO: another element to get from OptionAttribute
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
@@ -43,10 +42,11 @@ namespace Mono.GetOptions
|
||||
if (NeedsParameter)
|
||||
{
|
||||
if (this.LongForm != string.Empty && this.LongForm != null)
|
||||
optionHelp += "=";
|
||||
optionHelp += ParamName;
|
||||
optionHelp += "=PARAM";
|
||||
else
|
||||
optionHelp += "PARAM";
|
||||
}
|
||||
optionHelp = optionHelp.PadRight(26) + " ";
|
||||
optionHelp = optionHelp.PadRight(23) + " ";
|
||||
optionHelp += this.ShortDescription;
|
||||
return optionHelp;
|
||||
}
|
||||
@@ -189,18 +189,11 @@ namespace Mono.GetOptions
|
||||
|
||||
public bool ProcessArgument(string arg, string nextArg)
|
||||
{
|
||||
if (arg == ("-" + ShortForm) || arg == ("--" + LongForm) ||
|
||||
arg == ("/" + ShortForm) || arg == ("/" + LongForm))
|
||||
if (arg == ("-" + ShortForm) || arg == ("--" + LongForm))
|
||||
{
|
||||
DoIt(nextArg);
|
||||
return true;
|
||||
}
|
||||
string temp = (arg + ":" + nextArg).TrimStart('-','/');
|
||||
if (temp == LongForm)
|
||||
{
|
||||
DoIt(null);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,9 +1,11 @@
|
||||
//
|
||||
// OptionList.cs
|
||||
//
|
||||
// Author: Rafael Teixeira ([email protected])
|
||||
// Author: Rafael Teixeira ([email protected]) (original)
|
||||
// Author: Dean Scarff ([email protected]) (modifications)
|
||||
//
|
||||
// (C) 2002 Rafael Teixeira
|
||||
// Modifications (C) 2002 Dean Scarff, distributed under the Gnu General Public License Version 2 or later
|
||||
//
|
||||
|
||||
using System;
|
||||
@@ -296,8 +298,11 @@ namespace Mono.GetOptions
|
||||
|
||||
if ((parsingMode & OptionsParsingMode.Windows) > 0)
|
||||
{
|
||||
if (arg[0] == '/')
|
||||
result.AddRange(arg.Split(':'));
|
||||
if ((arg.Length == 2) && (arg[0] == '/')) // Windows options only come in this fashion
|
||||
{
|
||||
result.Add("-" + arg[1]); // translate to Linux style
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
if ((parsingMode & OptionsParsingMode.Linux) > 0)
|
||||
@@ -357,7 +362,7 @@ namespace Mono.GetOptions
|
||||
|
||||
OptionWasProcessed = false;
|
||||
|
||||
if (arg.StartsWith("-") || arg.StartsWith("/"))
|
||||
if (arg.StartsWith("-"))
|
||||
{
|
||||
foreach(OptionDetails option in list)
|
||||
{
|
||||
|
||||
@@ -41,6 +41,7 @@ namespace Mono.GetOptions
|
||||
return optionParser.DoUsage();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -8,31 +8,60 @@ using System.Runtime.InteropServices;
|
||||
|
||||
namespace Mono.PEToolkit {
|
||||
|
||||
public class COFFHeader {
|
||||
/// <summary>
|
||||
/// IMAGE_FILE_HEADER
|
||||
/// </summary>
|
||||
[StructLayoutAttribute(LayoutKind.Sequential)]
|
||||
public struct COFFHeader {
|
||||
|
||||
private MachineId machine;
|
||||
private short sections;
|
||||
private uint tdStampRaw;
|
||||
private uint symTabPtr;
|
||||
private uint numSymbols;
|
||||
private short optHeaderSize;
|
||||
private Characteristics characteristics;
|
||||
internal MachineId machine;
|
||||
internal short sections;
|
||||
internal uint tdStampRaw;
|
||||
internal uint symTabPtr;
|
||||
internal uint numSymbols;
|
||||
internal short optHeaderSize;
|
||||
internal Characteristics characteristics;
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Machine identifier.
|
||||
/// </summary>
|
||||
public MachineId Machine {
|
||||
get { return machine; }
|
||||
set { machine = value; }
|
||||
get {
|
||||
return machine;
|
||||
}
|
||||
set {
|
||||
machine = value;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// </summary>
|
||||
public short NumberOfSections {
|
||||
get { return sections; }
|
||||
set { sections = value; }
|
||||
get {
|
||||
return sections;
|
||||
}
|
||||
set {
|
||||
sections = value;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// </summary>
|
||||
public uint TimeDateStamp {
|
||||
get { return tdStampRaw; }
|
||||
set { tdStampRaw = value; }
|
||||
get {
|
||||
return tdStampRaw;
|
||||
}
|
||||
set {
|
||||
tdStampRaw = value;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// </summary>
|
||||
public DateTime TimeStamp {
|
||||
get {
|
||||
return (new DateTime(1970, 1, 1) +
|
||||
@@ -40,62 +69,83 @@ namespace Mono.PEToolkit {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// </summary>
|
||||
public uint PointerToSymbolTable {
|
||||
get { return symTabPtr; }
|
||||
set { symTabPtr = value; }
|
||||
get {
|
||||
return symTabPtr;
|
||||
}
|
||||
set {
|
||||
symTabPtr = value;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// </summary>
|
||||
public uint NumberOfSymbols {
|
||||
get { return numSymbols; }
|
||||
set { numSymbols = value; }
|
||||
get {
|
||||
return numSymbols;
|
||||
}
|
||||
set {
|
||||
numSymbols = value;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// </summary>
|
||||
public short SizeOfOptionalHeader {
|
||||
get { return optHeaderSize; }
|
||||
set { optHeaderSize = value; }
|
||||
get {
|
||||
return optHeaderSize;
|
||||
}
|
||||
set {
|
||||
optHeaderSize = value;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// </summary>
|
||||
public Characteristics Characteristics {
|
||||
get { return characteristics; }
|
||||
set { characteristics = value; }
|
||||
get {
|
||||
return characteristics;
|
||||
}
|
||||
set {
|
||||
characteristics = value;
|
||||
}
|
||||
}
|
||||
|
||||
public void Read (BinaryReader reader)
|
||||
{
|
||||
machine = (MachineId) reader.ReadUInt16 ();
|
||||
sections = reader.ReadInt16 ();
|
||||
tdStampRaw = reader.ReadUInt32 ();
|
||||
symTabPtr = reader.ReadUInt32 ();
|
||||
numSymbols = reader.ReadUInt32 ();
|
||||
optHeaderSize = reader.ReadInt16 ();
|
||||
characteristics = (Characteristics) reader.ReadUInt16 ();
|
||||
|
||||
/// <summary>
|
||||
/// </summary>
|
||||
unsafe public void Read(BinaryReader reader) {
|
||||
fixed (void* pThis = &this) {
|
||||
PEUtils.ReadStruct(reader, pThis, sizeof (COFFHeader), typeof (COFFHeader));
|
||||
}
|
||||
}
|
||||
|
||||
public void Write (BinaryWriter writer)
|
||||
{
|
||||
writer.Write ((ushort)machine);
|
||||
writer.Write (sections);
|
||||
writer.Write (tdStampRaw);
|
||||
writer.Write (symTabPtr);
|
||||
writer.Write (numSymbols);
|
||||
writer.Write (optHeaderSize);
|
||||
writer.Write ((ushort)characteristics);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// </summary>
|
||||
/// <param name="writer"></param>
|
||||
public void Dump(TextWriter writer)
|
||||
{
|
||||
|
||||
writer.WriteLine(
|
||||
"Machine ID : {0}" + Environment.NewLine +
|
||||
"Machine ID : {0}" + Environment.NewLine +
|
||||
"Sections : {1}" + Environment.NewLine +
|
||||
"Characteristics : {2}" + Environment.NewLine +
|
||||
"timestamp : {3}" + Environment.NewLine
|
||||
,machine, sections, (ushort)characteristics,
|
||||
TimeStamp + " (" + tdStampRaw.ToString("X") + ")"
|
||||
"timestamp : {2}" + Environment.NewLine +
|
||||
"Characteristics : {3}" + Environment.NewLine,
|
||||
machine, sections,
|
||||
TimeStamp + " (" + tdStampRaw.ToString("X") + ")",
|
||||
characteristics + " (0x" + characteristics.ToString("X") + ")"
|
||||
);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public override string ToString()
|
||||
{
|
||||
StringWriter sw = new StringWriter();
|
||||
@@ -103,6 +153,7 @@ namespace Mono.PEToolkit {
|
||||
return sw.ToString();
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,44 +0,0 @@
|
||||
2003-02-23 Peter Williams <[email protected]>
|
||||
|
||||
* makefile.gnu (all): Give this dependencies
|
||||
so that we don't rebuild every time.
|
||||
|
||||
2003-02-22 Jackson Harper <[email protected]>
|
||||
|
||||
* Image.cs: Write CorHeader
|
||||
|
||||
2003-02-22 Jackson Harper <[email protected]>
|
||||
|
||||
* Image.cs: Write Sections
|
||||
|
||||
2003-02-22 Jackson Harper <[email protected]>
|
||||
|
||||
* Section.cs: Add method for writing Sections
|
||||
|
||||
2003-02-21 Jackson Harper <[email protected]>
|
||||
|
||||
* Section.cs: Add Method to write Headers
|
||||
|
||||
2003-02-21 Jackson Harper <[email protected]>
|
||||
|
||||
* Section.cs: Make Read method safe
|
||||
|
||||
2003-02-21 Jackson Harper <[email protected]>
|
||||
|
||||
* Section.cs: Convert Header to a class and lowers it accesability.
|
||||
|
||||
2003-02-17 Jackson Harper <[email protected]>
|
||||
|
||||
* COFFHeader.cs: Convert to class, use Read and Write methods. Compress some code
|
||||
* CheckSum.cs: Access Lfanew through property not field.
|
||||
* CorHeader.cs: Convert to class, use Read and Write methods.
|
||||
* DOSHeader.cs: Convert to class, use Read and Write methods, and Init method for creating
|
||||
new DOSHeaders
|
||||
* DataDir.cs: Convert to class, use Read and Write methods.
|
||||
* Image.cs: Access lfanew through property, add Write method.
|
||||
* PEHeader.cs: Convert to class, use Read and Write methods.
|
||||
* PEUtils.cs: Add GetString method for converting byte pointers to strings.
|
||||
* RVA.cs: Add Write method
|
||||
* Section.cs: Use PEUtils.GetString method instead of new string (byte*)
|
||||
* makefuile.gnu: Compile all the files I want compiled ;-)
|
||||
|
||||
@@ -37,7 +37,7 @@ namespace Mono.PEToolkit {
|
||||
PEHeader peHdr = new PEHeader();
|
||||
|
||||
dosHdr.Read (reader);
|
||||
reader.BaseStream.Position = dosHdr.Lfanew;
|
||||
reader.BaseStream.Position = dosHdr.lfanew;
|
||||
ExeSignature peSig = (ExeSignature) reader.ReadUInt16();
|
||||
if (peSig != ExeSignature.NT) {
|
||||
throw new BadImageException("Checksum : Invalid image format, cannot find PE signature.");
|
||||
|
||||
@@ -38,7 +38,8 @@ namespace Mono.PEToolkit {
|
||||
/// CLR 2.0 header structure.
|
||||
/// IMAGE_COR20_HEADER
|
||||
/// </summary>
|
||||
public class CorHeader {
|
||||
[StructLayoutAttribute(LayoutKind.Sequential)]
|
||||
public struct CorHeader {
|
||||
// Header versioning
|
||||
internal uint cb;
|
||||
internal short runtimeMaj;
|
||||
@@ -265,77 +266,26 @@ namespace Mono.PEToolkit {
|
||||
}
|
||||
|
||||
|
||||
public void Read(BinaryReader reader)
|
||||
unsafe public void Read(BinaryReader reader)
|
||||
{
|
||||
// Header versioning
|
||||
cb = reader.ReadUInt32 ();
|
||||
|
||||
runtimeMaj = reader.ReadInt16 ();
|
||||
runtimeMin = reader.ReadInt16 ();
|
||||
|
||||
|
||||
// Symbol table and startup information.
|
||||
meta = new DataDir (reader);
|
||||
flags = (CorFlags) reader.ReadUInt32 ();
|
||||
entryTok = reader.ReadUInt32 ();
|
||||
// TODO: clear structure before reading to initialize/reset
|
||||
// unused fields. initblk would be great.
|
||||
|
||||
// Binding information.
|
||||
rsrc = new DataDir (reader);
|
||||
strongSig = new DataDir (reader);
|
||||
|
||||
// Regular fixup and binding information.
|
||||
codeManTab = new DataDir (reader);
|
||||
vtab = new DataDir (reader);
|
||||
jumps = new DataDir (reader);
|
||||
|
||||
// Managed Native Code.
|
||||
eeInfo = new DataDir (reader);
|
||||
helper = new DataDir (reader);
|
||||
dynInfo = new DataDir (reader);
|
||||
delayInfo = new DataDir (reader);
|
||||
modImg = new DataDir (reader);
|
||||
extFixups = new DataDir (reader);
|
||||
ridMap = new DataDir (reader);
|
||||
dbgMap = new DataDir (reader);
|
||||
|
||||
// obsolete?
|
||||
ipMap = new DataDir (reader);
|
||||
}
|
||||
|
||||
public void Write (BinaryWriter writer)
|
||||
{
|
||||
// Header versioning
|
||||
writer.Write (cb);
|
||||
|
||||
writer.Write (runtimeMaj);
|
||||
writer.Write (runtimeMin);
|
||||
|
||||
// Symbol table and startup information.
|
||||
meta.Write (writer);
|
||||
writer.Write ((uint)flags);
|
||||
writer.Write (entryTok);
|
||||
|
||||
// Binding information.
|
||||
rsrc.Write (writer);
|
||||
strongSig.Write (writer);
|
||||
|
||||
// Regular fixup and binding information.
|
||||
codeManTab.Write (writer);
|
||||
vtab.Write (writer);
|
||||
jumps.Write (writer);
|
||||
|
||||
// Managed Native Code.
|
||||
eeInfo.Write (writer);
|
||||
helper.Write (writer);
|
||||
dynInfo.Write (writer);
|
||||
delayInfo.Write (writer);
|
||||
modImg.Write (writer);
|
||||
extFixups.Write (writer);
|
||||
ridMap.Write (writer);
|
||||
dbgMap.Write (writer);
|
||||
|
||||
// obsolete?
|
||||
ipMap.Write (writer);
|
||||
// Read exactly the number of bytes as specified in the header.
|
||||
// This number is duplicated in PEHeader::CLIHdrDir.
|
||||
cb = reader.ReadUInt32();
|
||||
if (cb > sizeof(uint)) {
|
||||
fixed (void* ptr = &this.runtimeMaj, pThis = &this) {
|
||||
PEUtils.ReadStruct(reader, ptr, (int)cb - sizeof (uint));
|
||||
if (!System.BitConverter.IsLittleEndian) {
|
||||
// fix entries on big-endian machine
|
||||
// preserving cb
|
||||
uint oldcb = cb;
|
||||
PEUtils.ChangeStructEndianess(pThis, typeof (CorHeader));
|
||||
cb = oldcb;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -360,18 +310,15 @@ namespace Mono.PEToolkit {
|
||||
"External Fixups : {15}" + Environment.NewLine +
|
||||
"Rid Map : {16}" + Environment.NewLine +
|
||||
"Debug Map : {17}" + Environment.NewLine +
|
||||
"IP Map : {18}" + Environment.NewLine +
|
||||
"Runtime Major : {19}" + Environment.NewLine +
|
||||
"Runtime Minor : {20}" + Environment.NewLine,
|
||||
cb,
|
||||
"IP Map : {18}" + Environment.NewLine,
|
||||
cb + String.Format(" (0x{0})", cb.ToString("X")),
|
||||
RuntimeVersion,
|
||||
meta, null, EntryPointToken,
|
||||
meta, flags, EntryPointToken,
|
||||
rsrc, strongSig,
|
||||
codeManTab, vtab, jumps,
|
||||
eeInfo, helper, dynInfo, delayInfo, modImg, extFixups,
|
||||
ridMap, dbgMap, ipMap, MajorRuntimeVersion, MinorRuntimeVersion
|
||||
ridMap, dbgMap, ipMap
|
||||
));
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -385,4 +332,4 @@ namespace Mono.PEToolkit {
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -8,65 +8,74 @@ using System.Runtime.InteropServices;
|
||||
|
||||
namespace Mono.PEToolkit {
|
||||
|
||||
public class DOSHeader {
|
||||
|
||||
private readonly int OpenSize = 60;
|
||||
private readonly int CloseSize = 64;
|
||||
[StructLayout(LayoutKind.Explicit)]
|
||||
public struct DOSHeader {
|
||||
// Magic number (ExeSignature.DOS).
|
||||
[FieldOffset(0*2)] public ExeSignature magic;
|
||||
|
||||
private byte[] open_data; // First 60 bytes of data
|
||||
private byte[] close_data; // Last 64 bytes of data
|
||||
// Bytes on last page of file.
|
||||
[FieldOffset(1*2)] public short cblp;
|
||||
|
||||
// Pages in file.
|
||||
[FieldOffset(2*2)] public short cp;
|
||||
|
||||
// Relocations.
|
||||
[FieldOffset(3*2)] public short crlc;
|
||||
|
||||
// Size of header in paragraphs.
|
||||
[FieldOffset(4*2)] public short cparhdr;
|
||||
|
||||
// Minimum extra paragraphs needed.
|
||||
[FieldOffset(5*2)] public short minalloc;
|
||||
|
||||
// Maximum extra paragraphs needed.
|
||||
[FieldOffset(6*2)] public short maxalloc;
|
||||
|
||||
// Initial (relative) SS value.
|
||||
[FieldOffset(7*2)] public short ss;
|
||||
|
||||
// Initial SP value.
|
||||
[FieldOffset(8*2)] public short sp;
|
||||
|
||||
// Checksum.
|
||||
[FieldOffset(9*2)] public short csum;
|
||||
|
||||
// Initial IP value.
|
||||
[FieldOffset(10*2)] public short ip;
|
||||
|
||||
// Initial (relative) CS value.
|
||||
[FieldOffset(11*2)] public short cs;
|
||||
|
||||
// File address of relocation table.
|
||||
[FieldOffset(12*2)] public short lfarlc;
|
||||
|
||||
// Overlay number.
|
||||
[FieldOffset(13*2)] public short ovno;
|
||||
|
||||
// Reserved words.
|
||||
// short[4] res;
|
||||
|
||||
// OEM identifier (for e_oeminfo).
|
||||
[FieldOffset(18*2)] public short oemid;
|
||||
|
||||
// OEM information; e_oemid specific.
|
||||
[FieldOffset(19*2)] public short oeminfo;
|
||||
|
||||
// Reserved words
|
||||
// short[10] res2;
|
||||
|
||||
// File address of new exe header.
|
||||
private uint lfanew;
|
||||
[FieldOffset(30*2)] public uint lfanew;
|
||||
|
||||
public DOSHeader ()
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// </summary>
|
||||
unsafe public void Read(BinaryReader reader)
|
||||
{
|
||||
Init ();
|
||||
}
|
||||
|
||||
public DOSHeader (BinaryReader reader)
|
||||
{
|
||||
Read (reader);
|
||||
}
|
||||
|
||||
public uint Lfanew {
|
||||
get { return lfanew; }
|
||||
}
|
||||
|
||||
public void Read (BinaryReader reader)
|
||||
{
|
||||
open_data = reader.ReadBytes (OpenSize);
|
||||
lfanew = reader.ReadUInt32 ();
|
||||
close_data = reader.ReadBytes (CloseSize);
|
||||
}
|
||||
|
||||
public void Write (BinaryWriter writer)
|
||||
{
|
||||
writer.Write (open_data);
|
||||
writer.Write (lfanew);
|
||||
writer.Write (close_data);
|
||||
}
|
||||
|
||||
public void Init ()
|
||||
{
|
||||
open_data = new byte[] { 0x4D, 0x5A, 0x0, 0x0, 0xE7, 0x0, 0x0, 0x0,
|
||||
0x4, 0x0, 0x0, 0x0, 0xFF, 0xFF, 0x0, 0x0,
|
||||
0xB8, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
|
||||
0x40, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
|
||||
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
|
||||
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
|
||||
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
|
||||
0x0, 0x0, 0x0, 0x0 };
|
||||
|
||||
close_data = new byte[] { 0xE, 0x1F, 0xBA, 0xE, 0x0, 0xB4, 0x9, 0xCD,
|
||||
0x21, 0xB8, 0x1, 0x4C, 0xCD, 0x21,0x54, 0x68,
|
||||
0x69, 0x73, 0x20, 0x70, 0x72, 0x6F, 0x67, 0x72,
|
||||
0x61, 0x6D, 0x20, 0x63, 0x61, 0x6E, 0x6E, 0x6F,
|
||||
0x74, 0x20, 0x62, 0x65, 0x20, 0x72, 0x75, 0x6E,
|
||||
0x20, 0x69, 0x6E, 0x20, 0x44, 0x4F, 0x53, 0x20,
|
||||
0x6D, 0x6F, 0x64, 0x65, 0x2E, 0xD, 0xD, 0xA,
|
||||
0x24, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 };
|
||||
|
||||
fixed (void* pThis = &this) {
|
||||
PEUtils.ReadStruct(reader, pThis, sizeof (DOSHeader), typeof (DOSHeader));
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -75,8 +84,17 @@ namespace Mono.PEToolkit {
|
||||
public void Dump(TextWriter writer)
|
||||
{
|
||||
writer.WriteLine(
|
||||
"New header offset : {0}",
|
||||
lfanew + " (0x" + lfanew.ToString("X") + ")"
|
||||
"Number of pages : {0}" + Environment.NewLine +
|
||||
"Bytes on last pages : {1}" + Environment.NewLine +
|
||||
"New header offset : {2}" + Environment.NewLine +
|
||||
"Initial CS:IP : {3}:{4}" + Environment.NewLine +
|
||||
"Initial SS:SP : {5}:{6}" + Environment.NewLine +
|
||||
"Overlay number : {7}" + Environment.NewLine,
|
||||
cp, cblp,
|
||||
lfanew + " (0x" + lfanew.ToString("X") + ")",
|
||||
cs.ToString("X"), ip.ToString("X"),
|
||||
ss.ToString("X"), sp.ToString("X"),
|
||||
ovno
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
Loaded 100 of 1066 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user