From b437bfe0f4cf06559ca4c508a2869383196ddc6b Mon Sep 17 00:00:00 2001 From: Nick Alcock Date: Wed, 24 Apr 2019 11:15:33 +0100 Subject: libctf: lookups by name and symbol These functions allow you to look up types given a name in a simple subset of C declarator syntax (no function pointers), to look up the types of variables given a name, and to look up the types of data objects and the type signatures of functions given symbol table offsets. (Despite its name, one function in this commit, ctf_lookup_symbol_name(), is for the internal use of libctf only, and does not appear in any public header files.) libctf/ * ctf-lookup.c (isqualifier): New. (ctf_lookup_by_name): Likewise. (struct ctf_lookup_var_key): Likewise. (ctf_lookup_var): Likewise. (ctf_lookup_variable): Likewise. (ctf_lookup_symbol_name): Likewise. (ctf_lookup_by_symbol): Likewise. (ctf_func_info): Likewise. (ctf_func_args): Likewise. include/ * ctf-api.h (ctf_func_info): New. (ctf_func_args): Likewise. (ctf_lookup_by_symbol): Likewise. (ctf_lookup_by_symbol): Likewise. (ctf_lookup_variable): Likewise. --- include/ctf-api.h | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'include/ctf-api.h') diff --git a/include/ctf-api.h b/include/ctf-api.h index 023c890..045d8af 100644 --- a/include/ctf-api.h +++ b/include/ctf-api.h @@ -270,6 +270,13 @@ extern void *ctf_getspecific (ctf_file_t *); extern int ctf_errno (ctf_file_t *); extern const char *ctf_errmsg (int); +extern int ctf_func_info (ctf_file_t *, unsigned long, ctf_funcinfo_t *); +extern int ctf_func_args (ctf_file_t *, unsigned long, uint32_t, ctf_id_t *); + +extern ctf_id_t ctf_lookup_by_name (ctf_file_t *, const char *); +extern ctf_id_t ctf_lookup_by_symbol (ctf_file_t *, unsigned long); +extern ctf_id_t ctf_lookup_variable (ctf_file_t *, const char *); + extern ctf_id_t ctf_type_resolve (ctf_file_t *, ctf_id_t); extern char *ctf_type_aname (ctf_file_t *, ctf_id_t); extern ssize_t ctf_type_lname (ctf_file_t *, ctf_id_t, char *, size_t); -- cgit v1.1