aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNick Alcock <nick.alcock@oracle.com>2019-04-24 11:35:37 +0100
committerNick Alcock <nick.alcock@oracle.com>2019-05-28 17:09:30 +0100
commit6dbf2b734063522b4f3d7403ce7a2b436802b839 (patch)
treeffd324ef83a909f9bdee848fb2287e87877af5d8 /include
parentlibctf: library version enforcement (diff)
downloadbinutils-gdb-6dbf2b734063522b4f3d7403ce7a2b436802b839.tar.gz
binutils-gdb-6dbf2b734063522b4f3d7403ce7a2b436802b839.tar.bz2
binutils-gdb-6dbf2b734063522b4f3d7403ce7a2b436802b839.zip
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.
Diffstat (limited to 'include')
-rw-r--r--include/ChangeLog9
-rw-r--r--include/ctf-api.h9
2 files changed, 18 insertions, 0 deletions
diff --git a/include/ChangeLog b/include/ChangeLog
index 56922add8a8..3ea7ac8660a 100644
--- a/include/ChangeLog
+++ b/include/ChangeLog
@@ -1,5 +1,14 @@
2019-05-28 Nick Alcock <nick.alcock@oracle.com>
+ * 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 <nick.alcock@oracle.com>
+
* ctf-api.h (ctf_version): New.
2019-05-28 Nick Alcock <nick.alcock@oracle.com>
diff --git a/include/ctf-api.h b/include/ctf-api.h
index 6ab754a1840..c5ae38e6a43 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 *);