libctf: rename ctf_dict.ctf_{symtab,strtab}

These two fields are constantly confusing because CTF dicts contain both
a symtypetab and strtab, but these fields are not that: they are the
symtab and strtab from the ELF file.  We have enough string tables now
(internal, external, synthetic external, dynamic) that we need to at
least name them better than this to avoid getting totally confused.
Rename them to ctf_ext_symtab and ctf_ext_strtab.

libctf/

	* ctf-dump.c (ctf_dump_objts): Rename ctf_symtab -> ctf_ext_symtab.
	* ctf-impl.h (struct ctf_dict.ctf_symtab): Rename to...
	(struct ctf_dict.ctf_ext_strtab): ... this.
	(struct ctf_dict.ctf_strtab): Rename to...
	(struct ctf_dict.ctf_ext_strtab): ... this.
	* ctf-lookup.c (ctf_lookup_symbol_name): Adapt.
	(ctf_lookup_symbol_idx): Adapt.
	(ctf_lookup_by_sym_or_name): Adapt.
	* ctf-open.c (ctf_bufopen_internal): Adapt.
	(ctf_dict_close): Adapt.
	(ctf_getsymsect): Adapt.
	(ctf_getstrsect): Adapt.
	(ctf_symsect_endianness): Adapt.
This commit is contained in:
Nick Alcock
2024-01-05 12:17:27 +00:00
parent bb2a9a465e
commit 629acbe4a3
4 changed files with 25 additions and 25 deletions

View File

@@ -469,7 +469,7 @@ ctf_symidx_sort (ctf_dict_t *fp, uint32_t *idx, size_t *nidx,
static const char *
ctf_lookup_symbol_name (ctf_dict_t *fp, unsigned long symidx)
{
const ctf_sect_t *sp = &fp->ctf_symtab;
const ctf_sect_t *sp = &fp->ctf_ext_symtab;
ctf_link_sym_t sym;
int err;
@@ -540,7 +540,7 @@ static unsigned long
ctf_lookup_symbol_idx (ctf_dict_t *fp, const char *symname, int try_parent,
int is_function)
{
const ctf_sect_t *sp = &fp->ctf_symtab;
const ctf_sect_t *sp = &fp->ctf_ext_symtab;
ctf_link_sym_t sym;
void *known_idx;
int err;
@@ -973,7 +973,7 @@ ctf_lookup_by_sym_or_name (ctf_dict_t *fp, unsigned long symidx,
const char *symname, int try_parent,
int is_function)
{
const ctf_sect_t *sp = &fp->ctf_symtab;
const ctf_sect_t *sp = &fp->ctf_ext_symtab;
ctf_id_t type = 0;
int err = 0;