diff options
author | Bernhard Schommer <bernhardschommer@gmail.com> | 2015-04-14 16:18:46 +0200 |
---|---|---|
committer | Bernhard Schommer <bernhardschommer@gmail.com> | 2015-04-14 16:18:46 +0200 |
commit | e42febd5a88c2bf04227f1cd4ead947c51989ec1 (patch) | |
tree | 0661131709c95dc77a5c0583f66caf219a84e8cf /backend/PrintAnnot.ml | |
parent | 03ad26aa9d2762655b508f7142d0aed9916da83b (diff) | |
parent | b597ce896a8a9cd7c3ed028a34e0612229d1a36a (diff) | |
download | compcert-e42febd5a88c2bf04227f1cd4ead947c51989ec1.tar.gz compcert-e42febd5a88c2bf04227f1cd4ead947c51989ec1.zip |
Merge branch 'dwarf' of /local/schommer/trunk/build/compcert.ppc/compcert into dwarf
Diffstat (limited to 'backend/PrintAnnot.ml')
-rw-r--r-- | backend/PrintAnnot.ml | 15 |
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 |