Skip to content

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
merged 22 commits into from
Jul 8, 2021
Merged

Merge branch 'master' into '6.0/stage' #26

merged 22 commits into from
Jul 8, 2021

Conversation

prakashsurya
Copy link

No description provided.

osandov and others added 4 commits June 9, 2021 01:52
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]>
osandov and others added 18 commits June 25, 2021 17:50
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]>
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]>
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]>
@sdimitro sdimitro merged commit 5165e4a into 6.0/stage Jul 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

4 participants