Lines Matching refs:P
98 get_saddrs(struct ps_prochandle *P, uintptr_t ehdr_start, uint_t *n) in get_saddrs() argument
103 if (P->status.pr_dmodel == PR_MODEL_ILP32) { in get_saddrs()
108 if (read_ehdr32(P, &ehdr, &phnum, ehdr_start) != 0) in get_saddrs()
114 if (Pread(P, &phdr, sizeof (phdr), a) != in get_saddrs()
136 if (read_ehdr64(P, &ehdr, &phnum, ehdr_start) != 0) in get_saddrs()
142 if (Pread(P, &phdr, sizeof (phdr), a) != in get_saddrs()
172 file_info_new(struct ps_prochandle *P, map_info_t *mptr) in file_info_new() argument
182 list_link(fptr, &P->file_head); in file_info_new()
187 P->num_files++; in file_info_new()
197 if ((fptr->file_saddrs = get_saddrs(P, mptr->map_pmap.pr_vaddr, in file_info_new()
201 mp = P->mappings; in file_info_new()
203 while (mp < P->mappings + P->map_count && i < fptr->file_nsaddrs) { in file_info_new()
243 file_info_free(struct ps_prochandle *P, file_info_t *fptr) in file_info_free() argument
284 P->num_files--; in file_info_free()
292 map_info_free(struct ps_prochandle *P, map_info_t *mptr) in map_info_free() argument
299 file_info_free(P, fptr); in map_info_free()
301 if (P->execname && mptr == P->map_exec) { in map_info_free()
302 free(P->execname); in map_info_free()
303 P->execname = NULL; in map_info_free()
305 if (P->auxv && (mptr == P->map_exec || mptr == P->map_ldso)) { in map_info_free()
306 free(P->auxv); in map_info_free()
307 P->auxv = NULL; in map_info_free()
308 P->nauxv = 0; in map_info_free()
310 if (mptr == P->map_exec) in map_info_free()
311 P->map_exec = NULL; in map_info_free()
312 if (mptr == P->map_ldso) in map_info_free()
313 P->map_ldso = NULL; in map_info_free()
324 struct ps_prochandle *P = cd; in map_iter() local
330 if ((mptr = Paddr2mptr(P, lop->rl_base)) == NULL) { in map_iter()
336 (fptr = file_info_new(P, mptr)) == NULL) { in map_iter()
344 file_info_free(P, fptr); in map_iter()
365 if (Pread_string(P, buf, sizeof (buf), lop->rl_nameaddr) > 0) { in map_iter()
373 if ((Pfindmap(P, mptr, buf, sizeof (buf)) != NULL) && in map_iter()
383 map_set(struct ps_prochandle *P, map_info_t *mptr, const char *lname) in map_set() argument
389 (fptr = file_info_new(P, mptr)) == NULL) in map_set()
396 file_info_free(P, fptr); in map_set()
412 if ((Pfindmap(P, mptr, buf, sizeof (buf)) != NULL) && in map_set()
418 load_static_maps(struct ps_prochandle *P) in load_static_maps() argument
425 if ((mptr = object_name_to_map(P, PR_LMID_EVERY, PR_OBJ_EXEC)) != NULL) in load_static_maps()
426 map_set(P, mptr, "a.out"); in load_static_maps()
432 if (Pgetauxval(P, AT_BASE) != -1L && in load_static_maps()
433 (mptr = object_name_to_map(P, PR_LMID_EVERY, PR_OBJ_LDSO)) != NULL) in load_static_maps()
434 map_set(P, mptr, "ld.so.1"); in load_static_maps()
438 Preadmaps(struct ps_prochandle *P, prmap_t **Pmapp, ssize_t *nmapp) in Preadmaps() argument
440 return (P->ops.pop_read_maps(P, Pmapp, nmapp, P->data)); in Preadmaps()
451 Pupdate_maps(struct ps_prochandle *P) in Pupdate_maps() argument
461 if (P->info_valid || P->state == PS_UNDEAD) in Pupdate_maps()
464 Preadauxvec(P); in Pupdate_maps()
466 if (Preadmaps(P, &Pmap, &nmap) != 0) in Pupdate_maps()
476 mptr = P->mappings; in Pupdate_maps()
479 oldmapcount = P->map_count; in Pupdate_maps()
505 if (P->map_exec == mptr) in Pupdate_maps()
506 P->map_exec = newp; in Pupdate_maps()
507 if (P->map_ldso == mptr) in Pupdate_maps()
508 P->map_ldso = newp; in Pupdate_maps()
523 map_info_free(P, mptr); in Pupdate_maps()
543 map_info_free(P, mptr); in Pupdate_maps()
549 if (P->mappings != NULL) in Pupdate_maps()
550 free(P->mappings); in Pupdate_maps()
551 P->mappings = newmap; in Pupdate_maps()
552 P->map_count = P->map_alloc = nmap; in Pupdate_maps()
553 P->info_valid = 1; in Pupdate_maps()
559 if (P->rap != NULL) in Pupdate_maps()
560 (void) rd_loadobj_iter(P->rap, map_iter, P); in Pupdate_maps()
568 Pupdate_syms(struct ps_prochandle *P) in Pupdate_syms() argument
573 Pupdate_maps(P); in Pupdate_syms()
575 for (i = 0, fptr = list_next(&P->file_head); i < P->num_files; in Pupdate_syms()
577 Pbuild_file_symtab(P, fptr); in Pupdate_syms()
578 (void) Pbuild_file_ctf(P, fptr); in Pupdate_syms()
590 Prd_agent(struct ps_prochandle *P) in Prd_agent() argument
592 if (P->rap == NULL && P->state != PS_DEAD && P->state != PS_IDLE) { in Prd_agent()
593 Pupdate_maps(P); in Prd_agent()
594 if (P->num_files == 0) in Prd_agent()
595 load_static_maps(P); in Prd_agent()
597 if ((P->rap = rd_new(P)) != NULL) in Prd_agent()
598 (void) rd_loadobj_iter(P->rap, map_iter, P); in Prd_agent()
600 return (P->rap); in Prd_agent()
608 Paddr_to_text_map(struct ps_prochandle *P, uintptr_t addr) in Paddr_to_text_map() argument
612 if (!P->info_valid) in Paddr_to_text_map()
613 Pupdate_maps(P); in Paddr_to_text_map()
615 if ((mptr = Paddr2mptr(P, addr)) != NULL) { in Paddr_to_text_map()
616 file_info_t *fptr = build_map_symtab(P, mptr); in Paddr_to_text_map()
641 Paddr_to_map(struct ps_prochandle *P, uintptr_t addr) in Paddr_to_map() argument
645 if (!P->info_valid) in Paddr_to_map()
646 Pupdate_maps(P); in Paddr_to_map()
648 if ((mptr = Paddr2mptr(P, addr)) != NULL) in Paddr_to_map()
659 Plmid_to_map(struct ps_prochandle *P, Lmid_t lmid, const char *name) in Plmid_to_map() argument
666 if ((mptr = object_name_to_map(P, lmid, name)) != NULL) in Plmid_to_map()
673 Pname_to_map(struct ps_prochandle *P, const char *name) in Pname_to_map() argument
675 return (Plmid_to_map(P, PR_LMID_EVERY, name)); in Pname_to_map()
679 Paddr_to_loadobj(struct ps_prochandle *P, uintptr_t addr) in Paddr_to_loadobj() argument
683 if (!P->info_valid) in Paddr_to_loadobj()
684 Pupdate_maps(P); in Paddr_to_loadobj()
686 if ((mptr = Paddr2mptr(P, addr)) == NULL) in Paddr_to_loadobj()
693 (void) build_map_symtab(P, mptr); in Paddr_to_loadobj()
699 Plmid_to_loadobj(struct ps_prochandle *P, Lmid_t lmid, const char *name) in Plmid_to_loadobj() argument
706 if ((mptr = object_name_to_map(P, lmid, name)) == NULL) in Plmid_to_loadobj()
713 (void) build_map_symtab(P, mptr); in Plmid_to_loadobj()
719 Pname_to_loadobj(struct ps_prochandle *P, const char *name) in Pname_to_loadobj() argument
721 return (Plmid_to_loadobj(P, PR_LMID_EVERY, name)); in Pname_to_loadobj()
725 Pbuild_file_ctf(struct ps_prochandle *P, file_info_t *fptr) in Pbuild_file_ctf() argument
734 Pbuild_file_symtab(P, fptr); in Pbuild_file_ctf()
803 Paddr_to_ctf(struct ps_prochandle *P, uintptr_t addr) in Paddr_to_ctf() argument
808 if (!P->info_valid) in Paddr_to_ctf()
809 Pupdate_maps(P); in Paddr_to_ctf()
811 if ((mptr = Paddr2mptr(P, addr)) == NULL || in Paddr_to_ctf()
815 return (Pbuild_file_ctf(P, fptr)); in Paddr_to_ctf()
819 Plmid_to_ctf(struct ps_prochandle *P, Lmid_t lmid, const char *name) in Plmid_to_ctf() argument
827 if ((mptr = object_name_to_map(P, lmid, name)) == NULL || in Plmid_to_ctf()
831 return (Pbuild_file_ctf(P, fptr)); in Plmid_to_ctf()
835 Pname_to_ctf(struct ps_prochandle *P, const char *name) in Pname_to_ctf() argument
837 return (Plmid_to_ctf(P, PR_LMID_EVERY, name)); in Pname_to_ctf()
841 Preadauxvec(struct ps_prochandle *P) in Preadauxvec() argument
843 if (P->auxv != NULL) { in Preadauxvec()
844 free(P->auxv); in Preadauxvec()
845 P->auxv = NULL; in Preadauxvec()
846 P->nauxv = 0; in Preadauxvec()
849 P->ops.pop_read_aux(P, &P->auxv, &P->nauxv, P->data); in Preadauxvec()
857 Pgetauxval(struct ps_prochandle *P, int type) in Pgetauxval() argument
861 if (P->auxv == NULL) in Pgetauxval()
862 Preadauxvec(P); in Pgetauxval()
864 if (P->auxv == NULL) in Pgetauxval()
867 for (auxv = P->auxv; auxv->a_type != AT_NULL; auxv++) { in Pgetauxval()
880 Pgetauxvec(struct ps_prochandle *P) in Pgetauxvec() argument
884 if (P->auxv == NULL) in Pgetauxvec()
885 Preadauxvec(P); in Pgetauxvec()
887 if (P->auxv == NULL) in Pgetauxvec()
890 return (P->auxv); in Pgetauxvec()
898 is_mapping_in_file(struct ps_prochandle *P, map_info_t *mptr, file_info_t *fptr) in is_mapping_in_file() argument
931 (fptr->file_saddrs = get_saddrs(P, in is_mapping_in_file()
952 build_map_symtab(struct ps_prochandle *P, map_info_t *mptr) in build_map_symtab() argument
959 Pbuild_file_symtab(P, fptr); in build_map_symtab()
970 for (i = 0, fptr = list_next(&P->file_head); i < P->num_files; in build_map_symtab()
973 fptr->file_lo && is_mapping_in_file(P, mptr, fptr)) { in build_map_symtab()
976 Pbuild_file_symtab(P, fptr); in build_map_symtab()
988 if ((fptr = file_info_new(P, mptr)) == NULL) in build_map_symtab()
991 if (P->map_ldso != mptr) { in build_map_symtab()
992 if (P->rap != NULL) in build_map_symtab()
993 (void) rd_loadobj_iter(P->rap, map_iter, P); in build_map_symtab()
995 (void) Prd_agent(P); in build_map_symtab()
1011 Pbuild_file_symtab(P, fptr); in build_map_symtab()
1017 read_ehdr32(struct ps_prochandle *P, Elf32_Ehdr *ehdr, uint_t *phnum, in read_ehdr32() argument
1020 if (Pread(P, ehdr, sizeof (*ehdr), addr) != sizeof (*ehdr)) in read_ehdr32()
1040 Pread(P, &shdr0, sizeof (shdr0), addr + ehdr->e_shoff) != in read_ehdr32()
1052 read_dynamic_phdr32(struct ps_prochandle *P, const Elf32_Ehdr *ehdr, in read_dynamic_phdr32() argument
1059 if (Pread(P, phdr, sizeof (*phdr), a) != sizeof (*phdr)) in read_dynamic_phdr32()
1071 read_ehdr64(struct ps_prochandle *P, Elf64_Ehdr *ehdr, uint_t *phnum, in read_ehdr64() argument
1074 if (Pread(P, ehdr, sizeof (Elf64_Ehdr), addr) != sizeof (Elf64_Ehdr)) in read_ehdr64()
1094 Pread(P, &shdr0, sizeof (shdr0), addr + ehdr->e_shoff) != in read_ehdr64()
1106 read_dynamic_phdr64(struct ps_prochandle *P, const Elf64_Ehdr *ehdr, in read_dynamic_phdr64() argument
1113 if (Pread(P, phdr, sizeof (*phdr), a) != sizeof (*phdr)) in read_dynamic_phdr64()
1160 file_differs(struct ps_prochandle *P, Elf *elf, file_info_t *fptr) in file_differs() argument
1173 if ((Pcontent(P) & (CC_CONTENT_TEXT | CC_CONTENT_DATA)) != in file_differs()
1192 if (P->status.pr_dmodel == PR_MODEL_ILP32) in file_differs()
1195 else if (P->status.pr_dmodel == PR_MODEL_LP64) in file_differs()
1222 if (P->status.pr_dmodel == PR_MODEL_ILP32) { in file_differs()
1228 if (read_ehdr32(P, &ehdr, &phnum, addr) != 0 || in file_differs()
1229 read_dynamic_phdr32(P, &ehdr, phnum, &phdr, addr) != 0) in file_differs()
1237 if (Pread(P, dynp, phdr.p_filesz, phdr.p_vaddr) != in file_differs()
1257 } else if (P->status.pr_dmodel == PR_MODEL_LP64) { in file_differs()
1263 if (read_ehdr64(P, &ehdr, &phnum, addr) != 0 || in file_differs()
1264 read_dynamic_phdr64(P, &ehdr, phnum, &phdr, addr) != 0) in file_differs()
1272 if (Pread(P, dynp, phdr.p_filesz, phdr.p_vaddr) != in file_differs()
1303 fake_elf(struct ps_prochandle *P, file_info_t *fptr) in fake_elf() argument
1312 if ((Pcontent(P) & (CC_CONTENT_TEXT | CC_CONTENT_DATA)) != in fake_elf()
1318 if (P->status.pr_dmodel == PR_MODEL_ILP32) { in fake_elf()
1322 if ((read_ehdr32(P, &ehdr, &phnum, addr) != 0) || in fake_elf()
1323 read_dynamic_phdr32(P, &ehdr, phnum, &phdr, addr) != 0) in fake_elf()
1326 elf = fake_elf32(P, fptr, addr, &ehdr, phnum, &phdr); in fake_elf()
1332 if (read_ehdr64(P, &ehdr, &phnum, addr) != 0 || in fake_elf()
1333 read_dynamic_phdr64(P, &ehdr, phnum, &phdr, addr) != 0) in fake_elf()
1336 elf = fake_elf64(P, fptr, addr, &ehdr, phnum, &phdr); in fake_elf()
1546 build_fake_elf(struct ps_prochandle *P, file_info_t *fptr, GElf_Ehdr *ehdr, in build_fake_elf() argument
1553 if ((elf = fake_elf(P, fptr)) == NULL || in build_fake_elf()
1573 Pbuild_file_symtab(struct ps_prochandle *P, file_info_t *fptr) in Pbuild_file_symtab() argument
1606 if (P->state == PS_DEAD || P->state == PS_IDLE) { in Pbuild_file_symtab()
1630 procfs_path, (int)P->pid, fptr->file_pname); in Pbuild_file_symtab()
1640 if (_libproc_incore_elf || (P->flags & INCORE)) { in Pbuild_file_symtab()
1644 if ((elf = build_fake_elf(P, fptr, &ehdr, &nshdrs, &shdata)) == in Pbuild_file_symtab()
1652 if ((elf = build_fake_elf(P, fptr, &ehdr, &nshdrs, &shdata)) == in Pbuild_file_symtab()
1669 if ((elf = build_fake_elf(P, fptr, &ehdr, &nshdrs, &shdata)) == in Pbuild_file_symtab()
1673 } else if (file_differs(P, elf, fptr)) { in Pbuild_file_symtab()
1686 if ((newelf = build_fake_elf(P, fptr, &ehdr, &nshdrs, &shdata)) in Pbuild_file_symtab()
1699 if (fptr->file_rname != NULL && P->execname != NULL && in Pbuild_file_symtab()
1700 strcmp(fptr->file_rname, P->execname) == 0) { in Pbuild_file_symtab()
1703 free(P->execname); in Pbuild_file_symtab()
1704 P->execname = NULL; in Pbuild_file_symtab()
1954 Paddr2mptr(struct ps_prochandle *P, uintptr_t addr) in Paddr2mptr() argument
1957 int hi = P->map_count - 1; in Paddr2mptr()
1964 mp = &P->mappings[mid]; in Paddr2mptr()
1984 exec_map(struct ps_prochandle *P) in exec_map() argument
1992 for (i = 0, mptr = P->mappings; i < P->map_count; i++, mptr++) { in exec_map()
2038 object_to_map(struct ps_prochandle *P, Lmid_t lmid, const char *objname) in object_to_map() argument
2049 if (P->rap == NULL) in object_to_map()
2056 for (i = 0, mp = P->mappings; i < P->map_count; i++, mp++) { in object_to_map()
2083 for (i = 0, mp = P->mappings; i < P->map_count; i++, mp++) { in object_to_map()
2114 return (P->map_exec); in object_to_map()
2120 object_name_to_map(struct ps_prochandle *P, Lmid_t lmid, const char *name) in object_name_to_map() argument
2124 if (!P->info_valid) in object_name_to_map()
2125 Pupdate_maps(P); in object_name_to_map()
2127 if (P->map_exec == NULL && ((mptr = Paddr2mptr(P, in object_name_to_map()
2128 Pgetauxval(P, AT_ENTRY))) != NULL || (mptr = exec_map(P)) != NULL)) in object_name_to_map()
2129 P->map_exec = mptr; in object_name_to_map()
2131 if (P->map_ldso == NULL && (mptr = Paddr2mptr(P, in object_name_to_map()
2132 Pgetauxval(P, AT_BASE))) != NULL) in object_name_to_map()
2133 P->map_ldso = mptr; in object_name_to_map()
2136 mptr = P->map_exec; in object_name_to_map()
2138 mptr = P->map_ldso; in object_name_to_map()
2139 else if (Prd_agent(P) != NULL || P->state == PS_IDLE) in object_name_to_map()
2140 mptr = object_to_map(P, lmid, name); in object_name_to_map()
2387 struct ps_prochandle *P, in i_Pxlookup_by_addr() argument
2406 (void) Prd_agent(P); in i_Pxlookup_by_addr()
2408 if ((mptr = Paddr2mptr(P, addr)) == NULL || /* no such address */ in i_Pxlookup_by_addr()
2409 (fptr = build_map_symtab(P, mptr)) == NULL || /* no mapped file */ in i_Pxlookup_by_addr()
2456 Pxlookup_by_addr(struct ps_prochandle *P, uintptr_t addr, char *buf, in Pxlookup_by_addr() argument
2459 return (i_Pxlookup_by_addr(P, B_FALSE, addr, buf, bufsize, symp, sip)); in Pxlookup_by_addr()
2463 Pxlookup_by_addr_resolved(struct ps_prochandle *P, uintptr_t addr, char *buf, in Pxlookup_by_addr_resolved() argument
2466 return (i_Pxlookup_by_addr(P, B_TRUE, addr, buf, bufsize, symp, sip)); in Pxlookup_by_addr_resolved()
2470 Plookup_by_addr(struct ps_prochandle *P, uintptr_t addr, char *buf, in Plookup_by_addr() argument
2473 return (i_Pxlookup_by_addr(P, B_FALSE, addr, buf, size, symp, NULL)); in Plookup_by_addr()
2484 struct ps_prochandle *P, in Pxlookup_by_name() argument
2502 (void) Prd_agent(P); in Pxlookup_by_name()
2503 cnt = P->num_files; in Pxlookup_by_name()
2504 fptr = list_next(&P->file_head); in Pxlookup_by_name()
2507 if ((mptr = object_name_to_map(P, lmid, oname)) == NULL || in Pxlookup_by_name()
2508 (fptr = build_map_symtab(P, mptr)) == NULL) in Pxlookup_by_name()
2520 Pbuild_file_symtab(P, fptr); in Pxlookup_by_name()
2581 Plookup_by_name(struct ps_prochandle *P, const char *object, in Plookup_by_name() argument
2584 return (Pxlookup_by_name(P, PR_LMID_EVERY, object, symbol, symp, NULL)); in Plookup_by_name()
2591 i_Pmapping_iter(struct ps_prochandle *P, boolean_t lmresolve, in i_Pmapping_iter() argument
2601 (void) Prd_agent(P); in i_Pmapping_iter()
2603 for (i = 0, mptr = P->mappings; i < P->map_count; i++, mptr++) { in i_Pmapping_iter()
2617 Pmapping_iter(struct ps_prochandle *P, proc_map_f *func, void *cd) in Pmapping_iter() argument
2619 return (i_Pmapping_iter(P, B_FALSE, func, cd)); in Pmapping_iter()
2623 Pmapping_iter_resolved(struct ps_prochandle *P, proc_map_f *func, void *cd) in Pmapping_iter_resolved() argument
2625 return (i_Pmapping_iter(P, B_TRUE, func, cd)); in Pmapping_iter_resolved()
2632 i_Pobject_iter(struct ps_prochandle *P, boolean_t lmresolve, in i_Pobject_iter() argument
2640 (void) Prd_agent(P); /* create file_info_t's for all the mappings */ in i_Pobject_iter()
2641 Pupdate_maps(P); in i_Pobject_iter()
2643 for (cnt = P->num_files, fptr = list_next(&P->file_head); in i_Pobject_iter()
2660 if (!P->info_valid) in i_Pobject_iter()
2661 Pupdate_maps(P); in i_Pobject_iter()
2667 Pobject_iter(struct ps_prochandle *P, proc_map_f *func, void *cd) in Pobject_iter() argument
2669 return (i_Pobject_iter(P, B_FALSE, func, cd)); in Pobject_iter()
2673 Pobject_iter_resolved(struct ps_prochandle *P, proc_map_f *func, void *cd) in Pobject_iter_resolved() argument
2675 return (i_Pobject_iter(P, B_TRUE, func, cd)); in Pobject_iter_resolved()
2679 i_Pobjname(struct ps_prochandle *P, boolean_t lmresolve, uintptr_t addr, in i_Pobjname() argument
2686 (void) Prd_agent(P); in i_Pobjname()
2688 if ((mptr = Paddr2mptr(P, addr)) == NULL) in i_Pobjname()
2700 if (Pfindmap(P, mptr, buffer, bufsize) != NULL) in i_Pobjname()
2712 Pobjname(struct ps_prochandle *P, uintptr_t addr, in Pobjname() argument
2715 return (i_Pobjname(P, B_FALSE, addr, buffer, bufsize)); in Pobjname()
2727 Pobjname_resolved(struct ps_prochandle *P, uintptr_t addr, in Pobjname_resolved() argument
2730 return (i_Pobjname(P, B_TRUE, addr, buffer, bufsize)); in Pobjname_resolved()
2738 Plmid(struct ps_prochandle *P, uintptr_t addr, Lmid_t *lmidp) in Plmid() argument
2744 (void) Prd_agent(P); in Plmid()
2746 if ((mptr = Paddr2mptr(P, addr)) != NULL && in Plmid()
2761 Psymbol_iter_com(struct ps_prochandle *P, Lmid_t lmid, const char *object_name, in Psymbol_iter_com() argument
2780 if ((mptr = object_name_to_map(P, lmid, object_name)) == NULL) in Psymbol_iter_com()
2783 if ((fptr = build_map_symtab(P, mptr)) == NULL || /* no mapped file */ in Psymbol_iter_com()
2886 Pxsymbol_iter(struct ps_prochandle *P, Lmid_t lmid, const char *object_name, in Pxsymbol_iter() argument
2889 return (Psymbol_iter_com(P, lmid, object_name, which, mask, in Pxsymbol_iter()
2894 Psymbol_iter_by_lmid(struct ps_prochandle *P, Lmid_t lmid, in Psymbol_iter_by_lmid() argument
2897 return (Psymbol_iter_com(P, lmid, object_name, which, mask, in Psymbol_iter_by_lmid()
2902 Psymbol_iter(struct ps_prochandle *P, in Psymbol_iter() argument
2905 return (Psymbol_iter_com(P, PR_LMID_EVERY, object_name, which, mask, in Psymbol_iter()
2910 Psymbol_iter_by_addr(struct ps_prochandle *P, in Psymbol_iter_by_addr() argument
2913 return (Psymbol_iter_com(P, PR_LMID_EVERY, object_name, which, mask, in Psymbol_iter_by_addr()
2918 Psymbol_iter_by_name(struct ps_prochandle *P, in Psymbol_iter_by_name() argument
2921 return (Psymbol_iter_com(P, PR_LMID_EVERY, object_name, which, mask, in Psymbol_iter_by_name()
2929 Pplatform(struct ps_prochandle *P, char *s, size_t n) in Pplatform() argument
2931 return (P->ops.pop_platform(P, s, n, P->data)); in Pplatform()
2938 Puname(struct ps_prochandle *P, struct utsname *u) in Puname() argument
2940 return (P->ops.pop_uname(P, u, P->data)); in Puname()
2948 Pinitsym(struct ps_prochandle *P) in Pinitsym() argument
2950 P->num_files = 0; in Pinitsym()
2951 list_link(&P->file_head, NULL); in Pinitsym()
2959 Preset_maps(struct ps_prochandle *P) in Preset_maps() argument
2963 if (P->rap != NULL) { in Preset_maps()
2964 rd_delete(P->rap); in Preset_maps()
2965 P->rap = NULL; in Preset_maps()
2968 if (P->execname != NULL) { in Preset_maps()
2969 free(P->execname); in Preset_maps()
2970 P->execname = NULL; in Preset_maps()
2973 if (P->auxv != NULL) { in Preset_maps()
2974 free(P->auxv); in Preset_maps()
2975 P->auxv = NULL; in Preset_maps()
2976 P->nauxv = 0; in Preset_maps()
2979 for (i = 0; i < P->map_count; i++) in Preset_maps()
2980 map_info_free(P, &P->mappings[i]); in Preset_maps()
2982 if (P->mappings != NULL) { in Preset_maps()
2983 free(P->mappings); in Preset_maps()
2984 P->mappings = NULL; in Preset_maps()
2986 P->map_count = P->map_alloc = 0; in Preset_maps()
2988 P->info_valid = 0; in Preset_maps()
3000 getenv_func(void *data, struct ps_prochandle *P, uintptr_t addr, in getenv_func() argument
3022 Pgetenv(struct ps_prochandle *P, const char *name, char *buf, size_t buflen) in Pgetenv() argument
3031 if (Penv_iter(P, getenv_func, &d) == 1) { in Pgetenv()
3050 Penv_iter(struct ps_prochandle *P, proc_env_f *func, void *data) in Penv_iter() argument
3066 if ((psp = Ppsinfo(P)) == NULL) in Penv_iter()
3071 if (Plookup_by_name(P, PR_OBJ_EXEC, "_environ", &sym) == 0) { in Penv_iter()
3072 if (P->status.pr_dmodel == PR_MODEL_NATIVE) { in Penv_iter()
3073 if (Pread(P, &envpoff, sizeof (envpoff), in Penv_iter()
3076 } else if (P->status.pr_dmodel == PR_MODEL_ILP32) { in Penv_iter()
3079 if (Pread(P, &envpoff32, sizeof (envpoff32), in Penv_iter()
3096 if (P->status.pr_dmodel == PR_MODEL_NATIVE) { in Penv_iter()
3097 if (Pread(P, envp, in Penv_iter()
3102 } else if (P->status.pr_dmodel == PR_MODEL_ILP32) { in Penv_iter()
3107 if (Pread(P, e32, sizeof (e32), envpoff) <= 0) { in Penv_iter()
3124 ret = Pread_string(P, buf, buflen, envoff); in Penv_iter()
3142 if ((ret = func(data, P, envoff, nameval)) != 0) in Penv_iter()
3145 envpoff += (P->status.pr_dmodel == PR_MODEL_LP64)? 8 : 4; in Penv_iter()