src/Pure/ML-Systems/ml_debugger.ML
author immler
Tue, 22 Dec 2015 21:58:27 +0100
changeset 61915 e9812a95d108
parent 61886 5a9a85c4cfb3
permissions -rw-r--r--
theory for type of bounded linear functions; differentiation under the integral sign
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
61886
5a9a85c4cfb3 tuned message;
wenzelm
parents: 60954
diff changeset
    24
  val debug_local_name_space: state -> ML_Name_Space.T
60729
f5989a2c1f67 ML debugger interface;
wenzelm
parents:
diff changeset
    25
end;
f5989a2c1f67 ML debugger interface;
wenzelm
parents:
diff changeset
    26
f5989a2c1f67 ML debugger interface;
wenzelm
parents:
diff changeset
    27
structure ML_Debugger: ML_DEBUGGER =
f5989a2c1f67 ML debugger interface;
wenzelm
parents:
diff changeset
    28
struct
f5989a2c1f67 ML debugger interface;
wenzelm
parents:
diff changeset
    29
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
    30
(* 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
    31
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
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
    33
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
    34
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 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
    36
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
    37
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
    38
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
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
    40
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
    41
60729
f5989a2c1f67 ML debugger interface;
wenzelm
parents:
diff changeset
    42
(* hooks *)
f5989a2c1f67 ML debugger interface;
wenzelm
parents:
diff changeset
    43
f5989a2c1f67 ML debugger interface;
wenzelm
parents:
diff changeset
    44
fun on_entry _ = ();
f5989a2c1f67 ML debugger interface;
wenzelm
parents:
diff changeset
    45
fun on_exit _ = ();
f5989a2c1f67 ML debugger interface;
wenzelm
parents:
diff changeset
    46
fun on_exit_exception _ = ();
60744
4eba53a0ac3d report possible breakpoint positions;
wenzelm
parents: 60730
diff changeset
    47
fun on_breakpoint _ = ();
60729
f5989a2c1f67 ML debugger interface;
wenzelm
parents:
diff changeset
    48
f5989a2c1f67 ML debugger interface;
wenzelm
parents:
diff changeset
    49
f5989a2c1f67 ML debugger interface;
wenzelm
parents:
diff changeset
    50
(* debugger *)
f5989a2c1f67 ML debugger interface;
wenzelm
parents:
diff changeset
    51
f5989a2c1f67 ML debugger interface;
wenzelm
parents:
diff changeset
    52
fun fail () = raise Fail "No debugger support on this ML platform";
f5989a2c1f67 ML debugger interface;
wenzelm
parents:
diff changeset
    53
f5989a2c1f67 ML debugger interface;
wenzelm
parents:
diff changeset
    54
type state = unit;
f5989a2c1f67 ML debugger interface;
wenzelm
parents:
diff changeset
    55
f5989a2c1f67 ML debugger interface;
wenzelm
parents:
diff changeset
    56
fun state _ = [];
f5989a2c1f67 ML debugger interface;
wenzelm
parents:
diff changeset
    57
fun debug_function () = fail ();
f5989a2c1f67 ML debugger interface;
wenzelm
parents:
diff changeset
    58
fun debug_function_arg () = fail ();
f5989a2c1f67 ML debugger interface;
wenzelm
parents:
diff changeset
    59
fun debug_function_result () = fail ();
f5989a2c1f67 ML debugger interface;
wenzelm
parents:
diff changeset
    60
fun debug_location () = fail ();
f5989a2c1f67 ML debugger interface;
wenzelm
parents:
diff changeset
    61
fun debug_name_space () = fail ();
61886
5a9a85c4cfb3 tuned message;
wenzelm
parents: 60954
diff changeset
    62
fun debug_local_name_space () = fail ();
60729
f5989a2c1f67 ML debugger interface;
wenzelm
parents:
diff changeset
    63
f5989a2c1f67 ML debugger interface;
wenzelm
parents:
diff changeset
    64
end;