<p>Forwarded from rpm-maint <a rel="nofollow" href="http://lists.rpm.org/pipermail/rpm-maint/2019-June/010344.html">http://lists.rpm.org/pipermail/rpm-maint/2019-June/010344.html</a>:</p>
<p>Hi,</p>
<p>debugedit wouldn't properly handle gcc -g3 which generates .debug_macro<br>
sections. The sections would contain references to .debug_str which<br>
debugedit rewrites. But it would not update the references in .debug_macro<br>
which would upset various tools.  For example gdb:<br>
<a rel="nofollow" href="https://bugzilla.redhat.com/show_bug.cgi?id=1535174">https://bugzilla.redhat.com/show_bug.cgi?id=1535174</a></p>
<p>Michael Schroeder had a patch for that, but that didn't handle relocations<br>
(which happen in e.g. linux kernel modules). So I added support for that.<br>
(patch four).</p>
<p>debugedit didn't have any specific tests. It was only tested as part of<br>
the whole rpmbuild debuginfo pipeline. So I first added a bunch of test<br>
cases (the first two patches). That helped make sure my debugedit relocation<br>
code refactoring was working as expected (the third patches).</p>
<p>It also found an small issue (under valgrind) with the .debug_line<br>
rewriting code (the last patch).</p>
<p>[PATCH 1/5] Add some color to the tests if available and the terminal<br>
[PATCH 2/5] Add some debugedit tests.<br>
[PATCH 3/5] debugedit: Refactor reading/writing of relocated values.<br>
[PATCH 4/5] Handle .debug_macro in debugedit.<br>
[PATCH 5/5] debugedit: Make sure .debug_line old/new idx start equal.</p>
<p>Cheers,</p>
<p>Mark</p>

<hr>

<h4>You can view, comment on, or merge this pull request online at:</h4>
<p>  <a href='https://github.com/rpm-software-management/rpm/pull/754'>https://github.com/rpm-software-management/rpm/pull/754</a></p>

<h4>Commit Summary</h4>
<ul>
  <li>Add some color to the tests if available and the terminal supports it.</li>
  <li>Add some debugedit tests.</li>
  <li>debugedit: Refactor reading/writing of relocated values.</li>
  <li>Handle .debug_macro in debugedit.</li>
  <li>debugedit: Make sure .debug_line old/new idx start equal.</li>
</ul>

<h4>File Changes</h4>
<ul>
  <li>
    <strong>M</strong>
    <a href="https://github.com/rpm-software-management/rpm/pull/754/files#diff-0">tests/Makefile.am</a>
    (9)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/rpm-software-management/rpm/pull/754/files#diff-1">tests/atlocal.in</a>
    (2)
  </li>
  <li>
    <strong>A</strong>
    <a href="https://github.com/rpm-software-management/rpm/pull/754/files#diff-2">tests/data/SOURCES/bar.c</a>
    (9)
  </li>
  <li>
    <strong>A</strong>
    <a href="https://github.com/rpm-software-management/rpm/pull/754/files#diff-3">tests/data/SOURCES/baz.c</a>
    (10)
  </li>
  <li>
    <strong>A</strong>
    <a href="https://github.com/rpm-software-management/rpm/pull/754/files#diff-4">tests/data/SOURCES/foo.c</a>
    (7)
  </li>
  <li>
    <strong>A</strong>
    <a href="https://github.com/rpm-software-management/rpm/pull/754/files#diff-5">tests/data/SOURCES/foobar.h</a>
    (6)
  </li>
  <li>
    <strong>A</strong>
    <a href="https://github.com/rpm-software-management/rpm/pull/754/files#diff-6">tests/data/SPECS/hello-g3.spec</a>
    (60)
  </li>
  <li>
    <strong>A</strong>
    <a href="https://github.com/rpm-software-management/rpm/pull/754/files#diff-7">tests/debugedit.at</a>
    (393)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/rpm-software-management/rpm/pull/754/files#diff-8">tests/local.at</a>
    (3)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/rpm-software-management/rpm/pull/754/files#diff-9">tests/rpmbuild.at</a>
    (33)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/rpm-software-management/rpm/pull/754/files#diff-10">tests/rpmtests.at</a>
    (1)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/rpm-software-management/rpm/pull/754/files#diff-11">tools/debugedit.c</a>
    (594)
  </li>
</ul>

<h4>Patch Links:</h4>
<ul>
  <li><a href='https://github.com/rpm-software-management/rpm/pull/754.patch'>https://github.com/rpm-software-management/rpm/pull/754.patch</a></li>
  <li><a href='https://github.com/rpm-software-management/rpm/pull/754.diff'>https://github.com/rpm-software-management/rpm/pull/754.diff</a></li>
</ul>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />You are receiving this because you are subscribed to this thread.<br />Reply to this email directly, <a href="https://github.com/rpm-software-management/rpm/pull/754?email_source=notifications&email_token=ADLPZU5VDGE7V3GTBE5LN73P3HTCHA5CNFSM4HZHAEPKYY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4G2KQXSQ">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/ADLPZUY5LYNOCW76VYP7FBDP3HTCHANCNFSM4HZHAEPA">mute the thread</a>.<img src="https://github.com/notifications/beacon/ADLPZUY2NYTXVSC4KG62PELP3HTCHA5CNFSM4HZHAEPKYY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4G2KQXSQ.gif" height="1" width="1" alt="" /></p>
<script type="application/ld+json">[
{
"@context": "http://schema.org",
"@type": "EmailMessage",
"potentialAction": {
"@type": "ViewAction",
"target": "https://github.com/rpm-software-management/rpm/pull/754?email_source=notifications\u0026email_token=ADLPZU5VDGE7V3GTBE5LN73P3HTCHA5CNFSM4HZHAEPKYY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4G2KQXSQ",
"url": "https://github.com/rpm-software-management/rpm/pull/754?email_source=notifications\u0026email_token=ADLPZU5VDGE7V3GTBE5LN73P3HTCHA5CNFSM4HZHAEPKYY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4G2KQXSQ",
"name": "View Pull Request"
},
"description": "View this Pull Request on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>