From 6dbf2b734063522b4f3d7403ce7a2b436802b839 Mon Sep 17 00:00:00 2001 From: Nick Alcock Date: Wed, 24 Apr 2019 11:35:37 +0100 Subject: libctf: labels This facility allows you to associate regions of type IDs with *labels*, a labelled tiling of the type ID space. You can use these to define CTF containers with distinct parents for distinct ranges of the ID space, or to assist with parallelization of CTF processing, or for any other purpose you can think of. Notably absent from here (though declared in the API header) is any way to define new labels: this will probably be introduced soon, as part of the linker deduplication work. (One existed in the past, but was deeply tied to the Solaris CTF file generator and had to be torn out.) libctf/ * ctf-labels.c: New. include/ * ctf-api.h (ctf_label_f): New. (ctf_label_set): New. (ctf_label_get): New. (ctf_label_topmost): New. (ctf_label_info): New. (ctf_label_iter): New. --- include/ChangeLog | 9 +++++++++ include/ctf-api.h | 9 +++++++++ 2 files changed, 18 insertions(+) (limited to 'include') diff --git a/include/ChangeLog b/include/ChangeLog index 56922ad..3ea7ac8 100644 --- a/include/ChangeLog +++ b/include/ChangeLog @@ -1,5 +1,14 @@ 2019-05-28 Nick Alcock + * ctf-api.h (ctf_label_f): New. + (ctf_label_set): New. + (ctf_label_get): New. + (ctf_label_topmost): New. + (ctf_label_info): New. + (ctf_label_iter): New. + +2019-05-28 Nick Alcock + * ctf-api.h (ctf_version): New. 2019-05-28 Nick Alcock diff --git a/include/ctf-api.h b/include/ctf-api.h index 6ab754a..c5ae38e 100644 --- a/include/ctf-api.h +++ b/include/ctf-api.h @@ -213,6 +213,8 @@ typedef int ctf_member_f (const char *name, ctf_id_t membtype, typedef int ctf_enum_f (const char *name, int val, void *arg); typedef int ctf_variable_f (const char *name, ctf_id_t type, void *arg); typedef int ctf_type_f (ctf_id_t type, void *arg); +typedef int ctf_label_f (const char *name, const ctf_lblinfo_t *info, + void *arg); typedef int ctf_archive_member_f (ctf_file_t *fp, const char *name, void *arg); typedef int ctf_archive_raw_member_f (const char *name, const void *content, size_t len, void *arg); @@ -299,9 +301,16 @@ extern int ctf_array_info (ctf_file_t *, ctf_id_t, ctf_arinfo_t *); extern const char *ctf_enum_name (ctf_file_t *, ctf_id_t, int); extern int ctf_enum_value (ctf_file_t *, ctf_id_t, const char *, int *); +extern void ctf_label_set (ctf_file_t *, const char *); +extern const char *ctf_label_get (ctf_file_t *); + +extern const char *ctf_label_topmost (ctf_file_t *); +extern int ctf_label_info (ctf_file_t *, const char *, ctf_lblinfo_t *); + extern int ctf_member_iter (ctf_file_t *, ctf_id_t, ctf_member_f *, void *); extern int ctf_enum_iter (ctf_file_t *, ctf_id_t, ctf_enum_f *, void *); extern int ctf_type_iter (ctf_file_t *, ctf_type_f *, void *); +extern int ctf_label_iter (ctf_file_t *, ctf_label_f *, void *); extern int ctf_variable_iter (ctf_file_t *, ctf_variable_f *, void *); extern int ctf_archive_iter (const ctf_archive_t *, ctf_archive_member_f *, void *); -- cgit v1.1