Age | Commit message (Collapse) | Author | Files | Lines |
|
CTF functions return zero on success or an extended errno value which
can be translated into a string via the functions in this commit.
The errno numbers start at -CTF_BASE.
libctf/
* ctf-error.c: New file.
include/
* ctf-api.h (ctf_errno): New declaration.
(ctf_errmsg): Likewise.
|
|
These utilities are a bit of a ragbag of small things needed by more
than one TU: list manipulation, ELF32->64 translators, routines to look
up strings in string tables, dynamically-allocated string appenders, and
routines to set the specialized errno values previously committed in
<ctf-api.h>.
We do still need to dig around in raw ELF symbol tables in places,
because libctf allows the caller to pass in the contents of string and
symbol sections without telling it where they come from, so we cannot
use BFD to get the symbols (BFD reasonably demands the entire file). So
extract minimal ELF definitions from glibc into a private header named
libctf/elf.h: later, we use those to get symbols. (The start-of-
copyright range on elf.h reflects this glibc heritage.)
libctf/
* ctf-util.c: New file.
* elf.h: Likewise.
* ctf-impl.h: Include it, and add declarations.
|
|
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.
|