2003-12-07 Sebastien Pouliot <spouliot@videotron.ca>
[mono.git] / man / mono.1
1 .\" 
2 .\" mono manual page.
3 .\" (C) 2003 Ximian, Inc. 
4 .\" Author:
5 .\"   Miguel de Icaza (miguel@gnu.org)
6 .\"
7 .de Sp \" Vertical space (when we can't use .PP)
8 .if t .sp .5v
9 .if n .sp
10 ..
11 .TH Mono "Mono 1.0"
12 .SH NAME
13 mono \- Mono's ECMA-CLI native code generator (Just-in-Time and Ahead-of-Time)
14 .SH SYNOPSIS
15 .PP
16 .B mono [options] file [arguments...]
17 .SH DESCRIPTION
18 \fImono\fP is a runtime implementation of the ECMA Common Language
19 Infrastructure.  This can be used to run ECMA and .NET applications.
20 .PP
21 The runtime contains a native code generator that transforms the
22 Common Intermediate Language into native code.
23 .PP
24 The code generator can operate in two modes: just in time compilation
25 (JIT) or ahead of time compilation (AOT).  Since code can be
26 dynamically loaded, the runtime environment and the JIT are always
27 present, even if code is compiled ahead of time.
28 .PP
29 The runtime loads ths specified
30 .I file
31 and optionally passes
32 the
33 .I arguments
34 to it.  The 
35 .I file
36 is an ECMA assembly.  They typically have a .exe or .dll extension.
37 .PP
38 The runtime provides a number of configuration options for running
39 applications, for developping and debugging, and for testing and
40 debugging the runtime itself.
41 .SH RUNTIME OPTIONS
42 The following options are available:
43 .TP
44 .I "--aot"
45 This option is used to precompile the CIL code in the specified
46 assembly to native code.  The generated code is stored in a file with
47 the extension .so.  This file will be automatically picked up by the
48 runtime when the assembly is executed.  
49 .Sp
50 This pre-compiles the methods, but the original assembly is still
51 required to execute as this one contains the metadata and exception
52 information which is not availble on the generated file.  When
53 precompiling code, you might want to compile with all optimizations
54 (-O=all).  Pre-compiled code is position independent code.
55 .Sp
56 Pre compilation is just a mechanism to reduce startup time, and avoid
57 just-in-time compilation costs.  The original assembly must still be
58 present, as the metadata is contained there.
59 .TP
60 .I "--config filename"
61 Load the specified configuration file instead of the default one(s).
62 The default files are /etc/mono/config and ~/.mono/config or the file
63 specified in the MONO_CONFIG environment variable, if set.  See the
64 mono-config(5) man page for details on the format of this file.
65 .TP
66 .I "--help", "-h"
67 Displays usage instructions.
68 .TP
69 .I "--optimize=MODE", "-O=mode"
70 MODE is a comma separated list of optimizations.  They also allow
71 optimizations to be turned off by prefixing the optimization name with
72 a minus sign.
73 .Sp
74 The following optimizations are implemented:
75 .nf
76              all        Turn on all optimizations
77              peephole   Peephole postpass
78              branch     Branch optimizations
79              inline     Inline method calls
80              cfold      Constant folding
81              consprop   Constant propagation
82              copyprop   Copy propagation
83              deadce     Dead code elimination
84              linears    Linear scan global reg allocation
85              cmov       Conditional moves
86              shared     Emit per-domain code
87              sched      Instruction scheduling
88              intrins    Intrinsic method implementations
89              tailc      Tail recursion and tail calls
90              loop       Loop related optimizations
91              leaf       Leaf procedures optimizations
92              profile    Use profiling information
93 .fi
94 .Sp
95 For example, to enable all the optimization but dead code
96 elimination and inlining, you can use:
97 .nf
98         -O=all,-deadce,-inline
99 .fi
100 .TP
101 .I "-V", "--version"
102 Prints JIT version information.
103
104
105 .SH DEVELOPMENT OPTIONS
106 The following options are used to help when developing a JITed application.
107 .TP
108 .I "--debug"
109 Turns on the debugging mode in the runtime.  If an assembly was
110 compiled with debugging information, it will produce line number
111 information for stack traces. 
112 .TP
113 .I "--profile[=profiler[:profiler_args]]"
114 Instructs the runtime to collect profiling information about execution
115 times and memory allocation, and dump it at the end of the execution.
116 If a profiler is not specified, the default profiler is used. profiler_args 
117 is a profiler-specific string of options for the profiler itself.
118 .PP
119 The default profiler accepts -time and -alloc to options to disable
120 the time profiling or the memory allocation profilng.
121 .SH JIT MAINTAINER OPTIONS
122 The maintainer options are only used by those developing the runtime
123 itself, and not typically of interest to runtime users or developers.
124 .TP
125 .I "--compile name"
126 This compiles a method (namespace.name:methodname), this is used for
127 testing the compiler performance or to examine the output of the code
128 generator. 
129 .TP
130 .I "--compileall"
131 Compiles all the methods in an assembly.  This is used to test the
132 compiler performance or to examine the output of the code generator
133 .TP 
134 .I "--graph=TYPE METHOD"
135 This generates a postscript file with a graph with the details about
136 the specified method (namespace.name:methodname).  This requires `dot'
137 and ghostview to be installed (it expects Ghostview to be called
138 "gv"). 
139 .TP
140 The following graphs are available:
141 .nf
142           cfg        Control Flow Graph (CFG)
143           dtree      Dominator Tree
144           code       CFG showing code
145           ssa        CFG showing code after SSA translation
146           optcode    CFG showing code after IR optimizations
147 .fi
148 .Sp
149 Some graphs will only be available if certain optimizations are turned
150 on.
151 .TP
152 .I "--ncompile"
153 Instruct the runtime on the number of times that the method specified
154 by --compile (or all the methods if --compileall is used) to be
155 compiled.  This is used for testing the code generator performance. 
156 .TP
157 .I "-v", "--verbose"
158 Increases the verbosity level, each time it is listed, increases the
159 verbosity level to include more information (including, for example, 
160 a disassembly of the native code produced, code selector info etc.).
161 .TP
162 .I "--break method"
163 Inserts a breakpoint before the method whose name is `method'
164 (namespace.class:methodname).  Use `Main' as method name to insert a
165 breakpoint on the application's main method.
166 .TP
167 .I "--breakonex"
168 Inserts a breakpoint on exceptions.  This allows you to debug your
169 application with a native debugger when an exception is thrown.
170 .TP
171 .I "--trace[=expression]"
172 Shows method names as they are invoked.  By default all methods are
173 traced. 
174 .TP
175 The trace can be customized to include or exclude methods, classes or
176 assemblies.  A trace expression is a comma separated list of targets,
177 each target can be prefixed with a minus sign to turn off a particular
178 target.  The words `program' and `all' have special meaning.
179 `program' refers to the main program being executed, and `all' means
180 all the method calls. 
181 .TP
182 Assemblies are specified by their name, for example, to trace all
183 calls in the System assembly, use:
184 .nf
185         mono --trace=System app.exe
186 .fi
187 Classes are specified with the T: prefix.  For example, to trace all
188 calls to the System.String class, use:
189 .nf
190         mono --trace=T:System.String app.exe
191 .fi
192 And individual methods are referenced with the M: prefix, and the
193 standar method notation:
194 .nf
195         mono --trace=M:System.Console.WriteLine app.exe
196 .fi
197 As previously noted, various rules can be specified at once:
198 .nf
199         mono --trace=T:System.String,T:System.Random app.exe
200 .fi
201 You can exclude pieces, the next example traces calls to
202 System.String except for the System.String:Concat method.
203 .nf
204         mono --trace=T:System.String,-M:System.String:Concat
205 .fi
206 Finally, namespaces can be specified using the N: prefix:
207 .nf
208         mono --trace=N:System.Xml
209 .fi
210 .SH ENVIRONMENT VARIABLES
211 .TP
212 .I "GC_DONT_GC"
213 Turns off the garbage collection in Mono.  This should be only used
214 for debugging purposes
215 .TP
216 .I "MONO_PATH"
217 Provides a search path to the runtime where to look for library files.
218 Directories are separated by the platform path separator (colons on unix). Example:
219 .B /home/username/lib:/usr/local/mono/lib
220 .TP
221 .I "MONO_DISABLE_SHM"
222 If this variable is set, it disables the shared memory part of the
223 Windows I/O Emulation layer, and handles (files, events, mutexes,
224 pipes) will not be shared across processes.  Process creation is also
225 disabled.  This option is only available on Unix.
226 .TP
227 .I "MONO_CFG_DIR"
228 If set, this variable overrides the default system configuration directory
229 ($PREFIX/etc). It's used to locate machine.config file.
230 .TP
231 .I "MONO_CONFIG"
232 If set, this variable overrides the default runtime configuration file
233 ($PREFIX/etc/mono/config). The --config command line options overrides the
234 environment variable.
235 .TP
236 .I "MONO_DEBUG"
237 If set, enables some features of the runtime useful for debugging.
238 Currently it only makes the runtime display the stack traces for all the
239 threads running and exit. It may not exit cleanly. Use at your own risk.
240 .TP
241 .I "MONO_EXTERNAL_ENCODINGS"
242 If set, contains a colon-separated list of text encodings to try when
243 turning externally-generated text (e.g. command-line arguments or
244 filenames) into unicode.  The encoding names come from the list
245 provided by iconv, and the special case "default_locale" which refers
246 to the current locale's default encoding.
247 .TP
248 When reading externally-generated text strings UTF-8 is tried first,
249 and then this list is tried in order with the first successful
250 conversion ending the search.  When writing external text (e.g. new
251 filenames or arguments to new processes) the first item in this list
252 is used, or UTF-8 if the environment variable is not set.
253 .TP 
254 .I "MONO_SHARED_DIR"
255 If set its the directory where the ".wapi" handle state is stored.
256 This is the directory where the Windows I/O Emulation layer stores its
257 shared state data (files, events, mutexes, pipes).  By default Mono
258 will store the ".wapi" directory in the users's home directory.
259 .SH FILES
260 On Unix assemblies are loaded from the installation lib directory.  If you set
261 `prefix' to /usr, the assemblies will be located in /usr/lib.  On
262 Windows, the assemblies are loaded from the directory where mono and
263 mint live.
264 .PP
265 /etc/mono/config, ~/.mono/config
266 .PP
267 Mono runtime configuration file.  See the mono-config(5) manual page
268 for more information.
269 .SH MAILING LISTS
270 Visit http://mail.ximian.com/mailman/mono-list for details.
271 .SH WEB SITE
272 Visit: http://www.go-mono.com for details
273 .SH SEE ALSO
274 .BR mcs(1), mint(1), monodis(1), mono-config(5).
275 .PP
276 For ASP.NET-related documentation, see the xsp(1) manual page
277
278