dwarf_loader: Make attr_suffix() handle kabi_prefix
Since we're going to get rid of strings.c. Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
This commit is contained in:
parent
daaafeb35f
commit
2b9bd83e63
|
@ -372,10 +372,17 @@ static Dwarf_Off attr_offset(Dwarf_Die *die, const uint32_t name)
|
||||||
|
|
||||||
static const char *attr_string(Dwarf_Die *die, uint32_t name, struct conf_load *conf __maybe_unused)
|
static const char *attr_string(Dwarf_Die *die, uint32_t name, struct conf_load *conf __maybe_unused)
|
||||||
{
|
{
|
||||||
|
const char *str = NULL;
|
||||||
Dwarf_Attribute attr;
|
Dwarf_Attribute attr;
|
||||||
if (dwarf_attr(die, name, &attr) != NULL)
|
|
||||||
return dwarf_formstring(&attr);
|
if (dwarf_attr(die, name, &attr) != NULL) {
|
||||||
return NULL;
|
str = dwarf_formstring(&attr);
|
||||||
|
|
||||||
|
if (conf && conf->kabi_prefix && str && strncmp(str, conf->kabi_prefix, conf->kabi_prefix_len) == 0)
|
||||||
|
return conf->kabi_prefix;
|
||||||
|
}
|
||||||
|
|
||||||
|
return str;
|
||||||
}
|
}
|
||||||
|
|
||||||
static struct dwarf_off_ref attr_type(Dwarf_Die *die, uint32_t attr_name)
|
static struct dwarf_off_ref attr_type(Dwarf_Die *die, uint32_t attr_name)
|
||||||
|
|
|
@ -48,10 +48,12 @@ struct conf_load {
|
||||||
struct conf_load *conf);
|
struct conf_load *conf);
|
||||||
void *cookie;
|
void *cookie;
|
||||||
char *format_path;
|
char *format_path;
|
||||||
|
int nr_jobs;
|
||||||
bool extra_dbg_info;
|
bool extra_dbg_info;
|
||||||
bool fixup_silly_bitfields;
|
bool fixup_silly_bitfields;
|
||||||
bool get_addr_info;
|
bool get_addr_info;
|
||||||
int nr_jobs;
|
uint16_t kabi_prefix_len;
|
||||||
|
const char *kabi_prefix;
|
||||||
struct btf *base_btf;
|
struct btf *base_btf;
|
||||||
struct conf_fprintf *conf_fprintf;
|
struct conf_fprintf *conf_fprintf;
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue