Dump types before the string table to match ctftools' output.
authorMartin Pieuchot <mpi@openbsd.org>
Fri, 11 Nov 2016 17:33:09 +0000 (18:33 +0100)
committerMartin Pieuchot <mpi@openbsd.org>
Fri, 11 Nov 2016 17:33:09 +0000 (18:33 +0100)
ctfdump.c

index 22a5f50ded9179cd28bcc01313f0e6280936d570..4541170e47b993e99d934652af93fc63f771a838 100644 (file)
--- a/ctfdump.c
+++ b/ctfdump.c
@@ -358,6 +358,15 @@ ctf_dump(const char *p, size_t size, uint8_t flags)
                printf("\n");
        }
 
+       if (flags & DUMP_TYPE) {
+               unsigned int             idx = 1, offset = cth->cth_typeoff;
+
+               while (offset < cth->cth_stroff) {
+                       offset += ctf_dump_type(cth, data, dlen, offset, idx++);
+               }
+               printf("\n");
+       }
+
        if (flags & DUMP_STRTAB) {
                unsigned int             offset = 0;
                const char              *str;
@@ -376,15 +385,6 @@ ctf_dump(const char *p, size_t size, uint8_t flags)
                printf("\n");
        }
 
-       if (flags & DUMP_TYPE) {
-               unsigned int             idx = 1, offset = cth->cth_typeoff;
-
-               while (offset < cth->cth_stroff) {
-                       offset += ctf_dump_type(cth, data, dlen, offset, idx++);
-               }
-               printf("\n");
-       }
-
        if (cth->cth_flags & CTF_F_COMPRESS)
                free(data);