forked from osandov/drgn
-
Notifications
You must be signed in to change notification settings - Fork 6
Merge branch 'master' into '6.0/stage' #26
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
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Signed-off-by: Omar Sandoval <[email protected]>
This workaround was originally present in commit e5874ad ("libdrgn: use libdwfl"). We dropped in in commit 6a13d74 ("libdrgn: build with bundled elfutils") because the bundled version of elfutils had the fix. We forgot to bring it back in commit 4c5c5f3 ("Remove bundled version of elfutils") even though we support versions without the fix. Reported-by: Serapheim Dimitropoulos <[email protected]> Signed-off-by: Omar Sandoval <[email protected]>
I missed the drgn_program_set_kdump() code path when making sure that we set the platform before adding memory segments. Fixes: 0e3054a ("libdrgn: make addresses wrap around when reading memory") Signed-off-by: Omar Sandoval <[email protected]>
The string must be null terminated, so there must be at least one byte left in .debug_str. Signed-off-by: Omar Sandoval <[email protected]>
The former is the same as the latter with less generic naming. Signed-off-by: Omar Sandoval <[email protected]>
Signed-off-by: Omar Sandoval <[email protected]>
We currently don't include the compilation directory when hashing file names for deduplication. This can cause us to incorrectly deduplicate a definition if, for example, two libraries have a definition with the same name in files with the same name. Fix this by hashing the full file path including the compilation directory. This also requires reworking our strategy for path normalization to better handle ".." components, since directories may end up outside of the compilation directory. The new strategy keeps a linked list of hashes (now FNV-1a instead of SipHash) for each parent directory. This is actually more efficient than the previous approach, offsetting the cost of the extra hash computations for the compilation directory. It also correctly handles file names in the line number program header which consist of multiple components. Signed-off-by: Omar Sandoval <[email protected]>
Older versions of GCC and Clang don't accept const variables for initializers ("error: initializer element is not constant"), so #define the FNV constants instead. Signed-off-by: Omar Sandoval <[email protected]>
Signed-off-by: Omar Sandoval <[email protected]>
There are a few places in the DWARF indexing code that we skip a 64-bit size. On 32-bit systems, this can wrap if the count is greater than SIZE_MAX. Rather than requiring vigilance against this, change the size to uint64_t. Signed-off-by: Omar Sandoval <[email protected]>
Somehow I missed this form, and I've never seen it used. It's the same as DW_FORM_exprloc for our purposes, so it's an easy fix. Signed-off-by: Omar Sandoval <[email protected]>
In DWARF 2, DW_FORM_ref_addr has the size of an address, not a size depending on the format. Signed-off-by: Omar Sandoval <[email protected]>
…program And don't set the target by default; -k must be given explicitly now. Signed-off-by: Omar Sandoval <[email protected]>
LEB128 allows for redundant zero/sign bits, but we currently always treat extra bytes as overflow. Let's check those bytes correctly. Signed-off-by: Omar Sandoval <[email protected]>
Clang does not generate .debug_aranges by default, but the GNU toolchain does. This means that a Linux kernel binary compiled with Clang and GNU binutils will have ranges in .debug_aranges for assembly files and nothing else. This breaks our assumption that a non-empty .debug_aranges has ranges for every compilation unit. Fix it by always falling back to checking every CU if a range was not found in .debug_aranges. Signed-off-by: Omar Sandoval <[email protected]>
dwfl_module_getsrc() relies on .debug_aranges to find the CU containing the PC. If the module has a missing or incomplete .debug_aranges, it fails. This lookup is actually redundant since we already found the CU when we unwound the stack. Use the libdw helpers that take the CU DIE instead to avoid this. We also need to save the CU for frames where we found it but couldn't find the subprogram (typically assembly files). Signed-off-by: Omar Sandoval <[email protected]>
Signed-off-by: Omar Sandoval <[email protected]>
sdimitro
approved these changes
Jul 8, 2021
grwilson
approved these changes
Jul 8, 2021
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
No description provided.