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

Cache the .debug_aranges section and merge overlapping ranges #119

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

pedronavf
Copy link
Contributor

By caching .debug_aranges we speed up CU DIE lookups, as libdwarf requires us to allocate a copy of the ranges between trace frames. Because all contents in .debug_aranges are read we can also merge overlapping ranges and discard those with invalid information (a zero in start, length or die offset)

@bombela
Copy link
Owner

bombela commented Jun 28, 2018

The more memory we allocate, the more likely something bad can happen if you are expecting a stacktrace on some cpu exception...

@pedronavf
Copy link
Contributor Author

Agreed. I need to refresh the pull request because we kept evolving the code, but I've been quite busy to keep out fork cleaned up and ready to commit. We only enable this for debug builds as, in those, we know that our crashes are in parts of the code where we can use malloc with no problems.

I wanted to bring this up, enabling features on demand, but I wasn't sure if you wanted to keep backward free of those options or not. Right now we have #ifdefs to enable this caching or not, to scan DIEs recursively if searching in .debug_aranges fails, and some others. Would you be open to get those in? I can submit a pull request for you to check it out.

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

Successfully merging this pull request may close these issues.

None yet

2 participants