Make DUMP_FUNCTION and DUMP_OBJECT closer to illumos ctfdump
authorJasper Lievisse Adriaanse <jasper@humppa.nl>
Fri, 2 Sep 2016 10:22:38 +0000 (11:22 +0100)
committerJasper Lievisse Adriaanse <jasper@humppa.nl>
Fri, 2 Sep 2016 11:11:12 +0000 (12:11 +0100)
ctfdump.c

index 3f3ebd6c2dd16ca34fa70ab4b02fca09d6e2c96e..52dbbab607b45fe18ac78523145c2c81a865d256 100644 (file)
--- a/ctfdump.c
+++ b/ctfdump.c
@@ -323,13 +323,12 @@ ctf_dump(const char *p, size_t size, uint8_t flags)
 
                        l = printf("  [%zu] %u", i++, *dsp);
                        if ((s = elf_idx2sym(&idx, STT_OBJECT)) != NULL)
-                               printf("%*s %s (%zu)\n", (15 - l), "", s, idx);
+                               printf("%*s %s (%zu)\n", (14 - l), "", s, idx);
                        else
                                printf("\n");
 
                        objtoff += sizeof(*dsp);
                }
-               printf("\n");
        }
 
        if (flags & DUMP_FUNCTION) {
@@ -347,9 +346,9 @@ ctf_dump(const char *p, size_t size, uint8_t flags)
                        if (kind == CTF_K_UNKNOWN && vlen == 0)
                                continue;
 
-                       l = printf("  [%zu]", i++);
+                       l = printf("  [%zu] FUNC ", i++);
                        if ((s = elf_idx2sym(&idx, STT_FUNC)) != NULL)
-                               printf(" %s (%zu)", s, idx);
+                               printf("(%s)", s);
                        printf(" returns: %u args: (", *fsp++);
                        while (vlen-- > 0)
                                printf("%u%s", *fsp++, (vlen > 0) ? ", " : "");