From: Mark Wielaard <mark@klomp.org>
To: debugedit@sourceware.org
Cc: Mark Wielaard <mark@klomp.org>
Subject: [PATCH] Only process one file at a time in tests with binutils readelf
Date: Wed, 15 May 2024 23:48:20 +0200 [thread overview]
Message-ID: <20240515214820.1125747-1-mark@klomp.org> (raw)
Processing multiple files in one run with binutils readelf seems to
cause (extra) errors when there is an issue with one of the files.
Invoking readelf on one file at a time makes is slightly easier to
analyze test failures.
Signed-off-by: Mark Wielaard <mark@klomp.org>
---
tests/debugedit.at | 42 ++++++++++++++++++++++++++++++++----------
1 file changed, 32 insertions(+), 10 deletions(-)
diff --git a/tests/debugedit.at b/tests/debugedit.at
index 90e8ed36f335..4413704acc0b 100644
--- a/tests/debugedit.at
+++ b/tests/debugedit.at
@@ -93,7 +93,10 @@ DEBUGEDIT_SETUP([-gdwarf-4])
# Capture strings that start with the testdir (pwd) directory path
# (and replace that textually with /foo/bar/baz)
-$READELF -p.debug_str foo.o subdir_bar/bar.o baz.o | cut -c13- \
+($READELF -p.debug_str foo.o; \
+ $READELF -p.debug_str subdir_bar/bar.o; \
+ $READELF -p.debug_str baz.o) \
+ | cut -c13- \
| grep ^$(pwd) | sort \
| sed -e "s@$(pwd)@/foo/bar/baz@" > expout
@@ -108,7 +111,10 @@ AT_CHECK([[debugedit -b $(pwd) -d /foo/bar/baz ./foo.o]])
AT_CHECK([[debugedit -b $(pwd) -d /foo/bar/baz ./subdir_bar/bar.o]])
AT_CHECK([[debugedit -b $(pwd) -d /foo/bar/baz ./baz.o]])
AT_CHECK([[
-$READELF -p.debug_str foo.o subdir_bar/bar.o baz.o | cut -c13- \
+($READELF -p.debug_str foo.o; \
+ $READELF -p.debug_str subdir_bar/bar.o; \
+ $READELF -p.debug_str baz.o) \
+ | cut -c13- \
| grep ^/foo/bar/baz | sort
]],[0],[expout])
@@ -125,7 +131,9 @@ DEBUGEDIT_SETUP([-gdwarf-5])
# Capture strings that start with the testdir (pwd) directory path
# (and replace that textually with /foo/bar/baz)
-$READELF -p.debug_str -p.debug_line_str foo.o subdir_bar/bar.o baz.o \
+($READELF -p.debug_str -p.debug_line_str foo.o; \
+ $READELF -p.debug_str -p.debug_line_str subdir_bar/bar.o; \
+ $READELF -p.debug_str -p.debug_line_str baz.o) \
| cut -c13- \
| grep ^$(pwd) | sort | uniq \
| sed -e "s@$(pwd)@/foo/bar/baz@" > expout
@@ -141,7 +149,9 @@ AT_CHECK([[debugedit -b $(pwd) -d /foo/bar/baz ./foo.o]])
AT_CHECK([[debugedit -b $(pwd) -d /foo/bar/baz ./subdir_bar/bar.o]])
AT_CHECK([[debugedit -b $(pwd) -d /foo/bar/baz ./baz.o]])
AT_CHECK([[
-$READELF -p.debug_str -p.debug_line_str foo.o subdir_bar/bar.o baz.o \
+($READELF -p.debug_str -p.debug_line_str foo.o; \
+ $READELF -p.debug_str -p.debug_line_str subdir_bar/bar.o; \
+ $READELF -p.debug_str -p.debug_line_str baz.o) \
| cut -c13- \
| grep ^/foo/bar/baz | sort | uniq
]],[0],[expout],[ignore])
@@ -305,7 +315,9 @@ AT_CHECK([[debugedit -b $(pwd) -d /foo/bar/baz ./foo.o]])
AT_CHECK([[debugedit -b $(pwd) -d /foo/bar/baz ./subdir_bar/bar.o]])
AT_CHECK([[debugedit -b $(pwd) -d /foo/bar/baz ./baz.o]])
AT_CHECK([[
-$READELF --debug-dump=info foo.o subdir_bar/bar.o baz.o \
+($READELF --debug-dump=info foo.o; \
+ $READELF --debug-dump=info subdir_bar/bar.o; \
+ $READELF --debug-dump=info baz.o) \
| grep -E 'DW_AT_(name|comp_dir)' \
| rev | cut -d: -f1 | rev | cut -c2- | grep ^/foo/bar/baz | sort -u
]],[0],[expout])
@@ -468,7 +480,9 @@ AT_SETUP([debugedit .debug_line objects DWARF4])
AT_KEYWORDS([debuginfo] [debugedit])
DEBUGEDIT_SETUP([-gdwarf-4])
-$READELF --debug-dump=line foo.o subdir_bar/bar.o baz.o \
+($READELF --debug-dump=line foo.o; \
+ $READELF --debug-dump=line subdir_bar/bar.o; \
+ $READELF --debug-dump=line baz.o) \
| grep -E -A5 "The (Directory|File Name) Table" \
| grep "^ [[1234]]" \
| sed -e "s@$(pwd)@/foo/bar/baz@" | tee expout
@@ -477,7 +491,9 @@ AT_CHECK([[debugedit -b $(pwd) -d /foo/bar/baz ./foo.o]])
AT_CHECK([[debugedit -b $(pwd) -d /foo/bar/baz ./subdir_bar/bar.o]])
AT_CHECK([[debugedit -b $(pwd) -d /foo/bar/baz ./baz.o]])
AT_CHECK([[
-$READELF --debug-dump=line foo.o subdir_bar/bar.o baz.o \
+($READELF --debug-dump=line foo.o; \
+ $READELF --debug-dump=line subdir_bar/bar.o; \
+ $READELF --debug-dump=line baz.o) \
| grep -E -A5 "The (Directory|File Name) Table" | grep "^ [1234]"
]],[0],[expout])
@@ -493,7 +509,9 @@ AT_SKIP_IF([test "$GDWARF_5_FLAG" = "no"])
AT_SKIP_IF([test "$DWARF_5_DEBUGLINE" = "no"])
DEBUGEDIT_SETUP([-gdwarf-5])
-$READELF --debug-dump=line foo.o subdir_bar/bar.o baz.o \
+($READELF --debug-dump=line foo.o; \
+ $READELF --debug-dump=line subdir_bar/bar.o; \
+ $READELF --debug-dump=line baz.o) \
| grep -E -A5 "The (Directory|File Name) Table" \
| grep "^ [[01234]]" | cut -f3 -d: \
| sed -e "s@$(pwd)@/foo/bar/baz@" | tee expout
@@ -502,7 +520,9 @@ AT_CHECK([[debugedit -b $(pwd) -d /foo/bar/baz ./foo.o]])
AT_CHECK([[debugedit -b $(pwd) -d /foo/bar/baz ./subdir_bar/bar.o]])
AT_CHECK([[debugedit -b $(pwd) -d /foo/bar/baz ./baz.o]])
AT_CHECK([[
-$READELF --debug-dump=line foo.o subdir_bar/bar.o baz.o \
+($READELF --debug-dump=line foo.o; \
+ $READELF --debug-dump=line subdir_bar/bar.o; \
+ $READELF --debug-dump=line baz.o) \
| grep -E -A5 "The (Directory|File Name) Table" \
| grep "^ [01234]" | cut -f3 -d:
]],[0],[expout])
@@ -620,7 +640,9 @@ AT_CHECK([[debugedit -b $(pwd) -d /foo/bar/baz ./foo.o]])
AT_CHECK([[debugedit -b $(pwd) -d /foo/bar/baz ./subdir_bar/bar.o]])
AT_CHECK([[debugedit -b $(pwd) -d /foo/bar/baz ./baz.o]])
AT_CHECK([[
-$READELF --debug-dump=macro foo.o subdir_bar/bar.o baz.o \
+($READELF --debug-dump=macro foo.o; \
+ $READELF --debug-dump=macro subdir_bar/bar.o; \
+ $READELF --debug-dump=macro baz.o) \
| grep NUMBER | rev | cut -d: -f1 | rev | cut -c2-
]],[0],[expout])
--
2.39.3
next reply other threads:[~2024-05-15 21:48 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-05-15 21:48 Mark Wielaard [this message]
2024-05-19 23:31 ` Mark Wielaard
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=20240515214820.1125747-1-mark@klomp.org \
--to=mark@klomp.org \
--cc=debugedit@sourceware.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).