Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add dedicated printline-debugging support #1308

Merged
merged 6 commits into from
May 2, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
91 changes: 47 additions & 44 deletions ocaml/.depend
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,13 @@ utils/consistbl.cmx : \
utils/consistbl.cmi
utils/consistbl.cmi : \
utils/misc.cmi
utils/debug.cmo : \
utils/clflags.cmi \
utils/debug.cmi
utils/debug.cmx : \
utils/clflags.cmx \
utils/debug.cmi
utils/debug.cmi :
utils/diffing.cmo : \
utils/misc.cmi \
utils/diffing.cmi
Expand Down Expand Up @@ -422,6 +429,7 @@ parsing/docstrings.cmi : \
parsing/location.cmi
parsing/extensions.cmo : \
parsing/parsetree.cmi \
parsing/longident.cmi \
parsing/location.cmi \
utils/language_extension.cmi \
parsing/extensions_parsing.cmi \
Expand All @@ -430,6 +438,7 @@ parsing/extensions.cmo : \
parsing/extensions.cmi
parsing/extensions.cmx : \
parsing/parsetree.cmi \
parsing/longident.cmx \
parsing/location.cmx \
utils/language_extension.cmx \
parsing/extensions_parsing.cmx \
Expand All @@ -438,6 +447,7 @@ parsing/extensions.cmx : \
parsing/extensions.cmi
parsing/extensions.cmi : \
parsing/parsetree.cmi \
parsing/longident.cmi \
parsing/location.cmi \
parsing/asttypes.cmi
parsing/extensions_parsing.cmo : \
Expand Down Expand Up @@ -630,7 +640,6 @@ typing/cmt2annot.cmo : \
typing/envaux.cmi \
typing/env.cmi \
file_formats/cmt_format.cmi \
file_formats/cms_format.cmi \
parsing/asttypes.cmi \
typing/annot.cmi
typing/cmt2annot.cmx : \
Expand All @@ -645,7 +654,6 @@ typing/cmt2annot.cmx : \
typing/envaux.cmx \
typing/env.cmx \
file_formats/cmt_format.cmx \
file_formats/cms_format.cmx \
parsing/asttypes.cmi \
typing/annot.cmi
typing/ctype.cmo : \
Expand Down Expand Up @@ -725,6 +733,7 @@ typing/env.cmo : \
typing/predef.cmi \
typing/persistent_env.cmi \
typing/path.cmi \
parsing/parsetree.cmi \
utils/misc.cmi \
parsing/longident.cmi \
parsing/location.cmi \
Expand All @@ -748,6 +757,7 @@ typing/env.cmx : \
typing/predef.cmx \
typing/persistent_env.cmx \
typing/path.cmx \
parsing/parsetree.cmi \
utils/misc.cmx \
parsing/longident.cmx \
parsing/location.cmx \
Expand All @@ -769,6 +779,7 @@ typing/env.cmi : \
typing/subst.cmi \
typing/shape.cmi \
typing/path.cmi \
parsing/parsetree.cmi \
utils/misc.cmi \
parsing/longident.cmi \
parsing/location.cmi \
Expand Down Expand Up @@ -912,7 +923,6 @@ typing/includemod.cmo : \
utils/diffing.cmi \
typing/ctype.cmi \
file_formats/cmt_format.cmi \
file_formats/cms_format.cmi \
parsing/builtin_attributes.cmi \
typing/btype.cmi \
typing/includemod.cmi
Expand All @@ -936,7 +946,6 @@ typing/includemod.cmx : \
utils/diffing.cmx \
typing/ctype.cmx \
file_formats/cmt_format.cmx \
file_formats/cms_format.cmx \
parsing/builtin_attributes.cmx \
typing/btype.cmx \
typing/includemod.cmi
Expand Down Expand Up @@ -1464,7 +1473,6 @@ typing/typeclass.cmo : \
typing/env.cmi \
typing/ctype.cmi \
file_formats/cmt_format.cmi \
file_formats/cms_format.cmi \
utils/clflags.cmi \
parsing/builtin_attributes.cmi \
typing/btype.cmi \
Expand Down Expand Up @@ -1493,7 +1501,6 @@ typing/typeclass.cmx : \
typing/env.cmx \
typing/ctype.cmx \
file_formats/cmt_format.cmx \
file_formats/cms_format.cmx \
utils/clflags.cmx \
parsing/builtin_attributes.cmx \
typing/btype.cmx \
Expand Down Expand Up @@ -1540,7 +1547,6 @@ typing/typecore.cmo : \
typing/env.cmi \
typing/ctype.cmi \
file_formats/cmt_format.cmi \
file_formats/cms_format.cmi \
utils/clflags.cmi \
parsing/builtin_attributes.cmi \
typing/btype.cmi \
Expand Down Expand Up @@ -1576,7 +1582,6 @@ typing/typecore.cmx : \
typing/env.cmx \
typing/ctype.cmx \
file_formats/cmt_format.cmx \
file_formats/cms_format.cmx \
utils/clflags.cmx \
parsing/builtin_attributes.cmx \
typing/btype.cmx \
Expand Down Expand Up @@ -1799,6 +1804,7 @@ typing/typemod.cmo : \
typing/subst.cmi \
typing/signature_group.cmi \
typing/shape.cmi \
utils/profile.cmi \
typing/printtyp.cmi \
typing/path.cmi \
parsing/parsetree.cmi \
Expand All @@ -1819,8 +1825,8 @@ typing/typemod.cmo : \
utils/config.cmi \
utils/compilation_unit.cmi \
file_formats/cmt_format.cmi \
file_formats/cms_format.cmi \
typing/cmt2annot.cmo \
file_formats/cms_format.cmi \
file_formats/cmi_format.cmi \
utils/clflags.cmi \
parsing/builtin_attributes.cmi \
Expand All @@ -1839,6 +1845,7 @@ typing/typemod.cmx : \
typing/subst.cmx \
typing/signature_group.cmx \
typing/shape.cmx \
utils/profile.cmx \
typing/printtyp.cmx \
typing/path.cmx \
parsing/parsetree.cmi \
Expand All @@ -1859,8 +1866,8 @@ typing/typemod.cmx : \
utils/config.cmx \
utils/compilation_unit.cmx \
file_formats/cmt_format.cmx \
file_formats/cms_format.cmx \
typing/cmt2annot.cmx \
file_formats/cms_format.cmx \
file_formats/cmi_format.cmx \
utils/clflags.cmx \
parsing/builtin_attributes.cmx \
Expand Down Expand Up @@ -3640,6 +3647,7 @@ lambda/lambda.cmo : \
typing/path.cmi \
utils/misc.cmi \
parsing/longident.cmi \
parsing/location.cmi \
typing/ident.cmi \
typing/env.cmi \
lambda/debuginfo.cmi \
Expand All @@ -3654,6 +3662,7 @@ lambda/lambda.cmx : \
typing/path.cmx \
utils/misc.cmx \
parsing/longident.cmx \
parsing/location.cmx \
typing/ident.cmx \
typing/env.cmx \
lambda/debuginfo.cmx \
Expand All @@ -3666,6 +3675,7 @@ lambda/lambda.cmi : \
typing/types.cmi \
typing/primitive.cmi \
typing/path.cmi \
parsing/location.cmi \
typing/ident.cmi \
typing/env.cmi \
lambda/debuginfo.cmi \
Expand Down Expand Up @@ -3877,6 +3887,7 @@ lambda/translattribute.cmo : \
lambda/lambda.cmi \
utils/config.cmi \
parsing/builtin_attributes.cmi \
parsing/asttypes.cmi \
lambda/translattribute.cmi
lambda/translattribute.cmx : \
utils/warnings.cmx \
Expand All @@ -3888,6 +3899,7 @@ lambda/translattribute.cmx : \
lambda/lambda.cmx \
utils/config.cmx \
parsing/builtin_attributes.cmx \
parsing/asttypes.cmi \
lambda/translattribute.cmi
lambda/translattribute.cmi : \
typing/typedtree.cmi \
Expand Down Expand Up @@ -4181,23 +4193,34 @@ file_formats/cmo_format.cmi : \
utils/import_info.cmi \
typing/ident.cmi \
utils/compilation_unit.cmi
file_formats/cmt_format.cmo : \
typing/types.cmi \
typing/typedtree.cmi \
typing/tast_mapper.cmi \
file_formats/cms_format.cmo : \
typing/shape.cmi \
parsing/parsetree.cmi \
utils/misc.cmi \
parsing/location.cmi \
utils/load_path.cmi \
parsing/lexer.cmi \
utils/import_info.cmi \
typing/env.cmi \
utils/config.cmi \
utils/compilation_unit.cmi \
file_formats/cmi_format.cmi \
utils/clflags.cmi \
file_formats/cmt_format.cmi
file_formats/cms_format.cmo : \
file_formats/cms_format.cmi
file_formats/cms_format.cmx : \
typing/shape.cmx \
parsing/parsetree.cmi \
utils/misc.cmx \
parsing/location.cmx \
parsing/lexer.cmx \
typing/env.cmx \
utils/config.cmx \
utils/compilation_unit.cmx \
utils/clflags.cmx \
file_formats/cms_format.cmi
file_formats/cms_format.cmi : \
typing/shape.cmi \
parsing/parsetree.cmi \
parsing/location.cmi \
utils/compilation_unit.cmi
file_formats/cmt_format.cmo : \
typing/types.cmi \
typing/typedtree.cmi \
typing/tast_mapper.cmi \
Expand All @@ -4212,7 +4235,7 @@ file_formats/cms_format.cmo : \
utils/compilation_unit.cmi \
file_formats/cmi_format.cmi \
utils/clflags.cmi \
file_formats/cms_format.cmi
file_formats/cmt_format.cmi
file_formats/cmt_format.cmx : \
typing/types.cmx \
typing/typedtree.cmx \
Expand All @@ -4229,22 +4252,6 @@ file_formats/cmt_format.cmx : \
file_formats/cmi_format.cmx \
utils/clflags.cmx \
file_formats/cmt_format.cmi
file_formats/cms_format.cmx : \
typing/types.cmx \
typing/typedtree.cmx \
typing/tast_mapper.cmx \
typing/shape.cmx \
utils/misc.cmx \
parsing/location.cmx \
utils/load_path.cmx \
parsing/lexer.cmx \
utils/import_info.cmx \
typing/env.cmx \
utils/config.cmx \
utils/compilation_unit.cmx \
file_formats/cmi_format.cmx \
utils/clflags.cmx \
file_formats/cms_format.cmi
file_formats/cmt_format.cmi : \
typing/types.cmi \
typing/typedtree.cmi \
Expand All @@ -4254,14 +4261,6 @@ file_formats/cmt_format.cmi : \
typing/env.cmi \
utils/compilation_unit.cmi \
file_formats/cmi_format.cmi
file_formats/cms_format.cmi : \
typing/types.cmi \
typing/typedtree.cmi \
typing/shape.cmi \
parsing/location.cmi \
typing/env.cmi \
utils/compilation_unit.cmi \
file_formats/cmi_format.cmi
file_formats/cmx_format.cmi : \
lambda/lambda.cmi \
utils/import_info.cmi \
Expand Down Expand Up @@ -4963,6 +4962,8 @@ middle_end/flambda/flambda_to_clambda.cmo : \
middle_end/flambda/base_types/static_exception.cmi \
middle_end/flambda/simple_value_approx.cmi \
middle_end/flambda/base_types/set_of_closures_id.cmi \
lambda/printlambda.cmi \
middle_end/printclambda.cmi \
typing/primitive.cmi \
middle_end/flambda/parameter.cmi \
utils/numbers.cmi \
Expand Down Expand Up @@ -4995,6 +4996,8 @@ middle_end/flambda/flambda_to_clambda.cmx : \
middle_end/flambda/base_types/static_exception.cmx \
middle_end/flambda/simple_value_approx.cmx \
middle_end/flambda/base_types/set_of_closures_id.cmx \
lambda/printlambda.cmx \
middle_end/printclambda.cmx \
typing/primitive.cmx \
middle_end/flambda/parameter.cmx \
utils/numbers.cmx \
Expand Down
1 change: 1 addition & 0 deletions ocaml/compilerlibs/Makefile.compilerlibs
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ UTILS = \
utils/local_store.cmo \
utils/load_path.cmo \
utils/clflags.cmo \
utils/debug.cmo \
utils/language_extension.cmo \
utils/profile.cmo \
utils/terminfo.cmo \
Expand Down
12 changes: 12 additions & 0 deletions ocaml/driver/main_args.ml
Original file line number Diff line number Diff line change
Expand Up @@ -921,6 +921,10 @@ let mk_dstartup f =
"-dstartup", Arg.Unit f, " (undocumented)"
;;

