1 # Copyright (C) 2001-2005, The Perl Foundation.
14 This document describes parrot's command line options.
18 parrot [-options] <file> [arguments ...]
26 If this environment variable is set, parrot will use this path as runtime
27 prefix instead of the compiled in path.
31 Turn on the I<--gc-debug> flag.
37 =head2 Assembler options
43 Assume PASM input on stdin.
47 Assume PBC file on stdin, run it.
49 =item -d, --debug [hexbits]
51 The B<-d> switch takes an optional argument which is considered to hold a hex
52 value of debug bits. Without a value, debug is set to 1.
54 The individual bits are:
67 These can be listed on the command line by use of the B<--help-debug> switch.
69 To produce really huge output on F<stderr> run "imcc B<-d 0ffff> ...". Note:
70 if the argument is separated by whitespace from the B<-d> switch, it has to
75 Print commandline option summary.
79 Print debugging and tracing flag bits summary.
81 =item -o outputfile, --output=outputfile
83 Act like an assembler. Don't run code, unless B<-r> is given too. If the
84 outputfile ends with B<.pbc>, a PBC file is written. If it ends with B<.pasm>,
85 a PASM output is generated, even from PASM input. This can be handy to check
86 various optimizations, including B<-Op>.
90 Act like an assembler, but always output bytecode, even if the output file does
95 Only useful after B<-o> or B<--output-pbc>. Run the program from the compiled
96 in-memory image. If two B<-r> options are given, the B<.pbc> file is read from
97 disc and run. This is mainly needed for tests.
101 One B<-v> shows which files are worked on and prints a summary over register
102 usage and optimization stats per I<compilation unit>. With two B<-v> switches,
103 IMCC prints a line per individual processing step too.
107 Turn on yydebug in F<yacc>/F<bison>.
115 -O0 no optimization (default)
116 -O1 optimizations without life info (e.g. branches)
118 -O2 optimizations with life info
119 -Op rewrite I and N PASM registers most used first
120 -Ot select fastest run core (default with -O1 and -O2)
121 -Oc turns on the optional/experimental tail call optimizations
123 See F<docs/imcc/operation.pod> for more information on the optimizer. NB.
124 Optimization is currently experimental and these options are likely to change.
126 =item -E, --pre-process-only
128 Preprocess source file (i.e. expand macros) and print result to stdout. E.g.
130 $ parrot -E t/op/macro_10.pasm
131 $ parrot -E t/op/macro_10.pasm | parrot -- -
135 =head2 Run Core Options
137 TODO: The default run core should be indicated.
141 =item -b, --bounds-checks, --slow-core
143 Select the bounds-checking slow core.
147 Select the CGP (CGoto Predereferenced) core (if available).
149 =item -f, --fast-core
151 Select the fast (or function) core.
153 =item -g, --computed-goto-core
155 Select the CGoto core (if available).
159 Run with the JIT subsystem (if available).
163 Run with the slow core and print an execution profile.
165 =item -S, --switched-core
167 TODO: This needs to be documented briefly here and also in glossary.pod.
171 Run with the slow core and print trace information to B<stderr>. See 'parrot
172 --help-debug' for available flag bits.
182 Turn on warnings. See 'parrot --help-debug' for available flag bits.
184 =item -D, --parrot-debug
186 Turn on interpreter debug flag. See 'parrot --help-debug' for available flag
191 Turn on GC (Garbage Collection) debugging. This imposes some stress on the GC
192 subsystem and can slow down execution considerably.
196 This turns off DOD (Dead Object Detection) and GC. This may be useful to find
197 GC related bugs. Don't use this option for longer running programs: as memory
198 is no longer recycled, it may quickly become exhausted.
200 =item --leak-test, --destroy-at-end
202 Free all memory of the last interpreter, so that leak checkers can be run.
206 Read a keystroke before starting.
208 =item --runtime-prefix
210 Print the runtime prefix path and exit.
216 If the file ends in B<.pbc> it will be interpreted immediately.
218 If the file ends in B<.pasm>, then it is parsed as PASM code. Otherwise, it is
219 parsed as PIR code. In both cases, it will then be run, unless the B<-o> flag
222 If the B<file> is a single dash, input from B<stdin> is read.
224 =head2 Generated files
226 If debugging is enabled these files are generated:
228 file.stabs.s ... stabsfile for the program
229 file.o ... object file with debug information
230 EVAL_n ... source of B<compile> op number I<n>
231 EVAL_n.stabs.s ... stabsfile for this block
232 EVAL_n.o ... object file with debug information
234 =head1 [arguments ...]
236 Optional arguments passed to the running program as ARGV. The program is
237 assumed to know what to do with these.
239 =head1 Operation table
241 Command line Action Output
242 ---------------------------------------------
246 -o x.pasm x.pir ass x.pasm
247 -o x.pasm y.pasm ass x.pasm
248 -o x.pbc x.pir ass x.pbc
249 -o x.pbc x.pasm ass x.pbc
250 -o x.pbc -r x.pasm ass/run pasm x.pbc
251 -o x.pbc -r -r x.pasm ass/run pbc x.pbc
256 run ... yes, run the program
257 ass ... assemble sourcefile
258 obj .. produce native (ELF) object file for the EXEC subsystem
270 Leopold Toetsch C<lt@toetsch.at>