aboutsummaryrefslogtreecommitdiffstats
path: root/debug/DebugInformation.ml
diff options
context:
space:
mode:
authorBernhard Schommer <bernhardschommer@gmail.com>2015-09-28 18:39:43 +0200
committerBernhard Schommer <bernhardschommer@gmail.com>2015-09-28 18:39:43 +0200
commit68ad5472a78d12e0e4fd4eae422122185403d678 (patch)
tree52674e67c21c4134118996f2b241f9496f7f5130 /debug/DebugInformation.ml
parent5492b5b55afa68e3d628da07ff583a0cac79b7e3 (diff)
downloadcompcert-kvx-68ad5472a78d12e0e4fd4eae422122185403d678.tar.gz
compcert-kvx-68ad5472a78d12e0e4fd4eae422122185403d678.zip
Change the way the debug sections are printed.
If a user uses the #pragma use_section for functions the diab linker requires a separate debug_info section for each entry. This commit adds functionality to emulate this behavior.
Diffstat (limited to 'debug/DebugInformation.ml')
-rw-r--r--debug/DebugInformation.ml25
1 files changed, 23 insertions, 2 deletions
diff --git a/debug/DebugInformation.ml b/debug/DebugInformation.ml
index 8b6ec1ad..7866c339 100644
--- a/debug/DebugInformation.ml
+++ b/debug/DebugInformation.ml
@@ -774,9 +774,28 @@ let function_end atom loc =
List.iter (close_range loc) !open_vars;
open_vars:= []
-let compilation_section_start: (string,int) Hashtbl.t = Hashtbl.create 7
+let compilation_section_start: (string,int * int * int * string) Hashtbl.t = Hashtbl.create 7
let compilation_section_end: (string,int) Hashtbl.t = Hashtbl.create 7
+let add_compilation_section_start sec addr =
+ Hashtbl.add compilation_section_start sec addr
+
+let add_compilation_section_end sec addr =
+ Hashtbl.add compilation_section_end sec addr
+
+let exists_section sec =
+ Hashtbl.mem compilation_section_start sec
+
+let filenum: (string * string,int) Hashtbl.t = Hashtbl.create 7
+
+let compute_file_enum end_label entry_label line_end =
+ Hashtbl.iter (fun sec (_,_,_,secname) ->
+ Hashtbl.add compilation_section_end sec (end_label secname);
+ StringSet.iter (fun file ->
+ let lbl = entry_label file in
+ Hashtbl.add filenum (sec,file) lbl) !all_files;
+ line_end ()) compilation_section_start
+
let init name =
id := 0;
file_name := name;
@@ -790,4 +809,6 @@ let init name =
Hashtbl.reset atom_to_local;
Hashtbl.reset scope_to_local;
Hashtbl.reset compilation_section_start;
- Hashtbl.reset compilation_section_end
+ Hashtbl.reset compilation_section_end;
+ Hashtbl.reset filenum;
+ all_files := StringSet.empty