Skip to content

Commit f32d474

Browse files
committed
If AutoRemoteSyscalls fails to map a file, print the file name.
1 parent 6ebf56d commit f32d474

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/AutoRemoteSyscalls.cc

+6-2
Original file line numberDiff line numberDiff line change
@@ -894,9 +894,13 @@ bool AutoRemoteSyscalls::check_syscall_result(long ret, int syscallno, bool allo
894894
extra_msg = " opening " + t->read_c_str(t->regs().arg1());
895895
} else if (is_openat_syscall(syscallno, arch()) || is_openat2_syscall(syscallno, arch())) {
896896
extra_msg = " opening " + t->read_c_str(t->regs().arg2());
897-
} else if (is_mremap_syscall(syscallno, arch()) ||
898-
is_mmap_syscall(syscallno, arch())) {
897+
} else if (is_mremap_syscall(syscallno, arch())) {
899898
AddressSpace::print_process_maps(t);
899+
} else if (is_mmap_syscall(syscallno, arch())) {
900+
AddressSpace::print_process_maps(t);
901+
if ((t->regs().arg4() & MAP_ANONYMOUS) == 0) {
902+
extra_msg = " mmapping " + t->file_name_of_fd(t->regs().arg5());
903+
}
900904
}
901905
ASSERT(t, false) << "Syscall " << syscall_name(syscallno, arch())
902906
<< " failed with errno " << errno_name(-ret) << extra_msg

0 commit comments

Comments
 (0)