Committed: gas/testsuite/ld-elf/dwarf2-21.d: Pass -W (was: dwarf2 sub-section test)

Message ID 20210924214736.AD43D203CB@pchp3.se.axis.com
State New
Headers show
Series
  • Committed: gas/testsuite/ld-elf/dwarf2-21.d: Pass -W (was: dwarf2 sub-section test)
Related show

Commit Message

Alan Modra via Binutils Sept. 24, 2021, 9:47 p.m.
> From: Alan Modra via Binutils <binutils@sourceware.org>

> Date: Wed, 22 Sep 2021 03:02:27 +0200


> diff --git a/gas/testsuite/gas/elf/dwarf2-21.d b/gas/testsuite/gas/elf/dwarf2-21.d

> new file mode 100644

> index 00000000000..16fa317be66

> --- /dev/null

> +++ b/gas/testsuite/gas/elf/dwarf2-21.d

> @@ -0,0 +1,18 @@

> +#name: DWARF2 21

> +#as: -gdwarf-2

> +#readelf: -wL

...
> +CU: (.*/elf/dwarf2-21|tmpdir/asm)\.s:


You (or perhaps I, running my autotester using a long-enough
source-path, where this test fails) got bitten by readelf
non-wide default re. "CU:" output.  The same thing happened
to H.J. 2020-12-02; see referred commit and back-and-forth
email traffic at the time.

Now, can we drop the readelf non-"-W" functionality
completely?  People can just truncate the output manually.
("Script compatibility" you say?  They should be using -W!)

Or at least just make -W the default?

Or at least drop the quoted "|| strlen (directory) < 76"
conditional in binutils/dwarf.c?


The following was committed as obvious.
-----------
Required for the expected "CU:" to be emitted for long
source-paths.  See binutils/dwarf.c:

 if (do_wide || strlen (directory) < 76)
   printf (_("CU: %s/%s:\n"), directory, file_table[0].name);
 else
   printf ("%s:\n", file_table[0].name);

See also commit 5f410aa50ce2c, "testsuite/ld-elf/pr26936.d:
Pass -W."

gas/ChangeLog:
	* testsuite/ld-elf/dwarf2-21.d: Pass -W.
---
 gas/testsuite/gas/elf/dwarf2-21.d | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

-- 
2.11.0

brgds, H-P

Comments

Alan Modra via Binutils Sept. 25, 2021, 1:20 a.m. | #1
On Fri, Sep 24, 2021 at 11:47:36PM +0200, Hans-Peter Nilsson wrote:
> Or at least just make -W the default?


Changing readelf output often requires quite a bit of editing in our
testsuites.  If you're willing to do the work, and brave enough to
take any flak, I'll OK a patch.

> Or at least drop the quoted "|| strlen (directory) < 76"

> conditional in binutils/dwarf.c?


I'll even preapprove this one.

> The following was committed as obvious.

> -----------

> Required for the expected "CU:" to be emitted for long

> source-paths.  See binutils/dwarf.c:


Thanks for that.

-- 
Alan Modra
Australia Development Lab, IBM

Patch

diff --git a/gas/testsuite/gas/elf/dwarf2-21.d b/gas/testsuite/gas/elf/dwarf2-21.d
index 16fa317be664..66cd5a95ad13 100644
--- a/gas/testsuite/gas/elf/dwarf2-21.d
+++ b/gas/testsuite/gas/elf/dwarf2-21.d
@@ -1,6 +1,6 @@ 
 #name: DWARF2 21
 #as: -gdwarf-2
-#readelf: -wL
+#readelf: -wL -W
 # Note that non-zero view numbers are allowed here.  This doesn't really
 # make much sense, but DW_LNS_fixed_advance_pc is defined to not set the
 # view back to zero in contrast with all other changes in PC.  A number