From: Paul Floyd Date: Sat, 17 Jan 2026 15:59:19 +0000 (+0100) Subject: VG_(fcntl) error message and comments X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=edd47cc583df962be308ce178c5c76ac67a65078;p=thirdparty%2Fvalgrind.git VG_(fcntl) error message and comments And the fcntl command to the VG_(fcntl) error message. Clean up a few comments. --- diff --git a/coregrind/m_aspacemgr/aspacemgr-linux.c b/coregrind/m_aspacemgr/aspacemgr-linux.c index 3bc5cb044..ae9846e54 100644 --- a/coregrind/m_aspacemgr/aspacemgr-linux.c +++ b/coregrind/m_aspacemgr/aspacemgr-linux.c @@ -4443,8 +4443,8 @@ static char* maybe_merge_procmap_stack(char* p, struct vki_kinfo_vmentry *kve, * The other use is at startup in order to get the mapping for the * tool itself. In this case we have a fairly big problem. There is * a difference in the mapping used when the kernel loads an exe - * and when the link loader ldrt (or Valgrind which does the same - * job for the guest exe. In the case of ldrt, all ELF PT_LOAD + * and when the link loader rtld (or Valgrind which does the same + * job for the guest exe). In the case of rtld, all ELF PT_LOAD * sections get mmap'd. The kernel, however, does _not_ mmap * the RW PT_LOAD. * diff --git a/coregrind/m_debuginfo/debuginfo.c b/coregrind/m_debuginfo/debuginfo.c index 6ed649bc2..f503fc8ee 100644 --- a/coregrind/m_debuginfo/debuginfo.c +++ b/coregrind/m_debuginfo/debuginfo.c @@ -1190,6 +1190,13 @@ ULong VG_(di_notify_mmap)( Addr a, Bool allow_SkFileV, Int use_fd ) return 0; /* If the file doesn't have a name, we're hosed. Give up. */ + /* + * Maybe not. Since bug 280965 we may have the fd, and if we + * do have the fd we use that rather than the filename to + * get ELF info. The filename is used in several places but I think + * that it is not obligatory and when we have just the fd we could + * get by. + */ filename = VG_(am_get_filename)( seg ); if (!filename) return 0; diff --git a/coregrind/m_initimg/initimg-freebsd.c b/coregrind/m_initimg/initimg-freebsd.c index 40f74168c..c871f47bb 100644 --- a/coregrind/m_initimg/initimg-freebsd.c +++ b/coregrind/m_initimg/initimg-freebsd.c @@ -850,7 +850,7 @@ static Addr setup_client_stack(const void* init_sp, } if (VG_(resolved_exename) == NULL) { - VG_(resolved_exename) = VG_(strdup)("initimg-freebsd.sre.1", resolved_name); + VG_(resolved_exename) = VG_(strdup)("initimg-freebsd.scs.1", resolved_name); } return client_SP; diff --git a/coregrind/m_libcfile.c b/coregrind/m_libcfile.c index c4e7dddc1..aecc5404b 100644 --- a/coregrind/m_libcfile.c +++ b/coregrind/m_libcfile.c @@ -808,7 +808,7 @@ Int VG_(fcntl) ( Int fd, Int cmd, Addr arg ) # error "Unknown OS" # endif if (sr_isError(res)) { - VG_(debugLog)(1, "VG_(fcntl)", "fcntl error %lu %s\n", sr_Err(res), VG_(strerror)(sr_Err(res))); + VG_(debugLog)(1, "VG_(fcntl)", "fcntl cmd %d error %lu %s\n", cmd, sr_Err(res), VG_(strerror)(sr_Err(res))); return -1; } return (Int)sr_Res(res);