Lines Matching defs:core

46  * Pcore.c - Code to initialize a ps_prochandle from a core dump.  We
47 * allocate an additional structure to hold information from the core
54 * stored in the core file and associated shared libraries. We compute the
130 lwp_info_t *lwp = list_next(&P->core->core_lwp_head);
134 for (i = 0; i < P->core->core_nlwp; i++, lwp = list_next(lwp)) {
136 P->core->core_lwp = lwp;
151 P->core->core_lwp = lwp;
152 P->core->core_nlwp++;
158 * The core file itself contains a series of NOTE segments containing saved
160 * comprehend, we define a function to read it in from the core file,
171 if (P->core->core_dmodel == PR_MODEL_ILP32) {
203 if (P->core->core_dmodel == PR_MODEL_ILP32) {
224 * the lwps which did *not* create the core will show SIGKILL. We can
225 * be assured this is bogus because SIGKILL can't produce core files.
242 if (P->core->core_dmodel == PR_MODEL_ILP32) {
274 if (P->core->core_dmodel == PR_MODEL_ILP32) {
306 if (P->core->core_platform != NULL)
316 P->core->core_platform = plat;
328 if (P->core->core_uts != NULL || nbytes < ubytes)
348 P->core->core_uts = utsp;
357 if (sizeof (P->core->core_content) != nbytes)
363 P->core->core_content = content;
365 dprintf("core content = %llx\n", content);
383 if (P->core->core_cred != NULL || nbytes < min_size)
404 P->core->core_cred = pcrp;
415 if (P->core->core_ldt != NULL || nbytes < sizeof (struct ssd))
430 P->core->core_ldt = pldt;
431 P->core->core_nldt = nldt;
441 if (P->core->core_priv != NULL || nbytes < sizeof (prpriv_t))
453 P->core->core_priv = pprvp;
454 P->core->core_priv_size = nbytes;
464 if (P->core->core_privinfo != NULL ||
478 P->core->core_privinfo = __priv_parse_info(ppii);
479 P->core->core_ppii = ppii;
488 if (P->core->core_zonename != NULL)
500 P->core->core_zonename = zonename;
512 if (P->core->core_dmodel == PR_MODEL_ILP32) {
569 lwp_info_t *lwp = P->core->core_lwp;
593 lwp_info_t *lwp = P->core->core_lwp;
608 if (P->core->core_dmodel == PR_MODEL_ILP32) {
630 lwp_info_t *lwp = P->core->core_lwp;
653 lwp_info_t *lwp = P->core->core_lwp;
686 * functions to process each type of core file note:
756 Perror_printf(P, "core file data for mapping at %p not saved: "
758 dprintf("core file data for mapping at %p not saved: %s\n",
761 } else if (php->p_filesz != 0 && php->p_offset >= P->core->core_size) {
762 Perror_printf(P, "core file may be corrupt -- data for mapping "
764 dprintf("core file may be corrupt -- data for mapping "
789 * Once we've processed more of the core file, we'll have the
822 * takes a symbol table and string table from a core file and places them
1184 * It's possible this core file came from a system that
1188 * corruption by using the knowledge that the core dump
1251 * shared library, but a large 32-bit core file can exceed 2GB in size.
1424 P->core->core_errno = errno;
1432 P->core->core_errno = errno;
1547 * Attempt to load any section headers found in the core file. If present,
1548 * this will refer to non-loadable data added to the core file by the kernel
1571 * Read the section header table from the core file and then iterate
1608 * Read the .shstrtab section from the core file, terminating it with
1690 * Main engine for core file initialization: given an fd for the core file
1709 elf_file_t core;
1727 core.e_elf = NULL;
1728 core.e_fd = core_fd;
1731 * Allocate and initialize a ps_prochandle structure for the core.
1734 * 1. The PS_DEAD state flag marks this prochandle as a core file.
1738 * 2. We keep the core file fd in P->asfd since the core file contains
1742 * core is determined by the end of this function; there is no need
1757 P->asfd = core.e_fd;
1769 * Fstat and open the core file and make sure it is a valid ELF core.
1776 if (core_elf_fdopen(&core, ET_CORE, perr) == -1)
1781 * structure. We keep all core-specific information in this structure.
1783 if ((P->core = calloc(1, sizeof (core_info_t))) == NULL) {
1788 list_link(&P->core->core_lwp_head, NULL);
1789 P->core->core_size = stbuf.st_size;
1791 * In the days before adjustable core file content, this was the
1792 * default core file content. For new core files, this value will
1795 P->core->core_content = CC_CONTENT_STACK | CC_CONTENT_HEAP |
1799 switch (core.e_hdr.e_ident[EI_CLASS]) {
1801 P->core->core_dmodel = PR_MODEL_ILP32;
1804 P->core->core_dmodel = PR_MODEL_LP64;
1812 * Because the core file may be a large file, we can't use libelf to
1815 nbytes = core.e_hdr.e_phnum * core.e_hdr.e_phentsize;
1822 if (pread64(core_fd, phbuf, nbytes, core.e_hdr.e_phoff) != nbytes) {
1829 * Iterate through the program headers in the core file.
1834 * in the core file; currently the first PT_NOTE (if present)
1837 for (php = phbuf, notes = 0, i = 0; i < core.e_hdr.e_phnum; i++) {
1838 if (core.e_hdr.e_ident[EI_CLASS] == ELFCLASS64)
1858 php = (char *)php + core.e_hdr.e_phentsize;
1867 * was present, abort. The core file is either corrupt or too old.
1989 * and the ability to read from mappings provided by the core file.
2030 if (P->core->core_dmodel == PR_MODEL_LP64)
2135 * in the core, which will allow us to construct the file info
2145 if (P->core->core_errno != 0) {
2146 errno = P->core->core_errno;
2157 core_load_shdrs(P, &core);
2183 * Grab a core file using a pathname. We just open it and call Pfgrab_core().
2186 Pgrab_core(const char *core, const char *aout, int gflag, int *perr)
2190 if ((fd = open64(core, oflag)) >= 0)