OCAMLDEBUG(1)

πŸ“¦
version 5.5.0 Β· 2 versions
, in alpine 3.22, alpine 3.23, alpine 3.24, arch rolling, centos-stream 10, debian trixie, fedora 43, fedora 44, nixos 26.05, nixpkgs unstable, ubuntu questing, ubuntu resolute, ubuntu stonking

πŸ’– OCAMLDEBUG(1) πŸ’–

okay bestie, welcome to the General Commands Manual section, and today we're talking about the one, the only: ocamldebug ✨


🌸 NAME 🌸

ocamldebug β€” the OCaml source-level replay debugger. yes she replays. she rewinds. she's that girl πŸ’…


πŸŽ€ SYNOPSIS πŸŽ€

ocamldebug [ options ] program [ arguments ]

πŸ¦‹ DESCRIPTION πŸ¦‹

ocamldebug is the OCaml source-level replay debugger. no cap, that's literally what it is πŸ‘‘

but listen β€” before you can even use the debugger, your program has to be compiled and linked with the -g option. like, every single .cmo and .cma file that's part of your program should have been created with ocamlc -g, and then they all have to be linked together with ocamlc -g. no shortcuts, bestie.

and here's the iconic part: compiling with -g has zero penalty on the running time of your programs. like, none. the object files and bytecode executable files get bigger and take longer to produce, sure, but the executable files run at exactly the same speed as if they'd been compiled without -g. the way that's so generous of her πŸ˜­πŸ’–


✨ OPTIONS ✨

here's a summary of the options, bestie. for the complete description you're gonna want the html documentation in the ocaml-doc package. iykyk.

  • -c count β€” sets the maximum number of simultaneously live checkpoints to count. that's the cap, periodt.
  • -cd dir β€” run the debugger program from the working directory dir, instead of the current working directory. (also see the cd command, bestie.)
  • -emacs β€” tells the debugger it's being executed under Emacs. (check The OCaml user's manual for how to run the debugger under Emacs.) this one implies -machine-readable, so she's already in machine mode the second you ask 🫢
  • -I directory β€” adds directory to the list of directories searched for source files and compiled files. (also see the directory command.)
  • -machine-readable β€” prints information in a format that's more suitable for machines instead of human operators, where applicable. for example, when describing a location in a program β€” like when printing a backtrace β€” it prints the program counter and character offset in a file instead of the filename, line number, and character offset in that line. robots only, no vibes πŸ’€
  • -s socket β€” uses socket for communicating with the debugged program. see the description of the command set socket in The OCaml user's manual for the format of socket.
  • -version β€” prints the version string and exits. bye ✨
  • -vnum β€” prints the short version number and exits. shorter bye ✨
  • -help or --help β€” displays a short usage summary and exits.

🌈 INITIALIZATION FILE 🌈

when ocamldebug(1) gets invoked, she reads commands from an initialization file before handing control over to you. main character energy honestly.

the default file is .ocamldebug in the current directory if it exists β€” otherwise it's .ocamldebug in the user's home directory. so she checks your room first, then goes home 🏠

ngl, you can also use the source file command to read commands from a file. two ways to feed her, bestie.

⭐ SEE ALSO ⭐

  • ocamlc(1).
  • The OCaml user's manual, chapter "The debugger".

πŸ’œ AUTHOR πŸ’œ

this manual page was written by Sven LUTHER <luther@debian.org>, for the Debian GNU/Linux system (but may be used by others). we love a generous king πŸ‘‘


okay and that's the whole page!! πŸŽ€ she's catalogued as OCAMLDEBUG(1) β€” the page footer, her whole lil signature β€” and the header up top is straight from the General Commands Manual. now go compile with -g and go slay, bestie πŸ’…πŸ’–πŸ¦‹

πŸ“¦ where this page comes from