aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorNick Alcock <nick.alcock@oracle.com>2019-04-23 18:55:27 +0100
committerNick Alcock <nick.alcock@oracle.com>2019-05-28 17:07:15 +0100
commit60da9d955964759b1f52690bff587ad32a198507 (patch)
treee3d9dd8f6667916ef29c557e62c2d0f3fba6f6c0 /include
parent2e94b05630514109994abb77ee2dae730f17c263 (diff)
downloadgdb-60da9d955964759b1f52690bff587ad32a198507.zip
gdb-60da9d955964759b1f52690bff587ad32a198507.tar.gz
gdb-60da9d955964759b1f52690bff587ad32a198507.tar.bz2
libctf: lowest-level memory allocation and debug-dumping wrappers
The memory-allocation wrappers are simple things to allow malloc interposition: they are only used inconsistently at present, usually where malloc debugging was required in the past. These provide a default implementation that is environment-variable triggered (initialized on the first call to the libctf creation and file-opening functions, the first functions people will use), and a ctf_setdebug()/ctf_getdebug() pair that allows the caller to explicitly turn debugging off and on. If ctf_setdebug() is called, the automatic setting from an environment variable is skipped. libctf/ * ctf-impl.h: New file. * ctf-subr.c: New file. include/ * ctf-api.h (ctf_setdebug): New. (ctf_getdebug): Likewise.
Diffstat (limited to 'include')
-rw-r--r--include/ChangeLog5
-rw-r--r--include/ctf-api.h3
2 files changed, 8 insertions, 0 deletions
diff --git a/include/ChangeLog b/include/ChangeLog
index 2cd9f49..d113f98 100644
--- a/include/ChangeLog
+++ b/include/ChangeLog
@@ -1,5 +1,10 @@
2019-05-28 Nick Alcock <nick.alcock@oracle.com>
+ * ctf-api.h (ctf_setdebug): New.
+ (ctf_getdebug): Likewise.
+
+2019-05-28 Nick Alcock <nick.alcock@oracle.com>
+
* ctf-api.h: New file.
2019-05-28 Nick Alcock <nick.alcock@oracle.com>
diff --git a/include/ctf-api.h b/include/ctf-api.h
index 81f6add..8c6b770 100644
--- a/include/ctf-api.h
+++ b/include/ctf-api.h
@@ -123,6 +123,9 @@ enum
#define CTF_ADD_ROOT 1 /* Type visible at top-level scope. */
+extern void ctf_setdebug (int debug);
+extern int ctf_getdebug (void);
+
#ifdef __cplusplus
}
#endif