[readelf] Fix end_seq entry in -wL. Specifically stop the display of a line number and is_statement/has-view fields for the End of Sequence operator, as these have no meaning.

binutils* dwarf.c (display_debug_lines_decoded): Don't emit meaningless
	information in the end_sequence row.
	* testsuite/binutils-all/dw5.W: Update.
	* testsuite/binutils-all/objdump.WL: Update.

gas	* testsuite/gas/elf/dwarf2-11.d: Update expected output from
	readelf's line table decoding.
	* testsuite/gas/elf/dwarf2-12.d: Likewise.
	* testsuite/gas/elf/dwarf2-13.d: Likewise.
	* testsuite/gas/elf/dwarf2-14.d: Likewise.
	* testsuite/gas/elf/dwarf2-15.d: Likewise.
	* testsuite/gas/elf/dwarf2-16.d: Likewise.
	* testsuite/gas/elf/dwarf2-17.d: Likewise.
	* testsuite/gas/elf/dwarf2-18.d: Likewise.
	* testsuite/gas/elf/dwarf2-19.d: Likewise.
	* testsuite/gas/elf/dwarf2-5.d: Likewise.
	* testsuite/gas/elf/dwarf2-6.d: Likewise.
	* testsuite/gas/elf/dwarf2-7.d: Likewise.
This commit is contained in:
Tom de Vries
2020-07-10 11:25:44 +01:00
committed by Nick Clifton
parent d882c98893
commit af2b318648
17 changed files with 95 additions and 35 deletions

View File

@ -1,3 +1,10 @@
2020-07-10 Tom de Vries <tdevries@suse.de>
* dwarf.c (display_debug_lines_decoded): Don't emit meaningless
information in the end_sequence row.
* testsuite/binutils-all/dw5.W: Update.
* testsuite/binutils-all/objdump.WL: Update.
2020-07-09 Alan Modra <amodra@gmail.com>
* dlltool.c: Remove powerpc PE support and comments.

View File

@ -4988,38 +4988,75 @@ display_debug_lines_decoded (struct dwarf_section * section,
strncpy (newFileName, fileName, fileNameLength + 1);
}
/* A row with end_seq set to true has a meaningful address, but
the other information in the same row is not significant.
In such a row, print line as "-", and don't print
view/is_stmt. */
if (!do_wide || (fileNameLength <= MAX_FILENAME_LENGTH))
{
if (linfo.li_max_ops_per_insn == 1)
printf ("%-35s %11d %#18" DWARF_VMA_FMT "x",
newFileName, state_machine_regs.line,
state_machine_regs.address);
{
if (xop == -DW_LNE_end_sequence)
printf ("%-35s %11s %#18" DWARF_VMA_FMT "x",
newFileName, "-",
state_machine_regs.address);
else
printf ("%-35s %11d %#18" DWARF_VMA_FMT "x",
newFileName, state_machine_regs.line,
state_machine_regs.address);
}
else
printf ("%-35s %11d %#18" DWARF_VMA_FMT "x[%d]",
newFileName, state_machine_regs.line,
state_machine_regs.address,
state_machine_regs.op_index);
{
if (xop == -DW_LNE_end_sequence)
printf ("%-35s %11s %#18" DWARF_VMA_FMT "x[%d]",
newFileName, "-",
state_machine_regs.address,
state_machine_regs.op_index);
else
printf ("%-35s %11d %#18" DWARF_VMA_FMT "x[%d]",
newFileName, state_machine_regs.line,
state_machine_regs.address,
state_machine_regs.op_index);
}
}
else
{
if (linfo.li_max_ops_per_insn == 1)
printf ("%s %11d %#18" DWARF_VMA_FMT "x",
newFileName, state_machine_regs.line,
state_machine_regs.address);
{
if (xop == -DW_LNE_end_sequence)
printf ("%s %11s %#18" DWARF_VMA_FMT "x",
newFileName, "-",
state_machine_regs.address);
else
printf ("%s %11d %#18" DWARF_VMA_FMT "x",
newFileName, state_machine_regs.line,
state_machine_regs.address);
}
else
printf ("%s %11d %#18" DWARF_VMA_FMT "x[%d]",
newFileName, state_machine_regs.line,
state_machine_regs.address,
state_machine_regs.op_index);
{
if (xop == -DW_LNE_end_sequence)
printf ("%s %11s %#18" DWARF_VMA_FMT "x[%d]",
newFileName, "-",
state_machine_regs.address,
state_machine_regs.op_index);
else
printf ("%s %11d %#18" DWARF_VMA_FMT "x[%d]",
newFileName, state_machine_regs.line,
state_machine_regs.address,
state_machine_regs.op_index);
}
}
if (state_machine_regs.view)
printf (" %6u", state_machine_regs.view);
else
printf (" ");
if (xop != -DW_LNE_end_sequence)
{
if (state_machine_regs.view)
printf (" %6u", state_machine_regs.view);
else
printf (" ");
if (state_machine_regs.is_stmt)
printf (" x");
if (state_machine_regs.is_stmt)
printf (" x");
}
putchar ('\n');
state_machine_regs.view++;

View File

@ -350,10 +350,10 @@ CU: ./main.c:
File name Line number Starting address View Stmt
main.c 6 0x1234 x
main.c 6 0x12346 x
main.c 6 0x1234 x
main.c - 0x1234
main.c 5 0x1234 x
main.c 5 0x1234 x
main.c 5 0x1234 x
main.c - 0x1234

View File

