diff options
Diffstat (limited to 'powerpc/TargetPrinter.ml')
-rw-r--r-- | powerpc/TargetPrinter.ml | 24 |
1 files changed, 21 insertions, 3 deletions
diff --git a/powerpc/TargetPrinter.ml b/powerpc/TargetPrinter.ml index eca7a1b8..2faaf2e3 100644 --- a/powerpc/TargetPrinter.ml +++ b/powerpc/TargetPrinter.ml @@ -78,6 +78,8 @@ let end_addr = ref (-1) let stmt_list_addr = ref (-1) +let debug_start_addr = ref (-1) + let label = elf_label module Linux_System : SYSTEM = @@ -241,13 +243,17 @@ module Diab_System : SYSTEM = let label_start = new_label () in start_addr := label_start; fprintf oc "%a:\n" label label_start; + let d_start = new_label() in + debug_start_addr := d_start; + fprintf oc " .0byte %a\n" label d_start; fprintf oc " .d2_line_start .debug_line\n"; end let filenum : (string,int) Hashtbl.t = Hashtbl.create 7 - let additional_debug_sections: StringSet.t ref = ref StringSet.empty + module StringSet = Set.Make(String) + let additional_debug_sections: StringSet.t ref = ref StringSet.empty let print_epilogue oc = if !Clflags.option_g then @@ -257,10 +263,10 @@ module Diab_System : SYSTEM = end_addr := label_end; fprintf oc "%a:\n" label label_end; fprintf oc " .text\n"; - StringSet.iter (fun file -> + Debug.all_files_iter (fun file -> let label = new_label () in Hashtbl.add filenum file label; - fprintf oc ".L%d: .d2filenum \"%s\"\n" label file) !all_files; + fprintf oc ".L%d: .d2filenum \"%s\"\n" label file); fprintf oc " .d2_line_end\n"; StringSet.iter (fun s -> fprintf oc " %s\n" s; @@ -283,6 +289,7 @@ module Diab_System : SYSTEM = fprintf oc " .section %s,,n\n" name; fprintf oc " .sectionlink .debug_line\n"; section oc sec; + fprintf oc " .0byte %a\n" label !debug_start_addr; fprintf oc " .d2_line_start %s\n" name end | _ -> () (* Only the case of a user section is interresting *) @@ -855,6 +862,8 @@ module Target (System : SYSTEM):TARGET = let get_stmt_list_addr () = !stmt_list_addr + let get_debug_start_addr () = !debug_start_addr + module DwarfAbbrevs = DwarfUtil.DefaultAbbrevs let new_label = new_label @@ -862,7 +871,16 @@ module Target (System : SYSTEM):TARGET = let section oc sec = section oc sec; debug_section oc sec + + let locations = (Hashtbl.create 17 : (atom,DwarfTypes.location_value) Hashtbl.t) + let get_location a = try Some (Hashtbl.find locations a) with Not_found -> None + + let get_segment_location _ = None + + let add_var_location a = + if !Clflags.option_g && Configuration.advanced_debug then + Hashtbl.add locations a (DwarfTypes.LocSymbol a); end let sel_target () = |