scripts: ctx.py: Added struct/union namespace prefix to results
This is a bit more readable and better matches the names used in the C code (lfs_config vs struct lfs_config). The downside is we now have fields with spaces in them, which may cause problems for naive parsers.
This commit is contained in:
+7
-1
@@ -368,7 +368,13 @@ def collect_dwarf_info(obj_path, filter=None, *,
|
||||
@ft.cached_property
|
||||
def name(self):
|
||||
if 'DW_AT_name' in self:
|
||||
return self['DW_AT_name'].split(':')[-1].strip()
|
||||
name = self['DW_AT_name'].split(':')[-1].strip()
|
||||
# prefix with struct/union
|
||||
if self.tag == 'DW_TAG_structure_type':
|
||||
name = 'struct ' + name
|
||||
elif self.tag == 'DW_TAG_union_type':
|
||||
name = 'union ' + name
|
||||
return name
|
||||
else:
|
||||
return None
|
||||
|
||||
|
||||
Reference in New Issue
Block a user