diff options
author | Bernhard Schommer <bernhardschommer@gmail.com> | 2015-09-16 19:43:35 +0200 |
---|---|---|
committer | Bernhard Schommer <bernhardschommer@gmail.com> | 2015-09-16 19:43:35 +0200 |
commit | 98cddc7ba45b34fbd71d9a80c27a8e5ec6b311b0 (patch) | |
tree | 5a39f62c4e1526dd9e047f74efca164c59504f95 /debug/Debug.ml | |
parent | 3344bcf59acb1ae8d43a0d15acb4b824689e706d (diff) | |
download | compcert-98cddc7ba45b34fbd71d9a80c27a8e5ec6b311b0.tar.gz compcert-98cddc7ba45b34fbd71d9a80c27a8e5ec6b311b0.zip |
Move more functionality in the new interface.
Added functions to add more information to the debuging interface,
like the struct layout with offsets, bitifiled layout and removed
the no longer needed mapping from stamp to atom.
Diffstat (limited to 'debug/Debug.ml')
-rw-r--r-- | debug/Debug.ml | 38 |
1 files changed, 24 insertions, 14 deletions
diff --git a/debug/Debug.ml b/debug/Debug.ml index eb195b33..ab20f630 100644 --- a/debug/Debug.ml +++ b/debug/Debug.ml @@ -21,9 +21,11 @@ type implem = mutable init: string -> unit; mutable atom_function: ident -> atom -> unit; mutable atom_global_variable: ident -> atom -> unit; - mutable set_composite_size: ident -> struct_or_union -> int -> unit; - mutable set_member_offset: ident -> string -> int -> int -> unit; - mutable insert_declaration: globdecl -> Env.t -> unit; + mutable set_composite_size: ident -> struct_or_union -> int option -> unit; + mutable set_member_offset: ident -> string -> int -> unit; + mutable set_bitfield_offset: ident -> string -> int -> string -> int -> unit; + mutable insert_global_declaration: Env.t -> globdecl -> unit; + mutable add_fun_addr: atom -> (int * int) -> unit } let implem = @@ -32,8 +34,10 @@ let implem = atom_function = (fun _ _ -> ()); atom_global_variable = (fun _ _ -> ()); set_composite_size = (fun _ _ _ -> ()); - set_member_offset = (fun _ _ _ _ -> ()); - insert_declaration = (fun _ _ -> ()); + set_member_offset = (fun _ _ _ -> ()); + set_bitfield_offset = (fun _ _ _ _ _ -> ()); + insert_global_declaration = (fun _ _ -> ()); + add_fun_addr = (fun _ _ -> ()); } let init () = @@ -43,19 +47,25 @@ let init () = implem.atom_global_variable <- DebugInformation.atom_global_variable; implem.set_composite_size <- DebugInformation.set_composite_size; implem.set_member_offset <- DebugInformation.set_member_offset; - implem.insert_declaration <- DebugInformation.insert_declaration; + implem.set_bitfield_offset <- DebugInformation.set_bitfield_offset; + implem.insert_global_declaration <- DebugInformation.insert_global_declaration; + implem.add_fun_addr <- DebugInformation.add_fun_addr; end else begin - implem.init <- (fun _ -> ()); - implem.atom_function <- (fun _ _ -> ()); - implem.atom_global_variable <- (fun _ _ -> ()); - implem.set_composite_size <- (fun _ _ _ -> ()); - implem.set_member_offset <- (fun _ _ _ _ -> ()); - implem.insert_declaration <- (fun _ _ -> ()) + implem.init <- (fun _ -> ()); + implem.atom_function <- (fun _ _ -> ()); + implem.atom_global_variable <- (fun _ _ -> ()); + implem.set_composite_size <- (fun _ _ _ -> ()); + implem.set_member_offset <- (fun _ _ _ -> ()); + implem.set_bitfield_offset <- (fun _ _ _ _ _ -> ()); + implem.insert_global_declaration <- (fun _ _ -> ()); + implem.add_fun_addr <- (fun _ _ -> ()) end let init_compile_unit name = implem.init name let atom_function id atom = implem.atom_function id atom let atom_global_variable id atom = implem.atom_global_variable id atom let set_composite_size id sou size = implem.set_composite_size id sou size -let set_member_offset id field off size = implem.set_member_offset id field off size -let insert_declaration dec env = implem.insert_declaration dec env +let set_member_offset id field off = implem.set_member_offset id field off +let set_bitfield_offset id field off underlying size = implem.set_bitfield_offset id field off underlying size +let insert_global_declaration env dec = implem.insert_global_declaration env dec +let add_fun_addr atom addr = implem.add_fun_addr atom addr |