Lines Matching refs:cd

111 ref_to_str(uint_t name, const ctf_header_t *hp, const ctf_data_t *cd)  in ref_to_str()  argument
114 const char *s = cd->cd_ctfdata + hp->cth_stroff + offset; in ref_to_str()
122 if (hp->cth_stroff + offset >= cd->cd_ctflen) in ref_to_str()
182 print_header(const ctf_header_t *hp, const ctf_data_t *cd) in print_header() argument
190 ref_to_str(hp->cth_parlabel, hp, cd)); in print_header()
192 ref_to_str(hp->cth_parname, hp, cd)); in print_header()
204 print_labeltable(const ctf_header_t *hp, const ctf_data_t *cd) in print_labeltable() argument
207 const ctf_lblent_t *ctl = (ctf_lblent_t *)(cd->cd_ctfdata + 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()
224 ref_to_str(ctl->ctl_label, hp, cd)); in print_labeltable()
237 next_sym(const ctf_data_t *cd, const int symidx, const uchar_t matchtype, in next_sym() argument
242 for (i = symidx + 1; i < cd->cd_nsyms; i++) { in next_sym()
247 if (gelf_getsym(cd->cd_symdata, i, &sym) == 0) in next_sym()
250 name = (char *)cd->cd_strdata->d_buf + sym.st_name; in next_sym()
268 read_data(const ctf_header_t *hp, const ctf_data_t *cd) in read_data() argument
271 const ushort_t *idp = (ushort_t *)(cd->cd_ctfdata + hp->cth_objtoff); in read_data()
279 if (hp->cth_objtoff >= cd->cd_ctflen) in read_data()
281 if (hp->cth_funcoff >= cd->cd_ctflen) in read_data()
293 if (cd->cd_symdata == NULL || (nextsym = next_sym(cd, in read_data()
312 read_funcs(const ctf_header_t *hp, const ctf_data_t *cd) in read_funcs() argument
315 const ushort_t *fp = (ushort_t *)(cd->cd_ctfdata + hp->cth_funcoff); in read_funcs()
318 const ushort_t *end = (ushort_t *)(cd->cd_ctfdata + hp->cth_typeoff); in read_funcs()
328 if (hp->cth_funcoff >= cd->cd_ctflen) in read_funcs()
330 if (hp->cth_typeoff >= cd->cd_ctflen) in read_funcs()
343 if (cd->cd_symdata == NULL || (nextsym = next_sym(cd, symidx, in read_funcs()
389 read_types(const ctf_header_t *hp, const ctf_data_t *cd) in read_types() argument
392 const ctf_type_t *tp = (ctf_type_t *)(cd->cd_ctfdata + hp->cth_typeoff); in read_types()
395 const ctf_type_t *end = (ctf_type_t *)(cd->cd_ctfdata + hp->cth_stroff); in read_types()
404 if (hp->cth_typeoff >= cd->cd_ctflen) in read_types()
406 if (hp->cth_stroff >= cd->cd_ctflen) in read_types()
451 cd), int_encoding_to_str( in read_types()
465 cd), fp_encoding_to_str( in read_types()
476 ref_to_str(tp->ctt_name, hp, cd), in read_types()
485 hp, cd), u.ap->cta_contents, in read_types()
494 ref_to_str(tp->ctt_name, hp, cd), in read_types()
531 ref_to_str(tp->ctt_name, hp, cd), size); in read_types()
538 hp, cd), u.lmp->ctlm_type, in read_types()
546 hp, cd), u.mp->ctm_type, in read_types()
559 ref_to_str(tp->ctt_name, hp, cd)); in read_types()
563 ref_to_str(u.ep->cte_name, hp, cd), in read_types()
577 ref_to_str(tp->ctt_name, hp, cd)); in read_types()
584 ref_to_str(tp->ctt_name, hp, cd), in read_types()
592 ref_to_str(tp->ctt_name, hp, cd), in read_types()
600 ref_to_str(tp->ctt_name, hp, cd), in read_types()
608 ref_to_str(tp->ctt_name, hp, cd), in read_types()
634 read_strtab(const ctf_header_t *hp, const ctf_data_t *cd) in read_strtab() argument
637 const char *s = cd->cd_ctfdata + hp->cth_stroff; in read_strtab()
642 if (hp->cth_stroff >= cd->cd_ctflen) in read_strtab()
644 if (hp->cth_stroff + hp->cth_strlen > cd->cd_ctflen) in read_strtab()
812 ctf_data_t cd; in main() local
882 cd.cd_ctfdata = dp->d_buf; in main()
883 cd.cd_ctflen = dp->d_size; in main()
906 cd.cd_nsyms = shdr.sh_size / shdr.sh_entsize; in main()
907 cd.cd_symdata = elf_getdata(symscn, NULL); in main()
908 cd.cd_strdata = elf_getdata(symstrscn, NULL); in main()
917 cd.cd_ctflen = st.st_size; in main()
918 cd.cd_ctfdata = mmap(NULL, cd.cd_ctflen, PROT_READ, in main()
920 if (cd.cd_ctfdata == MAP_FAILED) in main()
929 if (cd.cd_ctflen < sizeof (ctf_preamble_t)) in main()
933 pp = (const ctf_preamble_t *)cd.cd_ctfdata; in main()
940 hp = (ctf_header_t *)cd.cd_ctfdata; in main()
941 cd.cd_ctfdata = (caddr_t)cd.cd_ctfdata + sizeof (ctf_header_t); in main()
943 if (cd.cd_ctflen < sizeof (ctf_header_t)) { in main()
966 zstr.next_in = (void *)cd.cd_ctfdata; in main()
967 zstr.avail_in = cd.cd_ctflen; in main()
983 cd.cd_ctfdata = buf; in main()
984 cd.cd_ctflen = hp->cth_stroff + hp->cth_strlen; in main()
988 error |= print_header(hp, &cd); in main()
990 error |= print_labeltable(hp, &cd); in main()
992 error |= read_data(hp, &cd); in main()
994 error |= read_funcs(hp, &cd); in main()
996 error |= read_types(hp, &cd); in main()
998 error |= read_strtab(hp, &cd); in main()
1015 write(ufd, cd.cd_ctfdata, cd.cd_ctflen) != cd.cd_ctflen) { in main()