let mk_debug_ocaml f =
"-debug-ocaml", Arg.Unit f, " Debugging output for the compiler\n\
(internal use only)"

let mk_opaque f =
"-opaque", Arg.Unit f,
" Does not generate cross-module optimization information\n\
Expand Down Expand Up @@ -1005,6 +1009,7 @@ module type Common_options = sig
val _version : unit -> unit
val _vnum : unit -> unit
val _w : string -> unit
val _debug_ocaml : unit -> unit

val anonymous : string -> unit
end
Expand Down Expand Up @@ -1341,6 +1346,7 @@ struct
mk_dprofile F._dprofile;
mk_dump_into_file F._dump_into_file;
mk_dump_dir F._dump_dir;
mk_debug_ocaml F._debug_ocaml;

mk_args F._args;
mk_args0 F._args0;
Expand Down Expand Up @@ -1409,6 +1415,7 @@ struct
mk_drawlambda F._drawlambda;
mk_dlambda F._dlambda;
mk_dinstr F._dinstr;
mk_debug_ocaml F._debug_ocaml;

mk_args F._args;
mk_args0 F._args0;
Expand Down Expand Up @@ -1578,6 +1585,7 @@ struct
mk_dump_into_file F._dump_into_file;
mk_dump_dir F._dump_dir;
mk_dump_pass F._dump_pass;
mk_debug_ocaml F._debug_ocaml;

mk_args F._args;
mk_args0 F._args0;
Expand Down Expand Up @@ -1686,6 +1694,8 @@ module Make_opttop_options (F : Opttop_options) = struct
mk_dinterval F._dinterval;
mk_dstartup F._dstartup;
mk_dump_pass F._dump_pass;
mk_debug_ocaml F._debug_ocaml;

mk_eval F._eval;
]
end;;
Expand Down Expand Up @@ -1738,6 +1748,7 @@ struct
mk_vnum F._vnum;
mk_w F._w;
mk__ F.anonymous;
mk_debug_ocaml F._debug_ocaml;
]
end;;

Expand Down Expand Up @@ -1823,6 +1834,7 @@ module Default = struct
let _unsafe_string = set unsafe_string
let _w s =
Warnings.parse_options false s |> Option.iter Location.(prerr_alert none)
let _debug_ocaml = set debug_ocaml

let anonymous = Compenv.anonymous

Expand Down
2 changes: 1 addition & 1 deletion ocaml/driver/main_args.mli
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ module type Common_options = sig
val _version : unit -> unit
val _vnum : unit -> unit
val _w : string -> unit

val _debug_ocaml : unit -> unit

val anonymous : string -> unit
end
Expand Down
Loading