Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

decode_funcname in dwarf_decode_address.py does not handle inlined functions #567

Open
IsaacL2001 opened this issue Sep 16, 2024 · 1 comment

Comments

@IsaacL2001
Copy link

When a "DW_TAG_subprogram" DIE contains an inlined function ("DW_AT_inline" = 1), it does not have a "DW_AT_low_pc" attribute which causes decode_funcname to ignore the "DW_TAG_subprogram" DIE. This leads to the non-inlined function that called the inlined function to be returned, instead of the inlined function .

I noticed this when my programs Reset_Handler() called __set_MSP(), which is a forced inlined CMSIS function. decode_funcname returned "Reset_Handler", whereas addr2line correctly returned "__set_MSP()".

@IsaacL2001 IsaacL2001 changed the title decode_funcname in dwarf_decode_address.py does not handle inlined subroutines decode_funcname in dwarf_decode_address.py does not handle inlined functions Sep 16, 2024
@sevaa
Copy link
Contributor

sevaa commented Sep 23, 2024

When analyzing the DWARF info for the purposes of call stack recovery in a real life situation, inline functions should be by all rights treated separately from genuine ones. In GNU a2l, there is a command line switch to make the tool check for inline functions.

The purpose of dwarf_decode_address.py is educational rather than presenting an exhaustive a2l replacement. So I'd say this is functions as designed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants