[lldb][DWARF] Sort ranges list in dwarf 5. (#91343) #8747
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Dwarf 5 says "There is no requirement that the entries be ordered in any particular way" in 2.17.3 Non-Contiguous Address Ranges for rnglist. Some places assume the ranges are already sorted but it's not.
For example, when parsing function
info, it validates low and hi address of the function: GetMinRangeBase returns the first range entry base and GetMaxRangeEnd returns the last range end. If low >= hi, it stops parsing this function. This causes missing inline stack frames for those functions.
This change fixes it and updates the test
lldb/test/Shell/SymbolFile/DWARF/x86/debug_rnglists.s
so that two ranges in.debug_rnglists
are out of order andimage lookup -v -s lookup_rnglists
is still able to produce sorted ranges for the inner block.(cherry picked from commit fdede92)