diff options
author | Bernhard Schommer <bernhardschommer@gmail.com> | 2015-10-09 16:36:16 +0200 |
---|---|---|
committer | Bernhard Schommer <bernhardschommer@gmail.com> | 2015-10-09 16:36:16 +0200 |
commit | b0c47e12f2bbff0905ad853b90169df16d87f6be (patch) | |
tree | 701518c70bd10e60f9add5d8e6e53731ba77bf81 /backend/Asmexpandaux.ml | |
parent | 6a2cfdb1bc410532a23c58206cd00b39bc7ccba3 (diff) | |
download | compcert-kvx-b0c47e12f2bbff0905ad853b90169df16d87f6be.tar.gz compcert-kvx-b0c47e12f2bbff0905ad853b90169df16d87f6be.zip |
Filled in missing functions for debug information on ia32.
Like for arm and ppc the functions for section names and start and
end addresses of compilation units are defined and the print_annot
function is moved to Asmexpandaux.ml.
Diffstat (limited to 'backend/Asmexpandaux.ml')
-rw-r--r-- | backend/Asmexpandaux.ml | 27 |
1 files changed, 24 insertions, 3 deletions
diff --git a/backend/Asmexpandaux.ml b/backend/Asmexpandaux.ml index 5c3ac381..25be9be3 100644 --- a/backend/Asmexpandaux.ml +++ b/backend/Asmexpandaux.ml @@ -63,9 +63,30 @@ let expand_scope id lbl oldscopes newscopes = and closing = List.filter (fun a -> not (List.mem a newscopes)) oldscopes in List.iter (fun i -> Debug.open_scope id i lbl) opening; List.iter (fun i -> Debug.close_scope id i lbl) closing + +let translate_annot sp preg_to_dwarf annot = + let rec aux = function + | BA x -> Some (sp,BA (preg_to_dwarf x)) + | BA_int _ + | BA_long _ + | BA_float _ + | BA_single _ + | BA_loadglobal _ + | BA_addrglobal _ + | BA_loadstack _ -> None + | BA_addrstack ofs -> Some (sp,BA_addrstack ofs) + | BA_splitlong (hi,lo) -> + begin + match (aux hi,aux lo) with + | Some (_,hi) ,Some (_,lo) -> Some (sp,BA_splitlong (hi,lo)) + | _,_ -> None + end in + (match annot with + | [] -> None + | a::_ -> aux a) -let expand_debug id annot simple l = +let expand_debug id sp preg simple l = let get_lbl = function | None -> let lbl = new_label () in @@ -85,7 +106,7 @@ let expand_debug id annot simple l = aux lbl scopes rest | 3 -> begin - match annot args with + match translate_annot sp preg args with | Some a -> let lbl = get_lbl lbl in Debug.start_live_range (id,txt) lbl a; @@ -98,7 +119,7 @@ let expand_debug id annot simple l = aux (Some lbl) scopes rest | 5 -> begin - match annot args with + match translate_annot sp preg args with | Some a-> Debug.stack_variable (id,txt) a; aux lbl scopes rest |