]> git.ipfire.org Git - thirdparty/elfutils.git/commitdiff
readelf: improve output format for .gcc_except_table
authorMartin Liška <m.liska@foxlink.cz>
Tue, 9 Dec 2025 08:21:01 +0000 (09:21 +0100)
committerMark Wielaard <mark@klomp.org>
Tue, 9 Dec 2025 11:04:49 +0000 (12:04 +0100)
Before the change:
```
 Call site table: [   0] Call site start:   0x10
        Call site length:  12
        Landing pad:       0x2a
        Action:            3
 [   1] Call site start:   0x1c
        Call site length:  123
        Landing pad:       0
        Action:            0

 Action table: [   0] ar_filter:   1
        ar_disp:     0
 [   1] ar_filter:   2
        ar_disp:    -3    -> [   0]
```

After:
```
 Call site table:
 [   0] Call site start:   0x10
        Call site length:  12
        Landing pad:       0x2a
        Action:            3
 [   1] Call site start:   0x1c
        Call site length:  123
        Landing pad:       0
        Action:            0

 Action table:
 [   0] ar_filter:   1
        ar_disp:     0
 [   1] ar_filter:   2
        ar_disp:    -3    -> [   0]
```

ChangeLog:

* src/readelf.c (print_debug_exception_table): Add newlines.

Signed-off-by: Martin Liska <martin.liska@hey.com>
src/readelf.c

index fbdf8c716a509ff94c7637e5afc38e70e68e1d03..4faf0405c1873b027bfa6646c71e2916f06cab02 100644 (file)
@@ -11724,7 +11724,7 @@ print_debug_exception_table (Dwfl_Module *dwflmod __attribute__ ((unused)),
   while (readp < action_table)
     {
       if (u == 0)
-       fputs (_("\n Call site table:"), out);
+       fputs (_("\n Call site table:\n"), out);
 
       uint64_t call_site_start;
       readp = read_encoded (call_site_encoding, readp, dataend,
@@ -11752,7 +11752,7 @@ print_debug_exception_table (Dwfl_Module *dwflmod __attribute__ ((unused)),
   unsigned int max_ar_filter = 0;
   if (max_action > 0)
     {
-      fputs ("\n Action table:", out);
+      fputs ("\n Action table:\n", out);
 
       size_t maxdata = (size_t) (dataend - action_table);
       if (max_action > maxdata || maxdata - max_action < 1)
@@ -11783,7 +11783,7 @@ print_debug_exception_table (Dwfl_Module *dwflmod __attribute__ ((unused)),
          if (abs (ar_disp) & 1)
            fprintf (out, " -> [%4u]\n", u + (ar_disp + 1) / 2);
          else if (ar_disp != 0)
-           fputs (" -> ???", out);
+           fputs (" -> ???\n", out);
          else
            fputc ('\n', out);
          ++u;