]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
VG_(fcntl) error message and comments
authorPaul Floyd <pjfloyd@wanadoo.fr>
Sat, 17 Jan 2026 15:59:19 +0000 (16:59 +0100)
committerPaul Floyd <pjfloyd@wanadoo.fr>
Sat, 17 Jan 2026 16:00:20 +0000 (17:00 +0100)
And the fcntl command to the VG_(fcntl) error message.
Clean up a few comments.

coregrind/m_aspacemgr/aspacemgr-linux.c
coregrind/m_debuginfo/debuginfo.c
coregrind/m_initimg/initimg-freebsd.c
coregrind/m_libcfile.c

index 3bc5cb0441829e35b2850a5edfd8841a11270182..ae9846e54f61007b223da54926811fa7d3234d82 100644 (file)
@@ -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.
  *
index 6ed649bc27667fa4fe9ddba3f1c2478dfdb72ade..f503fc8ee3eada7d354a064e1c7fcbf2bb37af93 100644 (file)
@@ -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;
index 40f74168c90bce54713726cea8d04d803d327a62..c871f47bb20ed944808f9c8b856e4b4cb49a43f8 100644 (file)
@@ -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;
index c4e7dddc1d70bceca1ba7d5021dfbcd33833b4a2..aecc5404b9a84d36434f292fdba3688d9d60a12f 100644 (file)
@@ -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);