Skip to content

Commit

Permalink
scripts: elf_helper.py: add analyze for DW_TAG_typedef
Browse files Browse the repository at this point in the history
add analyze for DW_TAG_typedef in order to catch all the
kernel objects.

Fixes: zephyrproject-rtos#16760.

Signed-off-by: Wentong Wu <[email protected]>
  • Loading branch information
wentongwu authored and nashif committed Aug 29, 2019
1 parent c18ff87 commit 9ca0d5e
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions scripts/elf_helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -336,6 +336,15 @@ def analyze_die_array(die):
type_env[die.offset] = ArrayType(die.offset, elements, type_offset)


def analyze_typedef(die):
type_offset = die_get_type_offset(die)

if type_offset not in type_env.keys():
return

type_env[die.offset] = type_env[type_offset]


def addr_deref(elf, addr):
for section in elf.iter_sections():
start = section['sh_addr']
Expand Down Expand Up @@ -404,6 +413,8 @@ def find_kobjects(self, syms):
analyze_die_const(die)
elif die.tag == "DW_TAG_array_type":
analyze_die_array(die)
elif die.tag == "DW_TAG_typedef":
analyze_typedef(die)
elif die.tag == "DW_TAG_variable":
variables.append(die)

Expand Down

0 comments on commit 9ca0d5e

Please sign in to comment.