Adjust the decoded line output to fit into 80 columns.
authorNick Clifton <nickc@redhat.com>
Tue, 14 Mar 2023 12:21:13 +0000 (12:21 +0000)
committerNick Clifton <nickc@redhat.com>
Tue, 14 Mar 2023 12:21:13 +0000 (12:21 +0000)
  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.

binutils/dwarf.c
binutils/testsuite/binutils-all/dw5.W
binutils/testsuite/binutils-all/objdump.WL

index 281a055a6d586181bbec7e5bed0b8bfacdb248ff..a4799f0198c1ba6bdfaae28a2db88d1c2a6e4284 100644 (file)
@@ -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);
index ff54134f29ecb142da0ef77b177640fee5024faa..0058b850bae4b2ebdf8cdd893e9a86b2d4201973 100644 (file)
@@ -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
 
 
index f02a9e638398818c20022dd81ceafea1a24faea5..c52accc7a5c165d16e901f2ae48fd8460a86f31f 100644 (file)
@@ -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[    ]+- .*