Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 948 lines (781 sloc) 27.09 kB
fccc685 Initial open-source release
MLstate authored
1 (*
2 Copyright © 2011 MLstate
3
4 This file is part of OPA.
5
6 OPA is free software: you can redistribute it and/or modify it under the
7 terms of the GNU Affero General Public License, version 3, as published by
8 the Free Software Foundation.
9
10 OPA is distributed in the hope that it will be useful, but WITHOUT ANY
11 WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
12 FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for
13 more details.
14
15 You should have received a copy of the GNU Affero General Public License
16 along with OPA. If not, see <http://www.gnu.org/licenses/>.
17 *)
18
19 (**
20 Debug Variables Management for the MLstate debug preprocessor (ppdebug)
21
22 @see "opalang/utils/ppdebug.pl" the script which implement the preprocess
23 @author Louis Gesbert
24 @author Mathieu Barbin
25 *)
26
27 (** {6 Template} *)
28
29 (**
30 Template for a module name [MyId]
31 {[
32 #<Debugvar:MY_VAR>
33 let debug fmt =
34 OManager.printf ("@{<cyan>[MyId]@}@ @[<2>"^^fmt^^"@]@.")
35
36 (* utilisation *)
37 ...
38 let _ =
39 #<If:MY_VAR $minlevel 4>
40 debug "do some %s of level %d@\n" "debug" 4
41 #<End>
42 in
43 ...
44 ]}
45 *)
46
47 (** {6 Static Debug Preprocessor -- Syntax Documentation} *)
48
49 (**
50 The preprocessor {b ppdebug} is used whenever you want to add logs or computation
51 in your application (assert, etc...), but you do not want the code to be embedded in release mode.
52
53 {[
54 let g =
55 #<Debug>
56 print_endline "this is a log" ;
57 #<End>
58 5
59 ]}
60
61 will be either
62 {[
63 let g =
64 (* #<Debug> *)
65 print_endline "this is a log" ;
66 (* #<End> *)
67 5
68 ]}
69 or
70 {[
71 let g =
72 (* #<Debug> *)(*
73 print_endline "this is a log" ;
74 *)(* #<End> *)
75 5
76 ]}
77 depending of the env var {b MLSTATE_PPDEBUG}, or on the tag used with ocamlbuild.
78
79 Note that you can also have a different code instead of nothing, using [#else]
80 {[
81 let g =
82 #<Debug>
83 print_endline "this is BIG BIG LOG" ;
84 print_endline "with so many details that I'd like to keep it only in debug mode" ;
85 #<Else>
86 print_endline "short log" ;
87 #<End>
88 5
89 ]}
90
91 <!> The code should be totally recompiled with/without option PPDEBUG to make changes be taken in consideration.
92 For dynamic toggle behavior, cf the next part.
93
94 For other compile-time checks (eg. target-dependent code), you can use the directive [#<Ifstatic:VAR REGEXP>].
95 A check will be done by the preprocessor on environment variable [VAR] with the regexp [REGEXP], and comment
96 the unappropriate code:
97
98 {[
99 let build_arch =
100 #<Ifstatic:ARCH Win.*> "Windows" #<Else> "Other" #<End>
101 ]}
102
103 will define [build_arch] to be ["Windows"] whenever a variable [ARCH] is defined with a value beginning with
104 ["Win"]
105 *)
106
107 (** {6 Dynamic Debug Preprocessor -- Syntax Documentation} *)
108
109 (**
110 This preprocessor allows you to do some extra logs and computation without recompiling
111 everything with a different preprocess configuration, but assures you that your code will
112 not be embeded in release mode.
113
114 {[
115 let g =
116 #<If:MY_SPLENDID_VARIABLE>
117 print_endline "this is a log"
118 #<End> ;
119 5
120 ]}
121
122 will be transformed in :
123 {[
124 let g =
125 (* #<If> *) if (DebugVariables.default) DebugVariables.my_splendid_variable then begin
126 print_endline "this is a log"
127 (* #<End> *) end else begin () end ;
128 5
129 ]}
130 or if release-mode is activated :
131 {[
132 let g =
133 (* #<If> *)(* if (DebugVariables.default) DebugVariables.my_splendid_variable then begin
134 print_endline "this is a log"
135 (* #<End> *) end else *) begin () end ;
136 5
137 ]}
138
139 Note that the [;] at the end is kept: the ppdebug-[#<If>] should be an ocaml expression.
140
141 You can find in this file all documented variables available.
142 You should add your variables there, and documenting it following the guidelines.
143
144 Extension of the test condition :
145
146 By default, we check that the env var is defined and doesn't have value ["0"] (test is [DebugVariables.default]).
147 You can use a different test using the following syntax :
148
149 {[
150 let g =
151 #<If:MY_SPLENDID_VARIABLE $equals "MY_SPLENDID_VALUE">
152 print_endline "this is a log"
153 #<End> ;
154 5
155 ]}
156
157 processed as :
158
159 {[
160 let =
161 (* #<If> *) if (DebugVariables.equals "MY_SPLENDID_VALUE") DebugVariables.my_splendid_variable then begin
162 print_endline "this is a log"
163 (* #<End> *) end else begin () end ;
164 5
165 ]}
166
167 Matching on debug variables :
168
169 If you have a multi-state debug variable, you can add a runtime-match as long as it's enclosed
170 in a [#<If$defined>] :
171
172 {[
173 let verb x =
174 #<If:MY_VERBOSE$defined> match DebugVariables.my_verbose with
175 | Some "quite verbose" -> print_debug x
176 | Some "very verbose" -> print_debug_very_verbose x
177 | _ -> failwith "Bad value for debug variable MY_VERBOSE"
178 #<End>
179 ]}
180
181 Warnings :
182 + <!> This preprocessor should not be used for top-level definitions.
183 + <!> Such a preprocessed part is a Ocaml.expr, necessary of type [unit] if there is no [#<Else>]
184 + <!> Remember that in release, you're always in the Else case. Keep this for debug !
185
186 You can find some tester available in this module.
187 You can add any tester you want editing this module, and following guidelines.
188 *)
189
190
191 (** {6 Variables} *)
192
193 (**
194 When you do lots of tests on the same debug-variable, you can use the shortcut:
195
196 {[
197 #<Debugvar:VAR>
198 ]}
199
200 The [:VAR] in subsequent uses of [#<If>] can be omitted.
201
202 Guidelines :
203 + all variables are documented in alphabetic order !!
204 + all variable begin with {e MLSTATE_} when you export it in shell
205 + all variable are UPPERCASED
206 + all corresponding variable name in this file are lowercased and does not contains MLSTATE_
207 *)
208
209 (**
210 The type of all debug_var.
211 [None] if the variable is not defined, [Some value] if there is a value.
212
213 <!> Env variables are checked only once, when this module is loaded.
214 *)
215 type debug_var = string option
216
217 (**
218 {b MLSTATE_ADD_STDLIB}
219 Be verbose to explain what files are added, and what files are rejected
220 during the pass [AddStdlibFiles], in presence and in absence of option
221 [--no-embedded-stdlib]
222
223 Level 1: print only rejected files
224 Level 2: print only keeped files
225 Level 3: print both
226 *)
227 val add_stdlib : debug_var
228
229 (**
230 {b BADOP_DEBUG}
231 Adds some experimental options to servers related to badop modes.
232 *)
233 val badop_debug : debug_var
234
235 (**
236 {b MLSTATE_BSL_LOADING}
237 Use with level.
238 Be more verbose during loading.
239 1: plugins
240 *: undocumented
241 *)
242 val bsl_loading : debug_var
243
244 (**
245 {b MLSTATE_BSL_NO_RESTRICTION}
246 When set, disables restriction checks on bypasses.
247 Useful when recompiling printed code containing
248 such bypasses.
249 *)
250 val bsl_no_restriction : debug_var
251
252 (**
253 {b MLSTATE_BSL_PROJECTION}
254 Use with level, print some debug logs about external bypass
255 projection. (libbsl, backend, qmltop, etc...)
256 *)
257 val bsl_projection : debug_var
258
259 (**
260 {b MLSTATE_BSL_REGISTER}
261 Use with level. Be more verbose during building maps, and dealing
262 with keys. Used during bslregister.
263 *)
264 val bsl_register : debug_var
265
266 (**
267 {b MLSTATE_BSL_SL}
268 Use with level. Be more verbose during some operations implemented
269 in the ServerLib.
270 This happens at runtime, during projections.
271 *)
272 val bsl_sl : debug_var
273
274 (**
275 {b MLSTATE_BYPASS_HOISTING}
276 insert debug message during the bypass hoisting pass. Works with level.
277 Level 1 :
278 Level 2 :
279 *)
280 val bypass_hoisting : debug_var
281
282 (**
283 One variable to check them all !
284
285 If you dont spell correctly a debug variable by exporting it before running your application,
286 you may be surprised that the execution has not the expected behavior, and you may loose time until
287 you notice that it is because of a variable not correctly defined.
288
289 If (and only if) ["MLSTATE_CHECK_VARS"] is set with a value different than ["0"],
290 this module will do a check on the global process environment.
291 For each env variable starting with ["MLSTATE_"] which are not defined (and documented :))
292 in this module, a warning will be printed on the standard error.
293
294 Strong mode : [MLSTATE_CHECK_VARS="s"] will make an error rather than a warning, stopping the execution.
295 *)
296 val check_vars : debug_var
297
298 (** {9 Closure} *)
299
300 (**
301 {b MLSTATE_CLOSURE_DEBUG}
302 Works only for caml bypasses (with qmlflat only, but this could be fixed)
303 Level 0 : runtime assertions were typing is not possible
304 - qml closures actually have a compatible structure
305 - imported functions must be exported closures
306 Level 1 : previous +
307 tells when applying and receiving magic arguments (to check bsl projections)
308 Level 2 : previous +
309 tells when applying closures to arguments and show the resulting value (very verbose)
310 *)
311 val closure_debug : debug_var
312 val closure_opt : debug_var (** generate optimized applyX functions *)
313 val closure_stat : debug_var (** display a few statistics in the passes uncurry/closure *)
314
315 (** {9 Constant Sharing} *)
316
317 (**
318 Debug vars used for activating/desactivating some sharing during the passes client/server
319 constant sharing. Variable are read only if the pass is activated.
320 *)
321
322 val const_sharing_client_float : debug_var
323 val const_sharing_client_record : debug_var
324 val const_sharing_client_remove_coerce : debug_var
325 val const_sharing_client_string : debug_var
326
327 val const_sharing_server_float : debug_var
328 val const_sharing_server_record : debug_var
329 val const_sharing_server_remove_coerce : debug_var
330 val const_sharing_server_string : debug_var
331
332 (** {9 Cps} *)
333
334 (**
335 {b MLSTATE_CPS_DEBUG} :
336 insert debug introspection message to trace the execution flow of continuations.
337
338 <!> Note that CPS_DEBUG env var should also be set at runtime of the compiled
339 application for logs to be produced, with a given level.
340
341 <!> At compile time, the level is not read, everything is generated.
342
343 {[
344 export MLSTATE_CPS_DEBUG=1
345 // compile
346 // run
347 unset MLSTATE_CPS_DEBUG
348 // run without debug logs
349 // compile
350 // run without debug logs
351 export MLSTATE_CPS_DEBUG=1
352 // run without debug logs (need a recompilation)
353 ]}
354
355 This var is used with increasing levels from 1 to 100 :
356 + 1 : print a few things
357 + 10 : cont tracer (print every cont application)
358 + 100: backtraces display function arguments (WIP)
359 *)
360 val cps_debug : debug_var
361
362 (**
363 {b MLSTATE_CPS_KEEP_LETCONT} :
364 do not remove continuation directly applied. Used just for benchmark purpose.
365 *)
366 val cps_keep_letcont : debug_var
367
368 (**
369 {b MLSTATE_CPS_NOSKIP} :
370 do not use the skip optimisation. Used just for benchmark and tracability purpose.
371 *)
372 val cps_noskip : debug_var
373
374 (**
375 {b MLSTATE_STACK_TRACE}
376 When set, activates the printing of backtraces
377 If it contains "tr", then transaction contexts are printed
378 If it contains "th", then thread contexts are printed
379 If it contains "args", then fonction arguments are printed
380 *)
381 val cps_stack_trace : debug_var
382
383 (**
384 {b MLSTATE_CPS_VERBOSE} :
385 compile time only : let the cps rewriting pass be more verbose. Used with level.
386 No changes to the generated code, affect only the transformation pass.
387 + Level 1 :
388 + print some timing
389 + Level 2 :
390 + previous
391 + print optimisation logs
392 *)
393 val cps_verbose : debug_var
394
395 (**
396 {b MLSTATE_CPS_BLOCKING_WAIT} :
397 Print blocking stack
398 *)
399 val cps_blocking_wait : debug_var
400
401 (**
402 {b MLSTATE_DB3_NO_FINAL_SNAPSHOT}
403 When activated, when the database is closed, we do not make a snapshot of the current revision,
404 meaning that the transaction file will not be empty, and pending transaction reapplied at
405 reopen time.
406 This is used for debugging the binary format of transaction (or queries) because if we
407 always use a snapshot when we close the database, the transaction binary file is always empty.
408 *)
409 val db3_no_final_snapshot : debug_var
410
411 (**
412 {b MLSTATE_LOW_LEVEL_DB_LOG}
413 When activated, the low level database will print disk writing related log in
414 'low_level_db.log' file.
415 *)
416 val low_level_db_log : debug_var
417
418 (**
419 {b MLSTATE_DB3_TRANSACTION_LIMIT}
420 Defines a limit of operations within a transaction, after which it is automatically aborted.
421 Default is 10000. This is a safeguard against exploding the memory by spamming a
422 transaction with too many writes. 0 disables the limit.
423 *)
424 val db3_transaction_limit : debug_var
425
426 (**
427 {b DbGen obscure toggles}
428 *)
429 (** run-time *)
430 val dbgen_always_upgrade : debug_var (** Force upgrade of incompatible databases when they are opened *)
431 val dbgen_butcher : debug_var (** When updating a field from an old db is not possible, remove and re-create *)
432
433 val dbgen_debug : debug_var (** Enables some compile-time debug messages, adds debug prints in the
434 generated code and, at run-time, dbGen-related debug messages *)
435 (** compile-time only: *)
436 val dbgen_flags : debug_var
437 (** comma-separated list of flags for DbGen, compile-time:
438 - 'fullcoerce': put coerces almost everywhere. Useful for checks
439 - 'source': instead of normal fresh identifiers, insert "source" textual ones in
440 AST. Useful to manual checks from toplevel.
441 - 'nodefault': don't complain about missing default values, use by-default defaults.
442 - 'nolazy': disable lazy records
443 - 'sharing': enable full-sharing in the DB (enabled in db tests, temporary
444 disabled for now to workaround a bug in the low-level implementation
445 of copy-on-write)
446 - 'noflatten': don't flatten recursive types, store them as deep trees
447 - 'copylink': when flattening recursive types, link them with internal copy-nodes instead of link-nodes
448 *)
449
450
451 (**
452 {b MLSTATE_DEBUG_DB}
453 Enables debug messages from the low-level database
454 You can specify :
455 - a debug level (int): to display low level db debug
456 - 'migration': to display only migration debug
457 - 'io': to display only io debug
458
459 *)
460 val debug_db : debug_var
461
462 (**
463 {b MLSTATE_DEBUG_DB_INDEX}
464 Enables debug messages from the index handling in the database
465 *)
466 val debug_db_index : debug_var
467
468 (**
469 {b MLSTATE_DEBUG_DB_MAX_DELTA}
470 How many delta nodes are permitted between full nodes; 0 means all are full.
471 *)
472 val debug_db_max_delta : debug_var
473
474 (**
475 {b MLSTATE_DEBUG_PAXOS}
476 Enables debug messages for the Paxos algorithm (including leader election)
477 *)
478 val libnet_cluster : debug_var
479 val debug_paxos : debug_var
480 val debug_paxos_le : debug_var
481 val debug_paxos_rbr : debug_var
482 val debug_paxos_consensus : debug_var
483 val debug_paxos_sched : debug_var
484
bc2add4 [cleanup] Log: add a debug variable for xml
Raja authored
485
486 (**
487 {b MLSTATE_DEBUG_XML}
488 Enables debug messages for Xml module (libbase)
489 *)
490 val debug_xml: debug_var
491
fccc685 Initial open-source release
MLstate authored
492 (**
493 {b MLSTATE_DIFFING}
494 Try to remove as much as possible any diff not due to the input of the compiler,
495 such as date, git sha, etc... for comparing the output of the compiler using
496 2 branches.
497
498 <!> This variable is also used in [generated_buildinfos.sh]
499 *)
500 val diffing : debug_var
501
502 (**
503 {b MLSTATE_EFFECTS_SHOW}
504 Show the types and effects as they are being inferred by QmlEffects
505 *)
506 val effects_show : debug_var
507
508 (**
509 {b Explicit Instantiation debug}
510 *)
511 val expl_inst_opt_debug : debug_var
512 (** print debug info when inserting ExplInst directives *)
513 val expl_inst_debug : debug_var
514 (** print debug info when eliminating ExplInst directives *)
515 val expl_inst_no_memo : debug_var
516 (** deactive sharing of types and typeschemes generated by ty_to_opaty and tsc_to_opatsc *)
517 val expl_inst_normalize : debug_var
518 (** 0: no normalization of type variables in types and typeschemes
519 1: no normalization of unbound type variables
520 other: full normalization
521 *)
522
523 (**
524 print debug info when generating and inserting typename (type_def_map registration).
525 *)
526 val expl_inst_typename : debug_var
527
528 (**
529 {b MLSTATE_HLNET_DEBUG}
530 *)
531 val hlnet_debug : debug_var
532 val hldir_debug : debug_var
533
534 (**
535 {b MLSTATE_HTTP_DEBUG}
536 *)
537 val http_debug : debug_var
538
539 (**
540 {b MLSTATE_HTTP_NO_COOKIE}
541 *)
542 val http_no_cookie : debug_var
543
544
545 (**
546 {b Javascript Compilation}
547 *)
548
549 (**
550 General debug information about the qmljsimp compiler
551 *)
552 val js_imp : debug_var
553
554 (**
555 Works with function name, and contains checker.
556 *)
557 val js_match_compilation : debug_var
558
559 (**
560 Do not apply the 'split' pass of JsPasses.
561 *)
562 val js_no_split : debug_var
563
564 (**
565 Do not optimize the call with the tailcall manager.
566 Used for debuging only, and getting a correct stack trace
567 with firebug.
568 The generated code will stack overflow in practice.
569 *)
570 val js_no_tailcall : debug_var
571
572 (**
573 Debug for the local renaming of qmljsimp only
574 *)
575 val js_renaming : debug_var
576
577 (**
578 Debuging the serialization of javascript from compiler to runtime.
579 *)
580 val js_serialize : debug_var
581
582 (**
583 {b Lambda lifting toggles}
584 *)
585 val lambda_debug : debug_var (** random stuff toggle *)
586 val lambda_coerce : debug_var (** adds explicit coercions in the code to check
587 the well-typedness of the code *)
588 val lambda_correct : debug_var (** check that the code is well lambda lifted
589 this is not really a postcondition since nobody cares if
590 [val f(x) = let g(y) = y in g] is transformed as
591 [val g(x,y) = y val f(x) = g(x)] but the lambda lifting
592 is not correct anyway
593 *)
594
595 (**
596 {b MLSTATE_NO_ACCESS_LOG}
597 *)
598 val no_access_log : debug_var
599
600 (**
601 {b MLSTATE_NO_DATABASE_UPGRADE}
602 disables the database migration engine altogether,
603 _assuming the db has been generated with the exact same database definition_
604 *)
605 val no_database_upgrade : debug_var
606
607 (**
608 {b MLSTATE_NO_FLOOD_PREVENTION}
609 *)
610 val no_flood_prevention : debug_var
611
612 (**
613 {b MLSTATE_NO_SERVER_INFO}
614 Disable "starting" and "terminating" message
615 when using the scheduler.
616 *)
617 val no_server_info : debug_var
618
619 (**
620 {b MLSTATE_NO_FLOOD_PREVENTION}
621 *)
622 val no_flood_prevention : debug_var
623
624 (**
625 {b MLSTATE_NOCACHE}
626 Changes the HTTP header of responses to clients to prevent caching. Useful
627 when you debug your server and re-run it often
628 *)
629 val nocache : debug_var
630
631 (**
632 {b MLSTATE_OBJECT_DEBUG}
633 Various printing while loading/managing object files
634 *)
635 val object_debug : debug_var
636
637 (**
638 {b MLSTATE_OCAMLDEP_SHOW_LOGS}
639 Do not logs the ocamldep output in a file, but print it on
640 the console instead
641 *)
642 val ocamldep_show_logs : debug_var
643
644 (**
645 {b MLSTATE_OMANAGER_debug}
646 Replaces ansi escape by xml-like tags
647 *)
648 val omanager_debug : debug_var
649
650 (**
651 {b MLSTATE_OPACAPI_LOOSE}
652 Do not fail if somewhere during the compilation a lookup is done via [OpaMapToIdent]
653 on an ident which is not defined in opacapi.
654 *)
655 val opacapi_loose : debug_var
656
657 (**
658 {b MLSTATE_OPADOC}
659 Prints some information while generating opa documentation
660 *)
661 val opadoc : debug_var
662
663 (**
664 {b MLSTATE_OPATOP_ANNOT}
665 Combined with MLSTATE_OPATOP_EXPR:
666 will use the annotation printer for
667 printing expressions before evaluation.
668 Usefull in case of annot not found.
669 *)
670 val opatop_annot : debug_var
671
672 (**
673 {b MLSTATE_OPATOP_EXPR}
674 Print expressions before evaluation.
675 Usefull for using it in case of a segfault for example.
676 *)
677 val opatop_expr : debug_var
678
679 (**
680 {b MLSTATE_OPATOP_HOOK}
681 Print hook from the source code for tracing the flow of execution.
682 This variable is meant to be used for a better comprehension of the interpreter
683 *)
684 val opatop_hook : debug_var
685
686 (**
687 {b MLSTATE_OPATOP_UNVALREC}
688 Print the unvalrec used for evaluation.
689 *)
690 val opatop_unvalrec : debug_var
691
692
693 (**
694 {b MLSTATE_PARSER_CACHE_DEBUG}
695 Outputs whether there are cache hits or cache misses in the opa parser
696 *)
697 val parser_cache_debug : debug_var
698
699 (**
700 {b MLSTATE_PATTERNS_NORMALIZE}
701 Activating the pattern normalization.
702 *)
703 val patterns_normalize : debug_var
704
705 (**
706 {b MLSTATE_PATTERNS_REAL_PATAS}
707 Traduces opa patas into qml patas instead
708 of performing a duplication of code.
709
710 This will of course be the final behavior of the compiler,
711 but currently, the PatAs is still not implemented everywhere
712 in qml, so we can play with this debug var for debuging,
713 and completing the implementation of patas in qml.
714 *)
715 val patterns_real_patas : debug_var
716
717 (**
718 {b MLSTATE_PING_DEBUG}
719 Debug printing on ping loop system
720 *)
721 val ping_debug : debug_var
722
723 (**
724 The env var {b MLSTATE_PPDEBUG}
725 *)
726 val ppdebug : debug_var
727
728 (**
729 {b MLSTATE_PROTOCOL_DEBUG} Debug statements from DSL-generated code.
730 *)
731 val protocol_debug : debug_var
732
733 (**
734 {b MLSTATE_QMLC_NO_MAGIC} : during the cps-pass, do not insert magic functions.
735 The code may then not type check during ocaml compilation.
736 This env var is also used by the standard ML-back-ends.
737
738 This var is used essentially for debugging, to help to track
739 runtime seg-fault, because in some case it may come from a
740 bug introduced by a pass, and can be detected by the ocaml type
741 checker, but not in presence of too much magie.
742 *)
743 val qmlc_no_magic : debug_var
744
745 (**
746 {b MLSTATE_QMLTOP_TIME} : in qmltop, print the timing for each top level value
747 computation (typing and eval)
748 *)
749 val qmltop_time : debug_var
750
751 (**
752 {b MLSTATE_REDUNDANCY}
753 Sets the redundancy parameter of the distributed database
754 *)
755 val redundancy : debug_var
756
757 (**
758 {b MLSTATE_REORDER}
759 Debug QmlDependencies module (reorder passes)
760 *)
761 val reorder : debug_var
762
763 (**
764 {b MLSTATE_RPC_DEBUG}
765 [rpc_debug] Debug the Opa_InsertRemote module (ResolveRemoteCalls pass)
766 [rpc_alt_skeleton] Alternative implementation of skeletons
767 Activating this flag factorises the code produced
768 and should improve compilation time with neglectable
769 runtime hit
770 *)
771 val rpc_debug : debug_var
772 val rpc_alt_skeleton : debug_var
773
774 (**
775 {b Debug on SurfaceAst passes}
776 *)
777 val sa_dependencies : debug_var (** for the debug of the reordering algorithm *)
778 val sa_printer_annot : debug_var (** to print the annotations while printing asts *)
779 val sa_printer_ty : debug_var (** to print the directive types while printing asts *)
780 val sa_trx : debug_var (** print the code of the parsers after they were rewritten *)
781 val sa_xml_pattern : debug_var (** print the ast of the xml patterns that is being rewritten *)
782
783 (**
784 {b MLSTATE_SESSION_DEBUG}
785 *)
786 val session_debug : debug_var
787
788 (**
789 {b MLSTATE_SCHEDULER_DEBUG}
790 *)
791 val scheduler_debug : debug_var
792
793 (**
794 {b MLSTATE_SERVER_SERIALIZE}
795 *)
796 val server_serialize : debug_var
797
798 (**
799 {b MLSTATE_SERVER_STATS}
800 Controls whether to (collect and) print server statistics upon
801 server termination.
802 *)
803 val server_stats : debug_var
804
805 (**
806 {b MLSTATE_SHOW_LOGS}
807 If set, all Logger logs will be output on stderr
808 Consequently, no logs will be output in files
809 *)
810 val show_logs : debug_var (** show all logs on stderr *)
811
812 (**
813 {b Pass_SimplifyMagic}
814 *)
815 val simplifymagic_disable : debug_var (** don't specialize any identifier *)
816 val simplifymagic_failures : debug_var (** show specializable identifiers that weren't specialized *)
817
818 (**
819 {b Slicer debug}
820 *)
821 val slicer_cond : debug_var (** checks slicer precondition and postcondition *)
822 val slicer_debug : debug_var (** ?? *)
823 val slicer_time : debug_var (** shows where the time of the slicing pass is spent *)
824
825 (**
826 {b MLSTATE_SSL_DEBUG}
827 *)
828 val ssl_debug : debug_var
829
830 (**
831 {b MLSTATE_TESTING}
832 This is set by the reftester. Only use to disable the printing of some
833 messages that are normally useful but very troublesome for the stability
834 of refs (eg. database locations...).
835 *)
836 val testing : debug_var
837
838 (**
839 {b MLSTATE_TYPER}
840 Works with level.
841 Debugging the type checker.
842 *)
843 val typer : debug_var
844
845 (**
846 {b MLSTATE_RESOURCE_TRACKER_DEBUG}
847 *)
848 val resource_tracker_debug : debug_var
849
850
851 (**
852 {b MLSTATE_WEBLIB_DEBUG}
853 *)
854 val weblib_debug : debug_var (** takes a level *)
855
856 (**
857 {b BADOP_XML_IMPORT_COMMIT_TRANSACTION_STEP}
858 Only used by db3/Xml_import, to decide the frequency of commits.
859 *)
860 val badop_xml_import_commit_transaction_step : debug_var
861
862
863 (** {6 Variables Testers} *)
864
865 (**
866 Variables tester are used to extend the macro [#<If>] of the ppdebug.
867 You can acces them by using the following syntax :
868 [#<If:MYVAR $tester args>]
869 where args is some optional arguments.
870
871 The meaning of this is that the corresponding tester is applied to all the
872 given arguments, and finally to the value of the debug_var,
873 returning a bool indicating what part of the control structure should
874 be executed.
875
876 Note :
877 You can also used inline tester in your code, but it is not recommanded (remember,
878 that must fit on the same line)
879 *)
880
881 (**
882 The type of all testers
883 *)
884 type debug_tester = debug_var -> bool
885
886 (** the default tester.
887 [#<If:MYVAR>] : returns [true] if and only if the variable is defined and doesn't have value "0" *)
888 val default : debug_tester
889
890 (**
891 the negation of the default tester.
892 [#<If:MYVAR $null>] : returns [true] if and only if the variable is undefined or have value "0"
893 *)
894 val null : debug_tester
895
896 (** the defined tester.
897 [#<If:MYVAR$defined>] : returns [true] if and only if the variable is defined *)
898 val defined : debug_tester
899
900 (**
901 the undefined tester.
902 [#<If:MYVAR $undefined>] : returns [true] if and only if the variable is undefined
903 *)
904 val undefined : debug_tester
905
906 (** the toggle tester.
907 [#<If:MYVAR$toggle>] : returns [true] if and only if the variable is set to ["1"] *)
908 val toggle : debug_tester
909
910 (** the equals tester.
911 [#<If:MYVAR $equals "VALUE">] : returns [true] if and only if the variable is set to ["VALUE"] *)
912 val equals : string -> debug_tester
913
914 (** the level tester :
915 [#<If:MYVAR $level fct>] : returns [true] if and only if the variable is set to an int
916 value [n], and [fct n] returns [true] *)
917 val level : (int -> bool) -> debug_tester
918
919 (**
920 A specific level.
921 [#<If:MYVAR $islevel 42>] : returns [true] if and only if the variable is set to "42"
922 *)
923 val islevel : int -> debug_tester
924
925 (** the maxlevel tester :
926 [#<If:MYVAR $maxlevel n>] : like [#<If: MYVAR $level (fun i -> i <= n)>] *)
927 val maxlevel : int -> debug_tester
928
929 (** the minlevel tester :
930 [#<If:MYVAR $minlevel n>] : like [#<If: MYVAR $level (fun i -> i >= n)>] *)
931 val minlevel : int -> debug_tester
932
933 (** the contains tester :
934 checks that the given string is included in the environment variable *)
935 val contains : string -> debug_tester
936
937 (**
938 free debug_tester, for complex conditions
939 *)
940 val cont : debug_tester -> debug_tester
941
942 (** checks that the environment variable is included in the given string *)
943 val is_contained : string -> debug_tester
944
945 (** contents of the variable is taken as a comma-separated list; checks if
946 the given flag exists in this list *)
947 val flag : string -> debug_tester
Something went wrong with that request. Please try again.