public inbox for dwz@sourceware.org
 help / color / mirror / Atom feed
From: Tom de Vries <tdevries@suse.de>
To: Mark Wielaard <mark@klomp.org>, Jakub Jelinek <jakub@redhat.com>
Cc: dwz@sourceware.org
Subject: [committed] Add eu-strip/eu-unstrip test-cases
Date: Tue, 01 Jan 2019 00:00:00 -0000	[thread overview]
Message-ID: <4d1f3821-8d5f-8471-cea6-a9ea4d01bdc6@suse.de> (raw)
In-Reply-To: <bug-24249-7128-fjVmrWDsgH@http.sourceware.org/bugzilla/>

[-- Attachment #1: Type: text/plain, Size: 1279 bytes --]

[ was: Re: [Bug default/24249] Section offsets not monotonically
increasing ]

On 22-02-19 14:40, mark at klomp dot org wrote:
> https://sourceware.org/bugzilla/show_bug.cgi?id=24249
> 
> Mark Wielaard <mark at klomp dot org> changed:
> 
>            What    |Removed                     |Added
> ----------------------------------------------------------------------------
>                  CC|                            |mark at klomp dot org
> 
> --- Comment #11 from Mark Wielaard <mark at klomp dot org> ---
> (In reply to Tom de Vries from comment #10)
>> (In reply to Jakub Jelinek from comment #9)
>>> e.g. if we process *.debug files stripped into file
>>> by objcopy or eu-strip, won't this shdr reordering then break the matching
>>> between original binary and *.debug file?
>>
>> Indeed the ordering of entries in the section table in the original binary
>> and the .debug file will not be the same.
>>
>> I'm not aware though of a tool that relies on this ordering to be the same.
> 
> I think eu-unstrip does deal with differences in ordering, but you might want
> to test whether it still works correctly.
> 

I did not know eu-unstrip, thanks for letting me know.

Committed two test-cases using dwz in combination with eu-strip and
eu-unstrip.

Thanks,
- Tom

[-- Attachment #2: 0001-Add-eu-strip-eu-unstrip-test-cases.patch --]
[-- Type: text/x-patch, Size: 1973 bytes --]

Add eu-strip/eu-unstrip test-cases

Add regular and multifile test-cases that:
- use eu-strip to split off the debuginfo into a seperate file,
- dwz the debuginfo, and
- merge the debuginfo back into the original file using eu-unstrip.

2019-03-08  Tom de Vries  <tdevries@suse.de>

	* testsuite/dwz.tests/eu-strip-unstrip-multifile.sh: New test.
	* testsuite/dwz.tests/eu-strip-unstrip.sh: New test.

---
 testsuite/dwz.tests/eu-strip-unstrip-multifile.sh | 26 +++++++++++++++++++++++
 testsuite/dwz.tests/eu-strip-unstrip.sh           | 19 +++++++++++++++++
 2 files changed, 45 insertions(+)

diff --git a/testsuite/dwz.tests/eu-strip-unstrip-multifile.sh b/testsuite/dwz.tests/eu-strip-unstrip-multifile.sh
new file mode 100755
index 0000000..a49666f
--- /dev/null
+++ b/testsuite/dwz.tests/eu-strip-unstrip-multifile.sh
@@ -0,0 +1,26 @@
+#!/bin/sh
+
+set -e
+
+cp ../hello 1
+cp ../hello 2
+
+eu-strip 1 -o 1.stripped -f 1.debug
+eu-strip 2 -o 2.stripped -f 2.debug
+
+dwz -m 3 1.debug 2.debug
+
+eu-unstrip 1.stripped 1.debug -o 1.unstripped
+eu-unstrip 2.stripped 2.debug -o 2.unstripped
+
+smaller-than.sh 1.unstripped 1
+smaller-than.sh 2.unstripped 2
+
+[ $(gnu-debugaltlink-name.sh 1.unstripped) = "3" ]
+[ $(gnu-debugaltlink-name.sh 2.unstripped) = "3" ]
+
+ls=$(ls)
+ls=$(echo $ls)
+[ "$ls" = "1 1.debug 1.stripped 1.unstripped 2 2.debug 2.stripped 2.unstripped 3" ]
+
+rm -f 1 1.debug 1.stripped 1.unstripped 2 2.debug 2.stripped 2.unstripped 3
diff --git a/testsuite/dwz.tests/eu-strip-unstrip.sh b/testsuite/dwz.tests/eu-strip-unstrip.sh
new file mode 100755
index 0000000..9ecb3fe
--- /dev/null
+++ b/testsuite/dwz.tests/eu-strip-unstrip.sh
@@ -0,0 +1,19 @@
+#!/bin/sh
+
+set -e
+
+cp ../hello 1
+
+eu-strip 1 -o 1.stripped -f 1.debug
+
+dwz 1.debug
+
+eu-unstrip 1.stripped 1.debug -o 1.unstripped
+
+smaller-than.sh 1.unstripped 1
+
+ls=$(ls)
+ls=$(echo $ls)
+[ "$ls" = "1 1.debug 1.stripped 1.unstripped" ]
+
+rm -f 1 1.debugged 1.stripped 1.unstripped

           reply	other threads:[~2019-03-08 14:41 UTC|newest]

Thread overview: expand[flat|nested]  mbox.gz  Atom feed
 [parent not found: <bug-24249-7128-fjVmrWDsgH@http.sourceware.org/bugzilla/>]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4d1f3821-8d5f-8471-cea6-a9ea4d01bdc6@suse.de \
    --to=tdevries@suse.de \
    --cc=dwz@sourceware.org \
    --cc=jakub@redhat.com \
    --cc=mark@klomp.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).