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.
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
Update DwarfWalker subrange handling #1369
Update DwarfWalker subrange handling #1369
Changes from 28 commits
c907634
5b6d213
cf0591f
a2fcdda
12a112f
47f4e74
7f86b0d
bad087d
d8cf642
29636f0
0c0a3fa
0ee23bc
108a1db
56d9e45
24f7efd
c0bbe2c
6407563
0e610b7
7555de1
3f4b3bf
5725dd0
4a9dd6e
79eb686
51a2324
efa6f67
da126ec
c9e8852
ea0e6a9
c33b43d
344c357
7991ee6
aa9fb66
1ad6566
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
int64_t
orDwarf_Word
instead oflong
? OK on linux and everywhere Dyninst runs, butlong
is required to be only at least 32-bits and would narrow the result if you were on a non-64-bitlong
system such as win64.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What about C VLAs and C flexible arrays? The DWARF form type is an exprloc and not a constant integer type. I also see subranges with a type, but without a
DW_AT_upper_bound
attribute (it also changes an array of array to a single subrange without theDW_AT_upper_bound
.These could be deferred to a new issue: array types need an unknown (and maybe locexpr) upper bound value.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Switched using Dwarf_Word. VLAs and flexible arrays aren't handled in libdw's dwarf_aggregate_size. Maybe we can just ignore them here, as well?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
return count + lower_bound - 1
?Works for zero-based array languages, but not 1-based arrays for languages or those that support a true range for the index values. Perhaps for efficiency there should only a function to return both lower and upper bounds as a pair so lower bound doesn't need to be computed twice if
DW_AT_count
is used.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed. I refactored this with the added assumption of zero-based if there is
DW_AT_count
but noDW_AT_lower_bound
ordwarf_srclang_lower_bound
.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds reasonable