libctf: introduce ctf_func_type_{info,args}, ctf_type_aname_raw
The first two of these allow you to get function type info and args out of the types section give a type ID: astonishingly, this was missing from libctf before now: so even though types of kind CTF_K_FUNCTION were supported, you couldn't find out anything about them. (The existing ctf_func_info and ctf_func_args only allow you to get info about functions in the function section, i.e. given symbol table indexes, not type IDs.) The second of these allows you to get the raw undecorated name out of the CTF section (strdupped for safety) without traversing subtypes to build a full C identifier out of it. It's useful for things that are already tracking the type kind etc and just need an unadorned name. include/ * ctf-api.h (ECTF_NOTFUNC): Fix description. (ctf_func_type_info): New. (ctf_func_type_args): Likewise. libctf/ * ctf-types.c (ctf_type_aname_raw): New. (ctf_func_type_info): Likewise. (ctf_func_type_args): Likewise. * ctf-error.c (_ctf_errlist): Fix description.
This commit is contained in:
parent
afe09f0b63
commit
12a0b67d28
6 changed files with 106 additions and 3 deletions
|
@ -48,7 +48,7 @@ static const char *const _ctf_errlist[] = {
|
|||
"Input buffer is too small for type name", /* ECTF_NAMELEN */
|
||||
"No type information available for that name", /* ECTF_NOTYPE */
|
||||
"Syntax error in type name", /* ECTF_SYNTAX */
|
||||
"Symbol table entry is not a function", /* ECTF_NOTFUNC */
|
||||
"Symbol table entry or type is not a function", /* ECTF_NOTFUNC */
|
||||
"No function information available for symbol", /* ECTF_NOFUNCDAT */
|
||||
"Symbol table entry is not a data object", /* ECTF_NOTDATA */
|
||||
"No type information available for symbol", /* ECTF_NOTYPEDAT */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue