public inbox for debugedit@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] Only process one file at a time in tests with binutils readelf
@ 2024-05-15 21:48 Mark Wielaard
  2024-05-19 23:31 ` Mark Wielaard
  0 siblings, 1 reply; 2+ messages in thread
From: Mark Wielaard @ 2024-05-15 21:48 UTC (permalink / raw)
  To: debugedit; +Cc: Mark Wielaard

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


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] Only process one file at a time in tests with binutils readelf
  2024-05-15 21:48 [PATCH] Only process one file at a time in tests with binutils readelf Mark Wielaard
@ 2024-05-19 23:31 ` Mark Wielaard
  0 siblings, 0 replies; 2+ messages in thread
From: Mark Wielaard @ 2024-05-19 23:31 UTC (permalink / raw)
  To: debugedit

Hi,

On Wed, May 15, 2024 at 11:48:20PM +0200, Mark Wielaard wrote:
> 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.

Pushed to main.

Cheers,

Mark

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2024-05-19 23:31 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-05-15 21:48 [PATCH] Only process one file at a time in tests with binutils readelf Mark Wielaard
2024-05-19 23:31 ` Mark Wielaard

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).