From eaf4bab84af4b3db1ca9c6785ed803bbbd61b9a7 Mon Sep 17 00:00:00 2001 From: Bernhard Schommer Date: Thu, 1 Oct 2015 12:19:16 +0200 Subject: Only print locations for symbols that are present in the assembler. --- debug/Dwarfgen.ml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'debug/Dwarfgen.ml') diff --git a/debug/Dwarfgen.ml b/debug/Dwarfgen.ml index aaf2d53f..8f71d487 100644 --- a/debug/Dwarfgen.ml +++ b/debug/Dwarfgen.ml @@ -284,13 +284,17 @@ let gen_types sec needed = acc) types []) let global_variable_to_entry sec acc id v = + let loc = match v.gvar_atom with + | Some a when StringSet.mem (extern_atom a) !printed_vars -> + Some (LocSymbol a) + | _ -> None in let var = { variable_file_loc = translate_file_loc sec v.gvar_file_loc; variable_declaration = Some v.gvar_declaration; variable_external = Some v.gvar_external; variable_name = v.gvar_name; variable_type = v.gvar_type; - variable_location = match v.gvar_atom with Some a -> Some (LocSymbol a) | None -> None; + variable_location = loc; } in new_entry id (DW_TAG_variable var),IntSet.add v.gvar_type acc -- cgit