diff options
author | Nick Alcock <nick.alcock@oracle.com> | 2025-03-10 23:20:27 +0000 |
---|---|---|
committer | Nick Alcock <nick.alcock@oracle.com> | 2025-03-20 12:11:42 +0000 |
commit | 13c49768b39e6280c439697672a817d76c7fd5b1 (patch) | |
tree | e9a7734bc22c978ca680310c4170f68e4189038f /libctf/ctf-inlines.h | |
parent | 4b87a11cf8ea46146ddd38ba6f25d221c00ebaf9 (diff) | |
download | binutils-13c49768b39e6280c439697672a817d76c7fd5b1.zip binutils-13c49768b39e6280c439697672a817d76c7fd5b1.tar.gz binutils-13c49768b39e6280c439697672a817d76c7fd5b1.tar.bz2 |
libctf: ctf-type / ctf-create: BTF / CTFv4 wip
This huge change transforms ctf-type.c and ctf-create.c to handle BTF,
including datasec and tag support. I don't think I missed anything, but
I haven't audited for things I missed yet... I'm still working on
ctf_tag(), but that's the last piece.
This is a much bigger change than expected because of type prefixes. We
need type prefixes even before CTFv4 because we want to be able to pass
pahole information on conflicted types, and in CTFv4 these are implemented
with a CTF_K_CONFLICTING prefix type. As long as we're doing that, let's
implement CTF_K_BIG as well... and with that there, suddenly we have to
worry about having both at once on one type, and the existing DTD
representation with one ctf_type_t starts to look seriously inadequate.
So we adjust the DTD so that the ctf_type_t and vlen are contained *within*
a buffer which is identical to the on-disk representation, except only that
it might be unconditionally CTF_K_BIG while in memory or something like
that. We can then trivially search this buffer for type headers using
a simple increment (since all the type headers are at the start, followed by
the vlen region), which makes all the rest much easier: e.g. most of the
repetitive code in ctf-types.c's type handling and in type creation can
get moved into common code, and there is finally almost no distinction at
all between static and dynamic types. This also makes it easy to make
types dynamic on the fly later, which will be crucial if we ever want
to add variables to pre-existing dicts (since that means adding to a
pre-existing datasec as well).
A bunch of APIs, particularly around iter_f functions, have changed:
everything that takes a type now takes a dict as well, because the lack of
such was incredibly annoying. Uses in libctf (particularly in the dumper and
in ctf_add_type) have been adjusted, but not yet simplified as they could be
now they have a dict more easily available.
Absolutely does not compile, but should show where we're going.
Thanks to Bruce McCulloch <bruce.mcculloch@oracle.com> for a whole
heap of creation and querying functions.
Diffstat (limited to 'libctf/ctf-inlines.h')
-rw-r--r-- | libctf/ctf-inlines.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/libctf/ctf-inlines.h b/libctf/ctf-inlines.h index d1f0691..54317bc 100644 --- a/libctf/ctf-inlines.h +++ b/libctf/ctf-inlines.h @@ -37,7 +37,7 @@ ctf_get_ctt_size (const ctf_dict_t *fp, ssize_t *sizep, ssize_t *incrementp) { - return (fp->ctf_dictops->ctfo_get_ctt_size (fp, tp, sizep, incrementp)); + return (fp->ctf_dictops->ctfo_get_ctt_size (fp, tprefix, sizep, incrementp)); } static inline int |