Skip to content
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

DWARF-5 support in debugedit #1537

Merged
merged 5 commits into from Feb 16, 2021

Conversation

pmatilai
Copy link
Member

Resubmitting patches posted on rpm-maint: http://lists.rpm.org/pipermail/rpm-maint/2021-February/016462.html

jankratochvil and others added 5 commits February 15, 2021 15:37
New functions edit_strp, skip_form and edit_attributes_str_comp_dir
called by edit_attributes.
Split part of read_dwarf2_line into a read_dwarf4_line function.
New function edit_dwarf2_any_str called by edit_dwarf2 at the end of
phase 0 to rebuild .debug_str.
Recognize the various new DWARF5 .debug sections.
Parse and skip new DWARF5 forms in read_abbrev and skip_form.
Read DWARF5 unit headers for compile and partial units in edit_info.

This is enough to be able to process gcc -gdwarf-5 produced binaries
without the new DWARF5 .debug_line format (which isn't produced with
binutils < 2.36).

Patches slightly edited/merged by Mark Wielaard <mark@klomp.org>
Handle the new DWARF5 .debug_line tables and the new DW_FORM_line_strp.
DWARF5 tables are handled separately from the earlier tables. They
will never change size, but they do need updates to the .debug_str
or .debug_line_str references.

Based on a patch from Jan Kratochvil <jan.kratochvil@redhat.com>
Adjust some existing tests so they are run with an explicit -gdwarf-4
and add an -gdwarf-5 variant to make testing independent of the gcc
default DWARF version. The tests that might generate a DWARF5 line
table work for both version 4 and 5 and some also ignore stderr output
when using -p.debug_line_str because some combinations of gcc/binutils
generate DWARF5 debug info with DWARF4 debug line tables, even when
-gdwarf-5 is given.

Tested against GCC10, which defaults to DWARF4 and GCC11, which defaults
to DWARF5.
@Conan-Kudo
Copy link
Member

How do I test this "in the real world"? The code looks fine (insomuch as debugedit code usually does...)...

@pmatilai
Copy link
Member Author

AIUI this has been real-world tested in rawhide for a few weeks now...

@pmatilai
Copy link
Member Author

So... some of this has been reviewed in #1332 months ago and the rest has been battle-tested in rawhide for several weeks now, I don't think this PR will get any better by "letting it breath" here some more 😅

@pmatilai pmatilai merged commit 42030e1 into rpm-software-management:master Feb 16, 2021
@pmatilai
Copy link
Member Author

Thanks for the patches @jankratochvil and Mark!

@jankratochvil
Copy link
Contributor

The patchset regressed against my version as it no longer tests rpmbuild compatibility with LLVM product as required by paying customers of Red Hat company.

@rpm-maint
Copy link

rpm-maint commented Feb 16, 2021 via email

@rpm-maint
Copy link

rpm-maint commented Feb 16, 2021 via email

@rpm-maint
Copy link

rpm-maint commented Feb 16, 2021 via email

@jankratochvil
Copy link
Contributor

Could you rather point what was incomplete on the previous testcases than to screw it up? You removed the only part that matters.

@rpm-maint
Copy link

rpm-maint commented Feb 16, 2021 via email

@jankratochvil
Copy link
Contributor

The reason I didn't use the testcases you wrote was simply because they depended on llvm tooling being present and you said you didn't care about making them work with gcc.

gcc did not support the needed functionality the time when I was implementing it. I sure do not care at all about gcc (like the rest of the world) but that was not the reason why I did not include the testcases for gcc. Running the tests with both gcc and clang would be a trivial extension of my testcases instead of dropping them all and replacing them by your incomplete ones.

@pmatilai pmatilai deleted the dwarf5-pr branch February 19, 2021 12:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants