Lines Matching refs:fp
79 ctf_lookup_by_name(ctf_file_t *fp, const char *name) in ctf_lookup_by_name() argument
90 return (ctf_set_errno(fp, EINVAL)); in ctf_lookup_by_name()
112 ntype = fp->ctf_ptrtab[CTF_TYPE_TO_INDEX(type)]; in ctf_lookup_by_name()
114 ntype = ctf_type_resolve(fp, type); in ctf_lookup_by_name()
115 if (ntype == CTF_ERR || (ntype = fp->ctf_ptrtab[ in ctf_lookup_by_name()
117 (void) ctf_set_errno(fp, ECTF_NOTYPE); in ctf_lookup_by_name()
123 (fp->ctf_flags & LCTF_CHILD)); in ctf_lookup_by_name()
132 for (lp = fp->ctf_lookups; lp->ctl_prefix != NULL; lp++) { in ctf_lookup_by_name()
144 if ((hp = ctf_hash_lookup(lp->ctl_hash, fp, p, in ctf_lookup_by_name()
146 (void) ctf_set_errno(fp, ECTF_NOTYPE); in ctf_lookup_by_name()
156 (void) ctf_set_errno(fp, ECTF_NOTYPE); in ctf_lookup_by_name()
162 return (ctf_set_errno(fp, ECTF_SYNTAX)); in ctf_lookup_by_name()
167 if (fp->ctf_parent != NULL && in ctf_lookup_by_name()
168 (ptype = ctf_lookup_by_name(fp->ctf_parent, name)) != CTF_ERR) in ctf_lookup_by_name()
179 ctf_lookup_by_symbol(ctf_file_t *fp, ulong_t symidx) in ctf_lookup_by_symbol() argument
181 const ctf_sect_t *sp = &fp->ctf_symtab; in ctf_lookup_by_symbol()
185 return (ctf_set_errno(fp, ECTF_NOSYMTAB)); in ctf_lookup_by_symbol()
187 if (symidx >= fp->ctf_nsyms) in ctf_lookup_by_symbol()
188 return (ctf_set_errno(fp, EINVAL)); in ctf_lookup_by_symbol()
193 return (ctf_set_errno(fp, ECTF_NOTDATA)); in ctf_lookup_by_symbol()
197 return (ctf_set_errno(fp, ECTF_NOTDATA)); in ctf_lookup_by_symbol()
200 if (fp->ctf_sxlate[symidx] == -1u) in ctf_lookup_by_symbol()
201 return (ctf_set_errno(fp, ECTF_NOTYPEDAT)); in ctf_lookup_by_symbol()
203 type = *(ushort_t *)((uintptr_t)fp->ctf_buf + fp->ctf_sxlate[symidx]); in ctf_lookup_by_symbol()
205 return (ctf_set_errno(fp, ECTF_NOTYPEDAT)); in ctf_lookup_by_symbol()
218 ctf_file_t *fp = *fpp; /* caller passes in starting CTF container */ in ctf_lookup_by_id() local
220 if ((fp->ctf_flags & LCTF_CHILD) && CTF_TYPE_ISPARENT(type) && in ctf_lookup_by_id()
221 (fp = fp->ctf_parent) == NULL) { in ctf_lookup_by_id()
227 if (type > 0 && type <= fp->ctf_typemax) { in ctf_lookup_by_id()
228 *fpp = fp; /* function returns ending CTF container */ in ctf_lookup_by_id()
229 return (LCTF_INDEX_TO_TYPEPTR(fp, type)); in ctf_lookup_by_id()
232 (void) ctf_set_errno(fp, ECTF_BADID); in ctf_lookup_by_id()
241 ctf_func_info(ctf_file_t *fp, ulong_t symidx, ctf_funcinfo_t *fip) in ctf_func_info() argument
243 const ctf_sect_t *sp = &fp->ctf_symtab; in ctf_func_info()
248 return (ctf_set_errno(fp, ECTF_NOSYMTAB)); in ctf_func_info()
250 if (symidx >= fp->ctf_nsyms) in ctf_func_info()
251 return (ctf_set_errno(fp, EINVAL)); in ctf_func_info()
256 return (ctf_set_errno(fp, ECTF_NOTFUNC)); in ctf_func_info()
260 return (ctf_set_errno(fp, ECTF_NOTFUNC)); in ctf_func_info()
263 if (fp->ctf_sxlate[symidx] == -1u) in ctf_func_info()
264 return (ctf_set_errno(fp, ECTF_NOFUNCDAT)); in ctf_func_info()
266 dp = (ushort_t *)((uintptr_t)fp->ctf_buf + fp->ctf_sxlate[symidx]); in ctf_func_info()
269 kind = LCTF_INFO_KIND(fp, info); in ctf_func_info()
270 n = LCTF_INFO_VLEN(fp, info); in ctf_func_info()
273 return (ctf_set_errno(fp, ECTF_NOFUNCDAT)); in ctf_func_info()
276 return (ctf_set_errno(fp, ECTF_CORRUPT)); in ctf_func_info()
295 ctf_func_args(ctf_file_t *fp, ulong_t symidx, uint_t argc, ctf_id_t *argv) in ctf_func_args() argument
300 if (ctf_func_info(fp, symidx, &f) == CTF_ERR) in ctf_func_args()
307 dp = (ushort_t *)((uintptr_t)fp->ctf_buf + fp->ctf_sxlate[symidx]) + 2; in ctf_func_args()