mirror of
https://github.com/apache/nuttx.git
synced 2026-05-21 21:34:07 +08:00
tools/parsetrace.py: Fix get_typesize bug in parsetrace.py
Build Documentation / build-html (push) Has been cancelled
Build Documentation / build-html (push) Has been cancelled
For the following code, we need to check 'type_attr.form'. type_attr = DIE.attributes["DW_AT_type"] base_type_die = dwarfinfo.get_DIE_from_refaddr(xxx) When type_attr.form==DW_FORM_ref_addr, 'type_attr.value' means global reference (across compilation units). When type_attr.form==DW_FORM_ref4, 'type_attr.value' means local reference (within the same compilation unit). Signed-off-by: yukangzhi <yukangzhi@xiaomi.com>
This commit is contained in:
+8
-3
@@ -133,9 +133,14 @@ class SymbolTables(object):
|
||||
if name == type_name:
|
||||
if "DW_AT_type" in DIE.attributes:
|
||||
type_attr = DIE.attributes["DW_AT_type"]
|
||||
base_type_die = dwarfinfo.get_DIE_from_refaddr(
|
||||
type_attr.value + CU.cu_offset
|
||||
)
|
||||
if type_attr.form == "DW_FORM_ref_addr":
|
||||
base_type_die = dwarfinfo.get_DIE_from_refaddr(
|
||||
type_attr.value
|
||||
)
|
||||
else:
|
||||
base_type_die = dwarfinfo.get_DIE_from_refaddr(
|
||||
type_attr.value + CU.cu_offset
|
||||
)
|
||||
if base_type_die.tag == "DW_TAG_base_type":
|
||||
size = base_type_die.attributes["DW_AT_byte_size"].value
|
||||
elif base_type_die.tag == "DW_TAG_typedef":
|
||||
|
||||
Reference in New Issue
Block a user