mirror of
https://github.com/bminor/binutils-gdb.git
synced 2025-12-25 16:57:52 +00:00
libctf: lookup, open: chase header field changes
Nothing exciting here, just header fields slightly changing name and a couple of new comments and indentation fixes.
This commit is contained in:
@@ -620,6 +620,9 @@ extern ctf_id_t ctf_lookup_by_kind (ctf_dict_t *, int kind, const char *);
|
|||||||
typedef of a type with a *different width* (because this slice has not been
|
typedef of a type with a *different width* (because this slice has not been
|
||||||
applied to it).
|
applied to it).
|
||||||
|
|
||||||
|
May error with ECTF_NONREPRESENTABLE if type 0 is seen (rare, but can happen:
|
||||||
|
not only types GCC cannot encode, but also e.g. const void variables).
|
||||||
|
|
||||||
Most of the time you don't need to call this: the type-querying functions
|
Most of the time you don't need to call this: the type-querying functions
|
||||||
will do it for you (as noted below). */
|
will do it for you (as noted below). */
|
||||||
|
|
||||||
|
|||||||
@@ -671,7 +671,7 @@ sort_symidx_by_name (const void *one_, const void *two_, void *arg_)
|
|||||||
|
|
||||||
static uint32_t *
|
static uint32_t *
|
||||||
ctf_symidx_sort (ctf_dict_t *fp, uint32_t *idx, size_t *nidx,
|
ctf_symidx_sort (ctf_dict_t *fp, uint32_t *idx, size_t *nidx,
|
||||||
size_t len)
|
size_t len)
|
||||||
{
|
{
|
||||||
uint32_t *sorted;
|
uint32_t *sorted;
|
||||||
size_t i;
|
size_t i;
|
||||||
@@ -1013,7 +1013,7 @@ ctf_symbol_next_static (ctf_dict_t *fp, ctf_next_t **it, const char **name,
|
|||||||
if (fp != i->cu.ctn_fp)
|
if (fp != i->cu.ctn_fp)
|
||||||
return (ctf_set_typed_errno (fp, ECTF_NEXT_WRONGFP));
|
return (ctf_set_typed_errno (fp, ECTF_NEXT_WRONGFP));
|
||||||
|
|
||||||
/* TODO-v4: Indexed after non-indexed portions? */
|
/* TODO: Indexed after non-indexed portions? */
|
||||||
|
|
||||||
if ((!functions && fp->ctf_objtidx_names) ||
|
if ((!functions && fp->ctf_objtidx_names) ||
|
||||||
(functions && fp->ctf_funcidx_names))
|
(functions && fp->ctf_funcidx_names))
|
||||||
@@ -1025,13 +1025,13 @@ ctf_symbol_next_static (ctf_dict_t *fp, ctf_next_t **it, const char **name,
|
|||||||
|
|
||||||
if (functions)
|
if (functions)
|
||||||
{
|
{
|
||||||
len = (hp->cth_varoff - hp->cth_funcidxoff) / sizeof (uint32_t);
|
len = hp->cth_funcidx_len / sizeof (uint32_t);
|
||||||
tab = (uint32_t *) (fp->ctf_buf + hp->cth_funcoff);
|
tab = (uint32_t *) (fp->ctf_buf + hp->cth_func_off);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
len = (hp->cth_funcidxoff - hp->cth_objtidxoff) / sizeof (uint32_t);
|
len = hp->cth_objtidx_len / sizeof (uint32_t);
|
||||||
tab = (uint32_t *) (fp->ctf_buf + hp->cth_objtoff);
|
tab = (uint32_t *) (fp->ctf_buf + hp->cth_objt_off);
|
||||||
}
|
}
|
||||||
|
|
||||||
do
|
do
|
||||||
@@ -1064,14 +1064,14 @@ ctf_symbol_next_static (ctf_dict_t *fp, ctf_next_t **it, const char **name,
|
|||||||
|
|
||||||
if (functions)
|
if (functions)
|
||||||
{
|
{
|
||||||
if (fp->ctf_sxlate[n] >= hp->cth_funcoff
|
if (fp->ctf_sxlate[n] >= hp->cth_func_off
|
||||||
&& fp->ctf_sxlate[n] < hp->cth_objtidxoff)
|
&& fp->ctf_sxlate[n] < hp->cth_func_off + hp->cth_func_len)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (fp->ctf_sxlate[n] >= hp->cth_objtoff
|
if (fp->ctf_sxlate[n] >= hp->cth_objt_off
|
||||||
&& fp->ctf_sxlate[n] < hp->cth_funcoff)
|
&& fp->ctf_sxlate[n] < hp->cth_objt_off + hp->cth_objt_len)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1138,16 +1138,15 @@ ctf_try_lookup_indexed (ctf_dict_t *fp, unsigned long symidx,
|
|||||||
{
|
{
|
||||||
if ((fp->ctf_funcidx_sxlate
|
if ((fp->ctf_funcidx_sxlate
|
||||||
= ctf_symidx_sort (fp, (uint32_t *)
|
= ctf_symidx_sort (fp, (uint32_t *)
|
||||||
(fp->ctf_buf + hp->cth_funcidxoff),
|
(fp->ctf_buf + hp->cth_funcidx_off),
|
||||||
&fp->ctf_nfuncidx,
|
&fp->ctf_nfuncidx, hp->cth_funcidx_len))
|
||||||
hp->cth_varoff - hp->cth_funcidxoff))
|
|
||||||
== NULL)
|
== NULL)
|
||||||
{
|
{
|
||||||
ctf_err_warn (fp, 0, 0, _("cannot sort function symidx"));
|
ctf_err_warn (fp, 0, 0, _("cannot sort function symidx"));
|
||||||
return CTF_ERR; /* errno is set for us. */
|
return CTF_ERR; /* errno is set for us. */
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
symtypetab = (uint32_t *) (fp->ctf_buf + hp->cth_funcoff);
|
symtypetab = (uint32_t *) (fp->ctf_buf + hp->cth_func_off);
|
||||||
sxlate = fp->ctf_funcidx_sxlate;
|
sxlate = fp->ctf_funcidx_sxlate;
|
||||||
names = fp->ctf_funcidx_names;
|
names = fp->ctf_funcidx_names;
|
||||||
nidx = fp->ctf_nfuncidx;
|
nidx = fp->ctf_nfuncidx;
|
||||||
@@ -1158,9 +1157,8 @@ ctf_try_lookup_indexed (ctf_dict_t *fp, unsigned long symidx,
|
|||||||
{
|
{
|
||||||
if ((fp->ctf_objtidx_sxlate
|
if ((fp->ctf_objtidx_sxlate
|
||||||
= ctf_symidx_sort (fp, (uint32_t *)
|
= ctf_symidx_sort (fp, (uint32_t *)
|
||||||
(fp->ctf_buf + hp->cth_objtidxoff),
|
(fp->ctf_buf + hp->cth_objtidx_off),
|
||||||
&fp->ctf_nobjtidx,
|
&fp->ctf_nobjtidx, hp->cth_objtidx_len))
|
||||||
hp->cth_funcidxoff - hp->cth_objtidxoff))
|
|
||||||
== NULL)
|
== NULL)
|
||||||
{
|
{
|
||||||
ctf_err_warn (fp, 0, 0, _("cannot sort object symidx"));
|
ctf_err_warn (fp, 0, 0, _("cannot sort object symidx"));
|
||||||
@@ -1168,7 +1166,7 @@ ctf_try_lookup_indexed (ctf_dict_t *fp, unsigned long symidx,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
symtypetab = (uint32_t *) (fp->ctf_buf + hp->cth_objtoff);
|
symtypetab = (uint32_t *) (fp->ctf_buf + hp->cth_objt_off);
|
||||||
sxlate = fp->ctf_objtidx_sxlate;
|
sxlate = fp->ctf_objtidx_sxlate;
|
||||||
names = fp->ctf_objtidx_names;
|
names = fp->ctf_objtidx_names;
|
||||||
nidx = fp->ctf_nobjtidx;
|
nidx = fp->ctf_nobjtidx;
|
||||||
|
|||||||
@@ -2629,11 +2629,11 @@ ctf_import_internal (ctf_dict_t *fp, ctf_dict_t *pfp, int unreffed)
|
|||||||
return (ctf_set_errno (fp, ECTF_HASPARENT));
|
return (ctf_set_errno (fp, ECTF_HASPARENT));
|
||||||
|
|
||||||
if (fp->ctf_header->cth_parent_strlen != 0 &&
|
if (fp->ctf_header->cth_parent_strlen != 0 &&
|
||||||
pfp->ctf_header->cth_strlen != fp->ctf_header->cth_parent_strlen)
|
pfp->ctf_header->btf.bth_str_len != fp->ctf_header->cth_parent_strlen)
|
||||||
{
|
{
|
||||||
ctf_err_warn (fp, 0, ECTF_WRONGPARENT,
|
ctf_err_warn (fp, 0, ECTF_WRONGPARENT,
|
||||||
_("ctf_import: incorrect parent dict: %u bytes of strings expected, %u found"),
|
_("ctf_import: incorrect parent dict: %u bytes of strings expected, %u found"),
|
||||||
fp->ctf_header->cth_parent_strlen, pfp->ctf_header->cth_strlen);
|
fp->ctf_header->cth_parent_strlen, pfp->ctf_header->btf.bth_str_len);
|
||||||
return (ctf_set_errno (fp, ECTF_WRONGPARENT));
|
return (ctf_set_errno (fp, ECTF_WRONGPARENT));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user