Re: [Rpm-maint] debugedit: Implement DWARF-5. (#1332)

2021-02-15 Thread Panu Matilainen

On 2/15/21 1:29 PM, Mark Wielaard wrote:

Hi,

It looks like the rpm-maint github bridge doesn't always work flawlessly
with attached patches.


Lol, that's ... putting it nicely :D


So here the whole series is using normal git
send-email. They are also available at:
https://code.wildebeest.org/git/user/mjw/rpm/log/?h=gcc-dwarf5

These patches are based on the original patches by Jan Kratochvil
but rewritten a bit so each individual patch adds distinct new
functionality and adding explicit DWARF4 and DWARF5 testcases using
the default GCC compiler that should work whether or not the compiler
defaults to DWARF4 or DWARF5 and whether or not the binutils assembler
generates older or new .debug_line sections. The patches (except the
new test cases) have been tested during the recent Fedora mass-rebuild
that used a GCC11 pre-release that defaulted to DWARF5 by default
using binutils 2.35.2. This resulted in one bug fix, a confusion of
comparing the size of the .debug_str and the new .debug_line_str section.
Those patches were against the rpm 4.16.1.2 release and can be found here:
https://code.wildebeest.org/git/user/mjw/rpm/log/?h=gcc-dwarf5-4.16.1.2

Those 4.16.1.2 patches include two patches which were already applied
to master:
- [NFC] debugedit: Move code from edit_dwarf2() to edit_info().
- debugedit: Fix missing relocation of .debug_types section.
So those have been dropped in this series, which was rebased to
current git trunk:

  [PATCH 1/5] [NFC] debugedit: Protect macro arguments by parentheses
  [PATCH 2/5] [NFC] debugedit: Move code to separate functions.
  [PATCH 3/5] debugedit: Implement DWARF-5 unit header and new forms
  [PATCH 4/5] debugedit: Handle DWARF-5 debug_line and debug_line_str.
  [PATCH 5/5] debugedit: Add DWARF5 tests

The first two [NFC] patches are unchanged just have a bit more explanation
in the commit message about what is going on.

The original series contained one patch that was dropped:
- debugedit: Fix handling in caller for errors in called read_dwarf2_line.
It was needed when doing multiple passes of some phases when dealing
with .debug_line, but the new patch handles things by doing each phase
just once (that is the fourth patch).

The original patches:
- debugedit: Implement DWARF-5 .debug_types (in .debug_info).
- debugedit: Implement DWARF-5.
were rewritten and split into the last three patches to have separate
implementations of handling the new unit headers and forms, handling
of the new .debug_line and .debug_line_str and adding new test cases.
This also made the third patch testable independently with older GCC
versions that support -gdwarf-5 but don't yet generate DWARF5 debug
line tables.

One feature of the original patch was dropped, handling of DW_UT_types
in .debug_info, which seemed to complicate the code a bit and wasn't
necessary for the default GCC DWARF5 mode. It shouldn't be that hard
to add that back if needed (although handling the partially linked
variant might be slightly tricky since they require handling COMDAT
.debug_info sections).

The original series added tests based on llvm tooling, which I have
replaced by existing tests based on explicit -gdwarf-4 and -gdwarf-5
tests that should work fine against both older and newer gcc versions
which might have different DWARF version defaults.


Thanks for the detailed explanation. I think this has been already 
reviewed and tested to the extent it's going to get, merged via 
https://github.com/rpm-software-management/rpm/pull/1537 now. Thanks 
again for the effort!


- Panu -

___
Rpm-maint mailing list
Rpm-maint@lists.rpm.org
http://lists.rpm.org/mailman/listinfo/rpm-maint


[Rpm-maint] debugedit: Implement DWARF-5. (#1332)

2021-02-15 Thread Mark Wielaard
Hi,

It looks like the rpm-maint github bridge doesn't always work flawlessly
with attached patches. So here the whole series is using normal git
send-email. They are also available at:
https://code.wildebeest.org/git/user/mjw/rpm/log/?h=gcc-dwarf5

These patches are based on the original patches by Jan Kratochvil
but rewritten a bit so each individual patch adds distinct new
functionality and adding explicit DWARF4 and DWARF5 testcases using
the default GCC compiler that should work whether or not the compiler
defaults to DWARF4 or DWARF5 and whether or not the binutils assembler
generates older or new .debug_line sections. The patches (except the
new test cases) have been tested during the recent Fedora mass-rebuild
that used a GCC11 pre-release that defaulted to DWARF5 by default
using binutils 2.35.2. This resulted in one bug fix, a confusion of
comparing the size of the .debug_str and the new .debug_line_str section.
Those patches were against the rpm 4.16.1.2 release and can be found here:
https://code.wildebeest.org/git/user/mjw/rpm/log/?h=gcc-dwarf5-4.16.1.2

Those 4.16.1.2 patches include two patches which were already applied
to master:
- [NFC] debugedit: Move code from edit_dwarf2() to edit_info().
- debugedit: Fix missing relocation of .debug_types section.
So those have been dropped in this series, which was rebased to
current git trunk:

 [PATCH 1/5] [NFC] debugedit: Protect macro arguments by parentheses
 [PATCH 2/5] [NFC] debugedit: Move code to separate functions.
 [PATCH 3/5] debugedit: Implement DWARF-5 unit header and new forms
 [PATCH 4/5] debugedit: Handle DWARF-5 debug_line and debug_line_str.
 [PATCH 5/5] debugedit: Add DWARF5 tests

The first two [NFC] patches are unchanged just have a bit more explanation
in the commit message about what is going on.

The original series contained one patch that was dropped:
- debugedit: Fix handling in caller for errors in called read_dwarf2_line.
It was needed when doing multiple passes of some phases when dealing
with .debug_line, but the new patch handles things by doing each phase
just once (that is the fourth patch).

The original patches:
- debugedit: Implement DWARF-5 .debug_types (in .debug_info).
- debugedit: Implement DWARF-5.
were rewritten and split into the last three patches to have separate
implementations of handling the new unit headers and forms, handling
of the new .debug_line and .debug_line_str and adding new test cases.
This also made the third patch testable independently with older GCC
versions that support -gdwarf-5 but don't yet generate DWARF5 debug
line tables.

One feature of the original patch was dropped, handling of DW_UT_types
in .debug_info, which seemed to complicate the code a bit and wasn't
necessary for the default GCC DWARF5 mode. It shouldn't be that hard
to add that back if needed (although handling the partially linked
variant might be slightly tricky since they require handling COMDAT
.debug_info sections).

The original series added tests based on llvm tooling, which I have
replaced by existing tests based on explicit -gdwarf-4 and -gdwarf-5
tests that should work fine against both older and newer gcc versions
which might have different DWARF version defaults.

Cheers,

Mark

___
Rpm-maint mailing list
Rpm-maint@lists.rpm.org
http://lists.rpm.org/mailman/listinfo/rpm-maint