summaryrefslogtreecommitdiff
path: root/binutils
diff options
context:
space:
mode:
authorNick Clifton <nickc@redhat.com>2023-03-14 12:21:13 +0000
committerNick Clifton <nickc@redhat.com>2023-03-14 12:21:13 +0000
commit7506fc9bf1fef7904a213c89a2df915e652ed3b9 (patch)
tree7cf7a0f4d61f768886480274cdcf00b5db6b329a /binutils
parent2dd1c6e88aaef613ec07e6dac86e7c9e6e06d1cb (diff)
downloadbinutils-gdb-7506fc9bf1fef7904a213c89a2df915e652ed3b9.tar.gz
Adjust the decoded line output to fit into 80 columns.
PR 30216 * dwarf.c (display_debug_lines_decoded): Reduce space for filenames. * testsuite/binutils-all/dw5.W: Adjust expected output. * testsuite/binutils-all/objdump.WL: Adjust expected output.
Diffstat (limited to 'binutils')
-rw-r--r--binutils/dwarf.c15
-rw-r--r--binutils/testsuite/binutils-all/dw5.W14
-rw-r--r--binutils/testsuite/binutils-all/objdump.WL8
3 files changed, 21 insertions, 16 deletions
diff --git a/binutils/dwarf.c b/binutils/dwarf.c
index 281a055a6d5..a4799f0198c 100644
--- a/binutils/dwarf.c
+++ b/binutils/dwarf.c
@@ -5246,7 +5246,12 @@ display_debug_lines_decoded (struct dwarf_section * section,
}
if (n_files > 0)
- printf (_("File name Line number Starting address View Stmt\n"));
+ {
+ if (do_wide)
+ printf (_("File name Line number Starting address View Stmt\n"));
+ else
+ printf (_("File name Line number Starting address View Stmt\n"));
+ }
else
printf (_("CU: Empty file name table\n"));
saved_linfo = linfo;
@@ -5572,23 +5577,23 @@ display_debug_lines_decoded (struct dwarf_section * section,
if (linfo.li_max_ops_per_insn == 1)
{
if (xop == -DW_LNE_end_sequence)
- printf ("%-35s %11s %#18" PRIx64,
+ printf ("%-31s %11s %#18" PRIx64,
newFileName, "-",
state_machine_regs.address);
else
- printf ("%-35s %11d %#18" PRIx64,
+ printf ("%-31s %11d %#18" PRIx64,
newFileName, state_machine_regs.line,
state_machine_regs.address);
}
else
{
if (xop == -DW_LNE_end_sequence)
- printf ("%-35s %11s %#18" PRIx64 "[%d]",
+ printf ("%-31s %11s %#18" PRIx64 "[%d]",
newFileName, "-",
state_machine_regs.address,
state_machine_regs.op_index);
else
- printf ("%-35s %11d %#18" PRIx64 "[%d]",
+ printf ("%-31s %11d %#18" PRIx64 "[%d]",
newFileName, state_machine_regs.line,
state_machine_regs.address,
state_machine_regs.op_index);
diff --git a/binutils/testsuite/binutils-all/dw5.W b/binutils/testsuite/binutils-all/dw5.W
index ff54134f29e..0058b850bae 100644
--- a/binutils/testsuite/binutils-all/dw5.W
+++ b/binutils/testsuite/binutils-all/dw5.W
@@ -348,13 +348,13 @@ Raw dump of debug contents of section .debug_line:
Contents of the .debug_line section:
main.c:
-File name Line number Starting address View Stmt
-main.c 6 0x1234 x
-main.c 6 0x12346 x
-main.c - 0x1234
+File name[ ]+Line number[ ]+Starting address[ ]+View[ ]+Stmt
+main.c[ ]+6[ ]+0x1234[ ]+x
+main.c[ ]+6[ ]+0x12346[ ]+x
+main.c[ ]+-[ ]+0x1234
-main.c 5 0x1234 x
-main.c 5 0x1234 x
-main.c - 0x1234
+main.c[ ]+5[ ]+0x1234[ ]+x
+main.c[ ]+5[ ]+0x1234[ ]+x
+main.c[ ]+-[ ]+0x1234
diff --git a/binutils/testsuite/binutils-all/objdump.WL b/binutils/testsuite/binutils-all/objdump.WL
index f02a9e63839..c52accc7a5c 100644
--- a/binutils/testsuite/binutils-all/objdump.WL
+++ b/binutils/testsuite/binutils-all/objdump.WL
@@ -4,13 +4,13 @@
Contents of the \.debug_line section:
dw2-decodedline\.c:
-File name Line number Starting address View Stmt
+File name[ ]+Line number[ ]+Starting address[ ]+View[ ]+Stmt
directory/file1\.c:
-file1\.c 1 .*
+file1\.c[ ]+1 .*
\./dw2-decodedline\.c:\[\+\+\]
-dw2-decodedline\.c 2 .*
-dw2-decodedline\.c - .*
+dw2-decodedline\.c[ ]+2 .*
+dw2-decodedline\.c[ ]+- .*