@ -12,5 +12,5 @@ file1\.c 1 .*
\./dw2-decodedline\.c:\[\+\+\]
dw2-decodedline\.c 2 .*
dw2-decodedline\.c 2 .*
dw2-decodedline\.c - .*

View File

@ -1,3 +1,19 @@
2020-07-10 Tom de Vries <tdevries@suse.de>
* testsuite/gas/elf/dwarf2-11.d: Update expected output from
readelf's line table decoding.
* testsuite/gas/elf/dwarf2-12.d: Likewise.
* testsuite/gas/elf/dwarf2-13.d: Likewise.
* testsuite/gas/elf/dwarf2-14.d: Likewise.
* testsuite/gas/elf/dwarf2-15.d: Likewise.
* testsuite/gas/elf/dwarf2-16.d: Likewise.
* testsuite/gas/elf/dwarf2-17.d: Likewise.
* testsuite/gas/elf/dwarf2-18.d: Likewise.
* testsuite/gas/elf/dwarf2-19.d: Likewise.
* testsuite/gas/elf/dwarf2-5.d: Likewise.
* testsuite/gas/elf/dwarf2-6.d: Likewise.
* testsuite/gas/elf/dwarf2-7.d: Likewise.
2020-07-09 H.J. Lu <hongjiu.lu@intel.com>
* config/tc-i386.c (output_insn): Set YMM/ZMM features for

View File

@ -11,4 +11,4 @@ CU: dwarf2-11\.c:
File name +Line number +Starting address +View +Stmt
dwarf2-11\.c +1 +0x8 +x
dwarf2-11\.c +2 +0x10 +x
dwarf2-11\.c +2 +0x10 +1 +x
dwarf2-11\.c +- +0x10

View File

@ -15,4 +15,4 @@ File name +Line number +Starting address +View +Stmt
dwarf2-12\.c +1 +0 +x
dwarf2-12\.c +2 +0 +x
dwarf2-12\.c +3 +0 +1 +x
dwarf2-12\.c +3 +0x8 +x
dwarf2-12\.c +- +0x8

View File

@ -15,4 +15,4 @@ File name +Line number +Starting address +View +Stmt
dwarf2-13\.c +1 +0x8 +x
dwarf2-13\.c +2 +0x10 +x
dwarf2-13\.c +3 +0x10 +1 +x
dwarf2-13\.c +3 +0x18 +x
dwarf2-13\.c +- +0x18

View File

@ -15,4 +15,4 @@ File name +Line number +Starting address +View +Stmt
dwarf2-14\.c +1 +0 +x
dwarf2-14\.c +2 +0 +x
dwarf2-14\.c +3 +0 +1 +x
dwarf2-14\.c +3 +0x8 +x
dwarf2-14\.c +- +0x8

View File

@ -15,4 +15,4 @@ File name +Line number +Starting address +View +Stmt
dwarf2-15\.c +1 +0 +x
dwarf2-15\.c +2 +0x8 +x
dwarf2-15\.c +3 +0x8 +1 +x
dwarf2-15\.c +3 +0x10 +x
dwarf2-15\.c +- +0x10

View File

@ -16,4 +16,4 @@ File name +Line number +Starting address +View +Stmt
dwarf2-16\.c +1 +0 +x
dwarf2-16\.c +2 +0x8 +x
dwarf2-16\.c +3 +0x8 +1 +x
dwarf2-16\.c +3 +0x10 +x
dwarf2-16\.c +- +0x10

View File

@ -16,4 +16,4 @@ File name +Line number +Starting address +View +Stmt
dwarf2-17\.c +1 +0 +x
dwarf2-17\.c +2 +0x8 +x
dwarf2-17\.c +3 +0x10 +x
dwarf2-17\.c +3 +0x18 +x
dwarf2-17\.c +- +0x18

View File

@ -16,4 +16,4 @@ File name +Line number +Starting address +View +Stmt
dwarf2-18\.c +1 +0 +x
dwarf2-18\.c +2 +0 +1 +x
dwarf2-18\.c +3 +0x8 +x
dwarf2-18\.c +3 +0x10 +x
dwarf2-18\.c +- +0x10

View File

@ -18,4 +18,4 @@ dwarf2-19\.c +2 +0 +1 +x
dwarf2-19\.c +4 +0x8 +x
dwarf2-19\.c +5 +0x8 +1 +x
dwarf2-19\.c +3 +0x8 +2 +x
dwarf2-19\.c +3 +0x8 +3 +x
dwarf2-19\.c +- +0x8

View File

@ -75,4 +75,4 @@ dwarf2-5\.c +9 +0x20 +x
dwarf2-5\.c +10 +0x20 +1 +x
dwarf2-5\.c +11 +0x20 +2 +x
dwarf2-5\.c +12 +0x20 +3 +x
dwarf2-5\.c +12 +0x28 +x
dwarf2-5\.c +- +0x28

View File

@ -75,4 +75,4 @@ dwarf2-6\.c *2 *0x3 *2 +x
dwarf2-6\.c *3 *0x4 +x
dwarf2-6\.c *3 *0x4 *1 +x
dwarf2-6\.c *3 *0xf3 +x
dwarf2-6\.c *3 *0x100 +x
dwarf2-6\.c *- *0x100

View File

@ -15,4 +15,4 @@ File name +Line number +Starting address +View +Stmt
dwarf2-7\.c +1 +0 +x
dwarf2-7\.c +2 +0 +x
dwarf2-7\.c +3 +0 +1 +x
dwarf2-7\.c +3 +0x8 +x
dwarf2-7\.c +- +0x8