This wasn’t easy (only code compiled outside of toplevel would support backtraces), but since OCaml 4.03.0 (released in April 2016), toplevel supports backtracks thanks to the contributions of whitequark and Jake Donham.
toplevel OCAMLRUNPARAM=b ocaml, . , , , -g, backtrace, , , .