liballocs
liballocs copied to clipboard
Derivation of runtime type information from ctf
Given the recent changes in e.g. binutils adding intial support for the ctf Compact Type Format, I'm not sure the current status of across gcc/ld in tree or releases yet
Anyhow given that liballocs derives its runtime information from DWARF, If it were possible to derive this information from Compact Type Format instead or as well, that might be nice given its more compact format. Since the intent seems to be that due to their minimal size these can have a more wide availability in normal release builds.
Edit: I think it's probably not possible, it seems like CTF is limited to type information about symbols, while liballocs would seem to need type information at call-sites which perform allocations?
By all means close if it's too much work invested in dwarf/not possible/whatever. Mostly just thought of liballocs while reading about this new/upcoming feature.
Thanks Matt! Indeed I'll have to look into it... it's not clear whether the information in CTF is sufficient. But the allocation sites thing is probably not an issue. Currently liballocs includes a separate source-level analysis for C code to retrieve type information at allocation sites, as the debug info was not sufficient anyway.
The main thing it's likely to lack is the local variable info that is used to compute stack frame layouts. I'm interested in finding more compact ways of representing that, since it takes up a lot of space currently (both in DWARF and in the uniqtype metadata I generate)... such a format is maybe is something I could try to push at binutils as a complement to CTF, if I get time to work on it.