aboutsummaryrefslogtreecommitdiffstats
path: root/debug/Dwarfgen.ml
diff options
context:
space:
mode:
authorBernhard Schommer <bernhardschommer@gmail.com>2015-09-18 16:42:05 +0200
committerBernhard Schommer <bernhardschommer@gmail.com>2015-09-18 16:42:05 +0200
commit31aceeb1be64d529432f35bbea16ebafc3a21df0 (patch)
treeacb6e197e6960405b450c9c9842fdf37e18a5b40 /debug/Dwarfgen.ml
parentc8a0b76c6b9c3eb004a7fccdd2ad15cc8615ef93 (diff)
downloadcompcert-kvx-31aceeb1be64d529432f35bbea16ebafc3a21df0.tar.gz
compcert-kvx-31aceeb1be64d529432f35bbea16ebafc3a21df0.zip
Started implementing the scope for the Debug Informations.
Scopes will be handled by a stack of all open scopes. This stack then can also be used to generate the debug directives to track the scopes through the rest of the passes.
Diffstat (limited to 'debug/Dwarfgen.ml')
-rw-r--r--debug/Dwarfgen.ml16
1 files changed, 14 insertions, 2 deletions
diff --git a/debug/Dwarfgen.ml b/debug/Dwarfgen.ml
index 0acab05a..bb0ab5f2 100644
--- a/debug/Dwarfgen.ml
+++ b/debug/Dwarfgen.ml
@@ -217,6 +217,17 @@ let function_parameter_to_entry p =
} in
new_entry (next_id ()) (DW_TAG_formal_parameter p)
+let local_variable_to_entry v id =
+ let var = {
+ variable_file_loc = v.lvar_file_loc;
+ variable_declaration = None;
+ variable_external = None;
+ variable_name = v.lvar_name;
+ variable_type = v.lvar_type;
+ variable_location = None;
+ } in
+ new_entry id (DW_TAG_variable var)
+
let function_to_entry id f =
let f_tag = {
subprogram_file_loc = f.fun_file_loc;
@@ -228,8 +239,9 @@ let function_to_entry id f =
subprogram_low_pc = f.fun_low_pc;
} in
let f_entry = new_entry id (DW_TAG_subprogram f_tag) in
- let child = List.map function_parameter_to_entry f.fun_parameter in
- add_children f_entry child
+ let params = List.map function_parameter_to_entry f.fun_parameter in
+(* let vars = List.map local_variable_to_entry f.fun_locals in*)
+ add_children f_entry params
let definition_to_entry id t =
match t with