diff options
author | Xavier Leroy <xavier.leroy@inria.fr> | 2000-03-25 18:55:45 +0000 |
---|---|---|
committer | Xavier Leroy <xavier.leroy@inria.fr> | 2000-03-25 18:55:45 +0000 |
commit | 5c65f975b239b5442776ef2c1413888753f080fe (patch) | |
tree | b0ff9c799c3fb7538d0c19e8f64231b6da780a96 /debugger/printval.ml | |
parent | a6a516872367f403a5116b8ad12e55589f7aa81c (diff) | |
download | ocaml-5c65f975b239b5442776ef2c1413888753f080fe.tar.gz |
Meilleure impression des exceptions
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@2990 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
Diffstat (limited to 'debugger/printval.ml')
-rw-r--r-- | debugger/printval.ml | 24 |
1 files changed, 22 insertions, 2 deletions
diff --git a/debugger/printval.ml b/debugger/printval.ml index cb8117a425..48eaef1d25 100644 --- a/debugger/printval.ml +++ b/debugger/printval.ml @@ -48,7 +48,27 @@ let check_depth ppf depth obj ty = false end else true -module Printer = Genprintval.Make(Debugcom.Remote_value) +module EvalPath = + struct + type value = Debugcom.Remote_value.t + exception Error + let rec eval_path = function + Pident id -> + begin try + Debugcom.Remote_value.global (Symtable.get_global_position id) + with Symtable.Error _ -> + raise Error + end + | Pdot(root, fieldname, pos) -> + let v = eval_path root in + if not (Debugcom.Remote_value.is_block v) + then raise Error + else Debugcom.Remote_value.field v pos + | Papply(p1, p2) -> + raise Error + end + +module Printer = Genprintval.Make(Debugcom.Remote_value)(EvalPath) let install_printer path ty ppf fn = Printer.install_printer path ty @@ -64,7 +84,7 @@ let remove_printer = Printer.remove_printer let max_printer_depth = ref 20 let max_printer_steps = ref 300 -let print_exception = Printer.print_exception +let print_exception = Printer.print_untyped_exception let print_value max_depth env obj (ppf : Format.formatter) ty = Printer.print_value !max_printer_steps max_depth |