[v4,13/35] libctf: dump: check the right error values when dumping functions

Message ID 20190924135131.441906-14-nick.alcock@oracle.com
State New
Headers show
Series
  • CTF linking support
Related show

Commit Message

Nick Alcock Sept. 24, 2019, 1:51 p.m.
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/ctf-dump.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

-- 
2.23.0.239.g28aa4420fd

Patch

diff --git a/libctf/ctf-dump.c b/libctf/ctf-dump.c
index 46613bd2c5d..3d66411a709 100644
--- a/libctf/ctf-dump.c
+++ b/libctf/ctf-dump.c
@@ -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)