Lines Matching defs:pgc

459 	pgcore_t *pgc = data;
460 struct ps_prochandle *P = pgc->P;
473 if (write_note(pgc->pgc_fd, NT_PRSTATUS, &prstatus,
474 sizeof (prstatus_t), pgc->pgc_doff) != 0)
476 if (write_note(pgc->pgc_fd, NT_PRFPREG, &lsp->pr_fpreg,
477 sizeof (prfpregset_t), pgc->pgc_doff) != 0)
484 if (write_note(pgc->pgc_fd, NT_PRSTATUS, &pr32,
485 sizeof (prstatus32_t), pgc->pgc_doff) != 0)
488 if (write_note(pgc->pgc_fd, NT_PRFPREG, &pf32,
489 sizeof (prfpregset32_t), pgc->pgc_doff) != 0)
498 write_note(pgc->pgc_fd, NT_PRXREG, &xregs,
499 sizeof (prxregset_t), pgc->pgc_doff) != 0)
510 pgcore_t *pgc = data;
511 struct ps_prochandle *P = pgc->P;
520 if (write_note(pgc->pgc_fd, NT_LWPSINFO, lip,
521 sizeof (lwpsinfo_t), pgc->pgc_doff) != 0)
525 if (write_note(pgc->pgc_fd, NT_LWPSTATUS, lsp,
526 sizeof (lwpstatus_t), pgc->pgc_doff) != 0)
533 if (write_note(pgc->pgc_fd, NT_LWPSINFO, &li32,
534 sizeof (lwpsinfo32_t), pgc->pgc_doff) != 0)
539 if (write_note(pgc->pgc_fd, NT_LWPSTATUS, &ls32,
540 sizeof (lwpstatus32_t), pgc->pgc_doff) != 0)
552 if (write_note(pgc->pgc_fd, NT_PRXREG, &xregs,
553 sizeof (prxregset_t), pgc->pgc_doff) != 0)
562 if (write_note(pgc->pgc_fd, NT_GWINDOWS, &gwins, size,
563 pgc->pgc_doff) != 0)
572 if (write_note(pgc->pgc_fd, NT_ASRS, &asrs,
573 sizeof (asrset_t), pgc->pgc_doff) != 0)
587 if (write_note(pgc->pgc_fd, NT_SPYMASTER, &ps,
588 sizeof (psinfo_t), pgc->pgc_doff) != 0)
594 if (write_note(pgc->pgc_fd, NT_SPYMASTER, &ps32,
595 sizeof (psinfo32_t), pgc->pgc_doff) != 0)
616 count_sections(pgcore_t *pgc)
618 struct ps_prochandle *P = pgc->P;
623 if (!(pgc->pgc_content & (CC_CONTENT_CTF | CC_CONTENT_SYMTAB)))
632 if ((pgc->pgc_content & CC_CONTENT_CTF) &&
650 if ((pgc->pgc_content & CC_CONTENT_SYMTAB) && !hit_symtab &&
662 write_shdr(pgcore_t *pgc, shstrtype_t name, uint_t type, ulong_t flags,
666 if (pgc->P->status.pr_dmodel == PR_MODEL_ILP32) {
670 shdr.sh_name = shstrtab_ndx(&pgc->pgc_shstrtab, name);
681 if (gc_pwrite64(pgc->pgc_fd, &shdr, sizeof (shdr),
682 *pgc->pgc_soff) != 0)
685 *pgc->pgc_soff += sizeof (shdr);
691 shdr.sh_name = shstrtab_ndx(&pgc->pgc_shstrtab, name);
702 if (gc_pwrite64(pgc->pgc_fd, &shdr, sizeof (shdr),
703 *pgc->pgc_soff) != 0)
706 *pgc->pgc_soff += sizeof (shdr);
714 dump_symtab(pgcore_t *pgc, file_info_t *fptr, uint_t index, int dynsym)
728 if (gc_pwrite64(pgc->pgc_fd, sym->sym_data_pri->d_buf, size,
729 *pgc->pgc_doff) != 0)
732 if (write_shdr(pgc, symname, symtype, 0, addr, *pgc->pgc_doff, size,
737 *pgc->pgc_doff += roundup(size, 8);
740 if (gc_pwrite64(pgc->pgc_fd, sym->sym_strs, size, *pgc->pgc_doff) != 0)
743 if (write_shdr(pgc, strname, SHT_STRTAB, SHF_STRINGS, addr,
744 *pgc->pgc_doff, size, 0, 0, 1, 0) != 0)
747 *pgc->pgc_doff += roundup(size, 8);
753 dump_sections(pgcore_t *pgc)
755 struct ps_prochandle *P = pgc->P;
760 if (!(pgc->pgc_content & (CC_CONTENT_CTF | CC_CONTENT_SYMTAB)))
769 if ((pgc->pgc_content & CC_CONTENT_CTF) &&
793 if (dump_symtab(pgc, fptr, index, dynsym) != 0)
802 if (gc_pwrite64(pgc->pgc_fd, fptr->file_ctf_buf,
803 fptr->file_ctf_size, *pgc->pgc_doff) != 0)
806 if (write_shdr(pgc, STR_CTF, SHT_PROGBITS, 0,
807 fptr->file_map->map_pmap.pr_vaddr, *pgc->pgc_doff,
812 *pgc->pgc_doff += roundup(fptr->file_ctf_size, 8);
815 if ((pgc->pgc_content & CC_CONTENT_SYMTAB) && !hit_symtab &&
819 if (dump_symtab(pgc, fptr, index, 0) != 0)
832 pgcore_t *pgc = data;
833 struct ps_prochandle *P = pgc->P;
854 if (!(pgc->pgc_content & CC_CONTENT_STACK))
860 if (!(pgc->pgc_content & CC_CONTENT_HEAP))
865 if (!(pgc->pgc_content & CC_CONTENT_DISM))
868 if (!(pgc->pgc_content & CC_CONTENT_ISM))
873 if (!(pgc->pgc_content & CC_CONTENT_SHM))
878 if (!(pgc->pgc_content & CC_CONTENT_SHANON))
881 if (!(pgc->pgc_content & CC_CONTENT_SHFILE))
886 if (!(pgc->pgc_content & CC_CONTENT_ANON))
890 if (!(pgc->pgc_content & CC_CONTENT_TEXT))
894 if (!(pgc->pgc_content & CC_CONTENT_RODATA))
898 if (!(pgc->pgc_content & CC_CONTENT_DATA))
904 size_t csz = MIN(pmp->pr_size - n, pgc->pgc_chunksz);
914 if (Pread(P, pgc->pgc_chunk, csz, pmp->pr_vaddr + n) != csz ||
915 gc_pwrite64(pgc->pgc_fd, pgc->pgc_chunk, csz,
916 *pgc->pgc_doff + n) != 0) {
918 (void) gc_pwrite64(pgc->pgc_fd, &err, sizeof (err),
919 *pgc->pgc_doff);
920 *pgc->pgc_doff += roundup(sizeof (err), 8);
923 (void) ftruncate64(pgc->pgc_fd, *pgc->pgc_doff);
930 phdr.p_offset = *pgc->pgc_doff;
932 *pgc->pgc_doff += roundup(phdr.p_filesz, 8);
936 if (gc_pwrite64(pgc->pgc_fd, &phdr, sizeof (phdr),
937 *pgc->pgc_poff) != 0)
940 *pgc->pgc_poff += sizeof (phdr);
953 if (gc_pwrite64(pgc->pgc_fd, &phdr32, sizeof (phdr32),
954 *pgc->pgc_poff) != 0)
957 *pgc->pgc_poff += sizeof (phdr32);
965 write_shstrtab(struct ps_prochandle *P, pgcore_t *pgc)
967 off64_t off = *pgc->pgc_doff;
969 shstrtab_t *s = &pgc->pgc_shstrtab;
978 (void) shstrtab_ndx(&pgc->pgc_shstrtab, STR_SHSTRTAB);
989 if (gc_pwrite64(pgc->pgc_fd, str, len, off + ndx) != 0)
998 shdr.sh_name = shstrtab_ndx(&pgc->pgc_shstrtab, STR_SHSTRTAB);
1000 shdr.sh_offset = *pgc->pgc_doff;
1005 if (gc_pwrite64(pgc->pgc_fd, &shdr, sizeof (shdr),
1006 *pgc->pgc_soff) != 0)
1009 *pgc->pgc_soff += sizeof (shdr);
1015 shdr.sh_name = shstrtab_ndx(&pgc->pgc_shstrtab, STR_SHSTRTAB);
1017 shdr.sh_offset = *pgc->pgc_doff;
1022 if (gc_pwrite64(pgc->pgc_fd, &shdr, sizeof (shdr),
1023 *pgc->pgc_soff) != 0)
1026 *pgc->pgc_soff += sizeof (shdr);
1030 *pgc->pgc_doff += roundup(size, 8);
1044 pgcore_t pgc;
1063 pgc.P = P;
1064 pgc.pgc_fd = fd;
1065 pgc.pgc_poff = &poff;
1066 pgc.pgc_soff = &soff;
1067 pgc.pgc_doff = &doff;
1068 pgc.pgc_content = content;
1069 pgc.pgc_chunksz = PAGESIZE;
1070 if ((pgc.pgc_chunk = malloc(pgc.pgc_chunksz)) == NULL)
1073 shstrtab_init(&pgc.pgc_shstrtab);
1080 nshdrs = count_sections(&pgc);
1221 if (nshdrs > 0 && write_shdr(&pgc, STR_NONE, 0, 0, 0, 0,
1275 if (Plwp_iter_all(P, old_per_lwp, &pgc) != 0)
1463 if (Plwp_iter_all(P, new_per_lwp, &pgc) != 0)
1501 if (Pmapping_iter(P, dump_map, &pgc) != 0)
1504 if (dump_sections(&pgc) != 0)
1507 if (write_shstrtab(P, &pgc) != 0)
1510 free(pgc.pgc_chunk);
1519 free(pgc.pgc_chunk);