Lines Matching refs:hp

112 ref_to_str(uint_t name, const ctf_header_t *hp, const ctf_data_t *cd)  in ref_to_str()  argument
115 const char *s = cd->cd_ctfdata + hp->cth_stroff + offset; in ref_to_str()
120 if (offset >= hp->cth_strlen) in ref_to_str()
123 if (hp->cth_stroff + offset >= cd->cd_ctflen) in ref_to_str()
183 print_header(const ctf_header_t *hp, const ctf_data_t *cd) in print_header() argument
187 (void) printf(" cth_magic = 0x%04x\n", hp->cth_magic); in print_header()
188 (void) printf(" cth_version = %u\n", hp->cth_version); in print_header()
189 (void) printf(" cth_flags = 0x%02x\n", hp->cth_flags); in print_header()
191 ref_to_str(hp->cth_parlabel, hp, cd)); in print_header()
193 ref_to_str(hp->cth_parname, hp, cd)); in print_header()
194 (void) printf(" cth_lbloff = %u\n", hp->cth_lbloff); in print_header()
195 (void) printf(" cth_objtoff = %u\n", hp->cth_objtoff); in print_header()
196 (void) printf(" cth_funcoff = %u\n", hp->cth_funcoff); in print_header()
197 (void) printf(" cth_typeoff = %u\n", hp->cth_typeoff); in print_header()
198 (void) printf(" cth_stroff = %u\n", hp->cth_stroff); in print_header()
199 (void) printf(" cth_strlen = %u\n", hp->cth_strlen); in print_header()
205 print_labeltable(const ctf_header_t *hp, const ctf_data_t *cd) in print_labeltable() argument
207 void *v = (void *) (cd->cd_ctfdata + hp->cth_lbloff); in print_labeltable()
209 ulong_t i, n = (hp->cth_objtoff - hp->cth_lbloff) / sizeof (*ctl); in print_labeltable()
213 if (hp->cth_lbloff & 3) in print_labeltable()
215 if (hp->cth_lbloff >= cd->cd_ctflen) in print_labeltable()
217 if (hp->cth_objtoff >= cd->cd_ctflen) in print_labeltable()
219 if (hp->cth_lbloff > hp->cth_objtoff) in print_labeltable()
224 ref_to_str(ctl->ctl_label, hp, cd)); in print_labeltable()
268 read_data(const ctf_header_t *hp, const ctf_data_t *cd) in read_data() argument
270 const char *v = (void *) (cd->cd_ctfdata + hp->cth_objtoff); in read_data()
271 ulong_t n = (hp->cth_funcoff - hp->cth_objtoff) / cd->cd_idwidth; in read_data()
276 if (hp->cth_objtoff & 1) in read_data()
278 if (hp->cth_objtoff >= cd->cd_ctflen) in read_data()
280 if (hp->cth_funcoff >= cd->cd_ctflen) in read_data()
282 if (hp->cth_objtoff > hp->cth_funcoff) in read_data()
314 read_funcs(const ctf_header_t *hp, const ctf_data_t *cd) in read_funcs() argument
316 const char *v = (void *) (cd->cd_ctfdata + hp->cth_funcoff); in read_funcs()
319 const char *end = (void *) (cd->cd_ctfdata + hp->cth_typeoff); in read_funcs()
327 if (hp->cth_funcoff & 1) in read_funcs()
329 if (hp->cth_funcoff >= cd->cd_ctflen) in read_funcs()
331 if (hp->cth_typeoff >= cd->cd_ctflen) in read_funcs()
333 if (hp->cth_funcoff > hp->cth_typeoff) in read_funcs()
340 ushort_t kind = hp->cth_version == CTF_VERSION_2 ? in read_funcs()
342 ushort_t n = hp->cth_version == CTF_VERSION_2 ? in read_funcs()
401 read_types(const ctf_header_t *hp, const ctf_data_t *cd) in read_types() argument
403 const char *v = (void *) (cd->cd_ctfdata + hp->cth_typeoff); in read_types()
404 const char *end = (void *) (cd->cd_ctfdata + hp->cth_stroff); in read_types()
411 if (hp->cth_typeoff & 3) in read_types()
413 if (hp->cth_typeoff >= cd->cd_ctflen) in read_types()
415 if (hp->cth_stroff >= cd->cd_ctflen) in read_types()
417 if (hp->cth_typeoff > hp->cth_stroff) in read_types()
420 version = hp->cth_version; in read_types()
423 if (hp->cth_parlabel || hp->cth_parname) in read_types()
424 id += 1ul << (hp->cth_version == CTF_VERSION_2 ? in read_types()
492 " bits=%u", ref_to_str(name, hp, cd), in read_types()
507 "bits=%u", ref_to_str(name, hp, cd), in read_types()
519 ref_to_str(name, hp, cd), type); in read_types()
537 "nelems: %u\n", ref_to_str(name, hp, cd), in read_types()
552 ref_to_str(name, hp, cd), type); in read_types()
595 ref_to_str(name, hp, cd), size); in read_types()
603 hp, cd), u.lmp2->ctlm_type, in read_types()
612 hp, cd), u.mp2->ctm_type, in read_types()
622 hp, cd), u.lmp3->ctlm_type, in read_types()
631 hp, cd), u.mp3->ctm_type, in read_types()
652 ref_to_str(name, hp, cd)); in read_types()
656 ref_to_str(u.ep->cte_name, hp, cd), in read_types()
670 ref_to_str(name, hp, cd)); in read_types()
677 ref_to_str(name, hp, cd), type); in read_types()
684 ref_to_str(name, hp, cd), type); in read_types()
691 ref_to_str(name, hp, cd), type); in read_types()
698 ref_to_str(name, hp, cd), type); in read_types()
723 read_strtab(const ctf_header_t *hp, const ctf_data_t *cd) in read_strtab() argument
725 size_t n, off, len = hp->cth_strlen; in read_strtab()
726 const char *s = cd->cd_ctfdata + hp->cth_stroff; in read_strtab()
731 if (hp->cth_stroff >= cd->cd_ctflen) in read_strtab()
733 if (hp->cth_stroff + hp->cth_strlen > cd->cd_ctflen) in read_strtab()
903 ctf_header_t *hp = NULL; in main() local
1029 hp = v; in main()
1048 if (hp->cth_flags & CTF_F_COMPRESS) { in main()
1053 if ((buf = malloc(hp->cth_stroff + hp->cth_strlen)) == NULL) in main()
1060 zstr.avail_out = hp->cth_stroff + hp->cth_strlen; in main()
1071 if (zstr.total_out != hp->cth_stroff + hp->cth_strlen) in main()
1075 cd.cd_ctflen = hp->cth_stroff + hp->cth_strlen; in main()
1079 error |= print_header(hp, &cd); in main()
1081 error |= print_labeltable(hp, &cd); in main()
1083 error |= read_data(hp, &cd); in main()
1085 error |= read_funcs(hp, &cd); in main()
1087 error |= read_types(hp, &cd); in main()
1089 error |= read_strtab(hp, &cd); in main()
1101 bcopy(hp, &h, sizeof (h)); in main()