forked from osandov/drgn
-
Notifications
You must be signed in to change notification settings - Fork 6
Merge branch 'master' into '6.0/stage' #23
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
Split the two modes into separate tests and move the environment variable fiddling into a separate helper function. Signed-off-by: Omar Sandoval <[email protected]>
For some reason, we consistently ignore errors from elf_strptr(), but we shouldn't. Signed-off-by: Omar Sandoval <[email protected]>
Linux kernel modules usually contain ELF relocations in DWARF and ORC sections for symbols in .init sections. Since we ignore .init sections entirely in cache_kernel_module_sections(), these relocations end up being based on an address of 0 (so, e.g., a function from .init.text could be reported as having an address of 0x0). It makes a little more sense to use the address where the .init section was before it was freed. So, let's update the sections' sh_addr but continue ignoring them for determining the module's address range. Signed-off-by: Omar Sandoval <[email protected]>
To support unwinding with ORC, we need to apply relocations to .orc_unwind_ip, which libdwfl doesn't do. That means that we always need to apply relocations on x86-64, not just as a fast path when the file's byte order matches the host's. So, generalize handling of 64- vs 32-bit and little- vs big-endian relocations, and move the handling of relocation types to an arch-specific callback. Signed-off-by: Omar Sandoval <[email protected]>
This is used for .orc_unwind_ip for kernel modules. Signed-off-by: Omar Sandoval <[email protected]>
The Linux kernel has its own stack unwinding format for x86-64 called ORC: https://www.kernel.org/doc/html/latest/x86/orc-unwinder.html. It is essentially a simplified, less complete version of DWARF CFI. ORC is generated by analyzing machine code, so it is present for all but a few ignored functions. In contrast, DWARF CFI is generated by the compiler and is therefore missing for functions written in assembly and inline assembly (which is widespread in the kernel). This implements an ORC stack unwinder: it applies ELF relocations to the ORC sections, adds a new DRGN_CFI_RULE_REGISTER_ADD_OFFSET CFI rule kind, parses and efficiently stores ORC data, and translates ORC to drgn CFI rules. This will allow us to stack trace through assembly code, interrupts, and system calls. Signed-off-by: Omar Sandoval <[email protected]>
prakashsurya
approved these changes
Mar 30, 2021
The libelf-dev and libdw-dev packages on Debian Stretch, Ubuntu Xenial, and older are missing dependencies on liblzma-dev and zlib1g-dev, which causes pkg-config to fail when running configure. Add them explicitly for old versions. Signed-off-by: Omar Sandoval <[email protected]>
The README instructs the user to install with pip, but doesn't actually mention that pip needs to be installed. Signed-off-by: Omar Sandoval <[email protected]>
Building drgn from an sdist currently requires autotools and gawk because libdrgn in the sdist is more or less a git checkout. It's more user-friendly to include the autotools output and generated code. Do this by extending the sdist command to include a full libdrgn distribution with `make distdir`. Signed-off-by: Omar Sandoval <[email protected]>
sdimitro
approved these changes
Apr 1, 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.