aboutsummaryrefslogtreecommitdiffstats
path: root/debug/DebugInformation.ml
diff options
context:
space:
mode:
authorBernhard Schommer <bernhardschommer@gmail.com>2015-09-23 16:49:13 +0200
committerBernhard Schommer <bernhardschommer@gmail.com>2015-09-23 16:49:13 +0200
commitb448fbba97c1008599610d0c9bc834881b9dc219 (patch)
treef244430d915c0818c8ae66c1235316fdac1d683d /debug/DebugInformation.ml
parent806102dd5492a39b33c2ebb88d6646237ba7f9e6 (diff)
downloadcompcert-b448fbba97c1008599610d0c9bc834881b9dc219.tar.gz
compcert-b448fbba97c1008599610d0c9bc834881b9dc219.zip
Added support for printing local variables and fixed issue with .text
Local variables are now added with bogus lexical scopes to reflect the actually lexical scopes. Also this commit fixes assembler problems of the das when a user section with the name ".text" is defined.
Diffstat (limited to 'debug/DebugInformation.ml')
-rw-r--r--debug/DebugInformation.ml8
1 files changed, 5 insertions, 3 deletions
diff --git a/debug/DebugInformation.ml b/debug/DebugInformation.ml
index d8d608af..ef8993ea 100644
--- a/debug/DebugInformation.ml
+++ b/debug/DebugInformation.ml
@@ -439,6 +439,7 @@ let atom_to_local: (atom, int) Hashtbl.t = Hashtbl.create 7
let scope_to_local: (int * int,int) Hashtbl.t = Hashtbl.create 7
(* Map from scope id + function atom to debug id *)
+let atom_to_scope: (atom, int) Hashtbl.t = Hashtbl.create 7
let find_lvar_stamp id =
let id = (Hashtbl.find stamp_to_local id) in
@@ -477,6 +478,7 @@ let insert_global_declaration env dec=
in
match dec.gdesc with
| Gdecl (sto,id,ty,init) ->
+ Printf.printf "Entering information for %s\n" id.name;
if not (is_function_type env ty) then begin
if not (Hashtbl.mem stamp_to_definition id.stamp) then begin
let at_decl,ext = (match sto with
@@ -644,9 +646,9 @@ let new_scope f_id sc_id =
let enter_function_scope fun_id sc_id =
try
- let id = new_scope fun_id.stamp sc_id in
- let fun_id,f = find_fun_stamp fun_id.stamp in
- replace_fun id ({f with fun_scope = Some id})
+ let id = new_scope fun_id sc_id in
+ let fun_id,f = find_fun_stamp fun_id in
+ replace_fun fun_id ({f with fun_scope = Some id})
with Not_found -> ()
let enter_scope f_id p_id id =