mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-09-21 13:16:33 +08:00
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.
This commit is contained in:
@ -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
|
||||
|
Reference in New Issue
Block a user