aboutsummaryrefslogtreecommitdiff
path: root/include/ctf-api.h
diff options
context:
space:
mode:
authorNick Alcock <nick.alcock@oracle.com>2020-06-03 17:31:44 +0100
committerNick Alcock <nick.alcock@oracle.com>2020-07-22 17:57:54 +0100
commitec388c16cd4217a64907e4e133d2102cc4fe608a (patch)
treeb2843ad6885d24e75b5351487b008fe2598fa3d0 /include/ctf-api.h
parent67d4cc671b7b3c49f748546a510005333fcbc465 (diff)
downloadgdb-ec388c16cd4217a64907e4e133d2102cc4fe608a.zip
gdb-ec388c16cd4217a64907e4e133d2102cc4fe608a.tar.gz
gdb-ec388c16cd4217a64907e4e133d2102cc4fe608a.tar.bz2
libctf: error out on corrupt CTF with invalid header flags
If corrupt CTF with invalid header flags is passed in, return the new error ECTF_FLAGS. include/ * ctf-api.h (ECTF_FLAGS): New. (ECTF_NERR): Adjust. * ctf.h (CTF_F_MAX): New. libctf/ * ctf-open.c (ctf_bufopen_internal): Diagnose invalid flags.
Diffstat (limited to 'include/ctf-api.h')
-rw-r--r--include/ctf-api.h5
1 files changed, 3 insertions, 2 deletions
diff --git a/include/ctf-api.h b/include/ctf-api.h
index 47a1f73..760b1e4 100644
--- a/include/ctf-api.h
+++ b/include/ctf-api.h
@@ -207,10 +207,11 @@ enum
ECTF_NONREPRESENTABLE, /* Type not representable in CTF. */
ECTF_NEXT_END, /* End of iteration. */
ECTF_NEXT_WRONGFUN, /* Wrong iteration function called. */
- ECTF_NEXT_WRONGFP /* Iteration entity changed in mid-iterate. */
+ ECTF_NEXT_WRONGFP, /* Iteration entity changed in mid-iterate. */
+ ECTF_FLAGS /* CTF header contains flags unknown to libctf. */
};
-#define ECTF_NERR (ECTF_NEXT_WRONGFP - ECTF_BASE + 1) /* Count of CTF errors. */
+#define ECTF_NERR (ECTF_FLAGS - ECTF_BASE + 1) /* Count of CTF errors. */
/* The CTF data model is inferred to be the caller's data model or the data
model of the given object, unless ctf_setmodel() is explicitly called. */