< prev index next >
src/jdk.hotspot.agent/macosx/native/libsaproc/ps_core.c
Print this page
*** 246,256 ****
lseek(fd, -sizeof(load_command), SEEK_CUR);
if (read(fd, (void *)&segcmd, sizeof(segment_command_64)) != sizeof(segment_command_64)) {
print_debug("failed to read LC_SEGMENT_64 i = %d!\n", i);
goto err;
}
! if (add_map_info(ph, fd, segcmd.fileoff, segcmd.vmaddr, segcmd.vmsize) == NULL) {
print_debug("Failed to add map_info at i = %d\n", i);
goto err;
}
print_debug("LC_SEGMENT_64 added: nsects=%d fileoff=0x%llx vmaddr=0x%llx vmsize=0x%llx filesize=0x%llx %s\n",
segcmd.nsects, segcmd.fileoff, segcmd.vmaddr, segcmd.vmsize,
--- 246,256 ----
lseek(fd, -sizeof(load_command), SEEK_CUR);
if (read(fd, (void *)&segcmd, sizeof(segment_command_64)) != sizeof(segment_command_64)) {
print_debug("failed to read LC_SEGMENT_64 i = %d!\n", i);
goto err;
}
! if (add_map_info(ph, fd, segcmd.fileoff, segcmd.vmaddr, segcmd.vmsize, segcmd.flags) == NULL) {
print_debug("Failed to add map_info at i = %d\n", i);
goto err;
}
print_debug("LC_SEGMENT_64 added: nsects=%d fileoff=0x%llx vmaddr=0x%llx vmsize=0x%llx filesize=0x%llx %s\n",
segcmd.nsects, segcmd.fileoff, segcmd.vmaddr, segcmd.vmsize,
*** 786,796 ****
break;
case PT_LOAD: {
if (core_php->p_filesz != 0) {
if (add_map_info(ph, ph->core->core_fd, core_php->p_offset,
! core_php->p_vaddr, core_php->p_filesz) == NULL) goto err;
}
break;
}
}
--- 786,796 ----
break;
case PT_LOAD: {
if (core_php->p_filesz != 0) {
if (add_map_info(ph, ph->core->core_fd, core_php->p_offset,
! core_php->p_vaddr, core_php->p_filesz, core_php->p_flags) == NULL) goto err;
}
break;
}
}
*** 825,835 ****
uintptr_t target_vaddr = lib_php->p_vaddr + lib_base;
map_info *existing_map = core_lookup(ph, target_vaddr);
if (existing_map == NULL){
if (add_map_info(ph, lib_fd, lib_php->p_offset,
! target_vaddr, lib_php->p_filesz) == NULL) {
goto err;
}
} else {
if ((existing_map->memsz != page_size) &&
(existing_map->fd != lib_fd) &&
--- 825,835 ----
uintptr_t target_vaddr = lib_php->p_vaddr + lib_base;
map_info *existing_map = core_lookup(ph, target_vaddr);
if (existing_map == NULL){
if (add_map_info(ph, lib_fd, lib_php->p_offset,
! target_vaddr, lib_php->p_filesz, lib_php->p_flags) == NULL) {
goto err;
}
} else {
if ((existing_map->memsz != page_size) &&
(existing_map->fd != lib_fd) &&
*** 891,901 ****
// add mappings for PT_LOAD segments
case PT_LOAD: {
// add only non-writable segments of non-zero filesz
if (!(exec_php->p_flags & PF_W) && exec_php->p_filesz != 0) {
! if (add_map_info(ph, ph->core->exec_fd, exec_php->p_offset, exec_php->p_vaddr, exec_php->p_filesz) == NULL) goto err;
}
break;
}
// read the interpreter and it's segments
--- 891,901 ----
// add mappings for PT_LOAD segments
case PT_LOAD: {
// add only non-writable segments of non-zero filesz
if (!(exec_php->p_flags & PF_W) && exec_php->p_filesz != 0) {
! if (add_map_info(ph, ph->core->exec_fd, exec_php->p_offset, exec_php->p_vaddr, exec_php->p_filesz, exec_php->p_flags) == NULL) goto err;
}
break;
}
// read the interpreter and it's segments
< prev index next >