@@ -111,7 +111,31 @@ fn export_type(
111111 TypeClass :: StructureTypeClass => {
112112 let structure_die_uid = match t. get_structure ( ) . unwrap ( ) . structure_type ( ) {
113113 StructureType :: ClassStructureType => {
114- dwarf. unit . add ( root, constants:: DW_TAG_class_type )
114+ let class_uid = dwarf. unit . add ( root, constants:: DW_TAG_class_type ) ;
115+ for base_struct in t. get_structure ( ) . unwrap ( ) . base_structures ( ) {
116+ let inheritance_uid = dwarf. unit . add ( class_uid, gimli:: DW_TAG_inheritance ) ;
117+ let base_struct_uid = export_type (
118+ base_struct. ty . name ( ) . to_string ( ) ,
119+ base_struct. ty . target ( bv) . unwrap ( ) . as_ref ( ) ,
120+ bv,
121+ defined_types,
122+ dwarf,
123+ )
124+ . unwrap ( ) ;
125+ dwarf
126+ . unit
127+ . get_mut ( inheritance_uid)
128+ . set ( gimli:: DW_AT_type , AttributeValue :: UnitRef ( base_struct_uid) ) ;
129+ dwarf. unit . get_mut ( inheritance_uid) . set (
130+ gimli:: DW_AT_data_member_location ,
131+ AttributeValue :: Data8 ( base_struct. offset ) ,
132+ ) ;
133+ dwarf. unit . get_mut ( inheritance_uid) . set (
134+ gimli:: DW_AT_accessibility ,
135+ AttributeValue :: Accessibility ( gimli:: DW_ACCESS_public ) ,
136+ ) ;
137+ }
138+ class_uid
115139 }
116140 StructureType :: StructStructureType => {
117141 dwarf. unit . add ( root, constants:: DW_TAG_structure_type )
0 commit comments