aboutsummaryrefslogtreecommitdiffstats
path: root/debug
diff options
context:
space:
mode:
authorBernhard Schommer <bernhardschommer@gmail.com>2017-01-24 13:04:51 +0100
committerBernhard Schommer <bernhardschommer@gmail.com>2017-01-24 13:04:51 +0100
commit89bd87cab8e6216b1f87389f93424468710e5f21 (patch)
treec8bbc0695328f48073ad7a9f5ed040e4928b8b1f /debug
parentf1e56a6c69acfd233bbe99bc3ab28409116eb5db (diff)
downloadcompcert-kvx-89bd87cab8e6216b1f87389f93424468710e5f21.tar.gz
compcert-kvx-89bd87cab8e6216b1f87389f93424468710e5f21.zip
Do not print anonymous member names in debug info
Anonymous members no longer are printed in the debug information. Fix 20798
Diffstat (limited to 'debug')
-rw-r--r--debug/DebugInformation.ml1
-rw-r--r--debug/DebugTypes.mli1
-rw-r--r--debug/DwarfPrinter.ml4
-rw-r--r--debug/DwarfTypes.mli2
-rw-r--r--debug/Dwarfgen.ml2
5 files changed, 6 insertions, 4 deletions
diff --git a/debug/DebugInformation.ml b/debug/DebugInformation.ml
index dfde9136..6f159743 100644
--- a/debug/DebugInformation.ml
+++ b/debug/DebugInformation.ml
@@ -395,6 +395,7 @@ let insert_global_declaration env dec =
let fields = List.map (fun f ->
{
cfd_name = f.fld_name;
+ cfd_anon = f.fld_anonymous;
cfd_typ = insert_type f.fld_typ;
cfd_bit_size = f.fld_bitfield;
cfd_bit_offset = None;
diff --git a/debug/DebugTypes.mli b/debug/DebugTypes.mli
index 25c7390f..c3df6066 100644
--- a/debug/DebugTypes.mli
+++ b/debug/DebugTypes.mli
@@ -19,6 +19,7 @@ open Camlcoq
type composite_field =
{
cfd_name: string;
+ cfd_anon: bool;
cfd_typ: int;
cfd_bit_size: int option;
cfd_bit_offset: int option;
diff --git a/debug/DwarfPrinter.ml b/debug/DwarfPrinter.ml
index b81507a8..13e7765d 100644
--- a/debug/DwarfPrinter.ml
+++ b/debug/DwarfPrinter.ml
@@ -159,7 +159,7 @@ module DwarfPrinter(Target: DWARF_TARGET):
add_attr_some e.member_bit_offset (add_abbr_entry (0xc,"DW_AT_bit_offset",DW_FORM_data1));
add_attr_some e.member_bit_size (add_abbr_entry (0xd,"DW_AT_bit_size",DW_FORM_data1));
add_attr_some e.member_declaration add_declaration;
- add_name buf e.member_name;
+ add_name_opt buf e.member_name;
add_type buf;
(match e.member_data_member_location with
| None -> ()
@@ -472,7 +472,7 @@ module DwarfPrinter(Target: DWARF_TARGET):
print_opt_value oc "DW_AT_bit_offset" mb.member_bit_offset print_byte;
print_opt_value oc "DW_AT_bit_size" mb.member_bit_size print_byte;
print_opt_value oc "DW_AT_declaration" mb.member_declaration print_flag;
- print_string oc "DW_AT_name" mb.member_name;
+ print_opt_value oc "DW_AT_name" mb.member_name print_string;
print_ref oc "DW_AT_type" mb.member_type;
print_opt_value oc "DW_AT_data_member_location" mb.member_data_member_location print_data_location
diff --git a/debug/DwarfTypes.mli b/debug/DwarfTypes.mli
index 48da4509..23aba448 100644
--- a/debug/DwarfTypes.mli
+++ b/debug/DwarfTypes.mli
@@ -159,7 +159,7 @@ type dw_tag_member =
member_bit_size: constant option;
member_data_member_location: data_location_value option;
member_declaration: flag option;
- member_name: string_const;
+ member_name: string_const option;
member_type: reference;
}
diff --git a/debug/Dwarfgen.ml b/debug/Dwarfgen.ml
index 30e44e52..ee568042 100644
--- a/debug/Dwarfgen.ml
+++ b/debug/Dwarfgen.ml
@@ -232,7 +232,7 @@ module Dwarfgenaux (Target: TARGET) =
| None -> None
| Some s -> Some (DataLocBlock (DW_OP_plus_uconst s)));
member_declaration = None;
- member_name = string_entry mem.cfd_name;
+ member_name = if mem.cfd_anon then None else Some (string_entry mem.cfd_name);
member_type = mem.cfd_typ;
} in
new_entry (next_id ()) (DW_TAG_member mem)