aboutsummaryrefslogtreecommitdiffstats
path: root/backend/PrintAnnot.ml
diff options
context:
space:
mode:
authorBernhard Schommer <bschommer@users.noreply.github.com>2015-04-15 12:15:12 +0200
committerBernhard Schommer <bschommer@users.noreply.github.com>2015-04-15 12:15:12 +0200
commit1150b687acf225e0f6063de45379c3d5fbc54524 (patch)
tree0661131709c95dc77a5c0583f66caf219a84e8cf /backend/PrintAnnot.ml
parent03ad26aa9d2762655b508f7142d0aed9916da83b (diff)
parente42febd5a88c2bf04227f1cd4ead947c51989ec1 (diff)
downloadcompcert-1150b687acf225e0f6063de45379c3d5fbc54524.tar.gz
compcert-1150b687acf225e0f6063de45379c3d5fbc54524.zip
Merge pull request #37 from AbsInt/dwarf
Added the Dwarf v2 debugging information for global variables and functions for the Diab Backend.
Diffstat (limited to 'backend/PrintAnnot.ml')
-rw-r--r--backend/PrintAnnot.ml15
1 files changed, 11 insertions, 4 deletions
diff --git a/backend/PrintAnnot.ml b/backend/PrintAnnot.ml
index 0176224d..995f22dd 100644
--- a/backend/PrintAnnot.ml
+++ b/backend/PrintAnnot.ml
@@ -21,6 +21,13 @@ open AST
open Memdata
open Asm
+(** All files used in the debug entries *)
+module StringSet = Set.Make(String)
+let all_files : StringSet.t ref = ref StringSet.empty
+let add_file file =
+ all_files := StringSet.add file !all_files
+
+
(** Line number annotations *)
let filename_info : (string, int * Printlines.filebuf option) Hashtbl.t
@@ -66,10 +73,10 @@ let print_file_line oc pref file line =
| Some fb -> Printlines.copy oc pref fb line line
end
-(* Add file and line debug location, using DWARF1 directives in the style
+(* Add file and line debug location, using DWARF2 directives in the style
of Diab C 5 *)
-let print_file_line_d1 oc pref file line =
+let print_file_line_d2 oc pref file line =
if !Clflags.option_g && file <> "" then begin
let (_, filebuf) =
try
@@ -77,10 +84,10 @@ let print_file_line_d1 oc pref file line =
with Not_found ->
enter_filename file in
if file <> !last_file then begin
- fprintf oc " .d1file %S\n" file;
+ fprintf oc " .d2file %S\n" file;
last_file := file
end;
- fprintf oc " .d1line %d\n" line;
+ fprintf oc " .d2line %d\n" line;
match filebuf with
| None -> ()
| Some fb -> Printlines.copy oc pref fb line line