src/Pure/ML-Systems/ml_debugger.ML
author blanchet
Fri, 02 Oct 2015 21:06:32 +0200
changeset 61310 9a50ea544fd3
parent 60954 eeee8349e9eb
child 61886 5a9a85c4cfb3
permissions -rw-r--r--
better compliance with TPTP SZS standard
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
60745
d86b4cd0f1ec clarified ML compiler parameters: always provide PolyML.Compiler.CPDebug, ignore global default;
wenzelm
parents: 60744
diff changeset
     1
(*  Title:      Pure/ML/ml_debugger.ML
60729
f5989a2c1f67 ML debugger interface;
wenzelm
parents:
diff changeset
     2
    Author:     Makarius
f5989a2c1f67 ML debugger interface;
wenzelm
parents:
diff changeset
     3
60853
wenzelm
parents: 60852
diff changeset
     4
ML debugger interface -- dummy version.
60729
f5989a2c1f67 ML debugger interface;
wenzelm
parents:
diff changeset
     5
*)
f5989a2c1f67 ML debugger interface;
wenzelm
parents:
diff changeset
     6
f5989a2c1f67 ML debugger interface;
wenzelm
parents:
diff changeset
     7
signature ML_DEBUGGER =
f5989a2c1f67 ML debugger interface;
wenzelm
parents:
diff changeset
     8
sig
60954
eeee8349e9eb abstract exn_id based on getExnId in polyml/basis/FinalPolyML.sml (NB: the mutable machine word cannot be inspected in ML, e.g. toplevel pp dumps core);
wenzelm
parents: 60853
diff changeset
     9
  type exn_id
eeee8349e9eb abstract exn_id based on getExnId in polyml/basis/FinalPolyML.sml (NB: the mutable machine word cannot be inspected in ML, e.g. toplevel pp dumps core);
wenzelm
parents: 60853
diff changeset
    10
  val exn_id: exn -> exn_id
eeee8349e9eb abstract exn_id based on getExnId in polyml/basis/FinalPolyML.sml (NB: the mutable machine word cannot be inspected in ML, e.g. toplevel pp dumps core);
wenzelm
parents: 60853
diff changeset
    11
  val print_exn_id: exn_id -> string
eeee8349e9eb abstract exn_id based on getExnId in polyml/basis/FinalPolyML.sml (NB: the mutable machine word cannot be inspected in ML, e.g. toplevel pp dumps core);
wenzelm
parents: 60853
diff changeset
    12
  val eq_exn_id: exn_id * exn_id -> bool
