public inbox for debugedit@sourceware.org
 help / color / mirror / Atom feed
From: Mark Wielaard <mark@klomp.org>
To: debugedit@sourceware.org
Cc: Mark Wielaard <mark@klomp.org>
Subject: [PATCH] tests: Handle zero directory entry in .debug_line DWARF5 debugedit.at
Date: Fri, 30 Jul 2021 18:33:11 +0200	[thread overview]
Message-ID: <20210730163311.6147-1-mark@klomp.org> (raw)

We were skipping the zero directory entry, because it was always
the same as the directory entry at position one. But that isn't
true anymore with gcc 11.2.1. There the zero dir entry is unique.
Fix the debugedit.at .debug_line testcases using DWARF5 to also
include dir entry zero.

Signed-off-by: Mark Wielaard <mark@klomp.org>
---
 tests/debugedit.at | 15 +++++++++------
 1 file changed, 9 insertions(+), 6 deletions(-)

diff --git a/tests/debugedit.at b/tests/debugedit.at
index 608b1d0..f9b50f7 100644
--- a/tests/debugedit.at
+++ b/tests/debugedit.at
@@ -492,6 +492,7 @@ DEBUGEDIT_SETUP([-gdwarf-5])
 
 AT_DATA([expout],
 [foo/bar/baz
+foo/bar/baz/subdir_bar
 foo/bar/baz/subdir_headers
 ])
 
@@ -500,8 +501,8 @@ 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 \
-        | grep -A5 "The Directory Table" | grep "^  [123]" \
-	| cut -f2- -d/ | grep ^foo/ | sort
+        | grep -A5 "The Directory Table" | grep "^  [0123]" \
+	| cut -f2- -d/ | grep ^foo/ | sort | uniq
 ]],[0],[expout])
 
 AT_CLEANUP
@@ -539,14 +540,15 @@ DEBUGEDIT_SETUP([-gdwarf-5])
 
 AT_DATA([expout],
 [foo/bar/baz
+foo/bar/baz/subdir_bar
 foo/bar/baz/subdir_headers
 ])
 
 AT_CHECK([[debugedit -b $(pwd) -d /foo/bar/baz ./foobarbaz.part.o]])
 AT_CHECK([[
 readelf --debug-dump=line ./foobarbaz.part.o \
-        | grep -A5 "The Directory Table" | grep "^  [123]" \
-	| cut -f2- -d/ | grep ^foo/ | sort
+        | grep -A5 "The Directory Table" | grep "^  [0123]" \
+	| cut -f2- -d/ | grep ^foo/ | sort | uniq
 ]],[0],[expout])
 
 AT_CLEANUP
@@ -584,14 +586,15 @@ DEBUGEDIT_SETUP([-gdwarf-5])
 
 AT_DATA([expout],
 [foo/bar/baz
+foo/bar/baz/subdir_bar
 foo/bar/baz/subdir_headers
 ])
 
 AT_CHECK([[debugedit -b $(pwd) -d /foo/bar/baz ./foobarbaz.exe]])
 AT_CHECK([[
 readelf --debug-dump=line ./foobarbaz.exe \
-        | grep -A5 "The Directory Table" | grep "^  [123]" \
-	| cut -f2- -d/ | grep ^foo/ | sort
+        | grep -A5 "The Directory Table" | grep "^  [0123]" \
+	| cut -f2- -d/ | grep ^foo/ | sort | uniq
 ]],[0],[expout])
 
 AT_CLEANUP
-- 
2.18.4


             reply	other threads:[~2021-07-30 16:33 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-30 16:33 Mark Wielaard [this message]
2021-08-02 22:42 ` [PATCHv2] " 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=20210730163311.6147-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).