aboutsummaryrefslogtreecommitdiff
path: root/include/ctf-api.h
diff options
context:
space:
mode:
authorNick Alcock <nick.alcock@oracle.com>2019-04-24 11:41:00 +0100
committerNick Alcock <nick.alcock@oracle.com>2019-05-28 17:09:37 +0100
commita30b3e182aad25f94de6412efd5d78f7805fb4d3 (patch)
tree349e87e7cb16ccf37ad4bf6367211c8c423da2a8 /include/ctf-api.h
parent6dbf2b734063522b4f3d7403ce7a2b436802b839 (diff)
downloadgdb-a30b3e182aad25f94de6412efd5d78f7805fb4d3.zip
gdb-a30b3e182aad25f94de6412efd5d78f7805fb4d3.tar.gz
gdb-a30b3e182aad25f94de6412efd5d78f7805fb4d3.tar.bz2
libctf: debug dumping
This introduces ctf_dump(), an iterator which returns a series of strings, each representing a debugging dump of one item from a given section in the CTF file. The items may be multiline: a callback is provided to allow the caller to decorate each line as they desire before the line is returned. libctf/ * ctf-dump.c: New. include/ * ctf-api.h (ctf_dump_decorate_f): New. (ctf_dump_state_t): new. (ctf_dump): New.
Diffstat (limited to 'include/ctf-api.h')
-rw-r--r--include/ctf-api.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/include/ctf-api.h b/include/ctf-api.h
index c5ae38e..822b3bf 100644
--- a/include/ctf-api.h
+++ b/include/ctf-api.h
@@ -218,6 +218,10 @@ typedef int ctf_label_f (const char *name, const ctf_lblinfo_t *info,
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);
+typedef char *ctf_dump_decorate_f (ctf_sect_names_t sect,
+ char *line, void *arg);
+
+typedef struct ctf_dump_state ctf_dump_state_t;
/* Opening. These mostly return an abstraction over both CTF files and CTF
archives: so they can be used to open both. CTF files will appear to be an
@@ -320,6 +324,9 @@ extern int ctf_archive_iter (const ctf_archive_t *, ctf_archive_member_f *,
to deal with non-archives at all. */
extern int ctf_archive_raw_iter (const ctf_archive_t *,
ctf_archive_raw_member_f *, void *);
+extern char *ctf_dump (ctf_file_t *, ctf_dump_state_t **state,
+ ctf_sect_names_t sect, ctf_dump_decorate_f *,
+ void *arg);
extern ctf_id_t ctf_add_array (ctf_file_t *, uint32_t,
const ctf_arinfo_t *);