60853
wenzelm
parents: 60852
diff changeset
    13
  val on_entry: (string * 'location -> unit) option -> unit
wenzelm
parents: 60852
diff changeset
    14
  val on_exit: (string * 'location -> unit) option -> unit
wenzelm
parents: 60852
diff changeset
    15
  val on_exit_exception: (string * 'location -> exn -> unit) option -> unit
wenzelm
parents: 60852
diff changeset
    16
  val on_breakpoint: ('location * bool Unsynchronized.ref -> unit) option -> unit
60729
f5989a2c1f67 ML debugger interface;
wenzelm
parents:
diff changeset
    17
  type state
f5989a2c1f67 ML debugger interface;
wenzelm
parents:
diff changeset
    18
  val state: Thread.thread -> state list
f5989a2c1f67 ML debugger interface;
wenzelm
parents:
diff changeset
    19
  val debug_function: state -> string
f5989a2c1f67 ML debugger interface;
wenzelm
parents:
diff changeset
    20
  val debug_function_arg: state -> ML_Name_Space.valueVal
f5989a2c1f67 ML debugger interface;
wenzelm
parents:
diff changeset
    21
  val debug_function_result: state -> ML_Name_Space.valueVal
60853
wenzelm
parents: 60852
diff changeset
    22
  val debug_location: state -> 'location
60729
f5989a2c1f67 ML debugger interface;
wenzelm
parents:
diff changeset
    23
  val debug_name_space: state -> ML_Name_Space.T
f5989a2c1f67 ML debugger interface;
wenzelm
parents:
diff changeset
    24
end;
f5989a2c1f67 ML debugger interface;
wenzelm
parents:
diff changeset
    25
f5989a2c1f67 ML debugger interface;
wenzelm
parents:
diff changeset
    26
structure ML_Debugger: ML_DEBUGGER =
f5989a2c1f67 ML debugger interface;
wenzelm
parents:
diff changeset
    27
struct
f5989a2c1f67 ML debugger interface;
wenzelm
parents:
diff changeset
    28
60954
eeee8349e9eb abstract exn_id based on getExnId in polyml/basis/FinalPolyML.sml (NB: the mutable machine word cannot be inspected in ML, e.g. toplevel pp dumps core);
wenzelm
parents: 60853
diff changeset
    29
(* exceptions *)
eeee8349e9eb abstract exn_id based on getExnId in polyml/basis/FinalPolyML.sml (NB: the mutable machine word cannot be inspected in ML, e.g. toplevel pp dumps core);
wenzelm
parents: 60853
diff changeset
    30
eeee8349e9eb abstract exn_id based on getExnId in polyml/basis/FinalPolyML.sml (NB: the mutable machine word cannot be inspected in ML, e.g. toplevel pp dumps core);
wenzelm
parents: 60853
diff changeset
    31
abstype exn_id = Exn_Id of string
eeee8349e9eb abstract exn_id based on getExnId in polyml/basis/FinalPolyML.sml (NB: the mutable machine word cannot be inspected in ML, e.g. toplevel pp dumps core);
wenzelm
parents: 60853
diff changeset
    32
with
eeee8349e9eb abstract exn_id based on getExnId in polyml/basis/FinalPolyML.sml (NB: the mutable machine word cannot be inspected in ML, e.g. toplevel pp dumps core);
wenzelm
parents: 60853
diff changeset
    33
eeee8349e9eb abstract exn_id based on getExnId in polyml/basis/FinalPolyML.sml (NB: the mutable machine word cannot be inspected in ML, e.g. toplevel pp dumps core);
wenzelm
parents: 60853
diff changeset
    34
fun exn_id exn = Exn_Id (General.exnName exn);
eeee8349e9eb abstract exn_id based on getExnId in polyml/basis/FinalPolyML.sml (NB: the mutable machine word cannot be inspected in ML, e.g. toplevel pp dumps core);
wenzelm
parents: 60853
diff changeset
    35
fun print_exn_id (Exn_Id name) = name;
eeee8349e9eb abstract exn_id based on getExnId in polyml/basis/FinalPolyML.sml (NB: the mutable machine word cannot be inspected in ML, e.g. toplevel pp dumps core);
wenzelm
parents: 60853
diff changeset
    36
fun eq_exn_id (Exn_Id name1, Exn_Id name2) = name1 = name2;  (*over-approximation*)
eeee8349e9eb abstract exn_id based on getExnId in polyml/basis/FinalPolyML.sml (NB: the mutable machine word cannot be inspected in ML, e.g. toplevel pp dumps core);
wenzelm
parents: 60853
diff changeset
    37
eeee8349e9eb abstract exn_id based on getExnId in polyml/basis/FinalPolyML.sml (NB: the mutable machine word cannot be inspected in ML, e.g. toplevel pp dumps core);
wenzelm
parents: 60853
diff changeset
    38
end;
eeee8349e9eb abstract exn_id based on getExnId in polyml/basis/FinalPolyML.sml (NB: the mutable machine word cannot be inspected in ML, e.g. toplevel pp dumps core);
wenzelm
parents: 60853
diff changeset
    39
eeee8349e9eb abstract exn_id based on getExnId in polyml/basis/FinalPolyML.sml (NB: the mutable machine word cannot be inspected in ML, e.g. toplevel pp dumps core);
wenzelm
parents: 60853
diff changeset
    40
60729
f5989a2c1f67 ML debugger interface;
wenzelm
parents:
diff changeset
    41
(* hooks *)
f5989a2c1f67 ML debugger interface;
wenzelm
parents:
diff changeset
    42
f5989a2c1f67 ML debugger interface;
wenzelm
parents:
diff changeset
    43
fun on_entry _ = ();
f5989a2c1f67 ML debugger interface;
wenzelm
parents:
diff changeset
    44
fun on_exit _ = ();
f5989a2c1f67 ML debugger interface;
wenzelm
parents:
diff changeset
    45
fun on_exit_exception _ = ();
60744
4eba53a0ac3d report possible breakpoint positions;
wenzelm
parents: 60730
diff changeset
    46
fun on_breakpoint _ = ();
60729
f5989a2c1f67 ML debugger interface;
wenzelm
parents:
diff changeset
    47
f5989a2c1f67 ML debugger interface;
wenzelm
parents:
diff changeset
    48
f5989a2c1f67 ML debugger interface;
wenzelm
parents:
diff changeset
    49
(* debugger *)
f5989a2c1f67 ML debugger interface;
wenzelm
parents:
diff changeset
    50
f5989a2c1f67 ML debugger interface;
wenzelm
parents:
diff changeset
    51
fun fail () = raise Fail "No debugger support on this ML platform";
f5989a2c1f67 ML debugger interface;
wenzelm
parents:
diff changeset
    52
f5989a2c1f67 ML debugger interface;
wenzelm
parents:
diff changeset
    53
type state = unit;
f5989a2c1f67 ML debugger interface;
wenzelm
parents:
diff changeset
    54
f5989a2c1f67 ML debugger interface;
wenzelm
parents:
diff changeset
    55
fun state _ = [];
f5989a2c1f67 ML debugger interface;
wenzelm
parents:
diff changeset
    56
fun debug_function () = fail ();
f5989a2c1f67 ML debugger interface;
wenzelm
parents:
diff changeset
    57
fun debug_function_arg () = fail ();
f5989a2c1f67 ML debugger interface;
wenzelm
parents:
diff changeset
    58
fun debug_function_result () = fail ();
f5989a2c1f67 ML debugger interface;
wenzelm
parents:
diff changeset
    59
fun debug_location () = fail ();
f5989a2c1f67 ML debugger interface;
wenzelm
parents:
diff changeset
    60
fun debug_name_space () = fail ();
f5989a2c1f67 ML debugger interface;
wenzelm
parents:
diff changeset
    61
f5989a2c1f67 ML debugger interface;
wenzelm
parents:
diff changeset
    62
end;