Home | History | Annotate | Download | only in coredump

Lines Matching refs:phdr

212         Debug(2, "phdr[%03d]: type:%d", i, cur->p_type);
315 struct coredump_phdr *phdr = &ui->phdrs[phdr_no];
316 if (phdr->backing_filename)
329 phdr->backing_fd = fd;
330 phdr->backing_filename = strdup(filename);
338 phdr->backing_filesize = (uoff_t)statbuf.st_size;
340 if (phdr->p_flags != (PF_X | PF_R))
341 Debug(1, "Note: phdr[%u] is not r-x: flags are 0x%x\n", phdr_no, phdr->p_flags);
343 if (phdr->backing_filesize > phdr->p_memsz)
346 Debug(2, "Note: phdr[%u] is %lld bytes, file is larger: %lld bytes\n",
348 (unsigned long long)phdr->p_memsz,
349 (unsigned long long)phdr->backing_filesize
354 if (phdr->p_filesz != 0)
357 char *core_buf = malloc(phdr->p_filesz);
358 char *file_buf = malloc(phdr->p_filesz);
359 if (lseek(ui->coredump_fd, phdr->p_offset, SEEK_SET) != (off_t)phdr->p_offset
360 || (uoff_t)read(ui->coredump_fd, core_buf, phdr->p_filesz) != phdr->p_filesz
369 if ((uoff_t)read(fd, file_buf, phdr->p_filesz) != phdr->p_filesz)
374 int r = memcmp(core_buf, file_buf, phdr->p_filesz);
379 Debug(1, "Note: phdr[%u] first %lld bytes in core dump and in file do not match\n",
380 phdr_no, (unsigned long long)phdr->p_filesz
383 Debug(1, "Note: phdr[%u] first %lld bytes in core dump and in file match\n",
384 phdr_no, (unsigned long long)phdr->p_filesz
393 if (phdr->backing_fd >= 0)
395 close(phdr->backing_fd);
396 phdr->backing_fd = -1;
398 free(phdr->backing_filename);
399 phdr->backing_filename = NULL;
410 struct coredump_phdr *phdr = &ui->phdrs[i];
411 if (phdr->p_vaddr != vaddr)