aboutsummaryrefslogtreecommitdiff
path: root/include/ctf-api.h
diff options
context:
space:
mode:
authorNick Alcock <nick.alcock@oracle.com>2021-01-27 19:55:45 +0000
committerNick Alcock <nick.alcock@oracle.com>2021-02-04 16:01:53 +0000
commitcaa170493e884215af4d07ea891ed1e2eeeb0578 (patch)
tree0d247c34146921550f50dd93081922fc2096132c /include/ctf-api.h
parent78f28b89e8c7a2c9e262e2819f0da5629f226efc (diff)
downloadgdb-caa170493e884215af4d07ea891ed1e2eeeb0578.zip
gdb-caa170493e884215af4d07ea891ed1e2eeeb0578.tar.gz
gdb-caa170493e884215af4d07ea891ed1e2eeeb0578.tar.bz2
libctf: prohibit nameless ints, floats, typedefs and forwards
Now that "anonymous typedef nodes" have been extirpated, we can mandate that things that have names in C must have names in CTF too. (Unlike the no-forwards embarrassment, the deduplicator does nothing special with names: types that have names in C will have the same name in CTF. So we can assume that the CTF rules and the C rules are the same.) include/ChangeLog 2021-01-27 Nick Alcock <nick.alcock@oracle.com> * ctf-api.h (ECTF_NONAME): New. (ECTF_NERR): Adjust. libctf/ChangeLog 2021-01-27 Nick Alcock <nick.alcock@oracle.com> * ctf-create.c (ctf_add_encoded): Add check for non-empty name. (ctf_add_forward): Likewise. (ctf_add_typedef): Likewise.
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 954778a..6dd43aa 100644
--- a/include/ctf-api.h
+++ b/include/ctf-api.h
@@ -240,7 +240,8 @@ typedef struct ctf_snapshot_id
_CTF_ITEM (ECTF_NEXT_WRONGFP, "Iteration entity changed in mid-iterate.") \
_CTF_ITEM (ECTF_FLAGS, "CTF header contains flags unknown to libctf.") \
_CTF_ITEM (ECTF_NEEDSBFD, "This feature needs a libctf with BFD support.") \
- _CTF_ITEM (ECTF_INCOMPLETE, "Type is not a complete type.")
+ _CTF_ITEM (ECTF_INCOMPLETE, "Type is not a complete type.") \
+ _CTF_ITEM (ECTF_NONAME, "Type name must not be empty.")
#define ECTF_BASE 1000 /* Base value for libctf errnos. */
@@ -253,7 +254,7 @@ _CTF_ERRORS
#undef _CTF_FIRST
};
-#define ECTF_NERR (ECTF_INCOMPLETE - ECTF_BASE + 1) /* Count of CTF errors. */
+#define ECTF_NERR (ECTF_NONAME - 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. */