Lines Matching defs:hp

111 ref_to_str(uint_t name, const ctf_header_t *hp, const ctf_data_t *cd)
114 const char *s = cd->cd_ctfdata + hp->cth_stroff + offset;
119 if (offset >= hp->cth_strlen)
122 if (hp->cth_stroff + offset >= cd->cd_ctflen)
182 print_header(const ctf_header_t *hp, const ctf_data_t *cd)
186 (void) printf(" cth_magic = 0x%04x\n", hp->cth_magic);
187 (void) printf(" cth_version = %u\n", hp->cth_version);
188 (void) printf(" cth_flags = 0x%02x\n", hp->cth_flags);
190 ref_to_str(hp->cth_parlabel, hp, cd));
192 ref_to_str(hp->cth_parname, hp, cd));
193 (void) printf(" cth_lbloff = %u\n", hp->cth_lbloff);
194 (void) printf(" cth_objtoff = %u\n", hp->cth_objtoff);
195 (void) printf(" cth_funcoff = %u\n", hp->cth_funcoff);
196 (void) printf(" cth_typeoff = %u\n", hp->cth_typeoff);
197 (void) printf(" cth_stroff = %u\n", hp->cth_stroff);
198 (void) printf(" cth_strlen = %u\n", hp->cth_strlen);
204 print_labeltable(const ctf_header_t *hp, const ctf_data_t *cd)
206 void *v = (void *) (cd->cd_ctfdata + hp->cth_lbloff);
208 ulong_t i, n = (hp->cth_objtoff - hp->cth_lbloff) / sizeof (*ctl);
212 if (hp->cth_lbloff & 3)
214 if (hp->cth_lbloff >= cd->cd_ctflen)
216 if (hp->cth_objtoff >= cd->cd_ctflen)
218 if (hp->cth_lbloff > hp->cth_objtoff)
223 ref_to_str(ctl->ctl_label, hp, cd));
267 read_data(const ctf_header_t *hp, const ctf_data_t *cd)
269 void *v = (void *) (cd->cd_ctfdata + hp->cth_objtoff);
271 ulong_t n = (hp->cth_funcoff - hp->cth_objtoff) / sizeof (ushort_t);
276 if (hp->cth_objtoff & 1)
278 if (hp->cth_objtoff >= cd->cd_ctflen)
280 if (hp->cth_funcoff >= cd->cd_ctflen)
282 if (hp->cth_objtoff > hp->cth_funcoff)
311 read_funcs(const ctf_header_t *hp, const ctf_data_t *cd)
313 void *v = (void *) (cd->cd_ctfdata + hp->cth_funcoff);
316 v = (void *) (cd->cd_ctfdata + hp->cth_typeoff);
325 if (hp->cth_funcoff & 1)
327 if (hp->cth_funcoff >= cd->cd_ctflen)
329 if (hp->cth_typeoff >= cd->cd_ctflen)
331 if (hp->cth_funcoff > hp->cth_typeoff)
388 read_types(const ctf_header_t *hp, const ctf_data_t *cd)
390 void *v = (void *) (cd->cd_ctfdata + hp->cth_typeoff);
393 v = (void *) (cd->cd_ctfdata + hp->cth_stroff);
401 if (hp->cth_typeoff & 3)
403 if (hp->cth_typeoff >= cd->cd_ctflen)
405 if (hp->cth_stroff >= cd->cd_ctflen)
407 if (hp->cth_typeoff > hp->cth_stroff)
411 if (hp->cth_parlabel || hp->cth_parname)
449 " bits=%u", ref_to_str(tp->ctt_name, hp,
463 "bits=%u", ref_to_str(tp->ctt_name, hp,
475 ref_to_str(tp->ctt_name, hp, cd),
484 hp, cd), u.ap->cta_contents,
493 ref_to_str(tp->ctt_name, hp, cd),
530 ref_to_str(tp->ctt_name, hp, cd), size);
537 hp, cd), u.lmp->ctlm_type,
546 hp, cd), u.mp->ctm_type,
559 ref_to_str(tp->ctt_name, hp, cd));
563 ref_to_str(u.ep->cte_name, hp, cd),
577 ref_to_str(tp->ctt_name, hp, cd));
584 ref_to_str(tp->ctt_name, hp, cd),
592 ref_to_str(tp->ctt_name, hp, cd),
600 ref_to_str(tp->ctt_name, hp, cd),
608 ref_to_str(tp->ctt_name, hp, cd),
634 read_strtab(const ctf_header_t *hp, const ctf_data_t *cd)
636 size_t n, off, len = hp->cth_strlen;
637 const char *s = cd->cd_ctfdata + hp->cth_stroff;
642 if (hp->cth_stroff >= cd->cd_ctflen)
644 if (hp->cth_stroff + hp->cth_strlen > cd->cd_ctflen)
814 ctf_header_t *hp = NULL;
940 hp = v;
957 if (hp->cth_flags & CTF_F_COMPRESS) {
962 if ((buf = malloc(hp->cth_stroff + hp->cth_strlen)) == NULL)
969 zstr.avail_out = hp->cth_stroff + hp->cth_strlen;
980 if (zstr.total_out != hp->cth_stroff + hp->cth_strlen)
984 cd.cd_ctflen = hp->cth_stroff + hp->cth_strlen;
988 error |= print_header(hp, &cd);
990 error |= print_labeltable(hp, &cd);
992 error |= read_data(hp, &cd);
994 error |= read_funcs(hp, &cd);
996 error |= read_types(hp, &cd);
998 error |= read_strtab(hp, &cd);
1010 bcopy(hp, &h, sizeof (h));