libctf: dump: check the right error values when dumping functions
authorNick Alcock <nick.alcock@oracle.com>
Sat, 13 Jul 2019 19:50:49 +0000 (20:50 +0100)
committerNick Alcock <nick.alcock@oracle.com>
Thu, 3 Oct 2019 16:04:55 +0000 (17:04 +0100)
We weren't correctly detecting when there were no functions to dump in
the function info table, because we were checking for ECTF_NOTYPEDAT,
which means there are no *data objects* to dump.

Adjust accordingly.

libctf/
* ctf-dump.c (ctf_dump_funcs): Check the right error value.

libctf/ChangeLog
libctf/ctf-dump.c

index 09353da012e4a8da7a83dd62618299d9555f8e0c..c23e5aedcfc10e94f42933eb0ddbfb9b63ac4c45 100644 (file)
@@ -1,3 +1,7 @@
+2019-07-13  Nick Alcock  <nick.alcock@oracle.com>
+
+       * ctf-dump.c (ctf_dump_funcs): Check the right error value.
+
 2019-07-13  Nick Alcock  <nick.alcock@oracle.com>
 
        * ctf-dump.c (ctf_dump): Use ctf_type_iter_all to dump types, not
index 0c0c2246b51970786177eaf6a9c7f68595594487..2a888e136396c6af74564c8053d35ad976b799a5 100644 (file)
@@ -401,7 +401,8 @@ ctf_dump_funcs (ctf_file_t *fp, ctf_dump_state_t *state)
          case ECTF_NOSYMTAB:
            return -1;
          case ECTF_NOTDATA:
-         case ECTF_NOTYPEDAT:
+         case ECTF_NOTFUNC:
+         case ECTF_NOFUNCDAT:
            continue;
          }
       if ((args = calloc (fi.ctc_argc, sizeof (ctf_id_t))) == NULL)