diff options
author | Nick Alcock <nick.alcock@oracle.com> | 2020-06-02 21:06:18 +0100 |
---|---|---|
committer | Nick Alcock <nick.alcock@oracle.com> | 2020-07-22 17:57:36 +0100 |
commit | 01d9317436cd824306b9856861408a40bf8da36a (patch) | |
tree | c47b60aa0e7a9a0c42c1df872683cad7182fbed0 /include | |
parent | 5ec7465fec8bceb477732d6757112fe162116eb8 (diff) | |
download | gdb-01d9317436cd824306b9856861408a40bf8da36a.zip gdb-01d9317436cd824306b9856861408a40bf8da36a.tar.gz gdb-01d9317436cd824306b9856861408a40bf8da36a.tar.bz2 |
libctf: add ctf_type_name_raw
We already have a function ctf_type_aname_raw, which returns the raw
name of a type with no decoration for structures or arrays or anything
like that: just the underlying name of whatever it is that's being
ultimately pointed at.
But this can be inconvenient to use, becauswe it always allocates new
storage for the string and copies it in, so it can potentially fail.
Add ctf_type_name_raw, which just returns the string directly out of
libctf's guts: it will live until the ctf_file_t is closed (if we later
gain the ability to remove types from writable dicts, it will live as
long as the type lives).
Reimplement ctf_type_aname_raw in terms of it.
include/
* ctf-api.c (ctf_type_name_raw): New.
libctf/
* ctf-types.c (ctf_type_name_raw): New.
(ctf_type_aname_raw): Reimplement accordingly.
Diffstat (limited to 'include')
-rw-r--r-- | include/ChangeLog | 4 | ||||
-rw-r--r-- | include/ctf-api.h | 1 |
2 files changed, 5 insertions, 0 deletions
diff --git a/include/ChangeLog b/include/ChangeLog index f5be0c0..2acc42a 100644 --- a/include/ChangeLog +++ b/include/ChangeLog @@ -1,5 +1,9 @@ 2020-07-22 Nick Alcock <nick.alcock@oracle.com> + * ctf-api.c (ctf_type_name_raw): New. + +2020-07-22 Nick Alcock <nick.alcock@oracle.com> + * ctf-api.h (ECTF_*): Improve comments. (ECTF_NERR): New. diff --git a/include/ctf-api.h b/include/ctf-api.h index 2e3e28b..363b5c2 100644 --- a/include/ctf-api.h +++ b/include/ctf-api.h @@ -324,6 +324,7 @@ extern char *ctf_type_aname (ctf_file_t *, ctf_id_t); extern char *ctf_type_aname_raw (ctf_file_t *, ctf_id_t); extern ssize_t ctf_type_lname (ctf_file_t *, ctf_id_t, char *, size_t); extern char *ctf_type_name (ctf_file_t *, ctf_id_t, char *, size_t); +extern const char *ctf_type_name_raw (ctf_file_t *, ctf_id_t); extern ssize_t ctf_type_size (ctf_file_t *, ctf_id_t); extern ssize_t ctf_type_align (ctf_file_t *, ctf_id_t); extern int ctf_type_kind (ctf_file_t *, ctf_id_t); |